Skip to content

Commit 27e886d

Browse files
committed
VS-461: Fix Vectorize Metadata filter type definitions
1 parent 8204ad3 commit 27e886d

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

src/cloudflare/internal/vectorize.d.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
/*****************************
66
*
7-
* NOTE: this is copy & pasted from the types/ folder, as when bazel
8-
* runs it doesn't have access to that directly and thusly is sad.
7+
* !!! WARNING !!!
8+
* Changes should be made in `types/defines/vectorize.d.ts`
9+
* and then synced back here.
10+
*
11+
* This files was is copy & pasted from the types/ folder 2 years ago
12+
* because when bazel runs it doesn't have access to that directly (and thusly is sad).
913
* TODO: come up with a better system for this.
1014
*
1115
****************************** /
@@ -291,3 +295,15 @@ declare abstract class Vectorize {
291295
*/
292296
getByIds(ids: string[]): Promise<VectorizeVector[]>;
293297
}
298+
299+
/*****************************
300+
*
301+
* !!! WARNING !!!
302+
* Changes should be made in `types/defines/vectorize.d.ts`
303+
* and then synced back here.
304+
*
305+
* This files was is copy & pasted from the types/ folder 2 years ago
306+
* because when bazel runs it doesn't have access to that directly (and thusly is sad).
307+
* TODO: come up with a better system for this.
308+
*
309+
******************************/

types/defines/vectorize.d.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ interface VectorizeError {
2525
*
2626
* This list is expected to grow as support for more operations are released.
2727
*/
28-
type VectorizeVectorMetadataFilterOp = "$eq" | "$ne";
28+
type VectorizeVectorMetadataFilterOp =
29+
| '$eq'
30+
| '$ne'
31+
| '$lt'
32+
| '$lte'
33+
| '$gt'
34+
| '$gte';
35+
type VectorizeVectorMetadataFilterCollectionOp = '$in' | '$nin';
2936

3037
/**
3138
* Filter criteria for vector metadata used to limit the retrieved query result set.
@@ -39,6 +46,12 @@ type VectorizeVectorMetadataFilter = {
3946
VectorizeVectorMetadataValue,
4047
string[]
4148
> | null;
49+
}
50+
| {
51+
[Op in VectorizeVectorMetadataFilterCollectionOp]?: Exclude<
52+
VectorizeVectorMetadataValue,
53+
string[]
54+
>[];
4255
};
4356
};
4457

0 commit comments

Comments
 (0)