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

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 (321) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/dist/{application-BX13RArL.mjs → application-BJXRpQj5.mjs} +602 -1842
  3. package/dist/application-BJXRpQj5.mjs.map +1 -0
  4. package/dist/application-BV-AXawv.mjs +3 -0
  5. package/dist/cli/cache/bundle-cache.d.mts +2 -1
  6. package/dist/cli/cache/store.d.mts +1 -1
  7. package/dist/cli/commands/api/index.d.mts +1 -0
  8. package/dist/cli/commands/deploy/aigateway.d.mts +5 -1
  9. package/dist/cli/commands/deploy/application.d.mts +7 -1
  10. package/dist/cli/commands/deploy/apply-phases.d.mts +14 -1
  11. package/dist/cli/commands/deploy/auth.d.mts +5 -1
  12. package/dist/cli/commands/deploy/deploy.d.mts +13 -3
  13. package/dist/cli/commands/deploy/executor.d.mts +7 -1
  14. package/dist/cli/commands/deploy/function-registry.d.mts +5 -0
  15. package/dist/cli/commands/deploy/idp.d.mts +5 -1
  16. package/dist/cli/commands/deploy/resolver.d.mts +5 -1
  17. package/dist/cli/commands/deploy/secret-manager.d.mts +5 -1
  18. package/dist/cli/commands/deploy/staticwebsite.d.mts +5 -1
  19. package/dist/cli/commands/deploy/tailordb/index.d.mts +8 -1
  20. package/dist/cli/commands/deploy/types.d.mts +3 -1
  21. package/dist/cli/commands/deploy/workflow-execution-policy.d.mts +3 -1
  22. package/dist/cli/commands/deploy/workflow.d.mts +4 -1
  23. package/dist/cli/commands/executor/get.d.mts +0 -1
  24. package/dist/cli/commands/executor/jobs.d.mts +0 -1
  25. package/dist/cli/commands/executor/list.d.mts +0 -1
  26. package/dist/cli/commands/executor/transform.d.mts +1 -0
  27. package/dist/cli/commands/executor/trigger.d.mts +0 -1
  28. package/dist/cli/commands/executor/webhook.d.mts +0 -1
  29. package/dist/cli/commands/function/get.d.mts +0 -1
  30. package/dist/cli/commands/function/list.d.mts +0 -1
  31. package/dist/cli/commands/function/transform.d.mts +1 -0
  32. package/dist/cli/commands/generate/options.d.mts +0 -1
  33. package/dist/cli/commands/generate/service.d.mts +6 -2
  34. package/dist/cli/commands/machineuser/list.d.mts +0 -1
  35. package/dist/cli/commands/machineuser/token.d.mts +0 -1
  36. package/dist/cli/commands/oauth2client/get.d.mts +0 -1
  37. package/dist/cli/commands/oauth2client/list.d.mts +0 -1
  38. package/dist/cli/commands/oauth2client/transform.d.mts +1 -0
  39. package/dist/cli/commands/organization/folder/create.d.mts +0 -1
  40. package/dist/cli/commands/organization/folder/delete.d.mts +0 -1
  41. package/dist/cli/commands/organization/folder/get.d.mts +0 -1
  42. package/dist/cli/commands/organization/folder/list.d.mts +0 -1
  43. package/dist/cli/commands/organization/folder/update.d.mts +0 -1
  44. package/dist/cli/commands/organization/get.d.mts +0 -1
  45. package/dist/cli/commands/organization/list.d.mts +0 -1
  46. package/dist/cli/commands/organization/transform.d.mts +2 -0
  47. package/dist/cli/commands/organization/tree.d.mts +0 -1
  48. package/dist/cli/commands/organization/update.d.mts +0 -1
  49. package/dist/cli/commands/remove.d.mts +0 -1
  50. package/dist/cli/commands/show.d.mts +9 -4
  51. package/dist/cli/commands/staticwebsite/deploy.d.mts +19 -0
  52. package/dist/cli/commands/tailordb/migrate/config.d.mts +0 -1
  53. package/dist/cli/commands/tailordb/migrate/diff-calculator.d.mts +16 -3
  54. package/dist/cli/commands/tailordb/migrate/generate.d.mts +0 -1
  55. package/dist/cli/commands/tailordb/migrate/snapshot-types.d.mts +6 -0
  56. package/dist/cli/commands/tailordb/migrate/snapshot.d.mts +1 -1
  57. package/dist/cli/commands/tailordb/truncate.d.mts +0 -1
  58. package/dist/cli/commands/workflow/executions.d.mts +0 -1
  59. package/dist/cli/commands/workflow/get.d.mts +2 -1
  60. package/dist/cli/commands/workflow/list.d.mts +0 -1
  61. package/dist/cli/commands/workflow/resume.d.mts +0 -1
  62. package/dist/cli/commands/workflow/start.d.mts +0 -1
  63. package/dist/cli/commands/workflow/status.d.mts +1 -0
  64. package/dist/cli/commands/workflow/transform.d.mts +1 -0
  65. package/dist/cli/commands/workflow/wait.d.mts +0 -1
  66. package/dist/cli/commands/workflow/waiter.d.mts +1 -1
  67. package/dist/cli/commands/workspace/app/health.d.mts +0 -1
  68. package/dist/cli/commands/workspace/app/list.d.mts +0 -1
  69. package/dist/cli/commands/workspace/app/transform.d.mts +2 -0
  70. package/dist/cli/commands/workspace/create.d.mts +3 -1
  71. package/dist/cli/commands/workspace/delete.d.mts +0 -1
  72. package/dist/cli/commands/workspace/get.d.mts +0 -1
  73. package/dist/cli/commands/workspace/list.d.mts +1 -1
  74. package/dist/cli/commands/workspace/restore.d.mts +0 -1
  75. package/dist/cli/commands/workspace/transform.d.mts +4 -0
  76. package/dist/cli/commands/workspace/user/invite.d.mts +0 -1
  77. package/dist/cli/commands/workspace/user/list.d.mts +0 -1
  78. package/dist/cli/commands/workspace/user/remove.d.mts +0 -1
  79. package/dist/cli/commands/workspace/user/transform.d.mts +1 -0
  80. package/dist/cli/commands/workspace/user/update.d.mts +0 -1
  81. package/dist/cli/index.d.mts +6 -3
  82. package/dist/cli/index.mjs +871 -1577
  83. package/dist/cli/index.mjs.map +1 -1
  84. package/dist/cli/lib.d.mts +10 -4
  85. package/dist/cli/lib.mjs +50 -4
  86. package/dist/cli/lib.mjs.map +1 -1
  87. package/dist/cli/query/index.d.mts +0 -1
  88. package/dist/cli/services/application.d.mts +12 -1
  89. package/dist/cli/services/auth/service.d.mts +2 -0
  90. package/dist/cli/services/executor/service.d.mts +1 -1
  91. package/dist/cli/services/http-adapter/bundler.d.mts +3 -1
  92. package/dist/cli/services/http-adapter/service.d.mts +2 -1
  93. package/dist/cli/services/resolver/service.d.mts +1 -1
  94. package/dist/cli/services/tailordb/service.d.mts +3 -1
  95. package/dist/cli/services/workflow/bundler.d.mts +2 -1
  96. package/dist/cli/services/workflow/service.d.mts +1 -1
  97. package/dist/cli/shared/args.d.mts +1 -1
  98. package/dist/cli/shared/client.d.mts +1 -1
  99. package/dist/cli/shared/config-loader.d.mts +1 -2
  100. package/dist/cli/shared/context.d.mts +2 -1
  101. package/dist/cli/shared/readonly-guard.d.mts +25 -0
  102. package/dist/cli/shared/script-executor.d.mts +0 -1
  103. package/dist/cli/shared/seed-chunker.d.mts +7 -3
  104. package/dist/cli/shared/tailordb-namespaces.d.mts +37 -0
  105. package/dist/cli/shared/type-generator.d.mts +0 -1
  106. package/dist/cli/shared/workspace-name.d.mts +1 -0
  107. package/dist/completion/zsh-worker.zsh +15 -303
  108. package/dist/configure/config/index.d.mts +0 -1
  109. package/dist/configure/config/types.d.mts +2 -2
  110. package/dist/configure/index.d.mts +14 -4
  111. package/dist/configure/index.mjs +201 -6
  112. package/dist/configure/index.mjs.map +1 -1
  113. package/dist/configure/services/aigateway/index.d.mts +0 -1
  114. package/dist/configure/services/aigateway/types.d.mts +0 -1
  115. package/dist/configure/services/auth/index.d.mts +0 -1
  116. package/dist/configure/services/auth/types.d.mts +15 -14
  117. package/dist/configure/services/executor/executor.d.mts +2 -13
  118. package/dist/configure/services/executor/index.d.mts +1 -0
  119. package/dist/configure/services/executor/operation.d.mts +9 -4
  120. package/dist/configure/services/executor/trigger/event.d.mts +0 -1
  121. package/dist/configure/services/executor/trigger/index.d.mts +0 -1
  122. package/dist/configure/services/executor/trigger/schedule.d.mts +0 -1
  123. package/dist/configure/services/executor/trigger/webhook.d.mts +0 -1
  124. package/dist/configure/services/http-adapter/http-adapter.d.mts +1 -2
  125. package/dist/configure/services/idp/index.d.mts +1 -5
  126. package/dist/configure/services/idp/permission.d.mts +4 -5
  127. package/dist/configure/services/idp/types.d.mts +0 -1
  128. package/dist/configure/services/index.d.mts +5 -0
  129. package/dist/configure/services/resolver/resolver.d.mts +1 -0
  130. package/dist/configure/services/resolver/types.d.mts +0 -1
  131. package/dist/configure/services/secrets/index.d.mts +0 -1
  132. package/dist/configure/services/secrets/types.d.mts +0 -1
  133. package/dist/configure/services/staticwebsite/index.d.mts +0 -1
  134. package/dist/configure/services/staticwebsite/types.d.mts +0 -1
  135. package/dist/configure/services/tailordb/permission.d.mts +4 -5
  136. package/dist/configure/services/tailordb/schema.d.mts +86 -56
  137. package/dist/configure/services/tailordb/types.d.mts +66 -17
  138. package/dist/configure/services/workflow/execution-policy.d.mts +2 -3
  139. package/dist/configure/services/workflow/execution-policy.types.d.mts +0 -1
  140. package/dist/configure/services/workflow/index.d.mts +1 -0
  141. package/dist/configure/services/workflow/job.d.mts +0 -1
  142. package/dist/configure/services/workflow/wait-point.d.mts +0 -1
  143. package/dist/configure/services/workflow/workflow.d.mts +1 -1
  144. package/dist/configure/types/field.d.mts +1 -2
  145. package/dist/configure/types/field.types.d.mts +6 -45
  146. package/dist/configure/types/index.d.mts +1 -0
  147. package/dist/configure/types/type.d.mts +2 -11
  148. package/dist/{crashreport-D3RjuSYb.mjs → crashreport-0ioNRZ4K.mjs} +1 -1
  149. package/dist/{crashreport-Cg-pqRJV.mjs → crashreport-CxHne11E.mjs} +4 -3
  150. package/dist/{crashreport-Cg-pqRJV.mjs.map → crashreport-CxHne11E.mjs.map} +1 -1
  151. package/dist/errors-DfnF4ibq.mjs +100 -0
  152. package/dist/errors-DfnF4ibq.mjs.map +1 -0
  153. package/dist/{globals-BjhJJ2dN.mjs → globals-D-YbJKW-.mjs} +16 -10
  154. package/dist/globals-D-YbJKW-.mjs.map +1 -0
  155. package/dist/kysely/index.d.mts +3 -4
  156. package/dist/{kysely-type-D-zflMGf.mjs → kysely-type-DqIRgDYR.mjs} +4 -3
  157. package/dist/kysely-type-DqIRgDYR.mjs.map +1 -0
  158. package/dist/{logger-BEiZZ3qT.mjs → logger-BwS4ppwO.mjs} +3 -3
  159. package/dist/logger-BwS4ppwO.mjs.map +1 -0
  160. package/dist/parser/service/auth/index.d.mts +1 -1
  161. package/dist/parser/service/auth/schema.d.mts +2 -0
  162. package/dist/parser/service/http-adapter/index.d.mts +1 -1
  163. package/dist/parser/service/idp/types.d.mts +1 -0
  164. package/dist/parser/service/tailordb/type-source.d.mts +10 -0
  165. package/dist/parser/service/tailordb/types.d.mts +6 -1
  166. package/dist/plugin/builtin/enum-constants/index.d.mts +0 -1
  167. package/dist/plugin/builtin/file-utils/index.d.mts +0 -1
  168. package/dist/plugin/builtin/kysely-type/index.d.mts +0 -1
  169. package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
  170. package/dist/plugin/builtin/seed/index.d.mts +0 -1
  171. package/dist/plugin/get-generated-type.d.mts +0 -1
  172. package/dist/plugin/manager.d.mts +2 -1
  173. package/dist/plugin/types.d.mts +0 -1
  174. package/dist/plugin/with-context.d.mts +0 -1
  175. package/dist/{register-ts-hook-BM1caLT0.mjs → register-ts-hook-DL31O2W9.mjs} +3076 -1744
  176. package/dist/register-ts-hook-DL31O2W9.mjs.map +1 -0
  177. package/dist/{registry-BSbq6SPo.mjs → registry-CC3CbQiF.mjs} +3 -3
  178. package/dist/registry-CC3CbQiF.mjs.map +1 -0
  179. package/dist/runtime/aigateway.d.mts +0 -1
  180. package/dist/runtime/authconnection.d.mts +0 -1
  181. package/dist/runtime/context.d.mts +0 -1
  182. package/dist/runtime/field-parse.d.mts +10 -0
  183. package/dist/runtime/globals.d.mts +5 -3
  184. package/dist/runtime/index.d.mts +0 -1
  185. package/dist/runtime/index.mjs +1 -1
  186. package/dist/runtime/types.d.mts +9 -4
  187. package/dist/runtime/workflow.d.mts +70 -10
  188. package/dist/runtime/workflow.mjs +1 -1
  189. package/dist/{schema-C4LYbXVG.mjs → schema--xYWRGfe.mjs} +272 -51
  190. package/dist/schema--xYWRGfe.mjs.map +1 -0
  191. package/dist/{secret-file-aoNXJmKa.mjs → secret-file-C3J4Gy8r.mjs} +2 -27
  192. package/dist/secret-file-C3J4Gy8r.mjs.map +1 -0
  193. package/dist/{secretmanager-Bd45j7an.mjs → secretmanager-IY4UvinW.mjs} +42 -9
  194. package/dist/secretmanager-IY4UvinW.mjs.map +1 -0
  195. package/dist/seed/index.d.mts +3 -2
  196. package/dist/{service-ufH7sS8o.mjs → service-CnHz9rwz.mjs} +47 -20
  197. package/dist/service-CnHz9rwz.mjs.map +1 -0
  198. package/dist/{service-DeZeYa06.mjs → service-DaeJlBoH.mjs} +3 -3
  199. package/dist/{service-DeZeYa06.mjs.map → service-DaeJlBoH.mjs.map} +1 -1
  200. package/dist/service-nU6ITOHL.mjs +3 -0
  201. package/dist/service_pb-BoLM0X4K.mjs +167 -0
  202. package/dist/service_pb-BoLM0X4K.mjs.map +1 -0
  203. package/dist/{service_pb-B2FF59sP.mjs → service_pb-r1T7kpJc.mjs} +1 -1
  204. package/dist/tailor-proto/src/tailor/v1/aigateway_pb.d.mts +0 -1
  205. package/dist/tailor-proto/src/tailor/v1/aigateway_resource_pb.d.mts +0 -1
  206. package/dist/tailor-proto/src/tailor/v1/application_pb.d.mts +0 -1
  207. package/dist/tailor-proto/src/tailor/v1/application_resource_pb.d.mts +0 -1
  208. package/dist/tailor-proto/src/tailor/v1/auth_pb.d.mts +0 -1
  209. package/dist/tailor-proto/src/tailor/v1/auth_resource_pb.d.mts +0 -1
  210. package/dist/tailor-proto/src/tailor/v1/events_pb.d.mts +0 -1
  211. package/dist/tailor-proto/src/tailor/v1/events_resource_pb.d.mts +0 -1
  212. package/dist/tailor-proto/src/tailor/v1/executor_pb.d.mts +0 -1
  213. package/dist/tailor-proto/src/tailor/v1/executor_resource_pb.d.mts +0 -1
  214. package/dist/tailor-proto/src/tailor/v1/function_pb.d.mts +0 -1
  215. package/dist/tailor-proto/src/tailor/v1/function_registry_pb.d.mts +0 -1
  216. package/dist/tailor-proto/src/tailor/v1/function_resource_pb.d.mts +0 -1
  217. package/dist/tailor-proto/src/tailor/v1/http_adapter_resource_pb.d.mts +0 -1
  218. package/dist/tailor-proto/src/tailor/v1/idp_pb.d.mts +0 -1
  219. package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +0 -1
  220. package/dist/tailor-proto/src/tailor/v1/metadata_pb.d.mts +0 -1
  221. package/dist/tailor-proto/src/tailor/v1/metadata_resource_pb.d.mts +0 -1
  222. package/dist/tailor-proto/src/tailor/v1/meter_pb.d.mts +0 -1
  223. package/dist/tailor-proto/src/tailor/v1/pipeline_pb.d.mts +0 -1
  224. package/dist/tailor-proto/src/tailor/v1/pipeline_resource_pb.d.mts +0 -1
  225. package/dist/tailor-proto/src/tailor/v1/resource_pb.d.mts +0 -1
  226. package/dist/tailor-proto/src/tailor/v1/secret_manager_pb.d.mts +0 -1
  227. package/dist/tailor-proto/src/tailor/v1/secret_manager_resource_pb.d.mts +0 -1
  228. package/dist/tailor-proto/src/tailor/v1/service_pb.d.mts +0 -1
  229. package/dist/tailor-proto/src/tailor/v1/stateflow_pb.d.mts +0 -1
  230. package/dist/tailor-proto/src/tailor/v1/stateflow_resource_pb.d.mts +0 -1
  231. package/dist/tailor-proto/src/tailor/v1/staticwebsite_pb.d.mts +0 -1
  232. package/dist/tailor-proto/src/tailor/v1/staticwebsite_resource_pb.d.mts +0 -1
  233. package/dist/tailor-proto/src/tailor/v1/tailordb_pb.d.mts +0 -1
  234. package/dist/tailor-proto/src/tailor/v1/tailordb_resource_pb.d.mts +0 -1
  235. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_pb.d.mts +0 -1
  236. package/dist/tailor-proto/src/tailor/v1/telemetryrouter_resource_pb.d.mts +0 -1
  237. package/dist/tailor-proto/src/tailor/v1/workflow_pb.d.mts +0 -1
  238. package/dist/tailor-proto/src/tailor/v1/workflow_resource_pb.d.mts +0 -1
  239. package/dist/tailor-proto/src/tailor/v1/workspace_pb.d.mts +0 -1
  240. package/dist/tailor-proto/src/tailor/v1/workspace_resource_pb.d.mts +0 -1
  241. package/dist/types/aigateway.generated.d.mts +5 -2
  242. package/dist/types/auth-connection.generated.d.mts +24 -11
  243. package/dist/types/auth.generated.d.mts +115 -84
  244. package/dist/types/executor.generated.d.mts +133 -123
  245. package/dist/types/helpers.d.mts +7 -6
  246. package/dist/types/http-adapter.generated.d.mts +11 -5
  247. package/dist/types/idp.generated.d.mts +536 -524
  248. package/dist/types/resolver.generated.d.mts +26 -11
  249. package/dist/types/staticwebsite.generated.d.mts +7 -3
  250. package/dist/types/tailordb.generated.d.mts +57 -29
  251. package/dist/types/workflow.generated.d.mts +9 -4
  252. package/dist/user-agent-Bgsszb5I.mjs +28 -0
  253. package/dist/user-agent-Bgsszb5I.mjs.map +1 -0
  254. package/dist/utils/test/index.d.mts +1 -2
  255. package/dist/utils/test/index.mjs +36 -10
  256. package/dist/utils/test/index.mjs.map +1 -1
  257. package/dist/utils/test/mock.d.mts +0 -1
  258. package/dist/vitest/environment.mjs +1 -1
  259. package/dist/vitest/index.d.mts +9 -9
  260. package/dist/vitest/index.mjs +591 -173
  261. package/dist/vitest/index.mjs.map +1 -1
  262. package/dist/vitest/mock-kysely.d.mts +0 -1
  263. package/dist/vitest/mock.d.mts +8 -8
  264. package/dist/vitest/mocks/aigateway.d.mts +16 -6
  265. package/dist/vitest/mocks/authconnection.d.mts +16 -6
  266. package/dist/vitest/mocks/file.d.mts +23 -6
  267. package/dist/vitest/mocks/iconv.d.mts +28 -4
  268. package/dist/vitest/mocks/idp.d.mts +26 -10
  269. package/dist/vitest/mocks/secretmanager.d.mts +16 -5
  270. package/dist/vitest/mocks/tailordb.d.mts +54 -10
  271. package/dist/vitest/mocks/workflow.d.mts +72 -21
  272. package/dist/vitest/setup.mjs +2 -2
  273. package/dist/vitest/workflow-local.d.mts +1 -0
  274. package/dist/workflow-9kHGKxF2.mjs +64 -0
  275. package/dist/workflow-9kHGKxF2.mjs.map +1 -0
  276. package/dist/{service_pb-B5w9rjPY.mjs → workspace_resource_pb-Db3fv68L.mjs} +57 -165
  277. package/dist/workspace_resource_pb-Db3fv68L.mjs.map +1 -0
  278. package/docs/cli/application.md +61 -15
  279. package/docs/cli/setup.md +1 -1
  280. package/docs/cli/tailordb.md +8 -140
  281. package/docs/cli/workspace.md +6 -4
  282. package/docs/cli-reference.md +18 -14
  283. package/docs/github-actions.md +8 -0
  284. package/docs/migration/v2.md +247 -0
  285. package/docs/runtime.md +5 -6
  286. package/docs/services/aigateway.md +2 -0
  287. package/docs/services/executor.md +5 -0
  288. package/docs/services/tailordb.md +144 -68
  289. package/docs/services/workflow.md +3 -3
  290. package/docs/testing.md +105 -89
  291. package/package.json +22 -25
  292. package/dist/application-BO4ZF8wP.mjs +0 -3
  293. package/dist/application-BX13RArL.mjs.map +0 -1
  294. package/dist/cli/erd-viewer-assets/app.js +0 -1424
  295. package/dist/cli/erd-viewer-assets/index.html +0 -77
  296. package/dist/cli/erd-viewer-assets/serve.json +0 -13
  297. package/dist/cli/erd-viewer-assets/styles.css +0 -1036
  298. package/dist/cli/shared/trigger-context.d.mts +0 -1
  299. package/dist/configure/types/field-runtime.d.mts +0 -17
  300. package/dist/errors-118wUDRr.mjs +0 -42
  301. package/dist/errors-118wUDRr.mjs.map +0 -1
  302. package/dist/field-runtime-CAnh_oow.mjs +0 -183
  303. package/dist/field-runtime-CAnh_oow.mjs.map +0 -1
  304. package/dist/globals-BjhJJ2dN.mjs.map +0 -1
  305. package/dist/kysely-type-D-zflMGf.mjs.map +0 -1
  306. package/dist/logger-BEiZZ3qT.mjs.map +0 -1
  307. package/dist/register-ts-hook-BM1caLT0.mjs.map +0 -1
  308. package/dist/registry-BSbq6SPo.mjs.map +0 -1
  309. package/dist/resource_pb-BRv7AMXK.mjs +0 -49
  310. package/dist/resource_pb-BRv7AMXK.mjs.map +0 -1
  311. package/dist/schema-C4LYbXVG.mjs.map +0 -1
  312. package/dist/secret-file-aoNXJmKa.mjs.map +0 -1
  313. package/dist/secretmanager-Bd45j7an.mjs.map +0 -1
  314. package/dist/service-CkIwEctX.mjs +0 -3
  315. package/dist/service-ufH7sS8o.mjs.map +0 -1
  316. package/dist/service_pb-B5w9rjPY.mjs.map +0 -1
  317. package/dist/types-C-lQ4se3.mjs +0 -4
  318. package/dist/types-CXF2OYdR.mjs +0 -199
  319. package/dist/types-CXF2OYdR.mjs.map +0 -1
  320. package/dist/workflow-GNuSnsTx.mjs +0 -22
  321. package/dist/workflow-GNuSnsTx.mjs.map +0 -1
