@tailor-platform/sdk 2.23.0 → 2.25.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 (50) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/dist/application-ChqHuhZW.mjs +1 -0
  3. package/dist/application-DS0XKBtK.mjs +200 -0
  4. package/dist/application-DS0XKBtK.mjs.map +1 -0
  5. package/dist/cli/cache/bundle-cache.d.mts +1 -0
  6. package/dist/cli/commands/deploy/deployment-target.d.mts +1 -0
  7. package/dist/cli/commands/machineuser/list.d.mts +1 -0
  8. package/dist/cli/commands/show.d.mts +13 -1
  9. package/dist/cli/lib.d.mts +2 -2
  10. package/dist/cli/lib.mjs +1 -1
  11. package/dist/cli/lib.mjs.map +1 -1
  12. package/dist/cli/main.mjs +43 -43
  13. package/dist/cli/main.mjs.map +1 -1
  14. package/dist/cli/services/application.d.mts +1 -0
  15. package/dist/cli/services/workflow/bundler.d.mts +2 -1
  16. package/dist/cli/shared/forbidden-runtime-globals.d.mts +1 -0
  17. package/dist/cli/shared/start-context.d.mts +1 -0
  18. package/dist/cli/ts-hook.mjs +3 -3
  19. package/dist/completion/zsh-worker.zsh +3 -3
  20. package/dist/configure/config/types.d.mts +42 -2
  21. package/dist/configure/index.d.mts +2 -2
  22. package/dist/configure/index.mjs +1 -1
  23. package/dist/configure/index.mjs.map +1 -1
  24. package/dist/plugin/index.mjs +1 -1
  25. package/dist/plugin/index.mjs.map +1 -1
  26. package/dist/plugin/types.d.mts +97 -0
  27. package/dist/register-ts-hook-DPAW0Z4M.mjs +924 -0
  28. package/dist/register-ts-hook-DPAW0Z4M.mjs.map +1 -0
  29. package/dist/vitest/mocks/file.d.mts +1 -1
  30. package/docs/cli/application.md +23 -0
  31. package/docs/cli/secret.md +24 -16
  32. package/docs/cli-reference.md +25 -13
  33. package/docs/configuration.md +28 -3
  34. package/docs/github-actions.md +236 -56
  35. package/docs/migration/v3.md +46 -0
  36. package/docs/multi-environment.md +3 -1
  37. package/docs/plugin/custom.md +76 -1
  38. package/docs/plugin/frontend.md +124 -0
  39. package/docs/plugin/index.md +24 -2
  40. package/docs/services/auth.md +2 -0
  41. package/docs/services/secret.md +5 -4
  42. package/docs/services/staticwebsite.md +2 -0
  43. package/docs/services/tailordb-migration.md +1 -1
  44. package/docs/services/workflow.md +3 -0
  45. package/package.json +8 -8
  46. package/dist/application-BtZ8hmx9.mjs +0 -1
  47. package/dist/application-m2G91kKI.mjs +0 -199
  48. package/dist/application-m2G91kKI.mjs.map +0 -1
  49. package/dist/register-ts-hook-ztnEFW6n.mjs +0 -922
  50. package/dist/register-ts-hook-ztnEFW6n.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,94 @@
1
1
  # @tailor-platform/sdk
2
2
 
