@tailor-platform/sdk 2.0.0-next.0 → 2.0.0-next.10

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 (497) hide show
  1. package/CHANGELOG.md +972 -0
  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-DArFTTJ9.mjs +3 -0
  7. package/dist/{application-76hhIhnJ.mjs → application-miwiXtB4.mjs} +1963 -1953
  8. package/dist/application-miwiXtB4.mjs.map +1 -0
  9. package/dist/{assert-CKfwrmCV.mjs → assert-DBxo8jPo.mjs} +1 -2
  10. package/dist/{assert-CKfwrmCV.mjs.map → assert-DBxo8jPo.mjs.map} +1 -1
  11. package/dist/authconnection-CZvi9ANm.mjs +9 -0
  12. package/dist/authconnection-CZvi9ANm.mjs.map +1 -0
  13. package/dist/{brand-DlnJ375c.mjs → brand-Eo4pLXPJ.mjs} +1 -2
  14. package/dist/brand-Eo4pLXPJ.mjs.map +1 -0
  15. package/dist/cli/cache/bundle-cache.d.mts +2 -0
  16. package/dist/cli/cache/store.d.mts +1 -0
  17. package/dist/cli/cache/types.d.mts +1 -0
  18. package/dist/cli/commands/api/api-call.d.mts +19 -0
  19. package/dist/cli/commands/api/index.d.mts +4 -0
  20. package/dist/cli/commands/deploy/aigateway.d.mts +5 -0
  21. package/dist/cli/commands/deploy/application.d.mts +7 -0
  22. package/dist/cli/commands/deploy/apply-phases.d.mts +14 -0
  23. package/dist/cli/commands/deploy/auth.d.mts +5 -0
  24. package/dist/cli/commands/deploy/deploy.d.mts +34 -0
  25. package/dist/cli/commands/deploy/executor.d.mts +7 -0
  26. package/dist/cli/commands/deploy/function-registry-types.d.mts +12 -0
  27. package/dist/cli/commands/deploy/function-registry.d.mts +7 -0
  28. package/dist/cli/commands/deploy/idp.d.mts +5 -0
  29. package/dist/cli/commands/deploy/resolver.d.mts +5 -0
  30. package/dist/cli/commands/deploy/secret-manager.d.mts +5 -0
  31. package/dist/cli/commands/deploy/staticwebsite.d.mts +5 -0
  32. package/dist/cli/commands/deploy/tailordb/index.d.mts +9 -0
  33. package/dist/cli/commands/deploy/types.d.mts +3 -0
  34. package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +3 -0
  35. package/dist/cli/commands/deploy/workflow.d.mts +4 -0
  36. package/dist/cli/commands/executor/get.d.mts +28 -0
  37. package/dist/cli/commands/executor/jobs.d.mts +122 -0
  38. package/dist/cli/commands/executor/list.d.mts +18 -0
  39. package/dist/cli/commands/executor/transform.d.mts +42 -0
  40. package/dist/cli/commands/executor/trigger.d.mts +40 -0
  41. package/dist/cli/commands/executor/webhook.d.mts +21 -0
  42. package/dist/cli/commands/function/get.d.mts +17 -0
  43. package/dist/cli/commands/function/list.d.mts +21 -0
  44. package/dist/cli/commands/function/transform.d.mts +12 -0
  45. package/dist/cli/commands/generate/options.d.mts +6 -0
  46. package/dist/cli/commands/generate/seed/bundler.d.mts +26 -0
  47. package/dist/cli/commands/generate/service.d.mts +15 -0
  48. package/dist/cli/commands/machineuser/list.d.mts +26 -0
  49. package/dist/cli/commands/machineuser/token.d.mts +21 -0
  50. package/dist/cli/commands/oauth2client/get.d.mts +17 -0
  51. package/dist/cli/commands/oauth2client/list.d.mts +19 -0
  52. package/dist/cli/commands/oauth2client/transform.d.mts +21 -0
  53. package/dist/cli/commands/organization/folder/create.d.mts +17 -0
  54. package/dist/cli/commands/organization/folder/delete.d.mts +15 -0
  55. package/dist/cli/commands/organization/folder/get.d.mts +16 -0
  56. package/dist/cli/commands/organization/folder/list.d.mts +21 -0
  57. package/dist/cli/commands/organization/folder/update.d.mts +17 -0
  58. package/dist/cli/commands/organization/get.d.mts +15 -0
  59. package/dist/cli/commands/organization/list.d.mts +14 -0
  60. package/dist/cli/commands/organization/transform.d.mts +29 -0
  61. package/dist/cli/commands/organization/tree.d.mts +24 -0
  62. package/dist/cli/commands/organization/update.d.mts +16 -0
  63. package/dist/cli/commands/remove.d.mts +15 -0
  64. package/dist/cli/commands/show.d.mts +39 -0
  65. package/dist/cli/commands/staticwebsite/deploy.d.mts +19 -0
  66. package/dist/cli/commands/tailordb/migrate/bundler.d.mts +29 -0
  67. package/dist/cli/commands/tailordb/migrate/config.d.mts +18 -0
  68. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +246 -0
  69. package/dist/cli/commands/tailordb/migrate/generate.d.mts +16 -0
  70. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +208 -0
  71. package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +98 -0
  72. package/dist/cli/commands/tailordb/migrate/types.d.mts +7 -0
  73. package/dist/cli/commands/tailordb/truncate.d.mts +18 -0
  74. package/dist/cli/commands/workflow/executions.d.mts +74 -0
  75. package/dist/cli/commands/workflow/get.d.mts +30 -0
  76. package/dist/cli/commands/workflow/list.d.mts +18 -0
  77. package/dist/cli/commands/workflow/resume.d.mts +22 -0
  78. package/dist/cli/commands/workflow/start.d.mts +60 -0
  79. package/dist/cli/commands/workflow/status.d.mts +6 -0
  80. package/dist/cli/commands/workflow/transform.d.mts +34 -0
  81. package/dist/cli/commands/workflow/wait.d.mts +15 -0
  82. package/dist/cli/commands/workflow/waiter.d.mts +23 -0
  83. package/dist/cli/commands/workspace/app/health.d.mts +17 -0
  84. package/dist/cli/commands/workspace/app/list.d.mts +21 -0
  85. package/dist/cli/commands/workspace/app/transform.d.mts +20 -0
  86. package/dist/cli/commands/workspace/create.d.mts +27 -0
  87. package/dist/cli/commands/workspace/delete.d.mts +14 -0
  88. package/dist/cli/commands/workspace/get.d.mts +16 -0
  89. package/dist/cli/commands/workspace/list.d.mts +17 -0
  90. package/dist/cli/commands/workspace/restore.d.mts +14 -0
  91. package/dist/cli/commands/workspace/transform.d.mts +20 -0
  92. package/dist/cli/commands/workspace/user/invite.d.mts +21 -0
  93. package/dist/cli/commands/workspace/user/list.d.mts +21 -0
  94. package/dist/cli/commands/workspace/user/remove.d.mts +16 -0
  95. package/dist/cli/commands/workspace/user/transform.d.mts +9 -0
  96. package/dist/cli/commands/workspace/user/update.d.mts +21 -0
  97. package/dist/cli/index.mjs +12 -5534
  98. package/dist/cli/lib.d.mts +90 -21180
  99. package/dist/cli/lib.mjs +157 -16
  100. package/dist/cli/lib.mjs.map +1 -1
  101. package/dist/cli/main.d.mts +23 -0
  102. package/dist/cli/main.mjs +6583 -0
  103. package/dist/cli/main.mjs.map +1 -0
  104. package/dist/cli/query/index.d.mts +38 -0
  105. package/dist/cli/services/application.d.mts +12 -0
  106. package/dist/cli/services/auth/service.d.mts +3 -0
  107. package/dist/cli/services/executor/service.d.mts +1 -0
  108. package/dist/cli/services/http-adapter/bundler.d.mts +3 -0
  109. package/dist/cli/services/http-adapter/service.d.mts +2 -0
  110. package/dist/cli/services/resolver/service.d.mts +1 -0
  111. package/dist/cli/services/tailordb/service.d.mts +3 -0
  112. package/dist/cli/services/workflow/bundler.d.mts +2 -0
  113. package/dist/cli/services/workflow/service.d.mts +1 -0
  114. package/dist/cli/shared/args.d.mts +13 -0
  115. package/dist/cli/shared/client.d.mts +1273 -0
  116. package/dist/cli/shared/config-loader.d.mts +25 -0
  117. package/dist/cli/shared/context.d.mts +29 -0
  118. package/dist/cli/shared/error-json.d.mts +23 -0
  119. package/dist/cli/shared/readonly-guard.d.mts +25 -0
  120. package/dist/cli/shared/script-executor.d.mts +77 -0
  121. package/dist/cli/shared/seed-chunker.d.mts +45 -0
  122. package/dist/cli/shared/seed-context.d.mts +49 -0
  123. package/dist/cli/shared/tailordb-namespaces.d.mts +40 -0
  124. package/dist/cli/shared/type-generator.d.mts +19 -0
  125. package/dist/cli/shared/workspace-name.d.mts +1 -0
  126. package/dist/cli/ts-hook.d.mts +4 -0
  127. package/dist/cli/ts-hook.mjs +333 -0
  128. package/dist/completion/zsh-worker.zsh +4223 -0
  129. package/dist/configure/config/index.d.mts +20 -0
  130. package/dist/configure/config/types.d.mts +111 -0
  131. package/dist/configure/index.d.mts +135 -7
  132. package/dist/configure/index.mjs +409 -56
  133. package/dist/configure/index.mjs.map +1 -1
  134. package/dist/configure/services/aigateway/index.d.mts +16 -0
  135. package/dist/configure/services/aigateway/types.d.mts +10 -0
  136. package/dist/configure/services/auth/index.d.mts +33 -0
  137. package/dist/configure/services/auth/types.d.mts +168 -0
  138. package/dist/configure/services/executor/executor.d.mts +70 -0
  139. package/dist/configure/services/executor/index.d.mts +9 -0
  140. package/dist/configure/services/executor/operation.d.mts +50 -0
  141. package/dist/configure/services/executor/trigger/event.d.mts +271 -0
  142. package/dist/configure/services/executor/trigger/index.d.mts +7 -0
  143. package/dist/configure/services/executor/trigger/schedule.d.mts +24 -0
  144. package/dist/configure/services/executor/trigger/webhook.d.mts +43 -0
  145. package/dist/configure/services/executor/types.d.mts +2 -0
  146. package/dist/configure/services/http-adapter/http-adapter.d.mts +124 -0
  147. package/dist/configure/services/http-adapter/index.d.mts +2 -0
  148. package/dist/configure/services/idp/index.d.mts +60 -0
  149. package/dist/configure/services/idp/permission.d.mts +64 -0
  150. package/dist/configure/services/idp/types.d.mts +23 -0
  151. package/dist/configure/services/index.d.mts +40 -0
  152. package/dist/configure/services/resolver/index.d.mts +6 -0
  153. package/dist/configure/services/resolver/permission.d.mts +64 -0
  154. package/dist/configure/services/resolver/resolver.d.mts +88 -0
  155. package/dist/configure/services/resolver/types.d.mts +5 -0
  156. package/dist/configure/services/secrets/index.d.mts +37 -0
  157. package/dist/configure/services/secrets/types.d.mts +10 -0
  158. package/dist/configure/services/staticwebsite/index.d.mts +18 -0
  159. package/dist/configure/services/staticwebsite/types.d.mts +10 -0
  160. package/dist/configure/services/tailordb/index.d.mts +4 -0
  161. package/dist/configure/services/tailordb/permission.d.mts +103 -0
  162. package/dist/configure/services/tailordb/schema.d.mts +486 -0
  163. package/dist/configure/services/tailordb/types.d.mts +198 -0
  164. package/dist/configure/services/workflow/execution-policy.d.mts +70 -0
  165. package/dist/configure/services/workflow/execution-policy.types.d.mts +103 -0
  166. package/dist/configure/services/workflow/index.d.mts +9 -0
  167. package/dist/configure/services/workflow/job.d.mts +83 -0
  168. package/dist/configure/services/workflow/types.d.mts +2 -0
  169. package/dist/configure/services/workflow/wait-point.d.mts +72 -0
  170. package/dist/configure/services/workflow/workflow.d.mts +56 -0
  171. package/dist/configure/types/aigateway-name.d.mts +12 -0
  172. package/dist/configure/types/connection-name.d.mts +12 -0
  173. package/dist/configure/types/field.d.mts +8 -0
  174. package/dist/configure/types/field.types.d.mts +70 -0
  175. package/dist/configure/types/idp-name.d.mts +12 -0
  176. package/dist/configure/types/index.d.mts +5 -0
  177. package/dist/configure/types/machine-user.d.mts +2 -0
  178. package/dist/configure/types/permission-operand.types.d.mts +20 -0
  179. package/dist/configure/types/type.d.mts +73 -0
  180. package/dist/{context-s0lxhu8_.mjs → context-DYQVYWqZ.mjs} +4 -6
  181. package/dist/context-DYQVYWqZ.mjs.map +1 -0
  182. package/dist/{crashreport-BhD0y14F.mjs → crashreport-B5LqCTfF.mjs} +25 -17
  183. package/dist/{crashreport-BhD0y14F.mjs.map → crashreport-B5LqCTfF.mjs.map} +1 -1
  184. package/dist/{crashreport-D1wKBJ8N.mjs → crashreport-eI7ty7ok.mjs} +1 -2
  185. package/dist/{enum-constants-C7DaWeQo.mjs → enum-constants-j9QBF0cB.mjs} +1 -2
  186. package/dist/enum-constants-j9QBF0cB.mjs.map +1 -0
  187. package/dist/{errors-EsY4XO6O.mjs → errors-D7583Zz7.mjs} +18 -3
  188. package/dist/errors-D7583Zz7.mjs.map +1 -0
  189. package/dist/{file-B58Dm-2P.mjs → file-BUcmVIH2.mjs} +12 -23
  190. package/dist/file-BUcmVIH2.mjs.map +1 -0
  191. package/dist/{file-utils-BHPxPXmn.mjs → file-utils-yEiIS4nJ.mjs} +7 -8
  192. package/dist/file-utils-yEiIS4nJ.mjs.map +1 -0
  193. package/dist/{globals-ByrCoDip.mjs → globals-DQotNuwK.mjs} +32 -6
  194. package/dist/globals-DQotNuwK.mjs.map +1 -0
  195. package/dist/iconv-QWaZh0TT.mjs +38 -0
  196. package/dist/iconv-QWaZh0TT.mjs.map +1 -0
  197. package/dist/{idp-Ch95ag8h.mjs → idp-RA_swu-h.mjs} +12 -6
  198. package/dist/idp-RA_swu-h.mjs.map +1 -0
  199. package/dist/{interceptor-DOqRkCya.mjs → interceptor-e33JtsC-.mjs} +2 -3
  200. package/dist/interceptor-e33JtsC-.mjs.map +1 -0
  201. package/dist/kysely/index.d.mts +5 -7
  202. package/dist/kysely/index.mjs +0 -1
  203. package/dist/kysely/index.mjs.map +1 -1
  204. package/dist/{kysely-type-D1e0Vwkd.mjs → kysely-type-DqIRgDYR.mjs} +6 -6
  205. package/dist/kysely-type-DqIRgDYR.mjs.map +1 -0
  206. package/dist/logger-BtX0suGY.mjs +48 -0
  207. package/dist/logger-BtX0suGY.mjs.map +1 -0
  208. package/dist/logger-CXQq9YIp.mjs +317 -0
  209. package/dist/logger-CXQq9YIp.mjs.map +1 -0
  210. package/dist/{multiline-Cf9ODpr1.mjs → multiline-sfHpTZZK.mjs} +1 -2
  211. package/dist/{multiline-Cf9ODpr1.mjs.map → multiline-sfHpTZZK.mjs.map} +1 -1
  212. package/dist/{package-json-DcQApfPQ.mjs → package-json-8b0O9TlX.mjs} +1 -2
  213. package/dist/{package-json-DcQApfPQ.mjs.map → package-json-8b0O9TlX.mjs.map} +1 -1
  214. package/dist/package-json-Cv2Z-TqQ.mjs +3 -0
  215. package/dist/parser/service/auth/index.d.mts +1 -0
  216. package/dist/parser/service/auth/schema.d.mts +3 -0
  217. package/dist/parser/service/http-adapter/index.d.mts +1 -0
  218. package/dist/parser/service/http-adapter/schema.d.mts +1 -0
  219. package/dist/parser/service/idp/types.d.mts +5 -0
  220. package/dist/parser/service/tailordb/type-source.d.mts +10 -0
  221. package/dist/parser/service/tailordb/types.d.mts +131 -0
  222. package/dist/platform-serialize-RoRtBS0v.mjs +46 -0
  223. package/dist/platform-serialize-RoRtBS0v.mjs.map +1 -0
  224. package/dist/plugin/builtin/enum-constants/index.d.mts +15 -1
  225. package/dist/plugin/builtin/enum-constants/index.mjs +1 -2
  226. package/dist/plugin/builtin/file-utils/index.d.mts +15 -1
  227. package/dist/plugin/builtin/file-utils/index.mjs +1 -2
  228. package/dist/plugin/builtin/kysely-type/index.d.mts +15 -1
  229. package/dist/plugin/builtin/kysely-type/index.mjs +1 -2
  230. package/dist/plugin/builtin/seed/index.d.mts +46 -2
  231. package/dist/plugin/builtin/seed/index.mjs +1 -2
  232. package/dist/plugin/builtin/seed/seed-type-processor.d.mts +19 -0
  233. package/dist/plugin/builtin/seed/types.d.mts +2 -0
  234. package/dist/plugin/get-generated-type.d.mts +16 -0
  235. package/dist/plugin/index.d.mts +3 -119
  236. package/dist/plugin/index.mjs +1 -2
  237. package/dist/plugin/index.mjs.map +1 -1
  238. package/dist/plugin/manager.d.mts +2 -0
  239. package/dist/plugin/types.d.mts +242 -0
  240. package/dist/plugin/with-context.d.mts +101 -0
  241. package/dist/{runtime-C7qTBDD2.mjs → register-ts-hook-BAHMwxfG.mjs} +12374 -8672
  242. package/dist/register-ts-hook-BAHMwxfG.mjs.map +1 -0
  243. package/dist/registry-BIGVUrMB.mjs +54 -0
  244. package/dist/registry-BIGVUrMB.mjs.map +1 -0
  245. package/dist/{repl-editor-CJG3sz7A.mjs → repl-editor-BCozyiNq.mjs} +7 -7
  246. package/dist/{repl-editor-CJG3sz7A.mjs.map → repl-editor-BCozyiNq.mjs.map} +1 -1
  247. package/dist/runtime/aigateway.d.mts +25 -0
  248. package/dist/runtime/aigateway.mjs +3 -0
  249. package/dist/runtime/authconnection.d.mts +21 -2
  250. package/dist/runtime/authconnection.mjs +2 -3
  251. package/dist/runtime/context.d.mts +54 -2
  252. package/dist/runtime/context.mjs +2 -3
  253. package/dist/runtime/field-parse.d.mts +10 -0
  254. package/dist/runtime/file.d.mts +170 -2
  255. package/dist/runtime/file.mjs +2 -3
  256. package/dist/runtime/globals.d.mts +38 -53
  257. package/dist/runtime/globals.mjs +0 -1
  258. package/dist/runtime/iconv.d.mts +73 -2
  259. package/dist/runtime/iconv.mjs +2 -3
  260. package/dist/runtime/idp.d.mts +129 -2
  261. package/dist/runtime/idp.mjs +2 -3
  262. package/dist/runtime/index.d.mts +48 -9
  263. package/dist/runtime/index.mjs +10 -9
  264. package/dist/runtime/logger.d.mts +98 -0
  265. package/dist/runtime/logger.mjs +3 -0
  266. package/dist/runtime/secretmanager.d.mts +41 -2
  267. package/dist/runtime/secretmanager.mjs +2 -3
  268. package/dist/runtime/types.d.mts +25 -0
  269. package/dist/runtime/workflow.d.mts +124 -2
  270. package/dist/runtime/workflow.mjs +2 -3
  271. package/dist/{schema-1msIhXwA.mjs → schema--xYWRGfe.mjs} +289 -231
  272. package/dist/schema--xYWRGfe.mjs.map +1 -0
  273. package/dist/{secret-file-CWzF8rry.mjs → secret-file-C3J4Gy8r.mjs} +2 -3
  274. package/dist/{secret-file-CWzF8rry.mjs.map → secret-file-C3J4Gy8r.mjs.map} +1 -1
  275. package/dist/secretmanager-CYlpffsz.mjs +13 -0
  276. package/dist/secretmanager-CYlpffsz.mjs.map +1 -0
  277. package/dist/secretmanager-IY4UvinW.mjs +131 -0
  278. package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
  279. package/dist/seed/index.d.mts +4 -4
  280. package/dist/seed/index.mjs +0 -1
  281. package/dist/seed/index.mjs.map +1 -1
  282. package/dist/seed-LUVr7jHL.mjs +444 -0
  283. package/dist/seed-LUVr7jHL.mjs.map +1 -0
  284. package/dist/{service-DMohAx8a2.mjs → service-B5WynBHQ.mjs} +3 -4
  285. package/dist/service-B5WynBHQ.mjs.map +1 -0
  286. package/dist/service-BNtPsK9Q.mjs +837 -0
  287. package/dist/service-BNtPsK9Q.mjs.map +1 -0
  288. package/dist/service-D5jn05ZI.mjs +3 -0
  289. package/dist/service_pb-BwZRiNug.mjs +167 -0
  290. package/dist/service_pb-BwZRiNug.mjs.map +1 -0
  291. package/dist/service_pb-wRkxUta6.mjs +3 -0
  292. package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +203 -0
  293. package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +57 -0
  294. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +315 -0
  295. package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +160 -0
  296. package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +2069 -0
  297. package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +865 -0
  298. package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +111 -0
  299. package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +68 -0
  300. package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +438 -0
  301. package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +563 -0
  302. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +144 -0
  303. package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +450 -0
  304. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +191 -0
  305. package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +49 -0
  306. package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +406 -0
  307. package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +429 -0
  308. package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +72 -0
  309. package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +16 -0
  310. package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +308 -0
  311. package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +590 -0
  312. package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +329 -0
  313. package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +112 -0
  314. package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +345 -0
  315. package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +53 -0
  316. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +3575 -0
  317. package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +186 -0
  318. package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +28 -0
  319. package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +428 -0
  320. package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +89 -0
  321. package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +683 -0
  322. package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +796 -0
  323. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +329 -0
  324. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +182 -0
  325. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +861 -0
  326. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +309 -0
  327. package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +2014 -0
  328. package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +482 -0
  329. package/dist/{telemetry-BQbbVo2t.mjs → telemetry-BRVdwh14.mjs} +4 -5
  330. package/dist/telemetry-BRVdwh14.mjs.map +1 -0
  331. package/dist/telemetry-CkbkeJxl.mjs +3 -0
  332. package/dist/test-env-key-D7UkZp99.mjs +75 -0
  333. package/dist/test-env-key-D7UkZp99.mjs.map +1 -0
  334. package/dist/type-source-DH_LH20p.mjs +13 -0
  335. package/dist/type-source-DH_LH20p.mjs.map +1 -0
  336. package/dist/types/aigateway.generated.d.mts +12 -0
  337. package/dist/types/app-config.generated.d.mts +4 -0
  338. package/dist/types/auth-connection.generated.d.mts +33 -0
  339. package/dist/types/auth.generated.d.mts +188 -0
  340. package/dist/types/executor.generated.d.mts +209 -0
  341. package/dist/types/helpers.d.mts +40 -0
  342. package/dist/types/http-adapter.generated.d.mts +28 -0
  343. package/dist/types/idp.generated.d.mts +626 -0
  344. package/dist/types/resolver.generated.d.mts +82 -0
  345. package/dist/types/secrets.generated.d.mts +14 -0
  346. package/dist/types/staticwebsite.generated.d.mts +14 -0
  347. package/dist/types/tailordb.generated.d.mts +468 -0
  348. package/dist/types/workflow.generated.d.mts +17 -0
  349. package/dist/user-agent-Bgsszb5I.mjs +28 -0
  350. package/dist/user-agent-Bgsszb5I.mjs.map +1 -0
  351. package/dist/utils/test/index.d.mts +6 -99
  352. package/dist/utils/test/index.mjs +60 -40
  353. package/dist/utils/test/index.mjs.map +1 -1
  354. package/dist/utils/test/mock.d.mts +86 -0
  355. package/dist/vitest/environment.d.mts +1 -2
  356. package/dist/vitest/environment.mjs +2 -3
  357. package/dist/vitest/environment.mjs.map +1 -1
  358. package/dist/vitest/index.d.mts +15 -392
  359. package/dist/vitest/index.mjs +1347 -9
  360. package/dist/vitest/index.mjs.map +1 -1
  361. package/dist/vitest/mock-kysely.d.mts +61 -0
  362. package/dist/vitest/mock.d.mts +10 -0
  363. package/dist/vitest/mocks/aigateway.d.mts +40 -0
  364. package/dist/vitest/mocks/authconnection.d.mts +38 -0
  365. package/dist/vitest/mocks/file.d.mts +58 -0
  366. package/dist/vitest/mocks/iconv.d.mts +51 -0
  367. package/dist/vitest/mocks/idp.d.mts +60 -0
  368. package/dist/vitest/mocks/logger.d.mts +45 -0
  369. package/dist/vitest/mocks/secretmanager.d.mts +44 -0
  370. package/dist/vitest/mocks/tailordb.d.mts +115 -0
  371. package/dist/vitest/mocks/workflow.d.mts +157 -0
  372. package/dist/vitest/setup.d.mts +1 -2
  373. package/dist/vitest/setup.mjs +2 -3
  374. package/dist/vitest/setup.mjs.map +1 -1
  375. package/dist/vitest/workflow-local.d.mts +41 -0
  376. package/dist/workflow-CsaQ9qK-.mjs +42 -0
  377. package/dist/workflow-CsaQ9qK-.mjs.map +1 -0
  378. package/dist/{client-CobIRHl-.mjs → workspace_resource_pb-UGK1SSn_.mjs} +55 -616
  379. package/dist/workspace_resource_pb-UGK1SSn_.mjs.map +1 -0
  380. package/docs/cli/application.md +150 -252
  381. package/docs/cli/auth.md +51 -295
  382. package/docs/cli/completion.md +4 -25
  383. package/docs/cli/crashreport.md +3 -63
  384. package/docs/cli/executor.md +72 -183
  385. package/docs/cli/function.md +17 -133
  386. package/docs/cli/organization.md +11 -221
  387. package/docs/cli/plugin.md +29 -0
  388. package/docs/cli/query.md +2 -22
  389. package/docs/cli/secret.md +71 -251
  390. package/docs/cli/setup.md +138 -40
  391. package/docs/cli/skills.md +50 -39
  392. package/docs/cli/staticwebsite.md +32 -180
  393. package/docs/cli/tailordb.md +71 -427
  394. package/docs/cli/upgrade.md +2 -22
  395. package/docs/cli/user.md +78 -247
  396. package/docs/cli/workflow.md +150 -172
  397. package/docs/cli/workspace.md +167 -538
  398. package/docs/cli-reference.md +213 -96
  399. package/docs/configuration.md +40 -8
  400. package/docs/github-actions.md +72 -24
  401. package/docs/migration/v2.md +1316 -0
  402. package/docs/multi-environment.md +29 -7
  403. package/docs/plugin/custom.md +6 -6
  404. package/docs/plugin/index.md +9 -9
  405. package/docs/quickstart.md +8 -7
  406. package/docs/runtime.md +21 -12
  407. package/docs/services/aigateway.md +115 -0
  408. package/docs/services/auth.md +70 -61
  409. package/docs/services/executor.md +8 -5
  410. package/docs/services/http-adapter.md +16 -1
  411. package/docs/services/idp.md +55 -2
  412. package/docs/services/resolver.md +63 -11
  413. package/docs/services/secret.md +11 -11
  414. package/docs/services/staticwebsite.md +8 -2
  415. package/docs/services/tailordb-migration.md +43 -28
  416. package/docs/services/tailordb.md +200 -99
  417. package/docs/services/workflow.md +135 -59
  418. package/docs/testing.md +253 -145
  419. package/package.json +61 -47
  420. package/postinstall.mjs +4 -6
  421. package/dist/actor-J2gJ0eK5.d.mts +0 -24
  422. package/dist/application-76hhIhnJ.mjs.map +0 -1
  423. package/dist/application-av2raLs6.mjs +0 -4
  424. package/dist/authconnection-BIYzEh2p.d.mts +0 -39
  425. package/dist/authconnection-D8SJGMpj.mjs +0 -16
  426. package/dist/authconnection-D8SJGMpj.mjs.map +0 -1
  427. package/dist/brand-DlnJ375c.mjs.map +0 -1
  428. package/dist/chunk-BkoGK1jX.mjs +0 -21
  429. package/dist/cli/erd-viewer-assets/app.js +0 -1181
  430. package/dist/cli/erd-viewer-assets/index.html +0 -73
  431. package/dist/cli/erd-viewer-assets/serve.json +0 -13
  432. package/dist/cli/erd-viewer-assets/styles.css +0 -789
  433. package/dist/cli/index.d.mts +0 -5
  434. package/dist/cli/index.mjs.map +0 -1
  435. package/dist/cli/skills.d.mts +0 -1
  436. package/dist/cli/skills.mjs +0 -22
  437. package/dist/cli/skills.mjs.map +0 -1
  438. package/dist/client-C68VWo4g.mjs +0 -4
  439. package/dist/client-CobIRHl-.mjs.map +0 -1
  440. package/dist/context-CUBwSBq4.d.mts +0 -68
  441. package/dist/context-s0lxhu8_.mjs.map +0 -1
  442. package/dist/enum-constants-C7DaWeQo.mjs.map +0 -1
  443. package/dist/env-B-g-qgE4.d.mts +0 -7
  444. package/dist/errors-EsY4XO6O.mjs.map +0 -1
  445. package/dist/field-C4zdJLW5.mjs +0 -23
  446. package/dist/field-C4zdJLW5.mjs.map +0 -1
  447. package/dist/file-B58Dm-2P.mjs.map +0 -1
  448. package/dist/file-BzK8z3X-.d.mts +0 -250
  449. package/dist/file-utils-BHPxPXmn.mjs.map +0 -1
  450. package/dist/globals-ByrCoDip.mjs.map +0 -1
  451. package/dist/iconv-DreIffeM.mjs +0 -64
  452. package/dist/iconv-DreIffeM.mjs.map +0 -1
  453. package/dist/iconv-kwrmd1U_.d.mts +0 -122
  454. package/dist/idp-BlBPtXJ-.d.mts +0 -160
  455. package/dist/idp-Ch95ag8h.mjs.map +0 -1
  456. package/dist/index-CLxubakC.d.mts +0 -1225
  457. package/dist/index-CPRnOjjt.d.mts +0 -18
  458. package/dist/index-CQZVJ5SX.d.mts +0 -18
  459. package/dist/index-CfRFkXIO.d.mts +0 -47
  460. package/dist/index-DRhMpdnA.d.mts +0 -46
  461. package/dist/index-DUupuPhZ.d.mts +0 -18
  462. package/dist/interceptor-DOqRkCya.mjs.map +0 -1
  463. package/dist/job-BpsFXPbi.mjs +0 -54
  464. package/dist/job-BpsFXPbi.mjs.map +0 -1
  465. package/dist/kysely-type-D1e0Vwkd.mjs.map +0 -1
  466. package/dist/logger-DpJyJvNz.mjs +0 -221
  467. package/dist/logger-DpJyJvNz.mjs.map +0 -1
  468. package/dist/mock-DMgIygjE.mjs +0 -806
  469. package/dist/mock-DMgIygjE.mjs.map +0 -1
  470. package/dist/package-json-wzO6nV9O.mjs +0 -4
  471. package/dist/plugin-C_FyVSdl.d.mts +0 -634
  472. package/dist/registry-D0uB0OrK.mjs +0 -178
  473. package/dist/registry-D0uB0OrK.mjs.map +0 -1
  474. package/dist/runtime-C7qTBDD2.mjs.map +0 -1
  475. package/dist/schema-1msIhXwA.mjs.map +0 -1
  476. package/dist/secretmanager-B9h-U_8U.mjs +0 -25
  477. package/dist/secretmanager-B9h-U_8U.mjs.map +0 -1
  478. package/dist/secretmanager-CKLB3wAQ.d.mts +0 -55
  479. package/dist/seed-BH2FbrPV.mjs +0 -1171
  480. package/dist/seed-BH2FbrPV.mjs.map +0 -1
  481. package/dist/service-BHQIerYh.mjs +0 -4
  482. package/dist/service-DMohAx8a2.mjs.map +0 -1
  483. package/dist/service-wI3Hvrgx.mjs +0 -460
  484. package/dist/service-wI3Hvrgx.mjs.map +0 -1
  485. package/dist/tailordb-BlBGmQK-.d.mts +0 -863
  486. package/dist/telemetry-BQbbVo2t.mjs.map +0 -1
  487. package/dist/telemetry-w92bvGdC.mjs +0 -4
  488. package/dist/types-2Be3wSMc.mjs +0 -5
  489. package/dist/types-CmzfQP_m.mjs +0 -372
  490. package/dist/types-CmzfQP_m.mjs.map +0 -1
  491. package/dist/workflow--aPbA8Uq.mjs +0 -39
  492. package/dist/workflow--aPbA8Uq.mjs.map +0 -1
  493. package/dist/workflow-CMamswkK.d.mts +0 -96
  494. package/dist/workflow.generated-Bf1tWylx.d.mts +0 -1416
  495. package/docs/generator/builtin.md +0 -257
  496. package/docs/generator/custom.md +0 -147
  497. package/docs/generator/index.md +0 -66
