@mastra/upstash 0.1.6-alpha.1 → 0.1.6-alpha.3
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.
- package/.turbo/turbo-build.log +11 -6
- package/CHANGELOG.md +25 -0
- package/README.md +20 -1
- package/dist/_tsup-dts-rollup.d.cts +133 -0
- package/dist/_tsup-dts-rollup.d.ts +12 -8
- package/dist/index.cjs +480 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.js +8 -4
- package/package.json +9 -5
- package/src/storage/upstash.test.ts +332 -330
- package/src/vector/filter.ts +5 -5
- package/src/vector/index.test.ts +440 -150
- package/src/vector/index.ts +20 -21
package/src/vector/filter.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseFilterTranslator } from '@mastra/core/filter';
|
|
2
|
-
import type {
|
|
1
|
+
import { BaseFilterTranslator } from '@mastra/core/vector/filter';
|
|
2
|
+
import type { FieldCondition, OperatorSupport, VectorFilter } from '@mastra/core/vector/filter';
|
|
3
3
|
|
|
4
4
|
export class UpstashFilterTranslator extends BaseFilterTranslator {
|
|
5
5
|
protected override getSupportedOperators(): OperatorSupport {
|
|
@@ -11,13 +11,13 @@ export class UpstashFilterTranslator extends BaseFilterTranslator {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
translate(filter?:
|
|
14
|
+
translate(filter?: VectorFilter): string | undefined {
|
|
15
15
|
if (this.isEmpty(filter)) return undefined;
|
|
16
|
-
this.validateFilter(filter
|
|
16
|
+
this.validateFilter(filter);
|
|
17
17
|
return this.translateNode(filter);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
private translateNode(node:
|
|
20
|
+
private translateNode(node: VectorFilter | FieldCondition, path: string = ''): string {
|
|
21
21
|
if (this.isRegex(node)) {
|
|
22
22
|
throw new Error('Direct regex pattern format is not supported in Upstash');
|
|
23
23
|
}
|