@tailor-platform/sdk 2.0.0-next.8 → 2.0.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 +631 -0
- package/dist/{application-GzW98_Xr.mjs → application-CM6hKnSK.mjs} +489 -118
- package/dist/application-CM6hKnSK.mjs.map +1 -0
- package/dist/application-CXNaUNhv.mjs +3 -0
- package/dist/cli/commands/deploy/aigateway.d.mts +2 -2
- package/dist/cli/commands/deploy/application.d.mts +2 -2
- package/dist/cli/commands/deploy/auth.d.mts +2 -2
- package/dist/cli/commands/deploy/deploy.d.mts +1 -0
- package/dist/cli/commands/deploy/executor.d.mts +2 -2
- package/dist/cli/commands/deploy/function-registry.d.mts +1 -2
- package/dist/cli/commands/deploy/idp.d.mts +2 -2
- package/dist/cli/commands/deploy/label.d.mts +2 -0
- package/dist/cli/commands/deploy/resolver.d.mts +2 -2
- package/dist/cli/commands/deploy/secret-manager.d.mts +1 -1
- package/dist/cli/commands/deploy/staticwebsite.d.mts +2 -2
- package/dist/cli/commands/deploy/tailordb/index.d.mts +4 -2
- package/dist/cli/commands/deploy/types.d.mts +2 -1
- package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -2
- package/dist/cli/commands/deploy/workflow.d.mts +2 -2
- package/dist/cli/commands/executor/get.d.mts +1 -10
- package/dist/cli/commands/executor/jobs.d.mts +1 -38
- package/dist/cli/commands/executor/trigger.d.mts +1 -11
- package/dist/cli/commands/generate/seed/bundler.d.mts +2 -1
- package/dist/cli/commands/tailordb/migrate/bundler.d.mts +3 -2
- package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +11 -1
- package/dist/cli/commands/tailordb/migrate/schema-checks.d.mts +5 -0
- package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
- package/dist/cli/commands/workflow/executions.d.mts +1 -13
- package/dist/cli/commands/workflow/get.d.mts +1 -10
- package/dist/cli/commands/workflow/start.d.mts +2 -14
- package/dist/cli/index.mjs +12 -6552
- package/dist/cli/lib.d.mts +14 -15
- package/dist/cli/lib.mjs +203 -46
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/{index.d.mts → main.d.mts} +1 -1
- package/dist/cli/main.mjs +6777 -0
- package/dist/cli/main.mjs.map +1 -0
- package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
- package/dist/cli/services/workflow/bundler.d.mts +2 -1
- package/dist/cli/shared/client.d.mts +28 -3
- package/dist/cli/shared/config-loader.d.mts +11 -4
- package/dist/cli/shared/error-json.d.mts +23 -0
- package/dist/cli/shared/script-executor.d.mts +6 -3
- package/dist/cli/shared/seed-chunker.d.mts +2 -7
- package/dist/cli/shared/seed-context.d.mts +49 -0
- package/dist/cli/shared/tailordb-namespaces.d.mts +7 -4
- package/dist/cli/shared/tsconfig-paths-plugin.d.mts +2 -0
- package/dist/cli/shared/type-generator.d.mts +4 -3
- package/dist/completion/zsh-worker.zsh +85 -22
- package/dist/configure/config/types.d.mts +29 -4
- package/dist/configure/index.d.mts +4 -3
- package/dist/configure/index.mjs +183 -6
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/executor/index.d.mts +2 -2
- package/dist/configure/services/executor/trigger/event.d.mts +245 -2
- package/dist/configure/services/executor/trigger/index.d.mts +3 -3
- package/dist/configure/services/idp/index.d.mts +2 -2
- package/dist/configure/services/idp/permission.d.mts +1 -16
- package/dist/configure/services/idp/types.d.mts +5 -1
- package/dist/configure/services/index.d.mts +4 -3
- package/dist/configure/services/resolver/index.d.mts +2 -1
- package/dist/configure/services/resolver/permission.d.mts +64 -0
- package/dist/configure/services/resolver/resolver.d.mts +14 -2
- package/dist/configure/services/tailordb/index.d.mts +0 -1
- package/dist/configure/services/tailordb/permission.d.mts +1 -16
- package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
- package/dist/configure/services/workflow/execution-policy.types.d.mts +1 -1
- package/dist/configure/services/workflow/job.d.mts +11 -2
- package/dist/configure/services/workflow/workflow.d.mts +10 -0
- package/dist/configure/types/permission-operand.types.d.mts +20 -0
- package/dist/{crashreport-CxHne11E.mjs → crashreport-B5LqCTfF.mjs} +2 -2
- package/dist/{crashreport-CxHne11E.mjs.map → crashreport-B5LqCTfF.mjs.map} +1 -1
- package/dist/{crashreport-0ioNRZ4K.mjs → crashreport-eI7ty7ok.mjs} +1 -1
- package/dist/{errors-DfnF4ibq.mjs → errors-D7583Zz7.mjs} +2 -44
- package/dist/errors-D7583Zz7.mjs.map +1 -0
- package/dist/{globals-CBZ0egXT.mjs → globals-TfAVItuK.mjs} +21 -5
- package/dist/globals-TfAVItuK.mjs.map +1 -0
- package/dist/logger-BtX0suGY.mjs +48 -0
- package/dist/logger-BtX0suGY.mjs.map +1 -0
- package/dist/{logger-BwS4ppwO.mjs → logger-CXQq9YIp.mjs} +110 -13
- package/dist/logger-CXQq9YIp.mjs.map +1 -0
- package/dist/node-builtins-CmaL2Cbq.mjs +36 -0
- package/dist/node-builtins-CmaL2Cbq.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.mjs +115 -2
- package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -0
- package/dist/plugin/builtin/file-utils/index.mjs +149 -2
- package/dist/plugin/builtin/file-utils/index.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +274 -2
- package/dist/plugin/builtin/kysely-type/index.mjs.map +1 -0
- package/dist/plugin/builtin/seed/index.d.mts +3 -2
- package/dist/plugin/builtin/seed/index.mjs +1 -1
- package/dist/plugin/builtin/seed/seed-type-processor.d.mts +21 -0
- package/dist/plugin/builtin/seed/types.d.mts +2 -0
- package/dist/{register-ts-hook-DvEs6YsL.mjs → register-ts-hook-LYV7zH-e.mjs} +2953 -996
- package/dist/register-ts-hook-LYV7zH-e.mjs.map +1 -0
- package/dist/{registry-i7EdJ-D5.mjs → registry-BIGVUrMB.mjs} +3 -3
- package/dist/registry-BIGVUrMB.mjs.map +1 -0
- package/dist/runtime/globals.d.mts +7 -0
- package/dist/runtime/index.d.mts +3 -1
- package/dist/runtime/index.mjs +3 -2
- package/dist/runtime/logger.d.mts +98 -0
- package/dist/runtime/logger.mjs +3 -0
- package/dist/runtime/workflow.d.mts +15 -7
- package/dist/runtime/workflow.mjs +1 -1
- package/dist/seed-B-yckgQY.mjs +483 -0
- package/dist/seed-B-yckgQY.mjs.map +1 -0
- package/dist/{service-DaeJlBoH.mjs → service-B5WynBHQ.mjs} +3 -3
- package/dist/{service-DaeJlBoH.mjs.map → service-B5WynBHQ.mjs.map} +1 -1
- package/dist/service-M7OYziQP.mjs +3 -0
- package/dist/{service-Dmxa2I4i.mjs → service-k1xy_A5G.mjs} +30 -4
- package/dist/service-k1xy_A5G.mjs.map +1 -0
- package/dist/{service_pb-BoLM0X4K.mjs → service_pb-D5--My_M.mjs} +5 -5
- package/dist/service_pb-D5--My_M.mjs.map +1 -0
- package/dist/{service_pb-r1T7kpJc.mjs → service_pb-i8CmnQP4.mjs} +1 -1
- package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +106 -1
- package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +6 -1
- package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +24 -1
- package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +49 -1
- package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +89 -6
- package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +26 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +101 -1
- package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +22 -1
- package/dist/types/auth.generated.d.mts +14 -2
- package/dist/types/executor.generated.d.mts +45 -3
- package/dist/types/http-adapter.generated.d.mts +5 -0
- package/dist/types/idp.generated.d.mts +31 -1
- package/dist/types/resolver.generated.d.mts +30 -2
- package/dist/types/tailordb.generated.d.mts +15 -3
- package/dist/utils/test/index.d.mts +1 -2
- package/dist/utils/test/index.mjs +1 -169
- package/dist/utils/test/index.mjs.map +1 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +6 -4
- package/dist/vitest/index.mjs +112 -62
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +2 -1
- package/dist/vitest/mocks/logger.d.mts +45 -0
- package/dist/vitest/mocks/workflow.d.mts +8 -8
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workflow-CsBvRE3g.mjs → workflow-Bamae_Yc.mjs} +5 -5
- package/dist/workflow-Bamae_Yc.mjs.map +1 -0
- package/dist/{workspace_resource_pb-Db3fv68L.mjs → workspace_resource_pb-DXnO2AT-.mjs} +13 -8
- package/dist/workspace_resource_pb-DXnO2AT-.mjs.map +1 -0
- package/docs/cli/application.md +5 -1
- package/docs/cli/tailordb.md +47 -13
- package/docs/cli-reference.md +38 -30
- package/docs/configuration.md +54 -2
- package/docs/github-actions.md +2 -2
- package/docs/migration/v2.md +408 -5
- package/docs/runtime.md +5 -1
- package/docs/services/executor.md +83 -3
- package/docs/services/idp.md +8 -6
- package/docs/services/resolver.md +60 -4
- package/docs/services/tailordb-migration.md +31 -7
- package/docs/services/tailordb.md +7 -5
- package/docs/services/workflow.md +33 -3
- package/docs/testing.md +34 -7
- package/package.json +31 -24
- package/dist/application-GzW98_Xr.mjs.map +0 -1
- package/dist/application-OM0taSPn.mjs +0 -3
- package/dist/cli/index.mjs.map +0 -1
- package/dist/enum-constants-j9QBF0cB.mjs +0 -116
- package/dist/enum-constants-j9QBF0cB.mjs.map +0 -1
- package/dist/errors-DfnF4ibq.mjs.map +0 -1
- package/dist/file-utils-yEiIS4nJ.mjs +0 -150
- package/dist/file-utils-yEiIS4nJ.mjs.map +0 -1
- package/dist/globals-CBZ0egXT.mjs.map +0 -1
- package/dist/kysely-type-DqIRgDYR.mjs +0 -275
- package/dist/kysely-type-DqIRgDYR.mjs.map +0 -1
- package/dist/logger-BwS4ppwO.mjs.map +0 -1
- package/dist/register-ts-hook-DvEs6YsL.mjs.map +0 -1
- package/dist/registry-i7EdJ-D5.mjs.map +0 -1
- package/dist/seed-CRSQJI_z.mjs +0 -1170
- package/dist/seed-CRSQJI_z.mjs.map +0 -1
- package/dist/service-BJAQ70e5.mjs +0 -3
- package/dist/service-Dmxa2I4i.mjs.map +0 -1
- package/dist/service_pb-BoLM0X4K.mjs.map +0 -1
- package/dist/utils/test/mock.d.mts +0 -86
- package/dist/workflow-CsBvRE3g.mjs.map +0 -1
- package/dist/workspace_resource_pb-Db3fv68L.mjs.map +0 -1
package/docs/cli/application.md
CHANGED
|
@@ -97,7 +97,7 @@ When the project has no saved selection, `deploy` discovers the account's worksp
|
|
|
97
97
|
In CI and other non-interactive environments, workspace creation must be explicit:
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
|
-
tailor
|
|
100
|
+
tailor deploy \
|
|
101
101
|
--create-workspace \
|
|
102
102
|
--workspace-name example-workspace \
|
|
103
103
|
--workspace-region us-west
|
|
@@ -143,6 +143,10 @@ When migrations are configured (`db.tailordb.migration` in config), the `deploy`
|
|
|
143
143
|
|
|
144
144
|
See [Automatic Migration Execution](../services/tailordb-migration.md#automatic-migration-execution) for details on automatic migration execution.
|
|
145
145
|
|
|
146
|
+
**Concurrent Deploys:**
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
|
|
146
150
|
**Schema Check:**
|
|
147
151
|
|
|
148
152
|
By default, `deploy` performs two verification steps:
|
package/docs/cli/tailordb.md
CHANGED
|
@@ -94,13 +94,14 @@ 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 types and the previous migration snapshot.
|
|
100
|
-
| [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory.
|
|
101
|
-
| [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number.
|
|
102
|
-
| [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations.
|
|
103
|
-
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift).
|
|
97
|
+
| Command | Description |
|
|
98
|
+
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local types and the previous migration snapshot. |
|
|
100
|
+
| [`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. |
|
|
101
|
+
| [`tailordb migration set`](#tailordb-migration-set) | Set migration checkpoint to a specific number. |
|
|
102
|
+
| [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
103
|
+
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
|
|
104
|
+
| [`tailordb migration validate`](#tailordb-migration-validate) | Validate the full migration history and detect schema drift (local types 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. |
|
|
104
105
|
|
|
105
106
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
106
107
|
|
|
@@ -127,7 +128,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
127
128
|
|
|
128
129
|
#### tailordb migration script
|
|
129
130
|
|
|
130
|
-
Add a migration script (migrate.ts) template to an existing migration directory.
|
|
131
|
+
Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none.
|
|
131
132
|
|
|
132
133
|
**Usage**
|
|
133
134
|
|
|
@@ -143,10 +144,12 @@ tailor tailordb migration script [options] <number>
|
|
|
143
144
|
|
|
144
145
|
**Options**
|
|
145
146
|
|
|
146
|
-
| Option | Alias | Description
|
|
147
|
-
| ------------------------- | ----- |
|
|
148
|
-
| `--config <CONFIG>` | `-c` | Path to Tailor config file
|
|
149
|
-
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist)
|
|
147
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
148
|
+
| ------------------------- | ----- | -------------------------------------------------------------------------------------------- | -------- | -------------------- | -------------------- |
|
|
149
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
150
|
+
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
|
|
151
|
+
| `--no-script` | - | Record that this migration intentionally runs without a migration script (requires --reason) | No | - | - |
|
|
152
|
+
| `--reason <REASON>` | - | Reason why no migration script is needed (used with --no-script) | No | - | - |
|
|
150
153
|
|
|
151
154
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
152
155
|
|
|
@@ -178,6 +181,12 @@ tailor tailordb migration set [options] <number>
|
|
|
178
181
|
|
|
179
182
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
180
183
|
|
|
184
|
+
**Notes**
|
|
185
|
+
|
|
186
|
+
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.
|
|
187
|
+
|
|
188
|
+
Metadata lookup failures (authentication, permission, or network errors) are reported as errors; only a not-yet-deployed namespace is treated as having no checkpoint.
|
|
189
|
+
|
|
181
190
|
#### tailordb migration status
|
|
182
191
|
|
|
183
192
|
Show the current migration status for TailorDB namespaces, including applied and pending migrations.
|
|
@@ -199,6 +208,10 @@ tailor tailordb migration status [options]
|
|
|
199
208
|
|
|
200
209
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
201
210
|
|
|
211
|
+
**Notes**
|
|
212
|
+
|
|
213
|
+
Metadata lookup failures (authentication, permission, or network errors) are reported per namespace and make the command exit non-zero; only a not-yet-deployed namespace is treated as having no applied migrations.
|
|
214
|
+
|
|
202
215
|
#### tailordb migration sync
|
|
203
216
|
|
|
204
217
|
Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift).
|
|
@@ -227,6 +240,27 @@ tailor tailordb migration sync [options] <number>
|
|
|
227
240
|
|
|
228
241
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
229
242
|
|
|
243
|
+
#### tailordb migration validate
|
|
244
|
+
|
|
245
|
+
Validate the full migration history and detect schema drift (local types 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.
|
|
246
|
+
|
|
247
|
+
**Usage**
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
tailor tailordb migration validate [options]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Options**
|
|
254
|
+
|
|
255
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
256
|
+
| ------------------------------- | ----- | --------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
257
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
258
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
259
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
260
|
+
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (validates all namespaces if not specified) | No | - | - |
|
|
261
|
+
|
|
262
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
263
|
+
|
|
230
264
|
**See also:** For migration concepts, configuration, workflow, and troubleshooting, see the [TailorDB Migrations guide](../services/tailordb-migration.md).
|
|
231
265
|
|
|
232
266
|
### tailordb erd
|
|
@@ -234,7 +268,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
234
268
|
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:
|
|
235
269
|
|
|
236
270
|
```bash
|
|
237
|
-
npm install -D @tailor-platform/sdk-plugin-tailordb-erd
|
|
271
|
+
npm install -D @tailor-platform/sdk-plugin-tailordb-erd
|
|
238
272
|
tailor tailordb erd export --namespace myNamespace
|
|
239
273
|
```
|
|
240
274
|
|
package/docs/cli-reference.md
CHANGED
|
@@ -65,26 +65,26 @@ tailor deploy --env-file .env --env-file .env.production
|
|
|
65
65
|
|
|
66
66
|
You can use environment variables to configure workspace and authentication:
|
|
67
67
|
|
|
68
|
-
| Variable | Description
|
|
69
|
-
| -------------------------------------------- |
|
|
70
|
-
| `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands
|
|
71
|
-
| `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands
|
|
72
|
-
| `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands
|
|
73
|
-
| `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`)
|
|
74
|
-
| `TAILOR_PLATFORM_PROFILE` | Workspace profile name
|
|
75
|
-
| `TAILOR_CONFIG_PATH` | Path to Tailor config file
|
|
76
|
-
| `TAILOR_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file
|
|
77
|
-
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user`
|
|
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 test-run`, `machineuser token`
|
|
80
|
-
| `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url`
|
|
81
|
-
| `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id`
|
|
82
|
-
| `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url`
|
|
83
|
-
| `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count
|
|
84
|
-
| `TAILOR_APPLY_CONCURRENCY` | Max concurrent
|
|
85
|
-
| `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`)
|
|
86
|
-
| `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off`
|
|
87
|
-
| `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on`
|
|
68
|
+
| Variable | Description |
|
|
69
|
+
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
70
|
+
| `TAILOR_PLATFORM_WORKSPACE_ID` | Workspace ID for deployment commands |
|
|
71
|
+
| `TAILOR_PLATFORM_ORGANIZATION_ID` | Organization ID for organization commands |
|
|
72
|
+
| `TAILOR_PLATFORM_FOLDER_ID` | Folder ID for folder commands |
|
|
73
|
+
| `TAILOR_PLATFORM_TOKEN` | Authentication token (alternative to `login`) |
|
|
74
|
+
| `TAILOR_PLATFORM_PROFILE` | Workspace profile name |
|
|
75
|
+
| `TAILOR_CONFIG_PATH` | Path to Tailor config file |
|
|
76
|
+
| `TAILOR_DTS_PATH` | Output path for generated `tailor.d.ts` type definition file |
|
|
77
|
+
| `TAILOR_PLATFORM_MACHINE_USER_CLIENT_ID` | Client ID for `login --machine-user` |
|
|
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 test-run`, `machineuser token` |
|
|
80
|
+
| `TAILOR_PLATFORM_URL` | Platform API base URL. Saved into profiles created with `profile create --platform-url` |
|
|
81
|
+
| `TAILOR_PLATFORM_OAUTH2_CLIENT_ID` | OAuth2 client ID for user login. Saved into profiles created with `profile create --oauth2-client-id` |
|
|
82
|
+
| `TAILOR_PLATFORM_CONSOLE_URL` | Console base URL. Saved into profiles created with `profile create --console-url` |
|
|
83
|
+
| `TAILOR_BUNDLE_CONCURRENCY` | Max concurrent bundle workers for `deploy` (resolvers/executors/workflows). Defaults to CPU count |
|
|
84
|
+
| `TAILOR_APPLY_CONCURRENCY` | Max concurrent platform RPCs during `apply`/`deploy`. Defaults to 16 |
|
|
85
|
+
| `VISUAL` / `EDITOR` | Preferred editor for commands that open files (e.g., `vim`, `code`, `nano`) |
|
|
86
|
+
| `TAILOR_CRASH_REPORTS_LOCAL` | Local crash log writing: `on` (default) or `off` |
|
|
87
|
+
| `TAILOR_CRASH_REPORTS_REMOTE` | Automatic crash report submission: `off` (default) or `on` |
|
|
88
88
|
|
|
89
89
|
### Authentication Token Priority
|
|
90
90
|
|
|
@@ -119,6 +119,13 @@ remaining arguments:
|
|
|
119
119
|
tailor hello world --loud
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
+
This is how the `@tailor-platform/sdk-plugin-seed` package provides the `seed` commands:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Runs `tailor-seed` with: apply
|
|
126
|
+
tailor seed apply
|
|
127
|
+
```
|
|
128
|
+
|
|
122
129
|
This also works under a built-in command group. The command path is joined with hyphens, so a plugin
|
|
123
130
|
nested under `tailordb` is named `tailor-tailordb-erd`. This is how the
|
|
124
131
|
`@tailor-platform/sdk-plugin-tailordb-erd`
|
|
@@ -193,16 +200,17 @@ Commands for managing Tailor Platform applications (work with `tailor.config.ts`
|
|
|
193
200
|
|
|
194
201
|
Commands for managing TailorDB tables, data, and schema migrations.
|
|
195
202
|
|
|
196
|
-
| Command | Description
|
|
197
|
-
| ---------------------------------------------------------------------------- |
|
|
198
|
-
| [tailordb](./cli/tailordb.md#tailordb) | Manage TailorDB tables and data.
|
|
199
|
-
| [tailordb truncate](./cli/tailordb.md#tailordb-truncate) | Truncate (delete all records from) TailorDB tables.
|
|
200
|
-
| [tailordb migration](./cli/tailordb.md#tailordb-migration) | Manage TailorDB schema migrations.
|
|
201
|
-
| [tailordb migration generate](./cli/tailordb.md#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local types and the previous migration snapshot.
|
|
202
|
-
| [tailordb migration script](./cli/tailordb.md#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory.
|
|
203
|
-
| [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number.
|
|
204
|
-
| [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations.
|
|
205
|
-
| [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift).
|
|
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 types and the previous migration snapshot. |
|
|
209
|
+
| [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. |
|
|
210
|
+
| [tailordb migration set](./cli/tailordb.md#tailordb-migration-set) | Set migration checkpoint to a specific number. |
|
|
211
|
+
| [tailordb migration status](./cli/tailordb.md#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
212
|
+
| [tailordb migration sync](./cli/tailordb.md#tailordb-migration-sync) | Sync remote TailorDB schema to a specific migration snapshot (recovery from --no-schema-check drift). |
|
|
213
|
+
| [tailordb migration validate](./cli/tailordb.md#tailordb-migration-validate) | Validate the full migration history and detect schema drift (local types 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. |
|
|
206
214
|
|
|
207
215
|
### [Query Commands](./cli/query.md)
|
|
208
216
|
|
package/docs/configuration.md
CHANGED
|
@@ -41,7 +41,7 @@ export default defineConfig({
|
|
|
41
41
|
|
|
42
42
|
**Disable Introspection**: Disable GraphQL introspection. Default is `false`.
|
|
43
43
|
|
|
44
|
-
**Log Level**: Controls which `console.*` calls are kept when deployment functions are bundled. Supported values are `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, and `"SILENT"`. The default is `"DEBUG"` and keeps all
|
|
44
|
+
**Log Level**: Controls which `console.*` and `logger.*` (from `@tailor-platform/sdk/runtime`) calls are kept when deployment functions are bundled. Supported values are `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, and `"SILENT"`. The default is `"DEBUG"` and keeps all calls. `console.log` is treated as a DEBUG-level call (matching the platform's OpenTelemetry severity mapping), so it is dropped at `"INFO"` and above, alongside `console.debug` and `logger.debug`. `logger.setAttributes` has no severity and is never dropped, regardless of `logLevel`. For production deployments, use `"WARN"` to keep warn/error calls while dropping debug, log, and info calls:
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
47
|
export default defineConfig({
|
|
@@ -52,6 +52,8 @@ export default defineConfig({
|
|
|
52
52
|
|
|
53
53
|
This is a bundle-time setting. Changing `TAILOR_APP_LOG_LEVEL` affects newly bundled deployments; already deployed functions must be redeployed.
|
|
54
54
|
|
|
55
|
+
Only `logger.*` calls made through the SDK's `logger` wrapper (from `@tailor-platform/sdk/runtime` or its `@tailor-platform/sdk/runtime/logger` subpath), or written as `globalThis.tailor.logger.*`, are covered. Other equivalent forms — such as the bare `tailor.logger.*` global or `self.tailor.logger.*` — are not affected by `logLevel`.
|
|
56
|
+
|
|
55
57
|
### Service Configuration
|
|
56
58
|
|
|
57
59
|
Specify glob patterns to load service files:
|
|
@@ -84,6 +86,21 @@ export default defineConfig({
|
|
|
84
86
|
|
|
85
87
|
**Pattern resolution**: `files` and `ignores` patterns are resolved relative to the directory of the `tailor.config.ts` file that declares them, not the directory you run the command from. This matters when deploying [multiple configs](./cli/application.md#deploy) together — each config's patterns only match files under its own directory. If a config's _relative_ patterns match nothing under its own directory, the SDK falls back to resolving them from the directory you ran the command from and logs a warning (this fallback doesn't apply to already-absolute patterns, since their resolution can't change). Update such patterns to be relative to the config's own directory — this fallback will be removed in v2.
|
|
86
88
|
|
|
89
|
+
### Bundling
|
|
90
|
+
|
|
91
|
+
Resolvers, executors, workflow jobs, auth hooks, HTTP adapters, TailorDB hooks and validators, functions, seeds, queries, and migration scripts are all bundled before running locally or deploying. Bundling honors `compilerOptions.paths` aliases declared in a `tsconfig.json`, resolved against the importing file's own nearest `tsconfig.json` (the first one found walking up from that file's directory, following its `extends` chain) — so a path alias works the same whether it is imported directly or through another aliased import.
|
|
92
|
+
|
|
93
|
+
An import that cannot be resolved fails the command instead of shipping a broken bundle, naming the specifier, the importing file, and the tsconfig the build used:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Error [UNRESOLVED_IMPORT]: Could not resolve "@lib/missing" imported from "/path/to/resolver.ts".
|
|
97
|
+
Suggestion: Check that each import path is correct, and that a `compilerOptions.paths`
|
|
98
|
+
entry covering it is declared in the importing file's own tsconfig.json or an ancestor.
|
|
99
|
+
The build used "/path/to/tsconfig.json".
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
If the unresolved specifier is a Node.js built-in (e.g. `fs`, `crypto`, `path`), the suggestion explains that it is not available in the Tailor Platform runtime and, where one exists, names a Web-standard replacement (e.g. the Fetch API instead of `http`/`https`).
|
|
103
|
+
|
|
87
104
|
### External Resources
|
|
88
105
|
|
|
89
106
|
You can reference resources managed by Terraform or other SDK projects to include them in your application's subgraph. External resources are not deployed by this project but can be used for shared access across multiple applications.
|
|
@@ -110,7 +127,8 @@ When using external resources:
|
|
|
110
127
|
- The resource must be deployed and available before referencing it
|
|
111
128
|
- You can combine external resources with locally-defined resources
|
|
112
129
|
- TailorDB type names must remain unique across local and external TailorDB namespaces; `deploy` checks external TailorDB type names before applying changes
|
|
113
|
-
- Destructive operations like `tailordb truncate` (and `
|
|
130
|
+
- Destructive operations like `tailordb truncate` (and `tailor seed apply --truncate`) automatically exclude external resources to prevent accidental data loss in shared resources
|
|
131
|
+
- Subscribing an executor to an external resource's events requires the config that owns the resource in the same `deploy`. Publishing is then enabled automatically, and `deploy` records the dependency so a later deploy without that config asks for confirmation instead of silently turning publishing off
|
|
114
132
|
|
|
115
133
|
### Built-in IdP
|
|
116
134
|
|
|
@@ -271,6 +289,40 @@ export async function main(trx: Transaction, { env }: MigrationContext): Promise
|
|
|
271
289
|
}
|
|
272
290
|
```
|
|
273
291
|
|
|
292
|
+
#### Secret Detection
|
|
293
|
+
|
|
294
|
+
`env` values are deployed as plaintext, so loading a config fails when one of them looks like a credential:
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
✖ Secret detected in 'env' in /path/to/tailor.config.ts:
|
|
298
|
+
- env.SLACK_BOT_TOKEN (matched slack: SLACK_TOKEN)
|
|
299
|
+
https://github.com/secretlint/secretlint/blob/master/packages/%40secretlint/secretlint-rule-slack/README.md#SLACK_TOKEN
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Each finding names the pattern that matched and links to its description, so a value flagged as an AWS account id is distinguishable from one flagged as an AWS secret access key.
|
|
303
|
+
|
|
304
|
+
Move the value to [Secret Manager](./services/secret.md) to fix this. Detection recognizes the credential formats published by common providers, such as Slack, GitHub and AWS.
|
|
305
|
+
|
|
306
|
+
A value that is merely long and random-looking, with no recognizable provider format, is reported as a warning instead and does not fail the command.
|
|
307
|
+
|
|
308
|
+
When detection is wrong about a value, allow it in place with `allowSecretReason`, stating why the value is safe to deploy as plaintext:
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
export default defineConfig({
|
|
312
|
+
name: "my-app",
|
|
313
|
+
env: {
|
|
314
|
+
slackRelayUrl: {
|
|
315
|
+
value: process.env.SLACK_RELAY_URL ?? "",
|
|
316
|
+
allowSecretReason: "Public relay endpoint; the token it proxies stays in Secret Manager.",
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
This silences both the failure and the warning, so it also covers a value that is random-looking without being a credential — say so in the reason. Only string and number values accept an allowance: a boolean is never flagged, so it never needs one.
|
|
323
|
+
|
|
324
|
+
Application code still reads `env.slackRelayUrl` as the value itself: the wrapper only carries the reason and does not reach the deployed application.
|
|
325
|
+
|
|
274
326
|
### Workflow Service
|
|
275
327
|
|
|
276
328
|
Configure Workflow service by specifying glob patterns for workflow files:
|
package/docs/github-actions.md
CHANGED
|
@@ -77,7 +77,7 @@ The generated workflow runs `tailor tailordb erd`, which is provided by the
|
|
|
77
77
|
dev-dependency in your project:
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
npm install -D @tailor-platform/sdk-plugin-tailordb-erd
|
|
80
|
+
npm install -D @tailor-platform/sdk-plugin-tailordb-erd
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
The generated workflow builds one self-contained ERD viewer HTML file for each
|
|
@@ -92,7 +92,7 @@ write PR comments.
|
|
|
92
92
|
|
|
93
93
|
`--erd-preview` is only available for branch targets with the plan job enabled;
|
|
94
94
|
it cannot be combined with `--tag` or `--no-plan`. The namespace list is
|
|
95
|
-
recorded in `.github/tailor
|
|
95
|
+
recorded in `.github/tailor.lock`; the pull request workflow compares the
|
|
96
96
|
head and base lock files so newly added or removed namespaces can still produce
|
|
97
97
|
all-added or all-removed viewer artifacts. Re-run `setup` after adding or
|
|
98
98
|
removing TailorDB namespaces. `setup check` reports drift when the recorded ERD
|