@tailor-platform/sdk 2.36.0 → 2.37.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 +72 -0
- package/dist/{application-DaJbleMi.mjs → application-83WVdH85.mjs} +1 -1
- package/dist/{application-BbORWCj-.mjs → application-Cida-j1g.mjs} +36 -36
- package/dist/application-Cida-j1g.mjs.map +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +6 -1
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +1 -0
- package/dist/cli/commands/executor/jobs.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/config.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +10 -0
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +28 -2
- package/dist/cli/commands/tailordb/migrate/hints.d.mts +1 -0
- package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +3 -0
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +3 -1
- package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +4 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +44 -6
- package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +2 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +2 -0
- package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +8 -0
- package/dist/cli/commands/tailordb/migrate/types.d.mts +2 -0
- package/dist/cli/commands/workspace/create.d.mts +1 -1
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +52 -51
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/client.d.mts +26 -0
- package/dist/cli/shared/function-execution.d.mts +2 -0
- package/dist/cli/shared/prompt.d.mts +9 -4
- package/dist/completion/zsh-worker.zsh +21 -13
- package/dist/configure/config/index.d.mts +2 -0
- package/dist/configure/config/types.d.mts +2 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/tailordb/schema.d.mts +1 -0
- package/dist/configure/services/tailordb/types.d.mts +3 -0
- package/dist/crashreport-C2AcQNTe.mjs +1 -0
- package/dist/{crashreport-DGU6lwiX.mjs → crashreport-D_wf4GZh.mjs} +4 -4
- package/dist/{crashreport-DGU6lwiX.mjs.map → crashreport-D_wf4GZh.mjs.map} +1 -1
- package/dist/date-representation-Cr7W7Pn2.mjs.map +1 -1
- package/dist/{errors-BXmGBX-7.mjs → errors-Dmdnq0zi.mjs} +2 -2
- package/dist/errors-Dmdnq0zi.mjs.map +1 -0
- package/dist/{kysely-type-B0ri1-Xs.mjs → kysely-type-DVL90_oX.mjs} +6 -6
- package/dist/kysely-type-DVL90_oX.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +4 -3
- package/dist/plugin/get-generated-table.d.mts +4 -0
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/types.d.mts +55 -3
- package/dist/plugin/with-context.d.mts +16 -0
- package/dist/register-ts-hook-Ht4zCseV.mjs +1115 -0
- package/dist/register-ts-hook-Ht4zCseV.mjs.map +1 -0
- package/dist/schema-BU1aIQ63.mjs.map +1 -1
- package/dist/{secret-file-BxZ-J_Nz.mjs → secret-file-DiuEcLFP.mjs} +2 -2
- package/dist/{secret-file-BxZ-J_Nz.mjs.map → secret-file-DiuEcLFP.mjs.map} +1 -1
- package/dist/service-CZ0EdD2-.mjs +10 -0
- package/dist/service-CZ0EdD2-.mjs.map +1 -0
- package/dist/service-DDrbdyd-.mjs +2 -0
- package/dist/{service-CaGmqg0r.mjs.map → service-DDrbdyd-.mjs.map} +1 -1
- package/dist/service-WhSyhaho.mjs +1 -0
- package/dist/service_pb-BMHhVot2.mjs +1 -0
- package/dist/service_pb-BxMSK0gg.mjs +2 -0
- package/dist/service_pb-BxMSK0gg.mjs.map +1 -0
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +3 -3
- package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +92 -0
- package/dist/tailor-proto/src/tailor/v1/notification_pb.d.mts +176 -0
- package/dist/tailor-proto/src/tailor/v1/notification_resource_pb.d.mts +172 -0
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +78 -0
- package/dist/types/app-config.generated.d.mts +1 -1
- package/dist/types/auth-connection.generated.d.mts +2 -2
- package/dist/types/auth.generated.d.mts +13 -13
- package/dist/types/executor.generated.d.mts +25 -25
- package/dist/types/field.generated.d.mts +2 -2
- package/dist/types/http-adapter.generated.d.mts +4 -4
- package/dist/types/idp.generated.d.mts +272 -272
- package/dist/types/resolver.generated.d.mts +10 -10
- package/dist/types/tailordb.generated.d.mts +84 -80
- package/dist/types/workflow.generated.d.mts +2 -2
- package/dist/vitest/date-representation.d.mts +2 -0
- package/dist/vitest/environment.d.mts +1 -0
- package/dist/vitest/environment.mjs.map +1 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/migration-steps.d.mts +13 -2
- package/dist/vitest/mock-kysely.d.mts +12 -2
- package/dist/vitest/mocks/aigateway.d.mts +7 -1
- package/dist/vitest/mocks/authconnection.d.mts +7 -1
- package/dist/vitest/mocks/file.d.mts +8 -2
- package/dist/vitest/mocks/iconv.d.mts +7 -1
- package/dist/vitest/mocks/idp.d.mts +7 -1
- package/dist/vitest/mocks/logger.d.mts +7 -1
- package/dist/vitest/mocks/secretmanager.d.mts +7 -1
- package/dist/vitest/mocks/tailordb-pglite.d.mts +12 -2
- package/dist/vitest/mocks/tailordb.d.mts +22 -4
- package/dist/vitest/mocks/workflow.d.mts +2 -1
- package/dist/vitest/pglite-kysely.d.mts +18 -2
- package/dist/vitest/pglite-temporal.d.mts +5 -1
- package/dist/vitest/workflow-local.d.mts +7 -0
- package/dist/{workspace_resource_pb-C4CkoYww.mjs → workspace_resource_pb-7smKERdZ.mjs} +2 -2
- package/dist/workspace_resource_pb-7smKERdZ.mjs.map +1 -0
- package/docs/cli/application.md +51 -21
- package/docs/cli/executor.md +2 -0
- package/docs/cli/function.md +3 -1
- package/docs/cli/tailordb.md +30 -22
- package/docs/cli/workflow.md +2 -0
- package/docs/cli/workspace.md +19 -17
- package/docs/cli-reference.md +5 -4
- package/docs/configuration.md +2 -2
- package/docs/data-clone.md +1 -1
- package/docs/github-actions.md +104 -15
- package/docs/plugin/custom.md +4 -4
- package/docs/runtime.md +1 -1
- package/docs/services/auth.md +2 -0
- package/docs/services/idp.md +2 -0
- package/docs/services/tailordb/index.md +7 -2
- package/docs/services/tailordb/migration.md +71 -30
- package/docs/services/workflow.md +1 -1
- package/docs/testing.md +9 -9
- package/package.json +13 -13
- package/dist/application-BbORWCj-.mjs.map +0 -1
- package/dist/crashreport-WsYAWARW.mjs +0 -1
- package/dist/errors-BXmGBX-7.mjs.map +0 -1
- package/dist/kysely-type-B0ri1-Xs.mjs.map +0 -1
- package/dist/register-ts-hook-iAcG1dfz.mjs +0 -1057
- package/dist/register-ts-hook-iAcG1dfz.mjs.map +0 -1
- package/dist/service-CaGmqg0r.mjs +0 -2
- package/dist/service-DTrVVaDJ.mjs +0 -1
- package/dist/service-hIarp2Gl.mjs +0 -8
- package/dist/service-hIarp2Gl.mjs.map +0 -1
- package/dist/service_pb-6EkMfdOb.mjs +0 -2
- package/dist/service_pb-6EkMfdOb.mjs.map +0 -1
- package/dist/service_pb-CsJKokDl.mjs +0 -1
- package/dist/workspace_resource_pb-C4CkoYww.mjs.map +0 -1
package/docs/cli/application.md
CHANGED
|
@@ -60,23 +60,23 @@ tailor deploy [options]
|
|
|
60
60
|
|
|
61
61
|
**Options**
|
|
62
62
|
|
|
63
|
-
| Option | Alias | Description
|
|
64
|
-
| ----------------------------------------------- | ----- |
|
|
65
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID
|
|
66
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile
|
|
67
|
-
| `--config <CONFIG>` | `-c` | Path to SDK config file. Use comma-separated paths to deploy multiple apps together.
|
|
68
|
-
| `--yes` | `-y` | Skip confirmation prompts
|
|
69
|
-
| `--create-workspace` | - | Create a workspace when the account has none
|
|
70
|
-
| `--workspace-name <WORKSPACE_NAME>` | - | Name for a workspace created during deploy
|
|
71
|
-
| `--workspace-region <WORKSPACE_REGION>` | - | Region for a workspace created during deploy
|
|
72
|
-
| `--organization-id <ORGANIZATION_ID>` | - | Organization ID for a workspace created during deploy
|
|
73
|
-
| `--folder-id <FOLDER_ID>` | - | Folder ID for a workspace created during deploy
|
|
74
|
-
| `--dry-run` | `-d` | Run the command without making any changes
|
|
75
|
-
| `--no-schema-check` | - | Skip schema diff check against migration snapshots
|
|
76
|
-
| `--migration-skip-steps <MIGRATION_SKIP_STEPS>` | - | Skip steps of a partially applied multi-step migration that already succeeded
|
|
77
|
-
| `--no-validate` | - | Skip client-side validation against platform resource constraints
|
|
78
|
-
| `--no-cache` | - | Disable bundle caching for this run
|
|
79
|
-
| `--clean-cache` | - | Clean the bundle cache before building
|
|
63
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
64
|
+
| ----------------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | --------------------------------- |
|
|
65
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
66
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
67
|
+
| `--config <CONFIG>` | `-c` | Path to SDK config file. Use comma-separated paths to deploy multiple apps together. | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
68
|
+
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
|
|
69
|
+
| `--create-workspace` | - | Create a workspace when the account has none | No | - | - |
|
|
70
|
+
| `--workspace-name <WORKSPACE_NAME>` | - | Name for a workspace created during deploy | No | - | - |
|
|
71
|
+
| `--workspace-region <WORKSPACE_REGION>` | - | Region for a workspace created during deploy | No | - | - |
|
|
72
|
+
| `--organization-id <ORGANIZATION_ID>` | - | Organization ID for a workspace created during deploy | No | - | `TAILOR_PLATFORM_ORGANIZATION_ID` |
|
|
73
|
+
| `--folder-id <FOLDER_ID>` | - | Folder ID for a workspace created during deploy | No | - | `TAILOR_PLATFORM_FOLDER_ID` |
|
|
74
|
+
| `--dry-run` | `-d` | Run the command without making any changes | No | - | - |
|
|
75
|
+
| `--no-schema-check` | - | Skip schema diff check against migration snapshots (beta) | No | - | - |
|
|
76
|
+
| `--migration-skip-steps <MIGRATION_SKIP_STEPS>` | - | Skip steps of a partially applied multi-step migration that already succeeded, as comma-separated namespace/step entries (beta) | No | - | - |
|
|
77
|
+
| `--no-validate` | - | Skip client-side validation against platform resource constraints | No | - | - |
|
|
78
|
+
| `--no-cache` | - | Disable bundle caching for this run | No | - | - |
|
|
79
|
+
| `--clean-cache` | - | Clean the bundle cache before building | No | - | - |
|
|
80
80
|
|
|
81
81
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
82
82
|
|
|
@@ -154,7 +154,8 @@ tailor deploy \
|
|
|
154
154
|
`--create-workspace` only creates when the account has no workspace. If the existing workspace
|
|
155
155
|
matches the requested name, region, organization, and folder, `deploy` reuses it so the same command
|
|
156
156
|
is safe to rerun. If multiple workspaces exist, the flag never creates another one or guesses which
|
|
157
|
-
workspace to use. `--yes`
|
|
157
|
+
workspace to use. `--yes` accepts the deployment confirmations described under Confirmation below
|
|
158
|
+
but does not authorize workspace creation.
|
|
158
159
|
|
|
159
160
|
If a saved workspace has been deleted or is no longer accessible, interactive terminals return to
|
|
160
161
|
workspace selection. Non-interactive environments stop with `WORKSPACE_CONTEXT_STALE` instead of
|
|
@@ -195,7 +196,7 @@ See [Automatic Migration Execution](../services/tailordb/migration.md#automatic-
|
|
|
195
196
|
|
|
196
197
|
**Concurrent Deploys:**
|
|
197
198
|
|
|
198
|
-
Deploys that target the same workspace and application from the same project directory are serialized while secrets and auth connections are updated: one deploy proceeds and the other waits for it to finish. A deploy that cannot proceed within 5 minutes fails with an error, which normally means another deploy is still running. If a previous deploy was interrupted, the next deploy recovers automatically within about a minute. Deploys to different workspaces or applications are not affected.
|
|
199
|
+
Deploys that target the same workspace and application from the same project directory are serialized while secrets and auth connections are updated: one deploy proceeds and the other waits for it to finish. A deploy that cannot proceed within 5 minutes fails with an error, which normally means another deploy is still running. If a previous deploy was interrupted, the next deploy recovers automatically within about a minute. If the error persists, stop any `tailor deploy` still running from the project directory, then delete the lock directory that the error names and retry. Deploys to different workspaces or applications are not affected.
|
|
199
200
|
|
|
200
201
|
**Schema Check:**
|
|
201
202
|
|
|
@@ -206,7 +207,7 @@ By default, `deploy` performs two verification steps:
|
|
|
206
207
|
|
|
207
208
|
If remote schema drift is detected, the deploy will fail with an error showing the differences. This helps prevent applying migrations to an inconsistent state.
|
|
208
209
|
|
|
209
|
-
Use `--no-schema-check` to skip both verifications (not recommended for production).
|
|
210
|
+
Use `--no-schema-check` to skip both verifications (not recommended for production). It does not skip the check that the remote migration checkpoint is in the local migration history: when the deployed checkpoint is ahead of the local migration files or belongs to another migration history, the deploy stops before changing anything. Pull the latest migration files, or move the checkpoint on purpose with `tailor tailordb migration sync` or `tailor tailordb migration set`, adding `--force` when the checkpoint belongs to another migration history or has a history label that cannot be read, then deploy again.
|
|
210
211
|
|
|
211
212
|
**Plan Output:**
|
|
212
213
|
|
|
@@ -239,6 +240,22 @@ tailor deploy --dry-run > plan.txt
|
|
|
239
240
|
|
|
240
241
|
In apply mode, the plan is printed to stderr so it does not interfere with piped output.
|
|
241
242
|
|
|
243
|
+
**Confirmation:**
|
|
244
|
+
|
|
245
|
+
After printing the plan, `deploy` asks for confirmation before applying when the plan includes any of the following:
|
|
246
|
+
|
|
247
|
+
- TailorDB migration checkpoints that must be reset before deploying (Beta)
|
|
248
|
+
- Applications recorded as depending on this deploy that are missing from it
|
|
249
|
+
- Resources owned by another application, or tagged with a different application id
|
|
250
|
+
- Existing resources that `tailor` does not manage yet
|
|
251
|
+
- Deletion of TailorDB tables, static websites, AI gateways, OAuth2 clients (including a client type change), Auth connections, Secret Manager vaults, or Secret Manager secrets
|
|
252
|
+
|
|
253
|
+
Declining cancels the deploy. When the plan includes none of these, `deploy` applies it without asking.
|
|
254
|
+
|
|
255
|
+
`--yes` accepts these confirmations without asking. In a non-interactive environment or with `--json`, a deploy that needs one of them fails unless `--yes` is passed. `--dry-run` lists them as warnings without asking.
|
|
256
|
+
|
|
257
|
+
When [`env`](../configuration.md#environment-variables) references the URL of a static website that the same deploy creates, `deploy` first applies static websites and the other resources that cannot reference that URL, then plans the rest again with the real URL and prints that plan as well. It asks again only about what the new plan adds; declining at that point leaves the resources applied first in place.
|
|
258
|
+
|
|
242
259
|
**JSON Output:**
|
|
243
260
|
|
|
244
261
|
Pass the global `--json` / `-j` flag to get machine-readable output.
|
|
@@ -280,10 +297,23 @@ Pass the global `--json` / `-j` flag to get machine-readable output.
|
|
|
280
297
|
```json
|
|
281
298
|
{
|
|
282
299
|
"summary": { "create": 1, "update": 2, "delete": 0, "replace": 0, "forcedBySdkVersion": 0 },
|
|
283
|
-
"status": "applied"
|
|
300
|
+
"status": "applied",
|
|
301
|
+
"workspaceId": "ws_abc123",
|
|
302
|
+
"applications": [
|
|
303
|
+
{
|
|
304
|
+
"name": "my-app",
|
|
305
|
+
"configPath": "/path/to/my-app/tailor.config.ts",
|
|
306
|
+
"url": "https://my-app.example.com",
|
|
307
|
+
"domain": "my-app.example.com",
|
|
308
|
+
"aiGateways": [],
|
|
309
|
+
"staticWebsites": {}
|
|
310
|
+
}
|
|
311
|
+
]
|
|
284
312
|
}
|
|
285
313
|
```
|
|
286
314
|
|
|
315
|
+
Some deploys also add `tailordbMaintenance` or `deployedHooks`, as described under **JSON result** above.
|
|
316
|
+
|
|
287
317
|
## remove
|
|
288
318
|
|
|
289
319
|
Remove all resources managed by the application from the workspace.
|
package/docs/cli/executor.md
CHANGED
|
@@ -6,6 +6,8 @@ description: "List and inspect executors, view executor jobs, and trigger execut
|
|
|
6
6
|
|
|
7
7
|
Commands for managing executors and executor jobs.
|
|
8
8
|
|
|
9
|
+
In the human-readable output of `executor jobs --logs` and `executor trigger --logs`, `[PLATFORM]` marks log lines the Platform added. See [`function logs`](./function.md#function-logs) for the `source` that `--json` reports for each log entry.
|
|
10
|
+
|
|
9
11
|
## executor
|
|
10
12
|
|
|
11
13
|
Manage executors
|
package/docs/cli/function.md
CHANGED
|
@@ -135,7 +135,9 @@ $ tailor function logs <execution-id> --follow
|
|
|
135
135
|
|
|
136
136
|
Each execution includes `errorKind`, which tells you where a failure came from: `USER_RUNTIME` (your code threw while running, or exceeded its time, memory, or CPU limit), `USER_NON_RUNTIME` (your script failed while loading, before your function was called, such as when its top-level code threw), `PLATFORM` (a failure on the Platform side, or the Platform aborting the run because of its own deadline or cancellation), `NONE` (no error), or `UNSPECIFIED` (not recorded, or a kind this CLI version does not recognize). A workflow job waiting on another job also reports `USER_NON_RUNTIME` when that job fails or is canceled. `errorName` and `errorMessage` hold the error's name and message, or `null` when none was recorded. The list table omits `errorMessage`; use `--json` or the execution details to read it.
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
Each execution also includes `hasPlatformLogs`, which is `true` when the Platform added log lines of its own to the execution. The flag is best-effort: `false` does not guarantee there are none, so read the `logEntries` of the execution details to be sure. The list table shows a `hasPlatformLogs` column, marking flagged executions with `yes`, only when at least one listed execution is flagged.
|
|
139
|
+
|
|
140
|
+
Execution details include `logEntries`, the structured log lines (message, severity, timestamp, source) recorded while the function ran. They are available while the execution is still running. `source` is `USER` for your function's own output, `PLATFORM` for a line the Platform added, or `UNSPECIFIED` (not recorded, or a source this CLI version does not recognize); the human-readable output marks Platform lines with `[PLATFORM]`. The `logs` string joins their messages with newlines.
|
|
139
141
|
|
|
140
142
|
Use `--follow` to keep polling a running execution and print new log entries as they arrive until it completes. Polling continues while the execution is suspended at a wait point, and indefinitely unless `--timeout` is set. With `--json`, `--follow` waits for completion and then emits the final execution details once.
|
|
141
143
|
|
package/docs/cli/tailordb.md
CHANGED
|
@@ -23,7 +23,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
23
23
|
| Command | Description |
|
|
24
24
|
| ------------------------------------------- | --------------------------------------------------- |
|
|
25
25
|
| [`tailordb truncate`](#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
|
|
26
|
-
| [`tailordb migration`](#tailordb-migration) | Manage TailorDB schema migrations.
|
|
26
|
+
| [`tailordb migration`](#tailordb-migration) | Manage TailorDB schema migrations (beta). |
|
|
27
27
|
|
|
28
28
|
### tailordb truncate
|
|
29
29
|
|
|
@@ -86,7 +86,7 @@ tailor tailordb truncate User Post --yes
|
|
|
86
86
|
|
|
87
87
|
### tailordb migration
|
|
88
88
|
|
|
89
|
-
Manage TailorDB schema migrations.
|
|
89
|
+
Manage TailorDB schema migrations (beta).
|
|
90
90
|
|
|
91
91
|
Note: Migration scripts are automatically executed during `tailor deploy`. See [Automatic Migration Execution](../services/tailordb/migration.md#automatic-migration-execution) for details.
|
|
92
92
|
|
|
@@ -106,7 +106,7 @@ tailor tailordb migration <command>
|
|
|
106
106
|
| [`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. |
|
|
107
107
|
| [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number. |
|
|
108
108
|
| [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
109
|
-
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a
|
|
109
|
+
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema and checkpoint to a local migration snapshot to recover from schema drift or a checkpoint outside the local history. |
|
|
110
110
|
| [`tailordb migration test`](#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
|
|
111
111
|
| [`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. |
|
|
112
112
|
|
|
@@ -190,7 +190,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
190
190
|
|
|
191
191
|
**Notes**
|
|
192
192
|
|
|
193
|
-
Use this after a deploy failed partway through a migration whose `migrate.ts` exports `steps`, or after a deploy could not confirm whether the script of a migration ran (`MIGRATION_OUTCOME_UNKNOWN`). The migration stays in progress: when `maintenanceMode` is on in your config, the tables of its namespace stay in maintenance mode, and
|
|
193
|
+
Use this after a deploy failed partway through a migration whose `migrate.ts` exports `steps`, or after a deploy could not confirm whether the script of a migration ran (`MIGRATION_OUTCOME_UNKNOWN`). The migration stays in progress: when `maintenanceMode` is on in your config, the tables of its namespace stay in maintenance mode, and the other migration commands that move the checkpoint are refused. A deploy stops before changing anything while a run it could not confirm is not settled.
|
|
194
194
|
|
|
195
195
|
- `--rollback` sends the schema of the migration before the failed one. The next deploy runs the failed migration again, from its first step for a script that exports `steps`. Data changes the script already made are not undone.
|
|
196
196
|
- `--complete` sends the schema of the failed migration itself and records it as completed, without running its `migrate.ts` again. Fix the data first (for example with `tailor query`), and make sure no record lacks a value for a field that becomes required.
|
|
@@ -249,13 +249,14 @@ tailor tailordb migration set [options] <number>
|
|
|
249
249
|
|
|
250
250
|
**Options**
|
|
251
251
|
|
|
252
|
-
| Option | Alias | Description
|
|
253
|
-
| ------------------------------- | ----- |
|
|
254
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID
|
|
255
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile
|
|
256
|
-
| `--config <CONFIG>` | `-c` | Path to Tailor config file
|
|
257
|
-
| `--yes` | `-y` | Skip confirmation prompts
|
|
258
|
-
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist)
|
|
252
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
253
|
+
| ------------------------------- | ----- | --------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
254
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
255
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
256
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
257
|
+
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
|
|
258
|
+
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
|
|
259
|
+
| `--force` | - | Proceed even when the namespace records a migration history ID other than the local one | No | `false` | - |
|
|
259
260
|
|
|
260
261
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
261
262
|
|
|
@@ -263,6 +264,8 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
263
264
|
|
|
264
265
|
The migration number must be a 4-digit value (e.g. `0001`) or a bare integer (e.g. `1`) within 0–9999, and must exist in the local migration history; `0` is always accepted as the baseline, provided the local history passes validation. A gapped history is rejected.
|
|
265
266
|
|
|
267
|
+
The command refuses to run when the namespace records a migration history ID other than the local one, or one that cannot be read, unless the namespace has neither a checkpoint nor a history ID yet. `--force` replaces that history ID with the local one, or removes it when the local history has none, and still asks for confirmation unless `--yes` is given.
|
|
268
|
+
|
|
266
269
|
Metadata lookup failures (authentication, permission, or network errors) are reported as errors; only a not-yet-deployed namespace is treated as having no checkpoint.
|
|
267
270
|
|
|
268
271
|
#### tailordb migration status
|
|
@@ -292,7 +295,7 @@ Local migration files are checked for a valid layout (numbering and required fil
|
|
|
292
295
|
|
|
293
296
|
#### tailordb migration sync
|
|
294
297
|
|
|
295
|
-
Sync remote TailorDB schema to a
|
|
298
|
+
Sync remote TailorDB schema and checkpoint to a local migration snapshot to recover from schema drift or a checkpoint outside the local history.
|
|
296
299
|
|
|
297
300
|
**Usage**
|
|
298
301
|
|
|
@@ -308,16 +311,21 @@ tailor tailordb migration sync [options] <number>
|
|
|
308
311
|
|
|
309
312
|
**Options**
|
|
310
313
|
|
|
311
|
-
| Option | Alias | Description
|
|
312
|
-
| ------------------------------- | ----- |
|
|
313
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID
|
|
314
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile
|
|
315
|
-
| `--config <CONFIG>` | `-c` | Path to Tailor config file
|
|
316
|
-
| `--yes` | `-y` | Skip confirmation prompts
|
|
317
|
-
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist)
|
|
314
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
315
|
+
| ------------------------------- | ----- | --------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
316
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
317
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
318
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
319
|
+
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
|
|
320
|
+
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
|
|
321
|
+
| `--force` | - | Proceed even when the namespace records a migration history ID other than the local one | No | `false` | - |
|
|
318
322
|
|
|
319
323
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
320
324
|
|
|
325
|
+
**Notes**
|
|
326
|
+
|
|
327
|
+
The command refuses to run when the namespace records a migration history ID other than the local one, or one that cannot be read, unless the namespace has neither a checkpoint nor a history ID yet. `--force` overwrites the tables and that history ID with those of the local history, and still asks for confirmation unless `--yes` is given.
|
|
328
|
+
|
|
321
329
|
#### tailordb migration test
|
|
322
330
|
|
|
323
331
|
Test pending migrations with seed fixtures or cloned data in a temporary workspace.
|
|
@@ -343,9 +351,9 @@ tailor tailordb migration test [options]
|
|
|
343
351
|
| `--folder-id <FOLDER_ID>` | - | Folder to create the temporary workspace in (default: the source workspace's folder). Requires --organization-id when the source workspace is not in an organization. With --target-workspace-id, must match the target's folder | No | - | `TAILOR_PLATFORM_FOLDER_ID` |
|
|
344
352
|
| `--assert <ASSERT>` | - | Path to a TypeScript assertion script to run after migrations | No | - | - |
|
|
345
353
|
| `--assert-namespace <ASSERT_NAMESPACE>` | - | TailorDB namespace exposed to the assertion script | No | - | - |
|
|
346
|
-
| `--keep-ttl <KEEP_TTL>` | - | Record an expiry on the kept workspace, e.g. 24h or 7d, so workspace prune --expired can delete it (requires --keep)
|
|
354
|
+
| `--keep-ttl <KEEP_TTL>` | - | Record an expiry on the kept workspace, e.g. 24h or 7d (less than 50,000,000 days), so workspace prune --expired can delete it (requires --keep) | No | - | - |
|
|
347
355
|
| `--clone-timeout <CLONE_TIMEOUT>` | - | How long to wait for the clone to finish with --data clone, e.g. 30s or 10m (default: 30m) | No | - | - |
|
|
348
|
-
| `--machine-user <MACHINE_USER>` | - | Machine user for seed and assertion script execution
|
|
356
|
+
| `--machine-user <MACHINE_USER>` | - | Machine user for seed, migration, and assertion script execution | No | - | - |
|
|
349
357
|
|
|
350
358
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
351
359
|
|
|
@@ -377,7 +385,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
377
385
|
|
|
378
386
|
**See also:** For migration concepts, configuration, workflow, and troubleshooting, see the [TailorDB Migrations guide](../services/tailordb/migration.md).
|
|
379
387
|
|
|
380
|
-
### tailordb erd
|
|
388
|
+
### tailordb erd (Beta)
|
|
381
389
|
|
|
382
390
|
The `tailordb erd` commands (export, diff, serve, deploy) are provided by the `@tailor-platform/sdk-plugin-tailordb-erd` CLI plugin. Install it next to the SDK and keep running `tailor tailordb erd <command>` as before:
|
|
383
391
|
|
package/docs/cli/workflow.md
CHANGED
|
@@ -6,6 +6,8 @@ description: "List and inspect workflows, start and wait for workflow runs, and
|
|
|
6
6
|
|
|
7
7
|
Commands for managing workflows and workflow executions.
|
|
8
8
|
|
|
9
|
+
In the human-readable output of `--logs` on `workflow start`, `workflow wait`, `workflow executions`, and `workflow resume`, `[PLATFORM]` marks log lines the Platform added. See [`function logs`](./function.md#function-logs) for the `source` that `--json` reports for each log entry.
|
|
10
|
+
|
|
9
11
|
## workflow
|
|
10
12
|
|
|
11
13
|
Manage workflows and workflow executions.
|
package/docs/cli/workspace.md
CHANGED
|
@@ -104,18 +104,18 @@ tailor workspace create [options]
|
|
|
104
104
|
|
|
105
105
|
**Options**
|
|
106
106
|
|
|
107
|
-
| Option | Alias | Description
|
|
108
|
-
| ------------------------------------- | ----- |
|
|
109
|
-
| `--name <NAME>` | `-n` | Workspace name
|
|
110
|
-
| `--region <REGION>` | `-r` | Workspace region (asia-northeast, us-west, europe-west)
|
|
111
|
-
| `--delete-protection` | `-d` | Enable delete protection
|
|
112
|
-
| `--organization-id <ORGANIZATION_ID>` | `-o` | Organization ID to workspace associate with
|
|
113
|
-
| `--folder-id <FOLDER_ID>` | `-f` | Folder ID to workspace associate with
|
|
114
|
-
| `--ttl <TTL>` | - | Record on the workspace itself when it becomes prunable, such as 30m, 24h, or 7d. `workspace prune --expired` deletes it once that has passed | No | - | - |
|
|
115
|
-
| `--profile-name <PROFILE_NAME>` | `-p` | Profile name to create
|
|
116
|
-
| `--profile <PROFILE>` | - | Workspace profile used for authentication and Platform selection
|
|
117
|
-
| `--profile-user <PROFILE_USER>` | - | User email address or machine user client ID for the profile (defaults to current user)
|
|
118
|
-
| `--permission <PERMISSION>` | - | Profile permission (requires --profile-name). 'read' blocks all write commands while the profile is active.
|
|
107
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
108
|
+
| ------------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------- | --------------------------------- |
|
|
109
|
+
| `--name <NAME>` | `-n` | Workspace name | Yes | - | - |
|
|
110
|
+
| `--region <REGION>` | `-r` | Workspace region (asia-northeast, us-west, europe-west) | Yes | - | - |
|
|
111
|
+
| `--delete-protection` | `-d` | Enable delete protection | No | `false` | - |
|
|
112
|
+
| `--organization-id <ORGANIZATION_ID>` | `-o` | Organization ID to workspace associate with | No | - | `TAILOR_PLATFORM_ORGANIZATION_ID` |
|
|
113
|
+
| `--folder-id <FOLDER_ID>` | `-f` | Folder ID to workspace associate with | No | - | `TAILOR_PLATFORM_FOLDER_ID` |
|
|
114
|
+
| `--ttl <TTL>` | - | Record on the workspace itself when it becomes prunable, such as 30m, 24h, or 7d (less than 50,000,000 days). `workspace prune --expired` deletes it once that has passed | No | - | - |
|
|
115
|
+
| `--profile-name <PROFILE_NAME>` | `-p` | Profile name to create | No | - | - |
|
|
116
|
+
| `--profile <PROFILE>` | - | Workspace profile used for authentication and Platform selection | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
117
|
+
| `--profile-user <PROFILE_USER>` | - | User email address or machine user client ID for the profile (defaults to current user) | No | - | - |
|
|
118
|
+
| `--permission <PERMISSION>` | - | Profile permission (requires --profile-name). 'read' blocks all write commands while the profile is active. | No | `"write"` | - |
|
|
119
119
|
|
|
120
120
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
121
121
|
|
|
@@ -125,6 +125,8 @@ Every workspace belongs to an organization. Without --organization-id and --fold
|
|
|
125
125
|
|
|
126
126
|
TAILOR_PLATFORM_ORGANIZATION_ID and TAILOR_PLATFORM_FOLDER_ID are also read from --env-file. Command-line options take precedence over the corresponding environment variables. Empty values in the env file are treated as not given.
|
|
127
127
|
|
|
128
|
+
When --ttl is given but the expiry cannot be confirmed, the command still prints the created workspace, then fails with WORKSPACE_TTL_WRITE_FAILED. With --json, the printed `ttl.state` is then `unconfirmed` instead of `written`, so a script can read the workspace ID and record the expiry again with `workspace ttl set`.
|
|
129
|
+
|
|
128
130
|
### workspace delete
|
|
129
131
|
|
|
130
132
|
Delete a Tailor Platform workspace.
|
|
@@ -300,11 +302,11 @@ tailor workspace ttl set [options]
|
|
|
300
302
|
|
|
301
303
|
**Options**
|
|
302
304
|
|
|
303
|
-
| Option | Alias | Description
|
|
304
|
-
| ------------------------------- | ----- |
|
|
305
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID
|
|
306
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile
|
|
307
|
-
| `--ttl <TTL>` | - | Time from now until the workspace becomes prunable, such as 30m, 24h, or 7d | Yes | - | - |
|
|
305
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
306
|
+
| ------------------------------- | ----- | ------------------------------------------------------------------------------------------------------- | -------- | ------- | ------------------------------ |
|
|
307
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
308
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
309
|
+
| `--ttl <TTL>` | - | Time from now until the workspace becomes prunable, such as 30m, 24h, or 7d (less than 50,000,000 days) | Yes | - | - |
|
|
308
310
|
|
|
309
311
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
310
312
|
|
package/docs/cli-reference.md
CHANGED
|
@@ -52,7 +52,8 @@ flag always wins, so `--json=false` forces table output even when the variable i
|
|
|
52
52
|
`true`, `True`, `TRUE`, `t`, `T`, and `1` enable JSON; `false`, `False`, `FALSE`, `f`, `F`, and `0`
|
|
53
53
|
keep table output. Other values are rejected. JSON mode also disables interactive prompts, so set the
|
|
54
54
|
variable per invocation or per job rather than exporting it from a shell profile; a command that
|
|
55
|
-
needed a prompt names what selected JSON when it refuses.
|
|
55
|
+
needed a prompt names what selected JSON when it refuses. In JSON mode, pass `--yes` to commands that
|
|
56
|
+
ask for confirmation, and pass the options that a command would otherwise prompt for.
|
|
56
57
|
|
|
57
58
|
When an AI coding agent such as Claude Code, Codex, Cursor, or Gemini CLI runs the CLI, every
|
|
58
59
|
command defaults to JSON as if `TAILOR_JSON_OUTPUT=true` were set, and `--help` starts with a short
|
|
@@ -226,7 +227,7 @@ Workspace ID resolution follows this priority order:
|
|
|
226
227
|
2. `TAILOR_PLATFORM_WORKSPACE_ID` environment variable
|
|
227
228
|
3. Profile specified via `--profile` option or `TAILOR_PLATFORM_PROFILE`
|
|
228
229
|
|
|
229
|
-
## CLI Plugins
|
|
230
|
+
## CLI Plugins (Beta)
|
|
230
231
|
|
|
231
232
|
> [!WARNING]
|
|
232
233
|
> CLI plugins are a **beta** feature. The dispatch behavior and the set of injected environment
|
|
@@ -331,14 +332,14 @@ Commands for managing TailorDB tables, data, and schema migrations.
|
|
|
331
332
|
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
332
333
|
| [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data. |
|
|
333
334
|
| [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables. |
|
|
334
|
-
| [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations.
|
|
335
|
+
| [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations (beta). |
|
|
335
336
|
| [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. |
|
|
336
337
|
| [tailordb migration rebaseline](./cli/tailordb.md#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
|
|
337
338
|
| [tailordb migration resolve](./cli/tailordb.md#tailordb-migration-resolve) | Settle a migration that a failed deploy left partially applied, or whose run a deploy could not confirm. |
|
|
338
339
|
| [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. |
|
|
339
340
|
| [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number. |
|
|
340
341
|
| [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
341
|
-
| [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a
|
|
342
|
+
| [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema and checkpoint to a local migration snapshot to recover from schema drift or a checkpoint outside the local history. |
|
|
342
343
|
| [tailordb migration test](./cli/tailordb.md#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
|
|
343
344
|
| [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. |
|
|
344
345
|
|
package/docs/configuration.md
CHANGED
|
@@ -118,7 +118,7 @@ The default applies wherever the SDK parses or serializes `t` fields on your beh
|
|
|
118
118
|
|
|
119
119
|
The setting is per `tailor.config.ts`, but the field types are declared through `tailor.d.ts`, which TypeScript merges across every file in a program. If one `tsconfig.json` includes the `tailor.d.ts` of several applications, they must agree on `defaultDateRepresentation`. When they differ, `t.date()`, `t.datetime()`, and `t.time()` called without `as` fail to type-check in that program until the configs are aligned or each application gets its own `tsconfig.json`.
|
|
120
120
|
|
|
121
|
-
**Maintenance Mode** (`maintenanceMode
|
|
121
|
+
**Maintenance Mode** (`maintenanceMode`, Beta): Whether `deploy` restricts the TailorDB namespaces it migrates while it applies pending migrations: `"migration"` (the default) restricts them until the migrations complete, `"deploy"` until the whole deploy completes, and `false` does not restrict them. See [Maintenance mode](./services/tailordb/migration.md#maintenance-mode) for what is restricted and what concurrent requests can observe without it.
|
|
122
122
|
|
|
123
123
|
```typescript
|
|
124
124
|
export default defineConfig({
|
|
@@ -516,7 +516,7 @@ export default defineConfig({
|
|
|
516
516
|
});
|
|
517
517
|
```
|
|
518
518
|
|
|
519
|
-
### Plugins
|
|
519
|
+
### Plugins (Beta)
|
|
520
520
|
|
|
521
521
|
Configure plugins using `definePlugins()`, exported as `export const plugins`.
|
|
522
522
|
|
package/docs/data-clone.md
CHANGED
|
@@ -70,6 +70,6 @@ tailor data operation get --from <source-workspace-id> --to <target-workspace-id
|
|
|
70
70
|
|
|
71
71
|
With `--json`, `data clone` reports `status: "completed"` once the clone has finished, or `status: "started"` with `--no-wait`.
|
|
72
72
|
|
|
73
|
-
## Rehearsing migrations with cloned data
|
|
73
|
+
## Rehearsing migrations with cloned data (Beta)
|
|
74
74
|
|
|
75
75
|
To test pending TailorDB migrations against a copy of real records, use `tailor tailordb migration test --data clone` instead of cloning by hand. It creates a temporary workspace, deploys the pre-migration schema, clones the records, and runs the pending migrations. That command copies TailorDB records only; see [Clone mode](./services/tailordb/migration.md#clone-mode).
|