@mastra/upstash 0.3.2-alpha.1 → 0.3.2-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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/upstash@0.3.2-alpha.1 build /home/runner/work/mastra/mastra/stores/upstash
2
+ > @mastra/upstash@0.3.2-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
  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 8899ms
9
+ TSC ⚡️ Build success in 9132ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
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.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/upstash/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 10853ms
16
+ DTS ⚡️ Build success in 11009ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 28.51 KB
21
- ESM ⚡️ Build success in 1082ms
22
- CJS dist/index.cjs 28.65 KB
23
- CJS ⚡️ Build success in 1079ms
20
+ ESM dist/index.js 28.88 KB
21
+ ESM ⚡️ Build success in 1143ms
22
+ CJS dist/index.cjs 29.03 KB
23
+ CJS ⚡️ Build success in 1149ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.3.2-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 4155f47: Add parameters to filter workflow runs
8
+ Add fromDate and toDate to telemetry parameters
9
+ - Updated dependencies [967b41c]
10
+ - Updated dependencies [4155f47]
11
+ - Updated dependencies [17826a9]
12
+ - @mastra/core@0.9.2-alpha.3
13
+
14
+ ## 0.3.2-alpha.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [26738f4]
19
+ - @mastra/core@0.9.2-alpha.2
20
+
3
21
  ## 0.3.2-alpha.1
4
22
 
5
23
  ### Patch Changes
@@ -54,13 +54,15 @@ declare class UpstashStore extends MastraStorage {
54
54
  }): Promise<void>;
55
55
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
56
56
  private transformEvalRecord;
57
- getTraces({ name, scope, page, perPage, attributes, filters, }?: {
57
+ getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
58
58
  name?: string;
59
59
  scope?: string;
60
60
  page: number;
61
61
  perPage: number;
62
62
  attributes?: Record<string, string>;
63
63
  filters?: Record<string, any>;
64
+ fromDate?: Date;
65
+ toDate?: Date;
64
66
  }): Promise<any[]>;
65
67
  private parseJSON;
66
68
  private redis;
@@ -54,13 +54,15 @@ declare class UpstashStore extends MastraStorage {
54
54
  }): Promise<void>;
55
55
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
56
56
  private transformEvalRecord;
57
- getTraces({ name, scope, page, perPage, attributes, filters, }?: {
57
+ getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
58
58
  name?: string;
59
59
  scope?: string;
60
60
  page: number;
61
61
  perPage: number;
62
62
  attributes?: Record<string, string>;
63
63
  filters?: Record<string, any>;
64
+ fromDate?: Date;
65
+ toDate?: Date;
64
66
  }): Promise<any[]>;
65
67
  private parseJSON;
66
68
  private redis;
package/dist/index.cjs CHANGED
@@ -94,7 +94,9 @@ var UpstashStore = class extends storage.MastraStorage {
94
94
  page = 0,
95
95
  perPage = 100,
96
96
  attributes,
97
- filters
97
+ filters,
98
+ fromDate,
99
+ toDate
98
100
  } = {
99
101
  page: 0,
100
102
  perPage: 100
@@ -130,6 +132,16 @@ var UpstashStore = class extends storage.MastraStorage {
130
132
  (record) => Object.entries(filters).every(([key, value]) => record[key] === value)
131
133
  );
132
134
  }
135
+ if (fromDate) {
136
+ filteredTraces = filteredTraces.filter(
137
+ (record) => new Date(record.createdAt).getTime() >= new Date(fromDate).getTime()
138
+ );
139
+ }
140
+ if (toDate) {
141
+ filteredTraces = filteredTraces.filter(
142
+ (record) => new Date(record.createdAt).getTime() <= new Date(toDate).getTime()
143
+ );
144
+ }
133
145
  filteredTraces.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
134
146
  const start = page * perPage;
135
147
  const end = start + perPage;
package/dist/index.js CHANGED
@@ -92,7 +92,9 @@ var UpstashStore = class extends MastraStorage {
92
92
  page = 0,
93
93
  perPage = 100,
94
94
  attributes,
95
- filters
95
+ filters,
96
+ fromDate,
97
+ toDate
96
98
  } = {
97
99
  page: 0,
98
100
  perPage: 100
@@ -128,6 +130,16 @@ var UpstashStore = class extends MastraStorage {
128
130
  (record) => Object.entries(filters).every(([key, value]) => record[key] === value)
129
131
  );
130
132
  }
133
+ if (fromDate) {
134
+ filteredTraces = filteredTraces.filter(
135
+ (record) => new Date(record.createdAt).getTime() >= new Date(fromDate).getTime()
136
+ );
137
+ }
138
+ if (toDate) {
139
+ filteredTraces = filteredTraces.filter(
140
+ (record) => new Date(record.createdAt).getTime() <= new Date(toDate).getTime()
141
+ );
142
+ }
131
143
  filteredTraces.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
132
144
  const start = page * perPage;
133
145
  const end = start + perPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/upstash",
3
- "version": "0.3.2-alpha.1",
3
+ "version": "0.3.2-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.9.2-alpha.1"
25
+ "@mastra/core": "^0.9.2-alpha.3"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@microsoft/api-extractor": "^7.52.5",
@@ -143,6 +143,8 @@ export class UpstashStore extends MastraStorage {
143
143
  perPage = 100,
144
144
  attributes,
145
145
  filters,
146
+ fromDate,
147
+ toDate,
146
148
  }: {
147
149
  name?: string;
148
150
  scope?: string;
@@ -150,6 +152,8 @@ export class UpstashStore extends MastraStorage {
150
152
  perPage: number;
151
153
  attributes?: Record<string, string>;
152
154
  filters?: Record<string, any>;
155
+ fromDate?: Date;
156
+ toDate?: Date;
153
157
  } = {
154
158
  page: 0,
155
159
  perPage: 100,
@@ -204,6 +208,20 @@ export class UpstashStore extends MastraStorage {
204
208
  );
205
209
  }
206
210
 
211
+ // Apply fromDate filter if provided
212
+ if (fromDate) {
213
+ filteredTraces = filteredTraces.filter(
214
+ record => new Date(record.createdAt).getTime() >= new Date(fromDate).getTime(),
215
+ );
216
+ }
217
+
218
+ // Apply toDate filter if provided
219
+ if (toDate) {
220
+ filteredTraces = filteredTraces.filter(
221
+ record => new Date(record.createdAt).getTime() <= new Date(toDate).getTime(),
222
+ );
223
+ }
224
+
207
225
  // Sort traces by creation date (newest first)
208
226
  filteredTraces.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
209
227