@mastra/upstash 0.10.3-alpha.1 → 0.10.3-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,39 +1,39 @@
1
1
 
2
- > @mastra/upstash@0.10.3-alpha.1 build /home/runner/work/mastra/mastra/stores/upstash
2
+ > @mastra/upstash@0.10.3-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.5.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 10151ms
9
+ TSC ⚡️ Build success in 9774ms
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 11729ms
16
+ DTS ⚡️ Build success in 10947ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
20
  dist/index.cjs (1651:18): Use of eval in "dist/index.cjs" is strongly discouraged as it poses security risks and may cause issues with minification.
21
21
  dist/index.js (1651:18): Use of eval in "dist/index.js" is strongly discouraged as it poses security risks and may cause issues with minification.
22
+ CJS dist/getMachineId-win-ZTI2LRDJ.cjs 1.66 KB
22
23
  CJS dist/getMachineId-darwin-3PL23DL6.cjs 1.19 KB
24
+ CJS dist/getMachineId-unsupported-DEDJN4ZS.cjs 777.00 B
25
+ CJS dist/chunk-N2CPQVE3.cjs 1.09 KB
23
26
  CJS dist/getMachineId-linux-KYLPK3HC.cjs 813.00 B
24
27
  CJS dist/getMachineId-bsd-HDZ73WR7.cjs 1015.00 B
25
- CJS dist/chunk-N2CPQVE3.cjs 1.09 KB
26
- CJS dist/getMachineId-win-ZTI2LRDJ.cjs 1.66 KB
27
- CJS dist/getMachineId-unsupported-DEDJN4ZS.cjs 777.00 B
28
28
  CJS dist/chunk-U74OJRHU.cjs 62.08 KB
29
29
  CJS dist/index.cjs 1.65 MB
30
- CJS ⚡️ Build success in 21940ms
31
- ESM dist/getMachineId-linux-K3QXQYAB.js 740.00 B
30
+ CJS ⚡️ Build success in 22089ms
32
31
  ESM dist/getMachineId-darwin-UTKBTJ2U.js 1.08 KB
33
- ESM dist/getMachineId-win-L2EYIM5A.js 1.04 KB
32
+ ESM dist/getMachineId-linux-K3QXQYAB.js 740.00 B
34
33
  ESM dist/getMachineId-bsd-KKIDU47O.js 896.00 B
34
+ ESM dist/getMachineId-win-L2EYIM5A.js 1.04 KB
35
35
  ESM dist/chunk-IGKEDEDE.js 452.00 B
36
36
  ESM dist/getMachineId-unsupported-VPWBQCK7.js 700.00 B
37
37
  ESM dist/chunk-HSTZWXH7.js 61.52 KB
38
38
  ESM dist/index.js 1.64 MB
39
- ESM ⚡️ Build success in 21983ms
39
+ ESM ⚡️ Build success in 22103ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @mastra/upstash
2
2
 
3
+ ## 0.10.3-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 925ab94: added paginated functions to base class and added boilerplate and updated imports
8
+ - a914da2: Fix upstash paginated APIs
9
+ - Updated dependencies [925ab94]
10
+ - @mastra/core@0.10.4-alpha.3
11
+
12
+ ## 0.10.3-alpha.2
13
+
14
+ ### Patch Changes
15
+
16
+ - 48eddb9: update filter logic in Memory class to support semantic recall search scope
17
+ - Updated dependencies [48eddb9]
18
+ - @mastra/core@0.10.4-alpha.2
19
+
3
20
  ## 0.10.3-alpha.1
4
21
 
5
22
  ### Patch Changes
@@ -10,10 +10,13 @@ import type { MastraMessageV2 } from '@mastra/core/memory';
10
10
  import { MastraStorage } from '@mastra/core/storage';
11
11
  import { MastraVector } from '@mastra/core/vector';
12
12
  import type { OperatorSupport } from '@mastra/core/vector/filter';
