@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,111 @@
1
+ /**
2
+ * The half of the demo runner that has no database in it (feature 113 Phase 0,
3
+ * `specs/113-module-owned-demo-data/contracts/module-demo-data-layer.md` §3.5,
4
+ * §3.6 and §4).
5
+ *
6
+ * Which modules contribute, in what order, and which are reported as skips —
7
+ * all of it decided from the resolved manifest set and a presence oracle, so
8
+ * the three properties that are easiest to get quietly wrong are testable with
9
+ * no services at all.
10
+ *
11
+ * It is deliberately separate from `runner.ts`, which is the half that calls
12
+ * things: **presence is decided here, before a context exists**, which is what
13
+ * §3.5 asks for and what `backend/src/cli/module-commands.ts` already does for a
14
+ * module-declared command. A plan that had already built contexts would have
15
+ * done the work the gate is meant to prevent.
16
+ */
17
+ import type { ModuleDemoManifest } from '@endora-commerce/contracts';
18
+ /** Seed or withdraw — the two directions the whole layer is written in. */
19
+ export type DemoMode = 'seed' | 'reset';
20
+ /**
21
+ * The minimum of a resolved manifest entry the demo layer reads.
22
+ *
23
+ * Structural rather than `RegisteredManifestEntry`, for the reason
24
+ * `CommandDeclaringEntry` gives: the three origins the platform resolves —
25
+ * core, this deployment's overlay and an installed package — reach here as one
26
+ * array and none of them is more this file's business than the others.
27
+ */
28
+ export interface DemoManifestEntry {
29
+ readonly id: string;
30
+ readonly dependencies: readonly string[];
31
+ /** `undefined` — nobody decided; `false` — nothing to demonstrate; an object — a body (§1.2). */
32
+ readonly demo?: ModuleDemoManifest<never> | false;
33
+ }
34
+ /** One module the run will invoke. */
35
+ export interface DemoPlanStep {
36
+ readonly moduleId: string;
37
+ readonly demo: ModuleDemoManifest<never>;
38
+ }
39
+ /**
40
+ * One module the run will not invoke, and why.
41
+ *
42
+ * The population is deliberately narrow: a module that **declares a body** and
43
+ * is not effectively present. That is §3.7's *"an absent module is a reported
44
+ * skip, never an error and never a silence"*. A module that declares `false`
45
+ * and a module nobody has decided about are counted rather than listed — 57
46
+ * lines saying "this module has nothing to demonstrate" is a report nobody
47
+ * reads, and neither state is a skip: there was nothing to run.
48
+ */
49
+ export interface DemoPlanSkip {
50
+ readonly moduleId: string;
51
+ readonly reason: 'not-present';
52
+ }
53
+ /** The two quiet states of §1.2, counted so the report can account for them. */
54
+ export interface DemoPlanCounts {
55
+ /** Modules declaring `demo: false` — a decision that owes nothing. */
56
+ readonly declaredNone: number;
57
+ /** Modules declaring nothing at all — nobody has decided. */
58
+ readonly undecided: number;
59
+ }
60
+ export interface DemoPlan {
61
+ readonly mode: DemoMode;
62
+ readonly steps: readonly DemoPlanStep[];
63
+ readonly skipped: readonly DemoPlanSkip[];
64
+ readonly counts: DemoPlanCounts;
65
+ /** Reported, never fatal (§4.5). */
66
+ readonly diagnostics: readonly string[];
67
+ }
68
+ export interface PlanDemoRunInput {
69
+ readonly mode: DemoMode;
70
+ /** The set the composition was actually built from. */
71
+ readonly entries: readonly DemoManifestEntry[];
72
+ /**
73
+ * Effective presence — platform-available **and** operator-activated
74
+ * (Constitution XVII, §3.6). Injected rather than reached for, so the plan is
75
+ * decidable without a registry cache and so the host stays the one place that
76
+ * knows what "present" means here.
77
+ */
78
+ readonly isPresent: (moduleId: string) => boolean;
79
+ }
80
+ /**
81
+ * Which modules contribute, in what order.
82
+ *
83
+ * ## The order is the platform's, not this file's (§4.1)
84
+ *
85
+ * `orderModulesByDependencies` is the walk the migration order builds its own
86
+ * order from, so a demo run and a migration run cannot come to disagree about
87
+ * what "after" means. What this file adds is the **advisory** `after` edges
88
+ * (§4.3): they go into the same graph, are read by the same walk, and put no
89
+ * module in anyone's `dependencies`. The measured case is `megamenu`, whose demo
90
+ * menu mirrors `catalog`'s demo categories and which does not declare `catalog`
91
+ * — and must not begin to for the sake of a fixture (D-209).
92
+ *
93
+ * The graph is built over **every** entry, not only the declaring ones, so a
94
+ * module that ships no demo data still orders the two that do through it. Only
95
+ * the declaring, present ones become steps.
96
+ *
97
+ * An `after` entry naming a module that is not in the run orders nothing and is
98
+ * not a finding (§4.4) — that falls out of `orderModulesByDependencies` skipping
99
+ * an edge into a node the map does not hold, and it is the ordinary case in a
100
+ * partial install rather than an exception to be reported. §4.4's *"MAY be
101
+ * reported"* for an id the vocabulary does not hold is deliberately not taken:
102
+ * from inside a client's instance the two states are one, and the diagnostic
103
+ * would fire on every correct partial install.
104
+ *
105
+ * A cycle is a **reported diagnostic and never a throw** (§4.5), on
106
+ * `migration-order.ts`' reasoning: a manifest can arrive from an installed
107
+ * package, and one stranger's declaration must not stop a shop's own demo from
108
+ * seeding. Its members come out contiguous, in id order.
109
+ */
110
+ export declare function planDemoRun(input: PlanDemoRunInput): DemoPlan;
111
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/demo/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAMrE,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,iGAAiG;IACjG,QAAQ,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;CACnD;AAED,sCAAsC;AACtC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;CAChC;AAED,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,oCAAoC;IACpC,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,QAAQ,CA6C7D"}
@@ -0,0 +1,74 @@
1
+ import { moduleDependencyCycles, orderModulesByDependencies, } from '../lifecycle/services/dep-graph.js';
2
+ /**
3
+ * Which modules contribute, in what order.
4
+ *
5
+ * ## The order is the platform's, not this file's (§4.1)
6
+ *
7
+ * `orderModulesByDependencies` is the walk the migration order builds its own
8
+ * order from, so a demo run and a migration run cannot come to disagree about
9
+ * what "after" means. What this file adds is the **advisory** `after` edges
10
+ * (§4.3): they go into the same graph, are read by the same walk, and put no
11
+ * module in anyone's `dependencies`. The measured case is `megamenu`, whose demo
12
+ * menu mirrors `catalog`'s demo categories and which does not declare `catalog`
13
+ * — and must not begin to for the sake of a fixture (D-209).
14
+ *
15
+ * The graph is built over **every** entry, not only the declaring ones, so a
16
+ * module that ships no demo data still orders the two that do through it. Only
17
+ * the declaring, present ones become steps.
18
+ *
19
+ * An `after` entry naming a module that is not in the run orders nothing and is
20
+ * not a finding (§4.4) — that falls out of `orderModulesByDependencies` skipping
21
+ * an edge into a node the map does not hold, and it is the ordinary case in a
22
+ * partial install rather than an exception to be reported. §4.4's *"MAY be
23
+ * reported"* for an id the vocabulary does not hold is deliberately not taken:
24
+ * from inside a client's instance the two states are one, and the diagnostic
25
+ * would fire on every correct partial install.
26
+ *
27
+ * A cycle is a **reported diagnostic and never a throw** (§4.5), on
28
+ * `migration-order.ts`' reasoning: a manifest can arrive from an installed
29
+ * package, and one stranger's declaration must not stop a shop's own demo from
30
+ * seeding. Its members come out contiguous, in id order.
31
+ */
32
+ export function planDemoRun(input) {
33
+ const declaring = new Map();
34
+ let declaredNone = 0;
35
+ let undecided = 0;
36
+ for (const entry of input.entries) {
37
+ if (entry.demo === undefined)
38
+ undecided += 1;
39
+ else if (entry.demo === false)
40
+ declaredNone += 1;
41
+ else
42
+ declaring.set(entry.id, entry.demo);
43
+ }
44
+ // Presence, once per declaring module, before anything is built. It is asked
45
+ // about the **declaring** module and never about a dependency: that answer is
46
+ // the owner's own gate's, and asking it twice is how the two come to disagree
47
+ // (D-157.5).
48
+ const skipped = [];
49
+ const running = new Map();
50
+ for (const [moduleId, demo] of declaring) {
51
+ if (input.isPresent(moduleId))
52
+ running.set(moduleId, demo);
53
+ else
54
+ skipped.push({ moduleId, reason: 'not-present' });
55
+ }
56
+ const graph = new Map();
57
+ for (const entry of input.entries) {
58
+ const after = running.get(entry.id)?.after ?? [];
59
+ graph.set(entry.id, [...entry.dependencies, ...after]);
60
+ }
61
+ const diagnostics = moduleDependencyCycles(graph).map((members) => `[demo] modules [${members.join(', ')}] order each other in a loop, counting ` +
62
+ `\`demo.after\`. Their demo data runs as one block in module-id order, because ` +
63
+ `the declarations contain no order.`);
64
+ const ordered = orderModulesByDependencies(graph).filter((id) => running.has(id));
65
+ const sequence = input.mode === 'reset' ? [...ordered].reverse() : ordered;
66
+ return {
67
+ mode: input.mode,
68
+ steps: sequence.map((moduleId) => ({ moduleId, demo: running.get(moduleId) })),
69
+ skipped: skipped.sort((left, right) => left.moduleId.localeCompare(right.moduleId)),
70
+ counts: { declaredNone, undecided },
71
+ diagnostics,
72
+ };
73
+ }
74
+ //# sourceMappingURL=plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.js","sourceRoot":"","sources":["../../src/demo/plan.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,oCAAoC,CAAC;AAuE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAqC,CAAC;IAC/D,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;YAAE,SAAS,IAAI,CAAC,CAAC;aACxC,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK;YAAE,YAAY,IAAI,CAAC,CAAC;;YAC5C,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,6EAA6E;IAC7E,8EAA8E;IAC9E,8EAA8E;IAC9E,aAAa;IACb,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqC,CAAC;IAC7D,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC;QACzC,IAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC;YAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;;YACtD,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,aAA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F,MAAM,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE;QACnC,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * What the operator reads at the end of a demo run (feature 113 Phase 0,
3
+ * `contracts/module-demo-data-layer.md` §3.7).
4
+ *
5
+ * *"The command MUST report per module what was contributed and per composition
6
+ * step what was skipped and why. An absent module is a reported skip, never an
7
+ * error and never a silence."*
8
+ *
9
+ * Formatting lives apart from the running so that the report is assertable
10
+ * without invoking anything, and so that a module's body never formats: it
11
+ * returns counts and the runner lays them out once. A client's scaffolded
12
+ * composition therefore does not have to know how the platform prints
13
+ * credentials.
14
+ */
15
+ import type { DemoRunResult } from './runner.js';
16
+ export declare function formatDemoReport(result: DemoRunResult): string;
17
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/demo/report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyBjD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAoE9D"}
@@ -0,0 +1,85 @@
1
+ function countLine(entity) {
2
+ return `${entity.entity} ${entity.count}`;
3
+ }
4
+ /**
5
+ * The two quiet states of §1.2, as one sentence.
6
+ *
7
+ * Counted rather than listed: 57 lines saying "this module has nothing to
8
+ * demonstrate" is a report nobody reads, and neither state is a skip — there
9
+ * was nothing to run. They are printed at all because *"nobody has decided"* is
10
+ * a real state an operator may want to see the size of.
11
+ */
12
+ function quietStates(result) {
13
+ const parts = [];
14
+ if (result.counts.declaredNone > 0) {
15
+ parts.push(`${result.counts.declaredNone} declares none`);
16
+ }
17
+ if (result.counts.undecided > 0) {
18
+ parts.push(`${result.counts.undecided} has not decided`);
19
+ }
20
+ return parts.length === 0 ? undefined : `Modules with no demo data: ${parts.join(', ')}.`;
21
+ }
22
+ export function formatDemoReport(result) {
23
+ const verb = result.mode === 'seed' ? 'seeded' : 'withdrawn';
24
+ const lines = [];
25
+ if (result.modules.length === 0) {
26
+ lines.push(`No module contributed demo data — nothing was ${verb}.`);
27
+ }
28
+ else {
29
+ lines.push(`Demo ${verb}, module by module:`);
30
+ for (const module of result.modules) {
31
+ const counts = module.entities.map(countLine).join(', ');
32
+ lines.push(` ${module.moduleId} — ${module.summary}${counts ? ` (${counts})` : ''}`);
33
+ for (const note of module.notes)
34
+ lines.push(` note: ${note}`);
35
+ }
36
+ }
37
+ if (result.skipped.length > 0) {
38
+ lines.push('');
39
+ lines.push('Skipped, and why:');
40
+ for (const skip of result.skipped) {
41
+ // Two reasons, printed apart, because they ask the operator for two
42
+ // different things: switch the module on, or install a package. Reading
43
+ // an uninstalled demo package as "not present" would send them to the
44
+ // module screen, where the module is on and nothing is wrong (§6.3).
45
+ lines.push(skip.reason === 'demo-package-not-installed'
46
+ ? ` ${skip.moduleId} — its demo data lives in '${skip.package}', which is not ` +
47
+ `installed in this instance. The module itself is present; install that ` +
48
+ `package to seed its demo data.`
49
+ : ` ${skip.moduleId} — not present in this instance (either not installed, or ` +
50
+ `switched off by an operator).`);
51
+ }
52
+ }
53
+ if (result.composition) {
54
+ lines.push('');
55
+ if (result.composition.applied.length > 0) {
56
+ lines.push(`Composition ${result.mode === 'seed' ? 'applied' : 'withdrawn'}:`);
57
+ for (const step of result.composition.applied)
58
+ lines.push(` ${step}`);
59
+ }
60
+ if (result.composition.skipped.length > 0) {
61
+ lines.push('Composition steps skipped, and why:');
62
+ for (const skip of result.composition.skipped) {
63
+ lines.push(` ${skip.step} — ${skip.reason}`);
64
+ }
65
+ }
66
+ }
67
+ const quiet = quietStates(result);
68
+ if (quiet) {
69
+ lines.push('');
70
+ lines.push(quiet);
71
+ }
72
+ if (result.credentials.length > 0) {
73
+ lines.push('');
74
+ lines.push('Sign in with:');
75
+ for (const credential of result.credentials) {
76
+ lines.push(` ${credential.label}: ${credential.value}`);
77
+ }
78
+ }
79
+ for (const diagnostic of result.diagnostics) {
80
+ lines.push('');
81
+ lines.push(diagnostic);
82
+ }
83
+ return `${lines.join('\n')}\n`;
84
+ }
85
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/demo/report.ts"],"names":[],"mappings":"AAgBA,SAAS,SAAS,CAAC,MAAyC;IAC1D,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,WAAW,CAAC,MAAqB;IACxC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,kBAAkB,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,8BAA8B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAqB;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC;IAC7D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,iDAAiD,IAAI,GAAG,CAAC,CAAC;IACvE,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E,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
@@ -0,0 +1,207 @@
1
+ /**
2
+ * The demo runner (feature 113 Phase 0,
3
+ * `specs/113-module-owned-demo-data/contracts/module-demo-data-layer.md` §3 and
4
+ * §5.5).
5
+ *
6
+ * Given a plan, invoke each module's body with that module's own context, run
7
+ * the instance's composition at the one point in the sequence where it belongs,
8
+ * and return a report. Everything decidable without a database is `plan.ts`'s;
9
+ * this file is the part that calls things.
10
+ *
11
+ * ## What it deliberately does not do
12
+ *
13
+ * It does not open a scope and it does not call the production guard. Both are
14
+ * the **entry point's** (§3.3, §3.4): the guard runs first, before anything is
15
+ * composed, outside every `try`, and the scope is opened once for the whole run
16
+ * over the composition's own container. A runner that opened its own would be a
17
+ * second entry point, which is exactly the property §3.4 buys by taking the
18
+ * responsibility off every module's body.
19
+ *
20
+ * It also holds no module list of its own and imports from no module. It is
21
+ * handed the resolved manifest set, a presence oracle and a context factory —
22
+ * which is what lets it live in the platform at all (D-52/D-53).
23
+ */
24
+ import type { DemoCredential, DemoEntityCount } from '@endora-commerce/contracts';
25
+ import { type DemoManifestEntry, type DemoMode, type DemoPlanCounts, type DemoPlanSkip } from './plan.js';
26
+ import { type DemoPackageResolver } from './packages.js';
27
+ /**
28
+ * The cross-module wiring, supplied by whoever owns the instance (§5, D-209).
29
+ *
30
+ * It is a **parameter** and never an import: a composition names `megamenu` and
31
+ * `catalog`, and a platform root that named a module would be D-52/D-53's one
32
+ * rule with an exception. In this repository the host passes its own; in a
33
+ * client's instance the scaffold writes one into their tree and their entry
34
+ * point passes that.
35
+ */
36
+ export interface DemoComposition {
37
+ /** Runs after every module's `seed` and before the summary (§5.5). */
38
+ apply(): Promise<DemoCompositionResult>;
39
+ /** Runs before any module's `reset` (§5.5). */
40
+ withdraw(): Promise<DemoCompositionResult>;
41
+ /**
42
+ * The **foundation**: rows every module's demo body already assumes, created
43
+ * before the first `seed` (§5.5a, feature 113 T226).
44
+ *
45
+ * ## Why a second phase exists, measured rather than argued
46
+ *
47
+ * §5.5's single after-the-modules position is right for *wiring* — a step
48
+ * that joins two modules' rows can only run once both exist. It is wrong for
49
+ * a row a module's body **reads**, and this repository holds exactly one:
50
+ * the demo's two sales channels. `sales_channels` is the kernel's table, so
51
+ * no module may declare it as demo data (§2.1) and the kernel carries no
52
+ * `demo` field; and `inventory`'s body does `em.find(SalesChannel, {})` and
53
+ * assigns the demo warehouse to every channel it finds. Created in `apply`,
54
+ * the second channel arrives after that read has happened and
55
+ * `pl_b2b_vip` silently loses its `warehouse_channel_assignments` row.
56
+ *
57
+ * Measured before this phase existed: `inventory` reports
58
+ * `WarehouseChannelAssignment 2` on a seed where the channels precede it and
59
+ * would report 1 where they do not, with nothing failing.
60
+ *
61
+ * It is **optional**, and an instance that declares none is an ordinary
62
+ * instance rather than a degraded one — §5.6's rule for a composition that is
63
+ * absent entirely, one level down. A composition written against the
64
+ * Phase-0 interface keeps working unchanged, which is §6.5's property applied
65
+ * to this interface rather than to the hatch.
66
+ */
67
+ applyFoundation?(): Promise<DemoCompositionResult>;
68
+ /**
69
+ * The mirror of {@link DemoComposition.applyFoundation}: runs **after** the
70
+ * last module's `reset` (§5.5a).
71
+ *
72
+ * The position is forced rather than chosen. A withdrawal is the reverse of
73
+ * the sequence that built it, so the foundation goes last — and here that is
74
+ * the difference between a filtered delete and a cascade: withdrawing the
75
+ * demo's sales channels *before* `inventory`'s `reset` would take that
76
+ * module's assignment rows with them through the database rather than
77
+ * through the module that owns them, which is an unfiltered destruction by
78
+ * another name.
79
+ */
80
+ withdrawFoundation?(): Promise<DemoCompositionResult>;
81
+ }
82
+ /**
83
+ * What a composition reports.
84
+ *
85
+ * `skipped` is not an afterthought — it is FR-011 and US2's first acceptance
86
+ * scenario. Every step is guarded by an effective-presence question about every
87
+ * module it touches, and a step whose modules are not all present is a reported
88
+ * skip carrying the reason (§5.4): never a throw, never a silence.
89
+ */
90
+ export interface DemoCompositionResult {
91
+ readonly applied: readonly string[];
92
+ readonly skipped: readonly {
93
+ readonly step: string;
94
+ readonly reason: string;
95
+ }[];
96
+ /**
97
+ * Sign-in details this composition created, merged into the run's own list
98
+ * and formatted once by {@link formatDemoReport} (feature 113, T226).
99
+ *
100
+ * A composition creates accounts a module cannot: `customer_accounts.
101
+ * organization_id` is `NOT NULL` under Principle XI, so the demo buyer is
102
+ * created by a composition step and by nothing else, and until this field
103
+ * existed the only thing that could print its password was the legacy seed
104
+ * script — which this task deletes. Without it the composed path would have
105
+ * printed three of the four pairs and said nothing about the fourth, which
106
+ * is the silent half-report §3.7 is written against.
107
+ */
108
+ readonly credentials?: readonly DemoCredential[];
109
+ }
110
+ /** What one module contributed. */
111
+ export interface DemoModuleOutcome {
112
+ readonly moduleId: string;
113
+ readonly summary: string;
114
+ readonly entities: readonly DemoEntityCount[];
115
+ readonly notes: readonly string[];
116
+ }
117
+ /**
118
+ * A module the escape hatch's package is not installed for (§6.3's **second**
119
+ * answer, feature 113 T235).
120
+ *
121
+ * A skip and never a failure: the module contributes nothing, the run
122
+ * continues, and the report names the package so an operator can install it.
123
+ * It is a kind of its own rather than a second `reason` on
124
+ * {@link DemoPlanSkip} because that type is `plan.ts`', decidable with no
125
+ * module system, and this one is not — collapsing them would put a resolution
126
+ * this file performs into a type that promises never to perform one.
127
+ */
128
+ export interface DemoPackageSkip {
129
+ readonly moduleId: string;
130
+ readonly reason: 'demo-package-not-installed';
131
+ readonly package: string;
132
+ }
133
+ /** Everything the run did not do, and why. */
134
+ export type DemoRunSkip = DemoPlanSkip | DemoPackageSkip;
135
+ export interface DemoRunResult {
136
+ readonly mode: DemoMode;
137
+ readonly modules: readonly DemoModuleOutcome[];
138
+ readonly skipped: readonly DemoRunSkip[];
139
+ readonly counts: DemoPlanCounts;
140
+ readonly credentials: readonly DemoCredential[];
141
+ readonly diagnostics: readonly string[];
142
+ /**
143
+ * Absent when the caller supplied no composition.
144
+ *
145
+ * Both phases (§5.5a) are here, concatenated in the order they ran: the
146
+ * foundation's steps and the wiring's are one list because an operator reads
147
+ * a sequence, and the step name — the composition's own sentence — is what
148
+ * says which is which.
149
+ */
150
+ readonly composition?: DemoCompositionResult;
151
+ }
152
+ /**
153
+ * A module's demo body failed, and the run failed with it (§3.8).
154
+ *
155
+ * *"A demo seed that half-succeeded silently is worse than one that failed: the
156
+ * operator cannot tell a partial demo from a complete one."* So the throw is
157
+ * unconditional and nothing is swallowed — the original error is the `cause`,
158
+ * unmodified, which is what keeps the entry point's `ModuleDisabledError`
159
+ * discrimination working through one `unwrapDemoFailure` call rather than
160
+ * through a `catch` that decides anything.
161
+ */
162
+ export declare class DemoRunFailedError extends Error {
163
+ readonly moduleId: string;
164
+ readonly mode: DemoMode;
165
+ readonly cause: unknown;
166
+ constructor(moduleId: string, mode: DemoMode, cause: unknown);
167
+ }
168
+ /**
169
+ * The error a demo run really failed with.
170
+ *
171
+ * Not a `catch` and not a decision: it unwraps one known wrapper so that an
172
+ * entry point's existing discrimination — `err instanceof ModuleDisabledError`
173
+ * — sees what it saw before this layer existed. Everything else passes through.
174
+ */
175
+ export declare function unwrapDemoFailure(error: unknown): unknown;
176
+ export interface RunDemoInput {
177
+ readonly mode: DemoMode;
178
+ readonly entries: readonly DemoManifestEntry[];
179
+ readonly isPresent: (moduleId: string) => boolean;
180
+ /** The composition's own context factory — `ComposeAppHandle.contextFor`. */
181
+ readonly contextFor: (moduleId: string) => unknown;
182
+ readonly composition?: DemoComposition;
183
+ /**
184
+ * How a `demo.package` name is resolved (§6, T235).
185
+ *
186
+ * Defaults to {@link createDemoPackageResolver} over the working directory,
187
+ * which for `endora demo seed` is the instance root. A host that runs from
188
+ * somewhere else, and a test asserting §6.3's three answers, passes its own.
189
+ */
190
+ readonly demoPackages?: DemoPackageResolver;
191
+ }
192
+ /**
193
+ * Run one demo pass and report it.
194
+ *
195
+ * The sequence is §3's and §5.5a's, in full: plan (which decides presence),
196
+ * then the foundation, then each module in order, then the wiring —
197
+ *
198
+ * ```
199
+ * seed applyFoundation? -> module seed (dependency order) -> apply
200
+ * reset withdraw -> module reset (reverse order) -> withdrawFoundation?
201
+ * ```
202
+ *
203
+ * — so `reset` is the exact reverse of `seed` at every position, which is the
204
+ * property that lets a withdrawal be a filtered delete rather than a cascade.
205
+ */
206
+ export declare function runDemo(input: RunDemoInput): Promise<DemoRunResult>;
207
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/demo/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAGhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,eAAe,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,KAAK,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACxC,+CAA+C;IAC/C,QAAQ,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,eAAe,CAAC,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACnD;;;;;;;;;;;OAWG;IACH,kBAAkB,CAAC,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACvD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAA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