@@ -0,0 +1,54 @@
1
+ //#region src/configure/services/workflow/registry.ts
2
+ const JOB_REGISTRY_KEY = Symbol.for("tailor-platform/sdk:job-registry");
3
+ function jobs() {
4
+ const g = globalThis;
5
+ let map = g[JOB_REGISTRY_KEY];
6
+ if (!map) {
7
+ map = /* @__PURE__ */ new Map();
8
+ g[JOB_REGISTRY_KEY] = map;
9
+ }
10
+ return map;
11
+ }
12
+ /**
13
+ * Register a job body keyed by job name. Called as a side effect by
14
+ * `createWorkflowJob` so `runWorkflowLocally()` can execute dependent job
15
+ * bodies when `globalThis.tailor.workflow.execJobFunction(name, args)` is invoked.
16
+ *
17
+ * In production builds the bundler rewrites `.start()` calls so this registry
18
+ * is never read; the gated write is dropped as dead code.
19
+ * @param name - Job name
20
+ * @param body - Job body function
21
+ */
22
+ function registerJob(name, body) {
23
+ jobs().set(name, body);
24
+ }
25
+ /**
26
+ * Look up a registered job body by name.
27
+ * @param name - Job name
28
+ * @returns The registered body, or undefined when no job is registered
29
+ */
30
+ function getRegisteredJob(name) {
31
+ return jobs().get(name);
32
+ }
33
+ function currentPlatformWorkflow() {
34
+ return globalThis.tailor?.workflow;
35
+ }
36
+ function requirePlatformWorkflow() {
37
+ const workflow = currentPlatformWorkflow();
38
+ if (!workflow) throw new Error("tailor.workflow is not available. Run tests in the `tailor-runtime` Vitest environment and use mockWorkflow(), or use runWorkflowLocally() from @tailor-platform/sdk/vitest for local workflow execution.");
39
+ return workflow;
40
+ }
41
+ const START_DEFAULT = "00000000-0000-4000-8000-000000000000";
42
+ function dispatchStartJob(name, args, options) {
43
+ const workflow = requirePlatformWorkflow();
44
+ return arguments.length >= 3 ? workflow.execJobFunction(name, args, options) : workflow.execJobFunction(name, args);
45
+ }
46
+ function dispatchStartWorkflow(name, args, options) {
47
+ const workflow = requirePlatformWorkflow();
48
+ if (arguments.length < 3) return workflow.startWorkflow(name, args);
49
+ return workflow.startWorkflow(name, args, options?.invoker === void 0 ? options : { authInvoker: options.invoker });
50
+ }
51
+
52
+ //#endregion
53
+ export { registerJob as a, getRegisteredJob as i, dispatchStartJob as n, dispatchStartWorkflow as r, START_DEFAULT as t };
54
+ //# sourceMappingURL=registry-BIGVUrMB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-BIGVUrMB.mjs","names":[],"sources":["../src/configure/services/workflow/registry.ts"],"sourcesContent":["import type { TailorEnv, TailorPrincipal } from \"#/runtime/types\";\nimport type { ExecJobFunctionOptions, StartWorkflowOptions } from \"#/runtime/workflow\";\n\n/**\n * Body signature shared by workflow jobs at registry-write time.\n * The user's `createWorkflowJob`/`createWorkflow` body uses concrete types,\n * but the registry erases them for storage.\n */\nexport type RegisteredJobBody = (\n args: unknown,\n context: { env: TailorEnv; invoker: TailorPrincipal | null },\n) => unknown | Promise<unknown>;\n\nconst JOB_REGISTRY_KEY: unique symbol = Symbol.for(\"tailor-platform/sdk:job-registry\");\n\ntype PlatformWorkflow = {\n startWorkflow: (name: string, args?: unknown, options?: StartWorkflowOptions) => Promise<string>;\n execJobFunction: (name: string, args?: unknown, options?: ExecJobFunctionOptions) => unknown;\n startJobFunction: (name: string, args?: unknown, options?: ExecJobFunctionOptions) => unknown;\n};\n\ntype GlobalWithRegistry = typeof globalThis & {\n [JOB_REGISTRY_KEY]?: Map<string, RegisteredJobBody>;\n tailor?: { workflow?: PlatformWorkflow };\n};\n\nfunction jobs(): Map<string, RegisteredJobBody> {\n const g = globalThis as GlobalWithRegistry;\n let map = g[JOB_REGISTRY_KEY];\n if (!map) {\n map = new Map();\n g[JOB_REGISTRY_KEY] = map;\n }\n return map;\n}\n\n/**\n * Register a job body keyed by job name. Called as a side effect by\n * `createWorkflowJob` so `runWorkflowLocally()` can execute dependent job\n * bodies when `globalThis.tailor.workflow.execJobFunction(name, args)` is invoked.\n *\n * In production builds the bundler rewrites `.start()` calls so this registry\n * is never read; the gated write is dropped as dead code.\n * @param name - Job name\n * @param body - Job body function\n */\nexport function registerJob(name: string, body: RegisteredJobBody): void {\n jobs().set(name, body);\n}\n\n/**\n * Look up a registered job body by name.\n * @param name - Job name\n * @returns The registered body, or undefined when no job is registered\n */\nexport function getRegisteredJob(name: string): RegisteredJobBody | undefined {\n return jobs().get(name);\n}\n\nfunction currentPlatformWorkflow(): PlatformWorkflow | undefined {\n // globalThis may not have the tailor property at runtime\n // oxlint-disable-next-line typescript/no-unnecessary-condition\n return (globalThis as GlobalWithRegistry).tailor?.workflow;\n}\n\nfunction requirePlatformWorkflow(): PlatformWorkflow {\n const workflow = currentPlatformWorkflow();\n if (!workflow) {\n throw new Error(\n \"tailor.workflow is not available. Run tests in the `tailor-runtime` Vitest environment and use mockWorkflow(), or use runWorkflowLocally() from @tailor-platform/sdk/vitest for local workflow execution.\",\n );\n }\n return workflow;\n}\n\n// A valid placeholder UUID, so callers that validate the execution id behave the\n// same locally as against the platform.\nexport const START_DEFAULT = \"00000000-0000-4000-8000-000000000000\";\n\n// `.start()` routes through the installed `tailor.workflow` shim. Local body\n// execution is intentionally available only through `runWorkflowLocally()`.\n// Preserve arity: the shim sees a 2-argument call when the caller supplied no\n// options, and a 3-argument call otherwise, mirroring the bundler rewrite so\n// mocks observe the same shape in local execution and in bundled workflows.\nexport function dispatchStartJob(\n name: string,\n args?: unknown,\n options?: ExecJobFunctionOptions,\n): unknown {\n const workflow = requirePlatformWorkflow();\n // oxlint-disable-next-line prefer-rest-params\n return arguments.length >= 3\n ? workflow.execJobFunction(name, args, options)\n : workflow.execJobFunction(name, args);\n}\n\n// Accepts `unknown` because the SDK-side `.start()` accepts a wider options\n// shape than the platform surface (e.g. `authInvoker` may be a machine-user\n// name string that the bundler normalizes at build time). Local execution\n// forwards the value verbatim; only the bundled path enforces the platform\n// contract.\nexport function dispatchStartWorkflow(\n name: string,\n args?: unknown,\n options?: { invoker?: unknown },\n): Promise<string> {\n const workflow = requirePlatformWorkflow();\n // oxlint-disable-next-line prefer-rest-params\n if (arguments.length < 3) {\n return workflow.startWorkflow(name, args);\n }\n return workflow.startWorkflow(\n name,\n args,\n options?.invoker === undefined\n ? (options as StartWorkflowOptions | undefined)\n : ({ authInvoker: options.invoker } as StartWorkflowOptions),\n );\n}\n"],"mappings":";AAaA,MAAM,mBAAkC,OAAO,IAAI,kCAAkC;AAarF,SAAS,OAAuC;CAC9C,MAAM,IAAI;CACV,IAAI,MAAM,EAAE;CACZ,IAAI,CAAC,KAAK;EACR,sBAAM,IAAI,IAAI;EACd,EAAE,oBAAoB;CACxB;CACA,OAAO;AACT;;;;;;;;;;;AAYA,SAAgB,YAAY,MAAc,MAA+B;CACvE,KAAK,CAAC,CAAC,IAAI,MAAM,IAAI;AACvB;;;;;;AAOA,SAAgB,iBAAiB,MAA6C;CAC5E,OAAO,KAAK,CAAC,CAAC,IAAI,IAAI;AACxB;AAEA,SAAS,0BAAwD;CAG/D,OAAQ,WAAkC,QAAQ;AACpD;AAEA,SAAS,0BAA4C;CACnD,MAAM,WAAW,wBAAwB;CACzC,IAAI,CAAC,UACH,MAAM,IAAI,MACR,2MACF;CAEF,OAAO;AACT;AAIA,MAAa,gBAAgB;AAO7B,SAAgB,iBACd,MACA,MACA,SACS;CACT,MAAM,WAAW,wBAAwB;CAEzC,OAAO,UAAU,UAAU,IACvB,SAAS,gBAAgB,MAAM,MAAM,OAAO,IAC5C,SAAS,gBAAgB,MAAM,IAAI;AACzC;AAOA,SAAgB,sBACd,MACA,MACA,SACiB;CACjB,MAAM,WAAW,wBAAwB;CAEzC,IAAI,UAAU,SAAS,GACrB,OAAO,SAAS,cAAc,MAAM,IAAI;CAE1C,OAAO,SAAS,cACd,MACA,MACA,SAAS,YAAY,SAChB,UACA,EAAE,aAAa,QAAQ,QAAQ,CACtC;AACF"}
@@ -1,5 +1,4 @@
1
-
2
- import { t as assertDefined } from "./assert-CKfwrmCV.mjs";
1
+ import { t as assertDefined } from "./assert-DBxo8jPo.mjs";
3
2
  import { GraphQLError, Lexer, Source, TokenKind } from "graphql";
