@mastra/upstash 1.5.0 → 1.5.1-alpha.1
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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/vector/filter.d.ts.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { BackgroundTasksStorage, MastraCompositeStore, MemoryStorage, ScoresStor
|
|
|
4
4
|
import { ErrorCategory, ErrorDomain, MastraError } from "@mastra/core/error";
|
|
5
5
|
import { MessageList } from "@mastra/core/agent";
|
|
6
6
|
import { saveScorePayloadSchema } from "@mastra/core/evals";
|
|
7
|
-
import { randomUUID } from "crypto";
|
|
8
7
|
import { MastraVector } from "@mastra/core/vector";
|
|
9
8
|
import { Index } from "@upstash/vector";
|
|
10
9
|
import { BaseFilterTranslator } from "@mastra/core/vector/filter";
|
|
@@ -2175,6 +2174,7 @@ var UpstashFilterTranslator = class extends BaseFilterTranslator {
|
|
|
2175
2174
|
if (op === "$contains") return `${path} NOT CONTAINS ${this.formatValue(val)}`;
|
|
2176
2175
|
if (op === "$regex") return `${path} NOT GLOB ${this.formatValue(val)}`;
|
|
2177
2176
|
if (op === "$in") return `${path} NOT IN (${this.formatArray(val)})`;
|
|
2177
|
+
if (op === "$nin") return `${path} IN (${this.formatArray(val)})`;
|
|
2178
2178
|
if (op === "$exists") return val ? `HAS NOT FIELD ${path}` : `HAS FIELD ${path}`;
|
|
2179
2179
|
if (op === "$and" || op === "$or") {
|
|
2180
2180
|
const newOp = op === "$and" ? "$or" : "$and";
|
|
@@ -2239,7 +2239,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2239
2239
|
* @returns {Promise<string[]>} A promise that resolves to the IDs of the upserted vectors.
|
|
2240
2240
|
*/
|
|
2241
2241
|
async upsert({ indexName: namespace, vectors, metadata, ids, sparseVectors }) {
|
|
2242
|
-
const generatedIds = ids || vectors.map(() => randomUUID());
|
|
2242
|
+
const generatedIds = ids || vectors.map(() => globalThis.crypto.randomUUID());
|
|
2243
2243
|
const points = vectors.map((vector, index) => ({
|
|
2244
2244
|
id: generatedIds[index],
|
|
2245
2245
|
vector,
|