@mastra/dynamodb 0.11.1-alpha.0 → 0.11.1-alpha.2
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 +10 -7
- package/dist/_tsup-dts-rollup.d.ts +10 -7
- package/dist/index.cjs +314 -92
- package/dist/index.js +290 -68
- package/package.json +3 -3
- package/src/storage/index.test.ts +77 -0
- package/src/storage/index.ts +308 -75
|
@@ -12,6 +12,7 @@ import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
|
12
12
|
import type { StorageGetTracesArg } from '@mastra/core/storage';
|
|
13
13
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
14
14
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
15
|
+
import type { TABLE_RESOURCES } from '@mastra/core/storage';
|
|
15
16
|
import type { Trace } from '@mastra/core/telemetry';
|
|
16
17
|
import type { WorkflowRun } from '@mastra/core/storage';
|
|
17
18
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
@@ -89,27 +90,27 @@ declare class DynamoDBStore extends MastraStorage {
|
|
|
89
90
|
* Clear all items from a logical "table" (entity type)
|
|
90
91
|
*/
|
|
91
92
|
clearTable({ tableName }: {
|
|
92
|
-
tableName:
|
|
93
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
93
94
|
}): Promise<void>;
|
|
94
95
|
/**
|
|
95
96
|
* Insert a record into the specified "table" (entity)
|
|
96
97
|
*/
|
|
97
|
-
insert({ tableName, record }: {
|
|
98
|
-
tableName:
|
|
98
|
+
insert({ tableName, record, }: {
|
|
99
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
99
100
|
record: Record<string, any>;
|
|
100
101
|
}): Promise<void>;
|
|
101
102
|
/**
|
|
102
103
|
* Insert multiple records as a batch
|
|
103
104
|
*/
|
|
104
|
-
batchInsert({ tableName, records }: {
|
|
105
|
-
tableName:
|
|
105
|
+
batchInsert({ tableName, records, }: {
|
|
106
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
106
107
|
records: Record<string, any>[];
|
|
107
108
|
}): Promise<void>;
|
|
108
109
|
/**
|
|
109
110
|
* Load a record by its keys
|
|
110
111
|
*/
|
|
111
|
-
load<R>({ tableName, keys }: {
|
|
112
|
-
tableName:
|
|
112
|
+
load<R>({ tableName, keys, }: {
|
|
113
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
113
114
|
keys: Record<string, string>;
|
|
114
115
|
}): Promise<R | null>;
|
|
115
116
|
getThreadById({ threadId }: {
|
|
@@ -887,6 +888,8 @@ export declare const messageEntity: Entity<string, string, string, {
|
|
|
887
888
|
};
|
|
888
889
|
}>;
|
|
889
890
|
|
|
891
|
+
declare type SUPPORTED_TABLE_NAMES = Exclude<TABLE_NAMES, typeof TABLE_RESOURCES>;
|
|
892
|
+
|
|
890
893
|
export declare const threadEntity: Entity<string, string, string, {
|
|
891
894
|
model: {
|
|
892
895
|
entity: string;
|
|
@@ -12,6 +12,7 @@ import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
|
12
12
|
import type { StorageGetTracesArg } from '@mastra/core/storage';
|
|
13
13
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
14
14
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
15
|
+
import type { TABLE_RESOURCES } from '@mastra/core/storage';
|
|
15
16
|
import type { Trace } from '@mastra/core/telemetry';
|
|
16
17
|
import type { WorkflowRun } from '@mastra/core/storage';
|
|
17
18
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
@@ -89,27 +90,27 @@ declare class DynamoDBStore extends MastraStorage {
|
|
|
89
90
|
* Clear all items from a logical "table" (entity type)
|
|
90
91
|
*/
|
|
91
92
|
clearTable({ tableName }: {
|
|
92
|
-
tableName:
|
|
93
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
93
94
|
}): Promise<void>;
|
|
94
95
|
/**
|
|
95
96
|
* Insert a record into the specified "table" (entity)
|
|
96
97
|
*/
|
|
97
|
-
insert({ tableName, record }: {
|
|
98
|
-
tableName:
|
|
98
|
+
insert({ tableName, record, }: {
|
|
99
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
99
100
|
record: Record<string, any>;
|
|
100
101
|
}): Promise<void>;
|
|
101
102
|
/**
|
|
102
103
|
* Insert multiple records as a batch
|
|
103
104
|
*/
|
|
104
|
-
batchInsert({ tableName, records }: {
|
|
105
|
-
tableName:
|
|
105
|
+
batchInsert({ tableName, records, }: {
|
|
106
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
106
107
|
records: Record<string, any>[];
|
|
107
108
|
}): Promise<void>;
|
|
108
109
|
/**
|
|
109
110
|
* Load a record by its keys
|
|
110
111
|
*/
|
|
111
|
-
load<R>({ tableName, keys }: {
|
|
112
|
-
tableName:
|
|
112
|
+
load<R>({ tableName, keys, }: {
|
|
113
|
+
tableName: SUPPORTED_TABLE_NAMES;
|
|
113
114
|
keys: Record<string, string>;
|
|
114
115
|
}): Promise<R | null>;
|
|
115
116
|
getThreadById({ threadId }: {
|
|
@@ -887,6 +888,8 @@ export declare const messageEntity: Entity<string, string, string, {
|
|
|
887
888
|
};
|
|
888
889
|
}>;
|
|
889
890
|
|
|
891
|
+
declare type SUPPORTED_TABLE_NAMES = Exclude<TABLE_NAMES, typeof TABLE_RESOURCES>;
|
|
892
|
+
|
|
890
893
|
export declare const threadEntity: Entity<string, string, string, {
|
|
891
894
|
model: {
|
|
892
895
|
entity: string;
|