@mastra/upstash 0.10.3-alpha.2 → 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.
- package/.turbo/turbo-build.log +14 -14
- package/CHANGELOG.md +9 -0
- package/dist/_tsup-dts-rollup.d.cts +22 -51
- package/dist/_tsup-dts-rollup.d.ts +22 -51
- package/dist/index.cjs +306 -358
- package/dist/index.js +306 -358
- package/package.json +3 -3
- package/src/storage/index.ts +270 -363
- package/src/storage/upstash.test.ts +76 -87
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/upstash@0.10.3-alpha.
|
|
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
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 9774ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
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.3
|
|
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 10947ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
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.
|
|
21
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
|
+
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
|
+
[32mCJS[39m [1mdist/getMachineId-win-ZTI2LRDJ.cjs [22m[32m1.66 KB[39m
|
|
23
|
+
[32mCJS[39m [1mdist/getMachineId-darwin-3PL23DL6.cjs [22m[32m1.19 KB[39m
|
|
24
|
+
[32mCJS[39m [1mdist/getMachineId-unsupported-DEDJN4ZS.cjs [22m[32m777.00 B[39m
|
|
25
|
+
[32mCJS[39m [1mdist/chunk-N2CPQVE3.cjs [22m[32m1.09 KB[39m
|
|
26
|
+
[32mCJS[39m [1mdist/getMachineId-linux-KYLPK3HC.cjs [22m[32m813.00 B[39m
|
|
27
|
+
[32mCJS[39m [1mdist/getMachineId-bsd-HDZ73WR7.cjs [22m[32m1015.00 B[39m
|
|
28
|
+
[32mCJS[39m [1mdist/chunk-U74OJRHU.cjs [22m[32m62.08 KB[39m
|
|
29
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m1.65 MB[39m
|
|
30
|
+
[32mCJS[39m ⚡️ Build success in 22089ms
|
|
22
31
|
[32mESM[39m [1mdist/getMachineId-darwin-UTKBTJ2U.js [22m[32m1.08 KB[39m
|
|
23
32
|
[32mESM[39m [1mdist/getMachineId-linux-K3QXQYAB.js [22m[32m740.00 B[39m
|
|
24
33
|
[32mESM[39m [1mdist/getMachineId-bsd-KKIDU47O.js [22m[32m896.00 B[39m
|
|
@@ -27,13 +36,4 @@ dist/index.cjs (1651:18): Use of eval in "dist/index.cjs" is strongly discourage
|
|
|
27
36
|
[32mESM[39m [1mdist/getMachineId-unsupported-VPWBQCK7.js [22m[32m700.00 B[39m
|
|
28
37
|
[32mESM[39m [1mdist/chunk-HSTZWXH7.js [22m[32m61.52 KB[39m
|
|
29
38
|
[32mESM[39m [1mdist/index.js [22m[32m1.64 MB[39m
|
|
30
|
-
[32mESM[39m ⚡️ Build success in
|
|
31
|
-
[32mCJS[39m [1mdist/getMachineId-darwin-3PL23DL6.cjs [22m[32m1.19 KB[39m
|
|
32
|
-
[32mCJS[39m [1mdist/getMachineId-linux-KYLPK3HC.cjs [22m[32m813.00 B[39m
|
|
33
|
-
[32mCJS[39m [1mdist/getMachineId-bsd-HDZ73WR7.cjs [22m[32m1015.00 B[39m
|
|
34
|
-
[32mCJS[39m [1mdist/getMachineId-win-ZTI2LRDJ.cjs [22m[32m1.66 KB[39m
|
|
35
|
-
[32mCJS[39m [1mdist/chunk-N2CPQVE3.cjs [22m[32m1.09 KB[39m
|
|
36
|
-
[32mCJS[39m [1mdist/getMachineId-unsupported-DEDJN4ZS.cjs [22m[32m777.00 B[39m
|
|
37
|
-
[32mCJS[39m [1mdist/chunk-U74OJRHU.cjs [22m[32m62.08 KB[39m
|
|
38
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m1.65 MB[39m
|
|
39
|
-
[32mCJS[39m ⚡️ Build success in 23122ms
|
|
39
|
+
[32mESM[39m ⚡️ Build success in 22103ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
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
|
+
|
|
3
12
|
## 0.10.3-alpha.2
|
|
4
13
|
|
|
5
14
|
### 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';
|
|
@@ -81,32 +84,17 @@ declare class UpstashStore extends MastraStorage {
|
|
|
81
84
|
* @deprecated Use getEvals instead
|
|
82
85
|
*/
|
|
83
86
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
page: number;
|
|
90
|
-
perPage?: number;
|
|
91
|
-
fromDate?: Date;
|
|
92
|
-
toDate?: Date;
|
|
93
|
-
}): Promise<any[]>;
|
|
94
|
-
getTraces(args: {
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated use getTracesPaginated instead
|
|
89
|
+
*/
|
|
90
|
+
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
91
|
+
getTracesPaginated(args: {
|
|
95
92
|
name?: string;
|
|
96
93
|
scope?: string;
|
|
97
|
-
page: number;
|
|
98
|
-
perPage?: number;
|
|
99
94
|
attributes?: Record<string, string>;
|
|
100
95
|
filters?: Record<string, any>;
|
|
101
|
-
|
|
102
|
-
toDate?: Date;
|
|
103
|
-
returnPaginationResults: true;
|
|
104
|
-
}): Promise<{
|
|
96
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
105
97
|
traces: any[];
|
|
106
|
-
total: number;
|
|
107
|
-
page: number;
|
|
108
|
-
perPage: number;
|
|
109
|
-
hasMore: boolean;
|
|
110
98
|
}>;
|
|
111
99
|
createTable({ tableName, schema, }: {
|
|
112
100
|
tableName: TABLE_NAMES;
|
|
@@ -141,19 +129,16 @@ declare class UpstashStore extends MastraStorage {
|
|
|
141
129
|
getThreadById({ threadId }: {
|
|
142
130
|
threadId: string;
|
|
143
131
|
}): Promise<StorageThreadType | null>;
|
|
144
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
134
|
+
*/
|
|
135
|
+
getThreadsByResourceId({ resourceId }: {
|
|
145
136
|
resourceId: string;
|
|
146
137
|
}): Promise<StorageThreadType[]>;
|
|
147
|
-
|
|
138
|
+
getThreadsByResourceIdPaginated(args: {
|
|
148
139
|
resourceId: string;
|
|
149
|
-
|
|
150
|
-
perPage?: number;
|
|
151
|
-
}): Promise<{
|
|
140
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
152
141
|
threads: StorageThreadType[];
|
|
153
|
-
total: number;
|
|
154
|
-
page: number;
|
|
155
|
-
perPage: number;
|
|
156
|
-
hasMore: boolean;
|
|
157
142
|
}>;
|
|
158
143
|
saveThread({ thread }: {
|
|
159
144
|
thread: StorageThreadType;
|
|
@@ -174,24 +159,20 @@ declare class UpstashStore extends MastraStorage {
|
|
|
174
159
|
messages: MastraMessageV2[];
|
|
175
160
|
format: 'v2';
|
|
176
161
|
}): Promise<MastraMessageV2[]>;
|
|
162
|
+
private _getIncludedMessages;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated use getMessagesPaginated instead
|
|
165
|
+
*/
|
|
177
166
|
getMessages(args: StorageGetMessagesArg & {
|
|
178
167
|
format?: 'v1';
|
|
179
168
|
}): Promise<MastraMessageV1[]>;
|
|
180
169
|
getMessages(args: StorageGetMessagesArg & {
|
|
181
170
|
format: 'v2';
|
|
182
171
|
}): Promise<MastraMessageV2[]>;
|
|
183
|
-
|
|
172
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
184
173
|
format?: 'v1' | 'v2';
|
|
185
|
-
|
|
186
|
-
perPage?: number;
|
|
187
|
-
fromDate?: Date;
|
|
188
|
-
toDate?: Date;
|
|
189
|
-
}): Promise<{
|
|
174
|
+
}): Promise<PaginationInfo & {
|
|
190
175
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
191
|
-
total: number;
|
|
192
|
-
page: number;
|
|
193
|
-
perPage: number;
|
|
194
|
-
hasMore: boolean;
|
|
195
176
|
}>;
|
|
196
177
|
persistWorkflowSnapshot(params: {
|
|
197
178
|
namespace: string;
|
|
@@ -212,18 +193,8 @@ declare class UpstashStore extends MastraStorage {
|
|
|
212
193
|
getEvals(options?: {
|
|
213
194
|
agentName?: string;
|
|
214
195
|
type?: 'test' | 'live';
|
|
215
|
-
|
|
216
|
-
perPage?: number;
|
|
217
|
-
limit?: number;
|
|
218
|
-
offset?: number;
|
|
219
|
-
fromDate?: Date;
|
|
220
|
-
toDate?: Date;
|
|
221
|
-
}): Promise<{
|
|
196
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
222
197
|
evals: EvalRow[];
|
|
223
|
-
total: number;
|
|
224
|
-
page?: number;
|
|
225
|
-
perPage?: number;
|
|
226
|
-
hasMore?: boolean;
|
|
227
198
|
}>;
|
|
228
199
|
getWorkflowRuns({ namespace, workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
229
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';
|
|
@@ -81,32 +84,17 @@ declare class UpstashStore extends MastraStorage {
|
|
|
81
84
|
* @deprecated Use getEvals instead
|
|
82
85
|
*/
|
|
83
86
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
page: number;
|
|
90
|
-
perPage?: number;
|
|
91
|
-
fromDate?: Date;
|
|
92
|
-
toDate?: Date;
|
|
93
|
-
}): Promise<any[]>;
|
|
94
|
-
getTraces(args: {
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated use getTracesPaginated instead
|
|
89
|
+
*/
|
|
90
|
+
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
91
|
+
getTracesPaginated(args: {
|
|
95
92
|
name?: string;
|
|
96
93
|
scope?: string;
|
|
97
|
-
page: number;
|
|
98
|
-
perPage?: number;
|
|
99
94
|
attributes?: Record<string, string>;
|
|
100
95
|
filters?: Record<string, any>;
|
|
101
|
-
|
|
102
|
-
toDate?: Date;
|
|
103
|
-
returnPaginationResults: true;
|
|
104
|
-
}): Promise<{
|
|
96
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
105
97
|
traces: any[];
|
|
106
|
-
total: number;
|
|
107
|
-
page: number;
|
|
108
|
-
perPage: number;
|
|
109
|
-
hasMore: boolean;
|
|
110
98
|
}>;
|
|
111
99
|
createTable({ tableName, schema, }: {
|
|
112
100
|
tableName: TABLE_NAMES;
|
|
@@ -141,19 +129,16 @@ declare class UpstashStore extends MastraStorage {
|
|
|
141
129
|
getThreadById({ threadId }: {
|
|
142
130
|
threadId: string;
|
|
143
131
|
}): Promise<StorageThreadType | null>;
|
|
144
|
-
|
|
132
|
+
/**
|
|
133
|
+
* @deprecated use getThreadsByResourceIdPaginated instead
|
|
134
|
+
*/
|
|
135
|
+
getThreadsByResourceId({ resourceId }: {
|
|
145
136
|
resourceId: string;
|
|
146
137
|
}): Promise<StorageThreadType[]>;
|
|
147
|
-
|
|
138
|
+
getThreadsByResourceIdPaginated(args: {
|
|
148
139
|
resourceId: string;
|
|
149
|
-
|
|
150
|
-
perPage?: number;
|
|
151
|
-
}): Promise<{
|
|
140
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
152
141
|
threads: StorageThreadType[];
|
|
153
|
-
total: number;
|
|
154
|
-
page: number;
|
|
155
|
-
perPage: number;
|
|
156
|
-
hasMore: boolean;
|
|
157
142
|
}>;
|
|
158
143
|
saveThread({ thread }: {
|
|
159
144
|
thread: StorageThreadType;
|
|
@@ -174,24 +159,20 @@ declare class UpstashStore extends MastraStorage {
|
|
|
174
159
|
messages: MastraMessageV2[];
|
|
175
160
|
format: 'v2';
|
|
176
161
|
}): Promise<MastraMessageV2[]>;
|
|
162
|
+
private _getIncludedMessages;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated use getMessagesPaginated instead
|
|
165
|
+
*/
|
|
177
166
|
getMessages(args: StorageGetMessagesArg & {
|
|
178
167
|
format?: 'v1';
|
|
179
168
|
}): Promise<MastraMessageV1[]>;
|
|
180
169
|
getMessages(args: StorageGetMessagesArg & {
|
|
181
170
|
format: 'v2';
|
|
182
171
|
}): Promise<MastraMessageV2[]>;
|
|
183
|
-
|
|
172
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
184
173
|
format?: 'v1' | 'v2';
|
|
185
|
-
|
|
186
|
-
perPage?: number;
|
|
187
|
-
fromDate?: Date;
|
|
188
|
-
toDate?: Date;
|
|
189
|
-
}): Promise<{
|
|
174
|
+
}): Promise<PaginationInfo & {
|
|
190
175
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
191
|
-
total: number;
|
|
192
|
-
page: number;
|
|
193
|
-
perPage: number;
|
|
194
|
-
hasMore: boolean;
|
|
195
176
|
}>;
|
|
196
177
|
persistWorkflowSnapshot(params: {
|
|
197
178
|
namespace: string;
|
|
@@ -212,18 +193,8 @@ declare class UpstashStore extends MastraStorage {
|
|
|
212
193
|
getEvals(options?: {
|
|
213
194
|
agentName?: string;
|
|
214
195
|
type?: 'test' | 'live';
|
|
215
|
-
|
|
216
|
-
perPage?: number;
|
|
217
|
-
limit?: number;
|
|
218
|
-
offset?: number;
|
|
219
|
-
fromDate?: Date;
|
|
220
|
-
toDate?: Date;
|
|
221
|
-
}): Promise<{
|
|
196
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
222
197
|
evals: EvalRow[];
|
|
223
|
-
total: number;
|
|
224
|
-
page?: number;
|
|
225
|
-
perPage?: number;
|
|
226
|
-
hasMore?: boolean;
|
|
227
198
|
}>;
|
|
228
199
|
getWorkflowRuns({ namespace, workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
229
200
|
namespace: string;
|