@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,281 @@
|
|
|
1
|
+
// Overlay resolution — runtime loader used by composition.
|
|
2
|
+
//
|
|
3
|
+
// The resolver (`resolve-overlay.ts`) decides WHICH core units a deployment
|
|
4
|
+
// overrides; this module dynamically imports the overlay implementations so
|
|
5
|
+
// composition can wire them. It runs ONCE at composeApp() startup. For a
|
|
6
|
+
// bare-core build (no DEPLOYMENT / no overlay dir) both loaders return empty and
|
|
7
|
+
// composition is byte-for-byte unchanged (FR-008).
|
|
8
|
+
//
|
|
9
|
+
// **This file derives no path of its own** (`specs/110-instance-repository/`
|
|
10
|
+
// T113/T114). It moved into `@endora-commerce/platform` and takes the overlay
|
|
11
|
+
// root, and the claims already made on a module id, as parameters — both are
|
|
12
|
+
// facts about the *application*, which in an instance is a member the CLI
|
|
13
|
+
// scaffolded and not a tree this package can see.
|
|
14
|
+
// `backend/src/overlay/overlay-runtime.ts` is the binding: it answers "the
|
|
15
|
+
// active deployment's root" from `overlay-roots.ts`' single `import.meta.url`
|
|
16
|
+
// derivation (D115-3) and "who already claims this id" from
|
|
17
|
+
// `packages/claimed-module-ids.ts` (R7.4), and keeps every name and signature
|
|
18
|
+
// its consumers already write.
|
|
19
|
+
//
|
|
20
|
+
// Runtime path mapping: overlay files are authored under `backend/src/apps/…`
|
|
21
|
+
// and compiled to `backend/dist/apps/…`. Which of the two this process reads
|
|
22
|
+
// needs no detection — the binding's root derivation answers `backend/dist`
|
|
23
|
+
// under a compiled run. What did not follow was the **file names**: this module spelled `manifest.ts`
|
|
24
|
+
// and `backend.ts` into `join(...)` and an `existsSync`, and a compiled tree
|
|
25
|
+
// spells both `.js`. `overlayModuleEntriesUnder` therefore skipped every
|
|
26
|
+
// overlay module in production — `if (!existsSync(...)) continue`, no error and
|
|
27
|
+
// no warning. Measured: the same binary with `DEPLOYMENT=example` logs
|
|
28
|
+
// `decoratedBy: 'example_overlay'` under `tsx` and produces zero overlay lines
|
|
29
|
+
// under `node dist/index.js` (feature 080, D-165 step C).
|
|
30
|
+
//
|
|
31
|
+
// So a unit is **resolved** rather than derived — see {@link resolveOverlayUnit}
|
|
32
|
+
// — and the path that comes back is the file that exists, which is what every
|
|
33
|
+
// consumer of `filePath` needs anyway.
|
|
34
|
+
import { existsSync } from 'node:fs';
|
|
35
|
+
import { join } from 'node:path';
|
|
36
|
+
import { pathToFileURL } from 'node:url';
|
|
37
|
+
import { assertNoModuleIdCollisions, } from '../lifecycle/services/module-id-claims.js';
|
|
38
|
+
import { listOverlayModuleDirs } from './resolve-overlay.js';
|
|
39
|
+
/**
|
|
40
|
+
* The two spellings one unit has: `<stem>.js` in a compiled tree, `<stem>.ts`
|
|
41
|
+
* under `tsx` and `vitest`. Compiled first, for the reason
|
|
42
|
+
* `manifest-locations.ts` gives about the same pair — the compiled tree is the
|
|
43
|
+
* one where picking up a stray source file would be wrong.
|
|
44
|
+
*/
|
|
45
|
+
const UNIT_EXTENSIONS = ['.js', '.ts'];
|
|
46
|
+
/**
|
|
47
|
+
* The real path of the overlay unit `<dir>/<stem>`, or `null` when the module
|
|
48
|
+
* ships neither spelling.
|
|
49
|
+
*
|
|
50
|
+
* A **resolution**, never a derivation. The path this returns is a file that
|
|
51
|
+
* exists, so `existsSync` on it is redundant by construction and a caller
|
|
52
|
+
* cannot end up importing a name the build never emitted.
|
|
53
|
+
*/
|
|
54
|
+
export function resolveOverlayUnit(dir, stem) {
|
|
55
|
+
for (const extension of UNIT_EXTENSIONS) {
|
|
56
|
+
const candidate = join(dir, `${stem}${extension}`);
|
|
57
|
+
if (existsSync(candidate))
|
|
58
|
+
return candidate;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
/** The candidates {@link resolveOverlayUnit} tried, for a message that names them. */
|
|
63
|
+
function unitCandidates(dir, stem) {
|
|
64
|
+
return UNIT_EXTENSIONS.map((extension) => join(dir, `${stem}${extension}`)).join(' and ');
|
|
65
|
+
}
|
|
66
|
+
/** Convert an absolute path to an importable URL. */
|
|
67
|
+
function importUrlFor(absPath) {
|
|
68
|
+
return pathToFileURL(absPath).href;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The overlay module ids under one overlay modules root, **and the one place
|
|
72
|
+
* their claim on those ids is checked** (feature 103, FR-004).
|
|
73
|
+
*
|
|
74
|
+
* Both overlay seams go through here — `overlayModuleManifestsUnder`, which is
|
|
75
|
+
* what `resolvedManifestEntries()` reads, and `overlayModuleEntriesUnder`,
|
|
76
|
+
* which is what a composition root composes — so the two cannot answer
|
|
77
|
+
* differently, which is exactly what they used to do: one dropped a colliding
|
|
78
|
+
* manifest with a `continue` while the other composed the module, leaving it
|
|
79
|
+
* with no registry row, no permission-catalogue entry and its routes gated on
|
|
80
|
+
* the effective state of somebody else's module of the same id.
|
|
81
|
+
*
|
|
82
|
+
* The claimed set is derived from what this instance ships and what is
|
|
83
|
+
* installed in it, never written down — so a module that arrives, moves or
|
|
84
|
+
* leaves changes the answer in the same run. It arrives as
|
|
85
|
+
* {@link claimsOutsideTheOverlay}, a **parameter**: its core half comes off the
|
|
86
|
+
* generated manifest index, which is a fact about one tree (D-104, D-160.3), and
|
|
87
|
+
* R7.4 is that a relocated platform file receives such a thing rather than
|
|
88
|
+
* reaching for it. `backend/src/overlay/overlay-runtime.ts` is the binding that
|
|
89
|
+
* supplies it, and an instance writes the same one.
|
|
90
|
+
*
|
|
91
|
+
* This used to be `scanOverlay(root, indexCore(coreModulesRoot())).newModules`
|
|
92
|
+
* — a file-shadowing scan whose core index resolved `backend/src/modules`,
|
|
93
|
+
* which has held no module since F4. With the index empty **every** overlay
|
|
94
|
+
* directory came back as a new module claiming its id, unchecked (D-201).
|
|
95
|
+
*/
|
|
96
|
+
export function overlayModuleIdsUnder(root, claimsOutsideTheOverlay) {
|
|
97
|
+
const ids = listOverlayModuleDirs(root);
|
|
98
|
+
assertNoModuleIdCollisions([
|
|
99
|
+
...claimsOutsideTheOverlay,
|
|
100
|
+
...ids.map((id) => ({
|
|
101
|
+
id,
|
|
102
|
+
origin: 'overlay',
|
|
103
|
+
// The directory, not a manifest that may not be there: an overlay module
|
|
104
|
+
// with no manifest is refused a few lines down, by a message that names
|
|
105
|
+
// both candidate spellings, and a claim built from a path that does not
|
|
106
|
+
// exist would pre-empt it with a worse one.
|
|
107
|
+
claimedBy: join(root, id),
|
|
108
|
+
})),
|
|
109
|
+
]);
|
|
110
|
+
return ids;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Discover overlay MODULE manifests under one root WITHOUT composing them. Used
|
|
114
|
+
* early in composition to build the deployment-resolved registry the permission
|
|
115
|
+
* catalogue + lifecycle consume (FR-009, FR-012).
|
|
116
|
+
*
|
|
117
|
+
* The **root** is a parameter, not a derivation of this file's own path: which
|
|
118
|
+
* directory holds `apps/<deployment>/modules` is a fact about the application,
|
|
119
|
+
* derived once by `backend/src/overlay/overlay-roots.ts` from its own
|
|
120
|
+
* `import.meta.url` (D115-3), and the platform is not in that tree. The binding
|
|
121
|
+
* beside that derivation is what answers "the active deployment's" — see
|
|
122
|
+
* `backend/src/overlay/overlay-runtime.ts`.
|
|
123
|
+
*
|
|
124
|
+
* The fixture is therefore a directory on disk, scanned and imported by the code
|
|
125
|
+
* the deployment path runs, rather than a value handed to the last function in
|
|
126
|
+
* the chain (issue #130).
|
|
127
|
+
*/
|
|
128
|
+
export async function overlayModuleManifestsUnder(root, ids) {
|
|
129
|
+
const out = [];
|
|
130
|
+
for (const id of ids) {
|
|
131
|
+
const moduleDir = join(root, id);
|
|
132
|
+
const manifestPath = resolveOverlayUnit(moduleDir, 'manifest');
|
|
133
|
+
if (manifestPath === null) {
|
|
134
|
+
// The scan already reported this directory as a module, so an absent
|
|
135
|
+
// manifest is not "a directory that ships nothing" — it is a module with
|
|
136
|
+
// no id and no version to compose it under. Refused here rather than left
|
|
137
|
+
// to `import()`, whose ERR_MODULE_NOT_FOUND names a `.ts` path that never
|
|
138
|
+
// existed in a compiled tree and sends the reader looking for the wrong
|
|
139
|
+
// file (D-165 step C).
|
|
140
|
+
throw new Error(`[overlay] the module directory ${moduleDir} carries no manifest — tried ` +
|
|
141
|
+
`${unitCandidates(moduleDir, 'manifest')}. An overlay module is discovered by its ` +
|
|
142
|
+
`directory and identified by its manifest; without one it has no id and no version.`);
|
|
143
|
+
}
|
|
144
|
+
const mod = (await import(importUrlFor(manifestPath)));
|
|
145
|
+
const manifest = mod['manifest'];
|
|
146
|
+
if (!manifest)
|
|
147
|
+
continue;
|
|
148
|
+
// `exactOptionalPropertyTypes`: an absent key is not `{ hook: undefined }`,
|
|
149
|
+
// and the lifecycle asks `entry.installHook !== undefined`.
|
|
150
|
+
const installHook = mod['installHook'];
|
|
151
|
+
const uninstallHook = mod['uninstallHook'];
|
|
152
|
+
const lifecycleParticipant = mod['lifecycleParticipant'];
|
|
153
|
+
const cliCommands = mod['cliCommands'];
|
|
154
|
+
const recentActivity = mod['recentActivity'];
|
|
155
|
+
out.push({
|
|
156
|
+
id,
|
|
157
|
+
manifest,
|
|
158
|
+
filePath: manifestPath,
|
|
159
|
+
...(installHook ? { installHook } : {}),
|
|
160
|
+
...(uninstallHook ? { uninstallHook } : {}),
|
|
161
|
+
...(lifecycleParticipant ? { lifecycleParticipant } : {}),
|
|
162
|
+
...(cliCommands ? { cliCommands } : {}),
|
|
163
|
+
...(recentActivity ? { recentActivity } : {}),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* One overlay root's converted modules, as composer entries (D-103/D-104).
|
|
170
|
+
*
|
|
171
|
+
* The root and the claims are parameters for the reason
|
|
172
|
+
* {@link overlayModuleManifestsUnder} gives: both are facts about the
|
|
173
|
+
* application, and `backend/src/overlay/overlay-runtime.ts` is the binding that
|
|
174
|
+
* answers "the active deployment's" over them.
|
|
175
|
+
*
|
|
176
|
+
* This is the **one** composition path for an overlay module: a root appends
|
|
177
|
+
* these to the core list and passes the single array to `composeModules`, so an
|
|
178
|
+
* overlay module receives an ordinary `ModuleContext` and reaches every seam a
|
|
179
|
+
* core module reaches — `ctx.routes` and its lifecycle gate, `ctx.worker`,
|
|
180
|
+
* `ctx.subscribe`, `ctx.interceptors`, `ctx.onBoot`, ports, and the decoration
|
|
181
|
+
* exemption. The path it replaces handed a frozen seven-field context to a
|
|
182
|
+
* `plugin.ts` factory and could gate nothing.
|
|
183
|
+
*
|
|
184
|
+
* **Discovered at runtime, not baked into a generated core artefact** (D-104).
|
|
185
|
+
* A deployment's manifests already resolve this way and for the stated reason:
|
|
186
|
+
* the answer depends on which deployment the *process* runs as, not on which
|
|
187
|
+
* tree a generator was run against. Registrations have the identical property
|
|
188
|
+
* and used to be given the opposite treatment, which made
|
|
189
|
+
* `composition.generated.ts` and `manifest-index.generated.ts` environment-
|
|
190
|
+
* dependent — an artefact that is always stale for a deployment is one nobody
|
|
191
|
+
* can use to detect a genuinely stale one (issue #120, applied to the family it
|
|
192
|
+
* was missed in).
|
|
193
|
+
*
|
|
194
|
+
* `overlay: true` is set **from the root the module was found under**, which is
|
|
195
|
+
* what `ModuleEntry.overlay`'s own contract requires: it exempts the module
|
|
196
|
+
* from the rule that a module may decorate only what it registered, so it may
|
|
197
|
+
* never be a claim a module makes about itself.
|
|
198
|
+
*
|
|
199
|
+
* Ordering is deterministic — the entries come back in id order and a root
|
|
200
|
+
* appends them after a frozen core list — and it decides nothing about
|
|
201
|
+
* decoration. It used to: this paragraph read "so a deployment's decoration
|
|
202
|
+
* always wraps a core registration that is already there", which was the
|
|
203
|
+
* composer's array position doing policy work. Since D-176 every
|
|
204
|
+
* `ctx.di.decorate` is queued during registration and drained once the last
|
|
205
|
+
* module has registered, so where a module sits in the array cannot grant or
|
|
206
|
+
* refuse a wrap; the ownership guard decides, alone.
|
|
207
|
+
*
|
|
208
|
+
* A module directory with no backend entry point **in either spelling** is
|
|
209
|
+
* skipped, not thrown at — a deployment may ship an overlay directory that only
|
|
210
|
+
* shadows core files. "Either spelling" is the whole of D-165 step C's repair
|
|
211
|
+
* here: this used to ask `existsSync('backend.ts')`, so a compiled deployment's
|
|
212
|
+
* every module took the skip and vanished with no error. A `backend.js`/`.ts`
|
|
213
|
+
* that exports no `registerModule` is a different thing and is refused:
|
|
214
|
+
* skipping it would compose nothing, and the first symptom would be a 404
|
|
215
|
+
* nobody connects to this file.
|
|
216
|
+
*/
|
|
217
|
+
export async function overlayModuleEntriesUnder(root, claimsOutsideTheOverlay) {
|
|
218
|
+
return await overlayModuleEntriesForIds(root, overlayModuleIdsUnder(root, claimsOutsideTheOverlay));
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* {@link overlayModuleEntriesUnder} over an id set already derived.
|
|
222
|
+
*
|
|
223
|
+
* It exists so a caller that needs **both** seams — the entries it composes and
|
|
224
|
+
* the manifests the resolved registry is built from — asserts the id-collision
|
|
225
|
+
* claim set once, over one array, rather than twice over two derivations that
|
|
226
|
+
* `overlayModuleIdsUnder`'s own contract says must never be able to answer
|
|
227
|
+
* differently. {@link overlayModulesUnder} is that caller's shape; this stays
|
|
228
|
+
* private because an id set assembled anywhere but there has not been checked.
|
|
229
|
+
*/
|
|
230
|
+
async function overlayModuleEntriesForIds(root, ids) {
|
|
231
|
+
const entries = [];
|
|
232
|
+
for (const id of ids) {
|
|
233
|
+
const moduleDir = join(root, id);
|
|
234
|
+
const backendPath = resolveOverlayUnit(moduleDir, 'backend');
|
|
235
|
+
if (backendPath === null)
|
|
236
|
+
continue;
|
|
237
|
+
const mod = (await import(importUrlFor(backendPath)));
|
|
238
|
+
const registerModule = mod['registerModule'];
|
|
239
|
+
if (typeof registerModule !== 'function') {
|
|
240
|
+
throw new Error(`[overlay] ${backendPath} exports no 'registerModule'. A module's backend.ts is its ` +
|
|
241
|
+
`entry point (see backend/src/apps/example/modules/example_overlay/backend.ts); ` +
|
|
242
|
+
`rename or remove the file if it is not one. It is not composed as written, and an ` +
|
|
243
|
+
`overlay module that composes nothing is a 404 with no error behind it.`);
|
|
244
|
+
}
|
|
245
|
+
const manifestPath = resolveOverlayUnit(moduleDir, 'manifest');
|
|
246
|
+
if (manifestPath === null) {
|
|
247
|
+
throw new Error(`[overlay] ${moduleDir} ships a composable backend entry point and no manifest — ` +
|
|
248
|
+
`tried ${unitCandidates(moduleDir, 'manifest')}. The module has no id and no ` +
|
|
249
|
+
`version to compose it under.`);
|
|
250
|
+
}
|
|
251
|
+
const manifestMod = (await import(importUrlFor(manifestPath)));
|
|
252
|
+
const manifest = manifestMod['manifest'];
|
|
253
|
+
if (!manifest) {
|
|
254
|
+
throw new Error(`[overlay] ${manifestPath} exports no lifecycle-shape manifest, so ` +
|
|
255
|
+
`the module has no id and no version to compose it under.`);
|
|
256
|
+
}
|
|
257
|
+
entries.push({
|
|
258
|
+
id,
|
|
259
|
+
version: manifest.version,
|
|
260
|
+
registerModule: registerModule,
|
|
261
|
+
// From the root, never from the module. See the note above.
|
|
262
|
+
overlay: true,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
return entries;
|
|
266
|
+
}
|
|
267
|
+
export function overlayModulesUnder(root, claimsOutsideTheOverlay) {
|
|
268
|
+
let derived;
|
|
269
|
+
const ids = () => {
|
|
270
|
+
if (derived === undefined) {
|
|
271
|
+
derived = root === null ? [] : overlayModuleIdsUnder(root, claimsOutsideTheOverlay());
|
|
272
|
+
}
|
|
273
|
+
return derived;
|
|
274
|
+
};
|
|
275
|
+
return {
|
|
276
|
+
ids,
|
|
277
|
+
manifests: async () => (root === null ? [] : await overlayModuleManifestsUnder(root, ids())),
|
|
278
|
+
entries: async () => (root === null ? [] : await overlayModuleEntriesForIds(root, ids())),
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=overlay-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-runtime.js","sourceRoot":"","sources":["../../src/overlay/overlay-runtime.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,yEAAyE;AACzE,iFAAiF;AACjF,mDAAmD;AACnD,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,0EAA0E;AAC1E,kDAAkD;AAClD,2EAA2E;AAC3E,8EAA8E;AAC9E,4DAA4D;AAC5D,8EAA8E;AAC9E,+BAA+B;AAC/B,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,sGAAsG;AACtG,6EAA6E;AAC7E,yEAAyE;AACzE,gFAAgF;AAChF,uEAAuE;AACvE,+EAA+E;AAC/E,0DAA0D;AAC1D,EAAE;AACF,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AC;IAC3C,MAAM,GAAG,GAAG,GAAsB,EAAE;QAClC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,CAAC,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC;QACxF,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IACF,OAAO;QACL,GAAG;QACH,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,2BAA2B,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QAC5F,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,0BAA0B,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;KAC1F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of resolving a deployment overlay.
|
|
3
|
+
*
|
|
4
|
+
* Declared here rather than in the application's `src/overlay/types.ts`, which
|
|
5
|
+
* stayed behind: that file is named **by relative path** from every deployment's
|
|
6
|
+
* generated divergence artefact and may not become a bare specifier, because a
|
|
7
|
+
* committed artefact under `src/apps/<deployment>/` whose import depends on the
|
|
8
|
+
* deployment's own dependency graph is the one artefact that stops being
|
|
9
|
+
* readable in a tree that has not installed the package. So the divergence
|
|
10
|
+
* shapes stay there and the *resolution* shape, which no artefact names, comes
|
|
11
|
+
* here with the function that produces it.
|
|
12
|
+
*/
|
|
13
|
+
export interface OverlayResolution {
|
|
14
|
+
deployment: string | null;
|
|
15
|
+
newModules: string[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Deterministic list of the module directories directly under an overlay root.
|
|
19
|
+
*
|
|
20
|
+
* Sorted, dot-prefixed entries skipped, non-directories skipped — the same
|
|
21
|
+
* listing `deploymentsOnDisk()` makes one level up, and both are sorted for the
|
|
22
|
+
* same reason: a committed artefact downstream is byte-compared.
|
|
23
|
+
*/
|
|
24
|
+
export declare function listOverlayModuleDirs(root: string): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Resolve one deployment: the module ids it adds. When `overlayRoot` is `null`
|
|
27
|
+
* (no deployment, or a deployment that ships no overlay directory) the result
|
|
28
|
+
* is core-only and empty, and the build behaves byte-for-byte like bare core
|
|
29
|
+
* (feature 057 FR-008, SC-006).
|
|
30
|
+
*
|
|
31
|
+
* It refuses nothing. An overlay module id already claimed by core, by a
|
|
32
|
+
* workspace module package, by an installed package or by another overlay
|
|
33
|
+
* module is refused at the seams that discover and compose — one rule, reached
|
|
34
|
+
* by both readers (feature 103, FR-004) — rather than here, where a build-time
|
|
35
|
+
* audit artefact is being rendered and no module is about to run.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveOverlay(params: {
|
|
38
|
+
overlayRoot: string | null;
|
|
39
|
+
deployment: string | null;
|
|
40
|
+
}): OverlayResolution;
|
|
41
|
+
//# sourceMappingURL=resolve-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-overlay.d.ts","sourceRoot":"","sources":["../../src/overlay/resolve-overlay.ts"],"names":[],"mappings":"AAiCA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAY5D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,GAAG,iBAAiB,CAIpB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Overlay resolution — which modules a deployment adds.
|
|
2
|
+
//
|
|
3
|
+
// That is the whole of it since D-201 retired file shadowing (feature 103). An
|
|
4
|
+
// overlay module owns every file it ships, so there is nothing inside one of
|
|
5
|
+
// these directories for the platform to classify, and no core tree to classify
|
|
6
|
+
// it against: the resolution is a deterministic listing of the module
|
|
7
|
+
// directories under one root.
|
|
8
|
+
//
|
|
9
|
+
// **What used to be here, and why none of it is missed.** A core index, a unit
|
|
10
|
+
// taxonomy (`route` / `config` / `schema` / `other`), a shadowing rule, a
|
|
11
|
+
// conflict policy and three build-time refusals. `git log -S` over this
|
|
12
|
+
// directory's whole history finds exactly one loader for a shadowed file ever
|
|
13
|
+
// written — `loadOverlayServiceClasses`, for `service` — and feature 072
|
|
14
|
+
// deleted it deliberately, replacing it with `ctx.di.decorate`, because a
|
|
15
|
+
// replacement stops receiving core fixes the day it is written. `route` and
|
|
16
|
+
// `config` never had a loader at all: `resolution.overrides` had one consumer
|
|
17
|
+
// in the whole history of the tree, the override-manifest generator, which
|
|
18
|
+
// serialised it into an audit artefact. So a route override never changed what
|
|
19
|
+
// a running platform served, on any deployment, in any tree state.
|
|
20
|
+
//
|
|
21
|
+
// Since F4 the classification could not even run — its core root resolved
|
|
22
|
+
// `backend/src/modules`, which holds no module — so every overlay directory
|
|
23
|
+
// short-circuited to "a new module claiming this id" before a single file was
|
|
24
|
+
// looked at, and the three refusals the documentation promised were
|
|
25
|
+
// unreachable. A deployment could put a migration under an overlay directory
|
|
26
|
+
// and the guard written to refuse it said nothing.
|
|
27
|
+
//
|
|
28
|
+
// What a deployment overrides instead is in
|
|
29
|
+
// `docs/docs/architecture/overlay-pattern.md`.
|
|
30
|
+
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
31
|
+
import { join } from 'node:path';
|
|
32
|
+
/**
|
|
33
|
+
* Deterministic list of the module directories directly under an overlay root.
|
|
34
|
+
*
|
|
35
|
+
* Sorted, dot-prefixed entries skipped, non-directories skipped — the same
|
|
36
|
+
* listing `deploymentsOnDisk()` makes one level up, and both are sorted for the
|
|
37
|
+
* same reason: a committed artefact downstream is byte-compared.
|
|
38
|
+
*/
|
|
39
|
+
export function listOverlayModuleDirs(root) {
|
|
40
|
+
if (!existsSync(root))
|
|
41
|
+
return [];
|
|
42
|
+
return readdirSync(root)
|
|
43
|
+
.filter((name) => !name.startsWith('.'))
|
|
44
|
+
.filter((name) => {
|
|
45
|
+
try {
|
|
46
|
+
return statSync(join(root, name)).isDirectory();
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.sort();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolve one deployment: the module ids it adds. When `overlayRoot` is `null`
|
|
56
|
+
* (no deployment, or a deployment that ships no overlay directory) the result
|
|
57
|
+
* is core-only and empty, and the build behaves byte-for-byte like bare core
|
|
58
|
+
* (feature 057 FR-008, SC-006).
|
|
59
|
+
*
|
|
60
|
+
* It refuses nothing. An overlay module id already claimed by core, by a
|
|
61
|
+
* workspace module package, by an installed package or by another overlay
|
|
62
|
+
* module is refused at the seams that discover and compose — one rule, reached
|
|
63
|
+
* by both readers (feature 103, FR-004) — rather than here, where a build-time
|
|
64
|
+
* audit artefact is being rendered and no module is about to run.
|
|
65
|
+
*/
|
|
66
|
+
export function resolveOverlay(params) {
|
|
67
|
+
const { overlayRoot, deployment } = params;
|
|
68
|
+
if (overlayRoot === null)
|
|
69
|
+
return { deployment: null, newModules: [] };
|
|
70
|
+
return { deployment, newModules: listOverlayModuleDirs(overlayRoot) };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=resolve-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-overlay.js","sourceRoot":"","sources":["../../src/overlay/resolve-overlay.ts"],"names":[],"mappings":"AA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E,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;IACtE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,qBAAqB,CAAC,WAAW,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `./packages` — installed extension-package discovery, and the platform's
|
|
3
|
+
* tenth subpath (`specs/110-instance-repository/` T113, FR-013).
|
|
4
|
+
*
|
|
5
|
+
* ## What is on it
|
|
6
|
+
*
|
|
7
|
+
* The answer to *"which Endora module packages did an operator install in this
|
|
8
|
+
* instance, and what do they compose to?"* — the `node_modules` scan, the
|
|
9
|
+
* classification that tells a tarball install from a workspace link, the
|
|
10
|
+
* manifest and `ModuleEntry` readers a composition root appends to its one
|
|
11
|
+
* `composeModules([...MODULES, ...overlay, ...packages], …)` call, the schema
|
|
12
|
+
* contribution the ORM configuration merges, and the entity lookup a host
|
|
13
|
+
* program uses to reach a class it may not import.
|
|
14
|
+
*
|
|
15
|
+
* It reads a package; it configures nothing. Merging what it finds into the
|
|
16
|
+
* execution order and into the ORM configuration is the host's
|
|
17
|
+
* (`backend/src/db/configured-migrations.ts`, `configured-entities.ts`), so the
|
|
18
|
+
* merge keeps exactly one implementation and this directory still knows nothing
|
|
19
|
+
* about a database.
|
|
20
|
+
*
|
|
21
|
+
* ## Why the platform carries it, and why an instance cannot
|
|
22
|
+
*
|
|
23
|
+
* This is *the* mechanism an instance depends on most (`research.md` §3.1): a
|
|
24
|
+
* client's whole tree is a composition of packages, and the code that finds them
|
|
25
|
+
* is not code a client may edit. It lived in `backend/src/packages/` while the
|
|
26
|
+
* application *was* the platform; an instance's application is a member the CLI
|
|
27
|
+
* scaffolds, and a scan it holds is a scan that diverges from ours the first
|
|
28
|
+
* time we correct it.
|
|
29
|
+
*
|
|
30
|
+
* ## Why no module may name it
|
|
31
|
+
*
|
|
32
|
+
* D-160.14's third state, for `./composition`'s own reason one surface over:
|
|
33
|
+
* this is the code that decides which packages are composed at all, so a module
|
|
34
|
+
* that could name it could enumerate — and eventually judge — its siblings. It
|
|
35
|
+
* is declared by the `exports` map and carried by no published barrel, so `node`
|
|
36
|
+
* and `tsc` resolve it for the host and the test kit, and
|
|
37
|
+
* `check:platform-surface` answers a module's reach into it with
|
|
38
|
+
* `host-internal-subpath`.
|
|
39
|
+
*
|
|
40
|
+
* ## What stays in the application, and why
|
|
41
|
+
*
|
|
42
|
+
* `backend/src/packages/claimed-module-ids.ts`. It reads the **generated**
|
|
43
|
+
* manifest index, which is a fact about one repository's tree (D-104, D-160.3),
|
|
44
|
+
* so R7.4 keeps it out of the package: a relocated platform file may not import
|
|
45
|
+
* a generated registry, it receives one. That file is a binding of eight lines
|
|
46
|
+
* over this directory's `installedPackageModuleIdClaims`, and an instance writes
|
|
47
|
+
* the same eight against its own index.
|
|
48
|
+
*
|
|
49
|
+
* The barrel names every symbol explicitly rather than re-exporting a directory:
|
|
50
|
+
* `check:platform-surface` exits 2 on an `export *`, because a wildcard makes
|
|
51
|
+
* the published set a property of whatever the files happen to declare rather
|
|
52
|
+
* than of a decision anybody took.
|
|
53
|
+
*/
|
|
54
|
+
export { INSTANCE_ROOT_ENV, nodeModulesRootsFor, scanNodeModulesRoots, type InstalledPackage, type InstalledPackageScan, type SkippedPackage, } from './installed-packages.js';
|
|
55
|
+
export { discoverPackageModuleManifests, discoverPackageSchema, installedPackageModuleIdClaims, loadPackageModuleEntries, packageModuleEntriesUnder, packageModuleManifestsUnder, packageSchemaContributionsUnder, type EntityClassLike, type MigrationRegistryEntry, type PackageModuleManifest, type PackageSchemaContribution, } from './package-runtime.js';
|
|
56
|
+
export { entityNamed, type EntityRowTypeIsRequired, } from './package-entity-lookup.js';
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/packages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,GAC/B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,KAAK,uBAAuB,GAC7B,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `./packages` — installed extension-package discovery, and the platform's
|
|
3
|
+
* tenth subpath (`specs/110-instance-repository/` T113, FR-013).
|
|
4
|
+
*
|
|
5
|
+
* ## What is on it
|
|
6
|
+
*
|
|
7
|
+
* The answer to *"which Endora module packages did an operator install in this
|
|
8
|
+
* instance, and what do they compose to?"* — the `node_modules` scan, the
|
|
9
|
+
* classification that tells a tarball install from a workspace link, the
|
|
10
|
+
* manifest and `ModuleEntry` readers a composition root appends to its one
|
|
11
|
+
* `composeModules([...MODULES, ...overlay, ...packages], …)` call, the schema
|
|
12
|
+
* contribution the ORM configuration merges, and the entity lookup a host
|
|
13
|
+
* program uses to reach a class it may not import.
|
|
14
|
+
*
|
|
15
|
+
* It reads a package; it configures nothing. Merging what it finds into the
|
|
16
|
+
* execution order and into the ORM configuration is the host's
|
|
17
|
+
* (`backend/src/db/configured-migrations.ts`, `configured-entities.ts`), so the
|
|
18
|
+
* merge keeps exactly one implementation and this directory still knows nothing
|
|
19
|
+
* about a database.
|
|
20
|
+
*
|
|
21
|
+
* ## Why the platform carries it, and why an instance cannot
|
|
22
|
+
*
|
|
23
|
+
* This is *the* mechanism an instance depends on most (`research.md` §3.1): a
|
|
24
|
+
* client's whole tree is a composition of packages, and the code that finds them
|
|
25
|
+
* is not code a client may edit. It lived in `backend/src/packages/` while the
|
|
26
|
+
* application *was* the platform; an instance's application is a member the CLI
|
|
27
|
+
* scaffolds, and a scan it holds is a scan that diverges from ours the first
|
|
28
|
+
* time we correct it.
|
|
29
|
+
*
|
|
30
|
+
* ## Why no module may name it
|
|
31
|
+
*
|
|
32
|
+
* D-160.14's third state, for `./composition`'s own reason one surface over:
|
|
33
|
+
* this is the code that decides which packages are composed at all, so a module
|
|
34
|
+
* that could name it could enumerate — and eventually judge — its siblings. It
|
|
35
|
+
* is declared by the `exports` map and carried by no published barrel, so `node`
|
|
36
|
+
* and `tsc` resolve it for the host and the test kit, and
|
|
37
|
+
* `check:platform-surface` answers a module's reach into it with
|
|
38
|
+
* `host-internal-subpath`.
|
|
39
|
+
*
|
|
40
|
+
* ## What stays in the application, and why
|
|
41
|
+
*
|
|
42
|
+
* `backend/src/packages/claimed-module-ids.ts`. It reads the **generated**
|
|
43
|
+
* manifest index, which is a fact about one repository's tree (D-104, D-160.3),
|
|
44
|
+
* so R7.4 keeps it out of the package: a relocated platform file may not import
|
|
45
|
+
* a generated registry, it receives one. That file is a binding of eight lines
|
|
46
|
+
* over this directory's `installedPackageModuleIdClaims`, and an instance writes
|
|
47
|
+
* the same eight against its own index.
|
|
48
|
+
*
|
|
49
|
+
* The barrel names every symbol explicitly rather than re-exporting a directory:
|
|
50
|
+
* `check:platform-surface` exits 2 on an `export *`, because a wildcard makes
|
|
51
|
+
* the published set a property of whatever the files happen to declare rather
|
|
52
|
+
* than of a decision anybody took.
|
|
53
|
+
*/
|
|
54
|
+
export { INSTANCE_ROOT_ENV, nodeModulesRootsFor, scanNodeModulesRoots, } from './installed-packages.js';
|
|
55
|
+
export { discoverPackageModuleManifests, discoverPackageSchema, installedPackageModuleIdClaims, loadPackageModuleEntries, packageModuleEntriesUnder, packageModuleManifestsUnder, packageSchemaContributionsUnder, } from './package-runtime.js';
|
|
56
|
+
export { entityNamed, } from './package-entity-lookup.js';
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/packages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GAIrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,GAKhC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,WAAW,GAEZ,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The environment variable naming the **instance** — the directory whose
|
|
3
|
+
* `node_modules` holds this platform's installed extension packages.
|
|
4
|
+
*
|
|
5
|
+
* Unset is the ordinary case and is not a degraded one: a deployed instance
|
|
6
|
+
* *is* the directory the platform runs from, so the chain above the running
|
|
7
|
+
* code already names it. The variable exists for the case where the two are not
|
|
8
|
+
* the same — a platform executed out of a checkout against an instance built
|
|
9
|
+
* somewhere else, which is exactly what D-110's acceptance criterion does.
|
|
10
|
+
*/
|
|
11
|
+
export declare const INSTANCE_ROOT_ENV = "ENDORA_INSTANCE_ROOT";
|
|
12
|
+
/** One installed package claiming to be an Endora module. */
|
|
13
|
+
export interface InstalledPackage {
|
|
14
|
+
/** The module id it claims — `endora.id` (D-142), never the folder name. */
|
|
15
|
+
readonly id: string;
|
|
16
|
+
/** The npm package name. Identity for humans; never identity for the platform. */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
readonly version: string;
|
|
19
|
+
/** The package directory as installed, symlinks unfollowed. */
|
|
20
|
+
readonly directory: string;
|
|
21
|
+
/** `<directory>/package.json` — the file that claims {@link id}. */
|
|
22
|
+
readonly manifestPath: string;
|
|
23
|
+
/** The `node_modules` directory it was found under. */
|
|
24
|
+
readonly foundUnder: string;
|
|
25
|
+
}
|
|
26
|
+
/** A candidate that was read and not accepted, with the reason. */
|
|
27
|
+
export type SkippedPackage = {
|
|
28
|
+
readonly kind: 'links-out-of-node-modules';
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly at: string;
|
|
31
|
+
readonly realPath: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: 'not-an-endora-module';
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly at: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'unreadable';
|
|
38
|
+
readonly at: string;
|
|
39
|
+
readonly reason: string;
|
|
40
|
+
};
|
|
41
|
+
export interface InstalledPackageScan {
|
|
42
|
+
/** Accepted packages, ordered by npm name so composition is deterministic. */
|
|
43
|
+
readonly packages: readonly InstalledPackage[];
|
|
44
|
+
readonly skipped: readonly SkippedPackage[];
|
|
45
|
+
/** The roots that existed and were walked — never the roots that were asked for. */
|
|
46
|
+
readonly rootsRead: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Every `node_modules` directory this platform reads, nearest first.
|
|
50
|
+
*
|
|
51
|
+
* The declared instance root comes first, then the chain above the running
|
|
52
|
+
* platform — in an instance, `<instance>/node_modules/@endora-commerce/platform`
|
|
53
|
+
* upward to the instance root; in this checkout, the platform package's own and
|
|
54
|
+
* the repository's. The chain is Node's own module-resolution directory list,
|
|
55
|
+
* which is the honest answer to "where would an installed package be": wherever
|
|
56
|
+
* `import` would find it. Roots that do not exist are dropped, so an empty
|
|
57
|
+
* result means *nothing to read* rather than *nothing found*.
|
|
58
|
+
*
|
|
59
|
+
* **The chain is derived from this file's own location and therefore moved with
|
|
60
|
+
* it** (`specs/110-instance-repository/` T113). It read from
|
|
61
|
+
* `backend/src/packages/` until the relocation, so `backend/node_modules` was on
|
|
62
|
+
* it and the platform package's was not; it now reads from
|
|
63
|
+
* `@endora-commerce/platform`, which is where the platform actually runs from in
|
|
64
|
+
* an instance, and is the reading `ENDORA_INSTANCE_ROOT` exists to override. No
|
|
65
|
+
* discovery is lost in this checkout: every `@endora-commerce/*` entry under
|
|
66
|
+
* `backend/node_modules` is a workspace link and is refused as one a few
|
|
67
|
+
* hundred lines down, which is what `installed-packages.test.ts` asserts either
|
|
68
|
+
* side of the move.
|
|
69
|
+
*/
|
|
70
|
+
export declare function nodeModulesRootsFor(env?: NodeJS.ProcessEnv): string[];
|
|
71
|
+
/**
|
|
72
|
+
* Scan the given `node_modules` roots for installed Endora module packages.
|
|
73
|
+
*
|
|
74
|
+
* A package found in more than one root is taken from the nearest one — the
|
|
75
|
+
* same precedence Node's resolver applies, so what the platform composes is
|
|
76
|
+
* what an `import` of that name in the instance would load.
|
|
77
|
+
*/
|
|
78
|
+
export declare function scanNodeModulesRoots(roots: readonly string[]): InstalledPackageScan;
|
|
79
|
+
//# sourceMappingURL=installed-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installed-packages.d.ts","sourceRoot":"","sources":["../../src/packages/installed-packages.ts"],"names":[],"mappings":"AA2EA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,yBAAyB,CAAC;AAExD,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,kFAAkF;IAClF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC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