@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.
- package/dist/_tsup-dts-rollup.d.cts +6 -0
- package/dist/_tsup-dts-rollup.d.ts +6 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +2 -0
- package/package.json +13 -12
- package/src/storage/index.ts +15 -1
|
@@ -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
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/dynamodb",
|
|
3
|
-
"version": "0.10.
|
|
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.
|
|
27
|
-
"@aws-sdk/lib-dynamodb": "^3.
|
|
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.
|
|
35
|
-
"@types/node": "^20.17.
|
|
36
|
-
"@vitest/coverage-v8": "3.
|
|
37
|
-
"@vitest/ui": "3.
|
|
38
|
-
"axios": "^1.
|
|
39
|
-
"eslint": "^9.
|
|
40
|
-
"tsup": "^8.
|
|
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.
|
|
42
|
+
"vitest": "^3.2.2",
|
|
43
43
|
"@internal/lint": "0.0.10",
|
|
44
|
-
"@
|
|
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",
|
package/src/storage/index.ts
CHANGED
|
@@ -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 {
|
|
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
|
*/
|