package/docs/testing.md CHANGED
@@ -70,18 +70,23 @@ import { mockTailordb } from "@tailor-platform/sdk/vitest";
70
70
 
71
71
  test("...", () => {
72
72
  using db = mockTailordb();
73
- db.enqueueResult({ age: 30 });
73
+ db.onQuery(/SELECT age/).returnsRows([{ age: 30 }]);
74
74
  // …
75
75
  }); // reset automatically here
76
76
  ```
77
77
 
78
- The mock functions are also exposed directly (e.g. `db.queryObject`, `wf.triggerJobFunction`) so you can assert on them with `expect(...).toHaveBeenCalledWith(...)`.
78
+ Runtime operations are exposed as typed Vitest mocks wherever the platform API has a stable operation shape. For example, use `file.download.mockResolvedValue(...)`, `iconv.decode.mockReturnValue(...)`, or `wf.job(myJob).mockResolvedValue(...)`, then assert with native Vitest matchers. Service-specific helpers cover stateful fixtures and query matching.
79
+
80
+ Every controller provides two lifecycle methods when manual reuse is useful:
81
+
82
+ - `clear()` removes call history but preserves configured behavior.
83
+ - `reset()` removes call history and configured behavior, restoring the controller's default behavior.
79
84
 
80
85
  > **Requirements:** `using` requires TypeScript ≥ 5.2 and a runtime that provides `Symbol.dispose` (Node ≥ 20.4 — the SDK already targets Node ≥ 22, and Vitest's transformer downlevels the syntax for you).
81
86
  >
82
87
  > **Acquire what you use:** a namespace is only mocked while you hold it with `using`, so code under test that calls a platform API (e.g. `tailor.workflow`, `tailordb.Client`) must run inside a test that has acquired the matching `mockX()`. The error classes and `tailor.context` are always present.
83
88
  >
84
- > **Seeded secrets survive:** secrets seeded from `tailor.config.ts` stay available across tests; a per-test `mockSecretmanager().setSecrets(...)` override applies only within that test.
89
+ > **Seeded secrets survive:** secrets seeded from `tailor.config.ts` stay available across tests; per-test fixtures passed to `mockSecretmanager({ secrets: ... })` apply only within that test.
85
90
 
86
91
  ### TailorDB Mock
87
92
 
@@ -92,8 +97,8 @@ import { mockTailordb } from "@tailor-platform/sdk/vitest";
92
97
 
93
98
  test("resolver queries the database", async () => {
94
99
  using db = mockTailordb();
95
- // Order-based: stage rows for each upcoming query in one call
96
- db.enqueueResults(
100
+ // Use an explicit queue when transaction order is part of the test.
101
+ db.enqueueRows(
97
102
  [], // BEGIN (empty result)
98
103
  [{ age: 30 }], // SELECT (one row)
99
104
  [], // COMMIT
@@ -112,19 +117,15 @@ test("resolver queries the database", async () => {
112
117
  });
113
118
  ```
