@tailor-platform/sdk 2.0.0-next.1 → 2.0.0-next.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/CHANGELOG.md +56 -0
- package/dist/application-Dtqap5jM.mjs +3 -0
- package/dist/{client-z_oHGVNy.mjs → application-XuMWK4eq.mjs} +5861 -20
- package/dist/application-XuMWK4eq.mjs.map +1 -0
- package/dist/cli/index.mjs +179 -122
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +75 -16
- package/dist/cli/lib.mjs +5 -6
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/completion/zsh-worker.zsh +105 -26
- package/dist/configure/index.d.mts +9 -8
- package/dist/configure/index.mjs +56 -19
- package/dist/configure/index.mjs.map +1 -1
- package/dist/context-Bd266-ru.mjs.map +1 -1
- package/dist/{context-BuuIb8CC.d.mts → context-C2lEi9uw.d.mts} +7 -28
- package/dist/{crashreport-pr6Rhvza.mjs → crashreport-BMWcxeSE.mjs} +1 -1
- package/dist/{crashreport-BsjAkFWw.mjs → crashreport-DFq-vsU0.mjs} +5 -7
- package/dist/{crashreport-BsjAkFWw.mjs.map → crashreport-DFq-vsU0.mjs.map} +1 -1
- package/dist/{file-_oUZo76X.mjs → file-BbdFGdMV.mjs} +2 -10
- package/dist/file-BbdFGdMV.mjs.map +1 -0
- package/dist/{file-BB8Vs9O_.d.mts → file-Dq3NIt_F.d.mts} +3 -42
- package/dist/{file-utils-DcyIPFQh.mjs → file-utils-CYZnO1pX.mjs} +5 -5
- package/dist/file-utils-CYZnO1pX.mjs.map +1 -0
- package/dist/{globals-Crz8o65k.mjs → globals-Cf0sxIt8.mjs} +2 -2
- package/dist/{globals-Crz8o65k.mjs.map → globals-Cf0sxIt8.mjs.map} +1 -1
- package/dist/{http-adapter.generated-WgMnb7Sb.d.mts → http-adapter.generated-DFsXDdm5.d.mts} +11 -10
- package/dist/{index-BlpzXncY.d.mts → index-BI-_j9Z3.d.mts} +29 -32
- package/dist/{index-DjUdWlzf.d.mts → index-C4JirJH8.d.mts} +2 -2
- package/dist/{index-5vPyRu1y.d.mts → index-CZfWhr0a.d.mts} +2 -2
- package/dist/{index-CK7u9isy.d.mts → index-Cg8VKAdN.d.mts} +4 -4
- package/dist/{index-B7AKc18V.d.mts → index-DYRjoLXD.d.mts} +2 -2
- package/dist/{index-ZePLwxw7.d.mts → index-lFpcjHPU.d.mts} +8 -15
- package/dist/{index-CNYe5lnW.d.mts → index-nW7hE6oE.d.mts} +2 -2
- package/dist/{mock-BjFj5o1I.mjs → mock-FPxmnt-y.mjs} +4 -49
- package/dist/{mock-BjFj5o1I.mjs.map → mock-FPxmnt-y.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.mjs +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.d.mts +1 -1
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/index.d.mts +4 -3
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/{registry-DdsYlL_P.mjs → registry-DH4m7eYo.mjs} +4 -2
- package/dist/registry-DH4m7eYo.mjs.map +1 -0
- package/dist/runtime/context.d.mts +1 -1
- package/dist/runtime/file.d.mts +2 -2
- package/dist/runtime/file.mjs +2 -2
- package/dist/runtime/globals.d.mts +6 -6
- package/dist/runtime/index.d.mts +4 -4
- package/dist/runtime/index.mjs +2 -2
- package/dist/runtime/workflow.d.mts +2 -2
- package/dist/runtime/workflow.mjs +1 -1
- package/dist/{runtime-n9NCkjee.mjs → runtime-CY4JvrDj.mjs} +777 -234
- package/dist/runtime-CY4JvrDj.mjs.map +1 -0
- package/dist/{schema-BhkpP5Hw.mjs → schema-Dtw9Orye.mjs} +16 -13
- package/dist/schema-Dtw9Orye.mjs.map +1 -0
- package/dist/{secret-file-DBqZhjFQ.mjs → secret-file-VSVGy1V0.mjs} +27 -2
- package/dist/{secret-file-DBqZhjFQ.mjs.map → secret-file-VSVGy1V0.mjs.map} +1 -1
- package/dist/{seed-jf3008-h.mjs → seed-izIEyP3z.mjs} +3 -4
- package/dist/seed-izIEyP3z.mjs.map +1 -0
- package/dist/service-DCqIWibD.mjs +3 -0
- package/dist/{service-DU1mVzri.mjs → service-DU1mVzri2.mjs} +1 -1
- package/dist/service-DU1mVzri2.mjs.map +1 -0
- package/dist/{service-CCL8ruDf.mjs → service-DjyqbCaJ.mjs} +7 -7
- package/dist/{service-CCL8ruDf.mjs.map → service-DjyqbCaJ.mjs.map} +1 -1
- package/dist/test-env-key-D7UkZp99.mjs +75 -0
- package/dist/test-env-key-D7UkZp99.mjs.map +1 -0
- package/dist/{types-ClhIrW_C.mjs → types-74etvaxy.mjs} +1 -1
- package/dist/{types-DhO_VEZd.d.mts → types-BDRml5C3.d.mts} +12 -12
- package/dist/{types-B2RpYyA_.mjs → types-BQijbo4m.mjs} +9 -9
- package/dist/types-BQijbo4m.mjs.map +1 -0
- package/dist/{types-DwDgacni.d.mts → types-BX4q6Mo6.d.mts} +3 -2
- package/dist/types-BZ7QKVE8.d.mts +21 -0
- package/dist/{types-DCUhgpyI.d.mts → types-CdcQh4Z2.d.mts} +5 -76
- package/dist/utils/test/index.d.mts +6 -15
- package/dist/utils/test/index.mjs +4 -13
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +2 -2
- package/dist/vitest/index.mjs +4 -4
- package/dist/vitest/setup.mjs +2 -2
- package/dist/{workflow-DgemCAz3.mjs → workflow-BOmaZwwG.mjs} +8 -3
- package/dist/workflow-BOmaZwwG.mjs.map +1 -0
- package/dist/{workflow-BbKvGLQg.d.mts → workflow-BVy4XWjS.d.mts} +15 -10
- package/dist/{workflow.generated-DtQwEo-x.d.mts → workflow.generated-ClEjBYhm.d.mts} +3 -3
- package/docs/cli/executor.md +53 -0
- package/docs/cli/setup.md +35 -33
- package/docs/cli/workflow.md +157 -20
- package/docs/cli-reference.md +26 -20
- package/docs/github-actions.md +29 -16
- package/docs/migration/v2.md +475 -0
- package/docs/runtime.md +1 -1
- package/docs/services/auth.md +12 -12
- package/docs/services/executor.md +3 -3
- package/docs/services/resolver.md +6 -6
- package/docs/services/tailordb.md +14 -12
- package/docs/services/workflow.md +4 -4
- package/docs/testing.md +59 -47
- package/package.json +7 -7
- package/dist/application-DB2r36Et.mjs +0 -3
- package/dist/application-DqS1yBg3.mjs +0 -5680
- package/dist/application-DqS1yBg3.mjs.map +0 -1
- package/dist/client-Dbohmtkv.mjs +0 -3
- package/dist/client-z_oHGVNy.mjs.map +0 -1
- package/dist/file-_oUZo76X.mjs.map +0 -1
- package/dist/file-utils-DcyIPFQh.mjs.map +0 -1
- package/dist/job-fuc3j1Ma.mjs +0 -53
- package/dist/job-fuc3j1Ma.mjs.map +0 -1
- package/dist/registry-DdsYlL_P.mjs.map +0 -1
- package/dist/runtime-n9NCkjee.mjs.map +0 -1
- package/dist/schema-BhkpP5Hw.mjs.map +0 -1
- package/dist/seed-jf3008-h.mjs.map +0 -1
- package/dist/service-D6yonf2I.mjs +0 -3
- package/dist/service-DU1mVzri.mjs.map +0 -1
- package/dist/test-env-key-D9kM6ETE.mjs +0 -49
- package/dist/test-env-key-D9kM6ETE.mjs.map +0 -1
- package/dist/types-B2RpYyA_.mjs.map +0 -1
- package/dist/workflow-DgemCAz3.mjs.map +0 -1
package/docs/cli/setup.md
CHANGED
|
@@ -10,7 +10,7 @@ Commands for setting up project infrastructure.
|
|
|
10
10
|
|
|
11
11
|
<!-- politty:command:setup:description:start -->
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Generate a CI deploy workflow for your project. (beta)
|
|
14
14
|
|
|
15
15
|
<!-- politty:command:setup:description:end -->
|
|
16
16
|
|
|
@@ -19,18 +19,36 @@ Set up project infrastructure.
|
|
|
19
19
|
**Usage**
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
tailor-sdk setup [command]
|
|
22
|
+
tailor-sdk setup [options] [command]
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
<!-- politty:command:setup:usage:end -->
|
|
26
26
|
|
|
27
|
+
<!-- politty:command:setup:options:start -->
|
|
28
|
+
|
|
29
|
+
**Options**
|
|
30
|
+
|
|
31
|
+
| Option | Alias | Description | Required | Default |
|
|
32
|
+
| ----------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ---------- |
|
|
33
|
+
| `--provider <PROVIDER>` | `-p` | CI provider to generate for (only 'github' is supported) | No | `"github"` |
|
|
34
|
+
| `--workspace-name <WORKSPACE_NAME>` | `-n` | Workspace name (defaults to the config 'name') | No | - |
|
|
35
|
+
| `--branch <BRANCH>` | - | Branch target: deploy trigger branch (defaults to the detected default branch). Tag target: tag-reachability guard branch (no guard when omitted) | No | - |
|
|
36
|
+
| `--tag` | - | Generate a tag target (deploy on tag push) | No | `false` |
|
|
37
|
+
| `--tag-pattern <TAG_PATTERN>` | - | Tag glob to match (requires --tag; defaults to v\*) | No | - |
|
|
38
|
+
| `--environment <ENVIRONMENT>` | - | GitHub Environment for the plan/deploy jobs (defaults to the workspace name) | No | - |
|
|
39
|
+
| `--no-plan` | - | Disable the plan job for a branch target (cannot be combined with --tag) | No | `false` |
|
|
40
|
+
| `--dir <DIR>` | `-d` | App directory (for monorepo setups) | No | `"."` |
|
|
41
|
+
| `--force` | - | Discard hand edits / take over unmanaged files and regenerate | No | `false` |
|
|
42
|
+
|
|
43
|
+
<!-- politty:command:setup:options:end -->
|
|
44
|
+
|
|
27
45
|
<!-- politty:command:setup:subcommands:start -->
|
|
28
46
|
|
|
29
47
|
**Commands**
|
|
30
48
|
|
|
31
|
-
| Command
|
|
32
|
-
|
|
|
33
|
-
| [`setup
|
|
49
|
+
| Command | Description |
|
|
50
|
+
| ----------------------------- | -------------------------------------------------------------------------------- |
|
|
51
|
+
| [`setup check`](#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
|
|
34
52
|
|
|
35
53
|
<!-- politty:command:setup:subcommands:end -->
|
|
36
54
|
|
|
@@ -39,50 +57,34 @@ tailor-sdk setup [command]
|
|
|
39
57
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
40
58
|
|
|
41
59
|
<!-- politty:command:setup:global-options-link:end -->
|
|
42
|
-
<!-- politty:command:setup github:heading:start -->
|
|
43
60
|
|
|
44
|
-
|
|
61
|
+
<!-- politty:command:setup check:heading:start -->
|
|
62
|
+
|
|
63
|
+
### setup check
|
|
45
64
|
|
|
46
|
-
<!-- politty:command:setup
|
|
65
|
+
<!-- politty:command:setup check:heading:end -->
|
|
47
66
|
|
|
48
|
-
<!-- politty:command:setup
|
|
67
|
+
<!-- politty:command:setup check:description:start -->
|
|
49
68
|
|
|
50
|
-
|
|
69
|
+
Audit generated workflows for drift against the current config/repo (read-only).
|
|
51
70
|
|
|
52
|
-
<!-- politty:command:setup
|
|
71
|
+
<!-- politty:command:setup check:description:end -->
|
|
53
72
|
|
|
54
|
-
<!-- politty:command:setup
|
|
73
|
+
<!-- politty:command:setup check:usage:start -->
|
|
55
74
|
|
|
56
75
|
**Usage**
|
|
57
76
|
|
|
58
77
|
```
|
|
59
|
-
tailor-sdk setup
|
|
78
|
+
tailor-sdk setup check
|
|
60
79
|
```
|
|
61
80
|
|
|
62
|
-
<!-- politty:command:setup
|
|
63
|
-
|
|
64
|
-
<!-- politty:command:setup github:options:start -->
|
|
65
|
-
|
|
66
|
-
**Options**
|
|
67
|
-
|
|
68
|
-
| Option | Alias | Description | Required | Default |
|
|
69
|
-
| ----------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- |
|
|
70
|
-
| `--workspace-name <WORKSPACE_NAME>` | `-n` | Workspace name (defaults to the config 'name') | No | - |
|
|
71
|
-
| `--branch <BRANCH>` | - | Branch target: deploy trigger branch (defaults to the detected default branch). Tag target: tag-reachability guard branch (no guard when omitted) | No | - |
|
|
72
|
-
| `--tag` | - | Generate a tag target (deploy on tag push) | No | `false` |
|
|
73
|
-
| `--tag-pattern <TAG_PATTERN>` | - | Tag glob to match (requires --tag; defaults to v\*) | No | - |
|
|
74
|
-
| `--environment <ENVIRONMENT>` | - | GitHub Environment for the plan/deploy jobs (defaults to the workspace name) | No | - |
|
|
75
|
-
| `--no-plan` | - | Disable the plan job for a branch target (cannot be combined with --tag) | No | `false` |
|
|
76
|
-
| `--dir <DIR>` | `-d` | App directory (for monorepo setups) | No | `"."` |
|
|
77
|
-
| `--force` | - | Discard hand edits / take over unmanaged files and regenerate | No | `false` |
|
|
78
|
-
|
|
79
|
-
<!-- politty:command:setup github:options:end -->
|
|
81
|
+
<!-- politty:command:setup check:usage:end -->
|
|
80
82
|
|
|
81
|
-
<!-- politty:command:setup
|
|
83
|
+
<!-- politty:command:setup check:global-options-link:start -->
|
|
82
84
|
|
|
83
85
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
84
86
|
|
|
85
|
-
<!-- politty:command:setup
|
|
87
|
+
<!-- politty:command:setup check:global-options-link:end -->
|
|
86
88
|
|
|
87
89
|
## Further reading
|
|
88
90
|
|
package/docs/cli/workflow.md
CHANGED
|
@@ -33,6 +33,7 @@ tailor-sdk workflow [command]
|
|
|
33
33
|
| [`workflow list`](#workflow-list) | List all workflows in the workspace. |
|
|
34
34
|
| [`workflow get`](#workflow-get) | Get workflow details. |
|
|
35
35
|
| [`workflow start`](#workflow-start) | Start a workflow execution. |
|
|
36
|
+
| [`workflow wait`](#workflow-wait) | Wait for a workflow execution. |
|
|
36
37
|
| [`workflow executions`](#workflow-executions) | List or get workflow executions. |
|
|
37
38
|
| [`workflow resume`](#workflow-resume) | Resume a failed or pending workflow execution. |
|
|
38
39
|
|
|
@@ -175,8 +176,10 @@ tailor-sdk workflow start [options] <name>
|
|
|
175
176
|
| `--machine-user <MACHINE_USER>` | `-m` | Machine user name. Falls back to the active profile's default machine user. | No | - | `TAILOR_PLATFORM_MACHINE_USER_NAME` |
|
|
176
177
|
| `--arg <ARG>` | `-a` | Workflow argument (JSON string) | No | - | - |
|
|
177
178
|
| `--wait` | `-W` | Wait for execution to complete | No | `false` | - |
|
|
178
|
-
| `--interval <INTERVAL>` | `-i` | Polling interval when
|
|
179
|
-
| `--
|
|
179
|
+
| `--interval <INTERVAL>` | `-i` | Polling interval when waiting (e.g., '3s', '500ms', '1m') | No | `"3s"` | - |
|
|
180
|
+
| `--timeout <TIMEOUT>` | `-t` | Maximum time to wait (e.g., '30s', '10m') | No | `"10m"` | - |
|
|
181
|
+
| `--until <UNTIL>` | `-u` | Wait target (success, suspended, terminal) | No | `"terminal"` | - |
|
|
182
|
+
| `--logs` | `-l` | Display job execution logs after completion | No | `false` | - |
|
|
180
183
|
|
|
181
184
|
<!-- politty:command:workflow start:options:end -->
|
|
182
185
|
|
|
@@ -185,6 +188,136 @@ tailor-sdk workflow start [options] <name>
|
|
|
185
188
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
186
189
|
|
|
187
190
|
<!-- politty:command:workflow start:global-options-link:end -->
|
|
191
|
+
<!-- politty:command:workflow wait:heading:start -->
|
|
192
|
+
|
|
193
|
+
### workflow wait
|
|
194
|
+
|
|
195
|
+
<!-- politty:command:workflow wait:heading:end -->
|
|
196
|
+
|
|
197
|
+
<!-- politty:command:workflow wait:description:start -->
|
|
198
|
+
|
|
199
|
+
Wait for a workflow execution.
|
|
200
|
+
|
|
201
|
+
<!-- politty:command:workflow wait:description:end -->
|
|
202
|
+
|
|
203
|
+
<!-- politty:command:workflow wait:usage:start -->
|
|
204
|
+
|
|
205
|
+
**Usage**
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
tailor-sdk workflow wait [options] <execution-id>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
<!-- politty:command:workflow wait:usage:end -->
|
|
212
|
+
|
|
213
|
+
<!-- politty:command:workflow wait:arguments:start -->
|
|
214
|
+
|
|
215
|
+
**Arguments**
|
|
216
|
+
|
|
217
|
+
| Argument | Description | Required |
|
|
218
|
+
| -------------- | ------------ | -------- |
|
|
219
|
+
| `execution-id` | Execution ID | Yes |
|
|
220
|
+
|
|
221
|
+
<!-- politty:command:workflow wait:arguments:end -->
|
|
222
|
+
|
|
223
|
+
<!-- politty:command:workflow wait:options:start -->
|
|
224
|
+
|
|
225
|
+
**Options**
|
|
226
|
+
|
|
227
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
228
|
+
| ------------------------------- | ----- | --------------------------------------------------------- | -------- | ------------ | ------------------------------ |
|
|
229
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
230
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
231
|
+
| `--interval <INTERVAL>` | `-i` | Polling interval when waiting (e.g., '3s', '500ms', '1m') | No | `"3s"` | - |
|
|
232
|
+
| `--timeout <TIMEOUT>` | `-t` | Maximum time to wait (e.g., '30s', '10m') | No | `"10m"` | - |
|
|
233
|
+
| `--until <UNTIL>` | `-u` | Wait target (success, suspended, terminal) | No | `"terminal"` | - |
|
|
234
|
+
| `--logs` | `-l` | Display job execution logs after completion | No | `false` | - |
|
|
235
|
+
|
|
236
|
+
<!-- politty:command:workflow wait:options:end -->
|
|
237
|
+
|
|
238
|
+
<!-- politty:command:workflow wait:global-options-link:start -->
|
|
239
|
+
|
|
240
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
241
|
+
|
|
242
|
+
<!-- politty:command:workflow wait:global-options-link:end -->
|
|
243
|
+
|
|
244
|
+
<!-- politty:command:workflow wait:examples:start -->
|
|
245
|
+
|
|
246
|
+
**Examples**
|
|
247
|
+
|
|
248
|
+
**Wait for workflow success**
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
$ tailor-sdk workflow wait execution-id --until success --timeout 10m --json
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Wait for a workflow wait point**
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
$ tailor-sdk workflow wait execution-id --until suspended --timeout 6m --logs --json
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**Wait for success, failure, or suspension**
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
$ tailor-sdk workflow wait execution-id --until terminal
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
<!-- politty:command:workflow wait:examples:end -->
|
|
267
|
+
|
|
268
|
+
**Shell automation**
|
|
269
|
+
|
|
270
|
+
Capture the execution ID from `workflow start` and wait for the same run from a
|
|
271
|
+
separate command:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
execution_id="$(
|
|
275
|
+
tailor-sdk workflow start order-workflow --json | jq -r '.executionId'
|
|
276
|
+
)"
|
|
277
|
+
|
|
278
|
+
tailor-sdk workflow wait "$execution_id" \
|
|
279
|
+
--until success \
|
|
280
|
+
--timeout 10m \
|
|
281
|
+
--interval 5s \
|
|
282
|
+
--json
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Wait until a workflow reaches a wait point, such as an approval step:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
tailor-sdk workflow wait "$execution_id" \
|
|
289
|
+
--until suspended \
|
|
290
|
+
--timeout 6m \
|
|
291
|
+
--logs \
|
|
292
|
+
--json
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Programmatic API**
|
|
296
|
+
|
|
297
|
+
Use `waitWorkflowExecution` when a script already has an execution ID and needs
|
|
298
|
+
the same waiter behavior as the CLI:
|
|
299
|
+
|
|
300
|
+
```ts
|
|
301
|
+
import { waitWorkflowExecution } from "@tailor-platform/sdk/cli";
|
|
302
|
+
|
|
303
|
+
const executionId = process.env.EXECUTION_ID;
|
|
304
|
+
|
|
305
|
+
if (!executionId) {
|
|
306
|
+
throw new Error("EXECUTION_ID is required");
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const result = await waitWorkflowExecution({
|
|
310
|
+
executionId,
|
|
311
|
+
until: "success",
|
|
312
|
+
timeout: 10 * 60 * 1000,
|
|
313
|
+
interval: 5000,
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
if (result.timedOut) {
|
|
317
|
+
throw new Error(`Workflow ${result.id} timed out at ${result.status}`);
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
188
321
|
<!-- politty:command:workflow executions:heading:start -->
|
|
189
322
|
|
|
190
323
|
### workflow executions
|
|
@@ -221,17 +354,19 @@ tailor-sdk workflow executions [options] [execution-id]
|
|
|
221
354
|
|
|
222
355
|
**Options**
|
|
223
356
|
|
|
224
|
-
| Option | Alias | Description
|
|
225
|
-
| --------------------------------- | ----- |
|
|
226
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID
|
|
227
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile
|
|
228
|
-
| `--order <ORDER>` | - | Sort order (asc or desc)
|
|
229
|
-
| `--limit <LIMIT>` | `-l` | Maximum number of items to return (0: unlimited)
|
|
230
|
-
| `--workflow-name <WORKFLOW_NAME>` | `-n` | Filter by workflow name (list mode only)
|
|
231
|
-
| `--status <STATUS>` | `-s` | Filter by status (list mode only)
|
|
232
|
-
| `--wait` | `-W` | Wait for execution to complete
|
|
233
|
-
| `--interval <INTERVAL>` | `-i` | Polling interval when
|
|
234
|
-
| `--
|
|
357
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
358
|
+
| --------------------------------- | ----- | --------------------------------------------------------- | -------- | ------------ | ------------------------------ |
|
|
359
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
360
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
361
|
+
| `--order <ORDER>` | - | Sort order (asc or desc) | No | `"desc"` | - |
|
|
362
|
+
| `--limit <LIMIT>` | `-l` | Maximum number of items to return (0: unlimited) | No | `50` | - |
|
|
363
|
+
| `--workflow-name <WORKFLOW_NAME>` | `-n` | Filter by workflow name (list mode only) | No | - | - |
|
|
364
|
+
| `--status <STATUS>` | `-s` | Filter by status (list mode only) | No | - | - |
|
|
365
|
+
| `--wait` | `-W` | Wait for execution to complete | No | `false` | - |
|
|
366
|
+
| `--interval <INTERVAL>` | `-i` | Polling interval when waiting (e.g., '3s', '500ms', '1m') | No | `"3s"` | - |
|
|
367
|
+
| `--timeout <TIMEOUT>` | `-t` | Maximum time to wait (e.g., '30s', '10m') | No | `"10m"` | - |
|
|
368
|
+
| `--until <UNTIL>` | `-u` | Wait target (success, suspended, terminal) | No | `"terminal"` | - |
|
|
369
|
+
| `--logs` | - | Display job execution logs (detail mode only) | No | `false` | - |
|
|
235
370
|
|
|
236
371
|
<!-- politty:command:workflow executions:options:end -->
|
|
237
372
|
|
|
@@ -276,13 +411,15 @@ tailor-sdk workflow resume [options] <execution-id>
|
|
|
276
411
|
|
|
277
412
|
**Options**
|
|
278
413
|
|
|
279
|
-
| Option | Alias | Description
|
|
280
|
-
| ------------------------------- | ----- |
|
|
281
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID
|
|
282
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile
|
|
283
|
-
| `--wait` | `-W` | Wait for execution to complete
|
|
284
|
-
| `--interval <INTERVAL>` | `-i` | Polling interval when
|
|
285
|
-
| `--
|
|
414
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
415
|
+
| ------------------------------- | ----- | --------------------------------------------------------- | -------- | ------------ | ------------------------------ |
|
|
416
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
417
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
418
|
+
| `--wait` | `-W` | Wait for execution to complete | No | `false` | - |
|
|
419
|
+
| `--interval <INTERVAL>` | `-i` | Polling interval when waiting (e.g., '3s', '500ms', '1m') | No | `"3s"` | - |
|
|
420
|
+
| `--timeout <TIMEOUT>` | `-t` | Maximum time to wait (e.g., '30s', '10m') | No | `"10m"` | - |
|
|
421
|
+
| `--until <UNTIL>` | `-u` | Wait target (success, suspended, terminal) | No | `"terminal"` | - |
|
|
422
|
+
| `--logs` | `-l` | Display job execution logs after completion | No | `false` | - |
|
|
286
423
|
|
|
287
424
|
<!-- politty:command:workflow resume:options:end -->
|
|
288
425
|
|
package/docs/cli-reference.md
CHANGED
|
@@ -65,23 +65,24 @@ tailor-sdk deploy --env-file .env --env-file .env.production
|
|
|
65
65
|
|
|
66
66
|
You can use environment variables to configure workspace and authentication:
|
|
67
67
|
|
|
68
|
-
| Variable | Description
|
|
69
|
-
| -------------------------------------------- |
|
|
70
|
-
| `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands
|
|
71
|
-
| `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands
|
|
72
|
-
| `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands
|
|
73
|
-
| `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`)
|
|
74
|
-
| `TAILOR_TOKEN` | **Deprecated.** Use `TAILOR_PLATFORM_TOKEN` instead
|
|
75
|
-
| `TAILOR_PLATFORM_PROFILE` | Workspace profile name
|
|
76
|
-
| `TAILOR_PLATFORM_SDK_CONFIG_PATH` | Path to SDK config file
|
|
77
|
-
| `TAILOR_PLATFORM_SDK_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file
|
|
78
|
-
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user`
|
|
79
|
-
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user`
|
|
80
|
-
| `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function test-run`, `machineuser token`
|
|
81
|
-
| `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
68
|
+
| Variable | Description |
|
|
69
|
+
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
70
|
+
| `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
|
|
71
|
+
| `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands |
|
|
72
|
+
| `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands |
|
|
73
|
+
| `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
|
|
74
|
+
| `TAILOR_TOKEN` | **Deprecated.** Use `TAILOR_PLATFORM_TOKEN` instead |
|
|
75
|
+
| `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
|
|
76
|
+
| `TAILOR_PLATFORM_SDK_CONFIG_PATH` | Path to SDK config file |
|
|
77
|
+
| `TAILOR_PLATFORM_SDK_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
|
|
78
|
+
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
|
|
79
|
+
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user` |
|
|
80
|
+
| `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function test-run`, `machineuser token` |
|
|
81
|
+
| `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count |
|
|
82
|
+
| `TAILOR_APPLY_CONCURRENCY` | Max concurrent unary platform RPCs during `apply`/`deploy` (streaming uploads are not gated). Defaults to 16 |
|
|
83
|
+
| `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |
|
|
84
|
+
| `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off` |
|
|
85
|
+
| `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on` |
|
|
85
86
|
|
|
86
87
|
### Authentication Token Priority
|
|
87
88
|
|
|
@@ -92,6 +93,10 @@ Token resolution follows this priority order:
|
|
|
92
93
|
3. Profile specified via `--profile` option or `TAILOR_PLATFORM_PROFILE`
|
|
93
94
|
4. Current user from platform config (`~/.config/tailor-platform/config.yaml`)
|
|
94
95
|
|
|
96
|
+
`tailor-sdk login` stores local CLI login tokens in the OS keyring by default
|
|
97
|
+
when available. If the keyring is unavailable, tokens are stored in the platform
|
|
98
|
+
config file.
|
|
99
|
+
|
|
95
100
|
### Workspace ID Priority
|
|
96
101
|
|
|
97
102
|
Workspace ID resolution follows this priority order:
|
|
@@ -222,6 +227,7 @@ Commands for managing workflows and executions.
|
|
|
222
227
|
| [workflow list](./cli/workflow.md#workflow-list) | List all workflows in the workspace. |
|
|
223
228
|
| [workflow get](./cli/workflow.md#workflow-get) | Get workflow details. |
|
|
224
229
|
| [workflow start](./cli/workflow.md#workflow-start) | Start a workflow execution. |
|
|
230
|
+
| [workflow wait](./cli/workflow.md#workflow-wait) | Wait for a workflow execution. |
|
|
225
231
|
| [workflow executions](./cli/workflow.md#workflow-executions) | List or get workflow executions. |
|
|
226
232
|
| [workflow resume](./cli/workflow.md#workflow-resume) | Resume a failed or pending workflow execution. |
|
|
227
233
|
|
|
@@ -287,9 +293,9 @@ Commands for managing crash reports.
|
|
|
287
293
|
|
|
288
294
|
Commands for setting up project infrastructure.
|
|
289
295
|
|
|
290
|
-
| Command
|
|
291
|
-
|
|
|
292
|
-
| [setup
|
|
296
|
+
| Command | Description |
|
|
297
|
+
| ----------------------------------------- | -------------------------------------------------------------------------------- |
|
|
298
|
+
| [setup check](./cli/setup.md#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
|
|
293
299
|
|
|
294
300
|
### [Upgrade Commands](./cli/upgrade.md)
|
|
295
301
|
|
package/docs/github-actions.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GitHub Actions Integration
|
|
2
2
|
|
|
3
|
-
`tailor-sdk setup
|
|
3
|
+
`tailor-sdk setup` generates a GitHub Actions workflow that deploys your
|
|
4
4
|
Tailor Platform application automatically on push or tag.
|
|
5
5
|
|
|
6
6
|
> **Beta:** This command is under active development. CLI flags, the generated
|
|
@@ -14,13 +14,16 @@ lives):
|
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
# Branch target: deploy to stg on every push to main
|
|
17
|
-
tailor-sdk setup
|
|
17
|
+
tailor-sdk setup -n my-app-stg
|
|
18
18
|
|
|
19
19
|
# Tag target: deploy to production when a tag is pushed, with an approval gate
|
|
20
|
-
tailor-sdk setup
|
|
20
|
+
tailor-sdk setup -n my-app-prod \
|
|
21
21
|
--tag --branch main --environment production
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
`setup` defaults to the GitHub provider; `--provider github` (`-p github`) is
|
|
25
|
+
accepted but optional, and other providers are not yet supported.
|
|
26
|
+
|
|
24
27
|
After running the command, follow the **Next steps** printed to the terminal to
|
|
25
28
|
set the required secrets, set the `TAILOR_PLATFORM_WORKSPACE_ID` variable, and
|
|
26
29
|
commit the generated files.
|
|
@@ -33,7 +36,7 @@ before the first deploy (see [Targeting a workspace](#targeting-a-workspace)).
|
|
|
33
36
|
## Targets
|
|
34
37
|
|
|
35
38
|
A _target_ is one workflow file that handles one deployment destination.
|
|
36
|
-
Run `setup
|
|
39
|
+
Run `setup` once per target.
|
|
37
40
|
|
|
38
41
|
### Branch target (recommended for staging)
|
|
39
42
|
|
|
@@ -41,9 +44,9 @@ The branch target fires on pull requests and pushes to the branch you specify
|
|
|
41
44
|
(defaulting to the repository's default branch when `--branch` is omitted):
|
|
42
45
|
|
|
43
46
|
```bash
|
|
44
|
-
tailor-sdk setup
|
|
47
|
+
tailor-sdk setup -n my-app-stg
|
|
45
48
|
# Equivalent to:
|
|
46
|
-
tailor-sdk setup
|
|
49
|
+
tailor-sdk setup -n my-app-stg --branch main
|
|
47
50
|
```
|
|
48
51
|
|
|
49
52
|
What it does:
|
|
@@ -66,7 +69,7 @@ The tag target fires when a tag matching `--tag-pattern` (default `v*`) is
|
|
|
66
69
|
pushed:
|
|
67
70
|
|
|
68
71
|
```bash
|
|
69
|
-
tailor-sdk setup
|
|
72
|
+
tailor-sdk setup -n my-app-prod \
|
|
70
73
|
--tag --tag-pattern "v*" --branch main --environment production
|
|
71
74
|
```
|
|
72
75
|
|
|
@@ -136,7 +139,7 @@ environment is planned.)
|
|
|
136
139
|
|
|
137
140
|
## Generated files
|
|
138
141
|
|
|
139
|
-
Running `setup
|
|
142
|
+
Running `setup` creates or updates:
|
|
140
143
|
|
|
141
144
|
### `.github/workflows/tailor-<workspace-name>.yml`
|
|
142
145
|
|
|
@@ -148,10 +151,10 @@ edit or rename them — the SDK tracks them by id.
|
|
|
148
151
|
|
|
149
152
|
You can add your own jobs and steps around the managed ones. To add
|
|
150
153
|
project-specific setup (such as private registry authentication or a system
|
|
151
|
-
dependency), add a step _before_ the managed setup
|
|
152
|
-
extras (such as `playwright install`), add a step _after_
|
|
154
|
+
dependency), add a step _before_ the managed `tailor-setup` step. For
|
|
155
|
+
post-install extras (such as `playwright install`), add a step _after_ it.
|
|
153
156
|
|
|
154
|
-
Note that re-running `setup
|
|
157
|
+
Note that re-running `setup` currently regenerates the whole file: if
|
|
155
158
|
the file differs from what the SDK last wrote — whether you edited a managed
|
|
156
159
|
step or added your own — the command stops and reports the conflict. Pass
|
|
157
160
|
`--force` to discard your edits and regenerate from the current template, then
|
|
@@ -167,7 +170,7 @@ detect hand edits.
|
|
|
167
170
|
|
|
168
171
|
### `tailor.config.ts` (id injection)
|
|
169
172
|
|
|
170
|
-
If your config does not already have an `id` field, `setup
|
|
173
|
+
If your config does not already have an `id` field, `setup` injects one.
|
|
171
174
|
This `id` must be committed alongside the workflow file. In CI, `tailor-sdk
|
|
172
175
|
deploy` refuses to inject a new id — if the id were assigned fresh on each CI
|
|
173
176
|
run, every deploy would create a brand-new application and lose ownership of
|
|
@@ -238,7 +241,7 @@ you can deploy any commit regardless of branch membership.
|
|
|
238
241
|
For a monorepo where your SDK app lives in a subdirectory, pass `--dir`:
|
|
239
242
|
|
|
240
243
|
```bash
|
|
241
|
-
tailor-sdk setup
|
|
244
|
+
tailor-sdk setup -n my-app --dir apps/backend
|
|
242
245
|
```
|
|
243
246
|
|
|
244
247
|
The generated workflow adds a `paths` filter on `apps/backend/**` so the
|
|
@@ -303,10 +306,10 @@ A typical setup with staging and production:
|
|
|
303
306
|
|
|
304
307
|
```bash
|
|
305
308
|
# Staging: main → stg (deploy on every push to main)
|
|
306
|
-
tailor-sdk setup
|
|
309
|
+
tailor-sdk setup -n my-app-stg
|
|
307
310
|
|
|
308
311
|
# Production: tagged commits → prod, with approval gate and branch guard
|
|
309
|
-
tailor-sdk setup
|
|
312
|
+
tailor-sdk setup -n my-app-prod \
|
|
310
313
|
--tag --branch main --environment production
|
|
311
314
|
```
|
|
312
315
|
|
|
@@ -326,9 +329,19 @@ gh secret set TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET --env production
|
|
|
326
329
|
|
|
327
330
|
Commit both workflow files and `.github/tailor-sdk.lock`.
|
|
328
331
|
|
|
332
|
+
## Checking for drift
|
|
333
|
+
|
|
334
|
+
`tailor-sdk setup check` audits the workflows recorded in
|
|
335
|
+
`.github/tailor-sdk.lock` against your current config and repository, without
|
|
336
|
+
writing anything. It reports when a workflow file is missing or hand-edited, a
|
|
337
|
+
newer template is available, `tailor.config.ts` is no longer under the recorded
|
|
338
|
+
`--dir`, or the repository default branch no longer matches a branch target's
|
|
339
|
+
trigger. It exits non-zero when it finds drift, so you can run it in CI. Each
|
|
340
|
+
finding names a stable rule key for future suppression.
|
|
341
|
+
|
|
329
342
|
## Updating the generated workflow
|
|
330
343
|
|
|
331
|
-
When you upgrade the SDK, re-run `setup
|
|
344
|
+
When you upgrade the SDK, re-run `setup` with the same flags to pick up
|
|
332
345
|
template improvements. If the SDK detects that you have hand-edited a managed
|
|
333
346
|
section, it stops and asks you to use `--force` to overwrite your edits, or to
|
|
334
347
|
move your customizations into your own steps before regenerating.
|