@tailor-platform/sdk 2.32.0 → 2.34.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 (356) hide show
  1. package/CHANGELOG.md +102 -0
  2. package/dist/ai/index.d.mts +1 -3
  3. package/dist/application-CwpOIOTt.mjs +1 -0
  4. package/dist/application-Nce5z46R.mjs +207 -0
  5. package/dist/application-Nce5z46R.mjs.map +1 -0
  6. package/dist/cli/cache/bundle-cache.d.mts +1 -0
  7. package/dist/cli/commands/api/api-call.d.mts +1 -3
  8. package/dist/cli/commands/deploy/aigateway.d.mts +1 -0
  9. package/dist/cli/commands/deploy/app-id-lock.d.mts +1 -3
  10. package/dist/cli/commands/deploy/application.d.mts +1 -0
  11. package/dist/cli/commands/deploy/auth.d.mts +1 -0
  12. package/dist/cli/commands/deploy/config-id-injector.d.mts +1 -3
  13. package/dist/cli/commands/deploy/confirm.d.mts +1 -0
  14. package/dist/cli/commands/deploy/deploy.d.mts +4 -3
  15. package/dist/cli/commands/deploy/executor.d.mts +1 -0
  16. package/dist/cli/commands/deploy/function-registry-types.d.mts +1 -3
  17. package/dist/cli/commands/deploy/function-registry.d.mts +1 -0
  18. package/dist/cli/commands/deploy/idp.d.mts +1 -0
  19. package/dist/cli/commands/deploy/owned-resource.d.mts +3 -0
  20. package/dist/cli/commands/deploy/resolver.d.mts +1 -0
  21. package/dist/cli/commands/deploy/secret-manager.d.mts +1 -0
  22. package/dist/cli/commands/deploy/staticwebsite.d.mts +2 -0
  23. package/dist/cli/commands/deploy/tailordb/plan.d.mts +1 -0
  24. package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +2 -1
  25. package/dist/cli/commands/deploy/workflow.d.mts +1 -0
  26. package/dist/cli/commands/executor/get.d.mts +0 -2
  27. package/dist/cli/commands/executor/jobs.d.mts +0 -2
  28. package/dist/cli/commands/executor/list.d.mts +1 -3
  29. package/dist/cli/commands/executor/transform.d.mts +1 -3
  30. package/dist/cli/commands/executor/trigger.d.mts +0 -2
  31. package/dist/cli/commands/executor/webhook.d.mts +1 -3
  32. package/dist/cli/commands/function/get.d.mts +0 -2
  33. package/dist/cli/commands/function/list.d.mts +0 -2
  34. package/dist/cli/commands/function/transform.d.mts +1 -3
  35. package/dist/cli/commands/generate/options.d.mts +1 -3
  36. package/dist/cli/commands/generate/seed/bundler.d.mts +1 -3
  37. package/dist/cli/commands/generate/service.d.mts +1 -3
  38. package/dist/cli/commands/machineuser/list.d.mts +1 -3
  39. package/dist/cli/commands/machineuser/token.d.mts +1 -3
  40. package/dist/cli/commands/oauth2client/get.d.mts +1 -3
  41. package/dist/cli/commands/oauth2client/list.d.mts +1 -3
  42. package/dist/cli/commands/oauth2client/transform.d.mts +1 -3
  43. package/dist/cli/commands/organization/folder/create.d.mts +0 -2
  44. package/dist/cli/commands/organization/folder/delete.d.mts +0 -2
  45. package/dist/cli/commands/organization/folder/get.d.mts +0 -2
  46. package/dist/cli/commands/organization/folder/list.d.mts +0 -2
  47. package/dist/cli/commands/organization/folder/update.d.mts +0 -2
  48. package/dist/cli/commands/organization/get.d.mts +0 -2
  49. package/dist/cli/commands/organization/list.d.mts +1 -3
  50. package/dist/cli/commands/organization/transform.d.mts +1 -3
  51. package/dist/cli/commands/organization/tree.d.mts +0 -2
  52. package/dist/cli/commands/organization/update.d.mts +0 -2
  53. package/dist/cli/commands/remove.d.mts +1 -3
  54. package/dist/cli/commands/show.d.mts +0 -2
  55. package/dist/cli/commands/staticwebsite/deploy.d.mts +1 -3
  56. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +1 -3
  57. package/dist/cli/commands/tailordb/migrate/config.d.mts +1 -3
  58. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +0 -2
  59. package/dist/cli/commands/tailordb/migrate/generate.d.mts +1 -3
  60. package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +1 -3
  61. package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +1 -3
  62. package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +1 -3
  63. package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +1 -3
  64. package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +1 -3
  65. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +0 -2
  66. package/dist/cli/commands/tailordb/migrate/types.d.mts +1 -3
  67. package/dist/cli/commands/tailordb/truncate.d.mts +1 -3
  68. package/dist/cli/commands/workflow/executions.d.mts +0 -2
  69. package/dist/cli/commands/workflow/get.d.mts +0 -2
  70. package/dist/cli/commands/workflow/list.d.mts +1 -3
  71. package/dist/cli/commands/workflow/resume.d.mts +1 -3
  72. package/dist/cli/commands/workflow/start.d.mts +0 -2
  73. package/dist/cli/commands/workflow/status.d.mts +1 -3
  74. package/dist/cli/commands/workflow/transform.d.mts +1 -3
  75. package/dist/cli/commands/workflow/wait.d.mts +1 -3
  76. package/dist/cli/commands/workflow/waiter.d.mts +1 -3
  77. package/dist/cli/commands/workspace/app/health.d.mts +0 -2
  78. package/dist/cli/commands/workspace/app/list.d.mts +0 -2
  79. package/dist/cli/commands/workspace/app/transform.d.mts +1 -3
  80. package/dist/cli/commands/workspace/create.d.mts +0 -2
  81. package/dist/cli/commands/workspace/delete.d.mts +0 -2
  82. package/dist/cli/commands/workspace/expiry.d.mts +1 -3
  83. package/dist/cli/commands/workspace/get.d.mts +0 -2
  84. package/dist/cli/commands/workspace/list.d.mts +1 -3
  85. package/dist/cli/commands/workspace/restore.d.mts +0 -2
  86. package/dist/cli/commands/workspace/transform.d.mts +1 -3
  87. package/dist/cli/commands/workspace/user/invite.d.mts +0 -2
  88. package/dist/cli/commands/workspace/user/list.d.mts +0 -2
  89. package/dist/cli/commands/workspace/user/remove.d.mts +0 -2
  90. package/dist/cli/commands/workspace/user/transform.d.mts +1 -3
  91. package/dist/cli/commands/workspace/user/update.d.mts +0 -2
  92. package/dist/cli/lib.d.mts +1 -1
  93. package/dist/cli/lib.mjs +1 -1
  94. package/dist/cli/lib.mjs.map +1 -1
  95. package/dist/cli/main.d.mts +1 -3
  96. package/dist/cli/main.mjs +65 -50
  97. package/dist/cli/main.mjs.map +1 -1
  98. package/dist/cli/query/index.d.mts +0 -2
  99. package/dist/cli/services/application.d.mts +5 -4
  100. package/dist/cli/services/executor/service.d.mts +2 -2
  101. package/dist/cli/services/function-bundle.d.mts +7 -0
  102. package/dist/cli/services/http-adapter/bundler.d.mts +7 -1
  103. package/dist/cli/services/resolver/service.d.mts +2 -1
  104. package/dist/cli/services/workflow/bundler.d.mts +2 -3
  105. package/dist/cli/shared/args.d.mts +0 -2
  106. package/dist/cli/shared/beta.d.mts +1 -3
  107. package/dist/cli/shared/client.d.mts +56 -4
  108. package/dist/cli/shared/command.d.mts +2 -4
  109. package/dist/cli/shared/config-loader.d.mts +2 -4
  110. package/dist/cli/shared/config.d.mts +1 -3
  111. package/dist/cli/shared/context.d.mts +0 -2
  112. package/dist/cli/shared/error-diagnostics.d.mts +1 -3
  113. package/dist/cli/shared/error-json.d.mts +1 -3
  114. package/dist/cli/shared/function-execution.d.mts +1 -3
  115. package/dist/cli/shared/github-actions.d.mts +1 -3
  116. package/dist/cli/shared/logger.d.mts +7 -4
  117. package/dist/cli/shared/platform-bundle-plugin.d.mts +1 -0
  118. package/dist/cli/shared/prompt.d.mts +1 -3
  119. package/dist/cli/shared/readonly-guard.d.mts +0 -2
  120. package/dist/cli/shared/script-executor.d.mts +1 -3
  121. package/dist/cli/shared/seed-chunker.d.mts +1 -3
  122. package/dist/cli/shared/seed-context.d.mts +0 -2
  123. package/dist/cli/shared/sourcemap-sources.d.mts +1 -0
  124. package/dist/cli/shared/tailordb-namespaces.d.mts +1 -3
  125. package/dist/cli/shared/type-generator.d.mts +0 -2
  126. package/dist/cli/shared/workspace-name.d.mts +1 -3
  127. package/dist/cli/ts-hook.d.mts +0 -2
  128. package/dist/cli/ts-hook.mjs +0 -113
  129. package/dist/completion/zsh-worker.zsh +26 -6
  130. package/dist/configure/config/index.d.mts +2 -4
  131. package/dist/configure/config/types.d.mts +27 -4
  132. package/dist/configure/index.d.mts +7 -9
  133. package/dist/configure/index.mjs +1 -1
  134. package/dist/configure/services/aigateway/index.d.mts +0 -2
  135. package/dist/configure/services/aigateway/types.d.mts +0 -2
  136. package/dist/configure/services/auth/index.d.mts +0 -2
  137. package/dist/configure/services/auth/types.d.mts +0 -2
  138. package/dist/configure/services/executor/executor.d.mts +0 -2
  139. package/dist/configure/services/executor/operation.d.mts +0 -2
  140. package/dist/configure/services/executor/trigger/event.d.mts +0 -2
  141. package/dist/configure/services/executor/trigger/index.d.mts +0 -2
  142. package/dist/configure/services/executor/trigger/schedule.d.mts +0 -2
  143. package/dist/configure/services/executor/trigger/webhook.d.mts +1 -3
  144. package/dist/configure/services/http-adapter/http-adapter.d.mts +0 -2
  145. package/dist/configure/services/idp/index.d.mts +0 -2
  146. package/dist/configure/services/idp/permission.d.mts +0 -2
  147. package/dist/configure/services/idp/types.d.mts +0 -2
  148. package/dist/configure/services/index.d.mts +5 -5
  149. package/dist/configure/services/resolver/index.d.mts +1 -1
  150. package/dist/configure/services/resolver/permission.d.mts +0 -2
  151. package/dist/configure/services/resolver/resolver.d.mts +1 -3
  152. package/dist/configure/services/resolver/types.d.mts +1 -3
  153. package/dist/configure/services/secrets/index.d.mts +0 -2
  154. package/dist/configure/services/secrets/types.d.mts +0 -2
  155. package/dist/configure/services/staticwebsite/index.d.mts +6 -3
  156. package/dist/configure/services/staticwebsite/types.d.mts +0 -2
  157. package/dist/configure/services/tailordb/permission.d.mts +0 -2
  158. package/dist/configure/services/tailordb/schema.d.mts +0 -2
  159. package/dist/configure/services/tailordb/types.d.mts +0 -2
  160. package/dist/configure/services/workflow/execution-policy.d.mts +0 -2
  161. package/dist/configure/services/workflow/execution-policy.types.d.mts +0 -2
  162. package/dist/configure/services/workflow/job.d.mts +0 -2
  163. package/dist/configure/services/workflow/wait-point.d.mts +0 -2
  164. package/dist/configure/services/workflow/workflow.d.mts +0 -2
  165. package/dist/configure/types/aigateway-name.d.mts +1 -3
  166. package/dist/configure/types/auth-namespace-name.d.mts +1 -3
  167. package/dist/configure/types/connection-name.d.mts +1 -3
  168. package/dist/configure/types/field.d.mts +1 -3
  169. package/dist/configure/types/field.types.d.mts +0 -2
  170. package/dist/configure/types/idp-name.d.mts +1 -3
  171. package/dist/configure/types/permission-operand.types.d.mts +0 -2
  172. package/dist/configure/types/secret-vault-name.d.mts +1 -3
  173. package/dist/configure/types/type.d.mts +0 -2
  174. package/dist/{crashreport-BCIy33Cz.mjs → crashreport-DGU6lwiX.mjs} +2 -2
  175. package/dist/{crashreport-BCIy33Cz.mjs.map → crashreport-DGU6lwiX.mjs.map} +1 -1
  176. package/dist/crashreport-WsYAWARW.mjs +1 -0
  177. package/dist/{logger-RgtbhJ83.mjs → errors-BXmGBX-7.mjs} +6 -3
  178. package/dist/errors-BXmGBX-7.mjs.map +1 -0
  179. package/dist/field-parse-BQhUAbpM.mjs +2 -0
  180. package/dist/{field-parse-C41e3UAF.mjs.map → field-parse-BQhUAbpM.mjs.map} +1 -1
  181. package/dist/guards-CiFVxoXR.mjs +2 -0
  182. package/dist/guards-CiFVxoXR.mjs.map +1 -0
  183. package/dist/kysely/index.d.mts +0 -2
  184. package/dist/{kysely-type-CBwsdx16.mjs → kysely-type-DxyIWXc6.mjs} +3 -3
  185. package/dist/kysely-type-DxyIWXc6.mjs.map +1 -0
  186. package/dist/manager-B813m43t.mjs +2 -0
  187. package/dist/manager-B813m43t.mjs.map +1 -0
  188. package/dist/parser/service/idp/types.d.mts +1 -3
  189. package/dist/parser/service/tailordb/type-source.d.mts +1 -3
  190. package/dist/parser/service/tailordb/types.d.mts +0 -2
  191. package/dist/plugin/builtin/enum-constants/index.d.mts +0 -2
  192. package/dist/plugin/builtin/enum-constants/index.mjs +2 -2
  193. package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -1
  194. package/dist/plugin/builtin/file-utils/index.d.mts +0 -2
  195. package/dist/plugin/builtin/kysely-type/index.d.mts +0 -2
  196. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  197. package/dist/plugin/builtin/seed/index.d.mts +0 -2
  198. package/dist/plugin/builtin/seed/seed-type-processor.d.mts +1 -3
  199. package/dist/plugin/get-generated-table.d.mts +1 -3
  200. package/dist/plugin/index.mjs +1 -1
  201. package/dist/plugin/types.d.mts +3 -2
  202. package/dist/plugin/with-context.d.mts +1 -3
  203. package/dist/register-ts-hook-CtWJL3EO.mjs +1054 -0
  204. package/dist/register-ts-hook-CtWJL3EO.mjs.map +1 -0
  205. package/dist/repl-editor-DkrCZmmg.mjs +2 -0
  206. package/dist/repl-editor-DkrCZmmg.mjs.map +1 -0
  207. package/dist/runtime/aigateway.d.mts +1 -3
  208. package/dist/runtime/authconnection.d.mts +1 -3
  209. package/dist/runtime/context.d.mts +0 -2
  210. package/dist/runtime/date.d.mts +0 -2
  211. package/dist/runtime/field-parse.d.mts +0 -2
  212. package/dist/runtime/file.d.mts +0 -2
  213. package/dist/runtime/globals.d.mts +0 -2
  214. package/dist/runtime/iconv.d.mts +1 -3
  215. package/dist/runtime/idp.d.mts +1 -3
  216. package/dist/runtime/index.d.mts +1 -3
  217. package/dist/runtime/index.mjs +1 -1
  218. package/dist/runtime/logger.d.mts +1 -3
  219. package/dist/runtime/secretmanager.d.mts +1 -3
  220. package/dist/runtime/temporal.d.mts +0 -2
  221. package/dist/runtime/types.d.mts +0 -2
  222. package/dist/runtime/workflow.d.mts +0 -2
  223. package/dist/{schema-B6hJQWp6.mjs → schema-BU1aIQ63.mjs} +2 -2
  224. package/dist/{schema-B6hJQWp6.mjs.map → schema-BU1aIQ63.mjs.map} +1 -1
  225. package/dist/secret-file-BxZ-J_Nz.mjs +2 -0
  226. package/dist/secret-file-BxZ-J_Nz.mjs.map +1 -0
  227. package/dist/seed/idp-user-password.d.mts +0 -2
  228. package/dist/seed/index.d.mts +0 -2
  229. package/dist/service-CaGmqg0r.mjs +2 -0
  230. package/dist/{service-9rwi_I4d.mjs.map → service-CaGmqg0r.mjs.map} +1 -1
  231. package/dist/service-DEq_hdht.mjs +1 -0
  232. package/dist/{service-9SBPNpK8.mjs → service-eeXdVrDK.mjs} +4 -4
  233. package/dist/service-eeXdVrDK.mjs.map +1 -0
  234. package/dist/service_pb-6EkMfdOb.mjs +2 -0
  235. package/dist/service_pb-6EkMfdOb.mjs.map +1 -0
  236. package/dist/service_pb-CsJKokDl.mjs +1 -0
  237. package/dist/shared/src/color.d.mts +1 -3
  238. package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +1 -3
  239. package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +1 -3
  240. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +1 -3
  241. package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +1 -3
  242. package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +1 -3
  243. package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +1 -3
  244. package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +1 -3
  245. package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +1 -3
  246. package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +1 -3
  247. package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +1 -3
  248. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +1 -3
  249. package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +1 -3
  250. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +1 -3
  251. package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +1 -3
  252. package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +1 -3
  253. package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +1 -3
  254. package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +6 -5
  255. package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +1 -3
  256. package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +1 -3
  257. package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +1 -3
  258. package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +1 -3
  259. package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +1 -3
  260. package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +1 -3
  261. package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +1 -3
  262. package/dist/tailor-proto/src/tailor/v1/security_pb.d.mts +211 -0
  263. package/dist/tailor-proto/src/tailor/v1/security_resource_pb.d.mts +299 -0
  264. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +201 -11
  265. package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +1 -3
  266. package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +1 -3
  267. package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +201 -3
  268. package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +88 -3
  269. package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +1 -3
  270. package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +1 -3
  271. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +1 -3
  272. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +1 -3
  273. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +1 -3
  274. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +1 -3
  275. package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +1 -3
  276. package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +1 -3
  277. package/dist/types/aigateway.generated.d.mts +1 -3
  278. package/dist/types/app-config.generated.d.mts +1 -3
  279. package/dist/types/auth-connection.generated.d.mts +1 -3
  280. package/dist/types/auth.generated.d.mts +1 -3
  281. package/dist/types/executor.generated.d.mts +1 -3
  282. package/dist/types/field.generated.d.mts +1 -3
  283. package/dist/types/helpers.d.mts +1 -3
  284. package/dist/types/http-adapter.generated.d.mts +1 -3
  285. package/dist/types/idp.generated.d.mts +1 -3
  286. package/dist/types/resolver.generated.d.mts +1 -3
  287. package/dist/types/secrets.generated.d.mts +1 -3
  288. package/dist/types/staticwebsite.generated.d.mts +10 -4
  289. package/dist/types/tailordb.generated.d.mts +1 -3
  290. package/dist/types/workflow.generated.d.mts +1 -3
  291. package/dist/utils/test/index.d.mts +1 -3
  292. package/dist/utils/test/index.mjs +1 -1
  293. package/dist/vitest/date-representation.d.mts +1 -3
  294. package/dist/vitest/environment.d.mts +0 -2
  295. package/dist/vitest/index.d.mts +2 -4
  296. package/dist/vitest/index.mjs +1 -1
  297. package/dist/vitest/index.mjs.map +1 -1
  298. package/dist/vitest/migration-steps.d.mts +1 -3
  299. package/dist/vitest/mock-kysely.d.mts +0 -2
  300. package/dist/vitest/mocks/aigateway.d.mts +0 -2
  301. package/dist/vitest/mocks/authconnection.d.mts +0 -2
  302. package/dist/vitest/mocks/file.d.mts +0 -2
  303. package/dist/vitest/mocks/iconv.d.mts +0 -2
  304. package/dist/vitest/mocks/idp.d.mts +0 -2
  305. package/dist/vitest/mocks/logger.d.mts +0 -2
  306. package/dist/vitest/mocks/secretmanager.d.mts +0 -2
  307. package/dist/vitest/mocks/tailordb-pglite.d.mts +0 -2
  308. package/dist/vitest/mocks/tailordb.d.mts +0 -2
  309. package/dist/vitest/mocks/workflow.d.mts +0 -2
  310. package/dist/vitest/pglite-kysely.d.mts +19 -2
  311. package/dist/vitest/pglite-temporal.d.mts +1 -3
  312. package/dist/vitest/setup.d.mts +0 -2
  313. package/dist/vitest/workflow-local.d.mts +0 -2
  314. package/dist/{workspace_resource_pb-CaoM2npP.mjs → workspace_resource_pb-C4CkoYww.mjs} +2 -2
  315. package/dist/workspace_resource_pb-C4CkoYww.mjs.map +1 -0
  316. package/docs/cli/application.md +2 -1
  317. package/docs/cli/tailordb.md +1 -1
  318. package/docs/cli/user.md +5 -5
  319. package/docs/cli/workspace.md +1 -1
  320. package/docs/cli-reference.md +26 -25
  321. package/docs/configuration.md +13 -2
  322. package/docs/github-actions.md +33 -10
  323. package/docs/plugin/custom.md +34 -0
  324. package/docs/plugin/index.md +1 -0
  325. package/docs/services/secret.md +6 -0
  326. package/docs/services/staticwebsite.md +31 -1
  327. package/docs/services/tailordb/index.md +19 -0
  328. package/docs/services/tailordb/migration.md +35 -12
  329. package/docs/testing.md +2 -2
  330. package/package.json +16 -16
  331. package/dist/application-C2bPmmbh.mjs +0 -1
  332. package/dist/application-D0xNJbag.mjs +0 -199
  333. package/dist/application-D0xNJbag.mjs.map +0 -1
  334. package/dist/crashreport-IN6H7GX3.mjs +0 -1
  335. package/dist/errors-BOF68LJ5.mjs +0 -5
  336. package/dist/errors-BOF68LJ5.mjs.map +0 -1
  337. package/dist/field-parse-C41e3UAF.mjs +0 -2
  338. package/dist/guards-yDXyKC9F.mjs +0 -2
  339. package/dist/guards-yDXyKC9F.mjs.map +0 -1
  340. package/dist/kysely-type-CBwsdx16.mjs.map +0 -1
  341. package/dist/logger-RgtbhJ83.mjs.map +0 -1
  342. package/dist/manager-Bk-7vkwd.mjs +0 -2
  343. package/dist/manager-Bk-7vkwd.mjs.map +0 -1
  344. package/dist/register-ts-hook-_dHIREtU.mjs +0 -1050
  345. package/dist/register-ts-hook-_dHIREtU.mjs.map +0 -1
  346. package/dist/repl-editor-DGJBfIt1.mjs +0 -2
  347. package/dist/repl-editor-DGJBfIt1.mjs.map +0 -1
  348. package/dist/secret-file-C9wp_FCX.mjs +0 -2
  349. package/dist/secret-file-C9wp_FCX.mjs.map +0 -1
  350. package/dist/service-9SBPNpK8.mjs.map +0 -1
  351. package/dist/service-9rwi_I4d.mjs +0 -2
  352. package/dist/service-Ca1WwyIt.mjs +0 -1
  353. package/dist/service_pb-Bbu2QSIr.mjs +0 -2
  354. package/dist/service_pb-Bbu2QSIr.mjs.map +0 -1
  355. package/dist/service_pb-urxAIYHT.mjs +0 -1
  356. package/dist/workspace_resource_pb-CaoM2npP.mjs.map +0 -1
