@mastra/dynamodb 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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DynamoDBClient, DescribeTableCommand } from '@aws-sdk/client-dynamodb';
2
2
  import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
3
3
  import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
4
- import { MastraStorage, StoreOperations, WorkflowsStorage, normalizePerPage, MemoryStorage, calculatePagination, ScoresStorage, SCORERS_SCHEMA, TABLE_SPANS, TABLE_RESOURCES, TABLE_TRACES, TABLE_SCORERS, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, TABLE_THREADS } from '@mastra/core/storage';
4
+ import { MastraStorage, createStorageErrorId, StoreOperations, WorkflowsStorage, normalizePerPage, MemoryStorage, calculatePagination, ScoresStorage, SCORERS_SCHEMA, TABLE_SPANS, TABLE_RESOURCES, TABLE_TRACES, TABLE_SCORERS, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, TABLE_THREADS } from '@mastra/core/storage';
5
5
  import { Entity, Service } from 'electrodb';
6
6
  import { MessageList } from '@mastra/core/agent';
7
7
  import { saveScorePayloadSchema } from '@mastra/core/evals';
@@ -987,7 +987,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
987
987
  } catch (error) {
988
988
  throw new MastraError(
989
989
  {
990
- id: "STORAGE_DYNAMODB_STORE_GET_THREAD_BY_ID_FAILED",
990
+ id: createStorageErrorId("DYNAMODB", "GET_THREAD_BY_ID", "FAILED"),
991
991
  domain: ErrorDomain.STORAGE,
992
992
  category: ErrorCategory.THIRD_PARTY,
993
993
  details: { threadId }
@@ -1021,7 +1021,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1021
1021
  } catch (error) {
1022
1022
  throw new MastraError(
1023
1023
  {
1024
- id: "STORAGE_DYNAMODB_STORE_SAVE_THREAD_FAILED",
1024
+ id: createStorageErrorId("DYNAMODB", "SAVE_THREAD", "FAILED"),
1025
1025
  domain: ErrorDomain.STORAGE,
1026
1026
  category: ErrorCategory.THIRD_PARTY,
1027
1027
  details: { threadId: thread.id }
@@ -1063,7 +1063,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1063
1063
  } catch (error) {
1064
1064
  throw new MastraError(
1065
1065
  {
1066
- id: "STORAGE_DYNAMODB_STORE_UPDATE_THREAD_FAILED",
1066
+ id: createStorageErrorId("DYNAMODB", "UPDATE_THREAD", "FAILED"),
1067
1067
  domain: ErrorDomain.STORAGE,
1068
1068
  category: ErrorCategory.THIRD_PARTY,
1069
1069
  details: { threadId: id }
@@ -1095,7 +1095,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1095
1095
  } catch (error) {
1096
1096
  throw new MastraError(
1097
1097
  {
1098
- id: "STORAGE_DYNAMODB_STORE_DELETE_THREAD_FAILED",
1098
+ id: createStorageErrorId("DYNAMODB", "DELETE_THREAD", "FAILED"),
1099
1099
  domain: ErrorDomain.STORAGE,
1100
1100
  category: ErrorCategory.THIRD_PARTY,
1101
1101
  details: { threadId }
@@ -1121,7 +1121,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1121
1121
  } catch (error) {
1122
1122
  throw new MastraError(
1123
1123
  {
1124
- id: "STORAGE_DYNAMODB_STORE_LIST_MESSAGES_BY_ID_FAILED",
1124
+ id: createStorageErrorId("DYNAMODB", "LIST_MESSAGES_BY_ID", "FAILED"),
1125
1125
  domain: ErrorDomain.STORAGE,
1126
1126
  category: ErrorCategory.THIRD_PARTY,
1127
1127
  details: { messageIds: JSON.stringify(messageIds) }
@@ -1136,7 +1136,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1136
1136
  if (threadIds.length === 0 || threadIds.some((id) => !id.trim())) {
1137
1137
  throw new MastraError(
1138
1138
  {
1139
- id: "STORAGE_DYNAMODB_LIST_MESSAGES_INVALID_THREAD_ID",
1139
+ id: createStorageErrorId("DYNAMODB", "LIST_MESSAGES", "INVALID_THREAD_ID"),
1140
1140
  domain: ErrorDomain.STORAGE,
1141
1141
  category: ErrorCategory.THIRD_PARTY,
1142
1142
  details: { threadId: Array.isArray(threadId) ? threadId.join(",") : threadId }
@@ -1150,7 +1150,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1150
1150
  if (page < 0) {
1151
1151
  throw new MastraError(
1152
1152
  {
1153
- id: "STORAGE_DYNAMODB_LIST_MESSAGES_INVALID_PAGE",
1153
+ id: createStorageErrorId("DYNAMODB", "LIST_MESSAGES", "INVALID_PAGE"),
1154
1154
  domain: ErrorDomain.STORAGE,
1155
1155
  category: ErrorCategory.USER,
1156
1156
  details: { page }
@@ -1248,7 +1248,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1248
1248
  } catch (error) {
1249
1249
  const mastraError = new MastraError(
1250
1250
  {
1251
- id: "STORAGE_DYNAMODB_STORE_LIST_MESSAGES_FAILED",
1251
+ id: createStorageErrorId("DYNAMODB", "LIST_MESSAGES", "FAILED"),
1252
1252
  domain: ErrorDomain.STORAGE,
1253
1253
  category: ErrorCategory.THIRD_PARTY,
1254
1254
  details: {
@@ -1331,7 +1331,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1331
1331
  } catch (error) {
1332
1332
  throw new MastraError(
1333
1333
  {
1334
- id: "STORAGE_DYNAMODB_STORE_SAVE_MESSAGES_FAILED",
1334
+ id: createStorageErrorId("DYNAMODB", "SAVE_MESSAGES", "FAILED"),
1335
1335
  domain: ErrorDomain.STORAGE,
1336
1336
  category: ErrorCategory.THIRD_PARTY,
1337
1337
  details: { count: messages.length }
@@ -1346,7 +1346,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1346
1346
  if (page < 0) {
1347
1347
  throw new MastraError(
1348
1348
  {
1349
- id: "STORAGE_DYNAMODB_LIST_THREADS_BY_RESOURCE_ID_INVALID_PAGE",
1349
+ id: createStorageErrorId("DYNAMODB", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
1350
1350
  domain: ErrorDomain.STORAGE,
1351
1351
  category: ErrorCategory.USER,
1352
1352
  details: { page }
@@ -1381,7 +1381,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1381
1381
  } catch (error) {
1382
1382
  throw new MastraError(
1383
1383
  {
1384
- id: "DYNAMODB_STORAGE_LIST_THREADS_BY_RESOURCE_ID_FAILED",
1384
+ id: createStorageErrorId("DYNAMODB", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
1385
1385
  domain: ErrorDomain.STORAGE,
1386
1386
  category: ErrorCategory.THIRD_PARTY,
1387
1387
  details: { resourceId, page, perPage }
@@ -1515,7 +1515,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1515
1515
  } catch (error) {
1516
1516
  throw new MastraError(
1517
1517
  {
1518
- id: "STORAGE_DYNAMODB_STORE_UPDATE_MESSAGES_FAILED",
1518
+ id: createStorageErrorId("DYNAMODB", "UPDATE_MESSAGES", "FAILED"),
1519
1519
  domain: ErrorDomain.STORAGE,
1520
1520
  category: ErrorCategory.THIRD_PARTY,
1521
1521
  details: { count: messages.length }
@@ -1544,7 +1544,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1544
1544
  } catch (error) {
1545
1545
  throw new MastraError(
1546
1546
  {
1547
- id: "STORAGE_DYNAMODB_STORE_GET_RESOURCE_BY_ID_FAILED",
1547
+ id: createStorageErrorId("DYNAMODB", "GET_RESOURCE_BY_ID", "FAILED"),
1548
1548
  domain: ErrorDomain.STORAGE,
1549
1549
  category: ErrorCategory.THIRD_PARTY,
1550
1550
  details: { resourceId }
@@ -1576,7 +1576,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1576
1576
  } catch (error) {
1577
1577
  throw new MastraError(
1578
1578
  {
1579
- id: "STORAGE_DYNAMODB_STORE_SAVE_RESOURCE_FAILED",
1579
+ id: createStorageErrorId("DYNAMODB", "SAVE_RESOURCE", "FAILED"),
1580
1580
  domain: ErrorDomain.STORAGE,
1581
1581
  category: ErrorCategory.THIRD_PARTY,
1582
1582
  details: { resourceId: resource.id }
@@ -1625,7 +1625,7 @@ var MemoryStorageDynamoDB = class extends MemoryStorage {
1625
1625
  } catch (error) {
1626
1626
  throw new MastraError(
1627
1627
  {
1628
- id: "STORAGE_DYNAMODB_STORE_UPDATE_RESOURCE_FAILED",
1628
+ id: createStorageErrorId("DYNAMODB", "UPDATE_RESOURCE", "FAILED"),
1629
1629
  domain: ErrorDomain.STORAGE,
1630
1630
  category: ErrorCategory.THIRD_PARTY,
1631
1631
  details: { resourceId }
@@ -1725,7 +1725,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1725
1725
  }
1726
1726
  throw new MastraError(
1727
1727
  {
1728
- id: "STORAGE_DYNAMODB_STORE_VALIDATE_TABLE_EXISTS_FAILED",
1728
+ id: createStorageErrorId("DYNAMODB", "VALIDATE_TABLE_EXISTS", "FAILED"),
1729
1729
  domain: ErrorDomain.STORAGE,
1730
1730
  category: ErrorCategory.THIRD_PARTY,
1731
1731
  details: { tableName: this.tableName }
@@ -1758,7 +1758,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1758
1758
  this.logger.error("Error validating table access", { tableName: this.tableName, error });
1759
1759
  throw new MastraError(
1760
1760
  {
1761
- id: "STORAGE_DYNAMODB_STORE_VALIDATE_TABLE_ACCESS_FAILED",
1761
+ id: createStorageErrorId("DYNAMODB", "VALIDATE_TABLE_ACCESS", "FAILED"),
1762
1762
  domain: ErrorDomain.STORAGE,
1763
1763
  category: ErrorCategory.THIRD_PARTY,
1764
1764
  details: { tableName: this.tableName }
@@ -1772,7 +1772,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1772
1772
  const entityName = this.getEntityNameForTable(tableName);
1773
1773
  if (!entityName || !this.service.entities[entityName]) {
1774
1774
  throw new MastraError({
1775
- id: "STORAGE_DYNAMODB_STORE_INSERT_INVALID_ARGS",
1775
+ id: createStorageErrorId("DYNAMODB", "INSERT", "INVALID_ARGS"),
1776
1776
  domain: ErrorDomain.STORAGE,
1777
1777
  category: ErrorCategory.USER,
1778
1778
  text: "No entity defined for tableName",
@@ -1785,7 +1785,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1785
1785
  } catch (error) {
1786
1786
  throw new MastraError(
1787
1787
  {
1788
- id: "STORAGE_DYNAMODB_STORE_INSERT_FAILED",
1788
+ id: createStorageErrorId("DYNAMODB", "INSERT", "FAILED"),
1789
1789
  domain: ErrorDomain.STORAGE,
1790
1790
  category: ErrorCategory.THIRD_PARTY,
1791
1791
  details: { tableName }
@@ -1804,7 +1804,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1804
1804
  const entityName = this.getEntityNameForTable(tableName);
1805
1805
  if (!entityName || !this.service.entities[entityName]) {
1806
1806
  throw new MastraError({
1807
- id: "STORAGE_DYNAMODB_STORE_CLEAR_TABLE_INVALID_ARGS",
1807
+ id: createStorageErrorId("DYNAMODB", "CLEAR_TABLE", "INVALID_ARGS"),
1808
1808
  domain: ErrorDomain.STORAGE,
1809
1809
  category: ErrorCategory.USER,
1810
1810
  text: "No entity defined for tableName",
@@ -1867,7 +1867,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1867
1867
  } catch (error) {
1868
1868
  throw new MastraError(
1869
1869
  {
1870
- id: "STORAGE_DYNAMODB_STORE_CLEAR_TABLE_FAILED",
1870
+ id: createStorageErrorId("DYNAMODB", "CLEAR_TABLE", "FAILED"),
1871
1871
  domain: ErrorDomain.STORAGE,
1872
1872
  category: ErrorCategory.THIRD_PARTY,
1873
1873
  details: { tableName }
@@ -1884,7 +1884,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1884
1884
  const entityName = this.getEntityNameForTable(tableName);
1885
1885
  if (!entityName || !this.service.entities[entityName]) {
1886
1886
  throw new MastraError({
1887
- id: "STORAGE_DYNAMODB_STORE_BATCH_INSERT_INVALID_ARGS",
1887
+ id: createStorageErrorId("DYNAMODB", "BATCH_INSERT", "INVALID_ARGS"),
1888
1888
  domain: ErrorDomain.STORAGE,
1889
1889
  category: ErrorCategory.USER,
1890
1890
  text: "No entity defined for tableName",
@@ -1912,7 +1912,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1912
1912
  } catch (error) {
1913
1913
  throw new MastraError(
1914
1914
  {
1915
- id: "STORAGE_DYNAMODB_STORE_BATCH_INSERT_FAILED",
1915
+ id: createStorageErrorId("DYNAMODB", "BATCH_INSERT", "FAILED"),
1916
1916
  domain: ErrorDomain.STORAGE,
1917
1917
  category: ErrorCategory.THIRD_PARTY,
1918
1918
  details: { tableName }
@@ -1929,7 +1929,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1929
1929
  const entityName = this.getEntityNameForTable(tableName);
1930
1930
  if (!entityName || !this.service.entities[entityName]) {
1931
1931
  throw new MastraError({
1932
- id: "STORAGE_DYNAMODB_STORE_LOAD_INVALID_ARGS",
1932
+ id: createStorageErrorId("DYNAMODB", "LOAD", "INVALID_ARGS"),
1933
1933
  domain: ErrorDomain.STORAGE,
1934
1934
  category: ErrorCategory.USER,
1935
1935
  text: "No entity defined for tableName",
@@ -1947,7 +1947,7 @@ var StoreOperationsDynamoDB = class extends StoreOperations {
1947
1947
  } catch (error) {
1948
1948
  throw new MastraError(
1949
1949
  {
1950
- id: "STORAGE_DYNAMODB_STORE_LOAD_FAILED",
1950
+ id: createStorageErrorId("DYNAMODB", "LOAD", "FAILED"),
1951
1951
  domain: ErrorDomain.STORAGE,
1952
1952
  category: ErrorCategory.THIRD_PARTY,
1953
1953
  details: { tableName }
@@ -1998,7 +1998,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
1998
1998
  } catch (error) {
1999
1999
  throw new MastraError(
2000
2000
  {
2001
- id: "STORAGE_DYNAMODB_STORE_GET_SCORE_BY_ID_FAILED",
2001
+ id: createStorageErrorId("DYNAMODB", "GET_SCORE_BY_ID", "FAILED"),
2002
2002
  domain: ErrorDomain.STORAGE,
2003
2003
  category: ErrorCategory.THIRD_PARTY,
2004
2004
  details: { id }
@@ -2014,7 +2014,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
2014
2014
  } catch (error) {
2015
2015
  throw new MastraError(
2016
2016
  {
2017
- id: "STORAGE_DYNAMODB_STORE_SAVE_SCORE_FAILED",
2017
+ id: createStorageErrorId("DYNAMODB", "SAVE_SCORE", "VALIDATION_FAILED"),
2018
2018
  domain: ErrorDomain.STORAGE,
2019
2019
  category: ErrorCategory.THIRD_PARTY
2020
2020
  },
@@ -2062,7 +2062,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
2062
2062
  } catch (error) {
2063
2063
  throw new MastraError(
2064
2064
  {
2065
- id: "STORAGE_DYNAMODB_STORE_SAVE_SCORE_FAILED",
2065
+ id: createStorageErrorId("DYNAMODB", "SAVE_SCORE", "FAILED"),
2066
2066
  domain: ErrorDomain.STORAGE,
2067
2067
  category: ErrorCategory.THIRD_PARTY,
2068
2068
  details: { scorerId: score.scorerId, runId: score.runId }
@@ -2110,7 +2110,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
2110
2110
  } catch (error) {
2111
2111
  throw new MastraError(
2112
2112
  {
2113
- id: "STORAGE_DYNAMODB_STORE_GET_SCORES_BY_SCORER_ID_FAILED",
2113
+ id: createStorageErrorId("DYNAMODB", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
2114
2114
  domain: ErrorDomain.STORAGE,
2115
2115
  category: ErrorCategory.THIRD_PARTY,
2116
2116
  details: {
@@ -2154,7 +2154,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
2154
2154
  } catch (error) {
2155
2155
  throw new MastraError(
2156
2156
  {
2157
- id: "STORAGE_DYNAMODB_STORE_GET_SCORES_BY_RUN_ID_FAILED",
2157
+ id: createStorageErrorId("DYNAMODB", "LIST_SCORES_BY_RUN_ID", "FAILED"),
2158
2158
  domain: ErrorDomain.STORAGE,
2159
2159
  category: ErrorCategory.THIRD_PARTY,
2160
2160
  details: { runId, page: pagination.page, perPage: pagination.perPage }
@@ -2193,7 +2193,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
2193
2193
  } catch (error) {
2194
2194
  throw new MastraError(
2195
2195
  {
2196
- id: "STORAGE_DYNAMODB_STORE_GET_SCORES_BY_ENTITY_ID_FAILED",
2196
+ id: createStorageErrorId("DYNAMODB", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
2197
2197
  domain: ErrorDomain.STORAGE,
2198
2198
  category: ErrorCategory.THIRD_PARTY,
2199
2199
  details: { entityId, entityType, page: pagination.page, perPage: pagination.perPage }
@@ -2231,7 +2231,7 @@ var ScoresStorageDynamoDB = class extends ScoresStorage {
2231
2231
  } catch (error) {
2232
2232
  throw new MastraError(
2233
2233
  {
2234
- id: "STORAGE_DYNAMODB_STORE_GET_SCORES_BY_SPAN_FAILED",
2234
+ id: createStorageErrorId("DYNAMODB", "LIST_SCORES_BY_SPAN", "FAILED"),
2235
2235
  domain: ErrorDomain.STORAGE,
2236
2236
  category: ErrorCategory.THIRD_PARTY,
2237
2237
  details: { traceId, spanId, page: pagination.page, perPage: pagination.perPage }
@@ -2297,7 +2297,7 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2297
2297
  } catch (error) {
2298
2298
  throw new MastraError(
2299
2299
  {
2300
- id: "STORAGE_DYNAMODB_STORE_PERSIST_WORKFLOW_SNAPSHOT_FAILED",
2300
+ id: createStorageErrorId("DYNAMODB", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
2301
2301
  domain: ErrorDomain.STORAGE,
2302
2302
  category: ErrorCategory.THIRD_PARTY,
2303
2303
  details: { workflowName, runId }
@@ -2325,7 +2325,7 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2325
2325
  } catch (error) {
2326
2326
  throw new MastraError(
2327
2327
  {
2328
- id: "STORAGE_DYNAMODB_STORE_LOAD_WORKFLOW_SNAPSHOT_FAILED",
2328
+ id: createStorageErrorId("DYNAMODB", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
2329
2329
  domain: ErrorDomain.STORAGE,
2330
2330
  category: ErrorCategory.THIRD_PARTY,
2331
2331
  details: { workflowName, runId }
@@ -2342,7 +2342,7 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2342
2342
  if (page < 0) {
2343
2343
  throw new MastraError(
2344
2344
  {
2345
- id: "DYNAMODB_STORE_INVALID_PAGE",
2345
+ id: createStorageErrorId("DYNAMODB", "LIST_WORKFLOW_RUNS", "INVALID_PAGE"),
2346
2346
  domain: ErrorDomain.STORAGE,
2347
2347
  category: ErrorCategory.USER,
2348
2348
  details: { page }
@@ -2412,7 +2412,7 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2412
2412
  } catch (error) {
2413
2413
  throw new MastraError(
2414
2414
  {
2415
- id: "STORAGE_DYNAMODB_STORE_LIST_WORKFLOW_RUNS_FAILED",
2415
+ id: createStorageErrorId("DYNAMODB", "LIST_WORKFLOW_RUNS", "FAILED"),
2416
2416
  domain: ErrorDomain.STORAGE,
2417
2417
  category: ErrorCategory.THIRD_PARTY,
2418
2418
  details: { workflowName: args?.workflowName || "", resourceId: args?.resourceId || "" }
@@ -2466,7 +2466,7 @@ var WorkflowStorageDynamoDB = class extends WorkflowsStorage {
2466
2466
  } catch (error) {
2467
2467
  throw new MastraError(
2468
2468
  {
2469
- id: "STORAGE_DYNAMODB_STORE_GET_WORKFLOW_RUN_BY_ID_FAILED",
2469
+ id: createStorageErrorId("DYNAMODB", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
2470
2470
  domain: ErrorDomain.STORAGE,
2471
2471
  category: ErrorCategory.THIRD_PARTY,
2472
2472
  details: { runId, workflowName: args?.workflowName || "" }
@@ -2485,7 +2485,7 @@ var DynamoDBStore = class extends MastraStorage {
2485
2485
  hasInitialized = null;
2486
2486
  stores;
2487
2487
  constructor({ name, config }) {
2488
- super({ id: config.id, name });
2488
+ super({ id: config.id, name, disableInit: config.disableInit });
2489
2489
  try {
2490
2490
  if (!config.tableName || typeof config.tableName !== "string" || config.tableName.trim() === "") {
2491
2491
  throw new Error("DynamoDBStore: config.tableName must be provided and cannot be empty.");
@@ -2520,7 +2520,7 @@ var DynamoDBStore = class extends MastraStorage {
2520
2520
  } catch (error) {
2521
2521
  throw new MastraError(
2522
2522
  {
2523
- id: "STORAGE_DYNAMODB_STORE_CONSTRUCTOR_FAILED",
2523
+ id: createStorageErrorId("DYNAMODB", "CONSTRUCTOR", "FAILED"),
2524
2524
  domain: ErrorDomain.STORAGE,
2525
2525
  category: ErrorCategory.USER
2526
2526
  },
@@ -2556,7 +2556,7 @@ var DynamoDBStore = class extends MastraStorage {
2556
2556
  }
2557
2557
  throw new MastraError(
2558
2558
  {
2559
- id: "STORAGE_DYNAMODB_STORE_VALIDATE_TABLE_EXISTS_FAILED",
2559
+ id: createStorageErrorId("DYNAMODB", "VALIDATE_TABLE_EXISTS", "FAILED"),
2560
2560
  domain: ErrorDomain.STORAGE,
2561
2561
  category: ErrorCategory.THIRD_PARTY,
2562
2562
  details: { tableName: this.tableName }
@@ -2579,7 +2579,7 @@ var DynamoDBStore = class extends MastraStorage {
2579
2579
  } catch (error) {
2580
2580
  throw new MastraError(
2581
2581
  {
2582
- id: "STORAGE_DYNAMODB_STORE_INIT_FAILED",
2582
+ id: createStorageErrorId("DYNAMODB", "INIT", "FAILED"),
2583
2583
  domain: ErrorDomain.STORAGE,
2584
2584
  category: ErrorCategory.THIRD_PARTY,
2585
2585
  details: { tableName: this.tableName }
@@ -2714,7 +2714,7 @@ var DynamoDBStore = class extends MastraStorage {
2714
2714
  } catch (error) {
2715
2715
  throw new MastraError(
2716
2716
  {
2717
- id: "STORAGE_DYNAMODB_STORE_CLOSE_FAILED",
2717
+ id: createStorageErrorId("DYNAMODB", "CLOSE", "FAILED"),
2718
2718
  domain: ErrorDomain.STORAGE,
2719
2719
  category: ErrorCategory.THIRD_PARTY
2720
2720
  },