@tailor-platform/sdk 2.3.0 → 2.5.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 (257) hide show
  1. package/CHANGELOG.md +171 -0
  2. package/README.md +1 -1
  3. package/dist/aigateway-DsWDjzk4.mjs +2 -0
  4. package/dist/{aigateway-DR4Kwuik.mjs.map → aigateway-DsWDjzk4.mjs.map} +1 -1
  5. package/dist/application-DFOUovmN.mjs +1 -0
  6. package/dist/application-D_4vg1KR.mjs +192 -0
  7. package/dist/application-D_4vg1KR.mjs.map +1 -0
  8. package/dist/assert-WeXvmG4j.mjs +2 -0
  9. package/dist/{assert-DBxo8jPo.mjs.map → assert-WeXvmG4j.mjs.map} +1 -1
  10. package/dist/authconnection-CynFBIv8.mjs +2 -0
  11. package/dist/{authconnection-CZvi9ANm.mjs.map → authconnection-CynFBIv8.mjs.map} +1 -1
  12. package/dist/brand-C8nMKhJC.mjs +2 -0
  13. package/dist/{brand-Eo4pLXPJ.mjs.map → brand-C8nMKhJC.mjs.map} +1 -1
  14. package/dist/cli/commands/deploy/deploy.d.mts +2 -2
  15. package/dist/cli/commands/deploy/deployment-target.d.mts +2 -0
  16. package/dist/cli/commands/deploy/event-subscriptions.d.mts +3 -0
  17. package/dist/cli/commands/deploy/tailordb/apply.d.mts +3 -0
  18. package/dist/cli/commands/deploy/tailordb/index.d.mts +3 -10
  19. package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +5 -0
  20. package/dist/cli/commands/deploy/tailordb/plan.d.mts +8 -0
  21. package/dist/cli/commands/executor/jobs.d.mts +1 -1
  22. package/dist/cli/commands/generate/seed/bundler.d.mts +2 -2
  23. package/dist/cli/commands/show.d.mts +1 -1
  24. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +15 -15
  25. package/dist/cli/commands/tailordb/migrate/generate.d.mts +7 -3
  26. package/dist/cli/commands/tailordb/migrate/rename-detection.d.mts +1 -1
  27. package/dist/cli/commands/tailordb/migrate/snapshot-comparison.d.mts +43 -0
  28. package/dist/cli/commands/tailordb/migrate/snapshot-files.d.mts +62 -0
  29. package/dist/cli/commands/tailordb/migrate/snapshot-local.d.mts +12 -0
  30. package/dist/cli/commands/tailordb/migrate/snapshot-migrations.d.mts +12 -0
  31. package/dist/cli/commands/tailordb/migrate/snapshot-remote.d.mts +1 -0
  32. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +3 -1
  33. package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +5 -117
  34. package/dist/cli/commands/tailordb/truncate.d.mts +2 -2
  35. package/dist/cli/lib.d.mts +8 -4
  36. package/dist/cli/lib.mjs +1 -9
  37. package/dist/cli/lib.mjs.map +1 -1
  38. package/dist/cli/main.mjs +1170 -7686
  39. package/dist/cli/main.mjs.map +1 -1
  40. package/dist/cli/shared/seed-chunker.d.mts +5 -5
  41. package/dist/cli/ts-hook.mjs +3 -1
  42. package/dist/completion/zsh-worker.zsh +99 -18
  43. package/dist/configure/config/index.d.mts +2 -2
  44. package/dist/configure/config/types.d.mts +2 -2
  45. package/dist/configure/index.d.mts +49 -12
  46. package/dist/configure/index.mjs +1 -1267
  47. package/dist/configure/index.mjs.map +1 -1
  48. package/dist/configure/services/aigateway/index.d.mts +5 -4
  49. package/dist/configure/services/aigateway/types.d.mts +6 -1
  50. package/dist/configure/services/auth/types.d.mts +3 -3
  51. package/dist/configure/services/idp/types.d.mts +1 -1
  52. package/dist/configure/services/tailordb/permission.d.mts +1 -1
  53. package/dist/configure/services/tailordb/schema.d.mts +5 -9
  54. package/dist/configure/services/tailordb/types.d.mts +8 -5
  55. package/dist/configure/services/workflow/execution-policy.d.mts +3 -3
  56. package/dist/configure/services/workflow/job.d.mts +12 -2
  57. package/dist/configure/types/auth-namespace-name.d.mts +18 -0
  58. package/dist/configure/types/field.types.d.mts +1 -1
  59. package/dist/configure/types/permission-operand.types.d.mts +1 -1
  60. package/dist/context-D0QjfxzD.mjs +2 -0
  61. package/dist/{context-DYQVYWqZ.mjs.map → context-D0QjfxzD.mjs.map} +1 -1
  62. package/dist/crashreport-B-_HTKLr.mjs +42 -0
  63. package/dist/{crashreport-CIIfLnoO.mjs.map → crashreport-B-_HTKLr.mjs.map} +1 -1
  64. package/dist/crashreport-BmsRIdpy.mjs +1 -0
  65. package/dist/errors-DSEXKRVD.mjs +2 -0
  66. package/dist/errors-DSEXKRVD.mjs.map +1 -0
  67. package/dist/file-COPYfju_.mjs +2 -0
  68. package/dist/file-COPYfju_.mjs.map +1 -0
  69. package/dist/globals-CMHSnj4w.mjs +2 -0
  70. package/dist/{globals-B2nlxBrz.mjs.map → globals-CMHSnj4w.mjs.map} +1 -1
  71. package/dist/iconv-DlFMt2gW.mjs +2 -0
  72. package/dist/{iconv-QWaZh0TT.mjs.map → iconv-DlFMt2gW.mjs.map} +1 -1
  73. package/dist/idp-G_ojPBB5.mjs +2 -0
  74. package/dist/{idp-RA_swu-h.mjs.map → idp-G_ojPBB5.mjs.map} +1 -1
  75. package/dist/interceptor-DQg3cR_9.mjs +2 -0
  76. package/dist/{interceptor-e33JtsC-.mjs.map → interceptor-DQg3cR_9.mjs.map} +1 -1
  77. package/dist/kysely/index.mjs +1 -31
  78. package/dist/kysely/index.mjs.map +1 -1
  79. package/dist/kysely-type-BTi3BMtL.mjs +43 -0
  80. package/dist/kysely-type-BTi3BMtL.mjs.map +1 -0
  81. package/dist/logger-BcGy-u7G.mjs +9 -0
  82. package/dist/{logger-DSdExfor.mjs.map → logger-BcGy-u7G.mjs.map} +1 -1
  83. package/dist/logger-DP2BjQ93.mjs +2 -0
  84. package/dist/{logger-BtX0suGY.mjs.map → logger-DP2BjQ93.mjs.map} +1 -1
  85. package/dist/multiline-EyzjEwn9.mjs +3 -0
  86. package/dist/{multiline-sfHpTZZK.mjs.map → multiline-EyzjEwn9.mjs.map} +1 -1
  87. package/dist/node-builtins-oBl7EbyV.mjs +2 -0
  88. package/dist/{node-builtins-CmaL2Cbq.mjs.map → node-builtins-oBl7EbyV.mjs.map} +1 -1
  89. package/dist/package-json-C690ceex.mjs +2 -0
  90. package/dist/{package-json-8b0O9TlX.mjs.map → package-json-C690ceex.mjs.map} +1 -1
  91. package/dist/package-json-CmqhDJ__.mjs +1 -0
  92. package/dist/parser/service/tailordb/type-source.d.mts +5 -5
  93. package/dist/parser/service/tailordb/types.d.mts +4 -4
  94. package/dist/platform-serialize-DkiTdHOt.mjs +2 -0
  95. package/dist/{platform-serialize-RoRtBS0v.mjs.map → platform-serialize-DkiTdHOt.mjs.map} +1 -1
  96. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  97. package/dist/plugin/builtin/enum-constants/index.mjs +5 -114
  98. package/dist/plugin/builtin/enum-constants/index.mjs.map +1 -1
  99. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  100. package/dist/plugin/builtin/file-utils/index.mjs +22 -101
  101. package/dist/plugin/builtin/file-utils/index.mjs.map +1 -1
  102. package/dist/plugin/builtin/kysely-type/index.d.mts +9 -2
  103. package/dist/plugin/builtin/kysely-type/index.mjs +1 -275
  104. package/dist/plugin/builtin/seed/index.d.mts +5 -0
  105. package/dist/plugin/builtin/seed/index.mjs +1 -3
  106. package/dist/plugin/builtin/seed/seed-type-processor.d.mts +4 -6
  107. package/dist/plugin/get-generated-table.d.mts +16 -0
  108. package/dist/plugin/index.d.mts +3 -2
  109. package/dist/plugin/index.mjs +1 -251
  110. package/dist/plugin/index.mjs.map +1 -1
  111. package/dist/plugin/types.d.mts +32 -25
  112. package/dist/plugin/with-context.d.mts +4 -4
  113. package/dist/register-ts-hook-Drnaproy.mjs +640 -0
  114. package/dist/register-ts-hook-Drnaproy.mjs.map +1 -0
  115. package/dist/registry-HlEaGvl5.mjs +2 -0
  116. package/dist/{registry-BIGVUrMB.mjs.map → registry-HlEaGvl5.mjs.map} +1 -1
  117. package/dist/repl-editor-BG1aDOfH.mjs +2 -0
  118. package/dist/{repl-editor-BCozyiNq.mjs.map → repl-editor-BG1aDOfH.mjs.map} +1 -1
  119. package/dist/runtime/aigateway.mjs +1 -3
  120. package/dist/runtime/authconnection.mjs +1 -3
  121. package/dist/runtime/context.mjs +1 -3
  122. package/dist/runtime/file.d.mts +28 -28
  123. package/dist/runtime/file.mjs +1 -3
  124. package/dist/runtime/globals.mjs +1 -1
  125. package/dist/runtime/iconv.mjs +1 -3
  126. package/dist/runtime/idp.mjs +1 -3
  127. package/dist/runtime/index.mjs +1 -11
  128. package/dist/runtime/logger.mjs +1 -3
  129. package/dist/runtime/secretmanager.mjs +1 -3
  130. package/dist/runtime/types.d.mts +1 -1
  131. package/dist/runtime/workflow.mjs +1 -3
  132. package/dist/schema-Ze_dI5VX.mjs +2 -0
  133. package/dist/schema-Ze_dI5VX.mjs.map +1 -0
  134. package/dist/secret-file-C9wp_FCX.mjs +2 -0
  135. package/dist/{secret-file-C3J4Gy8r.mjs.map → secret-file-C9wp_FCX.mjs.map} +1 -1
  136. package/dist/secretmanager-5olfnI1b.mjs +2 -0
  137. package/dist/{secretmanager-IY4UvinW.mjs.map → secretmanager-5olfnI1b.mjs.map} +1 -1
  138. package/dist/secretmanager-vHQoXdQz.mjs +2 -0
  139. package/dist/{secretmanager-CYlpffsz.mjs.map → secretmanager-vHQoXdQz.mjs.map} +1 -1
  140. package/dist/seed/index.d.mts +4 -4
  141. package/dist/seed/index.mjs +8 -244
  142. package/dist/seed/index.mjs.map +1 -1
  143. package/dist/seed-DwqRFdqP.mjs +207 -0
  144. package/dist/seed-DwqRFdqP.mjs.map +1 -0
  145. package/dist/service-BVe9u2Rt.mjs +7 -0
  146. package/dist/service-BVe9u2Rt.mjs.map +1 -0
  147. package/dist/service-CpZELSBa.mjs +1 -0
  148. package/dist/service-DlgaUO4V.mjs +2 -0
  149. package/dist/{service-hZskxZmg.mjs.map → service-DlgaUO4V.mjs.map} +1 -1
  150. package/dist/service_pb-DGKCLuAs.mjs +2 -0
  151. package/dist/{service_pb-BEWj1pOV.mjs.map → service_pb-DGKCLuAs.mjs.map} +1 -1
  152. package/dist/service_pb-_aeFE-Nv.mjs +1 -0
  153. package/dist/telemetry-Bklv9kQY.mjs +2 -0
  154. package/dist/{telemetry-BRVdwh14.mjs.map → telemetry-Bklv9kQY.mjs.map} +1 -1
  155. package/dist/telemetry-DXHP3VVi.mjs +1 -0
  156. package/dist/type-source--ZNcV8RJ.mjs +2 -0
  157. package/dist/type-source--ZNcV8RJ.mjs.map +1 -0
  158. package/dist/types/aigateway.generated.d.mts +2 -2
  159. package/dist/types/auth.generated.d.mts +3 -3
  160. package/dist/types/executor.generated.d.mts +2 -2
  161. package/dist/types/tailordb.generated.d.mts +12 -12
  162. package/dist/user-agent-vdHYF3QL.mjs +2 -0
  163. package/dist/{user-agent-Bgsszb5I.mjs.map → user-agent-vdHYF3QL.mjs.map} +1 -1
  164. package/dist/utils/test/index.d.mts +4 -4
  165. package/dist/utils/test/index.mjs +1 -109
  166. package/dist/utils/test/index.mjs.map +1 -1
  167. package/dist/vitest/environment.mjs +1 -41
  168. package/dist/vitest/environment.mjs.map +1 -1
  169. package/dist/vitest/index.mjs +1 -1980
  170. package/dist/vitest/index.mjs.map +1 -1
  171. package/dist/vitest/mocks/file.d.mts +8 -8
  172. package/dist/vitest/setup.mjs +1 -140
  173. package/dist/vitest/setup.mjs.map +1 -1
  174. package/dist/wait-point-invoker-eiP-IIux.mjs +2 -0
  175. package/dist/wait-point-invoker-eiP-IIux.mjs.map +1 -0
  176. package/dist/wait-point-registry-BrkwfyjS.mjs +2 -0
  177. package/dist/{wait-point-registry-TL99zotw.mjs.map → wait-point-registry-BrkwfyjS.mjs.map} +1 -1
  178. package/dist/workflow-Cs9ISw6j.mjs +2 -0
  179. package/dist/{workflow-Bamae_Yc.mjs.map → workflow-Cs9ISw6j.mjs.map} +1 -1
  180. package/dist/workspace_resource_pb--GeYQPXu.mjs +2 -0
  181. package/dist/{workspace_resource_pb-HNIL_Vfj.mjs.map → workspace_resource_pb--GeYQPXu.mjs.map} +1 -1
  182. package/docs/cli/application.md +3 -1
  183. package/docs/cli/function.md +77 -13
  184. package/docs/cli/setup.md +24 -14
  185. package/docs/cli/tailordb.md +32 -30
  186. package/docs/cli/workspace.md +2 -2
  187. package/docs/cli-reference.md +23 -22
  188. package/docs/configuration.md +2 -2
  189. package/docs/github-actions.md +10 -9
  190. package/docs/migration/v2.md +16 -4
  191. package/docs/migration/v3.md +123 -0
  192. package/docs/plugin/custom.md +130 -85
  193. package/docs/plugin/index.md +3 -3
  194. package/docs/quickstart.md +1 -1
  195. package/docs/services/aigateway.md +33 -9
  196. package/docs/services/executor.md +5 -1
  197. package/docs/services/tailordb-migration.md +68 -54
  198. package/docs/services/tailordb.md +7 -7
  199. package/docs/services/workflow.md +10 -9
  200. package/docs/testing.md +1 -1
  201. package/package.json +16 -16
  202. package/postinstall.mjs +1 -1
  203. package/dist/aigateway-DR4Kwuik.mjs +0 -9
  204. package/dist/application-BZfk4HKm.mjs +0 -3
  205. package/dist/application-F-nl107y.mjs +0 -6019
  206. package/dist/application-F-nl107y.mjs.map +0 -1
  207. package/dist/assert-DBxo8jPo.mjs +0 -9
  208. package/dist/authconnection-CZvi9ANm.mjs +0 -9
  209. package/dist/brand-Eo4pLXPJ.mjs +0 -36
  210. package/dist/context-DYQVYWqZ.mjs +0 -23
  211. package/dist/crashreport-CIIfLnoO.mjs +0 -423
  212. package/dist/crashreport-CINZ5dVN.mjs +0 -3
  213. package/dist/errors-BVb6vYGy.mjs +0 -89
  214. package/dist/errors-BVb6vYGy.mjs.map +0 -1
  215. package/dist/file-BUcmVIH2.mjs +0 -58
  216. package/dist/file-BUcmVIH2.mjs.map +0 -1
  217. package/dist/globals-B2nlxBrz.mjs +0 -126
  218. package/dist/iconv-QWaZh0TT.mjs +0 -38
  219. package/dist/idp-RA_swu-h.mjs +0 -82
  220. package/dist/interceptor-e33JtsC-.mjs +0 -33
  221. package/dist/logger-BtX0suGY.mjs +0 -48
  222. package/dist/logger-DSdExfor.mjs +0 -358
  223. package/dist/multiline-sfHpTZZK.mjs +0 -38
  224. package/dist/node-builtins-CmaL2Cbq.mjs +0 -36
  225. package/dist/package-json-8b0O9TlX.mjs +0 -17
  226. package/dist/package-json-Cv2Z-TqQ.mjs +0 -3
  227. package/dist/platform-serialize-RoRtBS0v.mjs +0 -46
  228. package/dist/plugin/builtin/kysely-type/index.mjs.map +0 -1
  229. package/dist/plugin/builtin/seed/types.d.mts +0 -2
  230. package/dist/plugin/get-generated-type.d.mts +0 -16
  231. package/dist/register-ts-hook-ClI226n2.mjs +0 -25543
  232. package/dist/register-ts-hook-ClI226n2.mjs.map +0 -1
  233. package/dist/registry-BIGVUrMB.mjs +0 -54
  234. package/dist/repl-editor-BCozyiNq.mjs +0 -251
  235. package/dist/schema--xYWRGfe.mjs +0 -639
  236. package/dist/schema--xYWRGfe.mjs.map +0 -1
  237. package/dist/secret-file-C3J4Gy8r.mjs +0 -64
  238. package/dist/secretmanager-CYlpffsz.mjs +0 -13
  239. package/dist/secretmanager-IY4UvinW.mjs +0 -131
  240. package/dist/seed-xqM9WIHP.mjs +0 -483
  241. package/dist/seed-xqM9WIHP.mjs.map +0 -1
  242. package/dist/service-C_WpbKHu.mjs +0 -898
  243. package/dist/service-C_WpbKHu.mjs.map +0 -1
  244. package/dist/service-D1RCdzIL.mjs +0 -3
  245. package/dist/service-hZskxZmg.mjs +0 -131
  246. package/dist/service_pb-BEWj1pOV.mjs +0 -167
  247. package/dist/service_pb-BjlhvK9E.mjs +0 -3
  248. package/dist/telemetry-BRVdwh14.mjs +0 -84
  249. package/dist/telemetry-CkbkeJxl.mjs +0 -3
  250. package/dist/type-source-DH_LH20p.mjs +0 -13
  251. package/dist/type-source-DH_LH20p.mjs.map +0 -1
  252. package/dist/user-agent-Bgsszb5I.mjs +0 -28
  253. package/dist/wait-point-invoker-__oE88_P.mjs +0 -148
  254. package/dist/wait-point-invoker-__oE88_P.mjs.map +0 -1
  255. package/dist/wait-point-registry-TL99zotw.mjs +0 -47
  256. package/dist/workflow-Bamae_Yc.mjs +0 -34
  257. package/dist/workspace_resource_pb-HNIL_Vfj.mjs +0 -860
