@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,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The refusal. A distinct type from every other absence refusal, per D-101's
|
|
3
|
+
* closing rule.
|
|
4
|
+
*/
|
|
5
|
+
export class RequiredModuleAbsentError extends Error {
|
|
6
|
+
findings;
|
|
7
|
+
constructor(findings) {
|
|
8
|
+
super(refusalMessage(findings));
|
|
9
|
+
this.name = 'RequiredModuleAbsentError';
|
|
10
|
+
this.findings = findings;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function refusalMessage(findings) {
|
|
14
|
+
const lines = [
|
|
15
|
+
'This deployment will not start: it is missing a module the platform requires.',
|
|
16
|
+
'',
|
|
17
|
+
];
|
|
18
|
+
for (const finding of findings) {
|
|
19
|
+
if (finding.kind === 'not-composed') {
|
|
20
|
+
lines.push(` ${finding.moduleId} — declared by this deployment's manifests, but no module registered it,`, ` and the platform cannot run without it: ${finding.reason}`, ' remedy: the composed module list and the manifest index disagree — run', ' `pnpm --filter backend run composer:generate` and rebuild.');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
lines.push(` ${finding.moduleId} — composed, but module presence says \`${finding.platformState}\`,`, ` and the platform cannot run without it: ${finding.reason}`, ` remedy: pnpm --filter backend run module:enable ${finding.moduleId}`);
|
|
24
|
+
}
|
|
25
|
+
lines.push('');
|
|
26
|
+
}
|
|
27
|
+
lines.push('A module whose manifest declares `activation.nonDeactivatable` is required to be present,', 'not merely un-switch-off-able: the orchestrator refuses to disable or uninstall it, and this', 'refuses a composition that would reach its boot phase without it. Starting anyway means', 'every boot hook, route and worker that needs it fails one at a time, each naming whichever', 'module happened to ask first rather than the one that is missing.');
|
|
28
|
+
return lines.join('\n');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The required set, straight from the shipped manifests.
|
|
32
|
+
*
|
|
33
|
+
* Pure and exported so its proof drives the classification from a fixture that
|
|
34
|
+
* enters at the top of the analysis, rather than from a value a composition
|
|
35
|
+
* already computed.
|
|
36
|
+
*/
|
|
37
|
+
export function requiredModulesFrom(manifests) {
|
|
38
|
+
const required = [];
|
|
39
|
+
for (const manifest of manifests) {
|
|
40
|
+
const activation = manifest.activation;
|
|
41
|
+
if (activation === undefined || !('nonDeactivatable' in activation))
|
|
42
|
+
continue;
|
|
43
|
+
required.push({ moduleId: manifest.id, reason: activation.reason });
|
|
44
|
+
}
|
|
45
|
+
return required;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Every required module this composition cannot serve, in manifest order.
|
|
49
|
+
*
|
|
50
|
+
* Pure, and that is load-bearing rather than stylistic — the same reason
|
|
51
|
+
* `assertLockedModulesPresent` is: its whole input is the three things a
|
|
52
|
+
* composition has by the end of its registration pass.
|
|
53
|
+
*/
|
|
54
|
+
export function absentRequiredModules(required, composed, presence) {
|
|
55
|
+
const findings = [];
|
|
56
|
+
for (const entry of required) {
|
|
57
|
+
if (!composed.has(entry.moduleId)) {
|
|
58
|
+
findings.push({ kind: 'not-composed', moduleId: entry.moduleId, reason: entry.reason });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (presence.isPresent(entry.moduleId))
|
|
62
|
+
continue;
|
|
63
|
+
findings.push({
|
|
64
|
+
kind: 'absent',
|
|
65
|
+
moduleId: entry.moduleId,
|
|
66
|
+
reason: entry.reason,
|
|
67
|
+
// Undefined means the id is unknown to both axes, which for a module the
|
|
68
|
+
// manifests declare can only mean presence was seeded without it.
|
|
69
|
+
platformState: presence.presence(entry.moduleId)?.platformState ?? 'not-installed',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return findings;
|
|
73
|
+
}
|
|
74
|
+
/** {@link absentRequiredModules}, as the refusal the composer makes. */
|
|
75
|
+
export function assertRequiredModulesPresent(required, composed, presence) {
|
|
76
|
+
const findings = absentRequiredModules(required, composed, presence);
|
|
77
|
+
if (findings.length > 0)
|
|
78
|
+
throw new RequiredModuleAbsentError(findings);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=required-modules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-modules.js","sourceRoot":"","sources":["../../../src/kernel/lifecycle/required-modules.ts"],"names":[],"mappings":"AAiHA;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACzC,QAAQ,CAAmC;IAEpD,YAAY,QAA0C;QACpD,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,SAAS,cAAc,CAAC,QAA0C;IAChE,MAAM,KAAK,GAAa;QACtB,+EAA+E;QAC/E,EAAE;KACH,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CACR,KAAK,OAAO,CAAC,QAAQ,0EAA0E,EAC/F,iDAAiD,OAAO,CAAC,MAAM,EAAE,EACjE,8EAA8E,EAC9E,0EAA0E,CAC3E,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CACR,KAAK,OAAO,CAAC,QAAQ,2CAA2C,OAAO,CAAC,aAAa,KAAK,EAC1F,iDAAiD,OAAO,CAAC,MAAM,EAAE,EACjE,yDAAyD,OAAO,CAAC,QAAQ,EAAE,CAC5E,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IACD,KAAK,CAAC,IAAI,CACR,2FAA2F,EAC3F,8FAA8F,EAC9F,yFAAyF,EACzF,4FAA4F,EAC5F,mEAAmE,CACpE,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAoC;IAEpC,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;QACvC,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,CAAC,kBAAkB,IAAI,UAAU,CAAC;YAAE,SAAS;QAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAAmC,EACnC,QAA6B,EAC7B,QAAgC;IAEhC,MAAM,QAAQ,GAA4B,EAAE,CAAC;IAC7C,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;YACxF,SAAS;QACX,CAAC;QACD,IAAI,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;YAAE,SAAS;QACjD,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,yEAAyE;YACzE,kEAAkE;YAClE,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,aAAa,IAAI,eAAe;SACnF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,4BAA4B,CAC1C,QAAmC,EACnC,QAA6B,EAC7B,QAAgC;IAEhC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACrE,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module id uniqueness at the composition seam (T030c, D-155.7 placement 2).
|
|
3
|
+
*
|
|
4
|
+
* ## The gap this closes
|
|
5
|
+
*
|
|
6
|
+
* `composeModules` had no id-uniqueness assertion. It composed every entry it
|
|
7
|
+
* was given, and the only thing that could surface a second claimant was
|
|
8
|
+
* `DuplicateRegistrationError` — which fires on the first *registration name*
|
|
9
|
+
* two modules share, names that key and the module id twice, and identifies
|
|
10
|
+
* neither claimant. Two modules claiming one id while registering disjoint
|
|
11
|
+
* names collided on nothing and both composed, so the container ran two
|
|
12
|
+
* strangers under one identity while the manifest set carried one of them.
|
|
13
|
+
*
|
|
14
|
+
* That mattered because the id is the identity everything downstream keys on.
|
|
15
|
+
* `specs/081-per-module-migration-order/contracts/migration-identity.md` §2
|
|
16
|
+
* argues that a migration class name scoped by its module is sufficient,
|
|
17
|
+
* *"because module ids are unique platform-wide — the lifecycle refuses a
|
|
18
|
+
* second module claiming an id"*. Until this landed, that refusal existed only
|
|
19
|
+
* in `buildStaticRegistry`, reachable from the `module:*` CLI scripts, each of
|
|
20
|
+
* which fed bare-core `REGISTERED_MANIFESTS`: the right refusal, wired where a
|
|
21
|
+
* package could not reach it. (T036 pointed those five at the resolved set,
|
|
22
|
+
* which reaches the *discovery* refusal below rather than that one — a `Map`
|
|
23
|
+
* keyed by id leaves no duplicate for `buildStaticRegistry` to see.)
|
|
24
|
+
*
|
|
25
|
+
* ## Why here as well as at discovery
|
|
26
|
+
*
|
|
27
|
+
* `src/packages/module-id-claims.ts` refuses the same thing where the
|
|
28
|
+
* `package.json` paths still exist, which is the only place a message can name
|
|
29
|
+
* both vendors. This one is the structural half: it holds for **any** entry
|
|
30
|
+
* source — core, overlay, package, or whatever composes next — instead of being
|
|
31
|
+
* a property of one loader. By the time a list reaches the composer an entry is
|
|
32
|
+
* an id, a version and a function, so this can only say *how many* claimed the
|
|
33
|
+
* id, and it says where to look for who.
|
|
34
|
+
*
|
|
35
|
+
* ## Why it is not `assertRequiredModulesPresent`, `assertDeactivatable` or
|
|
36
|
+
* `assertLockedModulesPresent`
|
|
37
|
+
*
|
|
38
|
+
* D-101's rule: refusals that share a subject and nothing else stay separate,
|
|
39
|
+
* so a reader can tell which question they are looking at without reading the
|
|
40
|
+
* others. Those three are about *absence*; this is about *two of something*.
|
|
41
|
+
* It runs in the same slot as the first of them, which is the only thing they
|
|
42
|
+
* share.
|
|
43
|
+
*/
|
|
44
|
+
/** An id claimed more than once, and by how many entries. */
|
|
45
|
+
export interface DuplicateModuleIdFinding {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly count: number;
|
|
48
|
+
}
|
|
49
|
+
/** Every repeated id, in first-seen order. */
|
|
50
|
+
export declare function duplicateModuleIds(ids: readonly string[]): DuplicateModuleIdFinding[];
|
|
51
|
+
/** The refusal. A distinct type, per D-101's closing rule. */
|
|
52
|
+
export declare class DuplicateModuleIdError extends Error {
|
|
53
|
+
readonly findings: readonly DuplicateModuleIdFinding[];
|
|
54
|
+
constructor(findings: readonly DuplicateModuleIdFinding[]);
|
|
55
|
+
}
|
|
56
|
+
/** {@link duplicateModuleIds}, as the refusal the composer makes. */
|
|
57
|
+
export declare function assertUniqueModuleIds(ids: readonly string[]): void;
|
|
58
|
+
//# sourceMappingURL=unique-module-ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique-module-ids.d.ts","sourceRoot":"","sources":["../../../src/kernel/lifecycle/unique-module-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,8CAA8C;AAC9C,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,wBAAwB,EAAE,CAQrF;AAED,8DAA8D;AAC9D,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,wBAAwB,EAAE,CAAC;gBAE3C,QAAQ,EAAE,SAAS,wBAAwB,EAAE;CAK1D;AA0BD,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAGlE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module id uniqueness at the composition seam (T030c, D-155.7 placement 2).
|
|
3
|
+
*
|
|
4
|
+
* ## The gap this closes
|
|
5
|
+
*
|
|
6
|
+
* `composeModules` had no id-uniqueness assertion. It composed every entry it
|
|
7
|
+
* was given, and the only thing that could surface a second claimant was
|
|
8
|
+
* `DuplicateRegistrationError` — which fires on the first *registration name*
|
|
9
|
+
* two modules share, names that key and the module id twice, and identifies
|
|
10
|
+
* neither claimant. Two modules claiming one id while registering disjoint
|
|
11
|
+
* names collided on nothing and both composed, so the container ran two
|
|
12
|
+
* strangers under one identity while the manifest set carried one of them.
|
|
13
|
+
*
|
|
14
|
+
* That mattered because the id is the identity everything downstream keys on.
|
|
15
|
+
* `specs/081-per-module-migration-order/contracts/migration-identity.md` §2
|
|
16
|
+
* argues that a migration class name scoped by its module is sufficient,
|
|
17
|
+
* *"because module ids are unique platform-wide — the lifecycle refuses a
|
|
18
|
+
* second module claiming an id"*. Until this landed, that refusal existed only
|
|
19
|
+
* in `buildStaticRegistry`, reachable from the `module:*` CLI scripts, each of
|
|
20
|
+
* which fed bare-core `REGISTERED_MANIFESTS`: the right refusal, wired where a
|
|
21
|
+
* package could not reach it. (T036 pointed those five at the resolved set,
|
|
22
|
+
* which reaches the *discovery* refusal below rather than that one — a `Map`
|
|
23
|
+
* keyed by id leaves no duplicate for `buildStaticRegistry` to see.)
|
|
24
|
+
*
|
|
25
|
+
* ## Why here as well as at discovery
|
|
26
|
+
*
|
|
27
|
+
* `src/packages/module-id-claims.ts` refuses the same thing where the
|
|
28
|
+
* `package.json` paths still exist, which is the only place a message can name
|
|
29
|
+
* both vendors. This one is the structural half: it holds for **any** entry
|
|
30
|
+
* source — core, overlay, package, or whatever composes next — instead of being
|
|
31
|
+
* a property of one loader. By the time a list reaches the composer an entry is
|
|
32
|
+
* an id, a version and a function, so this can only say *how many* claimed the
|
|
33
|
+
* id, and it says where to look for who.
|
|
34
|
+
*
|
|
35
|
+
* ## Why it is not `assertRequiredModulesPresent`, `assertDeactivatable` or
|
|
36
|
+
* `assertLockedModulesPresent`
|
|
37
|
+
*
|
|
38
|
+
* D-101's rule: refusals that share a subject and nothing else stay separate,
|
|
39
|
+
* so a reader can tell which question they are looking at without reading the
|
|
40
|
+
* others. Those three are about *absence*; this is about *two of something*.
|
|
41
|
+
* It runs in the same slot as the first of them, which is the only thing they
|
|
42
|
+
* share.
|
|
43
|
+
*/
|
|
44
|
+
/** Every repeated id, in first-seen order. */
|
|
45
|
+
export function duplicateModuleIds(ids) {
|
|
46
|
+
const counts = new Map();
|
|
47
|
+
for (const id of ids)
|
|
48
|
+
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
49
|
+
const findings = [];
|
|
50
|
+
for (const [id, count] of counts) {
|
|
51
|
+
if (count > 1)
|
|
52
|
+
findings.push({ id, count });
|
|
53
|
+
}
|
|
54
|
+
return findings;
|
|
55
|
+
}
|
|
56
|
+
/** The refusal. A distinct type, per D-101's closing rule. */
|
|
57
|
+
export class DuplicateModuleIdError extends Error {
|
|
58
|
+
findings;
|
|
59
|
+
constructor(findings) {
|
|
60
|
+
super(refusalMessage(findings));
|
|
61
|
+
this.name = 'DuplicateModuleIdError';
|
|
62
|
+
this.findings = findings;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function refusalMessage(findings) {
|
|
66
|
+
const lines = [
|
|
67
|
+
'This composition will not run: more than one module entry claims the same module id.',
|
|
68
|
+
'',
|
|
69
|
+
];
|
|
70
|
+
for (const finding of findings) {
|
|
71
|
+
lines.push(` ${finding.id} — claimed by ${finding.count} entries in one composition`);
|
|
72
|
+
}
|
|
73
|
+
lines.push('', 'The module id is what migrations are ordered and reverted by, what settings and permissions', 'are namespaced by, and what the lifecycle registry is keyed on. Two claimants cannot be told', 'apart afterwards, so composing both would mean one hard uninstall reverting two strangers’', 'migrations.', '', 'A composer entry carries an id, a version and a function, so this cannot say which files', 'claimed the id. Where the entries came from can: the core list is', '`src/composition.generated.ts`, a deployment’s overlay modules are under', '`src/apps/<deployment>/modules/`, and an installed package is refused earlier, by', '`ModuleIdCollisionError`, with both `package.json` paths in the message.');
|
|
74
|
+
return lines.join('\n');
|
|
75
|
+
}
|
|
76
|
+
/** {@link duplicateModuleIds}, as the refusal the composer makes. */
|
|
77
|
+
export function assertUniqueModuleIds(ids) {
|
|
78
|
+
const findings = duplicateModuleIds(ids);
|
|
79
|
+
if (findings.length > 0)
|
|
80
|
+
throw new DuplicateModuleIdError(findings);
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=unique-module-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unique-module-ids.js","sourceRoot":"","sources":["../../../src/kernel/lifecycle/unique-module-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAQH,8CAA8C;AAC9C,MAAM,UAAU,kBAAkB,CAAC,GAAsB;IACvD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,EAAE,IAAI,GAAG;QAAE,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,MAAM,QAAQ,GAA+B,EAAE,CAAC;IAChD,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,MAAM,EAAE,CAAC;QACjC,IAAI,KAAK,GAAG,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,8DAA8D;AAC9D,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IACtC,QAAQ,CAAsC;IAEvD,YAAY,QAA6C;QACvD,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,SAAS,cAAc,CAAC,QAA6C;IACnE,MAAM,KAAK,GAAa;QACtB,sFAAsF;QACtF,EAAE;KACH,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,EAAE,iBAAiB,OAAO,CAAC,KAAK,6BAA6B,CAAC,CAAC;IACzF,CAAC;IACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,6FAA6F,EAC7F,8FAA8F,EAC9F,4FAA4F,EAC5F,aAAa,EACb,EAAE,EACF,0FAA0F,EAC1F,mEAAmE,EACnE,0EAA0E,EAC1E,mFAAmF,EACnF,0EAA0E,CAC3E,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,qBAAqB,CAAC,GAAsB;IAC1D,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a module's log lines go (issue #269).
|
|
3
|
+
*
|
|
4
|
+
* ## What was wrong
|
|
5
|
+
*
|
|
6
|
+
* `ModuleContext.log` was whatever the composition root could name at the
|
|
7
|
+
* moment it composed, and composition runs before `buildServer`. So
|
|
8
|
+
* `composition.ts` passed the global `console` and the test harness passed a
|
|
9
|
+
* no-op — the two roots disagreed on the destination, and neither of them was
|
|
10
|
+
* the log the platform actually collects. A module writing `ctx.log.warn(...)`
|
|
11
|
+
* produced an unstructured line on stdout, uncorrelated with the request that
|
|
12
|
+
* caused it and outside the pino stream a deployment ships.
|
|
13
|
+
*
|
|
14
|
+
* Four modules feed `ctx.log` into a service that keeps it (`invoices`,
|
|
15
|
+
* `payments`, `pwa`, `shipments`), and `invoices` writes `{ module: 'invoices' }`
|
|
16
|
+
* into every object by hand, which is the attribution this file makes automatic.
|
|
17
|
+
*
|
|
18
|
+
* ## The shape
|
|
19
|
+
*
|
|
20
|
+
* Two concerns, deliberately split, because they have different owners:
|
|
21
|
+
*
|
|
22
|
+
* - **The destination** ({@link platformLogger}) is late-bound. A composition
|
|
23
|
+
* root passes it before there is an app; `buildServer` attaches the app's
|
|
24
|
+
* own pino instance the moment one exists, so every line emitted after that
|
|
25
|
+
* lands in the collected log without either root remembering to do anything.
|
|
26
|
+
* - **Attribution and correlation** ({@link moduleLogger}) are applied per
|
|
27
|
+
* line, over whatever destination the root chose. `createModuleContext` wraps
|
|
28
|
+
* the root's logger in one of these, so `ctx.log` stamps the module id and
|
|
29
|
+
* the current request's id without the author naming either.
|
|
30
|
+
*
|
|
31
|
+
* ## Why the request id, and not `request.log`
|
|
32
|
+
*
|
|
33
|
+
* Fastify's `request.log` is `app.log.child({ reqId })` and nothing else, so a
|
|
34
|
+
* line carrying `reqId` joins up with Fastify's own `req`/`res` lines exactly
|
|
35
|
+
* as one written through `request.log` would. Reading the id out of the
|
|
36
|
+
* platform scope instead of holding the request buys two things: it works from
|
|
37
|
+
* any depth without threading `request`, and it retains nothing — `scope.ts`
|
|
38
|
+
* documents at length that a value captured into the scope is pinned for as
|
|
39
|
+
* long as any async resource created inside it lives, and a Fastify request is
|
|
40
|
+
* the single most expensive thing that could be pinned there.
|
|
41
|
+
*
|
|
42
|
+
* ## Outside a request, and before the app exists
|
|
43
|
+
*
|
|
44
|
+
* There is no request id to stamp, so the line carries the module id alone and
|
|
45
|
+
* is emitted all the same. Which destination it reaches depends on where the
|
|
46
|
+
* process is:
|
|
47
|
+
*
|
|
48
|
+
* - **A boot hook** runs before `buildServer` in both composition roots, so it
|
|
49
|
+
* reaches {@link consoleFallback}. That is what a boot line has always had,
|
|
50
|
+
* and it is on stdout, where a boot failure is read.
|
|
51
|
+
* - **A worker, a timer, an EventBus subscriber** all run after the app was
|
|
52
|
+
* built — `worker.ts` builds a server it never listens on, precisely so the
|
|
53
|
+
* module plugins register — so they reach the app's pino instance.
|
|
54
|
+
* - **A process that composes modules and builds no server** (the boot-shape
|
|
55
|
+
* integration tests) reaches the fallback.
|
|
56
|
+
*
|
|
57
|
+
* The fallback is a real write, never a no-op: turning an unstructured line
|
|
58
|
+
* into a dropped one would be a worse platform than the one this replaces.
|
|
59
|
+
*
|
|
60
|
+
* ## One shape, one name
|
|
61
|
+
*
|
|
62
|
+
* This interface is **the** structured-logger surface of the platform, and it
|
|
63
|
+
* is the type of `ModuleContext.log`, of `DefineModuleWorkerOptions.logger`,
|
|
64
|
+
* and of every `log` a module is handed. It used to have three names —
|
|
65
|
+
* `WorkerLogger` in `lifecycle/plugin-helpers.ts` (identical body, published on
|
|
66
|
+
* the `./kernel` barrel), `ModuleLifecycleLogger` in `module-context.ts` (an
|
|
67
|
+
* alias of that), and this one — for one shape. Structural typing made the
|
|
68
|
+
* duplication invisible: `moduleLogger` returns a `PlatformLogger` and the
|
|
69
|
+
* field it lands in was declared as the other two.
|
|
70
|
+
*
|
|
71
|
+
* The name that did the damage was `ModuleLifecycleLogger`, because
|
|
72
|
+
* `@endora-commerce/contracts` **also** exports one — the install/uninstall
|
|
73
|
+
* hook logger, whose `info(msg)` takes a message and no bound object. A module
|
|
74
|
+
* author who read the published package and wrote `ctx.log.info('…')` was
|
|
75
|
+
* wrong, and both names resolved. Do not reintroduce an alias of this
|
|
76
|
+
* interface: a second name for one shape is what that defect was made of.
|
|
77
|
+
*/
|
|
78
|
+
export interface PlatformLogger {
|
|
79
|
+
info(obj: object, msg: string): void;
|
|
80
|
+
warn(obj: object, msg: string): void;
|
|
81
|
+
error(obj: object, msg: string): void;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Point every {@link platformLogger} at `logger`, and return a detach.
|
|
85
|
+
*
|
|
86
|
+
* Called once per built server, from `buildServer` — the one place in the tree
|
|
87
|
+
* where the platform's collected logger comes into existence, and therefore the
|
|
88
|
+
* only place where neither composition root can forget it and the two cannot
|
|
89
|
+
* drift apart on it.
|
|
90
|
+
*
|
|
91
|
+
* The detach clears the slot **only if this logger is still the current one**,
|
|
92
|
+
* so a suite that builds a second server before closing the first does not have
|
|
93
|
+
* the first one's teardown silence the second.
|
|
94
|
+
*/
|
|
95
|
+
export declare function attachPlatformLogger(logger: PlatformLogger): () => void;
|
|
96
|
+
/** The attached destination, or `undefined` when nothing is attached. Diagnostics and tests. */
|
|
97
|
+
export declare function currentPlatformLogger(): PlatformLogger | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* The late-bound destination a composition root passes as `log`.
|
|
100
|
+
*
|
|
101
|
+
* It reads the slot **per line** rather than capturing it, which is the whole
|
|
102
|
+
* point: composition happens before the app exists, so anything captured at
|
|
103
|
+
* composition time is the fallback forever.
|
|
104
|
+
*/
|
|
105
|
+
export declare function platformLogger(): PlatformLogger;
|
|
106
|
+
/**
|
|
107
|
+
* Wrap `destination` so every line it carries names `moduleId`, and names the
|
|
108
|
+
* request it was emitted during when there is one.
|
|
109
|
+
*
|
|
110
|
+
* The module id is written **after** the caller's own fields, so attribution is
|
|
111
|
+
* the wrapper's answer and not something a caller can shadow by accident. The
|
|
112
|
+
* request id is written the same way; a caller that genuinely means a different
|
|
113
|
+
* correlation names its own field.
|
|
114
|
+
*/
|
|
115
|
+
export declare function moduleLogger(moduleId: string, to: PlatformLogger): PlatformLogger;
|
|
116
|
+
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/kernel/logging.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAuBD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,CAKvE;AAED,gGAAgG;AAChG,wBAAgB,qBAAqB,IAAI,cAAc,GAAG,SAAS,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,cAAc,CAO/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,GAAG,cAAc,CAQjF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { getCurrentPlatformScope } from './scope.js';
|
|
2
|
+
/**
|
|
3
|
+
* The destination before one is attached, and after the app that was attached
|
|
4
|
+
* has closed.
|
|
5
|
+
*
|
|
6
|
+
* `console.info` is the one call the repository's `no-console` rule does not
|
|
7
|
+
* already allow; it is right here, because this object exists to be the last
|
|
8
|
+
* resort of a platform whose structured logger does not exist yet, and
|
|
9
|
+
* downgrading an info line to `console.warn` would misreport its level to
|
|
10
|
+
* whatever is reading stdout.
|
|
11
|
+
*/
|
|
12
|
+
const consoleFallback = {
|
|
13
|
+
// eslint-disable-next-line no-console -- the pre-`buildServer` destination; see above.
|
|
14
|
+
info: (obj, msg) => console.info(obj, msg),
|
|
15
|
+
warn: (obj, msg) => console.warn(obj, msg),
|
|
16
|
+
error: (obj, msg) => console.error(obj, msg),
|
|
17
|
+
};
|
|
18
|
+
let destination;
|
|
19
|
+
/**
|
|
20
|
+
* Point every {@link platformLogger} at `logger`, and return a detach.
|
|
21
|
+
*
|
|
22
|
+
* Called once per built server, from `buildServer` — the one place in the tree
|
|
23
|
+
* where the platform's collected logger comes into existence, and therefore the
|
|
24
|
+
* only place where neither composition root can forget it and the two cannot
|
|
25
|
+
* drift apart on it.
|
|
26
|
+
*
|
|
27
|
+
* The detach clears the slot **only if this logger is still the current one**,
|
|
28
|
+
* so a suite that builds a second server before closing the first does not have
|
|
29
|
+
* the first one's teardown silence the second.
|
|
30
|
+
*/
|
|
31
|
+
export function attachPlatformLogger(logger) {
|
|
32
|
+
destination = logger;
|
|
33
|
+
return () => {
|
|
34
|
+
if (destination === logger)
|
|
35
|
+
destination = undefined;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** The attached destination, or `undefined` when nothing is attached. Diagnostics and tests. */
|
|
39
|
+
export function currentPlatformLogger() {
|
|
40
|
+
return destination;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The late-bound destination a composition root passes as `log`.
|
|
44
|
+
*
|
|
45
|
+
* It reads the slot **per line** rather than capturing it, which is the whole
|
|
46
|
+
* point: composition happens before the app exists, so anything captured at
|
|
47
|
+
* composition time is the fallback forever.
|
|
48
|
+
*/
|
|
49
|
+
export function platformLogger() {
|
|
50
|
+
const emit = (level) => (obj, msg) => {
|
|
51
|
+
(destination ?? consoleFallback)[level](obj, msg);
|
|
52
|
+
};
|
|
53
|
+
return { info: emit('info'), warn: emit('warn'), error: emit('error') };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Wrap `destination` so every line it carries names `moduleId`, and names the
|
|
57
|
+
* request it was emitted during when there is one.
|
|
58
|
+
*
|
|
59
|
+
* The module id is written **after** the caller's own fields, so attribution is
|
|
60
|
+
* the wrapper's answer and not something a caller can shadow by accident. The
|
|
61
|
+
* request id is written the same way; a caller that genuinely means a different
|
|
62
|
+
* correlation names its own field.
|
|
63
|
+
*/
|
|
64
|
+
export function moduleLogger(moduleId, to) {
|
|
65
|
+
const emit = (level) => (obj, msg) => {
|
|
66
|
+
const requestId = getCurrentPlatformScope()?.requestMeta?.requestId;
|
|
67
|
+
to[level]({ ...obj, module: moduleId, ...(requestId ? { reqId: requestId } : {}) }, msg);
|
|
68
|
+
};
|
|
69
|
+
return { info: emit('info'), warn: emit('warn'), error: emit('error') };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=logging.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/kernel/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAuFrD;;;;;;;;;GASG;AACH,MAAM,eAAe,GAAmB;IACtC,uFAAuF;IACvF,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;IAC1C,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;IAC1C,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC;CAC7C,CAAC;AAEF,IAAI,WAAuC,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACzD,WAAW,GAAG,MAAM,CAAC;IACrB,OAAO,GAAS,EAAE;QAChB,IAAI,WAAW,KAAK,MAAM;YAAE,WAAW,GAAG,SAAS,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,qBAAqB;IACnC,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,IAAI,GACR,CAAC,KAAe,EAAE,EAAE,CACpB,CAAC,GAAW,EAAE,GAAW,EAAQ,EAAE;QACjC,CAAC,WAAW,IAAI,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC,CAAC;IACJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1E,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,EAAkB;IAC/D,MAAM,IAAI,GACR,CAAC,KAAe,EAAE,EAAE,CACpB,CAAC,GAAW,EAAE,GAAW,EAAQ,EAAE;QACjC,MAAM,SAAS,GAAG,uBAAuB,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC;QACpE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC3F,CAAC,CAAC;IACJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|