@mastra/upstash 0.2.6-alpha.2 → 0.3.0-alpha.4

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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/upstash@0.2.6-alpha.2 build /home/runner/work/mastra/mastra/stores/upstash
2
+ > @mastra/upstash@0.3.0-alpha.4 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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 9623ms
9
+ TSC ⚡️ Build success in 8348ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.2
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.2
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 11248ms
16
+ DTS ⚡️ Build success in 11416ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
20
  ESM dist/index.js 24.02 KB
21
- ESM ⚡️ Build success in 1023ms
21
+ ESM ⚡️ Build success in 919ms
22
22
  CJS dist/index.cjs 24.11 KB
23
- CJS ⚡️ Build success in 1024ms
23
+ CJS ⚡️ Build success in 922ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.3.0-alpha.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7e92011]
8
+ - @mastra/core@0.9.0-alpha.4
9
+
10
+ ## 0.3.0-alpha.3
11
+
12
+ ### Minor Changes
13
+
14
+ - fe3ae4d: Remove \_\_ functions in storage and move to storage proxy to make sure init is called
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [fe3ae4d]
19
+ - @mastra/core@0.9.0-alpha.3
20
+
3
21
  ## 0.2.6-alpha.2
4
22
 
5
23
  ### 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.__saveThread({ thread: updatedThread });
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.__saveThread({ thread: updatedThread });
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.2.6-alpha.2",
3
+ "version": "0.3.0-alpha.4",
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.8.4-alpha.2"
25
+ "@mastra/core": "^0.9.0-alpha.4"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@microsoft/api-extractor": "^7.52.1",
@@ -388,7 +388,7 @@ export class UpstashStore extends MastraStorage {
388
388
  },
389
389
  };
390
390
 
391
- await this.__saveThread({ thread: updatedThread });
391
+ await this.saveThread({ thread: updatedThread });
392
392
  return updatedThread;
393
393
  }
394
394
 
@@ -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.__saveThread({ thread });
175
+ const savedThread = await store.saveThread({ thread });
176
176
  expect(savedThread).toEqual(thread);
177
177
 
178
- const retrievedThread = await store.__getThreadById({ threadId: thread.id });
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.__updateThread({
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.__saveThread({
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.__saveMessages({ messages: messages as MessageType[] });
312
+ await store.saveMessages({ messages: messages as MessageType[] });
313
313
 
314
- const retrievedMessages = await store.__getMessages({ threadId });
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.__saveMessages({ messages: [] });
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.__saveMessages({ messages: messages as MessageType[] });
340
+ await store.saveMessages({ messages: messages as MessageType[] });
341
341
 
342
- const retrievedMessages = await store.__getMessages({ threadId });
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.__getWorkflowRuns();
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.__getWorkflowRuns({ namespace: testNamespace });
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.__getWorkflowRuns({ namespace: testNamespace, workflowName: workflowName1 });
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.__getWorkflowRuns({
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.__getWorkflowRuns({
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.__getWorkflowRuns({
723
+ const page2 = await store.getWorkflowRuns({
724
724
  namespace: testNamespace,
725
725
  limit: 2,
726
726
  offset: 2,