114
119
 
115
- Three response modes:
116
-
117
- - **`enqueueResult(...rows)`** — Order-based, single query. Arguments are the row objects returned by the next `queryObject` call (`enqueueResult()` for empty, `enqueueResult({ id: "1" })` for one row, `enqueueResult({ a: 1 }, { a: 2 })` for multiple rows). Consumed in FIFO order.
118
- - **`enqueueResults(...rowsArrays)`** — Order-based, multiple queries. Each argument is a rows array for one upcoming query. Equivalent to calling `enqueueResult` for each entry but easier to read for transactional sequences.
119
- - **`setQueryResolver((query, params) => rows)`** — Content-based fallback. Called when the queue is empty.
120
+ Match queries by SQL text, a regular expression, SQL plus parameters, or a predicate. The most recently registered matcher wins:
120
121
 
121
122
  ```typescript
122
123
  test("content-based mock", async () => {
123
124
  using db = mockTailordb();
124
- db.setQueryResolver((query) => {
125
- if (query.includes("SELECT")) return [{ id: "1", name: "test" }];
126
- return [];
127
- });
125
+ db.onQuery({ sql: /FROM users/i, params: ["1"] }).returnsRows([{ id: "1", name: "test" }]);
126
+ db.onQuery(/FROM audit_logs/i)
127
+ .returnsRowsOnce([{ id: "first" }])
128
+ .returnsRows([{ id: "later" }]);
128
129
 
129
130
  const result = await resolver.body({
130
131
  input: { userId: "1" },
@@ -137,40 +138,46 @@ test("content-based mock", async () => {
137
138
  });
138
139
  ```
