@mastra/upstash 0.2.6-alpha.2 → 0.3.0-alpha.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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +11 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/storage/index.ts +1 -1
- package/src/storage/upstash.test.ts +15 -15
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/upstash@0.
|
|
2
|
+
> @mastra/upstash@0.3.0-alpha.3 build /home/runner/work/mastra/mastra/stores/upstash
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 10205ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 11550ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
20
|
[32mESM[39m [1mdist/index.js [22m[32m24.02 KB[39m
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 1221ms
|
|
22
22
|
[32mCJS[39m [1mdist/index.cjs [22m[32m24.11 KB[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 1222ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @mastra/upstash
|
|
2
2
|
|
|
3
|
+
## 0.3.0-alpha.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fe3ae4d: Remove \_\_ functions in storage and move to storage proxy to make sure init is called
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [fe3ae4d]
|
|
12
|
+
- @mastra/core@0.9.0-alpha.3
|
|
13
|
+
|
|
3
14
|
## 0.2.6-alpha.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -279,7 +279,7 @@ var UpstashStore = class extends storage.MastraStorage {
|
|
|
279
279
|
...metadata
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
|
-
await this.
|
|
282
|
+
await this.saveThread({ thread: updatedThread });
|
|
283
283
|
return updatedThread;
|
|
284
284
|
}
|
|
285
285
|
async deleteThread({ threadId }) {
|
package/dist/index.js
CHANGED
|
@@ -277,7 +277,7 @@ var UpstashStore = class extends MastraStorage {
|
|
|
277
277
|
...metadata
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
await this.
|
|
280
|
+
await this.saveThread({ thread: updatedThread });
|
|
281
281
|
return updatedThread;
|
|
282
282
|
}
|
|
283
283
|
async deleteThread({ threadId }) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/upstash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-alpha.3",
|
|
4
4
|
"description": "Upstash provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@upstash/redis": "^1.34.5",
|
|
24
24
|
"@upstash/vector": "^1.2.1",
|
|
25
|
-
"@mastra/core": "^0.
|
|
25
|
+
"@mastra/core": "^0.9.0-alpha.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@microsoft/api-extractor": "^7.52.1",
|
package/src/storage/index.ts
CHANGED
|
@@ -172,10 +172,10 @@ describe('UpstashStore', () => {
|
|
|
172
172
|
const now = new Date();
|
|
173
173
|
const thread = createSampleThread(now);
|
|
174
174
|
|
|
175
|
-
const savedThread = await store.
|
|
175
|
+
const savedThread = await store.saveThread({ thread });
|
|
176
176
|
expect(savedThread).toEqual(thread);
|
|
177
177
|
|
|
178
|
-
const retrievedThread = await store.
|
|
178
|
+
const retrievedThread = await store.getThreadById({ threadId: thread.id });
|
|
179
179
|
expect(retrievedThread).toEqual({
|
|
180
180
|
...thread,
|
|
181
181
|
createdAt: new Date(now.toISOString()),
|
|
@@ -208,7 +208,7 @@ describe('UpstashStore', () => {
|
|
|
208
208
|
|
|
209
209
|
await store.saveThread({ thread });
|
|
210
210
|
|
|
211
|
-
const updatedThread = await store.
|
|
211
|
+
const updatedThread = await store.updateThread({
|
|
212
212
|
id: thread.id,
|
|
213
213
|
title: 'Updated Title',
|
|
214
214
|
metadata: { updated: 'value' },
|
|
@@ -290,7 +290,7 @@ describe('UpstashStore', () => {
|
|
|
290
290
|
await store.clearTable({ tableName: TABLE_THREADS });
|
|
291
291
|
|
|
292
292
|
// Create a test thread
|
|
293
|
-
await store.
|
|
293
|
+
await store.saveThread({
|
|
294
294
|
thread: {
|
|
295
295
|
id: threadId,
|
|
296
296
|
resourceId: 'resource-1',
|
|
@@ -309,15 +309,15 @@ describe('UpstashStore', () => {
|
|
|
309
309
|
createSampleMessage(threadId, 'Third'),
|
|
310
310
|
];
|
|
311
311
|
|
|
312
|
-
await store.
|
|
312
|
+
await store.saveMessages({ messages: messages as MessageType[] });
|
|
313
313
|
|
|
314
|
-
const retrievedMessages = await store.
|
|
314
|
+
const retrievedMessages = await store.getMessages({ threadId });
|
|
315
315
|
expect(retrievedMessages).toHaveLength(3);
|
|
316
316
|
expect(retrievedMessages.map(m => m.content[0].text)).toEqual(['First', 'Second', 'Third']);
|
|
317
317
|
});
|
|
318
318
|
|
|
319
319
|
it('should handle empty message array', async () => {
|
|
320
|
-
const result = await store.
|
|
320
|
+
const result = await store.saveMessages({ messages: [] });
|
|
321
321
|
expect(result).toEqual([]);
|
|
322
322
|
});
|
|
323
323
|
|
|
@@ -337,9 +337,9 @@ describe('UpstashStore', () => {
|
|
|
337
337
|
},
|
|
338
338
|
];
|
|
339
339
|
|
|
340
|
-
await store.
|
|
340
|
+
await store.saveMessages({ messages: messages as MessageType[] });
|
|
341
341
|
|
|
342
|
-
const retrievedMessages = await store.
|
|
342
|
+
const retrievedMessages = await store.getMessages({ threadId });
|
|
343
343
|
expect(retrievedMessages[0].content).toEqual(messages[0].content);
|
|
344
344
|
});
|
|
345
345
|
});
|
|
@@ -547,7 +547,7 @@ describe('UpstashStore', () => {
|
|
|
547
547
|
await store.clearTable({ tableName: TABLE_WORKFLOW_SNAPSHOT });
|
|
548
548
|
});
|
|
549
549
|
it('returns empty array when no workflows exist', async () => {
|
|
550
|
-
const { runs, total } = await store.
|
|
550
|
+
const { runs, total } = await store.getWorkflowRuns();
|
|
551
551
|
expect(runs).toEqual([]);
|
|
552
552
|
expect(total).toBe(0);
|
|
553
553
|
});
|
|
@@ -573,7 +573,7 @@ describe('UpstashStore', () => {
|
|
|
573
573
|
snapshot: workflow2,
|
|
574
574
|
});
|
|
575
575
|
|
|
576
|
-
const { runs, total } = await store.
|
|
576
|
+
const { runs, total } = await store.getWorkflowRuns({ namespace: testNamespace });
|
|
577
577
|
expect(runs).toHaveLength(2);
|
|
578
578
|
expect(total).toBe(2);
|
|
579
579
|
expect(runs[0]!.workflowName).toBe(workflowName2); // Most recent first
|
|
@@ -605,7 +605,7 @@ describe('UpstashStore', () => {
|
|
|
605
605
|
snapshot: workflow2,
|
|
606
606
|
});
|
|
607
607
|
|
|
608
|
-
const { runs, total } = await store.
|
|
608
|
+
const { runs, total } = await store.getWorkflowRuns({ namespace: testNamespace, workflowName: workflowName1 });
|
|
609
609
|
expect(runs).toHaveLength(1);
|
|
610
610
|
expect(total).toBe(1);
|
|
611
611
|
expect(runs[0]!.workflowName).toBe(workflowName1);
|
|
@@ -659,7 +659,7 @@ describe('UpstashStore', () => {
|
|
|
659
659
|
},
|
|
660
660
|
});
|
|
661
661
|
|
|
662
|
-
const { runs } = await store.
|
|
662
|
+
const { runs } = await store.getWorkflowRuns({
|
|
663
663
|
namespace: testNamespace,
|
|
664
664
|
fromDate: yesterday,
|
|
665
665
|
toDate: now,
|
|
@@ -705,7 +705,7 @@ describe('UpstashStore', () => {
|
|
|
705
705
|
});
|
|
706
706
|
|
|
707
707
|
// Get first page
|
|
708
|
-
const page1 = await store.
|
|
708
|
+
const page1 = await store.getWorkflowRuns({
|
|
709
709
|
namespace: testNamespace,
|
|
710
710
|
limit: 2,
|
|
711
711
|
offset: 0,
|
|
@@ -720,7 +720,7 @@ describe('UpstashStore', () => {
|
|
|
720
720
|
expect(secondSnapshot.context?.steps[stepId2]?.status).toBe('running');
|
|
721
721
|
|
|
722
722
|
// Get second page
|
|
723
|
-
const page2 = await store.
|
|
723
|
+
const page2 = await store.getWorkflowRuns({
|
|
724
724
|
namespace: testNamespace,
|
|
725
725
|
limit: 2,
|
|
726
726
|
offset: 2,
|