13
+ import type { PaginationArgs } from '@mastra/core/storage';
14
+ import type { PaginationInfo } from '@mastra/core/storage';
13
15
  import type { QueryResult } from '@mastra/core/vector';
14
16
  import type { QueryVectorParams } from '@mastra/core/vector';
15
17
  import type { StorageColumn } from '@mastra/core/storage';
16
18
  import type { StorageGetMessagesArg } from '@mastra/core/storage';
19
+ import type { StorageGetTracesArg } from '@mastra/core/storage';
17
20
  import type { StorageThreadType } from '@mastra/core/memory';
18
21
  import type { TABLE_NAMES } from '@mastra/core/storage';
19
22
  import type { UpdateVectorParams } from '@mastra/core/vector';
@@ -55,6 +58,9 @@ export declare class UpstashFilterTranslator extends BaseFilterTranslator {
55
58
  declare class UpstashStore extends MastraStorage {
56
59
  private redis;
57
60
  constructor(config: UpstashConfig);
61
+ get supports(): {
62
+ selectByIncludeResourceScope: boolean;
63
+ };
58
64
  private transformEvalRecord;
59
65
  private parseJSON;
60
66
  private getKey;
@@ -78,32 +84,17 @@ declare class UpstashStore extends MastraStorage {
78
84
  * @deprecated Use getEvals instead
79
85
  */
80
86
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
81
- getTraces(args: {
82
- name?: string;
83
- scope?: string;
84
- attributes?: Record<string, string>;
85
- filters?: Record<string, any>;
86
- page: number;
87
- perPage?: number;
88
- fromDate?: Date;
89
- toDate?: Date;
90
- }): Promise<any[]>;
91
- getTraces(args: {
87
+ /**
88
+ * @deprecated use getTracesPaginated instead
89
+ */
90
+ getTraces(args: StorageGetTracesArg): Promise<any[]>;
91
+ getTracesPaginated(args: {
92
92
  name?: string;
93
93
  scope?: string;
94
- page: number;
95
- perPage?: number;
96
94
  attributes?: Record<string, string>;
97
95
  filters?: Record<string, any>;
98
- fromDate?: Date;
99
- toDate?: Date;
100
- returnPaginationResults: true;
101
- }): Promise<{
96
+ } & PaginationArgs): Promise<PaginationInfo & {
102
97
  traces: any[];
103
- total: number;
104
- page: number;
105
- perPage: number;
106
- hasMore: boolean;
107
98
  }>;
108
99
  createTable({ tableName, schema, }: {
109
100
  tableName: TABLE_NAMES;
@@ -138,19 +129,16 @@ declare class UpstashStore extends MastraStorage {
138
129
  getThreadById({ threadId }: {
139
130
  threadId: string;
140
131
  }): Promise<StorageThreadType | null>;
141
- getThreadsByResourceId(args: {
132
+ /**
133
+ * @deprecated use getThreadsByResourceIdPaginated instead
134
+ */
135
+ getThreadsByResourceId({ resourceId }: {
142
136
  resourceId: string;
143
137
  }): Promise<StorageThreadType[]>;
144
- getThreadsByResourceId(args: {
138
+ getThreadsByResourceIdPaginated(args: {
145
139
  resourceId: string;
146
- page: number;
147
- perPage?: number;
148
- }): Promise<{
140
+ } & PaginationArgs): Promise<PaginationInfo & {
149
141
  threads: StorageThreadType[];
150
- total: number;
151
- page: number;
152
- perPage: number;
153
- hasMore: boolean;
154
142
  }>;
155
143
  saveThread({ thread }: {
156
144
  thread: StorageThreadType;
@@ -171,24 +159,20 @@ declare class UpstashStore extends MastraStorage {
171
159
  messages: MastraMessageV2[];
172
160
  format: 'v2';
173
161
  }): Promise<MastraMessageV2[]>;
162
+ private _getIncludedMessages;
163
+ /**
164
+ * @deprecated use getMessagesPaginated instead
165
+ */
174
166
  getMessages(args: StorageGetMessagesArg & {
175
167
  format?: 'v1';
176
168
  }): Promise<MastraMessageV1[]>;
177
169
  getMessages(args: StorageGetMessagesArg & {
178
170
  format: 'v2';
179
171
  }): Promise<MastraMessageV2[]>;
180
- getMessages(args: StorageGetMessagesArg & {
172
+ getMessagesPaginated(args: StorageGetMessagesArg & {
181
173
  format?: 'v1' | 'v2';
182
- page: number;
183
- perPage?: number;
184
- fromDate?: Date;
185
- toDate?: Date;
186
- }): Promise<{
174
+ }): Promise<PaginationInfo & {
187
175
  messages: MastraMessageV1[] | MastraMessageV2[];
188
- total: number;
189
- page: number;
190
- perPage: number;
191
- hasMore: boolean;
192
176
  }>;
193
177
  persistWorkflowSnapshot(params: {
194
178
  namespace: string;
@@ -209,18 +193,8 @@ declare class UpstashStore extends MastraStorage {
209
193
  getEvals(options?: {
210
194
  agentName?: string;
211
195
  type?: 'test' | 'live';
212
- page?: number;
213
- perPage?: number;
214
- limit?: number;
215
- offset?: number;
216
- fromDate?: Date;
217
- toDate?: Date;
218
- }): Promise<{
196
+ } & PaginationArgs): Promise<PaginationInfo & {
219
197
  evals: EvalRow[];
220
- total: number;
221
- page?: number;
222
- perPage?: number;
223
- hasMore?: boolean;
224
198
  }>;
225
199
  getWorkflowRuns({ namespace, workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
226
200
  namespace: string;
@@ -10,10 +10,13 @@ import type { MastraMessageV2 } from '@mastra/core/memory';
10
10
  import { MastraStorage } from '@mastra/core/storage';
11
11
  import { MastraVector } from '@mastra/core/vector';
12
12
  import type { OperatorSupport } from '@mastra/core/vector/filter';
13
+ import type { PaginationArgs } from '@mastra/core/storage';
14
+ import type { PaginationInfo } from '@mastra/core/storage';
13
15
  import type { QueryResult } from '@mastra/core/vector';
14
16
  import type { QueryVectorParams } from '@mastra/core/vector';
15
17
  import type { StorageColumn } from '@mastra/core/storage';
16
18
  import type { StorageGetMessagesArg } from '@mastra/core/storage';
19
+ import type { StorageGetTracesArg } from '@mastra/core/storage';
17
20
  import type { StorageThreadType } from '@mastra/core/memory';
18
21
  import type { TABLE_NAMES } from '@mastra/core/storage';
19
22
  import type { UpdateVectorParams } from '@mastra/core/vector';
@@ -55,6 +58,9 @@ export declare class UpstashFilterTranslator extends BaseFilterTranslator {
55
58
  declare class UpstashStore extends MastraStorage {
56
59
  private redis;
57
60
  constructor(config: UpstashConfig);
61
+ get supports(): {
62
+ selectByIncludeResourceScope: boolean;
63
+ };
58
64
  private transformEvalRecord;
59
65
  private parseJSON;
60
66
  private getKey;
@@ -78,32 +84,17 @@ declare class UpstashStore extends MastraStorage {
78
84
  * @deprecated Use getEvals instead
79
85
  */
80
86
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
81
- getTraces(args: {
82
- name?: string;
83
- scope?: string;
84
- attributes?: Record<string, string>;
85
- filters?: Record<string, any>;
86
- page: number;
87
- perPage?: number;
88
- fromDate?: Date;
89
- toDate?: Date;
90
- }): Promise<any[]>;
91
- getTraces(args: {
87
+ /**
88
+ * @deprecated use getTracesPaginated instead
89
+ */
90
+ getTraces(args: StorageGetTracesArg): Promise<any[]>;
91
+ getTracesPaginated(args: {
92
92
  name?: string;
93
93
  scope?: string;
94
- page: number;
95
- perPage?: number;
96
94
  attributes?: Record<string, string>;
97
95
  filters?: Record<string, any>;
98
- fromDate?: Date;
99
- toDate?: Date;
100
- returnPaginationResults: true;
101
- }): Promise<{
96
+ } & PaginationArgs): Promise<PaginationInfo & {
102
97
  traces: any[];
103
- total: number;
104
- page: number;
105
- perPage: number;
106
- hasMore: boolean;
107
98
  }>;
108
99
  createTable({ tableName, schema, }: {
109
100
  tableName: TABLE_NAMES;
@@ -138,19 +129,16 @@ declare class UpstashStore extends MastraStorage {
138
129
  getThreadById({ threadId }: {
139
130
  threadId: string;
140
131
  }): Promise<StorageThreadType | null>;
141
- getThreadsByResourceId(args: {
132
+ /**
133
+ * @deprecated use getThreadsByResourceIdPaginated instead
134
+ */
135
+ getThreadsByResourceId({ resourceId }: {
142
136
  resourceId: string;
143
137
  }): Promise<StorageThreadType[]>;
144
- getThreadsByResourceId(args: {
138
+ getThreadsByResourceIdPaginated(args: {
145
139
  resourceId: string;
146
- page: number;
147
- perPage?: number;
148
- }): Promise<{
140
+ } & PaginationArgs): Promise<PaginationInfo & {
149
141
  threads: StorageThreadType[];
150
- total: number;
151
- page: number;
152
- perPage: number;
153
- hasMore: boolean;
154
142
  }>;
155
143
  saveThread({ thread }: {
156
144
  thread: StorageThreadType;
@@ -171,24 +159,20 @@ declare class UpstashStore extends MastraStorage {
171
159
  messages: MastraMessageV2[];
172
160
  format: 'v2';
173
161
  }): Promise<MastraMessageV2[]>;
162
+ private _getIncludedMessages;
163
+ /**
164
+ * @deprecated use getMessagesPaginated instead
165
+ */
174
166
  getMessages(args: StorageGetMessagesArg & {
175
167
  format?: 'v1';
176
168
  }): Promise<MastraMessageV1[]>;
177
169
  getMessages(args: StorageGetMessagesArg & {
178
170
  format: 'v2';
179
171
  }): Promise<MastraMessageV2[]>;
180
- getMessages(args: StorageGetMessagesArg & {
172
+ getMessagesPaginated(args: StorageGetMessagesArg & {
181
173
  format?: 'v1' | 'v2';
182
- page: number;
183
- perPage?: number;
184
- fromDate?: Date;
185
- toDate?: Date;
186
- }): Promise<{
174
+ }): Promise<PaginationInfo & {
187
175
  messages: MastraMessageV1[] | MastraMessageV2[];
188
- total: number;
189
- page: number;
190
- perPage: number;
191
- hasMore: boolean;
192
176
  }>;
193
177
  persistWorkflowSnapshot(params: {
194
178
  namespace: string;
@@ -209,18 +193,8 @@ declare class UpstashStore extends MastraStorage {
209
193
  getEvals(options?: {
210
194
  agentName?: string;
211
195
  type?: 'test' | 'live';
212
- page?: number;
213
- perPage?: number;
214
- limit?: number;
215
- offset?: number;
216
- fromDate?: Date;
217
- toDate?: Date;
218
- }): Promise<{
196
+ } & PaginationArgs): Promise<PaginationInfo & {
219
197
  evals: EvalRow[];
220
- total: number;
221
- page?: number;
222
- perPage?: number;
223
- hasMore?: boolean;
224
198
  }>;
225
199
  getWorkflowRuns({ namespace, workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
226
200
  namespace: string;