@@ -0,0 +1,2 @@
1
+ function assertDefined(e,t){if(e==null)throw Error(t);return e}export{assertDefined as t};
2
+ //# sourceMappingURL=assert-WeXvmG4j.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"assert-DBxo8jPo.mjs","names":[],"sources":["../src/utils/assert.ts"],"sourcesContent":["export function assertDefined<T>(value: T, message: string): NonNullable<T> {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\n"],"mappings":";AAAA,SAAgB,cAAiB,OAAU,SAAiC;CAC1E,IAAI,SAAS,MACX,MAAM,IAAI,MAAM,OAAO;CAEzB,OAAO;AACT"}
1
+ {"version":3,"file":"assert-WeXvmG4j.mjs","names":[],"sources":["../src/utils/assert.ts"],"sourcesContent":["export function assertDefined<T>(value: T, message: string): NonNullable<T> {\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\n"],"mappings":"AAAA,SAAgB,cAAiB,EAAU,EAAiC,CAC1E,GAAI,GAAS,KACX,MAAU,MAAM,CAAO,EAEzB,OAAO,CACT"}
@@ -0,0 +1,2 @@
1
+ const api=()=>globalThis.tailor.authconnection,e={getConnectionToken:(...e)=>api().getConnectionToken(...e)};export{e as t};
2
+ //# sourceMappingURL=authconnection-CynFBIv8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"authconnection-CZvi9ANm.mjs","names":[],"sources":["../src/runtime/authconnection.ts"],"sourcesContent":["/**\n * Auth connection utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.\n * At runtime this delegates to `globalThis.tailor.authconnection`. Use\n * `mockAuthconnection` from `@tailor-platform/sdk/vitest` to mock in unit tests.\n *\n * `connectionName` is narrowed to the connection names defined in `defineAuth()`'s\n * `connections` once `tailor.d.ts` has been generated (via `tailor deploy`/`generate`).\n * @example\n * import { authconnection } from \"@tailor-platform/sdk/runtime\";\n *\n * const token = await authconnection.getConnectionToken(\"my-connection\");\n */\n\nimport type { AuthConnectionTokenResult } from \"#/configure/services/auth/types\";\n// Import from the public entry (not `#/configure/types/connection-name`) so this d.ts\n// references `@tailor-platform/sdk` externally instead of inlining the registry — a single\n// generated `declare module \"@tailor-platform/sdk\"` then narrows this entry too.\nimport type { ConnectionName } from \"@tailor-platform/sdk\";\n\n/**\n * Platform API surface for `tailor.authconnection`. Describes the shape the\n * platform runtime injects on `globalThis.tailor.authconnection`.\n */\nexport interface TailorAuthconnectionAPI {\n /**\n * Returns the access token for the given auth connection.\n * @param connectionName - Auth connection name as defined in tailor.config\n * @returns Token payload\n */\n getConnectionToken(connectionName: ConnectionName): Promise<AuthConnectionTokenResult>;\n}\n\nconst api = (): TailorAuthconnectionAPI =>\n (globalThis as unknown as { tailor: { authconnection: TailorAuthconnectionAPI } }).tailor\n .authconnection;\n\nconst getConnectionToken: TailorAuthconnectionAPI[\"getConnectionToken\"] = (...args) =>\n api().getConnectionToken(...args);\n\n/** Runtime wrapper namespace for `tailor.authconnection`. */\nexport const authconnection = { getConnectionToken } as const satisfies TailorAuthconnectionAPI;\n"],"mappings":";AAkCA,MAAM,YACH,WAAkF,OAChF;AAEL,MAAM,sBAAqE,GAAG,SAC5E,IAAI,CAAC,CAAC,mBAAmB,GAAG,IAAI;;AAGlC,MAAa,iBAAiB,EAAE,mBAAmB"}
1
+ {"version":3,"file":"authconnection-CynFBIv8.mjs","names":[],"sources":["../src/runtime/authconnection.ts"],"sourcesContent":["/**\n * Auth connection utilities.\n *\n * Thin typed wrapper around the platform-provided `tailor.authconnection` runtime API.\n * At runtime this delegates to `globalThis.tailor.authconnection`. Use\n * `mockAuthconnection` from `@tailor-platform/sdk/vitest` to mock in unit tests.\n *\n * `connectionName` is narrowed to the connection names defined in `defineAuth()`'s\n * `connections` once `tailor.d.ts` has been generated (via `tailor deploy`/`generate`).\n * @example\n * import { authconnection } from \"@tailor-platform/sdk/runtime\";\n *\n * const token = await authconnection.getConnectionToken(\"my-connection\");\n */\n\nimport type { AuthConnectionTokenResult } from \"#/configure/services/auth/types\";\n// Import from the public entry (not `#/configure/types/connection-name`) so this d.ts\n// references `@tailor-platform/sdk` externally instead of inlining the registry — a single\n// generated `declare module \"@tailor-platform/sdk\"` then narrows this entry too.\nimport type { ConnectionName } from \"@tailor-platform/sdk\";\n\n/**\n * Platform API surface for `tailor.authconnection`. Describes the shape the\n * platform runtime injects on `globalThis.tailor.authconnection`.\n */\nexport interface TailorAuthconnectionAPI {\n /**\n * Returns the access token for the given auth connection.\n * @param connectionName - Auth connection name as defined in tailor.config\n * @returns Token payload\n */\n getConnectionToken(connectionName: ConnectionName): Promise<AuthConnectionTokenResult>;\n}\n\nconst api = (): TailorAuthconnectionAPI =>\n (globalThis as unknown as { tailor: { authconnection: TailorAuthconnectionAPI } }).tailor\n .authconnection;\n\nconst getConnectionToken: TailorAuthconnectionAPI[\"getConnectionToken\"] = (...args) =>\n api().getConnectionToken(...args);\n\n/** Runtime wrapper namespace for `tailor.authconnection`. */\nexport const authconnection = { getConnectionToken } as const satisfies TailorAuthconnectionAPI;\n"],"mappings":"AAkCA,MAAM,QACH,WAAkF,OAChF,eAMQ,EAAiB,CAAE,oBAJ2C,GAAG,IAC5E,IAAI,CAAC,CAAC,mBAAmB,GAAG,CAAI,CAGiB"}
@@ -0,0 +1,2 @@
1
+ const e=Symbol.for(`tailor-platform/sdk`);function brandValue(t,n){return Object.defineProperty(t,e,{value:n,enumerable:!1,configurable:!1,writable:!1}),t}function isSdkBranded(t,n){if(typeof t!=`object`||!t||!(e in t))return!1;let r=t[e];return n===void 0||r===!0||(Array.isArray(n)?n.includes(r):r===n)}export{isSdkBranded as n,brandValue as t};
2
+ //# sourceMappingURL=brand-C8nMKhJC.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"brand-Eo4pLXPJ.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind =\n | \"tailordb-type\"\n | \"resolver\"\n | \"executor\"\n | \"workflow\"\n | \"workflow-job\"\n | \"wait-point\"\n | \"execution-policy\"\n | \"http-adapter\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored as SdkBrandKind) : stored === kind)\n );\n}\n"],"mappings":";AAEA,MAAa,YAA2B,OAAO,IAAI,qBAAqB;;;;;;;;;AAoBxE,SAAgB,WAA6B,OAAU,MAAuB;CAC5E,OAAO,eAAe,OAAO,WAAW;EACtC,OAAO;EACP,YAAY;EACZ,cAAc;EACd,UAAU;CACZ,CAAC;CACD,OAAO;AACT;;;;;;;;;AAUA,SAAgB,aACd,OACA,MACS;CACT,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,EAAE,aAAa,QAAQ,OAAO;CACjF,MAAM,SAAU,MAAkC;CAElD,OACE,SAAS,UACT,WAAW,SACV,MAAM,QAAQ,IAAI,IAAI,KAAK,SAAS,MAAsB,IAAI,WAAW;AAE9E"}
1
+ {"version":3,"file":"brand-C8nMKhJC.mjs","names":[],"sources":["../src/utils/brand.ts"],"sourcesContent":["// Symbol.for ensures the same symbol is returned across different ESM module instances,\n// avoiding identity mismatches when multiple copies of the SDK are loaded.\nexport const SDK_BRAND: unique symbol = Symbol.for(\"tailor-platform/sdk\");\n\nexport type SdkBrandKind =\n | \"tailordb-type\"\n | \"resolver\"\n | \"executor\"\n | \"workflow\"\n | \"workflow-job\"\n | \"wait-point\"\n | \"execution-policy\"\n | \"http-adapter\";\n\n/**\n * Adds a non-enumerable SDK brand symbol to the given object (in-place).\n * The brand stores the kind so service loaders can distinguish between\n * different SDK object types (e.g. a type loader skips executors).\n * @param value - The object to brand\n * @param kind - The kind of SDK object\n * @returns The same object with the brand applied\n */\nexport function brandValue<T extends object>(value: T, kind: SdkBrandKind): T {\n Object.defineProperty(value, SDK_BRAND, {\n value: kind,\n enumerable: false,\n configurable: false,\n writable: false,\n });\n return value;\n}\n\n/**\n * Checks whether the given value has been branded by the SDK.\n * When kind is specified, only returns true if the brand matches that kind.\n * Accepts a single kind or an array of kinds for multi-kind matching.\n * @param value - The value to check\n * @param kind - Optional kind or kinds to match against\n * @returns True if the value has the SDK brand symbol (and matches kind if specified)\n */\nexport function isSdkBranded(\n value: unknown,\n kind?: SdkBrandKind | readonly SdkBrandKind[],\n): boolean {\n if (value === null || typeof value !== \"object\" || !(SDK_BRAND in value)) return false;\n const stored = (value as Record<symbol, unknown>)[SDK_BRAND];\n // No kind filter → any brand matches. Legacy `true` brand → matches any kind.\n return (\n kind === undefined ||\n stored === true ||\n (Array.isArray(kind) ? kind.includes(stored) : stored === kind)\n );\n}\n"],"mappings":"AAEA,MAAa,EAA2B,OAAO,IAAI,qBAAqB,EAoBxE,SAAgB,WAA6B,EAAU,EAAuB,CAO5E,OANA,OAAO,eAAe,EAAO,EAAW,CACtC,MAAO,EACP,WAAY,GACZ,aAAc,GACd,SAAU,EACZ,CAAC,EACM,CACT,CAUA,SAAgB,aACd,EACA,EACS,CACT,GAAsB,OAAO,GAAU,WAAnC,GAA+C,EAAE,KAAa,GAAQ,MAAO,GACjF,IAAM,EAAU,EAAkC,GAElD,OACE,IAAS,IAAA,IACT,IAAW,KACV,MAAM,QAAQ,CAAI,EAAI,EAAK,SAAS,CAAM,EAAI,IAAW,EAE9D"}
@@ -1,10 +1,10 @@
1
1
  import { BundledScripts } from "./function-registry-types.mjs";