139
140
 
141
+ Within one `mockTailordb()` instance, use either `onQuery()` matchers or a direct `queryObject.mockImplementation()` override. A direct override replaces matcher-based behavior, so do not combine the two styles.
142
+
143
+ `returnsRowsOnce` and `rejectsOnce` configure one-time responses before the persistent `returnsRows` or `rejects` response. `enqueueRows(...rowArrays)` remains available for transaction sequences whose exact call order is under test. The existing `enqueueResult`, `enqueueResults`, and `setQueryResolver` helpers remain supported for compatibility.
144
+
145
+ Pass `{ onUnhandled: "error" }` to make an unmatched query fail instead of returning an empty result.
146
+
140
147
  ### Workflow Mock
141
148
 
142
- Workflow job `.trigger()` calls use the platform workflow runtime. Acquire `mockWorkflow()` when you want to provide trigger responses with `setJobHandler` / `enqueueResult` or assert on `triggeredJobs`. If no response is configured, the mock throws so missing job mocks fail loudly:
149
+ Workflow job `.trigger()` calls use the platform workflow runtime. Acquire `mockWorkflow()` when you want to provide trigger responses with `setJobHandler` / `enqueueResult` or assert on `triggeredJobs`. If no response is configured, the mock throws so missing job mocks fail loudly. Use `job(definition)` or `workflow(definition)` to get a stable, fully typed Vitest mock for one definition:
143
150
 
