@hatchet-dev/typescript-sdk 0.7.1 → 0.7.2
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/clients/admin/admin-client.js +3 -0
- package/package.json +3 -3
- package/step.d.ts +1 -1
- package/step.js +2 -1
|
@@ -82,6 +82,9 @@ class AdminClient {
|
|
|
82
82
|
run_workflow(workflowName, input, options) {
|
|
83
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
84
|
try {
|
|
85
|
+
if (this.config.namespace && !workflowName.startsWith(this.config.namespace)) {
|
|
86
|
+
workflowName = this.config.namespace + workflowName;
|
|
87
|
+
}
|
|
85
88
|
const inputStr = JSON.stringify(input);
|
|
86
89
|
const resp = yield this.client.triggerWorkflow(Object.assign(Object.assign({ name: workflowName, input: inputStr }, options), { additionalMetadata: (options === null || options === void 0 ? void 0 : options.additionalMetadata)
|
|
87
90
|
? JSON.stringify(options === null || options === void 0 ? void 0 : options.additionalMetadata)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"autoprefixer": "^10.4.16",
|
|
65
65
|
"dotenv-cli": "^7.3.0",
|
|
66
66
|
"eslint": "^8.56.0",
|
|
67
|
-
"eslint-config-airbnb-typescript": "^
|
|
67
|
+
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
68
68
|
"eslint-config-prettier": "^9.1.0",
|
|
69
69
|
"eslint-config-standard-with-typescript": "^43.0.0",
|
|
70
70
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
71
71
|
"eslint-plugin-import": "^2.29.1",
|
|
72
|
-
"eslint-plugin-jest": "^
|
|
72
|
+
"eslint-plugin-jest": "^28.5.0",
|
|
73
73
|
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
|
|
74
74
|
"eslint-plugin-prettier": "^5.0.1",
|
|
75
75
|
"eslint-plugin-promise": "^6.0.0",
|
package/step.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export declare class Context<T, K> {
|
|
|
97
97
|
putStream(data: string | Uint8Array): Promise<void>;
|
|
98
98
|
spawnWorkflow<P = unknown, Q = unknown>(workflowName: string, input: Q, key?: string): ChildWorkflowRef<P>;
|
|
99
99
|
}
|
|
100
|
-
export type StepRunFunction<T, K> = (ctx: Context<T, K>) => Promise<NextStep> | NextStep | void;
|
|
100
|
+
export type StepRunFunction<T, K> = (ctx: Context<T, K>) => Promise<NextStep | void> | NextStep | void;
|
|
101
101
|
export interface CreateStep<T, K> extends z.infer<typeof CreateStepSchema> {
|
|
102
102
|
run: StepRunFunction<T, K>;
|
|
103
103
|
}
|
package/step.js
CHANGED
|
@@ -225,7 +225,8 @@ class Context {
|
|
|
225
225
|
}
|
|
226
226
|
spawnWorkflow(workflowName, input, key) {
|
|
227
227
|
const { workflowRunId, stepRunId } = this.action;
|
|
228
|
-
const
|
|
228
|
+
const name = this.client.config.namespace + workflowName;
|
|
229
|
+
const childWorkflowRunIdPromise = this.client.admin.run_workflow(name, input, {
|
|
229
230
|
parentId: workflowRunId,
|
|
230
231
|
parentStepRunId: stepRunId,
|
|
231
232
|
childKey: key,
|