2
- import "../../shared/config-loader.mjs";
3
2
  import "../../services/application.mjs";
4
3
  import "../../shared/client.mjs";
5
- import "./label.mjs";
6
4
  import "./types.mjs";
7
5
  import "./apply-phases.mjs";
6
+ import "./deployment-target.mjs";
7
+ import "./event-subscriptions.mjs";
8
8
  //#region src/cli/commands/deploy/deploy.d.ts
9
9
  interface DeployOptions {
10
10
  workspaceId?: string;
@@ -0,0 +1,2 @@
1
+ import "../../shared/config-loader.mjs";
2
+ import "../../services/application.mjs";
@@ -0,0 +1,3 @@
1
+ import "./label.mjs";
2
+ import "./workflow.mjs";
3
+ import "./deployment-target.mjs";
@@ -0,0 +1,3 @@
1
+ import "../../../shared/client.mjs";
2
+ import "../types.mjs";
3
+ import "./plan.mjs";
@@ -1,11 +1,4 @@
1
- import "../../../shared/config-loader.mjs";
2
- import "../../../services/application.mjs";
3
- import "../../../../tailor-proto/src/tailor/v1/tailordb_pb.mjs";
4
- import "../../../shared/client.mjs";
5
- import "../label.mjs";
6
- import "../../tailordb/migrate/snapshot.mjs";
7
- import "../types.mjs";
8
- import "../../tailordb/migrate/config.mjs";
9
- import "../../tailordb/migrate/schema-checks.mjs";
10
1
  import "../../tailordb/migrate/file-state.mjs";
11
- import { MessageInitShape } from "@bufbuild/protobuf";
2
+ import "./plan.mjs";
3
+ import "./apply.mjs";
4
+ import "./migration-validation.mjs";
@@ -0,0 +1,5 @@
1
+ import "../../../shared/config-loader.mjs";
2
+ import "../../../shared/client.mjs";
3
+ import "../../tailordb/migrate/snapshot.mjs";
4
+ import "../../tailordb/migrate/config.mjs";
5
+ import "../../tailordb/migrate/schema-checks.mjs";
@@ -0,0 +1,8 @@
1
+ import "../../../services/application.mjs";
2
+ import "../../../../tailor-proto/src/tailor/v1/tailordb_pb.mjs";
3
+ import "../label.mjs";
4
+ import "../types.mjs";
5
+ import "../../tailordb/migrate/config.mjs";
6
+ import "../../tailordb/migrate/schema-checks.mjs";
7
+ import "../../../lib.mjs";
8
+ import { MessageInitShape } from "@bufbuild/protobuf";
@@ -82,4 +82,4 @@ declare function watchExecutorJob<E extends ExecutorLike>(options: WatchExecutor
82
82
  */
83
83
  declare function getExecutorWaitFailureMessage(result: WatchExecutorJobResult): string | undefined;
84
84
  //#endregion
85
- export { ExecutorJobDetailInfo, GetExecutorJobTypedOptions, ListExecutorJobsTypedOptions, WatchExecutorJobResult, WatchExecutorJobTypedOptions, WorkflowJobLog, getExecutorJob, getExecutorWaitFailureMessage, listExecutorJobs, watchExecutorJob };
85
+ export { ExecutorJobDetailInfo, GetExecutorJobTypedOptions, ListExecutorJobsTypedOptions, WatchExecutorJobResult, WatchExecutorJobTypedOptions, getExecutorJob, getExecutorWaitFailureMessage, listExecutorJobs, watchExecutorJob };
@@ -18,10 +18,10 @@ type SeedBundleResult = {
18
18
  * 3. Reports progress via console.log
19
19
  * 4. Exports as main() for TestExecScript
20
20
  * @param namespace - TailorDB namespace
21
- * @param typeNames - List of type names to include in the seed
21
+ * @param tableNames - List of table names to include in the seed
22
22
  * @param baseDir - Directory whose dependencies and tsconfig the generated entry uses
23
23
  * @returns Bundled seed script result
24
24
  */
25
- declare function bundleSeedScript(namespace: string, typeNames: string[], baseDir?: string): Promise<SeedBundleResult>;
25
+ declare function bundleSeedScript(namespace: string, tableNames: string[], baseDir?: string): Promise<SeedBundleResult>;
26
26
  //#endregion
27
27
  export { SeedBundleResult, bundleSeedScript };
@@ -36,4 +36,4 @@ interface ShowInfo extends ApplicationInfo, WorkspaceInfo {
36
36
  */
37
37
  declare function show(options?: ShowOptions): Promise<ShowInfo>;
38
38
  //#endregion
39
- export { AIGatewayInfo, ApplicationInfo, ShowInfo, ShowOptions, WorkspaceInfo, show };
39
+ export { AIGatewayInfo, ApplicationInfo, ShowInfo, ShowOptions, show };
@@ -8,7 +8,7 @@ interface DiffChangeBase {
8
8
  reason?: string;
9
9
  }
10
10
  /**
11
- * Type-level settings patch carried by legacy `type_modified` changes.
11
+ * Table-level settings patch carried by legacy `type_modified` changes.
12
12
  * Current SDK versions no longer produce this kind, but persisted
13
13
  * diff.json files written by older versions may still contain it.
14
14
  */
@@ -16,7 +16,7 @@ interface TypeSettingsPatch {
16
16
  indexes?: Record<string, SnapshotIndexConfig>;
17
17
  files?: Record<string, string>;
18
18
  }
19
- /** Type-level settings and metadata state used by current diffs. */
19
+ /** Table-level settings and metadata state used by current diffs. */
20
20
  interface SnapshotTypeSettingsState {
21
21
  description?: string;
22
22
  pluralForm: string;
@@ -66,13 +66,13 @@ interface TableSettingsModifiedChange extends DiffChangeBase {
66
66
  before: SnapshotTypeSettingsState;
67
67
  after: SnapshotTypeSettingsState;
68
68
  }
69
- /** A field was added to a type. */
69
+ /** A field was added to a table. */
70
70
  interface FieldAddedChange extends DiffChangeBase {
71
71
  kind: "field_added";
72
72
  fieldName: string;
73
73
  after: SnapshotFieldConfig;
74
74
  }
75
- /** A field was removed from a type. */
75
+ /** A field was removed from a table. */
76
76
  interface FieldRemovedChange extends DiffChangeBase {
77
77
  kind: "field_removed";
78
78
  fieldName: string;
@@ -86,7 +86,7 @@ interface FieldModifiedChange extends DiffChangeBase {
86
86
  after: SnapshotFieldConfig;
87
87
  }
88
88
  /**
89
- * A field was renamed within a type. Recorded when the user confirms that a
89
+ * A field was renamed within a table. Recorded when the user confirms that a
90
90
  * removed + added field pair is a rename (interactively or via `--rename`).
91
91
  * `fieldName` is the new name; `previousFieldName` is the old name.
92
92
  */
@@ -104,13 +104,13 @@ interface FieldTypeModifiedChange extends DiffChangeBase {
104
104
  before: SnapshotFieldConfig;
105
105
  after: SnapshotFieldConfig;
106
106
  }
107
- /** An index was added to a type. */
107
+ /** An index was added to a table. */
108
108
  interface IndexAddedChange extends DiffChangeBase {
109
109
  kind: "index_added";
110
110
  indexName: string;
111
111
  after: SnapshotIndexConfig;
112
112
  }
113
- /** An index was removed from a type. */
113
+ /** An index was removed from a table. */
114
114
  interface IndexRemovedChange extends DiffChangeBase {
115
115
  kind: "index_removed";
116
116
  indexName: string;
@@ -123,13 +123,13 @@ interface IndexModifiedChange extends DiffChangeBase {
123
123
  before: SnapshotIndexConfig;
124
124
  after: SnapshotIndexConfig;
125
125
  }
126
- /** A file field was added to a type. `before`/`after` hold the description. */
126
+ /** A file field was added to a table. `before`/`after` hold the description. */
127
127
  interface FileAddedChange extends DiffChangeBase {
128
128
  kind: "file_added";
129
129
  fieldName: string;
130
130
  after: string;
131
131
  }
132
- /** A file field was removed from a type. */
132
+ /** A file field was removed from a table. */
133
133
  interface FileRemovedChange extends DiffChangeBase {
134
134
  kind: "file_removed";
135
135
  fieldName: string;
@@ -143,7 +143,7 @@ interface FileModifiedChange extends DiffChangeBase {
143
143
  after: string;
144
144
  }
145
145
  /**
146
- * A relationship was added to a type. `relationshipType` is optional for
146
+ * A relationship was added to a table. `relationshipType` is optional for
147
147
  * backward compatibility: diff.json files written by older SDK versions
148
148
  * predate the field.
149
149
  */
@@ -153,7 +153,7 @@ interface RelationshipAddedChange extends DiffChangeBase {
153
153
  relationshipType?: "forward" | "backward";
154
154
  after: SnapshotRelationship;
155
155
  }
156
- /** A relationship was removed from a type. */
156
+ /** A relationship was removed from a table. */
157
157
  interface RelationshipRemovedChange extends DiffChangeBase {
158
158
  kind: "relationship_removed";
159
159
  relationshipName: string;
@@ -169,7 +169,7 @@ interface RelationshipModifiedChange extends DiffChangeBase {
169
169
  after: SnapshotRelationship;
170
170
  }
171
171
  /**
172
- * Type-level permissions were modified. `before`/`after` are optional for
172
+ * Table-level permissions were modified. `before`/`after` are optional for
173
173
  * robustness against hand-edited or legacy diff.json files; consumers guard
174
174
  * on their presence.
175
175
  */
@@ -178,7 +178,7 @@ interface PermissionModifiedChange extends DiffChangeBase {
178
178
  before?: SnapshotPermissionState;
179
179
  after?: SnapshotPermissionState;
180
180
  }
181
- /** Type-level hook/validate script state for diff tracking. */
181
+ /** Table-level hook/validate script state for diff tracking. */
182
182
  interface TypeScriptsState {
183
183
  typeHookExpr?: {
184
184
  create?: string;
@@ -212,7 +212,7 @@ interface MigrationDiff {
212
212
  hasBreakingChanges: boolean;
213
213
  /** List of breaking changes */
214
214
  breakingChanges: BreakingChangeInfo[];
215
- /** Whether there are non-breaking changes that may cause data loss (e.g. field/type removal) */
215
+ /** Whether there are non-breaking changes that may cause data loss (e.g. field/table removal) */
216
216
  hasWarnings: boolean;
217
217
  /** List of non-breaking warnings */
218
218
  warnings: WarningChangeInfo[];
@@ -245,7 +245,7 @@ interface BreakingChangeInfo {
245
245
  * Warning change information in migration diff.
246
246
  *
247
247
  * Warnings are non-breaking changes that may still cause data loss
248
- * (e.g. removing a field or type). Unlike breaking changes, a migration
248
+ * (e.g. removing a field or table). Unlike breaking changes, a migration
249
249
  * script is not required, but writing one is recommended if you need to
250
250
  * preserve or transform data before the change applies.
251
251
  */
@@ -5,11 +5,15 @@ interface GenerateOptions {
5
5
  name?: string;
6
6
  yes?: boolean;
7
7
  init?: boolean;
8
- /** `--rename Type.old:new` / `--rename OldType:NewType` values confirming renames non-interactively. */
8
+ /** Create a migration with no schema changes that exists to run a migration script. */
9
+ dataOnly?: boolean;
10
+ /** Namespace the `--data-only` migration targets. */
11
+ namespace?: string;
12
+ /** `--rename Table.oldField:newField` / `--rename OldTable:NewTable` values confirming renames non-interactively. */
9
13
  renames?: string[];
10
- /** `--drop Type.field` / `--drop Type` values confirming removals non-interactively. */
14
+ /** `--drop Table.field` / `--drop Table` values confirming removals non-interactively. */
11
15
  drops?: string[];
12
- /** `--expand-contract Type.field` values approving a field type conversion. */
16
+ /** `--expand-contract Table.field` values approving a field type conversion. */
13
17
  expandContracts?: string[];
14
18
  }
15
19
  /**
@@ -10,7 +10,7 @@ interface FieldRenameSpec {
10
10
  fieldName: string;
11
11
  }
12
12
  /**
13
- * A confirmed type rename to record in the migration diff.
13
+ * A confirmed table rename to record in the migration diff.
14
14
  */
15
15
  interface TypeRenameSpec {
16
16
  /** Type name before the rename. */
@@ -0,0 +1,43 @@
1
+ import { NormalizedSchemaSnapshot, SchemaSnapshot, TailorDBSnapshotType } from "./snapshot-types.mjs";
2
+ import { MigrationDiff } from "./diff-calculator.mjs";
3
+ import { FieldRenameSpec, TypeRenameSpec } from "./rename-detection.mjs";
4
+ //#region src/cli/commands/tailordb/migrate/snapshot-comparison.d.ts
5
+ /**
6
+ * Options for {@link compareSnapshots}.
7
+ */
8
+ interface CompareSnapshotsOptions {
9
+ /**
10
+ * Confirmed field renames. Each spec replaces the corresponding
11
+ * `field_removed` + `field_added` pair with a single breaking
12
+ * `field_renamed` change. Specs are validated against both snapshots.
13
+ */
14
+ fieldRenames?: readonly FieldRenameSpec[];
15
+ /**
16
+ * Confirmed table renames. Each spec replaces the corresponding
17
+ * `table_removed` + `table_added` pair with a single breaking
18
+ * `table_renamed` change. Specs are validated against both snapshots.
19
+ */
20
+ typeRenames?: readonly TypeRenameSpec[];
21
+ }
22
+ /**
23
+ * Compare two normalized snapshots and generate a diff
24
+ * @param {NormalizedSchemaSnapshot} previous - Previous normalized snapshot
25
+ * @param {NormalizedSchemaSnapshot} current - Current normalized snapshot
26
+ * @param {CompareSnapshotsOptions} [options] - Comparison options
27
+ * @returns {MigrationDiff} Migration diff between snapshots
28
+ */
29
+ declare function compareSnapshots(previous: NormalizedSchemaSnapshot, current: NormalizedSchemaSnapshot, options?: CompareSnapshotsOptions): MigrationDiff;
30
+ /**
31
+ * Compare a snapshot against canonical TailorDBSnapshotType-shaped local tables.
32
+ * Callers are expected to pre-convert TailorDBService.types to TailorDBSnapshotType via
33
+ * `createSnapshotType`. As a safety net, both sides are re-run through idempotent
34
+ * normalization here, so a caller that forgets will still get correct
35
+ * comparisons (no silent false drift).
36
+ * @param {SchemaSnapshot} snapshot - Schema snapshot to compare against
37
+ * @param {Record<string, TailorDBSnapshotType>} localTypes - Local snapshot-shaped tables
38
+ * @param {string} namespace - Namespace for comparison
39
+ * @returns {MigrationDiff} Migration diff
40
+ */
41
+ declare function compareLocalTypesWithSnapshot(snapshot: SchemaSnapshot, localTypes: Record<string, TailorDBSnapshotType>, namespace: string): MigrationDiff;
42
+ //#endregion
43
+ export { CompareSnapshotsOptions, compareLocalTypesWithSnapshot, compareSnapshots };
@@ -0,0 +1,62 @@
1
+ //#region src/cli/commands/tailordb/migrate/snapshot-files.d.ts
2
+ /**
3
+ * Initial schema migration number (0000)
4
+ */
5
+ declare const INITIAL_SCHEMA_NUMBER = 0;
6
+ /**
7
+ * Migration file names (used within migration directories)
8
+ */
9
+ declare const SCHEMA_FILE_NAME = "schema.json";
10
+ /** File name for migration diff metadata. */
11
+ declare const DIFF_FILE_NAME = "diff.json";
12
+ /** File name for migration script. */
13
+ declare const MIGRATE_FILE_NAME = "migrate.ts";
14
+ /** File name for migration script unit test. */
15
+ declare const MIGRATE_TEST_FILE_NAME = "migrate.test.ts";
16
+ /** File name for generated DB type definitions. */
17
+ declare const DB_TYPES_FILE_NAME = "db.ts";
18
+ /**
19
+ * Migration file type
20
+ */
21
+ type MigrationFileType = "schema" | "diff" | "migrate" | "test" | "db";
22
+ /**
23
+ * Get migration directory path for a given number
24
+ * @param {string} migrationsDir - Base migrations directory path
25
+ * @param {number} num - Migration number
26
+ * @returns {string} Full directory path for the migration
27
+ */
28
+ declare function getMigrationDirPath(migrationsDir: string, num: number): string;
29
+ /**
30
+ * Get migration file path for a given number and type
31
+ * @param {string} migrationsDir - Migrations directory path
32
+ * @param {number} num - Migration number
33
+ * @param {MigrationFileType} type - File type
34
+ * @returns {string} Full file path
35
+ */
36
+ declare function getMigrationFilePath(migrationsDir: string, num: number, type: MigrationFileType): string;
37
+ /**
38
+ * Get all migration directories and their files, sorted by number
39
+ * @param {string} migrationsDir - Migrations directory path
40
+ * @returns {Array<{number: number, type: "schema" | "diff", path: string}>} Migration files sorted by number
41
+ */
42
+ declare function getMigrationFiles(migrationsDir: string): {
43
+ number: number;
44
+ type: "schema" | "diff";
45
+ path: string;
46
+ }[];
47
+ /**
48
+ * Get the next migration number for a directory
49
+ * Returns INITIAL_SCHEMA_NUMBER (0) if no migrations exist
50
+ * @param {string} migrationsDir - Migrations directory path
51
+ * @returns {number} Next migration number
52
+ */
53
+ declare function getNextMigrationNumber(migrationsDir: string): number;
54
+ /**
55
+ * Get the latest migration number from a directory
56
+ * Returns 0 if no migrations exist
57
+ * @param {string} migrationsDir - Migrations directory path
58
+ * @returns {number} Latest migration number or 0 if no migrations exist
59
+ */
60
+ declare function getLatestMigrationNumber(migrationsDir: string): number;
61
+ //#endregion
62
+ export { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATE_TEST_FILE_NAME, MigrationFileType, SCHEMA_FILE_NAME, getLatestMigrationNumber, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNextMigrationNumber };
@@ -0,0 +1,12 @@
1
+ import { TailorDBType } from "../../../../parser/service/tailordb/types.mjs";
2
+ import { NormalizedSchemaSnapshot } from "./snapshot-types.mjs";
3
+ //#region src/cli/commands/tailordb/migrate/snapshot-local.d.ts
4
+ /**
5
+ * Create a schema snapshot from local table definitions
6
+ * @param {Record<string, TailorDBType>} types - Local table definitions
7
+ * @param {string} namespace - Namespace for the snapshot
8
+ * @returns {NormalizedSchemaSnapshot} Normalized schema snapshot
9
+ */
10
+ declare function createSnapshotFromLocalTypes(types: Record<string, TailorDBType>, namespace: string): NormalizedSchemaSnapshot;
11
+ //#endregion
12
+ export { createSnapshotFromLocalTypes };
@@ -0,0 +1,12 @@
1
+ import { NormalizedSchemaSnapshot } from "./snapshot-types.mjs";
2
+ //#region src/cli/commands/tailordb/migrate/snapshot-migrations.d.ts
3
+ /**
4
+ * Reconstruct the latest schema snapshot from all migration files
5
+ * Returns null if no migrations exist
6
+ * @param {string} migrationsDir - Migrations directory path
7
+ * @param {number} [maxVersion] - Optional maximum migration version to apply
8
+ * @returns {NormalizedSchemaSnapshot | null} Reconstructed normalized snapshot or null if no migrations exist
9
+ */
10
+ declare function reconstructSnapshotFromMigrations(migrationsDir: string, maxVersion?: number): NormalizedSchemaSnapshot | null;
11
+ //#endregion
12
+ export { reconstructSnapshotFromMigrations };
@@ -0,0 +1 @@
1
+ import "../../../../tailor-proto/src/tailor/v1/tailordb_resource_pb.mjs";
@@ -60,6 +60,8 @@ interface SnapshotFieldConfig {
60
60
  serial?: SnapshotSerial;
61
61
  scale?: number;
62
62
  default?: unknown;
63
+ /** Recorded on remote-derived snapshots when the platform fills the value on create. */
64
+ optionalOnCreate?: boolean;
63
65
  /** Nested fields (recursive) */
64
66
  fields?: Record<string, SnapshotFieldConfig>;
65
67
  }
@@ -212,4 +214,4 @@ type NormalizedSchemaSnapshot = SchemaSnapshot & {
212
214
  readonly [normalizedSchemaSnapshotBrand]: true;
213
215
  };
214
216
  //#endregion
215
- export { NormalizedSchemaSnapshot, RebaselineMarker, SchemaSnapshot, SnapshotActionPermission, SnapshotEnumValue, SnapshotFieldConfig, SnapshotFieldRefOperand, SnapshotGqlAction, SnapshotGqlPermission, SnapshotGqlPermissionPolicy, SnapshotHook, SnapshotIndexConfig, SnapshotPermissionCondition, SnapshotPermissionOperand, SnapshotPermissionOperator, SnapshotRecordPermission, SnapshotRelationship, SnapshotSerial, SnapshotValidation, SnapshotValueOperand, TailorDBSnapshotType };
217
+ export { NormalizedSchemaSnapshot, RebaselineMarker, SchemaSnapshot, SnapshotActionPermission, SnapshotEnumValue, SnapshotFieldConfig, SnapshotFieldRefOperand, SnapshotGqlAction, SnapshotGqlPermission, SnapshotGqlPermissionPolicy, SnapshotHook, SnapshotIndexConfig, SnapshotPermissionCondition, SnapshotPermissionOperand, SnapshotPermissionOperator, SnapshotRecordPermission, SnapshotRelationship, SnapshotSerial, SnapshotValidation, TailorDBSnapshotType };
@@ -1,119 +1,7 @@
1
- import { TailorDBType } from "../../../../parser/service/tailordb/types.mjs";
2
- import "../../../../tailor-proto/src/tailor/v1/tailordb_resource_pb.mjs";
3
1
  import { NormalizedSchemaSnapshot, RebaselineMarker, SchemaSnapshot, SnapshotActionPermission, SnapshotEnumValue, SnapshotFieldConfig, SnapshotGqlPermission, SnapshotGqlPermissionPolicy, SnapshotIndexConfig, SnapshotPermissionCondition, SnapshotPermissionOperand, SnapshotRecordPermission, SnapshotRelationship, TailorDBSnapshotType } from "./snapshot-types.mjs";
4
- import { MigrationDiff } from "./diff-calculator.mjs";
5
- import { FieldRenameSpec, TypeRenameSpec } from "./rename-detection.mjs";
6
- //#region src/cli/commands/tailordb/migrate/snapshot.d.ts
7
- /**
8
- * Initial schema migration number (0000)
9
- */
10
- declare const INITIAL_SCHEMA_NUMBER = 0;
11
- /**
12
- * Migration file names (used within migration directories)
13
- */
14
- declare const SCHEMA_FILE_NAME = "schema.json";
15
- /** File name for migration diff metadata. */
16
- declare const DIFF_FILE_NAME = "diff.json";
17
- /** File name for migration script. */
18
- declare const MIGRATE_FILE_NAME = "migrate.ts";
19
- /** File name for migration script unit test. */
20
- declare const MIGRATE_TEST_FILE_NAME = "migrate.test.ts";
21
- /** File name for generated DB type definitions. */
22
- declare const DB_TYPES_FILE_NAME = "db.ts";
23
- /**
24
- * Migration file type
25
- */
26
- type MigrationFileType = "schema" | "diff" | "migrate" | "test" | "db";
27
- /**
28
- * Get migration directory path for a given number
29
- * @param {string} migrationsDir - Base migrations directory path
30
- * @param {number} num - Migration number
31
- * @returns {string} Full directory path for the migration
32
- */
33
- declare function getMigrationDirPath(migrationsDir: string, num: number): string;
34
- /**
35
- * Get migration file path for a given number and type
36
- * @param {string} migrationsDir - Migrations directory path
37
- * @param {number} num - Migration number
38
- * @param {MigrationFileType} type - File type
39
- * @returns {string} Full file path
40
- */
41
- declare function getMigrationFilePath(migrationsDir: string, num: number, type: MigrationFileType): string;
42
- /**
43
- * Create a schema snapshot from local type definitions
44
- * @param {Record<string, TailorDBType>} types - Local type definitions
45
- * @param {string} namespace - Namespace for the snapshot
46
- * @returns {NormalizedSchemaSnapshot} Normalized schema snapshot
47
- */
48
- declare function createSnapshotFromLocalTypes(types: Record<string, TailorDBType>, namespace: string): NormalizedSchemaSnapshot;
49
- /**
50
- * Get all migration directories and their files, sorted by number
51
- * @param {string} migrationsDir - Migrations directory path
52
- * @returns {Array<{number: number, type: "schema" | "diff", path: string}>} Migration files sorted by number
53
- */
54
- declare function getMigrationFiles(migrationsDir: string): {
55
- number: number;
56
- type: "schema" | "diff";
57
- path: string;
58
- }[];
59
- /**
60
- * Get the next migration number for a directory
61
- * Returns INITIAL_SCHEMA_NUMBER (0) if no migrations exist
62
- * @param {string} migrationsDir - Migrations directory path
63
- * @returns {number} Next migration number
64
- */
65
- declare function getNextMigrationNumber(migrationsDir: string): number;
66
- /**
67
- * Reconstruct the latest schema snapshot from all migration files
68
- * Returns null if no migrations exist
69
- * @param {string} migrationsDir - Migrations directory path
70
- * @param {number} [maxVersion] - Optional maximum migration version to apply
71
- * @returns {NormalizedSchemaSnapshot | null} Reconstructed normalized snapshot or null if no migrations exist
72
- */
73
- declare function reconstructSnapshotFromMigrations(migrationsDir: string, maxVersion?: number): NormalizedSchemaSnapshot | null;
74
- /**
75
- * Get the latest migration number from a directory
76
- * Returns 0 if no migrations exist
77
- * @param {string} migrationsDir - Migrations directory path
78
- * @returns {number} Latest migration number or 0 if no migrations exist
79
- */
80
- declare function getLatestMigrationNumber(migrationsDir: string): number;
81
- /**
82
- * Options for {@link compareSnapshots}.
83
- */
84
- interface CompareSnapshotsOptions {
85
- /**
86
- * Confirmed field renames. Each spec replaces the corresponding
87
- * `field_removed` + `field_added` pair with a single breaking
88
- * `field_renamed` change. Specs are validated against both snapshots.
89
- */
90
- fieldRenames?: readonly FieldRenameSpec[];
91
- /**
92
- * Confirmed type renames. Each spec replaces the corresponding
93
- * `table_removed` + `table_added` pair with a single breaking
94
- * `table_renamed` change. Specs are validated against both snapshots.
95
- */
96
- typeRenames?: readonly TypeRenameSpec[];
97
- }
98
- /**
99
- * Compare two normalized snapshots and generate a diff
100
- * @param {NormalizedSchemaSnapshot} previous - Previous normalized snapshot
101
- * @param {NormalizedSchemaSnapshot} current - Current normalized snapshot
102
- * @param {CompareSnapshotsOptions} [options] - Comparison options
103
- * @returns {MigrationDiff} Migration diff between snapshots
104
- */
105
- declare function compareSnapshots(previous: NormalizedSchemaSnapshot, current: NormalizedSchemaSnapshot, options?: CompareSnapshotsOptions): MigrationDiff;
106
- /**
107
- * Compare a snapshot against canonical TailorDBSnapshotType-shaped local types.
108
- * Callers are expected to pre-convert TailorDBService.types to TailorDBSnapshotType via
109
- * `createSnapshotType`. As a safety net, both sides are re-run through idempotent
110
- * normalization here, so a caller that forgets will still get correct
111
- * comparisons (no silent false drift).
112
- * @param {SchemaSnapshot} snapshot - Schema snapshot to compare against
113
- * @param {Record<string, TailorDBSnapshotType>} localTypes - Local snapshot-shaped types
114
- * @param {string} namespace - Namespace for comparison
115
- * @returns {MigrationDiff} Migration diff
116
- */
117
- declare function compareLocalTypesWithSnapshot(snapshot: SchemaSnapshot, localTypes: Record<string, TailorDBSnapshotType>, namespace: string): MigrationDiff;
118
- //#endregion
2
+ import { CompareSnapshotsOptions, compareLocalTypesWithSnapshot, compareSnapshots } from "./snapshot-comparison.mjs";
3
+ import { DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATE_TEST_FILE_NAME, MigrationFileType, SCHEMA_FILE_NAME, getLatestMigrationNumber, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNextMigrationNumber } from "./snapshot-files.mjs";
4
+ import { reconstructSnapshotFromMigrations } from "./snapshot-migrations.mjs";
5
+ import { createSnapshotFromLocalTypes } from "./snapshot-local.mjs";
6
+ import "./snapshot-remote.mjs";
119
7
  export { CompareSnapshotsOptions, DB_TYPES_FILE_NAME, DIFF_FILE_NAME, INITIAL_SCHEMA_NUMBER, MIGRATE_FILE_NAME, MIGRATE_TEST_FILE_NAME, MigrationFileType, type NormalizedSchemaSnapshot, SCHEMA_FILE_NAME, type SchemaSnapshot, type SnapshotFieldConfig, type TailorDBSnapshotType, compareLocalTypesWithSnapshot, compareSnapshots, createSnapshotFromLocalTypes, getLatestMigrationNumber, getMigrationDirPath, getMigrationFilePath, getMigrationFiles, getNextMigrationNumber, reconstructSnapshotFromMigrations };
@@ -6,11 +6,11 @@ interface TruncateOptions {
6
6
  configPath?: string;
7
7
  all?: boolean;
8
8
  namespace?: string;
9
- types?: string[];
9
+ tables?: string[];
10
10
  }
11
11
  /**
12
12
  * Truncate TailorDB data based on the given options.
13
- * @param options - Truncate options (all, namespace, or types)
13
+ * @param options - Truncate options (all, namespace, or tables)
14
14
  * @returns Promise that resolves when truncation completes
15
15
  */
16
16
  declare function truncate(options?: TruncateOptions): Promise<void>;