@endora-commerce/platform 0.100.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 (657) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/cli/dispatch.d.ts +146 -0
  4. package/dist/cli/dispatch.d.ts.map +1 -0
  5. package/dist/cli/dispatch.js +259 -0
  6. package/dist/cli/dispatch.js.map +1 -0
  7. package/dist/cli/index.d.ts +58 -0
  8. package/dist/cli/index.d.ts.map +1 -0
  9. package/dist/cli/index.js +58 -0
  10. package/dist/cli/index.js.map +1 -0
  11. package/dist/cli/module-commands.d.ts +118 -0
  12. package/dist/cli/module-commands.d.ts.map +1 -0
  13. package/dist/cli/module-commands.js +120 -0
  14. package/dist/cli/module-commands.js.map +1 -0
  15. package/dist/commands/actor.d.ts +19 -0
  16. package/dist/commands/actor.d.ts.map +1 -0
  17. package/dist/commands/actor.js +45 -0
  18. package/dist/commands/actor.js.map +1 -0
  19. package/dist/commands/audit-from-context.d.ts +24 -0
  20. package/dist/commands/audit-from-context.d.ts.map +1 -0
  21. package/dist/commands/audit-from-context.js +28 -0
  22. package/dist/commands/audit-from-context.js.map +1 -0
  23. package/dist/commands/command-bus.d.ts +40 -0
  24. package/dist/commands/command-bus.d.ts.map +1 -0
  25. package/dist/commands/command-bus.js +46 -0
  26. package/dist/commands/command-bus.js.map +1 -0
  27. package/dist/commands/command.d.ts +76 -0
  28. package/dist/commands/command.d.ts.map +1 -0
  29. package/dist/commands/command.js +2 -0
  30. package/dist/commands/command.js.map +1 -0
  31. package/dist/commands/index.d.ts +65 -0
  32. package/dist/commands/index.d.ts.map +1 -0
  33. package/dist/commands/index.js +57 -0
  34. package/dist/commands/index.js.map +1 -0
  35. package/dist/commands/reversible.d.ts +66 -0
  36. package/dist/commands/reversible.d.ts.map +1 -0
  37. package/dist/commands/reversible.js +41 -0
  38. package/dist/commands/reversible.js.map +1 -0
  39. package/dist/composition/compose-app.d.ts +305 -0
  40. package/dist/composition/compose-app.d.ts.map +1 -0
  41. package/dist/composition/compose-app.js +939 -0
  42. package/dist/composition/compose-app.js.map +1 -0
  43. package/dist/composition/index.d.ts +92 -0
  44. package/dist/composition/index.d.ts.map +1 -0
  45. package/dist/composition/index.js +175 -0
  46. package/dist/composition/index.js.map +1 -0
  47. package/dist/composition/newsletter-token-secret.d.ts +19 -0
  48. package/dist/composition/newsletter-token-secret.d.ts.map +1 -0
  49. package/dist/composition/newsletter-token-secret.js +24 -0
  50. package/dist/composition/newsletter-token-secret.js.map +1 -0
  51. package/dist/composition/process-runs-workers.d.ts +17 -0
  52. package/dist/composition/process-runs-workers.d.ts.map +1 -0
  53. package/dist/composition/process-runs-workers.js +19 -0
  54. package/dist/composition/process-runs-workers.js.map +1 -0
  55. package/dist/db/baseline-migration-inventory.d.ts +15 -0
  56. package/dist/db/baseline-migration-inventory.d.ts.map +1 -0
  57. package/dist/db/baseline-migration-inventory.js +115 -0
  58. package/dist/db/baseline-migration-inventory.js.map +1 -0
  59. package/dist/db/configured-entities.d.ts +74 -0
  60. package/dist/db/configured-entities.d.ts.map +1 -0
  61. package/dist/db/configured-entities.js +20 -0
  62. package/dist/db/configured-entities.js.map +1 -0
  63. package/dist/db/configured-migrations.d.ts +199 -0
  64. package/dist/db/configured-migrations.d.ts.map +1 -0
  65. package/dist/db/configured-migrations.js +181 -0
  66. package/dist/db/configured-migrations.js.map +1 -0
  67. package/dist/db/index.d.ts +54 -0
  68. package/dist/db/index.d.ts.map +1 -0
  69. package/dist/db/index.js +54 -0
  70. package/dist/db/index.js.map +1 -0
  71. package/dist/db/migrate.d.ts +21 -0
  72. package/dist/db/migrate.d.ts.map +1 -0
  73. package/dist/db/migrate.js +48 -0
  74. package/dist/db/migrate.js.map +1 -0
  75. package/dist/db/migration-order.d.ts +159 -0
  76. package/dist/db/migration-order.d.ts.map +1 -0
  77. package/dist/db/migration-order.js +273 -0
  78. package/dist/db/migration-order.js.map +1 -0
  79. package/dist/db/mikro-orm.config.d.ts +51 -0
  80. package/dist/db/mikro-orm.config.d.ts.map +1 -0
  81. package/dist/db/mikro-orm.config.js +64 -0
  82. package/dist/db/mikro-orm.config.js.map +1 -0
  83. package/dist/db/orm.d.ts +40 -0
  84. package/dist/db/orm.d.ts.map +1 -0
  85. package/dist/db/orm.js +25 -0
  86. package/dist/db/orm.js.map +1 -0
  87. package/dist/db/platform-schema.d.ts +102 -0
  88. package/dist/db/platform-schema.d.ts.map +1 -0
  89. package/dist/db/platform-schema.js +79 -0
  90. package/dist/db/platform-schema.js.map +1 -0
  91. package/dist/db/pluralizing-naming-strategy.d.ts +16 -0
  92. package/dist/db/pluralizing-naming-strategy.d.ts.map +1 -0
  93. package/dist/db/pluralizing-naming-strategy.js +66 -0
  94. package/dist/db/pluralizing-naming-strategy.js.map +1 -0
  95. package/dist/demo/guard.d.ts +101 -0
  96. package/dist/demo/guard.d.ts.map +1 -0
  97. package/dist/demo/guard.js +168 -0
  98. package/dist/demo/guard.js.map +1 -0
  99. package/dist/demo/host-command.d.ts +133 -0
  100. package/dist/demo/host-command.d.ts.map +1 -0
  101. package/dist/demo/host-command.js +113 -0
  102. package/dist/demo/host-command.js.map +1 -0
  103. package/dist/demo/index.d.ts +82 -0
  104. package/dist/demo/index.d.ts.map +1 -0
  105. package/dist/demo/index.js +82 -0
  106. package/dist/demo/index.js.map +1 -0
  107. package/dist/demo/packages.d.ts +67 -0
  108. package/dist/demo/packages.d.ts.map +1 -0
  109. package/dist/demo/packages.js +132 -0
  110. package/dist/demo/packages.js.map +1 -0
  111. package/dist/demo/plan.d.ts +111 -0
  112. package/dist/demo/plan.d.ts.map +1 -0
  113. package/dist/demo/plan.js +74 -0
  114. package/dist/demo/plan.js.map +1 -0
  115. package/dist/demo/report.d.ts +17 -0
  116. package/dist/demo/report.d.ts.map +1 -0
  117. package/dist/demo/report.js +85 -0
  118. package/dist/demo/report.js.map +1 -0
  119. package/dist/demo/runner.d.ts +207 -0
  120. package/dist/demo/runner.d.ts.map +1 -0
  121. package/dist/demo/runner.js +169 -0
  122. package/dist/demo/runner.js.map +1 -0
  123. package/dist/demo/scope.d.ts +44 -0
  124. package/dist/demo/scope.d.ts.map +1 -0
  125. package/dist/demo/scope.js +44 -0
  126. package/dist/demo/scope.js.map +1 -0
  127. package/dist/env/index.d.ts +68 -0
  128. package/dist/env/index.d.ts.map +1 -0
  129. package/dist/env/index.js +427 -0
  130. package/dist/env/index.js.map +1 -0
  131. package/dist/events/bus.d.ts +29 -0
  132. package/dist/events/bus.d.ts.map +1 -0
  133. package/dist/events/bus.js +67 -0
  134. package/dist/events/bus.js.map +1 -0
  135. package/dist/events/index.d.ts +19 -0
  136. package/dist/events/index.d.ts.map +1 -0
  137. package/dist/events/index.js +19 -0
  138. package/dist/events/index.js.map +1 -0
  139. package/dist/http/cursor.d.ts +10 -0
  140. package/dist/http/cursor.d.ts.map +1 -0
  141. package/dist/http/cursor.js +20 -0
  142. package/dist/http/cursor.js.map +1 -0
  143. package/dist/http/error-envelope.d.ts +127 -0
  144. package/dist/http/error-envelope.d.ts.map +1 -0
  145. package/dist/http/error-envelope.js +402 -0
  146. package/dist/http/error-envelope.js.map +1 -0
  147. package/dist/http/health.d.ts +88 -0
  148. package/dist/http/health.d.ts.map +1 -0
  149. package/dist/http/health.js +77 -0
  150. package/dist/http/health.js.map +1 -0
  151. package/dist/http/index.d.ts +50 -0
  152. package/dist/http/index.d.ts.map +1 -0
  153. package/dist/http/index.js +50 -0
  154. package/dist/http/index.js.map +1 -0
  155. package/dist/http/interceptors/dispatch.d.ts +14 -0
  156. package/dist/http/interceptors/dispatch.d.ts.map +1 -0
  157. package/dist/http/interceptors/dispatch.js +113 -0
  158. package/dist/http/interceptors/dispatch.js.map +1 -0
  159. package/dist/http/interceptors/index.d.ts +6 -0
  160. package/dist/http/interceptors/index.d.ts.map +1 -0
  161. package/dist/http/interceptors/index.js +5 -0
  162. package/dist/http/interceptors/index.js.map +1 -0
  163. package/dist/http/interceptors/registry.d.ts +44 -0
  164. package/dist/http/interceptors/registry.d.ts.map +1 -0
  165. package/dist/http/interceptors/registry.js +123 -0
  166. package/dist/http/interceptors/registry.js.map +1 -0
  167. package/dist/http/interceptors/route-table.d.ts +33 -0
  168. package/dist/http/interceptors/route-table.d.ts.map +1 -0
  169. package/dist/http/interceptors/route-table.js +39 -0
  170. package/dist/http/interceptors/route-table.js.map +1 -0
  171. package/dist/http/interceptors/types.d.ts +101 -0
  172. package/dist/http/interceptors/types.d.ts.map +1 -0
  173. package/dist/http/interceptors/types.js +2 -0
  174. package/dist/http/interceptors/types.js.map +1 -0
  175. package/dist/http/interceptors/validation.d.ts +22 -0
  176. package/dist/http/interceptors/validation.d.ts.map +1 -0
  177. package/dist/http/interceptors/validation.js +39 -0
  178. package/dist/http/interceptors/validation.js.map +1 -0
  179. package/dist/http/logger.d.ts +9 -0
  180. package/dist/http/logger.d.ts.map +1 -0
  181. package/dist/http/logger.js +25 -0
  182. package/dist/http/logger.js.map +1 -0
  183. package/dist/http/openapi.d.ts +21 -0
  184. package/dist/http/openapi.d.ts.map +1 -0
  185. package/dist/http/openapi.js +114 -0
  186. package/dist/http/openapi.js.map +1 -0
  187. package/dist/http/product-audience.d.ts +78 -0
  188. package/dist/http/product-audience.d.ts.map +1 -0
  189. package/dist/http/product-audience.js +92 -0
  190. package/dist/http/product-audience.js.map +1 -0
  191. package/dist/http/request-actor.d.ts +82 -0
  192. package/dist/http/request-actor.d.ts.map +1 -0
  193. package/dist/http/request-actor.js +2 -0
  194. package/dist/http/request-actor.js.map +1 -0
  195. package/dist/http/server.d.ts +60 -0
  196. package/dist/http/server.d.ts.map +1 -0
  197. package/dist/http/server.js +117 -0
  198. package/dist/http/server.js.map +1 -0
  199. package/dist/http/storefront-revalidator.d.ts +29 -0
  200. package/dist/http/storefront-revalidator.d.ts.map +1 -0
  201. package/dist/http/storefront-revalidator.js +34 -0
  202. package/dist/http/storefront-revalidator.js.map +1 -0
  203. package/dist/http/test-actor-carrier.d.ts +28 -0
  204. package/dist/http/test-actor-carrier.d.ts.map +1 -0
  205. package/dist/http/test-actor-carrier.js +10 -0
  206. package/dist/http/test-actor-carrier.js.map +1 -0
  207. package/dist/http/trusted-proxy.d.ts +48 -0
  208. package/dist/http/trusted-proxy.d.ts.map +1 -0
  209. package/dist/http/trusted-proxy.js +136 -0
  210. package/dist/http/trusted-proxy.js.map +1 -0
  211. package/dist/kernel/audit/audit-log-entry.entity.d.ts +33 -0
  212. package/dist/kernel/audit/audit-log-entry.entity.d.ts.map +1 -0
  213. package/dist/kernel/audit/audit-log-entry.entity.js +102 -0
  214. package/dist/kernel/audit/audit-log-entry.entity.js.map +1 -0
  215. package/dist/kernel/audit/audit-log-service.d.ts +63 -0
  216. package/dist/kernel/audit/audit-log-service.d.ts.map +1 -0
  217. package/dist/kernel/audit/audit-log-service.js +107 -0
  218. package/dist/kernel/audit/audit-log-service.js.map +1 -0
  219. package/dist/kernel/cache/in-process-cache-registry.d.ts +93 -0
  220. package/dist/kernel/cache/in-process-cache-registry.d.ts.map +1 -0
  221. package/dist/kernel/cache/in-process-cache-registry.js +78 -0
  222. package/dist/kernel/cache/in-process-cache-registry.js.map +1 -0
  223. package/dist/kernel/cache/shared-drop-marks.d.ts +39 -0
  224. package/dist/kernel/cache/shared-drop-marks.d.ts.map +1 -0
  225. package/dist/kernel/cache/shared-drop-marks.js +68 -0
  226. package/dist/kernel/cache/shared-drop-marks.js.map +1 -0
  227. package/dist/kernel/compose.d.ts +234 -0
  228. package/dist/kernel/compose.d.ts.map +1 -0
  229. package/dist/kernel/compose.js +279 -0
  230. package/dist/kernel/compose.js.map +1 -0
  231. package/dist/kernel/container.d.ts +95 -0
  232. package/dist/kernel/container.d.ts.map +1 -0
  233. package/dist/kernel/container.js +90 -0
  234. package/dist/kernel/container.js.map +1 -0
  235. package/dist/kernel/contribution-sinks.d.ts +106 -0
  236. package/dist/kernel/contribution-sinks.d.ts.map +1 -0
  237. package/dist/kernel/contribution-sinks.js +153 -0
  238. package/dist/kernel/contribution-sinks.js.map +1 -0
  239. package/dist/kernel/crypto/password-hasher.d.ts +3 -0
  240. package/dist/kernel/crypto/password-hasher.d.ts.map +1 -0
  241. package/dist/kernel/crypto/password-hasher.js +44 -0
  242. package/dist/kernel/crypto/password-hasher.js.map +1 -0
  243. package/dist/kernel/i18n/error-envelope-options.d.ts +56 -0
  244. package/dist/kernel/i18n/error-envelope-options.d.ts.map +1 -0
  245. package/dist/kernel/i18n/error-envelope-options.js +46 -0
  246. package/dist/kernel/i18n/error-envelope-options.js.map +1 -0
  247. package/dist/kernel/i18n/error-translation.d.ts +144 -0
  248. package/dist/kernel/i18n/error-translation.d.ts.map +1 -0
  249. package/dist/kernel/i18n/error-translation.js +84 -0
  250. package/dist/kernel/i18n/error-translation.js.map +1 -0
  251. package/dist/kernel/i18n/request-language.d.ts +80 -0
  252. package/dist/kernel/i18n/request-language.d.ts.map +1 -0
  253. package/dist/kernel/i18n/request-language.js +168 -0
  254. package/dist/kernel/i18n/request-language.js.map +1 -0
  255. package/dist/kernel/index.d.ts +142 -0
  256. package/dist/kernel/index.d.ts.map +1 -0
  257. package/dist/kernel/index.js +160 -0
  258. package/dist/kernel/index.js.map +1 -0
  259. package/dist/kernel/lazy-port.d.ts +59 -0
  260. package/dist/kernel/lazy-port.d.ts.map +1 -0
  261. package/dist/kernel/lazy-port.js +78 -0
  262. package/dist/kernel/lazy-port.js.map +1 -0
  263. package/dist/kernel/lifecycle/activation-resolver.d.ts +63 -0
  264. package/dist/kernel/lifecycle/activation-resolver.d.ts.map +1 -0
  265. package/dist/kernel/lifecycle/activation-resolver.js +70 -0
  266. package/dist/kernel/lifecycle/activation-resolver.js.map +1 -0
  267. package/dist/kernel/lifecycle/capability-registry.d.ts +145 -0
  268. package/dist/kernel/lifecycle/capability-registry.d.ts.map +1 -0
  269. package/dist/kernel/lifecycle/capability-registry.js +170 -0
  270. package/dist/kernel/lifecycle/capability-registry.js.map +1 -0
  271. package/dist/kernel/lifecycle/effective-state.d.ts +126 -0
  272. package/dist/kernel/lifecycle/effective-state.d.ts.map +1 -0
  273. package/dist/kernel/lifecycle/effective-state.js +111 -0
  274. package/dist/kernel/lifecycle/effective-state.js.map +1 -0
  275. package/dist/kernel/lifecycle/module-registration.entity.d.ts +57 -0
  276. package/dist/kernel/lifecycle/module-registration.entity.d.ts.map +1 -0
  277. package/dist/kernel/lifecycle/module-registration.entity.js +111 -0
  278. package/dist/kernel/lifecycle/module-registration.entity.js.map +1 -0
  279. package/dist/kernel/lifecycle/plugin-helpers.d.ts +165 -0
  280. package/dist/kernel/lifecycle/plugin-helpers.d.ts.map +1 -0
  281. package/dist/kernel/lifecycle/plugin-helpers.js +395 -0
  282. package/dist/kernel/lifecycle/plugin-helpers.js.map +1 -0
  283. package/dist/kernel/lifecycle/registry-cache.d.ts +318 -0
  284. package/dist/kernel/lifecycle/registry-cache.d.ts.map +1 -0
  285. package/dist/kernel/lifecycle/registry-cache.js +509 -0
  286. package/dist/kernel/lifecycle/registry-cache.js.map +1 -0
  287. package/dist/kernel/lifecycle/required-modules.d.ts +137 -0
  288. package/dist/kernel/lifecycle/required-modules.d.ts.map +1 -0
  289. package/dist/kernel/lifecycle/required-modules.js +80 -0
  290. package/dist/kernel/lifecycle/required-modules.js.map +1 -0
  291. package/dist/kernel/lifecycle/unique-module-ids.d.ts +58 -0
  292. package/dist/kernel/lifecycle/unique-module-ids.d.ts.map +1 -0
  293. package/dist/kernel/lifecycle/unique-module-ids.js +82 -0
  294. package/dist/kernel/lifecycle/unique-module-ids.js.map +1 -0
  295. package/dist/kernel/logging.d.ts +116 -0
  296. package/dist/kernel/logging.d.ts.map +1 -0
  297. package/dist/kernel/logging.js +71 -0
  298. package/dist/kernel/logging.js.map +1 -0
  299. package/dist/kernel/module-context.d.ts +563 -0
  300. package/dist/kernel/module-context.d.ts.map +1 -0
  301. package/dist/kernel/module-context.js +670 -0
  302. package/dist/kernel/module-context.js.map +1 -0
  303. package/dist/kernel/ports/audit.d.ts +115 -0
  304. package/dist/kernel/ports/audit.d.ts.map +1 -0
  305. package/dist/kernel/ports/audit.js +2 -0
  306. package/dist/kernel/ports/audit.js.map +1 -0
  307. package/dist/kernel/ports/organizations.d.ts +56 -0
  308. package/dist/kernel/ports/organizations.d.ts.map +1 -0
  309. package/dist/kernel/ports/organizations.js +2 -0
  310. package/dist/kernel/ports/organizations.js.map +1 -0
  311. package/dist/kernel/ports/provide.d.ts +14 -0
  312. package/dist/kernel/ports/provide.d.ts.map +1 -0
  313. package/dist/kernel/ports/provide.js +50 -0
  314. package/dist/kernel/ports/provide.js.map +1 -0
  315. package/dist/kernel/ports/require-admin.d.ts +61 -0
  316. package/dist/kernel/ports/require-admin.d.ts.map +1 -0
  317. package/dist/kernel/ports/require-admin.js +2 -0
  318. package/dist/kernel/ports/require-admin.js.map +1 -0
  319. package/dist/kernel/ports/require-customer.d.ts +17 -0
  320. package/dist/kernel/ports/require-customer.d.ts.map +1 -0
  321. package/dist/kernel/ports/require-customer.js +2 -0
  322. package/dist/kernel/ports/require-customer.js.map +1 -0
  323. package/dist/kernel/ports/sales-channel.d.ts +84 -0
  324. package/dist/kernel/ports/sales-channel.d.ts.map +1 -0
  325. package/dist/kernel/ports/sales-channel.js +2 -0
  326. package/dist/kernel/ports/sales-channel.js.map +1 -0
  327. package/dist/kernel/ports/settings.d.ts +59 -0
  328. package/dist/kernel/ports/settings.d.ts.map +1 -0
  329. package/dist/kernel/ports/settings.js +2 -0
  330. package/dist/kernel/ports/settings.js.map +1 -0
  331. package/dist/kernel/public-api-base-url.d.ts +98 -0
  332. package/dist/kernel/public-api-base-url.d.ts.map +1 -0
  333. package/dist/kernel/public-api-base-url.js +144 -0
  334. package/dist/kernel/public-api-base-url.js.map +1 -0
  335. package/dist/kernel/request-scope-hook.d.ts +63 -0
  336. package/dist/kernel/request-scope-hook.d.ts.map +1 -0
  337. package/dist/kernel/request-scope-hook.js +67 -0
  338. package/dist/kernel/request-scope-hook.js.map +1 -0
  339. package/dist/kernel/sales-channels/channel-bridge-registry.d.ts +109 -0
  340. package/dist/kernel/sales-channels/channel-bridge-registry.d.ts.map +1 -0
  341. package/dist/kernel/sales-channels/channel-bridge-registry.js +75 -0
  342. package/dist/kernel/sales-channels/channel-bridge-registry.js.map +1 -0
  343. package/dist/kernel/sales-channels/compose.d.ts +69 -0
  344. package/dist/kernel/sales-channels/compose.d.ts.map +1 -0
  345. package/dist/kernel/sales-channels/compose.js +43 -0
  346. package/dist/kernel/sales-channels/compose.js.map +1 -0
  347. package/dist/kernel/sales-channels/default-channel-reconciler.d.ts +66 -0
  348. package/dist/kernel/sales-channels/default-channel-reconciler.d.ts.map +1 -0
  349. package/dist/kernel/sales-channels/default-channel-reconciler.js +91 -0
  350. package/dist/kernel/sales-channels/default-channel-reconciler.js.map +1 -0
  351. package/dist/kernel/sales-channels/no-system-default-channel.error.d.ts +28 -0
  352. package/dist/kernel/sales-channels/no-system-default-channel.error.d.ts.map +1 -0
  353. package/dist/kernel/sales-channels/no-system-default-channel.error.js +33 -0
  354. package/dist/kernel/sales-channels/no-system-default-channel.error.js.map +1 -0
  355. package/dist/kernel/sales-channels/request-channel-assortment.d.ts +72 -0
  356. package/dist/kernel/sales-channels/request-channel-assortment.d.ts.map +1 -0
  357. package/dist/kernel/sales-channels/request-channel-assortment.js +83 -0
  358. package/dist/kernel/sales-channels/request-channel-assortment.js.map +1 -0
  359. package/dist/kernel/sales-channels/sales-channel-membership.service.d.ts +157 -0
  360. package/dist/kernel/sales-channels/sales-channel-membership.service.d.ts.map +1 -0
  361. package/dist/kernel/sales-channels/sales-channel-membership.service.js +302 -0
  362. package/dist/kernel/sales-channels/sales-channel-membership.service.js.map +1 -0
  363. package/dist/kernel/sales-channels/sales-channel-resolver.middleware.d.ts +76 -0
  364. package/dist/kernel/sales-channels/sales-channel-resolver.middleware.d.ts.map +1 -0
  365. package/dist/kernel/sales-channels/sales-channel-resolver.middleware.js +184 -0
  366. package/dist/kernel/sales-channels/sales-channel-resolver.middleware.js.map +1 -0
  367. package/dist/kernel/sales-channels/sales-channel-resolver.service.d.ts +82 -0
  368. package/dist/kernel/sales-channels/sales-channel-resolver.service.d.ts.map +1 -0
  369. package/dist/kernel/sales-channels/sales-channel-resolver.service.js +126 -0
  370. package/dist/kernel/sales-channels/sales-channel-resolver.service.js.map +1 -0
  371. package/dist/kernel/sales-channels/sales-channel.entity.d.ts +50 -0
  372. package/dist/kernel/sales-channels/sales-channel.entity.d.ts.map +1 -0
  373. package/dist/kernel/sales-channels/sales-channel.entity.js +132 -0
  374. package/dist/kernel/sales-channels/sales-channel.entity.js.map +1 -0
  375. package/dist/kernel/sales-channels/sales-channels-cache.d.ts +170 -0
  376. package/dist/kernel/sales-channels/sales-channels-cache.d.ts.map +1 -0
  377. package/dist/kernel/sales-channels/sales-channels-cache.js +243 -0
  378. package/dist/kernel/sales-channels/sales-channels-cache.js.map +1 -0
  379. package/dist/kernel/scope.d.ts +153 -0
  380. package/dist/kernel/scope.d.ts.map +1 -0
  381. package/dist/kernel/scope.js +172 -0
  382. package/dist/kernel/scope.js.map +1 -0
  383. package/dist/kernel/settings/compose.d.ts +49 -0
  384. package/dist/kernel/settings/compose.d.ts.map +1 -0
  385. package/dist/kernel/settings/compose.js +21 -0
  386. package/dist/kernel/settings/compose.js.map +1 -0
  387. package/dist/kernel/settings/manifest-reconciler.d.ts +78 -0
  388. package/dist/kernel/settings/manifest-reconciler.d.ts.map +1 -0
  389. package/dist/kernel/settings/manifest-reconciler.js +343 -0
  390. package/dist/kernel/settings/manifest-reconciler.js.map +1 -0
  391. package/dist/kernel/settings/secret-value-codec.d.ts +52 -0
  392. package/dist/kernel/settings/secret-value-codec.d.ts.map +1 -0
  393. package/dist/kernel/settings/secret-value-codec.js +102 -0
  394. package/dist/kernel/settings/secret-value-codec.js.map +1 -0
  395. package/dist/kernel/settings/setting-group.entity.d.ts +25 -0
  396. package/dist/kernel/settings/setting-group.entity.d.ts.map +1 -0
  397. package/dist/kernel/settings/setting-group.entity.js +79 -0
  398. package/dist/kernel/settings/setting-group.entity.js.map +1 -0
  399. package/dist/kernel/settings/setting-value.entity.d.ts +23 -0
  400. package/dist/kernel/settings/setting-value.entity.d.ts.map +1 -0
  401. package/dist/kernel/settings/setting-value.entity.js +66 -0
  402. package/dist/kernel/settings/setting-value.entity.js.map +1 -0
  403. package/dist/kernel/settings/setting.entity.d.ts +56 -0
  404. package/dist/kernel/settings/setting.entity.d.ts.map +1 -0
  405. package/dist/kernel/settings/setting.entity.js +147 -0
  406. package/dist/kernel/settings/setting.entity.js.map +1 -0
  407. package/dist/kernel/settings/settings-cache.d.ts +158 -0
  408. package/dist/kernel/settings/settings-cache.d.ts.map +1 -0
  409. package/dist/kernel/settings/settings-cache.js +253 -0
  410. package/dist/kernel/settings/settings-cache.js.map +1 -0
  411. package/dist/kernel/settings/settings.service.d.ts +142 -0
  412. package/dist/kernel/settings/settings.service.d.ts.map +1 -0
  413. package/dist/kernel/settings/settings.service.js +294 -0
  414. package/dist/kernel/settings/settings.service.js.map +1 -0
  415. package/dist/lifecycle/backend.d.ts +51 -0
  416. package/dist/lifecycle/backend.d.ts.map +1 -0
  417. package/dist/lifecycle/backend.js +40 -0
  418. package/dist/lifecycle/backend.js.map +1 -0
  419. package/dist/lifecycle/commands/activation.commands.d.ts +97 -0
  420. package/dist/lifecycle/commands/activation.commands.d.ts.map +1 -0
  421. package/dist/lifecycle/commands/activation.commands.js +142 -0
  422. package/dist/lifecycle/commands/activation.commands.js.map +1 -0
  423. package/dist/lifecycle/commands/disable.d.ts +3 -0
  424. package/dist/lifecycle/commands/disable.d.ts.map +1 -0
  425. package/dist/lifecycle/commands/disable.js +126 -0
  426. package/dist/lifecycle/commands/disable.js.map +1 -0
  427. package/dist/lifecycle/commands/enable.d.ts +3 -0
  428. package/dist/lifecycle/commands/enable.d.ts.map +1 -0
  429. package/dist/lifecycle/commands/enable.js +102 -0
  430. package/dist/lifecycle/commands/enable.js.map +1 -0
  431. package/dist/lifecycle/commands/install.d.ts +3 -0
  432. package/dist/lifecycle/commands/install.d.ts.map +1 -0
  433. package/dist/lifecycle/commands/install.js +263 -0
  434. package/dist/lifecycle/commands/install.js.map +1 -0
  435. package/dist/lifecycle/commands/operator-entry.d.ts +104 -0
  436. package/dist/lifecycle/commands/operator-entry.d.ts.map +1 -0
  437. package/dist/lifecycle/commands/operator-entry.js +127 -0
  438. package/dist/lifecycle/commands/operator-entry.js.map +1 -0
  439. package/dist/lifecycle/commands/operator-runtime.d.ts +147 -0
  440. package/dist/lifecycle/commands/operator-runtime.d.ts.map +1 -0
  441. package/dist/lifecycle/commands/operator-runtime.js +40 -0
  442. package/dist/lifecycle/commands/operator-runtime.js.map +1 -0
  443. package/dist/lifecycle/commands/status.d.ts +3 -0
  444. package/dist/lifecycle/commands/status.d.ts.map +1 -0
  445. package/dist/lifecycle/commands/status.js +108 -0
  446. package/dist/lifecycle/commands/status.js.map +1 -0
  447. package/dist/lifecycle/commands/uninstall.d.ts +3 -0
  448. package/dist/lifecycle/commands/uninstall.d.ts.map +1 -0
  449. package/dist/lifecycle/commands/uninstall.js +223 -0
  450. package/dist/lifecycle/commands/uninstall.js.map +1 -0
  451. package/dist/lifecycle/divergence-declaration.d.ts +74 -0
  452. package/dist/lifecycle/divergence-declaration.d.ts.map +1 -0
  453. package/dist/lifecycle/divergence-declaration.js +92 -0
  454. package/dist/lifecycle/divergence-declaration.js.map +1 -0
  455. package/dist/lifecycle/i18n/en.json +4 -0
  456. package/dist/lifecycle/i18n/pl.json +4 -0
  457. package/dist/lifecycle/index.d.ts +110 -0
  458. package/dist/lifecycle/index.d.ts.map +1 -0
  459. package/dist/lifecycle/index.js +189 -0
  460. package/dist/lifecycle/index.js.map +1 -0
  461. package/dist/lifecycle/manifest-registry.d.ts +244 -0
  462. package/dist/lifecycle/manifest-registry.d.ts.map +1 -0
  463. package/dist/lifecycle/manifest-registry.js +223 -0
  464. package/dist/lifecycle/manifest-registry.js.map +1 -0
  465. package/dist/lifecycle/manifest.d.ts +166 -0
  466. package/dist/lifecycle/manifest.d.ts.map +1 -0
  467. package/dist/lifecycle/manifest.js +121 -0
  468. package/dist/lifecycle/manifest.js.map +1 -0
  469. package/dist/lifecycle/plugin.d.ts +56 -0
  470. package/dist/lifecycle/plugin.d.ts.map +1 -0
  471. package/dist/lifecycle/plugin.js +59 -0
  472. package/dist/lifecycle/plugin.js.map +1 -0
  473. package/dist/lifecycle/resident.d.ts +16 -0
  474. package/dist/lifecycle/resident.d.ts.map +1 -0
  475. package/dist/lifecycle/resident.js +59 -0
  476. package/dist/lifecycle/resident.js.map +1 -0
  477. package/dist/lifecycle/routes.admin.d.ts +57 -0
  478. package/dist/lifecycle/routes.admin.d.ts.map +1 -0
  479. package/dist/lifecycle/routes.admin.js +162 -0
  480. package/dist/lifecycle/routes.admin.js.map +1 -0
  481. package/dist/lifecycle/routes.storefront.d.ts +26 -0
  482. package/dist/lifecycle/routes.storefront.d.ts.map +1 -0
  483. package/dist/lifecycle/routes.storefront.js +36 -0
  484. package/dist/lifecycle/routes.storefront.js.map +1 -0
  485. package/dist/lifecycle/services/deactivation-ledger.d.ts +216 -0
  486. package/dist/lifecycle/services/deactivation-ledger.d.ts.map +1 -0
  487. package/dist/lifecycle/services/deactivation-ledger.js +171 -0
  488. package/dist/lifecycle/services/deactivation-ledger.js.map +1 -0
  489. package/dist/lifecycle/services/dep-graph.d.ts +119 -0
  490. package/dist/lifecycle/services/dep-graph.d.ts.map +1 -0
  491. package/dist/lifecycle/services/dep-graph.js +334 -0
  492. package/dist/lifecycle/services/dep-graph.js.map +1 -0
  493. package/dist/lifecycle/services/gating-graph.d.ts +164 -0
  494. package/dist/lifecycle/services/gating-graph.d.ts.map +1 -0
  495. package/dist/lifecycle/services/gating-graph.js +203 -0
  496. package/dist/lifecycle/services/gating-graph.js.map +1 -0
  497. package/dist/lifecycle/services/lock.d.ts +27 -0
  498. package/dist/lifecycle/services/lock.d.ts.map +1 -0
  499. package/dist/lifecycle/services/lock.js +82 -0
  500. package/dist/lifecycle/services/lock.js.map +1 -0
  501. package/dist/lifecycle/services/manifest-loader.d.ts +125 -0
  502. package/dist/lifecycle/services/manifest-loader.d.ts.map +1 -0
  503. package/dist/lifecycle/services/manifest-loader.js +210 -0
  504. package/dist/lifecycle/services/manifest-loader.js.map +1 -0
  505. package/dist/lifecycle/services/migration-ownership.d.ts +36 -0
  506. package/dist/lifecycle/services/migration-ownership.d.ts.map +1 -0
  507. package/dist/lifecycle/services/migration-ownership.js +15 -0
  508. package/dist/lifecycle/services/migration-ownership.js.map +1 -0
  509. package/dist/lifecycle/services/module-id-claims.d.ts +38 -0
  510. package/dist/lifecycle/services/module-id-claims.d.ts.map +1 -0
  511. package/dist/lifecycle/services/module-id-claims.js +123 -0
  512. package/dist/lifecycle/services/module-id-claims.js.map +1 -0
  513. package/dist/lifecycle/services/module-origin.d.ts +55 -0
  514. package/dist/lifecycle/services/module-origin.d.ts.map +1 -0
  515. package/dist/lifecycle/services/module-origin.js +47 -0
  516. package/dist/lifecycle/services/module-origin.js.map +1 -0
  517. package/dist/lifecycle/services/orchestrator.d.ts +235 -0
  518. package/dist/lifecycle/services/orchestrator.d.ts.map +1 -0
  519. package/dist/lifecycle/services/orchestrator.js +954 -0
  520. package/dist/lifecycle/services/orchestrator.js.map +1 -0
  521. package/dist/lifecycle/services/presence-load.d.ts +281 -0
  522. package/dist/lifecycle/services/presence-load.d.ts.map +1 -0
  523. package/dist/lifecycle/services/presence-load.js +437 -0
  524. package/dist/lifecycle/services/presence-load.js.map +1 -0
  525. package/dist/lifecycle/services/static-registry.d.ts +47 -0
  526. package/dist/lifecycle/services/static-registry.d.ts.map +1 -0
  527. package/dist/lifecycle/services/static-registry.js +41 -0
  528. package/dist/lifecycle/services/static-registry.js.map +1 -0
  529. package/dist/migrations/20260424T165847_core_foundation_init.d.ts +25 -0
  530. package/dist/migrations/20260424T165847_core_foundation_init.d.ts.map +1 -0
  531. package/dist/migrations/20260424T165847_core_foundation_init.js +238 -0
  532. package/dist/migrations/20260424T165847_core_foundation_init.js.map +1 -0
  533. package/dist/migrations/20260425T050720_core_commerce_init.d.ts +19 -0
  534. package/dist/migrations/20260425T050720_core_commerce_init.d.ts.map +1 -0
  535. package/dist/migrations/20260425T050720_core_commerce_init.js +200 -0
  536. package/dist/migrations/20260425T050720_core_commerce_init.js.map +1 -0
  537. package/dist/migrations/20260430T101450_core_settings_init.d.ts +25 -0
  538. package/dist/migrations/20260430T101450_core_settings_init.d.ts.map +1 -0
  539. package/dist/migrations/20260430T101450_core_settings_init.js +113 -0
  540. package/dist/migrations/20260430T101450_core_settings_init.js.map +1 -0
  541. package/dist/migrations/20260430T170044_core_sales_channels_promote.d.ts +67 -0
  542. package/dist/migrations/20260430T170044_core_sales_channels_promote.d.ts.map +1 -0
  543. package/dist/migrations/20260430T170044_core_sales_channels_promote.js +101 -0
  544. package/dist/migrations/20260430T170044_core_sales_channels_promote.js.map +1 -0
  545. package/dist/migrations/20260506T200657_core_module_lifecycle_init.d.ts +21 -0
  546. package/dist/migrations/20260506T200657_core_module_lifecycle_init.d.ts.map +1 -0
  547. package/dist/migrations/20260506T200657_core_module_lifecycle_init.js +41 -0
  548. package/dist/migrations/20260506T200657_core_module_lifecycle_init.js.map +1 -0
  549. package/dist/migrations/20260514T111329_core_settings_global_value.d.ts +30 -0
  550. package/dist/migrations/20260514T111329_core_settings_global_value.d.ts.map +1 -0
  551. package/dist/migrations/20260514T111329_core_settings_global_value.js +34 -0
  552. package/dist/migrations/20260514T111329_core_settings_global_value.js.map +1 -0
  553. package/dist/migrations/20260611T140411_core_settings_secret_value_type.d.ts +26 -0
  554. package/dist/migrations/20260611T140411_core_settings_secret_value_type.d.ts.map +1 -0
  555. package/dist/migrations/20260611T140411_core_settings_secret_value_type.js +63 -0
  556. package/dist/migrations/20260611T140411_core_settings_secret_value_type.js.map +1 -0
  557. package/dist/migrations/20260611T140419_core_settings_enum_options.d.ts +19 -0
  558. package/dist/migrations/20260611T140419_core_settings_enum_options.d.ts.map +1 -0
  559. package/dist/migrations/20260611T140419_core_settings_enum_options.js +23 -0
  560. package/dist/migrations/20260611T140419_core_settings_enum_options.js.map +1 -0
  561. package/dist/migrations/20260629T090100_core_settings_hidden_flag.d.ts +20 -0
  562. package/dist/migrations/20260629T090100_core_settings_hidden_flag.d.ts.map +1 -0
  563. package/dist/migrations/20260629T090100_core_settings_hidden_flag.js +24 -0
  564. package/dist/migrations/20260629T090100_core_settings_hidden_flag.js.map +1 -0
  565. package/dist/migrations/20260717T134752_core_tenant_scope_indexes.d.ts +27 -0
  566. package/dist/migrations/20260717T134752_core_tenant_scope_indexes.d.ts.map +1 -0
  567. package/dist/migrations/20260717T134752_core_tenant_scope_indexes.js +32 -0
  568. package/dist/migrations/20260717T134752_core_tenant_scope_indexes.js.map +1 -0
  569. package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.d.ts +24 -0
  570. package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.d.ts.map +1 -0
  571. package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.js +57 -0
  572. package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.js.map +1 -0
  573. package/dist/migrations/20260816T203339_core_retire_core_activation_settings.d.ts +39 -0
  574. package/dist/migrations/20260816T203339_core_retire_core_activation_settings.d.ts.map +1 -0
  575. package/dist/migrations/20260816T203339_core_retire_core_activation_settings.js +59 -0
  576. package/dist/migrations/20260816T203339_core_retire_core_activation_settings.js.map +1 -0
  577. package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.d.ts +34 -0
  578. package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.d.ts.map +1 -0
  579. package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.js +38 -0
  580. package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.js.map +1 -0
  581. package/dist/migrations/baseline-migrations.generated.d.ts +2 -0
  582. package/dist/migrations/baseline-migrations.generated.d.ts.map +1 -0
  583. package/dist/migrations/baseline-migrations.generated.js +136 -0
  584. package/dist/migrations/baseline-migrations.generated.js.map +1 -0
  585. package/dist/migrations/index.d.ts +62 -0
  586. package/dist/migrations/index.d.ts.map +1 -0
  587. package/dist/migrations/index.js +75 -0
  588. package/dist/migrations/index.js.map +1 -0
  589. package/dist/overlay/deployment-roots.d.ts +37 -0
  590. package/dist/overlay/deployment-roots.d.ts.map +1 -0
  591. package/dist/overlay/deployment-roots.js +90 -0
  592. package/dist/overlay/deployment-roots.js.map +1 -0
  593. package/dist/overlay/index.d.ts +62 -0
  594. package/dist/overlay/index.d.ts.map +1 -0
  595. package/dist/overlay/index.js +62 -0
  596. package/dist/overlay/index.js.map +1 -0
  597. package/dist/overlay/overlay-runtime.d.ts +173 -0
  598. package/dist/overlay/overlay-runtime.d.ts.map +1 -0
  599. package/dist/overlay/overlay-runtime.js +281 -0
  600. package/dist/overlay/overlay-runtime.js.map +1 -0
  601. package/dist/overlay/resolve-overlay.d.ts +41 -0
  602. package/dist/overlay/resolve-overlay.d.ts.map +1 -0
  603. package/dist/overlay/resolve-overlay.js +72 -0
  604. package/dist/overlay/resolve-overlay.js.map +1 -0
  605. package/dist/packages/index.d.ts +57 -0
  606. package/dist/packages/index.d.ts.map +1 -0
  607. package/dist/packages/index.js +57 -0
  608. package/dist/packages/index.js.map +1 -0
  609. package/dist/packages/installed-packages.d.ts +79 -0
  610. package/dist/packages/installed-packages.d.ts.map +1 -0
  611. package/dist/packages/installed-packages.js +312 -0
  612. package/dist/packages/installed-packages.js.map +1 -0
  613. package/dist/packages/package-entity-lookup.d.ts +120 -0
  614. package/dist/packages/package-entity-lookup.d.ts.map +1 -0
  615. package/dist/packages/package-entity-lookup.js +17 -0
  616. package/dist/packages/package-entity-lookup.js.map +1 -0
  617. package/dist/packages/package-runtime.d.ts +177 -0
  618. package/dist/packages/package-runtime.d.ts.map +1 -0
  619. package/dist/packages/package-runtime.js +386 -0
  620. package/dist/packages/package-runtime.js.map +1 -0
  621. package/dist/tenancy/derived-scope.d.ts +43 -0
  622. package/dist/tenancy/derived-scope.d.ts.map +1 -0
  623. package/dist/tenancy/derived-scope.js +76 -0
  624. package/dist/tenancy/derived-scope.js.map +1 -0
  625. package/dist/tenancy/escape-hatch.d.ts +30 -0
  626. package/dist/tenancy/escape-hatch.d.ts.map +1 -0
  627. package/dist/tenancy/escape-hatch.js +50 -0
  628. package/dist/tenancy/escape-hatch.js.map +1 -0
  629. package/dist/tenancy/filters.d.ts +87 -0
  630. package/dist/tenancy/filters.d.ts.map +1 -0
  631. package/dist/tenancy/filters.js +126 -0
  632. package/dist/tenancy/filters.js.map +1 -0
  633. package/dist/tenancy/index.d.ts +63 -0
  634. package/dist/tenancy/index.d.ts.map +1 -0
  635. package/dist/tenancy/index.js +61 -0
  636. package/dist/tenancy/index.js.map +1 -0
  637. package/dist/tenancy/org-scoped.decorator.d.ts +150 -0
  638. package/dist/tenancy/org-scoped.decorator.d.ts.map +1 -0
  639. package/dist/tenancy/org-scoped.decorator.js +339 -0
  640. package/dist/tenancy/org-scoped.decorator.js.map +1 -0
  641. package/dist/tenancy/org-write-guard.d.ts +106 -0
  642. package/dist/tenancy/org-write-guard.d.ts.map +1 -0
  643. package/dist/tenancy/org-write-guard.js +141 -0
  644. package/dist/tenancy/org-write-guard.js.map +1 -0
  645. package/dist/tenancy/resolve-tenant-context.d.ts +91 -0
  646. package/dist/tenancy/resolve-tenant-context.d.ts.map +1 -0
  647. package/dist/tenancy/resolve-tenant-context.js +85 -0
  648. package/dist/tenancy/resolve-tenant-context.js.map +1 -0
  649. package/dist/tenancy/scoped-em.d.ts +10 -0
  650. package/dist/tenancy/scoped-em.d.ts.map +1 -0
  651. package/dist/tenancy/scoped-em.js +11 -0
  652. package/dist/tenancy/scoped-em.js.map +1 -0
  653. package/dist/tenancy/tenant-context.d.ts +154 -0
  654. package/dist/tenancy/tenant-context.d.ts.map +1 -0
  655. package/dist/tenancy/tenant-context.js +109 -0
  656. package/dist/tenancy/tenant-context.js.map +1 -0
  657. package/package.json +123 -0
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Command Bus core layer (feature 054 — Uniform Write Auditing & Undo,
3
+ * Constitution Principle XIII). Peer of `events/`, `tenancy/`, `http/`,
4
+ * `kernel/`; becomes the `./commands` subpath of `@endora-commerce/platform`
5
+ * (feature 080, D-160.1/D-160.7), and that subpath is the boundary a future
6
+ * `@endora-commerce/commands` would take (D-160.6).
7
+ *
8
+ * **This barrel is a package boundary in waiting, so it carries this
9
+ * directory's symbols and nothing else.** Three of the shapes a consumer needs
10
+ * to use it come from elsewhere and stay there: `AuditPort`
11
+ * (`@endora-commerce/platform/kernel`) is `recordAuditFromContext`'s first
12
+ * argument, `TenantContext` (`…/tenancy`) is `actorFromContext`'s, and
13
+ * `EventBase` (`…/events`) is what a {@link CommandEvent} carries. Re-exporting
14
+ * one of them here to save a consumer an import line spends the split option
15
+ * for a convenience.
16
+ *
17
+ * **What is on it is decided by `contracts/host-package.md` §1.3, not by what
18
+ * happens to be here** (T042f, applying T042c's rule to this directory for the
19
+ * first time). §1.3 rows 5, 12 and 33 are all **P**, and the 177 module reaches
20
+ * into this directory name **ten** distinct symbols between them; the barrel
21
+ * carried 27.
22
+ *
23
+ * So the rule is the kernel barrel's: a symbol is here when §1.3 records a
24
+ * module taking it from a **P** file, or when it is the argument, return or
25
+ * thrown shape of one of those. Two groups are deliberately absent and a future
26
+ * author will look for them:
27
+ *
28
+ * - **the bus's construction** — `CommandBusOptions` and
29
+ * `CommandRequestMeta`. A composition root builds the one {@link CommandBus}
30
+ * and supplies its request-metadata resolver; a module resolves
31
+ * `commandBus` from the container and calls `run`. The class travels because
32
+ * 75 module files name it in a constructor signature or a cradle field.
33
+ * - **the command registry**, which this barrel exported until T042f pruned it
34
+ * and !897 deleted outright. D-163 settled it: the registry was read by
35
+ * **nothing** in `src/`, and both consumers its own header named had been
36
+ * wrong since it was created — `check:command-coverage` decides coverage
37
+ * syntactically and never imported it, and the undo affordance reads
38
+ * `op.reversible`, a column. The question it appeared to raise for a
39
+ * packaged module — *a central list of every module's actions* — is real and
40
+ * lives four tables away, in `audit_logs/action-catalog.ts`, whose
41
+ * `RECENT_ACTIVITY_ACTIONS` silently drops a package's row from the
42
+ * dashboard. Publishing a list with no reader would have answered nothing.
43
+ */
44
+ export { type Command,
45
+ /** {@link Command.run}'s parameter; its `actor` is a {@link CommandActor}. */
46
+ type CommandContext,
47
+ /** {@link Command.run}'s return shape. */
48
+ type CommandOutcome,
49
+ /** {@link Command.event}'s return shape, and the audit snapshot type. */
50
+ type CommandEvent, type AuditState,
51
+ /** What {@link resolveCommandActor} returns and what a Command's `ctx.actor` is. */
52
+ type CommandActor, } from './command.js';
53
+ /** Row 5's "+5" — both derive the actor server-side, never from a request body. */
54
+ export { resolveCommandActor, actorFromContext } from './actor.js';
55
+ /** Row 5's second-largest symbol — 51 reaches — plus its own input shape. */
56
+ export { recordAuditFromContext, type AuditFromContextInput } from './audit-from-context.js';
57
+ /** Rows 5 and 33 — the class 75 module files name. */
58
+ export { CommandBus } from './command-bus.js';
59
+ /**
60
+ * The stored-revert undo (US2). `applyUndo`'s argument and return shapes travel
61
+ * with it; `UndoStatus`, `RevertConflict` and `RevertConflictReason` are members
62
+ * of {@link UndoResult} that its one consumer reads structurally.
63
+ */
64
+ export { applyUndo, type RevertRecord, type RevertHandlers, type UndoResult, } from './reversible.js';
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EACL,KAAK,OAAO;AACZ,8EAA8E;AAC9E,KAAK,cAAc;AACnB,0CAA0C;AAC1C,KAAK,cAAc;AACnB,yEAAyE;AACzE,KAAK,YAAY,EACjB,KAAK,UAAU;AACf,oFAAoF;AACpF,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,mFAAmF;AACnF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnE,6EAA6E;AAC7E,OAAO,EAAE,sBAAsB,EAAE,KAAK,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,sDAAsD;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C;;;;GAIG;AACH,OAAO,EACL,SAAS,EACT,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Command Bus core layer (feature 054 — Uniform Write Auditing & Undo,
3
+ * Constitution Principle XIII). Peer of `events/`, `tenancy/`, `http/`,
4
+ * `kernel/`; becomes the `./commands` subpath of `@endora-commerce/platform`
5
+ * (feature 080, D-160.1/D-160.7), and that subpath is the boundary a future
6
+ * `@endora-commerce/commands` would take (D-160.6).
7
+ *
8
+ * **This barrel is a package boundary in waiting, so it carries this
9
+ * directory's symbols and nothing else.** Three of the shapes a consumer needs
10
+ * to use it come from elsewhere and stay there: `AuditPort`
11
+ * (`@endora-commerce/platform/kernel`) is `recordAuditFromContext`'s first
12
+ * argument, `TenantContext` (`…/tenancy`) is `actorFromContext`'s, and
13
+ * `EventBase` (`…/events`) is what a {@link CommandEvent} carries. Re-exporting
14
+ * one of them here to save a consumer an import line spends the split option
15
+ * for a convenience.
16
+ *
17
+ * **What is on it is decided by `contracts/host-package.md` §1.3, not by what
18
+ * happens to be here** (T042f, applying T042c's rule to this directory for the
19
+ * first time). §1.3 rows 5, 12 and 33 are all **P**, and the 177 module reaches
20
+ * into this directory name **ten** distinct symbols between them; the barrel
21
+ * carried 27.
22
+ *
23
+ * So the rule is the kernel barrel's: a symbol is here when §1.3 records a
24
+ * module taking it from a **P** file, or when it is the argument, return or
25
+ * thrown shape of one of those. Two groups are deliberately absent and a future
26
+ * author will look for them:
27
+ *
28
+ * - **the bus's construction** — `CommandBusOptions` and
29
+ * `CommandRequestMeta`. A composition root builds the one {@link CommandBus}
30
+ * and supplies its request-metadata resolver; a module resolves
31
+ * `commandBus` from the container and calls `run`. The class travels because
32
+ * 75 module files name it in a constructor signature or a cradle field.
33
+ * - **the command registry**, which this barrel exported until T042f pruned it
34
+ * and !897 deleted outright. D-163 settled it: the registry was read by
35
+ * **nothing** in `src/`, and both consumers its own header named had been
36
+ * wrong since it was created — `check:command-coverage` decides coverage
37
+ * syntactically and never imported it, and the undo affordance reads
38
+ * `op.reversible`, a column. The question it appeared to raise for a
39
+ * packaged module — *a central list of every module's actions* — is real and
40
+ * lives four tables away, in `audit_logs/action-catalog.ts`, whose
41
+ * `RECENT_ACTIVITY_ACTIONS` silently drops a package's row from the
42
+ * dashboard. Publishing a list with no reader would have answered nothing.
43
+ */
44
+ export {} from './command.js';
45
+ /** Row 5's "+5" — both derive the actor server-side, never from a request body. */
46
+ export { resolveCommandActor, actorFromContext } from './actor.js';
47
+ /** Row 5's second-largest symbol — 51 reaches — plus its own input shape. */
48
+ export { recordAuditFromContext } from './audit-from-context.js';
49
+ /** Rows 5 and 33 — the class 75 module files name. */
50
+ export { CommandBus } from './command-bus.js';
51
+ /**
52
+ * The stored-revert undo (US2). `applyUndo`'s argument and return shapes travel
53
+ * with it; `UndoStatus`, `RevertConflict` and `RevertConflictReason` are members
54
+ * of {@link UndoResult} that its one consumer reads structurally.
55
+ */
56
+ export { applyUndo, } from './reversible.js';
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,EAWN,MAAM,cAAc,CAAC;AACtB,mFAAmF;AACnF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnE,6EAA6E;AAC7E,OAAO,EAAE,sBAAsB,EAA8B,MAAM,yBAAyB,CAAC;AAC7F,sDAAsD;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C;;;;GAIG;AACH,OAAO,EACL,SAAS,GAIV,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,66 @@
1
+ import type { EntityManager } from '@mikro-orm/postgresql';
2
+ /**
3
+ * Reversible-operation contract (feature 054, US2 — bulk-edit undo).
4
+ *
5
+ * A reversible command captures, per affected record, the minimal changed-field
6
+ * before-values plus the after-values it wrote (research §R3/§R5). Undo restores
7
+ * `before` for every record whose current state still matches `after` (unchanged
8
+ * since the operation), and refuses records that changed — all-or-nothing per
9
+ * record, with a conflict report (FR-006). The stored `RevertRecord[]` is the
10
+ * `revert_state` persisted on the operation row.
11
+ */
12
+ /** One affected record's captured pre/post state, sufficient to detect conflicts and restore. */
13
+ export interface RevertRecord {
14
+ /** Id of the affected record. */
15
+ readonly recordId: string;
16
+ /** Minimal changed-field values before the operation (what undo restores). */
17
+ readonly before: Record<string, unknown>;
18
+ /** The values the operation wrote (compared against current state to detect conflicts). */
19
+ readonly after: Record<string, unknown>;
20
+ }
21
+ /** Terminal-ish undo state of a reversible operation (FR-014 idempotent re-invoke). */
22
+ export type UndoStatus = 'none' | 'reverted' | 'partially_reverted';
23
+ /** Why a record could not be reverted. */
24
+ export type RevertConflictReason = 'changed_since_operation' | 'missing';
25
+ /** A record the undo refused to touch, with the reason. */
26
+ export interface RevertConflict {
27
+ readonly recordId: string;
28
+ readonly reason: RevertConflictReason;
29
+ }
30
+ /** Outcome of running an undo over a set of {@link RevertRecord}s. */
31
+ export interface UndoResult {
32
+ /** Ids restored to their `before` state. */
33
+ readonly reverted: string[];
34
+ /** Records refused (changed since / missing), never overwritten. */
35
+ readonly conflicts: RevertConflict[];
36
+ /** The resulting operation undo status. */
37
+ readonly undoStatus: UndoStatus;
38
+ }
39
+ /**
40
+ * The per-record hooks a module supplies to make its records revertible. The
41
+ * generic {@link applyUndo} helper drives them: it reads current state, compares
42
+ * to `after`, and either restores `before` or records a conflict.
43
+ */
44
+ export interface RevertHandlers {
45
+ /**
46
+ * Current changed-field values for a record, keyed like `RevertRecord.after`.
47
+ * Return `null` if the record no longer exists.
48
+ */
49
+ readCurrent(em: EntityManager, rec: RevertRecord): Promise<Record<string, unknown> | null>;
50
+ /** Restore a single record's `before` values on the transactional em. */
51
+ restore(em: EntityManager, rec: RevertRecord): Promise<void>;
52
+ /** Whether the record already carries its `before` state (already reverted → skip, no conflict). */
53
+ matchesBefore?(current: Record<string, unknown>, rec: RevertRecord): boolean;
54
+ /** Field-equality predicate; defaults to shallow JSON equality. */
55
+ equals?(a: Record<string, unknown>, b: Record<string, unknown>): boolean;
56
+ }
57
+ /** Shallow, order-insensitive JSON equality over the keys present in `expected`. */
58
+ export declare function shallowFieldEquals(current: Record<string, unknown>, expected: Record<string, unknown>): boolean;
59
+ /**
60
+ * Restore every record whose current state still matches its captured `after`;
61
+ * refuse the rest. All-or-nothing per record (FR-006). Idempotent-safe: a record
62
+ * already at its `before` state (matchesBefore) is counted as reverted without a
63
+ * second write. The caller persists the returned `undoStatus` on the operation row.
64
+ */
65
+ export declare function applyUndo(em: EntityManager, records: readonly RevertRecord[], handlers: RevertHandlers): Promise<UndoResult>;
66
+ //# sourceMappingURL=reversible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reversible.d.ts","sourceRoot":"","sources":["../../src/commands/reversible.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;;;;;GASG;AAEH,iGAAiG;AACjG,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,uF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MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,EAAE,EAAE,aAAa,EACjB,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,CA4BrB"}
@@ -0,0 +1,41 @@
1
+ /** Shallow, order-insensitive JSON equality over the keys present in `expected`. */
2
+ export function shallowFieldEquals(current, expected) {
3
+ for (const key of Object.keys(expected)) {
4
+ if (JSON.stringify(current[key]) !== JSON.stringify(expected[key]))
5
+ return false;
6
+ }
7
+ return true;
8
+ }
9
+ /**
10
+ * Restore every record whose current state still matches its captured `after`;
11
+ * refuse the rest. All-or-nothing per record (FR-006). Idempotent-safe: a record
12
+ * already at its `before` state (matchesBefore) is counted as reverted without a
13
+ * second write. The caller persists the returned `undoStatus` on the operation row.
14
+ */
15
+ export async function applyUndo(em, records, handlers) {
16
+ const equals = handlers.equals ?? shallowFieldEquals;
17
+ const reverted = [];
18
+ const conflicts = [];
19
+ for (const rec of records) {
20
+ const current = await handlers.readCurrent(em, rec);
21
+ if (current === null) {
22
+ conflicts.push({ recordId: rec.recordId, reason: 'missing' });
23
+ continue;
24
+ }
25
+ // Already restored (e.g. a prior partial undo) — count as reverted, no rewrite.
26
+ if (handlers.matchesBefore?.(current, rec) ?? equals(current, rec.before)) {
27
+ reverted.push(rec.recordId);
28
+ continue;
29
+ }
30
+ // Changed since the operation → refuse, never clobber.
31
+ if (!equals(current, rec.after)) {
32
+ conflicts.push({ recordId: rec.recordId, reason: 'changed_since_operation' });
33
+ continue;
34
+ }
35
+ await handlers.restore(em, rec);
36
+ reverted.push(rec.recordId);
37
+ }
38
+ const undoStatus = conflicts.length === 0 ? 'reverted' : reverted.length === 0 ? 'none' : 'partially_reverted';
39
+ return { reverted, conflicts, undoStatus };
40
+ }
41
+ //# sourceMappingURL=reversible.js.map
@@ -0,0 +1 @@
1
+ {"version":3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O,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,SAAS,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,yBAAyB,EAAE,CAAC,CAAC;YAC9E,SAAS;QACX,CAAC;QACD,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,MAAM,UAAU,GACd,SAAS,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC;IAC9F,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,305 @@
1
+ /**
2
+ * `composeApp` — the production half of what `composeTestServer` already is
3
+ * (`specs/110-instance-repository/` T118; `contracts/instance-repository.md`
4
+ * R1.4 and R2.4).
5
+ *
6
+ * ## What "the platform's" means here, precisely
7
+ *
8
+ * Everything in a deployment's composition that is true of **any** Endora
9
+ * platform and mentions no module: refuse a boot with no public origin, open the
10
+ * ORM, build the container, register the ORM-derived names and the host values,
11
+ * construct the audit writer, the event bus, the command bus and the two Redis
12
+ * clients, load presence from the database, compose the settings and
13
+ * sales-channel kernels, run `composeModules` once, open the contribution window
14
+ * once, install the request-scope hook, reconcile the settings manifests, run
15
+ * the boot phase once, assemble the error envelope, and give back a handle that
16
+ * can take all of it down again.
17
+ *
18
+ * Everything else — which modules, which ORM configuration, which manifests,
19
+ * which contributions, which actor a request carries — is the caller's, and
20
+ * reaches this function either as {@link AppComposition} or as one of the hooks
21
+ * below.
22
+ *
23
+ * ## The contribution wiring is the point, and it is a callback
24
+ *
25
+ * R1.4 puts *the contribution wiring* in this package; it does **not** put the
26
+ * 61 values `backend/src/composition.ts` contributes here. 41 of them carry a
27
+ * module's type or a value built out of a module's services, which D-52/D-53
28
+ * refuses from inside this package — so what moves is the *slot*, and the values
29
+ * arrive through {@link ComposeAppOptions.contribute}. Twenty do move, and every
30
+ * one of them is a kernel sub-kernel's object, a host value or an environment
31
+ * read; they are contributed **before** the caller's callback, so a deployment
32
+ * can still overwrite one.
33
+ *
34
+ * That is what makes R2.4 true the day this lands rather than after a sweep: an
35
+ * instance supplies no callback, so no file in a client's tree contributes over
36
+ * a name a module defaults, while this repository's `composition.ts` keeps its
37
+ * own as the **reference deployment's** — which is what it is, and not an
38
+ * instance.
39
+ *
40
+ * ## The one ordering rule, and why it is a shape rather than a comment
41
+ *
42
+ * `composeModules` runs once and `runBootHooks` runs once, immediately before
43
+ * this function returns, so a boot hook may resolve anything. A contribution
44
+ * over a name a module defaults goes in the single slot between them — earlier
45
+ * and the module's own registration overwrites it, later and a boot hook has
46
+ * already read the default (D-45). That slot is
47
+ * {@link ComposeAppOptions.contribute}, and both edges are enforced by the
48
+ * platform rather than remembered: the early one because `ComposedModules` does
49
+ * not exist until every module has registered, the late one because `contribute`
50
+ * throws `ContributionWindowClosedError` once `runBootHooks` has started
51
+ * (issue #52).
52
+ *
53
+ * ## Why no module may name this file
54
+ *
55
+ * It is on `./composition`, the host-internal subpath D-160.14 rules: declared
56
+ * by the `exports` map, carried by no published barrel, and answered for a
57
+ * module's reach with `host-internal-subpath`.
58
+ */
59
+ import type { EntityManager, MikroORM } from '@mikro-orm/postgresql';
60
+ import type { FastifyRequest } from 'fastify';
61
+ import { Redis } from 'ioredis';
62
+ import { CommandBus } from '../commands/index.js';
63
+ import { EventBus } from '../events/bus.js';
64
+ import { type ErrorEnvelopeOptions } from '../http/error-envelope.js';
65
+ import { ApiInterceptorRegistry } from '../http/interceptors/index.js';
66
+ import type { ModulePlugin } from '../http/server.js';
67
+ import { AuditLogService } from '../kernel/audit/audit-log-service.js';
68
+ import { composeModules } from '../kernel/compose.js';
69
+ import { type KernelContainer } from '../kernel/container.js';
70
+ import { type SalesChannelsKernel } from '../kernel/sales-channels/compose.js';
71
+ import { type SettingsKernel } from '../kernel/settings/compose.js';
72
+ import { type RegisteredManifestEntry } from '../lifecycle/index.js';
73
+ import type { TenantContext } from '../tenancy/tenant-context.js';
74
+ /** One composed module, named through `composeModules`' own signature. */
75
+ type ModuleEntry = Parameters<typeof composeModules>[0][number];
76
+ /** `composeModules`' return, named through its signature, for the same reason. */
77
+ type ComposedModules = ReturnType<typeof composeModules>;
78
+ /**
79
+ * How a composition opens and closes its ORM.
80
+ *
81
+ * A pair rather than an instance, for the reason the application's own
82
+ * `initOrm`/`closeOrm` are a pair: the ORM configuration captures
83
+ * `DATABASE_URL` at import, so *when* it is opened is part of what the caller
84
+ * decides.
85
+ */
86
+ export interface AppOrmLifecycle {
87
+ open(): Promise<MikroORM>;
88
+ close(): Promise<void>;
89
+ }
90
+ /**
91
+ * What only this build knows about itself.
92
+ *
93
+ * Every member is optional, and the default is the same call with the
94
+ * **compiled-in half empty** — which is exactly an instance: it ships no
95
+ * generated manifest index, no committed entity registry and no committed
96
+ * migration registry, so its modules, its entities and its migrations are the
97
+ * packages it installed and nothing else (R1.2, D-119/D-155).
98
+ *
99
+ * A member is therefore never a second derivation of an answer the platform
100
+ * already has. `resolveManifestEntries`, `configuredEntitiesFrom` and
101
+ * `discoverConfiguredMigrations` are the same functions the application's own
102
+ * bindings call; what an application supplies is their `core*` argument.
103
+ */
104
+ export interface AppComposition {
105
+ /**
106
+ * The module entries to compose — this repository's `MODULES` plus its
107
+ * overlay modules plus its discovered packages, or an instance's own set.
108
+ *
109
+ * A composition lacking a module that declares `activation.nonDeactivatable`
110
+ * is refused by `composeModules` before the first module registers (issue
111
+ * #258), and nothing here adds a second check or swallows the refusal.
112
+ */
113
+ readonly modules?: readonly ModuleEntry[];
114
+ /** An opener and a closer, per {@link AppOrmLifecycle}. */
115
+ readonly orm?: AppOrmLifecycle;
116
+ /**
117
+ * The instance-resolved manifest set: core, this deployment's overlay
118
+ * modules, and every installed module package.
119
+ *
120
+ * It is what the required-module set, the presence load, the error-code
121
+ * routing and the settings reconcile are all derived from — four derivations
122
+ * from one input, on every composition, so a caller that withdraws a module
123
+ * changes all four in the same run and there is no list anywhere (D-100).
124
+ */
125
+ readonly manifests?: readonly RegisteredManifestEntry[];
126
+ }
127
+ /** What every hook is handed once the modules have registered. */
128
+ export interface ComposedAppContext {
129
+ readonly orm: MikroORM;
130
+ /** A fresh tenant-filtered fork per call — the seam production forks through. */
131
+ readonly em: () => EntityManager;
132
+ readonly container: KernelContainer;
133
+ readonly eventBus: EventBus;
134
+ readonly commandBus: CommandBus;
135
+ readonly auditLogService: AuditLogService;
136
+ readonly apiInterceptors: ApiInterceptorRegistry;
137
+ readonly redis: Redis;
138
+ readonly redisSubscriber: Redis;
139
+ readonly settings: SettingsKernel;
140
+ readonly salesChannels: SalesChannelsKernel;
141
+ /** The manifest set this composition was built from, resolved once. */
142
+ readonly resolvedModules: readonly RegisteredManifestEntry[];
143
+ /** The contribution window itself — `composed.contribute({ … })`. */
144
+ readonly composed: ComposedModules;
145
+ }
146
+ export interface ComposeAppOptions {
147
+ /**
148
+ * The absolute path of the directory that holds `apps/`.
149
+ *
150
+ * **A composition input, not a container contribution** (T114a,
151
+ * `contracts/application-root-supplier.md` R1.1). The proof is an ordering
152
+ * rather than a preference: the overlay entries it locates are spread into
153
+ * the module list `composeModules` receives, so a value deciding which
154
+ * modules exist cannot arrive through D-45's window, which opens on that
155
+ * call's return value.
156
+ *
157
+ * **It is required, and that is the point.** In this repository the answer is
158
+ * `overlay-roots.ts`' one expression and it would be easy to default to; in an
159
+ * instance the platform came out of `node_modules` and any default it could
160
+ * compute names a directory holding no `apps/` at all — silently, because an
161
+ * absent declaration and an empty one are deliberately the same answer.
162
+ */
163
+ readonly deploymentRoot: string;
164
+ /** What only this build knows — see {@link AppComposition}. */
165
+ readonly composition?: AppComposition;
166
+ /**
167
+ * Host values **no module defaults** — a deployment flag, a resolver only a
168
+ * composition can write. Registered before the modules do, where a value
169
+ * comes into existence, because there is nothing to overwrite and therefore
170
+ * no contribution window (AGENTS.md § Composition item 8).
171
+ *
172
+ * The platform registers its own here too: `redis`, `redisSubscriber`,
173
+ * `eventBus`, `commandBus`, `auditLogService`, `apiInterceptors`,
174
+ * `resolvedModuleRegistry` and the deployment dials derived from
175
+ * `BACKEND_ROLE`. A caller's entry of the same name wins.
176
+ */
177
+ readonly values?: Readonly<Record<string, unknown>>;
178
+ /**
179
+ * The contribution window (D-45, issue #52) — the one slot where a value a
180
+ * module defaults may be overwritten.
181
+ *
182
+ * It runs **after** the platform's own twenty contributions, so a deployment
183
+ * that wants a different answer for one of them says so here.
184
+ */
185
+ readonly contribute?: (ctx: ComposedAppContext) => void | Promise<void>;
186
+ /**
187
+ * Route plugins mounted after every module's own, after the modules' root
188
+ * plugins, and **before** the request-scope hook.
189
+ */
190
+ readonly plugins?: readonly ModulePlugin[];
191
+ /**
192
+ * Route plugins mounted **after** the request-scope hook.
193
+ *
194
+ * The scope sits in the middle of the chain rather than at its end, so there
195
+ * are two sides to it and a caller needs both. The platform's own
196
+ * sales-channel resolver is the first entry on this side, because it writes
197
+ * the resolved channel into the open request scope.
198
+ *
199
+ * Both arrays are read after the contribution window closes, so a caller may
200
+ * push into either from inside {@link contribute}, where the value a plugin
201
+ * needs finally exists.
202
+ */
203
+ readonly scopedPlugins?: readonly ModulePlugin[];
204
+ /**
205
+ * Establish the ambient `TenantContext` for a request (Principle XI).
206
+ *
207
+ * Omitting it is not "no tenancy": the platform installs
208
+ * `registerRequestScopeHook` either way and the default context is a system
209
+ * one. There is no path through this function that leaves the hook off.
210
+ *
211
+ * The actor → context mapping is the caller's until
212
+ * `specs/110-instance-repository/` T118b relocates the `request.actor`
213
+ * augmentation: reading `request.actor` needs a `declare module 'fastify'`
214
+ * block `auth` owns, and a platform file that named it would be the
215
+ * D-52/D-53 reach this function exists to end.
216
+ */
217
+ readonly buildTenantContext?: (request: FastifyRequest) => Promise<TenantContext>;
218
+ /**
219
+ * The wrapping order this deployment declares for a name more than one of its
220
+ * overlay modules decorates (feature 107, FR-040/FR-041).
221
+ *
222
+ * The deployment's own fact, read from its `divergence.ts` and handed over.
223
+ * Forwarded to `composeModules` unchanged and **checked, never applied**.
224
+ */
225
+ readonly decorationOrder?: Readonly<Record<string, readonly string[]>> | undefined;
226
+ /**
227
+ * The modules this deployment declares it omits (D-101), from the same
228
+ * declaration `decorationOrder` comes from.
229
+ *
230
+ * Supplied rather than read here: which deployment this process runs as is a
231
+ * fact about the process, and the file that locates the declaration is the
232
+ * application's (D115-3).
233
+ */
234
+ readonly declaredOmissions?: readonly string[];
235
+ }
236
+ export interface ComposeAppHandle {
237
+ orm: MikroORM;
238
+ redis: Redis;
239
+ modules: ModulePlugin[];
240
+ errorEnvelope: ErrorEnvelopeOptions;
241
+ /** Feature 054 — the Command Bus, exposed so migrated module wiring can consume it. */
242
+ commandBus: CommandBus;
243
+ /**
244
+ * Feature 060 — the API interceptor registry. An entry point passes it to
245
+ * `buildServer({ apiInterceptors })`; modules receive it at registration.
246
+ */
247
+ apiInterceptors: ApiInterceptorRegistry;
248
+ /**
249
+ * Feature 080 (T042b, D-157.12 item 1) — the composed kernel container.
250
+ *
251
+ * Passing it is mandatory rather than convenient for anything that opens a
252
+ * scope over this composition: `composeApp` deliberately does **not** call
253
+ * `setRootContainer` (see the reason at the container's construction below),
254
+ * so an `enterSystemScope` with no `container` branches off a process-wide
255
+ * root that has nothing registered.
256
+ */
257
+ container: KernelContainer;
258
+ /**
259
+ * Feature 080 (T042b, D-157.12 item 2) — a post-registration `ModuleContext`
260
+ * for one composed module, forwarded from `ComposedModules.contextFor`.
261
+ */
262
+ contextFor: ComposedModules['contextFor'];
263
+ /**
264
+ * The instance-resolved manifest set this composition was actually built
265
+ * from: core, this deployment's overlay modules and every installed package.
266
+ */
267
+ resolvedModules: readonly RegisteredManifestEntry[];
268
+ /** Closes the ORM + redis connections; call from a SIGTERM handler. */
269
+ dispose: () => Promise<void>;
270
+ }
271
+ /**
272
+ * The default {@link AppComposition} — the compiled-in half empty.
273
+ *
274
+ * An instance ships no generated manifest index and no committed registry, so
275
+ * its modules are its overlay modules plus the packages it installed, its
276
+ * entities are those packages' entities, and its migrations are those packages'
277
+ * migrations. Each is the same platform function the application's own binding
278
+ * calls, with `core` empty, so there is no second derivation of any of them.
279
+ *
280
+ * **Exported for its own test and named by no barrel.** Every other seam that
281
+ * could reach it needs a PostgreSQL, a Redis and an installed module set —
282
+ * `composeApp` opens all three before it composes anything — while the property
283
+ * this function has to hold is decided entirely by what it reads off disk: the
284
+ * modules it composes and the manifests it resolves must be one set.
285
+ * `default-composition-overlay.test.ts` is that assertion and it runs against a
286
+ * fixture deployment root with no service behind it. `./composition` does not
287
+ * carry the name, so nothing outside this package can call it.
288
+ */
289
+ export declare function defaultComposition(deploymentRoot: string, env: NodeJS.ProcessEnv): Promise<Required<AppComposition>>;
290
+ /**
291
+ * Every environment value below is read as `process.env['NAME']` at its own
292
+ * site, and never through a local alias.
293
+ *
294
+ * That is a rule about `check:env-inputs`, not about style: its walk reconciles
295
+ * `ENVIRONMENT_INPUTS` against the `process.env` reads it can **see**, and an
296
+ * alias hides every read behind it. Measured on the first draft of this file,
297
+ * which bound `const env = process.env` once: the check's site count fell from
298
+ * 67 to 58 and `REDIS_URL` and `REVALIDATE_SECRET` were reported as
299
+ * `unread-input` — an operator asked for two values that appeared to change
300
+ * nothing, on the merge request that made them load-bearing for every
301
+ * deployment at once.
302
+ */
303
+ export declare function composeApp(options: ComposeAppOptions): Promise<ComposeAppHandle>;
304
+ export {};
305
+ //# sourceMappingURL=compose-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose-app.d.ts","sourceRoot":"","sources":["../../src/composition/compose-app.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AA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