@warlock.js/core 5.31.0 → 5.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1018) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/esm/application/app.d.mts +3 -3
  3. package/esm/application/app.d.mts.map +1 -1
  4. package/esm/application/application-config-types.d.mts +1 -2
  5. package/esm/application/application-config-types.d.mts.map +1 -1
  6. package/esm/application/application.d.mts +5 -7
  7. package/esm/application/application.d.mts.map +1 -1
  8. package/esm/application/application.mjs +3 -1
  9. package/esm/application/application.mjs.map +1 -1
  10. package/esm/application/boot-signal.d.mts +14 -12
  11. package/esm/application/boot-signal.d.mts.map +1 -1
  12. package/esm/application/index.d.mts +2 -1
  13. package/esm/application/index.mjs +1 -1
  14. package/esm/application/public-url.d.mts +1 -2
  15. package/esm/application/public-url.d.mts.map +1 -1
  16. package/esm/application/roles.d.mts +10 -11
  17. package/esm/application/roles.d.mts.map +1 -1
  18. package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
  19. package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
  20. package/esm/benchmark/benchmark.d.mts +1 -3
  21. package/esm/benchmark/benchmark.d.mts.map +1 -1
  22. package/esm/benchmark/channels/console.channel.d.mts +1 -3
  23. package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
  24. package/esm/benchmark/channels/noop.channel.d.mts +1 -3
  25. package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
  26. package/esm/benchmark/index.mjs +1 -1
  27. package/esm/benchmark/profiler.d.mts +1 -3
  28. package/esm/benchmark/profiler.d.mts.map +1 -1
  29. package/esm/benchmark/profiler.mjs +2 -1
  30. package/esm/benchmark/profiler.mjs.map +1 -1
  31. package/esm/benchmark/types.d.mts +22 -17
  32. package/esm/benchmark/types.d.mts.map +1 -1
  33. package/esm/bootstrap/setup.d.mts +1 -2
  34. package/esm/bootstrap/setup.d.mts.map +1 -1
  35. package/esm/bootstrap.d.mts +1 -2
  36. package/esm/bootstrap.d.mts.map +1 -1
  37. package/esm/cache/database-cache-driver.d.mts +3 -5
  38. package/esm/cache/database-cache-driver.d.mts.map +1 -1
  39. package/esm/cache/database-cache-driver.mjs +1 -1
  40. package/esm/cache/index.d.mts +2 -1
  41. package/esm/cache/index.mjs +1 -1
  42. package/esm/cli/cli-commands.manager.mjs +6 -3
  43. package/esm/cli/cli-commands.manager.mjs.map +1 -1
  44. package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
  45. package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
  46. package/esm/cli/commands/board/board-command.action.mjs +1 -1
  47. package/esm/cli/commands/check/check-command.action.mjs +1 -1
  48. package/esm/cli/commands/check/child-typecheck.mjs +1 -1
  49. package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
  50. package/esm/cli/commands/check/format-problems.mjs +1 -1
  51. package/esm/cli/commands/dev-server.command.mjs +3 -2
  52. package/esm/cli/commands/dev-server.command.mjs.map +1 -1
  53. package/esm/cli/commands/doctor/check.types.d.mts +29 -16
  54. package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
  55. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
  56. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
  57. package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
  58. package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
  59. package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
  60. package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
  61. package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
  62. package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
  63. package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
  64. package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
  65. package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
  66. package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
  67. package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
  68. package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
  69. package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
  70. package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
  71. package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
  72. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
  73. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
  74. package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
  75. package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
  76. package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
  77. package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
  78. package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
  79. package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
  80. package/esm/cli/commands/issue/collect-environment.mjs +187 -0
  81. package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
  82. package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
  83. package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
  84. package/esm/cli/commands/issue.command.mjs +31 -0
  85. package/esm/cli/commands/issue.command.mjs.map +1 -0
  86. package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
  87. package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
  88. package/esm/cli/commands/openapi-generator.action.mjs +1 -1
  89. package/esm/cli/commands/postman-generator.action.mjs +1 -1
  90. package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
  91. package/esm/cli/commands/routes/route-row.mjs +1 -1
  92. package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
  93. package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
  94. package/esm/cli/commands/test.command.mjs +1 -1
  95. package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
  96. package/esm/cli/commands-loader.mjs +1 -1
  97. package/esm/cli/framework-cli-commands.mjs +2 -0
  98. package/esm/cli/framework-cli-commands.mjs.map +1 -1
  99. package/esm/cli/parse-cli-args.mjs +2 -2
  100. package/esm/cli/parse-cli-args.mjs.map +1 -1
  101. package/esm/cli/start.d.mts +1 -1
  102. package/esm/cli/string-similarity.mjs +1 -1
  103. package/esm/commands/cli-command.d.mts +2 -4
  104. package/esm/commands/cli-command.d.mts.map +1 -1
  105. package/esm/commands/index.d.mts +2 -1
  106. package/esm/commands/index.mjs +1 -1
  107. package/esm/commands/types.d.mts +8 -8
  108. package/esm/commands/types.d.mts.map +1 -1
  109. package/esm/config/config-getter.d.mts +2 -3
  110. package/esm/config/config-getter.d.mts.map +1 -1
  111. package/esm/config/config-getter.mjs +5 -5
  112. package/esm/config/config-getter.mjs.map +1 -1
  113. package/esm/config/config-handlers.d.mts +1 -3
  114. package/esm/config/config-handlers.d.mts.map +1 -1
  115. package/esm/config/config-loader.d.mts +1 -2
  116. package/esm/config/config-loader.d.mts.map +1 -1
  117. package/esm/config/config-loader.mjs +3 -3
  118. package/esm/config/config-loader.mjs.map +1 -1
  119. package/esm/config/config-manager.mjs +1 -1
  120. package/esm/config/config-schema.d.mts +19 -16
  121. package/esm/config/config-schema.d.mts.map +1 -1
  122. package/esm/config/config-setter.d.mts +2 -4
  123. package/esm/config/config-setter.d.mts.map +1 -1
  124. package/esm/config/config-setter.mjs +2 -2
  125. package/esm/config/config-setter.mjs.map +1 -1
  126. package/esm/config/config-special-handlers.d.mts +2 -4
  127. package/esm/config/config-special-handlers.d.mts.map +1 -1
  128. package/esm/config/index.d.mts +2 -1
  129. package/esm/config/index.mjs +1 -1
  130. package/esm/config/types.d.mts +4 -5
  131. package/esm/config/types.d.mts.map +1 -1
  132. package/esm/connectors/access-connector.d.mts +1 -3
  133. package/esm/connectors/access-connector.d.mts.map +1 -1
  134. package/esm/connectors/access-connector.mjs +2 -2
  135. package/esm/connectors/access-connector.mjs.map +1 -1
  136. package/esm/connectors/ai-connector.d.mts +1 -3
  137. package/esm/connectors/ai-connector.d.mts.map +1 -1
  138. package/esm/connectors/ai-connector.mjs +2 -2
  139. package/esm/connectors/ai-connector.mjs.map +1 -1
  140. package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
  141. package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
  142. package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
  143. package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
  144. package/esm/connectors/assert-unique-connector-names.mjs +2 -1
  145. package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
  146. package/esm/connectors/base-connector.d.mts +1 -3
  147. package/esm/connectors/base-connector.d.mts.map +1 -1
  148. package/esm/connectors/cache-connector.d.mts +1 -3
  149. package/esm/connectors/cache-connector.d.mts.map +1 -1
  150. package/esm/connectors/cache-connector.mjs +3 -3
  151. package/esm/connectors/cache-connector.mjs.map +1 -1
  152. package/esm/connectors/connectors-manager.d.mts +2 -4
  153. package/esm/connectors/connectors-manager.d.mts.map +1 -1
  154. package/esm/connectors/connectors-manager.mjs +2 -2
  155. package/esm/connectors/connectors-manager.mjs.map +1 -1
  156. package/esm/connectors/database-connector.d.mts +1 -3
  157. package/esm/connectors/database-connector.d.mts.map +1 -1
  158. package/esm/connectors/database-connector.mjs +2 -2
  159. package/esm/connectors/database-connector.mjs.map +1 -1
  160. package/esm/connectors/describe-server-address.mjs +4 -4
  161. package/esm/connectors/describe-server-address.mjs.map +1 -1
  162. package/esm/connectors/herald-connector.d.mts +1 -3
  163. package/esm/connectors/herald-connector.d.mts.map +1 -1
  164. package/esm/connectors/herald-connector.mjs +2 -2
  165. package/esm/connectors/herald-connector.mjs.map +1 -1
  166. package/esm/connectors/http-connector.d.mts +1 -3
  167. package/esm/connectors/http-connector.d.mts.map +1 -1
  168. package/esm/connectors/http-connector.mjs +8 -7
  169. package/esm/connectors/http-connector.mjs.map +1 -1
  170. package/esm/connectors/index.d.mts +2 -1
  171. package/esm/connectors/index.mjs +1 -1
  172. package/esm/connectors/logger-connector.d.mts +1 -3
  173. package/esm/connectors/logger-connector.d.mts.map +1 -1
  174. package/esm/connectors/logger-connector.mjs +2 -2
  175. package/esm/connectors/logger-connector.mjs.map +1 -1
  176. package/esm/connectors/mail-connector.d.mts +1 -3
  177. package/esm/connectors/mail-connector.d.mts.map +1 -1
  178. package/esm/connectors/mail-connector.mjs +2 -2
  179. package/esm/connectors/mail-connector.mjs.map +1 -1
  180. package/esm/connectors/notifications-connector.d.mts +1 -3
  181. package/esm/connectors/notifications-connector.d.mts.map +1 -1
  182. package/esm/connectors/notifications-connector.mjs +2 -2
  183. package/esm/connectors/notifications-connector.mjs.map +1 -1
  184. package/esm/connectors/register-configured-connectors.d.mts +2 -4
  185. package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
  186. package/esm/connectors/socket-connector.d.mts +1 -3
  187. package/esm/connectors/socket-connector.d.mts.map +1 -1
  188. package/esm/connectors/socket-connector.mjs +12 -10
  189. package/esm/connectors/socket-connector.mjs.map +1 -1
  190. package/esm/connectors/storage.connector.d.mts +1 -3
  191. package/esm/connectors/storage.connector.d.mts.map +1 -1
  192. package/esm/connectors/storage.connector.mjs +2 -2
  193. package/esm/connectors/storage.connector.mjs.map +1 -1
  194. package/esm/connectors/types.d.mts +17 -14
  195. package/esm/connectors/types.d.mts.map +1 -1
  196. package/esm/container/container-instance-registry.mjs.map +1 -1
  197. package/esm/container/development-app-modules.d.mts +7 -5
  198. package/esm/container/development-app-modules.d.mts.map +1 -1
  199. package/esm/container/development-model-modules.d.mts +6 -5
  200. package/esm/container/development-model-modules.d.mts.map +1 -1
  201. package/esm/container/index.d.mts +4 -4
  202. package/esm/container/index.d.mts.map +1 -1
  203. package/esm/database/index.d.mts +3 -1
  204. package/esm/database/index.mjs +1 -1
  205. package/esm/database/migrate-action.mjs +1 -1
  206. package/esm/database/models/database-log/database-log.d.mts +2 -3
  207. package/esm/database/models/database-log/database-log.d.mts.map +1 -1
  208. package/esm/database/models/database-log/index.d.mts +2 -1
  209. package/esm/database/models/database-log/index.mjs +1 -1
  210. package/esm/database/seed-command-action.mjs +1 -1
  211. package/esm/database/seeds/seeder.d.mts +2 -4
  212. package/esm/database/seeds/seeder.d.mts.map +1 -1
  213. package/esm/database/seeds/seeder.errors.d.mts +2 -3
  214. package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
  215. package/esm/database/seeds/seeders.manager.mjs +2 -1
  216. package/esm/database/seeds/seeders.manager.mjs.map +1 -1
  217. package/esm/database/seeds/types.d.mts +7 -8
  218. package/esm/database/seeds/types.d.mts.map +1 -1
  219. package/esm/database/utils.d.mts +4 -5
  220. package/esm/database/utils.d.mts.map +1 -1
  221. package/esm/dev-server/app-module-registry.mjs +1 -1
  222. package/esm/dev-server/create-worker.mjs +5 -3
  223. package/esm/dev-server/create-worker.mjs.map +1 -1
  224. package/esm/dev-server/dependency-graph.d.mts +1 -3
  225. package/esm/dev-server/dependency-graph.d.mts.map +1 -1
  226. package/esm/dev-server/dependency-graph.mjs +1 -1
  227. package/esm/dev-server/dependency-graph.mjs.map +1 -1
  228. package/esm/dev-server/extract-translation-keys.mjs +16 -17
  229. package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
  230. package/esm/dev-server/file-manager.d.mts +3 -7
  231. package/esm/dev-server/file-manager.d.mts.map +1 -1
  232. package/esm/dev-server/file-operations.d.mts +1 -3
  233. package/esm/dev-server/file-operations.d.mts.map +1 -1
  234. package/esm/dev-server/files-watcher.mjs +12 -11
  235. package/esm/dev-server/files-watcher.mjs.map +1 -1
  236. package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
  237. package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
  238. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +5 -5
  239. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
  240. package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
  241. package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
  242. package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -0
  243. package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
  244. package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
  245. package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
  246. package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
  247. package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
  248. package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
  249. package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
  250. package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
  251. package/esm/dev-server/loader/hook-thread.d.mts +4 -8
  252. package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
  253. package/esm/dev-server/loader/load-hook.d.mts +10 -6
  254. package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
  255. package/esm/dev-server/loader/load-hook.mjs +4 -3
  256. package/esm/dev-server/loader/load-hook.mjs.map +1 -1
  257. package/esm/dev-server/loader/own-resolver.mjs +1 -1
  258. package/esm/dev-server/loader/register-loader.mjs +3 -2
  259. package/esm/dev-server/loader/register-loader.mjs.map +1 -1
  260. package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
  261. package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
  262. package/esm/dev-server/loader/resolve-hook.mjs +2 -1
  263. package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
  264. package/esm/dev-server/loader/transpile-cache.mjs +2 -1
  265. package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
  266. package/esm/dev-server/manifest-manager.d.mts +1 -3
  267. package/esm/dev-server/manifest-manager.d.mts.map +1 -1
  268. package/esm/dev-server/model-module-registry.mjs +3 -3
  269. package/esm/dev-server/model-module-registry.mjs.map +1 -1
  270. package/esm/dev-server/model-resource-typings.mjs +40 -47
  271. package/esm/dev-server/model-resource-typings.mjs.map +1 -1
  272. package/esm/dev-server/module-loader.mjs +2 -2
  273. package/esm/dev-server/module-loader.mjs.map +1 -1
  274. package/esm/dev-server/package-json-manager.mjs +1 -1
  275. package/esm/dev-server/parse-imports.mjs +6 -38
  276. package/esm/dev-server/parse-imports.mjs.map +1 -1
  277. package/esm/dev-server/read-config-ast.mjs +3 -33
  278. package/esm/dev-server/read-config-ast.mjs.map +1 -1
  279. package/esm/dev-server/ready-block.mjs +1 -1
  280. package/esm/dev-server/shortcuts.mjs +1 -1
  281. package/esm/dev-server/special-files-collector.d.mts +2 -4
  282. package/esm/dev-server/special-files-collector.d.mts.map +1 -1
  283. package/esm/dev-server/supervisor.mjs +1 -1
  284. package/esm/dev-server/tsconfig-manager.mjs +3 -3
  285. package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
  286. package/esm/dev-server/type-generator.mjs +28 -35
  287. package/esm/dev-server/type-generator.mjs.map +1 -1
  288. package/esm/dev-server/types.d.mts +3 -4
  289. package/esm/dev-server/types.d.mts.map +1 -1
  290. package/esm/dev-server/update-check-cache.mjs +2 -2
  291. package/esm/dev-server/update-check-cache.mjs.map +1 -1
  292. package/esm/encryption/encrypt.d.mts +2 -3
  293. package/esm/encryption/encrypt.d.mts.map +1 -1
  294. package/esm/encryption/hash.d.mts +1 -2
  295. package/esm/encryption/hash.d.mts.map +1 -1
  296. package/esm/encryption/index.mjs +1 -1
  297. package/esm/encryption/password.d.mts +2 -3
  298. package/esm/encryption/password.d.mts.map +1 -1
  299. package/esm/encryption/types.d.mts +2 -3
  300. package/esm/encryption/types.d.mts.map +1 -1
  301. package/esm/errors/error-codes.d.mts +29 -22
  302. package/esm/errors/error-codes.d.mts.map +1 -1
  303. package/esm/errors/warlock-error.d.mts +1 -3
  304. package/esm/errors/warlock-error.d.mts.map +1 -1
  305. package/esm/generations/add-command.action.mjs +3 -2
  306. package/esm/generations/add-command.action.mjs.map +1 -1
  307. package/esm/generations/features/bull-board.feature.mjs +2 -1
  308. package/esm/generations/features/bull-board.feature.mjs.map +1 -1
  309. package/esm/generations/features/notifications.feature.mjs +2 -1
  310. package/esm/generations/features/notifications.feature.mjs.map +1 -1
  311. package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
  312. package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
  313. package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
  314. package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
  315. package/esm/generations/features/sitemap.feature.mjs +2 -1
  316. package/esm/generations/features/sitemap.feature.mjs.map +1 -1
  317. package/esm/generations/generation-fs.mjs +1 -1
  318. package/esm/generations/generation-run.mjs +1 -1
  319. package/esm/generations/stubs.mjs +1 -1
  320. package/esm/generations/stubs.mjs.map +1 -1
  321. package/esm/http/boot-port-preflight.d.mts +4 -5
  322. package/esm/http/boot-port-preflight.d.mts.map +1 -1
  323. package/esm/http/boot-port-preflight.mjs +2 -2
  324. package/esm/http/boot-port-preflight.mjs.map +1 -1
  325. package/esm/http/bounded-stream-queue.d.mts +4 -4
  326. package/esm/http/bounded-stream-queue.d.mts.map +1 -1
  327. package/esm/http/bounded-stream-queue.mjs +1 -1
  328. package/esm/http/bounded-stream-queue.mjs.map +1 -1
  329. package/esm/http/build-cors-options.mjs +2 -2
  330. package/esm/http/build-cors-options.mjs.map +1 -1
  331. package/esm/http/build-rate-limit-options.d.mts +2 -3
  332. package/esm/http/build-rate-limit-options.d.mts.map +1 -1
  333. package/esm/http/build-rate-limit-options.mjs +1 -1
  334. package/esm/http/build-rate-limit-options.mjs.map +1 -1
  335. package/esm/http/conditional-request.d.mts +14 -13
  336. package/esm/http/conditional-request.d.mts.map +1 -1
  337. package/esm/http/config.d.mts +2 -4
  338. package/esm/http/config.d.mts.map +1 -1
  339. package/esm/http/config.mjs +2 -2
  340. package/esm/http/config.mjs.map +1 -1
  341. package/esm/http/context/request-context.d.mts +6 -7
  342. package/esm/http/context/request-context.d.mts.map +1 -1
  343. package/esm/http/context/request-memo.d.mts +1 -2
  344. package/esm/http/context/request-memo.d.mts.map +1 -1
  345. package/esm/http/createHttpApplication.d.mts +2 -3
  346. package/esm/http/createHttpApplication.d.mts.map +1 -1
  347. package/esm/http/createHttpApplication.mjs +2 -2
  348. package/esm/http/createHttpApplication.mjs.map +1 -1
  349. package/esm/http/csp.d.mts +10 -12
  350. package/esm/http/csp.d.mts.map +1 -1
  351. package/esm/http/csp.mjs +2 -2
  352. package/esm/http/csp.mjs.map +1 -1
  353. package/esm/http/csrf-default-guard.d.mts +2 -4
  354. package/esm/http/csrf-default-guard.d.mts.map +1 -1
  355. package/esm/http/csrf-default-guard.mjs +1 -1
  356. package/esm/http/csrf-default-guard.mjs.map +1 -1
  357. package/esm/http/csrf-origin-policy.d.mts +7 -9
  358. package/esm/http/csrf-origin-policy.d.mts.map +1 -1
  359. package/esm/http/csrf-origin-policy.mjs +2 -2
  360. package/esm/http/csrf-origin-policy.mjs.map +1 -1
  361. package/esm/http/database/RequestLog.d.mts +2 -3
  362. package/esm/http/database/RequestLog.d.mts.map +1 -1
  363. package/esm/http/error-codes.d.mts +1 -2
  364. package/esm/http/error-codes.d.mts.map +1 -1
  365. package/esm/http/error-mapper.d.mts +2 -4
  366. package/esm/http/error-mapper.d.mts.map +1 -1
  367. package/esm/http/error-mapper.mjs +2 -2
  368. package/esm/http/error-mapper.mjs.map +1 -1
  369. package/esm/http/errors/errors.d.mts +28 -29
  370. package/esm/http/errors/errors.d.mts.map +1 -1
  371. package/esm/http/escape-header-value.d.mts +1 -2
  372. package/esm/http/escape-header-value.d.mts.map +1 -1
  373. package/esm/http/events.d.mts +2 -4
  374. package/esm/http/events.d.mts.map +1 -1
  375. package/esm/http/health.d.mts +4 -4
  376. package/esm/http/health.d.mts.map +1 -1
  377. package/esm/http/index.d.mts +4 -1
  378. package/esm/http/index.mjs +1 -1
  379. package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
  380. package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
  381. package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
  382. package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
  383. package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
  384. package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
  385. package/esm/http/middleware/idempotency.middleware.mjs +6 -6
  386. package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
  387. package/esm/http/middleware/index.d.mts +3 -1
  388. package/esm/http/middleware/index.mjs +1 -1
  389. package/esm/http/middleware/inject-request-context.d.mts +2 -4
  390. package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
  391. package/esm/http/middleware/inject-request-context.mjs +3 -3
  392. package/esm/http/middleware/inject-request-context.mjs.map +1 -1
  393. package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
  394. package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
  395. package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
  396. package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
  397. package/esm/http/middleware/maintenance.middleware.mjs +4 -4
  398. package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
  399. package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
  400. package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
  401. package/esm/http/middleware/middleware-list.d.mts +1 -3
  402. package/esm/http/middleware/middleware-list.d.mts.map +1 -1
  403. package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
  404. package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
  405. package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
  406. package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
  407. package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
  408. package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
  409. package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
  410. package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
  411. package/esm/http/middleware/utils/index.d.mts +2 -1
  412. package/esm/http/middleware/utils/parse-size.d.mts +1 -2
  413. package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
  414. package/esm/http/middleware/utils/parse-size.mjs +2 -2
  415. package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
  416. package/esm/http/plugins.d.mts +2 -4
  417. package/esm/http/plugins.d.mts.map +1 -1
  418. package/esm/http/plugins.mjs +10 -10
  419. package/esm/http/plugins.mjs.map +1 -1
  420. package/esm/http/port-preflight.d.mts +3 -4
  421. package/esm/http/port-preflight.d.mts.map +1 -1
  422. package/esm/http/rate-limit-cache-store.mjs +4 -3
  423. package/esm/http/rate-limit-cache-store.mjs.map +1 -1
  424. package/esm/http/ready-report.d.mts +15 -10
  425. package/esm/http/ready-report.d.mts.map +1 -1
  426. package/esm/http/request-controller.d.mts +1 -3
  427. package/esm/http/request-controller.d.mts.map +1 -1
  428. package/esm/http/request-log-snapshot.d.mts +20 -16
  429. package/esm/http/request-log-snapshot.d.mts.map +1 -1
  430. package/esm/http/request-log-snapshot.mjs +3 -3
  431. package/esm/http/request-log-snapshot.mjs.map +1 -1
  432. package/esm/http/request.d.mts +8 -7
  433. package/esm/http/request.d.mts.map +1 -1
  434. package/esm/http/request.mjs +8 -7
  435. package/esm/http/request.mjs.map +1 -1
  436. package/esm/http/response.d.mts +12 -11
  437. package/esm/http/response.d.mts.map +1 -1
  438. package/esm/http/response.mjs +7 -7
  439. package/esm/http/response.mjs.map +1 -1
  440. package/esm/http/safe-redirect.d.mts +3 -4
  441. package/esm/http/safe-redirect.d.mts.map +1 -1
  442. package/esm/http/serialized.d.mts +12 -13
  443. package/esm/http/serialized.d.mts.map +1 -1
  444. package/esm/http/server-rebuilt.d.mts +3 -5
  445. package/esm/http/server-rebuilt.d.mts.map +1 -1
  446. package/esm/http/server.d.mts +9 -9
  447. package/esm/http/server.d.mts.map +1 -1
  448. package/esm/http/server.mjs +4 -4
  449. package/esm/http/server.mjs.map +1 -1
  450. package/esm/http/stream-react-response.d.mts +7 -7
  451. package/esm/http/stream-react-response.d.mts.map +1 -1
  452. package/esm/http/tracing/index.mjs +1 -1
  453. package/esm/http/tracing/trace-id.d.mts +2 -3
  454. package/esm/http/tracing/trace-id.d.mts.map +1 -1
  455. package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
  456. package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
  457. package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
  458. package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
  459. package/esm/http/tracing/tracing.type.d.mts +11 -9
  460. package/esm/http/tracing/tracing.type.d.mts.map +1 -1
  461. package/esm/http/types.d.mts +49 -43
  462. package/esm/http/types.d.mts.map +1 -1
  463. package/esm/http/uploaded-file.d.mts +6 -5
  464. package/esm/http/uploaded-file.d.mts.map +1 -1
  465. package/esm/http/uploads/generate-image-variants.d.mts +6 -6
  466. package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
  467. package/esm/http/uploads/generate-image-variants.mjs +1 -1
  468. package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
  469. package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
  470. package/esm/http/uploads/image-variant-cache.mjs +8 -8
  471. package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
  472. package/esm/http/uploads/image-variant-types.d.mts +7 -9
  473. package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
  474. package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
  475. package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
  476. package/esm/http/uploads/index.d.mts +2 -1
  477. package/esm/http/uploads/index.mjs +1 -1
  478. package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
  479. package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
  480. package/esm/http/uploads/purge-image-variants.d.mts +2 -4
  481. package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
  482. package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
  483. package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
  484. package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
  485. package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
  486. package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
  487. package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
  488. package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
  489. package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
  490. package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
  491. package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
  492. package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
  493. package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
  494. package/esm/http/uploads/variant-cache-key.mjs +1 -1
  495. package/esm/http/uploads-config.d.mts +2 -4
  496. package/esm/http/uploads-config.d.mts.map +1 -1
  497. package/esm/http/uploads-types.d.mts +19 -17
  498. package/esm/http/uploads-types.d.mts.map +1 -1
  499. package/esm/http/xmlable.d.mts +1 -2
  500. package/esm/http/xmlable.d.mts.map +1 -1
  501. package/esm/image/image.d.mts +6 -7
  502. package/esm/image/image.d.mts.map +1 -1
  503. package/esm/image/image.mjs.map +1 -1
  504. package/esm/image/index.d.mts +2 -1
  505. package/esm/image/index.mjs +1 -1
  506. package/esm/index.d.mts +21 -0
  507. package/esm/loader/app-module-importer.d.mts +1 -2
  508. package/esm/loader/app-module-importer.d.mts.map +1 -1
  509. package/esm/localization/index.mjs +1 -1
  510. package/esm/localization/parse-locale-dictionary.d.mts +4 -5
  511. package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
  512. package/esm/localization/parse-locale-dictionary.mjs +1 -1
  513. package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
  514. package/esm/localization/register-locale-dictionary.d.mts +3 -4
  515. package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
  516. package/esm/localization/register-locale-dictionary.mjs +2 -2
  517. package/esm/localization/register-locale-dictionary.mjs.map +1 -1
  518. package/esm/logger/fatal-visibility.d.mts +1 -2
  519. package/esm/logger/fatal-visibility.d.mts.map +1 -1
  520. package/esm/logger/index.d.mts +2 -1
  521. package/esm/logger/index.mjs +1 -1
  522. package/esm/logger/logger.d.mts +1 -3
  523. package/esm/logger/logger.d.mts.map +1 -1
  524. package/esm/logger/types.d.mts +2 -3
  525. package/esm/logger/types.d.mts.map +1 -1
  526. package/esm/mail/config.d.mts +12 -14
  527. package/esm/mail/config.d.mts.map +1 -1
  528. package/esm/mail/events.d.mts +4 -6
  529. package/esm/mail/events.d.mts.map +1 -1
  530. package/esm/mail/index.d.mts +2 -1
  531. package/esm/mail/index.mjs +1 -1
  532. package/esm/mail/mail.d.mts +1 -3
  533. package/esm/mail/mail.d.mts.map +1 -1
  534. package/esm/mail/mailer-pool.d.mts +5 -7
  535. package/esm/mail/mailer-pool.d.mts.map +1 -1
  536. package/esm/mail/react-mail.d.mts +1 -3
  537. package/esm/mail/react-mail.d.mts.map +1 -1
  538. package/esm/mail/send-mail.d.mts +1 -3
  539. package/esm/mail/send-mail.d.mts.map +1 -1
  540. package/esm/mail/send-mail.mjs +2 -1
  541. package/esm/mail/send-mail.mjs.map +1 -1
  542. package/esm/mail/test-mailbox.d.mts +11 -13
  543. package/esm/mail/test-mailbox.d.mts.map +1 -1
  544. package/esm/mail/types.d.mts +17 -18
  545. package/esm/mail/types.d.mts.map +1 -1
  546. package/esm/manifest/manifest-manager.mjs +1 -1
  547. package/esm/openapi/build-openapi-document.d.mts +2 -4
  548. package/esm/openapi/build-openapi-document.d.mts.map +1 -1
  549. package/esm/openapi/cast-schema.mjs +1 -1
  550. package/esm/openapi/development-openapi-provider.d.mts +5 -6
  551. package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
  552. package/esm/openapi/index.d.mts +3 -1
  553. package/esm/openapi/index.mjs +1 -1
  554. package/esm/openapi/openapi-child-output.mjs +2 -2
  555. package/esm/openapi/openapi-child-output.mjs.map +1 -1
  556. package/esm/openapi/postman/build-request-url.mjs +1 -1
  557. package/esm/openapi/postman/example-from-schema.d.mts +1 -3
  558. package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
  559. package/esm/openapi/postman/index.d.mts +2 -1
  560. package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
  561. package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
  562. package/esm/openapi/postman/postman-types.d.mts +19 -18
  563. package/esm/openapi/postman/postman-types.d.mts.map +1 -1
  564. package/esm/openapi/postman/schema-refs.d.mts +1 -3
  565. package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
  566. package/esm/openapi/postman/uuid-v5.mjs +1 -1
  567. package/esm/openapi/schema-registry.d.mts +1 -1
  568. package/esm/openapi/security.mjs +1 -1
  569. package/esm/openapi/types.d.mts +23 -21
  570. package/esm/openapi/types.d.mts.map +1 -1
  571. package/esm/production/assert-generated-imports.mjs +1 -1
  572. package/esm/production/build-contributions.mjs +1 -1
  573. package/esm/production/bundle-framework-dependencies.mjs +1 -1
  574. package/esm/production/dist-build-manifest.mjs +1 -1
  575. package/esm/production/esbuild-plugins.mjs.map +1 -1
  576. package/esm/production/esbuild-preflight.mjs +1 -1
  577. package/esm/production/production-builder.mjs +2 -1
  578. package/esm/production/production-builder.mjs.map +1 -1
  579. package/esm/production/production-supervisor.mjs +1 -1
  580. package/esm/production/registration-child-runner.mjs +4 -3
  581. package/esm/production/registration-child-runner.mjs.map +1 -1
  582. package/esm/production/resolve-build-config.d.mts +4 -4
  583. package/esm/production/resolve-build-config.d.mts.map +1 -1
  584. package/esm/production/resolve-build-config.mjs +1 -1
  585. package/esm/production/route-registration-child.d.mts +1 -1
  586. package/esm/production/route-registration-child.mjs +8 -7
  587. package/esm/production/route-registration-child.mjs.map +1 -1
  588. package/esm/production/tsconfig-path-aliases.mjs +1 -1
  589. package/esm/react/index.d.mts +1 -3
  590. package/esm/react/index.d.mts.map +1 -1
  591. package/esm/react/index.mjs.map +1 -1
  592. package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
  593. package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
  594. package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
  595. package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
  596. package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
  597. package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
  598. package/esm/repositories/adapters/cascade/index.d.mts +2 -1
  599. package/esm/repositories/adapters/cascade/index.mjs +1 -1
  600. package/esm/repositories/contracts/index.d.mts +2 -1
  601. package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
  602. package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
  603. package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
  604. package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
  605. package/esm/repositories/contracts/types.d.mts +23 -25
  606. package/esm/repositories/contracts/types.d.mts.map +1 -1
  607. package/esm/repositories/index.d.mts +4 -1
  608. package/esm/repositories/index.mjs +1 -1
  609. package/esm/repositories/repository.manager.d.mts +2 -3
  610. package/esm/repositories/repository.manager.d.mts.map +1 -1
  611. package/esm/repositories/repository.manager.mjs +2 -2
  612. package/esm/repositories/repository.manager.mjs.map +1 -1
  613. package/esm/resource/define-resource.d.mts +3 -5
  614. package/esm/resource/define-resource.d.mts.map +1 -1
  615. package/esm/resource/index.d.mts +2 -1
  616. package/esm/resource/index.mjs +1 -1
  617. package/esm/resource/nullable-resource.d.mts +5 -7
  618. package/esm/resource/nullable-resource.d.mts.map +1 -1
  619. package/esm/resource/register-resource.d.mts +1 -3
  620. package/esm/resource/register-resource.d.mts.map +1 -1
  621. package/esm/resource/resource-field-builder.d.mts +1 -3
  622. package/esm/resource/resource-field-builder.d.mts.map +1 -1
  623. package/esm/resource/resource.d.mts +3 -5
  624. package/esm/resource/resource.d.mts.map +1 -1
  625. package/esm/resource/resource.mjs +4 -2
  626. package/esm/resource/resource.mjs.map +1 -1
  627. package/esm/resource/types.d.mts +21 -21
  628. package/esm/resource/types.d.mts.map +1 -1
  629. package/esm/restful/index.d.mts +2 -1
  630. package/esm/restful/index.mjs +1 -1
  631. package/esm/restful/restful.d.mts +12 -32
  632. package/esm/restful/restful.d.mts.map +1 -1
  633. package/esm/router/index.d.mts +2 -1
  634. package/esm/router/index.mjs +1 -1
  635. package/esm/router/named-api-routes-with-responses.mjs +2 -1
  636. package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
  637. package/esm/router/normalize-request-path.d.mts +1 -2
  638. package/esm/router/normalize-request-path.d.mts.map +1 -1
  639. package/esm/router/normalize-route-path.d.mts +1 -2
  640. package/esm/router/normalize-route-path.d.mts.map +1 -1
  641. package/esm/router/positional-handler-diagnostics.d.mts +15 -13
  642. package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
  643. package/esm/router/resolve-route-rate-limit.mjs +3 -3
  644. package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
  645. package/esm/router/route-builder.d.mts +1 -3
  646. package/esm/router/route-builder.d.mts.map +1 -1
  647. package/esm/router/route-guard-names.mjs +1 -1
  648. package/esm/router/route-guard-names.mjs.map +1 -1
  649. package/esm/router/route-name-method-suffix.d.mts +2 -3
  650. package/esm/router/route-name-method-suffix.d.mts.map +1 -1
  651. package/esm/router/route-name-taken-error.d.mts +1 -3
  652. package/esm/router/route-name-taken-error.d.mts.map +1 -1
  653. package/esm/router/route-registry.d.mts +1 -3
  654. package/esm/router/route-registry.d.mts.map +1 -1
  655. package/esm/router/router.d.mts +2 -4
  656. package/esm/router/router.d.mts.map +1 -1
  657. package/esm/router/router.mjs +8 -6
  658. package/esm/router/router.mjs.map +1 -1
  659. package/esm/router/types.d.mts +25 -26
  660. package/esm/router/types.d.mts.map +1 -1
  661. package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
  662. package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
  663. package/esm/socket/index.d.mts +2 -1
  664. package/esm/socket/index.mjs +1 -1
  665. package/esm/socket/types.d.mts +2 -4
  666. package/esm/socket/types.d.mts.map +1 -1
  667. package/esm/socket/utils.d.mts +1 -3
  668. package/esm/socket/utils.d.mts.map +1 -1
  669. package/esm/storage/config.d.mts +4 -6
  670. package/esm/storage/config.d.mts.map +1 -1
  671. package/esm/storage/context/storage-driver-context.d.mts +3 -4
  672. package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
  673. package/esm/storage/drivers/cloud-driver.d.mts +2 -4
  674. package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
  675. package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
  676. package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
  677. package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
  678. package/esm/storage/drivers/local-driver.d.mts +2 -3
  679. package/esm/storage/drivers/local-driver.d.mts.map +1 -1
  680. package/esm/storage/drivers/local-driver.mjs +8 -3
  681. package/esm/storage/drivers/local-driver.mjs.map +1 -1
  682. package/esm/storage/drivers/r2-driver.d.mts +1 -3
  683. package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
  684. package/esm/storage/drivers/s3-driver.d.mts +1 -3
  685. package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
  686. package/esm/storage/index.d.mts +2 -1
  687. package/esm/storage/index.mjs +1 -1
  688. package/esm/storage/local-disk-roots.mjs +2 -2
  689. package/esm/storage/local-disk-roots.mjs.map +1 -1
  690. package/esm/storage/scoped-storage.d.mts +2 -3
  691. package/esm/storage/scoped-storage.d.mts.map +1 -1
  692. package/esm/storage/storage-file.d.mts +1 -3
  693. package/esm/storage/storage-file.d.mts.map +1 -1
  694. package/esm/storage/storage.d.mts +3 -4
  695. package/esm/storage/storage.d.mts.map +1 -1
  696. package/esm/storage/types.d.mts +36 -36
  697. package/esm/storage/types.d.mts.map +1 -1
  698. package/esm/storage/utils/classify-ip-address.d.mts +1 -2
  699. package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
  700. package/esm/storage/utils/contain-path.d.mts +1 -2
  701. package/esm/storage/utils/contain-path.d.mts.map +1 -1
  702. package/esm/storage/utils/mime.d.mts +2 -3
  703. package/esm/storage/utils/mime.d.mts.map +1 -1
  704. package/esm/storage/utils/safe-fetch.d.mts +6 -6
  705. package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
  706. package/esm/storage/utils/safe-fetch.mjs +3 -3
  707. package/esm/storage/utils/safe-fetch.mjs.map +1 -1
  708. package/esm/storage/utils/storage-capability-error.d.mts +1 -3
  709. package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
  710. package/esm/storage/utils/storage-error.d.mts +2 -3
  711. package/esm/storage/utils/storage-error.d.mts.map +1 -1
  712. package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
  713. package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
  714. package/esm/tests/authenticated-test-client.d.mts +5 -6
  715. package/esm/tests/authenticated-test-client.d.mts.map +1 -1
  716. package/esm/tests/factories.d.mts +38 -23
  717. package/esm/tests/factories.d.mts.map +1 -1
  718. package/esm/tests/fakes/cache-fake.d.mts +14 -9
  719. package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
  720. package/esm/tests/fakes/clock-fake.d.mts +13 -8
  721. package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
  722. package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
  723. package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
  724. package/esm/tests/fakes/ids-fake.d.mts +5 -4
  725. package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
  726. package/esm/tests/fakes/index.d.mts +2 -1
  727. package/esm/tests/fakes/index.mjs +1 -1
  728. package/esm/tests/fakes/mail-fake.d.mts +21 -13
  729. package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
  730. package/esm/tests/fakes/queue-fake.d.mts +21 -13
  731. package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
  732. package/esm/tests/fakes/storage-fake.d.mts +12 -8
  733. package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
  734. package/esm/tests/fakes/storage-fake.mjs +1 -1
  735. package/esm/tests/fakes/test-fakes.d.mts +8 -9
  736. package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
  737. package/esm/tests/fakes/test-fakes.mjs +1 -1
  738. package/esm/tests/fakes/test-fakes.mjs.map +1 -1
  739. package/esm/tests/index.d.mts +1 -0
  740. package/esm/tests/snapshot-response.d.mts +4 -5
  741. package/esm/tests/snapshot-response.d.mts.map +1 -1
  742. package/esm/tests/start-http-development-server.d.mts +4 -6
  743. package/esm/tests/start-http-development-server.d.mts.map +1 -1
  744. package/esm/tests/start-http-development-server.mjs +5 -5
  745. package/esm/tests/start-http-development-server.mjs.map +1 -1
  746. package/esm/tests/test-connectors-selection.d.mts +2 -2
  747. package/esm/tests/test-connectors-selection.d.mts.map +1 -1
  748. package/esm/tests/test-connectors-selection.mjs +1 -1
  749. package/esm/tests/test-helpers.d.mts +11 -12
  750. package/esm/tests/test-helpers.d.mts.map +1 -1
  751. package/esm/tests/test-http-server.d.mts +14 -10
  752. package/esm/tests/test-http-server.d.mts.map +1 -1
  753. package/esm/tests/test-lifecycle-state.mjs +1 -1
  754. package/esm/tests/vitest-setup.d.mts +6 -7
  755. package/esm/tests/vitest-setup.d.mts.map +1 -1
  756. package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
  757. package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
  758. package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
  759. package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
  760. package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
  761. package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
  762. package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
  763. package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
  764. package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
  765. package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
  766. package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
  767. package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
  768. package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
  769. package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
  770. package/esm/tooling/board/board-message.d.mts +4 -6
  771. package/esm/tooling/board/board-message.d.mts.map +1 -1
  772. package/esm/tooling/board/board.d.mts +50 -38
  773. package/esm/tooling/board/board.d.mts.map +1 -1
  774. package/esm/tooling/board/board.mjs +4 -3
  775. package/esm/tooling/board/board.mjs.map +1 -1
  776. package/esm/tooling/board/board.types.d.mts +32 -23
  777. package/esm/tooling/board/board.types.d.mts.map +1 -1
  778. package/esm/tooling/check/changed-files.d.mts +4 -6
  779. package/esm/tooling/check/changed-files.d.mts.map +1 -1
  780. package/esm/tooling/check/changed-files.mjs +2 -2
  781. package/esm/tooling/check/changed-files.mjs.map +1 -1
  782. package/esm/tooling/check/check-report.types.d.mts +22 -17
  783. package/esm/tooling/check/check-report.types.d.mts.map +1 -1
  784. package/esm/tooling/check/code-style-conventions.mjs +25 -25
  785. package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
  786. package/esm/tooling/check/conventions-step.d.mts +4 -6
  787. package/esm/tooling/check/conventions-step.d.mts.map +1 -1
  788. package/esm/tooling/check/conventions-step.mjs +7 -18
  789. package/esm/tooling/check/conventions-step.mjs.map +1 -1
  790. package/esm/tooling/check/environment-step.d.mts +2 -4
  791. package/esm/tooling/check/environment-step.d.mts.map +1 -1
  792. package/esm/tooling/check/environment-step.mjs +1 -1
  793. package/esm/tooling/check/index.mjs +1 -1
  794. package/esm/tooling/check/lint-step.d.mts +4 -5
  795. package/esm/tooling/check/lint-step.d.mts.map +1 -1
  796. package/esm/tooling/check/lint-step.mjs +2 -1
  797. package/esm/tooling/check/lint-step.mjs.map +1 -1
  798. package/esm/tooling/check/request-input.mjs +15 -15
  799. package/esm/tooling/check/request-input.mjs.map +1 -1
  800. package/esm/tooling/check/run-check.d.mts +22 -14
  801. package/esm/tooling/check/run-check.d.mts.map +1 -1
  802. package/esm/tooling/check/run-tests.d.mts +22 -15
  803. package/esm/tooling/check/run-tests.d.mts.map +1 -1
  804. package/esm/tooling/check/security-conventions.mjs +133 -131
  805. package/esm/tooling/check/security-conventions.mjs.map +1 -1
  806. package/esm/tooling/check/source-ast.mjs +92 -132
  807. package/esm/tooling/check/source-ast.mjs.map +1 -1
  808. package/esm/tooling/check/tests-step.d.mts +7 -8
  809. package/esm/tooling/check/tests-step.d.mts.map +1 -1
  810. package/esm/tooling/check/tests-step.mjs +3 -3
  811. package/esm/tooling/check/tests-step.mjs.map +1 -1
  812. package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
  813. package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
  814. package/esm/tooling/devtools/devtools-client.d.mts +29 -20
  815. package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
  816. package/esm/tooling/generate/generation.d.mts +34 -22
  817. package/esm/tooling/generate/generation.d.mts.map +1 -1
  818. package/esm/tooling/generate/generation.mjs +9 -5
  819. package/esm/tooling/generate/generation.mjs.map +1 -1
  820. package/esm/tooling/generate/generator-spec.d.mts +9 -9
  821. package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
  822. package/esm/tooling/generate/index.mjs +1 -1
  823. package/esm/tooling/generate/project-files.mjs +3 -3
  824. package/esm/tooling/generate/project-files.mjs.map +1 -1
  825. package/esm/tooling/generate/run-cli.d.mts +14 -11
  826. package/esm/tooling/generate/run-cli.d.mts.map +1 -1
  827. package/esm/tooling/generate/run-cli.mjs +2 -2
  828. package/esm/tooling/generate/run-cli.mjs.map +1 -1
  829. package/esm/tooling/generate/unified-diff.d.mts +10 -7
  830. package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
  831. package/esm/tooling/index.d.mts +1 -0
  832. package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
  833. package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
  834. package/esm/tooling/inspect/collect-config.mjs +3 -3
  835. package/esm/tooling/inspect/collect-config.mjs.map +1 -1
  836. package/esm/tooling/inspect/collect-models.d.mts +4 -3
  837. package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
  838. package/esm/tooling/inspect/collect-models.mjs +1 -1
  839. package/esm/tooling/inspect/collect-packages.d.mts +1 -2
  840. package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
  841. package/esm/tooling/inspect/collect-pages.mjs +10 -10
  842. package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
  843. package/esm/tooling/inspect/collect-routes.mjs +1 -1
  844. package/esm/tooling/inspect/event-recorder.d.mts +7 -7
  845. package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
  846. package/esm/tooling/inspect/index.d.mts +2 -1
  847. package/esm/tooling/inspect/index.mjs +1 -1
  848. package/esm/tooling/inspect/inspect-app.d.mts +25 -16
  849. package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
  850. package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
  851. package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
  852. package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
  853. package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
  854. package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
  855. package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
  856. package/esm/tooling/mcp/db-schema.d.mts +10 -9
  857. package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
  858. package/esm/tooling/mcp/docs-search.d.mts +20 -15
  859. package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
  860. package/esm/tooling/mcp/index.mjs +1 -1
  861. package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
  862. package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
  863. package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
  864. package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
  865. package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
  866. package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
  867. package/esm/tooling/mcp/mcp-tools.mjs +3 -2
  868. package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
  869. package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
  870. package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
  871. package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
  872. package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
  873. package/esm/tooling/mcp/tool-input.d.mts +7 -7
  874. package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
  875. package/esm/tooling/problem.d.mts +27 -17
  876. package/esm/tooling/problem.d.mts.map +1 -1
  877. package/esm/tooling/syntax/ast.mjs +230 -0
  878. package/esm/tooling/syntax/ast.mjs.map +1 -0
  879. package/esm/tooling/syntax/imports.mjs +34 -0
  880. package/esm/tooling/syntax/imports.mjs.map +1 -0
  881. package/esm/tooling/trace/trace-report.types.d.mts +36 -22
  882. package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
  883. package/esm/tooling/trace/trace-request.d.mts +27 -20
  884. package/esm/tooling/trace/trace-request.d.mts.map +1 -1
  885. package/esm/tooling/trace/trace-request.mjs +2 -2
  886. package/esm/tooling/trace/trace-request.mjs.map +1 -1
  887. package/esm/tooling/typecheck/index.mjs +1 -1
  888. package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
  889. package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
  890. package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
  891. package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
  892. package/esm/tooling/typescript/compiler.d.mts +31 -0
  893. package/esm/tooling/typescript/compiler.d.mts.map +1 -0
  894. package/esm/tooling/typescript/compiler.mjs +120 -0
  895. package/esm/tooling/typescript/compiler.mjs.map +1 -0
  896. package/esm/updater/update-warlock-packages.mjs +3 -2
  897. package/esm/updater/update-warlock-packages.mjs.map +1 -1
  898. package/esm/upgrade/codemods/index.mjs +1 -1
  899. package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
  900. package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
  901. package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
  902. package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
  903. package/esm/upgrade/diff.mjs +1 -1
  904. package/esm/upgrade/diff.mjs.map +1 -1
  905. package/esm/upgrade/load-ts-morph.mjs +3 -2
  906. package/esm/upgrade/load-ts-morph.mjs.map +1 -1
  907. package/esm/upgrade/run-upgrade.mjs +1 -1
  908. package/esm/use-cases/index.d.mts +2 -1
  909. package/esm/use-cases/index.mjs +1 -1
  910. package/esm/use-cases/types.d.mts +116 -63
  911. package/esm/use-cases/types.d.mts.map +1 -1
  912. package/esm/use-cases/use-case-broadcast.d.mts +1 -3
  913. package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
  914. package/esm/use-cases/use-case-events.d.mts +3 -5
  915. package/esm/use-cases/use-case-events.d.mts.map +1 -1
  916. package/esm/use-cases/use-case-pipeline.d.mts +6 -6
  917. package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
  918. package/esm/use-cases/use-case.d.mts +2 -4
  919. package/esm/use-cases/use-case.d.mts.map +1 -1
  920. package/esm/use-cases/use-case.errors.d.mts +1 -3
  921. package/esm/use-cases/use-case.errors.d.mts.map +1 -1
  922. package/esm/use-cases/use-cases-registry.d.mts +8 -10
  923. package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
  924. package/esm/utils/app-log.d.mts +1 -2
  925. package/esm/utils/app-log.d.mts.map +1 -1
  926. package/esm/utils/clock.d.mts +8 -6
  927. package/esm/utils/clock.d.mts.map +1 -1
  928. package/esm/utils/database-log.d.mts +3 -4
  929. package/esm/utils/database-log.d.mts.map +1 -1
  930. package/esm/utils/environment.d.mts +4 -5
  931. package/esm/utils/environment.d.mts.map +1 -1
  932. package/esm/utils/framework-vesion.mjs.map +1 -1
  933. package/esm/utils/get-localized.d.mts +2 -3
  934. package/esm/utils/get-localized.d.mts.map +1 -1
  935. package/esm/utils/ids.d.mts +9 -6
  936. package/esm/utils/ids.d.mts.map +1 -1
  937. package/esm/utils/index.d.mts +2 -1
  938. package/esm/utils/index.mjs +1 -1
  939. package/esm/utils/normalized-path.d.mts +1 -2
  940. package/esm/utils/normalized-path.d.mts.map +1 -1
  941. package/esm/utils/npm-registry.d.mts +1 -2
  942. package/esm/utils/npm-registry.d.mts.map +1 -1
  943. package/esm/utils/paths.d.mts +13 -14
  944. package/esm/utils/paths.d.mts.map +1 -1
  945. package/esm/utils/paths.mjs +2 -2
  946. package/esm/utils/paths.mjs.map +1 -1
  947. package/esm/utils/promise-all-object.d.mts +1 -2
  948. package/esm/utils/promise-all-object.d.mts.map +1 -1
  949. package/esm/utils/queue.d.mts +1 -2
  950. package/esm/utils/queue.d.mts.map +1 -1
  951. package/esm/utils/runtime.d.mts +11 -10
  952. package/esm/utils/runtime.d.mts.map +1 -1
  953. package/esm/utils/sleep.d.mts +1 -2
  954. package/esm/utils/sleep.d.mts.map +1 -1
  955. package/esm/utils/sluggable.d.mts +1 -3
  956. package/esm/utils/sluggable.d.mts.map +1 -1
  957. package/esm/utils/to-json.d.mts +1 -2
  958. package/esm/utils/to-json.d.mts.map +1 -1
  959. package/esm/utils/types.d.mts +1 -2
  960. package/esm/utils/types.d.mts.map +1 -1
  961. package/esm/utils/urls.d.mts +5 -6
  962. package/esm/utils/urls.d.mts.map +1 -1
  963. package/esm/utils/version-compare.d.mts +1 -2
  964. package/esm/utils/version-compare.d.mts.map +1 -1
  965. package/esm/validation/database/exists-except-current-id.d.mts +2 -3
  966. package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
  967. package/esm/validation/database/exists-except-current-user.d.mts +2 -3
  968. package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
  969. package/esm/validation/database/index.d.mts +2 -1
  970. package/esm/validation/database/index.mjs +1 -1
  971. package/esm/validation/database/types.d.mts +14 -10
  972. package/esm/validation/database/types.d.mts.map +1 -1
  973. package/esm/validation/database/unique-except-current-id.d.mts +2 -3
  974. package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
  975. package/esm/validation/database/unique-except-current-user.d.mts +2 -3
  976. package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
  977. package/esm/validation/file/file.d.mts +4 -6
  978. package/esm/validation/file/file.d.mts.map +1 -1
  979. package/esm/validation/file/index.d.mts +2 -1
  980. package/esm/validation/file/index.mjs +1 -1
  981. package/esm/validation/index.d.mts +5 -1
  982. package/esm/validation/index.mjs +1 -1
  983. package/esm/validation/plugins/index.mjs +1 -1
  984. package/esm/validation/types.d.mts +6 -4
  985. package/esm/validation/types.d.mts.map +1 -1
  986. package/esm/validation/validateAll.mjs +2 -2
  987. package/esm/validation/validateAll.mjs.map +1 -1
  988. package/esm/validation/validation-failure-status.mjs +2 -2
  989. package/esm/validation/validation-failure-status.mjs.map +1 -1
  990. package/esm/validation/validators/file-validator.d.mts +2 -4
  991. package/esm/validation/validators/file-validator.d.mts.map +1 -1
  992. package/esm/validation/validators/index.d.mts +2 -1
  993. package/esm/validation/validators/index.mjs +1 -1
  994. package/esm/vite/lower-stage3-decorators.d.mts +2 -3
  995. package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
  996. package/esm/warlock-config/define-config.d.mts +1 -3
  997. package/esm/warlock-config/define-config.d.mts.map +1 -1
  998. package/esm/warlock-config/define-config.mjs +3 -2
  999. package/esm/warlock-config/define-config.mjs.map +1 -1
  1000. package/esm/warlock-config/index.d.mts +2 -1
  1001. package/esm/warlock-config/index.mjs +1 -1
  1002. package/esm/warlock-config/types.d.mts +6 -5
  1003. package/esm/warlock-config/types.d.mts.map +1 -1
  1004. package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
  1005. package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
  1006. package/esm/warlock-config/warlock-config.manager.mjs +2 -1
  1007. package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
  1008. package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
  1009. package/llms-full.txt +55 -5
  1010. package/package.json +17 -15
  1011. package/skills/create-module/SKILL.md +7 -0
  1012. package/skills/index.md +2 -0
  1013. package/skills/report-framework-issue.md +154 -0
  1014. package/skills/run-app/SKILL.md +6 -5
  1015. package/skills/upgrade-from-5-29/SKILL.md +41 -0
  1016. package/skills/warlock-check/SKILL.md +1 -0
  1017. package/esm/tooling/check/index.d.mts +0 -8
  1018. package/esm/tooling/typecheck/index.d.mts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"logger-sync-calls.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/upgrade/codemods/logger-sync-calls.ts"],"sourcesContent":["import type { Codemod, CodemodOutput } from \"../types\";\nimport { importedLocalNames, manualAt, replaceNode } from \"./helpers\";\n\nconst SYNC_METHODS = new Set([\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"success\",\n \"fatal\",\n \"log\",\n \"assert\",\n]);\n\n/**\n * 5.30: `log.info()` and its siblings return the logger instead of a promise.\n * Removes `await` in front of them; a `.then()` chained on one is listed for\n * review (code that must wait for delivery calls `await log.flush()`).\n */\nexport const loggerSyncCalls: Codemod = {\n id: \"logger-sync-calls\",\n version: \"5.30.0\",\n package: \"@warlock.js/logger\",\n title: \"Remove `await` from synchronous log calls\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node, SyntaxKind } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n const loggers = importedLocalNames(sourceFile, \"@warlock.js/logger\", \"log\");\n if (loggers.size === 0) continue;\n\n const isLogCall = (node: import(\"ts-morph\").Node): boolean => {\n if (!Node.isCallExpression(node)) return false;\n const callee = node.getExpression();\n if (!Node.isPropertyAccessExpression(callee)) return false;\n const owner = callee.getExpression();\n return (\n Node.isIdentifier(owner) &&\n loggers.has(owner.getText()) &&\n SYNC_METHODS.has(callee.getName())\n );\n };\n\n for (const awaitExpression of sourceFile.getDescendantsOfKind(SyntaxKind.AwaitExpression)) {\n const argument = awaitExpression.getExpression();\n if (!isLogCall(argument)) continue;\n output.edits.push(\n replaceNode(\n context,\n awaitExpression,\n argument.getText(),\n `removed await before ${argument.getText().split(\"(\")[0]}()`,\n ),\n );\n }\n\n for (const access of sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAccessExpression)) {\n if (access.getName() !== \"then\" || !isLogCall(access.getExpression())) continue;\n output.manual.push(\n manualAt(\n context,\n access,\n \"`.then()` on a log call: log calls return the logger now. Run the callback directly, or `await log.flush()` first if it must wait for delivery.\",\n ),\n );\n }\n }\n\n return output;\n },\n};\n"],"mappings":";;;AAGA,MAAM,eAAe,IAAI,IAAI;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,MAAa,kBAA2B;CACtC,IAAI;CACJ,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,IAAI,SAAS;EACX,MAAM,EAAE,MAAM,eAAe,QAAQ;EACrC,MAAM,SAAwB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;EAEtD,KAAK,MAAM,cAAc,QAAQ,aAAa;GAC5C,MAAM,UAAU,mBAAmB,YAAY,sBAAsB,KAAK;GAC1E,IAAI,QAAQ,SAAS,GAAG;GAExB,MAAM,aAAa,SAA2C;IAC5D,IAAI,CAAC,KAAK,iBAAiB,IAAI,GAAG,OAAO;IACzC,MAAM,SAAS,KAAK,cAAc;IAClC,IAAI,CAAC,KAAK,2BAA2B,MAAM,GAAG,OAAO;IACrD,MAAM,QAAQ,OAAO,cAAc;IACnC,OACE,KAAK,aAAa,KAAK,KACvB,QAAQ,IAAI,MAAM,QAAQ,CAAC,KAC3B,aAAa,IAAI,OAAO,QAAQ,CAAC;GAErC;GAEA,KAAK,MAAM,mBAAmB,WAAW,qBAAqB,WAAW,eAAe,GAAG;IACzF,MAAM,WAAW,gBAAgB,cAAc;IAC/C,IAAI,CAAC,UAAU,QAAQ,GAAG;IAC1B,OAAO,MAAM,KACX,YACE,SACA,iBACA,SAAS,QAAQ,GACjB,wBAAwB,SAAS,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAC3D,CACF;GACF;GAEA,KAAK,MAAM,UAAU,WAAW,qBAAqB,WAAW,wBAAwB,GAAG;IACzF,IAAI,OAAO,QAAQ,MAAM,UAAU,CAAC,UAAU,OAAO,cAAc,CAAC,GAAG;IACvE,OAAO,OAAO,KACZ,SACE,SACA,QACA,iJACF,CACF;GACF;EACF;EAEA,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"logger-sync-calls.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/upgrade/codemods/logger-sync-calls.ts"],"sourcesContent":["import type { Codemod, CodemodOutput } from \"../types\";\nimport { importedLocalNames, manualAt, replaceNode } from \"./helpers\";\n\nconst SYNC_METHODS = new Set([\n \"info\",\n \"warn\",\n \"error\",\n \"debug\",\n \"success\",\n \"fatal\",\n \"log\",\n \"assert\",\n]);\n\n/**\n * 5.30: `log.info()` and its siblings return the logger instead of a promise.\n * Removes `await` in front of them; a `.then()` chained on one is listed for\n * review (code that must wait for delivery calls `await log.flush()`).\n */\nexport const loggerSyncCalls: Codemod = {\n id: \"logger-sync-calls\",\n version: \"5.30.0\",\n package: \"@warlock.js/logger\",\n title: \"Remove `await` from synchronous log calls\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node, SyntaxKind } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n const loggers = importedLocalNames(sourceFile, \"@warlock.js/logger\", \"log\");\n if (loggers.size === 0) continue;\n\n const isLogCall = (node: import(\"ts-morph\").Node): boolean => {\n if (!Node.isCallExpression(node)) return false;\n const callee = node.getExpression();\n if (!Node.isPropertyAccessExpression(callee)) return false;\n const owner = callee.getExpression();\n return (\n Node.isIdentifier(owner) &&\n loggers.has(owner.getText()) &&\n SYNC_METHODS.has(callee.getName())\n );\n };\n\n for (const awaitExpression of sourceFile.getDescendantsOfKind(SyntaxKind.AwaitExpression)) {\n const argument = awaitExpression.getExpression();\n if (!isLogCall(argument)) continue;\n output.edits.push(\n replaceNode(\n context,\n awaitExpression,\n argument.getText(),\n `removed await before ${argument.getText().split(\"(\")[0]}()`,\n ),\n );\n }\n\n for (const access of sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAccessExpression)) {\n if (access.getName() !== \"then\" || !isLogCall(access.getExpression())) continue;\n output.manual.push(\n manualAt(\n context,\n access,\n \"`.then()` on a log call: log calls return the logger now. Run the callback directly, or `await log.flush()` first if it must wait for delivery.\",\n ),\n );\n }\n }\n\n return output;\n },\n};\n"],"mappings":";;;AAGA,MAAM,+BAAe,IAAI,IAAI;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,MAAa,kBAA2B;CACtC,IAAI;CACJ,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,IAAI,SAAS;EACX,MAAM,EAAE,MAAM,eAAe,QAAQ;EACrC,MAAM,SAAwB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;EAEtD,KAAK,MAAM,cAAc,QAAQ,aAAa;GAC5C,MAAM,UAAU,mBAAmB,YAAY,sBAAsB,KAAK;GAC1E,IAAI,QAAQ,SAAS,GAAG;GAExB,MAAM,aAAa,SAA2C;IAC5D,IAAI,CAAC,KAAK,iBAAiB,IAAI,GAAG,OAAO;IACzC,MAAM,SAAS,KAAK,cAAc;IAClC,IAAI,CAAC,KAAK,2BAA2B,MAAM,GAAG,OAAO;IACrD,MAAM,QAAQ,OAAO,cAAc;IACnC,OACE,KAAK,aAAa,KAAK,KACvB,QAAQ,IAAI,MAAM,QAAQ,CAAC,KAC3B,aAAa,IAAI,OAAO,QAAQ,CAAC;GAErC;GAEA,KAAK,MAAM,mBAAmB,WAAW,qBAAqB,WAAW,eAAe,GAAG;IACzF,MAAM,WAAW,gBAAgB,cAAc;IAC/C,IAAI,CAAC,UAAU,QAAQ,GAAG;IAC1B,OAAO,MAAM,KACX,YACE,SACA,iBACA,SAAS,QAAQ,GACjB,wBAAwB,SAAS,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAC3D,CACF;GACF;GAEA,KAAK,MAAM,UAAU,WAAW,qBAAqB,WAAW,wBAAwB,GAAG;IACzF,IAAI,OAAO,QAAQ,MAAM,UAAU,CAAC,UAAU,OAAO,cAAc,CAAC,GAAG;IACvE,OAAO,OAAO,KACZ,SACE,SACA,QACA,iJACF,CACF;GACF;EACF;EAEA,OAAO;CACT;AACF"}
