@mastra/dynamodb 0.10.3 → 0.10.4-alpha.0

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.
@@ -5,6 +5,7 @@ import type { MastraMessageV1 } from '@mastra/core';
5
5
  import type { MastraMessageV2 } from '@mastra/core';
6
6
  import { MastraStorage } from '@mastra/core/storage';
7
7
  import { Service } from 'electrodb';
8
+ import type { StorageColumn } from '@mastra/core';
8
9
  import type { StorageGetMessagesArg } from '@mastra/core/storage';
9
10
  import type { StorageThreadType } from '@mastra/core';
10
11
  import type { TABLE_NAMES } from '@mastra/core/storage';
@@ -75,6 +76,11 @@ declare class DynamoDBStore extends MastraStorage {
75
76
  * This is necessary because ElectroDB validation happens before setters are applied
76
77
  */
77
78
  private preprocessRecord;
79
+ alterTable(_args: {
80
+ tableName: TABLE_NAMES;
81
+ schema: Record<string, StorageColumn>;
82
+ ifNotExists: string[];
83
+ }): Promise<void>;
78
84
  /**
79
85
  * Clear all items from a logical "table" (entity type)
80
86
  */
@@ -5,6 +5,7 @@ import type { MastraMessageV1 } from '@mastra/core';
5
5
  import type { MastraMessageV2 } from '@mastra/core';
6
6
  import { MastraStorage } from '@mastra/core/storage';
7
7
  import { Service } from 'electrodb';
8
+ import type { StorageColumn } from '@mastra/core';
8
9
  import type { StorageGetMessagesArg } from '@mastra/core/storage';
9
10
  import type { StorageThreadType } from '@mastra/core';
10
11
  import type { TABLE_NAMES } from '@mastra/core/storage';
@@ -75,6 +76,11 @@ declare class DynamoDBStore extends MastraStorage {
75
76
  * This is necessary because ElectroDB validation happens before setters are applied
76
77
  */
77
78
  private preprocessRecord;
79
+ alterTable(_args: {
80
+ tableName: TABLE_NAMES;
81
+ schema: Record<string, StorageColumn>;
82
+ ifNotExists: string[];
83
+ }): Promise<void>;
78
84
  /**
79
85
  * Clear all items from a logical "table" (entity type)
80
86
  */
package/dist/index.cjs CHANGED
@@ -676,6 +676,8 @@ var DynamoDBStore = class extends storage.MastraStorage {
676
676
  }
677
677
  return processed;
678
678
  }
679
+ async alterTable(_args) {
680
+ }
679
681
  /**
680
682
  * Clear all items from a logical "table" (entity type)
681
683
  */
package/dist/index.js CHANGED
@@ -674,6 +674,8 @@ var DynamoDBStore = class extends MastraStorage {
674
674
  }
675
675
  return processed;
676
676
  }
677
+ async alterTable(_args) {
678
+ }
677
679
  /**
678
680
  * Clear all items from a logical "table" (entity type)
679
681
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/dynamodb",
3
- "version": "0.10.3",
3
+ "version": "0.10.4-alpha.0",
4
4
  "description": "DynamoDB storage adapter for Mastra",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,25 +23,26 @@
23
23
  "src"
24
24
  ],
25
25
  "dependencies": {
26
- "@aws-sdk/client-dynamodb": "^3.0.0",
27
- "@aws-sdk/lib-dynamodb": "^3.0.0",
26
+ "@aws-sdk/client-dynamodb": "^3.823.0",
27
+ "@aws-sdk/lib-dynamodb": "^3.823.0",
28
28
  "electrodb": "^3.4.1"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@mastra/core": "^0.10.2-alpha.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@microsoft/api-extractor": "^7.52.1",
35
- "@types/node": "^20.17.27",
36
- "@vitest/coverage-v8": "3.0.9",
37
- "@vitest/ui": "3.0.9",
38
- "axios": "^1.8.4",
39
- "eslint": "^9.23.0",
40
- "tsup": "^8.4.0",
34
+ "@microsoft/api-extractor": "^7.52.8",
35
+ "@types/node": "^20.17.57",
36
+ "@vitest/coverage-v8": "3.2.2",
37
+ "@vitest/ui": "3.2.2",
38
+ "axios": "^1.9.0",
39
+ "eslint": "^9.28.0",
40
+ "tsup": "^8.5.0",
41
41
  "typescript": "^5.8.2",
42
- "vitest": "^3.0.9",
42
+ "vitest": "^3.2.2",
43
43
  "@internal/lint": "0.0.10",
44
- "@mastra/core": "0.10.3"
44
+ "@internal/storage-test-utils": "0.0.6",
45
+ "@mastra/core": "0.10.4-alpha.1"
45
46
  },
46
47
  "scripts": {
47
48
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -1,6 +1,12 @@
1
1
  import { DynamoDBClient, DescribeTableCommand } from '@aws-sdk/client-dynamodb';
2
2
  import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
3
- import type { StorageThreadType, WorkflowRunState, MastraMessageV1, MastraMessageV2 } from '@mastra/core';
3
+ import type {
4
+ StorageThreadType,
5
+ WorkflowRunState,
6
+ MastraMessageV1,
7
+ MastraMessageV2,
8
+ StorageColumn,
9
+ } from '@mastra/core';
4
10
  import { MessageList } from '@mastra/core/agent';
5
11
  import {
6
12
  MastraStorage,
@@ -203,6 +209,14 @@ export class DynamoDBStore extends MastraStorage {
203
209
  return processed;
204
210
  }
205
211
 
212
+ async alterTable(_args: {
213
+ tableName: TABLE_NAMES;
214
+ schema: Record<string, StorageColumn>;
215
+ ifNotExists: string[];
216
+ }): Promise<void> {
217
+ // Nothing to do here, DynamoDB has a flexible schema and handles new attributes automatically upon insertion/update.
218
+ }
219
+
206
220
  /**
207
221
  * Clear all items from a logical "table" (entity type)
208
222
  */