@tailor-platform/sdk 2.34.0 → 2.36.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 +62 -0
- package/dist/{application-Nce5z46R.mjs → application-BbORWCj-.mjs} +27 -27
- package/dist/application-BbORWCj-.mjs.map +1 -0
- package/dist/{application-CwpOIOTt.mjs → application-DaJbleMi.mjs} +1 -1
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +1 -2
- package/dist/cli/commands/tailordb/migrate/generate.d.mts +1 -1
- package/dist/cli/commands/workspace/create.d.mts +4 -2
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +49 -49
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/services/application.d.mts +1 -0
- package/dist/cli/services/function-bundle.d.mts +1 -0
- package/dist/cli/shared/sdk-builder-pure-plugin.d.mts +1 -0
- package/dist/completion/zsh-worker.zsh +4 -4
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/executor/trigger/webhook.d.mts +1 -0
- package/dist/configure/services/tailordb/schema.d.mts +6 -2
- package/dist/{kysely-type-DxyIWXc6.mjs → kysely-type-B0ri1-Xs.mjs} +9 -7
- package/dist/kysely-type-B0ri1-Xs.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/register-ts-hook-iAcG1dfz.mjs +1057 -0
- package/dist/register-ts-hook-iAcG1dfz.mjs.map +1 -0
- package/dist/schema-BU1aIQ63.mjs.map +1 -1
- package/dist/service-DTrVVaDJ.mjs +1 -0
- package/dist/{service-eeXdVrDK.mjs → service-hIarp2Gl.mjs} +3 -3
- package/dist/service-hIarp2Gl.mjs.map +1 -0
- package/dist/vitest/index.mjs +1 -1
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mocks/file.d.mts +1 -1
- package/dist/vitest/pglite-kysely.d.mts +5 -0
- package/docs/cli/application.md +1 -1
- package/docs/cli/tailordb.md +9 -7
- package/docs/cli/user.md +1 -1
- package/docs/cli/workspace.md +1 -1
- package/docs/cli-reference.md +6 -4
- package/docs/configuration.md +2 -0
- package/docs/services/executor.md +12 -5
- package/docs/services/tailordb/index.md +8 -0
- package/docs/services/tailordb/migration.md +30 -14
- package/docs/testing.md +2 -2
- package/package.json +10 -10
- package/dist/application-Nce5z46R.mjs.map +0 -1
- package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +0 -1
- package/dist/kysely-type-DxyIWXc6.mjs.map +0 -1
- package/dist/register-ts-hook-CtWJL3EO.mjs +0 -1054
- package/dist/register-ts-hook-CtWJL3EO.mjs.map +0 -1
- package/dist/service-DEq_hdht.mjs +0 -1
- package/dist/service-eeXdVrDK.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,67 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 2.36.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2829](https://github.com/tailor-platform/sdk/pull/2829) [`6cbf20b`](https://github.com/tailor-platform/sdk/commit/6cbf20b798a5303a21fd99c6b7726bb342ad8d4b) Thanks [@dqn](https://github.com/dqn)! - **Breaking change (beta)**: A query issued on a `createKyselyPGlite` instance while one of its transactions is open now waits for the transaction to finish. Before, the query ran inside the transaction, and when it failed, the commit silently discarded the transaction's writes. A query on the outer instance from inside the transaction now never finishes and the test times out; run it on `trx` instead.
|
|
8
|
+
|
|
9
|
+
- [#2847](https://github.com/tailor-platform/sdk/pull/2847) [`55e9a94`](https://github.com/tailor-platform/sdk/commit/55e9a94a593406e7790f73b73c3714ba96eda8f7) Thanks [@jackchuka](https://github.com/jackchuka)! - **Breaking change**: `workspace create`, workspace creation during `deploy`, and the programmatic `createWorkspace()` now require an organization. Pass `--organization-id` (or set `TAILOR_PLATFORM_ORGANIZATION_ID`), or set a default organization with `tailor user update --default-organization-id` (not read while `TAILOR_PLATFORM_TOKEN` or `TAILOR_TOKEN` is set). Without one, interactive `deploy` asks which organization to create the workspace in; `workspace create`, `createWorkspace()`, and non-interactive `deploy` fail instead of creating a workspace outside any organization.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2833](https://github.com/tailor-platform/sdk/pull/2833) [`e3e3bac`](https://github.com/tailor-platform/sdk/commit/e3e3bac2e1fdc9b695db38d90e25abe7d40923ce) Thanks [@dqn](https://github.com/dqn)! - Adding a relation to an existing field is now a breaking change in `tailor tailordb migration generate`, and the migration needs a script. It was recorded as non-breaking, so values that point at no record stayed stored, and after deploy the platform rejected any later update of those rows, even one that changes another field. The generated `migrate.ts` finds those values and asks for their new reference with `TODO`, or leaves the elements of an array field to a single `TODO`. The foreign key is applied after the script runs, so the script and the other steps of the migration can update those rows. A relation added to a field inside `db.object()` stays non-breaking. The script generated for a relation retargeted to another table now also works when the relation points at its own table or at a key other than `id`.
|
|
14
|
+
|
|
15
|
+
- [#2831](https://github.com/tailor-platform/sdk/pull/2831) [`2d6217b`](https://github.com/tailor-platform/sdk/commit/2d6217b690bb25c1a825f1c40f8d437bb64d5140) Thanks [@dqn](https://github.com/dqn)! - `.unique()` and `.index()` on a `db.object()` field itself now fail type checking, and `tailor generate` and `tailor deploy` stop with an error naming the field. Before, such a table field failed to deploy with an internal platform error, and such a member of another `db.object()` was deployed without the setting, so in a namespace with `migration.directory` every later deploy stopped with `MIGRATION_REMOTE_DRIFT`. Remove the modifier; for such a member in a namespace with `migration.directory`, then run `tailor tailordb migration generate` and `tailor deploy --no-schema-check` once.
|
|
16
|
+
|
|
17
|
+
- [#2811](https://github.com/tailor-platform/sdk/pull/2811) [`e229992`](https://github.com/tailor-platform/sdk/commit/e229992b0861fe17f306d2e2405104a9cb2c371c) Thanks [@toiroakr](https://github.com/toiroakr)! - TailorDB namespaces that set the same `migration.directory` now fail with `MIGRATION_DIRECTORY_CONFLICT`, naming the namespaces and the shared directory, before any migration command or `tailor deploy` reads or writes migration files. Before, `migration generate` failed with a misleading "Possible rename(s) detected" error, and `migration generate --init` rebuilt the history of every namespace sharing the directory. Give each namespace its own `migration.directory`.
|
|
18
|
+
|
|
19
|
+
- [#2828](https://github.com/tailor-platform/sdk/pull/2828) [`eab9a23`](https://github.com/tailor-platform/sdk/commit/eab9a23368da6b084f0ebc73dd90d38fb3665ca7) Thanks [@dqn](https://github.com/dqn)! - Keep existing migration files when `tailordb migration generate --init` fails to load tables. Previously the migrations were deleted before the tables loaded, so an error such as a syntax error in a table file left the namespace with no migration history. The deletion confirmation now appears after the tables load.
|
|
20
|
+
|
|
21
|
+
- [#2776](https://github.com/tailor-platform/sdk/pull/2776) [`beacc64`](https://github.com/tailor-platform/sdk/commit/beacc643ec0a429736448f9074667106eb09ba1a) Thanks [@toiroakr](https://github.com/toiroakr)! - `tailor tailordb migration status` now reports an error for a namespace whose remote checkpoint is ahead of the latest local migration, for example `0009` on the workspace while the local history ends at `0002`. It used to show that namespace as up to date with no pending migrations. With `maintenanceMode` on, `tailor deploy` also records the maintenance mode with every migration checkpoint of a namespace instead of only the last one, so a deploy that stops after the first of several migrations leaves the record that `tailor tailordb migration resolve` and the next deploy use to lift the maintenance mode.
|
|
22
|
+
|
|
23
|
+
- [#2835](https://github.com/tailor-platform/sdk/pull/2835) [`0d4cd79`](https://github.com/tailor-platform/sdk/commit/0d4cd79db4a02b162bf384881668abec264da539) Thanks [@dqn](https://github.com/dqn)! - `tailor remove` now deletes every resource it lists. Before, when the only remaining resources were sub-resources such as TailorDB types, resolvers, IdP clients, auth configs, or auth connections, it listed them without deleting them. It now also lists workflow job functions; before, they were deleted without being listed, and when nothing else remained they were not deleted at all. Deploy plans, including the `Plan:` summary counts and `--dry-run --json` `changes`, now list each workflow job function deletion as its own `jobFunction` entry, so removing a workflow shows and counts its job functions on separate lines.
|
|
24
|
+
|
|
25
|
+
- [#2822](https://github.com/tailor-platform/sdk/pull/2822) [`b433a27`](https://github.com/tailor-platform/sdk/commit/b433a27e06c7aa1e2bc998b8f703aab6c9d8a7ff) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency @politty/zod to v0.6.3
|
|
26
|
+
|
|
27
|
+
- [#2823](https://github.com/tailor-platform/sdk/pull/2823) [`8712ec6`](https://github.com/tailor-platform/sdk/commit/8712ec645517d29c129b3da72e32bf0d71319b2c) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency execa to v10.2.1
|
|
28
|
+
|
|
29
|
+
- [#2824](https://github.com/tailor-platform/sdk/pull/2824) [`5bf7e69`](https://github.com/tailor-platform/sdk/commit/5bf7e69611437fcf486b9964a7fc30d606cfa62a) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @opentelemetry
|
|
30
|
+
|
|
31
|
+
- [#2826](https://github.com/tailor-platform/sdk/pull/2826) [`2a0e726`](https://github.com/tailor-platform/sdk/commit/2a0e726f3646394e36546eef9e56cfba8d043a09) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update @opentelemetry to v3
|
|
32
|
+
|
|
33
|
+
- [#2842](https://github.com/tailor-platform/sdk/pull/2842) [`8d3d70c`](https://github.com/tailor-platform/sdk/commit/8d3d70c78c22ea6cc4a98891bfddab880c83d830) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency es-toolkit to v1.53.0
|
|
34
|
+
|
|
35
|
+
- [#2836](https://github.com/tailor-platform/sdk/pull/2836) [`95ba73c`](https://github.com/tailor-platform/sdk/commit/95ba73cf72500d0e41252112164f212fa189fad7) Thanks [@toiroakr](https://github.com/toiroakr)! - The Stripe example in the incoming webhook docs now shows where to verify the `stripe-signature` header against `rawBody`, and links to Stripe's verification steps. The docs and the `rawBody` type of `IncomingWebhookArgs` now say that `rawBody` is delivered base64-encoded and has to be decoded to the original bytes before computing a signature.
|
|
36
|
+
|
|
37
|
+
- [#2832](https://github.com/tailor-platform/sdk/pull/2832) [`2c6242a`](https://github.com/tailor-platform/sdk/commit/2c6242a73f47cfb4a782449938b2323487aa0046) Thanks [@dqn](https://github.com/dqn)! - When a `.ts` or `.mts` file the CLI loads cannot be parsed, report a `SYNTAX_INVALID` error naming the file, the line, and the syntax error. For a TailorDB type, resolver, executor, workflow, HTTP adapter, or `function run` file, or a file one of them imports, this replaces `[object Object]`. For a config, or a file it imports, it replaces `UNEXPECTED_ERROR`, and the GitHub Actions annotation is titled `SYNTAX_INVALID` instead of `SyntaxError`.
|
|
38
|
+
|
|
39
|
+
## 2.35.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- [#2810](https://github.com/tailor-platform/sdk/pull/2810) [`41bf7ea`](https://github.com/tailor-platform/sdk/commit/41bf7ea9046e42b5c134b768d74772ea44e82c92) Thanks [@toiroakr](https://github.com/toiroakr)! - `tailor tailordb migration generate --init` now accepts `--namespace <name>` to reset only that namespace's `migrations/` directory and recreate its `0000`. Other namespaces' migration files are left untouched, and the confirmation lists only the target namespace. Without `--namespace`, `--init` still deletes the migrations of every namespace that has migrations configured.
|
|
44
|
+
|
|
45
|
+
- [#2713](https://github.com/tailor-platform/sdk/pull/2713) [`545cf4f`](https://github.com/tailor-platform/sdk/commit/545cf4f0ef433a70ccb87b64d975430da60260b9) Thanks [@toiroakr](https://github.com/toiroakr)! - The PGlite schema from `kyselyTypePlugin` and the `db.pglite.ts` written for a migration now reject deleting a parent, or changing the key a row points at, while a row still points at it through an array field or a field inside a nested object, as the platform does. A test that deletes a parent before the rows pointing at it now fails with `violates foreign key constraint`; delete the child rows first.
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [#2795](https://github.com/tailor-platform/sdk/pull/2795) [`30281c1`](https://github.com/tailor-platform/sdk/commit/30281c1236f8da04e09752a218e8a8f3a9d8ac15) Thanks [@dqn](https://github.com/dqn)! - Fix bundling of a `.start()` call on a local variable that shares its name with an imported workflow or job when the variable is declared in a `switch` case, a named class expression, a namespace, or a static block. The bundler rewrote the call or failed instead of leaving it as written.
|
|
50
|
+
|
|
51
|
+
- [#2817](https://github.com/tailor-platform/sdk/pull/2817) [`9ff6bcf`](https://github.com/tailor-platform/sdk/commit/9ff6bcf721bbd534cfb2e5c9ebe3ba604e74dc69) Thanks [@toiroakr](https://github.com/toiroakr)! - `tailor deploy` no longer fails when it cannot restore the secret vault of an IdP client whose name the platform rejects when reading the client, such as a name shorter than three characters. It prints a warning for that client and continues.
|
|
52
|
+
|
|
53
|
+
- [#2815](https://github.com/tailor-platform/sdk/pull/2815) [`1ee6cc5`](https://github.com/tailor-platform/sdk/commit/1ee6cc5386c8b135630780ca220f860506c0b934) Thanks [@dqn](https://github.com/dqn)! - `tailor tailordb migration generate` no longer writes a `10000` migration directory, which no command reads, after a namespace reaches migration 9999. Before writing, it now checks that every namespace has enough migration numbers left, including with `--data-only` and for a field type conversion, which needs two. If any namespace does not, it fails with `MIGRATION_NUMBER_EXHAUSTED` without writing a migration in any namespace, and the error names the `tailor tailordb migration rebaseline` command to run.
|
|
54
|
+
|
|
55
|
+
- [#2794](https://github.com/tailor-platform/sdk/pull/2794) [`45e5b65`](https://github.com/tailor-platform/sdk/commit/45e5b6540a91a7e622643dff5d29938022225dfd) Thanks [@dqn](https://github.com/dqn)! - Remove `@__PURE__` and `@__NO_SIDE_EFFECTS__` comments from bundled resolvers, executors, workflow jobs, auth hooks, HTTP adapters, and `tailor function run` scripts, and minify the scripts `tailor query` runs, to make them smaller.
|
|
56
|
+
|
|
57
|
+
- [#2793](https://github.com/tailor-platform/sdk/pull/2793) [`ca193b9`](https://github.com/tailor-platform/sdk/commit/ca193b9a87a92bd0c67b5dd397b3ce2ff653de8a) Thanks [@dqn](https://github.com/dqn)! - `tailor deploy` no longer runs a migration's `main` script again after it could not confirm whether an earlier run of it succeeded (`MIGRATION_OUTCOME_UNKNOWN`), including with `--no-schema-check`, in a namespace without a migration checkpoint, and after the deploy process stopped while the script ran. The migration now stays recorded as in progress while its script runs, and until you settle a run the deploy could not confirm, `tailor deploy` stops before changing anything with `MIGRATION_OUTCOME_UNSETTLED`, which reports how the run stands.
|
|
58
|
+
|
|
59
|
+
Settle such a run with `tailor tailordb migration resolve`: `--complete` when it succeeded, `--rollback` when it failed, was canceled, or did not start. `resolve` now reads how the run ended, shows it (`runStatus` under `--json`), and warns when the option you passed does not fit. The earlier advice to run `tailor tailordb migration sync` no longer applies to these runs: `sync` refuses to run while the migration is recorded. `tailor tailordb migration status` reports the run as in progress, with `inProgressMigrationRun: "main"` under `--json`. Earlier SDK versions cannot read this record and refuse to deploy until the migration is settled.
|
|
60
|
+
|
|
61
|
+
- [#2795](https://github.com/tailor-platform/sdk/pull/2795) [`30281c1`](https://github.com/tailor-platform/sdk/commit/30281c1236f8da04e09752a218e8a8f3a9d8ac15) Thanks [@dqn](https://github.com/dqn)! - Field and table definitions written with `db` and `t` in your own code no longer keep an otherwise unused call in bundled resolvers, executors, workflow jobs, auth hooks, and `tailor function run` scripts, which makes bundles that import shared schema modules smaller.
|
|
62
|
+
|
|
63
|
+
- [#2729](https://github.com/tailor-platform/sdk/pull/2729) [`bfe410f`](https://github.com/tailor-platform/sdk/commit/bfe410fbf6b9f9f9b560e79a0326f78a76011f11) Thanks [@toiroakr](https://github.com/toiroakr)! - `.unique()` and `.index()` on a field inside `db.object()` are now applied to the deployed schema. Before, they were recorded in the migration snapshot but sent to the platform as off, so duplicate values were stored, and the next `tailor deploy` of a project with such a field stopped with `MIGRATION_REMOTE_DRIFT`, and `tailor tailordb migration validate` failed the same way. The PGlite schema that `kyselyTypePlugin` and the migration `db.pglite.ts` generate now enforces `.unique()` on such a field too, so local tests reject the duplicates the platform rejects. After upgrading, run `tailor deploy --no-schema-check` once to apply the setting; later deploys need no flag. `.unique()` and `.index()` on a field inside an array of objects (`db.object(..., { array: true })`) now fail with an error, because the platform does not reject duplicate values there. If stored rows already hold duplicate values for a field that gains `.unique()`, that deploy fails with a unique index error and the schema stays unchanged until the duplicates are resolved.
|
|
64
|
+
|
|
3
65
|
## 2.34.0
|
|
4
66
|
|
|
5
67
|
### Minor Changes
|