@@ -270,7 +270,8 @@ Pass the global `--json` / `-j` flag to get machine-readable output.
270
270
 
271
271
  - `summary` — counts of each change type. `forcedBySdkVersion` counts the updates forced by the SDK version, which are also included in `update`.
272
272
  - `changes` — planned resource changes, each with `action`, `name`, and optional `labels` / `namespace`. An update forced by the SDK version also has `forcedBySdkVersion: true`.
273
- - `warnings` — resources not in config (`type: "unmanaged"`) or secrets with missing values (`type: "skippedSecret"`). Unmanaged resources require confirmation in apply mode (apply is cancelled if declined); skipped secrets are non-blocking.
273
+ - `warnings` — resources not in config (`type: "unmanaged"`), secrets with missing values (`type: "skippedSecret"`), or applications recorded as depending on this deploy but missing from it (`type: "missingDependentApp"`). Unmanaged resources and missing dependent applications require confirmation in apply mode (apply is cancelled if declined); skipped secrets are non-blocking.
274
+ - A `missingDependentApp` entry names the missing application's `appId`, the `reason` it depends on this deploy, and the resource whose event publishing turns off when applying without it (`resourceType` and `name`, plus `namespace` for a TailorDB table or resolver). An entry about a workflow's jobs rather than the workflow itself has `scope: "jobs"`.
274
275
  - `conflicts` — resources owned by another application that conflict with the current config. Require confirmation in apply mode; apply is cancelled if declined.
