@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,90 @@
|
|
|
1
|
+
import { asFunction, asValue, createContainer as createAwilixContainer, InjectionMode, } from 'awilix';
|
|
2
|
+
import { forkScopedEm } from '../tenancy/scoped-em.js';
|
|
3
|
+
/** Build a root container. One per process; scopes are children of it. */
|
|
4
|
+
export function createRootContainer() {
|
|
5
|
+
return createAwilixContainer({
|
|
6
|
+
injectionMode: InjectionMode.PROXY,
|
|
7
|
+
strict: true,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Register the ORM-derived names.
|
|
12
|
+
*
|
|
13
|
+
* `emFactory` keeps today's exact semantics — it is the closure, and every call
|
|
14
|
+
* forks. `em` is the container-native spelling of the same thing: **transient**,
|
|
15
|
+
* so each resolution yields its own fork with its own identity map. Neither is
|
|
16
|
+
* scoped, and that is the invariant the whole request seam rests on: the tenant
|
|
17
|
+
* filter reads `AsyncLocalStorage` at query-build time (`tenancy/filters.ts`),
|
|
18
|
+
* which is what makes a bare fork correct.
|
|
19
|
+
*/
|
|
20
|
+
export function registerOrm(container, orm) {
|
|
21
|
+
container.register({
|
|
22
|
+
orm: asValue(orm),
|
|
23
|
+
emFactory: asValue(() => forkScopedEm(orm)),
|
|
24
|
+
em: asFunction(() => forkScopedEm(orm)).transient(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Register plain values a composition root already owns — the Redis client, the
|
|
29
|
+
* `requireAdmin` factory, a port implementation a not-yet-converted module
|
|
30
|
+
* exposes through its handle.
|
|
31
|
+
*
|
|
32
|
+
* It exists so a composition root spells the container's vocabulary without
|
|
33
|
+
* importing `awilix` either. Modules are *forbidden* to import it
|
|
34
|
+
* (`scripts/check-container-imports.ts`); a root importing it would still be
|
|
35
|
+
* one more file to touch the day the container is swapped.
|
|
36
|
+
*/
|
|
37
|
+
export function registerValues(container, values) {
|
|
38
|
+
for (const [name, value] of Object.entries(values)) {
|
|
39
|
+
container.register({ [name]: asValue(value) });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
let currentRoot;
|
|
43
|
+
/**
|
|
44
|
+
* The process-wide root container, created on first use. `enterPlatformScope`
|
|
45
|
+
* falls back to it so a CLI script or an interval sweep needs no wiring to open
|
|
46
|
+
* a scope.
|
|
47
|
+
*/
|
|
48
|
+
export function getRootContainer() {
|
|
49
|
+
currentRoot ??= createRootContainer();
|
|
50
|
+
return currentRoot;
|
|
51
|
+
}
|
|
52
|
+
/** Install a composed root. Used by the composer, and by tests that build their own. */
|
|
53
|
+
export function setRootContainer(container) {
|
|
54
|
+
currentRoot = container;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Dispose the root container and forget it. Runs every registration's
|
|
58
|
+
* `.disposer(...)` — Redis clients, queue connections, the ORM — so a composed
|
|
59
|
+
* process tears down through one call instead of a hand-maintained list.
|
|
60
|
+
*/
|
|
61
|
+
export async function disposeRootContainer() {
|
|
62
|
+
const root = currentRoot;
|
|
63
|
+
currentRoot = undefined;
|
|
64
|
+
if (root)
|
|
65
|
+
await root.dispose();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Dispose `container` when the process is asked to stop. Returns a detach
|
|
69
|
+
* function so a test (or a second composition in the same process) does not
|
|
70
|
+
* leak signal handlers.
|
|
71
|
+
*
|
|
72
|
+
* Not installed automatically: importing the kernel must not attach global
|
|
73
|
+
* signal handlers, or 900 test files would each add a set.
|
|
74
|
+
*/
|
|
75
|
+
export function installShutdownDisposal(container, signals = ['SIGINT', 'SIGTERM']) {
|
|
76
|
+
let disposed = false;
|
|
77
|
+
const handler = () => {
|
|
78
|
+
if (disposed)
|
|
79
|
+
return;
|
|
80
|
+
disposed = true;
|
|
81
|
+
void container.dispose();
|
|
82
|
+
};
|
|
83
|
+
for (const signal of signals)
|
|
84
|
+
process.once(signal, handler);
|
|
85
|
+
return () => {
|
|
86
|
+
for (const signal of signals)
|
|
87
|
+
process.off(signal, handler);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../src/kernel/container.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,OAAO,EACP,eAAe,IAAI,qBAAqB,EACxC,aAAa,GAEd,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkDvD,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB;IACjC,OAAO,qBAAqB,CAAe;QACzC,aAAa,EAAE,aAAa,CAAC,KAAK;QAClC,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,SAA0B,EAAE,GAAa;IACnE,SAAS,CAAC,QAAQ,CAAC;QACjB,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC,GAAkB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAC1D,EAAE,EAAE,UAAU,CAAC,GAAkB,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE;KACnE,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,SAA0B,EAC1B,MAAyC;IAEzC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;AACH,CAAC;AAED,IAAI,WAAwC,CAAC;AAE7C;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,WAAW,KAAK,mBAAmB,EAAE,CAAC;IACtC,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,gBAAgB,CAAC,SAA0B;IACzD,WAAW,GAAG,SAAS,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,IAAI,GAAG,WAAW,CAAC;IACzB,WAAW,GAAG,SAAS,CAAC;IACxB,IAAI,IAAI;QAAE,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;AACjC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CACrC,SAA0B,EAC1B,UAAqC,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE1D,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,OAAO,GAAG,GAAS,EAAE;QACzB,IAAI,QAAQ;YAAE,OAAO;QACrB,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,SAAS,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC,CAAC;IACF,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D,OAAO,GAAG,EAAE;QACV,KAAK,MAAM,MAAM,IAAI,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **A contribution to a registry that was never registered is dropped**
|
|
3
|
+
* (owner ruling, 2026-09-12; feature 117, A4).
|
|
4
|
+
*
|
|
5
|
+
* ## The question this answers, and the one it does not
|
|
6
|
+
*
|
|
7
|
+
* The deactivation-consequence ledger (D-44) has four answers and every one of
|
|
8
|
+
* them is about an owner an **operator switched off** — a module that is
|
|
9
|
+
* composed, registered, and absent by choice. There is no answer for an owner
|
|
10
|
+
* an **instance never installed**, which is not a runtime choice but a fact
|
|
11
|
+
* about the module set the tree was scaffolded with.
|
|
12
|
+
*
|
|
13
|
+
* In this repository every module is always composed, so the difference could
|
|
14
|
+
* not arise. `endora new instance` executed it for the first time: it writes
|
|
15
|
+
* the modules declaring `activation.nonDeactivatable` closed over
|
|
16
|
+
* `dependencies` and over **nothing else**, so a `contributes-to` edge — whose
|
|
17
|
+
* whole purpose is to withhold the `dependencies` claim, since declaring it
|
|
18
|
+
* would make an optional assistant undeactivatable for as long as a
|
|
19
|
+
* non-deactivatable module is present — is precisely a promise that the owner
|
|
20
|
+
* may be missing. A scaffolded instance migrated 118 migrations and then died:
|
|
21
|
+
*
|
|
22
|
+
* ModuleCompositionError: [kernel] module 'catalog' failed in its boot
|
|
23
|
+
* hook: Could not resolve 'promptActionToolRegistry'
|
|
24
|
+
*
|
|
25
|
+
* ## Why a mechanism rather than a fifth classification
|
|
26
|
+
*
|
|
27
|
+
* A fifth kind would add a concept every module author must learn in order to
|
|
28
|
+
* describe a failure they could not have known about — the module set their
|
|
29
|
+
* consumer scaffolds with. The mechanism removes the failure instead, so a
|
|
30
|
+
* module contributes to another module's registry without knowing whether that
|
|
31
|
+
* registry exists in this composition.
|
|
32
|
+
*
|
|
33
|
+
* ## Why it is not either of the two repairs that are refused in writing
|
|
34
|
+
*
|
|
35
|
+
* - **Probing `effectiveState.isPresent` in the hook** is refused by
|
|
36
|
+
* `specs/conventions/module-activation.md`: the host filters by contributor
|
|
37
|
+
* at enumeration, so a probe would make runtime activation require a
|
|
38
|
+
* restart, and a hook mixing work with a contribution must be split before
|
|
39
|
+
* either answer applies. This mechanism asks nothing about presence.
|
|
40
|
+
* - **Declaring the owner in `dependencies`** makes a module mandatory by
|
|
41
|
+
* accident of one hook rather than by a manifest that says so — Principle
|
|
42
|
+
* XVII's axis decided in the wrong place.
|
|
43
|
+
*
|
|
44
|
+
* ## What keeps it narrow
|
|
45
|
+
*
|
|
46
|
+
* The drop is **not** "an unregistered name resolves to something". That would
|
|
47
|
+
* turn every typo and every genuinely missing dependency into a silent
|
|
48
|
+
* `undefined`, which is the opposite of what the container is for. It fires on
|
|
49
|
+
* a conjunction of three facts, all of them derived:
|
|
50
|
+
*
|
|
51
|
+
* 1. the reading module's **own manifest** declares this exact name as
|
|
52
|
+
* `contributes-to` — so a module gets the drop only for an edge it
|
|
53
|
+
* declared, and never for a name it merely happens to read;
|
|
54
|
+
* 2. **nothing in this composition registers the name** — the owner is not
|
|
55
|
+
* here, so there is no table for the descriptor to land in and nobody to
|
|
56
|
+
* walk it;
|
|
57
|
+
* 3. a manifest set has been supplied at all. A process that never established
|
|
58
|
+
* one gets today's behaviour — the resolution throws — because answering
|
|
59
|
+
* from an empty declaration set would be the silent fall-open this file
|
|
60
|
+
* exists to avoid.
|
|
61
|
+
*
|
|
62
|
+
* A `contributes-to` edge naming a name **nobody** registers is still a build
|
|
63
|
+
* failure: `check:port-dependencies` reports it as `unowned-name`. So the
|
|
64
|
+
* loudness lives where a wiring bug belongs — in CI, against the whole module
|
|
65
|
+
* set — and what is dropped at runtime is only ever an edge whose owner this
|
|
66
|
+
* particular instance chose not to install.
|
|
67
|
+
*
|
|
68
|
+
* ## The bound, stated rather than discovered
|
|
69
|
+
*
|
|
70
|
+
* This covers `contributes-to` and **not** `degrades-without`, and the reason
|
|
71
|
+
* is the direction of the data rather than the spelling of the kind. A
|
|
72
|
+
* contribution is a **push**: nothing observes the result, so dropping it is
|
|
73
|
+
* exactly the declared outcome. A `degrades-without` read is a **pull**: the
|
|
74
|
+
* consumer wants a value back and its declaration promises a *degrade*, which
|
|
75
|
+
* is a different branch rather than a silent no-op. Handing it an inert sink
|
|
76
|
+
* would answer `undefined` from every method, and `paymentAdapterRegistry.get`
|
|
77
|
+
* returning `undefined` is indistinguishable from "no adapter for this code" —
|
|
78
|
+
* the fail-open D-179 measured writing a row into a switched-off module's own
|
|
79
|
+
* table (issue #188). A push can be dropped; a pull cannot.
|
|
80
|
+
*/
|
|
81
|
+
/** One declared contribution: the module that pushes, and the name it pushes into. */
|
|
82
|
+
export interface DeclaredContribution {
|
|
83
|
+
/** The module whose manifest declares the edge. */
|
|
84
|
+
readonly moduleId: string;
|
|
85
|
+
/** The container registration name it contributes to. */
|
|
86
|
+
readonly name: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Install the deployment's declared contributions. Idempotent;
|
|
90
|
+
* last-writer-wins, like the gating graph it is installed beside.
|
|
91
|
+
*/
|
|
92
|
+
export declare function provideDeclaredContributions(supplier: () => readonly DeclaredContribution[]): void;
|
|
93
|
+
/**
|
|
94
|
+
* Forget the declaration set — for a test that needs the un-supplied state
|
|
95
|
+
* back, which is the state a bare composition is really in.
|
|
96
|
+
*/
|
|
97
|
+
export declare function resetDeclaredContributionsForTesting(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Does `moduleId`'s own manifest declare `name` as a `contributes-to` edge?
|
|
100
|
+
*
|
|
101
|
+
* `false` when no manifest set has been supplied, which is the fail-closed
|
|
102
|
+
* answer: see {@link declarations}.
|
|
103
|
+
*/
|
|
104
|
+
export declare function isDeclaredContribution(moduleId: string, name: string): boolean;
|
|
105
|
+
export declare const DROPPED_CONTRIBUTION_SINK: unknown;
|
|
106
|
+
//# sourceMappingURL=contribution-sinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution-sinks.d.ts","sourceRoot":"","sources":["../../src/kernel/contribution-sinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AAEH,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAqBD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,SAAS,oBAAoB,EAAE,GAC9C,IAAI,CAGN;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,IAAI,IAAI,CAG3D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAM9E;AAmBD,eAAO,MAAM,yBAAyB,EAAE,OAQtC,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **A contribution to a registry that was never registered is dropped**
|
|
3
|
+
* (owner ruling, 2026-09-12; feature 117, A4).
|
|
4
|
+
*
|
|
5
|
+
* ## The question this answers, and the one it does not
|
|
6
|
+
*
|
|
7
|
+
* The deactivation-consequence ledger (D-44) has four answers and every one of
|
|
8
|
+
* them is about an owner an **operator switched off** — a module that is
|
|
9
|
+
* composed, registered, and absent by choice. There is no answer for an owner
|
|
10
|
+
* an **instance never installed**, which is not a runtime choice but a fact
|
|
11
|
+
* about the module set the tree was scaffolded with.
|
|
12
|
+
*
|
|
13
|
+
* In this repository every module is always composed, so the difference could
|
|
14
|
+
* not arise. `endora new instance` executed it for the first time: it writes
|
|
15
|
+
* the modules declaring `activation.nonDeactivatable` closed over
|
|
16
|
+
* `dependencies` and over **nothing else**, so a `contributes-to` edge — whose
|
|
17
|
+
* whole purpose is to withhold the `dependencies` claim, since declaring it
|
|
18
|
+
* would make an optional assistant undeactivatable for as long as a
|
|
19
|
+
* non-deactivatable module is present — is precisely a promise that the owner
|
|
20
|
+
* may be missing. A scaffolded instance migrated 118 migrations and then died:
|
|
21
|
+
*
|
|
22
|
+
* ModuleCompositionError: [kernel] module 'catalog' failed in its boot
|
|
23
|
+
* hook: Could not resolve 'promptActionToolRegistry'
|
|
24
|
+
*
|
|
25
|
+
* ## Why a mechanism rather than a fifth classification
|
|
26
|
+
*
|
|
27
|
+
* A fifth kind would add a concept every module author must learn in order to
|
|
28
|
+
* describe a failure they could not have known about — the module set their
|
|
29
|
+
* consumer scaffolds with. The mechanism removes the failure instead, so a
|
|
30
|
+
* module contributes to another module's registry without knowing whether that
|
|
31
|
+
* registry exists in this composition.
|
|
32
|
+
*
|
|
33
|
+
* ## Why it is not either of the two repairs that are refused in writing
|
|
34
|
+
*
|
|
35
|
+
* - **Probing `effectiveState.isPresent` in the hook** is refused by
|
|
36
|
+
* `specs/conventions/module-activation.md`: the host filters by contributor
|
|
37
|
+
* at enumeration, so a probe would make runtime activation require a
|
|
38
|
+
* restart, and a hook mixing work with a contribution must be split before
|
|
39
|
+
* either answer applies. This mechanism asks nothing about presence.
|
|
40
|
+
* - **Declaring the owner in `dependencies`** makes a module mandatory by
|
|
41
|
+
* accident of one hook rather than by a manifest that says so — Principle
|
|
42
|
+
* XVII's axis decided in the wrong place.
|
|
43
|
+
*
|
|
44
|
+
* ## What keeps it narrow
|
|
45
|
+
*
|
|
46
|
+
* The drop is **not** "an unregistered name resolves to something". That would
|
|
47
|
+
* turn every typo and every genuinely missing dependency into a silent
|
|
48
|
+
* `undefined`, which is the opposite of what the container is for. It fires on
|
|
49
|
+
* a conjunction of three facts, all of them derived:
|
|
50
|
+
*
|
|
51
|
+
* 1. the reading module's **own manifest** declares this exact name as
|
|
52
|
+
* `contributes-to` — so a module gets the drop only for an edge it
|
|
53
|
+
* declared, and never for a name it merely happens to read;
|
|
54
|
+
* 2. **nothing in this composition registers the name** — the owner is not
|
|
55
|
+
* here, so there is no table for the descriptor to land in and nobody to
|
|
56
|
+
* walk it;
|
|
57
|
+
* 3. a manifest set has been supplied at all. A process that never established
|
|
58
|
+
* one gets today's behaviour — the resolution throws — because answering
|
|
59
|
+
* from an empty declaration set would be the silent fall-open this file
|
|
60
|
+
* exists to avoid.
|
|
61
|
+
*
|
|
62
|
+
* A `contributes-to` edge naming a name **nobody** registers is still a build
|
|
63
|
+
* failure: `check:port-dependencies` reports it as `unowned-name`. So the
|
|
64
|
+
* loudness lives where a wiring bug belongs — in CI, against the whole module
|
|
65
|
+
* set — and what is dropped at runtime is only ever an edge whose owner this
|
|
66
|
+
* particular instance chose not to install.
|
|
67
|
+
*
|
|
68
|
+
* ## The bound, stated rather than discovered
|
|
69
|
+
*
|
|
70
|
+
* This covers `contributes-to` and **not** `degrades-without`, and the reason
|
|
71
|
+
* is the direction of the data rather than the spelling of the kind. A
|
|
72
|
+
* contribution is a **push**: nothing observes the result, so dropping it is
|
|
73
|
+
* exactly the declared outcome. A `degrades-without` read is a **pull**: the
|
|
74
|
+
* consumer wants a value back and its declaration promises a *degrade*, which
|
|
75
|
+
* is a different branch rather than a silent no-op. Handing it an inert sink
|
|
76
|
+
* would answer `undefined` from every method, and `paymentAdapterRegistry.get`
|
|
77
|
+
* returning `undefined` is indistinguishable from "no adapter for this code" —
|
|
78
|
+
* the fail-open D-179 measured writing a row into a switched-off module's own
|
|
79
|
+
* table (issue #188). A push can be dropped; a pull cannot.
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* The declaration set, supplied by whoever owns the manifests.
|
|
83
|
+
*
|
|
84
|
+
* `null` means no manifest set has been established in this process, which is a
|
|
85
|
+
* real state — a bare fixture composition, a CLI that composes nothing — and is
|
|
86
|
+
* deliberately **not** the same as an empty one. It fails closed: with no
|
|
87
|
+
* declarations, nothing is dropped and every unregistered name throws exactly
|
|
88
|
+
* as it did before this file existed.
|
|
89
|
+
*
|
|
90
|
+
* A supplier rather than a snapshot, for the reason `provideDefaultGatingManifests`
|
|
91
|
+
* is one: the manifest set is established during composition and read after it.
|
|
92
|
+
*/
|
|
93
|
+
let declarations = null;
|
|
94
|
+
/** Memoised per supplier, so a resolution is a set lookup rather than a walk. */
|
|
95
|
+
let index = null;
|
|
96
|
+
const keyOf = (moduleId, name) => `${moduleId}:${name}`;
|
|
97
|
+
/**
|
|
98
|
+
* Install the deployment's declared contributions. Idempotent;
|
|
99
|
+
* last-writer-wins, like the gating graph it is installed beside.
|
|
100
|
+
*/
|
|
101
|
+
export function provideDeclaredContributions(supplier) {
|
|
102
|
+
declarations = supplier;
|
|
103
|
+
index = null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Forget the declaration set — for a test that needs the un-supplied state
|
|
107
|
+
* back, which is the state a bare composition is really in.
|
|
108
|
+
*/
|
|
109
|
+
export function resetDeclaredContributionsForTesting() {
|
|
110
|
+
declarations = null;
|
|
111
|
+
index = null;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Does `moduleId`'s own manifest declare `name` as a `contributes-to` edge?
|
|
115
|
+
*
|
|
116
|
+
* `false` when no manifest set has been supplied, which is the fail-closed
|
|
117
|
+
* answer: see {@link declarations}.
|
|
118
|
+
*/
|
|
119
|
+
export function isDeclaredContribution(moduleId, name) {
|
|
120
|
+
if (declarations === null)
|
|
121
|
+
return false;
|
|
122
|
+
if (index === null) {
|
|
123
|
+
index = new Set(declarations().map((edge) => keyOf(edge.moduleId, edge.name)));
|
|
124
|
+
}
|
|
125
|
+
return index.has(keyOf(moduleId, name));
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The registry that is not there: every method is a no-op returning
|
|
129
|
+
* `undefined`.
|
|
130
|
+
*
|
|
131
|
+
* A `Proxy` rather than an object with the methods on it, because the platform
|
|
132
|
+
* cannot know the interface — the registry class belongs to a module, and the
|
|
133
|
+
* platform may not import one (D-52/D-53). What it does know is the shape of
|
|
134
|
+
* the *contract*: a `contributes-to` edge is push-only, and all three of the
|
|
135
|
+
* declarations standing when this landed say so in as many words ("a push, not
|
|
136
|
+
* a pull: nothing is read back").
|
|
137
|
+
*
|
|
138
|
+
* A symbol property answers `undefined` rather than a function, so the runtime
|
|
139
|
+
* probing the object — `Symbol.toPrimitive`, `then` on an accidental `await` —
|
|
140
|
+
* sees an ordinary object rather than a thenable that never settles.
|
|
141
|
+
*/
|
|
142
|
+
const NO_OP = () => undefined;
|
|
143
|
+
export const DROPPED_CONTRIBUTION_SINK = new Proxy(Object.create(null), {
|
|
144
|
+
get(_target, property) {
|
|
145
|
+
if (typeof property === 'symbol')
|
|
146
|
+
return undefined;
|
|
147
|
+
return NO_OP;
|
|
148
|
+
},
|
|
149
|
+
has() {
|
|
150
|
+
return true;
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
//# sourceMappingURL=contribution-sinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contribution-sinks.js","sourceRoot":"","sources":["../../src/kernel/contribution-sinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AAUH;;;;;;;;;;;GAWG;AACH,IAAI,YAAY,GAAmD,IAAI,CAAC;AAExE,iFAAiF;AACjF,IAAI,KAAK,GAA+B,IAAI,CAAC;AAE7C,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,IAAY,EAAU,EAAE,CAAC,GAAG,QAAQ,IAAI,IAAI,EAAE,CAAC;AAEhF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAA+C;IAE/C,YAAY,GAAG,QAAQ,CAAC;IACxB,KAAK,GAAG,IAAI,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oCAAoC;IAClD,YAAY,GAAG,IAAI,CAAC;IACpB,KAAK,GAAG,IAAI,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB,EAAE,IAAY;IACnE,IAAI,YAAY,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,KAAK,GAAG,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,KAAK,GAAG,GAAc,EAAE,CAAC,SAAS,CAAC;AAEzC,MAAM,CAAC,MAAM,yBAAyB,GAAY,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAW,EAAE;IACzF,GAAG,CAAC,OAAO,EAAE,QAAQ;QACnB,IAAI,OAAO,QAAQ,KAAK,QAAQ;YAAE,OAAO,SAAS,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,GAAG;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-hasher.d.ts","sourceRoot":"","sources":["../../../src/kernel/crypto/password-hasher.ts"],"names":[],"mappings":"AAgCA,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKpE;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMrF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import argon2 from 'argon2';
|
|
2
|
+
/**
|
|
3
|
+
* Thin wrapper around argon2id with OWASP-recommended parameters.
|
|
4
|
+
* See specs/001-b2b-platform-foundation/research.md R-11.
|
|
5
|
+
*
|
|
6
|
+
* - memoryCost: 19 MiB (19456 KiB) — OWASP 2024 recommendation.
|
|
7
|
+
* - timeCost: 2.
|
|
8
|
+
* - parallelism: 1.
|
|
9
|
+
* - argon2id type.
|
|
10
|
+
*
|
|
11
|
+
* **Why this lives in the kernel and not in `auth` (feature 075, R-09).**
|
|
12
|
+
* Five modules and the dev seed hash a password. Every one of them reached
|
|
13
|
+
* into `auth/services/password-hasher.js` for it, and the obvious remedy —
|
|
14
|
+
* publish it as a port — is the wrong one: `providePort` wraps a registration
|
|
15
|
+
* in a gate on the owner's effective state, so an operator switching `auth`
|
|
16
|
+
* off would make `hashPassword` answer 503 `MODULE_DISABLED`. That is not a
|
|
17
|
+
* degrade, it is a bug. The test the plan sets is "does switching the owner
|
|
18
|
+
* off change the answer?", and for a pure function over its argument the
|
|
19
|
+
* answer is no. So it relocates rather than becoming a port.
|
|
20
|
+
*
|
|
21
|
+
* It reads no table, holds no state and touches no request context, which is
|
|
22
|
+
* what makes the kernel the right home rather than a second module.
|
|
23
|
+
*/
|
|
24
|
+
const HASH_OPTIONS = {
|
|
25
|
+
type: argon2.argon2id,
|
|
26
|
+
memoryCost: 19_456,
|
|
27
|
+
timeCost: 2,
|
|
28
|
+
parallelism: 1,
|
|
29
|
+
};
|
|
30
|
+
export async function hashPassword(password) {
|
|
31
|
+
if (password.length < 12) {
|
|
32
|
+
throw new Error('Password must be at least 12 characters long.');
|
|
33
|
+
}
|
|
34
|
+
return argon2.hash(password, HASH_OPTIONS);
|
|
35
|
+
}
|
|
36
|
+
export async function verifyPassword(hash, password) {
|
|
37
|
+
try {
|
|
38
|
+
return await argon2.verify(hash, password);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=password-hasher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-hasher.js","sourceRoot":"","sources":["../../../src/kernel/crypto/password-hasher.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,YAAY,GAAmB;IACnC,IAAI,EAAE,MAAM,CAAC,QAAQ;IACrB,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,CAAC;IACX,WAAW,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB;IACjD,IAAI,QAAQ,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAY,EAAE,QAAgB;IACjE,IAAI,CAAC;QACH,OAAO,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AdminI18nTranslatePort, AdminUserReadPort } from '@endora-commerce/contracts';
|
|
2
|
+
import type { ErrorEnvelopeOptions } from '../../http/error-envelope.js';
|
|
3
|
+
/**
|
|
4
|
+
* What a composition supplies: the deployment's routing table, and the two
|
|
5
|
+
* container reads the envelope's injected callbacks are built over.
|
|
6
|
+
*
|
|
7
|
+
* The two reads are **thunks**, and that is the contract rather than a style:
|
|
8
|
+
* each names a gated port, so it resolves per call and a switched-off owner
|
|
9
|
+
* answers at the call site instead of through a handle the composition is
|
|
10
|
+
* holding. Capturing either at composition time is the shape D-70 keeps
|
|
11
|
+
* removing from a composition root.
|
|
12
|
+
*/
|
|
13
|
+
export interface ErrorEnvelopeCompositionInputs {
|
|
14
|
+
/**
|
|
15
|
+
* `ErrorCode → {moduleId, key}` for the deployment's own resolved manifest
|
|
16
|
+
* set — `buildErrorTranslationTargets`' output, which is a composition input
|
|
17
|
+
* because which modules a deployment resolved is a composition's fact.
|
|
18
|
+
*/
|
|
19
|
+
readonly errorTranslationTargets: NonNullable<ErrorEnvelopeOptions['errorTranslationTargets']>;
|
|
20
|
+
/** Owner: `admin_users`. The stored preference of a signed-in admin. */
|
|
21
|
+
readonly adminUserReadPort: () => AdminUserReadPort;
|
|
22
|
+
/** Owner: `_i18n`. The lookup, over the merged bundle. */
|
|
23
|
+
readonly translate: () => AdminI18nTranslatePort;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The error envelope's options, assembled from what a composition supplies
|
|
27
|
+
* (`specs/110-instance-repository/` T118).
|
|
28
|
+
*
|
|
29
|
+
* **Written here because both composition roots had it, character for
|
|
30
|
+
* character.** The production root and `backend/test/helpers/test-server.ts`
|
|
31
|
+
* each carried the same twenty lines — the same language ladder, the same
|
|
32
|
+
* `translated === \`${moduleId}.${key}\`` test — and
|
|
33
|
+
* `test/contract/kernel/harness-parity.test.ts` exists precisely because a
|
|
34
|
+
* difference between two hand-maintained roots is a class of defect the suite
|
|
35
|
+
* reports green on. Issue #234 is the standing proof: both roots' language
|
|
36
|
+
* closure read `if (request.actor.kind !== 'admin') return null`, so every
|
|
37
|
+
* Polish error sentence the platform shipped was unreachable for a buyer, in
|
|
38
|
+
* production and in every test at once. One declaration cannot drift from
|
|
39
|
+
* itself.
|
|
40
|
+
*
|
|
41
|
+
* The two decisions it owns, and neither is a root's:
|
|
42
|
+
*
|
|
43
|
+
* - **the language ladder** is `createRequestLanguageResolver`'s (D-137), and
|
|
44
|
+
* what a root supplies to it is the one rung that reads a module's table;
|
|
45
|
+
* - **"the lookup found nothing" is `moduleId.key` coming back**, which is
|
|
46
|
+
* `_i18n`'s answer for a key it cannot resolve. Reading it as a miss and
|
|
47
|
+
* keeping the raising code's own sentence is the envelope's rule, not the
|
|
48
|
+
* deployment's, so it belongs beside the envelope.
|
|
49
|
+
*
|
|
50
|
+
* What stays a composition's is the two container reads and the target map,
|
|
51
|
+
* which is why they arrive as parameters — the platform may not name the module
|
|
52
|
+
* that registers a container name (D-52/D-53), and which modules a deployment
|
|
53
|
+
* resolved is a fact only its own root holds.
|
|
54
|
+
*/
|
|
55
|
+
export declare function composeErrorEnvelopeOptions(inputs: ErrorEnvelopeCompositionInputs): ErrorEnvelopeOptions;
|
|
56
|
+
//# sourceMappingURL=error-envelope-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-envelope-options.d.ts","sourceRoot":"","sources":["../../../src/kernel/i18n/error-envelope-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGzE;;;;;;;;;GASG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,uBAAuB,EAAE,WAAW,CAAC,oBAAoB,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAC/F,wEAAwE;IACxE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;IACpD,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,sBAAsB,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,8BAA8B,GACrC,oBAAoB,CActB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRequestLanguageResolver } from './request-language.js';
|
|
2
|
+
/**
|
|
3
|
+
* The error envelope's options, assembled from what a composition supplies
|
|
4
|
+
* (`specs/110-instance-repository/` T118).
|
|
5
|
+
*
|
|
6
|
+
* **Written here because both composition roots had it, character for
|
|
7
|
+
* character.** The production root and `backend/test/helpers/test-server.ts`
|
|
8
|
+
* each carried the same twenty lines — the same language ladder, the same
|
|
9
|
+
* `translated === \`${moduleId}.${key}\`` test — and
|
|
10
|
+
* `test/contract/kernel/harness-parity.test.ts` exists precisely because a
|
|
11
|
+
* difference between two hand-maintained roots is a class of defect the suite
|
|
12
|
+
* reports green on. Issue #234 is the standing proof: both roots' language
|
|
13
|
+
* closure read `if (request.actor.kind !== 'admin') return null`, so every
|
|
14
|
+
* Polish error sentence the platform shipped was unreachable for a buyer, in
|
|
15
|
+
* production and in every test at once. One declaration cannot drift from
|
|
16
|
+
* itself.
|
|
17
|
+
*
|
|
18
|
+
* The two decisions it owns, and neither is a root's:
|
|
19
|
+
*
|
|
20
|
+
* - **the language ladder** is `createRequestLanguageResolver`'s (D-137), and
|
|
21
|
+
* what a root supplies to it is the one rung that reads a module's table;
|
|
22
|
+
* - **"the lookup found nothing" is `moduleId.key` coming back**, which is
|
|
23
|
+
* `_i18n`'s answer for a key it cannot resolve. Reading it as a miss and
|
|
24
|
+
* keeping the raising code's own sentence is the envelope's rule, not the
|
|
25
|
+
* deployment's, so it belongs beside the envelope.
|
|
26
|
+
*
|
|
27
|
+
* What stays a composition's is the two container reads and the target map,
|
|
28
|
+
* which is why they arrive as parameters — the platform may not name the module
|
|
29
|
+
* that registers a container name (D-52/D-53), and which modules a deployment
|
|
30
|
+
* resolved is a fact only its own root holds.
|
|
31
|
+
*/
|
|
32
|
+
export function composeErrorEnvelopeOptions(inputs) {
|
|
33
|
+
return {
|
|
34
|
+
errorTranslationTargets: inputs.errorTranslationTargets,
|
|
35
|
+
// Issue #234 — the ladder is one kernel function, and the composition keeps
|
|
36
|
+
// the one rung that reads a module's table (D-137).
|
|
37
|
+
resolvePreferredLanguage: createRequestLanguageResolver({
|
|
38
|
+
adminPreferredLanguage: async (adminUserId) => (await inputs.adminUserReadPort().findById(adminUserId))?.preferredLanguage ?? null,
|
|
39
|
+
}),
|
|
40
|
+
translateErrorMessage: async ({ moduleId, key, language, originalMessage, params }) => {
|
|
41
|
+
const translated = await inputs.translate().translate(moduleId, key, language, params);
|
|
42
|
+
return translated === `${moduleId}.${key}` ? originalMessage : translated;
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=error-envelope-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-envelope-options.js","sourceRoot":"","sources":["../../../src/kernel/i18n/error-envelope-options.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAyBtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAsC;IAEtC,OAAO;QACL,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;QACvD,4EAA4E;QAC5E,oDAAoD;QACpD,wBAAwB,EAAE,6BAA6B,CAAC;YACtD,sBAAsB,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,CAC5C,CAAC,MAAM,MAAM,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,iBAAiB,IAAI,IAAI;SACtF,CAAC;QACF,qBAAqB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,EAAE;YACpF,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YACvF,OAAO,UAAU,KAAK,GAAG,QAAQ,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC;QAC5E,CAAC;KACF,CAAC;AACJ,CAAC"}
|