@tailor-platform/sdk 2.3.0 → 2.5.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 +171 -0
- package/README.md +1 -1
- package/dist/aigateway-DsWDjzk4.mjs +2 -0
- package/dist/{aigateway-DR4Kwuik.mjs.map → aigateway-DsWDjzk4.mjs.map} +1 -1
- package/dist/application-DFOUovmN.mjs +1 -0
- package/dist/application-D_4vg1KR.mjs +192 -0
- package/dist/application-D_4vg1KR.mjs.map +1 -0
- package/dist/assert-WeXvmG4j.mjs +2 -0
- package/dist/{assert-DBxo8jPo.mjs.map → assert-WeXvmG4j.mjs.map} +1 -1
- package/dist/authconnection-CynFBIv8.mjs +2 -0
- package/dist/{authconnection-CZvi9ANm.mjs.map → authconnection-CynFBIv8.mjs.map} +1 -1
- package/dist/brand-C8nMKhJC.mjs +2 -0
- package/dist/{brand-Eo4pLXPJ.mjs.map → brand-C8nMKhJC.mjs.map} +1 -1
- package/dist/cli/commands/deploy/deploy.d.mts +2 -2
- package/dist/cli/commands/deploy/deployment-target.d.mts +2 -0
- package/dist/cli/commands/deploy/event-subscriptions.d.mts +3 -0
- package/dist/cli/commands/deploy/tailordb/apply.d.mts +3 -0
- package/dist/cli/commands/deploy/tailordb/index.d.mts +3 -10
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +5 -0
- package/dist/cli/commands/deploy/tailordb/plan.d.mts +8 -0
- package/dist/cli/commands/executor/jobs.d.mts +1 -1
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -2
- package/dist/cli/commands/show.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +15 -15
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +7 -3
- package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +1 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +43 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +62 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +12 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +12 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-remote.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +3 -1
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +5 -117
- package/dist/cli/commands/tailordb/truncate.d.mts +2 -2
- package/dist/cli/lib.d.mts +8 -4
- package/dist/cli/lib.mjs +1 -9
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +1170 -7686
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/seed-chunker.d.mts +5 -5
- package/dist/cli/ts-hook.mjs +3 -1
- package/dist/completion/zsh-worker.zsh +99 -18
- package/dist/configure/config/index.d.mts +2 -2
- package/dist/configure/config/types.d.mts +2 -2
- package/dist/configure/index.d.mts +49 -12
- package/dist/configure/index.mjs +1 -1267
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/aigateway/index.d.mts +5 -4
- package/dist/configure/services/aigateway/types.d.mts +6 -1
- package/dist/configure/services/auth/types.d.mts +3 -3
- package/dist/configure/services/idp/types.d.mts +1 -1
- package/dist/configure/services/tailordb/permission.d.mts +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +5 -9
- package/dist/configure/services/tailordb/types.d.mts +8 -5
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/job.d.mts +12 -2
- package/dist/configure/types/auth-namespace-name.d.mts +18 -0
- package/dist/configure/types/field.types.d.mts +1 -1
- package/dist/configure/types/permission-operand.types.d.mts +1 -1
- package/dist/context-D0QjfxzD.mjs +2 -0
- package/dist/{context-DYQVYWqZ.mjs.map → context-D0QjfxzD.mjs.map} +1 -1
- package/dist/crashreport-B-_HTKLr.mjs +42 -0
- package/dist/{crashreport-CIIfLnoO.mjs.map → crashreport-B-_HTKLr.mjs.map} +1 -1
- package/dist/crashreport-BmsRIdpy.mjs +1 -0
- package/dist/errors-DSEXKRVD.mjs +2 -0
- package/dist/errors-DSEXKRVD.mjs.map +1 -0
- package/dist/file-COPYfju_.mjs +2 -0
- package/dist/file-COPYfju_.mjs.map +1 -0
- package/dist/globals-CMHSnj4w.mjs +2 -0
- package/dist/{globals-B2nlxBrz.mjs.map → globals-CMHSnj4w.mjs.map} +1 -1
- package/dist/iconv-DlFMt2gW.mjs +2 -0
- package/dist/{iconv-QWaZh0TT.mjs.map → iconv-DlFMt2gW.mjs.map} +1 -1
- package/dist/idp-G_ojPBB5.mjs +2 -0
- package/dist/{idp-RA_swu-h.mjs.map → idp-G_ojPBB5.mjs.map} +1 -1
- package/dist/interceptor-DQg3cR_9.mjs +2 -0
- package/dist/{interceptor-e33JtsC-.mjs.map → interceptor-DQg3cR_9.mjs.map} +1 -1
- package/dist/kysely/index.mjs +1 -31
- package/dist/kysely/index.mjs.map +1 -1
- package/dist/kysely-type-BTi3BMtL.mjs +43 -0
- package/dist/kysely-type-BTi3BMtL.mjs.map +1 -0
- package/dist/logger-BcGy-u7G.mjs +9 -0
- package/dist/{logger-DSdExfor.mjs.map → logger-BcGy-u7G.mjs.map} +1 -1
- package/dist/logger-DP2BjQ93.mjs +2 -0
- package/dist/{logger-BtX0suGY.mjs.map → logger-DP2BjQ93.mjs.map} +1 -1
- package/dist/multiline-EyzjEwn9.mjs +3 -0
- package/dist/{multiline-sfHpTZZK.mjs.map → multiline-EyzjEwn9.mjs.map} +1 -1
- package/dist/node-builtins-oBl7EbyV.mjs +2 -0
- package/dist/{node-builtins-CmaL2Cbq.mjs.map → node-builtins-oBl7EbyV.mjs.map} +1 -1
- package/dist/package-json-C690ceex.mjs +2 -0
- package/dist/{package-json-8b0O9TlX.mjs.map → package-json-C690ceex.mjs.map} +1 -1
- package/dist/package-json-CmqhDJ__.mjs +1 -0
- package/dist/parser/service/tailordb/type-source.d.mts +5 -5
- package/dist/parser/service/tailordb/types.d.mts +4 -4
- package/dist/platform-serialize-DkiTdHOt.mjs +2 -0
- package/dist/{platform-serialize-RoRtBS0v.mjs.map → platform-serialize-DkiTdHOt.mjs.map} +1 -1
- package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
- package/dist/plugin/builtin/enum-constants/index.mjs +5 -114
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -1
- package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
- package/dist/plugin/builtin/file-utils/index.mjs +22 -101
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -1
- package/dist/plugin/builtin/kysely-type/index.d.mts +9 -2
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -275
- package/dist/plugin/builtin/seed/index.d.mts +5 -0
- package/dist/plugin/builtin/seed/index.mjs +1 -3
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +4 -6
- package/dist/plugin/get-generated-table.d.mts +16 -0
- package/dist/plugin/index.d.mts +3 -2
- package/dist/plugin/index.mjs +1 -251
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +32 -25
- package/dist/plugin/with-context.d.mts +4 -4
- package/dist/register-ts-hook-Drnaproy.mjs +640 -0
- package/dist/register-ts-hook-Drnaproy.mjs.map +1 -0
- package/dist/registry-HlEaGvl5.mjs +2 -0
- package/dist/{registry-BIGVUrMB.mjs.map → registry-HlEaGvl5.mjs.map} +1 -1
- package/dist/repl-editor-BG1aDOfH.mjs +2 -0
- package/dist/{repl-editor-BCozyiNq.mjs.map → repl-editor-BG1aDOfH.mjs.map} +1 -1
- package/dist/runtime/aigateway.mjs +1 -3
- package/dist/runtime/authconnection.mjs +1 -3
- package/dist/runtime/context.mjs +1 -3
- package/dist/runtime/file.d.mts +28 -28
- package/dist/runtime/file.mjs +1 -3
- package/dist/runtime/globals.mjs +1 -1
- package/dist/runtime/iconv.mjs +1 -3
- package/dist/runtime/idp.mjs +1 -3
- package/dist/runtime/index.mjs +1 -11
- package/dist/runtime/logger.mjs +1 -3
- package/dist/runtime/secretmanager.mjs +1 -3
- package/dist/runtime/types.d.mts +1 -1
- package/dist/runtime/workflow.mjs +1 -3
- package/dist/schema-Ze_dI5VX.mjs +2 -0
- package/dist/schema-Ze_dI5VX.mjs.map +1 -0
- package/dist/secret-file-C9wp_FCX.mjs +2 -0
- package/dist/{secret-file-C3J4Gy8r.mjs.map → secret-file-C9wp_FCX.mjs.map} +1 -1
- package/dist/secretmanager-5olfnI1b.mjs +2 -0
- package/dist/{secretmanager-IY4UvinW.mjs.map → secretmanager-5olfnI1b.mjs.map} +1 -1
- package/dist/secretmanager-vHQoXdQz.mjs +2 -0
- package/dist/{secretmanager-CYlpffsz.mjs.map → secretmanager-vHQoXdQz.mjs.map} +1 -1
- package/dist/seed/index.d.mts +4 -4
- package/dist/seed/index.mjs +8 -244
- package/dist/seed/index.mjs.map +1 -1
- package/dist/seed-DwqRFdqP.mjs +207 -0
- package/dist/seed-DwqRFdqP.mjs.map +1 -0
- package/dist/service-BVe9u2Rt.mjs +7 -0
- package/dist/service-BVe9u2Rt.mjs.map +1 -0
- package/dist/service-CpZELSBa.mjs +1 -0
- package/dist/service-DlgaUO4V.mjs +2 -0
- package/dist/{service-hZskxZmg.mjs.map → service-DlgaUO4V.mjs.map} +1 -1
- package/dist/service_pb-DGKCLuAs.mjs +2 -0
- package/dist/{service_pb-BEWj1pOV.mjs.map → service_pb-DGKCLuAs.mjs.map} +1 -1
- package/dist/service_pb-_aeFE-Nv.mjs +1 -0
- package/dist/telemetry-Bklv9kQY.mjs +2 -0
- package/dist/{telemetry-BRVdwh14.mjs.map → telemetry-Bklv9kQY.mjs.map} +1 -1
- package/dist/telemetry-DXHP3VVi.mjs +1 -0
- package/dist/type-source--ZNcV8RJ.mjs +2 -0
- package/dist/type-source--ZNcV8RJ.mjs.map +1 -0
- package/dist/types/aigateway.generated.d.mts +2 -2
- package/dist/types/auth.generated.d.mts +3 -3
- package/dist/types/executor.generated.d.mts +2 -2
- package/dist/types/tailordb.generated.d.mts +12 -12
- package/dist/user-agent-vdHYF3QL.mjs +2 -0
- package/dist/{user-agent-Bgsszb5I.mjs.map → user-agent-vdHYF3QL.mjs.map} +1 -1
- package/dist/utils/test/index.d.mts +4 -4
- package/dist/utils/test/index.mjs +1 -109
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -41
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs +1 -1980
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +8 -8
- package/dist/vitest/setup.mjs +1 -140
- package/dist/vitest/setup.mjs.map +1 -1
- package/dist/wait-point-invoker-eiP-IIux.mjs +2 -0
- package/dist/wait-point-invoker-eiP-IIux.mjs.map +1 -0
- package/dist/wait-point-registry-BrkwfyjS.mjs +2 -0
- package/dist/{wait-point-registry-TL99zotw.mjs.map → wait-point-registry-BrkwfyjS.mjs.map} +1 -1
- package/dist/workflow-Cs9ISw6j.mjs +2 -0
- package/dist/{workflow-Bamae_Yc.mjs.map → workflow-Cs9ISw6j.mjs.map} +1 -1
- package/dist/workspace_resource_pb--GeYQPXu.mjs +2 -0
- package/dist/{workspace_resource_pb-HNIL_Vfj.mjs.map → workspace_resource_pb--GeYQPXu.mjs.map} +1 -1
- package/docs/cli/application.md +3 -1
- package/docs/cli/function.md +77 -13
- package/docs/cli/setup.md +24 -14
- package/docs/cli/tailordb.md +32 -30
- package/docs/cli/workspace.md +2 -2
- package/docs/cli-reference.md +23 -22
- package/docs/configuration.md +2 -2
- package/docs/github-actions.md +10 -9
- package/docs/migration/v2.md +16 -4
- package/docs/migration/v3.md +123 -0
- package/docs/plugin/custom.md +130 -85
- package/docs/plugin/index.md +3 -3
- package/docs/quickstart.md +1 -1
- package/docs/services/aigateway.md +33 -9
- package/docs/services/executor.md +5 -1
- package/docs/services/tailordb-migration.md +68 -54
- package/docs/services/tailordb.md +7 -7
- package/docs/services/workflow.md +10 -9
- package/docs/testing.md +1 -1
- package/package.json +16 -16
- package/postinstall.mjs +1 -1
- package/dist/aigateway-DR4Kwuik.mjs +0 -9
- package/dist/application-BZfk4HKm.mjs +0 -3
- package/dist/application-F-nl107y.mjs +0 -6019
- package/dist/application-F-nl107y.mjs.map +0 -1
- package/dist/assert-DBxo8jPo.mjs +0 -9
- package/dist/authconnection-CZvi9ANm.mjs +0 -9
- package/dist/brand-Eo4pLXPJ.mjs +0 -36
- package/dist/context-DYQVYWqZ.mjs +0 -23
- package/dist/crashreport-CIIfLnoO.mjs +0 -423
- package/dist/crashreport-CINZ5dVN.mjs +0 -3
- package/dist/errors-BVb6vYGy.mjs +0 -89
- package/dist/errors-BVb6vYGy.mjs.map +0 -1
- package/dist/file-BUcmVIH2.mjs +0 -58
- package/dist/file-BUcmVIH2.mjs.map +0 -1
- package/dist/globals-B2nlxBrz.mjs +0 -126
- package/dist/iconv-QWaZh0TT.mjs +0 -38
- package/dist/idp-RA_swu-h.mjs +0 -82
- package/dist/interceptor-e33JtsC-.mjs +0 -33
- package/dist/logger-BtX0suGY.mjs +0 -48
- package/dist/logger-DSdExfor.mjs +0 -358
- package/dist/multiline-sfHpTZZK.mjs +0 -38
- package/dist/node-builtins-CmaL2Cbq.mjs +0 -36
- package/dist/package-json-8b0O9TlX.mjs +0 -17
- package/dist/package-json-Cv2Z-TqQ.mjs +0 -3
- package/dist/platform-serialize-RoRtBS0v.mjs +0 -46
- package/dist/plugin/builtin/kysely-type/index.mjs.map +0 -1
- package/dist/plugin/builtin/seed/types.d.mts +0 -2
- package/dist/plugin/get-generated-type.d.mts +0 -16
- package/dist/register-ts-hook-ClI226n2.mjs +0 -25543
- package/dist/register-ts-hook-ClI226n2.mjs.map +0 -1
- package/dist/registry-BIGVUrMB.mjs +0 -54
- package/dist/repl-editor-BCozyiNq.mjs +0 -251
- package/dist/schema--xYWRGfe.mjs +0 -639
- package/dist/schema--xYWRGfe.mjs.map +0 -1
- package/dist/secret-file-C3J4Gy8r.mjs +0 -64
- package/dist/secretmanager-CYlpffsz.mjs +0 -13
- package/dist/secretmanager-IY4UvinW.mjs +0 -131
- package/dist/seed-xqM9WIHP.mjs +0 -483
- package/dist/seed-xqM9WIHP.mjs.map +0 -1
- package/dist/service-C_WpbKHu.mjs +0 -898
- package/dist/service-C_WpbKHu.mjs.map +0 -1
- package/dist/service-D1RCdzIL.mjs +0 -3
- package/dist/service-hZskxZmg.mjs +0 -131
- package/dist/service_pb-BEWj1pOV.mjs +0 -167
- package/dist/service_pb-BjlhvK9E.mjs +0 -3
- package/dist/telemetry-BRVdwh14.mjs +0 -84
- package/dist/telemetry-CkbkeJxl.mjs +0 -3
- package/dist/type-source-DH_LH20p.mjs +0 -13
- package/dist/type-source-DH_LH20p.mjs.map +0 -1
- package/dist/user-agent-Bgsszb5I.mjs +0 -28
- package/dist/wait-point-invoker-__oE88_P.mjs +0 -148
- package/dist/wait-point-invoker-__oE88_P.mjs.map +0 -1
- package/dist/wait-point-registry-TL99zotw.mjs +0 -47
- package/dist/workflow-Bamae_Yc.mjs +0 -34
- package/dist/workspace_resource_pb-HNIL_Vfj.mjs +0 -860
package/docs/cli/application.md
CHANGED
|
@@ -190,7 +190,9 @@ Pass the global `--json` / `-j` flag to get machine-readable output.
|
|
|
190
190
|
```json
|
|
191
191
|
{
|
|
192
192
|
"summary": { "create": 2, "update": 1, "delete": 0, "replace": 0 },
|
|
193
|
-
"changes": [
|
|
193
|
+
"changes": [
|
|
194
|
+
{ "action": "create", "name": "Order", "labels": ["table"], "namespace": "tailordb" }
|
|
195
|
+
],
|
|
194
196
|
"warnings": [
|
|
195
197
|
{ "type": "unmanaged", "resourceType": "tailorDB", "name": "LegacyType" },
|
|
196
198
|
{ "type": "skippedSecret", "resourceType": "secret", "name": "DB_PASSWORD" }
|
package/docs/cli/function.md
CHANGED
|
@@ -16,12 +16,13 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
16
16
|
|
|
17
17
|
**Commands**
|
|
18
18
|
|
|
19
|
-
| Command
|
|
20
|
-
|
|
|
21
|
-
| [`function get`](#function-get)
|
|
22
|
-
| [`function list`](#function-list)
|
|
23
|
-
| [`function logs`](#function-logs)
|
|
24
|
-
| [`function
|
|
19
|
+
| Command | Aliases | Description |
|
|
20
|
+
| ------------------------------------- | ---------- | --------------------------------------------------------------- |
|
|
21
|
+
| [`function get`](#function-get) | - | Get a function registry by name |
|
|
22
|
+
| [`function list`](#function-list) | - | List function registries in a workspace |
|
|
23
|
+
| [`function logs`](#function-logs) | - | List or get function execution logs. |
|
|
24
|
+
| [`function run`](#function-run) | `test-run` | Run a function on the Tailor Platform server without deploying. |
|
|
25
|
+
| [`function script`](#function-script) | - | Scaffold a one-off script to run with `function run`. |
|
|
25
26
|
|
|
26
27
|
### function get
|
|
27
28
|
|
|
@@ -119,18 +120,20 @@ $ tailor function logs <execution-id> --json
|
|
|
119
120
|
|
|
120
121
|
**Notes**
|
|
121
122
|
|
|
122
|
-
When viewing a specific execution that failed, the command displays error details with the stack trace mapped back to your original source files (clickable file links and code snippets, matching `function
|
|
123
|
+
When viewing a specific execution that failed, the command displays error details with the stack trace mapped back to your original source files (clickable file links and code snippets, matching `function run` output).
|
|
123
124
|
|
|
124
125
|
Stack traces are mapped only when the execution includes a content hash for the exact build that ran. If the content hash is missing or the build is no longer available, the command falls back to a plain-text error display.
|
|
125
126
|
|
|
126
|
-
### function
|
|
127
|
+
### function run
|
|
127
128
|
|
|
128
129
|
Run a function on the Tailor Platform server without deploying.
|
|
129
130
|
|
|
131
|
+
**Aliases:** `test-run`
|
|
132
|
+
|
|
130
133
|
**Usage**
|
|
131
134
|
|
|
132
135
|
```
|
|
133
|
-
tailor function
|
|
136
|
+
tailor function run [options] <file>
|
|
134
137
|
```
|
|
135
138
|
|
|
136
139
|
**Arguments**
|
|
@@ -149,6 +152,7 @@ tailor function test-run [options] <file>
|
|
|
149
152
|
| `--arg <ARG>` | `-a` | JSON argument to pass to the function | No | - | - |
|
|
150
153
|
| `--machine-user <MACHINE_USER>` | `-m` | Machine user name for authentication. Falls back to the active profile's default machine user. | No | - | `TAILOR_PLATFORM_MACHINE_USER_NAME` |
|
|
151
154
|
| `--config <CONFIG>` | `-c` | Path to SDK config file | No | `"tailor.config.ts"` | - |
|
|
155
|
+
| `--allow-schema-drift` | - | Run a scaffolded script even when its schema snapshot no longer matches | No | `false` | - |
|
|
152
156
|
|
|
153
157
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
154
158
|
|
|
@@ -157,19 +161,19 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
157
161
|
**Run a resolver with input arguments**
|
|
158
162
|
|
|
159
163
|
```bash
|
|
160
|
-
$ tailor function
|
|
164
|
+
$ tailor function run resolvers/add.ts --arg '{"a":1,"b":2}'
|
|
161
165
|
```
|
|
162
166
|
|
|
163
167
|
**Run a specific workflow job by name**
|
|
164
168
|
|
|
165
169
|
```bash
|
|
166
|
-
$ tailor function
|
|
170
|
+
$ tailor function run workflows/sample.ts --name validate-order
|
|
167
171
|
```
|
|
168
172
|
|
|
169
173
|
**Run a pre-bundled .js file directly**
|
|
170
174
|
|
|
171
175
|
```bash
|
|
172
|
-
$ tailor function
|
|
176
|
+
$ tailor function run build/resolvers/add.js --arg '{"a":1,"b":2}'
|
|
173
177
|
```
|
|
174
178
|
|
|
175
179
|
**Notes**
|
|
@@ -177,6 +181,66 @@ $ tailor function test-run build/resolvers/add.js --arg '{"a":1,"b":2}'
|
|
|
177
181
|
You can pass either a source file (`.ts`) or a pre-bundled file (`.js`).
|
|
178
182
|
When a `.js` file is provided, detection and bundling are skipped and the file is executed as-is.
|
|
179
183
|
|
|
184
|
+
A script scaffolded by `function script` with a generated `db.ts` is checked against its `db.snapshot.json` before execution and refused on schema drift; pass `--allow-schema-drift` to run it anyway. The check compares table and field structure; hook and validator code changes are not detected.
|
|
185
|
+
|
|
186
|
+
`test-run` is a deprecated alias of this command and will be removed in v3.
|
|
187
|
+
|
|
180
188
|
> [!WARNING]
|
|
181
|
-
> Workflow job `.start()` calls do not work in
|
|
189
|
+
> Workflow job `.start()` calls do not work in this mode.
|
|
182
190
|
> Started jobs are not executed; only the target job's `body` function runs in isolation.
|
|
191
|
+
|
|
192
|
+
### function script
|
|
193
|
+
|
|
194
|
+
Scaffold a one-off script to run with `function run`.
|
|
195
|
+
|
|
196
|
+
**Usage**
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
tailor function script [options] <file>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Arguments**
|
|
203
|
+
|
|
204
|
+
| Argument | Description | Required |
|
|
205
|
+
| -------- | ------------------------------------------------ | -------- |
|
|
206
|
+
| `file` | Path to create the script at (must end with .ts) | Yes |
|
|
207
|
+
|
|
208
|
+
**Options**
|
|
209
|
+
|
|
210
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
211
|
+
| ------------------------------- | ----- | --------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
212
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
213
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
214
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
215
|
+
| `--namespace <NAMESPACE>` | - | Target TailorDB namespace (required when the config does not pin one) | No | - | - |
|
|
216
|
+
| `--remote` | - | Generate script-scoped DB types from the deployed schema | No | `false` | - |
|
|
217
|
+
|
|
218
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
219
|
+
|
|
220
|
+
**Examples**
|
|
221
|
+
|
|
222
|
+
**Scaffold a one-off script (single-namespace project)**
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
$ tailor function script scripts/fix-prices.ts
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Scaffold a script targeting a specific namespace**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
$ tailor function script scripts/fix-prices.ts --namespace tailordb
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Scaffold from a deployed or external namespace**
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
$ tailor function script scripts/fix-prices.ts --namespace shared --remote
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Notes**
|
|
241
|
+
|
|
242
|
+
The scaffolded script is a plain default-exported function; execute it with `tailor function run <file>`.
|
|
243
|
+
|
|
244
|
+
By default, when the project configures `kyselyTypePlugin`, the skeleton imports `getDB()` from the plugin's generated types. Without the plugin, the command uses the namespace's local table definitions to write a script-scoped `db.ts` plus a `db.snapshot.json` next to the script; `function run` refuses to run the script when that snapshot no longer matches the deployed or locally defined table and field structure.
|
|
245
|
+
|
|
246
|
+
Pass `--remote` to generate the script-scoped files from the deployed schema instead, even when `kyselyTypePlugin` is configured. This is required for an external namespace. Re-running the command refreshes `db.ts` and `db.snapshot.json` from the selected source and leaves the script itself untouched.
|
package/docs/cli/setup.md
CHANGED
|
@@ -23,7 +23,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
23
23
|
| [`setup preview`](#setup-preview) | Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace). |
|
|
24
24
|
| [`setup action`](#setup-action) | Generate a per-app composite action for use with setup coordinate (monorepo multi-app deploys). |
|
|
25
25
|
| [`setup coordinate`](#setup-coordinate) | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
|
|
26
|
-
| [`setup
|
|
26
|
+
| [`setup deps`](#setup-deps) | Generate a dependency update config for Tailor dependency and workflow updates. |
|
|
27
27
|
| [`setup check`](#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
|
|
28
28
|
| [`setup delete`](#setup-delete) | Delete managed workflow/action file(s) and their .github/tailor.lock entries. |
|
|
29
29
|
|
|
@@ -63,7 +63,7 @@ tailor setup branch [options]
|
|
|
63
63
|
| Option | Alias | Description | Required | Default |
|
|
64
64
|
| ----------------------------- | ----- | ------------------------------------------------------------------------------ | -------- | ------- |
|
|
65
65
|
| `--name <NAME>` | `-n` | Name (defaults to the config 'name') | No | - |
|
|
66
|
-
| `--
|
|
66
|
+
| `--target <TARGET>` | - | Deploy trigger branch (defaults to the detected default branch) | No | - |
|
|
67
67
|
| `--environment <ENVIRONMENT>` | - | GitHub Environment for the plan/deploy jobs (defaults to the workspace name) | No | - |
|
|
68
68
|
| `--erd-preview` | - | Add PR ERD viewer artifacts with current/diff previews for TailorDB namespaces | No | `false` |
|
|
69
69
|
| `--dir <DIR>` | `-d` | App directory (for monorepo setups) | No | `"."` |
|
|
@@ -71,6 +71,10 @@ tailor setup branch [options]
|
|
|
71
71
|
|
|
72
72
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
73
73
|
|
|
74
|
+
**Notes**
|
|
75
|
+
|
|
76
|
+
`--branch` is a deprecated alias of `--target` and will be removed in v3.
|
|
77
|
+
|
|
74
78
|
### setup check
|
|
75
79
|
|
|
76
80
|
Audit generated workflows for drift against the current config/repo (read-only).
|
|
@@ -136,6 +140,24 @@ tailor setup delete [options] <files>
|
|
|
136
140
|
|
|
137
141
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
138
142
|
|
|
143
|
+
### setup deps
|
|
144
|
+
|
|
145
|
+
Generate a dependency update config for Tailor dependency and workflow updates.
|
|
146
|
+
|
|
147
|
+
**Usage**
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
tailor setup deps [options]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Options**
|
|
154
|
+
|
|
155
|
+
| Option | Alias | Description | Required | Default |
|
|
156
|
+
| ----------------------- | ----- | --------------------------------------- | -------- | ------------ |
|
|
157
|
+
| `--provider <PROVIDER>` | - | Dependency update provider to configure | No | `"renovate"` |
|
|
158
|
+
|
|
159
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
160
|
+
|
|
139
161
|
### setup preview
|
|
140
162
|
|
|
141
163
|
Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace).
|
|
@@ -160,18 +182,6 @@ tailor setup preview [options]
|
|
|
160
182
|
|
|
161
183
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
162
184
|
|
|
163
|
-
### setup renovate
|
|
164
|
-
|
|
165
|
-
Generate a Renovate config for Tailor dependency and workflow updates.
|
|
166
|
-
|
|
167
|
-
**Usage**
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
tailor setup renovate
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
174
|
-
|
|
175
185
|
### setup tag
|
|
176
186
|
|
|
177
187
|
Generate a tag-target deploy workflow (tag push triggers deploy).
|
package/docs/cli/tailordb.md
CHANGED
|
@@ -28,14 +28,14 @@ Truncate (delete all records from) TailorDB tables.
|
|
|
28
28
|
**Usage**
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
tailor tailordb truncate [options] [
|
|
31
|
+
tailor tailordb truncate [options] [tables]
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**Arguments**
|
|
35
35
|
|
|
36
|
-
| Argument | Description
|
|
37
|
-
| -------- |
|
|
38
|
-
| `
|
|
36
|
+
| Argument | Description | Required |
|
|
37
|
+
| -------- | ----------------------- | -------- |
|
|
38
|
+
| `tables` | Table names to truncate | No |
|
|
39
39
|
|
|
40
40
|
**Options**
|
|
41
41
|
|
|
@@ -62,21 +62,21 @@ tailor tailordb truncate --all --yes
|
|
|
62
62
|
# Truncate all tables in a specific namespace
|
|
63
63
|
tailor tailordb truncate --namespace myNamespace
|
|
64
64
|
|
|
65
|
-
# Truncate specific
|
|
65
|
+
# Truncate specific tables (namespace is auto-detected)
|
|
66
66
|
tailor tailordb truncate User Post Comment
|
|
67
67
|
|
|
68
|
-
# Truncate specific
|
|
68
|
+
# Truncate specific tables with confirmation skipped
|
|
69
69
|
tailor tailordb truncate User Post --yes
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
**Notes:**
|
|
73
73
|
|
|
74
|
-
- You must specify exactly one of: `--all`, `--namespace`, or
|
|
75
|
-
- When truncating specific
|
|
74
|
+
- You must specify exactly one of: `--all`, `--namespace`, or table names
|
|
75
|
+
- When truncating specific tables, the namespace is automatically detected from your config
|
|
76
76
|
- Confirmation prompts vary based on the operation:
|
|
77
77
|
- `--all`: requires typing `truncate all`
|
|
78
78
|
- `--namespace`: requires typing `truncate <namespace-name>`
|
|
79
|
-
- Specific
|
|
79
|
+
- Specific tables: requires typing `yes`
|
|
80
80
|
- Use `--yes` flag to skip confirmation prompts (useful for scripts and CI/CD)
|
|
81
81
|
- Namespaces declared with `{ external: true }` are skipped by `--all` and rejected with a dedicated error when targeted by `--namespace`. Run truncate from the app that owns the namespace.
|
|
82
82
|
|
|
@@ -94,22 +94,22 @@ tailor tailordb migration <command>
|
|
|
94
94
|
|
|
95
95
|
**Commands**
|
|
96
96
|
|
|
97
|
-
| Command | Description
|
|
98
|
-
| ----------------------------------------------------------------- |
|
|
99
|
-
| [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local
|
|
100
|
-
| [`tailordb migration rebaseline`](#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline.
|
|
101
|
-
| [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none.
|
|
102
|
-
| [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number.
|
|
103
|
-
| [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations.
|
|
104
|
-
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift).
|
|
105
|
-
| [`tailordb migration test`](#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace.
|
|
106
|
-
| [`tailordb migration validate`](#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local
|
|
97
|
+
| Command | Description |
|
|
98
|
+
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local tables and the previous migration snapshot. |
|
|
100
|
+
| [`tailordb migration rebaseline`](#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
|
|
101
|
+
| [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
|
|
102
|
+
| [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number. |
|
|
103
|
+
| [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
104
|
+
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
|
|
105
|
+
| [`tailordb migration test`](#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
|
|
106
|
+
| [`tailordb migration validate`](#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local tables vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
|
|
107
107
|
|
|
108
108
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
109
109
|
|
|
110
110
|
#### tailordb migration generate
|
|
111
111
|
|
|
112
|
-
Generate migration files by detecting schema differences between current local
|
|
112
|
+
Generate migration files by detecting schema differences between current local tables and the previous migration snapshot.
|
|
113
113
|
|
|
114
114
|
**Usage**
|
|
115
115
|
|
|
@@ -119,15 +119,17 @@ tailor tailordb migration generate [options]
|
|
|
119
119
|
|
|
120
120
|
**Options**
|
|
121
121
|
|
|
122
|
-
| Option | Alias | Description
|
|
123
|
-
| ------------------------------------- | ----- |
|
|
124
|
-
| `--yes` | `-y` | Skip confirmation prompts
|
|
125
|
-
| `--config <CONFIG>` | `-c` | Path to Tailor config file
|
|
126
|
-
| `--name <NAME>` | `-n` | Optional description for the migration
|
|
127
|
-
| `--init` | - | Delete existing migrations and start fresh
|
|
128
|
-
| `--
|
|
129
|
-
| `--
|
|
130
|
-
| `--
|
|
122
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
123
|
+
| ------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------- |
|
|
124
|
+
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
|
|
125
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
126
|
+
| `--name <NAME>` | `-n` | Optional description for the migration | No | - | - |
|
|
127
|
+
| `--init` | - | Delete existing migrations and start fresh | No | `false` | - |
|
|
128
|
+
| `--data-only` | - | Create a migration with no schema changes whose migration script runs a standalone data transformation | No | `false` | - |
|
|
129
|
+
| `--namespace <NAMESPACE>` | - | Target TailorDB namespace for --data-only (required if multiple namespaces exist) | No | - | - |
|
|
130
|
+
| `--rename <RENAME>` | - | Record a field or table rename instead of remove + add (format: "Table.oldField:newField" or "OldTable:NewTable"; repeatable). Renames require a migration script that copies the data. | No | - | - |
|
|
131
|
+
| `--drop <DROP>` | - | Confirm that a removed field or table is a genuine removal, not a rename (format: "Table.field" or "Table"; repeatable). Required in non-interactive runs for a removal with rename candidates. | No | - | - |
|
|
132
|
+
| `--expand-contract <EXPAND_CONTRACT>` | - | Convert a field type through a temporary field (format: "Table.field"; repeatable). Generates two migrations. | No | - | - |
|
|
131
133
|
|
|
132
134
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
133
135
|
|
|
@@ -309,7 +311,7 @@ The source workspace is read-only. Without --target-workspace-id, the command cr
|
|
|
309
311
|
|
|
310
312
|
#### tailordb migration validate
|
|
311
313
|
|
|
312
|
-
Validate the full migration history, unreviewed generated migration scripts, and schema drift (local
|
|
314
|
+
Validate the full migration history, unreviewed generated migration scripts, and schema drift (local tables vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found.
|
|
313
315
|
|
|
314
316
|
**Usage**
|
|
315
317
|
|
package/docs/cli/workspace.md
CHANGED
|
@@ -338,7 +338,7 @@ tailor profile create [options] <name>
|
|
|
338
338
|
| `--user <USER>` | `-u` | User email address or machine user client ID | Yes | - | - |
|
|
339
339
|
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | Yes | - | - |
|
|
340
340
|
| `--permission <PERMISSION>` | - | Profile permission. 'read' blocks all write commands while the profile is active. | No | `"write"` | - |
|
|
341
|
-
| `--machine-user <MACHINE_USER>` | `-m` | Default machine user name for application-data commands (query, workflow start, function
|
|
341
|
+
| `--machine-user <MACHINE_USER>` | `-m` | Default machine user name for application-data commands (query, workflow start, function run, machineuser token). | No | - | - |
|
|
342
342
|
| `--machine-user-override <MACHINE_USER_OVERRIDE>` | - | Whether the command line or TAILOR_PLATFORM_MACHINE_USER_NAME may override the profile's machine user. 'deny' requires --machine-user. | No | - | - |
|
|
343
343
|
| `--platform-url <PLATFORM_URL>` | - | Platform API base URL for this profile. | No | - | `TAILOR_PLATFORM_URL` |
|
|
344
344
|
| `--oauth2-client-id <OAUTH2_CLIENT_ID>` | - | OAuth2 client ID for logging in to this profile's platform. | No | - | `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` |
|
|
@@ -399,7 +399,7 @@ tailor profile update [options] <name>
|
|
|
399
399
|
| `--user <USER>` | `-u` | New user email address or machine user client ID | No | - |
|
|
400
400
|
| `--workspace-id <WORKSPACE_ID>` | `-w` | New workspace ID | No | - |
|
|
401
401
|
| `--permission <PERMISSION>` | - | Profile permission. 'read' blocks all write commands; 'write' lifts the restriction. | No | - |
|
|
402
|
-
| `--machine-user <MACHINE_USER>` | `-m` | Default machine user name for application-data commands (query, workflow start, function
|
|
402
|
+
| `--machine-user <MACHINE_USER>` | `-m` | Default machine user name for application-data commands (query, workflow start, function run, machineuser token). Pass an empty string to clear. | No | - |
|
|
403
403
|
| `--machine-user-override <MACHINE_USER_OVERRIDE>` | - | Whether the command line or TAILOR_PLATFORM_MACHINE_USER_NAME may override the profile's machine user. 'deny' requires --machine-user; 'allow' lifts the restriction. | No | - |
|
|
404
404
|
| `--platform-url <PLATFORM_URL>` | - | Platform API base URL for this profile. Pass an empty string to clear. | No | - |
|
|
405
405
|
| `--oauth2-client-id <OAUTH2_CLIENT_ID>` | - | OAuth2 client ID for logging in to this profile's platform. Pass an empty string to clear. | No | - |
|
package/docs/cli-reference.md
CHANGED
|
@@ -76,7 +76,7 @@ You can use environment variables to configure workspace and authentication:
|
|
|
76
76
|
| `TAILOR_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
|
|
77
77
|
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
|
|
78
78
|
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_SECRET` | Client secret for `login --machine-user` |
|
|
79
|
-
| `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function
|
|
79
|
+
| `TAILOR_PLATFORM_MACHINE_USER_NAME` | Default machine user name for `query`, `workflow start`, `function run`, `machineuser token` |
|
|
80
80
|
| `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url` |
|
|
81
81
|
| `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id` |
|
|
82
82
|
| `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url` |
|
|
@@ -200,19 +200,19 @@ Commands for managing Tailor Platform applications (work with `tailor.config.ts`
|
|
|
200
200
|
|
|
201
201
|
Commands for managing TailorDB tables, data, and schema migrations.
|
|
202
202
|
|
|
203
|
-
| Command | Description
|
|
204
|
-
| -------------------------------------------------------------------------------- |
|
|
205
|
-
| [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data.
|
|
206
|
-
| [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables.
|
|
207
|
-
| [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations.
|
|
208
|
-
| [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local
|
|
209
|
-
| [tailordb migration rebaseline](./cli/tailordb.md#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline.
|
|
210
|
-
| [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none.
|
|
211
|
-
| [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number.
|
|
212
|
-
| [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations.
|
|
213
|
-
| [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift).
|
|
214
|
-
| [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace.
|
|
215
|
-
| [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local
|
|
203
|
+
| Command | Description |
|
|
204
|
+
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
205
|
+
| [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data. |
|
|
206
|
+
| [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
|
|
207
|
+
| [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations. |
|
|
208
|
+
| [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local tables and the previous migration snapshot. |
|
|
209
|
+
| [tailordb migration rebaseline](./cli/tailordb.md#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
|
|
210
|
+
| [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
|
|
211
|
+
| [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number. |
|
|
212
|
+
| [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
213
|
+
| [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
|
|
214
|
+
| [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
|
|
215
|
+
| [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local tables vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
|
|
216
216
|
|
|
217
217
|
### [Query Commands](./cli/query.md)
|
|
218
218
|
|
|
@@ -323,13 +323,14 @@ Commands for managing workflows and executions.
|
|
|
323
323
|
|
|
324
324
|
Commands for managing function registries and viewing function execution logs.
|
|
325
325
|
|
|
326
|
-
| Command
|
|
327
|
-
|
|
|
328
|
-
| [function](./cli/function.md#function)
|
|
329
|
-
| [function get](./cli/function.md#function-get)
|
|
330
|
-
| [function list](./cli/function.md#function-list)
|
|
331
|
-
| [function logs](./cli/function.md#function-logs)
|
|
332
|
-
| [function
|
|
326
|
+
| Command | Description |
|
|
327
|
+
| ---------------------------------------------------- | --------------------------------------------------------------- |
|
|
328
|
+
| [function](./cli/function.md#function) | Manage functions |
|
|
329
|
+
| [function get](./cli/function.md#function-get) | Get a function registry by name |
|
|
330
|
+
| [function list](./cli/function.md#function-list) | List function registries in a workspace |
|
|
331
|
+
| [function logs](./cli/function.md#function-logs) | List or get function execution logs. |
|
|
332
|
+
| [function run](./cli/function.md#function-run) | Run a function on the Tailor Platform server without deploying. |
|
|
333
|
+
| [function script](./cli/function.md#function-script) | Scaffold a one-off script to run with `function run`. |
|
|
333
334
|
|
|
334
335
|
### [Executor Commands](./cli/executor.md)
|
|
335
336
|
|
|
@@ -397,8 +398,8 @@ Commands for setting up project infrastructure.
|
|
|
397
398
|
| [setup check](./cli/setup.md#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
|
|
398
399
|
| [setup coordinate](./cli/setup.md#setup-coordinate) | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
|
|
399
400
|
| [setup delete](./cli/setup.md#setup-delete) | Delete managed workflow/action file(s) and their .github/tailor.lock entries. |
|
|
401
|
+
| [setup deps](./cli/setup.md#setup-deps) | Generate a dependency update config for Tailor dependency and workflow updates. |
|
|
400
402
|
| [setup preview](./cli/setup.md#setup-preview) | Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace). |
|
|
401
|
-
| [setup renovate](./cli/setup.md#setup-renovate) | Generate a Renovate config for Tailor dependency and workflow updates. |
|
|
402
403
|
| [setup tag](./cli/setup.md#setup-tag) | Generate a tag-target deploy workflow (tag push triggers deploy). |
|
|
403
404
|
|
|
404
405
|
### [Upgrade Commands](./cli/upgrade.md)
|
package/docs/configuration.md
CHANGED
|
@@ -243,7 +243,7 @@ export default defineConfig({
|
|
|
243
243
|
|
|
244
244
|
If the same config defines an auth before-login hook, make sure the config module can be evaluated without Node-only globals in the platform runtime. Avoid arbitrary `process.env` reads in that module; pass literal values, or values generated into a config module before deployment, and read them from the hook's `env` argument.
|
|
245
245
|
|
|
246
|
-
When the SDK deploys application code or runs detected service code with `function
|
|
246
|
+
When the SDK deploys application code or runs detected service code with `function run`, it passes the resolved values as the `env` argument. Do not read `process.env` from deployed resolvers, executors, workflow jobs, auth hooks, or migration scripts; Node-side environment variables are not available there. Put sensitive values in [Secret Manager](./services/secret.md) instead of `env`.
|
|
247
247
|
|
|
248
248
|
| Code location | Runtime access |
|
|
249
249
|
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -252,7 +252,7 @@ When the SDK deploys application code or runs detected service code with `functi
|
|
|
252
252
|
| Workflow job body | `body: (input, { env }) => ...` |
|
|
253
253
|
| Auth before-login hook | `handler: async ({ env }) => ...` |
|
|
254
254
|
| TailorDB migration script | `main(trx, { env }: MigrationContext)` |
|
|
255
|
-
| `function
|
|
255
|
+
| `function run` | Same `env` argument shape as the detected resolver, executor, or workflow job |
|
|
256
256
|
|
|
257
257
|
```typescript
|
|
258
258
|
// In resolvers
|
package/docs/github-actions.md
CHANGED
|
@@ -38,12 +38,13 @@ Run `setup` once per target.
|
|
|
38
38
|
### Branch target (recommended for staging)
|
|
39
39
|
|
|
40
40
|
The branch target fires on pull requests and pushes to the branch you specify
|
|
41
|
-
(defaulting to the repository's default branch when `--
|
|
41
|
+
(defaulting to the repository's default branch when `--target` is
|
|
42
|
+
omitted):
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
tailor setup branch --name my-app-stg
|
|
45
46
|
# Equivalent to:
|
|
46
|
-
tailor setup branch --name my-app-stg --
|
|
47
|
+
tailor setup branch --name my-app-stg --target main
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
What it does:
|
|
@@ -120,12 +121,12 @@ What it does:
|
|
|
120
121
|
|
|
121
122
|
### Choosing `--branch` for the tag target
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
The branch each target reads plays a different role, under a different flag:
|
|
124
125
|
|
|
125
|
-
| Target | Role
|
|
126
|
-
| ------ | ---------------------------------------------------------------------------------------------- |
|
|
127
|
-
| Branch | The branch that triggers the workflow (push + PR base). Defaults to the repo's default branch. |
|
|
128
|
-
| Tag | The branch whose history the tag must be reachable from. Omit to disable the guard entirely. |
|
|
126
|
+
| Target | Flag | Role |
|
|
127
|
+
| ------ | ---------- | ---------------------------------------------------------------------------------------------- |
|
|
128
|
+
| Branch | `--target` | The branch that triggers the workflow (push + PR base). Defaults to the repo's default branch. |
|
|
129
|
+
| Tag | `--branch` | The branch whose history the tag must be reachable from. Omit to disable the guard entirely. |
|
|
129
130
|
|
|
130
131
|
The workspace name (`--name`, or the config `name` when omitted) must
|
|
131
132
|
be 3–63 characters of lowercase letters, numbers, and hyphens, and cannot start
|
|
@@ -365,7 +366,7 @@ Commit both workflow files and `.github/tailor.lock`.
|
|
|
365
366
|
Run this command once from the repository root to add Renovate configuration:
|
|
366
367
|
|
|
367
368
|
```bash
|
|
368
|
-
tailor setup
|
|
369
|
+
tailor setup deps
|
|
369
370
|
```
|
|
370
371
|
|
|
371
372
|
It generates `renovate.json`, which extends Tailor's shared Renovate preset. The
|
|
@@ -387,7 +388,7 @@ cannot be edited without losing those comments, so the command leaves it
|
|
|
387
388
|
unchanged and asks you to add the preset to its `extends` array yourself.
|
|
388
389
|
|
|
389
390
|
`renovate.json` is yours to edit — it is not tracked in `.github/tailor.lock`.
|
|
390
|
-
Add your own rules freely; re-running `tailor setup
|
|
391
|
+
Add your own rules freely; re-running `tailor setup deps` does not overwrite
|
|
391
392
|
them. To remove it, delete the file.
|
|
392
393
|
|
|
393
394
|
Renovate updates the SDK dependency and action pins, but it does not regenerate
|
package/docs/migration/v2.md
CHANGED
|
@@ -878,6 +878,10 @@ Also review, and migrate by hand:
|
|
|
878
878
|
- An invoker option passed via a variable or spread (not a literal object) —
|
|
879
879
|
the codemod only inspects literal object arguments; rename the invoker key
|
|
880
880
|
to authInvoker in the options object's own definition.
|
|
881
|
+
- A renamed triggerJobFunction call whose target is another workflow job —
|
|
882
|
+
rewrite it further to that job's own .start() method (e.g. worker.start(args)).
|
|
883
|
+
Calling execJobFunction directly is not detected as a build-time dependency
|
|
884
|
+
and fails the build.
|
|
881
885
|
```
|
|
882
886
|
|
|
883
887
|
</details>
|
|
@@ -924,6 +928,10 @@ Also review, and migrate by hand:
|
|
|
924
928
|
instead; the alias was the same mock function.
|
|
925
929
|
- A file that already imports ExecJobFunctionOptions alongside the removed type —
|
|
926
930
|
rename the remaining references by hand and drop the duplicate specifier.
|
|
931
|
+
- A renamed call whose target is another workflow job — rewrite it further to
|
|
932
|
+
that job's own .start() method (e.g. worker.start(args)). Calling
|
|
933
|
+
execJobFunction directly is not detected as a build-time dependency and fails
|
|
934
|
+
the build.
|
|
927
935
|
```
|
|
928
936
|
|
|
929
937
|
</details>
|
|
@@ -1422,7 +1430,7 @@ single generation pass and resolves once it completes.
|
|
|
1422
1430
|
|
|
1423
1431
|
**Migration:** Partially automatic
|
|
1424
1432
|
|
|
1425
|
-
`seedPlugin` no longer generates the `exec.mjs` seed runner. Seeding and validation move to the `tailor seed` commands provided by the `@tailor-platform/sdk-plugin-seed` CLI plugin: install it as a devDependency, replace `node <distPath>/exec.mjs` invocations with `tailor seed apply` and `node <distPath>/exec.mjs validate` with `tailor seed validate`, and delete the stale generated `<distPath>/exec.mjs` file. Seed data and schema generation (`data/*.jsonl`, `data/*.schema.ts`) is unchanged, and the `tailor seed apply` options mirror the old script (`--machine-user`, `--namespace`, `--skip-idp`, `--truncate`, `--yes`,
|
|
1433
|
+
`seedPlugin` no longer generates the `exec.mjs` seed runner. Seeding and validation move to the `tailor seed` commands provided by the `@tailor-platform/sdk-plugin-seed` CLI plugin: install it as a devDependency, replace `node <distPath>/exec.mjs` invocations with `tailor seed apply` and `node <distPath>/exec.mjs validate` with `tailor seed validate`, and delete the stale generated `<distPath>/exec.mjs` file. Seed data and schema generation (`data/*.jsonl`, `data/*.schema.ts`) is unchanged, and the `tailor seed apply` options mirror the old script (`--machine-user`, `--namespace`, `--skip-idp`, `--truncate`, `--yes`, entity-name arguments), plus a new `--upsert` flag to update existing rows instead of failing on duplicate ids.
|
|
1426
1434
|
|
|
1427
1435
|
Before:
|
|
1428
1436
|
|
|
@@ -1448,8 +1456,8 @@ CLI plugin (@tailor-platform/sdk-plugin-seed) replaces it:
|
|
|
1448
1456
|
- Install @tailor-platform/sdk-plugin-seed as a devDependency next to
|
|
1449
1457
|
@tailor-platform/sdk.
|
|
1450
1458
|
- Replace `node <distPath>/exec.mjs [options] [types...]` invocations with
|
|
1451
|
-
`tailor seed apply [options] [
|
|
1452
|
-
--namespace/-n, --skip-idp, --truncate, --yes, and
|
|
1459
|
+
`tailor seed apply [options] [entities...]` (same options: --machine-user/-m,
|
|
1460
|
+
--namespace/-n, --skip-idp, --truncate, --yes, and entity-name arguments,
|
|
1453
1461
|
plus a new --upsert flag to update existing rows instead of failing on
|
|
1454
1462
|
duplicate ids).
|
|
1455
1463
|
- Replace `node <distPath>/exec.mjs validate [path]` with
|
|
@@ -1663,8 +1671,12 @@ The CLI stores human users by their stable subject ID instead of email (email is
|
|
|
1663
1671
|
|
|
1664
1672
|
### Node.js minimum version raised to 22.15.0
|
|
1665
1673
|
|
|
1666
|
-
v2 requires Node.js **22.15.0** or later. This is the first version that includes `module.registerHooks()`, which the SDK uses to register its TypeScript loader hook synchronously in the main thread. No source change is required; ensure your environment runs Node.js 22.
|
|
1674
|
+
v2 requires Node.js **22.15.0** or later. This is the first version that includes `module.registerHooks()`, which the SDK uses to register its TypeScript loader hook synchronously in the main thread. The actual floor is now **22.18.0**: Node 22.15.0–22.17.x has a bug that crashes `tailor seed validate` when requiring `node:`-scheme-only builtins such as `node:sqlite`, fixed upstream by [nodejs/node#58612](https://github.com/nodejs/node/pull/58612) in 22.18.0. No source change is required; ensure your environment runs Node.js 22.18.0+.
|
|
1667
1675
|
|
|
1668
1676
|
### Legacy bundle artifact cleanup removed from deploy
|
|
1669
1677
|
|
|
1670
1678
|
`tailor deploy` no longer deletes on-disk bundle artifacts (`.entry.js` files, workflow-job bundles, and the `hooks-validate-scripts/` directory) left in the SDK output directory (`.tailor` by default) by SDK versions that predate the current in-memory bundling approach. Current bundlers no longer write these files. No source change is required; if such stale files remain from a very old SDK version, delete only those specific files/directories manually — do not delete the output directory itself, since it also holds deploy state (e.g. `secrets-state/`, `*.context.json`) that existing secrets and Auth Connections depend on.
|
|
1679
|
+
|
|
1680
|
+
### First v2 deploy to a v1-deployed environment needs migration sync
|
|
1681
|
+
|
|
1682
|
+
The pre-v2 CLI never wrote a script hash into deployed schemas, so the first `tailor deploy` against an environment last deployed with it reports `Remote schema drift detected` with every scripted type showing `has no script hash on remote`. Run `tailor tailordb migration sync <current migration number>` once for that environment to write the missing hashes, then `tailor deploy` as usual. Preview/PR workspaces don't hit this, since they're built with v2 from the start. No source change is required.
|