3
+ ## 2.25.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2449](https://github.com/tailor-platform/sdk/pull/2449) [`e4a0301`](https://github.com/tailor-platform/sdk/commit/e4a0301e24c97f4813f590467e56c50672083abb) Thanks [@toiroakr](https://github.com/toiroakr)! - `tailor open` and `tailor auth-connection open` now always open the new Tailor Platform Console UI, which has replaced the previous UI at `console.tailor.tech`. `tailor open` opens `/workspaces/{workspaceId}/services/applications/{applicationName}` (previously `/workspaces/{workspaceId}/applications/{applicationName}/overview`), and `tailor auth-connection open` opens `/workspaces/{workspaceId}/services/auth-connections` (previously `/workspaces/{workspaceId}/settings/connections`). The `TAILOR_CONSOLE_NEXT` environment variable is no longer read: a leftover `TAILOR_CONSOLE_NEXT=1` no longer redirects the console host to `console-next.`, so it can be removed.
8
+
9
+ - [#2468](https://github.com/tailor-platform/sdk/pull/2468) [`3c87be0`](https://github.com/tailor-platform/sdk/commit/3c87be0cdfbf3fe8b7cdedbdf0d64339b781c25e) Thanks [@toiroakr](https://github.com/toiroakr)! - Add an onDeployed plugin hook with deployed application IDs and URLs, public OAuth client IDs, and publishing to static websites. Hooks run after successful deploys, including deploys without resource changes, and can return structured JSON outputs.
10
+
11
+ - [#2468](https://github.com/tailor-platform/sdk/pull/2468) [`7451944`](https://github.com/tailor-platform/sdk/commit/74519445be5000fcbc0ce0f0bd3c6abfb3275b2f) Thanks [@toiroakr](https://github.com/toiroakr)! - Add `frontendPlugin` from `@tailor-platform/sdk-plugin-frontend` to build and upload frontend assets during `tailor deploy`. Frontend builds can use deployed URLs and public OAuth client IDs as environment variables, and deployment results include uploaded frontend details in `outputs.frontends`.
12
+
13
+ Add deployment hooks and shared context types to `@tailor-platform/sdk`. Successful `tailor deploy --json` results now include `workspaceId` and `applications` with deployed application, Static Website, and AI Gateway URLs, plus public OAuth client IDs, even when no deploy plugins are configured.
14
+
15
+ - [#2505](https://github.com/tailor-platform/sdk/pull/2505) [`3296f08`](https://github.com/tailor-platform/sdk/commit/3296f0874bca8c7f3b158abfa8527a34b7812dde) Thanks [@dqn](https://github.com/dqn)! - More state-changing commands now print a JSON result on stdout under `--json`, so scripts can confirm what changed without parsing stderr: `login`, `logout`, `remove`, `profile delete`, `user switch`, `user pat delete`, `secret vault create`, `authconnection authorize`, `workspace user invite`, `workspace user update`, `workspace ttl set`, `workspace ttl clear`, `crashreport send`, and `tailordb migration script`. Each result carries a `changed` boolean: `true` when the command did work, `false` when it did nothing, such as `logout` when nobody is logged in, `user switch` to the current user, or `workspace ttl clear` on a workspace with no TTL. Output without `--json` is unchanged.
16
+
17
+ - [#2497](https://github.com/tailor-platform/sdk/pull/2497) [`efcca78`](https://github.com/tailor-platform/sdk/commit/efcca789538fde0f7f05d8de4854c771b03ebbf0) Thanks [@tailor-bobbin](https://github.com/apps/tailor-bobbin)! - Include the machine user `id` in `tailor machineuser list` output so machine users can be matched against the invoker id available in resolvers and executors.
18
+
19
+ - [#2486](https://github.com/tailor-platform/sdk/pull/2486) [`caa34b4`](https://github.com/tailor-platform/sdk/commit/caa34b450fb92b8993e6f3c29c890918bb69b1f6) Thanks [@dqn](https://github.com/dqn)! - `tailor secret create` and `tailor secret update` now read the secret value from standard input when `--value` is omitted, keeping it out of shell history and process listings: `printf '%s' "$VALUE" | tailor secret create --vault-name <vault> --name <name>`. The piped value can be up to 128 KiB, and one trailing newline is removed from it. Without `--value`, a terminal or empty standard input fails with `SECRET_VALUE_REQUIRED`.
20
+
21
+ - [#2485](https://github.com/tailor-platform/sdk/pull/2485) [`d06f314`](https://github.com/tailor-platform/sdk/commit/d06f3143341a8c4161989e5cd906bda8fbbf5014) Thanks [@dqn](https://github.com/dqn)! - `tailor show` (and the programmatic `show()`) now also lists each deployed static website defined in `staticWebsites` with its URL and description, and each deployed OAuth2 client defined in `auth`'s `oauth2Clients` with its client ID, so a CI step can read both from one `tailor show --json` call right after `tailor deploy`. Client secrets are never included. Credentials that cannot list OAuth2 clients, such as the workspace viewer role, get a warning and `oauth2Clients: null`, which sets that case apart from an application with no deployed OAuth2 clients.
22
+
23
+ ### Patch Changes
24
+
25
+ - [#2487](https://github.com/tailor-platform/sdk/pull/2487) [`d160c86`](https://github.com/tailor-platform/sdk/commit/d160c865e0d0b9fce550b3e5a12000ef7108d360) Thanks [@dqn](https://github.com/dqn)! - Declining a confirmation prompt now makes the command exit non-zero with a `*_CANCELLED` error code, as `tailor deploy` and `tailor remove` already did, instead of exiting 0 as if the operation had succeeded. This covers `workspace delete` / `restore` / `prune`, `workspace user remove`, `organization folder delete`, `secret create` / `update` / `delete`, `secret vault delete`, `authconnection delete` / `revoke`, `tailordb truncate`, and `tailordb migration generate` / `set` / `sync` / `rebaseline`. For example, `tailor workspace delete` reports `WORKSPACE_DELETION_CANCELLED` when the entered name does not match, and `tailor tailordb migration generate` still generates the other namespaces before reporting `MIGRATION_GENERATE_CANCELLED` for the ones whose breaking changes were declined. Confirmation prompts appear only in an interactive terminal, so runs with `--yes`, in CI, or with `--json` are unaffected. `migrateGenerate()` now rejects with `MIGRATION_GENERATE_CANCELLED` when its prompt is declined, instead of resolving or exiting the process.
26
+
27
+ - [#2484](https://github.com/tailor-platform/sdk/pull/2484) [`7454455`](https://github.com/tailor-platform/sdk/commit/7454455239749dea7cd4660db76769e2fd4ca356) Thanks [@dqn](https://github.com/dqn)! - `tailor init` now exits non-zero when project scaffolding fails, instead of exiting 0. It reports `INIT_FAILED` when `create @tailor-platform/sdk` exits with a non-zero code or is terminated by a signal, and `INIT_SPAWN_FAILED` when the package manager cannot be started.
28
+
29
+ - [#2488](https://github.com/tailor-platform/sdk/pull/2488) [`608b7eb`](https://github.com/tailor-platform/sdk/commit/608b7eb8e46f8a72464b090f355f5a68f2af1243) Thanks [@dqn](https://github.com/dqn)! - Argument errors now follow `--json` and `TAILOR_JSON_OUTPUT`. An unknown option or subcommand, or an option value that fails validation, was printed as plain text even when JSON output was requested, because it happened before the flag took effect. It is now reported as the usual JSON error envelope on stderr with the code `INVALID_ARGUMENTS`, for example `{"error":{"code":"INVALID_ARGUMENTS","message":"Unknown flags: bogus"}}`. `--verbose` now also applies to these errors, adding the stack trace to the envelope or to the plain-text output, as it does for other failures. Otherwise, output without JSON mode is unchanged.
30
+
31
+ - [#2506](https://github.com/tailor-platform/sdk/pull/2506) [`69b3234`](https://github.com/tailor-platform/sdk/commit/69b32346618d022695fa9c7e06676eef34b83843) Thanks [@dqn](https://github.com/dqn)! - List commands now say when `--limit` cut their output short. When more items exist than `--limit` allows, the list is followed by `More results exist beyond --limit N. Raise --limit to see more.` on stderr, so a caller can tell a complete list from a partial one; stdout, including `--json` output, is unchanged. This matters most for `executor jobs`, `function logs`, and `workflow executions`, which list 50 items unless `--limit` says otherwise.
32
+
33
+ - [#2492](https://github.com/tailor-platform/sdk/pull/2492) [`46590a4`](https://github.com/tailor-platform/sdk/commit/46590a460ed382456109b4c440aeb411266a0adb) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update oxc
34
+
35
+ - [#2515](https://github.com/tailor-platform/sdk/pull/2515) [`ef00996`](https://github.com/tailor-platform/sdk/commit/ef00996f2b829726aa108f73aa89c81eaf0eb0ae) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): lock file maintenance
36
+
37
+ - [#2517](https://github.com/tailor-platform/sdk/pull/2517) [`3220bc9`](https://github.com/tailor-platform/sdk/commit/3220bc99ec92b89835f663245d9e896ea5ee62da) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency rolldown to v1.2.12
38
+
39
+ - [#2483](https://github.com/tailor-platform/sdk/pull/2483) [`ae6451e`](https://github.com/tailor-platform/sdk/commit/ae6451e6ab358d058a3cb38503dd222537163e35) Thanks [@toiroakr](https://github.com/toiroakr)! - `tailor setup ci branch`, `tailor setup ci tag`, and `tailor setup ci preview` accept `--dir` more than once. The generated workflow deploys every app to the same workspace in one multi-config run from the repository root, runs the generate check for each app directory (plus seed validation and the migration drift check on branch and tag workflows), and runs its jobs on changes under any of them. `--name` is required when `--dir` is repeated, and the root `package.json` must declare `@tailor-platform/sdk`. With `--erd-preview`, each TailorDB namespace is previewed from the app that owns it.
40
+
41
+ `tailor setup ci branch` and `tailor setup ci preview` also accept `--paths` (repeatable) to run the generated jobs on changes outside the app directories, such as a frontend or shared packages. A pattern supports `*`, `**`, and a leading `!` to exclude paths; other glob characters are rejected.
42
+
43
+ Branch and preview workflows with an app directory other than the repository root no longer filter their `on:` triggers by `paths`. Branch workflows start on every pull request and push, preview workflows on every pull request, and a new `tailor-changes` job skips the plan, deploy, and preview jobs when nothing under the app directories (or `--paths`) changed. Skipped jobs report success, so these checks can be required in branch protection. If the `tailor-changes` job itself fails, those jobs fail instead of being skipped, so a required check cannot pass without them. `setup` remains a beta command, so this ships as an immediate change rather than going through a deprecation cycle.
44
+
45
+ Branch workflows generated with `--erd-preview` now install the project dependencies before building the ERD preview, which the setup step does not do.
46
+
47
+ The workflow template version is bumped, so `tailor setup check` reports every generated target as outdated; run `tailor setup update` to regenerate them. Branch and preview workflows whose `--dir` is not the repository root switch to the `tailor-changes` job described above, and branch workflows generated with `--erd-preview` get the new ERD matrix and install step. Other workflows regenerate identically. `tailor setup update` keeps every app directory and `--paths` pattern of a multi-directory target.
48
+
49
+ - [#2489](https://github.com/tailor-platform/sdk/pull/2489) [`16175f6`](https://github.com/tailor-platform/sdk/commit/16175f6335e72f5775a2f706b65b043be1058a1e) Thanks [@toiroakr](https://github.com/toiroakr)! - You can add `environment:` to a managed job that `tailor setup ci` generates without one (`tailor-tag-guard`, and the `tailor-erd-preview*` jobs from `--erd-preview`), so a step you added there can read that GitHub Environment's secrets, such as a token for installing dependencies from a private registry. `tailor setup check` no longer reports it as a hand edit, and re-running `tailor setup ci` keeps it. The `environment:` of `tailor-plan`, `tailor-deploy`, and the preview jobs still comes from `--environment`.
50
+
51
+ ## 2.24.0
52
+
53
+ ### Minor Changes
54
+
55
+ - [#2459](https://github.com/tailor-platform/sdk/pull/2459) [`72e295b`](https://github.com/tailor-platform/sdk/commit/72e295b422d243fef6e39f73590c34f2f10b68f5) Thanks [@toiroakr](https://github.com/toiroakr)! - When a resolver, executor, or workflow job fails to build with `FORBIDDEN_RUNTIME_GLOBAL` because it references a Node-only global such as `process` or `Buffer`, the error now names where the reference is: the file in your own code, or the installed package (code under `node_modules`). A reference from an installed package can be allowed with the new `buildOptions.allowedRuntimeGlobals` option of `defineConfig()`, keyed by package name, with the globals to allow or `true` for all of them — for example `buildOptions: { allowedRuntimeGlobals: { "@ai-sdk/gateway": ["Buffer"] } }` — once you have confirmed that the package's code referencing it never runs for your use. The error's suggestion shows the entry to add. `buildOptions.allowedRuntimeGlobals` has no effect on your own code.
56
+
57
+ - [#2463](https://github.com/tailor-platform/sdk/pull/2463) [`f708521`](https://github.com/tailor-platform/sdk/commit/f708521ecc5c6e77fa5731d5256bbd483b49dc66) Thanks [@toiroakr](https://github.com/toiroakr)! - `defineConfig()` accepts `buildOptions`, which groups the settings that control how resolvers, executors, workflow jobs, and other functions are bundled: `inlineSourcemap`, `logLevel`, and `allowedRuntimeGlobals`. The top-level `inlineSourcemap` and `logLevel` still work but are deprecated and will be removed in v3; `tailor upgrade` moves them into `buildOptions` with the `v3/define-config-build-options` codemod. Setting the same option both at the top level and in `buildOptions` fails config validation instead of silently using one of them.
58
+
59
+ ```ts
60
+ export default defineConfig({
61
+ name: "my-app",
62
+ buildOptions: {
63
+ inlineSourcemap: false,
64
+ logLevel: "WARN",
65
+ },
66
+ });
67
+ ```
68
+
69
+ ### Patch Changes
70
+
71
+ - [#2475](https://github.com/tailor-platform/sdk/pull/2475) [`10ab737`](https://github.com/tailor-platform/sdk/commit/10ab73789d9865ec2e2fb6658e76b15841219834) Thanks [@toiroakr](https://github.com/toiroakr)! - Generated deploy jobs now expose the deployed workspace as job outputs, so a job of your own can use `needs:` to run tests or deploy extra assets against it:
72
+
73
+ - `tailor setup ci preview`: the `tailor-preview-deploy` job exposes `workspace-id`, `workspace-name`, and `app-url` of the per-PR workspace.
74
+ - `tailor setup ci branch` and `tailor setup ci tag`: the `tailor-deploy` job exposes `workspace-id` and `app-url`.
75
+
76
+ `tailor setup check` reports the template as outdated; run `tailor setup update` to regenerate every target.
77
+
78
+ - [#2464](https://github.com/tailor-platform/sdk/pull/2464) [`978c332`](https://github.com/tailor-platform/sdk/commit/978c332fa0ae0d9256fd2f80d858fb68e0e8c76d) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update secretlint monorepo to v13.0.6
79
+
80
+ - [#2465](https://github.com/tailor-platform/sdk/pull/2465) [`d8222e4`](https://github.com/tailor-platform/sdk/commit/d8222e40ab8f9668d19707bcc76fc7b134a08c26) Thanks [@renovate](https://github.com/apps/renovate)! - chore(deps): update dependency @​types/node to v24.19.0
81
+
82
+ - [#2458](https://github.com/tailor-platform/sdk/pull/2458) [`e982853`](https://github.com/tailor-platform/sdk/commit/e98285358692428fbc07a3713a0cc056f04baffa) Thanks [@toiroakr](https://github.com/toiroakr)! - Deploying a resolver, executor, or workflow no longer fails with `FORBIDDEN_RUNTIME_GLOBAL` for a Node-only global such as `process` that is only used after checking that it exists — for example `if (typeof process !== "undefined") { ... process.env.FOO ... }`, an early exit such as `if (typeof process === "undefined") return;` followed by `process.env.FOO`, or `typeof process < "u" && process.emitWarning(message)`. A global used without such a check is still reported — for example the `Buffer.from(...)` inside `@ai-sdk/gateway`, which the Vercel AI SDK (`ai`) depends on.
83
+
84
+ - [#2457](https://github.com/tailor-platform/sdk/pull/2457) [`be6ffb2`](https://github.com/tailor-platform/sdk/commit/be6ffb2acea8fec95c9b7e90d52d35960cb7be14) Thanks [@toiroakr](https://github.com/toiroakr)! - Fix `workflow.start()` and job `.start()` calls that built and deployed but threw "workflow.start() is rewritten at build time and unavailable in the bundle" at runtime. These calls are now rewritten when:
85
+
86
+ - the workflow file is imported through a `tsconfig.json` `compilerOptions.paths` alias (e.g. `import workflow from "@/workflow/syncGLBalances"`)
87
+ - the workflow is default-exported as the result of a helper function that calls `createWorkflow()` (e.g. `export default module.workflows.syncGLBalances.create(mainJob)`); wrapping the helper result in another `createWorkflow({ ...helperResult, name: "..." })` call is no longer needed
88
+ - the workflow file is imported as a namespace (`import * as wf from "./workflows/sync"; wf.default.start(...)`)
89
+
90
+ A `.start()` call on an import from a workflow file that still cannot be rewritten — such as a helper-created workflow exported under a named export — now fails the build instead of deploying code that throws at runtime. The runtime error for an unrewritten `workflow.start()` also names the workflow.
91
+
3
92
  ## 2.23.0
4
93
 
5
94
  ### Minor Changes
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./application-DS0XKBtK.mjs";export{t as defineApplication,e as generatePluginFilesIfNeeded};