275
276
  - `resourceType` in `warnings` and `conflicts` is a stable identifier of the resource kind, such as `executor`, `tailordb.service`, or `secret.secret`. The human-readable plan shows a display name instead.
276
277
 
@@ -286,7 +286,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
286
286
 
287
287
  **Notes**
288
288
 
289
- Every local migration file is checked for a compatible format version, and deployed migration history IDs must match the local baseline. Compatibility errors, history mismatches, and metadata lookup failures are reported per namespace and make the command exit non-zero; only a not-yet-deployed namespace is treated as having no applied migrations.
289
+ Local migration files are checked for a valid layout (numbering and required files in each migration directory) and a compatible format version, and deployed migration history IDs must match the local baseline. Invalid or incompatible files, history mismatches, and metadata lookup failures are reported per namespace and make the command exit non-zero; only a not-yet-deployed namespace is treated as having no applied migrations.
290
290
 
291
291
  #### tailordb migration sync
292
292
 
package/docs/cli/user.md CHANGED
@@ -70,10 +70,10 @@ See [Global Options](../cli-reference.md#global-options) for options available t
70
70
 
71
71
  **Commands**
72
72
 
73
- | Command | Description |
74
- | ----------------------------- | ------------------------------------------------------------------------------------- |
75
- | [`auth status`](#auth-status) | Show the active Tailor Platform authentication status without printing tokens. |
76
- | [`auth token`](#auth-token) | Print a valid Tailor Platform access token to stdout, refreshing it first if expired. |
73
+ | Command | Description |
74
+ | ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
75
+ | [`auth status`](#auth-status) | Show the active Tailor Platform authentication status without printing tokens. |
76
+ | [`auth token`](#auth-token) | Print a valid Tailor Platform access token to stdout, refreshing it first if it expires within five minutes. |
77
77
 
78
78
  ### auth status
79
79
 
@@ -95,7 +95,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
95
95
 
96
96
  ### auth token
97
97
 
98
- Print a valid Tailor Platform access token to stdout, refreshing it first if expired.
98
+ Print a valid Tailor Platform access token to stdout, refreshing it first if it expires within five minutes.
99
99
 
100
100
  **Usage**
101
101
 
@@ -253,7 +253,7 @@ Manage when a workspace becomes prunable.
253
253
  **Usage**
254
254
 
255
255
  ```
256
- tailor workspace ttl [command]
256
+ tailor workspace ttl <command>
257
257
  ```
258
258
 
259
259
  See [Global Options](../cli-reference.md#global-options) for options available to all commands.
@@ -20,8 +20,8 @@ tailor <command> [options]
20
20
  | ------------------------------------------- | ----- | --------------------------------------------------- | -------- | ------- | -------------------- |
21
21
  | `--env-file <ENV_FILE>` | `-e` | Path to the environment file (error if not found) | No | - | - |
22
22
  | `--env-file-if-exists <ENV_FILE_IF_EXISTS>` | - | Path to the environment file (ignored if not found) | No | - | - |
23
- | `--verbose` | - | Enable verbose logging | No | `false` | - |
24
- | `--json` | `-j` | Output as JSON | No | `false` | `TAILOR_JSON_OUTPUT` |
23
+ | `--verbose` / `--no-verbose` | - | Enable verbose logging | No | `false` | - |
24
+ | `--json` / `--no-json` | `-j` | Output as JSON | No | `false` | `TAILOR_JSON_OUTPUT` |
25
25
 
26
26
  ### Progress and Detailed Logs
27
27
 
@@ -82,13 +82,13 @@ unexpected argument, or an option value that fails validation (including one set
82
82
  environment variable), and `1` for other failures, including checks a command makes after reading
83
83
  its arguments. A command that only warns about an unknown option or an extra argument keeps
84
84
  running. Cancelling an interactive prompt exits with `130`, and a CLI plugin exits with its own
85
- code. A command group run without a subcommand, such as `tailor` or `tailor tailordb`, can exit
86
- with `0` after printing its help or a warning even when an option is unknown or its value is
87
- invalid, so name the subcommand to rely on `2`.
85
+ code.
88
86
 
89
87
  Authentication failures distinguish missing credentials (`AUTH_TOKEN_NOT_FOUND`), a missing saved
90
88
  user (`AUTH_USER_NOT_FOUND`), an expired token (`AUTH_TOKEN_EXPIRED`), and a failed token refresh
91
- (`AUTH_TOKEN_REFRESH_FAILED`). Login recovery preserves the selected profile. For saved identities,
89
+ (`AUTH_TOKEN_REFRESH_FAILED`). `CONFIG_LOCK_TIMEOUT` means another `tailor` command kept the saved
90
+ credentials locked for too long; `error.context.lockPath` names the lock file to delete if no other
91
+ command is running. Login recovery preserves the selected profile. For saved identities,
92
92
  the next step opens login help so you can reuse the original browser or machine-user login method. Permission and
93
93
  connection failures include guidance in `error.suggestion`; API failures also identify the operation
94
94
  and affected resources in `error.context`.
@@ -107,7 +107,8 @@ excluded from that list.
107
107
  Use `--verbose` to include debug diagnostics and error stack traces. `DEBUG=true` or
108
108
  `RUNNER_DEBUG=1` also enables verbose output, including stacks in JSON errors. GitHub Actions
109
109
  sets `RUNNER_DEBUG=1` when debug logging is enabled, so the same command automatically includes
110
- these details in a debug run. These settings do not enable JSON output; pass `--json` separately.
110
+ these details in a debug run. `--no-verbose` turns verbose output off even when these are set.
111
+ These settings do not enable JSON output; pass `--json` separately.
111
112
 
112
113
  Capture the original failure's stderr and exit code before retrying. Failures before the CLI starts,
113
114
  a rejected `--json` or `TAILOR_JSON_OUTPUT` value, argument errors in the bundled CLI plugins, and
@@ -300,7 +301,7 @@ the plugin does not need to re-implement authentication or re-resolve the active
300
301
  The token, workspace ID, and user are best-effort: whatever the current context can resolve is injected,
301
302
  and auth-free plugins still run when you are not logged in. A long-running plugin (or one started on its
302
303
  own) can obtain a fresh token at any time with `tailor auth token`, which prints a valid access token to
303
- stdout, refreshing it first if it has expired.
304
+ stdout, refreshing it first if it expires within five minutes.
304
305
 
305
306
  ## Commands
306
307
 
@@ -362,23 +363,23 @@ Run ad-hoc SQL/GraphQL queries or enter the interactive REPL.
362
363
 
363
364
  Commands for authentication and user management.
364
365
 
365
- | Command | Description |
366
- | ------------------------------------------------ | ------------------------------------------------------------------------------------- |
367
- | [login](./cli/user.md#login) | Login to Tailor Platform. |
368
- | [logout](./cli/user.md#logout) | Logout from Tailor Platform. |
369
- | [auth](./cli/user.md#auth) | Authentication helpers for scripts and plugins. |
370
- | [auth status](./cli/user.md#auth-status) | Show the active Tailor Platform authentication status without printing tokens. |
371
- | [auth token](./cli/user.md#auth-token) | Print a valid Tailor Platform access token to stdout, refreshing it first if expired. |
372
- | [user](./cli/user.md#user) | Manage Tailor Platform users. |
373
- | [user current](./cli/user.md#user-current) | Show current user. |
374
- | [user list](./cli/user.md#user-list) | List all users. |
375
- | [user pat](./cli/user.md#user-pat) | Manage personal access tokens. |
376
- | [user pat create](./cli/user.md#user-pat-create) | Create a new personal access token. |
377
- | [user pat delete](./cli/user.md#user-pat-delete) | Delete a personal access token. |
378
- | [user pat list](./cli/user.md#user-pat-list) | List all personal access tokens. |
379
- | [user pat update](./cli/user.md#user-pat-update) | Update a personal access token (delete and recreate). |
380
- | [user switch](./cli/user.md#user-switch) | Set current user. |
381
- | [user update](./cli/user.md#user-update) | Set the current user's default organization and folder for new workspaces. |
366
+ | Command | Description |
367
+ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
368
+ | [login](./cli/user.md#login) | Login to Tailor Platform. |
369
+ | [logout](./cli/user.md#logout) | Logout from Tailor Platform. |
370
+ | [auth](./cli/user.md#auth) | Authentication helpers for scripts and plugins. |
371
+ | [auth status](./cli/user.md#auth-status) | Show the active Tailor Platform authentication status without printing tokens. |
372
+ | [auth token](./cli/user.md#auth-token) | Print a valid Tailor Platform access token to stdout, refreshing it first if it expires within five minutes. |
373
+ | [user](./cli/user.md#user) | Manage Tailor Platform users. |
374
+ | [user current](./cli/user.md#user-current) | Show current user. |
375
+ | [user list](./cli/user.md#user-list) | List all users. |
376
+ | [user pat](./cli/user.md#user-pat) | Manage personal access tokens. |
377
+ | [user pat create](./cli/user.md#user-pat-create) | Create a new personal access token. |
378
+ | [user pat delete](./cli/user.md#user-pat-delete) | Delete a personal access token. |
379
+ | [user pat list](./cli/user.md#user-pat-list) | List all personal access tokens. |
380
+ | [user pat update](./cli/user.md#user-pat-update) | Update a personal access token (delete and recreate). |
381
+ | [user switch](./cli/user.md#user-switch) | Set current user. |
382
+ | [user update](./cli/user.md#user-update) | Set the current user's default organization and folder for new workspaces. |
382
383
 
383
384
  ### [Organization Commands](./cli/organization.md)
384
385
 
@@ -64,9 +64,9 @@ export default defineConfig({
64
64
 
65
65
  Entries are only added or overwritten. An entry removed from the config keeps its last deployed value on the platform, and labels the config does not name are left untouched. Because those retained labels count towards the platform's limit of 20 labels per resource, `deploy` reports the overflow and stops before changing the application when the labels it would leave behind exceed that limit. The labels are written when the application itself is deployed, so a config with no TailorDB, Resolver, IdP, or Auth service has no application to carry them.
66
66
 
67
- **Build Options**: `buildOptions` groups the settings that control how resolvers, executors, workflow jobs, and other functions are bundled: `logLevel` (below), `inlineSourcemap` (whether bundled functions embed an inline sourcemap for readable error stack traces; default `true`), `inlineSourcemapDependencySources` (below), `allowedRuntimeGlobals` (see [Node-only globals](#node-only-globals)), and `treeshake` (see [Removing unused code](#removing-unused-code)). The top-level `logLevel` and `inlineSourcemap` fields still work but are deprecated; `tailor upgrade` moves them into `buildOptions`. Setting the same option both at the top level and in `buildOptions` is rejected.
67
+ **Build Options**: `buildOptions` groups the settings that control how resolvers, executors, workflow jobs, and other functions are bundled: `logLevel` (below), `inlineSourcemap` (whether bundled functions embed an inline sourcemap for readable error stack traces; default `true`), `inlineSourcemapDependencySources` and `inlineSourcemapProjectSources` (below), `allowedRuntimeGlobals` (see [Node-only globals](#node-only-globals)), and `treeshake` (see [Removing unused code](#removing-unused-code)). The top-level `logLevel` and `inlineSourcemap` fields still work but are deprecated; `tailor upgrade` moves them into `buildOptions`. Setting the same option both at the top level and in `buildOptions` is rejected.
68
68
 
69
- **Sourcemap Sources** (`buildOptions.inlineSourcemapDependencySources`): Whether the inline sourcemap embeds the source text of installed packages, that is, everything under `node_modules`. The default is `false`: only your own source files are embedded, which makes bundled functions much smaller. Error positions in stack traces resolve to the original files and lines either way. With the default, `tailor function run` and `tailor function logs` show the code snippet for a frame inside an installed package from the package's file on your machine, so the snippet is missing when that file is not installed locally (for `tailor function logs`, run it from the project directory you deployed from). Set it to `true` to embed the source text of installed packages as well, or to a list of package names such as `["kysely", "@scope/lib"]` to embed only those packages. A listed package's own dependencies are not embedded unless they are listed too. It has no effect when `inlineSourcemap` is `false`.
69
+ **Sourcemap Sources** (`buildOptions.inlineSourcemapDependencySources`): Whether the inline sourcemap embeds the source text of installed packages, that is, everything under `node_modules`. The default is `false`: only your own source files are embedded, which makes bundled functions much smaller. Error positions in stack traces resolve to the original files and lines either way. With the default, `tailor function run` and `tailor function logs` show the code snippet for a frame inside an installed package from the package's file on your machine, so the snippet is missing when that file is not installed locally (for `tailor function logs`, run it from the project directory you deployed from). Set it to `true` to embed the source text of installed packages as well, or to a list of package names such as `["kysely", "@scope/lib"]` to embed only those packages. A listed package's own dependencies are not embedded unless they are listed too. Files under `node_modules` that belong to no package, such as a generated client in `node_modules/.prisma`, are embedded only when the option is `true`. It has no effect when `inlineSourcemap` is `false`.
70
70
 
71
71
  ```typescript
72
72
  export default defineConfig({
@@ -79,6 +79,17 @@ export default defineConfig({
79
79
 
80
80
  This is a bundle-time setting. It affects newly bundled deployments; already deployed functions keep the sourcemap they were deployed with until they are redeployed.
81
81
 
82
+ **Project Sourcemap Sources** (`buildOptions.inlineSourcemapProjectSources`): Which of your own source files embed their text in the inline sourcemap. By default all of them do. `include` and `exclude` are globs relative to the directory containing your config file, written without a leading `./` (a `./` prefix is ignored). Only files matching `include` (all files when omitted) and not matching `exclude` keep their text. `**` does not match a dot-directory such as `src/.cache`. Files under `node_modules` are controlled by `inlineSourcemapDependencySources` instead. Error positions still resolve to the original files and lines, but `tailor function run` shows no code snippet for a frame in a file whose text is left out. It has no effect when `inlineSourcemap` is `false`.
83
+
84
+ ```typescript
85
+ export default defineConfig({
86
+ name: "my-app",
87
+ buildOptions: {
88
+ inlineSourcemapProjectSources: { exclude: ["src/generated/**"] },
89
+ },
90
+ });
91
+ ```
92
+
82
93
  **Log Level** (`buildOptions.logLevel`): Controls which `console.*` and `logger.*` (from `@tailor-platform/sdk/runtime`) calls are kept when deployment functions are bundled. Supported values are `"DEBUG"`, `"INFO"`, `"WARN"`, `"ERROR"`, and `"SILENT"`. The default is `"DEBUG"` and keeps all calls. `console.log` is treated as a DEBUG-level call (matching the platform's OpenTelemetry severity mapping), so it is dropped at `"INFO"` and above, alongside `console.debug` and `logger.debug`. `logger.setAttributes` has no severity and is never dropped, regardless of `logLevel`. For production deployments, use `"WARN"` to keep warn/error calls while dropping debug, log, and info calls:
83
94
 
84
95
  ```typescript
@@ -249,6 +249,29 @@ For a preview target, the name can be at most 50 characters: each pull request
249
249
  gets its own workspace named `<name>-pr-<number>`, which must fit in 63
250
250
  characters.
251
251
 
252
+ ### Preview target (per-pull-request workspace)
253
+
254
+ The preview target deploys each pull request to its own workspace and deletes
255
+ that workspace when the pull request is closed:
256
+
257
+ ```bash
258
+ tailor setup ci preview --name my-app --region asia-northeast
259
+ ```
260
+
261
+ Fork pull requests are skipped. Every other pull request gets a preview, draft
262
+ pull requests included. `--require` narrows that to one of:
263
+
264
+ - `--require ready` skips draft pull requests. The preview is deployed when the
265
+ draft is marked ready for review.
266
+ - `--require label` deploys only pull requests labeled `tailor:preview`. A
267
+ labeled draft deploys too, because the label asks for the preview.
268
+
269
+ When `tailor setup update` regenerates a preview target generated before
270
+ `--require` existed, it reads the target as `--require ready`, or as
271
+ `--require label` if it required the label. The first keeps skipping drafts; the
272
+ second now also deploys a labeled draft. To deploy drafts as well, run
273
+ `tailor setup ci preview` again without `--require`.
274
+
252
275
  ## Targeting a workspace
253
276
 
254
277
  The generated `plan` and `deploy` jobs target a workspace by **id**, read from
@@ -385,8 +408,8 @@ A job that runs `tailor` against the workspace needs the machine-user
385
408
  that only uses `app-url`, such as end-to-end tests, does not.
386
409
 
387
410
  The job is skipped whenever `tailor-preview-deploy` is skipped: when a pull
388
- request is closed, for draft and fork pull requests, and for unlabeled ones with
389
- `--require-preview-label`.
411
+ request is closed, for fork pull requests, for draft pull requests with
412
+ `--require ready`, and for unlabeled ones with `--require label`.
390
413
 
391
414
  A preview workspace expires 7 days (`ttl: 7d` on `tailor-preview-deploy`) after
392
415
  the last push to its pull request. When a pull request is closed,
@@ -476,11 +499,11 @@ failed also counts as passing, so list every job of yours whose failure should
476
499
  block merging, not only the last one: above, `seed` is listed because `e2e`
477
500
  needs it.
478
501
 
479
- With `--require-preview-label`, the preview workflow does not start when a pull
480
- request is opened, so its check is not reported until the pull request is
481
- labeled, reopened, or pushed to. A draft pull request skips the preview deploy,
482
- and marking it ready for review does not start the workflow, so the check that
483
- passed while it was a draft stays until the next push. Tag workflows have no
502
+ With `--require label`, the preview workflow does not start when a pull request
503
+ is opened, so its check is not reported until the pull request is labeled,
504
+ reopened, or pushed to. With `--require ready`, a draft pull request skips the
505
+ preview deploy and its check passes; marking it ready for review starts the
506
+ workflow, so the deploy and its check follow right away. Tag workflows have no
484
507
  such job: they run on tags, not on pull requests.
485
508
 
486
509
  ### `.github/tailor.lock`
@@ -758,7 +781,7 @@ Before enabling it, note that:
758
781
  and validation run, `updatedAt` changes, and executors with
759
782
  `recordUpdatedTrigger` fire once per seeded row on every deploy.
760
783
  - Every preview deploy deletes the data reviewers added to the preview
761
- workspace. That is every push, and with `--require-preview-label` also every
784
+ workspace. That is every push, and with `--require label` also every
762
785
  label added to the pull request, since each one redeploys the preview.
763
786
  - A seed failure fails the deploy job and its notification, although the deploy
764
787
  itself went through.
@@ -1016,8 +1039,8 @@ targets it reports.
1016
1039
  Workflows generated by `setup ci branch`, `setup ci tag`, and `setup ci preview`
1017
1040
  self-audit: each contains a `tailor-drift-check` step that
1018
1041
  runs the check in CI. Preview workflows run it alongside each preview deploy,
1019
- so pull requests that deploy no preview (drafts, fork PRs, and unlabeled PRs
1020
- in label-triggered mode) skip the check. A single run audits every target
1042
+ so pull requests that deploy no preview (drafts with `--require ready`, fork
1043
+ PRs, and unlabeled PRs with `--require label`) skip the check. A single run audits every target
1021
1044
  recorded in `.github/tailor.lock`.
1022
1045
 
1023
1046
  Drift findings are advisory by default. Set the repository variable
@@ -90,6 +90,40 @@ interface Plugin<TableConfig = unknown, PluginConfig = unknown> {
90
90
  | `executors` | `PluginGeneratedExecutor[]` | Additional executors to generate |
91
91
  | `extends` | `{ fields?: Record<string, TailorAnyDBField> }` | Fields to add to the source table |
92
92
 
93
+ Resolvers returned by `onTableLoaded` or `onNamespaceLoaded` are loaded, bundled, and deployed to
94
+ the resolver namespace (a `resolver` key in your config) with the same name as the hook's TailorDB
95
+ namespace (a `db` key). These are separate namespaces that only share the name: with
96
+ `db: { main: ... }` and `resolver: { billing: ... }`, generated resolvers go to a `main` resolver
97
+ namespace, not `billing`. If you configure a resolver namespace with that name, generated resolvers
98
+ join its configured files and use its `defaultPermission`. Otherwise, a resolver namespace is created
99
+ automatically. Configure `defaultPermission` to restrict access; without it, generated resolvers are
100
+ accessible to anonymous callers, like regular resolvers with no permission declared. Generating into
101
+ an external resolver namespace or duplicating a resolver name within a namespace fails the build.
102
+
103
+ For example, a namespace hook can return a query using `t` field builders:
104
+
105
+ ```typescript
106
+ onNamespaceLoaded() {
107
+ return {
108
+ resolvers: [{
109
+ name: "greet",
110
+ operation: "query",
111
+ inputFields: { name: t.string() },
112
+ outputFields: { message: t.string() },
113
+ body: 'return { message: `Hello, ${context.input.name}!` };',
114
+ }],
115
+ };
116
+ }
117
+ ```
118
+
119
+ The `body` string contains JavaScript statements with access to `context.input`, `context.caller`,
120
+ `context.invoker`, and `context.env`. It can use `await` and platform globals, but cannot capture
121
+ plugin-local variables. Embed configuration values as literals with `JSON.stringify` when building
122
+ the string. Field validators must also be self-contained: they can use their arguments and standard
123
+ JavaScript globals, and references to other names are rejected during generation. Input validation and date conversion follow the same rules as regular
124
+ resolvers. Invalid field definitions or JavaScript syntax fail the build with the plugin and namespace
125
+ identified in the error.
126
+
93
127
  Tables in `tables` are validated as complete TailorDB table definitions before registration.
94
128
  Fields in `extends.fields` are validated as part of the resulting source table. You can return a
95
129
  table builder directly or a structural copy such as `{ ...db.table(...) }`; a copy is accepted as
@@ -102,6 +102,7 @@ export const plugins = definePlugins(
102
102
  Plugins can generate:
103
103
 
104
104
  - **Tables**: Additional TailorDB tables (e.g., `CustomerHistory`, `Deleted_Customer`)
105
+ - **Resolvers**: Queries and mutations
105
106
  - **Executors**: Event handlers triggered by record changes
106
107
  - **Field Extensions**: Additional fields added to the source table
107
108
  - **Output Files**: TypeScript code and other files via generation-time hooks
@@ -32,6 +32,12 @@ workspace/
32
32
  └── analytics-connection-string
33
33
  ```
34
34
 
35
+ ### Reserved Vault Names
36
+
37
+ Vault names that start with `tailor--` (two hyphens) are reserved in advance for the platform and have no use today. Declaring such a vault in `defineSecretManager()` prints a warning on `tailor deploy` and will become an error in v3. A name that starts with a single `tailor-`, such as `tailor-reports`, is not reserved.
38
+
39
+ `tailor deploy` also creates a vault named `idp-<namespace>-<client>` for each IdP client of your application. A declared vault with exactly that name is an error, because both would write to the same vault.
40
+
35
41
  ### Secrets
36
42
 
37
43
  Secrets are key-value pairs stored within a vault. Secret values are encrypted at rest and only accessible at runtime by authorized services.
@@ -78,7 +78,37 @@ defineStaticWebSite("my-website", {
78
78
 
79
79
  After deploying, use `tailor staticwebsite domain get <domain>` to check domain status and retrieve the CNAME targets required for DNS configuration.
80
80
 
81
- A domain can be associated with only one workspace at a time. To set custom domains only in the workspace that owns the domain, see [Multi-Environment Configuration](../multi-environment.md#settings-that-belong-to-a-single-environment).
81
+ A domain can be associated with only one workspace at a time. To set custom domains only in the workspace that owns the domain, see [Multi-Environment Configuration](../multi-environment.md#settings-that-belong-to-a-single-environment). To hand a domain to another site or workspace without taking it offline, see [Moving a domain](#moving-a-domain).
82
+
83
+ ### Moving a domain
84
+
85
+ A domain already serving traffic can be moved to another static website — in this workspace or another one — without downtime, without reissuing its certificate and without changing DNS. The site that currently holds the domain offers it; the receiving site accepts by listing the domain normally.
86
+
87
+ On the side giving the domain up, replace the plain entry with the destination:
88
+
89
+ ```typescript
90
+ defineStaticWebSite("my-website", {
91
+ customDomains: [{ domain: "app.example.com", transferTo: { workspaceId: "..." } }],
92
+ });
93
+ ```
94
+
95
+ Deploying opens the offer. On the receiving side, list the domain as usual and deploy:
96
+
97
+ ```typescript
98
+ defineStaticWebSite("new-website", {
99
+ customDomains: ["app.example.com"],
100
+ });
101
+ ```
102
+
103
+ That deploy completes the move. The next plan on the giving side reports that the domain moved, and the entry should then be deleted — it describes a move that already happened, not ongoing state.
104
+
105
+ The two deploys must be separate runs, even when both sites live in the same workspace: the receiving side cannot accept an offer that the same run is still opening, and `tailor deploy` says so rather than failing partway.
106
+
107
+ These rules apply while an offer is open:
108
+
109
+ - An offer expires after 7 days. Deploying the entry again after that opens a fresh offer.
110
+ - Neither the domain nor the static website holding it can be removed. Change the entry back to a plain string and deploy to withdraw the offer first; `tailor deploy` and `tailor remove` both refuse before changing anything.
111
+ - An offer takes a moment to become ready. Until it is, the receiving side cannot accept it and its deploy is refused; the giving side's plan says so.
82
112
 
83
113
  ## Type-safe URL References
84
114
 
@@ -218,6 +218,25 @@ const user = db.table("User", {
218
218
  });
219
219
  ```
220
220
 
221
+ A relation can also be set on a field inside `db.object()`. The inner field gets the foreign key constraint only: no index, no unique constraint, and no forward or backward relationship, as with `type: "keyOnly"`.
222
+
223
+ ```typescript
224
+ const order = db.table("Order", {
225
+ items: db.object(
226
+ {
227
+ productId: db.uuid().relation({
228
+ type: "keyOnly",
229
+ toward: { table: product },
230
+ }),
231
+ quantity: db.int(),
232
+ },
233
+ { array: true },
234
+ ),
235
+ });
236
+ ```
237
+
238
+ A relation inside `db.object()` that points at its own table is not yet handled by `tailor seed apply` or by the data copy a table rename generates. Both write rows in batches, and the platform rejects a row whose parent is in the same or a later batch.
239
+
221
240
  Create relations against different fields using `toward.key`:
222
241
 
223
242
  ```typescript
@@ -96,7 +96,7 @@ A typical change cycle:
96
96
  DB types: ./migrations/0001/db.ts
97
97
  ```
98
98
 
99
- If `EDITOR` or `VISUAL` is set, `migrate.ts` opens automatically unless JSON output is enabled.
99
+ If `EDITOR` or `VISUAL` is set, `migrate.ts` opens automatically when the command runs in an interactive terminal outside CI without JSON output. `tailordb migration script` opens the file it scaffolds the same way.
100
100
 
101
101
  3. **Edit `migrate.ts`** to populate data for the new required field:
102
102
 
@@ -462,6 +462,25 @@ tailor deploy --migration-skip-steps main-db/backfillUser,main-db/backfillInvoic
462
462
 
463
463
  Write every step so that running it again is safe: besides the cases above, a step can run a second time when a deploy is interrupted right after it commits. Use `where` clauses that skip rows a step already migrated, as in the example. Rows written while a migration is in progress are not seen by steps that already completed. [Maintenance mode](#maintenance-mode) blocks GraphQL writes but not the writes your resolvers, executors, or workflows make through Kysely, and without it GraphQL clients can write too, so stop such writers until the migration finishes or write steps that tolerate them.
464
464
 
465
+ #### Rolling back instead of resuming
466
+
467
+ By default a failure after another step has completed leaves the migration in progress and the namespace's tables in maintenance mode until you fix the step and deploy again. When you would rather restore the tables first and fix the script afterwards, export `onFailure` next to `steps`:
468
+
469
+ ```typescript
470
+ export const onFailure = "rollback";
471
+
472
+ export const steps = {
473
+ // ...
474
+ } satisfies MigrationSteps;
475
+ ```
476
+
477
+ - `onFailure` is `"resume"` (the default, described above) or `"rollback"`. Write it as `export const onFailure = "rollback"` with one of those two string literals; `tailor tailordb migration validate` and `tailor deploy` reject anything else. A script that runs `main` ignores it.
478
+ - With `"rollback"`, a failed step after another step has completed, and post-migration schema changes that fail after every step completed, roll back the pre-migration schema changes like a failing `main` script: tables that already existed are restored to their previous shape and GraphQL permissions, and tables the migration newly introduced are dropped. The in-progress record is cleared before the schema is rolled back, the tables leave maintenance mode, and the checkpoint is not advanced. `tailor deploy` then fails with the step's error under the code `MIGRATION_ROLLED_BACK`, and its suggestion says the next deploy runs every step again. A migration that an earlier deploy left in progress is rolled back the same way once its script exports `"rollback"`, including the tables and GraphQL permissions its earlier Pre-phase wrote.
479
+ - Steps that already completed stay committed. Their changes to existing fields remain in the database, and nothing is recorded as in progress, so the next deploy runs every step again from the beginning. Every step must be safe to run again, or a rolled-back run applies those changes twice. Do not rely on data a step wrote to a field or table that the rollback removed.
480
+ - If `tailor deploy` cannot tell whether a step ran, or the migration's workflow execution may still be running (for example the connection to it was lost), it does not roll anything back even with `"rollback"`: the migration stays in progress as described for a `main` script below. A migration an earlier deploy left in progress is rolled back only when its earlier run is confirmed to have ended, so a failure before that run is inspected, such as a schema error while applying the Pre-phase, keeps it in progress.
481
+ - If the in-progress record cannot be cleared, `tailor deploy` does not roll the schema back. It logs a warning and keeps the migration in progress with its tables in maintenance mode, because a record that outlives a rollback would make the next deploy resume against a schema its completed steps no longer match. Deploy again to resume it as described above, or roll it back without deploying with `tailor tailordb migration resolve --rollback`.
482
+ - If the schema or GraphQL permission of some tables cannot be rolled back, `tailor deploy` still fails with the step's original error. It also warns `Migration <namespace>/<N> was not rolled back completely` and lists the tables that need manual repair, and separately the tables whose GraphQL permission could not be set back. Check them in the workspace and repair them by hand; deploying again does not release them.
483
+
465
484
  ### Settling a migration that stays in progress
466
485
 
467
486
  When you do not want to resume the migration with another deploy — you abandoned it, or you repaired the data by hand — settle it with `tailor tailordb migration resolve`. Pass exactly one of two options:
@@ -896,7 +915,7 @@ When your branch and main each generated the same number, merging or rebasing st
896
915
 
897
916
  - For non-interactive environments, pass `--yes` to `migration generate` and `--yes` to `apply`. `apply` runs migrations automatically when the `migrations/` directory is configured.
898
917
  - Run `tailor tailordb migration validate` in CI to catch uncommitted migrations, broken migration files, unreviewed generated normalization logic, and remote schema drift before deploying. It exits with a non-zero code when validation fails and supports `--json`. Add `--strict` to also require an explicit acknowledgment (a `migrate.ts` or a recorded `--no-script` reason) for every pending migration that can drop data, so destructive changes cannot merge unnoticed.
899
- - `tailor tailordb migration status` validates file-format compatibility across the full local history, compares its history ID with the deployed namespace, and shows applied and pending migrations for a human-readable comparison. Its exit code is non-zero on incompatible files, migration history mismatches, and remote read errors, so check the output.
918
+ - `tailor tailordb migration status` validates the layout and file-format compatibility of the full local history, compares its history ID with the deployed namespace, and shows applied and pending migrations for a human-readable comparison. Its exit code is non-zero on invalid or incompatible files, migration history mismatches, and remote read errors, so check the output.
900
919
  - Avoid running migrations in parallel against the same workspace — there is no locking. Serialize deploys per environment.
901
920
 
902
921
  ### Resetting a deployed project
@@ -905,10 +924,10 @@ Use `tailor tailordb migration rebaseline` rather than combining `migration gene
905
924
 
906
925
  ## Failure Recovery
907
926
 
908
- A script that exports `steps` follows different rules once one of its steps has completed: the migration stays in progress and the next deploy resumes it. See [Splitting a migration into steps](#splitting-a-migration-into-steps). Otherwise, if the pre-migration phase or `migrate.ts` fails:
927
+ A script that exports `steps` follows different rules once one of its steps has completed: the migration stays in progress and the next deploy resumes it, unless the script exports `onFailure = "rollback"`. See [Splitting a migration into steps](#splitting-a-migration-into-steps) and [Rolling back instead of resuming](#rolling-back-instead-of-resuming). Otherwise, if the pre-migration phase or `migrate.ts` fails:
909
928
 
910
929
  - **The transaction rolls back** for that migration's script. Database changes the script made are undone.
911
- - **The pre-migration schema changes are rolled back** to the prior checkpoint: tables that already existed are restored to their previous shape, and tables the migration newly introduced are dropped. The workspace is left at its prior checkpoint and prior schema — not half-applied.
930
+ - **The pre-migration schema changes are rolled back** to the prior checkpoint: tables that already existed are restored to their previous shape and GraphQL permissions, and tables the migration newly introduced are dropped. The workspace is left at its prior checkpoint and prior schema — not half-applied.
912
931
  - The whole `apply` aborts and the checkpoint label is not bumped. Subsequent migrations in the same run do not execute.
913
932
 
914
933
  The rollback is best-effort per table; if reverting a table fails, a warning is logged and the original migration error is still reported. The next deploy then stops with remote schema drift on that table. Run `tailor tailordb migration validate` to see which tables differ, return the namespace to its checkpoint with `tailor tailordb migration sync <N>`, where `<N>` is the checkpoint `tailor tailordb migration status` reports, and deploy again. `sync` deletes the tables and fields that are not in that migration's snapshot, together with any rows the failed migration wrote to them; the next deploy runs the failed migration again.
@@ -1037,10 +1056,12 @@ npm install -D @electric-sql/pglite
1037
1056
 
1038
1057
  The generated `db.pglite.ts` exports the `CREATE TABLE` script for the same schema `db.ts` types — the tables as the pre-migration phase leaves them while `migrate.ts` runs, including relaxed constraints, renamed fields under both names, and retained removed fields. Run it once on the PGlite instance, stage rows, then run the script in a transaction. `tailor tailordb migration script <N> --with-test` scaffolds this test too when `@electric-sql/pglite` is installed. Type the instance with `Unmigrated<Database>` rather than `Database`: `db.ts` types a column the migration makes required as `T | null` on read but `T` on write (and an enum it narrows as the old values on read but the new ones on write), so that `migrate.ts` cannot write what the migration is removing — which would also stop the test from staging the rows the script has to convert. `Unmigrated` lets every column be written with whatever it can still be read as; `main` still receives a `Transaction<Database>`.
1039
1058
 
1059
+ Relations are enforced as on the platform: a row that points at a parent that does not exist is rejected. Write the records the test starts from inside `prepareFixtures`, which leaves relations unchecked while it runs, so you can stage rows that predate a relation, such as rows whose parent does not exist that the script repairs. Relations are checked again when it returns, so the script itself still cannot write a missing parent. NOT NULL, UNIQUE, and CHECK constraints stay enforced. A relation is left unenforced while the pre-migration schema cannot satisfy it: when a pending type change leaves the field a different type from its target, when the migration retargets the relation to another table, or when the target field's unique constraint is still withheld. How relations on array fields and inside nested objects behave is described under [Real SQL execution with PGlite](../../testing.md#real-sql-execution-with-pglite-mocktailordbwithpglite).
1060
+
1040
1061
  ```typescript
1041
1062
  // migrations/0005/migrate.pglite.test.ts
1042
1063
  import { PGlite } from "@electric-sql/pglite";
1043
- import { createKyselyPGlite, type Unmigrated } from "@tailor-platform/sdk/vitest";
1064
+ import { createKyselyPGlite, prepareFixtures, type Unmigrated } from "@tailor-platform/sdk/vitest";
1044
1065
  import { afterAll, beforeAll, describe, expect, test } from "vitest";
1045
1066
  import { pgliteSchema } from "./db.pglite";
1046
1067
  import { main } from "./migrate";
@@ -1061,13 +1082,15 @@ afterAll(async () => {
1061
1082
  describe("0005 add required email", () => {
1062
1083
  test("backfills null emails and keeps existing ones", async () => {
1063
1084
  const now = new Date();
1064
- await db
1065
- .insertInto("User")
1066
- .values([
1067
- { name: "a", email: null, createdAt: now, updatedAt: now },
1068
- { name: "b", email: "b@example.com", createdAt: now, updatedAt: now },
1069
- ])
1070
- .execute();
1085
+ await prepareFixtures(pglite, async () => {
1086
+ await db
1087
+ .insertInto("User")
1088
+ .values([
1089
+ { name: "a", email: null, createdAt: now, updatedAt: now },
1090
+ { name: "b", email: "b@example.com", createdAt: now, updatedAt: now },
1091
+ ])
1092
+ .execute();
1093
+ });
1071
1094
 
1072
1095
  await db.transaction().execute((trx) => main(trx));
1073
1096
 
package/docs/testing.md CHANGED
@@ -209,12 +209,12 @@ test("upserts against real rows", async () => {
209
209
  });
210
210
  ```
211
211
 
212
- The generated columns follow the Kysely types, not TailorDB's storage: `text` for string and enum fields, `timestamptz` for datetime, `date` and `time` for date and time, `numeric` for decimal, rounded to the configured scale and read back with exactly that many fractional digits, `jsonb` for nested objects (and arrays of them), Postgres arrays for other array fields. `id` is a generated `uuid` primary key, `.unique()` fields and unique `.indexes()` are enforced, so `ON CONFLICT` upserts behave, and `.default()` values become column defaults (`"now"` becomes the current time). `.serial()` fields are assigned by the database from the configured `start`, `maxValue`, and format. Relations are enforced as the platform does: a row that points at a parent that does not exist is rejected with an error containing `violates foreign key constraint`, so create parent rows before their children. This includes relations on array fields. A relation declared on a field inside a nested object is not enforced, as on the platform.
212
+ The generated columns follow the Kysely types, not TailorDB's storage: `text` for string and enum fields, `timestamptz` for datetime, `date` and `time` for date and time, `numeric` for decimal, rounded to the configured scale and read back with exactly that many fractional digits, `jsonb` for nested objects (and arrays of them), Postgres arrays for other array fields. `id` is a generated `uuid` primary key, `.unique()` fields and unique `.indexes()` are enforced, so `ON CONFLICT` upserts behave, and `.default()` values become column defaults (`"now"` becomes the current time). `.serial()` fields are assigned by the database from the configured `start`, `maxValue`, and format. Relations are enforced as the platform does: a row that points at a parent that does not exist is rejected with an error containing `violates foreign key constraint`, so create parent rows before their children. This includes relations on array fields and on fields inside nested objects.
213
213
 
214
214
  What the script cannot reproduce:
215
215
 
216
216
  - Hooks, validations, and permissions do not run. A required field whose value only its own field-level create hook supplies is created nullable, so inserts that omit it succeed; give it a `.default()` if the test reads it back. A field filled by a table-level hook stays `NOT NULL`, as its Kysely type still requires it on insert.
217
- - Relations on array fields, and relations from a field whose type differs from the field it points at (such as a `string` field related to `id`), are checked only when a row is written. Deleting a parent that such a row still points at is rejected by the platform but not by PGlite, and changing the parent's `id` is not checked either, so a test must not expect PGlite to reject them.
217
+ - Relations on array fields and on fields inside nested objects, and relations from a field whose type differs from the field it points at (such as a `string` field related to `id`), are checked only when a row is written. Deleting a parent that such a row still points at is rejected by the platform but not by PGlite, and changing the parent's `id` is not checked either, so a test must not expect PGlite to reject them.
218
218
  - Serial formats are reproduced for a single `%d`, `%x`, or `%X` specifier with an optional zero-padded width; an octal `%o` format fails generation with an error naming the field.
219
219
  - `gapless` is not reproduced: the numbers come from a sequence, so an insert that fails still uses up its number.
220
220
  - A date or datetime inside a nested object reads back as a string from `jsonb`, not a `Date`, or a `Temporal.PlainDate` or `Temporal.Instant` under `kyselyTypePlugin({ temporal: true })`, although the platform returns those types.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "2.32.0",
3
+ "version": "2.34.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -160,25 +160,25 @@
160
160
  "@bufbuild/protovalidate": "1.3.0",
161
161
  "@connectrpc/connect": "2.2.0",
162
162
  "@connectrpc/connect-node": "2.2.0",
163
- "@inquirer/core": "12.0.4",
164
- "@inquirer/prompts": "8.7.3",
163
+ "@inquirer/core": "12.0.5",
164
+ "@inquirer/prompts": "8.7.4",
165
165
  "@jridgewell/trace-mapping": "0.3.31",
166
- "@napi-rs/keyring": "2.1.1",
166
+ "@napi-rs/keyring": "2.1.2",
167
167
  "@opentelemetry/api": "1.9.1",
168
168
  "@opentelemetry/context-async-hooks": "2.12.0",
169
169
  "@opentelemetry/exporter-trace-otlp-proto": "0.223.0",
170
170
  "@opentelemetry/resources": "2.12.0",
171
171
  "@opentelemetry/sdk-trace": "2.12.0",
172
172
  "@opentelemetry/semantic-conventions": "1.43.0",
173
- "@oxc-project/types": "0.154.0",
174
- "@politty/zod": "0.5.2",
173
+ "@oxc-project/types": "0.155.0",
174
+ "@politty/zod": "0.6.1",
175
175
  "@secretlint/core": "13.0.7",
176
176
  "@secretlint/secretlint-rule-preset-recommend": "13.0.7",
177
177
  "@standard-schema/spec": "1.1.0",
178
178
  "@tailor-platform/function-kysely-tailordb": "0.1.3",
179
179
  "@toiroakr/read-multiline": "0.4.3",
180
180
  "@urql/core": "6.0.3",
181
- "amaro": "1.2.1",
181
+ "amaro": "1.2.2",
182
182
  "confbox": "0.3.1",
183
183
  "date-fns": "4.4.0",
184
184
  "es-toolkit": "1.52.0",
@@ -192,12 +192,12 @@
192
192
  "lines-db": "0.18.0",
193
193
  "mime-types": "3.0.2",
194
194
  "open": "11.0.4",
195
- "oxc-parser": "0.154.0",
195
+ "oxc-parser": "0.155.0",
196
196
  "p-limit": "7.3.3",
197
197
  "pathe": "2.0.3",
198
198
  "pgsql-ast-parser": "12.0.2",
199
- "pkg-types": "2.3.3",
200
- "rolldown": "1.2.14",
199
+ "pkg-types": "2.4.0",
200
+ "rolldown": "1.2.15",
201
201
  "semver": "7.8.5",
202
202
  "sql-highlight": "6.1.0",
203
203
  "std-env": "4.3.0",
@@ -209,18 +209,18 @@
209
209
  "zod": "4.6.7"
210
210
  },
211
211
  "devDependencies": {
212
- "@ark/attest": "0.57.0",
213
- "@electric-sql/pglite": "0.5.10",
212
+ "@ark/attest": "0.58.0",
213
+ "@electric-sql/pglite": "0.5.11",
214
214
  "@tailor-platform/shared": "^0.0.0",
215
215
  "@tailor-platform/tailor-proto": "^0.0.1",
216
216
  "@types/mime-types": "3.0.1",
217
217
  "@types/node": "24.19.2",
218
218
  "@types/semver": "7.8.0",
219
219
  "@vitest/coverage-v8": "5.0.5",
220
- "eslint-plugin-zod": "5.2.0",
221
- "oxfmt": "0.73.0",
222
- "oxlint": "1.88.0",
223
- "oxlint-tsgolint": "7.0.2004",
220
+ "eslint-plugin-zod": "5.2.1",
221
+ "oxfmt": "0.74.0",
222
+ "oxlint": "1.89.0",
223
+ "oxlint-tsgolint": "7.0.2005",
224
224
  "sonda": "0.14.0",
225
225
  "tsdown": "0.23.1",
226
226
  "tsrs": "0.16.0-ts7.1.0-dev.20260929",
@@ -1 +0,0 @@
1
- export{t as defineApplication,n as generatePluginFilesIfNeeded}from"./application-D0xNJbag.mjs";