@mastra/client-js 0.10.8 → 0.10.9-alpha.1

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,5 +1,5 @@
1
1
 
2
- > @mastra/client-js@0.10.8-alpha.0 build /home/runner/work/mastra/mastra/client-sdks/client-js
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
  CLI Building entry: src/index.ts
@@ -9,11 +9,11 @@
9
9
  CLI Cleaning output folder
10
10
  ESM Build start
11
11
  CJS Build start
12
- ESM dist/index.js 67.94 KB
13
- ESM ⚡️ Build success in 2073ms
14
- CJS dist/index.cjs 68.23 KB
15
- CJS ⚡️ Build success in 2073ms
16
12
  DTS Build start
17
- DTS ⚡️ Build success in 17575ms
18
- DTS dist/index.d.ts 40.25 KB
19
- DTS dist/index.d.cts 40.25 KB
13
+ CJS dist/index.cjs 68.75 KB
14
+ CJS ⚡️ Build success in 1553ms
15
+ ESM dist/index.js 68.47 KB
16
+ ESM ⚡️ Build success in 1555ms
17
+ DTS ⚡️ Build success in 17592ms
18
+ DTS dist/index.d.ts 40.58 KB
19
+ DTS dist/index.d.cts 40.58 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @mastra/client-js
2
2
 
3
+ ## 0.10.9-alpha.1
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
+ - @mastra/core@0.10.10-alpha.1
10
+
11
+ ## 0.10.9-alpha.0
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [4d3fbdf]
16
+ - @mastra/core@0.10.10-alpha.0
17
+
3
18
  ## 0.10.8
4
19
 
5
20
  ### 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.8",
3
+ "version": "0.10.9-alpha.1",
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.9"
36
+ "@mastra/core": "0.10.10-alpha.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "zod": "^3.0.0"
@@ -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