@tailor-platform/sdk 2.6.0 → 2.8.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.
Files changed (78) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/{application-CmXOqTaK.mjs → application-D2E3FDfF.mjs} +27 -25
  3. package/dist/application-D2E3FDfF.mjs.map +1 -0
  4. package/dist/application-rySTKrFa.mjs +1 -0
  5. package/dist/cli/commands/deploy/config-id-injector.d.mts +16 -0
  6. package/dist/cli/commands/workspace/create.d.mts +1 -1
  7. package/dist/cli/lib.d.mts +7 -2
  8. package/dist/cli/lib.mjs +1 -1
  9. package/dist/cli/lib.mjs.map +1 -1
  10. package/dist/cli/main.mjs +50 -1145
  11. package/dist/cli/main.mjs.map +1 -1
  12. package/dist/cli/shared/args.d.mts +7 -1
  13. package/dist/cli/shared/beta.d.mts +8 -0
  14. package/dist/cli/shared/client.d.mts +11 -1
  15. package/dist/cli/shared/config.d.mts +13 -0
  16. package/dist/cli/shared/prompt.d.mts +53 -0
  17. package/dist/cli/shared/script-executor.d.mts +1 -1
  18. package/dist/cli/shared/workspace-name.d.mts +10 -1
  19. package/dist/completion/zsh-worker.zsh +10 -206
  20. package/dist/errors-BlX4gUw5.mjs +4 -0
  21. package/dist/errors-BlX4gUw5.mjs.map +1 -0
  22. package/dist/es-builtins-BHCXINQp.mjs +2 -0
  23. package/dist/es-builtins-BHCXINQp.mjs.map +1 -0
  24. package/dist/field-column-type-QMtF6lUp.mjs +2 -0
  25. package/dist/field-column-type-QMtF6lUp.mjs.map +1 -0
  26. package/dist/{kysely-type-BTi3BMtL.mjs → kysely-type-CmvAz1Xj.mjs} +4 -4
  27. package/dist/kysely-type-CmvAz1Xj.mjs.map +1 -0
  28. package/dist/node-builtins-TQHhwNzG.mjs +2 -0
  29. package/dist/node-builtins-TQHhwNzG.mjs.map +1 -0
  30. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  31. package/dist/register-ts-hook-CQuJ7h5G.mjs +642 -0
  32. package/dist/register-ts-hook-CQuJ7h5G.mjs.map +1 -0
  33. package/dist/service-COC9whur.mjs +1 -0
  34. package/dist/{service-CLPMoj9n.mjs → service-CqbQXFDp.mjs} +2 -2
  35. package/dist/{service-CLPMoj9n.mjs.map → service-CqbQXFDp.mjs.map} +1 -1
  36. package/dist/{service-YqDsHmlK.mjs → service-DDon86tM.mjs} +2 -2
  37. package/dist/service-DDon86tM.mjs.map +1 -0
  38. package/dist/service_pb-BNxUPfP3.mjs +2 -0
  39. package/dist/service_pb-BNxUPfP3.mjs.map +1 -0
  40. package/dist/service_pb-D-xFu9Ub.mjs +1 -0
  41. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +12 -0
  42. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +18 -1
  43. package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +130 -1
  44. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +43 -4
  45. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +9 -0
  46. package/dist/vitest/environment.mjs +1 -1
  47. package/dist/vitest/index.mjs +1 -1
  48. package/dist/vitest/mocks/file.d.mts +1 -1
  49. package/dist/workspace_resource_pb-B7S-zx4Z.mjs +2 -0
  50. package/dist/workspace_resource_pb-B7S-zx4Z.mjs.map +1 -0
  51. package/docs/cli-reference.md +0 -16
  52. package/docs/github-actions.md +12 -0
  53. package/docs/services/executor.md +17 -0
  54. package/docs/services/idp.md +1 -1
  55. package/docs/services/resolver.md +1 -1
  56. package/docs/services/tailordb-migration.md +12 -0
  57. package/docs/services/tailordb.md +6 -2
  58. package/docs/services/workflow.md +1 -1
  59. package/package.json +15 -17
  60. package/dist/application-CNeOcaLc.mjs +0 -1
  61. package/dist/application-CmXOqTaK.mjs.map +0 -1
  62. package/dist/errors-DLsQ_-ol.mjs +0 -2
  63. package/dist/errors-DLsQ_-ol.mjs.map +0 -1
  64. package/dist/es-builtins-n3wBv4Sv.mjs +0 -2
  65. package/dist/es-builtins-n3wBv4Sv.mjs.map +0 -1
  66. package/dist/kysely-type-BTi3BMtL.mjs.map +0 -1
  67. package/dist/node-builtins-oBl7EbyV.mjs +0 -2
  68. package/dist/node-builtins-oBl7EbyV.mjs.map +0 -1
  69. package/dist/register-ts-hook-oDA2JLp2.mjs +0 -640
  70. package/dist/register-ts-hook-oDA2JLp2.mjs.map +0 -1
  71. package/dist/service-D7iXk0BT.mjs +0 -1
  72. package/dist/service-YqDsHmlK.mjs.map +0 -1
  73. package/dist/service_pb-DGKCLuAs.mjs +0 -2
  74. package/dist/service_pb-DGKCLuAs.mjs.map +0 -1
  75. package/dist/service_pb-_aeFE-Nv.mjs +0 -1
  76. package/dist/workspace_resource_pb--GeYQPXu.mjs +0 -2
  77. package/dist/workspace_resource_pb--GeYQPXu.mjs.map +0 -1
  78. package/docs/cli/setup.md +0 -210
