@mastra/upstash 1.0.0-beta.3 → 1.0.0-beta.4
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/CHANGELOG.md +31 -0
- package/dist/index.cjs +45 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -45
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +20 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MastraStorage, StoreOperations, ScoresStorage, TABLE_SCORERS, normalizePerPage, calculatePagination, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, MemoryStorage, TABLE_THREADS, TABLE_RESOURCES, TABLE_MESSAGES, serializeDate, transformScoreRow as transformScoreRow$1 } from '@mastra/core/storage';
|
|
1
|
+
import { MastraStorage, createVectorErrorId, StoreOperations, createStorageErrorId, ScoresStorage, TABLE_SCORERS, normalizePerPage, calculatePagination, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, MemoryStorage, TABLE_THREADS, TABLE_RESOURCES, TABLE_MESSAGES, serializeDate, transformScoreRow as transformScoreRow$1 } from '@mastra/core/storage';
|
|
2
2
|
import { Redis } from '@upstash/redis';
|
|
3
3
|
import { MessageList } from '@mastra/core/agent';
|
|
4
4
|
import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
|
|
@@ -79,7 +79,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
79
79
|
} catch (error) {
|
|
80
80
|
throw new MastraError(
|
|
81
81
|
{
|
|
82
|
-
id: "
|
|
82
|
+
id: createStorageErrorId("UPSTASH", "GET_THREAD_BY_ID", "FAILED"),
|
|
83
83
|
domain: ErrorDomain.STORAGE,
|
|
84
84
|
category: ErrorCategory.THIRD_PARTY,
|
|
85
85
|
details: {
|
|
@@ -97,7 +97,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
97
97
|
if (page < 0) {
|
|
98
98
|
throw new MastraError(
|
|
99
99
|
{
|
|
100
|
-
id: "
|
|
100
|
+
id: createStorageErrorId("UPSTASH", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
101
101
|
domain: ErrorDomain.STORAGE,
|
|
102
102
|
category: ErrorCategory.USER,
|
|
103
103
|
details: { page }
|
|
@@ -139,7 +139,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
139
139
|
} catch (error) {
|
|
140
140
|
const mastraError = new MastraError(
|
|
141
141
|
{
|
|
142
|
-
id: "
|
|
142
|
+
id: createStorageErrorId("UPSTASH", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
143
143
|
domain: ErrorDomain.STORAGE,
|
|
144
144
|
category: ErrorCategory.THIRD_PARTY,
|
|
145
145
|
details: {
|
|
@@ -171,7 +171,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
171
171
|
} catch (error) {
|
|
172
172
|
const mastraError = new MastraError(
|
|
173
173
|
{
|
|
174
|
-
id: "
|
|
174
|
+
id: createStorageErrorId("UPSTASH", "SAVE_THREAD", "FAILED"),
|
|
175
175
|
domain: ErrorDomain.STORAGE,
|
|
176
176
|
category: ErrorCategory.THIRD_PARTY,
|
|
177
177
|
details: {
|
|
@@ -193,7 +193,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
193
193
|
const thread = await this.getThreadById({ threadId: id });
|
|
194
194
|
if (!thread) {
|
|
195
195
|
throw new MastraError({
|
|
196
|
-
id: "
|
|
196
|
+
id: createStorageErrorId("UPSTASH", "UPDATE_THREAD", "FAILED"),
|
|
197
197
|
domain: ErrorDomain.STORAGE,
|
|
198
198
|
category: ErrorCategory.USER,
|
|
199
199
|
text: `Thread ${id} not found`,
|
|
@@ -216,7 +216,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
216
216
|
} catch (error) {
|
|
217
217
|
throw new MastraError(
|
|
218
218
|
{
|
|
219
|
-
id: "
|
|
219
|
+
id: createStorageErrorId("UPSTASH", "UPDATE_THREAD", "FAILED"),
|
|
220
220
|
domain: ErrorDomain.STORAGE,
|
|
221
221
|
category: ErrorCategory.THIRD_PARTY,
|
|
222
222
|
details: {
|
|
@@ -245,7 +245,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
245
245
|
} catch (error) {
|
|
246
246
|
throw new MastraError(
|
|
247
247
|
{
|
|
248
|
-
id: "
|
|
248
|
+
id: createStorageErrorId("UPSTASH", "DELETE_THREAD", "FAILED"),
|
|
249
249
|
domain: ErrorDomain.STORAGE,
|
|
250
250
|
category: ErrorCategory.THIRD_PARTY,
|
|
251
251
|
details: {
|
|
@@ -271,7 +271,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
271
271
|
} catch (error) {
|
|
272
272
|
throw new MastraError(
|
|
273
273
|
{
|
|
274
|
-
id: "
|
|
274
|
+
id: createStorageErrorId("UPSTASH", "SAVE_MESSAGES", "INVALID_ARGS"),
|
|
275
275
|
domain: ErrorDomain.STORAGE,
|
|
276
276
|
category: ErrorCategory.USER
|
|
277
277
|
},
|
|
@@ -341,7 +341,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
341
341
|
} catch (error) {
|
|
342
342
|
throw new MastraError(
|
|
343
343
|
{
|
|
344
|
-
id: "
|
|
344
|
+
id: createStorageErrorId("UPSTASH", "SAVE_MESSAGES", "FAILED"),
|
|
345
345
|
domain: ErrorDomain.STORAGE,
|
|
346
346
|
category: ErrorCategory.THIRD_PARTY,
|
|
347
347
|
details: {
|
|
@@ -467,7 +467,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
467
467
|
} catch (error) {
|
|
468
468
|
throw new MastraError(
|
|
469
469
|
{
|
|
470
|
-
id: "
|
|
470
|
+
id: createStorageErrorId("UPSTASH", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
471
471
|
domain: ErrorDomain.STORAGE,
|
|
472
472
|
category: ErrorCategory.THIRD_PARTY,
|
|
473
473
|
details: {
|
|
@@ -484,7 +484,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
484
484
|
if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
|
|
485
485
|
throw new MastraError(
|
|
486
486
|
{
|
|
487
|
-
id: "
|
|
487
|
+
id: createStorageErrorId("UPSTASH", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
488
488
|
domain: ErrorDomain.STORAGE,
|
|
489
489
|
category: ErrorCategory.THIRD_PARTY,
|
|
490
490
|
details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
|
|
@@ -498,7 +498,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
498
498
|
if (page < 0) {
|
|
499
499
|
throw new MastraError(
|
|
500
500
|
{
|
|
501
|
-
id: "
|
|
501
|
+
id: createStorageErrorId("UPSTASH", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
502
502
|
domain: ErrorDomain.STORAGE,
|
|
503
503
|
category: ErrorCategory.USER,
|
|
504
504
|
details: { page }
|
|
@@ -601,7 +601,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
601
601
|
} catch (error) {
|
|
602
602
|
const mastraError = new MastraError(
|
|
603
603
|
{
|
|
604
|
-
id: "
|
|
604
|
+
id: createStorageErrorId("UPSTASH", "LIST_MESSAGES", "FAILED"),
|
|
605
605
|
domain: ErrorDomain.STORAGE,
|
|
606
606
|
category: ErrorCategory.THIRD_PARTY,
|
|
607
607
|
details: {
|
|
@@ -792,7 +792,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
792
792
|
} catch (error) {
|
|
793
793
|
throw new MastraError(
|
|
794
794
|
{
|
|
795
|
-
id: "
|
|
795
|
+
id: createStorageErrorId("UPSTASH", "UPDATE_MESSAGES", "FAILED"),
|
|
796
796
|
domain: ErrorDomain.STORAGE,
|
|
797
797
|
category: ErrorCategory.THIRD_PARTY,
|
|
798
798
|
details: {
|
|
@@ -871,7 +871,7 @@ var StoreMemoryUpstash = class extends MemoryStorage {
|
|
|
871
871
|
} catch (error) {
|
|
872
872
|
throw new MastraError(
|
|
873
873
|
{
|
|
874
|
-
id: "
|
|
874
|
+
id: createStorageErrorId("UPSTASH", "DELETE_MESSAGES", "FAILED"),
|
|
875
875
|
domain: ErrorDomain.STORAGE,
|
|
876
876
|
category: ErrorCategory.THIRD_PARTY,
|
|
877
877
|
details: { messageIds: messageIds.join(", ") }
|
|
@@ -916,7 +916,7 @@ var StoreOperationsUpstash = class extends StoreOperations {
|
|
|
916
916
|
} catch (error) {
|
|
917
917
|
throw new MastraError(
|
|
918
918
|
{
|
|
919
|
-
id: "
|
|
919
|
+
id: createStorageErrorId("UPSTASH", "CLEAR_TABLE", "FAILED"),
|
|
920
920
|
domain: ErrorDomain.STORAGE,
|
|
921
921
|
category: ErrorCategory.THIRD_PARTY,
|
|
922
922
|
details: {
|
|
@@ -937,7 +937,7 @@ var StoreOperationsUpstash = class extends StoreOperations {
|
|
|
937
937
|
} catch (error) {
|
|
938
938
|
throw new MastraError(
|
|
939
939
|
{
|
|
940
|
-
id: "
|
|
940
|
+
id: createStorageErrorId("UPSTASH", "INSERT", "FAILED"),
|
|
941
941
|
domain: ErrorDomain.STORAGE,
|
|
942
942
|
category: ErrorCategory.THIRD_PARTY,
|
|
943
943
|
details: {
|
|
@@ -965,7 +965,7 @@ var StoreOperationsUpstash = class extends StoreOperations {
|
|
|
965
965
|
} catch (error) {
|
|
966
966
|
throw new MastraError(
|
|
967
967
|
{
|
|
968
|
-
id: "
|
|
968
|
+
id: createStorageErrorId("UPSTASH", "BATCH_INSERT", "FAILED"),
|
|
969
969
|
domain: ErrorDomain.STORAGE,
|
|
970
970
|
category: ErrorCategory.THIRD_PARTY,
|
|
971
971
|
details: {
|
|
@@ -984,7 +984,7 @@ var StoreOperationsUpstash = class extends StoreOperations {
|
|
|
984
984
|
} catch (error) {
|
|
985
985
|
throw new MastraError(
|
|
986
986
|
{
|
|
987
|
-
id: "
|
|
987
|
+
id: createStorageErrorId("UPSTASH", "LOAD", "FAILED"),
|
|
988
988
|
domain: ErrorDomain.STORAGE,
|
|
989
989
|
category: ErrorCategory.THIRD_PARTY,
|
|
990
990
|
details: {
|
|
@@ -1050,7 +1050,7 @@ var ScoresUpstash = class extends ScoresStorage {
|
|
|
1050
1050
|
} catch (error) {
|
|
1051
1051
|
throw new MastraError(
|
|
1052
1052
|
{
|
|
1053
|
-
id: "
|
|
1053
|
+
id: createStorageErrorId("UPSTASH", "GET_SCORE_BY_ID", "FAILED"),
|
|
1054
1054
|
domain: ErrorDomain.STORAGE,
|
|
1055
1055
|
category: ErrorCategory.THIRD_PARTY,
|
|
1056
1056
|
details: {
|
|
@@ -1121,7 +1121,7 @@ var ScoresUpstash = class extends ScoresStorage {
|
|
|
1121
1121
|
} catch (error) {
|
|
1122
1122
|
throw new MastraError(
|
|
1123
1123
|
{
|
|
1124
|
-
id: "
|
|
1124
|
+
id: createStorageErrorId("UPSTASH", "SAVE_SCORE", "VALIDATION_FAILED"),
|
|
1125
1125
|
domain: ErrorDomain.STORAGE,
|
|
1126
1126
|
category: ErrorCategory.THIRD_PARTY
|
|
1127
1127
|
},
|
|
@@ -1135,7 +1135,7 @@ var ScoresUpstash = class extends ScoresStorage {
|
|
|
1135
1135
|
} catch (error) {
|
|
1136
1136
|
throw new MastraError(
|
|
1137
1137
|
{
|
|
1138
|
-
id: "
|
|
1138
|
+
id: createStorageErrorId("UPSTASH", "SAVE_SCORE", "FAILED"),
|
|
1139
1139
|
domain: ErrorDomain.STORAGE,
|
|
1140
1140
|
category: ErrorCategory.THIRD_PARTY,
|
|
1141
1141
|
details: { id: score.id }
|
|
@@ -1346,7 +1346,7 @@ var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
|
1346
1346
|
} catch (error) {
|
|
1347
1347
|
throw new MastraError(
|
|
1348
1348
|
{
|
|
1349
|
-
id: "
|
|
1349
|
+
id: createStorageErrorId("UPSTASH", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1350
1350
|
domain: ErrorDomain.STORAGE,
|
|
1351
1351
|
category: ErrorCategory.THIRD_PARTY,
|
|
1352
1352
|
details: {
|
|
@@ -1373,7 +1373,7 @@ var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
|
1373
1373
|
} catch (error) {
|
|
1374
1374
|
throw new MastraError(
|
|
1375
1375
|
{
|
|
1376
|
-
id: "
|
|
1376
|
+
id: createStorageErrorId("UPSTASH", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1377
1377
|
domain: ErrorDomain.STORAGE,
|
|
1378
1378
|
category: ErrorCategory.THIRD_PARTY,
|
|
1379
1379
|
details: {
|
|
@@ -1405,7 +1405,7 @@ var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
|
1405
1405
|
} catch (error) {
|
|
1406
1406
|
throw new MastraError(
|
|
1407
1407
|
{
|
|
1408
|
-
id: "
|
|
1408
|
+
id: createStorageErrorId("UPSTASH", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
1409
1409
|
domain: ErrorDomain.STORAGE,
|
|
1410
1410
|
category: ErrorCategory.THIRD_PARTY,
|
|
1411
1411
|
details: {
|
|
@@ -1431,7 +1431,7 @@ var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
|
1431
1431
|
if (page !== void 0 && page < 0) {
|
|
1432
1432
|
throw new MastraError(
|
|
1433
1433
|
{
|
|
1434
|
-
id: "
|
|
1434
|
+
id: createStorageErrorId("UPSTASH", "LIST_WORKFLOW_RUNS", "INVALID_PAGE"),
|
|
1435
1435
|
domain: ErrorDomain.STORAGE,
|
|
1436
1436
|
category: ErrorCategory.USER,
|
|
1437
1437
|
details: { page }
|
|
@@ -1491,9 +1491,10 @@ var WorkflowsUpstash = class extends WorkflowsStorage {
|
|
|
1491
1491
|
}
|
|
1492
1492
|
return { runs, total };
|
|
1493
1493
|
} catch (error) {
|
|
1494
|
+
if (error instanceof MastraError) throw error;
|
|
1494
1495
|
throw new MastraError(
|
|
1495
1496
|
{
|
|
1496
|
-
id: "
|
|
1497
|
+
id: createStorageErrorId("UPSTASH", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
1497
1498
|
domain: ErrorDomain.STORAGE,
|
|
1498
1499
|
category: ErrorCategory.THIRD_PARTY,
|
|
1499
1500
|
details: {
|
|
@@ -1513,7 +1514,7 @@ var UpstashStore = class extends MastraStorage {
|
|
|
1513
1514
|
redis;
|
|
1514
1515
|
stores;
|
|
1515
1516
|
constructor(config) {
|
|
1516
|
-
super({ id: config.id, name: "Upstash" });
|
|
1517
|
+
super({ id: config.id, name: "Upstash", disableInit: config.disableInit });
|
|
1517
1518
|
this.redis = new Redis({
|
|
1518
1519
|
url: config.url,
|
|
1519
1520
|
token: config.token
|
|
@@ -1919,7 +1920,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
1919
1920
|
} catch (error) {
|
|
1920
1921
|
throw new MastraError(
|
|
1921
1922
|
{
|
|
1922
|
-
id: "
|
|
1923
|
+
id: createVectorErrorId("UPSTASH", "UPSERT", "FAILED"),
|
|
1923
1924
|
domain: ErrorDomain.STORAGE,
|
|
1924
1925
|
category: ErrorCategory.THIRD_PARTY,
|
|
1925
1926
|
details: { namespace, vectorCount: vectors.length }
|
|
@@ -1982,7 +1983,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
1982
1983
|
} catch (error) {
|
|
1983
1984
|
throw new MastraError(
|
|
1984
1985
|
{
|
|
1985
|
-
id: "
|
|
1986
|
+
id: createVectorErrorId("UPSTASH", "QUERY", "FAILED"),
|
|
1986
1987
|
domain: ErrorDomain.STORAGE,
|
|
1987
1988
|
category: ErrorCategory.THIRD_PARTY,
|
|
1988
1989
|
details: { namespace, topK }
|
|
@@ -2002,7 +2003,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2002
2003
|
} catch (error) {
|
|
2003
2004
|
throw new MastraError(
|
|
2004
2005
|
{
|
|
2005
|
-
id: "
|
|
2006
|
+
id: createVectorErrorId("UPSTASH", "LIST_INDEXES", "FAILED"),
|
|
2006
2007
|
domain: ErrorDomain.STORAGE,
|
|
2007
2008
|
category: ErrorCategory.THIRD_PARTY
|
|
2008
2009
|
},
|
|
@@ -2027,7 +2028,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2027
2028
|
} catch (error) {
|
|
2028
2029
|
throw new MastraError(
|
|
2029
2030
|
{
|
|
2030
|
-
id: "
|
|
2031
|
+
id: createVectorErrorId("UPSTASH", "DESCRIBE_INDEX", "FAILED"),
|
|
2031
2032
|
domain: ErrorDomain.STORAGE,
|
|
2032
2033
|
category: ErrorCategory.THIRD_PARTY,
|
|
2033
2034
|
details: { namespace }
|
|
@@ -2052,7 +2053,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2052
2053
|
}
|
|
2053
2054
|
throw new MastraError(
|
|
2054
2055
|
{
|
|
2055
|
-
id: "
|
|
2056
|
+
id: createVectorErrorId("UPSTASH", "DELETE_INDEX", "FAILED"),
|
|
2056
2057
|
domain: ErrorDomain.STORAGE,
|
|
2057
2058
|
category: ErrorCategory.THIRD_PARTY,
|
|
2058
2059
|
details: { namespace }
|
|
@@ -2077,7 +2078,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2077
2078
|
const sparseVector = upstashUpdate.sparseVector;
|
|
2078
2079
|
if ("id" in params && params.id && "filter" in params && params.filter) {
|
|
2079
2080
|
throw new MastraError({
|
|
2080
|
-
id: "
|
|
2081
|
+
id: createVectorErrorId("UPSTASH", "UPDATE_VECTOR", "MUTUALLY_EXCLUSIVE"),
|
|
2081
2082
|
text: "Cannot specify both id and filter - they are mutually exclusive",
|
|
2082
2083
|
domain: ErrorDomain.STORAGE,
|
|
2083
2084
|
category: ErrorCategory.USER,
|
|
@@ -2086,7 +2087,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2086
2087
|
}
|
|
2087
2088
|
if (!("id" in params && params.id) && !("filter" in params && params.filter)) {
|
|
2088
2089
|
throw new MastraError({
|
|
2089
|
-
id: "
|
|
2090
|
+
id: createVectorErrorId("UPSTASH", "UPDATE_VECTOR", "NO_TARGET"),
|
|
2090
2091
|
text: "Either id or filter must be provided",
|
|
2091
2092
|
domain: ErrorDomain.STORAGE,
|
|
2092
2093
|
category: ErrorCategory.USER,
|
|
@@ -2095,7 +2096,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2095
2096
|
}
|
|
2096
2097
|
if (!update.vector && !update.metadata && !sparseVector) {
|
|
2097
2098
|
throw new MastraError({
|
|
2098
|
-
id: "
|
|
2099
|
+
id: createVectorErrorId("UPSTASH", "UPDATE_VECTOR", "NO_PAYLOAD"),
|
|
2099
2100
|
text: "No update data provided",
|
|
2100
2101
|
domain: ErrorDomain.STORAGE,
|
|
2101
2102
|
category: ErrorCategory.USER,
|
|
@@ -2104,7 +2105,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2104
2105
|
}
|
|
2105
2106
|
if ("filter" in params && params.filter && Object.keys(params.filter).length === 0) {
|
|
2106
2107
|
throw new MastraError({
|
|
2107
|
-
id: "
|
|
2108
|
+
id: createVectorErrorId("UPSTASH", "UPDATE_VECTOR", "EMPTY_FILTER"),
|
|
2108
2109
|
text: "Filter cannot be an empty filter object",
|
|
2109
2110
|
domain: ErrorDomain.STORAGE,
|
|
2110
2111
|
category: ErrorCategory.USER,
|
|
@@ -2172,7 +2173,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2172
2173
|
if (error instanceof MastraError) throw error;
|
|
2173
2174
|
throw new MastraError(
|
|
2174
2175
|
{
|
|
2175
|
-
id: "
|
|
2176
|
+
id: createVectorErrorId("UPSTASH", "UPDATE_VECTOR", "FAILED"),
|
|
2176
2177
|
domain: ErrorDomain.STORAGE,
|
|
2177
2178
|
category: ErrorCategory.THIRD_PARTY,
|
|
2178
2179
|
details: {
|
|
@@ -2199,7 +2200,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2199
2200
|
} catch (error) {
|
|
2200
2201
|
const mastraError = new MastraError(
|
|
2201
2202
|
{
|
|
2202
|
-
id: "
|
|
2203
|
+
id: createVectorErrorId("UPSTASH", "DELETE_VECTOR", "FAILED"),
|
|
2203
2204
|
domain: ErrorDomain.STORAGE,
|
|
2204
2205
|
category: ErrorCategory.THIRD_PARTY,
|
|
2205
2206
|
details: {
|
|
@@ -2223,7 +2224,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2223
2224
|
async deleteVectors({ indexName: namespace, filter, ids }) {
|
|
2224
2225
|
if (ids && filter) {
|
|
2225
2226
|
throw new MastraError({
|
|
2226
|
-
id: "
|
|
2227
|
+
id: createVectorErrorId("UPSTASH", "DELETE_VECTORS", "MUTUALLY_EXCLUSIVE"),
|
|
2227
2228
|
text: "Cannot specify both ids and filter - they are mutually exclusive",
|
|
2228
2229
|
domain: ErrorDomain.STORAGE,
|
|
2229
2230
|
category: ErrorCategory.USER,
|
|
@@ -2232,7 +2233,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2232
2233
|
}
|
|
2233
2234
|
if (!ids && !filter) {
|
|
2234
2235
|
throw new MastraError({
|
|
2235
|
-
id: "
|
|
2236
|
+
id: createVectorErrorId("UPSTASH", "DELETE_VECTORS", "NO_TARGET"),
|
|
2236
2237
|
text: "Either filter or ids must be provided",
|
|
2237
2238
|
domain: ErrorDomain.STORAGE,
|
|
2238
2239
|
category: ErrorCategory.USER,
|
|
@@ -2241,7 +2242,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2241
2242
|
}
|
|
2242
2243
|
if (ids && ids.length === 0) {
|
|
2243
2244
|
throw new MastraError({
|
|
2244
|
-
id: "
|
|
2245
|
+
id: createVectorErrorId("UPSTASH", "DELETE_VECTORS", "EMPTY_IDS"),
|
|
2245
2246
|
text: "Cannot delete with empty ids array",
|
|
2246
2247
|
domain: ErrorDomain.STORAGE,
|
|
2247
2248
|
category: ErrorCategory.USER,
|
|
@@ -2250,7 +2251,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2250
2251
|
}
|
|
2251
2252
|
if (filter && Object.keys(filter).length === 0) {
|
|
2252
2253
|
throw new MastraError({
|
|
2253
|
-
id: "
|
|
2254
|
+
id: createVectorErrorId("UPSTASH", "DELETE_VECTORS", "EMPTY_FILTER"),
|
|
2254
2255
|
text: "Cannot delete with empty filter object",
|
|
2255
2256
|
domain: ErrorDomain.STORAGE,
|
|
2256
2257
|
category: ErrorCategory.USER,
|
|
@@ -2284,7 +2285,7 @@ var UpstashVector = class extends MastraVector {
|
|
|
2284
2285
|
if (error instanceof MastraError) throw error;
|
|
2285
2286
|
throw new MastraError(
|
|
2286
2287
|
{
|
|
2287
|
-
id: "
|
|
2288
|
+
id: createVectorErrorId("UPSTASH", "DELETE_VECTORS", "FAILED"),
|
|
2288
2289
|
domain: ErrorDomain.STORAGE,
|
|
2289
2290
|
category: ErrorCategory.THIRD_PARTY,
|
|
2290
2291
|
details: {
|