@mastra/client-js 0.12.4-alpha.3 → 0.13.0-alpha.5

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
@@ -1894,13 +1894,21 @@ var Workflow = class extends BaseResource {
1894
1894
  body: { event: params.event, data: params.data }
1895
1895
  });
1896
1896
  }
1897
+ /**
1898
+ * @deprecated Use createRunAsync() instead.
1899
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
1900
+ */
1901
+ async createRun(_params) {
1902
+ throw new Error(
1903
+ "createRun() has been deprecated. Please use createRunAsync() instead.\n\nMigration guide:\n Before: const run = workflow.createRun();\n After: const run = await workflow.createRunAsync();\n\nNote: createRunAsync() is an async method, so make sure your calling function is async."
1904
+ );
1905
+ }
1897
1906
  /**
1898
1907
  * Creates a new workflow run
1899
1908
  * @param params - Optional object containing the optional runId
1900
- * @returns Promise containing the runId of the created run
1909
+ * @returns Promise containing the runId of the created run with methods to control execution
1901
1910
  */
1902
- /** @deprecated Use createRunAsync instead */
1903
- async createRun(params) {
1911
+ async createRunAsync(params) {
1904
1912
  const searchParams = new URLSearchParams();
1905
1913
  if (!!params?.runId) {
1906
1914
  searchParams.set("runId", params.runId);
@@ -1934,14 +1942,6 @@ var Workflow = class extends BaseResource {
1934
1942
  }
1935
1943
  };
1936
1944
  }
1937
- /**
1938
- * Creates a new workflow run (alias for createRun)
1939
- * @param params - Optional object containing the optional runId
1940
- * @returns Promise containing the runId of the created run
1941
- */
1942
- createRunAsync(params) {
1943
- return this.createRun(params);
1944
- }
1945
1945
  /**
1946
1946
  * Starts a workflow run synchronously without waiting for the workflow to complete
1947
1947
  * @param params - Object containing the runId, inputData and runtimeContext
@@ -2303,11 +2303,20 @@ var AgentBuilder = class extends BaseResource {
2303
2303
  };
2304
2304
  }
2305
2305
  }
2306
+ /**
2307
+ * @deprecated Use createRunAsync() instead.
2308
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
2309
+ */
2310
+ async createRun(_params) {
2311
+ throw new Error(
2312
+ "createRun() has been deprecated. Please use createRunAsync() instead.\n\nMigration guide:\n Before: const run = agentBuilder.createRun();\n After: const run = await agentBuilder.createRunAsync();\n\nNote: createRunAsync() is an async method, so make sure your calling function is async."
2313
+ );
2314
+ }
2306
2315
  /**
2307
2316
  * Creates a new agent builder action run and returns the runId.
2308
2317
  * This calls `/api/agent-builder/:actionId/create-run`.
2309
2318
  */
2310
- async createRun(params) {
2319
+ async createRunAsync(params) {
2311
2320
  const searchParams = new URLSearchParams();
2312
2321
  if (!!params?.runId) {
2313
2322
  searchParams.set("runId", params.runId);
@@ -2317,14 +2326,6 @@ var AgentBuilder = class extends BaseResource {
2317
2326
  method: "POST"
2318
2327
  });
2319
2328
  }
2320
- /**
2321
- * Creates a new workflow run (alias for createRun)
2322
- * @param params - Optional object containing the optional runId
2323
- * @returns Promise containing the runId of the created run
2324
- */
2325
- createRunAsync(params) {
2326
- return this.createRun(params);
2327
- }
2328
2329
  /**
2329
2330
  * Starts agent builder action asynchronously and waits for completion.
2330
2331
  * This calls `/api/agent-builder/:actionId/start-async`.