@mastra/upstash 0.1.12 → 0.1.13-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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/upstash@0.1.12-alpha.1 build /home/runner/work/mastra/mastra/stores/upstash
2
+ > @mastra/upstash@0.1.13-alpha.0 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 9156ms
9
+ TSC ⚡️ Build success in 9737ms
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 10167ms
16
+ DTS ⚡️ Build success in 10952ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 16.12 KB
21
- ESM ⚡️ Build success in 692ms
22
- CJS dist/index.cjs 16.25 KB
23
- CJS ⚡️ Build success in 698ms
20
+ CJS dist/index.cjs 16.31 KB
21
+ CJS ⚡️ Build success in 711ms
22
+ ESM dist/index.js 16.19 KB
23
+ ESM ⚡️ Build success in 717ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.1.13-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 7911ddf: Sanitize redis keys on workflow snapshot storage
8
+ - Updated dependencies [fb68a80]
9
+ - Updated dependencies [b56a681]
10
+ - Updated dependencies [248cb07]
11
+ - @mastra/core@0.6.4-alpha.0
12
+
3
13
  ## 0.1.12
4
14
 
5
15
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -26,7 +26,7 @@ var UpstashStore = class extends storage.MastraStorage {
26
26
  });
27
27
  }
28
28
  getKey(tableName, keys) {
29
- const keyParts = Object.entries(keys).map(([key, value]) => `${key}:${value}`);
29
+ const keyParts = Object.entries(keys).filter(([_, value]) => value !== void 0).map(([key, value]) => `${key}:${value}`);
30
30
  return `${tableName}:${keyParts.join(":")}`;
31
31
  }
32
32
  ensureDate(date) {
@@ -192,7 +192,7 @@ var UpstashStore = class extends storage.MastraStorage {
192
192
  return messages.map(({ _index, ...message }) => message);
193
193
  }
194
194
  async persistWorkflowSnapshot(params) {
195
- const { namespace, workflowName, runId, snapshot } = params;
195
+ const { namespace = "workflows", workflowName, runId, snapshot } = params;
196
196
  const key = this.getKey(storage.MastraStorage.TABLE_WORKFLOW_SNAPSHOT, {
197
197
  namespace,
198
198
  workflow_name: workflowName,
@@ -201,7 +201,7 @@ var UpstashStore = class extends storage.MastraStorage {
201
201
  await this.redis.set(key, snapshot);
202
202
  }
203
203
  async loadWorkflowSnapshot(params) {
204
- const { namespace, workflowName, runId } = params;
204
+ const { namespace = "workflows", workflowName, runId } = params;
205
205
  const key = this.getKey(storage.MastraStorage.TABLE_WORKFLOW_SNAPSHOT, {
206
206
  namespace,
207
207
  workflow_name: workflowName,
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ var UpstashStore = class extends MastraStorage {
24
24
  });
25
25
  }
26
26
  getKey(tableName, keys) {
27
- const keyParts = Object.entries(keys).map(([key, value]) => `${key}:${value}`);
27
+ const keyParts = Object.entries(keys).filter(([_, value]) => value !== void 0).map(([key, value]) => `${key}:${value}`);
28
28
  return `${tableName}:${keyParts.join(":")}`;
29
29
  }
30
30
  ensureDate(date) {
@@ -190,7 +190,7 @@ var UpstashStore = class extends MastraStorage {
190
190
  return messages.map(({ _index, ...message }) => message);
191
191
  }
192
192
  async persistWorkflowSnapshot(params) {
193
- const { namespace, workflowName, runId, snapshot } = params;
193
+ const { namespace = "workflows", workflowName, runId, snapshot } = params;
194
194
  const key = this.getKey(MastraStorage.TABLE_WORKFLOW_SNAPSHOT, {
195
195
  namespace,
196
196
  workflow_name: workflowName,
@@ -199,7 +199,7 @@ var UpstashStore = class extends MastraStorage {
199
199
  await this.redis.set(key, snapshot);
200
200
  }
201
201
  async loadWorkflowSnapshot(params) {
202
- const { namespace, workflowName, runId } = params;
202
+ const { namespace = "workflows", workflowName, runId } = params;
203
203
  const key = this.getKey(MastraStorage.TABLE_WORKFLOW_SNAPSHOT, {
204
204
  namespace,
205
205
  workflow_name: workflowName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/upstash",
3
- "version": "0.1.12",
3
+ "version": "0.1.13-alpha.0",
4
4
  "description": "Upstash provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@upstash/redis": "^1.34.5",
23
23
  "@upstash/vector": "^1.2.1",
24
- "@mastra/core": "^0.6.3"
24
+ "@mastra/core": "^0.6.4-alpha.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@microsoft/api-extractor": "^7.52.1",
@@ -36,7 +36,9 @@ export class UpstashStore extends MastraStorage {
36
36
  }
37
37
 
38
38
  private getKey(tableName: TABLE_NAMES, keys: Record<string, any>): string {
39
- const keyParts = Object.entries(keys).map(([key, value]) => `${key}:${value}`);
39
+ const keyParts = Object.entries(keys)
40
+ .filter(([_, value]) => value !== undefined)
41
+ .map(([key, value]) => `${key}:${value}`);
40
42
  return `${tableName}:${keyParts.join(':')}`;
41
43
  }
42
44
 
@@ -272,7 +274,7 @@ export class UpstashStore extends MastraStorage {
272
274
  runId: string;
273
275
  snapshot: WorkflowRunState;
274
276
  }): Promise<void> {
275
- const { namespace, workflowName, runId, snapshot } = params;
277
+ const { namespace = 'workflows', workflowName, runId, snapshot } = params;
276
278
  const key = this.getKey(MastraStorage.TABLE_WORKFLOW_SNAPSHOT, {
277
279
  namespace,
278
280
  workflow_name: workflowName,
@@ -286,7 +288,7 @@ export class UpstashStore extends MastraStorage {
286
288
  workflowName: string;
287
289
  runId: string;
288
290
  }): Promise<WorkflowRunState | null> {
289
- const { namespace, workflowName, runId } = params;
291
+ const { namespace = 'workflows', workflowName, runId } = params;
290
292
  const key = this.getKey(MastraStorage.TABLE_WORKFLOW_SNAPSHOT, {
291
293
  namespace,
292
294
  workflow_name: workflowName,