@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Endora sp. z o.o. and the Endora Commerce contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # `@endora-commerce/platform` — the host package
2
+
3
+ The surface an installed extension package compiles against. Five enumerated `exports`
4
+ subpaths, one per platform directory that has published API; no root export and no wildcard
5
+ (D-160.7). The design, the classification behind it and every rejected alternative are in
6
+ `specs/080-f4-real-scope/contracts/host-package.md`; this file records only what is peculiar
7
+ to the package directory itself.
8
+
9
+ ## It has no `src/`, and that is the answer to the placement question
10
+
11
+ The contract's §2.1 points every subpath at `./dist/<dir>/index.js` and its §8 step 5 says
12
+ `rootDir`. Read together those two sentences imply the package's own `src/` holds `kernel/`,
13
+ `http/`, `tenancy/`, `commands/` and `events/` — which would mean **relocating five
14
+ directories out of `backend/src`**: 82 files, plus every relative specifier aimed at them from
15
+ the 1400-plus module files, plus both composition roots and the whole test tree. §9 records
16
+ that `tsc -p` over a host package with `rootDir` set was never run, so this was the part the
17
+ contract had not tested.
18
+
19
+ It is not required. `tsconfig.build.json` sets `rootDir` to `../../backend/src` and includes
20
+ exactly the five published directories. `tsc` emits paths relative to `rootDir`, so the layout
21
+ under `dist` is `kernel/`, `http/`, `tenancy/`, `commands/`, `events/` — byte-for-byte the
22
+ layout §2.1's `exports` map names, with the sources left where 1400 files already point at
23
+ them.
24
+
25
+ Two measurements make that safe rather than lucky:
26
+
27
+ - **The five directories are closed under relative imports.** 82 files, and **zero**
28
+ specifiers escaping the set — nothing reaches `db/`, `overlay/`, `packages/`, `modules/` or
29
+ `apps/`. So the `include` list is the whole compilation and no `db/index.js` (§1.4f: 219
30
+ module-owned entity references) can be dragged in behind it.
31
+ - **`backend`'s own build is untouched.** `backend` type-checks with `--noEmit` and executes
32
+ through `tsx`/`vitest`; it does not compile these files to `dist`. Nothing about this
33
+ package changes what `backend` reads or emits, and the emitted output lands only under
34
+ `packages/platform/dist`, which is git-ignored.
35
+
36
+ The relocation stays available and stays cheap in the direction that matters: moving the
37
+ sources here later changes `rootDir` and `include` and nothing else, because the `exports`
38
+ map already names the emitted layout rather than the source layout.
39
+
40
+ ## Two tsconfigs, for the reason the other packages have two
41
+
42
+ `tsconfig.json` type-checks with `tsconfig.base.json`'s `paths` active — `@endora-commerce/*`
43
+ resolves at a sibling's source, which is what keeps a worktree honest (issue #255) — and
44
+ carries `noEmit`. `tsconfig.build.json` clears `paths`, sets `rootDir`, and emits with
45
+ `noEmitOnError`. Do not merge them: `rootDir` with an active `paths` block is TS6059, which
46
+ exits 2 **and** writes the sibling's output beside the sibling's source.
47
+
48
+ `rootDir` is deliberately absent from the type-check half. Here it would be a guaranteed
49
+ TS6059 — with `paths` active, `@endora-commerce/contracts` resolves into
50
+ `packages/contracts/src`, which no `rootDir` this package could name contains.
51
+
52
+ ## No `lint` and no `test` script
53
+
54
+ The sources belong to the `backend` workspace, which lints them (`eslint src`) and tests them
55
+ (`backend/test`). A second `eslint` pass over the same files from here would be a second
56
+ author of the same verdict, and the package's own probes — the type probe, the runtime probe
57
+ and the distribution-shape assertions — live in `backend/test/unit/packages/`, where the rest
58
+ of the packaging evidence already is.
@@ -0,0 +1,146 @@
1
+ /**
2
+ * The operator CLI, whole: argv in, an exit code out
3
+ * (`specs/123-oss-install-experience/` G2, T2-B).
4
+ *
5
+ * ## Why the process moved here, when `./cli`'s own header said it would not
6
+ *
7
+ * That header — and `HOST_INTERNAL_SUBPATHS`' entry beside it — said *"the
8
+ * process around it — argv, the composition, the system scope and the exit code
9
+ * — stays in the application at `backend/src/cli.ts`"*. It was written when this
10
+ * repository was the only application there was, and it was measured wrong the
11
+ * moment a second one existed: `endora new instance` reported
12
+ * `backend/src/cli.ts` as an **omission**, so a scaffolded instance could run no
13
+ * command its modules declared — no `admin_users create`, and therefore nobody
14
+ * to log in to the admin bundle A5 and A13 prove is built and styled.
15
+ *
16
+ * The alternative was rendering ~170 lines of dispatch into a client's tree,
17
+ * which is the copy `contracts/operator-half.md` R7.1 refuses in as many words:
18
+ * *"a client's copy of it is a copy that diverges the first time we correct
19
+ * ours"*. D-207 is the same rule from the other side — an instance takes the
20
+ * platform as a dependency and receives none of the host's sources.
21
+ *
22
+ * **What is left in an application is genuinely the application's**, and it is
23
+ * the four suppliers below rather than nothing: which manifests this build ships
24
+ * as core, which composition it composes, where its own demo composition lives,
25
+ * and the one directory holding `apps/`. This repository supplies all four; a
26
+ * scaffolded instance supplies the last one and takes the defaults, which is why
27
+ * its entry point is five lines.
28
+ *
29
+ * ## `./cli` is still host-internal, and this changes nothing about that
30
+ *
31
+ * D-160.14's third state is unmoved: `./cli` is declared by the `exports` map,
32
+ * carried by no published barrel, and a **module** naming it is
33
+ * `host-internal-subpath` — refused. The consumer here is an application's entry
34
+ * point, which is not a module, and which already names `./composition`,
35
+ * `./db`, `./lifecycle`, `./overlay`, `./packages` and `./kernel` in the six
36
+ * wiring files `endora new instance` renders. No subpath is added and
37
+ * `PUBLISHED_SUBPATHS` stays at five.
38
+ */
39
+ import type { EntityManager } from '@mikro-orm/postgresql';
40
+ import type { KernelContainer } from '../kernel/container.js';
41
+ import type { RegisteredManifestEntry } from '../lifecycle/index.js';
42
+ import { type DemoCompositionLoader } from '../demo/host-command.js';
43
+ import { type RunModuleCommandOptions } from './module-commands.js';
44
+ /**
45
+ * How an operator reached this dispatcher, as their own shell writes it.
46
+ *
47
+ * **Defect F-1** (`specs/125-first-mile-install/spec.md` §2.5, T1-F). This text
48
+ * was a constant opening `usage: endora <module id> <command>`, and in a
49
+ * scaffolded instance `endora` on the path is a **different program**: the
50
+ * scaffolder, `@endora-commerce/cli`, whose `bin` is `endora` and which has no
51
+ * `demo` verb and no `<module id>` positional. So the tool's own help
52
+ * contradicted the tool's own next step — `endora new instance` correctly
53
+ * prints `pnpm run cli …` — and a stranger following the help got an
54
+ * unknown-command refusal from a program they did not think they were running.
55
+ *
56
+ * The dispatcher cannot see how it was invoked, and `process.argv[1]` is no
57
+ * answer: it is a path to a compiled entry point (`…/backend/dist/cli.js`),
58
+ * which is a worse sentence than either name. So it is **told**, and the
59
+ * default below is a scaffolded instance's own line, because a scaffolded
60
+ * instance is the audience the defect was measured on. This repository's entry
61
+ * point passes its own.
62
+ */
63
+ export declare const DEFAULT_CLI_PROGRAM = "pnpm run cli";
64
+ /** The usage text, addressed to whoever is actually running it. */
65
+ export declare function cliUsage(program?: string): string;
66
+ /**
67
+ * The composed platform, as this file reads it.
68
+ *
69
+ * Structurally a `ComposeAppHandle` and deliberately *not* that type by name:
70
+ * naming it would put a runtime edge from `./cli` to `./composition`, and the
71
+ * whole of the composition graph would load for a `--list` that composes
72
+ * nothing. The default supplier imports it dynamically, one function down.
73
+ */
74
+ export interface CliComposition {
75
+ readonly container: KernelContainer;
76
+ readonly contextFor: RunModuleCommandOptions['contextFor'];
77
+ readonly resolvedModules: readonly RegisteredManifestEntry[];
78
+ readonly orm: {
79
+ readonly em: {
80
+ fork(): EntityManager;
81
+ };
82
+ };
83
+ dispose(): Promise<void>;
84
+ }
85
+ export interface RunCliOptions {
86
+ /**
87
+ * The absolute path of the directory that holds `apps/` — the one thing no
88
+ * package can derive for itself, for `composeApp`'s own reason.
89
+ */
90
+ readonly deploymentRoot: string;
91
+ /** Defaults to `process.argv.slice(2)`. */
92
+ readonly argv?: readonly string[];
93
+ /**
94
+ * How this tree's operator reaches this dispatcher, for the usage text and
95
+ * every help sentence under it. Defaults to {@link DEFAULT_CLI_PROGRAM},
96
+ * which is a scaffolded instance's own line — see that constant for the
97
+ * defect this parameter exists for.
98
+ */
99
+ readonly program?: string;
100
+ /**
101
+ * The manifest set, answered **before** anything is opened.
102
+ *
103
+ * `resolvedManifestEntries()` in this repository, because its core half is a
104
+ * generated index this build ships. An instance ships none, so the default
105
+ * below is the instance's answer: its overlay modules and every installed
106
+ * package.
107
+ */
108
+ readonly resolveEntries?: () => Promise<readonly RegisteredManifestEntry[]>;
109
+ /**
110
+ * The composition. This repository's own `composeApp`, which carries its
111
+ * generated composition; an instance takes `@endora-commerce/platform`'s.
112
+ */
113
+ readonly compose?: () => Promise<CliComposition>;
114
+ /** Where this tree keeps its demo composition, if it has one (§5.6). */
115
+ readonly demoComposition?: DemoCompositionLoader;
116
+ readonly out?: (chunk: string) => void;
117
+ readonly err?: (chunk: string) => void;
118
+ readonly env?: NodeJS.ProcessEnv;
119
+ }
120
+ /**
121
+ * Decide and run, and return the exit code. It opens no process concern of its
122
+ * own, which is what lets a test drive it.
123
+ */
124
+ export declare function dispatchCli(options: RunCliOptions): Promise<number>;
125
+ /**
126
+ * The exit code a thrown failure earns, with the sentence an operator reads.
127
+ *
128
+ * The one discrimination here is not a conditional re-throw: both branches exit
129
+ * non-zero and neither lets the command's work proceed. It exists because a
130
+ * stack trace is the wrong answer to "this module is switched off" — the
131
+ * operator needs the sentence and the module id, which the error already
132
+ * carries.
133
+ */
134
+ export declare function cliFailureExitCode(thrown: unknown, err: (chunk: string) => void): number;
135
+ /**
136
+ * The whole of an operator CLI entry point: dispatch, then exit.
137
+ *
138
+ * No `try`/`catch` anywhere above a command's body, and this is why: a `catch`
139
+ * around a port call swallows `ModuleDisabledError` and turns fail-closed into
140
+ * fail-open, which is what `check:port-catches` refuses. A `.catch()` **method**
141
+ * on the entry promise is outside that check's population by construction
142
+ * (D-157.3), and it is the right place for a CLI to turn a throw into an exit
143
+ * code.
144
+ */
145
+ export declare function runCli(options: RunCliOptions): Promise<never>;
146
+ //# sourceMappingURL=dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/cli/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAQL,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EAML,KAAK,uBAAuB,EAC7B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD,mEAAmE;AACnE,wBAAgB,QAAQ,CAAC,OAAO,GAAE,MAA4B,GAAG,MAAM,CAmBtE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC,YAAY,CAAC,CAAC;IAC3D,QAAQ,CAAC,eAAe,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC7D,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE;YAAE,IAAI,IAAI,aAAa,CAAA;SAAE,C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 import { enterSystemScope } from '../kernel/scope.js';
4
+ import { instanceManifestEntries } from '../lifecycle/commands/operator-entry.js';
5
+ import { DEMO_HOST_COMMANDS, NO_DEMO_COMPOSITION_NOTICE, demoEntriesFrom, demoHelpFor, formatHostCommandList, isDemoInvocation, parseDemoVerb, } from '../demo/host-command.js';
6
+ import { formatDemoReport } from '../demo/report.js';
7
+ import { mustBeNonProduction } from '../demo/guard.js';
8
+ import { runDemo, unwrapDemoFailure } from '../demo/runner.js';
9
+ import { DEMO_RESET_SCOPE_REASON, DEMO_SEED_SCOPE_REASON } from '../demo/scope.js';
10
+ import { collectModuleCommands, findModuleCommand, formatCommandList, helpFor, runModuleCommand, } from './module-commands.js';
11
+ /**
12
+ * How an operator reached this dispatcher, as their own shell writes it.
13
+ *
14
+ * **Defect F-1** (`specs/125-first-mile-install/spec.md` §2.5, T1-F). This text
15
+ * was a constant opening `usage: endora <module id> <command>`, and in a
16
+ * scaffolded instance `endora` on the path is a **different program**: the
17
+ * scaffolder, `@endora-commerce/cli`, whose `bin` is `endora` and which has no
18
+ * `demo` verb and no `<module id>` positional. So the tool's own help
19
+ * contradicted the tool's own next step — `endora new instance` correctly
20
+ * prints `pnpm run cli …` — and a stranger following the help got an
21
+ * unknown-command refusal from a program they did not think they were running.
22
+ *
23
+ * The dispatcher cannot see how it was invoked, and `process.argv[1]` is no
24
+ * answer: it is a path to a compiled entry point (`…/backend/dist/cli.js`),
25
+ * which is a worse sentence than either name. So it is **told**, and the
26
+ * default below is a scaffolded instance's own line, because a scaffolded
27
+ * instance is the audience the defect was measured on. This repository's entry
28
+ * point passes its own.
29
+ */
30
+ export const DEFAULT_CLI_PROGRAM = 'pnpm run cli';
31
+ /** The usage text, addressed to whoever is actually running it. */
32
+ export function cliUsage(program = DEFAULT_CLI_PROGRAM) {
33
+ const pad = ' '.repeat('usage: '.length);
34
+ return `usage: ${program} <module id> <command> [args…]
35
+ ${pad}${program} <module id> <command> --help
36
+ ${pad}${program} demo seed | ${program} demo reset
37
+ ${pad}${program} --list
38
+
39
+ Runs an operator command a module declares in its \`manifest.ts\`. The host
40
+ composes the platform once and hands the command its module's own context, so
41
+ it resolves the same services — and the same deployment decorations — the
42
+ running server does.
43
+
44
+ \`demo\` is the host's own command rather than any module's: it fans out over
45
+ every module that declares demo data in its manifest, in the order the
46
+ dependency graph gives, and then applies this instance's composition.
47
+
48
+ --list every command this instance offers, including an overlay
49
+ module's and an installed package's
50
+ `;
51
+ }
52
+ /**
53
+ * `endora demo seed` / `endora demo reset` (feature 113 Phase 0, §3.3–§3.4).
54
+ *
55
+ * The order of the first three statements **is** the contract, and nothing else
56
+ * in this file has this property:
57
+ *
58
+ * 1. **The guard, first** — before anything is composed, before a scope is
59
+ * opened, and outside every `try` (§3.3). A refusal here writes nothing,
60
+ * which is the whole of FR-012, and it cannot be reached through a `catch`
61
+ * that decided to continue because there is no `catch` above it.
62
+ * 2. **One composition**, exactly as a module-declared command gets, so a demo
63
+ * body resolves the same services — and the same deployment decorations —
64
+ * the running server does.
65
+ * 3. **One system scope for the whole run** (§3.4), so no module's demo body is
66
+ * its own entry point, and no module's body has to remember to open one.
67
+ *
68
+ * Presence is decided inside `runDemo`, from the declaration and before a
69
+ * context is built (§3.5) — the rule `runModuleCommand` already applies one
70
+ * command at a time, applied here once per declaring module.
71
+ *
72
+ * The composition is loaded from the calling tree and handed in (§5.2). A tree
73
+ * that has none is an ordinary tree: every present module still seeds its own
74
+ * rows and the notice below says so once (§5.6).
75
+ */
76
+ async function runDemoCommand(verb, resolved, compose, loadComposition, out) {
77
+ mustBeNonProduction();
78
+ const entries = demoEntriesFrom(resolved);
79
+ const composition = await compose();
80
+ try {
81
+ return await enterSystemScope(verb === 'seed' ? DEMO_SEED_SCOPE_REASON : DEMO_RESET_SCOPE_REASON, async () => {
82
+ // Feature 113 T212 — the EntityManager is forked **inside** the scope,
83
+ // so the composition's reads carry the same system scope every module's
84
+ // body does, and the presence oracle handed to it is the composed
85
+ // platform's own: a composition step over a switched-off module is a
86
+ // reported skip (§5.4), decided from the conjunction of both axes and
87
+ // never re-derived.
88
+ const em = composition.orm.em.fork();
89
+ const found = loadComposition === undefined
90
+ ? { found: false, notice: NO_DEMO_COMPOSITION_NOTICE }
91
+ : await loadComposition({
92
+ em,
93
+ isPresent: (id) => effectiveState.isPresent(id),
94
+ });
95
+ // Feature 113 T226 — there is no host residue left to run. Every demo
96
+ // row this repository seeds is now either a module's own (its
97
+ // `manifest.ts` declares it) or the composition's.
98
+ const result = await runDemo({
99
+ mode: verb,
100
+ entries,
101
+ isPresent: (id) => effectiveState.isPresent(id),
102
+ contextFor: composition.contextFor,
103
+ ...(found.found ? { composition: found.composition } : {}),
104
+ });
105
+ out(formatDemoReport(result));
106
+ // §5.6, once and enumerating nothing.
107
+ if (!found.found)
108
+ out(`\n${found.notice}\n`);
109
+ return 0;
110
+ }, { entryPoint: 'cli', container: composition.container });
111
+ }
112
+ finally {
113
+ await composition.dispose();
114
+ }
115
+ }
116
+ /**
117
+ * Composition preconditions become CLI preconditions, deliberately (D-157.3d):
118
+ * `assertPublicApiBaseUrlConfigured()` and a reachable PostgreSQL are now
119
+ * required for every command that composes. That is the property being bought —
120
+ * a command that runs on the deployment's own graph needs the deployment's
121
+ * environment — rather than a cost to be worked around.
122
+ *
123
+ * One line suppresses the single Redis write a composition performs:
124
+ * `product_feeds`' boot hook re-asserts its BullMQ Job Schedulers when
125
+ * `runWorkers` is true, and `runWorkers` is `BACKEND_ROLE !== 'api'`. Nothing
126
+ * else in a composition issues a Redis command, and `registryCache.watch()` is
127
+ * not reached, so this keeps Redis off a one-shot command's critical path.
128
+ *
129
+ * What composing does **not** do, contrary to a belief three shard comments
130
+ * recorded: it starts no BullMQ worker and arms no timer (D-157.2, measured
131
+ * three ways).
132
+ */
133
+ async function defaultCompose(deploymentRoot) {
134
+ process.env['BACKEND_ROLE'] = 'api';
135
+ const { composeApp } = await import('../composition/compose-app.js');
136
+ return (await composeApp({ deploymentRoot }));
137
+ }
138
+ /**
139
+ * Decide and run, and return the exit code. It opens no process concern of its
140
+ * own, which is what lets a test drive it.
141
+ */
142
+ export async function dispatchCli(options) {
143
+ const argv = options.argv ?? process.argv.slice(2);
144
+ const env = options.env ?? process.env;
145
+ const out = options.out ?? ((chunk) => void process.stdout.write(chunk));
146
+ const err = options.err ?? ((chunk) => void process.stderr.write(chunk));
147
+ const compose = options.compose ?? (() => defaultCompose(options.deploymentRoot));
148
+ const program = options.program ?? DEFAULT_CLI_PROGRAM;
149
+ if (argv.length === 0 || argv[0] === '--help' || argv[0] === '-h') {
150
+ out(cliUsage(program));
151
+ return argv.length === 0 ? 1 : 0;
152
+ }
153
+ // The two **declaration-level** questions, answered before anything is
154
+ // opened. Resolving manifests reads `node_modules` and touches no database,
155
+ // which is the property D-102 attached as a condition to `audit_logs read`:
156
+ // its credential is host access, not a working connection string, so it has to
157
+ // be able to say what it does before it can do it. It is also the property
158
+ // D-157.8 rejected path-convention dispatch for, since nothing can list a
159
+ // convention.
160
+ const resolved = await (options.resolveEntries ??
161
+ (() => instanceManifestEntries(options.deploymentRoot, env)))();
162
+ const declared = collectModuleCommands(resolved);
163
+ if (argv[0] === '--list') {
164
+ out(formatHostCommandList(DEMO_HOST_COMMANDS));
165
+ out(formatCommandList(declared));
166
+ return 0;
167
+ }
168
+ const [moduleId, name, ...rest] = argv;
169
+ if (isDemoInvocation(moduleId)) {
170
+ if (name === undefined || name === '--help' || name === '-h') {
171
+ out(DEMO_HOST_COMMANDS.map((command) => `${command.address} — ${command.summary}`).join('\n'));
172
+ out('\n');
173
+ return name === undefined ? 1 : 0;
174
+ }
175
+ const verb = parseDemoVerb(name);
176
+ if (rest.includes('--help') || rest.includes('-h')) {
177
+ out(demoHelpFor(verb, program));
178
+ return 0;
179
+ }
180
+ return await runDemoCommand(verb, resolved, compose, options.demoComposition, out);
181
+ }
182
+ if (moduleId === undefined || name === undefined) {
183
+ err(`${cliUsage(program)}\nerror: a command is addressed as '<module id> <command>'.\n`);
184
+ return 1;
185
+ }
186
+ if (rest.includes('--help') || rest.includes('-h')) {
187
+ out(`${helpFor(findModuleCommand(declared, moduleId, name))}\n`);
188
+ return 0;
189
+ }
190
+ const composition = await compose();
191
+ try {
192
+ // The scope opens over **this composition's** container. `composeApp`
193
+ // deliberately never calls `setRootContainer`, so a scope with no
194
+ // `container` would branch off a process-wide root with nothing in it and
195
+ // every `ctx.cradle()` read inside a command would fail to resolve
196
+ // (D-157.7).
197
+ return await enterSystemScope(`cli: ${argv.join(' ')}`, async () =>
198
+ // The set the composition was **actually built from**, not the one read
199
+ // above: `contextFor` answers for exactly those ids, so reading the
200
+ // command off the same array is what makes "found a command" and "can
201
+ // build its context" one question rather than two.
202
+ await runModuleCommand({
203
+ entries: composition.resolvedModules,
204
+ moduleId,
205
+ name,
206
+ argv: rest,
207
+ contextFor: composition.contextFor,
208
+ out: (line) => out(`${line}\n`),
209
+ err: (line) => err(`${line}\n`),
210
+ }), { entryPoint: 'cli', container: composition.container });
211
+ }
212
+ finally {
213
+ // Every command shares one disposal, which is the other thing a per-script
214
+ // entry point kept getting wrong: `closeOrm()` in a `finally` around a
215
+ // `return promise` tore the pool down under the query it was still running.
216
+ await composition.dispose();
217
+ }
218
+ }
219
+ /**
220
+ * The exit code a thrown failure earns, with the sentence an operator reads.
221
+ *
222
+ * The one discrimination here is not a conditional re-throw: both branches exit
223
+ * non-zero and neither lets the command's work proceed. It exists because a
224
+ * stack trace is the wrong answer to "this module is switched off" — the
225
+ * operator needs the sentence and the module id, which the error already
226
+ * carries.
227
+ */
228
+ export function cliFailureExitCode(thrown, err) {
229
+ // `unwrapDemoFailure` is not a `catch` and decides nothing: it takes one known
230
+ // wrapper off so the discrimination below sees what it saw before the demo
231
+ // layer existed. `DemoRunFailedError`'s own message — which names the module —
232
+ // is printed by the fallback branch.
233
+ const error = unwrapDemoFailure(thrown);
234
+ if (error instanceof ModuleDisabledError) {
235
+ err(`error: module '${error.moduleId}' is switched off in this instance, so its commands ` +
236
+ `do not run. Switch it on under Platform → Modules, or check that it is installed ` +
237
+ `here (\`module:status\`).\n`);
238
+ return 3;
239
+ }
240
+ err(`${thrown instanceof Error ? (thrown.stack ?? thrown.message) : String(thrown)}\n`);
241
+ return 1;
242
+ }
243
+ /**
244
+ * The whole of an operator CLI entry point: dispatch, then exit.
245
+ *
246
+ * No `try`/`catch` anywhere above a command's body, and this is why: a `catch`
247
+ * around a port call swallows `ModuleDisabledError` and turns fail-closed into
248
+ * fail-open, which is what `check:port-catches` refuses. A `.catch()` **method**
249
+ * on the entry promise is outside that check's population by construction
250
+ * (D-157.3), and it is the right place for a CLI to turn a throw into an exit
251
+ * code.
252
+ */
253
+ export function runCli(options) {
254
+ const err = options.err ?? ((chunk) => void process.stderr.write(chunk));
255
+ return dispatchCli(options)
256
+ .then((code) => process.exit(code))
257
+ .catch((thrown) => process.exit(cliFailureExitCode(thrown, err)));
258
+ }
259
+ //# sourceMappingURL=dispatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/cli/dispatch.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,GAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MA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G;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAe,EAAE,GAA4B;IAC9E,+EAA+E;IAC/E,2EAA2E;IAC3E,+EAA+E;IAC/E,qCAAqC;IACrC,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;QACzC,GAAG,CACD,kBAAkB,KAAK,CAAC,QAAQ,sDAAsD;YACpF,mFAAmF;YACnF,6BAA6B,CAChC,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,GAAG,CAAC,GAAG,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxF,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,MAAM,CAAC,OAAsB;IAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACjF,OAAO,WAAW,CAAC,OAAO,CAAC;SACxB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClC,KAAK,CAAC,CAAC,MAAe,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * `./cli` — the host's side of a module-declared operator command, and the
3
+ * platform's thirteenth subpath (`specs/110-instance-repository/` T117,
4
+ * FR-013).
5
+ *
6
+ * ## What is on it
7
+ *
8
+ * Everything a `pnpm --filter backend run cli` invocation decides **with no
9
+ * process and no database**: the enumeration of every command the resolved
10
+ * manifest set declares, the two refusals a declaration can earn, the
11
+ * `<module id> <command name>` lookup, the `--list` and `--help` renderings,
12
+ * and the find-gate-invoke that ends in the module's own `run`.
13
+ *
14
+ * ## And the process around it, since `specs/123-oss-install-experience/` G2
15
+ *
16
+ * This header used to end *"the process — argv, the composition, the system
17
+ * scope and the exit code — stays in the application at `backend/src/cli.ts`"*,
18
+ * and the partition it cited is the reason it changed. `operator-half.md` §1.1:
19
+ * *"a file belongs to `@endora-commerce/platform` unless it names a path in the
20
+ * tree that installs the platform"*. The dispatch names none — the core
21
+ * manifests, the composition and a tree's own demo composition are all
22
+ * **parameters** — and the sentence was measured wrong the moment a second
23
+ * application existed: `endora new instance` reported `backend/src/cli.ts` as an
24
+ * omission, so a scaffolded instance could run **no** command its modules
25
+ * declared, `admin_users create` included, and nobody could log in to it.
26
+ *
27
+ * What did not move is what genuinely names a path: this repository's generated
28
+ * core index, its own `composeApp`, its `src/seeds/demo-composition.ts` probe,
29
+ * and the one directory holding `apps/`. `backend/src/cli.ts` supplies those
30
+ * four and is otherwise an exit code; a scaffolded instance supplies the last
31
+ * one and is five lines. See `dispatch.ts`' own header.
32
+ *
33
+ * It is also **not** the `module:*` path and must never become one. Those five
34
+ * operate *on* the platform rather than with it, compose nothing (D-157.2/.4)
35
+ * and keep their own ~20-line entry points under `backend/src/lifecycle/` over
36
+ * `@endora-commerce/platform/lifecycle`'s `commands/<verb>.ts` (R2.5).
37
+ * `research.md` §3.1 calls this file *"the host's `module:*` dispatcher"*; it is
38
+ * not, and `backend/src/cli.ts`' own header has said so since feature 080.
39
+ *
40
+ * ## Why no module may name it
41
+ *
42
+ * D-160.14's third state, for `./composition`'s own reason one surface over.
43
+ * This is the code that decides **which** command runs and whether the module
44
+ * that declared it is present at all — so a module that could name it could
45
+ * enumerate its siblings' operator commands, and invoke one. A module declares
46
+ * its commands in its own `manifest.ts` and receives a `ModuleContext`; that is
47
+ * the whole of the surface it is entitled to. Declared by the `exports` map,
48
+ * carried by no published barrel, and answered for a module's reach with
49
+ * `host-internal-subpath`.
50
+ *
51
+ * The barrel names every symbol explicitly rather than re-exporting a
52
+ * directory: `check:platform-surface` exits 2 on an `export *`, because a
53
+ * wildcard makes the published set a property of whatever the files happen to
54
+ * declare rather than of a decision anybody took.
55
+ */
56
+ export { collectModuleCommands, findModuleCommand, formatCommandList, helpFor, InvalidCommandDeclarationError, runModuleCommand, UnknownCommandError, type CommandDeclaringEntry, type DeclaredCommand, type RunModuleCommandOptions, } from './module-commands.js';
57
+ export { cliFailureExitCode, cliUsage, DEFAULT_CLI_PROGRAM, dispatchCli, runCli, type CliComposition, type RunCliOptions, } from './dispatch.js';
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,8BAA8B,EAC9B,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * `./cli` — the host's side of a module-declared operator command, and the
3
+ * platform's thirteenth subpath (`specs/110-instance-repository/` T117,
4
+ * FR-013).
5
+ *
6
+ * ## What is on it
7
+ *
8
+ * Everything a `pnpm --filter backend run cli` invocation decides **with no
9
+ * process and no database**: the enumeration of every command the resolved
10
+ * manifest set declares, the two refusals a declaration can earn, the
11
+ * `<module id> <command name>` lookup, the `--list` and `--help` renderings,
12
+ * and the find-gate-invoke that ends in the module's own `run`.
13
+ *
14
+ * ## And the process around it, since `specs/123-oss-install-experience/` G2
15
+ *
16
+ * This header used to end *"the process — argv, the composition, the system
17
+ * scope and the exit code — stays in the application at `backend/src/cli.ts`"*,
18
+ * and the partition it cited is the reason it changed. `operator-half.md` §1.1:
19
+ * *"a file belongs to `@endora-commerce/platform` unless it names a path in the
20
+ * tree that installs the platform"*. The dispatch names none — the core
21
+ * manifests, the composition and a tree's own demo composition are all
22
+ * **parameters** — and the sentence was measured wrong the moment a second
23
+ * application existed: `endora new instance` reported `backend/src/cli.ts` as an
24
+ * omission, so a scaffolded instance could run **no** command its modules
25
+ * declared, `admin_users create` included, and nobody could log in to it.
26
+ *
27
+ * What did not move is what genuinely names a path: this repository's generated
28
+ * core index, its own `composeApp`, its `src/seeds/demo-composition.ts` probe,
29
+ * and the one directory holding `apps/`. `backend/src/cli.ts` supplies those
30
+ * four and is otherwise an exit code; a scaffolded instance supplies the last
31
+ * one and is five lines. See `dispatch.ts`' own header.
32
+ *
33
+ * It is also **not** the `module:*` path and must never become one. Those five
34
+ * operate *on* the platform rather than with it, compose nothing (D-157.2/.4)
35
+ * and keep their own ~20-line entry points under `backend/src/lifecycle/` over
36
+ * `@endora-commerce/platform/lifecycle`'s `commands/<verb>.ts` (R2.5).
37
+ * `research.md` §3.1 calls this file *"the host's `module:*` dispatcher"*; it is
38
+ * not, and `backend/src/cli.ts`' own header has said so since feature 080.
39
+ *
40
+ * ## Why no module may name it
41
+ *
42
+ * D-160.14's third state, for `./composition`'s own reason one surface over.
43
+ * This is the code that decides **which** command runs and whether the module
44
+ * that declared it is present at all — so a module that could name it could
45
+ * enumerate its siblings' operator commands, and invoke one. A module declares
46
+ * its commands in its own `manifest.ts` and receives a `ModuleContext`; that is
47
+ * the whole of the surface it is entitled to. Declared by the `exports` map,
48
+ * carried by no published barrel, and answered for a module's reach with
49
+ * `host-internal-subpath`.
50
+ *
51
+ * The barrel names every symbol explicitly rather than re-exporting a
52
+ * directory: `check:platform-surface` exits 2 on an `export *`, because a
53
+ * wildcard makes the published set a property of whatever the files happen to
54
+ * declare rather than of a decision anybody took.
55
+ */
56
+ export { collectModuleCommands, findModuleCommand, formatCommandList, helpFor, InvalidCommandDeclarationError, runModuleCommand, UnknownCommandError, } from './module-commands.js';
57
+ export { cliFailureExitCode, cliUsage, DEFAULT_CLI_PROGRAM, dispatchCli, runCli, } from './dispatch.js';
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,EACP,8BAA8B,EAC9B,gBAAgB,EAChB,mBAAmB,GAIpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,MAAM,GAGP,MAAM,eAAe,CAAC"}