@tailor-platform/sdk 2.34.0 → 2.35.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 (30) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{application-CwpOIOTt.mjs → application-Bj2MtL-d.mjs} +1 -1
  3. package/dist/{application-Nce5z46R.mjs → application-DIsQSnj3.mjs} +25 -25
  4. package/dist/application-DIsQSnj3.mjs.map +1 -0
  5. package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +1 -2
  6. package/dist/cli/commands/tailordb/migrate/generate.d.mts +1 -1
  7. package/dist/cli/lib.mjs +1 -1
  8. package/dist/cli/lib.mjs.map +1 -1
  9. package/dist/cli/main.mjs +37 -37
  10. package/dist/cli/main.mjs.map +1 -1
  11. package/dist/cli/services/application.d.mts +1 -0
  12. package/dist/cli/services/function-bundle.d.mts +1 -0
  13. package/dist/cli/shared/sdk-builder-pure-plugin.d.mts +1 -0
  14. package/dist/completion/zsh-worker.zsh +4 -4
  15. package/dist/{kysely-type-DxyIWXc6.mjs → kysely-type-B0ri1-Xs.mjs} +9 -7
  16. package/dist/kysely-type-B0ri1-Xs.mjs.map +1 -0
  17. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  18. package/dist/{register-ts-hook-CtWJL3EO.mjs → register-ts-hook-CQ7shKO5.mjs} +59 -58
  19. package/dist/register-ts-hook-CQ7shKO5.mjs.map +1 -0
  20. package/docs/cli/tailordb.md +8 -6
  21. package/docs/cli-reference.md +1 -1
  22. package/docs/configuration.md +2 -0
  23. package/docs/services/tailordb/index.md +4 -0
  24. package/docs/services/tailordb/migration.md +12 -7
  25. package/docs/testing.md +2 -2
  26. package/package.json +1 -1
  27. package/dist/application-Nce5z46R.mjs.map +0 -1
  28. package/dist/cli/commands/tailordb/migrate/remote-state.d.mts +0 -1
  29. package/dist/kysely-type-DxyIWXc6.mjs.map +0 -1
  30. package/dist/register-ts-hook-CtWJL3EO.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 2.35.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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.
8
+
9
+ - [#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.
10
+
11
+ ### Patch Changes
12
+
13
+ - [#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.
14
+
15
+ - [#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.
16
+
17
+ - [#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.
18
+
19
+ - [#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.
20
+
21
+ - [#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.
22
+
23
+ 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.
24
+
25
+ - [#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.
26
+
27
+ - [#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.
28
+
3
29
  ## 2.34.0
4
30
 
5
31
  ### Minor Changes
@@ -1 +1 @@
1
- export{t as defineApplication,r as generatePluginFilesIfNeeded}from"./application-Nce5z46R.mjs";
1
+ export{t as defineApplication,r as generatePluginFilesIfNeeded}from"./application-DIsQSnj3.mjs";