@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.
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/cli/dispatch.d.ts +146 -0
- package/dist/cli/dispatch.d.ts.map +1 -0
- package/dist/cli/dispatch.js +259 -0
- package/dist/cli/dispatch.js.map +1 -0
- package/dist/cli/index.d.ts +58 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +58 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/module-commands.d.ts +118 -0
- package/dist/cli/module-commands.d.ts.map +1 -0
- package/dist/cli/module-commands.js +120 -0
- package/dist/cli/module-commands.js.map +1 -0
- package/dist/commands/actor.d.ts +19 -0
- package/dist/commands/actor.d.ts.map +1 -0
- package/dist/commands/actor.js +45 -0
- package/dist/commands/actor.js.map +1 -0
- package/dist/commands/audit-from-context.d.ts +24 -0
- package/dist/commands/audit-from-context.d.ts.map +1 -0
- package/dist/commands/audit-from-context.js +28 -0
- package/dist/commands/audit-from-context.js.map +1 -0
- package/dist/commands/command-bus.d.ts +40 -0
- package/dist/commands/command-bus.d.ts.map +1 -0
- package/dist/commands/command-bus.js +46 -0
- package/dist/commands/command-bus.js.map +1 -0
- package/dist/commands/command.d.ts +76 -0
- package/dist/commands/command.d.ts.map +1 -0
- package/dist/commands/command.js +2 -0
- package/dist/commands/command.js.map +1 -0
- package/dist/commands/index.d.ts +65 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +57 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/reversible.d.ts +66 -0
- package/dist/commands/reversible.d.ts.map +1 -0
- package/dist/commands/reversible.js +41 -0
- package/dist/commands/reversible.js.map +1 -0
- package/dist/composition/compose-app.d.ts +305 -0
- package/dist/composition/compose-app.d.ts.map +1 -0
- package/dist/composition/compose-app.js +939 -0
- package/dist/composition/compose-app.js.map +1 -0
- package/dist/composition/index.d.ts +92 -0
- package/dist/composition/index.d.ts.map +1 -0
- package/dist/composition/index.js +175 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/composition/newsletter-token-secret.d.ts +19 -0
- package/dist/composition/newsletter-token-secret.d.ts.map +1 -0
- package/dist/composition/newsletter-token-secret.js +24 -0
- package/dist/composition/newsletter-token-secret.js.map +1 -0
- package/dist/composition/process-runs-workers.d.ts +17 -0
- package/dist/composition/process-runs-workers.d.ts.map +1 -0
- package/dist/composition/process-runs-workers.js +19 -0
- package/dist/composition/process-runs-workers.js.map +1 -0
- package/dist/db/baseline-migration-inventory.d.ts +15 -0
- package/dist/db/baseline-migration-inventory.d.ts.map +1 -0
- package/dist/db/baseline-migration-inventory.js +115 -0
- package/dist/db/baseline-migration-inventory.js.map +1 -0
- package/dist/db/configured-entities.d.ts +74 -0
- package/dist/db/configured-entities.d.ts.map +1 -0
- package/dist/db/configured-entities.js +20 -0
- package/dist/db/configured-entities.js.map +1 -0
- package/dist/db/configured-migrations.d.ts +199 -0
- package/dist/db/configured-migrations.d.ts.map +1 -0
- package/dist/db/configured-migrations.js +181 -0
- package/dist/db/configured-migrations.js.map +1 -0
- package/dist/db/index.d.ts +54 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +54 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrate.d.ts +21 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +48 -0
- package/dist/db/migrate.js.map +1 -0
- package/dist/db/migration-order.d.ts +159 -0
- package/dist/db/migration-order.d.ts.map +1 -0
- package/dist/db/migration-order.js +273 -0
- package/dist/db/migration-order.js.map +1 -0
- package/dist/db/mikro-orm.config.d.ts +51 -0
- package/dist/db/mikro-orm.config.d.ts.map +1 -0
- package/dist/db/mikro-orm.config.js +64 -0
- package/dist/db/mikro-orm.config.js.map +1 -0
- package/dist/db/orm.d.ts +40 -0
- package/dist/db/orm.d.ts.map +1 -0
- package/dist/db/orm.js +25 -0
- package/dist/db/orm.js.map +1 -0
- package/dist/db/platform-schema.d.ts +102 -0
- package/dist/db/platform-schema.d.ts.map +1 -0
- package/dist/db/platform-schema.js +79 -0
- package/dist/db/platform-schema.js.map +1 -0
- package/dist/db/pluralizing-naming-strategy.d.ts +16 -0
- package/dist/db/pluralizing-naming-strategy.d.ts.map +1 -0
- package/dist/db/pluralizing-naming-strategy.js +66 -0
- package/dist/db/pluralizing-naming-strategy.js.map +1 -0
- package/dist/demo/guard.d.ts +101 -0
- package/dist/demo/guard.d.ts.map +1 -0
- package/dist/demo/guard.js +168 -0
- package/dist/demo/guard.js.map +1 -0
- package/dist/demo/host-command.d.ts +133 -0
- package/dist/demo/host-command.d.ts.map +1 -0
- package/dist/demo/host-command.js +113 -0
- package/dist/demo/host-command.js.map +1 -0
- package/dist/demo/index.d.ts +82 -0
- package/dist/demo/index.d.ts.map +1 -0
- package/dist/demo/index.js +82 -0
- package/dist/demo/index.js.map +1 -0
- package/dist/demo/packages.d.ts +67 -0
- package/dist/demo/packages.d.ts.map +1 -0
- package/dist/demo/packages.js +132 -0
- package/dist/demo/packages.js.map +1 -0
- package/dist/demo/plan.d.ts +111 -0
- package/dist/demo/plan.d.ts.map +1 -0
- package/dist/demo/plan.js +74 -0
- package/dist/demo/plan.js.map +1 -0
- package/dist/demo/report.d.ts +17 -0
- package/dist/demo/report.d.ts.map +1 -0
- package/dist/demo/report.js +85 -0
- package/dist/demo/report.js.map +1 -0
- package/dist/demo/runner.d.ts +207 -0
- package/dist/demo/runner.d.ts.map +1 -0
- package/dist/demo/runner.js +169 -0
- package/dist/demo/runner.js.map +1 -0
- package/dist/demo/scope.d.ts +44 -0
- package/dist/demo/scope.d.ts.map +1 -0
- package/dist/demo/scope.js +44 -0
- package/dist/demo/scope.js.map +1 -0
- package/dist/env/index.d.ts +68 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/env/index.js +427 -0
- package/dist/env/index.js.map +1 -0
- package/dist/events/bus.d.ts +29 -0
- package/dist/events/bus.d.ts.map +1 -0
- package/dist/events/bus.js +67 -0
- package/dist/events/bus.js.map +1 -0
- package/dist/events/index.d.ts +19 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +19 -0
- package/dist/events/index.js.map +1 -0
- package/dist/http/cursor.d.ts +10 -0
- package/dist/http/cursor.d.ts.map +1 -0
- package/dist/http/cursor.js +20 -0
- package/dist/http/cursor.js.map +1 -0
- package/dist/http/error-envelope.d.ts +127 -0
- package/dist/http/error-envelope.d.ts.map +1 -0
- package/dist/http/error-envelope.js +402 -0
- package/dist/http/error-envelope.js.map +1 -0
- package/dist/http/health.d.ts +88 -0
- package/dist/http/health.d.ts.map +1 -0
- package/dist/http/health.js +77 -0
- package/dist/http/health.js.map +1 -0
- package/dist/http/index.d.ts +50 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +50 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/interceptors/dispatch.d.ts +14 -0
- package/dist/http/interceptors/dispatch.d.ts.map +1 -0
- package/dist/http/interceptors/dispatch.js +113 -0
- package/dist/http/interceptors/dispatch.js.map +1 -0
- package/dist/http/interceptors/index.d.ts +6 -0
- package/dist/http/interceptors/index.d.ts.map +1 -0
- package/dist/http/interceptors/index.js +5 -0
- package/dist/http/interceptors/index.js.map +1 -0
- package/dist/http/interceptors/registry.d.ts +44 -0
- package/dist/http/interceptors/registry.d.ts.map +1 -0
- package/dist/http/interceptors/registry.js +123 -0
- package/dist/http/interceptors/registry.js.map +1 -0
- package/dist/http/interceptors/route-table.d.ts +33 -0
- package/dist/http/interceptors/route-table.d.ts.map +1 -0
- package/dist/http/interceptors/route-table.js +39 -0
- package/dist/http/interceptors/route-table.js.map +1 -0
- package/dist/http/interceptors/types.d.ts +101 -0
- package/dist/http/interceptors/types.d.ts.map +1 -0
- package/dist/http/interceptors/types.js +2 -0
- package/dist/http/interceptors/types.js.map +1 -0
- package/dist/http/interceptors/validation.d.ts +22 -0
- package/dist/http/interceptors/validation.d.ts.map +1 -0
- package/dist/http/interceptors/validation.js +39 -0
- package/dist/http/interceptors/validation.js.map +1 -0
- package/dist/http/logger.d.ts +9 -0
- package/dist/http/logger.d.ts.map +1 -0
- package/dist/http/logger.js +25 -0
- package/dist/http/logger.js.map +1 -0
- package/dist/http/openapi.d.ts +21 -0
- package/dist/http/openapi.d.ts.map +1 -0
- package/dist/http/openapi.js +114 -0
- package/dist/http/openapi.js.map +1 -0
- package/dist/http/product-audience.d.ts +78 -0
- package/dist/http/product-audience.d.ts.map +1 -0
- package/dist/http/product-audience.js +92 -0
- package/dist/http/product-audience.js.map +1 -0
- package/dist/http/request-actor.d.ts +82 -0
- package/dist/http/request-actor.d.ts.map +1 -0
- package/dist/http/request-actor.js +2 -0
- package/dist/http/request-actor.js.map +1 -0
- package/dist/http/server.d.ts +60 -0
- package/dist/http/server.d.ts.map +1 -0
- package/dist/http/server.js +117 -0
- package/dist/http/server.js.map +1 -0
- package/dist/http/storefront-revalidator.d.ts +29 -0
- package/dist/http/storefront-revalidator.d.ts.map +1 -0
- package/dist/http/storefront-revalidator.js +34 -0
- package/dist/http/storefront-revalidator.js.map +1 -0
- package/dist/http/test-actor-carrier.d.ts +28 -0
- package/dist/http/test-actor-carrier.d.ts.map +1 -0
- package/dist/http/test-actor-carrier.js +10 -0
- package/dist/http/test-actor-carrier.js.map +1 -0
- package/dist/http/trusted-proxy.d.ts +48 -0
- package/dist/http/trusted-proxy.d.ts.map +1 -0
- package/dist/http/trusted-proxy.js +136 -0
- package/dist/http/trusted-proxy.js.map +1 -0
- package/dist/kernel/audit/audit-log-entry.entity.d.ts +33 -0
- package/dist/kernel/audit/audit-log-entry.entity.d.ts.map +1 -0
- package/dist/kernel/audit/audit-log-entry.entity.js +102 -0
- package/dist/kernel/audit/audit-log-entry.entity.js.map +1 -0
- package/dist/kernel/audit/audit-log-service.d.ts +63 -0
- package/dist/kernel/audit/audit-log-service.d.ts.map +1 -0
- package/dist/kernel/audit/audit-log-service.js +107 -0
- package/dist/kernel/audit/audit-log-service.js.map +1 -0
- package/dist/kernel/cache/in-process-cache-registry.d.ts +93 -0
- package/dist/kernel/cache/in-process-cache-registry.d.ts.map +1 -0
- package/dist/kernel/cache/in-process-cache-registry.js +78 -0
- package/dist/kernel/cache/in-process-cache-registry.js.map +1 -0
- package/dist/kernel/cache/shared-drop-marks.d.ts +39 -0
- package/dist/kernel/cache/shared-drop-marks.d.ts.map +1 -0
- package/dist/kernel/cache/shared-drop-marks.js +68 -0
- package/dist/kernel/cache/shared-drop-marks.js.map +1 -0
- package/dist/kernel/compose.d.ts +234 -0
- package/dist/kernel/compose.d.ts.map +1 -0
- package/dist/kernel/compose.js +279 -0
- package/dist/kernel/compose.js.map +1 -0
- package/dist/kernel/container.d.ts +95 -0
- package/dist/kernel/container.d.ts.map +1 -0
- package/dist/kernel/container.js +90 -0
- package/dist/kernel/container.js.map +1 -0
- package/dist/kernel/contribution-sinks.d.ts +106 -0
- package/dist/kernel/contribution-sinks.d.ts.map +1 -0
- package/dist/kernel/contribution-sinks.js +153 -0
- package/dist/kernel/contribution-sinks.js.map +1 -0
- package/dist/kernel/crypto/password-hasher.d.ts +3 -0
- package/dist/kernel/crypto/password-hasher.d.ts.map +1 -0
- package/dist/kernel/crypto/password-hasher.js +44 -0
- package/dist/kernel/crypto/password-hasher.js.map +1 -0
- package/dist/kernel/i18n/error-envelope-options.d.ts +56 -0
- package/dist/kernel/i18n/error-envelope-options.d.ts.map +1 -0
- package/dist/kernel/i18n/error-envelope-options.js +46 -0
- package/dist/kernel/i18n/error-envelope-options.js.map +1 -0
- package/dist/kernel/i18n/error-translation.d.ts +144 -0
- package/dist/kernel/i18n/error-translation.d.ts.map +1 -0
- package/dist/kernel/i18n/error-translation.js +84 -0
- package/dist/kernel/i18n/error-translation.js.map +1 -0
- package/dist/kernel/i18n/request-language.d.ts +80 -0
- package/dist/kernel/i18n/request-language.d.ts.map +1 -0
- package/dist/kernel/i18n/request-language.js +168 -0
- package/dist/kernel/i18n/request-language.js.map +1 -0
- package/dist/kernel/index.d.ts +142 -0
- package/dist/kernel/index.d.ts.map +1 -0
- package/dist/kernel/index.js +160 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/kernel/lazy-port.d.ts +59 -0
- package/dist/kernel/lazy-port.d.ts.map +1 -0
- package/dist/kernel/lazy-port.js +78 -0
- package/dist/kernel/lazy-port.js.map +1 -0
- package/dist/kernel/lifecycle/activation-resolver.d.ts +63 -0
- package/dist/kernel/lifecycle/activation-resolver.d.ts.map +1 -0
- package/dist/kernel/lifecycle/activation-resolver.js +70 -0
- package/dist/kernel/lifecycle/activation-resolver.js.map +1 -0
- package/dist/kernel/lifecycle/capability-registry.d.ts +145 -0
- package/dist/kernel/lifecycle/capability-registry.d.ts.map +1 -0
- package/dist/kernel/lifecycle/capability-registry.js +170 -0
- package/dist/kernel/lifecycle/capability-registry.js.map +1 -0
- package/dist/kernel/lifecycle/effective-state.d.ts +126 -0
- package/dist/kernel/lifecycle/effective-state.d.ts.map +1 -0
- package/dist/kernel/lifecycle/effective-state.js +111 -0
- package/dist/kernel/lifecycle/effective-state.js.map +1 -0
- package/dist/kernel/lifecycle/module-registration.entity.d.ts +57 -0
- package/dist/kernel/lifecycle/module-registration.entity.d.ts.map +1 -0
- package/dist/kernel/lifecycle/module-registration.entity.js +111 -0
- package/dist/kernel/lifecycle/module-registration.entity.js.map +1 -0
- package/dist/kernel/lifecycle/plugin-helpers.d.ts +165 -0
- package/dist/kernel/lifecycle/plugin-helpers.d.ts.map +1 -0
- package/dist/kernel/lifecycle/plugin-helpers.js +395 -0
- package/dist/kernel/lifecycle/plugin-helpers.js.map +1 -0
- package/dist/kernel/lifecycle/registry-cache.d.ts +318 -0
- package/dist/kernel/lifecycle/registry-cache.d.ts.map +1 -0
- package/dist/kernel/lifecycle/registry-cache.js +509 -0
- package/dist/kernel/lifecycle/registry-cache.js.map +1 -0
- package/dist/kernel/lifecycle/required-modules.d.ts +137 -0
- package/dist/kernel/lifecycle/required-modules.d.ts.map +1 -0
- package/dist/kernel/lifecycle/required-modules.js +80 -0
- package/dist/kernel/lifecycle/required-modules.js.map +1 -0
- package/dist/kernel/lifecycle/unique-module-ids.d.ts +58 -0
- package/dist/kernel/lifecycle/unique-module-ids.d.ts.map +1 -0
- package/dist/kernel/lifecycle/unique-module-ids.js +82 -0
- package/dist/kernel/lifecycle/unique-module-ids.js.map +1 -0
- package/dist/kernel/logging.d.ts +116 -0
- package/dist/kernel/logging.d.ts.map +1 -0
- package/dist/kernel/logging.js +71 -0
- package/dist/kernel/logging.js.map +1 -0
- package/dist/kernel/module-context.d.ts +563 -0
- package/dist/kernel/module-context.d.ts.map +1 -0
- package/dist/kernel/module-context.js +670 -0
- package/dist/kernel/module-context.js.map +1 -0
- package/dist/kernel/ports/audit.d.ts +115 -0
- package/dist/kernel/ports/audit.d.ts.map +1 -0
- package/dist/kernel/ports/audit.js +2 -0
- package/dist/kernel/ports/audit.js.map +1 -0
- package/dist/kernel/ports/organizations.d.ts +56 -0
- package/dist/kernel/ports/organizations.d.ts.map +1 -0
- package/dist/kernel/ports/organizations.js +2 -0
- package/dist/kernel/ports/organizations.js.map +1 -0
- package/dist/kernel/ports/provide.d.ts +14 -0
- package/dist/kernel/ports/provide.d.ts.map +1 -0
- package/dist/kernel/ports/provide.js +50 -0
- package/dist/kernel/ports/provide.js.map +1 -0
- package/dist/kernel/ports/require-admin.d.ts +61 -0
- package/dist/kernel/ports/require-admin.d.ts.map +1 -0
- package/dist/kernel/ports/require-admin.js +2 -0
- package/dist/kernel/ports/require-admin.js.map +1 -0
- package/dist/kernel/ports/require-customer.d.ts +17 -0
- package/dist/kernel/ports/require-customer.d.ts.map +1 -0
- package/dist/kernel/ports/require-customer.js +2 -0
- package/dist/kernel/ports/require-customer.js.map +1 -0
- package/dist/kernel/ports/sales-channel.d.ts +84 -0
- package/dist/kernel/ports/sales-channel.d.ts.map +1 -0
- package/dist/kernel/ports/sales-channel.js +2 -0
- package/dist/kernel/ports/sales-channel.js.map +1 -0
- package/dist/kernel/ports/settings.d.ts +59 -0
- package/dist/kernel/ports/settings.d.ts.map +1 -0
- package/dist/kernel/ports/settings.js +2 -0
- package/dist/kernel/ports/settings.js.map +1 -0
- package/dist/kernel/public-api-base-url.d.ts +98 -0
- package/dist/kernel/public-api-base-url.d.ts.map +1 -0
- package/dist/kernel/public-api-base-url.js +144 -0
- package/dist/kernel/public-api-base-url.js.map +1 -0
- package/dist/kernel/request-scope-hook.d.ts +63 -0
- package/dist/kernel/request-scope-hook.d.ts.map +1 -0
- package/dist/kernel/request-scope-hook.js +67 -0
- package/dist/kernel/request-scope-hook.js.map +1 -0
- package/dist/kernel/sales-channels/channel-bridge-registry.d.ts +109 -0
- package/dist/kernel/sales-channels/channel-bridge-registry.d.ts.map +1 -0
- package/dist/kernel/sales-channels/channel-bridge-registry.js +75 -0
- package/dist/kernel/sales-channels/channel-bridge-registry.js.map +1 -0
- package/dist/kernel/sales-channels/compose.d.ts +69 -0
- package/dist/kernel/sales-channels/compose.d.ts.map +1 -0
- package/dist/kernel/sales-channels/compose.js +43 -0
- package/dist/kernel/sales-channels/compose.js.map +1 -0
- package/dist/kernel/sales-channels/default-channel-reconciler.d.ts +66 -0
- package/dist/kernel/sales-channels/default-channel-reconciler.d.ts.map +1 -0
- package/dist/kernel/sales-channels/default-channel-reconciler.js +91 -0
- package/dist/kernel/sales-channels/default-channel-reconciler.js.map +1 -0
- package/dist/kernel/sales-channels/no-system-default-channel.error.d.ts +28 -0
- package/dist/kernel/sales-channels/no-system-default-channel.error.d.ts.map +1 -0
- package/dist/kernel/sales-channels/no-system-default-channel.error.js +33 -0
- package/dist/kernel/sales-channels/no-system-default-channel.error.js.map +1 -0
- package/dist/kernel/sales-channels/request-channel-assortment.d.ts +72 -0
- package/dist/kernel/sales-channels/request-channel-assortment.d.ts.map +1 -0
- package/dist/kernel/sales-channels/request-channel-assortment.js +83 -0
- package/dist/kernel/sales-channels/request-channel-assortment.js.map +1 -0
- package/dist/kernel/sales-channels/sales-channel-membership.service.d.ts +157 -0
- package/dist/kernel/sales-channels/sales-channel-membership.service.d.ts.map +1 -0
- package/dist/kernel/sales-channels/sales-channel-membership.service.js +302 -0
- package/dist/kernel/sales-channels/sales-channel-membership.service.js.map +1 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.middleware.d.ts +76 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.middleware.d.ts.map +1 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.middleware.js +184 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.middleware.js.map +1 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.service.d.ts +82 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.service.d.ts.map +1 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.service.js +126 -0
- package/dist/kernel/sales-channels/sales-channel-resolver.service.js.map +1 -0
- package/dist/kernel/sales-channels/sales-channel.entity.d.ts +50 -0
- package/dist/kernel/sales-channels/sales-channel.entity.d.ts.map +1 -0
- package/dist/kernel/sales-channels/sales-channel.entity.js +132 -0
- package/dist/kernel/sales-channels/sales-channel.entity.js.map +1 -0
- package/dist/kernel/sales-channels/sales-channels-cache.d.ts +170 -0
- package/dist/kernel/sales-channels/sales-channels-cache.d.ts.map +1 -0
- package/dist/kernel/sales-channels/sales-channels-cache.js +243 -0
- package/dist/kernel/sales-channels/sales-channels-cache.js.map +1 -0
- package/dist/kernel/scope.d.ts +153 -0
- package/dist/kernel/scope.d.ts.map +1 -0
- package/dist/kernel/scope.js +172 -0
- package/dist/kernel/scope.js.map +1 -0
- package/dist/kernel/settings/compose.d.ts +49 -0
- package/dist/kernel/settings/compose.d.ts.map +1 -0
- package/dist/kernel/settings/compose.js +21 -0
- package/dist/kernel/settings/compose.js.map +1 -0
- package/dist/kernel/settings/manifest-reconciler.d.ts +78 -0
- package/dist/kernel/settings/manifest-reconciler.d.ts.map +1 -0
- package/dist/kernel/settings/manifest-reconciler.js +343 -0
- package/dist/kernel/settings/manifest-reconciler.js.map +1 -0
- package/dist/kernel/settings/secret-value-codec.d.ts +52 -0
- package/dist/kernel/settings/secret-value-codec.d.ts.map +1 -0
- package/dist/kernel/settings/secret-value-codec.js +102 -0
- package/dist/kernel/settings/secret-value-codec.js.map +1 -0
- package/dist/kernel/settings/setting-group.entity.d.ts +25 -0
- package/dist/kernel/settings/setting-group.entity.d.ts.map +1 -0
- package/dist/kernel/settings/setting-group.entity.js +79 -0
- package/dist/kernel/settings/setting-group.entity.js.map +1 -0
- package/dist/kernel/settings/setting-value.entity.d.ts +23 -0
- package/dist/kernel/settings/setting-value.entity.d.ts.map +1 -0
- package/dist/kernel/settings/setting-value.entity.js +66 -0
- package/dist/kernel/settings/setting-value.entity.js.map +1 -0
- package/dist/kernel/settings/setting.entity.d.ts +56 -0
- package/dist/kernel/settings/setting.entity.d.ts.map +1 -0
- package/dist/kernel/settings/setting.entity.js +147 -0
- package/dist/kernel/settings/setting.entity.js.map +1 -0
- package/dist/kernel/settings/settings-cache.d.ts +158 -0
- package/dist/kernel/settings/settings-cache.d.ts.map +1 -0
- package/dist/kernel/settings/settings-cache.js +253 -0
- package/dist/kernel/settings/settings-cache.js.map +1 -0
- package/dist/kernel/settings/settings.service.d.ts +142 -0
- package/dist/kernel/settings/settings.service.d.ts.map +1 -0
- package/dist/kernel/settings/settings.service.js +294 -0
- package/dist/kernel/settings/settings.service.js.map +1 -0
- package/dist/lifecycle/backend.d.ts +51 -0
- package/dist/lifecycle/backend.d.ts.map +1 -0
- package/dist/lifecycle/backend.js +40 -0
- package/dist/lifecycle/backend.js.map +1 -0
- package/dist/lifecycle/commands/activation.commands.d.ts +97 -0
- package/dist/lifecycle/commands/activation.commands.d.ts.map +1 -0
- package/dist/lifecycle/commands/activation.commands.js +142 -0
- package/dist/lifecycle/commands/activation.commands.js.map +1 -0
- package/dist/lifecycle/commands/disable.d.ts +3 -0
- package/dist/lifecycle/commands/disable.d.ts.map +1 -0
- package/dist/lifecycle/commands/disable.js +126 -0
- package/dist/lifecycle/commands/disable.js.map +1 -0
- package/dist/lifecycle/commands/enable.d.ts +3 -0
- package/dist/lifecycle/commands/enable.d.ts.map +1 -0
- package/dist/lifecycle/commands/enable.js +102 -0
- package/dist/lifecycle/commands/enable.js.map +1 -0
- package/dist/lifecycle/commands/install.d.ts +3 -0
- package/dist/lifecycle/commands/install.d.ts.map +1 -0
- package/dist/lifecycle/commands/install.js +263 -0
- package/dist/lifecycle/commands/install.js.map +1 -0
- package/dist/lifecycle/commands/operator-entry.d.ts +104 -0
- package/dist/lifecycle/commands/operator-entry.d.ts.map +1 -0
- package/dist/lifecycle/commands/operator-entry.js +127 -0
- package/dist/lifecycle/commands/operator-entry.js.map +1 -0
- package/dist/lifecycle/commands/operator-runtime.d.ts +147 -0
- package/dist/lifecycle/commands/operator-runtime.d.ts.map +1 -0
- package/dist/lifecycle/commands/operator-runtime.js +40 -0
- package/dist/lifecycle/commands/operator-runtime.js.map +1 -0
- package/dist/lifecycle/commands/status.d.ts +3 -0
- package/dist/lifecycle/commands/status.d.ts.map +1 -0
- package/dist/lifecycle/commands/status.js +108 -0
- package/dist/lifecycle/commands/status.js.map +1 -0
- package/dist/lifecycle/commands/uninstall.d.ts +3 -0
- package/dist/lifecycle/commands/uninstall.d.ts.map +1 -0
- package/dist/lifecycle/commands/uninstall.js +223 -0
- package/dist/lifecycle/commands/uninstall.js.map +1 -0
- package/dist/lifecycle/divergence-declaration.d.ts +74 -0
- package/dist/lifecycle/divergence-declaration.d.ts.map +1 -0
- package/dist/lifecycle/divergence-declaration.js +92 -0
- package/dist/lifecycle/divergence-declaration.js.map +1 -0
- package/dist/lifecycle/i18n/en.json +4 -0
- package/dist/lifecycle/i18n/pl.json +4 -0
- package/dist/lifecycle/index.d.ts +110 -0
- package/dist/lifecycle/index.d.ts.map +1 -0
- package/dist/lifecycle/index.js +189 -0
- package/dist/lifecycle/index.js.map +1 -0
- package/dist/lifecycle/manifest-registry.d.ts +244 -0
- package/dist/lifecycle/manifest-registry.d.ts.map +1 -0
- package/dist/lifecycle/manifest-registry.js +223 -0
- package/dist/lifecycle/manifest-registry.js.map +1 -0
- package/dist/lifecycle/manifest.d.ts +166 -0
- package/dist/lifecycle/manifest.d.ts.map +1 -0
- package/dist/lifecycle/manifest.js +121 -0
- package/dist/lifecycle/manifest.js.map +1 -0
- package/dist/lifecycle/plugin.d.ts +56 -0
- package/dist/lifecycle/plugin.d.ts.map +1 -0
- package/dist/lifecycle/plugin.js +59 -0
- package/dist/lifecycle/plugin.js.map +1 -0
- package/dist/lifecycle/resident.d.ts +16 -0
- package/dist/lifecycle/resident.d.ts.map +1 -0
- package/dist/lifecycle/resident.js +59 -0
- package/dist/lifecycle/resident.js.map +1 -0
- package/dist/lifecycle/routes.admin.d.ts +57 -0
- package/dist/lifecycle/routes.admin.d.ts.map +1 -0
- package/dist/lifecycle/routes.admin.js +162 -0
- package/dist/lifecycle/routes.admin.js.map +1 -0
- package/dist/lifecycle/routes.storefront.d.ts +26 -0
- package/dist/lifecycle/routes.storefront.d.ts.map +1 -0
- package/dist/lifecycle/routes.storefront.js +36 -0
- package/dist/lifecycle/routes.storefront.js.map +1 -0
- package/dist/lifecycle/services/deactivation-ledger.d.ts +216 -0
- package/dist/lifecycle/services/deactivation-ledger.d.ts.map +1 -0
- package/dist/lifecycle/services/deactivation-ledger.js +171 -0
- package/dist/lifecycle/services/deactivation-ledger.js.map +1 -0
- package/dist/lifecycle/services/dep-graph.d.ts +119 -0
- package/dist/lifecycle/services/dep-graph.d.ts.map +1 -0
- package/dist/lifecycle/services/dep-graph.js +334 -0
- package/dist/lifecycle/services/dep-graph.js.map +1 -0
- package/dist/lifecycle/services/gating-graph.d.ts +164 -0
- package/dist/lifecycle/services/gating-graph.d.ts.map +1 -0
- package/dist/lifecycle/services/gating-graph.js +203 -0
- package/dist/lifecycle/services/gating-graph.js.map +1 -0
- package/dist/lifecycle/services/lock.d.ts +27 -0
- package/dist/lifecycle/services/lock.d.ts.map +1 -0
- package/dist/lifecycle/services/lock.js +82 -0
- package/dist/lifecycle/services/lock.js.map +1 -0
- package/dist/lifecycle/services/manifest-loader.d.ts +125 -0
- package/dist/lifecycle/services/manifest-loader.d.ts.map +1 -0
- package/dist/lifecycle/services/manifest-loader.js +210 -0
- package/dist/lifecycle/services/manifest-loader.js.map +1 -0
- package/dist/lifecycle/services/migration-ownership.d.ts +36 -0
- package/dist/lifecycle/services/migration-ownership.d.ts.map +1 -0
- package/dist/lifecycle/services/migration-ownership.js +15 -0
- package/dist/lifecycle/services/migration-ownership.js.map +1 -0
- package/dist/lifecycle/services/module-id-claims.d.ts +38 -0
- package/dist/lifecycle/services/module-id-claims.d.ts.map +1 -0
- package/dist/lifecycle/services/module-id-claims.js +123 -0
- package/dist/lifecycle/services/module-id-claims.js.map +1 -0
- package/dist/lifecycle/services/module-origin.d.ts +55 -0
- package/dist/lifecycle/services/module-origin.d.ts.map +1 -0
- package/dist/lifecycle/services/module-origin.js +47 -0
- package/dist/lifecycle/services/module-origin.js.map +1 -0
- package/dist/lifecycle/services/orchestrator.d.ts +235 -0
- package/dist/lifecycle/services/orchestrator.d.ts.map +1 -0
- package/dist/lifecycle/services/orchestrator.js +954 -0
- package/dist/lifecycle/services/orchestrator.js.map +1 -0
- package/dist/lifecycle/services/presence-load.d.ts +281 -0
- package/dist/lifecycle/services/presence-load.d.ts.map +1 -0
- package/dist/lifecycle/services/presence-load.js +437 -0
- package/dist/lifecycle/services/presence-load.js.map +1 -0
- package/dist/lifecycle/services/static-registry.d.ts +47 -0
- package/dist/lifecycle/services/static-registry.d.ts.map +1 -0
- package/dist/lifecycle/services/static-registry.js +41 -0
- package/dist/lifecycle/services/static-registry.js.map +1 -0
- package/dist/migrations/20260424T165847_core_foundation_init.d.ts +25 -0
- package/dist/migrations/20260424T165847_core_foundation_init.d.ts.map +1 -0
- package/dist/migrations/20260424T165847_core_foundation_init.js +238 -0
- package/dist/migrations/20260424T165847_core_foundation_init.js.map +1 -0
- package/dist/migrations/20260425T050720_core_commerce_init.d.ts +19 -0
- package/dist/migrations/20260425T050720_core_commerce_init.d.ts.map +1 -0
- package/dist/migrations/20260425T050720_core_commerce_init.js +200 -0
- package/dist/migrations/20260425T050720_core_commerce_init.js.map +1 -0
- package/dist/migrations/20260430T101450_core_settings_init.d.ts +25 -0
- package/dist/migrations/20260430T101450_core_settings_init.d.ts.map +1 -0
- package/dist/migrations/20260430T101450_core_settings_init.js +113 -0
- package/dist/migrations/20260430T101450_core_settings_init.js.map +1 -0
- package/dist/migrations/20260430T170044_core_sales_channels_promote.d.ts +67 -0
- package/dist/migrations/20260430T170044_core_sales_channels_promote.d.ts.map +1 -0
- package/dist/migrations/20260430T170044_core_sales_channels_promote.js +101 -0
- package/dist/migrations/20260430T170044_core_sales_channels_promote.js.map +1 -0
- package/dist/migrations/20260506T200657_core_module_lifecycle_init.d.ts +21 -0
- package/dist/migrations/20260506T200657_core_module_lifecycle_init.d.ts.map +1 -0
- package/dist/migrations/20260506T200657_core_module_lifecycle_init.js +41 -0
- package/dist/migrations/20260506T200657_core_module_lifecycle_init.js.map +1 -0
- package/dist/migrations/20260514T111329_core_settings_global_value.d.ts +30 -0
- package/dist/migrations/20260514T111329_core_settings_global_value.d.ts.map +1 -0
- package/dist/migrations/20260514T111329_core_settings_global_value.js +34 -0
- package/dist/migrations/20260514T111329_core_settings_global_value.js.map +1 -0
- package/dist/migrations/20260611T140411_core_settings_secret_value_type.d.ts +26 -0
- package/dist/migrations/20260611T140411_core_settings_secret_value_type.d.ts.map +1 -0
- package/dist/migrations/20260611T140411_core_settings_secret_value_type.js +63 -0
- package/dist/migrations/20260611T140411_core_settings_secret_value_type.js.map +1 -0
- package/dist/migrations/20260611T140419_core_settings_enum_options.d.ts +19 -0
- package/dist/migrations/20260611T140419_core_settings_enum_options.d.ts.map +1 -0
- package/dist/migrations/20260611T140419_core_settings_enum_options.js +23 -0
- package/dist/migrations/20260611T140419_core_settings_enum_options.js.map +1 -0
- package/dist/migrations/20260629T090100_core_settings_hidden_flag.d.ts +20 -0
- package/dist/migrations/20260629T090100_core_settings_hidden_flag.d.ts.map +1 -0
- package/dist/migrations/20260629T090100_core_settings_hidden_flag.js +24 -0
- package/dist/migrations/20260629T090100_core_settings_hidden_flag.js.map +1 -0
- package/dist/migrations/20260717T134752_core_tenant_scope_indexes.d.ts +27 -0
- package/dist/migrations/20260717T134752_core_tenant_scope_indexes.d.ts.map +1 -0
- package/dist/migrations/20260717T134752_core_tenant_scope_indexes.js +32 -0
- package/dist/migrations/20260717T134752_core_tenant_scope_indexes.js.map +1 -0
- package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.d.ts +24 -0
- package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.d.ts.map +1 -0
- package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.js +57 -0
- package/dist/migrations/20260721T011510_core_settings_credential_ref_value_type.js.map +1 -0
- package/dist/migrations/20260816T203339_core_retire_core_activation_settings.d.ts +39 -0
- package/dist/migrations/20260816T203339_core_retire_core_activation_settings.d.ts.map +1 -0
- package/dist/migrations/20260816T203339_core_retire_core_activation_settings.js +59 -0
- package/dist/migrations/20260816T203339_core_retire_core_activation_settings.js.map +1 -0
- package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.d.ts +34 -0
- package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.d.ts.map +1 -0
- package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.js +38 -0
- package/dist/migrations/20260919T101500_core_module_registrations_boot_converged.js.map +1 -0
- package/dist/migrations/baseline-migrations.generated.d.ts +2 -0
- package/dist/migrations/baseline-migrations.generated.d.ts.map +1 -0
- package/dist/migrations/baseline-migrations.generated.js +136 -0
- package/dist/migrations/baseline-migrations.generated.js.map +1 -0
- package/dist/migrations/index.d.ts +62 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +75 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/overlay/deployment-roots.d.ts +37 -0
- package/dist/overlay/deployment-roots.d.ts.map +1 -0
- package/dist/overlay/deployment-roots.js +90 -0
- package/dist/overlay/deployment-roots.js.map +1 -0
- package/dist/overlay/index.d.ts +62 -0
- package/dist/overlay/index.d.ts.map +1 -0
- package/dist/overlay/index.js +62 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/overlay/overlay-runtime.d.ts +173 -0
- package/dist/overlay/overlay-runtime.d.ts.map +1 -0
- package/dist/overlay/overlay-runtime.js +281 -0
- package/dist/overlay/overlay-runtime.js.map +1 -0
- package/dist/overlay/resolve-overlay.d.ts +41 -0
- package/dist/overlay/resolve-overlay.d.ts.map +1 -0
- package/dist/overlay/resolve-overlay.js +72 -0
- package/dist/overlay/resolve-overlay.js.map +1 -0
- package/dist/packages/index.d.ts +57 -0
- package/dist/packages/index.d.ts.map +1 -0
- package/dist/packages/index.js +57 -0
- package/dist/packages/index.js.map +1 -0
- package/dist/packages/installed-packages.d.ts +79 -0
- package/dist/packages/installed-packages.d.ts.map +1 -0
- package/dist/packages/installed-packages.js +312 -0
- package/dist/packages/installed-packages.js.map +1 -0
- package/dist/packages/package-entity-lookup.d.ts +120 -0
- package/dist/packages/package-entity-lookup.d.ts.map +1 -0
- package/dist/packages/package-entity-lookup.js +17 -0
- package/dist/packages/package-entity-lookup.js.map +1 -0
- package/dist/packages/package-runtime.d.ts +177 -0
- package/dist/packages/package-runtime.d.ts.map +1 -0
- package/dist/packages/package-runtime.js +386 -0
- package/dist/packages/package-runtime.js.map +1 -0
- package/dist/tenancy/derived-scope.d.ts +43 -0
- package/dist/tenancy/derived-scope.d.ts.map +1 -0
- package/dist/tenancy/derived-scope.js +76 -0
- package/dist/tenancy/derived-scope.js.map +1 -0
- package/dist/tenancy/escape-hatch.d.ts +30 -0
- package/dist/tenancy/escape-hatch.d.ts.map +1 -0
- package/dist/tenancy/escape-hatch.js +50 -0
- package/dist/tenancy/escape-hatch.js.map +1 -0
- package/dist/tenancy/filters.d.ts +87 -0
- package/dist/tenancy/filters.d.ts.map +1 -0
- package/dist/tenancy/filters.js +126 -0
- package/dist/tenancy/filters.js.map +1 -0
- package/dist/tenancy/index.d.ts +63 -0
- package/dist/tenancy/index.d.ts.map +1 -0
- package/dist/tenancy/index.js +61 -0
- package/dist/tenancy/index.js.map +1 -0
- package/dist/tenancy/org-scoped.decorator.d.ts +150 -0
- package/dist/tenancy/org-scoped.decorator.d.ts.map +1 -0
- package/dist/tenancy/org-scoped.decorator.js +339 -0
- package/dist/tenancy/org-scoped.decorator.js.map +1 -0
- package/dist/tenancy/org-write-guard.d.ts +106 -0
- package/dist/tenancy/org-write-guard.d.ts.map +1 -0
- package/dist/tenancy/org-write-guard.js +141 -0
- package/dist/tenancy/org-write-guard.js.map +1 -0
- package/dist/tenancy/resolve-tenant-context.d.ts +91 -0
- package/dist/tenancy/resolve-tenant-context.d.ts.map +1 -0
- package/dist/tenancy/resolve-tenant-context.js +85 -0
- package/dist/tenancy/resolve-tenant-context.js.map +1 -0
- package/dist/tenancy/scoped-em.d.ts +10 -0
- package/dist/tenancy/scoped-em.d.ts.map +1 -0
- package/dist/tenancy/scoped-em.js +11 -0
- package/dist/tenancy/scoped-em.js.map +1 -0
- package/dist/tenancy/tenant-context.d.ts +154 -0
- package/dist/tenancy/tenant-context.d.ts.map +1 -0
- package/dist/tenancy/tenant-context.js +109 -0
- package/dist/tenancy/tenant-context.js.map +1 -0
- package/package.json +123 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { readdirSync, statSync, existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, basename, resolve, join, sep } from 'node:path';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
import { ModuleManifestSchema, } from '@endora-commerce/contracts';
|
|
5
|
+
import { ModuleDepGraph } from './dep-graph.js';
|
|
6
|
+
/**
|
|
7
|
+
* Collect the participants declared by a set of loaded entries.
|
|
8
|
+
*
|
|
9
|
+
* Sorted by module id so the order a projection is written in is a property of
|
|
10
|
+
* the platform rather than of whichever walk produced the map.
|
|
11
|
+
*/
|
|
12
|
+
export function collectLifecycleParticipants(entries) {
|
|
13
|
+
const found = [];
|
|
14
|
+
for (const entry of entries) {
|
|
15
|
+
if (entry.lifecycleParticipant) {
|
|
16
|
+
found.push({ moduleId: entry.manifest.id, participant: entry.lifecycleParticipant });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return found.sort((a, b) => a.moduleId.localeCompare(b.moduleId));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The manifest in one module folder, or `null` when the folder holds none.
|
|
23
|
+
*
|
|
24
|
+
* Two spellings for one file: `manifest.js` in a compiled tree,
|
|
25
|
+
* `manifest.ts` under `tsx` and `vitest`. This walk used to spell `.ts` into an
|
|
26
|
+
* `existsSync` and `continue` past a folder that failed it, so pointed at a
|
|
27
|
+
* built tree it discovered **nothing** and reported an empty registry — the
|
|
28
|
+
* absent-path-as-absent-feature shape this repository keeps finding (feature
|
|
29
|
+
* 080, D-165 step C). `null` still means "this folder is not a module", which is
|
|
30
|
+
* how a non-module directory under the root is skipped; what it no longer means
|
|
31
|
+
* is "this module was compiled".
|
|
32
|
+
*
|
|
33
|
+
* Compiled first, for the reason `manifest-locations.ts` gives about the same
|
|
34
|
+
* pair: the compiled tree is the one where picking up a stray source file
|
|
35
|
+
* beside it would be wrong.
|
|
36
|
+
*/
|
|
37
|
+
function moduleManifestIn(moduleDir) {
|
|
38
|
+
for (const extension of ['.js', '.ts']) {
|
|
39
|
+
const candidate = join(moduleDir, `manifest${extension}`);
|
|
40
|
+
if (existsSync(candidate))
|
|
41
|
+
return candidate;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
export class ManifestLoadError extends Error {
|
|
46
|
+
kind;
|
|
47
|
+
constructor(kind, message) {
|
|
48
|
+
super(message);
|
|
49
|
+
this.kind = kind;
|
|
50
|
+
this.name = 'ManifestLoadError';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Discover every `manifest.ts` under `modulesRoot/<id>/manifest.ts` and
|
|
55
|
+
* dynamically import each module. Returns the validated registry plus
|
|
56
|
+
* the dep graph derived from declarations.
|
|
57
|
+
*
|
|
58
|
+
* Production builds may swap this loader for a generated
|
|
59
|
+
* `manifest-index.ts` that imports the same modules eagerly — this
|
|
60
|
+
* runtime path is for dev/test where the file system is the source of
|
|
61
|
+
* truth.
|
|
62
|
+
*
|
|
63
|
+
* **Identity here is the directory name, and that scopes this loader** (feature
|
|
64
|
+
* 080, T032). It walks a tree this repository lays out, where Principle VI says
|
|
65
|
+
* `<id>/manifest.ts` — so the folder name is a claim about the id and a
|
|
66
|
+
* disagreement is a defect. An **installed package** has neither property: its
|
|
67
|
+
* directory is its npm name (`@endora-commerce/mod-blog`), and its identity is
|
|
68
|
+
* the `endora.id` field of its `package.json` (D-142), checked against its
|
|
69
|
+
* manifest by `src/packages/package-runtime.ts`. Pointing this loader at a
|
|
70
|
+
* `node_modules` is therefore refused outright rather than walked — see
|
|
71
|
+
* {@link ManifestLoadError} kind `package-root`. Without that refusal the walk
|
|
72
|
+
* happens to work and then reports `folder-id-mismatch`, which blames a vendor
|
|
73
|
+
* for naming their package correctly and sends the reader to fix the one thing
|
|
74
|
+
* that is right.
|
|
75
|
+
*/
|
|
76
|
+
export async function discoverManifests(opts) {
|
|
77
|
+
const root = resolve(opts.modulesRoot);
|
|
78
|
+
// Before the walk, not inside it: a `node_modules` must not be readable as a
|
|
79
|
+
// modules tree at all, whatever it happens to contain.
|
|
80
|
+
if (root.split(sep).includes('node_modules')) {
|
|
81
|
+
throw new ManifestLoadError('package-root', `${root} is inside a node_modules tree, and this loader derives a module's id from its ` +
|
|
82
|
+
`folder name. An installed package's folder is its npm name and its id is the ` +
|
|
83
|
+
`"endora.id" field of its package.json (D-142), so discovering one here would either ` +
|
|
84
|
+
`refuse it as a folder-id-mismatch or give it the wrong id. Use ` +
|
|
85
|
+
`loadPackageModuleEntries / discoverPackageModuleManifests (src/packages/) instead.`);
|
|
86
|
+
}
|
|
87
|
+
const exclude = new Set(opts.exclude ?? []);
|
|
88
|
+
const candidates = [];
|
|
89
|
+
if (opts.include && opts.include.length > 0) {
|
|
90
|
+
for (const sub of opts.include)
|
|
91
|
+
candidates.push(sub);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
for (const entry of readdirSync(root)) {
|
|
95
|
+
if (exclude.has(entry))
|
|
96
|
+
continue;
|
|
97
|
+
const full = join(root, entry);
|
|
98
|
+
if (!statSync(full).isDirectory())
|
|
99
|
+
continue;
|
|
100
|
+
candidates.push(entry);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const modules = new Map();
|
|
104
|
+
for (const folderName of candidates) {
|
|
105
|
+
const filePath = moduleManifestIn(join(root, folderName));
|
|
106
|
+
if (filePath === null)
|
|
107
|
+
continue;
|
|
108
|
+
let imported;
|
|
109
|
+
try {
|
|
110
|
+
imported = (await import(pathToFileURL(filePath).href));
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
throw new ManifestLoadError('parse-failed', `failed to import manifest at ${filePath}: ` +
|
|
114
|
+
(err instanceof Error ? err.message : String(err)));
|
|
115
|
+
}
|
|
116
|
+
const manifest = imported.manifest;
|
|
117
|
+
if (!manifest) {
|
|
118
|
+
throw new ManifestLoadError('parse-failed', `manifest.ts at ${filePath} does not export a "manifest" constant`);
|
|
119
|
+
}
|
|
120
|
+
// Re-parse defensively — `defineModuleManifest` already validates,
|
|
121
|
+
// but a hand-rolled export might not have used the helper.
|
|
122
|
+
const parsed = ModuleManifestSchema.parse(manifest);
|
|
123
|
+
if (parsed.id !== folderName) {
|
|
124
|
+
throw new ManifestLoadError('folder-id-mismatch', `manifest at ${filePath} declares id "${parsed.id}" but lives in ` +
|
|
125
|
+
`folder "${folderName}" — in a directory-named module tree they MUST match ` +
|
|
126
|
+
`(Principle VI). An installed package is the other case and never reaches here: ` +
|
|
127
|
+
`its id is its "endora.id" field, not its folder.`);
|
|
128
|
+
}
|
|
129
|
+
if (parsed.dependencies.includes(parsed.id)) {
|
|
130
|
+
throw new ManifestLoadError('self-dep', `manifest "${parsed.id}" depends on itself.`);
|
|
131
|
+
}
|
|
132
|
+
const existing = modules.get(parsed.id);
|
|
133
|
+
if (existing) {
|
|
134
|
+
throw new ManifestLoadError('duplicate-id', `manifest id "${parsed.id}" is declared by both ` +
|
|
135
|
+
`${existing.filePath} and ${filePath}.`);
|
|
136
|
+
}
|
|
137
|
+
if (parsed.settings && parsed.settings.moduleCode !== parsed.id) {
|
|
138
|
+
throw new ManifestLoadError('parse-failed', `manifest "${parsed.id}" carries a settings manifest with ` +
|
|
139
|
+
`moduleCode "${parsed.settings.moduleCode}" — must match.`);
|
|
140
|
+
}
|
|
141
|
+
modules.set(parsed.id, {
|
|
142
|
+
manifest: parsed,
|
|
143
|
+
filePath,
|
|
144
|
+
...(imported.installHook ? { installHook: imported.installHook } : {}),
|
|
145
|
+
...(imported.uninstallHook ? { uninstallHook: imported.uninstallHook } : {}),
|
|
146
|
+
...(imported.lifecycleParticipant
|
|
147
|
+
? { lifecycleParticipant: imported.lifecycleParticipant }
|
|
148
|
+
: {}),
|
|
149
|
+
...(imported.recentActivity ? { recentActivity: imported.recentActivity } : {}),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
// Verify every dependency points to a known module before building
|
|
153
|
+
// the graph (cycles in subgraphs of unknown nodes would mask).
|
|
154
|
+
for (const entry of modules.values()) {
|
|
155
|
+
for (const dep of entry.manifest.dependencies) {
|
|
156
|
+
if (!modules.has(dep)) {
|
|
157
|
+
throw new ManifestLoadError('orphan-dep', `manifest "${entry.manifest.id}" depends on "${dep}" but no ` +
|
|
158
|
+
`manifest with that id was discovered under ${root}.`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const graph = new ModuleDepGraph([...modules.values()].map((e) => e.manifest));
|
|
163
|
+
const cycle = graph.hasCycle();
|
|
164
|
+
if (cycle) {
|
|
165
|
+
throw new ManifestLoadError('cycle', `cycle detected in module dependency graph: [${cycle.cycle.join(' → ')}]`);
|
|
166
|
+
}
|
|
167
|
+
return { modules, graph, participants: collectLifecycleParticipants(modules.values()) };
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Convenience for tests: resolve `modulesRoot` relative to a test file.
|
|
171
|
+
* Avoids hard-coding paths that break under different working dirs.
|
|
172
|
+
*/
|
|
173
|
+
export function resolveFromFile(metaUrl, relative) {
|
|
174
|
+
return resolve(dirname(fileURLToPath(metaUrl)), relative);
|
|
175
|
+
}
|
|
176
|
+
/** Test helper — assert that a value is one of the known load-error kinds. */
|
|
177
|
+
export function isLoadError(err) {
|
|
178
|
+
return err instanceof ManifestLoadError;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Production loader entry point: scans the project's
|
|
182
|
+
* `backend/src/modules` for every `manifest.ts`. Skips the fixtures
|
|
183
|
+
* trees under `test/`. Used by `composition.ts` at boot.
|
|
184
|
+
*/
|
|
185
|
+
export async function loadProjectManifests(modulesRoot) {
|
|
186
|
+
return discoverManifests({
|
|
187
|
+
modulesRoot,
|
|
188
|
+
exclude: [],
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* The folder name a **directory-named** module's id comes from.
|
|
193
|
+
*
|
|
194
|
+
* It answers for the anchor {@link discoverManifests} produces — a
|
|
195
|
+
* `manifest.ts` under `<modules root>/<id>/`. It refuses a `package.json`
|
|
196
|
+
* anchor, which is what a resolved package entry's `filePath` is (feature 080,
|
|
197
|
+
* T032): `basename(dirname(...))` would answer `mod-blog`, the tail of an npm
|
|
198
|
+
* name, which is neither the module id nor even unique without the `@scope`
|
|
199
|
+
* this drops. A confident wrong answer is worse than a refusal — a package's id
|
|
200
|
+
* is its `endora.id`, and `resolvedManifestEntries()` already carries it.
|
|
201
|
+
*/
|
|
202
|
+
export function folderNameFromPath(filePath) {
|
|
203
|
+
if (basename(filePath) === 'package.json') {
|
|
204
|
+
throw new ManifestLoadError('package-root', `${filePath} is a package.json, so it anchors an installed package rather than a ` +
|
|
205
|
+
`directory-named module. A package's id is its "endora.id" field (D-142), not its ` +
|
|
206
|
+
`folder name; read it from the manifest entry instead of deriving it from the path.`);
|
|
207
|
+
}
|
|
208
|
+
return basename(dirname(filePath));
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=manifest-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest-loader.js","sourceRoot":"","sources":["../../../src/lifecycle/services/manifest-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EACL,oBAAoB,GAOrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAoDhD;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAA2C;IAE3C,MAAM,KAAK,GAAqC,EAAE,CAAC;IACnD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,oBAAoB,EAAE,CAAC;YAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,oBAAoB,EAAE,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;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AE,KAAK,EAAE,YAAY,EAAE,4BAA4B,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;AAC1F,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,QAAgB;IAC/D,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CACzB,GAAY;IAEZ,OAAO,GAAG,YAAY,iBAAiB,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,WAAmB;IAEnB,OAAO,iBAAiB,CAAQ;QAC9B,WAAW;QACX,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,cAAc,EAAE,CAAC;QAC1C,MAAM,IAAI,iBAAiB,CACzB,cAAc,EACd,GAAG,QAAQ,uEAAuE;YAChF,mFAAmF;YACnF,oFAAoF,CACvF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which module owns which migration — the question `uninstall --hard` reverts
|
|
3
|
+
* by, declared where the orchestrator that asks it lives (feature 080,
|
|
4
|
+
* D-160.11).
|
|
5
|
+
*
|
|
6
|
+
* The **answer** is the host application's: it is merged from the committed
|
|
7
|
+
* core registry plus whatever extension packages this instance installed, which
|
|
8
|
+
* only a composition root knows. That merge stays in
|
|
9
|
+
* `backend/src/db/configured-migrations.ts`, which re-exports this type so the
|
|
10
|
+
* host's callers keep one name for it. What moved here is the *shape*, because
|
|
11
|
+
* a platform file may not name a file the host owns (D-52/D-53) and the
|
|
12
|
+
* orchestrator's whole use of it is `deps.migrationOwnership`.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Which module owns which migration, and — the part that has to be a separate
|
|
16
|
+
* question — whether this registry is in a position to answer at all.
|
|
17
|
+
*
|
|
18
|
+
* `null` from {@link MigrationOwnership.migrationNamesFor} means *"I cannot
|
|
19
|
+
* answer for that module"*, and an empty array means *"that module owns no
|
|
20
|
+
* migration"*. Collapsing the two is the fail-open the lifecycle orchestrator
|
|
21
|
+
* shipped: a package whose entries the orchestrator could not see
|
|
22
|
+
* hard-uninstalled to a **warning** and left its table in the database
|
|
23
|
+
* (D-155.3(c)). The return type is where the distinction lives, in the idiom
|
|
24
|
+
* `allowedIdsFor(): Promise<string[] | null>` already uses in this tree —
|
|
25
|
+
* a caller cannot forget to ask, because `null` is not a list of names.
|
|
26
|
+
*/
|
|
27
|
+
export interface MigrationOwnership {
|
|
28
|
+
/**
|
|
29
|
+
* Migration class names owned by `moduleId`, ascending by class name, or
|
|
30
|
+
* `null` when this registry covers no module of that name.
|
|
31
|
+
*/
|
|
32
|
+
migrationNamesFor(moduleId: string): readonly string[] | null;
|
|
33
|
+
/** The modules this registry can answer for. Named in the refusal message. */
|
|
34
|
+
readonly coveredModuleIds: ReadonlySet<string>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=migration-ownership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-ownership.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/services/migration-ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9D,8EAA8E;IAC9E,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which module owns which migration — the question `uninstall --hard` reverts
|
|
3
|
+
* by, declared where the orchestrator that asks it lives (feature 080,
|
|
4
|
+
* D-160.11).
|
|
5
|
+
*
|
|
6
|
+
* The **answer** is the host application's: it is merged from the committed
|
|
7
|
+
* core registry plus whatever extension packages this instance installed, which
|
|
8
|
+
* only a composition root knows. That merge stays in
|
|
9
|
+
* `backend/src/db/configured-migrations.ts`, which re-exports this type so the
|
|
10
|
+
* host's callers keep one name for it. What moved here is the *shape*, because
|
|
11
|
+
* a platform file may not name a file the host owns (D-52/D-53) and the
|
|
12
|
+
* orchestrator's whole use of it is `deps.migrationOwnership`.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=migration-ownership.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-ownership.js","sourceRoot":"","sources":["../../../src/lifecycle/services/migration-ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type { ModuleIdClaimOrigin } from './module-origin.js';
|
|
2
|
+
import type { ModuleIdClaimOrigin } from './module-origin.js';
|
|
3
|
+
export interface ModuleIdClaim {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly origin: ModuleIdClaimOrigin;
|
|
6
|
+
/**
|
|
7
|
+
* The file that claims the id: `manifest.ts` for a core or overlay module,
|
|
8
|
+
* the resolved `package.json` for an installed package. It is the whole
|
|
9
|
+
* remedy — an operator can only act on a path.
|
|
10
|
+
*/
|
|
11
|
+
readonly claimedBy: string;
|
|
12
|
+
/** The npm package name, where there is one. */
|
|
13
|
+
readonly name?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ModuleIdCollision {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/** Every claimant, in the order they were offered. */
|
|
18
|
+
readonly claims: readonly ModuleIdClaim[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Every module id claimed by more than one source, whatever those sources are.
|
|
22
|
+
*
|
|
23
|
+
* There is no qualifier. There used to be one — *"where at least one of them is
|
|
24
|
+
* an installed package"* — and it excluded exactly the pair feature 103 is
|
|
25
|
+
* about: a core id and an overlay id, which had a shipped answer of its own
|
|
26
|
+
* (drop the overlay) resting on a shadowing reading D-201 retires. A module id
|
|
27
|
+
* is one identity with one owner, and which two sources happen to claim it says
|
|
28
|
+
* nothing about whether the platform can run.
|
|
29
|
+
*/
|
|
30
|
+
export declare function moduleIdCollisions(claims: readonly ModuleIdClaim[]): ModuleIdCollision[];
|
|
31
|
+
/** The refusal. A distinct type, per D-101's rule that absence refusals stay distinct. */
|
|
32
|
+
export declare class ModuleIdCollisionError extends Error {
|
|
33
|
+
readonly collisions: readonly ModuleIdCollision[];
|
|
34
|
+
constructor(collisions: readonly ModuleIdCollision[]);
|
|
35
|
+
}
|
|
36
|
+
/** {@link moduleIdCollisions}, as the refusal a composition root makes. */
|
|
37
|
+
export declare function assertNoModuleIdCollisions(claims: readonly ModuleIdClaim[]): void;
|
|
38
|
+
//# sourceMappingURL=module-id-claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-id-claims.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/services/module-id-claims.ts"],"names":[],"mappings":"AAqEA,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;CAC3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,iBAAiB,EAAE,CAcxF;AAED,0FAA0F;AAC1F,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;gBAEtC,UAAU,EAAE,SAAS,iBAAiB,EAAE;CAKrD;AAkDD,2EAA2E;AAC3E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAGjF"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// Module id collisions (T030c, D-155.7; widened to the overlay by feature 103).
|
|
2
|
+
//
|
|
3
|
+
// A module id is the platform's identity for a module: migrations are ordered
|
|
4
|
+
// and reverted by it, permissions and settings are namespaced by it, and the
|
|
5
|
+
// lifecycle registry is keyed on it. Nothing refused a second claimant on the
|
|
6
|
+
// path a package takes, and the consequences were not theoretical:
|
|
7
|
+
//
|
|
8
|
+
// - `composeModules` had no id-uniqueness assertion, so both entries
|
|
9
|
+
// composed. What surfaced — if anything did — was a
|
|
10
|
+
// `DuplicateRegistrationError` naming the registration key and the module
|
|
11
|
+
// id twice, and neither vendor. Two claimants registering disjoint names
|
|
12
|
+
// collided on nothing at all.
|
|
13
|
+
// - `resolvedManifestEntries` is a `Map` keyed by id: core won silently and
|
|
14
|
+
// among the rest the last writer won, silently. So the manifest set carried
|
|
15
|
+
// one module while the container ran two.
|
|
16
|
+
// - `buildStaticRegistry` does throw the right refusal, and was reached only
|
|
17
|
+
// by the `module:*` CLI scripts, each of which fed bare-core
|
|
18
|
+
// `REGISTERED_MANIFESTS`. The right refusal, wired where a package could not
|
|
19
|
+
// reach it. Since T036 those five read the resolved set — but they reach
|
|
20
|
+
// *this* file's refusal, not that one, because the resolver keys a `Map` by
|
|
21
|
+
// id and no duplicate survives to `buildStaticRegistry`. That is the better
|
|
22
|
+
// of the two: this one still holds both vendors and can name them.
|
|
23
|
+
//
|
|
24
|
+
// Two vendors' `blog` packages therefore produced correctly-scoped,
|
|
25
|
+
// differently-stamped migration class names — no `duplicate-name`, no
|
|
26
|
+
// `unscoped-name` — and `orderMigrations` merged two strangers' chains into one
|
|
27
|
+
// contiguous block under one id. A hard uninstall of `blog` reverted both,
|
|
28
|
+
// because `revertMigrationsFor` filters on `moduleId` and nothing downstream
|
|
29
|
+
// can tell the two apart.
|
|
30
|
+
//
|
|
31
|
+
// `specs/081-per-module-migration-order/contracts/migration-identity.md` §2
|
|
32
|
+
// already argues its sufficiency from *"the lifecycle refuses a second module
|
|
33
|
+
// claiming an id"*. This file, and `kernel/lifecycle/unique-module-ids.ts`, are
|
|
34
|
+
// what make that sentence true.
|
|
35
|
+
//
|
|
36
|
+
// **Why the refusal is placed twice.** Discovery is the only layer that still
|
|
37
|
+
// holds both vendors — by `composeModules` an entry is an id, a version and a
|
|
38
|
+
// function — so this is where the message that names both `package.json` paths
|
|
39
|
+
// can be written. The composition seam is where the guarantee becomes
|
|
40
|
+
// structural for *any* entry source rather than a property of one loader.
|
|
41
|
+
//
|
|
42
|
+
// **The population is every claimant, not only a package's** (feature 103,
|
|
43
|
+
// FR-004). It used to be "at least one claimant is an installed package",
|
|
44
|
+
// because an overlay claiming a core id had a different, shipped answer: the
|
|
45
|
+
// overlay was dropped, on the reading that a deployment shadowing a module it
|
|
46
|
+
// authored is what the overlay mechanism is for. File shadowing is retired
|
|
47
|
+
// (D-201), so that reading has no referent left — and the drop was never the
|
|
48
|
+
// whole answer anyway. `resolvedManifestEntries` dropped the manifest while
|
|
49
|
+
// `overlayModuleEntriesUnder` composed the module, so a deployment could run a
|
|
50
|
+
// module the resolved registry did not know about: no `module_registrations`
|
|
51
|
+
// row, no permission-catalogue entry, and routes gated on the effective state
|
|
52
|
+
// of somebody else's module of the same id. One rule, reached by both readers,
|
|
53
|
+
// is what replaces it.
|
|
54
|
+
/**
|
|
55
|
+
* Every module id claimed by more than one source, whatever those sources are.
|
|
56
|
+
*
|
|
57
|
+
* There is no qualifier. There used to be one — *"where at least one of them is
|
|
58
|
+
* an installed package"* — and it excluded exactly the pair feature 103 is
|
|
59
|
+
* about: a core id and an overlay id, which had a shipped answer of its own
|
|
60
|
+
* (drop the overlay) resting on a shadowing reading D-201 retires. A module id
|
|
61
|
+
* is one identity with one owner, and which two sources happen to claim it says
|
|
62
|
+
* nothing about whether the platform can run.
|
|
63
|
+
*/
|
|
64
|
+
export function moduleIdCollisions(claims) {
|
|
65
|
+
const byId = new Map();
|
|
66
|
+
for (const claim of claims) {
|
|
67
|
+
const existing = byId.get(claim.id);
|
|
68
|
+
if (existing)
|
|
69
|
+
existing.push(claim);
|
|
70
|
+
else
|
|
71
|
+
byId.set(claim.id, [claim]);
|
|
72
|
+
}
|
|
73
|
+
const collisions = [];
|
|
74
|
+
for (const [id, claimants] of byId) {
|
|
75
|
+
if (claimants.length < 2)
|
|
76
|
+
continue;
|
|
77
|
+
collisions.push({ id, claims: claimants });
|
|
78
|
+
}
|
|
79
|
+
return collisions;
|
|
80
|
+
}
|
|
81
|
+
/** The refusal. A distinct type, per D-101's rule that absence refusals stay distinct. */
|
|
82
|
+
export class ModuleIdCollisionError extends Error {
|
|
83
|
+
collisions;
|
|
84
|
+
constructor(collisions) {
|
|
85
|
+
super(refusalMessage(collisions));
|
|
86
|
+
this.name = 'ModuleIdCollisionError';
|
|
87
|
+
this.collisions = collisions;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const ORIGIN_LABEL = {
|
|
91
|
+
core: 'a core module',
|
|
92
|
+
overlay: "this deployment's overlay",
|
|
93
|
+
package: 'an installed package',
|
|
94
|
+
};
|
|
95
|
+
function refusalMessage(collisions) {
|
|
96
|
+
const lines = [
|
|
97
|
+
'This instance will not start: more than one module claims the same module id.',
|
|
98
|
+
'',
|
|
99
|
+
];
|
|
100
|
+
for (const collision of collisions) {
|
|
101
|
+
lines.push(` ${collision.id} — claimed by ${collision.claims.length}:`);
|
|
102
|
+
for (const claim of collision.claims) {
|
|
103
|
+
lines.push(` ${ORIGIN_LABEL[claim.origin]}${claim.name ? ` (${claim.name})` : ''}`, ` ${claim.claimedBy}`);
|
|
104
|
+
}
|
|
105
|
+
lines.push('');
|
|
106
|
+
}
|
|
107
|
+
lines.push('A module id is the platform\'s identity for a module: migrations are ordered and reverted', 'by it, settings and permissions are namespaced by it, and the lifecycle registry is keyed', 'on it. Two claimants cannot be told apart afterwards — a hard uninstall of the id would', 'revert both vendors\' migrations — so this is refused rather than resolved by picking one.', '');
|
|
108
|
+
const origins = new Set(collisions.flatMap((collision) => collision.claims.map((claim) => claim.origin)));
|
|
109
|
+
if (origins.has('package')) {
|
|
110
|
+
lines.push('remedy: `pnpm remove` one of the packages above, or ask its author to change `endora.id`.', 'The npm package name is not the identity (D-142) and renaming it changes nothing here.');
|
|
111
|
+
}
|
|
112
|
+
if (origins.has('overlay')) {
|
|
113
|
+
lines.push("remedy: give the overlay module above an id of this deployment's own. An overlay module", 'is an additive, client-only module (D-103); it does not replace, extend or shadow the', 'module whose id it took — file shadowing is retired (D-201) — so sharing an id buys it', 'nothing and costs it its registry row, its settings and its permissions.');
|
|
114
|
+
}
|
|
115
|
+
return lines.join('\n');
|
|
116
|
+
}
|
|
117
|
+
/** {@link moduleIdCollisions}, as the refusal a composition root makes. */
|
|
118
|
+
export function assertNoModuleIdCollisions(claims) {
|
|
119
|
+
const collisions = moduleIdCollisions(claims);
|
|
120
|
+
if (collisions.length > 0)
|
|
121
|
+
throw new ModuleIdCollisionError(collisions);
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=module-id-claims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-id-claims.js","sourceRoot":"","sources":["../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EAAE,CAAC,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,IAAI,CACR,2FAA2F,EAC3F,2FAA2F,EAC3F,yFAAyF,EACzF,4FAA4F,EAC5F,EAAE,CACH,CAAC;IACF,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CACjF,CAAC;IACF,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CACR,2FAA2F,EAC3F,wFAAwF,CACzF,CAAC;IACJ,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CACR,yFAAyF,EACzF,uFAAuF,EACvF,wFAAwF,EACxF,0EAA0E,CAC3E,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,0BAA0B,CAAC,MAAgC;IACzE,MAAM,UAAU,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC9C,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which discovery produced a module entry, and the one split that is taken from
|
|
3
|
+
* it (feature 080, D-160.11).
|
|
4
|
+
*
|
|
5
|
+
* It was declared in `backend/src/packages/module-id-claims.ts` and re-exported
|
|
6
|
+
* through the host's manifest registry, which is a reach out of the platform
|
|
7
|
+
* into the host application: the presence load types
|
|
8
|
+
* `ShippedModuleEntry.origin` on it and narrows the first-boot insert
|
|
9
|
+
* population with {@link deploymentShippedEntries}, and both of those are the
|
|
10
|
+
* platform's. The **claims** machinery — who claimed an id, from which
|
|
11
|
+
* `package.json`, and the refusal naming both — stays host-side, because it is
|
|
12
|
+
* about runtime package discovery, which the host owns (D-119/D-155).
|
|
13
|
+
*
|
|
14
|
+
* There is deliberately no `'installed'` beside `'package'` and no containment
|
|
15
|
+
* test that could produce one. A workspace module package and an installed one
|
|
16
|
+
* are the same directory shape, and in a deployed build both resolve under
|
|
17
|
+
* `node_modules`; what separates them is which discovery produced the entry,
|
|
18
|
+
* which is known at construction and nowhere else.
|
|
19
|
+
*/
|
|
20
|
+
import type { ModuleManifest } from '@endora-commerce/contracts';
|
|
21
|
+
/** Where a claim on a module id came from. */
|
|
22
|
+
export type ModuleIdClaimOrigin = 'core' | 'overlay' | 'package';
|
|
23
|
+
/**
|
|
24
|
+
* The entries **this build ships**: core plus the deployment's overlay modules,
|
|
25
|
+
* never an installed package.
|
|
26
|
+
*
|
|
27
|
+
* The single spelling of D-157.6(b)'s split, because it has two readers and a
|
|
28
|
+
* derived fact written down twice is two answers waiting to disagree (D-100).
|
|
29
|
+
* Both readers converge state at boot for a module nobody ran a command for,
|
|
30
|
+
* and both must stop at the same line:
|
|
31
|
+
*
|
|
32
|
+
* - `firstBootInsertPopulation` — the `module_registrations` insert. A package
|
|
33
|
+
* converged here is a package `module:install` will answer
|
|
34
|
+
* `already-installed` about, having applied none of its migrations.
|
|
35
|
+
* - the **boot settings reconcile** (`composition.ts`, and the harness beside
|
|
36
|
+
* it). An overlay module has no `install` at all, so boot is the only author
|
|
37
|
+
* its activation Setting can have; a package has exactly one author,
|
|
38
|
+
* `install`, which reconciles its settings inside the operation that also
|
|
39
|
+
* runs its migrations. Reconciling a package's manifest at boot would let a
|
|
40
|
+
* `SettingCodeConflict` in something an operator merely `pnpm add`ed abort
|
|
41
|
+
* the platform's start.
|
|
42
|
+
*
|
|
43
|
+
* Generic over the entry, so a caller keeps whatever fields it had: the presence
|
|
44
|
+
* load hands it `{ manifest, filePath }` and a composition root hands it whole
|
|
45
|
+
* `RegisteredManifestEntry` values.
|
|
46
|
+
*/
|
|
47
|
+
export declare function deploymentShippedEntries<E extends {
|
|
48
|
+
readonly origin: ModuleIdClaimOrigin;
|
|
49
|
+
}>(entries: readonly E[]): E[];
|
|
50
|
+
/** A manifest plus where it came from — the minimum both readers above need. */
|
|
51
|
+
export interface OriginatedManifestEntry {
|
|
52
|
+
readonly manifest: ModuleManifest;
|
|
53
|
+
readonly origin: ModuleIdClaimOrigin;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=module-origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-origin.d.ts","sourceRoot":"","sources":["../../../src/lifecycle/services/module-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,8CAA8C;AAC9C,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,EACzF,OAAO,EAAE,SAAS,CAAC,EAAE,GACpB,CAAC,EAAE,CAEL;AAED,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which discovery produced a module entry, and the one split that is taken from
|
|
3
|
+
* it (feature 080, D-160.11).
|
|
4
|
+
*
|
|
5
|
+
* It was declared in `backend/src/packages/module-id-claims.ts` and re-exported
|
|
6
|
+
* through the host's manifest registry, which is a reach out of the platform
|
|
7
|
+
* into the host application: the presence load types
|
|
8
|
+
* `ShippedModuleEntry.origin` on it and narrows the first-boot insert
|
|
9
|
+
* population with {@link deploymentShippedEntries}, and both of those are the
|
|
10
|
+
* platform's. The **claims** machinery — who claimed an id, from which
|
|
11
|
+
* `package.json`, and the refusal naming both — stays host-side, because it is
|
|
12
|
+
* about runtime package discovery, which the host owns (D-119/D-155).
|
|
13
|
+
*
|
|
14
|
+
* There is deliberately no `'installed'` beside `'package'` and no containment
|
|
15
|
+
* test that could produce one. A workspace module package and an installed one
|
|
16
|
+
* are the same directory shape, and in a deployed build both resolve under
|
|
17
|
+
* `node_modules`; what separates them is which discovery produced the entry,
|
|
18
|
+
* which is known at construction and nowhere else.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The entries **this build ships**: core plus the deployment's overlay modules,
|
|
22
|
+
* never an installed package.
|
|
23
|
+
*
|
|
24
|
+
* The single spelling of D-157.6(b)'s split, because it has two readers and a
|
|
25
|
+
* derived fact written down twice is two answers waiting to disagree (D-100).
|
|
26
|
+
* Both readers converge state at boot for a module nobody ran a command for,
|
|
27
|
+
* and both must stop at the same line:
|
|
28
|
+
*
|
|
29
|
+
* - `firstBootInsertPopulation` — the `module_registrations` insert. A package
|
|
30
|
+
* converged here is a package `module:install` will answer
|
|
31
|
+
* `already-installed` about, having applied none of its migrations.
|
|
32
|
+
* - the **boot settings reconcile** (`composition.ts`, and the harness beside
|
|
33
|
+
* it). An overlay module has no `install` at all, so boot is the only author
|
|
34
|
+
* its activation Setting can have; a package has exactly one author,
|
|
35
|
+
* `install`, which reconciles its settings inside the operation that also
|
|
36
|
+
* runs its migrations. Reconciling a package's manifest at boot would let a
|
|
37
|
+
* `SettingCodeConflict` in something an operator merely `pnpm add`ed abort
|
|
38
|
+
* the platform's start.
|
|
39
|
+
*
|
|
40
|
+
* Generic over the entry, so a caller keeps whatever fields it had: the presence
|
|
41
|
+
* load hands it `{ manifest, filePath }` and a composition root hands it whole
|
|
42
|
+
* `RegisteredManifestEntry` values.
|
|
43
|
+
*/
|
|
44
|
+
export function deploymentShippedEntries(entries) {
|
|
45
|
+
return entries.filter((entry) => entry.origin !== 'package');
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=module-origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-origin.js","sourceRoot":"","sources":["../../../src/lifecycle/services/module-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAAqB;IAErB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAC/D,CAAC"}
|