@mastra/client-js 0.10.9-alpha.0 → 0.10.9
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 +8 -8
- package/CHANGELOG.md +17 -0
- package/dist/index.cjs +13 -2
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +13 -2
- package/package.json +3 -3
- package/src/resources/workflow.ts +14 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/client-js@0.10.9-alpha.
|
|
2
|
+
> @mastra/client-js@0.10.9-alpha.1 build /home/runner/work/mastra/mastra/client-sdks/client-js
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Cleaning output folder
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m68.75 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 2505ms
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m68.47 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 2511ms
|
|
16
16
|
[34mDTS[39m Build start
|
|
17
|
-
[32mDTS[39m ⚡️ Build success in
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m40.
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m40.
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 15791ms
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m40.58 KB[39m
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m40.58 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @mastra/client-js
|
|
2
2
|
|
|
3
|
+
## 0.10.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b60f510: Fix getWorkflowRuns by limit and offset
|
|
8
|
+
- 6997af1: add send event to server, deployer, client-js and playground-ui
|
|
9
|
+
- Updated dependencies [4d3fbdf]
|
|
10
|
+
- @mastra/core@0.10.10
|
|
11
|
+
|
|
12
|
+
## 0.10.9-alpha.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- b60f510: Fix getWorkflowRuns by limit and offset
|
|
17
|
+
- 6997af1: add send event to server, deployer, client-js and playground-ui
|
|
18
|
+
- @mastra/core@0.10.10-alpha.1
|
|
19
|
+
|
|
3
20
|
## 0.10.9-alpha.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1308,10 +1308,10 @@ var Workflow = class extends BaseResource {
|
|
|
1308
1308
|
if (params?.toDate) {
|
|
1309
1309
|
searchParams.set("toDate", params.toDate.toISOString());
|
|
1310
1310
|
}
|
|
1311
|
-
if (params?.limit) {
|
|
1311
|
+
if (params?.limit !== null && params?.limit !== void 0 && !isNaN(Number(params?.limit))) {
|
|
1312
1312
|
searchParams.set("limit", String(params.limit));
|
|
1313
1313
|
}
|
|
1314
|
-
if (params?.offset) {
|
|
1314
|
+
if (params?.offset !== null && params?.offset !== void 0 && !isNaN(Number(params?.offset))) {
|
|
1315
1315
|
searchParams.set("offset", String(params.offset));
|
|
1316
1316
|
}
|
|
1317
1317
|
if (params?.resourceId) {
|
|
@@ -1349,6 +1349,17 @@ var Workflow = class extends BaseResource {
|
|
|
1349
1349
|
method: "POST"
|
|
1350
1350
|
});
|
|
1351
1351
|
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Sends an event to a specific workflow run by its ID
|
|
1354
|
+
* @param params - Object containing the runId, event and data
|
|
1355
|
+
* @returns Promise containing a success message
|
|
1356
|
+
*/
|
|
1357
|
+
sendRunEvent(params) {
|
|
1358
|
+
return this.request(`/api/workflows/${this.workflowId}/runs/${params.runId}/send-event`, {
|
|
1359
|
+
method: "POST",
|
|
1360
|
+
body: { event: params.event, data: params.data }
|
|
1361
|
+
});
|
|
1362
|
+
}
|
|
1352
1363
|
/**
|
|
1353
1364
|
* Creates a new workflow run
|
|
1354
1365
|
* @param params - Optional object containing the optional runId
|
package/dist/index.d.cts
CHANGED
|
@@ -726,6 +726,18 @@ declare class Workflow extends BaseResource {
|
|
|
726
726
|
cancelRun(runId: string): Promise<{
|
|
727
727
|
message: string;
|
|
728
728
|
}>;
|
|
729
|
+
/**
|
|
730
|
+
* Sends an event to a specific workflow run by its ID
|
|
731
|
+
* @param params - Object containing the runId, event and data
|
|
732
|
+
* @returns Promise containing a success message
|
|
733
|
+
*/
|
|
734
|
+
sendRunEvent(params: {
|
|
735
|
+
runId: string;
|
|
736
|
+
event: string;
|
|
737
|
+
data: unknown;
|
|
738
|
+
}): Promise<{
|
|
739
|
+
message: string;
|
|
740
|
+
}>;
|
|
729
741
|
/**
|
|
730
742
|
* Creates a new workflow run
|
|
731
743
|
* @param params - Optional object containing the optional runId
|
package/dist/index.d.ts
CHANGED
|
@@ -726,6 +726,18 @@ declare class Workflow extends BaseResource {
|
|
|
726
726
|
cancelRun(runId: string): Promise<{
|
|
727
727
|
message: string;
|
|
728
728
|
}>;
|
|
729
|
+
/**
|
|
730
|
+
* Sends an event to a specific workflow run by its ID
|
|
731
|
+
* @param params - Object containing the runId, event and data
|
|
732
|
+
* @returns Promise containing a success message
|
|
733
|
+
*/
|
|
734
|
+
sendRunEvent(params: {
|
|
735
|
+
runId: string;
|
|
736
|
+
event: string;
|
|
737
|
+
data: unknown;
|
|
738
|
+
}): Promise<{
|
|
739
|
+
message: string;
|
|
740
|
+
}>;
|
|
729
741
|
/**
|
|
730
742
|
* Creates a new workflow run
|
|
731
743
|
* @param params - Optional object containing the optional runId
|
package/dist/index.js
CHANGED
|
@@ -1302,10 +1302,10 @@ var Workflow = class extends BaseResource {
|
|
|
1302
1302
|
if (params?.toDate) {
|
|
1303
1303
|
searchParams.set("toDate", params.toDate.toISOString());
|
|
1304
1304
|
}
|
|
1305
|
-
if (params?.limit) {
|
|
1305
|
+
if (params?.limit !== null && params?.limit !== void 0 && !isNaN(Number(params?.limit))) {
|
|
1306
1306
|
searchParams.set("limit", String(params.limit));
|
|
1307
1307
|
}
|
|
1308
|
-
if (params?.offset) {
|
|
1308
|
+
if (params?.offset !== null && params?.offset !== void 0 && !isNaN(Number(params?.offset))) {
|
|
1309
1309
|
searchParams.set("offset", String(params.offset));
|
|
1310
1310
|
}
|
|
1311
1311
|
if (params?.resourceId) {
|
|
@@ -1343,6 +1343,17 @@ var Workflow = class extends BaseResource {
|
|
|
1343
1343
|
method: "POST"
|
|
1344
1344
|
});
|
|
1345
1345
|
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Sends an event to a specific workflow run by its ID
|
|
1348
|
+
* @param params - Object containing the runId, event and data
|
|
1349
|
+
* @returns Promise containing a success message
|
|
1350
|
+
*/
|
|
1351
|
+
sendRunEvent(params) {
|
|
1352
|
+
return this.request(`/api/workflows/${this.workflowId}/runs/${params.runId}/send-event`, {
|
|
1353
|
+
method: "POST",
|
|
1354
|
+
body: { event: params.event, data: params.data }
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1346
1357
|
/**
|
|
1347
1358
|
* Creates a new workflow run
|
|
1348
1359
|
* @param params - Optional object containing the optional runId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/client-js",
|
|
3
|
-
"version": "0.10.9
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"description": "The official TypeScript library for the Mastra Client API",
|
|
5
5
|
"author": "",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"rxjs": "7.8.1",
|
|
34
34
|
"zod": "^3.25.67",
|
|
35
35
|
"zod-to-json-schema": "^3.24.5",
|
|
36
|
-
"@mastra/core": "0.10.10
|
|
36
|
+
"@mastra/core": "0.10.10"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"zod": "^3.0.0"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tsup": "^8.5.0",
|
|
48
48
|
"typescript": "^5.8.3",
|
|
49
49
|
"vitest": "^3.2.4",
|
|
50
|
-
"@internal/lint": "0.0.
|
|
50
|
+
"@internal/lint": "0.0.17"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean --treeshake=smallest --splitting",
|
|
@@ -115,10 +115,10 @@ export class Workflow extends BaseResource {
|
|
|
115
115
|
if (params?.toDate) {
|
|
116
116
|
searchParams.set('toDate', params.toDate.toISOString());
|
|
117
117
|
}
|
|
118
|
-
if (params?.limit) {
|
|
118
|
+
if (params?.limit !== null && params?.limit !== undefined && !isNaN(Number(params?.limit))) {
|
|
119
119
|
searchParams.set('limit', String(params.limit));
|
|
120
120
|
}
|
|
121
|
-
if (params?.offset) {
|
|
121
|
+
if (params?.offset !== null && params?.offset !== undefined && !isNaN(Number(params?.offset))) {
|
|
122
122
|
searchParams.set('offset', String(params.offset));
|
|
123
123
|
}
|
|
124
124
|
if (params?.resourceId) {
|
|
@@ -161,6 +161,18 @@ export class Workflow extends BaseResource {
|
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Sends an event to a specific workflow run by its ID
|
|
166
|
+
* @param params - Object containing the runId, event and data
|
|
167
|
+
* @returns Promise containing a success message
|
|
168
|
+
*/
|
|
169
|
+
sendRunEvent(params: { runId: string; event: string; data: unknown }): Promise<{ message: string }> {
|
|
170
|
+
return this.request(`/api/workflows/${this.workflowId}/runs/${params.runId}/send-event`, {
|
|
171
|
+
method: 'POST',
|
|
172
|
+
body: { event: params.event, data: params.data },
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
164
176
|
/**
|
|
165
177
|
* Creates a new workflow run
|
|
166
178
|
* @param params - Optional object containing the optional runId
|