@tailor-platform/sdk 2.29.1 → 2.30.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 (87) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/{application-dalGHdrI.mjs → application-C2bPmmbh.mjs} +1 -1
  3. package/dist/application-D0xNJbag.mjs +199 -0
  4. package/dist/application-D0xNJbag.mjs.map +1 -0
  5. package/dist/brand-C8nMKhJC.mjs.map +1 -1
  6. package/dist/cli/commands/machineuser/list.d.mts +2 -1
  7. package/dist/cli/lib.mjs +1 -1
  8. package/dist/cli/lib.mjs.map +1 -1
  9. package/dist/cli/main.mjs +50 -50
  10. package/dist/cli/main.mjs.map +1 -1
  11. package/dist/cli/shared/error-json.d.mts +2 -0
  12. package/dist/completion/zsh-worker.zsh +1 -1
  13. package/dist/{crashreport-BAG8c7hB.mjs → crashreport-BCIy33Cz.mjs} +2 -2
  14. package/dist/{crashreport-BAG8c7hB.mjs.map → crashreport-BCIy33Cz.mjs.map} +1 -1
  15. package/dist/crashreport-IN6H7GX3.mjs +1 -0
  16. package/dist/errors-BOF68LJ5.mjs +5 -0
  17. package/dist/errors-BOF68LJ5.mjs.map +1 -0
  18. package/dist/{logger-DuaT2zY3.mjs → logger-RgtbhJ83.mjs} +3 -3
  19. package/dist/logger-RgtbhJ83.mjs.map +1 -0
  20. package/dist/plugin/builtin/seed/index.mjs +1 -1
  21. package/dist/{register-ts-hook-CkfKqhJT.mjs → register-ts-hook-CDnN_Jx2.mjs} +84 -86
  22. package/dist/register-ts-hook-CDnN_Jx2.mjs.map +1 -0
  23. package/dist/seed/idp-user-password.d.mts +15 -0
  24. package/dist/seed/index.d.mts +19 -1
  25. package/dist/seed/index.mjs +6 -6
  26. package/dist/seed/index.mjs.map +1 -1
  27. package/dist/{seed-C3P_T_Eh.mjs → seed-Cn-3JApy.mjs} +12 -8
  28. package/dist/seed-Cn-3JApy.mjs.map +1 -0
  29. package/dist/service-9SBPNpK8.mjs +8 -0
  30. package/dist/service-9SBPNpK8.mjs.map +1 -0
  31. package/dist/{service-b1g22NN9.mjs → service-9rwi_I4d.mjs} +2 -2
  32. package/dist/{service-b1g22NN9.mjs.map → service-9rwi_I4d.mjs.map} +1 -1
  33. package/dist/service-Ca1WwyIt.mjs +1 -0
  34. package/docs/cli/application.md +4 -0
  35. package/docs/cli/auth.md +4 -0
  36. package/docs/cli/completion.md +4 -0
  37. package/docs/cli/crashreport.md +4 -0
  38. package/docs/cli/data.md +4 -0
  39. package/docs/cli/executor.md +4 -0
  40. package/docs/cli/function.md +4 -0
  41. package/docs/cli/organization.md +4 -0
  42. package/docs/cli/plugin.md +4 -0
  43. package/docs/cli/query.md +4 -0
  44. package/docs/cli/secret.md +4 -0
  45. package/docs/cli/skills.md +4 -0
  46. package/docs/cli/staticwebsite.md +4 -0
  47. package/docs/cli/tailordb.md +4 -0
  48. package/docs/cli/upgrade.md +4 -0
  49. package/docs/cli/user.md +4 -0
  50. package/docs/cli/workflow.md +4 -0
  51. package/docs/cli/workspace.md +4 -0
  52. package/docs/cli-reference.md +4 -0
  53. package/docs/configuration.md +6 -0
  54. package/docs/data-clone.md +4 -0
  55. package/docs/github-actions.md +10 -0
  56. package/docs/migration/v2.md +4 -0
  57. package/docs/multi-environment.md +4 -0
  58. package/docs/plugin/custom.md +4 -0
  59. package/docs/plugin/frontend.md +4 -0
  60. package/docs/plugin/index.md +4 -0
  61. package/docs/quickstart.md +4 -0
  62. package/docs/runtime.md +4 -0
  63. package/docs/services/aigateway.md +4 -0
  64. package/docs/services/auth.md +4 -0
  65. package/docs/services/executor.md +5 -1
  66. package/docs/services/http-adapter.md +4 -0
  67. package/docs/services/idp.md +4 -0
  68. package/docs/services/resolver.md +4 -0
  69. package/docs/services/secret.md +4 -0
  70. package/docs/services/staticwebsite.md +4 -0
  71. package/docs/services/tailordb/index.md +4 -0
  72. package/docs/services/tailordb/migration.md +4 -0
  73. package/docs/services/workflow.md +4 -0
  74. package/docs/testing.md +4 -0
  75. package/package.json +8 -8
  76. package/dist/application-rWYDAfNU.mjs +0 -200
  77. package/dist/application-rWYDAfNU.mjs.map +0 -1
  78. package/dist/crashreport-BcXuocwI.mjs +0 -1
  79. package/dist/errors-D3qpNHR6.mjs +0 -7
  80. package/dist/errors-D3qpNHR6.mjs.map +0 -1
  81. package/dist/logger-DuaT2zY3.mjs.map +0 -1
  82. package/dist/register-ts-hook-CkfKqhJT.mjs.map +0 -1
  83. package/dist/seed-C3P_T_Eh.mjs.map +0 -1
  84. package/dist/service-CETr0AKY.mjs +0 -7
  85. package/dist/service-CETr0AKY.mjs.map +0 -1
  86. package/dist/service-DREWLYxD.mjs +0 -1
  87. package/docs/migration/v3.md +0 -277
