@tailor-platform/sdk 1.72.0 → 1.73.1

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 (382) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/aigateway-B3oZZE6v.mjs +15 -0
  3. package/dist/aigateway-B3oZZE6v.mjs.map +1 -0
  4. package/dist/application-BXdCl6bp.mjs +3 -0
  5. package/dist/{application-DmjIKQ-a.mjs → application-Bb9NNp5m.mjs} +54 -28
  6. package/dist/application-Bb9NNp5m.mjs.map +1 -0
  7. package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
  8. package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
  9. package/dist/{authconnection-D7lsvsKY.mjs → authconnection-BGQM8FZI.mjs} +2 -3
  10. package/dist/{authconnection-D7lsvsKY.mjs.map → authconnection-BGQM8FZI.mjs.map} +1 -1
  11. package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
  12. package/dist/{brand-DlnJ375c.mjs.map → brand-Eo4pLXPJ.mjs.map} +1 -1
  13. package/dist/cli/cache/bundle-cache.d.mts +1 -0
  14. package/dist/cli/cache/store.d.mts +1 -0
  15. package/dist/cli/cache/types.d.mts +1 -0
  16. package/dist/cli/commands/api/api-call.d.mts +19 -0
  17. package/dist/cli/commands/api/index.d.mts +3 -0
  18. package/dist/cli/commands/deploy/aigateway.d.mts +1 -0
  19. package/dist/cli/commands/deploy/application.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.d.mts +1 -0
  32. package/dist/cli/commands/executor/get.d.mts +29 -0
  33. package/dist/cli/commands/executor/jobs.d.mts +123 -0
  34. package/dist/cli/commands/executor/list.d.mts +19 -0
  35. package/dist/cli/commands/executor/transform.d.mts +41 -0
  36. package/dist/cli/commands/executor/trigger.d.mts +41 -0
  37. package/dist/cli/commands/executor/webhook.d.mts +22 -0
  38. package/dist/cli/commands/function/get.d.mts +18 -0
  39. package/dist/cli/commands/function/list.d.mts +22 -0
  40. package/dist/cli/commands/function/transform.d.mts +11 -0
  41. package/dist/cli/commands/generate/options.d.mts +7 -0
  42. package/dist/cli/commands/generate/seed/bundler.d.mts +26 -0
  43. package/dist/cli/commands/generate/service.d.mts +12 -0
  44. package/dist/cli/commands/generate/types.d.mts +126 -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 +113 -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 +63 -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/index.d.mts +1 -2
  94. package/dist/cli/index.mjs +24 -25
  95. package/dist/cli/index.mjs.map +1 -1
  96. package/dist/cli/lib.d.mts +80 -21402
  97. package/dist/cli/lib.mjs +8 -9
  98. package/dist/cli/lib.mjs.map +1 -1
  99. package/dist/cli/query/index.d.mts +35 -0
  100. package/dist/cli/services/application.d.mts +1 -0
  101. package/dist/cli/services/auth/service.d.mts +1 -0
  102. package/dist/cli/services/executor/service.d.mts +1 -0
  103. package/dist/cli/services/http-adapter/bundler.d.mts +1 -0
  104. package/dist/cli/services/http-adapter/service.d.mts +1 -0
  105. package/dist/cli/services/resolver/service.d.mts +1 -0
  106. package/dist/cli/services/tailordb/service.d.mts +1 -0
  107. package/dist/cli/services/workflow/bundler.d.mts +1 -0
  108. package/dist/cli/services/workflow/service.d.mts +1 -0
  109. package/dist/cli/shared/args.d.mts +13 -0
  110. package/dist/cli/shared/client.d.mts +1273 -0
  111. package/dist/cli/shared/config-loader.d.mts +44 -0
  112. package/dist/cli/shared/context.d.mts +28 -0
  113. package/dist/cli/shared/script-executor.d.mts +74 -0
  114. package/dist/cli/shared/seed-chunker.d.mts +46 -0
  115. package/dist/cli/shared/trigger-context.d.mts +1 -0
  116. package/dist/cli/shared/type-generator.d.mts +20 -0
  117. package/dist/cli/skills.mjs +1 -2
  118. package/dist/cli/skills.mjs.map +1 -1
  119. package/dist/completion/zsh-worker.zsh +1 -1
  120. package/dist/configure/config/index.d.mts +29 -0
  121. package/dist/configure/config/types.d.mts +103 -0
  122. package/dist/configure/index.d.mts +125 -7
  123. package/dist/configure/index.mjs +5 -6
  124. package/dist/configure/index.mjs.map +1 -1
  125. package/dist/configure/services/aigateway/index.d.mts +17 -0
  126. package/dist/configure/services/aigateway/types.d.mts +11 -0
  127. package/dist/configure/services/auth/index.d.mts +43 -0
  128. package/dist/{types-v_ErzNUF.d.mts → configure/services/auth/types.d.mts} +7 -172
  129. package/dist/configure/services/executor/executor.d.mts +82 -0
  130. package/dist/configure/services/executor/index.d.mts +8 -0
  131. package/dist/configure/services/executor/operation.d.mts +46 -0
  132. package/dist/configure/services/executor/trigger/event.d.mts +272 -0
  133. package/dist/configure/services/executor/trigger/index.d.mts +8 -0
  134. package/dist/configure/services/executor/trigger/schedule.d.mts +25 -0
  135. package/dist/configure/services/executor/trigger/webhook.d.mts +44 -0
  136. package/dist/configure/services/executor/types.d.mts +2 -0
  137. package/dist/configure/services/http-adapter/http-adapter.d.mts +125 -0
  138. package/dist/configure/services/http-adapter/index.d.mts +2 -0
  139. package/dist/configure/services/idp/index.d.mts +64 -0
  140. package/dist/configure/services/idp/permission.d.mts +80 -0
  141. package/dist/configure/services/idp/types.d.mts +20 -0
  142. package/dist/configure/services/index.d.mts +33 -0
  143. package/dist/configure/services/resolver/index.d.mts +5 -0
  144. package/dist/configure/services/resolver/resolver.d.mts +77 -0
  145. package/dist/configure/services/resolver/types.d.mts +6 -0
  146. package/dist/configure/services/secrets/index.d.mts +38 -0
  147. package/dist/configure/services/secrets/types.d.mts +11 -0
  148. package/dist/configure/services/staticwebsite/index.d.mts +19 -0
  149. package/dist/configure/services/staticwebsite/types.d.mts +11 -0
  150. package/dist/configure/services/tailordb/index.d.mts +4 -0
  151. package/dist/configure/services/tailordb/permission.d.mts +119 -0
  152. package/dist/configure/services/tailordb/schema.d.mts +451 -0
  153. package/dist/configure/services/tailordb/types.d.mts +149 -0
  154. package/dist/configure/services/workflow/index.d.mts +7 -0
  155. package/dist/configure/services/workflow/job.d.mts +81 -0
  156. package/dist/configure/services/workflow/test-env-key.d.mts +9 -0
  157. package/dist/configure/services/workflow/types.d.mts +2 -0
  158. package/dist/configure/services/workflow/wait-point.d.mts +73 -0
  159. package/dist/configure/services/workflow/workflow.d.mts +55 -0
  160. package/dist/configure/types/aigateway-name.d.mts +12 -0
  161. package/dist/configure/types/connection-name.d.mts +12 -0
  162. package/dist/configure/types/field.d.mts +9 -0
  163. package/dist/configure/types/field.types.d.mts +109 -0
  164. package/dist/configure/types/idp-name.d.mts +12 -0
  165. package/dist/configure/types/index.d.mts +4 -0
  166. package/dist/configure/types/machine-user.d.mts +12 -0
  167. package/dist/configure/types/type.d.mts +99 -0
  168. package/dist/configure/user.d.mts +7 -0
  169. package/dist/{context-CDQqIv4u.mjs → context-Bd266-ru.mjs} +2 -3
  170. package/dist/{context-CDQqIv4u.mjs.map → context-Bd266-ru.mjs.map} +1 -1
  171. package/dist/{crashreport-BwF8cHF0.mjs → crashreport-Dy4ZzSkd.mjs} +1 -2
  172. package/dist/{crashreport-BqyvFk-_.mjs → crashreport-ayWANEZ6.mjs} +4 -5
  173. package/dist/{crashreport-BqyvFk-_.mjs.map → crashreport-ayWANEZ6.mjs.map} +1 -1
  174. package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
  175. package/dist/{enum-constants-C7DaWeQo.mjs.map → enum-constants-j9QBF0cB.mjs.map} +1 -1
  176. package/dist/{errors-EsY4XO6O.mjs → errors-Dtf2WPaW.mjs} +1 -2
  177. package/dist/{errors-EsY4XO6O.mjs.map → errors-Dtf2WPaW.mjs.map} +1 -1
  178. package/dist/{field-C4zdJLW5.mjs → field-DOsJCPFa.mjs} +1 -2
  179. package/dist/{field-C4zdJLW5.mjs.map → field-DOsJCPFa.mjs.map} +1 -1
  180. package/dist/{file-BkxupbYP.mjs → file-_oUZo76X.mjs} +2 -3
  181. package/dist/{file-BkxupbYP.mjs.map → file-_oUZo76X.mjs.map} +1 -1
  182. package/dist/{file-utils-BHPxPXmn.mjs → file-utils-DcyIPFQh.mjs} +2 -3
  183. package/dist/{file-utils-BHPxPXmn.mjs.map → file-utils-DcyIPFQh.mjs.map} +1 -1
  184. package/dist/{globals-ByrCoDip.mjs → globals-B8XX5TRB.mjs} +3 -3
  185. package/dist/globals-B8XX5TRB.mjs.map +1 -0
  186. package/dist/{iconv-D1zmPjvi.mjs → iconv-D2vi8G36.mjs} +2 -3
  187. package/dist/{iconv-D1zmPjvi.mjs.map → iconv-D2vi8G36.mjs.map} +1 -1
  188. package/dist/{idp-ynUfzwpz.mjs → idp-Bx25ZBdN.mjs} +2 -3
  189. package/dist/{idp-ynUfzwpz.mjs.map → idp-Bx25ZBdN.mjs.map} +1 -1
  190. package/dist/{interceptor-DOqRkCya.mjs → interceptor-D-q1rvRl.mjs} +1 -2
  191. package/dist/{interceptor-DOqRkCya.mjs.map → interceptor-D-q1rvRl.mjs.map} +1 -1
  192. package/dist/{job-BpsFXPbi.mjs → job-CtU73PGa.mjs} +3 -4
  193. package/dist/job-CtU73PGa.mjs.map +1 -0
  194. package/dist/kysely/index.d.mts +2 -3
  195. package/dist/kysely/index.mjs +0 -1
  196. package/dist/kysely/index.mjs.map +1 -1
  197. package/dist/{kysely-type-CSoZxVKN.mjs → kysely-type-D-zflMGf.mjs} +2 -3
  198. package/dist/{kysely-type-CSoZxVKN.mjs.map → kysely-type-D-zflMGf.mjs.map} +1 -1
  199. package/dist/{logger-DKF-JsAK.mjs → logger-BEiZZ3qT.mjs} +1 -2
  200. package/dist/{logger-DKF-JsAK.mjs.map → logger-BEiZZ3qT.mjs.map} +1 -1
  201. package/dist/{mock-wf5qeZLi.mjs → mock-Ce1GCi4-.mjs} +60 -5
  202. package/dist/mock-Ce1GCi4-.mjs.map +1 -0
  203. package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
  204. package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
  205. package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
  206. package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
  207. package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
  208. package/dist/parser/generator-config/schema.d.mts +1 -0
  209. package/dist/parser/service/auth/index.d.mts +1 -0
  210. package/dist/parser/service/auth/schema.d.mts +1 -0
  211. package/dist/parser/service/http-adapter/index.d.mts +1 -0
  212. package/dist/parser/service/http-adapter/schema.d.mts +1 -0
  213. package/dist/parser/service/idp/types.d.mts +4 -0
  214. package/dist/parser/service/tailordb/types.d.mts +126 -0
  215. package/dist/plugin/builtin/enum-constants/index.d.mts +16 -1
  216. package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
  217. package/dist/plugin/builtin/file-utils/index.d.mts +16 -1
  218. package/dist/plugin/builtin/file-utils/index.mjs +1 -2
  219. package/dist/plugin/builtin/kysely-type/index.d.mts +16 -1
  220. package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
  221. package/dist/plugin/builtin/seed/index.d.mts +45 -1
  222. package/dist/plugin/builtin/seed/index.mjs +1 -2
  223. package/dist/plugin/get-generated-type.d.mts +17 -0
  224. package/dist/plugin/index.d.mts +3 -118
  225. package/dist/plugin/index.mjs +0 -1
  226. package/dist/plugin/index.mjs.map +1 -1
  227. package/dist/plugin/manager.d.mts +1 -0
  228. package/dist/plugin/types.d.mts +245 -0
  229. package/dist/plugin/with-context.d.mts +102 -0
  230. package/dist/{registry-D0uB0OrK.mjs → registry-BozuxbPp.mjs} +1 -2
  231. package/dist/{registry-D0uB0OrK.mjs.map → registry-BozuxbPp.mjs.map} +1 -1
  232. package/dist/{repl-editor-DD5YP5mt.mjs → repl-editor-BmQOyZJd.mjs} +2 -3
  233. package/dist/{repl-editor-DD5YP5mt.mjs.map → repl-editor-BmQOyZJd.mjs.map} +1 -1
  234. package/dist/{rolldown-runtime-BkoGK1jX.mjs → rolldown-runtime-DXywRVcq.mjs} +0 -1
  235. package/dist/runtime/aigateway.d.mts +35 -0
  236. package/dist/runtime/aigateway.mjs +3 -0
  237. package/dist/runtime/authconnection.d.mts +31 -2
  238. package/dist/runtime/authconnection.mjs +1 -2
  239. package/dist/runtime/context.d.mts +67 -2
  240. package/dist/runtime/context.mjs +1 -2
  241. package/dist/runtime/file.d.mts +249 -2
  242. package/dist/runtime/file.mjs +1 -2
  243. package/dist/runtime/globals.d.mts +31 -20
  244. package/dist/runtime/globals.mjs +0 -1
  245. package/dist/runtime/iconv.d.mts +121 -2
  246. package/dist/runtime/iconv.mjs +1 -2
  247. package/dist/runtime/idp.d.mts +186 -2
  248. package/dist/runtime/idp.mjs +1 -2
  249. package/dist/runtime/index.d.mts +47 -9
  250. package/dist/runtime/index.mjs +9 -9
  251. package/dist/runtime/secretmanager.d.mts +54 -2
  252. package/dist/runtime/secretmanager.mjs +1 -2
  253. package/dist/{types-DTcZ2Yax.d.mts → runtime/types.d.mts} +1 -2
  254. package/dist/runtime/workflow.d.mts +107 -2
  255. package/dist/runtime/workflow.mjs +2 -3
  256. package/dist/{runtime-Cd375HD-.mjs → runtime-B8O6JFS2.mjs} +752 -256
  257. package/dist/runtime-B8O6JFS2.mjs.map +1 -0
  258. package/dist/{schema-C4fkpWV_.mjs → schema-DAdZSFOd.mjs} +3 -4
  259. package/dist/{schema-C4fkpWV_.mjs.map → schema-DAdZSFOd.mjs.map} +1 -1
  260. package/dist/{secret-file-eB3R3Fil.mjs → secret-file-VSVGy1V0.mjs} +2 -3
  261. package/dist/{secret-file-eB3R3Fil.mjs.map → secret-file-VSVGy1V0.mjs.map} +1 -1
  262. package/dist/{secretmanager-h3tBJV8f.mjs → secretmanager-BVxw3ih_.mjs} +2 -3
  263. package/dist/{secretmanager-h3tBJV8f.mjs.map → secretmanager-BVxw3ih_.mjs.map} +1 -1
  264. package/dist/seed/index.d.mts +1 -2
  265. package/dist/seed/index.mjs +0 -1
  266. package/dist/seed/index.mjs.map +1 -1
  267. package/dist/{seed-YAbtMy65.mjs → seed-DoMTMLcm.mjs} +3 -4
  268. package/dist/{seed-YAbtMy65.mjs.map → seed-DoMTMLcm.mjs.map} +1 -1
  269. package/dist/service-BXmdFwSH.mjs +3 -0
  270. package/dist/{service-DDWgZL_L2.mjs → service-DBFZQloR.mjs} +3 -4
  271. package/dist/service-DBFZQloR.mjs.map +1 -0
  272. package/dist/{service-B2Jd9CxS.mjs → service-DiEtAsvc.mjs} +3 -4
  273. package/dist/{service-B2Jd9CxS.mjs.map → service-DiEtAsvc.mjs.map} +1 -1
  274. package/dist/{service_pb-BsBR6yW5.mjs → service_pb-CIrhGwHk.mjs} +1 -2
  275. package/dist/{service_pb-BsBR6yW5.mjs.map → service_pb-CIrhGwHk.mjs.map} +1 -1
  276. package/dist/{service_pb-BJ9GsAnW.mjs → service_pb-DjwIn4jO.mjs} +1 -2
  277. package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +204 -0
  278. package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +58 -0
  279. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +316 -0
  280. package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +161 -0
  281. package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2070 -0
  282. package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +861 -0
  283. package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +112 -0
  284. package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +69 -0
  285. package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +439 -0
  286. package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +564 -0
  287. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +145 -0
  288. package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +451 -0
  289. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +192 -0
  290. package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +50 -0
  291. package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +407 -0
  292. package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +430 -0
  293. package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +73 -0
  294. package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +17 -0
  295. package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +309 -0
  296. package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +591 -0
  297. package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +330 -0
  298. package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +113 -0
  299. package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +346 -0
  300. package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +54 -0
  301. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3576 -0
  302. package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +187 -0
  303. package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +29 -0
  304. package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +429 -0
  305. package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +90 -0
  306. package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +684 -0
  307. package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +797 -0
  308. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +330 -0
  309. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +183 -0
  310. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +842 -0
  311. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +276 -0
  312. package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2015 -0
  313. package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +483 -0
  314. package/dist/{telemetry-BQbbVo2t.mjs → telemetry-CdqJEzkj.mjs} +2 -3
  315. package/dist/{telemetry-BQbbVo2t.mjs.map → telemetry-CdqJEzkj.mjs.map} +1 -1
  316. package/dist/telemetry-ClwW5ohF.mjs +3 -0
  317. package/dist/types/aigateway.generated.d.mts +9 -0
  318. package/dist/types/app-config.generated.d.mts +4 -0
  319. package/dist/types/auth-connection.generated.d.mts +20 -0
  320. package/dist/types/auth.generated.d.mts +150 -0
  321. package/dist/types/executor.generated.d.mts +177 -0
  322. package/dist/types/generator-config.generated.d.mts +28 -0
  323. package/dist/types/helpers.d.mts +39 -0
  324. package/dist/types/http-adapter.generated.d.mts +17 -0
  325. package/dist/types/idp.generated.d.mts +584 -0
  326. package/dist/types/resolver.generated.d.mts +38 -0
  327. package/dist/types/secrets.generated.d.mts +14 -0
  328. package/dist/types/staticwebsite.generated.d.mts +10 -0
  329. package/dist/{types-rj8YJcEe.d.mts → types/tailordb.generated.d.mts} +2 -290
  330. package/dist/types/workflow.generated.d.mts +12 -0
  331. package/dist/types-qhFZ8y9B.mjs +4 -0
  332. package/dist/{types-D4QMmNWh.mjs → types-ywCGpzDZ.mjs} +2 -3
  333. package/dist/{types-D4QMmNWh.mjs.map → types-ywCGpzDZ.mjs.map} +1 -1
  334. package/dist/utils/test/index.d.mts +6 -89
  335. package/dist/utils/test/index.mjs +1 -2
  336. package/dist/utils/test/index.mjs.map +1 -1
  337. package/dist/utils/test/mock.d.mts +87 -0
  338. package/dist/vitest/environment.d.mts +1 -2
  339. package/dist/vitest/environment.mjs +1 -2
  340. package/dist/vitest/environment.mjs.map +1 -1
  341. package/dist/vitest/index.d.mts +4 -392
  342. package/dist/vitest/index.mjs +4 -5
  343. package/dist/vitest/index.mjs.map +1 -1
  344. package/dist/vitest/mock-kysely.d.mts +62 -0
  345. package/dist/vitest/mock.d.mts +364 -0
  346. package/dist/vitest/setup.d.mts +1 -2
  347. package/dist/vitest/setup.mjs +2 -3
  348. package/dist/vitest/setup.mjs.map +1 -1
  349. package/dist/{workflow-C8I7shjM.mjs → workflow-DSwnYPPP.mjs} +10 -4
  350. package/dist/workflow-DSwnYPPP.mjs.map +1 -0
  351. package/docs/runtime.md +5 -1
  352. package/docs/services/aigateway.md +14 -0
  353. package/docs/services/tailordb-migration.md +2 -0
  354. package/docs/testing.md +48 -2
  355. package/package.json +6 -1
  356. package/dist/application-DmjIKQ-a.mjs.map +0 -1
  357. package/dist/application-a_ApFuPh.mjs +0 -4
  358. package/dist/authconnection-CqfaJfrC.d.mts +0 -32
  359. package/dist/context-CUBwSBq4.d.mts +0 -68
  360. package/dist/file-BzK8z3X-.d.mts +0 -250
  361. package/dist/globals-ByrCoDip.mjs.map +0 -1
  362. package/dist/iconv-kwrmd1U_.d.mts +0 -122
  363. package/dist/idp-BmYwCXnJ.d.mts +0 -187
  364. package/dist/index-BDBU7x-i.d.mts +0 -18
  365. package/dist/index-BSlv_YrG.d.mts +0 -46
  366. package/dist/index-BzGqTY5x.d.mts +0 -1315
  367. package/dist/index-D3_Au3wu.d.mts +0 -47
  368. package/dist/index-DtFRlrww.d.mts +0 -18
  369. package/dist/index-jeE3UvF2.d.mts +0 -18
  370. package/dist/job-BpsFXPbi.mjs.map +0 -1
  371. package/dist/mock-wf5qeZLi.mjs.map +0 -1
  372. package/dist/package-json-wzO6nV9O.mjs +0 -4
  373. package/dist/runtime-Cd375HD-.mjs.map +0 -1
  374. package/dist/secretmanager-CKLB3wAQ.d.mts +0 -55
  375. package/dist/service-CRaa4Joe.mjs +0 -4
  376. package/dist/service-DDWgZL_L2.mjs.map +0 -1
  377. package/dist/telemetry-w92bvGdC.mjs +0 -4
  378. package/dist/types-32lUMToj.mjs +0 -5
  379. package/dist/types-aqnqTCfO.d.mts +0 -602
  380. package/dist/workflow-C8I7shjM.mjs.map +0 -1
  381. package/dist/workflow-CMamswkK.d.mts +0 -96
  382. package/dist/workflow.generated-Da1zECDw.d.mts +0 -1348
