@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,102 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Entity, Index, OptionalProps, PrimaryKey, Property } from '@mikro-orm/core';
11
+ import { GlobalEntity } from '../../tenancy/org-scoped.decorator.js';
12
+ import { randomUUID } from 'crypto';
13
+ /**
14
+ * Row in the audit log of sensitive operations (FR-084, R-12).
15
+ * Never soft-deleted — accounting + audit retention ≥ 5 years per spec assumptions.
16
+ */
17
+ let AuditLogEntry = class AuditLogEntry {
18
+ [OptionalProps];
19
+ id = randomUUID();
20
+ /** The Admin User who performed the action. Null for system-initiated entries. */
21
+ actorAdminUserId;
22
+ /**
23
+ * The Customer Account being acted upon by the Admin User during Impersonation (R-12).
24
+ * Non-null entries describe operations performed on behalf of the Customer.
25
+ */
26
+ impersonatedCustomerAccountId;
27
+ actedAt = new Date();
28
+ /**
29
+ * Screaming-snake-case action identifier, e.g. `price.update`, `permission.change`,
30
+ * `credit_limit.adjust`, `impersonation.start`, `impersonation.end`.
31
+ */
32
+ action;
33
+ /** Polymorphic pointer to the affected entity. */
34
+ objectType;
35
+ objectId;
36
+ /** Diff-friendly snapshot of the affected fields before the mutation. */
37
+ stateBefore;
38
+ stateAfter;
39
+ ipAddress;
40
+ userAgent;
41
+ /** Correlation id from the inbound request (X-Request-Id). */
42
+ requestId;
43
+ };
44
+ __decorate([
45
+ PrimaryKey({ type: 'uuid' }),
46
+ __metadata("design:type", String)
47
+ ], AuditLogEntry.prototype, "id", void 0);
48
+ __decorate([
49
+ Property({ type: 'uuid', nullable: true }),
50
+ Index(),
51
+ __metadata("design:type", Object)
52
+ ], AuditLogEntry.prototype, "actorAdminUserId", void 0);
53
+ __decorate([
54
+ Property({ type: 'uuid', nullable: true }),
55
+ Index(),
56
+ __metadata("design:type", Object)
57
+ ], AuditLogEntry.prototype, "impersonatedCustomerAccountId", void 0);
58
+ __decorate([
59
+ Property({ type: 'datetime' }),
60
+ Index(),
61
+ __metadata("design:type", Date)
62
+ ], AuditLogEntry.prototype, "actedAt", void 0);
63
+ __decorate([
64
+ Property({ type: 'string', length: 120 }),
65
+ Index(),
66
+ __metadata("design:type", String)
67
+ ], AuditLogEntry.prototype, "action", void 0);
68
+ __decorate([
69
+ Property({ type: 'string', length: 120 }),
70
+ __metadata("design:type", String)
71
+ ], AuditLogEntry.prototype, "objectType", void 0);
72
+ __decorate([
73
+ Property({ type: 'string', length: 120 }),
74
+ Index(),
75
+ __metadata("design:type", String)
76
+ ], AuditLogEntry.prototype, "objectId", void 0);
77
+ __decorate([
78
+ Property({ type: 'json', nullable: true }),
79
+ __metadata("design:type", Object)
80
+ ], AuditLogEntry.prototype, "stateBefore", void 0);
81
+ __decorate([
82
+ Property({ type: 'json', nullable: true }),
83
+ __metadata("design:type", Object)
84
+ ], AuditLogEntry.prototype, "stateAfter", void 0);
85
+ __decorate([
86
+ Property({ type: 'string', length: 45, nullable: true }),
87
+ __metadata("design:type", Object)
88
+ ], AuditLogEntry.prototype, "ipAddress", void 0);
89
+ __decorate([
90
+ Property({ type: 'string', length: 255, nullable: true }),
91
+ __metadata("design:type", Object)
92
+ ], AuditLogEntry.prototype, "userAgent", void 0);
93
+ __decorate([
94
+ Property({ type: 'string', length: 64, nullable: true }),
95
+ __metadata("design:type", Object)
96
+ ], AuditLogEntry.prototype, "requestId", void 0);
97
+ AuditLogEntry = __decorate([
98
+ GlobalEntity(),
99
+ Entity({ tableName: 'audit_log_entries' })
100
+ ], AuditLogEntry);
101
+ export { AuditLogEntry };
102
+ //# sourceMappingURL=audit-log-entry.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log-entry.entity.js","sourceRoot":"","sources":["../../../src/kernel/audit/audit-log-entry.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC;;;GAGG;AAGI,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,CAAC,aAAa,CAAC,CAAoB;IAGnC,EAAE,GAAW,UAAU,EAAE,CAAC;IAE1B,kFAAkF;IAGlF,gBAAgB,CAAiB;IAEjC;;;OAGG;IAGH,6BAA6B,CAAiB;IAI9C,OAAO,GAAS,IAAI,IAAI,EAAE,CAAC;IAE3B;;;OAGG;IAGH,MAAM,CAAU;IAEhB,kDAAkD;IAElD,UAAU,CAAU;IAIpB,QAAQ,CAAU;IAElB,yEAAyE;IAEzE,WAAW,CAAkC;IAG7C,UAAU,CAAkC;IAG5C,SAAS,CAAiB;IAG1B,SAAS,CAAiB;IAE1B,8DAA8D;IAE9D,SAAS,CAAiB;CAC3B,CAAA;AAnDC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACH;AAK1B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1C,KAAK,EAAE;;uDACyB;AAQjC;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1C,KAAK,EAAE;;oEACsC;AAI9C;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC9B,KAAK,EAAE;8BACC,IAAI;8CAAc;AAQ3B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACzC,KAAK,EAAE;;6CACQ;AAIhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;iDACtB;AAIpB;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACzC,KAAK,EAAE;;+CACU;AAIlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACE;AAG7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACC;AAG5C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC/B;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChC;AAI1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAC/B;AAtDf,aAAa;IAFzB,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;GAC9B,aAAa,CAuDzB"}
@@ -0,0 +1,63 @@
1
+ import type { EntityManager } from '@mikro-orm/postgresql';
2
+ import { AuditLogEntry } from './audit-log-entry.entity.js';
3
+ import type { AuditLogFilter, AuditPort, RecordAuditInput } from '../ports/audit.js';
4
+ /**
5
+ * Append-only audit log writer. Every sensitive operation (FR-084) calls `record()`
6
+ * — price changes, permission changes, credit-limit adjustments, order-status changes
7
+ * performed during Impersonation, etc.
8
+ *
9
+ * This service is deliberately narrow: it only appends rows. Queries are the concern
10
+ * of the admin-panel audit viewer (US4 / T195).
11
+ *
12
+ * **The class is the host's implementation and not the platform's contract**
13
+ * (D-160.10). {@link AuditPort} is what a module types on and what the kernel
14
+ * barrel publishes; this file is reachable only by its relative path, which the
15
+ * composition roots and the tests have and a packaged module does not. The
16
+ * shapes it used to declare — `RecordAuditInput` and `AuditLogFilter` — moved to
17
+ * the port beside the methods that take them, so the class cannot widen the
18
+ * contract by growing a field.
19
+ */
20
+ export declare class AuditLogService implements AuditPort {
21
+ private readonly emFactory;
22
+ constructor(emFactory: () => EntityManager);
23
+ record(input: RecordAuditInput): Promise<AuditLogEntry>;
24
+ /**
25
+ * Co-transactional audit writer (feature 054, Constitution Principle XIII).
26
+ *
27
+ * Persists the entry on the CALLER's transactional `em` with NO fork and NO
28
+ * flush — the caller's `em.transactional(...)` commits it atomically with the
29
+ * domain write, so the audit row and the write live or die together (FR-003).
30
+ *
31
+ * The {@link CommandBus} is its main caller. `CartAuditService` is the other
32
+ * one (issue #152): a sweep lands a batch of audit rows beside the batch of
33
+ * domain rows it is auditing, and one flush over one EntityManager is what
34
+ * makes "the flip and its audit row commit together" true rather than
35
+ * documented. `record()` is still what a service reaches for when it has one
36
+ * row and no unit of work of its own to join.
37
+ */
38
+ recordWithin(em: EntityManager, input: RecordAuditInput): AuditLogEntry;
39
+ private build;
40
+ query(filter?: AuditLogFilter): Promise<AuditLogEntry[]>;
41
+ /**
42
+ * Every entry recorded under one action for a **set** of objects, oldest
43
+ * first (issue #284).
44
+ *
45
+ * `query()` above answers for one object and caps the answer; this one
46
+ * answers for a page. The difference is the whole reason it exists: its
47
+ * caller is a list of orders asking who wrote each one's current status, and
48
+ * `query()` per row is an N+1 across the page — the class of defect MR !822
49
+ * spent a day pinning out of the catalogue listing.
50
+ *
51
+ * Deliberately **uncapped**. A `limit` over a set does not bound the work
52
+ * evenly, it drops whichever objects sort last, and an object whose history
53
+ * was silently truncated reads as an object with no history — a wrong answer
54
+ * rather than a slow one. The population is bounded by the caller instead:
55
+ * it passes the ids on one page.
56
+ */
57
+ findByObjectIds(input: {
58
+ action: string;
59
+ objectType: string;
60
+ objectIds: readonly string[];
61
+ }): Promise<AuditLogEntry[]>;
62
+ }
63
+ //# sourceMappingURL=audit-log-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log-service.d.ts","sourceRoot":"","sources":["../../../src/kernel/audit/audit-log-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErF;;;;;;;;;;;;;;;GAeG;AAEH,qBAAa,eAAgB,YAAW,SAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,MAAM,aAAa;IAErD,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO7D;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,gBAAgB,GAAG,aAAa;IAMvE,OAAO,CAAC,KAAK;IAiBP,KAAK,CAAC,MAAM,GAAE,cAAmB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAgBlE;;;;;;;;;;;;;;;OAeG;IACG,eAAe,CAAC,KAAK,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;KAC9B,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAU7B"}
@@ -0,0 +1,107 @@
1
+ import { AuditLogEntry } from './audit-log-entry.entity.js';
2
+ /**
3
+ * Append-only audit log writer. Every sensitive operation (FR-084) calls `record()`
4
+ * — price changes, permission changes, credit-limit adjustments, order-status changes
5
+ * performed during Impersonation, etc.
6
+ *
7
+ * This service is deliberately narrow: it only appends rows. Queries are the concern
8
+ * of the admin-panel audit viewer (US4 / T195).
9
+ *
10
+ * **The class is the host's implementation and not the platform's contract**
11
+ * (D-160.10). {@link AuditPort} is what a module types on and what the kernel
12
+ * barrel publishes; this file is reachable only by its relative path, which the
13
+ * composition roots and the tests have and a packaged module does not. The
14
+ * shapes it used to declare — `RecordAuditInput` and `AuditLogFilter` — moved to
15
+ * the port beside the methods that take them, so the class cannot widen the
16
+ * contract by growing a field.
17
+ */
18
+ export class AuditLogService {
19
+ emFactory;
20
+ constructor(emFactory) {
21
+ this.emFactory = emFactory;
22
+ }
23
+ async record(input) {
24
+ const em = this.emFactory();
25
+ const entry = this.build(em, input);
26
+ await em.persistAndFlush(entry);
27
+ return entry;
28
+ }
29
+ /**
30
+ * Co-transactional audit writer (feature 054, Constitution Principle XIII).
31
+ *
32
+ * Persists the entry on the CALLER's transactional `em` with NO fork and NO
33
+ * flush — the caller's `em.transactional(...)` commits it atomically with the
34
+ * domain write, so the audit row and the write live or die together (FR-003).
35
+ *
36
+ * The {@link CommandBus} is its main caller. `CartAuditService` is the other
37
+ * one (issue #152): a sweep lands a batch of audit rows beside the batch of
38
+ * domain rows it is auditing, and one flush over one EntityManager is what
39
+ * makes "the flip and its audit row commit together" true rather than
40
+ * documented. `record()` is still what a service reaches for when it has one
41
+ * row and no unit of work of its own to join.
42
+ */
43
+ recordWithin(em, input) {
44
+ const entry = this.build(em, input);
45
+ em.persist(entry);
46
+ return entry;
47
+ }
48
+ build(em, input) {
49
+ return em.create(AuditLogEntry, {
50
+ action: input.action,
51
+ objectType: input.objectType,
52
+ objectId: input.objectId,
53
+ ...(input.actorAdminUserId !== undefined ? { actorAdminUserId: input.actorAdminUserId } : {}),
54
+ ...(input.impersonatedCustomerAccountId !== undefined
55
+ ? { impersonatedCustomerAccountId: input.impersonatedCustomerAccountId }
56
+ : {}),
57
+ ...(input.stateBefore !== undefined ? { stateBefore: input.stateBefore } : {}),
58
+ ...(input.stateAfter !== undefined ? { stateAfter: input.stateAfter } : {}),
59
+ ...(input.ipAddress !== undefined ? { ipAddress: input.ipAddress } : {}),
60
+ ...(input.userAgent !== undefined ? { userAgent: input.userAgent } : {}),
61
+ ...(input.requestId !== undefined ? { requestId: input.requestId } : {}),
62
+ });
63
+ }
64
+ async query(filter = {}) {
65
+ const em = this.emFactory();
66
+ const where = {};
67
+ if (filter.actorAdminUserId)
68
+ where['actorAdminUserId'] = filter.actorAdminUserId;
69
+ if (filter.action)
70
+ where['action'] = filter.action;
71
+ if (filter.objectType)
72
+ where['objectType'] = filter.objectType;
73
+ if (filter.objectId)
74
+ where['objectId'] = filter.objectId;
75
+ if (filter.impersonatedCustomerAccountId) {
76
+ where['impersonatedCustomerAccountId'] = filter.impersonatedCustomerAccountId;
77
+ }
78
+ return em.find(AuditLogEntry, where, {
79
+ orderBy: { actedAt: 'desc' },
80
+ limit: Math.min(Math.max(filter.limit ?? 100, 1), 500),
81
+ });
82
+ }
83
+ /**
84
+ * Every entry recorded under one action for a **set** of objects, oldest
85
+ * first (issue #284).
86
+ *
87
+ * `query()` above answers for one object and caps the answer; this one
88
+ * answers for a page. The difference is the whole reason it exists: its
89
+ * caller is a list of orders asking who wrote each one's current status, and
90
+ * `query()` per row is an N+1 across the page — the class of defect MR !822
91
+ * spent a day pinning out of the catalogue listing.
92
+ *
93
+ * Deliberately **uncapped**. A `limit` over a set does not bound the work
94
+ * evenly, it drops whichever objects sort last, and an object whose history
95
+ * was silently truncated reads as an object with no history — a wrong answer
96
+ * rather than a slow one. The population is bounded by the caller instead:
97
+ * it passes the ids on one page.
98
+ */
99
+ async findByObjectIds(input) {
100
+ const objectIds = [...new Set(input.objectIds)];
101
+ // No ids is no question, and an `$in: []` is still a round trip.
102
+ if (objectIds.length === 0)
103
+ return [];
104
+ return this.emFactory().find(AuditLogEntry, { action: input.action, objectType: input.objectType, objectId: { $in: objectIds } }, { orderBy: { actedAt: 'asc' } });
105
+ }
106
+ }
107
+ //# sourceMappingURL=audit-log-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log-service.js","sourceRoot":"","sources":["../../../src/kernel/audit/audit-log-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,SAA8B;QAA9B,cAAS,GAAT,SAAS,CAAqB;IAAG,CAAC;IAE/D,KAAK,CAAC,MAAM,CAAC,KAAuB;QAClC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACpC,MAAM,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAiB,EAAE,KAAuB;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACpC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,KAAK,CAAC,EAAiB,EAAE,KAAuB;QACtD,OAAO,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE;YAC9B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,GAAG,CAAC,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7F,GAAG,CAAC,KAAK,CAAC,6BAA6B,KAAK,SAAS;gBACnD,CAAC,CAAC,EAAE,6BAA6B,EAAE,KAAK,CAAC,6BAA6B,EAAE;gBACxE,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3E,GAAG,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxE,GAAG,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxE,GAAG,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,SAAyB,EAAE;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5B,MAAM,KAAK,GAA4B,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,gBAAgB;YAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACjF,IAAI,MAAM,CAAC,MAAM;YAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACnD,IAAI,MAAM,CAAC,UAAU;YAAE,KAAK,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC;QAC/D,IAAI,MAAM,CAAC,QAAQ;YAAE,KAAK,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QACzD,IAAI,MAAM,CAAC,6BAA6B,EAAE,CAAC;YACzC,KAAK,CAAC,+BAA+B,CAAC,GAAG,MAAM,CAAC,6BAA6B,CAAC;QAChF,CAAC;QACD,OAAO,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE;YACnC,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;YAC5B,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;SACvD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,eAAe,CAAC,KAIrB;QACC,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAChD,iEAAiE;QACjE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAC1B,aAAa,EACb,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EACpF,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAChC,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The caches that keep a per-process layer in front of Redis, by the namespace
3
+ * key the operator-facing "clear cache" surface uses.
4
+ *
5
+ * Six of the eight clearable namespaces are Redis-only, so SCAN+DEL over the
6
+ * key space is a complete clear for them. Two are not: `settings` and
7
+ * `sales_channels` each hold a per-process LRU, and dropping only the Redis
8
+ * keys leaves every warm process serving the value it had already resolved —
9
+ * which the next read then re-pins into Redis. The operator gets a green
10
+ * confirmation and an unchanged system.
11
+ *
12
+ * The clear therefore has to reach the object that owns both layers, and this
13
+ * is how it finds it. A registry rather than an injected dependency because
14
+ * the two caches live in the kernel while the clear surface is a route of the
15
+ * `settings` module: a module may not reach into another module for an
16
+ * instance, and threading two handles through every composition root to reach
17
+ * one maintenance button is a lot of wiring for a rare action.
18
+ *
19
+ * Nothing here is required: a process that registered no layer — the
20
+ * `cache:clear` CLI, a unit test — clears the Redis keys and is correct,
21
+ * because it has no in-memory layer to be stale.
22
+ *
23
+ * **The second reader is the platform's own module-state notification**
24
+ * (D-174). A per-process cache derived from what an install rewrites —
25
+ * `module_actions` rows, another module's translation bundles — cannot see
26
+ * those inputs move: `registryCache.presenceVersion()` is a content hash of the
27
+ * two presence axes and of nothing else, so a consumer polling it is
28
+ * structurally blind to them. What does announce them is
29
+ * `b2b:module:state-changed`, and a module may not name that channel — it is a
30
+ * transport detail of `kernel/lifecycle/registry-cache.ts`, carrying a payload
31
+ * the consumer does not even read. So the kernel's own subscriber calls
32
+ * {@link InProcessCacheRegistry.invalidateForModuleStateChange} and a module
33
+ * registers a layer that opts in. Same argument as the paragraph above, one
34
+ * seam further: a module may not reach into the platform for an instance, and
35
+ * the registry is where it says what it owns instead.
36
+ *
37
+ * The opt-in is deliberate and is not a convenience. `settings` and
38
+ * `sales_channels` clear a **Redis** key space with SCAN+DEL, and running that
39
+ * in every API and worker process on every operator flip is a storm nobody
40
+ * asked for — and a cold settings cache platform-wide, for a write those caches
41
+ * already invalidate at their own seam.
42
+ */
43
+ export interface InProcessCacheLayer {
44
+ /**
45
+ * Drop every entry in this namespace across **both** layers, shared layer
46
+ * first and with the key prefix marked for the whole operation. Returns the
47
+ * number of shared keys deleted, which is what the operator is shown.
48
+ */
49
+ invalidateAll(): Promise<number>;
50
+ }
51
+ export declare class InProcessCacheRegistry {
52
+ private readonly layers;
53
+ /**
54
+ * Register this process's layer for `namespace`. Returns the unregister
55
+ * function; a second composition root in the same process (the test harness
56
+ * builds one per file) replaces the entry, so the registry always names the
57
+ * live cache rather than a discarded one.
58
+ *
59
+ * `invalidateOnModuleStateChange` declares that this layer's content is
60
+ * derived from what an install, an uninstall or an operator's activation flip
61
+ * rewrites, so the platform's module-state notification must drop it in every
62
+ * process. Default `false`: see the header for why a blanket drop would be
63
+ * wrong for a layer that owns Redis keys.
64
+ */
65
+ register(namespace: string, layer: InProcessCacheLayer, opts?: {
66
+ readonly invalidateOnModuleStateChange?: boolean;
67
+ }): () => void;
68
+ has(namespace: string): boolean;
69
+ /**
70
+ * Clear the namespace through its owning cache, or `undefined` when nothing
71
+ * registered one — the caller then falls back to clearing the shared layer
72
+ * by key pattern.
73
+ */
74
+ clear(namespace: string): Promise<number | undefined>;
75
+ /**
76
+ * Drop every layer that declared itself derived from module state. Called by
77
+ * the kernel's `b2b:module:state-changed` subscriber, in every process that
78
+ * armed it.
79
+ *
80
+ * Every layer is **started synchronously**, before the first `await`: the
81
+ * notification's whole value over the presence-version pull is that the drop
82
+ * lands on receipt rather than a PostgreSQL round-trip later, and awaiting
83
+ * layer by layer would give that away for the second one onwards.
84
+ *
85
+ * A layer that throws is reported and skipped rather than propagated. The
86
+ * caller is a pub/sub handler with nowhere to throw to, and one bad consumer
87
+ * must not stop the refresh every gating seam depends on.
88
+ */
89
+ invalidateForModuleStateChange(): Promise<void>;
90
+ }
91
+ /** Process singleton, read by the settings module's cache-maintenance service. */
92
+ export declare const inProcessCaches: InProcessCacheRegistry;
93
+ //# sourceMappingURL=in-process-cache-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-process-cache-registry.d.ts","sourceRoot":"","sources":["../../../src/kernel/cache/in-process-cache-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAClC;AAOD,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAE7D;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,mBAAmB,EAC1B,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,6BAA6B,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1D,MAAM,IAAI;IAWb,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI/B;;;;OAIG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAM3D;;;;;;;;;;;;;OAaG;IACG,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBtD;AAUD,kFAAkF;AAClF,eAAO,MAAM,eAAe,wBAA+B,CAAC"}
@@ -0,0 +1,78 @@
1
+ export class InProcessCacheRegistry {
2
+ layers = new Map();
3
+ /**
4
+ * Register this process's layer for `namespace`. Returns the unregister
5
+ * function; a second composition root in the same process (the test harness
6
+ * builds one per file) replaces the entry, so the registry always names the
7
+ * live cache rather than a discarded one.
8
+ *
9
+ * `invalidateOnModuleStateChange` declares that this layer's content is
10
+ * derived from what an install, an uninstall or an operator's activation flip
11
+ * rewrites, so the platform's module-state notification must drop it in every
12
+ * process. Default `false`: see the header for why a blanket drop would be
13
+ * wrong for a layer that owns Redis keys.
14
+ */
15
+ register(namespace, layer, opts) {
16
+ const entry = {
17
+ layer,
18
+ invalidateOnModuleStateChange: opts?.invalidateOnModuleStateChange === true,
19
+ };
20
+ this.layers.set(namespace, entry);
21
+ return () => {
22
+ if (this.layers.get(namespace) === entry)
23
+ this.layers.delete(namespace);
24
+ };
25
+ }
26
+ has(namespace) {
27
+ return this.layers.has(namespace);
28
+ }
29
+ /**
30
+ * Clear the namespace through its owning cache, or `undefined` when nothing
31
+ * registered one — the caller then falls back to clearing the shared layer
32
+ * by key pattern.
33
+ */
34
+ async clear(namespace) {
35
+ const entry = this.layers.get(namespace);
36
+ if (!entry)
37
+ return undefined;
38
+ return entry.layer.invalidateAll();
39
+ }
40
+ /**
41
+ * Drop every layer that declared itself derived from module state. Called by
42
+ * the kernel's `b2b:module:state-changed` subscriber, in every process that
43
+ * armed it.
44
+ *
45
+ * Every layer is **started synchronously**, before the first `await`: the
46
+ * notification's whole value over the presence-version pull is that the drop
47
+ * lands on receipt rather than a PostgreSQL round-trip later, and awaiting
48
+ * layer by layer would give that away for the second one onwards.
49
+ *
50
+ * A layer that throws is reported and skipped rather than propagated. The
51
+ * caller is a pub/sub handler with nowhere to throw to, and one bad consumer
52
+ * must not stop the refresh every gating seam depends on.
53
+ */
54
+ async invalidateForModuleStateChange() {
55
+ const pending = [];
56
+ for (const [namespace, entry] of this.layers) {
57
+ if (!entry.invalidateOnModuleStateChange)
58
+ continue;
59
+ try {
60
+ pending.push(Promise.resolve(entry.layer.invalidateAll()).catch((err) => {
61
+ warnLayerFailed(namespace, err);
62
+ }));
63
+ }
64
+ catch (err) {
65
+ // A layer whose `invalidateAll` threw synchronously never produced a
66
+ // promise to attach the handler above to.
67
+ warnLayerFailed(namespace, err);
68
+ }
69
+ }
70
+ await Promise.all(pending);
71
+ }
72
+ }
73
+ function warnLayerFailed(namespace, err) {
74
+ console.warn(`[in-process-cache] "${namespace}" failed to invalidate on a module-state change: ${err instanceof Error ? err.message : String(err)}`);
75
+ }
76
+ /** Process singleton, read by the settings module's cache-maintenance service. */
77
+ export const inProcessCaches = new InProcessCacheRegistry();
78
+ //# sourceMappingURL=in-process-cache-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-process-cache-registry.js","sourceRoot":"","sources":["../../../src/kernel/cache/in-process-cache-registry.ts"],"names":[],"mappings":"AAwDA,MAAM,OAAO,sBAAsB;IAChB,MAAM,GAAG,IAAI,GAAG,EAA2B,CAAC;IAE7D;;;;;;;;;;;OAWG;IACH,QAAQ,CACN,SAAiB,EACjB,KAA0B,EAC1B,IAA2D;QAE3D,MAAM,KAAK,GAAoB;YAC7B,KAAK;YACL,6BAA6B,EAAE,IAAI,EAAE,6BAA6B,KAAK,IAAI;SAC5E,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAClC,OAAO,GAAG,EAAE;YACV,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,KAAK;gBAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC1E,CAAC,CAAC;IACJ,CAAC;IAED,GAAG,CAAC,SAAiB;QACnB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,SAAiB;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,CAAC,KAAK;YAAE,OAAO,SAAS,CAAC;QAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,8BAA8B;QAClC,MAAM,OAAO,GAAuB,EAAE,CAAC;QACvC,KAAK,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC7C,IAAI,CAAC,KAAK,CAAC,6BAA6B;gBAAE,SAAS;YACnD,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CACV,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;oBAClE,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;gBAClC,CAAC,CAAC,CACH,CAAC;YACJ,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,qEAAqE;gBACrE,0CAA0C;gBAC1C,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,SAAS,eAAe,CAAC,SAAiB,EAAE,GAAY;IACtD,OAAO,CAAC,IAAI,CACV,uBAAuB,SAAS,oDAC9B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE,CACH,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Bookkeeping for the invalidation window of a two-layer cache (Redis + a
3
+ * per-process LRU), shared by `SettingsCache` and `SalesChannelsCache`.
4
+ *
5
+ * Both caches invalidate the same way, for the reasons MR !449 established:
6
+ * drop the **shared** layer first, because it is the layer that outlives this
7
+ * process and would otherwise be re-pulled into every other process's LRU, and
8
+ * because it is the step that can fail. A half-done invalidation must degrade
9
+ * to "slower but correct", never to "fast and wrong", which needs two marks:
10
+ *
11
+ * - `draining` — a drop for this prefix is on the wire. Reads bypass both
12
+ * layers and writes do not repopulate them, because the notification that
13
+ * triggered the drop is dispatched fire-and-forget and a read routinely
14
+ * lands mid-invalidation.
15
+ * - `failed` — the shared drop threw, so Redis may still hold the
16
+ * pre-invalidation value. The prefix stays marked until a later drop
17
+ * succeeds; reads keep bypassing the cache (and keep retrying the drop)
18
+ * rather than being served a value the invalidation was supposed to remove.
19
+ *
20
+ * It is deliberately just the bookkeeping: the caller owns the drop, so the
21
+ * retry stays where the key layout and the scan count are known.
22
+ */
23
+ export declare class SharedDropMarks {
24
+ /** Key prefixes whose shared drop is on the wire right now, by depth. */
25
+ private readonly draining;
26
+ /** Key prefixes whose shared drop threw; the shared layer may be stale. */
27
+ private readonly failed;
28
+ /** True when neither mark is set — the hot path's early exit. */
29
+ get isClean(): boolean;
30
+ begin(prefix: string): void;
31
+ finish(prefix: string): void;
32
+ markFailed(prefix: string): void;
33
+ /** A successful drop also retires any narrower outstanding failure. */
34
+ retireFailedUnder(prefix: string): void;
35
+ isDraining(key: string): boolean;
36
+ /** The outstanding failed prefix covering `key`, so the caller can retry it. */
37
+ failedPrefixFor(key: string): string | undefined;
38
+ }
39
+ //# sourceMappingURL=shared-drop-marks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-drop-marks.d.ts","sourceRoot":"","sources":["../../../src/kernel/cache/shared-drop-marks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,eAAe;IAC1B,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAE5C,iEAAiE;IACjE,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI3B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM5B,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIhC,uEAAuE;IACvE,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMvC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAOhC,gFAAgF;IAChF,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAMjD"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Bookkeeping for the invalidation window of a two-layer cache (Redis + a
3
+ * per-process LRU), shared by `SettingsCache` and `SalesChannelsCache`.
4
+ *
5
+ * Both caches invalidate the same way, for the reasons MR !449 established:
6
+ * drop the **shared** layer first, because it is the layer that outlives this
7
+ * process and would otherwise be re-pulled into every other process's LRU, and
8
+ * because it is the step that can fail. A half-done invalidation must degrade
9
+ * to "slower but correct", never to "fast and wrong", which needs two marks:
10
+ *
11
+ * - `draining` — a drop for this prefix is on the wire. Reads bypass both
12
+ * layers and writes do not repopulate them, because the notification that
13
+ * triggered the drop is dispatched fire-and-forget and a read routinely
14
+ * lands mid-invalidation.
15
+ * - `failed` — the shared drop threw, so Redis may still hold the
16
+ * pre-invalidation value. The prefix stays marked until a later drop
17
+ * succeeds; reads keep bypassing the cache (and keep retrying the drop)
18
+ * rather than being served a value the invalidation was supposed to remove.
19
+ *
20
+ * It is deliberately just the bookkeeping: the caller owns the drop, so the
21
+ * retry stays where the key layout and the scan count are known.
22
+ */
23
+ export class SharedDropMarks {
24
+ /** Key prefixes whose shared drop is on the wire right now, by depth. */
25
+ draining = new Map();
26
+ /** Key prefixes whose shared drop threw; the shared layer may be stale. */
27
+ failed = new Set();
28
+ /** True when neither mark is set — the hot path's early exit. */
29
+ get isClean() {
30
+ return this.draining.size === 0 && this.failed.size === 0;
31
+ }
32
+ begin(prefix) {
33
+ this.draining.set(prefix, (this.draining.get(prefix) ?? 0) + 1);
34
+ }
35
+ finish(prefix) {
36
+ const depth = (this.draining.get(prefix) ?? 1) - 1;
37
+ if (depth <= 0)
38
+ this.draining.delete(prefix);
39
+ else
40
+ this.draining.set(prefix, depth);
41
+ }
42
+ markFailed(prefix) {
43
+ this.failed.add(prefix);
44
+ }
45
+ /** A successful drop also retires any narrower outstanding failure. */
46
+ retireFailedUnder(prefix) {
47
+ for (const p of this.failed) {
48
+ if (p.startsWith(prefix))
49
+ this.failed.delete(p);
50
+ }
51
+ }
52
+ isDraining(key) {
53
+ for (const prefix of this.draining.keys()) {
54
+ if (key.startsWith(prefix))
55
+ return true;
56
+ }
57
+ return false;
58
+ }
59
+ /** The outstanding failed prefix covering `key`, so the caller can retry it. */
60
+ failedPrefixFor(key) {
61
+ for (const prefix of this.failed) {
62
+ if (key.startsWith(prefix))
63
+ return prefix;
64
+ }
65
+ return undefined;
66
+ }
67
+ }
68
+ //# sourceMappingURL=shared-drop-marks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-drop-marks.js","sourceRoot":"","sources":["../../../src/kernel/cache/shared-drop-marks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,eAAe;IAC1B,yEAAyE;IACxD,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtD,2EAA2E;IAC1D,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IAE5C,iEAAiE;IACjE,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,MAAc;QAClB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,KAAK,IAAI,CAAC;YAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;;YACxC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,UAAU,CAAC,MAAc;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,uEAAuE;IACvE,iBAAiB,CAAC,MAAc;QAC9B,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;gBAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,UAAU,CAAC,GAAW;QACpB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;YAC1C,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;gBAAE,OAAO,IAAI,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gFAAgF;IAChF,eAAe,CAAC,GAAW;QACzB,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC;gBAAE,OAAO,MAAM,CAAC;QAC5C,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}