4
3
  import { getSegments } from "sql-highlight";
5
4
 
@@ -40,7 +39,7 @@ function highlightSqlLine(line) {
40
39
  }
41
40
  return result;
42
41
  }
43
- const GQL_KEYWORDS = new Set([
42
+ const GQL_KEYWORDS = /* @__PURE__ */ new Set([
44
43
  "query",
45
44
  "mutation",
46
45
  "subscription",
@@ -57,13 +56,13 @@ const GQL_KEYWORDS = new Set([
57
56
  "directive",
58
57
  "implements"
59
58
  ]);
60
- const GQL_DEF_KEYWORDS = new Set([
59
+ const GQL_DEF_KEYWORDS = /* @__PURE__ */ new Set([
61
60
  "query",
62
61
  "mutation",
63
62
  "subscription",
64
63
  "fragment"
65
64
  ]);
66
- const GQL_BUILTINS = new Set([
65
+ const GQL_BUILTINS = /* @__PURE__ */ new Set([
67
66
  "true",
68
67
  "false",
69
68
  "null"
@@ -230,7 +229,8 @@ function replTransform(state, event) {
230
229
  };
231
230
  }
232
231
  if (endsWithOpen) {
233
- const closeChar = BRACKET_PAIRS[prevLine.trimEnd().slice(-1)] ?? "}";
232
+ const openChar = prevLine.trimEnd().slice(-1);
233
+ const closeChar = BRACKET_PAIRS[openChar] ?? "}";
234
234
  const indent = baseIndent + " ";
235
235
  return {
236
236
  lines: lines.with(row, indent + currentLine).toSpliced(row + 1, 0, baseIndent + closeChar),
@@ -248,4 +248,4 @@ function replTransform(state, event) {
248
248
 
249
249
  //#endregion
250
250
  export { highlightGraphqlLine, highlightSqlLine, replTransform };
251
- //# sourceMappingURL=repl-editor-CJG3sz7A.mjs.map
251
+ //# sourceMappingURL=repl-editor-BCozyiNq.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"repl-editor-CJG3sz7A.mjs","names":[],"sources":["../src/cli/query/repl-editor.ts"],"sourcesContent":["import { GraphQLError, Lexer, Source, TokenKind } from \"graphql\";\nimport { getSegments } from \"sql-highlight\";\nimport { assertDefined } from \"@/utils/assert\";\nimport type { TransformEvent, TransformState } from \"@toiroakr/read-multiline\";\n\n// ANSI colour sequences. Kept inline (rather than going through `node:util`\n// styleText) so that tests running outside a TTY still produce deterministic\n// escape sequences regardless of detected colour support.\nconst RESET = \"\\x1b[0m\";\nconst BLUE = \"\\x1b[34m\";\nconst MAGENTA = \"\\x1b[35m\";\nconst YELLOW = \"\\x1b[33m\";\nconst BRIGHT_GREEN = \"\\x1b[92m\";\nconst CYAN = \"\\x1b[36m\";\nconst BRIGHT_BLUE = \"\\x1b[94m\";\nconst BOLD_CYAN = \"\\x1b[1;36m\";\nconst BOLD_MAGENTA = \"\\x1b[1;35m\";\nconst ITALIC_YELLOW = \"\\x1b[3;33m\";\nconst GREEN = \"\\x1b[32m\";\nconst DIM = \"\\x1b[90m\";\nconst DIM_YELLOW = \"\\x1b[2;33m\";\n\nconst SQL_STYLE_MAP: Record<string, string> = {\n keyword: BLUE,\n function: MAGENTA,\n identifier: YELLOW,\n string: BRIGHT_GREEN,\n number: CYAN,\n bracket: DIM_YELLOW,\n special: DIM,\n};\n\n/**\n * Highlight a single SQL line using the `sql-highlight` tokenizer.\n * @param line - SQL text for a single editor line\n * @returns ANSI-decorated line safe for terminal output\n */\nexport function highlightSqlLine(line: string): string {\n const segments = getSegments(line);\n let result = \"\";\n for (const seg of segments) {\n const style = SQL_STYLE_MAP[seg.name];\n result += style ? style + seg.content + RESET : seg.content;\n }\n return result;\n}\n\nconst GQL_KEYWORDS = new Set([\n \"query\",\n \"mutation\",\n \"subscription\",\n \"fragment\",\n \"on\",\n \"type\",\n \"input\",\n \"enum\",\n \"interface\",\n \"union\",\n \"scalar\",\n \"extend\",\n \"schema\",\n \"directive\",\n \"implements\",\n]);\n\n// Keywords that introduce a definition name (next NAME token is the def).\nconst GQL_DEF_KEYWORDS = new Set([\"query\", \"mutation\", \"subscription\", \"fragment\"]);\n\nconst GQL_BUILTINS = new Set([\"true\", \"false\", \"null\"]);\n\n/**\n * Highlight a single GraphQL line using the official `graphql` Lexer. Tracks\n * paren depth and the previous token to provide semantic-level colouring\n * (field names vs argument names vs types).\n * @param line - GraphQL text for a single editor line\n * @returns ANSI-decorated line, or the input unchanged when the lexer rejects it\n */\nexport function highlightGraphqlLine(line: string): string {\n if (line.trimStart().startsWith(\"#\")) {\n return `${DIM}${line}${RESET}`;\n }\n\n try {\n const source = new Source(line);\n const lexer = new Lexer(source);\n let result = \"\";\n let pos = 0;\n\n let parenDepth = 0;\n let prevKind: string = \"\";\n let prevText = \"\";\n let afterColon = false;\n\n let token = lexer.advance();\n while (token.kind !== TokenKind.EOF) {\n if (token.start > pos) {\n result += line.slice(pos, token.start);\n }\n\n const text = line.slice(token.start, token.end);\n switch (token.kind) {\n case TokenKind.NAME: {\n if (prevKind === TokenKind.DOLLAR) {\n result += `${MAGENTA}${text}${RESET}`;\n } else if (prevKind === TokenKind.AT) {\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n } else if (GQL_BUILTINS.has(text) || GQL_KEYWORDS.has(text)) {\n result += `${BLUE}${text}${RESET}`;\n } else if (GQL_DEF_KEYWORDS.has(prevText)) {\n result += `${BOLD_CYAN}${text}${RESET}`;\n } else if (afterColon) {\n result += `${CYAN}${text}${RESET}`;\n } else if (parenDepth > 0) {\n result += `${ITALIC_YELLOW}${text}${RESET}`;\n } else {\n result += `${BRIGHT_BLUE}${text}${RESET}`;\n }\n afterColon = false;\n break;\n }\n case TokenKind.INT:\n case TokenKind.FLOAT:\n result += `${BLUE}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n result += `${GREEN}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.DOLLAR:\n result += `${MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.AT:\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACE_L:\n case TokenKind.BRACE_R:\n result += `${YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_L:\n parenDepth += 1;\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_R:\n parenDepth = Math.max(0, parenDepth - 1);\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACKET_L:\n case TokenKind.BRACKET_R:\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.COLON:\n result += `${DIM}${text}${RESET}`;\n afterColon = true;\n break;\n case TokenKind.BANG:\n case TokenKind.EQUALS:\n case TokenKind.PIPE:\n case TokenKind.AMP:\n case TokenKind.SPREAD:\n result += `${DIM}${text}${RESET}`;\n afterColon = false;\n break;\n default:\n result += text;\n afterColon = false;\n }\n\n prevKind = token.kind;\n prevText = text;\n pos = token.end;\n token = lexer.advance();\n }\n\n if (pos < line.length) {\n result += line.slice(pos);\n }\n return result;\n } catch (error) {\n // The lexer throws GraphQLError on partial or invalid input (e.g. an\n // unterminated string while the user is still typing). Fall back to the\n // raw line so the editor keeps rendering without colour until the input\n // is valid. Any other error is a real bug and should surface.\n if (error instanceof GraphQLError) {\n return line;\n }\n throw error;\n }\n}\n\nconst BRACKET_PAIRS: Record<string, string> = { \"(\": \")\", \"[\": \"]\", \"{\": \"}\" };\nconst CLOSE_BRACKETS = new Set(Object.values(BRACKET_PAIRS));\n\n/**\n * Apply auto-close brackets and auto-indent on newline. Works for both SQL\n * and GraphQL because both languages share the `()`, `[]`, `{}` bracket set.\n * @param state - Editor state after the last edit\n * @param event - Event describing the edit that just occurred\n * @returns A new editor state to apply, or `undefined` to leave the state unchanged\n */\nexport function replTransform(\n state: TransformState,\n event: TransformEvent,\n): TransformState | undefined {\n const { lines, row, col } = state;\n\n if (event.type === \"insert\" && event.char in BRACKET_PAIRS) {\n const close = BRACKET_PAIRS[event.char];\n const line = assertDefined(lines[row], `line at row ${row} missing`);\n const newLine = line.slice(0, col) + close + line.slice(col);\n return { lines: lines.with(row, newLine), row, col };\n }\n\n if (event.type === \"insert\" && CLOSE_BRACKETS.has(event.char)) {\n const line = assertDefined(lines[row], `line at row ${row} missing`);\n if (line[col] === event.char) {\n const newLine = line.slice(0, col) + line.slice(col + 1);\n return { lines: lines.with(row, newLine), row, col };\n }\n }\n\n if (event.type === \"backspace\") {\n const line = assertDefined(lines[row], `line at row ${row} missing`);\n const beforeCursor = line.slice(0, col);\n if (beforeCursor.length >= 1 && /^ +$/.test(beforeCursor)) {\n const newIndent = beforeCursor.slice(0, -1);\n const newLine = newIndent + line.slice(col);\n return { lines: lines.with(row, newLine), row, col: newIndent.length };\n }\n }\n\n if (event.type === \"newline\" && row > 0) {\n const prevLine = assertDefined(lines[row - 1], `line at row ${row - 1} missing`);\n const baseIndent = prevLine.match(/^(\\s*)/)?.[1] ?? \"\";\n const endsWithOpen = /[{([]$/.test(prevLine.trimEnd());\n const currentLine = assertDefined(lines[row], `line at row ${row} missing`);\n const startsWithClose = /^[}\\])]/.test(currentLine.trimStart());\n\n if (endsWithOpen && startsWithClose) {\n // Bracket expansion: the cursor sits between a matching open/close\n // pair (e.g. `{|}`). Expand into a three-line block with the cursor\n // on an indented middle line.\n const innerIndent = baseIndent + \" \";\n const newLines = lines\n .with(row, innerIndent)\n .toSpliced(row + 1, 0, baseIndent + currentLine.trimStart());\n return { lines: newLines, row, col: innerIndent.length };\n }\n if (endsWithOpen) {\n // A lone open bracket on the previous line: drop an extra indent for\n // the new line and auto-insert the matching closing bracket below.\n const openChar = prevLine.trimEnd().slice(-1);\n const closeChar = BRACKET_PAIRS[openChar] ?? \"}\";\n const indent = baseIndent + \" \";\n const newLines = lines\n .with(row, indent + currentLine)\n .toSpliced(row + 1, 0, baseIndent + closeChar);\n return { lines: newLines, row, col: indent.length };\n }\n if (baseIndent && col === 0) {\n return { lines: lines.with(row, baseIndent + currentLine), row, col: baseIndent.length };\n }\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;AAQA,MAAM,QAAQ;AACd,MAAM,OAAO;AACb,MA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AAK,OAAO,KAAK,YAAY,GAAG;GACzD,MAAM,YAAY,aAAa,MAAM,GAAG,EAAE;GAC1C,MAAM,UAAU,YAAY,KAAK,MAAM,GAAG;GAC1C,OAAO;IAAE,OAAO,MAAM,KAAK,KAAK,OAAO;IAAG;IAAK,KAAK,UAAU;GAAO;EACvE;CACF;CAEA,IAAI,MAAM,SAAS,aAAa,MAAM,GAAG;EACvC,MAAM,WAAW,cAAc,MAAM,MAAM,IAAI,eAAe,MAAM,EAAE,SAAS;EAC/E,MAAM,aAAa,SAAS,MAAM,QAAQ,CAAC,GAAG,MAAM;EACpD,MAAM,eAAe,SAAS,KAAK,SAAS,QAAQ,CAAC;EACrD,MAAM,cAAc,cAAc,MAAM,MAAM,eAAe,IAAI,SAAS;EAC1E,MAAM,kBAAkB,UAAU,KAAK,YAAY,UAAU,CAAC;EAE9D,IAAI,gBAAgB,iBAAiB;GAInC,MAAM,cAAc,aAAa;GAIjC,OAAO;IAAE,OAHQ,MACd,KAAK,KAAK,WAAW,CAAC,CACtB,UAAU,MAAM,GAAG,GAAG,aAAa,YAAY,UAAU,CACrC;IAAG;IAAK,KAAK,YAAY;GAAO;EACzD;EACA,IAAI,cAAc;GAIhB,MAAM,YAAY,cADD,SAAS,QAAQ,CAAC,CAAC,MAAM,EACH,MAAM;GAC7C,MAAM,SAAS,aAAa;GAI5B,OAAO;IAAE,OAHQ,MACd,KAAK,KAAK,SAAS,WAAW,CAAC,CAC/B,UAAU,MAAM,GAAG,GAAG,aAAa,SACf;IAAG;IAAK,KAAK,OAAO;GAAO;EACpD;EACA,IAAI,cAAc,QAAQ,GACxB,OAAO;GAAE,OAAO,MAAM,KAAK,KAAK,aAAa,WAAW;GAAG;GAAK,KAAK,WAAW;EAAO;CAE3F;AAGF"}
1
+ {"version":3,"file":"repl-editor-BCozyiNq.mjs","names":[],"sources":["../src/cli/query/repl-editor.ts"],"sourcesContent":["import { GraphQLError, Lexer, Source, TokenKind } from \"graphql\";\nimport { getSegments } from \"sql-highlight\";\nimport { assertDefined } from \"#/utils/assert\";\nimport type { TransformEvent, TransformState } from \"@toiroakr/read-multiline\";\n\n// ANSI colour sequences. Kept inline (rather than going through `node:util`\n// styleText) so that tests running outside a TTY still produce deterministic\n// escape sequences regardless of detected colour support.\nconst RESET = \"\\x1b[0m\";\nconst BLUE = \"\\x1b[34m\";\nconst MAGENTA = \"\\x1b[35m\";\nconst YELLOW = \"\\x1b[33m\";\nconst BRIGHT_GREEN = \"\\x1b[92m\";\nconst CYAN = \"\\x1b[36m\";\nconst BRIGHT_BLUE = \"\\x1b[94m\";\nconst BOLD_CYAN = \"\\x1b[1;36m\";\nconst BOLD_MAGENTA = \"\\x1b[1;35m\";\nconst ITALIC_YELLOW = \"\\x1b[3;33m\";\nconst GREEN = \"\\x1b[32m\";\nconst DIM = \"\\x1b[90m\";\nconst DIM_YELLOW = \"\\x1b[2;33m\";\n\nconst SQL_STYLE_MAP: Record<string, string> = {\n keyword: BLUE,\n function: MAGENTA,\n identifier: YELLOW,\n string: BRIGHT_GREEN,\n number: CYAN,\n bracket: DIM_YELLOW,\n special: DIM,\n};\n\n/**\n * Highlight a single SQL line using the `sql-highlight` tokenizer.\n * @param line - SQL text for a single editor line\n * @returns ANSI-decorated line safe for terminal output\n */\nexport function highlightSqlLine(line: string): string {\n const segments = getSegments(line);\n let result = \"\";\n for (const seg of segments) {\n const style = SQL_STYLE_MAP[seg.name];\n result += style ? style + seg.content + RESET : seg.content;\n }\n return result;\n}\n\nconst GQL_KEYWORDS = new Set([\n \"query\",\n \"mutation\",\n \"subscription\",\n \"fragment\",\n \"on\",\n \"type\",\n \"input\",\n \"enum\",\n \"interface\",\n \"union\",\n \"scalar\",\n \"extend\",\n \"schema\",\n \"directive\",\n \"implements\",\n]);\n\n// Keywords that introduce a definition name (next NAME token is the def).\nconst GQL_DEF_KEYWORDS = new Set([\"query\", \"mutation\", \"subscription\", \"fragment\"]);\n\nconst GQL_BUILTINS = new Set([\"true\", \"false\", \"null\"]);\n\n/**\n * Highlight a single GraphQL line using the official `graphql` Lexer. Tracks\n * paren depth and the previous token to provide semantic-level colouring\n * (field names vs argument names vs types).\n * @param line - GraphQL text for a single editor line\n * @returns ANSI-decorated line, or the input unchanged when the lexer rejects it\n */\nexport function highlightGraphqlLine(line: string): string {\n if (line.trimStart().startsWith(\"#\")) {\n return `${DIM}${line}${RESET}`;\n }\n\n try {\n const source = new Source(line);\n const lexer = new Lexer(source);\n let result = \"\";\n let pos = 0;\n\n let parenDepth = 0;\n let prevKind: string = \"\";\n let prevText = \"\";\n let afterColon = false;\n\n let token = lexer.advance();\n while (token.kind !== TokenKind.EOF) {\n if (token.start > pos) {\n result += line.slice(pos, token.start);\n }\n\n const text = line.slice(token.start, token.end);\n switch (token.kind) {\n case TokenKind.NAME: {\n if (prevKind === TokenKind.DOLLAR) {\n result += `${MAGENTA}${text}${RESET}`;\n } else if (prevKind === TokenKind.AT) {\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n } else if (GQL_BUILTINS.has(text) || GQL_KEYWORDS.has(text)) {\n result += `${BLUE}${text}${RESET}`;\n } else if (GQL_DEF_KEYWORDS.has(prevText)) {\n result += `${BOLD_CYAN}${text}${RESET}`;\n } else if (afterColon) {\n result += `${CYAN}${text}${RESET}`;\n } else if (parenDepth > 0) {\n result += `${ITALIC_YELLOW}${text}${RESET}`;\n } else {\n result += `${BRIGHT_BLUE}${text}${RESET}`;\n }\n afterColon = false;\n break;\n }\n case TokenKind.INT:\n case TokenKind.FLOAT:\n result += `${BLUE}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n result += `${GREEN}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.DOLLAR:\n result += `${MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.AT:\n result += `${BOLD_MAGENTA}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACE_L:\n case TokenKind.BRACE_R:\n result += `${YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_L:\n parenDepth += 1;\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.PAREN_R:\n parenDepth = Math.max(0, parenDepth - 1);\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.BRACKET_L:\n case TokenKind.BRACKET_R:\n result += `${DIM_YELLOW}${text}${RESET}`;\n afterColon = false;\n break;\n case TokenKind.COLON:\n result += `${DIM}${text}${RESET}`;\n afterColon = true;\n break;\n case TokenKind.BANG:\n case TokenKind.EQUALS:\n case TokenKind.PIPE:\n case TokenKind.AMP:\n case TokenKind.SPREAD:\n result += `${DIM}${text}${RESET}`;\n afterColon = false;\n break;\n default:\n result += text;\n afterColon = false;\n }\n\n prevKind = token.kind;\n prevText = text;\n pos = token.end;\n token = lexer.advance();\n }\n\n if (pos < line.length) {\n result += line.slice(pos);\n }\n return result;\n } catch (error) {\n // The lexer throws GraphQLError on partial or invalid input (e.g. an\n // unterminated string while the user is still typing). Fall back to the\n // raw line so the editor keeps rendering without colour until the input\n // is valid. Any other error is a real bug and should surface.\n if (error instanceof GraphQLError) {\n return line;\n }\n throw error;\n }\n}\n\nconst BRACKET_PAIRS: Record<string, string> = { \"(\": \")\", \"[\": \"]\", \"{\": \"}\" };\nconst CLOSE_BRACKETS = new Set(Object.values(BRACKET_PAIRS));\n\n/**\n * Apply auto-close brackets and auto-indent on newline. Works for both SQL\n * and GraphQL because both languages share the `()`, `[]`, `{}` bracket set.\n * @param state - Editor state after the last edit\n * @param event - Event describing the edit that just occurred\n * @returns A new editor state to apply, or `undefined` to leave the state unchanged\n */\nexport function replTransform(\n state: TransformState,\n event: TransformEvent,\n): TransformState | undefined {\n const { lines, row, col } = state;\n\n if (event.type === \"insert\" && event.char in BRACKET_PAIRS) {\n const close = BRACKET_PAIRS[event.char];\n const line = assertDefined(lines[row], `line at row ${row} missing`);\n const newLine = line.slice(0, col) + close + line.slice(col);\n return { lines: lines.with(row, newLine), row, col };\n }\n\n if (event.type === \"insert\" && CLOSE_BRACKETS.has(event.char)) {\n const line = assertDefined(lines[row], `line at row ${row} missing`);\n if (line[col] === event.char) {\n const newLine = line.slice(0, col) + line.slice(col + 1);\n return { lines: lines.with(row, newLine), row, col };\n }\n }\n\n if (event.type === \"backspace\") {\n const line = assertDefined(lines[row], `line at row ${row} missing`);\n const beforeCursor = line.slice(0, col);\n if (beforeCursor.length >= 1 && /^ +$/.test(beforeCursor)) {\n const newIndent = beforeCursor.slice(0, -1);\n const newLine = newIndent + line.slice(col);\n return { lines: lines.with(row, newLine), row, col: newIndent.length };\n }\n }\n\n if (event.type === \"newline\" && row > 0) {\n const prevLine = assertDefined(lines[row - 1], `line at row ${row - 1} missing`);\n const baseIndent = prevLine.match(/^(\\s*)/)?.[1] ?? \"\";\n const endsWithOpen = /[{([]$/.test(prevLine.trimEnd());\n const currentLine = assertDefined(lines[row], `line at row ${row} missing`);\n const startsWithClose = /^[}\\])]/.test(currentLine.trimStart());\n\n if (endsWithOpen && startsWithClose) {\n // Bracket expansion: the cursor sits between a matching open/close\n // pair (e.g. `{|}`). Expand into a three-line block with the cursor\n // on an indented middle line.\n const innerIndent = baseIndent + \" \";\n const newLines = lines\n .with(row, innerIndent)\n .toSpliced(row + 1, 0, baseIndent + currentLine.trimStart());\n return { lines: newLines, row, col: innerIndent.length };\n }\n if (endsWithOpen) {\n // A lone open bracket on the previous line: drop an extra indent for\n // the new line and auto-insert the matching closing bracket below.\n const openChar = prevLine.trimEnd().slice(-1);\n const closeChar = BRACKET_PAIRS[openChar] ?? \"}\";\n const indent = baseIndent + \" \";\n const newLines = lines\n .with(row, indent + currentLine)\n .toSpliced(row + 1, 0, baseIndent + closeChar);\n return { lines: newLines, row, col: indent.length };\n }\n if (baseIndent && col === 0) {\n return { lines: lines.with(row, baseIndent + currentLine), row, col: baseIndent.length };\n }\n }\n\n return undefined;\n}\n"],"mappings":";;;;;AAQA,MAAM,QA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
+ /** Result of {@link TailorAigatewayAPI.get}. */
4
+ interface GetAIGatewayResult {
5
+ /** The platform-assigned URL of the AI Gateway. */
6
+ url: string;
7
+ }
8
+ /**
9
+ * Platform API surface for `tailor.aigateway`. Describes the shape the
10
+ * platform runtime injects on `globalThis.tailor.aigateway`.
11
+ */
12
+ interface TailorAigatewayAPI {
13
+ /**
14
+ * Resolves an AI Gateway defined in the caller's own workspace.
15
+ * @param name - AI Gateway name, as passed to `defineAIGateway()`
16
+ * @returns The resolved AI Gateway's platform-assigned URL
17
+ */
18
+ get(name: AIGatewayName): Promise<GetAIGatewayResult>;
19
+ }
20
+ /** Runtime wrapper namespace for `tailor.aigateway`. */
21
+ declare const aigateway: {
22
+ readonly get: (name: AIGatewayName) => Promise<GetAIGatewayResult>;
23
+ };
24
+ //#endregion
25
+ export { GetAIGatewayResult, TailorAigatewayAPI, aigateway };
@@ -0,0 +1,3 @@
1
+ import { t as aigateway } from "../aigateway-DR4Kwuik.mjs";
2
+
3
+ export { aigateway };
@@ -1,2 +1,21 @@
1
- import { r as getConnectionToken, t as TailorAuthconnectionAPI } from "../authconnection-BIYzEh2p.mjs";
2
- export { TailorAuthconnectionAPI, getConnectionToken };
1
+ import { AuthConnectionTokenResult as AuthConnectionTokenResult$1 } from "../configure/services/auth/types.mjs";
2
+ import { ConnectionName } from "@tailor-platform/sdk";
3
+ //#region src/runtime/authconnection.d.ts
4
+ /**
5
+ * Platform API surface for `tailor.authconnection`. Describes the shape the
6
+ * platform runtime injects on `globalThis.tailor.authconnection`.
7
+ */
8
+ interface TailorAuthconnectionAPI {
9
+ /**
10
+ * Returns the access token for the given auth connection.
11
+ * @param connectionName - Auth connection name as defined in tailor.config
12
+ * @returns Token payload
13
+ */
14
+ getConnectionToken(connectionName: ConnectionName): Promise<AuthConnectionTokenResult$1>;
15
+ }
16
+ /** Runtime wrapper namespace for `tailor.authconnection`. */
17
+ declare const authconnection: {
18
+ readonly getConnectionToken: (connectionName: ConnectionName) => Promise<AuthConnectionTokenResult$1>;
19
+ };
20
+ //#endregion
21
+ export { TailorAuthconnectionAPI, authconnection };
@@ -1,4 +1,3 @@
1
+ import { t as authconnection } from "../authconnection-CZvi9ANm.mjs";
1
2
 
2
- import { n as getConnectionToken } from "../authconnection-D8SJGMpj.mjs";
3
-
4
- export { getConnectionToken };
3
+ export { authconnection };
@@ -1,2 +1,54 @@
1
- import { a as getInvoker, n as Invoker, r as TailorContextAPI, t as ContextInvoker } from "../context-CUBwSBq4.mjs";
2
- export { ContextInvoker, Invoker, TailorContextAPI, getInvoker };
1
+ import { TailorPrincipal } from "./types.mjs";
2
+ //#region src/runtime/context.d.ts
3
+ /**
4
+ * Information about the invoker of the current function execution.
5
+ *
6
+ * Matches the public `TailorPrincipal` shape — `attributes` is the attribute
7
+ * map and `attributeList` is the array of attribute IDs.
8
+ */
9
+ type Invoker = TailorPrincipal;
10
+ /**
11
+ * Raw platform-side invoker payload returned by `tailor.context.getInvoker()`.
12
+ * The wrapper normalizes this into {@link Invoker}.
13
+ * @internal
14
+ */
15
+ interface ContextInvoker {
16
+ /** The invoker's ID */
17
+ id: string;
18
+ /** The invoker's type */
19
+ type: "user" | "machine_user";
20
+ /** The workspace ID */
21
+ workspaceId: string;
22
+ /** The invoker's attribute IDs */
23
+ attributes: string[];
24
+ /** The invoker's attribute map */
25
+ attributeMap: Record<string, unknown>;
26
+ }
27
+ /**
28
+ * Platform API surface for `tailor.context`. Describes the shape the platform
29
+ * runtime injects on `globalThis.tailor.context`.
30
+ * @internal
31
+ */
32
+ interface PlatformContextAPI {
33
+ getInvoker(): ContextInvoker | null;
34
+ }
35
+ /** Runtime wrapper API for execution context utilities. */
36
+ interface TailorContextAPI {
37
+ /**
38
+ * Returns information about the current invoker.
39
+ * @returns Invoker details, or `null` for anonymous invocations
40
+ */
41
+ getInvoker(): Invoker | null;
42
+ }
43
+ /**
44
+ * Returns information about the invoker of the current function execution,
45
+ * or `null` for anonymous invocations.
46
+ * @returns Invoker details, or `null` when the call is anonymous
47
+ */
48
+ declare function getInvoker(): Invoker | null;
49
+ /** Runtime wrapper namespace for `tailor.context`. */
50
+ declare const context: {
51
+ readonly getInvoker: typeof getInvoker;
52
+ };
53
+ //#endregion
54
+ export { ContextInvoker, Invoker, PlatformContextAPI, TailorContextAPI, context };
@@ -1,4 +1,3 @@
1
+ import { t as context } from "../context-DYQVYWqZ.mjs";
1
2
 
2
- import { n as getInvoker } from "../context-s0lxhu8_.mjs";
3
-
4
- export { getInvoker };
3
+ export { context };
@@ -0,0 +1,10 @@
1
+ import { TailorPrincipal } from "./types.mjs";
2
+ import { StandardSchemaV1 } from "@standard-schema/spec";
3
+ //#region src/runtime/field-parse.d.ts
4
+ type FieldParseArgs = {
5
+ value: unknown;
6
+ data: unknown;
7
+ invoker: TailorPrincipal | null;
8
+ };
9
+ //#endregion
10
+ export { FieldParseArgs };
@@ -1,2 +1,170 @@
1
- import { C as upload, S as openDownloadStream, _ as download, a as FileMetadata, c as FileUploadResponse, d as StreamValue, f as TailorDBFileAPI, g as deleteFile, h as UploadMetadata, i as FileDownloadStreamResponse, l as FileUploadStreamOptions, m as TailorDBFileErrorCode, n as FileDownloadAsBase64Response, o as FileStreamIterator, p as TailorDBFileError, r as FileDownloadResponse, s as FileUploadOptions, t as DownloadMetadata, u as StreamMetadata, v as downloadAsBase64, w as uploadStream, x as getMetadata, y as downloadStream } from "../file-BzK8z3X-.mjs";
2
- export { DownloadMetadata, FileDownloadAsBase64Response, FileDownloadResponse, FileDownloadStreamResponse, FileMetadata, FileStreamIterator, FileUploadOptions, FileUploadResponse, FileUploadStreamOptions, StreamMetadata, StreamValue, TailorDBFileAPI, TailorDBFileError, TailorDBFileErrorCode, UploadMetadata, deleteFile as delete, deleteFile, download, downloadAsBase64, downloadStream, getMetadata, openDownloadStream, upload, uploadStream };
1
+ //#region src/runtime/file.d.ts
2
+ /**
3
+ * TailorDB file (BLOB) utilities.
4
+ *
5
+ * Thin typed wrapper around the platform-provided `tailordb.file` runtime API.
6
+ * At runtime this delegates to `globalThis.tailordb.file`. Use `mockFile` from
7
+ * `@tailor-platform/sdk/vitest` to mock these calls in unit tests.
8
+ * @example
9
+ * import { file } from "@tailor-platform/sdk/runtime";
10
+ *
11
+ * const { metadata } = await file.upload(
12
+ * "my-namespace",
13
+ * "Document",
14
+ * "attachment",
15
+ * recordId,
16
+ * bytes,
17
+ * );
18
+ */
19
+ /** Upload response metadata. */
20
+ interface UploadMetadata {
21
+ fileSize: number;
22
+ sha256sum: string;
23
+ }
24
+ /** Download response metadata. */
25
+ interface DownloadMetadata {
26
+ contentType: string;
27
+ fileSize: number;
28
+ sha256sum: string;
29
+ lastUploadedAt: string;
30
+ }
31
+ /** File metadata (for {@link TailorDBFileAPI.getMetadata}). */
32
+ interface FileMetadata {
33
+ contentType: string;
34
+ fileSize: number;
35
+ sha256sum: string;
36
+ urlPath: string;
37
+ lastUploadedAt?: string;
38
+ }
39
+ /** Upload options. */
40
+ interface FileUploadOptions {
41
+ contentType?: string;
42
+ }
43
+ /** Upload stream options. */
44
+ interface FileUploadStreamOptions {
45
+ contentType?: string;
46
+ fileSize?: number;
47
+ }
48
+ /** Upload response. */
49
+ interface FileUploadResponse {
50
+ metadata: UploadMetadata;
51
+ }
52
+ /** Download response. */
53
+ interface FileDownloadResponse {
54
+ data: Uint8Array;
55
+ metadata: DownloadMetadata;
56
+ }
57
+ /** Download-as-Base64 response. */
58
+ interface FileDownloadAsBase64Response {
59
+ data: string;
60
+ metadata: DownloadMetadata;
61
+ }
62
+ /** Download stream response. */
63
+ interface FileDownloadStreamResponse {
64
+ body: ReadableStream<Uint8Array>;
65
+ metadata: DownloadMetadata;
66
+ }
67
+ /** Error code emitted by {@link TailorDBFileError}. */
68
+ type TailorDBFileErrorCode = "INVALID_PARAMS" | "INVALID_DATA_TYPE" | "OPERATION_FAILED" | "DELETE_FAILED" | "STREAM_OPEN_FAILED" | "STREAM_READ_ERROR" | "STREAM_ERROR" | "FILE_TOO_LARGE";
69
+ /**
70
+ * Type-only shape of the `TailorDBFileError` runtime class. The class itself
71
+ * is provided by the platform runtime (and by `injectMocks` in tests); this
72
+ * interface mirrors it so callers can `import type { TailorDBFileError }` from
73
+ * the wrapper module without depending on any ambient declaration.
74
+ */
75
+ interface TailorDBFileError extends Error {
76
+ name: "TailorDBFileError";
77
+ code?: TailorDBFileErrorCode;
78
+ cause?: unknown;
79
+ }
80
+ /**
81
+ * Platform API surface for `tailordb.file`. Describes the shape the platform
82
+ * runtime injects on `globalThis.tailordb.file`.
83
+ */
84
+ interface TailorDBFileAPI {
85
+ /**
86
+ * Upload a file to TailorDB.
87
+ * @param namespace - TailorDB namespace
88
+ * @param typeName - TailorDB type name
89
+ * @param fieldName - File field name on the type
90
+ * @param recordId - Record ID owning the field
91
+ * @param data - File contents
92
+ * @param options - Upload options (e.g. `contentType`)
93
+ * @returns Upload response containing the file metadata
94
+ */
95
+ upload(namespace: string, typeName: string, fieldName: string, recordId: string, data: string | ArrayBuffer | Uint8Array | number[], options?: FileUploadOptions): Promise<FileUploadResponse>;
96
+ /**
97
+ * Download a file from TailorDB.
98
+ *
99
+ * Throws `TailorDBFileError` with code `FILE_TOO_LARGE` when the file
100
+ * exceeds 10MB — use {@link downloadStream} for large files.
101
+ * @param namespace - TailorDB namespace
102
+ * @param typeName - TailorDB type name
103
+ * @param fieldName - File field name on the type
104
+ * @param recordId - Record ID owning the field
105
+ * @returns Bytes and metadata for the file
106
+ */
107
+ download(namespace: string, typeName: string, fieldName: string, recordId: string): Promise<FileDownloadResponse>;
108
+ /**
109
+ * Download a file from TailorDB as a Base64-encoded string.
110
+ *
111
+ * Throws `TailorDBFileError` with code `FILE_TOO_LARGE` when the file
112
+ * exceeds 10MB — use {@link downloadStream} for large files.
113
+ * @param namespace - TailorDB namespace
114
+ * @param typeName - TailorDB type name
115
+ * @param fieldName - File field name on the type
116
+ * @param recordId - Record ID owning the field
117
+ * @returns Base64-encoded contents and metadata for the file
118
+ */
119
+ downloadAsBase64(namespace: string, typeName: string, fieldName: string, recordId: string): Promise<FileDownloadAsBase64Response>;
120
+ /**
121
+ * Delete a file from TailorDB.
122
+ * @param namespace - TailorDB namespace
123
+ * @param typeName - TailorDB type name
124
+ * @param fieldName - File field name on the type
125
+ * @param recordId - Record ID owning the field
126
+ * @returns Resolves once the file has been deleted
127
+ */
128
+ delete(namespace: string, typeName: string, fieldName: string, recordId: string): Promise<void>;
129
+ /**
130
+ * Get file metadata from TailorDB.
131
+ * @param namespace - TailorDB namespace
132
+ * @param typeName - TailorDB type name
133
+ * @param fieldName - File field name on the type
134
+ * @param recordId - Record ID owning the field
135
+ * @returns Metadata for the stored file
136
+ */
137
+ getMetadata(namespace: string, typeName: string, fieldName: string, recordId: string): Promise<FileMetadata>;
138
+ /**
139
+ * Download a file as a ReadableStream.
140
+ * @param namespace - TailorDB namespace
141
+ * @param typeName - TailorDB type name
142
+ * @param fieldName - File field name on the type
143
+ * @param recordId - Record ID owning the field
144
+ * @returns ReadableStream body and metadata for the file
145
+ */
146
+ downloadStream(namespace: string, typeName: string, fieldName: string, recordId: string): Promise<FileDownloadStreamResponse>;
147
+ /**
148
+ * Upload a file using a ReadableStream.
149
+ * @param namespace - TailorDB namespace
150
+ * @param typeName - TailorDB type name
151
+ * @param fieldName - File field name on the type
152
+ * @param recordId - Record ID owning the field
153
+ * @param readableStream - ReadableStream providing the file data
154
+ * @param options - Upload stream options (e.g. `contentType`, `fileSize`)
155
+ * @returns Upload response containing the file metadata
156
+ */
157
+ uploadStream(namespace: string, typeName: string, fieldName: string, recordId: string, readableStream: ReadableStream<Uint8Array | ArrayBuffer>, options?: FileUploadStreamOptions): Promise<FileUploadResponse>;
158
+ }
159
+ /** Runtime wrapper namespace for `tailordb.file`. */
160
+ declare const file: {
161
+ readonly upload: (namespace: string, typeName: string, fieldName: string, recordId: string, data: string | ArrayBuffer | Uint8Array | number[], options?: FileUploadOptions) => Promise<FileUploadResponse>;
162
+ readonly download: (namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileDownloadResponse>;
163
+ readonly downloadAsBase64: (namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileDownloadAsBase64Response>;
164
+ readonly delete: (namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<void>;
165
+ readonly getMetadata: (namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileMetadata>;
166
+ readonly downloadStream: (namespace: string, typeName: string, fieldName: string, recordId: string) => Promise<FileDownloadStreamResponse>;
167
+ readonly uploadStream: (namespace: string, typeName: string, fieldName: string, recordId: string, readableStream: ReadableStream<Uint8Array | ArrayBuffer>, options?: FileUploadStreamOptions) => Promise<FileUploadResponse>;
168
+ };
169
+ //#endregion
170
+ export { DownloadMetadata, FileDownloadAsBase64Response, FileDownloadResponse, FileDownloadStreamResponse, FileMetadata, FileUploadOptions, FileUploadResponse, FileUploadStreamOptions, TailorDBFileAPI, TailorDBFileError, TailorDBFileErrorCode, UploadMetadata, file };
@@ -1,4 +1,3 @@
1
+ import { t as file } from "../file-BUcmVIH2.mjs";
1
2
 
2
- import { c as upload, i as downloadStream, l as uploadStream, n as download, o as getMetadata, r as downloadAsBase64, s as openDownloadStream, t as deleteFile } from "../file-B58Dm-2P.mjs";
3
-
4
- export { deleteFile as delete, deleteFile, download, downloadAsBase64, downloadStream, getMetadata, openDownloadStream, upload, uploadStream };
3
+ export { file };
@@ -1,11 +1,25 @@
1
- import { t as ContextInvoker } from "../context-CUBwSBq4.mjs";
2
- import { m as TailorDBFileErrorCode } from "../file-BzK8z3X-.mjs";
3
- import { r as IconvInstance } from "../iconv-kwrmd1U_.mjs";
4
- import { a as IdpClientInstance, c as SendPasswordResetEmailInput, d as User, f as UserQuery, n as ClientConfig, o as ListUsersOptions, r as CreateUserInput, s as ListUsersResponse, u as UpdateUserInput } from "../idp-BlBPtXJ-.mjs";
5
- import { r as TriggerWorkflowOptions, t as AuthInvoker } from "../workflow-CMamswkK.mjs";
6
- import { a as TailordbQueryResult, i as TailordbCommandType, o as TailordbRuntime, r as TailordbClientInstance, t as TailorRuntime } from "../index-DRhMpdnA.mjs";
7
-
1
+ import { Invoker, StartWorkflowOptions } from "./workflow.mjs";
2
+ import { ContextInvoker } from "./context.mjs";
3
+ import { TailorDBFileErrorCode } from "./file.mjs";
4
+ import { IconvInstance } from "./iconv.mjs";
5
+ import { ClientConfig, CreateUserInput, IdpClientInstance, ListUsersOptions, ListUsersResponse, SendPasswordResetEmailInput, UnenrollMfaInput, UpdateUserInput, User, UserQuery } from "./idp.mjs";
6
+ import { LogAttributeValue, LogAttributes } from "./logger.mjs";
7
+ import { TailorRuntime, TailordbClientInstance, TailordbCommandType, TailordbQueryResult, TailordbRuntime } from "./index.mjs";
8
8
  //#region src/runtime/globals.d.ts
9
+ type TailorIdpClientConfig = ClientConfig;
10
+ type TailorIdpCreateUserInput = CreateUserInput;
11
+ type TailorIdpClientInstance = IdpClientInstance;
12
+ type TailorIdpListUsersOptions = ListUsersOptions;
13
+ type TailorIdpListUsersResponse = ListUsersResponse;
14
+ type TailorIdpSendPasswordResetEmailInput = SendPasswordResetEmailInput;
15
+ type TailorIdpUnenrollMfaInput = UnenrollMfaInput;
16
+ type TailorIdpUpdateUserInput = UpdateUserInput;
17
+ type TailorIdpUser = User;
18
+ type TailorIdpUserQuery = UserQuery;
19
+ type TailorWorkflowInvoker = Invoker;
20
+ type TailorWorkflowStartWorkflowOptions = StartWorkflowOptions;
21
+ type TailorLoggerLogAttributeValue = LogAttributeValue;
22
+ type TailorLoggerLogAttributes = LogAttributes;
9
23
  declare global {
10
24
  namespace tailordb {
11
25
  type QueryResult<T> = TailordbQueryResult<T>;
@@ -13,61 +27,33 @@ declare global {
13
27
  type Client = TailordbClientInstance;
14
28
  }
15
29
  var tailordb: TailordbRuntime;
16
- /**
17
- * @deprecated Use the lowercase `tailordb.*` namespace instead (e.g.
18
- * `tailordb.QueryResult`, `tailordb.CommandType`,
19
- * `typeof tailordb.Client`). This capital-cased namespace is retained
20
- * only for backwards compatibility with `@tailor-platform/function-types`
21
- * and will be removed in v2. Run
22
- * `pnpm dlx @tailor-platform/sdk-codemod v2/tailordb-namespace`
23
- * to migrate.
24
- */
25
- namespace Tailordb {
26
- /**
27
- * @deprecated Use `tailordb.Client` (lowercase) instead.
28
- * Will be removed in v2.
29
- */
30
- class Client {
31
- constructor(config: {
32
- namespace: string;
33
- });
34
- connect(): Promise<void>;
35
- end(): Promise<void>;
36
- queryObject<O>(sql: string, args?: readonly unknown[]): Promise<TailordbQueryResult<O>>;
37
- }
38
- /**
39
- * @deprecated Use `tailordb.QueryResult<T>` (lowercase) instead.
40
- * Will be removed in v2.
41
- */
42
- type QueryResult<T> = TailordbQueryResult<T>;
43
- /**
44
- * @deprecated Use `tailordb.CommandType` (lowercase) instead.
45
- * Will be removed in v2.
46
- */
47
- type CommandType = TailordbCommandType;
48
- }
49
30
  namespace tailor {
50
31
  namespace iconv {
51
32
  type Iconv = IconvInstance;
52
33
  }
53
34
  namespace idp {
54
- type Client = IdpClientInstance;
55
- type ClientConfig = ClientConfig;
56
- type User = User;
57
- type UserQuery = UserQuery;
58
- type ListUsersOptions = ListUsersOptions;
59
- type ListUsersResponse = ListUsersResponse;
60
- type CreateUserInput = CreateUserInput;
61
- type UpdateUserInput = UpdateUserInput;
62
- type SendPasswordResetEmailInput = SendPasswordResetEmailInput;
35
+ type Client = TailorIdpClientInstance;
36
+ type ClientConfig = TailorIdpClientConfig;
37
+ type User = TailorIdpUser;
38
+ type UserQuery = TailorIdpUserQuery;
39
+ type ListUsersOptions = TailorIdpListUsersOptions;
40
+ type ListUsersResponse = TailorIdpListUsersResponse;
41
+ type CreateUserInput = TailorIdpCreateUserInput;
42
+ type UpdateUserInput = TailorIdpUpdateUserInput;
43
+ type SendPasswordResetEmailInput = TailorIdpSendPasswordResetEmailInput;
44
+ type UnenrollMfaInput = TailorIdpUnenrollMfaInput;
63
45
  }
64
46
  namespace workflow {
65
- type AuthInvoker = AuthInvoker;
66
- type TriggerWorkflowOptions = TriggerWorkflowOptions;
47
+ type Invoker = TailorWorkflowInvoker;
48
+ type StartWorkflowOptions = TailorWorkflowStartWorkflowOptions;
67
49
  }
68
50
  namespace context {
69
51
  type Invoker = ContextInvoker;
70
52
  }
53
+ namespace logger {
54
+ type LogAttributeValue = TailorLoggerLogAttributeValue;
55
+ type LogAttributes = TailorLoggerLogAttributes;
56
+ }
71
57
  }
72
58
  var tailor: TailorRuntime;
73
59
  /** Custom error class for TailorDB File operations. */
@@ -99,5 +85,4 @@ declare global {
99
85
  constructor(message: string);
100
86
  name: "TailorErrorMessage";
101
87
  }
102
- }
103
- //# sourceMappingURL=globals.d.mts.map
88
+ }
@@ -1,2 +1 @@
1
-
2
1
  export { };