@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,318 @@
|
|
|
1
|
+
import type { Redis } from 'ioredis';
|
|
2
|
+
import type { EntityManager } from '@mikro-orm/postgresql';
|
|
3
|
+
import type { RegistryState } from '@endora-commerce/contracts';
|
|
4
|
+
import { type ModuleActivationDeclaration } from './activation-resolver.js';
|
|
5
|
+
import type { CapabilityRegistry, ExclusiveCapabilityDeclaration } from './capability-registry.js';
|
|
6
|
+
export declare const STATE_CHANGED_CHANNEL = "b2b:module:state-changed";
|
|
7
|
+
export declare const FALLBACK_TTL_MS = 5000;
|
|
8
|
+
/**
|
|
9
|
+
* Per-process cache of module presence. Hot path for the
|
|
10
|
+
* `defineModuleRoutes` / `defineModuleWorker` / `subscribeForModule` /
|
|
11
|
+
* `requireModuleEnabled` wrappers — every request hits it, so the read side
|
|
12
|
+
* MUST stay in-memory after the cold start.
|
|
13
|
+
*
|
|
14
|
+
* It holds **both** presence axes (feature 073):
|
|
15
|
+
*
|
|
16
|
+
* - platform availability, from `module_registrations`;
|
|
17
|
+
* - operator activation, from the declared activation `Setting` rows.
|
|
18
|
+
*
|
|
19
|
+
* They are rebuilt in the same refresh so a process that missed a
|
|
20
|
+
* notification cannot hold the two axes in disagreement. Combining them is
|
|
21
|
+
* `ModuleEffectiveState`'s job, not this class's: here they stay separate,
|
|
22
|
+
* because the Admin UI has to tell "not installed here" from "switched off".
|
|
23
|
+
*
|
|
24
|
+
* The cache keeps itself fresh by subscribing to the
|
|
25
|
+
* `b2b:module:state-changed` pub/sub channel. If that connection drops, a
|
|
26
|
+
* background timer re-reads from PostgreSQL every `FALLBACK_TTL_MS` until it
|
|
27
|
+
* recovers — PostgreSQL is the authority and stays reachable during a Redis
|
|
28
|
+
* outage, so degraded means *stale*, not *everything off*.
|
|
29
|
+
*
|
|
30
|
+
* **Loading and watching are two different things** (feature 072, D-38), and
|
|
31
|
+
* conflating them is what kept the backend from booting:
|
|
32
|
+
*
|
|
33
|
+
* - {@link load} is awaited, fatal and PostgreSQL-only. It runs as a kernel
|
|
34
|
+
* step inside `composeApp()`, before the first module registers, because a
|
|
35
|
+
* boot hook resolving a gated port asks this cache and a composition-time
|
|
36
|
+
* answer of "off" is indistinguishable from "nobody has read the database
|
|
37
|
+
* yet".
|
|
38
|
+
* - {@link watch} is armed after composition, is Redis-only and can never fail
|
|
39
|
+
* a boot: losing the notification channel means *stale*, which is the
|
|
40
|
+
* degraded mode above.
|
|
41
|
+
*
|
|
42
|
+
* Before a load there is no answer, and asking for one throws
|
|
43
|
+
* {@link ModulePresenceNotLoadedError} rather than being answered `false`. It
|
|
44
|
+
* is a wiring defect, and the one thing it must not do is look like data.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* A presence read reached the cache before anything loaded it.
|
|
48
|
+
*
|
|
49
|
+
* Not fail-open and not fail-closed — *loud*. Both of the other answers are
|
|
50
|
+
* answers to a question nobody has asked the database yet: `false` takes a
|
|
51
|
+
* correctly-installed platform down at boot (which is exactly what it did), and
|
|
52
|
+
* `true` runs a switched-off module's workers and subscribers.
|
|
53
|
+
*/
|
|
54
|
+
export declare class ModulePresenceNotLoadedError extends Error {
|
|
55
|
+
readonly read: string;
|
|
56
|
+
constructor(read: string);
|
|
57
|
+
}
|
|
58
|
+
export declare class ModuleRegistryCache {
|
|
59
|
+
/**
|
|
60
|
+
* The third state. `false` means "nothing has read the database", which is
|
|
61
|
+
* neither of the two answers a presence read can be given.
|
|
62
|
+
*/
|
|
63
|
+
private loaded;
|
|
64
|
+
private enabled;
|
|
65
|
+
/** Every registry row's state, including the non-installed ones. */
|
|
66
|
+
private platformStates;
|
|
67
|
+
/** Resolved operator activation, per declaring module. */
|
|
68
|
+
private activation;
|
|
69
|
+
private declarations;
|
|
70
|
+
/**
|
|
71
|
+
* The derived capability families (feature 132), indexed the two ways they are
|
|
72
|
+
* read: key → declared member ids, and key → its owner's declaration.
|
|
73
|
+
*
|
|
74
|
+
* They live **here**, beside the activation declarations and the resolved
|
|
75
|
+
* activation, and that is the Redis cache-invalidation design rather than a
|
|
76
|
+
* convenience (`data-model.md` §2.2). An exclusion reads membership and
|
|
77
|
+
* activation together on every refusal, and this cache is refreshed by the
|
|
78
|
+
* `b2b:module:state-changed` pub/sub channel — the same refresh that
|
|
79
|
+
* re-resolves activation. Holding both in one structure with one invalidation
|
|
80
|
+
* is what stops them disagreeing; a family cached anywhere else would need a
|
|
81
|
+
* second refresh path and would be stale for exactly the window in which an
|
|
82
|
+
* operator is flipping a connector, which is the only window that matters.
|
|
83
|
+
*/
|
|
84
|
+
private capabilityMembers;
|
|
85
|
+
private exclusiveCapabilities;
|
|
86
|
+
/**
|
|
87
|
+
* Content hash of the two axes, and the counter that moves with it.
|
|
88
|
+
*
|
|
89
|
+
* Issue #225 — a consumer that memoises anything derived from presence needs
|
|
90
|
+
* to know **when the presence it read from was replaced**, and a pub/sub
|
|
91
|
+
* message cannot tell it: the message announces a change whose effect on this
|
|
92
|
+
* cache is still a PostgreSQL round-trip away, so a snapshot rebuilt on the
|
|
93
|
+
* message is rebuilt from the pre-change maps and then kept. The version is
|
|
94
|
+
* the answer to that, and it is a *pull*: no registration, therefore no
|
|
95
|
+
* listener order to get wrong, and a consumer constructed after a refresh
|
|
96
|
+
* still reads the right number.
|
|
97
|
+
*
|
|
98
|
+
* It moves on **content**, not on refresh count. Every state-changed message
|
|
99
|
+
* refreshes every process and the degraded-mode timer refreshes every five
|
|
100
|
+
* seconds; a counter bumped per refresh would drop a consumer's cache each
|
|
101
|
+
* time and make it worthless during a Redis outage, for a presence that did
|
|
102
|
+
* not move. The hash costs one pass over ~70 entries, once per refresh, and
|
|
103
|
+
* never on the read path.
|
|
104
|
+
*/
|
|
105
|
+
private presenceSignature;
|
|
106
|
+
private presenceVersionCounter;
|
|
107
|
+
private subscriber;
|
|
108
|
+
private degraded;
|
|
109
|
+
private fallbackTimer;
|
|
110
|
+
private fallbackStopped;
|
|
111
|
+
private presenceListeners;
|
|
112
|
+
/** True once {@link load} — or the test seam that stands in for it — has run. */
|
|
113
|
+
isLoaded(): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Run `listener` every time this cache **installs** presence — the pub/sub
|
|
116
|
+
* refresh, the degraded-mode refresh, the cold load and the test seams alike.
|
|
117
|
+
*
|
|
118
|
+
* It is the seam a consumer that owns something *stateful* needs, where
|
|
119
|
+
* {@link presenceVersion} is enough for one that merely memoises: a BullMQ
|
|
120
|
+
* worker is not re-read on a request path, so nothing would ever ask it the
|
|
121
|
+
* version, and the orchestrator's `pauseWorkersFor` reaches only the process
|
|
122
|
+
* that ran the orchestrator — never the `BACKEND_ROLE=worker` process, and
|
|
123
|
+
* never the `module:*` CLI, which composes nothing at all. Following the
|
|
124
|
+
* cache instead makes the answer per-process and therefore right in every
|
|
125
|
+
* process.
|
|
126
|
+
*
|
|
127
|
+
* Deliberately **level-triggered**: it fires on every install rather than
|
|
128
|
+
* only when the content moved, because a listener that failed once must get
|
|
129
|
+
* another chance — the degraded-mode timer is then a retry loop rather than a
|
|
130
|
+
* silence. Listeners are therefore obliged to be idempotent and cheap.
|
|
131
|
+
*
|
|
132
|
+
* Notification is synchronous and its errors are contained here: a consumer
|
|
133
|
+
* that throws must not take down a refresh that every gating seam depends on.
|
|
134
|
+
*/
|
|
135
|
+
onPresenceInstalled(listener: () => void): () => void;
|
|
136
|
+
private notifyPresenceInstalled;
|
|
137
|
+
/**
|
|
138
|
+
* Monotonic counter over the *content* of both axes. It changes exactly when
|
|
139
|
+
* a load has installed presence that differs from the presence before it, so
|
|
140
|
+
* a consumer that caches a projection of presence can drop that cache by
|
|
141
|
+
* comparing the number it built under with the current one.
|
|
142
|
+
*
|
|
143
|
+
* Synchronous and allocation-free, like every other read here: it is meant to
|
|
144
|
+
* be asked on a request path.
|
|
145
|
+
*/
|
|
146
|
+
presenceVersion(): number;
|
|
147
|
+
/**
|
|
148
|
+
* Re-sign both axes and bump the counter when the signature moved, then tell
|
|
149
|
+
* every {@link onPresenceInstalled} listener that presence was installed.
|
|
150
|
+
* Called at the end of every path that installs presence — the real refresh
|
|
151
|
+
* and the three test seams alike, because a seam that swaps presence without
|
|
152
|
+
* moving the version would leave a consumer serving the presence before it.
|
|
153
|
+
*
|
|
154
|
+
* The notification is unconditional where the counter is not: the counter
|
|
155
|
+
* answers "did the content move", which is the question a memoising consumer
|
|
156
|
+
* asks, and the listeners answer "reconcile yourself to what is here now",
|
|
157
|
+
* which has to keep being asked after a listener that failed.
|
|
158
|
+
*/
|
|
159
|
+
private restamp;
|
|
160
|
+
private assertLoaded;
|
|
161
|
+
isEnabled(moduleId: string): boolean;
|
|
162
|
+
enabledIds(): string[];
|
|
163
|
+
/** Platform axis detail for the presence projection. */
|
|
164
|
+
platformStateOf(moduleId: string): RegistryState | 'not-installed';
|
|
165
|
+
/**
|
|
166
|
+
* Resolved activation for a module that declares a control, or `undefined`
|
|
167
|
+
* when nothing has been resolved for it yet.
|
|
168
|
+
*/
|
|
169
|
+
activationValue(moduleId: string): boolean | undefined;
|
|
170
|
+
activationDeclaration(moduleId: string): ModuleActivationDeclaration | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* The module that declares `settingCode` as its activation control, if any.
|
|
173
|
+
* Used by the settings write guards: an activation code has exactly one
|
|
174
|
+
* legitimate door, and it is not `PUT /settings/:code/value` (FR-009).
|
|
175
|
+
*/
|
|
176
|
+
activationDeclarationByCode(settingCode: string): ModuleActivationDeclaration | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* Install the activation declarations distilled from the manifests. Kept as
|
|
179
|
+
* plain data so the hot path never imports the manifest graph. Refreshing
|
|
180
|
+
* without them resolves the platform axis only, which is exactly the
|
|
181
|
+
* behaviour of a module that has declared no control.
|
|
182
|
+
*/
|
|
183
|
+
setActivationDeclarations(declarations: readonly ModuleActivationDeclaration[]): void;
|
|
184
|
+
/**
|
|
185
|
+
* Install the derived capability registry. Plain data, for the same reason the
|
|
186
|
+
* activation declarations are: the hot path must never import the manifest
|
|
187
|
+
* graph.
|
|
188
|
+
*
|
|
189
|
+
* Replaces the whole registry rather than merging into it — a re-load is a
|
|
190
|
+
* re-derivation from the manifests this process composed, and a merge would
|
|
191
|
+
* keep a member that a `module:uninstall` has taken away.
|
|
192
|
+
*/
|
|
193
|
+
setCapabilityDeclarations(registry: CapabilityRegistry): void;
|
|
194
|
+
/**
|
|
195
|
+
* Every module that **declared** membership of `key`, present or not, in
|
|
196
|
+
* manifest order.
|
|
197
|
+
*
|
|
198
|
+
* No `assertLoaded`, exactly like {@link activationDeclaration}: this is
|
|
199
|
+
* manifest data installed by the composition root before any database read,
|
|
200
|
+
* and the family owner registers its exclusion interceptor at that point. A
|
|
201
|
+
* read that threw before the load would make the family unreadable at the one
|
|
202
|
+
* moment it has to be readable.
|
|
203
|
+
*/
|
|
204
|
+
declaredCapabilityMembers(key: string): readonly string[];
|
|
205
|
+
/**
|
|
206
|
+
* The owner and refusal code for `key`, or `undefined` when no installed
|
|
207
|
+
* module owns it — which is not an error (R3.5): the capability is simply not
|
|
208
|
+
* exclusive in that deployment.
|
|
209
|
+
*/
|
|
210
|
+
exclusiveCapability(key: string): ExclusiveCapabilityDeclaration | undefined;
|
|
211
|
+
/** Union of everything the registry knows and everything that declared a control. */
|
|
212
|
+
knownModuleIds(): string[];
|
|
213
|
+
/**
|
|
214
|
+
* Load both axes from PostgreSQL. **Awaited, fatal, no Redis.**
|
|
215
|
+
*
|
|
216
|
+
* The composition root calls this before the first module registers, so a
|
|
217
|
+
* boot hook, a plugin body and a worker registration all read a cache that
|
|
218
|
+
* has an answer. Idempotent: a second call re-reads the tables.
|
|
219
|
+
*
|
|
220
|
+
* Fatal is not a new failure mode. `composeApp()` opens with `initOrm()` and
|
|
221
|
+
* MikroORM connects eagerly, so a backend whose database is unreachable
|
|
222
|
+
* already cannot boot; this adds one round-trip to a boot that makes several.
|
|
223
|
+
*/
|
|
224
|
+
load(opts: {
|
|
225
|
+
em: () => EntityManager;
|
|
226
|
+
/** Activation declarations from the loaded manifests (feature 073). */
|
|
227
|
+
activationDeclarations?: readonly ModuleActivationDeclaration[];
|
|
228
|
+
/**
|
|
229
|
+
* The capability families derived from the same manifests (feature 132).
|
|
230
|
+
*
|
|
231
|
+
* In **this** call and in no other, on purpose: see the field's comment. The
|
|
232
|
+
* exclusion resolves membership against the activation this call resolves, so
|
|
233
|
+
* the two are installed by one caller and refreshed by one event.
|
|
234
|
+
*/
|
|
235
|
+
capabilityRegistry?: CapabilityRegistry;
|
|
236
|
+
}): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Arm the pub/sub subscriber that keeps the loaded state fresh. **Not fatal,
|
|
239
|
+
* no PostgreSQL read of its own.** Safe to call multiple times — a second
|
|
240
|
+
* call does not re-subscribe.
|
|
241
|
+
*
|
|
242
|
+
* A Redis outage must never fail a boot: the channel is a freshness
|
|
243
|
+
* optimisation over an authority that is still reachable, which is the whole
|
|
244
|
+
* argument for the degraded mode below. So a failing subscribe enters that
|
|
245
|
+
* mode instead of propagating.
|
|
246
|
+
*/
|
|
247
|
+
watch(opts: {
|
|
248
|
+
redisSubscriber: Redis;
|
|
249
|
+
em: () => EntityManager;
|
|
250
|
+
}): Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Test seam — replaces both axes without touching Redis or the database.
|
|
253
|
+
* `ids` seeds platform availability; `opts.deactivated` seeds the operator
|
|
254
|
+
* axis to off, which is the axis an operator actually drives.
|
|
255
|
+
*
|
|
256
|
+
* It counts as a {@link load}: it is "the load, without a database", and a
|
|
257
|
+
* harness that seeds it has answered the question the tri-state asks.
|
|
258
|
+
*/
|
|
259
|
+
__setEnabledForTesting(ids: readonly string[], opts?: {
|
|
260
|
+
deactivated?: readonly string[];
|
|
261
|
+
}): void;
|
|
262
|
+
/**
|
|
263
|
+
* Test seam — return the cache to the unloaded state, which is the one state
|
|
264
|
+
* a test cannot otherwise reach: the suite shares one process, so by the time
|
|
265
|
+
* a file runs, some earlier file has almost certainly seeded the singleton.
|
|
266
|
+
* The invariant "a presence read before the load is an error" is not testable
|
|
267
|
+
* without it.
|
|
268
|
+
*/
|
|
269
|
+
__resetForTesting(): void;
|
|
270
|
+
/**
|
|
271
|
+
* Test seam — re-resolve the **operator** axis from the database, leaving the
|
|
272
|
+
* seeded platform axis alone.
|
|
273
|
+
*
|
|
274
|
+
* The shared test harness never populates `module_registrations`; it seeds
|
|
275
|
+
* the enabled-set directly through `__setEnabledForTesting`. A full
|
|
276
|
+
* `refreshFromDb` there would find an empty registry table and take every
|
|
277
|
+
* gated route down mid-run, so a test that has just written an activation
|
|
278
|
+
* value needs this narrower refresh to observe it.
|
|
279
|
+
*
|
|
280
|
+
* Production never calls it: a partial refresh is exactly how the two axes
|
|
281
|
+
* would drift apart in a process that missed a notification, which is why
|
|
282
|
+
* `refreshFromDb` rebuilds both together.
|
|
283
|
+
*/
|
|
284
|
+
__refreshActivationForTesting(em: () => EntityManager): Promise<void>;
|
|
285
|
+
/** True when the pub/sub side is unhealthy and the cache is TTL-refreshing. */
|
|
286
|
+
isDegraded(): boolean;
|
|
287
|
+
/** Refresh both axes from the source-of-truth tables. Idempotent. */
|
|
288
|
+
refreshFromDb(em: () => EntityManager): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* Degraded-mode refresh. Runs on a timer rather than at the seam: the
|
|
291
|
+
* wrappers' check must stay synchronous (FR-004), so a lazy
|
|
292
|
+
* `await maybeRefresh()` on the hot path is not available.
|
|
293
|
+
*
|
|
294
|
+
* Refreshing from PostgreSQL rather than blanking the sets is deliberate.
|
|
295
|
+
* Fail-closed applies to *unresolved* state, not to stale state; treating a
|
|
296
|
+
* Redis blip as "every module is off" would take the platform down, and the
|
|
297
|
+
* database — the actual authority — is still reachable.
|
|
298
|
+
*/
|
|
299
|
+
private enterDegradedMode;
|
|
300
|
+
private clearDegradedMode;
|
|
301
|
+
/**
|
|
302
|
+
* Stop the degraded-mode timer for good. Used by tests and by process
|
|
303
|
+
* shutdown: after this the cache will not re-arm, so tearing down the
|
|
304
|
+
* database behind it produces no background noise.
|
|
305
|
+
*/
|
|
306
|
+
stopFallbackRefresh(): void;
|
|
307
|
+
}
|
|
308
|
+
/** Module-internal singleton consumed by the wrappers. */
|
|
309
|
+
export declare const registryCache: ModuleRegistryCache;
|
|
310
|
+
/**
|
|
311
|
+
* Publish a state-change notification. Called by the orchestrator on
|
|
312
|
+
* every successful install / uninstall / enable / disable.
|
|
313
|
+
*/
|
|
314
|
+
export declare function publishStateChanged(redis: Redis, payload: {
|
|
315
|
+
moduleId: string;
|
|
316
|
+
newState: string;
|
|
317
|
+
}): Promise<void>;
|
|
318
|
+
//# sourceMappingURL=registry-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-cache.d.ts","sourceRoot":"","sources":["../../../src/kernel/lifecycle/registry-cache.ts"],"names":[],"mappings":"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"}
|