@mastra/client-js 0.13.0 → 0.13.1-alpha.0
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/CHANGELOG.md +9 -0
- package/dist/index.cjs +25 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/resources/workflow.d.ts +17 -0
- package/dist/resources/workflow.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1882,6 +1882,14 @@ var Workflow = class extends BaseResource {
|
|
|
1882
1882
|
},
|
|
1883
1883
|
resumeAsync: async (p) => {
|
|
1884
1884
|
return this.resumeAsync({ runId, step: p.step, resumeData: p.resumeData, runtimeContext: p.runtimeContext });
|
|
1885
|
+
},
|
|
1886
|
+
resumeStreamVNext: async (p) => {
|
|
1887
|
+
return this.resumeStreamVNext({
|
|
1888
|
+
runId,
|
|
1889
|
+
step: p.step,
|
|
1890
|
+
resumeData: p.resumeData,
|
|
1891
|
+
runtimeContext: p.runtimeContext
|
|
1892
|
+
});
|
|
1885
1893
|
}
|
|
1886
1894
|
};
|
|
1887
1895
|
}
|
|
@@ -2047,7 +2055,7 @@ var Workflow = class extends BaseResource {
|
|
|
2047
2055
|
`/api/workflows/${this.workflowId}/streamVNext?${searchParams.toString()}`,
|
|
2048
2056
|
{
|
|
2049
2057
|
method: "POST",
|
|
2050
|
-
body: { inputData: params.inputData, runtimeContext },
|
|
2058
|
+
body: { inputData: params.inputData, runtimeContext, closeOnSuspend: params.closeOnSuspend },
|
|
2051
2059
|
stream: true
|
|
2052
2060
|
}
|
|
2053
2061
|
);
|
|
@@ -2099,6 +2107,22 @@ var Workflow = class extends BaseResource {
|
|
|
2099
2107
|
}
|
|
2100
2108
|
});
|
|
2101
2109
|
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Resumes a suspended workflow step that uses streamVNext asynchronously and returns a promise that resolves when the workflow is complete
|
|
2112
|
+
* @param params - Object containing the runId, step, resumeData and runtimeContext
|
|
2113
|
+
* @returns Promise containing the workflow resume results
|
|
2114
|
+
*/
|
|
2115
|
+
resumeStreamVNext(params) {
|
|
2116
|
+
const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
|
|
2117
|
+
return this.request(`/api/workflows/${this.workflowId}/resume-stream?runId=${params.runId}`, {
|
|
2118
|
+
method: "POST",
|
|
2119
|
+
body: {
|
|
2120
|
+
step: params.step,
|
|
2121
|
+
resumeData: params.resumeData,
|
|
2122
|
+
runtimeContext
|
|
2123
|
+
}
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2102
2126
|
/**
|
|
2103
2127
|
* Watches workflow transitions in real-time
|
|
2104
2128
|
* @param runId - Optional run ID to filter the watch stream
|