@@ -2,7 +2,7 @@ import { importedLocalNames, manualAt, replaceNode } from "./helpers.mjs";
2
2
 
3
3
  //#region ../../packages/core/src/upgrade/codemods/request-log-snapshot.ts
4
4
  /** Fields of the `RequestLogSnapshot` a log channel now receives. */
5
- const SNAPSHOT_FIELDS = new Set([
5
+ const SNAPSHOT_FIELDS = /* @__PURE__ */ new Set([
6
6
  "id",
7
7
  "method",
8
8
  "url",
@@ -1 +1 @@
1
- {"version":3,"file":"request-log-snapshot.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/upgrade/codemods/request-log-snapshot.ts"],"sourcesContent":["import type * as TsMorph from \"ts-morph\";\nimport type { Codemod, CodemodOutput } from \"../types\";\nimport { importedLocalNames, manualAt, replaceNode } from \"./helpers\";\n\n/** Fields of the `RequestLogSnapshot` a log channel now receives. */\nconst SNAPSHOT_FIELDS = new Set([\n \"id\",\n \"method\",\n \"url\",\n \"route\",\n \"name\",\n \"ip\",\n \"userAgent\",\n \"query\",\n \"body\",\n \"statusCode\",\n]);\n\n/** `request.<a>.<b>` reads with a snapshot equivalent. */\nconst REWRITES: Record<string, string> = {\n \"baseRequest.url\": \"url\",\n \"baseRequest.method\": \"method\",\n \"baseRequest.ip\": \"ip\",\n \"route.path\": \"route\",\n \"route.name\": \"name\",\n};\n\n/**\n * 5.30: request log entries carry a plain `RequestLogSnapshot` in\n * `context.request`, not the `Request` instance. Inside custom log channels,\n * rewrites the reads that have a direct snapshot field and lists the rest.\n */\nexport const requestLogSnapshot: Codemod = {\n id: \"request-log-snapshot\",\n version: \"5.30.0\",\n package: \"@warlock.js/core\",\n title: \"Read request log snapshots in custom log channels\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node, SyntaxKind } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n if (importedLocalNames(sourceFile, \"@warlock.js/logger\", \"LogChannel\").size === 0) continue;\n\n for (const access of sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAccessExpression)) {\n const owner = access.getExpression();\n // `<anything>.context.request` / `.context.response`\n if (!Node.isPropertyAccessExpression(owner) || owner.getName() !== \"context\") continue;\n const target = access.getName();\n if (target !== \"request\" && target !== \"response\") continue;\n\n const chain = memberChain(Node, access);\n if (chain.length === 0) continue;\n\n const first = chain[0] as TsMorph.PropertyAccessExpression;\n const second = chain[1];\n const pair = second ? `${first.getName()}.${second.getName()}` : undefined;\n const replacement = pair ? REWRITES[pair] : undefined;\n\n if (target === \"request\" && replacement && second) {\n output.edits.push(\n replaceNode(\n context,\n second,\n `${access.getText()}.${replacement}`,\n `context.request.${pair} → context.request.${replacement}`,\n ),\n );\n continue;\n }\n\n const field = first.getName();\n const isCall = Node.isCallExpression(first.getParent());\n // `route` is the matched pattern string now, not the route object.\n const readsRouteObject = target === \"request\" && field === \"route\" && second !== undefined;\n if (!SNAPSHOT_FIELDS.has(field) || isCall || readsRouteObject) {\n output.manual.push(\n manualAt(\n context,\n first,\n `\\`context.${target}.${field}\\` is not on the log snapshot ({ id, method, url, route, name, ip, userAgent, query?, body? }). Read a snapshot field, or call \\`request.toLogSnapshot()\\` where the entry is logged.`,\n ),\n );\n }\n }\n }\n\n return output;\n },\n};\n\n/** `x.context.request.a.b` → [`…request.a`, `…request.a.b`]. */\nfunction memberChain(\n Node: typeof TsMorph.Node,\n start: TsMorph.PropertyAccessExpression,\n): TsMorph.PropertyAccessExpression[] {\n const chain: TsMorph.PropertyAccessExpression[] = [];\n let current: TsMorph.Node = start;\n\n for (;;) {\n const parent = current.getParent();\n if (!parent || !Node.isPropertyAccessExpression(parent) || parent.getExpression() !== current) {\n return chain;\n }\n chain.push(parent);\n current = parent;\n }\n}\n"],"mappings":";;;;AAKA,MAAM,kBAAkB,IAAI,IAAI;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAM,WAAmC;CACvC,mBAAmB;CACnB,sBAAsB;CACtB,kBAAkB;CAClB,cAAc;CACd,cAAc;AAChB;;;;;;AAOA,MAAa,qBAA8B;CACzC,IAAI;CACJ,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,IAAI,SAAS;EACX,MAAM,EAAE,MAAM,eAAe,QAAQ;EACrC,MAAM,SAAwB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;EAEtD,KAAK,MAAM,cAAc,QAAQ,aAAa;GAC5C,IAAI,mBAAmB,YAAY,sBAAsB,YAAY,CAAC,CAAC,SAAS,GAAG;GAEnF,KAAK,MAAM,UAAU,WAAW,qBAAqB,WAAW,wBAAwB,GAAG;IACzF,MAAM,QAAQ,OAAO,cAAc;IAEnC,IAAI,CAAC,KAAK,2BAA2B,KAAK,KAAK,MAAM,QAAQ,MAAM,WAAW;IAC9E,MAAM,SAAS,OAAO,QAAQ;IAC9B,IAAI,WAAW,aAAa,WAAW,YAAY;IAEnD,MAAM,QAAQ,YAAY,MAAM,MAAM;IACtC,IAAI,MAAM,WAAW,GAAG;IAExB,MAAM,QAAQ,MAAM;IACpB,MAAM,SAAS,MAAM;IACrB,MAAM,OAAO,SAAS,GAAG,MAAM,QAAQ,EAAE,GAAG,OAAO,QAAQ,MAAM;IACjE,MAAM,cAAc,OAAO,SAAS,QAAQ;IAE5C,IAAI,WAAW,aAAa,eAAe,QAAQ;KACjD,OAAO,MAAM,KACX,YACE,SACA,QACA,GAAG,OAAO,QAAQ,EAAE,GAAG,eACvB,mBAAmB,KAAK,qBAAqB,aAC/C,CACF;KACA;IACF;IAEA,MAAM,QAAQ,MAAM,QAAQ;IAC5B,MAAM,SAAS,KAAK,iBAAiB,MAAM,UAAU,CAAC;IAEtD,MAAM,mBAAmB,WAAW,aAAa,UAAU,WAAW,WAAW;IACjF,IAAI,CAAC,gBAAgB,IAAI,KAAK,KAAK,UAAU,kBAC3C,OAAO,OAAO,KACZ,SACE,SACA,OACA,aAAa,OAAO,GAAG,MAAM,sLAC/B,CACF;GAEJ;EACF;EAEA,OAAO;CACT;AACF;;AAGA,SAAS,YACP,MACA,OACoC;CACpC,MAAM,QAA4C,CAAC;CACnD,IAAI,UAAwB;CAE5B,SAAS;EACP,MAAM,SAAS,QAAQ,UAAU;EACjC,IAAI,CAAC,UAAU,CAAC,KAAK,2BAA2B,MAAM,KAAK,OAAO,cAAc,MAAM,SACpF,OAAO;EAET,MAAM,KAAK,MAAM;EACjB,UAAU;CACZ;AACF"}
1
+ {"version":3,"file":"request-log-snapshot.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/upgrade/codemods/request-log-snapshot.ts"],"sourcesContent":["import type * as TsMorph from \"ts-morph\";\nimport type { Codemod, CodemodOutput } from \"../types\";\nimport { importedLocalNames, manualAt, replaceNode } from \"./helpers\";\n\n/** Fields of the `RequestLogSnapshot` a log channel now receives. */\nconst SNAPSHOT_FIELDS = new Set([\n \"id\",\n \"method\",\n \"url\",\n \"route\",\n \"name\",\n \"ip\",\n \"userAgent\",\n \"query\",\n \"body\",\n \"statusCode\",\n]);\n\n/** `request.<a>.<b>` reads with a snapshot equivalent. */\nconst REWRITES: Record<string, string> = {\n \"baseRequest.url\": \"url\",\n \"baseRequest.method\": \"method\",\n \"baseRequest.ip\": \"ip\",\n \"route.path\": \"route\",\n \"route.name\": \"name\",\n};\n\n/**\n * 5.30: request log entries carry a plain `RequestLogSnapshot` in\n * `context.request`, not the `Request` instance. Inside custom log channels,\n * rewrites the reads that have a direct snapshot field and lists the rest.\n */\nexport const requestLogSnapshot: Codemod = {\n id: \"request-log-snapshot\",\n version: \"5.30.0\",\n package: \"@warlock.js/core\",\n title: \"Read request log snapshots in custom log channels\",\n skill: \"upgrade-from-5-29\",\n run(context) {\n const { Node, SyntaxKind } = context.tsMorph;\n const output: CodemodOutput = { edits: [], manual: [] };\n\n for (const sourceFile of context.sourceFiles) {\n if (importedLocalNames(sourceFile, \"@warlock.js/logger\", \"LogChannel\").size === 0) continue;\n\n for (const access of sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAccessExpression)) {\n const owner = access.getExpression();\n // `<anything>.context.request` / `.context.response`\n if (!Node.isPropertyAccessExpression(owner) || owner.getName() !== \"context\") continue;\n const target = access.getName();\n if (target !== \"request\" && target !== \"response\") continue;\n\n const chain = memberChain(Node, access);\n if (chain.length === 0) continue;\n\n const first = chain[0] as TsMorph.PropertyAccessExpression;\n const second = chain[1];\n const pair = second ? `${first.getName()}.${second.getName()}` : undefined;\n const replacement = pair ? REWRITES[pair] : undefined;\n\n if (target === \"request\" && replacement && second) {\n output.edits.push(\n replaceNode(\n context,\n second,\n `${access.getText()}.${replacement}`,\n `context.request.${pair} → context.request.${replacement}`,\n ),\n );\n continue;\n }\n\n const field = first.getName();\n const isCall = Node.isCallExpression(first.getParent());\n // `route` is the matched pattern string now, not the route object.\n const readsRouteObject = target === \"request\" && field === \"route\" && second !== undefined;\n if (!SNAPSHOT_FIELDS.has(field) || isCall || readsRouteObject) {\n output.manual.push(\n manualAt(\n context,\n first,\n `\\`context.${target}.${field}\\` is not on the log snapshot ({ id, method, url, route, name, ip, userAgent, query?, body? }). Read a snapshot field, or call \\`request.toLogSnapshot()\\` where the entry is logged.`,\n ),\n );\n }\n }\n }\n\n return output;\n },\n};\n\n/** `x.context.request.a.b` → [`…request.a`, `…request.a.b`]. */\nfunction memberChain(\n Node: typeof TsMorph.Node,\n start: TsMorph.PropertyAccessExpression,\n): TsMorph.PropertyAccessExpression[] {\n const chain: TsMorph.PropertyAccessExpression[] = [];\n let current: TsMorph.Node = start;\n\n for (;;) {\n const parent = current.getParent();\n if (!parent || !Node.isPropertyAccessExpression(parent) || parent.getExpression() !== current) {\n return chain;\n }\n chain.push(parent);\n current = parent;\n }\n}\n"],"mappings":";;;;AAKA,MAAM,kCAAkB,IAAI,IAAI;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAM,WAAmC;CACvC,mBAAmB;CACnB,sBAAsB;CACtB,kBAAkB;CAClB,cAAc;CACd,cAAc;AAChB;;;;;;AAOA,MAAa,qBAA8B;CACzC,IAAI;CACJ,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;CACP,IAAI,SAAS;EACX,MAAM,EAAE,MAAM,eAAe,QAAQ;EACrC,MAAM,SAAwB;GAAE,OAAO,CAAC;GAAG,QAAQ,CAAC;EAAE;EAEtD,KAAK,MAAM,cAAc,QAAQ,aAAa;GAC5C,IAAI,mBAAmB,YAAY,sBAAsB,YAAY,CAAC,CAAC,SAAS,GAAG;GAEnF,KAAK,MAAM,UAAU,WAAW,qBAAqB,WAAW,wBAAwB,GAAG;IACzF,MAAM,QAAQ,OAAO,cAAc;IAEnC,IAAI,CAAC,KAAK,2BAA2B,KAAK,KAAK,MAAM,QAAQ,MAAM,WAAW;IAC9E,MAAM,SAAS,OAAO,QAAQ;IAC9B,IAAI,WAAW,aAAa,WAAW,YAAY;IAEnD,MAAM,QAAQ,YAAY,MAAM,MAAM;IACtC,IAAI,MAAM,WAAW,GAAG;IAExB,MAAM,QAAQ,MAAM;IACpB,MAAM,SAAS,MAAM;IACrB,MAAM,OAAO,SAAS,GAAG,MAAM,QAAQ,EAAE,GAAG,OAAO,QAAQ,MAAM;IACjE,MAAM,cAAc,OAAO,SAAS,QAAQ;IAE5C,IAAI,WAAW,aAAa,eAAe,QAAQ;KACjD,OAAO,MAAM,KACX,YACE,SACA,QACA,GAAG,OAAO,QAAQ,EAAE,GAAG,eACvB,mBAAmB,KAAK,qBAAqB,aAC/C,CACF;KACA;IACF;IAEA,MAAM,QAAQ,MAAM,QAAQ;IAC5B,MAAM,SAAS,KAAK,iBAAiB,MAAM,UAAU,CAAC;IAEtD,MAAM,mBAAmB,WAAW,aAAa,UAAU,WAAW,WAAW;IACjF,IAAI,CAAC,gBAAgB,IAAI,KAAK,KAAK,UAAU,kBAC3C,OAAO,OAAO,KACZ,SACE,SACA,OACA,aAAa,OAAO,GAAG,MAAM,sLAC/B,CACF;GAEJ;EACF;EAEA,OAAO;CACT;AACF;;AAGA,SAAS,YACP,MACA,OACoC;CACpC,MAAM,QAA4C,CAAC;CACnD,IAAI,UAAwB;CAE5B,SAAS;EACP,MAAM,SAAS,QAAQ,UAAU;EACjC,IAAI,CAAC,UAAU,CAAC,KAAK,2BAA2B,MAAM,KAAK,OAAO,cAAc,MAAM,SACpF,OAAO;EAET,MAAM,KAAK,MAAM;EACjB,UAAU;CACZ;AACF"}
@@ -75,7 +75,7 @@ function formatHunks(operations) {
75
75
  while (cursor < changed.length) {
76
76
  const firstChange = changed[cursor] ?? 0;
77
77
  let lastChange = firstChange;
78
- while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= CONTEXT * 2) {
78
+ while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= 6) {
79
79
  cursor++;
80
80
  lastChange = changed[cursor] ?? lastChange;
81
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"diff.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/diff.ts"],"sourcesContent":["/**\n * A minimal unified diff (`diff -u` shape, 3 lines of context) between two\n * versions of one file, enough for `warlock upgrade --dry-run` to show what\n * it would change. Line-based longest common subsequence; files too large for\n * that are shown as one replaced hunk.\n */\nconst CONTEXT = 3;\nconst MAX_CELLS = 16_000_000;\n\ntype Operation = { type: \"same\" | \"removed\" | \"added\"; text: string };\n\nexport function unifiedDiff(file: string, before: string, after: string): string {\n if (before === after) return \"\";\n\n const oldLines = splitLines(before);\n const newLines = splitLines(after);\n const operations = diffLines(oldLines, newLines);\n\n const header = `--- a/${file}\\n+++ b/${file}\\n`;\n return header + formatHunks(operations);\n}\n\nfunction splitLines(text: string): string[] {\n if (text === \"\") return [];\n const lines = text.split(\"\\n\");\n if (lines[lines.length - 1] === \"\") lines.pop();\n return lines;\n}\n\nfunction diffLines(oldLines: string[], newLines: string[]): Operation[] {\n const n = oldLines.length;\n const m = newLines.length;\n\n if (n * m > MAX_CELLS) {\n return [\n ...oldLines.map((text): Operation => ({ type: \"removed\", text })),\n ...newLines.map((text): Operation => ({ type: \"added\", text })),\n ];\n }\n\n // lengths[i][j] = LCS length of oldLines[i..] and newLines[j..]\n const lengths: Uint32Array[] = [];\n for (let i = 0; i <= n; i++) lengths.push(new Uint32Array(m + 1));\n\n for (let i = n - 1; i >= 0; i--) {\n const row = lengths[i] as Uint32Array;\n const below = lengths[i + 1] as Uint32Array;\n for (let j = m - 1; j >= 0; j--) {\n row[j] =\n oldLines[i] === newLines[j]\n ? (below[j + 1] ?? 0) + 1\n : Math.max(below[j] ?? 0, row[j + 1] ?? 0);\n }\n }\n\n const operations: Operation[] = [];\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (oldLines[i] === newLines[j]) {\n operations.push({ type: \"same\", text: oldLines[i] ?? \"\" });\n i++;\n j++;\n } else if ((lengths[i + 1]?.[j] ?? 0) >= (lengths[i]?.[j + 1] ?? 0)) {\n operations.push({ type: \"removed\", text: oldLines[i] ?? \"\" });\n i++;\n } else {\n operations.push({ type: \"added\", text: newLines[j] ?? \"\" });\n j++;\n }\n }\n while (i < n) operations.push({ type: \"removed\", text: oldLines[i++] ?? \"\" });\n while (j < m) operations.push({ type: \"added\", text: newLines[j++] ?? \"\" });\n\n return operations;\n}\n\nfunction formatHunks(operations: Operation[]): string {\n const changed = operations\n .map((operation, index) => (operation.type === \"same\" ? -1 : index))\n .filter((index) => index >= 0);\n\n let output = \"\";\n let cursor = 0;\n\n while (cursor < changed.length) {\n const firstChange = changed[cursor] ?? 0;\n let lastChange = firstChange;\n // Merge changes whose context windows touch.\n while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= CONTEXT * 2) {\n cursor++;\n lastChange = changed[cursor] ?? lastChange;\n }\n cursor++;\n\n const start = Math.max(0, firstChange - CONTEXT);\n const end = Math.min(operations.length, lastChange + CONTEXT + 1);\n\n let oldStart = 1;\n let newStart = 1;\n for (let index = 0; index < start; index++) {\n const type = operations[index]?.type;\n if (type !== \"added\") oldStart++;\n if (type !== \"removed\") newStart++;\n }\n\n let oldCount = 0;\n let newCount = 0;\n let body = \"\";\n for (let index = start; index < end; index++) {\n const operation = operations[index];\n if (!operation) continue;\n if (operation.type === \"same\") {\n oldCount++;\n newCount++;\n body += ` ${operation.text}\\n`;\n } else if (operation.type === \"removed\") {\n oldCount++;\n body += `-${operation.text}\\n`;\n } else {\n newCount++;\n body += `+${operation.text}\\n`;\n }\n }\n\n const oldRange = oldCount === 0 ? `${oldStart - 1},0` : `${oldStart},${oldCount}`;\n const newRange = newCount === 0 ? `${newStart - 1},0` : `${newStart},${newCount}`;\n output += `@@ -${oldRange} +${newRange} @@\\n${body}`;\n }\n\n return output;\n}\n"],"mappings":";;;;;;;AAMA,MAAM,UAAU;AAChB,MAAM,YAAY;AAIlB,SAAgB,YAAY,MAAc,QAAgB,OAAuB;CAC/E,IAAI,WAAW,OAAO,OAAO;CAI7B,MAAM,aAAa,UAFF,WAAW,MAEQ,GADnB,WAAW,KACkB,CAAC;CAG/C,OAAO,SADiB,KAAK,UAAU,KAAK,MAC5B,YAAY,UAAU;AACxC;AAEA,SAAS,WAAW,MAAwB;CAC1C,IAAI,SAAS,IAAI,OAAO,CAAC;CACzB,MAAM,QAAQ,KAAK,MAAM,IAAI;CAC7B,IAAI,MAAM,MAAM,SAAS,OAAO,IAAI,MAAM,IAAI;CAC9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MAAM,GAAG,SAAS,GAAG;EACvE,UAAU,OAAO,SAAS,IAAI,SAAS,OAAO;CAChD;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"diff.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/diff.ts"],"sourcesContent":["/**\n * A minimal unified diff (`diff -u` shape, 3 lines of context) between two\n * versions of one file, enough for `warlock upgrade --dry-run` to show what\n * it would change. Line-based longest common subsequence; files too large for\n * that are shown as one replaced hunk.\n */\nconst CONTEXT = 3;\nconst MAX_CELLS = 16_000_000;\n\ntype Operation = { type: \"same\" | \"removed\" | \"added\"; text: string };\n\nexport function unifiedDiff(file: string, before: string, after: string): string {\n if (before === after) return \"\";\n\n const oldLines = splitLines(before);\n const newLines = splitLines(after);\n const operations = diffLines(oldLines, newLines);\n\n const header = `--- a/${file}\\n+++ b/${file}\\n`;\n return header + formatHunks(operations);\n}\n\nfunction splitLines(text: string): string[] {\n if (text === \"\") return [];\n const lines = text.split(\"\\n\");\n if (lines[lines.length - 1] === \"\") lines.pop();\n return lines;\n}\n\nfunction diffLines(oldLines: string[], newLines: string[]): Operation[] {\n const n = oldLines.length;\n const m = newLines.length;\n\n if (n * m > MAX_CELLS) {\n return [\n ...oldLines.map((text): Operation => ({ type: \"removed\", text })),\n ...newLines.map((text): Operation => ({ type: \"added\", text })),\n ];\n }\n\n // lengths[i][j] = LCS length of oldLines[i..] and newLines[j..]\n const lengths: Uint32Array[] = [];\n for (let i = 0; i <= n; i++) lengths.push(new Uint32Array(m + 1));\n\n for (let i = n - 1; i >= 0; i--) {\n const row = lengths[i] as Uint32Array;\n const below = lengths[i + 1] as Uint32Array;\n for (let j = m - 1; j >= 0; j--) {\n row[j] =\n oldLines[i] === newLines[j]\n ? (below[j + 1] ?? 0) + 1\n : Math.max(below[j] ?? 0, row[j + 1] ?? 0);\n }\n }\n\n const operations: Operation[] = [];\n let i = 0;\n let j = 0;\n while (i < n && j < m) {\n if (oldLines[i] === newLines[j]) {\n operations.push({ type: \"same\", text: oldLines[i] ?? \"\" });\n i++;\n j++;\n } else if ((lengths[i + 1]?.[j] ?? 0) >= (lengths[i]?.[j + 1] ?? 0)) {\n operations.push({ type: \"removed\", text: oldLines[i] ?? \"\" });\n i++;\n } else {\n operations.push({ type: \"added\", text: newLines[j] ?? \"\" });\n j++;\n }\n }\n while (i < n) operations.push({ type: \"removed\", text: oldLines[i++] ?? \"\" });\n while (j < m) operations.push({ type: \"added\", text: newLines[j++] ?? \"\" });\n\n return operations;\n}\n\nfunction formatHunks(operations: Operation[]): string {\n const changed = operations\n .map((operation, index) => (operation.type === \"same\" ? -1 : index))\n .filter((index) => index >= 0);\n\n let output = \"\";\n let cursor = 0;\n\n while (cursor < changed.length) {\n const firstChange = changed[cursor] ?? 0;\n let lastChange = firstChange;\n // Merge changes whose context windows touch.\n while (cursor + 1 < changed.length && (changed[cursor + 1] ?? 0) - lastChange <= CONTEXT * 2) {\n cursor++;\n lastChange = changed[cursor] ?? lastChange;\n }\n cursor++;\n\n const start = Math.max(0, firstChange - CONTEXT);\n const end = Math.min(operations.length, lastChange + CONTEXT + 1);\n\n let oldStart = 1;\n let newStart = 1;\n for (let index = 0; index < start; index++) {\n const type = operations[index]?.type;\n if (type !== \"added\") oldStart++;\n if (type !== \"removed\") newStart++;\n }\n\n let oldCount = 0;\n let newCount = 0;\n let body = \"\";\n for (let index = start; index < end; index++) {\n const operation = operations[index];\n if (!operation) continue;\n if (operation.type === \"same\") {\n oldCount++;\n newCount++;\n body += ` ${operation.text}\\n`;\n } else if (operation.type === \"removed\") {\n oldCount++;\n body += `-${operation.text}\\n`;\n } else {\n newCount++;\n body += `+${operation.text}\\n`;\n }\n }\n\n const oldRange = oldCount === 0 ? `${oldStart - 1},0` : `${oldStart},${oldCount}`;\n const newRange = newCount === 0 ? `${newStart - 1},0` : `${newStart},${newCount}`;\n output += `@@ -${oldRange} +${newRange} @@\\n${body}`;\n }\n\n return output;\n}\n"],"mappings":";;;;;;;AAMA,MAAM,UAAU;A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AM,YAAY,WAAW;GAC7B,IAAI,CAAC,WAAW;GAChB,IAAI,UAAU,SAAS,QAAQ;IAC7B;IACA;IACA,QAAQ,IAAI,UAAU,KAAK;GAC7B,OAAO,IAAI,UAAU,SAAS,WAAW;IACvC;IACA,QAAQ,IAAI,UAAU,KAAK;GAC7B,OAAO;IACL;IACA,QAAQ,IAAI,UAAU,KAAK;GAC7B;EACF;EAEA,MAAM,WAAW,aAAa,IAAI,GAAG,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG;EACvE,MAAM,WAAW,aAAa,IAAI,GAAG,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG;EACvE,UAAU,OAAO,SAAS,IAAI,SAAS,OAAO;CAChD;CAEA,OAAO;AACT"}
@@ -28,7 +28,8 @@ function tsMorphInstallCommand(packageManager) {
28
28
  */
29
29
  async function loadTsMorph(root) {
30
30
  try {
31
- return fromNamespace(await import(pathToFileURL(createRequire(path.join(root, "package.json")).resolve("ts-morph")).href));
31
+ const resolved = createRequire(path.join(root, "package.json")).resolve("ts-morph");
32
+ return fromNamespace(await import(pathToFileURL(resolved).href));
32
33
  } catch {}
33
34
  try {
34
35
  return fromNamespace(await import("ts-morph"));
@@ -44,5 +45,5 @@ function fromNamespace(namespace) {
44
45
  }
45
46
 
46
47
  //#endregion
47
- export { TsMorphMissingError, loadTsMorph };
48
+ export { TsMorphMissingError, loadTsMorph, tsMorphInstallCommand };
48
49
  //# sourceMappingURL=load-ts-morph.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-ts-morph.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/load-ts-morph.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { detectPackageManager, type PackageManager } from \"../updater/package-manager\";\nimport type { TsMorphModule } from \"./types\";\n\n/** Thrown when `ts-morph` is not installed; the message says how to add it. */\nexport class TsMorphMissingError extends Error {\n public override readonly name = \"TsMorphMissingError\";\n\n public constructor(public readonly installCommand: string) {\n super(\n `warlock upgrade edits source files with ts-morph, which is not installed. ` +\n `Add it as a development dependency, then run the command again:\\n\\n ${installCommand}\\n`,\n );\n }\n}\n\n/** The dev-dependency install command for `ts-morph` with this package manager. */\nexport function tsMorphInstallCommand(packageManager: PackageManager): string {\n switch (packageManager) {\n case \"pnpm\":\n return \"pnpm add --save-dev ts-morph\";\n case \"yarn\":\n return \"yarn add --dev ts-morph\";\n case \"bun\":\n return \"bun add --dev ts-morph\";\n default:\n return \"npm install --save-dev ts-morph\";\n }\n}\n\n/**\n * Load `ts-morph` lazily: it is an optional peer of `@warlock.js/core`, needed\n * only by `warlock upgrade`. Resolved from the app first (where the user\n * installs it), then from core's own location.\n */\nexport async function loadTsMorph(root: string): Promise<TsMorphModule> {\n try {\n const resolved = createRequire(path.join(root, \"package.json\")).resolve(\"ts-morph\");\n return fromNamespace(await import(pathToFileURL(resolved).href));\n } catch {\n // Not in the app; try core's own resolution below.\n }\n\n try {\n return fromNamespace(await import(\"ts-morph\"));\n } catch {\n throw new TsMorphMissingError(tsMorphInstallCommand(await detectPackageManager(root)));\n }\n}\n\n/** A CommonJS package imported from ESM may expose its API on `default` only. */\nfunction fromNamespace(namespace: unknown): TsMorphModule {\n const candidate = namespace as { Project?: unknown; default?: unknown };\n if (typeof candidate.Project === \"function\") return namespace as TsMorphModule;\n return candidate.default as TsMorphModule;\n}\n"],"mappings":";;;;;;;AAOA,IAAa,sBAAb,cAAyC,MAAM;CAG7C,AAAO,YAAY,AAAgB,gBAAwB;EACzD,MACE,kJAC0E,eAAe,GAC3F;EAJiC;cAFH;CAOhC;AACF;;AAGA,SAAgB,sBAAsB,gBAAwC;CAC5E,QAAQ,gBAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;;;AAOA,eAAsB,YAAY,MAAsC;CACtE,IAAI;EAEF,OAAO,cAAc,MAAM,OAAO,cADjB,cAAc,KAAK,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,QAAQ,UACjB,CAAC,CAAC,CAAC,KAAK;CACjE,QAAQ,CAER;CAEA,IAAI;EACF,OAAO,cAAc,MAAM,OAAO,WAAW;CAC/C,QAAQ;EACN,MAAM,IAAI,oBAAoB,sBAAsB,MAAM,qBAAqB,IAAI,CAAC,CAAC;CACvF;AACF;;AAGA,SAAS,cAAc,WAAmC;CACxD,MAAM,YAAY;CAClB,IAAI,OAAO,UAAU,YAAY,YAAY,OAAO;CACpD,OAAO,UAAU;AACnB"}
1
+ {"version":3,"file":"load-ts-morph.mjs","names":[],"sources":["../../../../../../../../packages/core/src/upgrade/load-ts-morph.ts"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { detectPackageManager, type PackageManager } from \"../updater/package-manager\";\nimport type { TsMorphModule } from \"./types\";\n\n/** Thrown when `ts-morph` is not installed; the message says how to add it. */\nexport class TsMorphMissingError extends Error {\n public override readonly name = \"TsMorphMissingError\";\n\n public constructor(public readonly installCommand: string) {\n super(\n `warlock upgrade edits source files with ts-morph, which is not installed. ` +\n `Add it as a development dependency, then run the command again:\\n\\n ${installCommand}\\n`,\n );\n }\n}\n\n/** The dev-dependency install command for `ts-morph` with this package manager. */\nexport function tsMorphInstallCommand(packageManager: PackageManager): string {\n switch (packageManager) {\n case \"pnpm\":\n return \"pnpm add --save-dev ts-morph\";\n case \"yarn\":\n return \"yarn add --dev ts-morph\";\n case \"bun\":\n return \"bun add --dev ts-morph\";\n default:\n return \"npm install --save-dev ts-morph\";\n }\n}\n\n/**\n * Load `ts-morph` lazily: it is an optional peer of `@warlock.js/core`, needed\n * only by `warlock upgrade`. Resolved from the app first (where the user\n * installs it), then from core's own location.\n */\nexport async function loadTsMorph(root: string): Promise<TsMorphModule> {\n try {\n const resolved = createRequire(path.join(root, \"package.json\")).resolve(\"ts-morph\");\n return fromNamespace(await import(pathToFileURL(resolved).href));\n } catch {\n // Not in the app; try core's own resolution below.\n }\n\n try {\n return fromNamespace(await import(\"ts-morph\"));\n } catch {\n throw new TsMorphMissingError(tsMorphInstallCommand(await detectPackageManager(root)));\n }\n}\n\n/** A CommonJS package imported from ESM may expose its API on `default` only. */\nfunction fromNamespace(namespace: unknown): TsMorphModule {\n const candidate = namespace as { Project?: unknown; default?: unknown };\n if (typeof candidate.Project === \"function\") return namespace as TsMorphModule;\n return candidate.default as TsMorphModule;\n}\n"],"mappings":";;;;;;;AAOA,IAAa,sBAAb,cAAyC,MAAM;CAG7C,AAAO,YAAY,AAAgB,gBAAwB;EACzD,MACE,kJAC0E,eAAe,GAC3F;EAJiC;cAFH;CAOhC;AACF;;AAGA,SAAgB,sBAAsB,gBAAwC;CAC5E,QAAQ,gBAAR;EACE,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,OACH,OAAO;EACT,SACE,OAAO;CACX;AACF;;;;;;AAOA,eAAsB,YAAY,MAAsC;CACtE,IAAI;EACF,MAAM,WAAW,cAAc,KAAK,KAAK,MAAM,cAAc,CAAC,CAAC,CAAC,QAAQ,UAAU;EAClF,OAAO,cAAc,MAAM,OAAO,cAAc,QAAQ,CAAC,CAAC,KAAK;CACjE,QAAQ,CAER;CAEA,IAAI;EACF,OAAO,cAAc,MAAM,OAAO,WAAW;CAC/C,QAAQ;EACN,MAAM,IAAI,oBAAoB,sBAAsB,MAAM,qBAAqB,IAAI,CAAC,CAAC;CACvF;AACF;;AAGA,SAAS,cAAc,WAAmC;CACxD,MAAM,YAAY;CAClB,IAAI,OAAO,UAAU,YAAY,YAAY,OAAO;CACpD,OAAO,UAAU;AACnB"}
@@ -242,5 +242,5 @@ function createTextFiles(root) {
242
242
  }
243
243
 
244
244
  //#endregion
245
- export { UpgradeUsageError, runUpgrade };
245
+ export { UpgradeUsageError, detectInstalledVersion, runUpgrade };
246
246
  //# sourceMappingURL=run-upgrade.mjs.map
@@ -4,4 +4,5 @@ import { broadcastUseCaseResult } from "./use-case-broadcast.mjs";
4
4
  import { fireLifecycleEvent, globalEventsCallbacksMap, globalUseCasesEvents } from "./use-case-events.mjs";
5
5
  import { PipelineOptions, runPipeline } from "./use-case-pipeline.mjs";
6
6
  import { BadSchemaUseCaseError } from "./use-case.errors.mjs";
7
- import { $registerUseCase, $unregisterUseCase, addUseCaseHistory, getUseCase, getUseCaseHistory, getUseCases, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls } from "./use-cases-registry.mjs";
7
+ import { $registerUseCase, $unregisterUseCase, addUseCaseHistory, getUseCase, getUseCaseHistory, getUseCases, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls } from "./use-cases-registry.mjs";
8
+ export { $registerUseCase, $unregisterUseCase, BadSchemaUseCaseError, PipelineOptions, RegisteredUseCase, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema, addUseCaseHistory, broadcastUseCaseResult, fireLifecycleEvent, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, runPipeline, useCase };
@@ -5,4 +5,4 @@ import { runPipeline } from "./use-case-pipeline.mjs";
5
5
  import { $registerUseCase, $unregisterUseCase, addUseCaseHistory, getUseCase, getUseCaseHistory, getUseCases, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls } from "./use-cases-registry.mjs";
6
6
  import { useCase } from "./use-case.mjs";
7
7
 
8
- export { };
8
+ export { $registerUseCase, $unregisterUseCase, BadSchemaUseCaseError, addUseCaseHistory, broadcastUseCaseResult, fireLifecycleEvent, getUseCase, getUseCaseHistory, getUseCases, globalEventsCallbacksMap, globalUseCasesEvents, increaseUseCaseFailedCalls, increaseUseCaseSuccessCalls, runPipeline, useCase };
@@ -1,14 +1,13 @@
1
1
  import { BenchmarkOptions } from "../benchmark/types.mjs";
2
2
  import { Infer, ObjectValidator } from "@warlock.js/seal";
3
3
  import { RetryOptions } from "@mongez/reinforcements";
4
-
5
4
  //#region ../../packages/core/src/use-cases/types.d.ts
6
5
  /**
7
6
  * Shared context object passed through the entire use case pipeline.
8
7
  * Contains the optional schema and can be enriched by guards/middleware
9
8
  * with arbitrary data (e.g., currentUser, permissions, request metadata).
10
9
  */
11
- type UseCaseContext = {
10
+ export type UseCaseContext = {
12
11
  schema?: ObjectValidator;
13
12
  } & Record<string, any>;
14
13
  /**
@@ -30,7 +29,7 @@ type UseCaseContext = {
30
29
  * @template Input - The shape of the use case input data
31
30
  * @template Ctx - The shape of the shared context
32
31
  */
33
- type UseCaseGuard<Input, Ctx extends UseCaseContext = UseCaseContext> = (data: Readonly<Input>, ctx: Ctx) => void | Promise<void>;
32
+ export type UseCaseGuard<Input, Ctx extends UseCaseContext = UseCaseContext> = (data: Readonly<Input>, ctx: Ctx) => void | Promise<void>;
34
33
  /**
35
34
  * Before middleware that runs **after** schema validation.
36
35
  *
@@ -47,7 +46,7 @@ type UseCaseGuard<Input, Ctx extends UseCaseContext = UseCaseContext> = (data: R
47
46
  * @template Input - The shape of the use case input data
48
47
  * @template Ctx - The shape of the shared context
49
48
  */
50
- type UseCaseBeforeMiddleware<Input, Ctx extends UseCaseContext = UseCaseContext> = (data: Input, ctx: Ctx) => Input | Promise<Input>;
49
+ export type UseCaseBeforeMiddleware<Input, Ctx extends UseCaseContext = UseCaseContext> = (data: Input, ctx: Ctx) => Input | Promise<Input>;
51
50
  /**
52
51
  * After middleware that runs **after** the handler succeeds.
53
52
  *
@@ -65,17 +64,23 @@ type UseCaseBeforeMiddleware<Input, Ctx extends UseCaseContext = UseCaseContext>
65
64
  * @template Output - The shape of the use case output data
66
65
  * @template Ctx - The shape of the shared context
67
66
  */
68
- type UseCaseAfterMiddleware<Output, Ctx extends UseCaseContext = UseCaseContext> = (output: Output, ctx: Ctx) => void | Promise<void>;
67
+ export type UseCaseAfterMiddleware<Output, Ctx extends UseCaseContext = UseCaseContext> = (output: Output, ctx: Ctx) => void | Promise<void>;
69
68
  /**
70
69
  * Context passed to `onExecuting` lifecycle event callbacks.
71
70
  * Fired at the start of each use case execution, before guards run.
72
71
  */
73
- type UseCaseOnExecutingContext = {
74
- /** The shared pipeline context */ctx: UseCaseContext; /** Unique execution ID */
75
- id: string; /** Use case name */
76
- name: string; /** Raw input data */
77
- data: any; /** Schema validator (if defined) */
78
- schema?: ObjectValidator; /** Timestamp when execution started */
72
+ export type UseCaseOnExecutingContext = {
73
+ /** The shared pipeline context */
74
+ ctx: UseCaseContext;
75
+ /** Unique execution ID */
76
+ id: string;
77
+ /** Use case name */
78
+ name: string;
79
+ /** Raw input data */
80
+ data: any;
81
+ /** Schema validator (if defined) */
82
+ schema?: ObjectValidator;
83
+ /** Timestamp when execution started */
79
84
  startedAt: Date;
80
85
  };
81
86
  /**
@@ -84,11 +89,16 @@ type UseCaseOnExecutingContext = {
84
89
  * An envelope (not the bare payload) so consumers get a correlation `id` for
85
90
  * tracing/idempotency under at-least-once delivery.
86
91
  */
87
- type UseCaseBroadcastEvent = {
88
- /** Use case name */useCase: string; /** Channel/event name — defaults to the use case name */
89
- event: string; /** Execution id (correlation / idempotency) */
90
- id: string; /** Emission timestamp */
91
- at: Date; /** The output as-is, or the projected shape from `broadcast.output` */
92
+ export type UseCaseBroadcastEvent = {
93
+ /** Use case name */
94
+ useCase: string;
95
+ /** Channel/event name — defaults to the use case name */
96
+ event: string;
97
+ /** Execution id (correlation / idempotency) */
98
+ id: string;
99
+ /** Emission timestamp */
100
+ at: Date;
101
+ /** The output as-is, or the projected shape from `broadcast.output` */
92
102
  payload: unknown;
93
103
  };
94
104
  /**
@@ -104,7 +114,7 @@ type UseCaseBroadcastEvent = {
104
114
  * broadcast: { enabled: true, channels: [heraldBroadcast({ broker: "default" })] }
105
115
  * ```
106
116
  */
107
- interface UseCaseBroadcastChannel {
117
+ export interface UseCaseBroadcastChannel {
108
118
  broadcast(event: UseCaseBroadcastEvent): void | Promise<void>;
109
119
  }
110
120
  /**
@@ -113,8 +123,10 @@ interface UseCaseBroadcastChannel {
113
123
  *
114
124
  * @template Output - The shape of the handler's return value
115
125
  */
116
- type UseCaseBroadcastOption<Output> = boolean | {
117
- /** Channel/event name; defaults to the use case name */event?: string; /** Project the payload before broadcasting (e.g. strip sensitive fields) */
126
+ export type UseCaseBroadcastOption<Output> = boolean | {
127
+ /** Channel/event name; defaults to the use case name */
128
+ event?: string;
129
+ /** Project the payload before broadcasting (e.g. strip sensitive fields) */
118
130
  output?: (output: Output, result: UseCaseResult<Output>) => unknown;
119
131
  };
120
132
  /**
@@ -143,16 +155,26 @@ type UseCaseBroadcastOption<Output> = boolean | {
143
155
  * @template Input - The shape of the input data (before transformation)
144
156
  * @template Ctx - The shape of the shared context
145
157
  */
146
- type UseCase<Output = any, Input = any, Ctx extends UseCaseContext = UseCaseContext> = {
147
- /** Unique use case identifier, used for registration, logging, and cache keys */name: string; /** Human-readable description, surfaced in the registry and observability */
148
- description?: string; /** Core business logic handler. Receives validated + transformed data and context */
149
- handler: (data: Input, ctx: Ctx) => Promise<Output>; /** Optional schema validator (from @warlock.js/seal). Runs after guards */
150
- schema?: ObjectValidator; /** Guards to run before validation. Sequential, can enrich ctx, cannot mutate data */
151
- guards?: UseCaseGuard<Input, Ctx>[]; /** Before middleware to run after validation. Sequential, can transform data */
152
- before?: UseCaseBeforeMiddleware<Input, Ctx>[]; /** After middleware to run on success. Fire-and-forget, errors are logged not thrown */
153
- after?: UseCaseAfterMiddleware<Output, Ctx>[]; /** Lifecycle callback: fires when execution starts (before guards) */
154
- onExecuting?: (ctx: UseCaseOnExecutingContext) => void; /** Lifecycle callback: fires on successful completion with full result snapshot */
155
- onCompleted?: (result: UseCaseResult<Output>) => void; /** Lifecycle callback: fires on error with error details and execution context */
158
+ export type UseCase<Output = any, Input = any, Ctx extends UseCaseContext = UseCaseContext> = {
159
+ /** Unique use case identifier, used for registration, logging, and cache keys */
160
+ name: string;
161
+ /** Human-readable description, surfaced in the registry and observability */
162
+ description?: string;
163
+ /** Core business logic handler. Receives validated + transformed data and context */
164
+ handler: (data: Input, ctx: Ctx) => Promise<Output>;
165
+ /** Optional schema validator (from @warlock.js/seal). Runs after guards */
166
+ schema?: ObjectValidator;
167
+ /** Guards to run before validation. Sequential, can enrich ctx, cannot mutate data */
168
+ guards?: UseCaseGuard<Input, Ctx>[];
169
+ /** Before middleware to run after validation. Sequential, can transform data */
170
+ before?: UseCaseBeforeMiddleware<Input, Ctx>[];
171
+ /** After middleware to run on success. Fire-and-forget, errors are logged not thrown */
172
+ after?: UseCaseAfterMiddleware<Output, Ctx>[];
173
+ /** Lifecycle callback: fires when execution starts (before guards) */
174
+ onExecuting?: (ctx: UseCaseOnExecutingContext) => void;
175
+ /** Lifecycle callback: fires on successful completion with full result snapshot */
176
+ onCompleted?: (result: UseCaseResult<Output>) => void;
177
+ /** Lifecycle callback: fires on error with error details and execution context */
156
178
  onError?: (ctx: UseCaseErrorResult) => void;
157
179
  /**
158
180
  * Retry configuration (from `@mongez/reinforcements`). When set, the **handler**
@@ -178,7 +200,7 @@ type UseCase<Output = any, Input = any, Ctx extends UseCaseContext = UseCaseCont
178
200
  * @template Schema - The schema validator the input is inferred from
179
201
  * @template Ctx - The shape of the shared context
180
202
  */
181
- type UseCaseWithSchema<Output, Schema extends ObjectValidator, Ctx extends UseCaseContext = UseCaseContext> = Omit<UseCase<Output, Infer<Schema>, Ctx>, "schema"> & {
203
+ export type UseCaseWithSchema<Output, Schema extends ObjectValidator, Ctx extends UseCaseContext = UseCaseContext> = Omit<UseCase<Output, Infer<Schema>, Ctx>, "schema"> & {
182
204
  schema: Schema;
183
205
  };
184
206
  /**
@@ -188,17 +210,21 @@ type UseCaseWithSchema<Output, Schema extends ObjectValidator, Ctx extends UseCa
188
210
  * @template Output - The shape of the handler's return value
189
211
  * @template Input - The shape of the input data
190
212
  */
191
- type UseCaseHandler<Output, Input> = ((data: Input, options?: UseCaseRuntimeOptions<Output>) => Promise<Output>) & {
213
+ export type UseCaseHandler<Output, Input> = ((data: Input, options?: UseCaseRuntimeOptions<Output>) => Promise<Output>) & {
192
214
  $cleanup: () => void;
193
215
  };
194
216
  /**
195
217
  * A registered use case with call tracking metadata.
196
218
  * Created internally when a use case is registered via `useCase()`.
197
219
  */
198
- type RegisteredUseCase<Output = any, Input = any> = UseCase<Output, Input> & {
199
- /** Execution call counters */calls: {
200
- /** Number of successful executions */success: number; /** Number of failed executions */
201
- failed: number; /** Total executions (success + failed) */
220
+ export type RegisteredUseCase<Output = any, Input = any> = UseCase<Output, Input> & {
221
+ /** Execution call counters */
222
+ calls: {
223
+ /** Number of successful executions */
224
+ success: number;
225
+ /** Number of failed executions */
226
+ failed: number;
227
+ /** Total executions (success + failed) */
202
228
  total: number;
203
229
  };
204
230
  };
@@ -217,19 +243,25 @@ type RegisteredUseCase<Output = any, Input = any> = UseCase<Output, Input> & {
217
243
  *
218
244
  * @template Output - The shape of the use case output data
219
245
  */
220
- type UseCaseRuntimeOptions<Output = any> = {
221
- /** Override the auto-generated execution ID */id?: string; /** Provide a pre-populated context object */
222
- ctx?: UseCaseContext; /** Invocation-level lifecycle callback: fires first, before use case and global */
223
- onExecuting?: (ctx: UseCaseOnExecutingContext) => void; /** Invocation-level lifecycle callback: fires first on success */
224
- onCompleted?: (result: UseCaseResult<Output>) => void; /** Invocation-level lifecycle callback: fires first on error */
246
+ export type UseCaseRuntimeOptions<Output = any> = {
247
+ /** Override the auto-generated execution ID */
248
+ id?: string;
249
+ /** Provide a pre-populated context object */
250
+ ctx?: UseCaseContext;
251
+ /** Invocation-level lifecycle callback: fires first, before use case and global */
252
+ onExecuting?: (ctx: UseCaseOnExecutingContext) => void;
253
+ /** Invocation-level lifecycle callback: fires first on success */
254
+ onCompleted?: (result: UseCaseResult<Output>) => void;
255
+ /** Invocation-level lifecycle callback: fires first on error */
225
256
  onError?: (ctx: UseCaseErrorResult) => void;
226
257
  };
227
258
  /**
228
259
  * Error result snapshot, emitted via `onError` lifecycle callbacks.
229
260
  * Contains all fields from `UseCaseResult` except `output`, plus the thrown error.
230
261
  */
231
- type UseCaseErrorResult = Omit<UseCaseResult, "output"> & {
232
- /** The error that caused the failure */error: Error;
262
+ export type UseCaseErrorResult = Omit<UseCaseResult, "output"> & {
263
+ /** The error that caused the failure */
264
+ error: Error;
233
265
  };
234
266
  /**
235
267
  * Success result snapshot, emitted via `onCompleted` lifecycle callbacks
@@ -237,21 +269,35 @@ type UseCaseErrorResult = Omit<UseCaseResult, "output"> & {
237
269
  *
238
270
  * @template Output - The shape of the handler's return value
239
271
  */
240
- type UseCaseResult<Output = any> = {
241
- /** Handler return value (undefined if execution failed) */output?: Output; /** The pipeline context at time of completion */
242
- ctx: UseCaseContext; /** Timestamp when execution started */
243
- startedAt: Date; /** Timestamp when execution ended */
244
- endedAt: Date; /** Unique execution ID */
245
- id: string; /** Use case name */
246
- name: string; /** Success or failed call count at time of completion (matches the outcome) */
247
- calls: number; /** Retry state (present only if retry was configured) */
272
+ export type UseCaseResult<Output = any> = {
273
+ /** Handler return value (undefined if execution failed) */
274
+ output?: Output;
275
+ /** The pipeline context at time of completion */
276
+ ctx: UseCaseContext;
277
+ /** Timestamp when execution started */
278
+ startedAt: Date;
279
+ /** Timestamp when execution ended */
280
+ endedAt: Date;
281
+ /** Unique execution ID */
282
+ id: string;
283
+ /** Use case name */
284
+ name: string;
285
+ /** Success or failed call count at time of completion (matches the outcome) */
286
+ calls: number;
287
+ /** Retry state (present only if retry was configured) */
248
288
  retries?: {
249
- /** Total allowed attempts (initial try + retries) */attempts: number; /** Delay between attempts in ms */
250
- delay?: number; /** Actual retry attempts performed (0 = succeeded on first try) */
289
+ /** Total allowed attempts (initial try + retries) */
290
+ attempts: number;
291
+ /** Delay between attempts in ms */
292
+ delay?: number;
293
+ /** Actual retry attempts performed (0 = succeeded on first try) */
251
294
  currentRetry: number;
252
- }; /** Benchmark result (present only if benchmark was enabled) */
295
+ };
296
+ /** Benchmark result (present only if benchmark was enabled) */
253
297
  benchmarkResult?: {
254
- /** Execution time in milliseconds */latency: number; /** Performance classification */
298
+ /** Execution time in milliseconds */
299
+ latency: number;
300
+ /** Performance classification */
255
301
  state: "poor" | "good" | "excellent";
256
302
  };
257
303
  };
@@ -259,7 +305,7 @@ type UseCaseResult<Output = any> = {
259
305
  * Internal registry of global lifecycle event callback arrays.
260
306
  * Used by `globalUseCasesEvents` to manage subscriptions.
261
307
  */
262
- type UseCaseEventsCallbacksMap = {
308
+ export type UseCaseEventsCallbacksMap = {
263
309
  onExecuting: ((ctx: UseCaseOnExecutingContext) => void)[];
264
310
  onCompleted: ((result: UseCaseResult<any>) => void)[];
265
311
  onError: ((ctx: UseCaseErrorResult) => void)[];
@@ -279,7 +325,7 @@ type UseCaseEventsCallbacksMap = {
279
325
  * } satisfies UseCaseConfigurations;
280
326
  * ```
281
327
  */
282
- type UseCaseConfigurations = {
328
+ export type UseCaseConfigurations = {
283
329
  /**
284
330
  * Default retry for all use cases (from `@mongez/reinforcements`).
285
331
  * When set, every use case retries its handler unless it overrides `retry`.
@@ -289,18 +335,25 @@ type UseCaseConfigurations = {
289
335
  * Default benchmark setting for all use cases.
290
336
  * For standalone benchmark usage, use `config.get("benchmark")` instead.
291
337
  */
292
- benchmark?: boolean | BenchmarkOptions; /** Broadcast transport — registered channels plus a global kill-switch */
338
+ benchmark?: boolean | BenchmarkOptions;
339
+ /** Broadcast transport — registered channels plus a global kill-switch */
293
340
  broadcast?: {
294
- /** Global on/off — `false` disables broadcasting for every use case */enabled?: boolean; /** Channels every broadcast fans out to */
341
+ /** Global on/off — `false` disables broadcasting for every use case */
342
+ enabled?: boolean;
343
+ /** Channels every broadcast fans out to */
295
344
  channels?: UseCaseBroadcastChannel[];
296
- }; /** Per-step debug logging through `@warlock.js/logger` (default: false) */
297
- log?: boolean; /** Execution history cache settings */
345
+ };
346
+ /** Per-step debug logging through `@warlock.js/logger` (default: false) */
347
+ log?: boolean;
348
+ /** Execution history cache settings */
298
349
  history?: {
299
- /** Enable/disable history storage (default: true) */enabled?: boolean; /** Cache TTL in seconds (default: 3600). `false` uses the cache driver default */
300
- ttl?: number | false; /** Max history entries kept per use case before oldest are evicted (default: 100) */
350
+ /** Enable/disable history storage (default: true) */
351
+ enabled?: boolean;
352
+ /** Cache TTL in seconds (default: 3600). `false` uses the cache driver default */
353
+ ttl?: number | false;
354
+ /** Max history entries kept per use case before oldest are evicted (default: 100) */
301
355
  maxEntries?: number;
302
356
  };
303
357
  };
304
358
  //#endregion
305
- export { RegisteredUseCase, UseCase, UseCaseAfterMiddleware, UseCaseBeforeMiddleware, UseCaseBroadcastChannel, UseCaseBroadcastEvent, UseCaseBroadcastOption, UseCaseConfigurations, UseCaseContext, UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseGuard, UseCaseHandler, UseCaseOnExecutingContext, UseCaseResult, UseCaseRuntimeOptions, UseCaseWithSchema };
306
359
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/types.ts"],"mappings":";;;;;;;AASA;;;KAAY,cAAA;EACV,MAAA,GAAS,eAAA;AAAA,IACP,MAAM;;;AAAA;AAqBV;;;;;;;;;;;;;;;;KAAY,YAAA,oBAAgC,cAAA,GAAiB,cAAA,KAC3D,IAAA,EAAM,QAAA,CAAS,KAAA,GACf,GAAA,EAAK,GAAA,YACK,OAAA;;;;;;AAAO;AAkBnB;;;;;;;;;;KAAY,uBAAA,oBAA2C,cAAA,GAAiB,cAAA,KACtE,IAAA,EAAM,KAAA,EACN,GAAA,EAAK,GAAA,KACF,KAAA,GAAQ,OAAA,CAAQ,KAAA;;;;;;;;;;;;;;AAAK;AAmB1B;;;KAAY,sBAAA,qBAA2C,cAAA,GAAiB,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* Broadcast a successful use-case result through the globally-configured channels.
@@ -11,7 +10,7 @@ import { UseCaseBroadcastOption, UseCaseConfigurations, UseCaseResult } from "./
11
10
  * @example
12
11
  * await broadcastUseCaseResult({ name, id, output, result, broadcast, config });
13
12
  */
14
- declare function broadcastUseCaseResult<Output>(params: {
13
+ export declare function broadcastUseCaseResult<Output>(params: {
15
14
  name: string;
16
15
  id: string;
17
16
  output: Output;
@@ -20,5 +19,4 @@ declare function broadcastUseCaseResult<Output>(params: {
20
19
  config?: UseCaseConfigurations["broadcast"];
21
20
  }): Promise<void>;
22
21
  //#endregion
23
- export { broadcastUseCaseResult };
24
22
  //# sourceMappingURL=use-case-broadcast.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-case-broadcast.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/use-case-broadcast.ts"],"mappings":";;;;;AAkBA;;;;;;;;iBAAsB,sBAAA,SAA+B,MAAA;EACnD,IAAA;EACA,EAAA;EACA,MAAA,EAAQ,MAAA;EACR,MAAA,EAAQ,aAAA,CAAc,MAAA;EACtB,SAAA,GAAY,sBAAA,CAAuB,MAAA;EACnC,MAAA,GAAS,qBAAA;AAAA,IACP,OAAA"}
1
+ {"version":3,"file":"use-case-broadcast.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/use-case-broadcast.ts"],"mappings":";;;;;;;;;;;;wBAkBsB,uBAAuB,QAAQ;EACnD;EACA;EACA,QAAQ;EACR,QAAQ,cAAc;EACtB,YAAY,uBAAuB;EACnC,SAAS;IACP"}
@@ -1,10 +1,9 @@
1
1
  import { UseCaseErrorResult, UseCaseEventsCallbacksMap, UseCaseOnExecutingContext, UseCaseResult } from "./types.mjs";
2
-
3
2
  //#region ../../packages/core/src/use-cases/use-case-events.d.ts
4
3
  /**
5
4
  * Global event callbacks — shared across all use case instances.
6
5
  */
7
- declare const globalEventsCallbacksMap: UseCaseEventsCallbacksMap;
6
+ export declare const globalEventsCallbacksMap: UseCaseEventsCallbacksMap;
8
7
  /**
9
8
  * Subscribe to lifecycle events fired by any use case.
10
9
  *
@@ -12,7 +11,7 @@ declare const globalEventsCallbacksMap: UseCaseEventsCallbacksMap;
12
11
  * globalUseCasesEvents.onCompleted((result) => metrics.track(result.name, result.benchmarkResult));
13
12
  * globalUseCasesEvents.onError((ctx) => logger.error(ctx.name, ctx.error));
14
13
  */
15
- declare const globalUseCasesEvents: {
14
+ export declare const globalUseCasesEvents: {
16
15
  onExecuting(callback: (ctx: UseCaseOnExecutingContext) => void): {
17
16
  unsubscribe: () => void;
18
17
  };
@@ -30,11 +29,10 @@ declare const globalUseCasesEvents: {
30
29
  * observer can't stall the others, and a throwing one can't break the pipeline (e.g.
31
30
  * a successful use case must not fail because a metrics/broadcast observer threw).
32
31
  */
33
- declare function fireLifecycleEvent<EventCtx>(ctx: EventCtx, observers: {
32
+ export declare function fireLifecycleEvent<EventCtx>(ctx: EventCtx, observers: {
34
33
  invocation?: ((ctx: EventCtx) => void | Promise<void>)[];
35
34
  useCase?: ((ctx: EventCtx) => void | Promise<void>)[];
36
35
  global?: ((ctx: EventCtx) => void | Promise<void>)[];
37
36
  }): Promise<void>;
38
37
  //#endregion
39
- export { fireLifecycleEvent, globalEventsCallbacksMap, globalUseCasesEvents };
40
38
  //# sourceMappingURL=use-case-events.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-case-events.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/use-case-events.ts"],"mappings":";;;;;AAWA;cAAa,wBAAA,EAA0B,yBAItC;;;AAAA;AASD;;;;cAAa,oBAAA;yBACY,GAAA,EAAK,yBAAA;;;sBASV,QAAA,GAAa,MAAA,EAAQ,aAAA,CAAc,MAAA;;;qBASlC,GAAA,EAAK,kBAAA;;;;;;;;;;;iBAkBJ,kBAAA,WACpB,GAAA,EAAK,QAAA,EACL,SAAA;EACE,UAAA,KAAe,GAAA,EAAK,QAAA,YAAoB,OAAA;EACxC,OAAA,KAAY,GAAA,EAAK,QAAA,YAAoB,OAAA;EACrC,MAAA,KAAW,GAAA,EAAK,QAAA,YAAoB,OAAA;AAAA,IACrC,OAAA"}
1
+ {"version":3,"file":"use-case-events.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/use-case-events.ts"],"mappings":";;;;;qBAWa,0BAA0B;;;;;;;;qBAa1B;EACX,YAAW,WAAY,KAAK;IAGxB;;EAMJ,YAAY,QAAM,WAAa,QAAQ,cAAc;IAGjD;;EAMJ,QAAO,WAAY,KAAK;IAGpB;;;;;;;;;;wBAegB,mBAAmB,UACvC,KAAK,UACL;EACE,eAAe,KAAK,oBAAoB;EACxC,YAAY,KAAK,oBAAoB;EACrC,WAAW,KAAK,oBAAoB;IACrC"}
@@ -1,8 +1,7 @@
1
1
  import { UseCaseBeforeMiddleware, UseCaseContext, UseCaseGuard, UseCaseOnExecutingContext } from "./types.mjs";
2
2
  import { ObjectValidator } from "@warlock.js/seal";
3
-
4
3
  //#region ../../packages/core/src/use-cases/use-case-pipeline.d.ts
5
- type PipelineOptions<Input> = {
4
+ export type PipelineOptions<Input> = {
6
5
  name: string;
7
6
  id: string;
8
7
  data: Input;
@@ -10,8 +9,10 @@ type PipelineOptions<Input> = {
10
9
  startedAt: Date;
11
10
  schema?: ObjectValidator;
12
11
  guards?: UseCaseGuard<Input>[];
13
- before?: UseCaseBeforeMiddleware<Input>[]; /** Invocation-level onExecuting override */
14
- onExecuting?: (ctx: UseCaseOnExecutingContext) => void; /** Use-case-level onExecuting */
12
+ before?: UseCaseBeforeMiddleware<Input>[];
13
+ /** Invocation-level onExecuting override */
14
+ onExecuting?: (ctx: UseCaseOnExecutingContext) => void;
15
+ /** Use-case-level onExecuting */
15
16
  ucOnExecuting?: (ctx: UseCaseOnExecutingContext) => void;
16
17
  };
17
18
  /**
@@ -27,7 +28,6 @@ type PipelineOptions<Input> = {
27
28
  * @example
28
29
  * const data = await runPipeline({ name, id, data, ctx, startedAt, schema, guards, before });
29
30
  */
30
- declare function runPipeline<Input>(opts: PipelineOptions<Input>): Promise<Input>;
31
+ export declare function runPipeline<Input>(opts: PipelineOptions<Input>): Promise<Input>;
31
32
  //#endregion
32
- export { PipelineOptions, runPipeline };
33
33
  //# sourceMappingURL=use-case-pipeline.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-case-pipeline.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/use-case-pipeline.ts"],"mappings":";;;;KAWY,eAAA;EACV,IAAA;EACA,EAAA;EACA,IAAA,EAAM,KAAA;EACN,GAAA,EAAK,cAAA;EACL,SAAA,EAAW,IAAA;EACX,MAAA,GAAS,eAAA;EACT,MAAA,GAAS,YAAA,CAAa,KAAA;EACtB,MAAA,GAAS,uBAAA,CAAwB,KAAA,KADX;EAGtB,WAAA,IAAe,GAAA,EAAK,yBAAA,WAFa;EAIjC,aAAA,IAAiB,GAAA,EAAK,yBAAA;AAAA;;;;;;;;;;;;;;iBAgBF,WAAA,QAAmB,IAAA,EAAM,eAAA,CAAgB,KAAA,IAAS,OAAA,CAAQ,KAAA"}
1
+ {"version":3,"file":"use-case-pipeline.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/use-cases/use-case-pipeline.ts"],"mappings":";;;YAWY,gBAAgB;EAC1B;EACA;EACA,MAAM;EACN,KAAK;EACL,WAAW;EACX,SAAS;EACT,SAAS,aAAa;EACtB,SAAS,wBAAwB;;EAEjC,eAAe,KAAK;;EAEpB,iBAAiB,KAAK;;;;;;;;;;;;;;;wBAgBF,YAAY,OAAO,MAAM,gBAAgB,SAAS,QAAQ"}