@ddd-ts-kit/di 0.0.0-stage → 0.1.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 (446) hide show
  1. package/README.md +1075 -2
  2. package/dist/application/application-options.d.ts +19 -0
  3. package/dist/application/application-options.d.ts.map +1 -0
  4. package/dist/application/application-options.js +2 -0
  5. package/dist/application/application-options.js.map +1 -0
  6. package/dist/application/application.d.ts +22 -0
  7. package/dist/application/application.d.ts.map +1 -0
  8. package/dist/application/application.js +2 -0
  9. package/dist/application/application.js.map +1 -0
  10. package/dist/application/assemble.d.ts +6 -0
  11. package/dist/application/assemble.d.ts.map +1 -0
  12. package/dist/application/assemble.js +16 -0
  13. package/dist/application/assemble.js.map +1 -0
  14. package/dist/application/binding-info.d.ts +10 -0
  15. package/dist/application/binding-info.d.ts.map +1 -0
  16. package/dist/application/binding-info.js +2 -0
  17. package/dist/application/binding-info.js.map +1 -0
  18. package/dist/application/bound-ports.d.ts +8 -0
  19. package/dist/application/bound-ports.d.ts.map +1 -0
  20. package/dist/application/bound-ports.js +2 -0
  21. package/dist/application/bound-ports.js.map +1 -0
  22. package/dist/application/consumer-subscriptions.d.ts +21 -0
  23. package/dist/application/consumer-subscriptions.d.ts.map +1 -0
  24. package/dist/application/consumer-subscriptions.js +59 -0
  25. package/dist/application/consumer-subscriptions.js.map +1 -0
  26. package/dist/application/container-application.d.ts +44 -0
  27. package/dist/application/container-application.d.ts.map +1 -0
  28. package/dist/application/container-application.js +224 -0
  29. package/dist/application/container-application.js.map +1 -0
  30. package/dist/application/create-application.d.ts +10 -0
  31. package/dist/application/create-application.d.ts.map +1 -0
  32. package/dist/application/create-application.js +12 -0
  33. package/dist/application/create-application.js.map +1 -0
  34. package/dist/application/decorate.d.ts +8 -0
  35. package/dist/application/decorate.d.ts.map +1 -0
  36. package/dist/application/decorate.js +2 -0
  37. package/dist/application/decorate.js.map +1 -0
  38. package/dist/application/delegating-applications.d.ts +7 -0
  39. package/dist/application/delegating-applications.d.ts.map +1 -0
  40. package/dist/application/delegating-applications.js +6 -0
  41. package/dist/application/delegating-applications.js.map +1 -0
  42. package/dist/application/failures-of.d.ts +3 -0
  43. package/dist/application/failures-of.d.ts.map +1 -0
  44. package/dist/application/failures-of.js +13 -0
  45. package/dist/application/failures-of.js.map +1 -0
  46. package/dist/application/is-handler-registry.d.ts +9 -0
  47. package/dist/application/is-handler-registry.d.ts.map +1 -0
  48. package/dist/application/is-handler-registry.js +5 -0
  49. package/dist/application/is-handler-registry.js.map +1 -0
  50. package/dist/application/job-lifecycle.d.ts +16 -0
  51. package/dist/application/job-lifecycle.d.ts.map +1 -0
  52. package/dist/application/job-lifecycle.js +48 -0
  53. package/dist/application/job-lifecycle.js.map +1 -0
  54. package/dist/application/override-for-tests.d.ts +8 -0
  55. package/dist/application/override-for-tests.d.ts.map +1 -0
  56. package/dist/application/override-for-tests.js +14 -0
  57. package/dist/application/override-for-tests.js.map +1 -0
  58. package/dist/application/override.d.ts +5 -0
  59. package/dist/application/override.d.ts.map +1 -0
  60. package/dist/application/override.js +5 -0
  61. package/dist/application/override.js.map +1 -0
  62. package/dist/application/with-binding-aspects.d.ts +8 -0
  63. package/dist/application/with-binding-aspects.d.ts.map +1 -0
  64. package/dist/application/with-binding-aspects.js +26 -0
  65. package/dist/application/with-binding-aspects.js.map +1 -0
  66. package/dist/authorization/assert-authorization-declared.d.ts +5 -0
  67. package/dist/authorization/assert-authorization-declared.d.ts.map +1 -0
  68. package/dist/authorization/assert-authorization-declared.js +28 -0
  69. package/dist/authorization/assert-authorization-declared.js.map +1 -0
  70. package/dist/authorization/authorization-mode.d.ts +3 -0
  71. package/dist/authorization/authorization-mode.d.ts.map +1 -0
  72. package/dist/authorization/authorization-mode.js +2 -0
  73. package/dist/authorization/authorization-mode.js.map +1 -0
  74. package/dist/authorization/declarations-of.d.ts +4 -0
  75. package/dist/authorization/declarations-of.d.ts.map +1 -0
  76. package/dist/authorization/declarations-of.js +4 -0
  77. package/dist/authorization/declarations-of.js.map +1 -0
  78. package/dist/authorization/declared-policies.d.ts +10 -0
  79. package/dist/authorization/declared-policies.d.ts.map +1 -0
  80. package/dist/authorization/declared-policies.js +8 -0
  81. package/dist/authorization/declared-policies.js.map +1 -0
  82. package/dist/authorization/declared-requirement.d.ts +5 -0
  83. package/dist/authorization/declared-requirement.d.ts.map +1 -0
  84. package/dist/authorization/declared-requirement.js +16 -0
  85. package/dist/authorization/declared-requirement.js.map +1 -0
  86. package/dist/authorization/pass-every-message.d.ts +3 -0
  87. package/dist/authorization/pass-every-message.d.ts.map +1 -0
  88. package/dist/authorization/pass-every-message.js +2 -0
  89. package/dist/authorization/pass-every-message.js.map +1 -0
  90. package/dist/authorization/protected-requirement.d.ts +6 -0
  91. package/dist/authorization/protected-requirement.d.ts.map +1 -0
  92. package/dist/authorization/protected-requirement.js +9 -0
  93. package/dist/authorization/protected-requirement.js.map +1 -0
  94. package/dist/authorization/requirement-options.d.ts +8 -0
  95. package/dist/authorization/requirement-options.d.ts.map +1 -0
  96. package/dist/authorization/requirement-options.js +2 -0
  97. package/dist/authorization/requirement-options.js.map +1 -0
  98. package/dist/authorization/requirement.d.ts +5 -0
  99. package/dist/authorization/requirement.d.ts.map +1 -0
  100. package/dist/authorization/requirement.js +2 -0
  101. package/dist/authorization/requirement.js.map +1 -0
  102. package/dist/authorization/use-case-access.d.ts +2 -0
  103. package/dist/authorization/use-case-access.d.ts.map +1 -0
  104. package/dist/authorization/use-case-access.js +2 -0
  105. package/dist/authorization/use-case-access.js.map +1 -0
  106. package/dist/authorization/use-case-declaration.d.ts +14 -0
  107. package/dist/authorization/use-case-declaration.d.ts.map +1 -0
  108. package/dist/authorization/use-case-declaration.js +2 -0
  109. package/dist/authorization/use-case-declaration.js.map +1 -0
  110. package/dist/authorization/use-case-declarations.d.ts +7 -0
  111. package/dist/authorization/use-case-declarations.d.ts.map +1 -0
  112. package/dist/authorization/use-case-declarations.js +5 -0
  113. package/dist/authorization/use-case-declarations.js.map +1 -0
  114. package/dist/authorization/use-case-guard-middleware.d.ts +5 -0
  115. package/dist/authorization/use-case-guard-middleware.d.ts.map +1 -0
  116. package/dist/authorization/use-case-guard-middleware.js +6 -0
  117. package/dist/authorization/use-case-guard-middleware.js.map +1 -0
  118. package/dist/authorization/use-case-guard.d.ts +10 -0
  119. package/dist/authorization/use-case-guard.d.ts.map +1 -0
  120. package/dist/authorization/use-case-guard.js +8 -0
  121. package/dist/authorization/use-case-guard.js.map +1 -0
  122. package/dist/checks/assert-sound.d.ts +5 -0
  123. package/dist/checks/assert-sound.d.ts.map +1 -0
  124. package/dist/checks/assert-sound.js +74 -0
  125. package/dist/checks/assert-sound.js.map +1 -0
  126. package/dist/checks/cycle-error.d.ts +4 -0
  127. package/dist/checks/cycle-error.d.ts.map +1 -0
  128. package/dist/checks/cycle-error.js +6 -0
  129. package/dist/checks/cycle-error.js.map +1 -0
  130. package/dist/consumer/consumer-options.d.ts +14 -0
  131. package/dist/consumer/consumer-options.d.ts.map +1 -0
  132. package/dist/consumer/consumer-options.js +2 -0
  133. package/dist/consumer/consumer-options.js.map +1 -0
  134. package/dist/consumer/consumer-runtime.d.ts +9 -0
  135. package/dist/consumer/consumer-runtime.d.ts.map +1 -0
  136. package/dist/consumer/consumer-runtime.js +2 -0
  137. package/dist/consumer/consumer-runtime.js.map +1 -0
  138. package/dist/consumer/observed-projection.d.ts +19 -0
  139. package/dist/consumer/observed-projection.d.ts.map +1 -0
  140. package/dist/consumer/observed-projection.js +44 -0
  141. package/dist/consumer/observed-projection.js.map +1 -0
  142. package/dist/consumer/receive.d.ts +21 -0
  143. package/dist/consumer/receive.d.ts.map +1 -0
  144. package/dist/consumer/receive.js +40 -0
  145. package/dist/consumer/receive.js.map +1 -0
  146. package/dist/consumer/unreadable-event-error.d.ts +9 -0
  147. package/dist/consumer/unreadable-event-error.d.ts.map +1 -0
  148. package/dist/consumer/unreadable-event-error.js +15 -0
  149. package/dist/consumer/unreadable-event-error.js.map +1 -0
  150. package/dist/declared/apply-through.d.ts +3 -0
  151. package/dist/declared/apply-through.d.ts.map +1 -0
  152. package/dist/declared/apply-through.js +11 -0
  153. package/dist/declared/apply-through.js.map +1 -0
  154. package/dist/declared/consumption-of.d.ts +15 -0
  155. package/dist/declared/consumption-of.d.ts.map +1 -0
  156. package/dist/declared/consumption-of.js +15 -0
  157. package/dist/declared/consumption-of.js.map +1 -0
  158. package/dist/declared/context-module.d.ts +10 -0
  159. package/dist/declared/context-module.d.ts.map +1 -0
  160. package/dist/declared/context-module.js +16 -0
  161. package/dist/declared/context-module.js.map +1 -0
  162. package/dist/declared/declared-source.d.ts +7 -0
  163. package/dist/declared/declared-source.d.ts.map +1 -0
  164. package/dist/declared/declared-source.js +2 -0
  165. package/dist/declared/declared-source.js.map +1 -0
  166. package/dist/declared/discovered-files.d.ts +6 -0
  167. package/dist/declared/discovered-files.d.ts.map +1 -0
  168. package/dist/declared/discovered-files.js +10 -0
  169. package/dist/declared/discovered-files.js.map +1 -0
  170. package/dist/declared/include-declared.d.ts +10 -0
  171. package/dist/declared/include-declared.d.ts.map +1 -0
  172. package/dist/declared/include-declared.js +173 -0
  173. package/dist/declared/include-declared.js.map +1 -0
  174. package/dist/declared/projection-of.d.ts +24 -0
  175. package/dist/declared/projection-of.d.ts.map +1 -0
  176. package/dist/declared/projection-of.js +73 -0
  177. package/dist/declared/projection-of.js.map +1 -0
  178. package/dist/description/describe-wiring.d.ts +6 -0
  179. package/dist/description/describe-wiring.d.ts.map +1 -0
  180. package/dist/description/describe-wiring.js +77 -0
  181. package/dist/description/describe-wiring.js.map +1 -0
  182. package/dist/description/wiring-description.d.ts +98 -0
  183. package/dist/description/wiring-description.d.ts.map +1 -0
  184. package/dist/description/wiring-description.js +2 -0
  185. package/dist/description/wiring-description.js.map +1 -0
  186. package/dist/discovery/discover-context.d.ts +27 -0
  187. package/dist/discovery/discover-context.d.ts.map +1 -0
  188. package/dist/discovery/discover-context.js +69 -0
  189. package/dist/discovery/discover-context.js.map +1 -0
  190. package/dist/discovery/role-files-of.d.ts +16 -0
  191. package/dist/discovery/role-files-of.d.ts.map +1 -0
  192. package/dist/discovery/role-files-of.js +63 -0
  193. package/dist/discovery/role-files-of.js.map +1 -0
  194. package/dist/discovery/role-rule.d.ts +10 -0
  195. package/dist/discovery/role-rule.d.ts.map +1 -0
  196. package/dist/discovery/role-rule.js +23 -0
  197. package/dist/discovery/role-rule.js.map +1 -0
  198. package/dist/discovery.d.ts +2 -0
  199. package/dist/discovery.d.ts.map +1 -0
  200. package/dist/discovery.js +2 -0
  201. package/dist/discovery.js.map +1 -0
  202. package/dist/errors/wiring-error.d.ts +7 -0
  203. package/dist/errors/wiring-error.d.ts.map +1 -0
  204. package/dist/errors/wiring-error.js +10 -0
  205. package/dist/errors/wiring-error.js.map +1 -0
  206. package/dist/index.d.ts +52 -0
  207. package/dist/index.d.ts.map +1 -0
  208. package/dist/index.js +20 -0
  209. package/dist/index.js.map +1 -0
  210. package/dist/jobs/definition-of.d.ts +7 -0
  211. package/dist/jobs/definition-of.d.ts.map +1 -0
  212. package/dist/jobs/definition-of.js +11 -0
  213. package/dist/jobs/definition-of.js.map +1 -0
  214. package/dist/jobs/effective-job.d.ts +7 -0
  215. package/dist/jobs/effective-job.d.ts.map +1 -0
  216. package/dist/jobs/effective-job.js +2 -0
  217. package/dist/jobs/effective-job.js.map +1 -0
  218. package/dist/jobs/effective-jobs.d.ts +6 -0
  219. package/dist/jobs/effective-jobs.d.ts.map +1 -0
  220. package/dist/jobs/effective-jobs.js +33 -0
  221. package/dist/jobs/effective-jobs.js.map +1 -0
  222. package/dist/jobs/jobs-options.d.ts +16 -0
  223. package/dist/jobs/jobs-options.d.ts.map +1 -0
  224. package/dist/jobs/jobs-options.js +2 -0
  225. package/dist/jobs/jobs-options.js.map +1 -0
  226. package/dist/jobs/readable.d.ts +3 -0
  227. package/dist/jobs/readable.d.ts.map +1 -0
  228. package/dist/jobs/readable.js +15 -0
  229. package/dist/jobs/readable.js.map +1 -0
  230. package/dist/jobs/written-job.d.ts +11 -0
  231. package/dist/jobs/written-job.d.ts.map +1 -0
  232. package/dist/jobs/written-job.js +8 -0
  233. package/dist/jobs/written-job.js.map +1 -0
  234. package/dist/kernel/guarded-query-bus.d.ts +5 -0
  235. package/dist/kernel/guarded-query-bus.d.ts.map +1 -0
  236. package/dist/kernel/guarded-query-bus.js +9 -0
  237. package/dist/kernel/guarded-query-bus.js.map +1 -0
  238. package/dist/kernel/instrumentation.d.ts +37 -0
  239. package/dist/kernel/instrumentation.d.ts.map +1 -0
  240. package/dist/kernel/instrumentation.js +9 -0
  241. package/dist/kernel/instrumentation.js.map +1 -0
  242. package/dist/kernel/kernel-module-options.d.ts +57 -0
  243. package/dist/kernel/kernel-module-options.d.ts.map +1 -0
  244. package/dist/kernel/kernel-module-options.js +2 -0
  245. package/dist/kernel/kernel-module-options.js.map +1 -0
  246. package/dist/kernel/kernel-module.d.ts +14 -0
  247. package/dist/kernel/kernel-module.d.ts.map +1 -0
  248. package/dist/kernel/kernel-module.js +133 -0
  249. package/dist/kernel/kernel-module.js.map +1 -0
  250. package/dist/kernel/kernel-ports.d.ts +4 -0
  251. package/dist/kernel/kernel-ports.d.ts.map +1 -0
  252. package/dist/kernel/kernel-ports.js +25 -0
  253. package/dist/kernel/kernel-ports.js.map +1 -0
  254. package/dist/kernel/lazy-error-reporter.d.ts +8 -0
  255. package/dist/kernel/lazy-error-reporter.d.ts.map +1 -0
  256. package/dist/kernel/lazy-error-reporter.js +14 -0
  257. package/dist/kernel/lazy-error-reporter.js.map +1 -0
  258. package/dist/kernel/provided.d.ts +4 -0
  259. package/dist/kernel/provided.d.ts.map +1 -0
  260. package/dist/kernel/provided.js +2 -0
  261. package/dist/kernel/provided.js.map +1 -0
  262. package/dist/kernel/reported-failures.d.ts +5 -0
  263. package/dist/kernel/reported-failures.d.ts.map +1 -0
  264. package/dist/kernel/reported-failures.js +9 -0
  265. package/dist/kernel/reported-failures.js.map +1 -0
  266. package/dist/kernel/transactional-command-bus.d.ts +10 -0
  267. package/dist/kernel/transactional-command-bus.d.ts.map +1 -0
  268. package/dist/kernel/transactional-command-bus.js +17 -0
  269. package/dist/kernel/transactional-command-bus.js.map +1 -0
  270. package/dist/module/binding-options-of.d.ts +5 -0
  271. package/dist/module/binding-options-of.d.ts.map +1 -0
  272. package/dist/module/binding-options-of.js +23 -0
  273. package/dist/module/binding-options-of.js.map +1 -0
  274. package/dist/module/binding-options.d.ts +8 -0
  275. package/dist/module/binding-options.d.ts.map +1 -0
  276. package/dist/module/binding-options.js +2 -0
  277. package/dist/module/binding-options.js.map +1 -0
  278. package/dist/module/binding-target.d.ts +15 -0
  279. package/dist/module/binding-target.d.ts.map +1 -0
  280. package/dist/module/binding-target.js +2 -0
  281. package/dist/module/binding-target.js.map +1 -0
  282. package/dist/module/collect-wiring.d.ts +5 -0
  283. package/dist/module/collect-wiring.d.ts.map +1 -0
  284. package/dist/module/collect-wiring.js +13 -0
  285. package/dist/module/collect-wiring.js.map +1 -0
  286. package/dist/module/context-module.d.ts +10 -0
  287. package/dist/module/context-module.d.ts.map +1 -0
  288. package/dist/module/context-module.js +2 -0
  289. package/dist/module/context-module.js.map +1 -0
  290. package/dist/module/define-context-module.d.ts +4 -0
  291. package/dist/module/define-context-module.d.ts.map +1 -0
  292. package/dist/module/define-context-module.js +5 -0
  293. package/dist/module/define-context-module.js.map +1 -0
  294. package/dist/module/factory-made-handlers.d.ts +6 -0
  295. package/dist/module/factory-made-handlers.d.ts.map +1 -0
  296. package/dist/module/factory-made-handlers.js +24 -0
  297. package/dist/module/factory-made-handlers.js.map +1 -0
  298. package/dist/module/handler-target.d.ts +11 -0
  299. package/dist/module/handler-target.d.ts.map +1 -0
  300. package/dist/module/handler-target.js +2 -0
  301. package/dist/module/handler-target.js.map +1 -0
  302. package/dist/module/module-builder.d.ts +50 -0
  303. package/dist/module/module-builder.d.ts.map +1 -0
  304. package/dist/module/module-builder.js +2 -0
  305. package/dist/module/module-builder.js.map +1 -0
  306. package/dist/module/module-context.d.ts +5 -0
  307. package/dist/module/module-context.d.ts.map +1 -0
  308. package/dist/module/module-context.js +2 -0
  309. package/dist/module/module-context.js.map +1 -0
  310. package/dist/module/module-recorder.d.ts +31 -0
  311. package/dist/module/module-recorder.d.ts.map +1 -0
  312. package/dist/module/module-recorder.js +133 -0
  313. package/dist/module/module-recorder.js.map +1 -0
  314. package/dist/module/protected-use-case-target.d.ts +14 -0
  315. package/dist/module/protected-use-case-target.d.ts.map +1 -0
  316. package/dist/module/protected-use-case-target.js +2 -0
  317. package/dist/module/protected-use-case-target.js.map +1 -0
  318. package/dist/module/use-case-target.d.ts +8 -0
  319. package/dist/module/use-case-target.d.ts.map +1 -0
  320. package/dist/module/use-case-target.js +2 -0
  321. package/dist/module/use-case-target.js.map +1 -0
  322. package/dist/module/value-binding-options.d.ts +13 -0
  323. package/dist/module/value-binding-options.d.ts.map +1 -0
  324. package/dist/module/value-binding-options.js +2 -0
  325. package/dist/module/value-binding-options.js.map +1 -0
  326. package/dist/testing/create-test-application.d.ts +12 -0
  327. package/dist/testing/create-test-application.d.ts.map +1 -0
  328. package/dist/testing/create-test-application.js +89 -0
  329. package/dist/testing/create-test-application.js.map +1 -0
  330. package/dist/testing/create-test-kernel.d.ts +6 -0
  331. package/dist/testing/create-test-kernel.d.ts.map +1 -0
  332. package/dist/testing/create-test-kernel.js +65 -0
  333. package/dist/testing/create-test-kernel.js.map +1 -0
  334. package/dist/testing/fake.d.ts +5 -0
  335. package/dist/testing/fake.d.ts.map +1 -0
  336. package/dist/testing/fake.js +6 -0
  337. package/dist/testing/fake.js.map +1 -0
  338. package/dist/testing/test-application-of.d.ts +10 -0
  339. package/dist/testing/test-application-of.d.ts.map +1 -0
  340. package/dist/testing/test-application-of.js +49 -0
  341. package/dist/testing/test-application-of.js.map +1 -0
  342. package/dist/testing/test-application-options.d.ts +35 -0
  343. package/dist/testing/test-application-options.d.ts.map +1 -0
  344. package/dist/testing/test-application-options.js +2 -0
  345. package/dist/testing/test-application-options.js.map +1 -0
  346. package/dist/testing/test-application.d.ts +15 -0
  347. package/dist/testing/test-application.d.ts.map +1 -0
  348. package/dist/testing/test-application.js +2 -0
  349. package/dist/testing/test-application.js.map +1 -0
  350. package/dist/testing/test-jobs.d.ts +16 -0
  351. package/dist/testing/test-jobs.d.ts.map +1 -0
  352. package/dist/testing/test-jobs.js +2 -0
  353. package/dist/testing/test-jobs.js.map +1 -0
  354. package/dist/testing/test-kernel.d.ts +39 -0
  355. package/dist/testing/test-kernel.d.ts.map +1 -0
  356. package/dist/testing/test-kernel.js +2 -0
  357. package/dist/testing/test-kernel.js.map +1 -0
  358. package/dist/token/same-token.d.ts +3 -0
  359. package/dist/token/same-token.d.ts.map +1 -0
  360. package/dist/token/same-token.js +5 -0
  361. package/dist/token/same-token.js.map +1 -0
  362. package/dist/token/token-map.d.ts +14 -0
  363. package/dist/token/token-map.d.ts.map +1 -0
  364. package/dist/token/token-map.js +24 -0
  365. package/dist/token/token-map.js.map +1 -0
  366. package/dist/token/token-set.d.ts +9 -0
  367. package/dist/token/token-set.d.ts.map +1 -0
  368. package/dist/token/token-set.js +19 -0
  369. package/dist/token/token-set.js.map +1 -0
  370. package/dist/wiring/any-message-handler.d.ts +5 -0
  371. package/dist/wiring/any-message-handler.d.ts.map +1 -0
  372. package/dist/wiring/any-message-handler.js +2 -0
  373. package/dist/wiring/any-message-handler.js.map +1 -0
  374. package/dist/wiring/assert-port.d.ts +4 -0
  375. package/dist/wiring/assert-port.d.ts.map +1 -0
  376. package/dist/wiring/assert-port.js +10 -0
  377. package/dist/wiring/assert-port.js.map +1 -0
  378. package/dist/wiring/binding-source.d.ts +2 -0
  379. package/dist/wiring/binding-source.d.ts.map +1 -0
  380. package/dist/wiring/binding-source.js +2 -0
  381. package/dist/wiring/binding-source.js.map +1 -0
  382. package/dist/wiring/binding.d.ts +22 -0
  383. package/dist/wiring/binding.d.ts.map +1 -0
  384. package/dist/wiring/binding.js +2 -0
  385. package/dist/wiring/binding.js.map +1 -0
  386. package/dist/wiring/declarer.d.ts +6 -0
  387. package/dist/wiring/declarer.d.ts.map +1 -0
  388. package/dist/wiring/declarer.js +2 -0
  389. package/dist/wiring/declarer.js.map +1 -0
  390. package/dist/wiring/domain-event-handling.d.ts +20 -0
  391. package/dist/wiring/domain-event-handling.d.ts.map +1 -0
  392. package/dist/wiring/domain-event-handling.js +2 -0
  393. package/dist/wiring/domain-event-handling.js.map +1 -0
  394. package/dist/wiring/event-consumption.d.ts +17 -0
  395. package/dist/wiring/event-consumption.d.ts.map +1 -0
  396. package/dist/wiring/event-consumption.js +2 -0
  397. package/dist/wiring/event-consumption.js.map +1 -0
  398. package/dist/wiring/job-registration.d.ts +14 -0
  399. package/dist/wiring/job-registration.d.ts.map +1 -0
  400. package/dist/wiring/job-registration.js +2 -0
  401. package/dist/wiring/job-registration.js.map +1 -0
  402. package/dist/wiring/kind-aspect.d.ts +11 -0
  403. package/dist/wiring/kind-aspect.d.ts.map +1 -0
  404. package/dist/wiring/kind-aspect.js +2 -0
  405. package/dist/wiring/kind-aspect.js.map +1 -0
  406. package/dist/wiring/lifetime.d.ts +2 -0
  407. package/dist/wiring/lifetime.d.ts.map +1 -0
  408. package/dist/wiring/lifetime.js +2 -0
  409. package/dist/wiring/lifetime.js.map +1 -0
  410. package/dist/wiring/message-handling.d.ts +15 -0
  411. package/dist/wiring/message-handling.d.ts.map +1 -0
  412. package/dist/wiring/message-handling.js +2 -0
  413. package/dist/wiring/message-handling.js.map +1 -0
  414. package/dist/wiring/natural-kind.d.ts +9 -0
  415. package/dist/wiring/natural-kind.d.ts.map +1 -0
  416. package/dist/wiring/natural-kind.js +11 -0
  417. package/dist/wiring/natural-kind.js.map +1 -0
  418. package/dist/wiring/policy-binding.d.ts +11 -0
  419. package/dist/wiring/policy-binding.d.ts.map +1 -0
  420. package/dist/wiring/policy-binding.js +2 -0
  421. package/dist/wiring/policy-binding.js.map +1 -0
  422. package/dist/wiring/projection-registration.d.ts +22 -0
  423. package/dist/wiring/projection-registration.d.ts.map +1 -0
  424. package/dist/wiring/projection-registration.js +2 -0
  425. package/dist/wiring/projection-registration.js.map +1 -0
  426. package/dist/wiring/recipe.d.ts +9 -0
  427. package/dist/wiring/recipe.d.ts.map +1 -0
  428. package/dist/wiring/recipe.js +15 -0
  429. package/dist/wiring/recipe.js.map +1 -0
  430. package/dist/wiring/resolve.d.ts +3 -0
  431. package/dist/wiring/resolve.d.ts.map +1 -0
  432. package/dist/wiring/resolve.js +2 -0
  433. package/dist/wiring/resolve.js.map +1 -0
  434. package/dist/wiring/where-of.d.ts +9 -0
  435. package/dist/wiring/where-of.d.ts.map +1 -0
  436. package/dist/wiring/where-of.js +9 -0
  437. package/dist/wiring/where-of.js.map +1 -0
  438. package/dist/wiring/wiring-draft.d.ts +31 -0
  439. package/dist/wiring/wiring-draft.d.ts.map +1 -0
  440. package/dist/wiring/wiring-draft.js +83 -0
  441. package/dist/wiring/wiring-draft.js.map +1 -0
  442. package/dist/wiring/wiring.d.ts +23 -0
  443. package/dist/wiring/wiring.d.ts.map +1 -0
  444. package/dist/wiring/wiring.js +2 -0
  445. package/dist/wiring/wiring.js.map +1 -0
  446. package/package.json +42 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-module-options.js","sourceRoot":"","sources":["../../src/kernel/kernel-module-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ import type { ContextModule } from '../module/context-module.js';