@@ -1,277 +0,0 @@
1
- # Migrating to v3
2
-
3
- <!-- Generated from the sdk-codemod registry. Run `pnpm codemod:docs:update` and edit `packages/sdk-codemod/src/registry.ts` instead of this file. -->
4
-
5
- Run the codemods, then finish anything reported as not migrated automatically:
6
-
7
- ```sh
8
- npx @tailor-platform/sdk-codemod --from <current-version> --to <target-version>
9
- ```
10
-
11
- ## workflow.execJobFunction (imported) removed — use job.start()
12
-
13
- **Migration:** Manual
14
-
15
- `execJobFunction` on the `workflow` value imported from @tailor-platform/sdk/runtime(/workflow) is removed in v3. Calling it directly from a workflow job body to reach another job is not detected as a build-time dependency and has no working use; the target job's own `.start()` method is the only supported way to call it. This does not affect the ambient `tailor.workflow.execJobFunction` global — that's what `.start()` itself compiles down to at build time, and it remains fully supported.
16
-
17
- Before:
18
-
19
- ```ts
20
- import { workflow } from "@tailor-platform/sdk/runtime";
21
-
22
- await workflow.execJobFunction("worker", { id: 1 });
23
- ```
24
-
25
- After:
26
-
27
- ```ts
28
- import { worker } from "./jobs/worker";
29
-
30
- await worker.start({ id: 1 });
31
- ```
32
-
33
- <details>
34
- <summary>Prompt for an AI agent (to perform this migration)</summary>
35
-
36
- ```text
37
- workflow.execJobFunction — the value imported from
38
- @tailor-platform/sdk/runtime or @tailor-platform/sdk/runtime/workflow — is
39
- removed in v3. Replace each call with the target job's own .start() method:
40
- import the WorkflowJob the call names and call <job>.start(args, options)
41
- instead of workflow.execJobFunction("<job-name>", args, options).
42
-
43
- This only removes the re-export from @tailor-platform/sdk/runtime. It does
44
- not affect the ambient tailor.workflow.execJobFunction global, which stays
45
- fully supported and is what .start() itself compiles down to at build time.
46
- This codemod does not rewrite ambient tailor.workflow.execJobFunction(...)
47
- call sites, since removing the import re-export does not affect them — but
48
- if such a call site sits inside workflow job source and calls another job
49
- by name, a separate build-time check already rejects it; migrate that call
50
- to the target job's own .start() method too.
51
-
52
- If the job name passed to execJobFunction is not a string literal (a truly
53
- dynamic dispatch), there is currently no supported replacement — .start()
54
- only targets a statically known job. Flag this case for a human instead of
55
- guessing a rewrite.
56
- ```
57
-
58
- </details>
59
-
60
- ## function test-run → function run
61
-
62
- **Migration:** Partially automatic
63
-
64
- Rename `tailor function test-run` invocations to `tailor function run`. `test-run` remains as a deprecated alias until it is removed in v3.
65
-
66
- Before:
67
-
68
- ```sh
69
- tailor function test-run resolvers/add.ts --arg '{"a":1,"b":2}'
70
- ```
71
-
72
- After:
73
-
74
- ```sh
75
- tailor function run resolvers/add.ts --arg '{"a":1,"b":2}'
76
- ```
77
-
78
- <details>
79
- <summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
80
-
81
- ```text
82
- The `tailor function test-run` subcommand is renamed to `tailor function run`;
83
- the old name is removed in v3. Replace any remaining `function test-run`
84
- invocations the codemod did not rewrite (e.g. wrapped across lines or invoked
85
- through a package runner such as `npx @tailor-platform/sdk`) with
86
- `function run`. Leave prose that merely mentions the old subcommand name
87
- unchanged unless it documents a command to type.
88
- ```
89
-
90
- </details>
91
-
92
- ## relation() toward.type → toward.table
93
-
94
- **Migration:** Partially automatic
95
-
96
- Rename the `.relation()` option `toward.type` to `toward.table`, matching the `db.type()` → `db.table()` rename. The relation's own `type` (its cardinality, e.g. `"n-1"`) is unchanged — only the target-table reference nested under `toward` moves.
97
-
98
- Before:
99
-
100
- ```ts
101
- customerId: db.uuid().relation({
102
- type: "n-1",
103
- toward: { type: customer },
104
- }),
105
- ```
106
-
107
- After:
108
-
109
- ```ts
110
- customerId: db.uuid().relation({
111
- type: "n-1",
112
- toward: { table: customer },
113
- }),
114
- ```
115
-
116
- <details>
117
- <summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
118
-
119
- ```text
120
- In Tailor SDK v3, `.relation()`'s `toward.type` option is renamed to
121
- `toward.table` (it names a target table, not a TypeScript/GraphQL type).
122
- Rename any remaining `toward.type` the codemod did not rewrite (e.g. a
123
- `toward` object reached through a shared variable, spread, or computed
124
- key) to `toward.table`. Do not touch the relation's own outer `type`
125
- property, which is the relation's cardinality (e.g. "n-1", "1-1",
126
- "keyOnly") and keeps its name.
127
- ```
128
-
129
- </details>
130
-
131
- ## defineConfig inlineSourcemap / logLevel → buildOptions
132
-
133
- **Migration:** Partially automatic
134
-
135
- Move the top-level `inlineSourcemap` and `logLevel` of `defineConfig()` into `buildOptions`, which groups the settings that control how functions are bundled. The top-level fields keep working until they are removed in v3; setting the same option in both places is rejected.
136
-
137
- Before:
138
-
139
- ```ts
140
- export default defineConfig({
141
- name: "my-app",
142
- inlineSourcemap: false,
143
- logLevel: "WARN",
144
- });
145
- ```
146
-
147
- After:
148
-
149
- ```ts
150
- export default defineConfig({
151
- name: "my-app",
152
- buildOptions: {
153
- inlineSourcemap: false,
154
- logLevel: "WARN",
155
- },
156
- });
157
- ```
158
-
159
- <details>
160
- <summary>Prompt for an AI agent (to finish the cases the codemod could not migrate)</summary>
161
-
162
- ```text
163
- In Tailor SDK v3, the top-level `inlineSourcemap` and `logLevel` options of
164
- `defineConfig()` from `@tailor-platform/sdk` are removed in favor of
165
- `buildOptions.inlineSourcemap` and `buildOptions.logLevel`. For each flagged
166
- config, move those two properties into a `buildOptions` object (create it if
167
- it does not exist) without changing their values. When the config is built
168
- from a variable or a spread, move them in the object that actually defines
169
- them. If an option is set both at the top level and in `buildOptions`, keep
170
- the value that the deployed app should use and delete the other; the build
171
- rejects a config that sets both. Leave `logLevel` options of other tools
172
- (for example a Vite or Vitest config) unchanged.
173
- ```
174
-
175
- </details>
176
-
177
- ## String file uploads → explicit encoding
178
-
179
- **Migration:** Manual
180
-
181
- String inputs to the SDK `file.upload` and generated `uploadFile` require an explicit `encoding` in v3. Add `encoding: "utf8"` to preserve the previous behavior; use `"base64"` only when decoding the input is intended. Byte inputs are unchanged. This migration requires checking the input type and regenerating file helpers, so it provides review guidance instead of rewriting calls automatically.
182
-
183
- Before:
184
-
185
- ```ts
186
- await file.upload(ns, table, field, id, text, { contentType: "text/plain" });
187
- ```
188
-
189
- After:
190
-
191
- ```ts
192
- await file.upload(ns, table, field, id, text, { contentType: "text/plain", encoding: "utf8" });
193
- ```
194
-
195
- <details>
196
- <summary>Prompt for an AI agent (to perform this migration)</summary>
197
-
198
- ```text
199
- Inspect calls to the imported SDK file.upload (including aliases and destructured upload)
200
- and generated uploadFile helpers, including shared wrappers and option objects.
201
- For string inputs, add encoding: utf8 to preserve existing text storage behavior.
202
- Choose encoding: base64 only if decoding is explicitly intended; never infer it from
203
- the string contents or contentType. Preserve all existing upload options.
204
- Leave byte-only inputs unchanged. For string | byte unions, supplying encoding: utf8
205
- preserves behavior because byte input ignores encoding. Narrow shared options types
206
- so TypeScript can see that encoding is present for strings.
207
- Run tailor generate to regenerate uploadFile helpers instead of editing generated files.
208
- The global tailordb.file.upload does not support this encoding option; switch to the
209
- file import from @tailor-platform/sdk/runtime before using it.
210
- Do not change unrelated upload APIs or already explicit encodings.
211
- ```
212
-
213
- </details>
214
-
215
- ## secrets.get()/getAll() (defineSecretManager) removed — use secretmanager from @tailor-platform/sdk/runtime
216
-
217
- **Migration:** Manual
218
-
219
- The `get()`/`getAll()` methods on the object `defineSecretManager()` returns are removed in v3. Importing that object into a resolver, executor, or workflow file bundles the raw values passed to `defineSecretManager()` into that function's deployed code, which fails to build once any value comes from `process.env`. `secretmanager.getSecret()`/`getSecrets()` from `@tailor-platform/sdk/runtime` read the same secrets without importing the config object.
220
-
221
- Before:
222
-
223
- ```ts
224
- import { secrets } from "../tailor.config";
225
-
226
- const apiKey = await secrets.get("api-keys", "stripe-secret-key");
227
- ```
228
-
229
- After:
230
-
231
- ```ts
232
- import { secretmanager } from "@tailor-platform/sdk/runtime";
233
-
234
- const apiKey = await secretmanager.getSecret("api-keys", "stripe-secret-key");
235
- ```
236
-
237
- Before:
238
-
239
- ```ts
240
- import { secrets } from "../tailor.config";
241
-
242
- const [apiKey, webhookSecret] = await secrets.getAll("api-keys", [
243
- "sendgrid-api-key",
244
- "stripe-secret-key",
245
- ]);
246
- ```
247
-
248
- After:
249
-
250
- ```ts
251
- import { secretmanager } from "@tailor-platform/sdk/runtime";
252
-
253
- const { "sendgrid-api-key": apiKey, "stripe-secret-key": webhookSecret } =
254
- await secretmanager.getSecrets("api-keys", ["sendgrid-api-key", "stripe-secret-key"]);
255
- ```
256
-
257
- <details>
258
- <summary>Prompt for an AI agent (to perform this migration)</summary>
259
-
260
- ```text
261
- `secrets.get()`/`getAll()` on the object `defineSecretManager()` returns are removed in v3.
262
- Replace the import with `import { secretmanager } from "@tailor-platform/sdk/runtime";` and
263
- call `secretmanager.getSecret(vault, name)` in place of `secrets.get(vault, name)`.
264
-
265
- `getAll()` needs more than a rename: `secrets.getAll(vault, names)` returned an array of
266
- values in the same order as `names`, while `secretmanager.getSecrets(vault, names)` returns
267
- a partial record keyed by each requested name (a name with no value is omitted instead of
268
- being `undefined` at its index). Rewrite positional destructuring (`const [a, b] = await
269
- secrets.getAll(v, ["A", "B"])`) into keyed destructuring (`const { A: a, B: b } = await
270
- secretmanager.getSecrets(v, ["A", "B"])`).
271
-
272
- Also review: a `secrets` object re-exported or re-assigned to another name before use, and a
273
- file that already imports something else named `secretmanager` (rename one of the two on
274
- conflict).
275
- ```
276
-
277
- </details>