144
151
  ```typescript
145
152
  import { mockWorkflow } from "@tailor-platform/sdk/vitest";
153
+ import { processPayment, validateOrder } from "./jobs";
146
154
 
147
155
  test("workflow triggers jobs", async () => {
148
156
  using wf = mockWorkflow();
149
- wf.setJobHandler((jobName, args) => {
150
- if (jobName === "validate-order") return { valid: true };
151
- if (jobName === "process-payment") return { txnId: "txn-1" };
152
- return null;
153
- });
157
+ const validate = wf.job(validateOrder);
158
+ const payment = wf.job(processPayment);
159
+ validate.mockResolvedValue({ valid: true });
160
+ payment.mockResolvedValue({ txnId: "txn-1" });
154
161
 
155
162
  const result = await main({ input: { orderId: "o-1" } });
156
163
 
157
- expect(wf.triggeredJobs).toEqual([
158
- { jobName: "validate-order", args: { orderId: "o-1" } },
159
- { jobName: "process-payment", args: { orderId: "o-1" } },
160
- ]);
164
+ expect(validate).toHaveBeenCalledWith({ orderId: "o-1" });
165
+ expect(payment).toHaveBeenCalledWith({ orderId: "o-1" });
161
166
  });
162
167
  ```
163
168
 
164
- `mockWorkflow()` also supports order-based responses:
169
+ Unconfigured definition mocks continue to run their real implementations. The lower-level `triggerJobFunction`, `triggerWorkflow`, `resumeWorkflow`, `wait`, and `resolve` mocks and the existing `setJobHandler`, `enqueueResult`, `enqueueResults`, and call-record helpers remain available.
170
+
171
+ Use `waitPoint(definition)` for typed wait-point control:
165
172
 
166
173
  ```typescript
167
174
  using wf = mockWorkflow();
175
+ const approvalMock = wf.waitPoint(approvalWaitPoint);
168
176
 
169
- // Single response for the next triggerJobFunction call
170
- wf.enqueueResult({ valid: true });
177
+ approvalMock.wait.mockResolvedValue({ approved: true });
178
+ await approvalWaitPoint.wait({ message: "Please approve" });
171
179
 
172
- // Multiple responses for subsequent calls (FIFO)
173
- wf.enqueueResults({ valid: true }, { txnId: "txn-1" });
180
+ expect(approvalMock.wait).toHaveBeenCalledWith({ message: "Please approve" });
174
181
  ```
175
182
 
176
183
  Use `wf.setEnv(...)` when locally-run workflow job bodies need configuration values. Per-run `runWorkflowLocally(..., { env })` options take precedence over the mock's env.
@@ -181,13 +188,14 @@ Use `wf.setEnv(...)` when locally-run workflow job bodies need configuration val
181
188
  import { mockSecretmanager } from "@tailor-platform/sdk/vitest";
182
189
 
