@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,23 @@
|
|
|
1
|
+
import { OptionalProps } from '@mikro-orm/core';
|
|
2
|
+
import { Setting } from './setting.entity.js';
|
|
3
|
+
import { SalesChannel } from '../sales-channels/sales-channel.entity.js';
|
|
4
|
+
/**
|
|
5
|
+
* SettingValue — feature 004 / data-model.md.
|
|
6
|
+
*
|
|
7
|
+
* Per-(setting, sales_channel) admin override. Resolution order from
|
|
8
|
+
* SettingsService: this row's value if present, otherwise the owning
|
|
9
|
+
* Setting's `defaultValue` (R-3).
|
|
10
|
+
*
|
|
11
|
+
* `updatedAt` backs the `If-Match` ETag pattern (R-6 / FR-012); admins must
|
|
12
|
+
* round-trip the timestamp from a prior GET to commit a write.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SettingValue {
|
|
15
|
+
[OptionalProps]?: 'id' | 'createdAt' | 'updatedAt';
|
|
16
|
+
id: string;
|
|
17
|
+
setting: Setting;
|
|
18
|
+
salesChannel: SalesChannel;
|
|
19
|
+
value: unknown;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=setting-value.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting-value.entity.d.ts","sourceRoot":"","sources":["../../../src/kernel/settings/setting-value.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAId,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE;;;;;;;;;GASG;AACH,qBAGa,YAAY;IACvB,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC;IAGnD,EAAE,EAAE,MAAM,CAAgB;IAI1B,OAAO,EAAG,OAAO,CAAC;IAIlB,YAAY,EAAG,YAAY,CAAC;IAG5B,KAAK,EAAG,OAAO,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAc;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Entity, Index, ManyToOne, OptionalProps, PrimaryKey, Property, Unique, } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '../../tenancy/org-scoped.decorator.js';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
import { Setting } from './setting.entity.js';
|
|
14
|
+
import { SalesChannel } from '../sales-channels/sales-channel.entity.js';
|
|
15
|
+
/**
|
|
16
|
+
* SettingValue — feature 004 / data-model.md.
|
|
17
|
+
*
|
|
18
|
+
* Per-(setting, sales_channel) admin override. Resolution order from
|
|
19
|
+
* SettingsService: this row's value if present, otherwise the owning
|
|
20
|
+
* Setting's `defaultValue` (R-3).
|
|
21
|
+
*
|
|
22
|
+
* `updatedAt` backs the `If-Match` ETag pattern (R-6 / FR-012); admins must
|
|
23
|
+
* round-trip the timestamp from a prior GET to commit a write.
|
|
24
|
+
*/
|
|
25
|
+
let SettingValue = class SettingValue {
|
|
26
|
+
[OptionalProps];
|
|
27
|
+
id = randomUUID();
|
|
28
|
+
setting;
|
|
29
|
+
salesChannel;
|
|
30
|
+
value;
|
|
31
|
+
createdAt = new Date();
|
|
32
|
+
updatedAt = new Date();
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
PrimaryKey({ type: 'uuid' }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], SettingValue.prototype, "id", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
ManyToOne(() => Setting, { fieldName: 'setting_id' }),
|
|
40
|
+
Index(),
|
|
41
|
+
__metadata("design:type", Setting)
|
|
42
|
+
], SettingValue.prototype, "setting", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
ManyToOne(() => SalesChannel, { fieldName: 'sales_channel_id' }),
|
|
45
|
+
Index(),
|
|
46
|
+
__metadata("design:type", SalesChannel)
|
|
47
|
+
], SettingValue.prototype, "salesChannel", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Property({ type: 'json' }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], SettingValue.prototype, "value", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Property({ type: 'datetime', onCreate: () => new Date(), fieldName: 'created_at' }),
|
|
54
|
+
__metadata("design:type", Date)
|
|
55
|
+
], SettingValue.prototype, "createdAt", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Property({ type: 'datetime', onUpdate: () => new Date(), fieldName: 'updated_at' }),
|
|
58
|
+
__metadata("design:type", Date)
|
|
59
|
+
], SettingValue.prototype, "updatedAt", void 0);
|
|
60
|
+
SettingValue = __decorate([
|
|
61
|
+
GlobalEntity(),
|
|
62
|
+
Entity({ tableName: 'setting_values' }),
|
|
63
|
+
Unique({ properties: ['setting', 'salesChannel'] })
|
|
64
|
+
], SettingValue);
|
|
65
|
+
export { SettingValue };
|
|
66
|
+
//# sourceMappingURL=setting-value.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting-value.entity.js","sourceRoot":"","sources":["../../../src/kernel/settings/setting-value.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE;;;;;;;;;GASG;AAII,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,CAAC,aAAa,CAAC,CAAoC;IAGnD,EAAE,GAAW,UAAU,EAAE,CAAC;IAI1B,OAAO,CAAW;IAIlB,YAAY,CAAgB;IAG5B,KAAK,CAAW;IAGhB,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAG7B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AAlBC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wCACH;AAI1B;IAFC,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;IACrD,KAAK,EAAE;8BACE,OAAO;6CAAC;AAIlB;IAFC,SAAS,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChE,KAAK,EAAE;8BACO,YAAY;kDAAC;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACX;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8BACzE,IAAI;+CAAc;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8BACzE,IAAI;+CAAc;AArBlB,YAAY;IAHxB,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;IACvC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,CAAC;GACvC,YAAY,CAsBxB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Collection, OptionalProps } from '@mikro-orm/core';
|
|
2
|
+
import { SettingGroup } from './setting-group.entity.js';
|
|
3
|
+
import { SalesChannel } from '../sales-channels/sales-channel.entity.js';
|
|
4
|
+
export declare const SETTING_VALUE_TYPES: readonly ["string", "number", "boolean", "json", "string_list", "secret", "credential_ref"];
|
|
5
|
+
export type SettingValueTypeDb = (typeof SETTING_VALUE_TYPES)[number];
|
|
6
|
+
/**
|
|
7
|
+
* Setting — feature 004 / data-model.md.
|
|
8
|
+
*
|
|
9
|
+
* One tunable knob declared by a module. `defaultValue` is the manifest-
|
|
10
|
+
* supplied fallback used by the universal getter when no per-channel
|
|
11
|
+
* `SettingValue` exists for the requested sales channel.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Setting {
|
|
14
|
+
[OptionalProps]?: 'id' | 'createdAt' | 'updatedAt' | 'description' | 'globalValue' | 'enumOptions' | 'configurationType' | 'hidden';
|
|
15
|
+
id: string;
|
|
16
|
+
code: string;
|
|
17
|
+
name: string;
|
|
18
|
+
group: SettingGroup;
|
|
19
|
+
valueType: SettingValueTypeDb;
|
|
20
|
+
defaultValue: unknown;
|
|
21
|
+
ownerModule: string;
|
|
22
|
+
description?: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Platform-wide "global override" the admin has set. NULL means no global
|
|
25
|
+
* override — the resolver falls back to `defaultValue`. Per-channel
|
|
26
|
+
* `SettingValue` rows take precedence over this for their channel.
|
|
27
|
+
*/
|
|
28
|
+
globalValue?: unknown | null;
|
|
29
|
+
/**
|
|
30
|
+
* Closed list of allowed values for an enum-style `string` setting (manifest
|
|
31
|
+
* `enumOptions`). NULL ⇒ ordinary free-text setting. When set, the admin
|
|
32
|
+
* renders a dropdown and value writes are constrained to these options.
|
|
33
|
+
*/
|
|
34
|
+
enumOptions?: string[] | null;
|
|
35
|
+
/**
|
|
36
|
+
* Feature 058 — for a `credential_ref` setting, the configuration type its
|
|
37
|
+
* reference is constrained to (e.g. `'llm'`). NULL for every other value
|
|
38
|
+
* type. Manifest-driven config, kept in sync by the reconciler.
|
|
39
|
+
*/
|
|
40
|
+
configurationType?: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* When true, the setting is excluded from the generic admin Settings screen
|
|
43
|
+
* and managed exclusively through its owning module's dedicated UI (e.g. the
|
|
44
|
+
* PWA settings page). It stays fully readable/writable by code. Manifest-
|
|
45
|
+
* driven config, kept in sync on every reconciliation.
|
|
46
|
+
*/
|
|
47
|
+
hidden: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Sales-channel scope. Empty collection ⇒ "applies to all sales channels"
|
|
50
|
+
* (FR-004 / R-5). Backed by the `setting_sales_channels` join table.
|
|
51
|
+
*/
|
|
52
|
+
salesChannels: Collection<SalesChannel, object>;
|
|
53
|
+
createdAt: Date;
|
|
54
|
+
updatedAt: Date;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=setting.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting.entity.d.ts","sourceRoot":"","sources":["../../../src/kernel/settings/setting.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAMV,aAAa,EAId,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE,eAAO,MAAM,mBAAmB,6FAStB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE;;;;;;GAMG;AACH,qBAEa,OAAO;IAClB,CAAC,aAAa,CAAC,CAAC,EACZ,IAAI,GACJ,WAAW,GACX,WAAW,GACX,aAAa,GACb,aAAa,GACb,aAAa,GACb,mBAAmB,GACnB,QAAQ,CAAC;IAGb,EAAE,EAAE,MAAM,CAAgB;IAI1B,IAAI,EAAG,MAAM,CAAC;IAGd,IAAI,EAAG,MAAM,CAAC;IAId,KAAK,EAAG,YAAY,CAAC;IAGrB,SAAS,EAAG,kBAAkB,CAAC;IAG/B,YAAY,EAAG,OAAO,CAAC;IAIvB,WAAW,EAAG,MAAM,CAAC;IAGrB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;OAIG;IAEH,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE7B;;;;OAIG;IAEH,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAE9B;;;;OAIG;IAEH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;;OAKG;IAEH,MAAM,EAAE,OAAO,CAAS;IAExB;;;OAGG;IAMH,aAAa,mCAAsC;IAGnD,SAAS,EAAE,IAAI,CAAc;IAG7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { Collection, Entity, Enum, Index, ManyToMany, ManyToOne, OptionalProps, PrimaryKey, Property, Unique, } from '@mikro-orm/core';
|
|
11
|
+
import { GlobalEntity } from '../../tenancy/org-scoped.decorator.js';
|
|
12
|
+
import { randomUUID } from 'crypto';
|
|
13
|
+
import { SettingGroup } from './setting-group.entity.js';
|
|
14
|
+
import { SalesChannel } from '../sales-channels/sales-channel.entity.js';
|
|
15
|
+
export const SETTING_VALUE_TYPES = [
|
|
16
|
+
'string',
|
|
17
|
+
'number',
|
|
18
|
+
'boolean',
|
|
19
|
+
'json',
|
|
20
|
+
'string_list',
|
|
21
|
+
'secret',
|
|
22
|
+
// Feature 058 — reference to a saved credential configuration (by code).
|
|
23
|
+
'credential_ref',
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Setting — feature 004 / data-model.md.
|
|
27
|
+
*
|
|
28
|
+
* One tunable knob declared by a module. `defaultValue` is the manifest-
|
|
29
|
+
* supplied fallback used by the universal getter when no per-channel
|
|
30
|
+
* `SettingValue` exists for the requested sales channel.
|
|
31
|
+
*/
|
|
32
|
+
let Setting = class Setting {
|
|
33
|
+
[OptionalProps];
|
|
34
|
+
id = randomUUID();
|
|
35
|
+
code;
|
|
36
|
+
name;
|
|
37
|
+
group;
|
|
38
|
+
valueType;
|
|
39
|
+
defaultValue;
|
|
40
|
+
ownerModule;
|
|
41
|
+
description;
|
|
42
|
+
/**
|
|
43
|
+
* Platform-wide "global override" the admin has set. NULL means no global
|
|
44
|
+
* override — the resolver falls back to `defaultValue`. Per-channel
|
|
45
|
+
* `SettingValue` rows take precedence over this for their channel.
|
|
46
|
+
*/
|
|
47
|
+
globalValue;
|
|
48
|
+
/**
|
|
49
|
+
* Closed list of allowed values for an enum-style `string` setting (manifest
|
|
50
|
+
* `enumOptions`). NULL ⇒ ordinary free-text setting. When set, the admin
|
|
51
|
+
* renders a dropdown and value writes are constrained to these options.
|
|
52
|
+
*/
|
|
53
|
+
enumOptions;
|
|
54
|
+
/**
|
|
55
|
+
* Feature 058 — for a `credential_ref` setting, the configuration type its
|
|
56
|
+
* reference is constrained to (e.g. `'llm'`). NULL for every other value
|
|
57
|
+
* type. Manifest-driven config, kept in sync by the reconciler.
|
|
58
|
+
*/
|
|
59
|
+
configurationType;
|
|
60
|
+
/**
|
|
61
|
+
* When true, the setting is excluded from the generic admin Settings screen
|
|
62
|
+
* and managed exclusively through its owning module's dedicated UI (e.g. the
|
|
63
|
+
* PWA settings page). It stays fully readable/writable by code. Manifest-
|
|
64
|
+
* driven config, kept in sync on every reconciliation.
|
|
65
|
+
*/
|
|
66
|
+
hidden = false;
|
|
67
|
+
/**
|
|
68
|
+
* Sales-channel scope. Empty collection ⇒ "applies to all sales channels"
|
|
69
|
+
* (FR-004 / R-5). Backed by the `setting_sales_channels` join table.
|
|
70
|
+
*/
|
|
71
|
+
salesChannels = new Collection(this);
|
|
72
|
+
createdAt = new Date();
|
|
73
|
+
updatedAt = new Date();
|
|
74
|
+
};
|
|
75
|
+
__decorate([
|
|
76
|
+
PrimaryKey({ type: 'uuid' }),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], Setting.prototype, "id", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Property({ type: 'string', length: 160 }),
|
|
81
|
+
Unique(),
|
|
82
|
+
__metadata("design:type", String)
|
|
83
|
+
], Setting.prototype, "code", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
Property({ type: 'string', length: 200 }),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], Setting.prototype, "name", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
ManyToOne(() => SettingGroup, { fieldName: 'group_id' }),
|
|
90
|
+
Index(),
|
|
91
|
+
__metadata("design:type", SettingGroup)
|
|
92
|
+
], Setting.prototype, "group", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
Enum({ items: () => SETTING_VALUE_TYPES, nativeEnumName: 'setting_value_type', fieldName: 'value_type' }),
|
|
95
|
+
__metadata("design:type", String)
|
|
96
|
+
], Setting.prototype, "valueType", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
Property({ type: 'json', fieldName: 'default_value' }),
|
|
99
|
+
__metadata("design:type", Object)
|
|
100
|
+
], Setting.prototype, "defaultValue", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
Property({ type: 'string', length: 120, fieldName: 'owner_module' }),
|
|
103
|
+
Index(),
|
|
104
|
+
__metadata("design:type", String)
|
|
105
|
+
], Setting.prototype, "ownerModule", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
Property({ type: 'text', nullable: true }),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], Setting.prototype, "description", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
Property({ type: 'json', nullable: true, fieldName: 'global_value' }),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], Setting.prototype, "globalValue", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
Property({ type: 'json', nullable: true, fieldName: 'enum_options' }),
|
|
116
|
+
__metadata("design:type", Object)
|
|
117
|
+
], Setting.prototype, "enumOptions", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
Property({ type: 'string', length: 64, nullable: true, fieldName: 'configuration_type' }),
|
|
120
|
+
__metadata("design:type", Object)
|
|
121
|
+
], Setting.prototype, "configurationType", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
Property({ type: 'boolean', default: false }),
|
|
124
|
+
__metadata("design:type", Boolean)
|
|
125
|
+
], Setting.prototype, "hidden", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
ManyToMany(() => SalesChannel, undefined, {
|
|
128
|
+
pivotTable: 'setting_sales_channels',
|
|
129
|
+
joinColumn: 'setting_id',
|
|
130
|
+
inverseJoinColumn: 'sales_channel_id',
|
|
131
|
+
}),
|
|
132
|
+
__metadata("design:type", Object)
|
|
133
|
+
], Setting.prototype, "salesChannels", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
Property({ type: 'datetime', onCreate: () => new Date(), fieldName: 'created_at' }),
|
|
136
|
+
__metadata("design:type", Date)
|
|
137
|
+
], Setting.prototype, "createdAt", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
Property({ type: 'datetime', onUpdate: () => new Date(), fieldName: 'updated_at' }),
|
|
140
|
+
__metadata("design:type", Date)
|
|
141
|
+
], Setting.prototype, "updatedAt", void 0);
|
|
142
|
+
Setting = __decorate([
|
|
143
|
+
GlobalEntity(),
|
|
144
|
+
Entity({ tableName: 'settings' })
|
|
145
|
+
], Setting);
|
|
146
|
+
export { Setting };
|
|
147
|
+
//# sourceMappingURL=setting.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting.entity.js","sourceRoot":"","sources":["../../../src/kernel/settings/setting.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,UAAU,EACV,MAAM,EACN,IAAI,EACJ,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEzE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,MAAM;IACN,aAAa;IACb,QAAQ;IACR,yEAAyE;IACzE,gBAAgB;CACR,CAAC;AAGX;;;;;;GAMG;AAGI,IAAM,OAAO,GAAb,MAAM,OAAO;IAClB,CAAC,aAAa,CAAC,CAQF;IAGb,EAAE,GAAW,UAAU,EAAE,CAAC;IAI1B,IAAI,CAAU;IAGd,IAAI,CAAU;IAId,KAAK,CAAgB;IAGrB,SAAS,CAAsB;IAG/B,YAAY,CAAW;IAIvB,WAAW,CAAU;IAGrB,WAAW,CAAiB;IAE5B;;;;OAIG;IAEH,WAAW,CAAkB;IAE7B;;;;OAIG;IAEH,WAAW,CAAmB;IAE9B;;;;OAIG;IAEH,iBAAiB,CAAiB;IAElC;;;;;OAKG;IAEH,MAAM,GAAY,KAAK,CAAC;IAExB;;;OAGG;IAMH,aAAa,GAAG,IAAI,UAAU,CAAe,IAAI,CAAC,CAAC;IAGnD,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;IAG7B,SAAS,GAAS,IAAI,IAAI,EAAE,CAAC;CAC9B,CAAA;AA3EC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;mCACH;AAI1B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IACzC,MAAM,EAAE;;qCACK;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;qCAC5B;AAId;IAFC,SAAS,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACxD,KAAK,EAAE;8BACA,YAAY;sCAAC;AAGrB;IADC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;;0CAC3E;AAG/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;6CAChC;AAIvB;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;IACpE,KAAK,EAAE;;4CACa;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACf;AAQ5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;4CACzC;AAQ7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;;4CACxC;AAQ9B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;;kDACxD;AASlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uCACtB;AAWxB;IALC,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE;QACzC,UAAU,EAAE,wBAAwB;QACpC,UAAU,EAAE,YAAY;QACxB,iBAAiB,EAAE,kBAAkB;KACtC,CAAC;;8CACiD;AAGnD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8BACzE,IAAI;0CAAc;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8BACzE,IAAI;0CAAc;AAtFlB,OAAO;IAFnB,YAAY,EAAE;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;GACrB,OAAO,CAuFnB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { Redis } from 'ioredis';
|
|
2
|
+
/**
|
|
3
|
+
* Read-through cache for `SettingsService.get` — feature 004 / US3 (T050).
|
|
4
|
+
*
|
|
5
|
+
* Two layers, in this order on read:
|
|
6
|
+
* 1. Per-process LRU (cheap; absorbs intra-request bursts).
|
|
7
|
+
* 2. Redis (`settings:v1:<code>:<channelId>`, TTL 1h; survives restarts).
|
|
8
|
+
*
|
|
9
|
+
* Invalidation goes the other way: write → drop in Redis → drop in LRU. The
|
|
10
|
+
* write seam calls {@link SettingsCacheInvalidation} itself and awaits it
|
|
11
|
+
* (issue #45); until then the drop rode an EventBus notification, which made it
|
|
12
|
+
* a function of *which handler the bus reached first*.
|
|
13
|
+
*
|
|
14
|
+
* Dropping the shared layer first is deliberate: it is the layer that outlives
|
|
15
|
+
* this process and would otherwise be re-pulled into every other process's
|
|
16
|
+
* LRU. Dropping it is also the step that can fail (network, closed
|
|
17
|
+
* connection), and a half-done invalidation must degrade to "slower but
|
|
18
|
+
* correct", never to "fast and wrong". {@link SharedDropMarks} holds the two
|
|
19
|
+
* guards that enforce it.
|
|
20
|
+
*
|
|
21
|
+
* **The local layer expires.** The EventBus is in-process (`events/bus.ts`),
|
|
22
|
+
* so a second API instance learns about a write only through the shared layer:
|
|
23
|
+
* invalidation is, across processes, a broadcast that can be missed. Redis
|
|
24
|
+
* expires its entries after an hour; without {@link SETTINGS_LRU_TTL_MS} the
|
|
25
|
+
* LRU expired nothing and was bounded only by its capacity, so a process that
|
|
26
|
+
* missed a notification served the pre-write value indefinitely — the one case
|
|
27
|
+
* the operator's "clear cache" button cannot fix, because clearing rides the
|
|
28
|
+
* same in-process path that already failed. The window is on the value's age,
|
|
29
|
+
* never refreshed by a read: a setting read on every request is exactly the
|
|
30
|
+
* entry a sliding window would pin forever.
|
|
31
|
+
*
|
|
32
|
+
* Stored values are JSON-serialised so structured types (objects, arrays)
|
|
33
|
+
* survive the Redis hop. The `null` sentinel is never stored — absence of a
|
|
34
|
+
* key means "cache miss"; falsy values like `false`, `0`, `""` are valid.
|
|
35
|
+
*/
|
|
36
|
+
/** Shared with the operator-facing cache-clear surface, so the two cannot drift. */
|
|
37
|
+
export declare const SETTINGS_CACHE_KEY_PREFIX = "settings:v1:";
|
|
38
|
+
export declare const SETTINGS_CACHE_NAMESPACE = "settings";
|
|
39
|
+
/**
|
|
40
|
+
* Maximum age of an entry in the per-process layer.
|
|
41
|
+
*
|
|
42
|
+
* 30 s is chosen from both ends. The layer exists to remove the Redis hop from
|
|
43
|
+
* a path read several times per request, and a request burst — a page load, a
|
|
44
|
+
* checkout step, a worker's batch — lives well inside 30 s, so the hit rate
|
|
45
|
+
* that justifies the layer is untouched; a 5 s window (what `custom_fields`
|
|
46
|
+
* uses for a far colder key space) would put a Redis round trip back on the
|
|
47
|
+
* hot path many times a second. At the other end, 30 s is a bound an operator
|
|
48
|
+
* experiences as "reload the page and it is right" rather than as a defect,
|
|
49
|
+
* and it is two orders of magnitude below the hour Redis keeps its own copy —
|
|
50
|
+
* which is what makes the self-healing real rather than theoretical.
|
|
51
|
+
*/
|
|
52
|
+
export declare const SETTINGS_LRU_TTL_MS = 30000;
|
|
53
|
+
/**
|
|
54
|
+
* The invalidating half of the cache, as the **write seam** sees it (issue #45).
|
|
55
|
+
*
|
|
56
|
+
* `SettingsAdminService` — the one place a setting value or group changes —
|
|
57
|
+
* takes this and awaits it before it emits `settings.value_changed`. That is
|
|
58
|
+
* what makes the drop a property of the write instead of a property of the
|
|
59
|
+
* dispatch order: a caller that writes and reads back in the same tick, in the
|
|
60
|
+
* same `EventBus.run` scope, or with any number of module subscribers on the
|
|
61
|
+
* bus, cannot observe the pre-write value.
|
|
62
|
+
*
|
|
63
|
+
* Narrow on purpose. The reader (`SettingsService`) holds the whole
|
|
64
|
+
* {@link SettingsCache}; the writer needs only these two, and a module that can
|
|
65
|
+
* only invalidate cannot accidentally seed the cache from the write path.
|
|
66
|
+
*/
|
|
67
|
+
export interface SettingsCacheInvalidation {
|
|
68
|
+
/**
|
|
69
|
+
* Drop every cached entry for one setting code, across every channel, on
|
|
70
|
+
* behalf of a write that has **already committed**.
|
|
71
|
+
*
|
|
72
|
+
* Returns the number of shared keys deleted, or `null` when the shared layer
|
|
73
|
+
* could not be reached. The degrade lives here rather than in a `catch` at
|
|
74
|
+
* the call site, and it is in the return type on purpose: the row is written
|
|
75
|
+
* and audited, so a Redis blip must not fail the operator's request or make
|
|
76
|
+
* them retry a write that succeeded. Correctness does not rest on the number
|
|
77
|
+
* — {@link SharedDropMarks} has marked the prefix failed, so this process
|
|
78
|
+
* bypasses both layers for those keys and retries the drop on the next read.
|
|
79
|
+
*/
|
|
80
|
+
invalidateAfterWrite(code: string): Promise<number | null>;
|
|
81
|
+
/**
|
|
82
|
+
* The same contract for a group change, which can move settings between
|
|
83
|
+
* groups or rescope channels and so can change resolution for any number of
|
|
84
|
+
* codes.
|
|
85
|
+
*/
|
|
86
|
+
invalidateAllAfterWrite(): Promise<number | null>;
|
|
87
|
+
}
|
|
88
|
+
export declare class SettingsCache implements SettingsCacheInvalidation {
|
|
89
|
+
private readonly redis;
|
|
90
|
+
/** Injectable so a test can advance the TTL window without a real clock. */
|
|
91
|
+
private readonly now;
|
|
92
|
+
private readonly lru;
|
|
93
|
+
private readonly marks;
|
|
94
|
+
constructor(redis: Redis,
|
|
95
|
+
/** Injectable so a test can advance the TTL window without a real clock. */
|
|
96
|
+
now?: () => number);
|
|
97
|
+
private static composeKey;
|
|
98
|
+
/**
|
|
99
|
+
* Returns:
|
|
100
|
+
* - { hit: true; value: unknown } when the value (or "not registered" sentinel) is cached
|
|
101
|
+
* - { hit: false } when the caller must fall through to Postgres
|
|
102
|
+
* The "not registered" sentinel is encoded as `{ __settings_not_registered__: true }`.
|
|
103
|
+
*/
|
|
104
|
+
get(code: string, channelId: string | null): Promise<{
|
|
105
|
+
hit: false;
|
|
106
|
+
} | {
|
|
107
|
+
hit: true;
|
|
108
|
+
value: unknown;
|
|
109
|
+
notRegistered?: boolean;
|
|
110
|
+
}>;
|
|
111
|
+
set(code: string, channelId: string | null, value: unknown): Promise<void>;
|
|
112
|
+
/** Cache the "not registered" outcome so repeated typos don't hammer Postgres. */
|
|
113
|
+
setNotRegistered(code: string, channelId: string | null): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Drop every cached entry for a given setting code (across every channel).
|
|
116
|
+
* Returns how many shared keys were deleted.
|
|
117
|
+
*/
|
|
118
|
+
invalidate(code: string): Promise<number>;
|
|
119
|
+
/**
|
|
120
|
+
* Used after group-level changes that may affect many codes, and by the
|
|
121
|
+
* operator-facing cache clear. Returns how many shared keys were deleted.
|
|
122
|
+
*/
|
|
123
|
+
invalidateAll(): Promise<number>;
|
|
124
|
+
/** {@inheritDoc SettingsCacheInvalidation.invalidateAfterWrite} */
|
|
125
|
+
invalidateAfterWrite(code: string): Promise<number | null>;
|
|
126
|
+
/** {@inheritDoc SettingsCacheInvalidation.invalidateAllAfterWrite} */
|
|
127
|
+
invalidateAllAfterWrite(): Promise<number | null>;
|
|
128
|
+
/**
|
|
129
|
+
* The one place the write seam's tolerance is written down.
|
|
130
|
+
*
|
|
131
|
+
* `drop` has already marked the prefix failed by the time it re-throws, so
|
|
132
|
+
* every read in this process bypasses both layers for those keys and retries
|
|
133
|
+
* the drop until Redis answers — the invariant is intact and the answer is
|
|
134
|
+
* "slower but correct". What is left of the throw is a report, and a report
|
|
135
|
+
* must not undo the write that produced it.
|
|
136
|
+
*/
|
|
137
|
+
private afterWrite;
|
|
138
|
+
/**
|
|
139
|
+
* Drop both layers for a key prefix, shared layer first. The prefix is
|
|
140
|
+
* marked for the whole operation so concurrent reads and writes cannot
|
|
141
|
+
* observe or restore the pre-invalidation state; the mark is only released
|
|
142
|
+
* once the shared layer is known to be clean.
|
|
143
|
+
*/
|
|
144
|
+
private drop;
|
|
145
|
+
/** SCAN + DEL, to avoid blocking on KEYS in production-sized databases. */
|
|
146
|
+
private dropShared;
|
|
147
|
+
private dropLocal;
|
|
148
|
+
/**
|
|
149
|
+
* True when neither layer may be trusted for this key: a drop is in flight,
|
|
150
|
+
* or an earlier drop failed and Redis was never cleaned. In the failed case
|
|
151
|
+
* the drop is retried here, so a transient outage costs the affected codes
|
|
152
|
+
* their caching until Redis answers again — not for the process lifetime.
|
|
153
|
+
*/
|
|
154
|
+
private isBypassed;
|
|
155
|
+
private touchLru;
|
|
156
|
+
private isNotRegisteredSentinel;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=settings-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-cache.d.ts","sourceRoot":"","sources":["../../../src/kernel/settings/settings-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAuB1C;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;;;;;;;;OAWG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC3D;;;;OAIG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACnD;AAED,qBAAa,aAAc,YAAW,yBAAyB;IAK3D,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,4EAA4E;IAC5E,OAAO,CAAC,QAAQ,CAAC,GAAG;IANtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;gBAG5B,KAAK,EAAE,KAAK;IAC7B,4EAA4E;IAC3D,GAAG,GAAE,MAAM,MAAyB;IAGvD,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB;;;;;OAKG;IACG,GAAG,CACP,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,IAAI,GACvB,OAAO,CAAC;QAAE,GAAG,EAAE,KAAK,CAAA;KAAE,GAAG;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IA8B7E,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAShF,kFAAkF;IAC5E,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7E;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/C;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC,mEAAmE;IAC7D,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIhE,sEAAsE;IAChE,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIvD;;;;;;;;OAQG;YACW,UAAU;IAQxB;;;;;OAKG;YACW,IAAI;IAiBlB,2EAA2E;YAC7D,UAAU;IAmBxB,OAAO,CAAC,SAAS;IAMjB;;;;;OAKG;YACW,UAAU;IAaxB,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,uBAAuB;CAQhC"}
|