@mastra/vectorize 0.10.3-alpha.0 → 0.11.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,22 @@
1
1
  import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
+ import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
2
3
  import Cloudflare from 'cloudflare';
3
4
  import type { CreateIndexParams } from '@mastra/core/vector';
4
5
  import type { DeleteIndexParams } from '@mastra/core/vector';
5
6
  import type { DeleteVectorParams } from '@mastra/core/vector';
6
7
  import type { DescribeIndexParams } from '@mastra/core/vector';
7
8
  import type { IndexStats } from '@mastra/core/vector';
9
+ import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
8
10
  import { MastraVector } from '@mastra/core/vector';
9
11
  import type { OperatorSupport } from '@mastra/core/vector/filter';
12
+ import type { OperatorValueMap } from '@mastra/core/vector/filter';
10
13
  import type { QueryResult } from '@mastra/core/vector';
11
14
  import type { QueryVectorParams } from '@mastra/core/vector';
12
15
  import type { UpdateVectorParams } from '@mastra/core/vector';
13
16
  import type { UpsertVectorParams } from '@mastra/core/vector';
14
17
  import type { VectorFilter } from '@mastra/core/vector/filter';
15
18
 
16
- declare class CloudflareVector extends MastraVector {
19
+ declare class CloudflareVector extends MastraVector<VectorizeVectorFilter> {
17
20
  client: Cloudflare;
18
21
  accountId: string;
19
22
  constructor({ accountId, apiToken }: {
@@ -22,9 +25,9 @@ declare class CloudflareVector extends MastraVector {
22
25
  });
23
26
  get indexSeparator(): string;
24
27
  upsert({ indexName, vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
25
- transformFilter(filter?: VectorFilter): VectorFilter;
28
+ transformFilter(filter?: VectorizeVectorFilter): VectorizeVectorFilter;
26
29
  createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
27
- query({ indexName, queryVector, topK, filter, includeVector, }: QueryVectorParams): Promise<QueryResult[]>;
30
+ query({ indexName, queryVector, topK, filter, includeVector, }: VectorizeQueryParams): Promise<QueryResult[]>;
28
31
  listIndexes(): Promise<string[]>;
29
32
  /**
30
33
  * Retrieves statistics about a vector index.
@@ -68,10 +71,20 @@ declare const VECTORIZE_PROMPT = "When querying Vectorize, you can ONLY use the
68
71
  export { VECTORIZE_PROMPT }
69
72
  export { VECTORIZE_PROMPT as VECTORIZE_PROMPT_alias_1 }
70
73
 
71
- export declare class VectorizeFilterTranslator extends BaseFilterTranslator {
74
+ declare type VectorizeBlacklistedRootOperators = BlacklistedRootOperators | '$nor' | '$not' | '$and' | '$or';
75
+
76
+ export declare class VectorizeFilterTranslator extends BaseFilterTranslator<VectorizeVectorFilter> {
72
77
  protected getSupportedOperators(): OperatorSupport;
73
- translate(filter?: VectorFilter): VectorFilter;
78
+ translate(filter?: VectorizeVectorFilter): VectorizeVectorFilter;
74
79
  private translateNode;
75
80
  }
76
81
 
82
+ declare type VectorizeLogicalOperatorValueMap = Omit<LogicalOperatorValueMap, '$nor' | '$not' | '$and' | '$or'>;
83
+
84
+ declare type VectorizeOperatorValueMap = Omit<OperatorValueMap, '$regex' | '$options' | '$exists' | '$elemMatch' | '$all'>;
85
+
86
+ declare type VectorizeQueryParams = QueryVectorParams<VectorizeVectorFilter>;
87
+
88
+ export declare type VectorizeVectorFilter = VectorFilter<keyof VectorizeOperatorValueMap, VectorizeOperatorValueMap, VectorizeLogicalOperatorValueMap, VectorizeBlacklistedRootOperators>;
89
+
77
90
  export { }
@@ -1,19 +1,22 @@
1
1
  import { BaseFilterTranslator } from '@mastra/core/vector/filter';
2
+ import type { BlacklistedRootOperators } from '@mastra/core/vector/filter';
2
3
  import Cloudflare from 'cloudflare';
3
4
  import type { CreateIndexParams } from '@mastra/core/vector';
4
5
  import type { DeleteIndexParams } from '@mastra/core/vector';
5
6
  import type { DeleteVectorParams } from '@mastra/core/vector';
6
7
  import type { DescribeIndexParams } from '@mastra/core/vector';
7
8
  import type { IndexStats } from '@mastra/core/vector';
9
+ import type { LogicalOperatorValueMap } from '@mastra/core/vector/filter';
8
10
  import { MastraVector } from '@mastra/core/vector';
9
11
  import type { OperatorSupport } from '@mastra/core/vector/filter';
12
+ import type { OperatorValueMap } from '@mastra/core/vector/filter';
10
13
  import type { QueryResult } from '@mastra/core/vector';
11
14
  import type { QueryVectorParams } from '@mastra/core/vector';
12
15
  import type { UpdateVectorParams } from '@mastra/core/vector';
13
16
  import type { UpsertVectorParams } from '@mastra/core/vector';
14
17
  import type { VectorFilter } from '@mastra/core/vector/filter';
15
18
 
16
- declare class CloudflareVector extends MastraVector {
19
+ declare class CloudflareVector extends MastraVector<VectorizeVectorFilter> {
17
20
  client: Cloudflare;
18
21
  accountId: string;
19
22
  constructor({ accountId, apiToken }: {
@@ -22,9 +25,9 @@ declare class CloudflareVector extends MastraVector {
22
25
  });
23
26
  get indexSeparator(): string;
24
27
  upsert({ indexName, vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
25
- transformFilter(filter?: VectorFilter): VectorFilter;
28
+ transformFilter(filter?: VectorizeVectorFilter): VectorizeVectorFilter;
26
29
  createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
27
- query({ indexName, queryVector, topK, filter, includeVector, }: QueryVectorParams): Promise<QueryResult[]>;
30
+ query({ indexName, queryVector, topK, filter, includeVector, }: VectorizeQueryParams): Promise<QueryResult[]>;
28
31
  listIndexes(): Promise<string[]>;
29
32
  /**
30
33
  * Retrieves statistics about a vector index.
@@ -68,10 +71,20 @@ declare const VECTORIZE_PROMPT = "When querying Vectorize, you can ONLY use the
68
71
  export { VECTORIZE_PROMPT }
69
72
  export { VECTORIZE_PROMPT as VECTORIZE_PROMPT_alias_1 }
70
73
 
71
- export declare class VectorizeFilterTranslator extends BaseFilterTranslator {
74
+ declare type VectorizeBlacklistedRootOperators = BlacklistedRootOperators | '$nor' | '$not' | '$and' | '$or';
75
+
76
+ export declare class VectorizeFilterTranslator extends BaseFilterTranslator<VectorizeVectorFilter> {
72
77
  protected getSupportedOperators(): OperatorSupport;
73
- translate(filter?: VectorFilter): VectorFilter;
78
+ translate(filter?: VectorizeVectorFilter): VectorizeVectorFilter;
74
79
  private translateNode;
75
80
  }
76
81
 
82
+ declare type VectorizeLogicalOperatorValueMap = Omit<LogicalOperatorValueMap, '$nor' | '$not' | '$and' | '$or'>;
83
+
84
+ declare type VectorizeOperatorValueMap = Omit<OperatorValueMap, '$regex' | '$options' | '$exists' | '$elemMatch' | '$all'>;
85
+
86
+ declare type VectorizeQueryParams = QueryVectorParams<VectorizeVectorFilter>;
87
+
88
+ export declare type VectorizeVectorFilter = VectorFilter<keyof VectorizeOperatorValueMap, VectorizeOperatorValueMap, VectorizeLogicalOperatorValueMap, VectorizeBlacklistedRootOperators>;
89
+
77
90
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/vectorize",
3
- "version": "0.10.3-alpha.0",
3
+ "version": "0.11.0-alpha.2",
4
4
  "description": "Cloudflare Vectorize store provider for Mastra",
5
5
  "type": "module",
6
6
  "files": [
@@ -23,21 +23,21 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
- "cloudflare": "^4.3.0"
26
+ "cloudflare": "^4.4.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@microsoft/api-extractor": "^7.52.8",
30
30
  "@types/node": "^20.19.0",
31
31
  "dotenv": "^16.5.0",
32
- "eslint": "^9.28.0",
32
+ "eslint": "^9.29.0",
33
33
  "tsup": "^8.5.0",
34
34
  "typescript": "^5.8.3",
35
35
  "vitest": "^3.2.3",
36
- "@internal/lint": "0.0.13",
37
- "@mastra/core": "0.10.7-alpha.1"
36
+ "@mastra/core": "0.10.7-alpha.5",
37
+ "@internal/lint": "0.0.13"
38
38
  },
39
39
  "peerDependencies": {
40
- "@mastra/core": ">=0.10.4-0 <0.11.0"
40
+ "@mastra/core": ">=0.10.7-0 <0.11.0-0"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",