183
190
  test("reads secrets from vault", async () => {
184
- using sm = mockSecretmanager();
185
- sm.setSecrets({
186
- "my-vault": { API_KEY: "sk-123", DB_PASS: "secret" },
191
+ using sm = mockSecretmanager({
192
+ secrets: { "my-vault": { API_KEY: "sk-123" } },
187
193
  });
194
+ sm.setSecret("my-vault", "API_KEY", "override");
195
+ sm.mergeSecrets("my-vault", { DB_PASS: "secret" });
188
196
 
189
197
  const key = await tailor.secretmanager.getSecret("my-vault", "API_KEY");
190
- expect(key).toBe("sk-123");
198
+ expect(key).toBe("override");
191
199
  expect(sm.calls).toEqual([{ method: "getSecret", vault: "my-vault", name: "API_KEY" }]);
192
200
  });
193
201
  ```
@@ -198,65 +206,65 @@ test("reads secrets from vault", async () => {
198
206
  import { mockAuthconnection } from "@tailor-platform/sdk/vitest";
199
207
 
200
208
  test("returns configured token", async () => {
201
- using ac = mockAuthconnection();
202
- ac.setTokens({
203
- google: { access_token: "ya29.xxx" },
209
+ using ac = mockAuthconnection({
210
+ tokens: { google: { access_token: "ya29.xxx" } },
211
+ onUnhandled: "error",
204
212
  });
213
+ ac.setToken("google", { access_token: "replacement" });
205
214
 
206
215
  const token = await tailor.authconnection.getConnectionToken("google");
207
- expect(token.access_token).toBe("ya29.xxx");
216
+ expect(token.access_token).toBe("replacement");
208
217
  });
209
218
  ```
210
219
 
211
- When no token is configured for a connection, it returns `{ access_token: "mock-token" }`.
220
+ By default, an unconfigured connection returns `{ access_token: "mock-token" }`. Pass `onUnhandled: "error"` to fail instead.
212
221
 
213
222
  ### IDP Mock
214
223
 
215
224
  ```typescript
216
225
  import { mockIdp } from "@tailor-platform/sdk/vitest";
217
226
 
218
- test("resolver-based", async () => {
219
- using idp = mockIdp();
220
- idp.setResolver((method, args) => {
221
- if (method === "user") return { id: "u-1", name: "alice", disabled: false };
222
- return null; // falls back to defaults
227
+ test("namespace-specific mock", async () => {
228
+ using idp = mockIdp({ onUnhandled: "error" });
229
+ const customerIdp = idp.namespace("my-ns");
230
+ customerIdp.user.mockResolvedValue({
231
+ id: "u-1",
232
+ name: "alice",
233
+ disabled: false,
234
+ mfaEnrolled: false,
235
+ mfaFactorIds: [],
223
236
  });
224
237
 
225
238
  const client = new tailor.idp.Client({ namespace: "my-ns" });
226
239
  const user = await client.user("u-1");
227
240
  expect(user.name).toBe("alice");
228
- });
229
-
230
- test("queue-based", async () => {
231
- using idp = mockIdp();
232
- idp.enqueueResult({ id: "u-1", name: "alice", disabled: false });
233
-
234
- const client = new tailor.idp.Client({ namespace: "my-ns" });
235
- const user = await client.user("u-1");
236
- expect(user.name).toBe("alice");
237
- expect(idp.calls).toMatchObject([{ method: "user", namespace: "my-ns" }]);
241
+ expect(customerIdp.user).toHaveBeenCalledWith("u-1");
238
242
  });
239
243
  ```
240
244
 
245
+ Each namespace exposes typed mocks for `users`, `user`, `userByName`, `createUser`, `updateUser`, `deleteUser`, `sendPasswordResetEmail`, and `unenrollMfa`. The existing resolver, queue, and aggregate `calls` APIs remain supported.
246
+
241
247
  ### File Mock
242
248
 
243
249
  ```typescript
244
250
  import { mockFile } from "@tailor-platform/sdk/vitest";
245
251
 
246
252
  test("mock file download", async () => {
247
- using file = mockFile();
248
- file.enqueueResult({
253
+ using file = mockFile({ onUnhandled: "error" });
254
+ file.download.mockResolvedValue({
249
255
  data: new Uint8Array([1, 2, 3]),
250
256
  metadata: { contentType: "image/png", fileSize: 3, sha256sum: "abc", lastUploadedAt: "" },
251
257
  });
252
258
 
253
259
  const result = await tailordb.file.download("ns", "Doc", "attachment", "r-1");
254
260
  expect(result.data).toEqual(new Uint8Array([1, 2, 3]));
255
- expect(file.calls).toMatchObject([{ method: "download", recordId: "r-1" }]);
261
+ expect(file.download).toHaveBeenCalledWith("ns", "Doc", "attachment", "r-1");
256
262
  });
257
263
  ```
258
264
 
259
- For `downloadStream`, enqueue a `FileDownloadStreamResponse` object with a `ReadableStream` body and metadata:
265
+ All File operations are typed Vitest mocks: `upload`, `download`, `downloadAsBase64`, `delete`, `getMetadata`, `downloadStream`, and `uploadStream`. Use native methods such as `mockResolvedValueOnce` and `mockRejectedValueOnce` to model success and failure. The existing resolver, queue, and aggregate `calls` APIs remain supported.
266
+
267
+ For `downloadStream`, configure a `FileDownloadStreamResponse` object with a `ReadableStream` body and metadata:
260
268
 
261
269
  ```typescript
262
270
  test("mock file download stream", async () => {
@@ -267,7 +275,7 @@ test("mock file download stream", async () => {
267
275
  controller.close();
268
276
  },
269
277
  });
270
- file.enqueueResult({
278
+ file.downloadStream.mockResolvedValue({
271
279
  body,
272
280
  metadata: { contentType: "image/png", fileSize: 3, sha256sum: "abc", lastUploadedAt: "" },
273
281
  });
@@ -284,10 +292,7 @@ import { mockIconv } from "@tailor-platform/sdk/vitest";
284
292
 
285
293
  test("mock encoding conversion", () => {
286
294
  using iconv = mockIconv();
287
- iconv.setResolver((method, args) => {
288
- if (method === "decode") return "decoded-text";
289
- return null; // falls back to default empty string
290
- });
295
+ iconv.decode.mockReturnValue("decoded-text");
291
296
 
292
297
  const result = tailor.iconv.decode(new Uint8Array([0x48, 0x69]), "UTF-8");
293
298
  expect(result).toBe("decoded-text");
@@ -295,22 +300,26 @@ test("mock encoding conversion", () => {
295
300
  });
296
301
  ```
297
302
 
303
+ `convert`, `convertBuffer`, `decode`, `encode`, and `encodings` are all typed Vitest mocks. Pass `{ onUnhandled: "error" }` to fail calls without a configured implementation. The existing resolver and aggregate `calls` APIs remain supported.
304
+
298
305
  ### AI Gateway Mock
299
306
 
300
307
  ```typescript
301
308
  import { mockAigateway } from "@tailor-platform/sdk/vitest";
302
309
 
303
310
  test("resolves an AI Gateway URL", async () => {
304
- using aigateway = mockAigateway();
305
- aigateway.setUrls({ "my-aigateway": "https://my-aigateway.example.com" });
311
+ using aigateway = mockAigateway({
312
+ urls: { "my-aigateway": "https://my-aigateway.example.com" },
313
+ });
314
+ aigateway.setUrl("my-aigateway", "https://replacement.example.com");
306
315
 
307
316
  const { url } = await tailor.aigateway.get("my-aigateway");
308
- expect(url).toBe("https://my-aigateway.example.com");
317
+ expect(url).toBe("https://replacement.example.com");
309
318
  expect(aigateway.calls).toEqual([{ name: "my-aigateway" }]);
310
319
  });
311
320
  ```
312
321
 
313
- Calling `get` for a name that hasn't been registered via `setUrls` throws.
322
+ Calling `get` for a name that has not been registered throws. `setUrls` remains available when replacing the complete URL fixture.
314
323
 
315
324
  ### Loading Secrets from Config
316
325
 
@@ -323,7 +332,7 @@ export default defineConfig({
323
332
  });
324
333
  ```
325
334
 
326
- This makes `tailor.secretmanager.getSecret("vault", "key")` return the values defined in your config. You can still override with `using sm = mockSecretmanager(); sm.setSecrets(...)` in individual tests: a per-test override applies only within that test, and the config-loaded secrets remain available to every other test.
335
+ This makes `tailor.secretmanager.getSecret("vault", "key")` return the values defined in your config. You can still override with `mockSecretmanager({ secrets: ... })` in individual tests: a per-test overlay applies only within that test, and the config-loaded secrets remain available to every other test.
327
336
 
328
337
  ### Per-Project Configuration
329
338
 
@@ -548,19 +557,21 @@ Reach for [`mockTailordb`](#mocking-the-tailordb-client) instead when you want t
548
557
 
549
558
  #### Resolvers that resume a workflow
550
559
 
551
- Resolvers that call `waitPoint.resolve(...)` delegate to `tailor.workflow.resolve` at runtime. With the `tailor-runtime` environment active, use `mockWorkflow().setResolveHandler` to drive the user-supplied callback and inspect `resolveCalls`:
560
+ Resolvers that call `waitPoint.resolve(...)` delegate to `tailor.workflow.resolve` at runtime. With the `tailor-runtime` environment active, use `mockWorkflow().waitPoint(definition)` to invoke the callback with the payload that originally suspended the job:
552
561
 
553
562
  ```typescript
554
563
  import { mockWorkflow } from "@tailor-platform/sdk/vitest";
555
564
  import { describe, expect, test } from "vitest";
565
+ import { approval } from "../workflow/approval";
556
566
  import resolver from "./resolveApproval";
557
567
 
558
568
  describe("resolveApproval resolver", () => {
559
569
  test("resolves approval with approved=true", async () => {
560
570
  using wf = mockWorkflow();
561
- wf.setResolveHandler((_executionId, _key, callback) => {
562
- const result = callback({ message: "Please approve order order-1", orderId: "order-1" });
563
- expect(result).toEqual({ approved: true });
571
+ const approvalMock = wf.waitPoint(approval);
572
+ approvalMock.setResolvePayload({
573
+ message: "Please approve order order-1",
574
+ orderId: "order-1",
564
575
  });
565
576
 
566
577
  const result = await resolver.body({
@@ -571,16 +582,16 @@ describe("resolveApproval resolver", () => {
571
582
  });
572
583
 
573
584
  expect(result).toEqual({ resolved: true });
574
- expect(wf.resolveCalls).toEqual([{ executionId: "exec-1", key: "approval" }]);
585
+ expect(approvalMock.resolve).toHaveBeenCalledWith("exec-1", expect.any(Function));
575
586
  });
576
587
  });
577
588
  ```
578
589
 
579
- `setResolveHandler` receives `(executionId, key, callback)` and decides whether to invoke the callback that's how you assert the value returned to the suspended job.
590
+ `setResolvePayload` is typed from the wait-point definition. The lower-level `setResolveHandler` and `resolveCalls` APIs remain available when a test must control several wait points together.
580
591
 
581
592
  #### Resolvers that resume failed workflows
582
593
 
583
- Resolvers or executors that call `workflow.resumeWorkflow(executionId)` delegate to `tailor.workflow.resumeWorkflow` at runtime. With the `tailor-runtime` environment active, use `mockWorkflow().setResumeHandler` to control the returned execution ID and inspect `resumeWorkflow.mock.calls`:
594
+ Resolvers or executors that call `workflow.resumeWorkflowExecution(executionId)` delegate to `tailor.workflow.resumeWorkflowExecution` at runtime. With the `tailor-runtime` environment active, use `mockWorkflow().setResumeHandler` to control the returned execution ID and inspect `resumeWorkflowExecution.mock.calls`:
584
595
 
585
596
  ```typescript
586
597
  import { unauthenticatedTailorUser } from "@tailor-platform/sdk/test";
@@ -600,7 +611,7 @@ describe("retryFailedWorkflow resolver", () => {
600
611
  });
601
612
 
602
613
  expect(result).toEqual({ resumedExecutionId: "exec-resumed-123" });
603
- expect(wf.resumeWorkflow.mock.calls).toEqual([["exec-failed-456"]]);
614
+ expect(wf.resumeWorkflowExecution.mock.calls).toEqual([["exec-failed-456"]]);
604
615
  });
605
616
  });
606
617
  ```
@@ -687,24 +698,26 @@ describe("validateOrder", () => {
687
698
 
688
699
  #### Jobs that trigger other jobs
689
700
 
690
- Spy on each dependent job's `.trigger()` to replace it with a deterministic result:
701
+ Use `mockWorkflow().job(definition)` to replace dependent jobs with deterministic results:
691
702
 
692
703
  ```typescript
693
- import { describe, expect, test, vi } from "vitest";
704
+ import { mockWorkflow } from "@tailor-platform/sdk/vitest";
705
+ import { describe, expect, test } from "vitest";
694
706
  import { fulfillOrder, processPayment, sendConfirmation, validateOrder } from "./order-fulfillment";
695
707
 
696
708
  describe("fulfillOrder", () => {
697
709
  test("chains validate → pay → confirm", async () => {
698
- using _validateSpy = vi.spyOn(validateOrder, "trigger").mockReturnValue({
710
+ using wf = mockWorkflow();
711
+ const validate = wf.job(validateOrder).mockResolvedValue({
699
712
  valid: true,
700
713
  orderId: "order-1",
701
714
  });
702
- using _paymentSpy = vi.spyOn(processPayment, "trigger").mockReturnValue({
715
+ wf.job(processPayment).mockResolvedValue({
703
716
  transactionId: "txn-order-1",
704
717
  amount: 100,
705
718
  status: "completed",
706
719
  });
707
- using _confirmSpy = vi.spyOn(sendConfirmation, "trigger").mockReturnValue({
720
+ wf.job(sendConfirmation).mockResolvedValue({
708
721
  orderId: "order-1",
709
722
  transactionId: "txn-order-1",
710
723
  confirmed: true,
@@ -715,7 +728,7 @@ describe("fulfillOrder", () => {
715
728
  { env: {}, invoker: null },
716
729
  );
717
730
 
718
- expect(validateOrder.trigger).toHaveBeenCalledWith({ orderId: "order-1", amount: 100 });
731
+ expect(validate).toHaveBeenCalledWith({ orderId: "order-1", amount: 100 });
719
732
  expect(result).toMatchObject({ confirmed: true, paymentStatus: "completed" });
720
733
  });
721
734
  });
@@ -725,17 +738,18 @@ describe("fulfillOrder", () => {
725
738
 
726
739
  #### Jobs that wait on approval
727
740
 
728
- `.wait()` calls delegate to `tailor.workflow.wait`. With the `tailor-runtime` environment active, use `mockWorkflow().setWaitHandler` to drive each branch and inspect `waitCalls`:
741
+ `.wait()` calls delegate to `tailor.workflow.wait`. With the `tailor-runtime` environment active, use `mockWorkflow().waitPoint(definition)` to drive each branch with a typed mock:
729
742
 
730
743
  ```typescript
731
744
  import { mockWorkflow } from "@tailor-platform/sdk/vitest";
732
745
  import { describe, expect, test } from "vitest";
733
- import { processWithApproval } from "./approval";
746
+ import { approval, processWithApproval } from "./approval";
734
747
 
735
748
  describe("processWithApproval", () => {
736
749
  test("returns approved status when .wait() resolves positively", async () => {
737
750
  using wf = mockWorkflow();
738
- wf.setWaitHandler({ approved: true });
751
+ const approvalMock = wf.waitPoint(approval);
752
+ approvalMock.wait.mockResolvedValue({ approved: true });
739
753
 
740
754
  const result = await processWithApproval.body(
741
755
  { orderId: "order-1" },
@@ -743,15 +757,15 @@ describe("processWithApproval", () => {
743
757
  );
744
758
 
745
759
  expect(result).toEqual({ orderId: "order-1", status: "approved" });
746
- expect(wf.waitCalls[0]).toEqual({
747
- key: "approval",
748
- payload: { message: "Please approve order order-1", orderId: "order-1" },
760
+ expect(approvalMock.wait).toHaveBeenCalledWith({
761
+ message: "Please approve order order-1",
762
+ orderId: "order-1",
749
763
  });
750
764
  });
751
765
 
752
766
  test("returns rejected status when .wait() resolves negatively", async () => {
753
767
  using wf = mockWorkflow();
754
- wf.setWaitHandler({ approved: false });
768
+ wf.waitPoint(approval).wait.mockResolvedValue({ approved: false });
755
769
 
756
770
  const result = await processWithApproval.body(
757
771
  { orderId: "order-2" },
@@ -763,7 +777,7 @@ describe("processWithApproval", () => {
763
777
  });
764
778
  ```
765
779
 
766
- `setWaitHandler` accepts a static value (returned from every `.wait()` call) or a function `(key, payload) => unknown` to compute one per call. `waitCalls` captures the `key` and `payload` passed in.
780
+ The lower-level `setWaitHandler` and `waitCalls` APIs remain available when one handler must cover several wait points.
767
781
 
768
782
  #### Running a full workflow locally
769
783
 
@@ -783,6 +797,8 @@ describe("order-fulfillment workflow", () => {
783
797
  });
784
798
  ```
785
799
 
800
+ Acquire `mockWorkflow()` only when you need to override a dependent definition with `wf.job(...)` / `wf.workflow(...)` (the rest still run their real bodies), control the env via `wf.setEnv(...)`, or assert on calls.
801
+
786
802
  Pass `{ env }` as the third argument when job bodies need configuration values during the local run.
787
803
 
788
804
  If you already acquired `mockWorkflow()`, you can also call `wf.setEnv(...)` to reuse the same env across local workflow runs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "2.0.0-next.4",
3
+ "version": "2.0.0-next.6",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -157,61 +157,58 @@
157
157
  "@opentelemetry/exporter-trace-otlp-proto": "0.220.0",
158
158
  "@opentelemetry/resources": "2.9.0",
159
159
  "@opentelemetry/sdk-trace-node": "2.9.0",
160
- "@opentelemetry/semantic-conventions": "1.41.1",
161
- "@oxc-project/types": "0.138.0",
160
+ "@opentelemetry/semantic-conventions": "1.43.0",
161
+ "@oxc-project/types": "0.139.0",
162
162
  "@standard-schema/spec": "1.1.0",
163
163
  "@tailor-platform/function-kysely-tailordb": "0.1.3",
164
- "@toiroakr/lines-db": "0.10.0",
164
+ "@toiroakr/lines-db": "0.10.1",
165
165
  "@toiroakr/read-multiline": "0.4.1",
166
166
  "@urql/core": "6.0.3",
167
167
  "amaro": "1.1.10",
168
168
  "chalk": "5.6.2",
169
- "chokidar": "5.0.0",
170
169
  "confbox": "0.2.4",
171
170
  "date-fns": "4.4.0",
172
171
  "es-toolkit": "1.49.0",
173
172
  "find-up-simple": "1.0.1",
174
173
  "globals": "17.7.0",
175
- "graphql": "17.0.1",
174
+ "graphql": "17.0.2",
176
175
  "inflection": "3.0.2",
177
- "kysely": "0.29.2",
178
- "madge": "8.0.0",
176
+ "kysely": "0.29.3",
179
177
  "mime-types": "3.0.2",
180
178
  "open": "11.0.0",
181
- "oxc-parser": "0.138.0",
179
+ "oxc-parser": "0.139.0",
182
180
  "p-limit": "7.3.0",
183
181
  "pathe": "2.0.3",
184
182
  "pgsql-ast-parser": "12.0.2",
185
183
  "pkg-types": "2.3.1",
186
- "politty": "0.11.0",
187
- "rolldown": "1.1.4",
184
+ "politty": "0.11.2",
185
+ "rolldown": "1.1.5",
188
186
  "semver": "7.8.5",
189
187
  "sql-highlight": "6.1.0",
190
- "std-env": "4.1.0",
188
+ "std-env": "4.2.0",
191
189
  "table": "6.9.0",
192
190
  "ts-cron-validator": "1.1.5",
193
- "type-fest": "5.7.0",
194
- "undici": "8.6.0",
191
+ "type-fest": "5.8.0",
192
+ "undici": "8.7.0",
195
193
  "xdg-basedir": "5.1.0",
196
194
  "zod": "4.4.3"
197
195
  },
198
196
  "devDependencies": {
199
197
  "@opentelemetry/sdk-trace-base": "2.9.0",
200
- "@types/madge": "5.0.3",
201
198
  "@types/mime-types": "3.0.1",
202
- "@types/node": "24.13.2",
199
+ "@types/node": "24.13.3",
203
200
  "@types/semver": "7.7.1",
204
- "@typescript/native-preview": "7.0.0-dev.20260703.1",
205
- "@vitest/coverage-v8": "4.1.9",
201
+ "@typescript/native-preview": "7.0.0-dev.20260707.2",
202
+ "@vitest/coverage-v8": "4.1.10",
206
203
  "eslint-plugin-zod": "4.7.0",
207
- "oxfmt": "0.57.0",
208
- "oxlint": "1.72.0",
204
+ "oxfmt": "0.58.0",
205
+ "oxlint": "1.73.0",
209
206
  "oxlint-tsgolint": "0.24.0",
210
- "sonda": "0.13.1",
211
- "tsdown": "0.22.3",
207
+ "sonda": "0.14.0",
208
+ "tsdown": "0.22.5",
212
209
  "typescript": "6.0.3",
213
- "vitest": "4.1.9",
214
- "zinfer": "0.2.3",
210
+ "vitest": "4.1.10",
211
+ "zinfer": "0.2.5",
215
212
  "@tailor-platform/tailor-proto": "^0.0.0"
216
213
  },
217
214
  "peerDependencies": {
@@ -244,7 +241,7 @@
244
241
  "check:import-cycles": "node --experimental-strip-types scripts/check-import-cycles.ts",
245
242
  "lint:fix": "oxlint --type-aware . --fix",
246
243
  "typecheck": "tsc --noEmit",
247
- "typecheck:go": "tsgo",
244
+ "typecheck:go": "tsgo --tsBuildInfoFile ./.tsgo.tsbuildinfo",
248
245
  "perf:typecheck": "bash scripts/perf/exec.sh",
249
246
  "perf:runtime": "bash scripts/perf/runtime-perf.sh",
250
247
  "prepublish": "pnpm run build",
@@ -1,3 +0,0 @@
1
- import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-BX13RArL.mjs";
2
-
3
- export { defineApplication, generatePluginFilesIfNeeded };