@@ -0,0 +1,149 @@
1
+ import { InferredAttributeMap, TailorUser } from "../../../runtime/types.mjs";
2
+ import { InferFieldsOutput, Prettify, output } from "../../../types/helpers.mjs";
3
+ import { DefinedFieldMetadata, FieldMetadata, TailorField } from "../../types/field.types.mjs";
4
+ import { DBFieldMetadata as DBFieldMetadata$1, GqlOperationsInput, RawPermissions, TailorDBServiceConfigInput } from "../../../types/tailordb.generated.mjs";
5
+ import { NonEmptyObject } from "type-fest";
6
+
7
+ //#region src/configure/services/tailordb/types.d.ts
8
+ type SerialConfig<T extends "string" | "integer" = "string" | "integer"> = Prettify<{
9
+ start: number;
10
+ maxValue?: number;
11
+ } & (T extends "string" ? {
12
+ format?: string;
13
+ } : object)>;
14
+ interface DBFieldMetadata extends FieldMetadata {
15
+ index?: boolean;
16
+ unique?: boolean;
17
+ vector?: boolean;
18
+ foreignKey?: boolean;
19
+ foreignKeyType?: string;
20
+ foreignKeyField?: string;
21
+ /** Lifecycle hooks for the field */
22
+ hooks?: DBFieldMetadata$1["hooks"];
23
+ serial?: SerialConfig;
24
+ relation?: boolean;
25
+ scale?: number;
26
+ }
27
+ interface DefinedDBFieldMetadata extends DefinedFieldMetadata {
28
+ index?: boolean;
29
+ unique?: boolean;
30
+ vector?: boolean;
31
+ foreignKey?: boolean;
32
+ foreignKeyType?: boolean;
33
+ validate?: boolean;
34
+ hooks?: {
35
+ create: boolean;
36
+ update: boolean;
37
+ };
38
+ serial?: boolean;
39
+ relation?: boolean;
40
+ }
41
+ type GqlOperationsConfig = GqlOperationsInput;
42
+ interface RawRelationConfig {
43
+ type: "1-1" | "n-1" | "keyOnly" | "oneToOne" | "manyToOne" | "N-1";
44
+ toward: {
45
+ type: string;
46
+ as?: string;
47
+ key?: string;
48
+ };
49
+ backward?: string;
50
+ }
51
+ interface TailorDBTypeMetadata {
52
+ name: string;
53
+ description?: string;
54
+ settings?: {
55
+ pluralForm?: string;
56
+ aggregation?: boolean;
57
+ bulkUpsert?: boolean;
58
+ gqlOperations?: GqlOperationsConfig;
59
+ publishEvents?: boolean;
60
+ };
61
+ permissions: RawPermissions;
62
+ files: Record<string, string>;
63
+ indexes?: Record<string, {
64
+ fields: string[];
65
+ unique?: boolean;
66
+ }>;
67
+ }
68
+ /**
69
+ * Minimal structural interface for TailorDBField.
70
+ * Defines only the properties needed by parser, plugin, cli, and types layers.
71
+ * The full interface with builder methods (relation, index, unique, hooks, validate, etc.)
72
+ * is defined in configure/services/tailordb/schema.ts.
73
+ */
74
+ interface TailorDBField<Defined extends DefinedDBFieldMetadata = DefinedDBFieldMetadata, Output = any> extends Omit<TailorField<Defined, Output, DBFieldMetadata, Defined["type"]>, "fields"> {
75
+ readonly fields: Record<string, TailorAnyDBField>;
76
+ readonly rawRelation: Readonly<RawRelationConfig> | undefined;
77
+ }
78
+ type TailorAnyDBField = TailorDBField<any, any>;
79
+ /**
80
+ * Minimal structural interface for TailorDBType.
81
+ * Defines only the properties needed by parser, plugin, cli, and types layers.
82
+ * The full interface with builder methods (hooks, validate, features, permission, etc.)
83
+ * is defined in configure/services/tailordb/schema.ts.
84
+ */
85
+ interface TailorDBType<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> {
86
+ readonly name: string;
87
+ readonly fields: Fields;
88
+ readonly _output: InferFieldsOutput<Fields>;
89
+ readonly metadata: TailorDBTypeMetadata;
90
+ readonly plugins: PluginAttachment[];
91
+ }
92
+ type TailorAnyDBType = TailorDBType<any, any>;
93
+ type TailorDBInstance<Fields extends Record<string, TailorAnyDBField> = any, User extends object = InferredAttributeMap> = TailorDBType<Fields, User>;
94
+ type HookFn<TValue, TData, TReturn> = (args: {
95
+ value: TValue;
96
+ data: TData extends Record<string, unknown> ? { readonly [K in keyof TData]?: TData[K] | null | undefined } : unknown;
97
+ user: TailorUser;
98
+ }) => TReturn;
99
+ type Hook<TData, TReturn> = {
100
+ create?: HookFn<TReturn | null, TData, TReturn>;
101
+ update?: HookFn<TReturn | null, TData, TReturn>;
102
+ };
103
+ type Hooks<F extends Record<string, TailorAnyDBField>, TData = { [K in keyof F]: output<F[K]> }> = NonEmptyObject<{ [K in Exclude<keyof F, "id"> as F[K]["_defined"] extends {
104
+ hooks: unknown;
105
+ } ? never : F[K]["_defined"] extends {
106
+ type: "nested";
107
+ } ? never : K]?: Hook<TData, output<F[K]>> }>;
108
+ type ExcludeNestedDBFields<T extends Record<string, TailorAnyDBField>> = { [K in keyof T]: T[K] extends TailorDBField<{
109
+ type: "nested";
110
+ array: boolean;
111
+ }, any> ? never : T[K] };
112
+ interface TypeFeatures {
113
+ pluralForm?: string;
114
+ aggregation?: true;
115
+ bulkUpsert?: true;
116
+ /** Configure GraphQL operations for this type. Use "query" for read-only mode, or an object for granular control. */
117
+ gqlOperations?: GqlOperationsConfig;
118
+ /**
119
+ * Enable publishing events for this type.
120
+ * When enabled, record creation/update/deletion events are published.
121
+ * If not specified, this is automatically set to true when an executor uses this type
122
+ * with recordCreated/recordUpdated/recordDeleted triggers. If explicitly set to false
123
+ * while an executor uses this type, an error will be thrown during apply.
124
+ */
125
+ publishEvents?: boolean;
126
+ }
127
+ /**
128
+ * Plugin attachment stored on TailorAnyDBType instances.
129
+ */
130
+ interface PluginAttachment {
131
+ pluginId: string;
132
+ config: unknown;
133
+ }
134
+ type IndexDef<T extends {
135
+ fields: Record<PropertyKey, unknown>;
136
+ }> = {
137
+ fields: [keyof T["fields"], keyof T["fields"], ...(keyof T["fields"])[]];
138
+ unique?: boolean;
139
+ name?: string;
140
+ };
141
+ type RelationType = "1-1" | "oneToOne" | "n-1" | "manyToOne" | "N-1" | "keyOnly";
142
+ type TailorDBExternalConfig = {
143
+ external: true;
144
+ };
145
+ type TailorDBServiceInput = {
146
+ [namespace: string]: TailorDBServiceConfigInput | TailorDBExternalConfig;
147
+ };
148
+ //#endregion
149
+ export { DBFieldMetadata, DefinedDBFieldMetadata, ExcludeNestedDBFields, GqlOperationsConfig, Hook, Hooks, IndexDef, PluginAttachment, RawRelationConfig, RelationType, SerialConfig, TailorAnyDBField, TailorAnyDBType, TailorDBExternalConfig, TailorDBField, TailorDBInstance, TailorDBServiceInput, TailorDBType, TailorDBTypeMetadata, TypeFeatures };
@@ -0,0 +1,7 @@
1
+ import { WorkflowServiceConfig, WorkflowServiceInput } from "../../config/types.mjs";
2
+ import { ConcurrencyPolicy, RetryPolicy } from "../../../types/workflow.generated.mjs";
3
+ import { WORKFLOW_TEST_ENV_KEY } from "./test-env-key.mjs";
4
+ import { WorkflowJob, WorkflowJobContext, createWorkflowJob } from "./job.mjs";
5
+ import { Workflow, WorkflowConfig, createWorkflow } from "./workflow.mjs";
6
+ import { WaitPointInstance, defineWaitPoint, defineWaitPoints } from "./wait-point.mjs";
7
+ export { type ConcurrencyPolicy, type RetryPolicy, WORKFLOW_TEST_ENV_KEY, WaitPointInstance, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, type WorkflowServiceConfig, type WorkflowServiceInput, createWorkflow, createWorkflowJob, defineWaitPoint, defineWaitPoints };
@@ -0,0 +1,81 @@
1
+ import { TailorEnv, TailorInvoker } from "../../../runtime/types.mjs";
2
+ import { JsonCompatible, TypeLevelError } from "../../../types/helpers.mjs";
3
+ import { WORKFLOW_TEST_ENV_KEY } from "./test-env-key.mjs";
4
+
5
+ //#region src/configure/services/workflow/job.d.ts
6
+ /**
7
+ * Context object passed as the second argument to workflow job body functions.
8
+ */
9
+ type WorkflowJobContext = {
10
+ env: TailorEnv;
11
+ invoker?: TailorInvoker;
12
+ };
13
+ /**
14
+ * The body function type for a workflow job.
15
+ * Resolves to the callable signature when `I` / `O` are JsonValue-compatible,
16
+ * or to a type-level error that surfaces at the `body:` property.
17
+ */
18
+ type JobBody<I, O> = [null] extends [I] ? TypeLevelError<"Input cannot be null at the top level"> : [I] extends [undefined] ? [O] extends [JsonCompatible<O> | undefined | void] ? (input: I, context: WorkflowJobContext) => O | Promise<O> : TypeLevelError<"Output must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : [undefined] extends [I] ? TypeLevelError<"Input cannot include undefined at the top level"> : [I] extends [JsonCompatible<I>] ? [O] extends [JsonCompatible<O> | undefined | void] ? (input: I, context: WorkflowJobContext) => O | Promise<O> : TypeLevelError<"Output must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : TypeLevelError<"Input must be JsonValue-compatible (plain objects/arrays; no class instances or functions)">;
19
+ /**
20
+ * WorkflowJob represents a job that can be triggered in a workflow.
21
+ *
22
+ * Type constraints:
23
+ * - Input: Must be JsonValue-compatible (plain objects/arrays; no class instances or functions) or undefined.
24
+ * - Output: Must be JsonValue-compatible (plain objects/arrays; no class instances or functions), undefined, or void.
25
+ * - Trigger returns `Awaited<Output>` as-is (no Jsonify transformation).
26
+ */
27
+ interface WorkflowJob<Name extends string = string, Input = undefined, Output = undefined> {
28
+ name: Name;
29
+ /**
30
+ * Trigger this job with the given input. Returns a Promise that resolves
31
+ * to the job's output value.
32
+ * @example
33
+ * body: async (input) => {
34
+ * const a = await jobA.trigger({ id: input.id });
35
+ * const b = await jobB.trigger({ id: input.id });
36
+ * return { a, b };
37
+ * }
38
+ */
39
+ trigger: [Input] extends [undefined] ? () => Promise<Awaited<Output>> : (input: Input) => Promise<Awaited<Output>>;
40
+ body: (input: Input, context: WorkflowJobContext) => Output | Promise<Output>;
41
+ }
42
+ interface CreateWorkflowJobConfig<Name extends string, I, O> {
43
+ readonly name: Name;
44
+ readonly body: JobBody<I, O>;
45
+ }
46
+ /**
47
+ * Create a workflow job definition.
48
+ *
49
+ * All jobs must be named exports from the workflow file.
50
+ * Job names must be unique across the entire project.
51
+ *
52
+ * Input and output must be JsonValue-compatible (primitives, plain objects, arrays).
53
+ * Functions and objects with a `toJSON` method are rejected at the type level;
54
+ * class instances exposing methods are rejected via the property walk.
55
+ * @param config - Job configuration with name and body function.
56
+ * @param config.name - Unique job name across the project.
57
+ * @param config.body - Async function that processes the job input.
58
+ * @returns A WorkflowJob that can be triggered from other jobs.
59
+ * @example
60
+ * // Simple job with async body:
61
+ * export const fetchData = createWorkflowJob({
62
+ * name: "fetch-data",
63
+ * body: async (input: { id: string }) => {
64
+ * const db = getDB("tailordb");
65
+ * return await db.selectFrom("Table").selectAll().where("id", "=", input.id).executeTakeFirst();
66
+ * },
67
+ * });
68
+ * @example
69
+ * // Orchestrator job that fans out to other jobs.
70
+ * export const orchestrate = createWorkflowJob({
71
+ * name: "orchestrate",
72
+ * body: async (input: { orderId: string }) => {
73
+ * const inventory = await checkInventory.trigger({ orderId: input.orderId });
74
+ * const payment = await processPayment.trigger({ orderId: input.orderId });
75
+ * return { inventory, payment };
76
+ * },
77
+ * });
78
+ */
79
+ declare function createWorkflowJob<const Name extends string, I = undefined, O = undefined>(config: CreateWorkflowJobConfig<Name, I, O>): WorkflowJob<Name, I, Awaited<O>>;
80
+ //#endregion
81
+ export { WORKFLOW_TEST_ENV_KEY, WorkflowJob, WorkflowJobContext, createWorkflowJob };
@@ -0,0 +1,9 @@
1
+ //#region src/configure/services/workflow/test-env-key.d.ts
2
+ /**
3
+ * Env-var fallback read by `.trigger()` when `mockWorkflow().setEnv()` is unset.
4
+ * @deprecated Use `mockWorkflow().setEnv()` from `@tailor-platform/sdk/vitest`.
5
+ * @internal
6
+ */
7
+ declare const WORKFLOW_TEST_ENV_KEY = "TAILOR_TEST_WORKFLOW_ENV";
8
+ //#endregion
9
+ export { WORKFLOW_TEST_ENV_KEY };
@@ -0,0 +1,2 @@
1
+ import { WorkflowServiceConfig, WorkflowServiceInput } from "../../config/types.mjs";
2
+ export type { WorkflowServiceConfig, WorkflowServiceInput };
@@ -0,0 +1,73 @@
1
+ import { JsonCompatible, TypeLevelError } from "../../../types/helpers.mjs";
2
+
3
+ //#region src/configure/services/workflow/wait-point.d.ts
4
+ /**
5
+ * A single wait point instance with typed `.wait()` and `.resolve()` methods.
6
+ *
7
+ * - `.wait(payload?)` suspends execution until resolved. Returns the result from `.resolve()`.
8
+ * - `.resolve(executionId, callback)` resumes a suspended execution.
9
+ *
10
+ * Both `Payload` and `Result` must be JsonValue-compatible (primitives, plain objects, arrays).
11
+ * Functions and objects with a `toJSON` method are rejected at the type level.
12
+ */
13
+ interface WaitPointInstance<Payload = undefined, Result = undefined> {
14
+ wait: [Payload] extends [undefined] ? () => Promise<Result> : (payload: Payload) => Promise<Result>;
15
+ resolve: (executionId: string, callback: (payload: [Payload] extends [undefined] ? undefined : Payload) => Result | Promise<Result>) => Promise<void>;
16
+ }
17
+ /**
18
+ * The type produced by `define<Payload, Result>()` / `defineWaitPoint<Payload, Result>(key)`.
19
+ * Resolves to `WaitPointInstance<Payload, Result>` when both types are JsonValue-compatible,
20
+ * or to a type-level error that surfaces at the call site.
21
+ */
22
+ type WaitPointDef<Payload, Result> = [null] extends [Payload] ? TypeLevelError<"Payload cannot be null at the top level"> : [undefined] extends [Result] ? TypeLevelError<"Result cannot be (or include) undefined (resolve callback must return a value)"> : [Payload] extends [undefined] ? [Result] extends [JsonCompatible<Result>] ? WaitPointInstance<Payload, Result> : TypeLevelError<"Result must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : [undefined] extends [Payload] ? TypeLevelError<"Payload cannot include undefined at the top level"> : [Payload] extends [JsonCompatible<Payload>] ? [Result] extends [JsonCompatible<Result>] ? WaitPointInstance<Payload, Result> : TypeLevelError<"Result must be JsonValue-compatible (plain objects/arrays; no class instances or functions)"> : TypeLevelError<"Payload must be JsonValue-compatible (plain objects/arrays; no class instances or functions)">;
23
+ /**
24
+ * The `define` function passed to the `defineWaitPoints` builder callback.
25
+ * Returns an actual WaitPointInstance (not a phantom marker) so that the
26
+ * builder's return type can flow through as-is, preserving JSDoc comments
27
+ * on each property for IDE autocompletion.
28
+ *
29
+ * JSON validation is encoded in the return type rather than in type-parameter
30
+ * constraints, because tsgo rejects self-referential constraints like
31
+ * `Payload extends JsonCompatible<Payload>` as circular.
32
+ */
33
+ type DefineFn = <Payload = undefined, Result = undefined>() => WaitPointDef<Payload, Result>;
34
+ /**
35
+ * Define a single typed wait point with an explicit key.
36
+ *
37
+ * `Payload` and `Result` must be JsonValue-compatible.
38
+ * Functions and objects with a `toJSON` method are rejected at the type level;
39
+ * class instances exposing methods are rejected via the property walk.
40
+ * @param key - The wait point key used to match wait and resolve calls
41
+ * @returns A WaitPointInstance with typed `.wait()` and `.resolve()` methods
42
+ * @example
43
+ * export const approval = defineWaitPoint<{ message: string }, { approved: boolean }>("approval");
44
+ *
45
+ * await approval.wait({ message: "Please approve" });
46
+ */
47
+ declare function defineWaitPoint<Payload = undefined, Result = undefined>(key: string): WaitPointDef<Payload, Result>;
48
+ /**
49
+ * Define a group of typed wait points for human-in-the-loop workflows.
50
+ * Property names become the wait point keys.
51
+ *
52
+ * The return type is the same as the builder's return type, so JSDoc on each
53
+ * property is preserved and visible in IDE autocompletion.
54
+ *
55
+ * `Payload` and `Result` must be JsonValue-compatible.
56
+ * Functions and objects with a `toJSON` method are rejected at the type level;
57
+ * class instances exposing methods are rejected via the property walk.
58
+ * @param builder - Callback that receives a `define` factory and returns an object of wait points
59
+ * @returns The same object returned by the builder (with correct keys set on each instance)
60
+ * @example
61
+ * export const waitPoints = defineWaitPoints(define => ({
62
+ * // Preceding JSDoc on this property is shown in IDE autocompletion
63
+ * approval: define<{ message: string }, { approved: boolean }>(),
64
+ * }));
65
+ *
66
+ * // IDE shows the JSDoc when typing `waitPoints.`
67
+ * await waitPoints.approval.wait({ message: "Please approve" });
68
+ *
69
+ * // For 2-level access, use destructured export with JSDoc attached to the export itself.
70
+ */
71
+ declare function defineWaitPoints<T extends Record<string, WaitPointInstance<any, any>>>(builder: (define: DefineFn) => T): T;
72
+ //#endregion
73
+ export { WaitPointInstance, defineWaitPoint, defineWaitPoints };
@@ -0,0 +1,55 @@
1
+ import { ConcurrencyPolicy, RetryPolicy } from "../../../types/workflow.generated.mjs";
2
+ import { MachineUserName } from "../../types/machine-user.mjs";
3
+ import { AuthInvoker } from "../auth/index.mjs";
4
+ import { WorkflowJob } from "./job.mjs";
5
+
6
+ //#region src/configure/services/workflow/workflow.d.ts
7
+ interface WorkflowConfig<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
8
+ name: string;
9
+ mainJob: Job;
10
+ retryPolicy?: RetryPolicy;
11
+ concurrencyPolicy?: ConcurrencyPolicy;
12
+ }
13
+ interface Workflow<Job extends WorkflowJob<any, any, any> = WorkflowJob<any, any, any>> {
14
+ name: string;
15
+ mainJob: Job;
16
+ retryPolicy?: RetryPolicy;
17
+ concurrencyPolicy?: ConcurrencyPolicy;
18
+ trigger: (args: Parameters<Job["trigger"]>[0], options?: {
19
+ authInvoker: AuthInvoker<string> | MachineUserName;
20
+ }) => Promise<string>;
21
+ }
22
+ interface WorkflowDefinition<Job extends WorkflowJob<any, any, any>> {
23
+ name: string;
24
+ mainJob: Job;
25
+ retryPolicy?: RetryPolicy;
26
+ concurrencyPolicy?: ConcurrencyPolicy;
27
+ }
28
+ /**
29
+ * Create a workflow definition that can be triggered via the Tailor SDK.
30
+ * In production, bundler transforms .trigger() calls to tailor.workflow.triggerWorkflow().
31
+ *
32
+ * The workflow MUST be the default export of the file.
33
+ * All jobs referenced by the workflow MUST be named exports.
34
+ * @template Job
35
+ * @param config - Workflow configuration
36
+ * @returns Defined workflow
37
+ * @example
38
+ * export const fetchData = createWorkflowJob({ name: "fetch-data", body: async (input: { id: string }) => ({ id: input.id }) });
39
+ * export const processData = createWorkflowJob({
40
+ * name: "process-data",
41
+ * body: async (input: { id: string }) => {
42
+ * const data = await fetchData.trigger({ id: input.id });
43
+ * return { data };
44
+ * },
45
+ * });
46
+ *
47
+ * // Workflow must be default export; mainJob is the entry point
48
+ * export default createWorkflow({
49
+ * name: "data-processing",
50
+ * mainJob: processData,
51
+ * });
52
+ */
53
+ declare function createWorkflow<Job extends WorkflowJob<any, any, any>>(config: WorkflowDefinition<Job>): Workflow<Job>;
54
+ //#endregion
55
+ export { type ConcurrencyPolicy, type RetryPolicy, Workflow, WorkflowConfig, createWorkflow };
@@ -0,0 +1,12 @@
1
+ //#region src/configure/types/aigateway-name.d.ts
2
+ interface AIGatewayNameRegistry {}
3
+ /**
4
+ * AI Gateway name.
5
+ *
6
+ * When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
7
+ * to the union of AI Gateway names defined via `defineAIGateway()`. Falls back to
8
+ * `string` before the first generate run.
9
+ */
10
+ type AIGatewayName = keyof AIGatewayNameRegistry extends never ? string : keyof AIGatewayNameRegistry & string;
11
+ //#endregion
12
+ export { AIGatewayName, AIGatewayNameRegistry };
@@ -0,0 +1,12 @@
1
+ //#region src/configure/types/connection-name.d.ts
2
+ interface ConnectionNameRegistry {}
3
+ /**
4
+ * Auth connection name.
5
+ *
6
+ * When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
7
+ * to the union of connection names defined in `defineAuth()`'s `connections`. Falls back
8
+ * to `string` before the first generate run.
9
+ */
10
+ type ConnectionName = keyof ConnectionNameRegistry extends never ? string : keyof ConnectionNameRegistry & string;
11
+ //#endregion
12
+ export { ConnectionName, ConnectionNameRegistry };
@@ -0,0 +1,9 @@
1
+ import { EnumValue } from "./field.types.mjs";
2
+
3
+ //#region src/configure/types/field.d.ts
4
+ type AllowedValues = readonly [string | EnumValue, ...(string | EnumValue)[]];
5
+ type AllowedValuesOutput<V extends AllowedValues> = V[number] extends infer T ? T extends string ? T : T extends {
6
+ value: infer K;
7
+ } ? K : never : never;
8
+ //#endregion
9
+ export { AllowedValues, AllowedValuesOutput };
@@ -0,0 +1,109 @@
1
+ import { TailorUser } from "../../runtime/types.mjs";
2
+ import { InferFieldsOutput, output } from "../../types/helpers.mjs";
3
+ import { NonEmptyObject } from "type-fest";
4
+
5
+ //#region src/configure/types/field.types.d.ts
6
+ interface EnumValue {
7
+ value: string;
8
+ description?: string;
9
+ }
10
+ type TailorFieldType = "uuid" | "string" | "boolean" | "integer" | "float" | "decimal" | "enum" | "date" | "datetime" | "time" | "nested";
11
+ type TailorToTs = {
12
+ string: string;
13
+ integer: number;
14
+ float: number;
15
+ decimal: string;
16
+ boolean: boolean;
17
+ uuid: string;
18
+ date: string;
19
+ datetime: string | Date;
20
+ time: string;
21
+ enum: string;
22
+ object: Record<string, unknown>;
23
+ nested: Record<string, unknown>;
24
+ } & Record<TailorFieldType, unknown>;
25
+ interface FieldMetadata {
26
+ description?: string;
27
+ required?: boolean;
28
+ array?: boolean;
29
+ allowedValues?: EnumValue[];
30
+ validate?: FieldValidateInput<any>[];
31
+ typeName?: string;
32
+ }
33
+ interface DefinedFieldMetadata {
34
+ type: TailorFieldType;
35
+ array: boolean;
36
+ description?: boolean;
37
+ validate?: boolean;
38
+ typeName?: boolean;
39
+ }
40
+ type FieldOptions = {
41
+ optional?: boolean;
42
+ array?: boolean;
43
+ };
44
+ type FieldOutput<T, O extends FieldOptions> = OptionalFieldOutput<ArrayFieldOutput<T, O>, O>;
45
+ type OptionalFieldOutput<T, O extends FieldOptions> = O["optional"] extends true ? T | null : T;
46
+ type ArrayFieldOutput<T, O extends FieldOptions> = [O] extends [{
47
+ array: true;
48
+ }] ? T[] : T;
49
+ /**
50
+ * Validation function type
51
+ */
52
+ type ValidateFn<O, D = unknown> = (args: {
53
+ value: O;
54
+ data: D;
55
+ user: TailorUser;
56
+ }) => boolean;
57
+ /**
58
+ * Validation configuration with custom error message
59
+ */
60
+ type ValidateConfig<O, D = unknown> = [ValidateFn<O, D>, string];
61
+ /**
62
+ * Field-level validation function
63
+ */
64
+ type FieldValidateFn<O> = ValidateFn<O>;
65
+ /**
66
+ * Field-level validation configuration
67
+ */
68
+ type FieldValidateConfig<O> = ValidateConfig<O>;
69
+ /**
70
+ * Input type for field validation - can be either a function or a tuple of [function, errorMessage]
71
+ */
72
+ type FieldValidateInput<O> = FieldValidateFn<O> | FieldValidateConfig<O>;
73
+ /**
74
+ * Base validators type for field collections
75
+ * @template F - Record of fields
76
+ * @template ExcludeKeys - Keys to exclude from validation (default: "id" for TailorDB)
77
+ */
78
+ type ValidatorsBase<F extends Record<string, {
79
+ _defined: any;
80
+ _output: any;
81
+ [key: string]: any;
82
+ }>, ExcludeKeys extends string = "id"> = NonEmptyObject<{ [K in Exclude<keyof F, ExcludeKeys> as F[K]["_defined"] extends {
83
+ validate: unknown;
84
+ } ? never : K]?: ValidateFn<output<F[K]>, InferFieldsOutput<F>> | ValidateConfig<output<F[K]>, InferFieldsOutput<F>> | (ValidateFn<output<F[K]>, InferFieldsOutput<F>> | ValidateConfig<output<F[K]>, InferFieldsOutput<F>>)[] }>;
85
+ /**
86
+ * Validators type (by default excludes "id" field for TailorDB compatibility)
87
+ * Can be used with both TailorField and TailorDBField
88
+ */
89
+ type Validators<F extends Record<string, {
90
+ _defined: any;
91
+ _output: any;
92
+ [key: string]: any;
93
+ }>> = ValidatorsBase<F, "id">;
94
+ /**
95
+ * Minimal structural interface for TailorField.
96
+ * Defines only the properties needed by parser, plugin, cli, and types layers.
97
+ * The full interface with builder methods (description, typeName, validate, parse)
98
+ * is defined in configure/types/type.ts.
99
+ */
100
+ interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> {
101
+ readonly type: T;
102
+ readonly fields: Record<string, TailorAnyField>;
103
+ readonly _defined: Defined;
104
+ readonly _output: Output;
105
+ readonly metadata: M;
106
+ }
107
+ type TailorAnyField = TailorField<any>;
108
+ //#endregion
109
+ export { ArrayFieldOutput, DefinedFieldMetadata, EnumValue, FieldMetadata, FieldOptions, FieldOutput, FieldValidateInput, TailorAnyField, TailorField, TailorFieldType, TailorToTs, ValidateConfig, ValidateFn, Validators };
@@ -0,0 +1,12 @@
1
+ //#region src/configure/types/idp-name.d.ts
2
+ interface IdpNameRegistry {}
3
+ /**
4
+ * IdP namespace name.
5
+ *
6
+ * When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
7
+ * to the union of defined IdP names. When no IdPs are registered yet, falls back to
8
+ * `string` to avoid blocking editing before the first generate run.
9
+ */
10
+ type IdpName = keyof IdpNameRegistry extends never ? string : keyof IdpNameRegistry & string;
11
+ //#endregion
12
+ export { IdpName, IdpNameRegistry };
@@ -0,0 +1,4 @@
1
+ import { AllowedValues, AllowedValuesOutput } from "./field.mjs";
2
+ import { TailorAnyField, TailorField } from "./type.mjs";
3
+ import { MachineUserName, MachineUserNameRegistry } from "./machine-user.mjs";
4
+ export { AllowedValues, AllowedValuesOutput, MachineUserName, MachineUserNameRegistry, TailorAnyField, TailorField };
@@ -0,0 +1,12 @@
1
+ //#region src/configure/types/machine-user.d.ts
2
+ interface MachineUserNameRegistry {}
3
+ /**
4
+ * Machine user name.
5
+ *
6
+ * When `tailor.d.ts` is generated (via `tailor-sdk deploy`/`generate`), this is narrowed
7
+ * to the union of defined machine user names. When no machine users are registered yet,
8
+ * falls back to `string` to avoid blocking editing before the first generate run.
9
+ */
10
+ type MachineUserName = keyof MachineUserNameRegistry extends never ? string : keyof MachineUserNameRegistry & string;
11
+ //#endregion
12
+ export { MachineUserName, MachineUserNameRegistry };
@@ -0,0 +1,99 @@
1
+ import { TailorUser } from "../../runtime/types.mjs";
2
+ import { TypeLevelError } from "../../types/helpers.mjs";
3
+ import { DefinedFieldMetadata, FieldMetadata, FieldValidateInput, TailorField as TailorField$1, TailorFieldType } from "./field.types.mjs";
4
+ import { StandardSchemaV1 } from "@standard-schema/spec";
5
+
6
+ //#region src/configure/types/type.d.ts
7
+ type AnyBuilderMethod = any;
8
+ type TailorAnyField = Omit<TailorField$1<AnyBuilderMethod, AnyBuilderMethod, FieldMetadata, TailorFieldType>, "fields"> & {
9
+ readonly fields: Record<string, AnyBuilderMethod>;
10
+ _metadata: FieldMetadata;
11
+ description: AnyBuilderMethod;
12
+ typeName: AnyBuilderMethod;
13
+ validate: AnyBuilderMethod;
14
+ parse: AnyBuilderMethod;
15
+ _parseInternal: AnyBuilderMethod;
16
+ };
17
+ type IsAny<T> = 0 extends 1 & T ? true : false;
18
+ type WithFieldDescription<Defined> = Defined & {
19
+ description: true;
20
+ };
21
+ type WithFieldTypeName<Defined> = Defined & {
22
+ typeName: true;
23
+ };
24
+ type WithFieldValidate<Defined> = Defined & {
25
+ validate: true;
26
+ };
27
+ type FieldDescriptionFn<Defined extends DefinedFieldMetadata, Output> = (description: string) => TailorField<WithFieldDescription<Defined>, Output>;
28
+ type FieldTypeNameFn<Defined extends DefinedFieldMetadata, Output> = (typeName: string) => TailorField<WithFieldTypeName<Defined>, Output>;
29
+ type FieldValidateFn<Defined extends DefinedFieldMetadata, Output> = (...validate: FieldValidateInput<Output>[]) => TailorField<WithFieldValidate<Defined>, Output>;
30
+ type FieldDescriptionMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<Defined> extends true ? FieldDescriptionFn<Defined, Output> : Defined extends {
31
+ description: unknown;
32
+ } ? TypeLevelError<".description() has already been set"> : FieldDescriptionFn<Defined, Output>;
33
+ type FieldTypeNameMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<Defined> extends true ? TypeLevelError<string> : Defined extends {
34
+ typeName: unknown;
35
+ } ? TypeLevelError<".typeName() has already been set"> : Defined extends {
36
+ type: "enum" | "nested";
37
+ } ? FieldTypeNameFn<Defined, Output> : TypeLevelError<"typeName can only be set on enum or object fields">;
38
+ type FieldValidateMethod<Defined extends DefinedFieldMetadata, Output> = IsAny<Defined> extends true ? FieldValidateFn<Defined, Output> : Defined extends {
39
+ validate: unknown;
40
+ } ? TypeLevelError<".validate() has already been set"> : FieldValidateFn<Defined, Output>;
41
+ /**
42
+ * Full TailorField interface with builder methods.
43
+ * Extends the minimal structural interface from types/ with fluent API methods.
44
+ */
45
+ interface TailorField<Defined extends DefinedFieldMetadata = DefinedFieldMetadata, Output = any, M extends FieldMetadata = FieldMetadata, T extends TailorFieldType = TailorFieldType> extends TailorField$1<Defined, Output, M, T> {
46
+ readonly fields: Record<string, TailorAnyField>;
47
+ _metadata: M;
48
+ /**
49
+ * Set a description for the field
50
+ * @param description - The description text
51
+ * @returns The field with updated metadata
52
+ */
53
+ description: FieldDescriptionMethod<Defined, Output>;
54
+ /**
55
+ * Set a custom type name for enum or nested types
56
+ * @param typeName - The custom type name
57
+ * @returns The field with updated metadata
58
+ */
59
+ typeName: FieldTypeNameMethod<Defined, Output>;
60
+ /**
61
+ * Add validation functions to the field
62
+ * @param validate - One or more validation functions
63
+ * @returns The field with updated metadata
64
+ */
65
+ validate: FieldValidateMethod<Defined, Output>;
66
+ /**
67
+ * Parse and validate a value against this field's validation rules
68
+ * Returns StandardSchema Result type with success or failure
69
+ * @param args - Value, context data, and user
70
+ * @returns Validation result
71
+ */
72
+ parse(args: FieldParseArgs): StandardSchemaV1.Result<Output>;
73
+ /**
74
+ * Internal parse method that tracks field path for nested validation
75
+ * @private
76
+ * @param args - Parse arguments
77
+ * @returns Validation result
78
+ */
79
+ _parseInternal(args: FieldParseInternalArgs): StandardSchemaV1.Result<Output>;
80
+ }
81
+ type FieldParseArgs = {
82
+ value: unknown;
83
+ data: unknown;
84
+ user: TailorUser;
85
+ };
86
+ type FieldParseInternalArgs = {
87
+ value: any;
88
+ data: unknown;
89
+ user: TailorUser;
90
+ pathArray: string[];
91
+ };
92
+ /**
93
+ * Create a UUID field for resolver input/output.
94
+ * @param options - Field configuration options
95
+ * @returns A UUID field
96
+ * @example t.uuid()
97
+ */
98
+ //#endregion
99
+ export { TailorAnyField, TailorField };