@mastra/cloudflare-d1 1.0.0-beta.2 → 1.0.0-beta.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/CHANGELOG.md +31 -0
- package/dist/index.cjs +38 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +39 -39
- 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 +31 -14
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
|
|
2
|
-
import { MastraStorage, StoreOperations, ScoresStorage, TABLE_SCORERS, normalizePerPage, calculatePagination, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, ensureDate, MemoryStorage, TABLE_RESOURCES, TABLE_THREADS, TABLE_MESSAGES, serializeDate, transformScoreRow as transformScoreRow$1 } from '@mastra/core/storage';
|
|
2
|
+
import { MastraStorage, createStorageErrorId, StoreOperations, ScoresStorage, TABLE_SCORERS, normalizePerPage, calculatePagination, WorkflowsStorage, TABLE_WORKFLOW_SNAPSHOT, ensureDate, MemoryStorage, TABLE_RESOURCES, TABLE_THREADS, TABLE_MESSAGES, serializeDate, transformScoreRow as transformScoreRow$1 } from '@mastra/core/storage';
|
|
3
3
|
import Cloudflare from 'cloudflare';
|
|
4
4
|
import { MessageList } from '@mastra/core/agent';
|
|
5
5
|
import { parseSqlIdentifier } from '@mastra/core/utils';
|
|
@@ -275,7 +275,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
275
275
|
} catch (error) {
|
|
276
276
|
const mastraError = new MastraError(
|
|
277
277
|
{
|
|
278
|
-
id: "
|
|
278
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_RESOURCE_BY_ID", "FAILED"),
|
|
279
279
|
domain: ErrorDomain.STORAGE,
|
|
280
280
|
category: ErrorCategory.THIRD_PARTY,
|
|
281
281
|
text: `Error processing resource ${resourceId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -314,7 +314,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
314
314
|
} catch (error) {
|
|
315
315
|
throw new MastraError(
|
|
316
316
|
{
|
|
317
|
-
id: "
|
|
317
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "SAVE_RESOURCE", "FAILED"),
|
|
318
318
|
domain: ErrorDomain.STORAGE,
|
|
319
319
|
category: ErrorCategory.THIRD_PARTY,
|
|
320
320
|
text: `Failed to save resource to ${fullTableName}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -361,7 +361,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
361
361
|
} catch (error) {
|
|
362
362
|
throw new MastraError(
|
|
363
363
|
{
|
|
364
|
-
id: "
|
|
364
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "UPDATE_RESOURCE", "FAILED"),
|
|
365
365
|
domain: ErrorDomain.STORAGE,
|
|
366
366
|
category: ErrorCategory.THIRD_PARTY,
|
|
367
367
|
text: `Failed to update resource ${resourceId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -387,7 +387,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
387
387
|
} catch (error) {
|
|
388
388
|
const mastraError = new MastraError(
|
|
389
389
|
{
|
|
390
|
-
id: "
|
|
390
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_THREAD_BY_ID", "FAILED"),
|
|
391
391
|
domain: ErrorDomain.STORAGE,
|
|
392
392
|
category: ErrorCategory.THIRD_PARTY,
|
|
393
393
|
text: `Error processing thread ${threadId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -406,7 +406,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
406
406
|
if (page < 0) {
|
|
407
407
|
throw new MastraError(
|
|
408
408
|
{
|
|
409
|
-
id: "
|
|
409
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
410
410
|
domain: ErrorDomain.STORAGE,
|
|
411
411
|
category: ErrorCategory.USER,
|
|
412
412
|
details: { page }
|
|
@@ -441,7 +441,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
441
441
|
} catch (error) {
|
|
442
442
|
const mastraError = new MastraError(
|
|
443
443
|
{
|
|
444
|
-
id: "
|
|
444
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
445
445
|
domain: ErrorDomain.STORAGE,
|
|
446
446
|
category: ErrorCategory.THIRD_PARTY,
|
|
447
447
|
text: `Error getting threads by resourceId ${resourceId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -488,7 +488,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
488
488
|
} catch (error) {
|
|
489
489
|
throw new MastraError(
|
|
490
490
|
{
|
|
491
|
-
id: "
|
|
491
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "SAVE_THREAD", "FAILED"),
|
|
492
492
|
domain: ErrorDomain.STORAGE,
|
|
493
493
|
category: ErrorCategory.THIRD_PARTY,
|
|
494
494
|
text: `Failed to save thread to ${fullTableName}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -531,7 +531,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
531
531
|
} catch (error) {
|
|
532
532
|
throw new MastraError(
|
|
533
533
|
{
|
|
534
|
-
id: "
|
|
534
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "UPDATE_THREAD", "FAILED"),
|
|
535
535
|
domain: ErrorDomain.STORAGE,
|
|
536
536
|
category: ErrorCategory.THIRD_PARTY,
|
|
537
537
|
text: `Failed to update thread ${id}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -554,7 +554,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
554
554
|
} catch (error) {
|
|
555
555
|
throw new MastraError(
|
|
556
556
|
{
|
|
557
|
-
id: "
|
|
557
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "DELETE_THREAD", "FAILED"),
|
|
558
558
|
domain: ErrorDomain.STORAGE,
|
|
559
559
|
category: ErrorCategory.THIRD_PARTY,
|
|
560
560
|
text: `Failed to delete thread ${threadId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -618,7 +618,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
618
618
|
} catch (error) {
|
|
619
619
|
throw new MastraError(
|
|
620
620
|
{
|
|
621
|
-
id: "
|
|
621
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "SAVE_MESSAGES", "FAILED"),
|
|
622
622
|
domain: ErrorDomain.STORAGE,
|
|
623
623
|
category: ErrorCategory.THIRD_PARTY,
|
|
624
624
|
text: `Failed to save messages: ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -710,7 +710,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
710
710
|
} catch (error) {
|
|
711
711
|
const mastraError = new MastraError(
|
|
712
712
|
{
|
|
713
|
-
id: "
|
|
713
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
714
714
|
domain: ErrorDomain.STORAGE,
|
|
715
715
|
category: ErrorCategory.THIRD_PARTY,
|
|
716
716
|
text: `Failed to retrieve messages by ID: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -729,7 +729,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
729
729
|
if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
|
|
730
730
|
throw new MastraError(
|
|
731
731
|
{
|
|
732
|
-
id: "
|
|
732
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
733
733
|
domain: ErrorDomain.STORAGE,
|
|
734
734
|
category: ErrorCategory.THIRD_PARTY,
|
|
735
735
|
details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
|
|
@@ -740,7 +740,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
740
740
|
if (page < 0) {
|
|
741
741
|
throw new MastraError(
|
|
742
742
|
{
|
|
743
|
-
id: "
|
|
743
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
744
744
|
domain: ErrorDomain.STORAGE,
|
|
745
745
|
category: ErrorCategory.USER,
|
|
746
746
|
details: { page }
|
|
@@ -857,7 +857,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
857
857
|
} catch (error) {
|
|
858
858
|
const mastraError = new MastraError(
|
|
859
859
|
{
|
|
860
|
-
id: "
|
|
860
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_MESSAGES", "FAILED"),
|
|
861
861
|
domain: ErrorDomain.STORAGE,
|
|
862
862
|
category: ErrorCategory.THIRD_PARTY,
|
|
863
863
|
text: `Failed to list messages for thread ${Array.isArray(threadId) ? threadId.join(",") : threadId}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -970,7 +970,7 @@ var MemoryStorageD1 = class extends MemoryStorage {
|
|
|
970
970
|
} catch (error) {
|
|
971
971
|
throw new MastraError(
|
|
972
972
|
{
|
|
973
|
-
id: "
|
|
973
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "UPDATE_MESSAGES", "FAILED"),
|
|
974
974
|
domain: ErrorDomain.STORAGE,
|
|
975
975
|
category: ErrorCategory.THIRD_PARTY,
|
|
976
976
|
details: { count: messages.length }
|
|
@@ -1039,7 +1039,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1039
1039
|
} catch (error) {
|
|
1040
1040
|
throw new MastraError(
|
|
1041
1041
|
{
|
|
1042
|
-
id: "
|
|
1042
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "WORKERS_BINDING_QUERY", "FAILED"),
|
|
1043
1043
|
domain: ErrorDomain.STORAGE,
|
|
1044
1044
|
category: ErrorCategory.THIRD_PARTY,
|
|
1045
1045
|
details: { sql }
|
|
@@ -1071,7 +1071,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1071
1071
|
} catch (error) {
|
|
1072
1072
|
throw new MastraError(
|
|
1073
1073
|
{
|
|
1074
|
-
id: "
|
|
1074
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "REST_QUERY", "FAILED"),
|
|
1075
1075
|
domain: ErrorDomain.STORAGE,
|
|
1076
1076
|
category: ErrorCategory.THIRD_PARTY,
|
|
1077
1077
|
details: { sql }
|
|
@@ -1152,7 +1152,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1152
1152
|
} catch (error) {
|
|
1153
1153
|
throw new MastraError(
|
|
1154
1154
|
{
|
|
1155
|
-
id: "
|
|
1155
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "CREATE_TABLE", "FAILED"),
|
|
1156
1156
|
domain: ErrorDomain.STORAGE,
|
|
1157
1157
|
category: ErrorCategory.THIRD_PARTY,
|
|
1158
1158
|
details: { tableName }
|
|
@@ -1171,7 +1171,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1171
1171
|
} catch (error) {
|
|
1172
1172
|
throw new MastraError(
|
|
1173
1173
|
{
|
|
1174
|
-
id: "
|
|
1174
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "CLEAR_TABLE", "FAILED"),
|
|
1175
1175
|
domain: ErrorDomain.STORAGE,
|
|
1176
1176
|
category: ErrorCategory.THIRD_PARTY,
|
|
1177
1177
|
details: { tableName }
|
|
@@ -1189,7 +1189,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1189
1189
|
} catch (error) {
|
|
1190
1190
|
throw new MastraError(
|
|
1191
1191
|
{
|
|
1192
|
-
id: "
|
|
1192
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "DROP_TABLE", "FAILED"),
|
|
1193
1193
|
domain: ErrorDomain.STORAGE,
|
|
1194
1194
|
category: ErrorCategory.THIRD_PARTY,
|
|
1195
1195
|
details: { tableName }
|
|
@@ -1215,7 +1215,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1215
1215
|
} catch (error) {
|
|
1216
1216
|
throw new MastraError(
|
|
1217
1217
|
{
|
|
1218
|
-
id: "
|
|
1218
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "ALTER_TABLE", "FAILED"),
|
|
1219
1219
|
domain: ErrorDomain.STORAGE,
|
|
1220
1220
|
category: ErrorCategory.THIRD_PARTY,
|
|
1221
1221
|
details: { tableName: args.tableName }
|
|
@@ -1236,7 +1236,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1236
1236
|
} catch (error) {
|
|
1237
1237
|
throw new MastraError(
|
|
1238
1238
|
{
|
|
1239
|
-
id: "
|
|
1239
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "INSERT", "FAILED"),
|
|
1240
1240
|
domain: ErrorDomain.STORAGE,
|
|
1241
1241
|
category: ErrorCategory.THIRD_PARTY,
|
|
1242
1242
|
details: { tableName }
|
|
@@ -1260,7 +1260,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1260
1260
|
} catch (error) {
|
|
1261
1261
|
throw new MastraError(
|
|
1262
1262
|
{
|
|
1263
|
-
id: "
|
|
1263
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "BATCH_INSERT", "FAILED"),
|
|
1264
1264
|
domain: ErrorDomain.STORAGE,
|
|
1265
1265
|
category: ErrorCategory.THIRD_PARTY,
|
|
1266
1266
|
details: { tableName }
|
|
@@ -1297,7 +1297,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1297
1297
|
} catch (error) {
|
|
1298
1298
|
throw new MastraError(
|
|
1299
1299
|
{
|
|
1300
|
-
id: "
|
|
1300
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LOAD", "FAILED"),
|
|
1301
1301
|
domain: ErrorDomain.STORAGE,
|
|
1302
1302
|
category: ErrorCategory.THIRD_PARTY,
|
|
1303
1303
|
details: { tableName }
|
|
@@ -1355,7 +1355,7 @@ var StoreOperationsD1 = class extends StoreOperations {
|
|
|
1355
1355
|
} catch (error) {
|
|
1356
1356
|
throw new MastraError(
|
|
1357
1357
|
{
|
|
1358
|
-
id: "
|
|
1358
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "BATCH_UPSERT", "FAILED"),
|
|
1359
1359
|
domain: ErrorDomain.STORAGE,
|
|
1360
1360
|
category: ErrorCategory.THIRD_PARTY,
|
|
1361
1361
|
text: `Failed to batch upsert into ${tableName}: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -1393,7 +1393,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1393
1393
|
} catch (error) {
|
|
1394
1394
|
throw new MastraError(
|
|
1395
1395
|
{
|
|
1396
|
-
id: "
|
|
1396
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_SCORE_BY_ID", "FAILED"),
|
|
1397
1397
|
domain: ErrorDomain.STORAGE,
|
|
1398
1398
|
category: ErrorCategory.THIRD_PARTY
|
|
1399
1399
|
},
|
|
@@ -1408,7 +1408,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1408
1408
|
} catch (error) {
|
|
1409
1409
|
throw new MastraError(
|
|
1410
1410
|
{
|
|
1411
|
-
id: "
|
|
1411
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "SAVE_SCORE", "VALIDATION_FAILED"),
|
|
1412
1412
|
domain: ErrorDomain.STORAGE,
|
|
1413
1413
|
category: ErrorCategory.USER,
|
|
1414
1414
|
details: { scoreId: score.id }
|
|
@@ -1444,7 +1444,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1444
1444
|
} catch (error) {
|
|
1445
1445
|
throw new MastraError(
|
|
1446
1446
|
{
|
|
1447
|
-
id: "
|
|
1447
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "SAVE_SCORE", "FAILED"),
|
|
1448
1448
|
domain: ErrorDomain.STORAGE,
|
|
1449
1449
|
category: ErrorCategory.THIRD_PARTY
|
|
1450
1450
|
},
|
|
@@ -1515,7 +1515,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1515
1515
|
} catch (error) {
|
|
1516
1516
|
throw new MastraError(
|
|
1517
1517
|
{
|
|
1518
|
-
id: "
|
|
1518
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_SCORES_BY_SCORER_ID", "FAILED"),
|
|
1519
1519
|
domain: ErrorDomain.STORAGE,
|
|
1520
1520
|
category: ErrorCategory.THIRD_PARTY
|
|
1521
1521
|
},
|
|
@@ -1564,7 +1564,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1564
1564
|
} catch (error) {
|
|
1565
1565
|
throw new MastraError(
|
|
1566
1566
|
{
|
|
1567
|
-
id: "
|
|
1567
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_SCORES_BY_RUN_ID", "FAILED"),
|
|
1568
1568
|
domain: ErrorDomain.STORAGE,
|
|
1569
1569
|
category: ErrorCategory.THIRD_PARTY
|
|
1570
1570
|
},
|
|
@@ -1614,7 +1614,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1614
1614
|
} catch (error) {
|
|
1615
1615
|
throw new MastraError(
|
|
1616
1616
|
{
|
|
1617
|
-
id: "
|
|
1617
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
1618
1618
|
domain: ErrorDomain.STORAGE,
|
|
1619
1619
|
category: ErrorCategory.THIRD_PARTY
|
|
1620
1620
|
},
|
|
@@ -1664,7 +1664,7 @@ var ScoresStorageD1 = class extends ScoresStorage {
|
|
|
1664
1664
|
} catch (error) {
|
|
1665
1665
|
throw new MastraError(
|
|
1666
1666
|
{
|
|
1667
|
-
id: "
|
|
1667
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_SCORES_BY_SPAN", "FAILED"),
|
|
1668
1668
|
domain: ErrorDomain.STORAGE,
|
|
1669
1669
|
category: ErrorCategory.THIRD_PARTY
|
|
1670
1670
|
},
|
|
@@ -1735,7 +1735,7 @@ var WorkflowsStorageD1 = class extends WorkflowsStorage {
|
|
|
1735
1735
|
} catch (error) {
|
|
1736
1736
|
throw new MastraError(
|
|
1737
1737
|
{
|
|
1738
|
-
id: "
|
|
1738
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1739
1739
|
domain: ErrorDomain.STORAGE,
|
|
1740
1740
|
category: ErrorCategory.THIRD_PARTY,
|
|
1741
1741
|
text: `Failed to persist workflow snapshot: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -1760,7 +1760,7 @@ var WorkflowsStorageD1 = class extends WorkflowsStorage {
|
|
|
1760
1760
|
} catch (error) {
|
|
1761
1761
|
throw new MastraError(
|
|
1762
1762
|
{
|
|
1763
|
-
id: "
|
|
1763
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1764
1764
|
domain: ErrorDomain.STORAGE,
|
|
1765
1765
|
category: ErrorCategory.THIRD_PARTY,
|
|
1766
1766
|
text: `Failed to load workflow snapshot: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -1846,7 +1846,7 @@ var WorkflowsStorageD1 = class extends WorkflowsStorage {
|
|
|
1846
1846
|
} catch (error) {
|
|
1847
1847
|
throw new MastraError(
|
|
1848
1848
|
{
|
|
1849
|
-
id: "
|
|
1849
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
1850
1850
|
domain: ErrorDomain.STORAGE,
|
|
1851
1851
|
category: ErrorCategory.THIRD_PARTY,
|
|
1852
1852
|
text: `Failed to retrieve workflow runs: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -1883,7 +1883,7 @@ var WorkflowsStorageD1 = class extends WorkflowsStorage {
|
|
|
1883
1883
|
} catch (error) {
|
|
1884
1884
|
throw new MastraError(
|
|
1885
1885
|
{
|
|
1886
|
-
id: "
|
|
1886
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
1887
1887
|
domain: ErrorDomain.STORAGE,
|
|
1888
1888
|
category: ErrorCategory.THIRD_PARTY,
|
|
1889
1889
|
text: `Failed to retrieve workflow run by ID: ${error instanceof Error ? error.message : String(error)}`,
|
|
@@ -1908,7 +1908,7 @@ var D1Store = class extends MastraStorage {
|
|
|
1908
1908
|
*/
|
|
1909
1909
|
constructor(config) {
|
|
1910
1910
|
try {
|
|
1911
|
-
super({ id: config.id, name: "D1" });
|
|
1911
|
+
super({ id: config.id, name: "D1", disableInit: config.disableInit });
|
|
1912
1912
|
if (config.tablePrefix && !/^[a-zA-Z0-9_]*$/.test(config.tablePrefix)) {
|
|
1913
1913
|
throw new Error("Invalid tablePrefix: only letters, numbers, and underscores are allowed.");
|
|
1914
1914
|
}
|
|
@@ -1946,7 +1946,7 @@ var D1Store = class extends MastraStorage {
|
|
|
1946
1946
|
} catch (error) {
|
|
1947
1947
|
throw new MastraError(
|
|
1948
1948
|
{
|
|
1949
|
-
id: "
|
|
1949
|
+
id: createStorageErrorId("CLOUDFLARE_D1", "INITIALIZATION", "FAILED"),
|
|
1950
1950
|
domain: ErrorDomain.STORAGE,
|
|
1951
1951
|
category: ErrorCategory.SYSTEM,
|
|
1952
1952
|
text: "Error initializing D1Store"
|