@mastra/client-js 1.51.0-alpha.6 → 1.51.0-alpha.7

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/dist/index.js CHANGED
@@ -3225,7 +3225,7 @@ var Run = class extends BaseResource {
3225
3225
  * @deprecated Use `cancel()` instead
3226
3226
  */
3227
3227
  cancelRun() {
3228
- return this.request(`/workflows/${this.workflowId}/runs/${this.runId}/cancel`, { method: "POST" });
3228
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(this.runId)}/cancel`, { method: "POST" });
3229
3229
  }
3230
3230
  /**
3231
3231
  * Cancels a workflow run.
@@ -3289,7 +3289,7 @@ var Run = class extends BaseResource {
3289
3289
  * ```
3290
3290
  */
3291
3291
  cancel() {
3292
- return this.request(`/workflows/${this.workflowId}/runs/${this.runId}/cancel`, { method: "POST" });
3292
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(this.runId)}/cancel`, { method: "POST" });
3293
3293
  }
3294
3294
  /**
3295
3295
  * Starts a workflow run synchronously without waiting for the workflow to complete
@@ -3298,7 +3298,7 @@ var Run = class extends BaseResource {
3298
3298
  */
3299
3299
  start(params) {
3300
3300
  const requestContext = parseClientRequestContext(params.requestContext);
3301
- return this.request(`/workflows/${this.workflowId}/start?runId=${this.runId}`, {
3301
+ return this.request(`/workflows/${this.workflowId}/start?runId=${encodeURIComponent(this.runId)}`, {
3302
3302
  method: "POST",
3303
3303
  body: {
3304
3304
  inputData: params?.inputData,
@@ -3316,7 +3316,7 @@ var Run = class extends BaseResource {
3316
3316
  */
3317
3317
  resume({ step, resumeData, tracingOptions, perStep, forEachIndex, ...rest }) {
3318
3318
  const requestContext = parseClientRequestContext(rest.requestContext);
3319
- return this.request(`/workflows/${this.workflowId}/resume?runId=${this.runId}`, {
3319
+ return this.request(`/workflows/${this.workflowId}/resume?runId=${encodeURIComponent(this.runId)}`, {
3320
3320
  method: "POST",
3321
3321
  body: {
3322
3322
  step,
@@ -3419,7 +3419,7 @@ var Run = class extends BaseResource {
3419
3419
  */
3420
3420
  resumeAsync(params) {
3421
3421
  const requestContext = parseClientRequestContext(params.requestContext);
3422
- return this.request(`/workflows/${this.workflowId}/resume-async?runId=${this.runId}`, {
3422
+ return this.request(`/workflows/${this.workflowId}/resume-async?runId=${encodeURIComponent(this.runId)}`, {
3423
3423
  method: "POST",
3424
3424
  body: {
3425
3425
  step: params.step,
@@ -3448,7 +3448,7 @@ var Run = class extends BaseResource {
3448
3448
  */
3449
3449
  resumeNoWait(params) {
3450
3450
  const requestContext = parseClientRequestContext(params.requestContext);
3451
- return this.request(`/workflows/${this.workflowId}/resume-no-wait?runId=${this.runId}`, {
3451
+ return this.request(`/workflows/${this.workflowId}/resume-no-wait?runId=${encodeURIComponent(this.runId)}`, {
3452
3452
  method: "POST",
3453
3453
  body: {
3454
3454
  step: params.step,
@@ -3492,7 +3492,7 @@ var Run = class extends BaseResource {
3492
3492
  */
3493
3493
  restart(params) {
3494
3494
  const requestContext = parseClientRequestContext(params.requestContext);
3495
- return this.request(`/workflows/${this.workflowId}/restart?runId=${this.runId}`, {
3495
+ return this.request(`/workflows/${this.workflowId}/restart?runId=${encodeURIComponent(this.runId)}`, {
3496
3496
  method: "POST",
3497
3497
  body: {
3498
3498
  requestContext,
@@ -3507,7 +3507,7 @@ var Run = class extends BaseResource {
3507
3507
  */
3508
3508
  restartAsync(params) {
3509
3509
  const requestContext = parseClientRequestContext(params?.requestContext);
3510
- return this.request(`/workflows/${this.workflowId}/restart-async?runId=${this.runId}`, {
3510
+ return this.request(`/workflows/${this.workflowId}/restart-async?runId=${encodeURIComponent(this.runId)}`, {
3511
3511
  method: "POST",
3512
3512
  body: {
3513
3513
  requestContext,
@@ -3522,7 +3522,7 @@ var Run = class extends BaseResource {
3522
3522
  */
3523
3523
  timeTravel({ requestContext: paramsRequestContext, ...params }) {
3524
3524
  const requestContext = parseClientRequestContext(paramsRequestContext);
3525
- return this.request(`/workflows/${this.workflowId}/time-travel?runId=${this.runId}`, {
3525
+ return this.request(`/workflows/${this.workflowId}/time-travel?runId=${encodeURIComponent(this.runId)}`, {
3526
3526
  method: "POST",
3527
3527
  body: {
3528
3528
  ...params,
@@ -3537,7 +3537,7 @@ var Run = class extends BaseResource {
3537
3537
  */
3538
3538
  timeTravelAsync({ requestContext: paramsRequestContext, ...params }) {
3539
3539
  const requestContext = parseClientRequestContext(paramsRequestContext);
3540
- return this.request(`/workflows/${this.workflowId}/time-travel-async?runId=${this.runId}`, {
3540
+ return this.request(`/workflows/${this.workflowId}/time-travel-async?runId=${encodeURIComponent(this.runId)}`, {
3541
3541
  method: "POST",
3542
3542
  body: {
3543
3543
  ...params,
@@ -3552,7 +3552,7 @@ var Run = class extends BaseResource {
3552
3552
  */
3553
3553
  async timeTravelStream({ requestContext: paramsRequestContext, ...params }) {
3554
3554
  const requestContext = parseClientRequestContext(paramsRequestContext);
3555
- const response = await this.request(`/workflows/${this.workflowId}/time-travel-stream?runId=${this.runId}`, {
3555
+ const response = await this.request(`/workflows/${this.workflowId}/time-travel-stream?runId=${encodeURIComponent(this.runId)}`, {
3556
3556
  method: "POST",
3557
3557
  body: {
3558
3558
  ...params,
@@ -3623,7 +3623,7 @@ var Workflow = class extends BaseResource {
3623
3623
  const requestContextParam = base64RequestContext(parseClientRequestContext(options?.requestContext));
3624
3624
  if (requestContextParam) searchParams.set("requestContext", requestContextParam);
3625
3625
  const queryString = searchParams.size > 0 ? `?${searchParams.toString()}` : "";
3626
- return this.request(`/workflows/${this.workflowId}/runs/${runId}${queryString}`);
3626
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(runId)}${queryString}`);
3627
3627
  }
3628
3628
  /**
3629
3629
  * Deletes a specific workflow run by its ID
@@ -3631,7 +3631,7 @@ var Workflow = class extends BaseResource {
3631
3631
  * @returns Promise containing a success message
3632
3632
  */
3633
3633
  deleteRunById(runId) {
3634
- return this.request(`/workflows/${this.workflowId}/runs/${runId}`, { method: "DELETE" });
3634
+ return this.request(`/workflows/${this.workflowId}/runs/${encodeURIComponent(runId)}`, { method: "DELETE" });
3635
3635
  }
3636
3636
  /**
3637
3637
  * Retrieves the input/output schema for the workflow