@tailor-platform/sdk 2.0.0-next.2 → 2.0.0-next.4

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 (441) hide show
  1. package/CHANGELOG.md +511 -10
  2. package/README.md +9 -9
  3. package/agent-skills/{tailor-sdk → tailor}/SKILL.md +3 -1
  4. package/dist/aigateway-DR4Kwuik.mjs +9 -0
  5. package/dist/aigateway-DR4Kwuik.mjs.map +1 -0
  6. package/dist/application-BO4ZF8wP.mjs +3 -0
  7. package/dist/application-BX13RArL.mjs +6669 -0
  8. package/dist/application-BX13RArL.mjs.map +1 -0
  9. package/dist/authconnection-CZvi9ANm.mjs +9 -0
  10. package/dist/authconnection-CZvi9ANm.mjs.map +1 -0
  11. package/dist/brand-Eo4pLXPJ.mjs.map +1 -1
  12. package/dist/cli/cache/bundle-cache.d.mts +1 -0
  13. package/dist/cli/cache/store.d.mts +1 -0
  14. package/dist/cli/cache/types.d.mts +1 -0
  15. package/dist/cli/commands/api/api-call.d.mts +19 -0
  16. package/dist/cli/commands/api/index.d.mts +3 -0
  17. package/dist/cli/commands/deploy/aigateway.d.mts +1 -0
  18. package/dist/cli/commands/deploy/application.d.mts +1 -0
  19. package/dist/cli/commands/deploy/apply-phases.d.mts +1 -0
  20. package/dist/cli/commands/deploy/auth.d.mts +1 -0
  21. package/dist/cli/commands/deploy/deploy.d.mts +24 -0
  22. package/dist/cli/commands/deploy/executor.d.mts +1 -0
  23. package/dist/cli/commands/deploy/function-registry-types.d.mts +12 -0
  24. package/dist/cli/commands/deploy/function-registry.d.mts +2 -0
  25. package/dist/cli/commands/deploy/idp.d.mts +1 -0
  26. package/dist/cli/commands/deploy/resolver.d.mts +1 -0
  27. package/dist/cli/commands/deploy/secret-manager.d.mts +1 -0
  28. package/dist/cli/commands/deploy/staticwebsite.d.mts +1 -0
  29. package/dist/cli/commands/deploy/tailordb/index.d.mts +1 -0
  30. package/dist/cli/commands/deploy/types.d.mts +1 -0
  31. package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +1 -0
  32. package/dist/cli/commands/deploy/workflow.d.mts +1 -0
  33. package/dist/cli/commands/executor/get.d.mts +29 -0
  34. package/dist/cli/commands/executor/jobs.d.mts +123 -0
  35. package/dist/cli/commands/executor/list.d.mts +19 -0
  36. package/dist/cli/commands/executor/transform.d.mts +41 -0
  37. package/dist/cli/commands/executor/trigger.d.mts +41 -0
  38. package/dist/cli/commands/executor/webhook.d.mts +22 -0
  39. package/dist/cli/commands/function/get.d.mts +18 -0
  40. package/dist/cli/commands/function/list.d.mts +22 -0
  41. package/dist/cli/commands/function/transform.d.mts +11 -0
  42. package/dist/cli/commands/generate/options.d.mts +7 -0
  43. package/dist/cli/commands/generate/seed/bundler.d.mts +26 -0
  44. package/dist/cli/commands/generate/service.d.mts +11 -0
  45. package/dist/cli/commands/machineuser/list.d.mts +27 -0
  46. package/dist/cli/commands/machineuser/token.d.mts +22 -0
  47. package/dist/cli/commands/oauth2client/get.d.mts +18 -0
  48. package/dist/cli/commands/oauth2client/list.d.mts +20 -0
  49. package/dist/cli/commands/oauth2client/transform.d.mts +20 -0
  50. package/dist/cli/commands/organization/folder/create.d.mts +18 -0
  51. package/dist/cli/commands/organization/folder/delete.d.mts +16 -0
  52. package/dist/cli/commands/organization/folder/get.d.mts +17 -0
  53. package/dist/cli/commands/organization/folder/list.d.mts +22 -0
  54. package/dist/cli/commands/organization/folder/update.d.mts +18 -0
  55. package/dist/cli/commands/organization/get.d.mts +16 -0
  56. package/dist/cli/commands/organization/list.d.mts +15 -0
  57. package/dist/cli/commands/organization/transform.d.mts +27 -0
  58. package/dist/cli/commands/organization/tree.d.mts +25 -0
  59. package/dist/cli/commands/organization/update.d.mts +17 -0
  60. package/dist/cli/commands/remove.d.mts +16 -0
  61. package/dist/cli/commands/show.d.mts +34 -0
  62. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +28 -0
  63. package/dist/cli/commands/tailordb/migrate/config.d.mts +19 -0
  64. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +223 -0
  65. package/dist/cli/commands/tailordb/migrate/generate.d.mts +17 -0
  66. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +202 -0
  67. package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +98 -0
  68. package/dist/cli/commands/tailordb/migrate/types.d.mts +7 -0
  69. package/dist/cli/commands/tailordb/truncate.d.mts +19 -0
  70. package/dist/cli/commands/workflow/executions.d.mts +75 -0
  71. package/dist/cli/commands/workflow/get.d.mts +29 -0
  72. package/dist/cli/commands/workflow/list.d.mts +19 -0
  73. package/dist/cli/commands/workflow/resume.d.mts +23 -0
  74. package/dist/cli/commands/workflow/start.d.mts +61 -0
  75. package/dist/cli/commands/workflow/status.d.mts +5 -0
  76. package/dist/cli/commands/workflow/transform.d.mts +33 -0
  77. package/dist/cli/commands/workflow/wait.d.mts +16 -0
  78. package/dist/cli/commands/workflow/waiter.d.mts +23 -0
  79. package/dist/cli/commands/workspace/app/health.d.mts +18 -0
  80. package/dist/cli/commands/workspace/app/list.d.mts +22 -0
  81. package/dist/cli/commands/workspace/app/transform.d.mts +18 -0
  82. package/dist/cli/commands/workspace/create.d.mts +25 -0
  83. package/dist/cli/commands/workspace/delete.d.mts +15 -0
  84. package/dist/cli/commands/workspace/get.d.mts +17 -0
  85. package/dist/cli/commands/workspace/list.d.mts +17 -0
  86. package/dist/cli/commands/workspace/restore.d.mts +15 -0
  87. package/dist/cli/commands/workspace/transform.d.mts +16 -0
  88. package/dist/cli/commands/workspace/user/invite.d.mts +22 -0
  89. package/dist/cli/commands/workspace/user/list.d.mts +22 -0
  90. package/dist/cli/commands/workspace/user/remove.d.mts +17 -0
  91. package/dist/cli/commands/workspace/user/transform.d.mts +8 -0
  92. package/dist/cli/commands/workspace/user/update.d.mts +22 -0
  93. package/dist/cli/erd-viewer-assets/app.js +279 -36
  94. package/dist/cli/erd-viewer-assets/index.html +4 -0
  95. package/dist/cli/erd-viewer-assets/styles.css +252 -5
  96. package/dist/cli/index.d.mts +18 -3
  97. package/dist/cli/index.mjs +2237 -520
  98. package/dist/cli/index.mjs.map +1 -1
  99. package/dist/cli/lib.d.mts +81 -21107
  100. package/dist/cli/lib.mjs +7 -10
  101. package/dist/cli/lib.mjs.map +1 -1
  102. package/dist/cli/query/index.d.mts +39 -0
  103. package/dist/cli/services/application.d.mts +1 -0
  104. package/dist/cli/services/auth/service.d.mts +1 -0
  105. package/dist/cli/services/executor/service.d.mts +1 -0
  106. package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
  107. package/dist/cli/services/http-adapter/service.d.mts +1 -0
  108. package/dist/cli/services/resolver/service.d.mts +1 -0
  109. package/dist/cli/services/tailordb/service.d.mts +1 -0
  110. package/dist/cli/services/workflow/bundler.d.mts +1 -0
  111. package/dist/cli/services/workflow/service.d.mts +1 -0
  112. package/dist/cli/shared/args.d.mts +13 -0
  113. package/dist/cli/shared/client.d.mts +1273 -0
  114. package/dist/cli/shared/config-loader.d.mts +26 -0
  115. package/dist/cli/shared/context.d.mts +28 -0
  116. package/dist/cli/shared/script-executor.d.mts +75 -0
  117. package/dist/cli/shared/seed-chunker.d.mts +46 -0
  118. package/dist/cli/shared/trigger-context.d.mts +1 -0
  119. package/dist/cli/shared/type-generator.d.mts +20 -0
  120. package/dist/cli/ts-hook.d.mts +4 -0
  121. package/dist/cli/ts-hook.mjs +333 -0
  122. package/dist/completion/zsh-worker.zsh +1531 -1131
  123. package/dist/configure/config/index.d.mts +21 -0
  124. package/dist/configure/config/types.d.mts +105 -0
  125. package/dist/configure/index.d.mts +124 -9
  126. package/dist/configure/index.mjs +136 -23
  127. package/dist/configure/index.mjs.map +1 -1
  128. package/dist/configure/services/aigateway/index.d.mts +17 -0
  129. package/dist/configure/services/aigateway/types.d.mts +11 -0
  130. package/dist/configure/services/auth/index.d.mts +34 -0
  131. package/dist/configure/services/auth/types.d.mts +172 -0
  132. package/dist/configure/services/executor/executor.d.mts +81 -0
  133. package/dist/configure/services/executor/index.d.mts +8 -0
  134. package/dist/configure/services/executor/operation.d.mts +45 -0
  135. package/dist/configure/services/executor/trigger/event.d.mts +272 -0
  136. package/dist/configure/services/executor/trigger/index.d.mts +8 -0
  137. package/dist/configure/services/executor/trigger/schedule.d.mts +25 -0
  138. package/dist/configure/services/executor/trigger/webhook.d.mts +44 -0
  139. package/dist/configure/services/executor/types.d.mts +2 -0
  140. package/dist/configure/services/http-adapter/http-adapter.d.mts +125 -0
  141. package/dist/configure/services/http-adapter/index.d.mts +2 -0
  142. package/dist/configure/services/idp/index.d.mts +64 -0
  143. package/dist/configure/services/idp/permission.d.mts +80 -0
  144. package/dist/configure/services/idp/types.d.mts +20 -0
  145. package/dist/configure/services/index.d.mts +34 -0
  146. package/dist/configure/services/resolver/index.d.mts +5 -0
  147. package/dist/configure/services/resolver/resolver.d.mts +75 -0
  148. package/dist/configure/services/resolver/types.d.mts +6 -0
  149. package/dist/configure/services/secrets/index.d.mts +38 -0
  150. package/dist/configure/services/secrets/types.d.mts +11 -0
  151. package/dist/configure/services/staticwebsite/index.d.mts +19 -0
  152. package/dist/configure/services/staticwebsite/types.d.mts +11 -0
  153. package/dist/configure/services/tailordb/index.d.mts +4 -0
  154. package/dist/configure/services/tailordb/permission.d.mts +119 -0
  155. package/dist/configure/services/tailordb/schema.d.mts +456 -0
  156. package/dist/configure/services/tailordb/types.d.mts +149 -0
  157. package/dist/configure/services/workflow/execution-policy.d.mts +71 -0
  158. package/dist/configure/services/workflow/execution-policy.types.d.mts +104 -0
  159. package/dist/configure/services/workflow/index.d.mts +8 -0
  160. package/dist/configure/services/workflow/job.d.mts +84 -0
  161. package/dist/configure/services/workflow/types.d.mts +2 -0
  162. package/dist/configure/services/workflow/wait-point.d.mts +73 -0
  163. package/dist/configure/services/workflow/workflow.d.mts +54 -0
  164. package/dist/configure/types/aigateway-name.d.mts +12 -0
  165. package/dist/configure/types/connection-name.d.mts +12 -0
  166. package/dist/configure/types/field-runtime.d.mts +17 -0
  167. package/dist/configure/types/field.d.mts +9 -0
  168. package/dist/configure/types/field.types.d.mts +109 -0
  169. package/dist/configure/types/idp-name.d.mts +12 -0
  170. package/dist/configure/types/index.d.mts +4 -0
  171. package/dist/configure/types/machine-user.d.mts +2 -0
  172. package/dist/configure/types/type.d.mts +82 -0
  173. package/dist/{context-Bd266-ru.mjs → context-DYQVYWqZ.mjs} +4 -5
  174. package/dist/context-DYQVYWqZ.mjs.map +1 -0
  175. package/dist/{crashreport-DFq-vsU0.mjs → crashreport-Cg-pqRJV.mjs} +6 -6
  176. package/dist/{crashreport-DFq-vsU0.mjs.map → crashreport-Cg-pqRJV.mjs.map} +1 -1
  177. package/dist/{crashreport-BMWcxeSE.mjs → crashreport-D3RjuSYb.mjs} +1 -1
  178. package/dist/enum-constants-j9QBF0cB.mjs.map +1 -1
  179. package/dist/{errors-Dtf2WPaW.mjs → errors-118wUDRr.mjs} +2 -2
  180. package/dist/errors-118wUDRr.mjs.map +1 -0
  181. package/dist/field-runtime-CAnh_oow.mjs +183 -0
  182. package/dist/field-runtime-CAnh_oow.mjs.map +1 -0
  183. package/dist/{file-BbdFGdMV.mjs → file-BUcmVIH2.mjs} +12 -14
  184. package/dist/file-BUcmVIH2.mjs.map +1 -0
  185. package/dist/{file-utils-CYZnO1pX.mjs → file-utils-yEiIS4nJ.mjs} +2 -2
  186. package/dist/file-utils-yEiIS4nJ.mjs.map +1 -0
  187. package/dist/{globals-Cf0sxIt8.mjs → globals-BjhJJ2dN.mjs} +5 -47
  188. package/dist/globals-BjhJJ2dN.mjs.map +1 -0
  189. package/dist/iconv-QWaZh0TT.mjs +38 -0
  190. package/dist/iconv-QWaZh0TT.mjs.map +1 -0
  191. package/dist/{idp-BDbK5gjm.mjs → idp-RA_swu-h.mjs} +12 -5
  192. package/dist/idp-RA_swu-h.mjs.map +1 -0
  193. package/dist/{interceptor-D-q1rvRl.mjs → interceptor-e33JtsC-.mjs} +2 -2
  194. package/dist/interceptor-e33JtsC-.mjs.map +1 -0
  195. package/dist/kysely/index.d.mts +2 -3
  196. package/dist/{kysely-type-DR8uzZTA.mjs → kysely-type-D-zflMGf.mjs} +2 -2
  197. package/dist/{kysely-type-DR8uzZTA.mjs.map → kysely-type-D-zflMGf.mjs.map} +1 -1
  198. package/dist/{logger-CxF-Ex5d.mjs → logger-BEiZZ3qT.mjs} +3 -3
  199. package/dist/{logger-CxF-Ex5d.mjs.map → logger-BEiZZ3qT.mjs.map} +1 -1
  200. package/dist/parser/service/auth/index.d.mts +1 -0
  201. package/dist/parser/service/auth/schema.d.mts +1 -0
  202. package/dist/parser/service/http-adapter/index.d.mts +1 -0
  203. package/dist/parser/service/http-adapter/schema.d.mts +1 -0
  204. package/dist/parser/service/idp/types.d.mts +4 -0
  205. package/dist/parser/service/tailordb/types.d.mts +126 -0
  206. package/dist/platform-serialize-RoRtBS0v.mjs +46 -0
  207. package/dist/platform-serialize-RoRtBS0v.mjs.map +1 -0
  208. package/dist/plugin/builtin/enum-constants/index.d.mts +16 -1
  209. package/dist/plugin/builtin/file-utils/index.d.mts +16 -1
  210. package/dist/plugin/builtin/file-utils/index.mjs +1 -1
  211. package/dist/plugin/builtin/kysely-type/index.d.mts +16 -1
  212. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  213. package/dist/plugin/builtin/seed/index.d.mts +45 -1
  214. package/dist/plugin/builtin/seed/index.mjs +1 -1
  215. package/dist/plugin/get-generated-type.d.mts +17 -0
  216. package/dist/plugin/index.d.mts +3 -118
  217. package/dist/plugin/index.mjs +1 -1
  218. package/dist/plugin/index.mjs.map +1 -1
  219. package/dist/plugin/manager.d.mts +1 -0
  220. package/dist/plugin/types.d.mts +243 -0
  221. package/dist/plugin/with-context.d.mts +102 -0
  222. package/dist/{runtime-CY4JvrDj.mjs → register-ts-hook-BM1caLT0.mjs} +4128 -2744
  223. package/dist/register-ts-hook-BM1caLT0.mjs.map +1 -0
  224. package/dist/{registry-DH4m7eYo.mjs → registry-BSbq6SPo.mjs} +4 -3
  225. package/dist/registry-BSbq6SPo.mjs.map +1 -0
  226. package/dist/{repl-editor-DmGr9zMw.mjs → repl-editor-BCozyiNq.mjs} +6 -5
  227. package/dist/{repl-editor-DmGr9zMw.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
  228. package/dist/resource_pb-BRv7AMXK.mjs +49 -0
  229. package/dist/resource_pb-BRv7AMXK.mjs.map +1 -0
  230. package/dist/runtime/aigateway.d.mts +26 -0
  231. package/dist/runtime/aigateway.mjs +3 -0
  232. package/dist/runtime/authconnection.d.mts +22 -2
  233. package/dist/runtime/authconnection.mjs +2 -2
  234. package/dist/runtime/context.d.mts +55 -2
  235. package/dist/runtime/context.mjs +2 -2
  236. package/dist/runtime/file.d.mts +170 -2
  237. package/dist/runtime/file.mjs +2 -2
  238. package/dist/runtime/globals.d.mts +31 -19
  239. package/dist/runtime/iconv.d.mts +73 -2
  240. package/dist/runtime/iconv.mjs +2 -2
  241. package/dist/runtime/idp.d.mts +129 -2
  242. package/dist/runtime/idp.mjs +2 -2
  243. package/dist/runtime/index.d.mts +47 -9
  244. package/dist/runtime/index.mjs +9 -8
  245. package/dist/runtime/secretmanager.d.mts +41 -2
  246. package/dist/runtime/secretmanager.mjs +2 -2
  247. package/dist/{types-BZ7QKVE8.d.mts → runtime/types.d.mts} +4 -5
  248. package/dist/runtime/workflow.d.mts +113 -2
  249. package/dist/runtime/workflow.mjs +2 -2
  250. package/dist/{schema-Dtw9Orye.mjs → schema-C4LYbXVG.mjs} +21 -186
  251. package/dist/schema-C4LYbXVG.mjs.map +1 -0
  252. package/dist/{secret-file-VSVGy1V0.mjs → secret-file-aoNXJmKa.mjs} +3 -3
  253. package/dist/secret-file-aoNXJmKa.mjs.map +1 -0
  254. package/dist/secretmanager-Bd45j7an.mjs +98 -0
  255. package/dist/secretmanager-Bd45j7an.mjs.map +1 -0
  256. package/dist/secretmanager-CYlpffsz.mjs +13 -0
  257. package/dist/secretmanager-CYlpffsz.mjs.map +1 -0
  258. package/dist/seed/index.d.mts +1 -2
  259. package/dist/{seed-izIEyP3z.mjs → seed-CRSQJI_z.mjs} +14 -3
  260. package/dist/seed-CRSQJI_z.mjs.map +1 -0
  261. package/dist/service-CkIwEctX.mjs +3 -0
  262. package/dist/{service-DU1mVzri2.mjs → service-DeZeYa06.mjs} +3 -3
  263. package/dist/service-DeZeYa06.mjs.map +1 -0
  264. package/dist/{service-DjyqbCaJ.mjs → service-ufH7sS8o.mjs} +396 -58
  265. package/dist/service-ufH7sS8o.mjs.map +1 -0
  266. package/dist/service_pb-B2FF59sP.mjs +3 -0
  267. package/dist/service_pb-B5w9rjPY.mjs +955 -0
  268. package/dist/service_pb-B5w9rjPY.mjs.map +1 -0
  269. package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +204 -0
  270. package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +58 -0
  271. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +316 -0
  272. package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +161 -0
  273. package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2070 -0
  274. package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +861 -0
  275. package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +112 -0
  276. package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +69 -0
  277. package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +439 -0
  278. package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +564 -0
  279. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +145 -0
  280. package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +451 -0
  281. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +192 -0
  282. package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +50 -0
  283. package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +407 -0
  284. package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +430 -0
  285. package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +73 -0
  286. package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +17 -0
  287. package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +309 -0
  288. package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +591 -0
  289. package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +330 -0
  290. package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +113 -0
  291. package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +346 -0
  292. package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +54 -0
  293. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3576 -0
  294. package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +187 -0
  295. package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +29 -0
  296. package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +429 -0
  297. package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +90 -0
  298. package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +684 -0
  299. package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +797 -0
  300. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +330 -0
  301. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +183 -0
  302. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +862 -0
  303. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +310 -0
  304. package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2015 -0
  305. package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +483 -0
  306. package/dist/{telemetry-CdqJEzkj.mjs → telemetry-BRVdwh14.mjs} +3 -3
  307. package/dist/telemetry-BRVdwh14.mjs.map +1 -0
  308. package/dist/telemetry-CkbkeJxl.mjs +3 -0
  309. package/dist/types/aigateway.generated.d.mts +9 -0
  310. package/dist/types/app-config.generated.d.mts +4 -0
  311. package/dist/types/auth-connection.generated.d.mts +20 -0
  312. package/dist/types/auth.generated.d.mts +145 -0
  313. package/dist/types/executor.generated.d.mts +177 -0
  314. package/dist/types/helpers.d.mts +39 -0
  315. package/dist/types/http-adapter.generated.d.mts +17 -0
  316. package/dist/{workflow.generated-ClEjBYhm.d.mts → types/idp.generated.d.mts} +98 -185
  317. package/dist/types/resolver.generated.d.mts +39 -0
  318. package/dist/types/secrets.generated.d.mts +14 -0
  319. package/dist/types/staticwebsite.generated.d.mts +10 -0
  320. package/dist/{types-CdcQh4Z2.d.mts → types/tailordb.generated.d.mts} +2 -287
  321. package/dist/types/workflow.generated.d.mts +12 -0
  322. package/dist/types-C-lQ4se3.mjs +4 -0
  323. package/dist/types-CXF2OYdR.mjs +199 -0
  324. package/dist/types-CXF2OYdR.mjs.map +1 -0
  325. package/dist/utils/test/index.d.mts +5 -89
  326. package/dist/utils/test/index.mjs.map +1 -1
  327. package/dist/utils/test/mock.d.mts +87 -0
  328. package/dist/vitest/environment.d.mts +1 -2
  329. package/dist/vitest/environment.mjs +2 -2
  330. package/dist/vitest/environment.mjs.map +1 -1
  331. package/dist/vitest/index.d.mts +12 -428
  332. package/dist/vitest/index.mjs +740 -9
  333. package/dist/vitest/index.mjs.map +1 -1
  334. package/dist/vitest/mock-kysely.d.mts +62 -0
  335. package/dist/vitest/mock.d.mts +9 -0
  336. package/dist/vitest/mocks/aigateway.d.mts +30 -0
  337. package/dist/vitest/mocks/authconnection.d.mts +28 -0
  338. package/dist/vitest/mocks/file.d.mts +41 -0
  339. package/dist/vitest/mocks/iconv.d.mts +27 -0
  340. package/dist/vitest/mocks/idp.d.mts +44 -0
  341. package/dist/vitest/mocks/secretmanager.d.mts +33 -0
  342. package/dist/vitest/mocks/tailordb.d.mts +71 -0
  343. package/dist/vitest/mocks/workflow.d.mts +117 -0
  344. package/dist/vitest/setup.d.mts +1 -2
  345. package/dist/vitest/setup.mjs +2 -2
  346. package/dist/vitest/workflow-local.d.mts +40 -0
  347. package/dist/workflow-GNuSnsTx.mjs +22 -0
  348. package/dist/workflow-GNuSnsTx.mjs.map +1 -0
  349. package/docs/cli/application.md +98 -250
  350. package/docs/cli/auth.md +51 -295
  351. package/docs/cli/completion.md +1 -25
  352. package/docs/cli/crashreport.md +3 -61
  353. package/docs/cli/executor.md +23 -187
  354. package/docs/cli/function.md +14 -130
  355. package/docs/cli/organization.md +11 -221
  356. package/docs/cli/plugin.md +29 -0
  357. package/docs/cli/query.md +2 -22
  358. package/docs/cli/secret.md +71 -251
  359. package/docs/cli/setup.md +137 -41
  360. package/docs/cli/skills.md +50 -39
  361. package/docs/cli/staticwebsite.md +32 -180
  362. package/docs/cli/tailordb.md +97 -323
  363. package/docs/cli/upgrade.md +2 -22
  364. package/docs/cli/user.md +78 -247
  365. package/docs/cli/workflow.md +44 -203
  366. package/docs/cli/workspace.md +165 -538
  367. package/docs/cli-reference.md +167 -67
  368. package/docs/configuration.md +34 -4
  369. package/docs/github-actions.md +46 -19
  370. package/docs/migration/v2.md +397 -26
  371. package/docs/multi-environment.md +29 -7
  372. package/docs/plugin/custom.md +4 -4
  373. package/docs/plugin/index.md +8 -8
  374. package/docs/quickstart.md +8 -7
  375. package/docs/runtime.md +9 -3
  376. package/docs/services/aigateway.md +18 -2
  377. package/docs/services/auth.md +34 -42
  378. package/docs/services/http-adapter.md +16 -1
  379. package/docs/services/idp.md +55 -2
  380. package/docs/services/resolver.md +2 -2
  381. package/docs/services/secret.md +11 -11
  382. package/docs/services/staticwebsite.md +8 -2
  383. package/docs/services/tailordb-migration.md +25 -23
  384. package/docs/services/tailordb.md +55 -32
  385. package/docs/services/workflow.md +92 -14
  386. package/docs/testing.md +49 -3
  387. package/package.json +42 -31
  388. package/postinstall.mjs +4 -6
  389. package/dist/application-Dtqap5jM.mjs +0 -3
  390. package/dist/application-XuMWK4eq.mjs +0 -7257
  391. package/dist/application-XuMWK4eq.mjs.map +0 -1
  392. package/dist/authconnection-D2MhtTN5.mjs +0 -15
  393. package/dist/authconnection-D2MhtTN5.mjs.map +0 -1
  394. package/dist/authconnection-DvUQAjQS.d.mts +0 -39
  395. package/dist/context-Bd266-ru.mjs.map +0 -1
  396. package/dist/context-C2lEi9uw.d.mts +0 -47
  397. package/dist/errors-Dtf2WPaW.mjs.map +0 -1
  398. package/dist/field-DOsJCPFa.mjs +0 -22
  399. package/dist/field-DOsJCPFa.mjs.map +0 -1
  400. package/dist/file-BbdFGdMV.mjs.map +0 -1
  401. package/dist/file-Dq3NIt_F.d.mts +0 -211
  402. package/dist/file-utils-CYZnO1pX.mjs.map +0 -1
  403. package/dist/globals-Cf0sxIt8.mjs.map +0 -1
  404. package/dist/http-adapter.generated-DFsXDdm5.d.mts +0 -581
  405. package/dist/iconv-Co-TOPuH.d.mts +0 -122
  406. package/dist/iconv-D2vi8G36.mjs +0 -63
  407. package/dist/iconv-D2vi8G36.mjs.map +0 -1
  408. package/dist/idp-BDbK5gjm.mjs.map +0 -1
  409. package/dist/idp-DrhVrLmV.d.mts +0 -160
  410. package/dist/index-BI-_j9Z3.d.mts +0 -1013
  411. package/dist/index-C4JirJH8.d.mts +0 -18
  412. package/dist/index-CZfWhr0a.d.mts +0 -18
  413. package/dist/index-Cg8VKAdN.d.mts +0 -46
  414. package/dist/index-DYRjoLXD.d.mts +0 -47
  415. package/dist/index-lFpcjHPU.d.mts +0 -201
  416. package/dist/index-nW7hE6oE.d.mts +0 -18
  417. package/dist/interceptor-D-q1rvRl.mjs.map +0 -1
  418. package/dist/mock-FPxmnt-y.mjs +0 -759
  419. package/dist/mock-FPxmnt-y.mjs.map +0 -1
  420. package/dist/registry-DH4m7eYo.mjs.map +0 -1
  421. package/dist/rolldown-runtime-DXywRVcq.mjs +0 -20
  422. package/dist/runtime-CY4JvrDj.mjs.map +0 -1
  423. package/dist/schema-Dtw9Orye.mjs.map +0 -1
  424. package/dist/secret-file-VSVGy1V0.mjs.map +0 -1
  425. package/dist/secretmanager-B3n4KHfm.d.mts +0 -55
  426. package/dist/secretmanager-BVxw3ih_.mjs +0 -24
  427. package/dist/secretmanager-BVxw3ih_.mjs.map +0 -1
  428. package/dist/seed-izIEyP3z.mjs.map +0 -1
  429. package/dist/service-DCqIWibD.mjs +0 -3
  430. package/dist/service-DU1mVzri2.mjs.map +0 -1
  431. package/dist/service-DjyqbCaJ.mjs.map +0 -1
  432. package/dist/telemetry-CdqJEzkj.mjs.map +0 -1
  433. package/dist/telemetry-ClwW5ohF.mjs +0 -3
  434. package/dist/types-74etvaxy.mjs +0 -4
  435. package/dist/types-BDRml5C3.d.mts +0 -574
  436. package/dist/types-BQijbo4m.mjs +0 -371
  437. package/dist/types-BQijbo4m.mjs.map +0 -1
  438. package/dist/types-BX4q6Mo6.d.mts +0 -339
  439. package/dist/workflow-BOmaZwwG.mjs +0 -43
  440. package/dist/workflow-BOmaZwwG.mjs.map +0 -1
  441. package/dist/workflow-BVy4XWjS.d.mts +0 -101
@@ -1,9 +1,10 @@
1
1
  import { n as isSdkBranded } from "./brand-Eo4pLXPJ.mjs";
2
- import { n as logger, r as styles } from "./logger-CxF-Ex5d.mjs";
2
+ import { n as logger, r as styles } from "./logger-BEiZZ3qT.mjs";
3
+ import * as path from "pathe";
3
4
  import { z } from "zod";
4
5
  import * as fs from "node:fs";
5
- import * as path from "pathe";
6
6
  import { pathToFileURL } from "node:url";
7
+ import * as inflection from "inflection";
7
8
 
8
9
  //#region src/parser/service/common.ts
9
10
  const functionSchema = z.custom((val) => typeof val === "function");
@@ -41,9 +42,316 @@ function loadFilesWithIgnores(config) {
41
42
  return files;
42
43
  }
43
44
 
45
+ //#endregion
46
+ //#region src/parser/service/tailordb/relation.ts
47
+ const relationTypes = {
48
+ "1-1": "1-1",
49
+ oneToOne: "1-1",
50
+ "n-1": "n-1",
51
+ manyToOne: "n-1",
52
+ "N-1": "n-1",
53
+ keyOnly: "keyOnly"
54
+ };
55
+ const relationTypesKeys = Object.keys(relationTypes);
56
+ function fieldRef(context) {
57
+ return `Field "${context.fieldName}" on type "${context.typeName}"`;
58
+ }
59
+ /**
60
+ * Validate relation configuration.
61
+ * @param rawRelation - Raw relation configuration from TailorDB type definition
62
+ * @param context - Context information for the relation (type name, field name, all type names)
63
+ */
64
+ function validateRelationConfig(rawRelation, context) {
65
+ if (!rawRelation.type) throw new Error(`${fieldRef(context)} has a relation but is missing the required 'type' property. Valid values: ${relationTypesKeys.join(", ")}.`);
66
+ if (!(rawRelation.type in relationTypes)) throw new Error(`${fieldRef(context)} has invalid relation type '${rawRelation.type}'. Valid values: ${relationTypesKeys.join(", ")}.`);
67
+ if (rawRelation.toward.type !== "self" && !context.allTypeNames.has(rawRelation.toward.type)) throw new Error(`${fieldRef(context)} references unknown type "${rawRelation.toward.type}".`);
68
+ }
69
+ /**
70
+ * Process raw relation config and compute derived metadata values.
71
+ * @param rawRelation - Raw relation configuration
72
+ * @param context - Context information for the relation
73
+ * @param isArrayField - Whether the target field is an array field
74
+ * @returns Computed relation metadata to apply to field config
75
+ */
76
+ function processRelationMetadata(rawRelation, context, isArrayField = false) {
77
+ const isUnique = relationTypes[rawRelation.type] === "1-1";
78
+ const key = rawRelation.toward.key ?? "id";
79
+ const targetTypeName = rawRelation.toward.type === "self" ? context.typeName : rawRelation.toward.type;
80
+ const shouldSetIndex = !isArrayField;
81
+ const shouldSetUnique = !isArrayField && isUnique;
82
+ return {
83
+ index: shouldSetIndex,
84
+ foreignKey: true,
85
+ relationType: rawRelation.type,
86
+ unique: shouldSetUnique,
87
+ foreignKeyType: targetTypeName,
88
+ foreignKeyField: key
89
+ };
90
+ }
91
+ /**
92
+ * Build relation info for creating forward/backward relationships.
93
+ * Returns undefined for keyOnly relations.
94
+ * @param rawRelation - Raw relation configuration
95
+ * @param context - Context information for the relation
96
+ * @returns Relation information or undefined for keyOnly relations
97
+ */
98
+ function buildRelationInfo(rawRelation, context) {
99
+ if (rawRelation.type === "keyOnly") return;
100
+ const isUnique = relationTypes[rawRelation.type] === "1-1";
101
+ const key = rawRelation.toward.key ?? "id";
102
+ const targetTypeName = rawRelation.toward.type === "self" ? context.typeName : rawRelation.toward.type;
103
+ let forwardName = rawRelation.toward.as;
104
+ if (!forwardName) if (rawRelation.toward.type === "self") forwardName = context.fieldName.replace(/(ID|Id|id)$/u, "");
105
+ else forwardName = inflection.camelize(targetTypeName, true);
106
+ return {
107
+ targetType: targetTypeName,
108
+ forwardName,
109
+ backwardName: rawRelation.backward ?? "",
110
+ key,
111
+ unique: isUnique
112
+ };
113
+ }
114
+ /**
115
+ * Apply processed relation metadata to field config.
116
+ * @param fieldConfig - Original operator field configuration
117
+ * @param metadata - Processed relation metadata to apply
118
+ * @returns Field config with relation metadata applied
119
+ */
120
+ function applyRelationMetadataToFieldConfig(fieldConfig, metadata) {
121
+ return {
122
+ ...fieldConfig,
123
+ index: metadata.index,
124
+ foreignKey: metadata.foreignKey,
125
+ unique: metadata.unique,
126
+ foreignKeyType: metadata.foreignKeyType,
127
+ foreignKeyField: metadata.foreignKeyField
128
+ };
129
+ }
130
+
131
+ //#endregion
132
+ //#region src/parser/service/tailordb/schema.ts
133
+ /**
134
+ * Normalize GqlOperationsConfig (alias or object) to GqlOperations object.
135
+ * "query" alias expands to read-only mode: { create: false, update: false, delete: false, read: true }
136
+ * @param config - The config to normalize
137
+ * @returns The normalized GqlOperations object
138
+ */
139
+ function normalizeGqlOperations(config) {
140
+ if (config === "query") return {
141
+ create: false,
142
+ update: false,
143
+ delete: false,
144
+ read: true
145
+ };
146
+ return config;
147
+ }
148
+ /**
149
+ * Zod schema for GqlOperations configuration with normalization transform.
150
+ * Accepts "query" alias or detailed object, normalizes to GqlOperations object.
151
+ */
152
+ const GqlOperationsSchema = z.union([z.literal("query"), z.strictObject({
153
+ create: z.boolean().optional().describe("Enable create mutation (default: true)"),
154
+ update: z.boolean().optional().describe("Enable update mutation (default: true)"),
155
+ delete: z.boolean().optional().describe("Enable delete mutation (default: true)"),
156
+ read: z.boolean().optional().describe("Enable read queries - get, list, aggregation (default: true)")
157
+ })]).describe("Configuration for GraphQL operations on a TailorDB type.\nAll operations are enabled by default (undefined or true = enabled, false = disabled).").transform((val) => normalizeGqlOperations(val));
158
+ const TailorFieldTypeSchema$1 = z.enum([
159
+ "uuid",
160
+ "string",
161
+ "boolean",
162
+ "integer",
163
+ "float",
164
+ "decimal",
165
+ "enum",
166
+ "date",
167
+ "datetime",
168
+ "time",
169
+ "nested"
170
+ ]);
171
+ const AllowedValueSchema$1 = z.strictObject({
172
+ value: z.string(),
173
+ description: z.string().optional()
174
+ });
175
+ const DBFieldMetadataSchema = z.strictObject({
176
+ required: z.boolean().optional().describe("Whether the field is required"),
177
+ array: z.boolean().optional().describe("Whether the field is an array"),
178
+ description: z.string().optional().describe("Field description"),
179
+ typeName: z.string().optional().describe("Type name for nested or enum fields"),
180
+ allowedValues: z.array(AllowedValueSchema$1).optional().describe("Allowed values for enum fields"),
181
+ index: z.boolean().optional().describe("Whether the field is indexed for faster queries"),
182
+ unique: z.boolean().optional().describe("Whether the field value must be unique"),
183
+ vector: z.boolean().optional().describe("Whether the field is a vector field for similarity search"),
184
+ foreignKey: z.boolean().optional().describe("Whether the field is a foreign key"),
185
+ foreignKeyType: z.string().optional().describe("Target type name for foreign key relations"),
186
+ foreignKeyField: z.string().optional().describe("Target field name for foreign key relations"),
187
+ hooks: z.strictObject({
188
+ create: functionSchema.optional().describe("Hook function called on record creation"),
189
+ update: functionSchema.optional().describe("Hook function called on record update")
190
+ }).optional().describe("Lifecycle hooks for the field"),
191
+ validate: z.array(z.union([functionSchema, z.tuple([functionSchema, z.string()])])).optional().describe("Validation functions for the field"),
192
+ serial: z.strictObject({
193
+ start: z.number().describe("Starting value for the serial sequence"),
194
+ maxValue: z.number().optional().describe("Maximum value for the serial sequence"),
195
+ format: z.string().optional().describe("Format string for serial value (string type only)")
196
+ }).optional().describe("Serial (auto-increment) configuration"),
197
+ scale: z.number().int().min(0).max(12).optional().describe("Decimal scale (number of digits after decimal point, 0-12)")
198
+ });
199
+ const RelationTypeSchema = z.enum(relationTypesKeys);
200
+ const RawRelationConfigSchema = z.strictObject({
201
+ type: RelationTypeSchema.describe("Relation cardinality type"),
202
+ toward: z.strictObject({
203
+ type: z.string().describe("Target type name, or 'self' for self-relations"),
204
+ as: z.string().optional().describe("Custom forward relation name"),
205
+ key: z.string().optional().describe("Target field to join on (default: 'id')")
206
+ }),
207
+ backward: z.string().optional().describe("Backward relation name on the target type")
208
+ });
209
+ const TailorDBFieldSchema = z.lazy(() => z.object({
210
+ type: TailorFieldTypeSchema$1,
211
+ fields: z.record(z.string(), TailorDBFieldSchema).optional(),
212
+ metadata: DBFieldMetadataSchema,
213
+ rawRelation: RawRelationConfigSchema.optional()
214
+ }));
215
+ /**
216
+ * Schema for TailorDB type settings.
217
+ * Normalizes gqlOperations from alias ("query") to object format.
218
+ */
219
+ const TailorDBTypeSettingsSchema = z.strictObject({
220
+ pluralForm: z.string().optional().describe("Custom plural form of the type name for GraphQL"),
221
+ aggregation: z.boolean().optional().describe("Enable aggregation queries for this type"),
222
+ bulkUpsert: z.boolean().optional().describe("Enable bulk upsert mutation for this type"),
223
+ gqlOperations: GqlOperationsSchema.optional().describe("Configure GraphQL operations for this type. Use \"query\" for read-only mode, or an object for granular control."),
224
+ publishEvents: z.boolean().optional().describe("Enable publishing events for this type.\nWhen enabled, record creation/update/deletion events are published.\nIf not specified, this is automatically set to true when an executor uses this type\nwith recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false\nwhile an executor uses this type, an error will be thrown during apply.")
225
+ });
226
+ const GQL_PERMISSION_INVALID_OPERAND_MESSAGE = "operand is not supported in gqlPermission. Use permission() for record-level conditions.";
227
+ const GqlPermissionOperandSchema = z.union([
228
+ z.strictObject({ user: z.string() }),
229
+ z.string(),
230
+ z.boolean(),
231
+ z.array(z.string()),
232
+ z.array(z.boolean())
233
+ ], { error: (issue) => {
234
+ if (typeof issue.input === "object" && issue.input !== null) {
235
+ const keys = Object.keys(issue.input);
236
+ if (keys.length === 1) return `"${keys[0]}" ${GQL_PERMISSION_INVALID_OPERAND_MESSAGE}`;
237
+ return "Operand object must have exactly 1 key";
238
+ }
239
+ return "Invalid operand in gqlPermission";
240
+ } });
241
+ const RecordPermissionOperandSchema = z.union([
242
+ GqlPermissionOperandSchema,
243
+ z.strictObject({ record: z.string() }),
244
+ z.strictObject({ oldRecord: z.string() }),
245
+ z.strictObject({ newRecord: z.string() })
246
+ ]);
247
+ const PermissionOperatorSchema = z.enum([
248
+ "=",
249
+ "!=",
250
+ "in",
251
+ "not in",
252
+ "hasAny",
253
+ "not hasAny"
254
+ ]);
255
+ const RecordPermissionConditionSchema = z.tuple([
256
+ RecordPermissionOperandSchema,
257
+ PermissionOperatorSchema,
258
+ RecordPermissionOperandSchema
259
+ ]).readonly();
260
+ const GqlPermissionConditionSchema = z.tuple([
261
+ GqlPermissionOperandSchema,
262
+ PermissionOperatorSchema,
263
+ GqlPermissionOperandSchema
264
+ ]).readonly();
265
+ const ActionPermissionSchema = z.union([
266
+ z.strictObject({
267
+ conditions: z.union([RecordPermissionConditionSchema, z.array(RecordPermissionConditionSchema).readonly()]),
268
+ description: z.string().optional(),
269
+ permit: z.boolean().optional()
270
+ }),
271
+ z.tuple([
272
+ RecordPermissionOperandSchema,
273
+ PermissionOperatorSchema,
274
+ RecordPermissionOperandSchema
275
+ ]).readonly(),
276
+ z.tuple([
277
+ RecordPermissionOperandSchema,
278
+ PermissionOperatorSchema,
279
+ RecordPermissionOperandSchema,
280
+ z.boolean()
281
+ ]).readonly(),
282
+ z.array(z.union([RecordPermissionConditionSchema, z.boolean()])).refine((arr) => {
283
+ const boolIndex = arr.findIndex((item) => typeof item === "boolean");
284
+ return boolIndex === -1 || boolIndex === arr.length - 1;
285
+ }, { message: "Boolean permit flag must only appear at the end" }).readonly()
286
+ ]);
287
+ const GqlPermissionActionSchema = z.enum([
288
+ "read",
289
+ "create",
290
+ "update",
291
+ "delete",
292
+ "aggregate",
293
+ "bulkUpsert"
294
+ ]);
295
+ const GqlPermissionPolicySchema = z.strictObject({
296
+ conditions: z.array(GqlPermissionConditionSchema).readonly(),
297
+ actions: z.union([z.literal("all"), z.array(GqlPermissionActionSchema).readonly()]),
298
+ permit: z.boolean().optional(),
299
+ description: z.string().optional()
300
+ });
301
+ const RawPermissionsSchema = z.strictObject({
302
+ record: z.strictObject({
303
+ create: z.array(ActionPermissionSchema).readonly(),
304
+ read: z.array(ActionPermissionSchema).readonly(),
305
+ update: z.array(ActionPermissionSchema).readonly(),
306
+ delete: z.array(ActionPermissionSchema).readonly()
307
+ }).optional(),
308
+ gql: z.array(GqlPermissionPolicySchema).readonly().optional()
309
+ });
310
+ const TailorDBTypeSchema = z.strictObject({
311
+ name: z.string(),
312
+ fields: z.record(z.string(), TailorDBFieldSchema),
313
+ metadata: z.object({
314
+ name: z.string(),
315
+ description: z.string().optional(),
316
+ settings: TailorDBTypeSettingsSchema.optional(),
317
+ permissions: RawPermissionsSchema,
318
+ files: z.record(z.string(), z.string()),
319
+ indexes: z.record(z.string(), z.strictObject({
320
+ fields: z.array(z.string()),
321
+ unique: z.boolean().optional()
322
+ })).optional()
323
+ }).strict()
324
+ });
325
+ const TailorDBMigrationConfigSchema = z.strictObject({
326
+ directory: z.string().describe("Directory containing migration files"),
327
+ machineUser: z.string().optional().describe("Machine user name for migration execution")
328
+ });
329
+ /**
330
+ * Schema for TailorDB service configuration.
331
+ * Normalizes gqlOperations from alias ("query") to object format.
332
+ */
333
+ const TailorDBServiceConfigSchema = z.strictObject({
334
+ files: z.array(z.string()).describe("Glob patterns for TailorDB type definition files"),
335
+ ignores: z.array(z.string()).optional().describe("Glob patterns to exclude from type discovery"),
336
+ erdSite: z.string().optional().describe("URL for the ERD (Entity Relationship Diagram) site"),
337
+ migration: TailorDBMigrationConfigSchema.optional().describe("Migration configuration"),
338
+ gqlOperations: GqlOperationsSchema.optional().describe("Default GraphQL operations for all types in this service")
339
+ });
340
+
341
+ //#endregion
342
+ //#region src/parser/service/tailordb/builder-helpers.ts
343
+ const TAILORDB_TYPE_SCHEMA_KEYS = TailorDBTypeSchema.keyof().options;
344
+ function stripTailorDBTypeBuilderHelpers(type) {
345
+ if (!isSdkBranded(type, "tailordb-type")) return type;
346
+ const config = {};
347
+ const input = type;
348
+ for (const key of TAILORDB_TYPE_SCHEMA_KEYS) if (Object.prototype.hasOwnProperty.call(input, key)) config[key] = input[key];
349
+ return config;
350
+ }
351
+
44
352
  //#endregion
45
353
  //#region src/parser/service/auth-connection/schema.ts
46
- const AuthConnectionOAuth2ConfigSchema = z.object({
354
+ const AuthConnectionOAuth2ConfigSchema = z.strictObject({
47
355
  providerUrl: z.string().describe("OAuth2 provider URL"),
48
356
  issuerUrl: z.string().describe("OAuth2 issuer URL"),
49
357
  clientId: z.string().describe("OAuth2 client ID"),
@@ -51,7 +359,7 @@ const AuthConnectionOAuth2ConfigSchema = z.object({
51
359
  authUrl: z.string().optional().describe("OAuth2 authorization endpoint override"),
52
360
  tokenUrl: z.string().optional().describe("OAuth2 token endpoint override")
53
361
  });
54
- const AuthConnectionConfigSchema = z.object({ type: z.literal("oauth2").describe("Connection type") }).and(AuthConnectionOAuth2ConfigSchema);
362
+ const AuthConnectionConfigSchema = AuthConnectionOAuth2ConfigSchema.extend({ type: z.literal("oauth2").describe("Connection type") });
55
363
 
56
364
  //#endregion
57
365
  //#region src/parser/service/field/schema.ts
@@ -68,19 +376,20 @@ const TailorFieldTypeSchema = z.enum([
68
376
  "time",
69
377
  "nested"
70
378
  ]);
71
- const AllowedValueSchema = z.object({
379
+ const AllowedValueSchema = z.strictObject({
72
380
  value: z.string().describe("The allowed value"),
73
381
  description: z.string().optional().describe("Description of the allowed value")
74
382
  });
75
- const FieldMetadataSchema = z.object({
383
+ const FieldMetadataSchema = z.strictObject({
76
384
  required: z.boolean().optional().describe("Whether the field is required"),
77
385
  array: z.boolean().optional().describe("Whether the field is an array"),
78
386
  description: z.string().optional().describe("Field description"),
79
387
  allowedValues: z.array(AllowedValueSchema).optional().describe("Allowed values for enum fields"),
80
- hooks: z.object({
388
+ hooks: z.strictObject({
81
389
  create: functionSchema.optional().describe("Hook function called on creation"),
82
390
  update: functionSchema.optional().describe("Hook function called on update")
83
391
  }).optional().describe("Lifecycle hooks"),
392
+ validate: z.array(z.union([functionSchema, z.tuple([functionSchema, z.string()])])).optional().describe("Validation functions for the field"),
84
393
  typeName: z.string().optional().describe("Type name for nested or enum fields")
85
394
  });
86
395
  const TailorFieldSchema = z.object({
@@ -93,16 +402,16 @@ const TailorFieldSchema = z.object({
93
402
 
94
403
  //#endregion
95
404
  //#region src/parser/service/auth/schema.ts
96
- const AuthInvokerObjectSchema = z.object({
405
+ const AuthInvokerObjectSchema = z.strictObject({
97
406
  namespace: z.string().describe("Auth namespace"),
98
407
  machineUserName: z.string().describe("Machine user name for authentication")
99
408
  });
100
409
  const AuthInvokerSchema = z.union([z.string().describe("Machine user name (namespace auto-resolved from auth service)"), AuthInvokerObjectSchema]);
101
- const secretValueSchema = z.object({
410
+ const secretValueSchema = z.strictObject({
102
411
  vaultName: z.string().describe("Vault name containing the secret"),
103
412
  secretKey: z.string().describe("Key of the secret in the vault")
104
413
  });
105
- const OIDCSchema = z.object({
414
+ const OIDCSchema = z.strictObject({
106
415
  name: z.string().describe("Identity provider name"),
107
416
  kind: z.literal("OIDC"),
108
417
  clientID: z.string().describe("OAuth2 client ID"),
@@ -111,7 +420,7 @@ const OIDCSchema = z.object({
111
420
  issuerURL: z.string().optional().describe("OIDC issuer URL (defaults to providerURL)"),
112
421
  usernameClaim: z.string().optional().describe("JWT claim to use as username")
113
422
  });
114
- const SAMLSchema = z.object({
423
+ const SAMLSchema = z.strictObject({
115
424
  name: z.string().describe("Identity provider name"),
116
425
  kind: z.literal("SAML"),
117
426
  enableSignRequest: z.boolean().default(false).describe("Enable signing of SAML requests"),
@@ -121,7 +430,7 @@ const SAMLSchema = z.object({
121
430
  }).refine((value) => {
122
431
  return value.metadataURL !== void 0 !== (value.rawMetadata !== void 0);
123
432
  }, "Provide either metadataURL or rawMetadata");
124
- const IDTokenSchema = z.object({
433
+ const IDTokenSchema = z.strictObject({
125
434
  name: z.string().describe("Identity provider name"),
126
435
  kind: z.literal("IDToken"),
127
436
  providerURL: z.string().describe("ID token provider URL"),
@@ -129,7 +438,7 @@ const IDTokenSchema = z.object({
129
438
  clientID: z.string().describe("Client ID for ID token validation"),
130
439
  usernameClaim: z.string().optional().describe("JWT claim to use as username")
131
440
  });
132
- const BuiltinIdPSchema = z.object({
441
+ const BuiltinIdPSchema = z.strictObject({
133
442
  name: z.string().describe("Identity provider name"),
134
443
  kind: z.literal("BuiltInIdP"),
135
444
  namespace: z.string().describe("IdP namespace"),
@@ -142,7 +451,7 @@ const IdProviderSchema = z.discriminatedUnion("kind", [
142
451
  BuiltinIdPSchema
143
452
  ]);
144
453
  const OAuth2ClientGrantTypeSchema = z.union([z.literal("authorization_code"), z.literal("refresh_token")]).describe("OAuth2 grant type");
145
- const OAuth2ClientSchema = z.object({
454
+ const OAuth2ClientSchema = z.strictObject({
146
455
  description: z.string().optional().describe("Client description"),
147
456
  grantTypes: z.array(OAuth2ClientGrantTypeSchema).default(["authorization_code", "refresh_token"]).describe("Allowed OAuth2 grant types"),
148
457
  redirectURIs: z.array(z.union([
@@ -173,7 +482,7 @@ const OAuth2ClientSchema = z.object({
173
482
  message: "requireDpop cannot be set to true for browser clients as they don't support DPoP",
174
483
  path: ["requireDpop"]
175
484
  });
176
- const SCIMAuthorizationSchema = z.object({
485
+ const SCIMAuthorizationSchema = z.strictObject({
177
486
  type: z.union([z.literal("oauth2"), z.literal("bearer")]).describe("SCIM authorization type"),
178
487
  bearerSecret: secretValueSchema.optional().describe("Bearer token secret (required for bearer type)")
179
488
  });
@@ -184,7 +493,7 @@ const SCIMAttributeTypeSchema = z.union([
184
493
  z.literal("datetime"),
185
494
  z.literal("complex")
186
495
  ]).describe("SCIM attribute data type");
187
- const SCIMAttributeSchema = z.object({
496
+ const SCIMAttributeSchema = z.strictObject({
188
497
  type: SCIMAttributeTypeSchema.describe("Attribute data type"),
189
498
  name: z.string().describe("Attribute name"),
190
499
  description: z.string().optional().describe("Attribute description"),
@@ -205,46 +514,34 @@ const SCIMAttributeSchema = z.object({
205
514
  return z.array(SCIMAttributeSchema).nullable().optional();
206
515
  }
207
516
  });
208
- const SCIMSchemaSchema = z.object({
517
+ const SCIMSchemaSchema = z.strictObject({
209
518
  name: z.string().describe("SCIM schema name"),
210
519
  attributes: z.array(SCIMAttributeSchema).describe("Schema attributes")
211
520
  });
212
- const SCIMAttributeMappingSchema = z.object({
521
+ const SCIMAttributeMappingSchema = z.strictObject({
213
522
  tailorDBField: z.string().describe("TailorDB field name to map to"),
214
523
  scimPath: z.string().describe("SCIM attribute path")
215
524
  });
216
- const SCIMResourceSchema = z.object({
525
+ const SCIMResourceSchema = z.strictObject({
217
526
  name: z.string().describe("SCIM resource name"),
218
527
  tailorDBNamespace: z.string().describe("TailorDB namespace for the resource"),
219
528
  tailorDBType: z.string().describe("TailorDB type name for the resource"),
220
529
  coreSchema: SCIMSchemaSchema.describe("Core SCIM schema definition"),
221
530
  attributeMapping: z.array(SCIMAttributeMappingSchema).describe("Attribute mapping configuration")
222
531
  });
223
- const SCIMSchema = z.object({
532
+ const SCIMSchema = z.strictObject({
224
533
  machineUserName: z.string().describe("Machine user name for SCIM operations"),
225
534
  authorization: SCIMAuthorizationSchema.describe("SCIM authorization configuration"),
226
535
  resources: z.array(SCIMResourceSchema).describe("SCIM resource definitions")
227
536
  });
228
- const TenantProviderSchema = z.object({
537
+ const TenantProviderSchema = z.strictObject({
229
538
  namespace: z.string().describe("TailorDB namespace for the tenant type"),
230
539
  type: z.string().describe("TailorDB type name for tenants"),
231
540
  signatureField: z.string().describe("Field used as the tenant signature")
232
541
  });
233
- const UserProfileSchema = z.object({
542
+ const UserProfileSchema = z.strictObject({
234
543
  namespace: z.string().optional().describe("TailorDB namespace where the user type is defined"),
235
- type: z.object({
236
- name: z.string(),
237
- fields: z.any(),
238
- metadata: z.any(),
239
- hooks: z.any(),
240
- validate: z.any(),
241
- features: z.any(),
242
- indexes: z.any(),
243
- files: z.any(),
244
- permission: z.any(),
245
- gqlPermission: z.any(),
246
- _output: z.any()
247
- }),
544
+ type: z.custom().transform(stripTailorDBTypeBuilderHelpers).pipe(TailorDBTypeSchema),
248
545
  usernameField: z.string(),
249
546
  attributes: z.record(z.string(), z.literal(true)).optional(),
250
547
  attributeList: z.array(z.string()).optional()
@@ -255,17 +552,17 @@ const ValueOperandSchema = z.union([
255
552
  z.array(z.string()),
256
553
  z.array(z.boolean())
257
554
  ]);
258
- const MachineUserSchema = z.object({
555
+ const MachineUserSchema = z.strictObject({
259
556
  attributes: z.record(z.string(), ValueOperandSchema).optional(),
260
557
  attributeList: z.array(z.uuid()).optional()
261
558
  });
262
- const BeforeLoginHookSchema = z.object({
559
+ const BeforeLoginHookSchema = z.strictObject({
263
560
  handler: z.function(),
264
561
  invoker: z.string()
265
562
  });
266
- const AuthConfigBaseSchema = z.object({
563
+ const AuthConfigBaseSchema = z.strictObject({
267
564
  name: z.string().describe("Auth service name"),
268
- hooks: z.object({ beforeLogin: BeforeLoginHookSchema.optional().describe("Before login auth hook") }).optional().describe("Auth hooks"),
565
+ hooks: z.strictObject({ beforeLogin: BeforeLoginHookSchema.optional().describe("Before login auth hook") }).optional().describe("Auth hooks"),
269
566
  machineUsers: z.record(z.string(), MachineUserSchema).optional().describe("Machine user definitions"),
270
567
  oauth2Clients: z.record(z.string(), OAuth2ClientSchema).optional().describe("OAuth2 client definitions"),
271
568
  idProvider: IdProviderSchema.optional().describe("Identity provider configuration"),
@@ -288,7 +585,7 @@ const AuthConfigSchema = z.xor([AuthConfigBaseSchema.extend({
288
585
 
289
586
  //#endregion
290
587
  //#region src/parser/service/executor/schema.ts
291
- const TailorDBTriggerSchema = z.object({
588
+ const TailorDBTriggerSchema = z.strictObject({
292
589
  kind: z.literal("tailordb").describe("TailorDB record event trigger"),
293
590
  events: z.array(z.enum([
294
591
  "tailordb.type_record.created",
@@ -298,25 +595,25 @@ const TailorDBTriggerSchema = z.object({
298
595
  typeName: z.string().describe("TailorDB type name to watch for events"),
299
596
  condition: functionSchema.optional().describe("Condition function to filter events")
300
597
  });
301
- const ResolverExecutedTriggerSchema = z.object({
598
+ const ResolverExecutedTriggerSchema = z.strictObject({
302
599
  kind: z.literal("resolverExecuted"),
303
600
  resolverName: z.string().describe("Name of the resolver to trigger on"),
304
601
  condition: functionSchema.optional().describe("Condition function to filter events")
305
602
  });
306
- const ScheduleTriggerSchema = z.object({
603
+ const ScheduleTriggerSchema = z.strictObject({
307
604
  kind: z.literal("schedule"),
308
605
  cron: z.string().describe("CRON expression for the schedule"),
309
606
  timezone: z.string().optional().default("UTC").describe("Timezone for the CRON schedule (default: UTC)")
310
607
  });
311
- const IncomingWebhookTriggerResponseSchema = z.object({
608
+ const IncomingWebhookTriggerResponseSchema = z.strictObject({
312
609
  body: functionSchema.optional().describe("Function returning the response body"),
313
610
  statusCode: z.number().int().optional().describe("HTTP status code for the response")
314
611
  });
315
- const IncomingWebhookTriggerSchema = z.object({
612
+ const IncomingWebhookTriggerSchema = z.strictObject({
316
613
  kind: z.literal("incomingWebhook"),
317
614
  response: IncomingWebhookTriggerResponseSchema.optional().describe("Response configuration")
318
615
  });
319
- const IdpUserTriggerSchema = z.object({
616
+ const IdpUserTriggerSchema = z.strictObject({
320
617
  kind: z.literal("idpUser").describe("IdP user event trigger"),
321
618
  events: z.array(z.enum([
322
619
  "idp.user.created",
@@ -325,7 +622,7 @@ const IdpUserTriggerSchema = z.object({
325
622
  ])).min(1).transform((arr) => [...new Set(arr)]).describe("IdP user event types to trigger on"),
326
623
  idp: z.string().optional().describe("IdP namespace name to subscribe to. If omitted, the project's only IdP is used; throws when multiple IdPs exist.")
327
624
  });
328
- const AuthAccessTokenTriggerSchema = z.object({
625
+ const AuthAccessTokenTriggerSchema = z.strictObject({
329
626
  kind: z.literal("authAccessToken").describe("Auth access token event trigger"),
330
627
  events: z.array(z.enum([
331
628
  "auth.access_token.issued",
@@ -341,23 +638,23 @@ const TriggerSchema = z.discriminatedUnion("kind", [
341
638
  IdpUserTriggerSchema,
342
639
  AuthAccessTokenTriggerSchema
343
640
  ]);
344
- const FunctionOperationSchema = z.object({
641
+ const FunctionOperationSchema = z.strictObject({
345
642
  kind: z.enum(["function", "jobFunction"]),
346
643
  body: functionSchema.describe("Function implementation"),
347
644
  invoker: AuthInvokerSchema.optional().describe("Invoker for the function execution")
348
- }).strict();
349
- const GqlOperationSchema = z.object({
645
+ });
646
+ const GqlOperationSchema = z.strictObject({
350
647
  kind: z.literal("graphql"),
351
648
  appName: z.string().optional().describe("Target application name for the GraphQL query"),
352
649
  query: z.preprocess((val) => String(val), z.string().describe("GraphQL query string")),
353
650
  variables: functionSchema.optional().describe("Function to compute GraphQL variables"),
354
651
  invoker: AuthInvokerSchema.optional().describe("Invoker for the GraphQL execution")
355
- }).strict();
356
- const WebhookOperationSchema = z.object({
652
+ });
653
+ const WebhookOperationSchema = z.strictObject({
357
654
  kind: z.literal("webhook"),
358
655
  url: functionSchema.describe("Function returning the webhook URL"),
359
656
  requestBody: functionSchema.optional().describe("Function to compute the request body"),
360
- headers: z.record(z.string(), z.union([z.string(), z.object({
657
+ headers: z.record(z.string(), z.union([z.string(), z.strictObject({
361
658
  vault: z.string(),
362
659
  key: z.string()
363
660
  })])).optional().describe("HTTP headers for the webhook request")
@@ -369,19 +666,19 @@ const WorkflowOperationSchema = z.preprocess((val) => {
369
666
  ...rest,
370
667
  workflowName: workflow.name
371
668
  };
372
- }, z.object({
669
+ }, z.strictObject({
373
670
  kind: z.literal("workflow"),
374
671
  workflowName: z.string().describe("Name of the workflow to execute"),
375
672
  args: z.union([z.record(z.string(), z.unknown()), functionSchema]).optional().describe("Arguments to pass to the workflow"),
376
673
  invoker: AuthInvokerSchema.optional().describe("Invoker for the workflow execution")
377
- }).strict());
674
+ }));
378
675
  const OperationSchema = z.union([
379
676
  FunctionOperationSchema,
380
677
  GqlOperationSchema,
381
678
  WebhookOperationSchema,
382
679
  WorkflowOperationSchema
383
680
  ]);
384
- const ExecutorSchema = z.object({
681
+ const ExecutorSchema = z.strictObject({
385
682
  name: z.string().describe("Executor name"),
386
683
  description: z.string().optional().describe("Executor description"),
387
684
  disabled: z.boolean().optional().default(false).describe("Whether the executor is disabled"),
@@ -389,6 +686,30 @@ const ExecutorSchema = z.object({
389
686
  operation: OperationSchema.describe("Operation to execute when triggered")
390
687
  });
391
688
 
689
+ //#endregion
690
+ //#region src/cli/services/executor/loader.ts
691
+ function stripExecutorTriggerArgs(executor) {
692
+ if (!isSdkBranded(executor, "executor")) return executor;
693
+ const trigger = executor.trigger;
694
+ if (trigger === null || typeof trigger !== "object" || !("__args" in trigger)) return executor;
695
+ const { __args: _args, ...triggerConfig } = trigger;
696
+ return {
697
+ ...executor,
698
+ trigger: triggerConfig
699
+ };
700
+ }
701
+ /**
702
+ * Load and validate an executor definition from a file.
703
+ * @param executorFilePath - Path to the executor file
704
+ * @returns Parsed executor or null if invalid
705
+ */
706
+ async function loadExecutor(executorFilePath) {
707
+ const executor = (await import(pathToFileURL(executorFilePath).href)).default;
708
+ const parseResult = ExecutorSchema.safeParse(stripExecutorTriggerArgs(executor));
709
+ if (!parseResult.success) return null;
710
+ return parseResult.data;
711
+ }
712
+
392
713
  //#endregion
393
714
  //#region src/cli/services/executor/service.ts
394
715
  /**
@@ -404,7 +725,7 @@ function createExecutorService(params) {
404
725
  const loadExecutorForFile = async (executorFile) => {
405
726
  try {
406
727
  const executorModule = await import(pathToFileURL(executorFile).href);
407
- const result = ExecutorSchema.safeParse(executorModule.default);
728
+ const result = ExecutorSchema.safeParse(stripExecutorTriggerArgs(executorModule.default));
408
729
  if (result.success) {
409
730
  const relativePath = path.relative(process.cwd(), executorFile);
410
731
  logger.log(`Executor: ${styles.successBright(`"${result.data.name}"`)} loaded from ${styles.path(relativePath)}`);
@@ -434,6 +755,7 @@ function createExecutorService(params) {
434
755
  logger.newline();
435
756
  logger.log(`Found ${styles.highlight(executorFiles.length.toString())} executor files`);
436
757
  await Promise.all(executorFiles.map((executorFile) => loadExecutorForFile(executorFile)));
758
+ assertUniqueExecutorNames(executors);
437
759
  return executors;
438
760
  })();
439
761
  return loadPromise;
@@ -450,10 +772,26 @@ function createExecutorService(params) {
450
772
  sourceTypeName: void 0
451
773
  });
452
774
  }
775
+ assertUniqueExecutorNames(executors);
453
776
  }
454
777
  };
455
778
  }
779
+ /**
780
+ * Assert that every loaded executor has a unique name.
781
+ * Executors are stored by source file, so two files declaring the same
782
+ * `name` would otherwise silently share a single bundle cache entry.
783
+ * @param executors - Loaded executors keyed by source file
784
+ */
785
+ function assertUniqueExecutorNames(executors) {
786
+ const seenNames = /* @__PURE__ */ new Map();
787
+ for (const [file, executor] of Object.entries(executors)) {
788
+ const relativePath = path.relative(process.cwd(), file);
789
+ const existing = seenNames.get(executor.name);
790
+ if (existing) throw new Error(`Duplicate executor name "${executor.name}" found:\n - ${existing}\n - ${relativePath}\nEach executor must have a unique name.`);
791
+ seenNames.set(executor.name, relativePath);
792
+ }
793
+ }
456
794
 
457
795
  //#endregion
458
- export { TailorFieldSchema as a, AuthInvokerSchema as i, ExecutorSchema as n, loadFilesWithIgnores as o, AuthConfigSchema as r, functionSchema as s, createExecutorService as t };
459
- //# sourceMappingURL=service-DjyqbCaJ.mjs.map
796
+ export { AuthConfigSchema as a, stripTailorDBTypeBuilderHelpers as c, applyRelationMetadataToFieldConfig as d, buildRelationInfo as f, functionSchema as g, loadFilesWithIgnores as h, ExecutorSchema as i, TailorDBServiceConfigSchema as l, validateRelationConfig as m, loadExecutor as n, AuthInvokerSchema as o, processRelationMetadata as p, stripExecutorTriggerArgs as r, TailorFieldSchema as s, createExecutorService as t, TailorDBTypeSchema as u };
797
+ //# sourceMappingURL=service-ufH7sS8o.mjs.map