@@ -386,22 +386,6 @@ Commands for managing crash reports.
386
386
  | [crashreport list](./cli/crashreport.md#crashreport-list) | List local crash report files. |
387
387
  | [crashreport send](./cli/crashreport.md#crashreport-send) | Submit a crash report to help improve the SDK. |
388
388
 
389
- ### [Setup Commands](./cli/setup.md)
390
-
391
- Commands for setting up project infrastructure.
392
-
393
- | Command | Description |
394
- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
395
- | [setup](./cli/setup.md#setup) | Set up repository automation for your project. (beta) |
396
- | [setup action](./cli/setup.md#setup-action) | Generate a per-app composite action for use with setup coordinate (monorepo multi-app deploys). |
397
- | [setup branch](./cli/setup.md#setup-branch) | Generate a branch-target deploy workflow (push to branch triggers deploy). |
398
- | [setup check](./cli/setup.md#setup-check) | Audit generated workflows for drift against the current config/repo (read-only). |
399
- | [setup coordinate](./cli/setup.md#setup-coordinate) | Generate a coordinator workflow that orchestrates multiple --action-generated composite actions. |
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. |
402
- | [setup preview](./cli/setup.md#setup-preview) | Generate a preview workflow (PR open/sync triggers deploy to a per-PR workspace). |
403
- | [setup tag](./cli/setup.md#setup-tag) | Generate a tag-target deploy workflow (tag push triggers deploy). |
404
-
405
389
  ### [Upgrade Commands](./cli/upgrade.md)
406
390
 
407
391
  Commands for upgrading SDK versions with automated code migration.
@@ -7,6 +7,18 @@ application, including deploy workflows and Renovate configuration.
7
7
  > workflow, and the `.github/tailor.lock` schema may change before general
8
8
  > availability.
9
9
 
10
+ ## Installation
11
+
12
+ The `setup` commands are provided by the `@tailor-platform/sdk-plugin-setup` CLI
13
+ plugin. Install it next to the SDK:
14
+
15
+ ```bash
16
+ npm install -D @tailor-platform/sdk-plugin-setup
17
+ ```
18
+
19
+ The Tailor CLI discovers the plugin automatically from `node_modules/.bin` (or
20
+ your `PATH`). Run `tailor plugin list` to confirm it resolves.
21
+
10
22
  ## Quick start
11
23
 
12
24
  Run the command from the root of your SDK project (where `tailor.config.ts`
@@ -44,6 +44,23 @@ export default createExecutor({
44
44
  });
45
45
  ```
46
46
 
47
+ ### Disabling an Executor
48
+
49
+ Set `disabled: true` to deploy an executor without letting it run. The definition stays deployed, and the platform skips dispatching jobs to it.
50
+
51
+ ```typescript
52
+ export default createExecutor({
53
+ name: "user-welcome-paused",
54
+ disabled: true,
55
+ trigger: recordCreatedTrigger({ type: user }),
56
+ operation: { kind: "function", body: async () => {} },
57
+ });
58
+ ```
59
+
60
+ A disabled executor does not count as a subscriber when `deploy` resolves `publishEvents` on the resource its trigger names. Publishing is not enabled on that resource's behalf, and an explicit `publishEvents: false` on it is not rejected. If the resource was publishing only for this executor, the next `deploy` turns publishing back off — so disabling the last subscriber of a shared table changes that table for every config that reads its events.
61
+
62
+ The trigger is still deployed, so it must still name a resource the deploy declares; a disabled executor whose trigger names nothing fails the deploy exactly as an enabled one does.
63
+
47
64
  ## Trigger Types
48
65
 
49
66
  ### Record Triggers
@@ -330,7 +330,7 @@ defineIdp("my-idp", {
330
330
  });
331
331
  ```
332
332
 
333
- **Auto-configuration:** When `publishEvents` is omitted, `deploy` sets it from the executors taking part in the same run: `true` while one of their `idpUser` triggers targets this IdP, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`. Targeting is per-IdP: an executor specifies which IdP it subscribes to via the trigger's `idp` option (required in multi-IdP projects). Set the value explicitly to override:
333
+ **Auto-configuration:** When `publishEvents` is omitted, `deploy` sets it from the executors taking part in the same run: `true` while one of their `idpUser` triggers targets this IdP, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`, as does disabling the last executor that carries one. Targeting is per-IdP: an executor specifies which IdP it subscribes to via the trigger's `idp` option (required in multi-IdP projects). Set the value explicitly to override:
334
334
 
335
335
  - `publishEvents: true`: always publish events.
336
336
  - `publishEvents: false`: never publish events. `deploy` rejects this with an error if an `idpUser` trigger taking part in the same run targets this IdP — either remove `publishEvents: false` or remove the matching trigger.
@@ -310,7 +310,7 @@ createResolver({
310
310
 
311
311
  **Use cases:**
312
312
 
313
- 1. **Auto-detection (recommended)**: Don't set `publishEvents` - `deploy` enables it while an executor taking part in the same run needs it
313
+ 1. **Auto-detection (recommended)**: Don't set `publishEvents` - `deploy` enables it while an executor taking part in the same run needs it. An executor declared with `disabled: true` never runs, so it does not count
314
314
 
315
315
  ```typescript
316
316
  // publishEvents is automatically enabled because an executor uses this resolver
@@ -757,6 +757,18 @@ The migration script runs in a single transaction. For tables with many rows:
757
757
  - Long-running transactions can hit platform timeouts and hold locks. For very large backfills, consider splitting the work across multiple migrations, each operating on a subset.
758
758
  - Add `LIMIT` and resumability (idempotent `where` clauses) so a re-run after a transient failure converges.
759
759
 
760
+ ### Migrations that take longer than a minute
761
+
762
+ Migration scripts run as workflow jobs, so they are not bound by the 60-second
763
+ limit that applies to synchronous script execution. `tailor deploy` waits for
764
+ the migration and reports its logs as usual. Execution time is still bounded —
765
+ a workflow job has its own, far longer, execution-time limit.
766
+
767
+ The script still runs in a single transaction, so the guidance above about
768
+ locks and transaction size continues to apply — prefer splitting a very large
769
+ backfill across several migrations over holding one transaction open for a
770
+ long time.
771
+
760
772
  ## Testing Migrations Locally
761
773
 
762
774
  ### Unit-testing migrate.ts
@@ -69,8 +69,8 @@ db.table("User", "User in the system", {
69
69
  | `db.float()` | Float | number |
70
70
  | [`db.decimal()`](#decimal-fields) | Decimal | string |
71
71
  | `db.bool()` | Boolean | boolean |
72
- | `db.date()` | Date | string |
73
- | `db.datetime()` | DateTime | string \| Date |
72
+ | `db.date()` | Date | Date \| string |
73
+ | `db.datetime()` | DateTime | Date \| string |
74
74
  | `db.time()` | Time | string |
75
75
  | `db.uuid()` | UUID | string |
76
76
  | [`db.enum()`](#enum-fields) | Enum | string |
@@ -519,6 +519,8 @@ db.table("User", {
519
519
  - When `publishEvents: true`, record creation/update/deletion events are published
520
520
  - When not specified, `deploy` sets it from the executors taking part in the same run: `true` while one of them uses this table with `recordCreatedTrigger`, `recordUpdatedTrigger`, or `recordDeletedTrigger`, and `false` once none does. Removing the last such trigger turns publishing back off on the next `deploy`
521
521
  - When explicitly set to `false` while an executor taking part in the same run uses this table, `deploy` fails
522
+ - An executor declared with `disabled: true` never runs, so it does not count as using the table
523
+ - While a `deploy` applies pending migrations, every table in the migrating namespace is read-only: create, update, delete, and bulk-upsert operations are disabled while the existing read setting is preserved. Record event publishing is also switched off so a migration script's writes do not reach executors from the previous deploy. After success, the configured settings take effect. If a later migration fails, settings from the last confirmed checkpoint are restored; an uncommitted migration restores existing tables' prior settings and leaves its newly created tables restricted until a successful retry. Restoration is skipped if the checkpoint number or migration history changed concurrently, or if checkpoint ownership cannot be verified. A table left behind by a failed post-checkpoint deletion also remains read-only for manual recovery
522
524
 
523
525
  **Use cases:**
524
526
 
@@ -563,6 +565,8 @@ db.table("User", {
563
565
 
564
566
  Control which GraphQL operations (`create`, `update`, `delete`, `read`) are exposed for a table. All operations are enabled by default.
565
567
 
568
+ While a `deploy` applies pending migrations, every GraphQL operation — `create`, `update`, `delete`, `read`, and bulk upsert — is switched off across the migrating namespace, so nothing reads or writes an intermediate schema. After success, the configured operations take effect. If a later migration fails, operations from the last confirmed checkpoint are restored; an uncommitted migration restores existing tables' prior operations and leaves its newly created tables restricted until a successful retry. Restoration is skipped if the checkpoint number or migration history changed concurrently.
569
+
566
570
  ```typescript
567
571
  db.table("Order", {
568
572
  status: db.string(),
@@ -208,7 +208,7 @@ export default createWorkflow({
208
208
 
209
209
  Workflows can publish execution lifecycle events for executors. When an executor subscribes to a workflow's events, `deploy` enables publishing automatically. A `workflowExecution*` trigger enables it on the workflow, and a `workflowJobExecution*` trigger enables it on every job that workflow runs. See [Workflow Execution Triggers](./executor.md#workflow-execution-triggers).
210
210
 
211
- Publishing follows the subscription in both directions: removing the last subscribing trigger turns it back off on the next `deploy`.
211
+ Publishing follows the subscription in both directions: removing the last subscribing trigger turns it back off on the next `deploy`, as does disabling the last executor that carries one.
212
212
 
213
213
  Set `publishEvents` explicitly to pin the value instead. Use `true` to publish workflow-level events with no subscribing executor:
214
214
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "2.6.0",
3
+ "version": "2.8.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -149,15 +149,14 @@
149
149
  }
150
150
  },
151
151
  "dependencies": {
152
- "@0no-co/graphql.web": "1.3.3",
152
+ "@0no-co/graphql.web": "1.3.4",
153
153
  "@badgateway/oauth2-client": "3.3.1",
154
154
  "@bufbuild/protobuf": "2.14.0",
155
155
  "@bufbuild/protovalidate": "1.2.0",
156
156
  "@connectrpc/connect": "2.1.2",
157
157
  "@connectrpc/connect-node": "2.1.2",
158
- "@croct/json5-parser": "0.2.2",
159
- "@inquirer/core": "11.2.1",
160
- "@inquirer/prompts": "8.5.2",
158
+ "@inquirer/core": "12.0.0",
159
+ "@inquirer/prompts": "8.6.0",
161
160
  "@jridgewell/trace-mapping": "0.3.31",
162
161
  "@napi-rs/keyring": "1.3.0",
163
162
  "@opentelemetry/api": "1.9.1",
@@ -165,7 +164,7 @@
165
164
  "@opentelemetry/resources": "2.10.0",
166
165
  "@opentelemetry/sdk-trace-node": "2.10.0",
167
166
  "@opentelemetry/semantic-conventions": "1.43.0",
168
- "@oxc-project/types": "0.144.0",
167
+ "@oxc-project/types": "0.147.0",
169
168
  "@secretlint/core": "13.0.4",
170
169
  "@secretlint/secretlint-rule-preset-recommend": "13.0.4",
171
170
  "@standard-schema/spec": "1.1.0",
@@ -183,17 +182,16 @@
183
182
  "globals": "17.11.0",
184
183
  "graphql": "17.0.2",
185
184
  "inflection": "3.0.2",
186
- "json5": "2.2.3",
187
185
  "kysely": "0.29.5",
188
186
  "mime-types": "3.0.2",
189
187
  "open": "11.0.1",
190
- "oxc-parser": "0.144.0",
188
+ "oxc-parser": "0.147.0",
191
189
  "p-limit": "7.3.1",
192
190
  "pathe": "2.0.3",
193
191
  "pgsql-ast-parser": "12.0.2",
194
192
  "pkg-types": "2.3.1",
195
193
  "politty": "0.11.9",
196
- "rolldown": "1.2.4",
194
+ "rolldown": "1.2.5",
197
195
  "semver": "7.8.5",
198
196
  "sql-highlight": "6.1.0",
199
197
  "std-env": "4.2.0",
@@ -204,22 +202,22 @@
204
202
  },
205
203
  "devDependencies": {
206
204
  "@opentelemetry/sdk-trace-base": "2.10.0",
205
+ "@tailor-platform/shared": "^0.0.0",
206
+ "@tailor-platform/tailor-proto": "^0.0.1",
207
207
  "@types/mime-types": "3.0.1",
208
208
  "@types/node": "24.13.3",
209
209
  "@types/semver": "7.8.0",
210
210
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
211
- "@vitest/coverage-v8": "4.1.10",
212
- "eslint-plugin-zod": "4.9.1",
213
- "oxfmt": "0.63.0",
214
- "oxlint": "1.78.0",
211
+ "@vitest/coverage-v8": "4.1.11",
212
+ "eslint-plugin-zod": "4.10.0",
213
+ "oxfmt": "0.65.0",
214
+ "oxlint": "1.80.0",
215
215
  "oxlint-tsgolint": "7.0.2001",
216
216
  "sonda": "0.14.0",
217
217
  "tsdown": "0.22.14",
218
218
  "typescript": "6.0.3",
219
- "vitest": "4.1.10",
220
- "zinfer": "0.2.8",
221
- "@tailor-platform/shared": "^0.0.0",
222
- "@tailor-platform/tailor-proto": "^0.0.1"
219
+ "vitest": "4.1.11",
220
+ "zinfer": "0.2.8"
223
221
  },
224
222
  "peerDependencies": {
225
223
  "@electric-sql/pglite": ">=0.2.0",
@@ -1 +0,0 @@
1
- import{n as e,t}from"./application-CmXOqTaK.mjs";export{t as defineApplication,e as generatePluginFilesIfNeeded};