2
+ import type { KernelModuleOptions } from './kernel-module-options.js';
3
+ /**
4
+ * Binds the ports of the kernel to in-process defaults: system clock, UUIDs, in-memory buses, a
5
+ * command bus running every command in the unit of work, both buses asking the use case guard
6
+ * first and handing their unexpected failures to the error reporter. Replace one through the options, or from a later module with `builder.rebind(Clock)`.
7
+ *
8
+ * Every binding of kind `repository`, in every module, hands over the domain events of the
9
+ * aggregates it is given once the call resolved (`dispatchingOnSave`): handlers only save, and
10
+ * the unit of work of the command dispatches them at its end, before the commit. A failure of
11
+ * an `after-commit` handler goes to the `Logger` and the `ErrorReporter`.
12
+ */
13
+ export declare function kernelModule(options?: KernelModuleOptions): ContextModule;
14
+ //# sourceMappingURL=kernel-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-module.d.ts","sourceRoot":"","sources":["../../src/kernel/kernel-module.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAMjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAgBtE;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa,CAgB7E"}
@@ -0,0 +1,133 @@
1
+ import { ActorContext, AsyncLocalStorageExecutionScope, Cache, Clock, CommandBus, DomainEventDispatcher, ErrorReporter, EventBus, EventSubscribers, ExecutionScope, IdGenerator, InMemoryCache, InMemoryDomainEventDispatcher, InMemoryEventBus, InMemoryLock, InMemoryProcessedEventStore, InMemoryRateLimiter, InMemoryUnitOfWork, IntegrationEventPublisher, IntegrationEventSubscriber, JobScheduler, Lock, Logger, Metrics, NoopErrorReporter, NoopLogger, NoopMetrics, ProcessedEventStore, QueryBus, RateLimiter, ScopedActorContext, SystemClock, UnitOfWork, UuidGenerator, dispatchingOnSave, reportAfterCommitFailures, } from '@ddd-ts-kit/kernel';
2
+ import { InProcessJobScheduler, reportFailedRuns } from '@ddd-ts-kit/scheduling';
3
+ import { defineContextModule } from '../module/define-context-module.js';
4
+ import { guardedQueryBus } from './guarded-query-bus.js';
5
+ import { Instrumentation } from './instrumentation.js';
6
+ import { lazyErrorReporter } from './lazy-error-reporter.js';
7
+ import { transactionalCommandBus } from './transactional-command-bus.js';
8
+ const EVERY_KIND = [
9
+ 'repository',
10
+ 'gateway',
11
+ 'external',
12
+ 'use-case',
13
+ 'publisher',
14
+ 'consumer',
15
+ 'domain-event-handler',
16
+ 'job',
17
+ ];
18
+ /**
19
+ * Binds the ports of the kernel to in-process defaults: system clock, UUIDs, in-memory buses, a
20
+ * command bus running every command in the unit of work, both buses asking the use case guard
21
+ * first and handing their unexpected failures to the error reporter. Replace one through the options, or from a later module with `builder.rebind(Clock)`.
22
+ *
23
+ * Every binding of kind `repository`, in every module, hands over the domain events of the
24
+ * aggregates it is given once the call resolved (`dispatchingOnSave`): handlers only save, and
25
+ * the unit of work of the command dispatches them at its end, before the commit. A failure of
26
+ * an `after-commit` handler goes to the `Logger` and the `ErrorReporter`.
27
+ */
28
+ export function kernelModule(options = {}) {
29
+ const instrumentation = options.instrumentation ?? {};
30
+ return defineContextModule({
31
+ name: 'kernel',
32
+ register(builder) {
33
+ builder.bind(Instrumentation).toValue(instrumentation);
34
+ builder.bind(Clock).toFactory(either(options.clock, () => new SystemClock()));
35
+ builder.bind(IdGenerator).toFactory(either(options.ids, () => new UuidGenerator()));
36
+ builder.bind(UnitOfWork).toFactory(either(options.unitOfWork, () => new InMemoryUnitOfWork()));
37
+ bindBuses(builder, options);
38
+ bindEventPorts(builder, options);
39
+ bindCrossCuttingPorts(builder, options);
40
+ wrapBindings(builder, instrumentation);
41
+ },
42
+ });
43
+ }
44
+ function bindBuses(builder, { commandBus, queryBus, instrumentation }) {
45
+ const observed = instrumentation?.useCase;
46
+ builder.bind(CommandBus).toFactory(either(commandBus, (resolve) => transactionalCommandBus(resolve, observed)));
47
+ builder.bind(QueryBus).toFactory(either(queryBus, (resolve) => guardedQueryBus(resolve, observed)));
48
+ }
49
+ /** Declared in this order: what observes a binding is outside the dispatch, so it sees the save and what the save announced. */
50
+ function wrapBindings(builder, { binding }) {
51
+ if (binding !== undefined) {
52
+ builder.around(EVERY_KIND, () => binding);
53
+ }
54
+ builder.around(['repository'], (resolve) => (repository) => dispatchingOnSave(repository, () => resolve(DomainEventDispatcher)));
55
+ }
56
+ function either(provided, fallback) {
57
+ if (provided === undefined) {
58
+ return fallback;
59
+ }
60
+ return isFactory(provided) ? provided : () => provided;
61
+ }
62
+ function isFactory(provided) {
63
+ return typeof provided === 'function';
64
+ }
65
+ function bindEventPorts(builder, options) {
66
+ builder.bind(EventBus).toFactory(either(options.eventBus, () => new InMemoryEventBus()));
67
+ builder.bind(IntegrationEventPublisher).toFactory(wrapped(either(options.eventPublisher, (resolve) => resolve(EventBus)), options.instrumentation?.publisher));
68
+ builder.bind(IntegrationEventSubscriber).toFactory(either(options.eventSubscriber, (resolve) => resolve(EventBus)));
69
+ builder.bind(EventSubscribers).toFactory(either(options.eventSubscribers, oneSubscriberForAll));
70
+ builder.bind(ProcessedEventStore).toFactory(either(options.processedEvents, () => new InMemoryProcessedEventStore()));
71
+ }
72
+ /** The port as the options or the default give it, inside what the instrumentation puts around it. */
73
+ function wrapped(build, wrap) {
74
+ return wrap === undefined ? build : (resolve) => wrap(build(resolve));
75
+ }
76
+ function oneSubscriberForAll(resolve) {
77
+ return { forContext: () => resolve(IntegrationEventSubscriber) };
78
+ }
79
+ function bindCrossCuttingPorts(builder, options) {
80
+ const { instrumentation = {} } = options;
81
+ builder.bind(ExecutionScope).toFactory(wrapped(either(options.executionScope, () => new AsyncLocalStorageExecutionScope()), told(instrumentation)));
82
+ builder.bind(ActorContext).toFactory(either(options.actorContext, scopedActorContext));
83
+ builder
84
+ .bind(DomainEventDispatcher)
85
+ .toFactory(wrapped(either(options.domainEvents, inProcessDomainEvents), instrumentation.domainEvents));
86
+ builder.bind(Logger).toFactory(either(options.logger, () => new NoopLogger()));
87
+ builder.bind(Metrics).toFactory(either(options.metrics, () => new NoopMetrics()));
88
+ builder.bind(ErrorReporter).toFactory(wrapped(either(options.errorReporter, () => new NoopErrorReporter()), instrumentation.errorReporter));
89
+ builder.bind(Cache).toFactory(either(options.cache, (resolve) => new InMemoryCache(resolve(Clock))));
90
+ builder.bind(Lock).toFactory(either(options.lock, (resolve) => new InMemoryLock(resolve(Clock))));
91
+ builder
92
+ .bind(RateLimiter)
93
+ .toFactory(either(options.rateLimiter, (resolve) => new InMemoryRateLimiter(resolve(Clock))));
94
+ builder.bind(JobScheduler).toFactory(either(options.jobScheduler, inProcessJobScheduler));
95
+ }
96
+ /** The logger, the reporter and the scope are resolved at each failure: a later module or a test may replace them. */
97
+ function inProcessDomainEvents(resolve) {
98
+ const failed = reportAfterCommitFailures({
99
+ reporter: lazyErrorReporter(resolve),
100
+ logger: { error: (message, fields) => resolve(Logger).error(message, fields) },
101
+ scope: { current: () => resolve(ExecutionScope).current() },
102
+ });
103
+ return new InMemoryDomainEventDispatcher(failed);
104
+ }
105
+ function told({ executionScope }) {
106
+ if (executionScope === undefined) {
107
+ return undefined;
108
+ }
109
+ return (scope) => {
110
+ executionScope(scope);
111
+ return scope;
112
+ };
113
+ }
114
+ function scopedActorContext(resolve) {
115
+ return new ScopedActorContext(resolve(ExecutionScope), resolve(IdGenerator));
116
+ }
117
+ /**
118
+ * The lock and the error reporter are resolved when they are needed, not when the scheduler is
119
+ * built: the application resolves the scheduler at creation to register the jobs, and that must
120
+ * not open a connection.
121
+ */
122
+ function inProcessJobScheduler(resolve) {
123
+ return new InProcessJobScheduler({
124
+ clock: resolve(Clock),
125
+ lock: { acquire: (key, options) => resolve(Lock).acquire(key, options) },
126
+ scope: resolve(ExecutionScope),
127
+ ids: resolve(IdGenerator),
128
+ logger: resolve(Logger),
129
+ metrics: resolve(Metrics),
130
+ onRun: reportFailedRuns(lazyErrorReporter(resolve)),
131
+ });
132
+ }
133
+ //# sourceMappingURL=kernel-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-module.js","sourceRoot":"","sources":["../../src/kernel/kernel-module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,+BAA+B,EAC/B,KAAK,EACL,KAAK,EACL,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,aAAa,EACb,6BAA6B,EAC7B,gBAAgB,EAChB,YAAY,EACZ,2BAA2B,EAC3B,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB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4 @@
1
+ import type { Token } from '@ddd-ts-kit/kernel/declarations';
2
+ /** What `kernelModule()` binds: a test application gives each of them a deterministic stand-in. */
3
+ export declare const KERNEL_PORTS: readonly Token<unknown>[];
4
+ //# sourceMappingURL=kernel-ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-ports.d.ts","sourceRoot":"","sources":["../../src/kernel/kernel-ports.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAE7D,mGAAmG;AACnG,eAAO,MAAM,YAAY,EAAE,SAAS,KAAK,CAAC,OAAO,CAAC,EAqBjD,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { ActorContext, Cache, Clock, CommandBus, DomainEventDispatcher, ErrorReporter, EventBus, EventSubscribers, ExecutionScope, IdGenerator, IntegrationEventPublisher, IntegrationEventSubscriber, JobScheduler, Lock, Logger, Metrics, ProcessedEventStore, QueryBus, RateLimiter, UnitOfWork, } from '@ddd-ts-kit/kernel';
2
+ /** What `kernelModule()` binds: a test application gives each of them a deterministic stand-in. */
3
+ export const KERNEL_PORTS = [
4
+ Clock,
5
+ IdGenerator,
6
+ UnitOfWork,
7
+ CommandBus,
8
+ QueryBus,
9
+ EventBus,
10
+ IntegrationEventPublisher,
11
+ IntegrationEventSubscriber,
12
+ EventSubscribers,
13
+ ProcessedEventStore,
14
+ DomainEventDispatcher,
15
+ ActorContext,
16
+ ExecutionScope,
17
+ Logger,
18
+ Metrics,
19
+ ErrorReporter,
20
+ Cache,
21
+ Lock,
22
+ RateLimiter,
23
+ JobScheduler,
24
+ ];
25
+ //# sourceMappingURL=kernel-ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel-ports.js","sourceRoot":"","sources":["../../src/kernel/kernel-ports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,EACL,KAAK,EACL,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,yBAAyB,EACzB,0BAA0B,EAC1B,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAG5B,mGAAmG;AACnG,MAAM,CAAC,MAAM,YAAY,GAA8B;IACrD,KAAK;IACL,WAAW;IACX,UAAU;IACV,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,yBAAyB;IACzB,0BAA0B;IAC1B,gBAAgB;IAChB,mBAAmB;IACnB,qBAAqB;IACrB,YAAY;IACZ,cAAc;IACd,MAAM;IACN,OAAO;IACP,aAAa;IACb,KAAK;IACL,IAAI;IACJ,WAAW;IACX,YAAY;CACb,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ErrorReporter } from '@ddd-ts-kit/kernel';
2
+ import type { Resolve } from '../wiring/resolve.js';
3
+ /**
4
+ * The bound reporter, resolved at each failure: what is built when the application is created
5
+ * (the buses, the job scheduler) must build no adapter, and a test replaces the reporter later.
6
+ */
7
+ export declare function lazyErrorReporter(resolve: Resolve): ErrorReporter;
8
+ //# sourceMappingURL=lazy-error-reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-error-reporter.d.ts","sourceRoot":"","sources":["../../src/kernel/lazy-error-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAOjE"}
@@ -0,0 +1,14 @@
1
+ import { ErrorReporter } from '@ddd-ts-kit/kernel';
2
+ /**
3
+ * The bound reporter, resolved at each failure: what is built when the application is created
4
+ * (the buses, the job scheduler) must build no adapter, and a test replaces the reporter later.
5
+ */
6
+ export function lazyErrorReporter(resolve) {
7
+ return {
8
+ report: (error, report) => {
9
+ resolve(ErrorReporter).report(error, report);
10
+ },
11
+ flush: (timeoutMs) => resolve(ErrorReporter).flush(timeoutMs),
12
+ };
13
+ }
14
+ //# sourceMappingURL=lazy-error-reporter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-error-reporter.js","sourceRoot":"","sources":["../../src/kernel/lazy-error-reporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,OAAO;QACL,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,OAAO,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/C,CAAC;QACD,KAAK,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;KAC9D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Resolve } from '../wiring/resolve.js';
2
+ /** An instance, or a factory when it needs other bindings. A port is never itself a function. */
3
+ export type Provided<T> = T | ((resolve: Resolve) => T);
4
+ //# sourceMappingURL=provided.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided.d.ts","sourceRoot":"","sources":["../../src/kernel/provided.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,iGAAiG;AACjG,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=provided.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provided.js","sourceRoot":"","sources":["../../src/kernel/provided.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { type BusMiddleware } from '@ddd-ts-kit/kernel';
2
+ import type { Resolve } from '../wiring/resolve.js';
3
+ /** Resolved at each failure, so the reporter and the scope may be bound, rebound or faked after the bus exists. */
4
+ export declare function reportedFailures(resolve: Resolve): BusMiddleware;
5
+ //# sourceMappingURL=reported-failures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reported-failures.d.ts","sourceRoot":"","sources":["../../src/kernel/reported-failures.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD,mHAAmH;AACnH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAIhE"}
@@ -0,0 +1,9 @@
1
+ import { ExecutionScope, errorReportingMiddleware } from '@ddd-ts-kit/kernel';
2
+ import { lazyErrorReporter } from './lazy-error-reporter.js';
3
+ /** Resolved at each failure, so the reporter and the scope may be bound, rebound or faked after the bus exists. */
4
+ export function reportedFailures(resolve) {
5
+ return errorReportingMiddleware(lazyErrorReporter(resolve), {
6
+ current: () => resolve(ExecutionScope).current(),
7
+ });
8
+ }
9
+ //# sourceMappingURL=reported-failures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reported-failures.js","sourceRoot":"","sources":["../../src/kernel/reported-failures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAsB,MAAM,oBAAoB,CAAC;AAElG,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,mHAAmH;AACnH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,OAAO,wBAAwB,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE;QAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,EAAE;KACjD,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { InMemoryCommandBus, type BusMiddleware } from '@ddd-ts-kit/kernel';
2
+ import type { Resolve } from '../wiring/resolve.js';
3
+ /**
4
+ * The unit of work is resolved at each command, not when the bus is built: the application
5
+ * resolves the bus at creation to attach the handlers, and that must not open a database. The
6
+ * error reporting comes first, outside of it, so a commit that fails is reported too. What
7
+ * observes the use cases comes after the guard: a refused command never started.
8
+ */
9
+ export declare function transactionalCommandBus(resolve: Resolve, observed?: BusMiddleware): InMemoryCommandBus;
10
+ //# sourceMappingURL=transactional-command-bus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactional-command-bus.d.ts","sourceRoot":"","sources":["../../src/kernel/transactional-command-bus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAoC,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE9G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAGpD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,kBAAkB,CAQtG"}
@@ -0,0 +1,17 @@
1
+ import { InMemoryCommandBus, UnitOfWork, unitOfWorkMiddleware } from '@ddd-ts-kit/kernel';
2
+ import { useCaseGuardMiddleware } from '../authorization/use-case-guard-middleware.js';
3
+ import { reportedFailures } from './reported-failures.js';
4
+ /**
5
+ * The unit of work is resolved at each command, not when the bus is built: the application
6
+ * resolves the bus at creation to attach the handlers, and that must not open a database. The
7
+ * error reporting comes first, outside of it, so a commit that fails is reported too. What
8
+ * observes the use cases comes after the guard: a refused command never started.
9
+ */
10
+ export function transactionalCommandBus(resolve, observed) {
11
+ const bus = new InMemoryCommandBus().use(reportedFailures(resolve)).use(useCaseGuardMiddleware(resolve));
12
+ if (observed !== undefined) {
13
+ bus.use(observed);
14
+ }
15
+ return bus.use(unitOfWorkMiddleware({ run: (work) => resolve(UnitOfWork).run(work) }));
16
+ }
17
+ //# sourceMappingURL=transactional-command-bus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactional-command-bus.js","sourceRoot":"","sources":["../../src/kernel/transactional-command-bus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAsB,MAAM,oBAAoB,CAAC;AAC9G,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAgB,EAAE,QAAwB;IAChF,MAAM,GAAG,GAAG,IAAI,kBAAkB,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEzG,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACzF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { Binding } from '../wiring/binding.js';
2
+ import type { BindingOptions } from './binding-options.js';
3
+ /** The options a module chains after a binding: each changes the binding it was made for. */
4
+ export declare function bindingOptionsOf(binding: Binding): BindingOptions;
5
+ //# sourceMappingURL=binding-options-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-options-of.d.ts","sourceRoot":"","sources":["../../src/module/binding-options-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,cAAc,CAyBjE"}
@@ -0,0 +1,23 @@
1
+ /** The options a module chains after a binding: each changes the binding it was made for. */
2
+ export function bindingOptionsOf(binding) {
3
+ const options = {
4
+ as(kind) {
5
+ binding.kind = kind;
6
+ return options;
7
+ },
8
+ singleton() {
9
+ binding.lifetime = 'singleton';
10
+ return options;
11
+ },
12
+ transient() {
13
+ binding.lifetime = 'transient';
14
+ return options;
15
+ },
16
+ with(...aspects) {
17
+ binding.aspects = [...binding.aspects, ...aspects];
18
+ return options;
19
+ },
20
+ };
21
+ return options;
22
+ }
23
+ //# sourceMappingURL=binding-options-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-options-of.js","sourceRoot":"","sources":["../../src/module/binding-options-of.ts"],"names":[],"mappings":"AAGA,6FAA6F;AAC7F,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,OAAO,GAAmB;QAC9B,EAAE,CAAC,IAAI;YACL,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;YAEpB,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,SAAS;YACP,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC;YAE/B,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,SAAS;YACP,OAAO,CAAC,QAAQ,GAAG,WAAW,CAAC;YAE/B,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,IAAI,CAAC,GAAG,OAAO;YACb,OAAO,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;YAEnD,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { ValueBindingOptions } from './value-binding-options.js';
2
+ export interface BindingOptions extends ValueBindingOptions {
3
+ /** One instance per application. The default. */
4
+ singleton(): this;
5
+ /** A new instance on every resolution. */
6
+ transient(): this;
7
+ }
8
+ //# sourceMappingURL=binding-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-options.d.ts","sourceRoot":"","sources":["../../src/module/binding-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,iDAAiD;IACjD,SAAS,IAAI,IAAI,CAAC;IAElB,0CAA0C;IAC1C,SAAS,IAAI,IAAI,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=binding-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-options.js","sourceRoot":"","sources":["../../src/module/binding-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { Dependencies, DependencyList, DependencyTokens } from '@ddd-ts-kit/kernel/declarations';
2
+ import type { Resolve } from '../wiring/resolve.js';
3
+ import type { BindingOptions } from './binding-options.js';
4
+ import type { ValueBindingOptions } from './value-binding-options.js';
5
+ export interface BindingTarget<T> {
6
+ /**
7
+ * The class needs no decorator: its constructor arguments are the listed ports, in order.
8
+ * It implements the port it is bound to and never extends it.
9
+ */
10
+ toClass<Args extends readonly unknown[], const List extends Dependencies = DependencyTokens<Args>>(implementation: new (...args: Args) => T, ...dependencies: DependencyList<Args, List>): BindingOptions;
11
+ toFactory(factory: (resolve: Resolve) => T): BindingOptions;
12
+ /** A fake, a plain object of the shape of the port, or the value an abstract class types. */
13
+ toValue(value: T): ValueBindingOptions;
14
+ }
15
+ //# sourceMappingURL=binding-target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-target.d.ts","sourceRoot":"","sources":["../../src/module/binding-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,MAAM,WAAW,aAAa,CAAC,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EAAE,KAAK,CAAC,IAAI,SAAS,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAC/F,cAAc,EAAE,KAAK,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,EACxC,GAAG,YAAY,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,GAC1C,cAAc,CAAC;IAElB,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,CAAC,GAAG,cAAc,CAAC;IAE5D,6FAA6F;IAC7F,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,mBAAmB,CAAC;CACxC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=binding-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-target.js","sourceRoot":"","sources":["../../src/module/binding-target.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { Wiring } from '../wiring/wiring.js';
2
+ import type { ContextModule } from './context-module.js';
3
+ /** Runs the `register` function of every module and returns what they declared. */
4
+ export declare function collectWiring(modules: readonly ContextModule[]): Wiring;
5
+ //# sourceMappingURL=collect-wiring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-wiring.d.ts","sourceRoot":"","sources":["../../src/module/collect-wiring.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,MAAM,CAWvE"}
@@ -0,0 +1,13 @@
1
+ import { WiringDraft } from '../wiring/wiring-draft.js';
2
+ import { ModuleRecorder } from './module-recorder.js';
3
+ /** Runs the `register` function of every module and returns what they declared. */
4
+ export function collectWiring(modules) {
5
+ const draft = new WiringDraft();
6
+ for (const module of modules) {
7
+ const recorder = new ModuleRecorder(module.name, draft);
8
+ module.register(recorder);
9
+ recorder.assertNothingLeftUnfinished();
10
+ }
11
+ return draft.wiring(modules.map((module) => module.name));
12
+ }
13
+ //# sourceMappingURL=collect-wiring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-wiring.js","sourceRoot":"","sources":["../../src/module/collect-wiring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAAC,OAAiC;IAC7D,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;IAEhC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAExD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC1B,QAAQ,CAAC,2BAA2B,EAAE,CAAC;IACzC,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ModuleBuilder } from './module-builder.js';
2
+ import type { ModuleContext } from './module-context.js';
3
+ export interface ContextModule {
4
+ /** The bounded context's name; passed to the `decorate` hook as `context`. */
5
+ readonly name: string;
6
+ register(builder: ModuleBuilder): void;
7
+ onStart?(context: ModuleContext): void | Promise<void>;
8
+ onStop?(context: ModuleContext): void | Promise<void>;
9
+ }
10
+ //# sourceMappingURL=context-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-module.d.ts","sourceRoot":"","sources":["../../src/module/context-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;IAEvC,OAAO,CAAC,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,CAAC,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-module.js","sourceRoot":"","sources":["../../src/module/context-module.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { ContextModule } from './context-module.js';
2
+ /** Identity function that types a module definition and keeps it immutable. */
3
+ export declare function defineContextModule(definition: ContextModule): ContextModule;
4
+ //# sourceMappingURL=define-context-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-context-module.d.ts","sourceRoot":"","sources":["../../src/module/define-context-module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,aAAa,GAAG,aAAa,CAE5E"}
@@ -0,0 +1,5 @@
1
+ /** Identity function that types a module definition and keeps it immutable. */
2
+ export function defineContextModule(definition) {
3
+ return Object.freeze({ ...definition });
4
+ }
5
+ //# sourceMappingURL=define-context-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-context-module.js","sourceRoot":"","sources":["../../src/module/define-context-module.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CAAC,UAAyB;IAC3D,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,UAAU,EAAE,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Message, ScheduledJob } from '@ddd-ts-kit/kernel';
2
+ import type { IntegrationEventHandler, MessageHandler, Token } from '@ddd-ts-kit/kernel/declarations';
3
+ export declare function messageHandlerOf<M extends Message>(statement: string): Token<MessageHandler<M>>;
4
+ export declare function integrationEventHandlerOf<Payload>(statement: string): Token<IntegrationEventHandler<Payload>>;
5
+ export declare function jobOf(statement: string): Token<ScheduledJob>;
6
+ //# sourceMappingURL=factory-made-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-made-handlers.d.ts","sourceRoot":"","sources":["../../src/module/factory-made-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAOtG,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAM/F;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAM7G;AAED,wBAAgB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,CAM5D"}
@@ -0,0 +1,24 @@
1
+ /*
2
+ * What a handler built by a factory is bound under: no class of the project names it, so a
3
+ * class is made for the statement and reads, in an error or a description, as that statement.
4
+ */
5
+ export function messageHandlerOf(statement) {
6
+ class FactoryMade {
7
+ }
8
+ return named(FactoryMade, statement);
9
+ }
10
+ export function integrationEventHandlerOf(statement) {
11
+ class FactoryMade {
12
+ }
13
+ return named(FactoryMade, statement);
14
+ }
15
+ export function jobOf(statement) {
16
+ class FactoryMade {
17
+ }
18
+ return named(FactoryMade, statement);
19
+ }
20
+ function named(made, statement) {
21
+ Object.defineProperty(made, 'name', { value: `${statement} handler` });
22
+ return made;
23
+ }
24
+ //# sourceMappingURL=factory-made-handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory-made-handlers.js","sourceRoot":"","sources":["../../src/module/factory-made-handlers.ts"],"names":[],"mappings":"AAGA;;;GAGG;AAEH,MAAM,UAAU,gBAAgB,CAAoB,SAAiB;IACnE,MAAe,WAAW;KAEzB;IAED,OAAO,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAU,SAAiB;IAClE,MAAe,WAAW;KAEzB;IAED,OAAO,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,SAAiB;IACrC,MAAe,WAAW;KAEzB;IAED,OAAO,KAAK,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,KAAK,CAA8B,IAAU,EAAE,SAAiB;IACvE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,SAAS,UAAU,EAAE,CAAC,CAAC;IAEvE,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { Dependencies, DependencyList, DependencyTokens } from '@ddd-ts-kit/kernel/declarations';
2
+ import type { Resolve } from '../wiring/resolve.js';
3
+ export interface HandlerTarget<Handler> {
4
+ /**
5
+ * Binds the class as a singleton, under itself; its constructor arguments are the listed
6
+ * ports. One class is one binding: a class given to two statements is refused.
7
+ */
8
+ handledBy<Args extends readonly unknown[], const List extends Dependencies = DependencyTokens<Args>>(handler: new (...args: Args) => Handler, ...dependencies: DependencyList<Args, List>): void;
9
+ handledByFactory(factory: (resolve: Resolve) => Handler): void;
10
+ }
11
+ //# sourceMappingURL=handler-target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-target.d.ts","sourceRoot":"","sources":["../../src/module/handler-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACtG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,WAAW,aAAa,CAAC,OAAO;IACpC;;;OAGG;IACH,SAAS,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EAAE,KAAK,CAAC,IAAI,SAAS,YAAY,GAAG,gBAAgB,CAAC,IAAI,CAAC,EACjG,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,EACvC,GAAG,YAAY,EAAE,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,GAC1C,IAAI,CAAC;IAER,gBAAgB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAAC;CAChE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=handler-target.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler-target.js","sourceRoot":"","sources":["../../src/module/handler-target.ts"],"names":[],"mappings":""}