@tailor-platform/sdk 1.76.2 → 1.79.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 +38 -0
- package/dist/application-BB6BlUfk.mjs +3 -0
- package/dist/{application-CqjCcZ2n.mjs → application-fjqb-Gh8.mjs} +57 -10
- package/dist/application-fjqb-Gh8.mjs.map +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +8 -3
- package/dist/cli/commands/show.d.mts +9 -3
- package/dist/cli/commands/workspace/create.d.mts +3 -0
- package/dist/cli/commands/workspace/list.d.mts +1 -0
- package/dist/cli/commands/workspace/transform.d.mts +2 -0
- package/dist/cli/index.mjs +47 -22
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +2 -2
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/shared/workspace-name.d.mts +1 -0
- package/dist/cli/skills.mjs +1 -1
- package/dist/completion/zsh-worker.zsh +18 -1
- package/dist/configure/index.mjs +202 -7
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/idp/index.d.mts +1 -4
- package/dist/configure/services/tailordb/schema.d.mts +1 -7
- package/dist/configure/services/workflow/execution-policy.d.mts +2 -2
- package/dist/configure/types/type.d.mts +1 -9
- package/dist/{crashreport-DZDr-TvH.mjs → crashreport-BNWUM6Kf.mjs} +2 -2
- package/dist/{crashreport-DZDr-TvH.mjs.map → crashreport-BNWUM6Kf.mjs.map} +1 -1
- package/dist/{crashreport-np4-_DX2.mjs → crashreport-BafWvjjX.mjs} +1 -1
- package/dist/errors-DVFS0AZk.mjs +100 -0
- package/dist/errors-DVFS0AZk.mjs.map +1 -0
- package/dist/{globals-z6zYMjlr.mjs → globals-B-n_3uYu.mjs} +11 -5
- package/dist/globals-B-n_3uYu.mjs.map +1 -0
- package/dist/{logger-BEiZZ3qT.mjs → logger-BwS4ppwO.mjs} +3 -3
- package/dist/logger-BwS4ppwO.mjs.map +1 -0
- package/dist/{registry-CTgoVWc_.mjs → registry-CXi7rJq7.mjs} +4 -3
- package/dist/registry-CXi7rJq7.mjs.map +1 -0
- package/dist/runtime/field-parse.d.mts +11 -0
- package/dist/runtime/globals.d.mts +4 -1
- package/dist/runtime/index.mjs +1 -1
- package/dist/runtime/workflow.d.mts +79 -15
- package/dist/runtime/workflow.mjs +2 -2
- package/dist/{runtime-DlklyuHN.mjs → runtime-CjMeYuPA.mjs} +1169 -539
- package/dist/runtime-CjMeYuPA.mjs.map +1 -0
- package/dist/{schema-DbTR1c6M.mjs → schema-CYrle8JZ.mjs} +222 -4
- package/dist/schema-CYrle8JZ.mjs.map +1 -0
- package/dist/{secretmanager-Bd45j7an.mjs → secretmanager-IY4UvinW.mjs} +42 -9
- package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
- package/dist/service-CghpdV-9.mjs +3 -0
- package/dist/{service-DBFZQloR.mjs → service-Cp0I7ZFe.mjs} +3 -3
- package/dist/{service-DBFZQloR.mjs.map → service-Cp0I7ZFe.mjs.map} +1 -1
- package/dist/{service-BCRJ-3NV.mjs → service-D12iQGcS.mjs} +2 -2
- package/dist/{service-BCRJ-3NV.mjs.map → service-D12iQGcS.mjs.map} +1 -1
- package/dist/{test-env-key-IPapa1KJ.mjs → test-env-key-DuZycyWM.mjs} +2 -2
- package/dist/{test-env-key-IPapa1KJ.mjs.map → test-env-key-DuZycyWM.mjs.map} +1 -1
- package/dist/types/auth.generated.d.mts +9 -36
- package/dist/types/executor.generated.d.mts +19 -59
- package/dist/types/idp.generated.d.mts +518 -517
- package/dist/types/resolver.generated.d.mts +6 -2
- package/dist/types/tailordb.generated.d.mts +8 -7
- package/dist/utils/test/index.mjs +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +8 -8
- package/dist/vitest/index.mjs +635 -195
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +8 -8
- package/dist/vitest/mocks/aigateway.d.mts +14 -4
- package/dist/vitest/mocks/authconnection.d.mts +14 -4
- package/dist/vitest/mocks/file.d.mts +24 -6
- package/dist/vitest/mocks/iconv.d.mts +28 -4
- package/dist/vitest/mocks/idp.d.mts +25 -9
- package/dist/vitest/mocks/secretmanager.d.mts +13 -4
- package/dist/vitest/mocks/tailordb.d.mts +48 -7
- package/dist/vitest/mocks/workflow.d.mts +68 -22
- package/dist/vitest/setup.mjs +2 -2
- package/dist/workflow-CkIDJpdg.mjs +69 -0
- package/dist/workflow-CkIDJpdg.mjs.map +1 -0
- package/docs/cli/application.md +58 -11
- package/docs/cli/setup.md +1 -1
- package/docs/cli/workspace.md +6 -4
- package/docs/cli-reference.md +12 -8
- package/docs/runtime.md +5 -6
- package/docs/services/aigateway.md +2 -0
- package/docs/services/tailordb.md +44 -0
- package/docs/services/workflow.md +3 -3
- package/docs/testing.md +105 -91
- package/package.json +7 -7
- package/dist/application-6zsDLGKv.mjs +0 -3
- package/dist/application-CqjCcZ2n.mjs.map +0 -1
- package/dist/configure/types/field-runtime.d.mts +0 -17
- package/dist/errors-Dtf2WPaW.mjs +0 -42
- package/dist/errors-Dtf2WPaW.mjs.map +0 -1
- package/dist/field-runtime-D4QWRiB1.mjs +0 -203
- package/dist/field-runtime-D4QWRiB1.mjs.map +0 -1
- package/dist/globals-z6zYMjlr.mjs.map +0 -1
- package/dist/logger-BEiZZ3qT.mjs.map +0 -1
- package/dist/registry-CTgoVWc_.mjs.map +0 -1
- package/dist/runtime-DlklyuHN.mjs.map +0 -1
- package/dist/schema-DbTR1c6M.mjs.map +0 -1
- package/dist/secretmanager-Bd45j7an.mjs.map +0 -1
- package/dist/service-CPMlIg3X.mjs +0 -3
- package/dist/types-BzJ7A_fn.mjs +0 -199
- package/dist/types-BzJ7A_fn.mjs.map +0 -1
- package/dist/types-CG9H7HuE.mjs +0 -4
- package/dist/workflow-DSwnYPPP.mjs +0 -45
- package/dist/workflow-DSwnYPPP.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare namespace workflow_d_exports {
|
|
2
|
-
export { AuthInvoker, ExecutionPolicyKey, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, triggerJobFunction, triggerWorkflow, wait };
|
|
2
|
+
export { AuthInvoker, ExecutionPolicyKey, StartJobFunctionOptions, StartWorkflowOptions, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, resumeWorkflowExecution, startJobFunction, startWorkflow, triggerJobFunction, triggerWorkflow, wait };
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
5
|
* Workflow utilities.
|
|
@@ -7,10 +7,16 @@ declare namespace workflow_d_exports {
|
|
|
7
7
|
* Thin typed wrapper around the platform-provided `tailor.workflow` runtime API.
|
|
8
8
|
* At runtime this delegates to `globalThis.tailor.workflow`. Use `mockWorkflow`
|
|
9
9
|
* from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.
|
|
10
|
+
*
|
|
11
|
+
* The canonical names (`startWorkflow`, `startJobFunction`,
|
|
12
|
+
* `resumeWorkflowExecution`) mirror the public `tailor.v1` RPC vocabulary.
|
|
13
|
+
* The pre-alignment names (`triggerWorkflow`, `triggerJobFunction`,
|
|
14
|
+
* `resumeWorkflow`) are kept as frozen aliases that reference the same platform
|
|
15
|
+
* implementations, so existing code continues to work unchanged.
|
|
10
16
|
* @example
|
|
11
17
|
* import { workflow } from "@tailor-platform/sdk/runtime";
|
|
12
18
|
*
|
|
13
|
-
* const executionId = await workflow.
|
|
19
|
+
* const executionId = await workflow.startWorkflow("myWorkflow", { data: "value" });
|
|
14
20
|
*/
|
|
15
21
|
/**
|
|
16
22
|
* Specifies the machine user that should be used to execute the workflow.
|
|
@@ -22,11 +28,16 @@ interface AuthInvoker {
|
|
|
22
28
|
/** The name of the machine user to use for workflow execution */
|
|
23
29
|
machineUserName: string;
|
|
24
30
|
}
|
|
25
|
-
/** Options for {@link
|
|
26
|
-
interface
|
|
31
|
+
/** Options for {@link startWorkflow}. */
|
|
32
|
+
interface StartWorkflowOptions {
|
|
27
33
|
/** Optional authentication invoker to specify which machine user should execute the workflow */
|
|
28
34
|
authInvoker?: AuthInvoker;
|
|
29
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Frozen alias for {@link StartWorkflowOptions}. Kept for backward compatibility.
|
|
38
|
+
* @deprecated Use {@link StartWorkflowOptions} instead.
|
|
39
|
+
*/
|
|
40
|
+
type TriggerWorkflowOptions = StartWorkflowOptions;
|
|
30
41
|
declare const executionPolicyKeyBrand: unique symbol;
|
|
31
42
|
/**
|
|
32
43
|
* A concrete runtime key produced by an execution policy instance — either an
|
|
@@ -37,14 +48,19 @@ declare const executionPolicyKeyBrand: unique symbol;
|
|
|
37
48
|
type ExecutionPolicyKey = string & {
|
|
38
49
|
readonly [executionPolicyKeyBrand]: never;
|
|
39
50
|
};
|
|
40
|
-
/** Options for {@link
|
|
41
|
-
interface
|
|
51
|
+
/** Options for {@link startJobFunction}. */
|
|
52
|
+
interface StartJobFunctionOptions {
|
|
42
53
|
/**
|
|
43
54
|
* Execution policy key matched by the platform against the policies
|
|
44
55
|
* declared with `defineWorkflowExecutionPolicies` in `tailor.config.ts`.
|
|
45
56
|
*/
|
|
46
57
|
executionPolicyKey?: ExecutionPolicyKey;
|
|
47
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Frozen alias for {@link StartJobFunctionOptions}. Kept for backward compatibility.
|
|
61
|
+
* @deprecated Use {@link StartJobFunctionOptions} instead.
|
|
62
|
+
*/
|
|
63
|
+
type TriggerJobFunctionOptions = StartJobFunctionOptions;
|
|
48
64
|
/**
|
|
49
65
|
* Platform API surface for `tailor.workflow`. Describes the shape the platform
|
|
50
66
|
* runtime injects on `globalThis.tailor.workflow`.
|
|
@@ -55,26 +71,53 @@ interface TriggerJobFunctionOptions {
|
|
|
55
71
|
*/
|
|
56
72
|
interface TailorWorkflowAPI {
|
|
57
73
|
/**
|
|
58
|
-
*
|
|
74
|
+
* Starts a workflow and returns its execution ID.
|
|
75
|
+
*
|
|
76
|
+
* Canonical name that mirrors the `tailor.v1` RPC vocabulary.
|
|
77
|
+
* {@link triggerWorkflow} is a frozen alias that resolves to the same
|
|
78
|
+
* platform implementation.
|
|
59
79
|
* @param workflowName - Workflow name as defined in tailor.config
|
|
60
80
|
* @param args - Arguments forwarded to the workflow's main job
|
|
61
|
-
* @param options - Optional
|
|
62
|
-
* @returns The execution ID of the
|
|
81
|
+
* @param options - Optional start options (e.g. `authInvoker`)
|
|
82
|
+
* @returns The execution ID of the started workflow
|
|
83
|
+
*/
|
|
84
|
+
startWorkflow(workflowName: string, args?: any, options?: StartWorkflowOptions): Promise<string>;
|
|
85
|
+
/**
|
|
86
|
+
* Frozen alias for {@link startWorkflow}. Kept for backward compatibility.
|
|
87
|
+
* @deprecated Use {@link startWorkflow} instead.
|
|
63
88
|
*/
|
|
64
89
|
triggerWorkflow(workflowName: string, args?: any, options?: TriggerWorkflowOptions): Promise<string>;
|
|
65
90
|
/**
|
|
66
91
|
* Resumes a failed or pending-retry workflow execution and returns its execution ID.
|
|
92
|
+
*
|
|
93
|
+
* Canonical name that mirrors the `tailor.v1` RPC vocabulary.
|
|
94
|
+
* {@link resumeWorkflow} is a frozen alias that resolves to the same
|
|
95
|
+
* platform implementation.
|
|
67
96
|
* @param executionId - The execution to resume
|
|
68
97
|
* @returns The execution ID of the resumed workflow
|
|
69
98
|
*/
|
|
99
|
+
resumeWorkflowExecution(executionId: string): Promise<string>;
|
|
100
|
+
/**
|
|
101
|
+
* Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.
|
|
102
|
+
* @deprecated Use {@link resumeWorkflowExecution} instead.
|
|
103
|
+
*/
|
|
70
104
|
resumeWorkflow(executionId: string): Promise<string>;
|
|
71
105
|
/**
|
|
72
|
-
*
|
|
106
|
+
* Starts a job function and returns its result.
|
|
107
|
+
*
|
|
108
|
+
* Canonical name that mirrors the `tailor.v1` RPC vocabulary.
|
|
109
|
+
* {@link triggerJobFunction} is a frozen alias that resolves to the same
|
|
110
|
+
* platform implementation.
|
|
73
111
|
* @param jobName - Job name as defined in the workflow
|
|
74
112
|
* @param args - Arguments forwarded to the job
|
|
75
|
-
* @param options - Optional
|
|
113
|
+
* @param options - Optional start options (e.g. `executionPolicyKey`)
|
|
76
114
|
* @returns The job's return value
|
|
77
115
|
*/
|
|
116
|
+
startJobFunction(jobName: string, args?: any, options?: StartJobFunctionOptions): any;
|
|
117
|
+
/**
|
|
118
|
+
* Frozen alias for {@link startJobFunction}. Kept for backward compatibility.
|
|
119
|
+
* @deprecated Use {@link startJobFunction} instead.
|
|
120
|
+
*/
|
|
78
121
|
triggerJobFunction(jobName: string, args?: any, options?: TriggerJobFunctionOptions): any;
|
|
79
122
|
/**
|
|
80
123
|
* Suspends the current workflow execution and waits for an external signal to resume.
|
|
@@ -93,19 +136,40 @@ interface TailorWorkflowAPI {
|
|
|
93
136
|
resolve(executionId: string, key: string, callback: (waitPayload: any) => any): Promise<void>;
|
|
94
137
|
}
|
|
95
138
|
/**
|
|
96
|
-
* See {@link TailorWorkflowAPI.
|
|
139
|
+
* See {@link TailorWorkflowAPI.startWorkflow}.
|
|
140
|
+
* @param args - Forwarded to {@link TailorWorkflowAPI.startWorkflow}
|
|
141
|
+
* @returns The execution ID of the started workflow
|
|
142
|
+
*/
|
|
143
|
+
declare const startWorkflow: TailorWorkflowAPI["startWorkflow"];
|
|
144
|
+
/**
|
|
145
|
+
* Frozen alias for {@link startWorkflow}. Kept for backward compatibility.
|
|
146
|
+
* @deprecated Use {@link startWorkflow} instead.
|
|
97
147
|
* @param args - Forwarded to {@link TailorWorkflowAPI.triggerWorkflow}
|
|
98
148
|
* @returns The execution ID of the triggered workflow
|
|
99
149
|
*/
|
|
100
150
|
declare const triggerWorkflow: TailorWorkflowAPI["triggerWorkflow"];
|
|
101
151
|
/**
|
|
102
|
-
* See {@link TailorWorkflowAPI.
|
|
152
|
+
* See {@link TailorWorkflowAPI.resumeWorkflowExecution}.
|
|
153
|
+
* @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflowExecution}
|
|
154
|
+
* @returns The execution ID of the resumed workflow
|
|
155
|
+
*/
|
|
156
|
+
declare const resumeWorkflowExecution: TailorWorkflowAPI["resumeWorkflowExecution"];
|
|
157
|
+
/**
|
|
158
|
+
* Frozen alias for {@link resumeWorkflowExecution}. Kept for backward compatibility.
|
|
159
|
+
* @deprecated Use {@link resumeWorkflowExecution} instead.
|
|
103
160
|
* @param args - Forwarded to {@link TailorWorkflowAPI.resumeWorkflow}
|
|
104
161
|
* @returns The execution ID of the resumed workflow
|
|
105
162
|
*/
|
|
106
163
|
declare const resumeWorkflow: TailorWorkflowAPI["resumeWorkflow"];
|
|
107
164
|
/**
|
|
108
|
-
* See {@link TailorWorkflowAPI.
|
|
165
|
+
* See {@link TailorWorkflowAPI.startJobFunction}.
|
|
166
|
+
* @param args - Forwarded to {@link TailorWorkflowAPI.startJobFunction}
|
|
167
|
+
* @returns The job's return value
|
|
168
|
+
*/
|
|
169
|
+
declare const startJobFunction: TailorWorkflowAPI["startJobFunction"];
|
|
170
|
+
/**
|
|
171
|
+
* Frozen alias for {@link startJobFunction}. Kept for backward compatibility.
|
|
172
|
+
* @deprecated Use {@link startJobFunction} instead.
|
|
109
173
|
* @param args - Forwarded to {@link TailorWorkflowAPI.triggerJobFunction}
|
|
110
174
|
* @returns The job's return value
|
|
111
175
|
*/
|
|
@@ -123,4 +187,4 @@ declare const wait: TailorWorkflowAPI["wait"];
|
|
|
123
187
|
*/
|
|
124
188
|
declare const resolve: TailorWorkflowAPI["resolve"];
|
|
125
189
|
//#endregion
|
|
126
|
-
export { AuthInvoker, ExecutionPolicyKey, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, triggerJobFunction, triggerWorkflow, wait, workflow_d_exports };
|
|
190
|
+
export { AuthInvoker, ExecutionPolicyKey, StartJobFunctionOptions, StartWorkflowOptions, TailorWorkflowAPI, TriggerJobFunctionOptions, TriggerWorkflowOptions, resolve, resumeWorkflow, resumeWorkflowExecution, startJobFunction, startWorkflow, triggerJobFunction, triggerWorkflow, wait, workflow_d_exports };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as wait, i as
|
|
1
|
+
import { a as startWorkflow, c as wait, i as startJobFunction, n as resumeWorkflow, o as triggerJobFunction, r as resumeWorkflowExecution, s as triggerWorkflow, t as resolve } from "../workflow-CkIDJpdg.mjs";
|
|
2
2
|
|
|
3
|
-
export { resolve, resumeWorkflow, triggerJobFunction, triggerWorkflow, wait };
|
|
3
|
+
export { resolve, resumeWorkflow, resumeWorkflowExecution, startJobFunction, startWorkflow, triggerJobFunction, triggerWorkflow, wait };
|