@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,98 @@
1
+ /**
2
+ * The public origin of this backend — one reader, and one production refusal
3
+ * (issue #218).
4
+ *
5
+ * Every payment-gateway callback URL (Tpay `notification`, PayU `notifyUrl`,
6
+ * Autopay ITN/ISTN), every public product-feed URL and every newsletter
7
+ * confirmation link is `<this origin>` plus an `/api/v1/...` path. Eight sites
8
+ * used to read `PUBLIC_API_BASE_URL` directly and each invented
9
+ * `http://localhost:3001` when it was unset, so a production deployment that
10
+ * had never heard of the variable handed the gateway a callback nothing on the
11
+ * internet can reach: no payment was ever confirmed, and nothing logged or
12
+ * refused. A value whose absence produces a wrong-but-plausible URL is worse
13
+ * than one that refuses — the argument `SESSION_COOKIE_SECRET` already wins in
14
+ * `src/index.ts`.
15
+ *
16
+ * **Three spellings, one meaning.** `BACKEND_PUBLIC_URL` is what
17
+ * `deploy/compose.prod.yml` has always derived from `API_DOMAIN`;
18
+ * `API_PUBLIC_URL` is the second choice `tpay` / `payu` / `autopay` carry; and
19
+ * `PUBLIC_API_BASE_URL` is the one the eight sites read. They named the same
20
+ * thing and the templates set the wrong one, which is the whole defect. Reading
21
+ * all three here is also what keeps the refusal from taking down a deployment
22
+ * that is configured today: the shipped compose file supplies
23
+ * `BACKEND_PUBLIC_URL`, so what this refuses is a production boot with *no*
24
+ * public origin at all.
25
+ *
26
+ * Kept in the kernel rather than in a module because the refusal happens at the
27
+ * top of `composeApp()`, before a module exists to own it, and because five
28
+ * modules read the value.
29
+ */
30
+ /** Refusal to boot a production backend that has no public origin. */
31
+ export declare class PublicApiBaseUrlNotConfiguredError extends Error {
32
+ constructor();
33
+ }
34
+ /**
35
+ * The explicitly configured public origin, or `null`.
36
+ *
37
+ * Never invents one — the callers that use this rather than
38
+ * {@link resolvePublicApiBaseUrl} are the ones that answer "is an origin
39
+ * configured?" (the Autopay admin screen renders a relative ITN path and a
40
+ * `publicApiBaseConfigured: false` flag) or that would rather emit nothing than
41
+ * something unreachable (a product-feed image URL).
42
+ *
43
+ * Trailing slashes are stripped because every call site concatenates a path.
44
+ */
45
+ export declare function configuredPublicApiBaseUrl(env?: NodeJS.ProcessEnv): string | null;
46
+ /**
47
+ * Refuse a production process that has no public origin.
48
+ *
49
+ * Called at the top of `composeApp()`, before the ORM, Redis or any module
50
+ * exists, so both deployment entry points (`src/index.ts` and `src/worker.ts`)
51
+ * inherit it from the one root they share and the operator sees the message
52
+ * instead of a stack trace from whichever call site would have built the first
53
+ * wrong URL.
54
+ */
55
+ export declare function assertPublicApiBaseUrlConfigured(env?: NodeJS.ProcessEnv): void;
56
+ /**
57
+ * The public origin a URL should be built on.
58
+ *
59
+ * Outside production it falls back to this process's own local origin, which is
60
+ * what a developer running `pnpm run dev` means. In production it throws rather
61
+ * than returning that fallback.
62
+ */
63
+ export declare function resolvePublicApiBaseUrl(env?: NodeJS.ProcessEnv): string;
64
+ /**
65
+ * Make an asset / API path absolute for a consumer that is not a browser on
66
+ * this host — an e-mail client, a push payload, a partner's feed reader.
67
+ * Relative `/assets/file/...` URLs only work in a browser on the API host.
68
+ *
69
+ * It arrived here from `modules/email/` (feature 080, T040b), where it was
70
+ * filed under the module that first needed it and had **no consumer inside
71
+ * that module at all**: the composition root was its only caller, for the PWA
72
+ * asset bridge and the transactional-email asset URL. A deployment-origin
73
+ * helper the host calls is the host's, and while it lived in a module the root
74
+ * had a value import that stops having a spelling the day the module becomes a
75
+ * package (D-160.6.1).
76
+ *
77
+ * Deliberately **not** on the `./kernel` barrel: no module reaches it, and a
78
+ * published symbol with one host-internal consumer is public API nobody asked
79
+ * for.
80
+ *
81
+ * **The default base is the two spellings this function has always read, in the
82
+ * order it has always read them** — not {@link configuredPublicApiBaseUrl}.
83
+ * The two disagree on precedence when both variables are set to different
84
+ * origins, and that disagreement is one of the five answers **D-223** ended.
85
+ *
86
+ * **It has no consumer today, and that is the state the ruling left it in.**
87
+ * `assets_library` resolves the public API origin itself and every URL it
88
+ * produces is absolute, so the two composition-root call sites this function
89
+ * existed for — the PWA asset bridge and the transactional-email asset URL —
90
+ * are gone, and it came off the `./composition` barrel with them, which is what
91
+ * holding that barrel to its consumers in both directions means. The
92
+ * declaration stays: it is a correct, tested helper, and it returns to the
93
+ * barrel the day an application needs one again. What it must not become is a
94
+ * *sixth* answer to the question the ruling settled — a consumer rebasing a URL
95
+ * a module already made absolute is a consumer that can disagree with it.
96
+ */
97
+ export declare function absolutizePublicUrl(url: string | null | undefined, publicBase?: string): string;
98
+ //# sourceMappingURL=public-api-base-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api-base-url.d.ts","sourceRoot":"","sources":["../../src/kernel/public-api-base-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAoBH,sEAAsE;AACtE,qBAAa,kCAAmC,SAAQ,KAAK;;CAK5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAM9F;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,IAAI,CAI3F;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAKpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC9B,UAAU,SAAgF,GACzF,MAAM,CAOR"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * The public origin of this backend — one reader, and one production refusal
3
+ * (issue #218).
4
+ *
5
+ * Every payment-gateway callback URL (Tpay `notification`, PayU `notifyUrl`,
6
+ * Autopay ITN/ISTN), every public product-feed URL and every newsletter
7
+ * confirmation link is `<this origin>` plus an `/api/v1/...` path. Eight sites
8
+ * used to read `PUBLIC_API_BASE_URL` directly and each invented
9
+ * `http://localhost:3001` when it was unset, so a production deployment that
10
+ * had never heard of the variable handed the gateway a callback nothing on the
11
+ * internet can reach: no payment was ever confirmed, and nothing logged or
12
+ * refused. A value whose absence produces a wrong-but-plausible URL is worse
13
+ * than one that refuses — the argument `SESSION_COOKIE_SECRET` already wins in
14
+ * `src/index.ts`.
15
+ *
16
+ * **Three spellings, one meaning.** `BACKEND_PUBLIC_URL` is what
17
+ * `deploy/compose.prod.yml` has always derived from `API_DOMAIN`;
18
+ * `API_PUBLIC_URL` is the second choice `tpay` / `payu` / `autopay` carry; and
19
+ * `PUBLIC_API_BASE_URL` is the one the eight sites read. They named the same
20
+ * thing and the templates set the wrong one, which is the whole defect. Reading
21
+ * all three here is also what keeps the refusal from taking down a deployment
22
+ * that is configured today: the shipped compose file supplies
23
+ * `BACKEND_PUBLIC_URL`, so what this refuses is a production boot with *no*
24
+ * public origin at all.
25
+ *
26
+ * Kept in the kernel rather than in a module because the refusal happens at the
27
+ * top of `composeApp()`, before a module exists to own it, and because five
28
+ * modules read the value.
29
+ */
30
+ /**
31
+ * The spellings of the public API origin, in precedence order.
32
+ *
33
+ * `PUBLIC_API_BASE_URL` leads because it is the name every call site, every
34
+ * module README and the deployment checklist already document; the other two
35
+ * are accepted so an already-configured deployment is not asked to rename a
36
+ * variable to keep booting.
37
+ */
38
+ const ORIGIN_VARIABLES = ['PUBLIC_API_BASE_URL', 'BACKEND_PUBLIC_URL', 'API_PUBLIC_URL'];
39
+ const REFUSAL_MESSAGE = 'PUBLIC_API_BASE_URL is not set and NODE_ENV=production. It is the origin every ' +
40
+ 'payment-gateway callback URL, public product-feed URL and newsletter confirmation link is ' +
41
+ 'built on, so defaulting it to http://localhost:3001 would hand the gateway a callback it ' +
42
+ 'cannot reach and no payment would ever be confirmed. Set PUBLIC_API_BASE_URL (or ' +
43
+ 'BACKEND_PUBLIC_URL) to the public https origin of this API — deploy/compose.prod.yml ' +
44
+ 'derives both from API_DOMAIN.';
45
+ /** Refusal to boot a production backend that has no public origin. */
46
+ export class PublicApiBaseUrlNotConfiguredError extends Error {
47
+ constructor() {
48
+ super(REFUSAL_MESSAGE);
49
+ this.name = 'PublicApiBaseUrlNotConfiguredError';
50
+ }
51
+ }
52
+ /**
53
+ * The explicitly configured public origin, or `null`.
54
+ *
55
+ * Never invents one — the callers that use this rather than
56
+ * {@link resolvePublicApiBaseUrl} are the ones that answer "is an origin
57
+ * configured?" (the Autopay admin screen renders a relative ITN path and a
58
+ * `publicApiBaseConfigured: false` flag) or that would rather emit nothing than
59
+ * something unreachable (a product-feed image URL).
60
+ *
61
+ * Trailing slashes are stripped because every call site concatenates a path.
62
+ */
63
+ export function configuredPublicApiBaseUrl(env = process.env) {
64
+ for (const name of ORIGIN_VARIABLES) {
65
+ const raw = env[name]?.trim();
66
+ if (raw !== undefined && raw !== '')
67
+ return raw.replace(/\/+$/, '');
68
+ }
69
+ return null;
70
+ }
71
+ /**
72
+ * Refuse a production process that has no public origin.
73
+ *
74
+ * Called at the top of `composeApp()`, before the ORM, Redis or any module
75
+ * exists, so both deployment entry points (`src/index.ts` and `src/worker.ts`)
76
+ * inherit it from the one root they share and the operator sees the message
77
+ * instead of a stack trace from whichever call site would have built the first
78
+ * wrong URL.
79
+ */
80
+ export function assertPublicApiBaseUrlConfigured(env = process.env) {
81
+ if (env['NODE_ENV'] === 'production' && configuredPublicApiBaseUrl(env) === null) {
82
+ throw new PublicApiBaseUrlNotConfiguredError();
83
+ }
84
+ }
85
+ /**
86
+ * The public origin a URL should be built on.
87
+ *
88
+ * Outside production it falls back to this process's own local origin, which is
89
+ * what a developer running `pnpm run dev` means. In production it throws rather
90
+ * than returning that fallback.
91
+ */
92
+ export function resolvePublicApiBaseUrl(env = process.env) {
93
+ const configured = configuredPublicApiBaseUrl(env);
94
+ if (configured !== null)
95
+ return configured;
96
+ assertPublicApiBaseUrlConfigured(env);
97
+ return `http://localhost:${env['PORT'] ?? '3001'}`;
98
+ }
99
+ /**
100
+ * Make an asset / API path absolute for a consumer that is not a browser on
101
+ * this host — an e-mail client, a push payload, a partner's feed reader.
102
+ * Relative `/assets/file/...` URLs only work in a browser on the API host.
103
+ *
104
+ * It arrived here from `modules/email/` (feature 080, T040b), where it was
105
+ * filed under the module that first needed it and had **no consumer inside
106
+ * that module at all**: the composition root was its only caller, for the PWA
107
+ * asset bridge and the transactional-email asset URL. A deployment-origin
108
+ * helper the host calls is the host's, and while it lived in a module the root
109
+ * had a value import that stops having a spelling the day the module becomes a
110
+ * package (D-160.6.1).
111
+ *
112
+ * Deliberately **not** on the `./kernel` barrel: no module reaches it, and a
113
+ * published symbol with one host-internal consumer is public API nobody asked
114
+ * for.
115
+ *
116
+ * **The default base is the two spellings this function has always read, in the
117
+ * order it has always read them** — not {@link configuredPublicApiBaseUrl}.
118
+ * The two disagree on precedence when both variables are set to different
119
+ * origins, and that disagreement is one of the five answers **D-223** ended.
120
+ *
121
+ * **It has no consumer today, and that is the state the ruling left it in.**
122
+ * `assets_library` resolves the public API origin itself and every URL it
123
+ * produces is absolute, so the two composition-root call sites this function
124
+ * existed for — the PWA asset bridge and the transactional-email asset URL —
125
+ * are gone, and it came off the `./composition` barrel with them, which is what
126
+ * holding that barrel to its consumers in both directions means. The
127
+ * declaration stays: it is a correct, tested helper, and it returns to the
128
+ * barrel the day an application needs one again. What it must not become is a
129
+ * *sixth* answer to the question the ruling settled — a consumer rebasing a URL
130
+ * a module already made absolute is a consumer that can disagree with it.
131
+ */
132
+ export function absolutizePublicUrl(url, publicBase = process.env['BACKEND_PUBLIC_URL'] ?? process.env['PUBLIC_API_BASE_URL'] ?? '') {
133
+ if (!url)
134
+ return '';
135
+ if (/^(https?:|data:|mailto:)/i.test(url))
136
+ return url;
137
+ const base = publicBase.replace(/\/+$/, '');
138
+ if (!base)
139
+ return url;
140
+ if (url.startsWith('/'))
141
+ return `${base}${url}`;
142
+ return `${base}/${url}`;
143
+ }
144
+ //# sourceMappingURL=public-api-base-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api-base-url.js","sourceRoot":"","sources":["../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AAO,UAAU,CAAC;IAC3C,gCAAgC,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,oBAAoB,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,UAAU,mBAAmB,CACjC,GAA8B,EAC9B,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,EAAE;IAE1F,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACtD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,CAAC;IACtB,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,IAAI,GAAG,GAAG,EAAE,CAAC;IAChD,OAAO,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,63 @@
1
+ import type { FastifyInstance, FastifyRequest } from 'fastify';
2
+ import { type TenantContext } from '../tenancy/tenant-context.js';
3
+ /**
4
+ * The HTTP entry into `enterPlatformScope` (feature 072, FR-015…FR-021).
5
+ *
6
+ * Registered by both the production composition root and the test harness, from
7
+ * this one file on purpose: the two hand-written copies of the tenant hook it
8
+ * replaces had already drifted apart in their comments, and a drift in *this*
9
+ * hook is a silent cross-tenant leak rather than a failing test.
10
+ *
11
+ * ## Shape
12
+ *
13
+ * `done()` is called **synchronously inside** the store, which is what makes the
14
+ * store propagate into every later hook and into the handler's awaited
15
+ * continuations — `enterWith` from an async hook does not, and fails silently
16
+ * (`tenancy/tenant-context.ts`). The work the scope wraps is therefore "the rest
17
+ * of this request", expressed as a promise that settles when `reply.raw` emits
18
+ * `close`. That one event covers success, error and client abort, so the scope
19
+ * is disposed in all three cases with a single mechanism and no `try/finally`
20
+ * spread across the response path.
21
+ *
22
+ * ## Ordering
23
+ *
24
+ * This hook must be registered **after** the auth hook (it derives tenancy from
25
+ * `request.actor`) and **before** the sales-channel resolver (which fills the
26
+ * scope's channel slot and whose refusal path writes an audit row, so it needs
27
+ * tenancy). See the ordering note in `scope.ts` — that order is a constraint,
28
+ * not an accident of registration.
29
+ *
30
+ * ## Disclosure
31
+ *
32
+ * It also carries the *outbound* half (feature 087, owner decision of
33
+ * 2026-08-29): `preSerialization` puts `meta.scopeNotice` on a successful body
34
+ * when the tenant filter refused a whole table for want of an organization
35
+ * column. It lives here, and not on each route, because that is the only place
36
+ * both facts are in hand at once — the context this hook opened, and the body
37
+ * about to go out — and because a per-route flag is a flag somebody forgets.
38
+ * Both composition roots register this hook, so neither can disclose less than
39
+ * the other.
40
+ */
41
+ export interface RequestScopeHookOptions {
42
+ /**
43
+ * Derive the request's tenant context from the already-authenticated actor —
44
+ * never from request inputs (Constitution XI). Rejecting here fails the
45
+ * request through `done(err)`, exactly as the pre-kernel hook did.
46
+ */
47
+ buildTenantContext: (request: FastifyRequest) => Promise<TenantContext>;
48
+ }
49
+ export declare function registerRequestScopeHook(app: FastifyInstance, options: RequestScopeHookOptions): Promise<void>;
50
+ /**
51
+ * Put `meta.scopeNotice` on `payload` when this execution's tenant filter
52
+ * refused a whole table, and return `payload` untouched otherwise.
53
+ *
54
+ * Three things it deliberately does not do. It does not touch an **error**
55
+ * body: a 4xx/5xx envelope is `{ error: … }` and already says why, and a notice
56
+ * about emptiness on a refusal is noise. It does not touch a **non-object**
57
+ * body — the newsletter CSV export is a string, and a Buffer or a stream is
58
+ * nobody's envelope. And it does not overwrite an existing `meta`, it merges
59
+ * into it, because `meta` is where two of the three surfaces already keep their
60
+ * pagination.
61
+ */
62
+ export declare function withScopeNotice(payload: unknown, statusCode: number): unknown;
63
+ //# sourceMappingURL=request-scope-hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-scope-hook.d.ts","sourceRoot":"","sources":["../../src/kernel/request-scope-hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG/D,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CACzE;AAWD,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAc7E"}
@@ -0,0 +1,67 @@
1
+ import fastifyPlugin from 'fastify-plugin';
2
+ import { SCOPE_NOTICE_CODES } from '@endora-commerce/contracts';
3
+ import { getTenantContext } from '../tenancy/tenant-context.js';
4
+ import { enterPlatformScope } from './scope.js';
5
+ function requestMetaOf(request) {
6
+ const userAgent = request.headers['user-agent'];
7
+ return {
8
+ requestId: request.id ? String(request.id) : null,
9
+ ipAddress: request.ip ?? null,
10
+ userAgent: Array.isArray(userAgent) ? (userAgent[0] ?? null) : (userAgent ?? null),
11
+ };
12
+ }
13
+ export async function registerRequestScopeHook(app, options) {
14
+ await app.register(fastifyPlugin(async (inner) => {
15
+ inner.addHook('onRequest', (request, reply, done) => {
16
+ options.buildTenantContext(request).then((tenant) => {
17
+ void enterPlatformScope(tenant, () => new Promise((resolve) => {
18
+ reply.raw.once('close', resolve);
19
+ done();
20
+ }), { entryPoint: 'http', requestMeta: requestMetaOf(request) }).catch((err) => {
21
+ // Reaching here means the scope failed to close down, not that the
22
+ // request failed — the response has already been written by then.
23
+ request.log.error({ err }, 'platform scope disposal failed');
24
+ });
25
+ }, (err) => done(err));
26
+ });
27
+ // The disclosure (feature 087). `preSerialization` runs inside the store
28
+ // this hook opened — the `onRequest` callback calls `done()`
29
+ // synchronously inside it, so the whole lifecycle continues in that async
30
+ // context — which is what lets the sink written by the filter during the
31
+ // handler be read here.
32
+ inner.addHook('preSerialization', (_request, reply, payload, done) => {
33
+ done(null, withScopeNotice(payload, reply.statusCode));
34
+ });
35
+ }));
36
+ }
37
+ /**
38
+ * Put `meta.scopeNotice` on `payload` when this execution's tenant filter
39
+ * refused a whole table, and return `payload` untouched otherwise.
40
+ *
41
+ * Three things it deliberately does not do. It does not touch an **error**
42
+ * body: a 4xx/5xx envelope is `{ error: … }` and already says why, and a notice
43
+ * about emptiness on a refusal is noise. It does not touch a **non-object**
44
+ * body — the newsletter CSV export is a string, and a Buffer or a stream is
45
+ * nobody's envelope. And it does not overwrite an existing `meta`, it merges
46
+ * into it, because `meta` is where two of the three surfaces already keep their
47
+ * pagination.
48
+ */
49
+ export function withScopeNotice(payload, statusCode) {
50
+ if (statusCode >= 400)
51
+ return payload;
52
+ if (!getTenantContext()?.notices?.organizationAttributionRefused)
53
+ return payload;
54
+ if (typeof payload !== 'object' || payload === null)
55
+ return payload;
56
+ if (Array.isArray(payload) || Buffer.isBuffer(payload))
57
+ return payload;
58
+ const body = payload;
59
+ const existingMeta = typeof body.meta === 'object' && body.meta !== null && !Array.isArray(body.meta)
60
+ ? body.meta
61
+ : {};
62
+ return {
63
+ ...body,
64
+ meta: { ...existingMeta, scopeNotice: SCOPE_NOTICE_CODES.ORGANIZATION_ATTRIBUTION_PENDING },
65
+ };
66
+ }
67
+ //# sourceMappingURL=request-scope-hook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-scope-hook.js","sourceRoot":"","sources":["../../src/kernel/request-scope-hook.ts"],"names":[],"mappings":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IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9E,CAAC,CAAE,IAAI,CAAC,IAAgC;QACxC,CAAC,CAAC,EAAE,CAAC;IACT,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,EAAE,GAAG,YAAY,EAAE,WAAW,EAAE,kBAAkB,CAAC,gCAAgC,EAAE;KAC5F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { type ChannelMemberEntityType } from '@endora-commerce/contracts';
2
+ /**
3
+ * Which table holds a channel-scoped entity type's memberships, said by the
4
+ * module that owns that entity type (feature 120, FR-015; D-226).
5
+ *
6
+ * ## What this replaces, and why it was a defect rather than a tidiness question
7
+ *
8
+ * `SalesChannelMembershipService` held a literal map **total** over
9
+ * `ChannelMemberEntityTypeSchema` — nine `{ table, entityIdColumn }` triples,
10
+ * naming `catalog`'s, `cms`', `promotions`' and six other modules' tables from
11
+ * inside the platform. `tsc` kept it honest precisely *because* it was total,
12
+ * and that totality is the defect: the platform named nine module concepts, so
13
+ * D-52/D-53's prohibition was expressed in a contract instead of in an import
14
+ * and no check in the estate could see it. On an instance that never installed
15
+ * `cms`, a membership call for `cms-page` executed SQL against a relation that
16
+ * is not there.
17
+ *
18
+ * A second copy of the same nine triples lived in `sales_channels`' own admin
19
+ * service, on the channel-**delete** path, justified by a circular import that
20
+ * had not existed since feature 072's T019 moved the membership service into the
21
+ * kernel. Both are gone; this registry is what they became.
22
+ *
23
+ * ## The two axes, and which one this answers
24
+ *
25
+ * A registration is a statement about **schema**: *this entity type's
26
+ * memberships live in this table, keyed by this column*. It is contributed once
27
+ * per composition by the module whose migrations create the table, which makes
28
+ * it an answer on the **platform-availability** axis — a module that is not
29
+ * composed contributes nothing, and {@link ChannelBridgeRegistry.require}
30
+ * refuses rather than reaching a relation that may not exist (FR-017).
31
+ *
32
+ * It is deliberately **not** an answer on the operator-activation axis. The
33
+ * rows survive an operator switching the owning module off, so the bridge must
34
+ * still be readable — which is the same reasoning the asset-reference and
35
+ * language-reference registries state for their own contributions: a
36
+ * contribution is inert, and probing presence in the hook that makes one would
37
+ * make runtime activation require a restart (D-62/D-68). The activation axis is
38
+ * answered where it belongs, at the owning module's own routes and ports.
39
+ *
40
+ * ## Why it is not published on the kernel barrel
41
+ *
42
+ * Nothing here needs an address a module compiles against: a module contributes
43
+ * by resolving `salesChannelBridgeRegistry` from the container, which is a
44
+ * runtime name and not an import. Publishing the registry would enlarge the
45
+ * platform's published surface — which `check:platform-surface` judges and
46
+ * `PUBLISHED_SUBPATHS` pins — for a seam whose whole purpose is to *remove* a
47
+ * platform-held map.
48
+ */
49
+ export interface ChannelBridgeRegistration {
50
+ /** The published vocabulary member this bridge serves. */
51
+ readonly entityType: ChannelMemberEntityType;
52
+ /** The M:N bridge table, created by the contributing module's own migration. */
53
+ readonly table: string;
54
+ /** The column in it holding the entity's id; `sales_channel_id` holds the other side. */
55
+ readonly entityIdColumn: string;
56
+ }
57
+ export declare class ChannelBridgeRegistry {
58
+ private readonly bridges;
59
+ /**
60
+ * Declare the bridge this module owns.
61
+ *
62
+ * **A conflicting second registration is refused, never silently
63
+ * overwritten**: two modules claiming one member of the vocabulary is an
64
+ * ownership collision, and the last composer winning would decide which
65
+ * table a membership write lands in by module order.
66
+ *
67
+ * Re-declaring the **same** triple is a no-op rather than a refusal, and the
68
+ * distinction is the design rather than a leniency. A registration is a
69
+ * statement of fact about the schema, not a capability instance: nothing is
70
+ * overwritten by repeating it, and a process legitimately composes more than
71
+ * once — the test harness builds a platform per file, and several unit files
72
+ * compose the whole module list twice to compare two compositions. Refusing
73
+ * an identical repeat would make this seam fail for a reason that has nothing
74
+ * to do with what it guards.
75
+ */
76
+ register(bridge: ChannelBridgeRegistration): void;
77
+ /**
78
+ * The bridge for `entityType`, or a refusal (FR-017).
79
+ *
80
+ * The refusal is the whole point of the registry: on an instance that did not
81
+ * install the module owning this entity type there is no table to read, and
82
+ * the honest answer is *"this platform cannot serve that capability"* rather
83
+ * than a Postgres `relation … does not exist` from inside a transaction that
84
+ * has already written something else.
85
+ *
86
+ * `MODULE_DISABLED` is the code because it is the one the platform already
87
+ * publishes and translates for *"a capability this platform is not currently
88
+ * serving"*, and a consumer branching on it needs no new vocabulary. The
89
+ * module is **not** named in the details, because the honest answer is that
90
+ * no module registered it: naming one would be a guess about which package an
91
+ * operator was expected to install.
92
+ */
93
+ require(entityType: ChannelMemberEntityType): ChannelBridgeRegistration;
94
+ /** The registered bridges, in registration order. Empty in a process that composed nothing. */
95
+ list(): readonly ChannelBridgeRegistration[];
96
+ }
97
+ /**
98
+ * The registry a composition uses unless it is handed another.
99
+ *
100
+ * Process-level, on `inProcessCaches`' precedent, and for the same reason: the
101
+ * contributors are modules and the reader is the kernel, so threading one
102
+ * handle through every composition root — and through every test that
103
+ * constructs the membership service against a bare database — is a lot of
104
+ * wiring for a table that is a property of the build rather than of a
105
+ * composition. {@link ChannelBridgeRegistry.register}'s idempotence is what
106
+ * makes one-per-process safe.
107
+ */
108
+ export declare const channelBridges: ChannelBridgeRegistry;
109
+ //# sourceMappingURL=channel-bridge-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-bridge-registry.d.ts","sourceRoot":"","sources":["../../../src/kernel/sales-channels/channel-bridge-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAGvF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiE;IAEzF;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,MAAM,EAAE,yBAAyB,GAAG,IAAI;IAcjD;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,UAAU,EAAE,uBAAuB,GAAG,yBAAyB;IAcvE,+FAA+F;IAC/F,IAAI,IAAI,SAAS,yBAAyB,EAAE;CAG7C;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,uBAA8B,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { ERROR_CODES } from '@endora-commerce/contracts';
2
+ import { HttpError } from '../../http/error-envelope.js';
3
+ export class ChannelBridgeRegistry {
4
+ bridges = new Map();
5
+ /**
6
+ * Declare the bridge this module owns.
7
+ *
8
+ * **A conflicting second registration is refused, never silently
9
+ * overwritten**: two modules claiming one member of the vocabulary is an
10
+ * ownership collision, and the last composer winning would decide which
11
+ * table a membership write lands in by module order.
12
+ *
13
+ * Re-declaring the **same** triple is a no-op rather than a refusal, and the
14
+ * distinction is the design rather than a leniency. A registration is a
15
+ * statement of fact about the schema, not a capability instance: nothing is
16
+ * overwritten by repeating it, and a process legitimately composes more than
17
+ * once — the test harness builds a platform per file, and several unit files
18
+ * compose the whole module list twice to compare two compositions. Refusing
19
+ * an identical repeat would make this seam fail for a reason that has nothing
20
+ * to do with what it guards.
21
+ */
22
+ register(bridge) {
23
+ const held = this.bridges.get(bridge.entityType);
24
+ if (held !== undefined) {
25
+ if (held.table === bridge.table && held.entityIdColumn === bridge.entityIdColumn)
26
+ return;
27
+ throw new Error(`sales-channel bridge '${bridge.entityType}' is already registered as ` +
28
+ `"${held.table}"."${held.entityIdColumn}" and cannot be re-registered as ` +
29
+ `"${bridge.table}"."${bridge.entityIdColumn}" — two modules claim one member of the ` +
30
+ 'channel-membership vocabulary');
31
+ }
32
+ this.bridges.set(bridge.entityType, bridge);
33
+ }
34
+ /**
35
+ * The bridge for `entityType`, or a refusal (FR-017).
36
+ *
37
+ * The refusal is the whole point of the registry: on an instance that did not
38
+ * install the module owning this entity type there is no table to read, and
39
+ * the honest answer is *"this platform cannot serve that capability"* rather
40
+ * than a Postgres `relation … does not exist` from inside a transaction that
41
+ * has already written something else.
42
+ *
43
+ * `MODULE_DISABLED` is the code because it is the one the platform already
44
+ * publishes and translates for *"a capability this platform is not currently
45
+ * serving"*, and a consumer branching on it needs no new vocabulary. The
46
+ * module is **not** named in the details, because the honest answer is that
47
+ * no module registered it: naming one would be a guess about which package an
48
+ * operator was expected to install.
49
+ */
50
+ require(entityType) {
51
+ const bridge = this.bridges.get(entityType);
52
+ if (bridge === undefined) {
53
+ throw new HttpError(503, ERROR_CODES.MODULE_DISABLED, `Sales-channel membership for '${entityType}' is not available on this platform: no ` +
54
+ 'installed module contributes that bridge.', [{ path: 'entityType', issue: entityType }]);
55
+ }
56
+ return bridge;
57
+ }
58
+ /** The registered bridges, in registration order. Empty in a process that composed nothing. */
59
+ list() {
60
+ return [...this.bridges.values()];
61
+ }
62
+ }
63
+ /**
64
+ * The registry a composition uses unless it is handed another.
65
+ *
66
+ * Process-level, on `inProcessCaches`' precedent, and for the same reason: the
67
+ * contributors are modules and the reader is the kernel, so threading one
68
+ * handle through every composition root — and through every test that
69
+ * constructs the membership service against a bare database — is a lot of
70
+ * wiring for a table that is a property of the build rather than of a
71
+ * composition. {@link ChannelBridgeRegistry.register}'s idempotence is what
72
+ * makes one-per-process safe.
73
+ */
74
+ export const channelBridges = new ChannelBridgeRegistry();
75
+ //# sourceMappingURL=channel-bridge-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-bridge-registry.js","sourceRoot":"","sources":["../../../src/kernel/sales-channels/channel-bridge-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgC,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AA0DzD,MAAM,OAAO,qBAAqB;IACf,OAAO,GAAG,IAAI,GAAG,EAAsD,CAAC;IAEzF;;;;;;;;;;;;;;;;OA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