@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,74 @@
|
|
|
1
|
+
import { type EntityClassLike } from '../packages/package-runtime.js';
|
|
2
|
+
/**
|
|
3
|
+
* The entity classes this platform registers: the committed core registry the
|
|
4
|
+
* host supplies, plus every installed extension package's own (feature 080,
|
|
5
|
+
* T033 — D-106.2).
|
|
6
|
+
*
|
|
7
|
+
* The sibling of `configured-migrations.ts`, and async for the same reason: the
|
|
8
|
+
* committed registry is emitted by a source-text walk for the MikroORM entity
|
|
9
|
+
* decorator (`generate-composer.ts`), and compilation turns that decorator into
|
|
10
|
+
* a `__decorate([...])` call — so a published package contributes nothing to it
|
|
11
|
+
* and could not, whatever the generator did. Which packages an instance
|
|
12
|
+
* installed is a fact about the process (D-119/D-155), so the second half is
|
|
13
|
+
* read at runtime, through the package's own `./backend` export.
|
|
14
|
+
*
|
|
15
|
+
* ## The core half is **received**, not imported (`specs/110-instance-repository/` R7.4)
|
|
16
|
+
*
|
|
17
|
+
* `entities-registry.generated.ts` is a fact about *one repository's tree*, is
|
|
18
|
+
* host-owned (D-160.3), and the platform may not name a file in the tree that
|
|
19
|
+
* installs it (D-52/D-53). So it arrives as a parameter and this file knows
|
|
20
|
+
* nothing about where it came from. `backend/src/db/configured-entities.ts` is
|
|
21
|
+
* the binding that supplies it, and an instance writes the same three lines
|
|
22
|
+
* against its own index — the shape `registered-manifests.ts` took in
|
|
23
|
+
* `specs/115-lifecycle-container-move/` Phase 3.
|
|
24
|
+
*
|
|
25
|
+
* Memoisation stays with the binding for the same reason: how many times one
|
|
26
|
+
* process may ask is a fact about that process.
|
|
27
|
+
*
|
|
28
|
+
* It lives beside the migration seam rather than inside it because the two
|
|
29
|
+
* answer different questions to different readers — the ORM configuration is
|
|
30
|
+
* the only reader of the entity set, while the order has three — but both are
|
|
31
|
+
* one merge over the one discovery in `../packages/`.
|
|
32
|
+
*
|
|
33
|
+
* ## It is also where the tenancy chains are reconciled (feature 080, T049)
|
|
34
|
+
*
|
|
35
|
+
* Since D-169 a `@TransitivelyScoped` entity names its parent by class name
|
|
36
|
+
* rather than by importing the class, so a name that resolves to nothing is
|
|
37
|
+
* possible in a way it was not before — and a transitively scoped entity has no
|
|
38
|
+
* tenant column of its own, so that would leave it reachable with no tenant
|
|
39
|
+
* predicate at all (Principle XI, non-negotiable).
|
|
40
|
+
*
|
|
41
|
+
* This is the first moment the question can honestly be asked. The decorator
|
|
42
|
+
* cannot ask it: entity classes register in import order and a child is
|
|
43
|
+
* routinely imported before its parent. The line below is the instant after
|
|
44
|
+
* every classification decorator has run — the committed registry above plus
|
|
45
|
+
* every installed package's entities — and still before the ORM exists, so no
|
|
46
|
+
* query can have been issued under a chain that does not resolve. It throws
|
|
47
|
+
* `UnresolvableTenantParentError`, which stops the boot; there is deliberately
|
|
48
|
+
* no degraded mode, because the degraded mode is an untenanted read.
|
|
49
|
+
*
|
|
50
|
+
* Since T054(a) (D-170) it walks the whole chain rather than one hop, and
|
|
51
|
+
* refuses one that resolves at every step and grounds nowhere — a `global` or
|
|
52
|
+
* `rule` terminus, a cycle, a run of transitives reaching no keyed
|
|
53
|
+
* classification. It also emits an `info` line for a chain that terminates at a
|
|
54
|
+
* `customer`, which is legal and has a gap worth naming; the logger is passed
|
|
55
|
+
* from here because that is where the platform's destination is nameable, and
|
|
56
|
+
* `tenancy/` deliberately imports nothing from `kernel/`.
|
|
57
|
+
*/
|
|
58
|
+
export type ConfiguredEntity = EntityClassLike;
|
|
59
|
+
/** What {@link configuredEntitiesFrom} needs from the host. */
|
|
60
|
+
export interface EntityConfigurationInputs {
|
|
61
|
+
/**
|
|
62
|
+
* The committed core registry — `ALL_ENTITIES` in this repository's tree.
|
|
63
|
+
*
|
|
64
|
+
* Declared as the structural shape rather than imported, for
|
|
65
|
+
* `DiscoveredManifestEntry`'s reason: `tsc` holds the two together at the
|
|
66
|
+
* binding's call site, so an entity dropped from the generated array fails in
|
|
67
|
+
* the host's own type-check.
|
|
68
|
+
*/
|
|
69
|
+
readonly coreEntities: readonly EntityClassLike[];
|
|
70
|
+
/** Selects the `node_modules` roots the package scan reads. */
|
|
71
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
72
|
+
}
|
|
73
|
+
export declare function configuredEntitiesFrom(inputs: EntityConfigurationInputs): Promise<readonly ConfiguredEntity[]>;
|
|
74
|
+
//# sourceMappingURL=configured-entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-entities.d.ts","sourceRoot":"","sources":["../../src/db/configured-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAK7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAE/C,+DAA+D;AAC/D,MAAM,WAAW,yBAAyB;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,EAAE,SAAS,eAAe,EAAE,CAAC;IAClD,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAClC;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CActC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { discoverPackageSchema } from '../packages/package-runtime.js';
|
|
2
|
+
import { assertTransitiveParentsResolve } from '../tenancy/org-scoped.decorator.js';
|
|
3
|
+
import { platformLogger } from '../kernel/logging.js';
|
|
4
|
+
import { PLATFORM_ENTITIES, mergeByIdentity } from './platform-schema.js';
|
|
5
|
+
export async function configuredEntitiesFrom(inputs) {
|
|
6
|
+
const packages = await discoverPackageSchema(inputs.env ?? process.env);
|
|
7
|
+
const entities = [
|
|
8
|
+
// The platform's own six first (`specs/110-instance-repository/` T141).
|
|
9
|
+
// They are this package's, and an instance supplies `coreEntities: []` —
|
|
10
|
+
// which used to mean it registered none of them, so nothing mapped the
|
|
11
|
+
// tables its own migrations create. Where a host names them, as this
|
|
12
|
+
// repository's generated registry does by bare specifier, the merge is an
|
|
13
|
+
// identity de-duplication over the same class objects.
|
|
14
|
+
...mergeByIdentity(PLATFORM_ENTITIES, inputs.coreEntities),
|
|
15
|
+
...packages.flatMap((contribution) => contribution.entities),
|
|
16
|
+
];
|
|
17
|
+
assertTransitiveParentsResolve(platformLogger());
|
|
18
|
+
return entities;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=configured-entities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-entities.js","sourceRoot":"","sources":["../../src/db/configured-entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAwB,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA2E1E,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAiC;IAEjC,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACxE,MAAM,QAAQ,GAAG;QACf,wEAAwE;QACxE,yEAAyE;QACzE,uEAAuE;QACvE,qEAAqE;QACrE,0EAA0E;QAC1E,uDAAuD;QACvD,GAAG,eAAe,CAAC,iBAAiB,EAAE,MAAM,CAAC,YAAY,CAAC;QAC1D,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC;KAC7D,CAAC;IACF,8BAA8B,CAAC,cAAc,EAAE,CAAC,CAAC;IACjD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type { MigrationObject } from '@mikro-orm/core';
|
|
2
|
+
import { type PackageSchemaContribution } from '../packages/package-runtime.js';
|
|
3
|
+
import type { DiscoveredManifestEntry } from '../lifecycle/manifest-registry.js';
|
|
4
|
+
import { type MigrationOrderDiagnostic, type MigrationOrigin, type MigrationRegistryEntry } from './migration-order.js';
|
|
5
|
+
/**
|
|
6
|
+
* The migration order this platform runs, as a value — with no database in it.
|
|
7
|
+
*
|
|
8
|
+
* `mikro-orm.config.ts` computed this inline and nothing else could read it,
|
|
9
|
+
* because reading it meant importing that config, and **the config captures
|
|
10
|
+
* `DATABASE_URL` at import**: whichever database that variable names when the
|
|
11
|
+
* first import happens is the one the process migrates for the rest of its
|
|
12
|
+
* life. The test harness needs the order *before* it knows which database this
|
|
13
|
+
* run will migrate — issue #289 keys the migration template on it — so the
|
|
14
|
+
* ordering lives here, where it depends on the registry and the manifests and
|
|
15
|
+
* on nothing about a connection.
|
|
16
|
+
*
|
|
17
|
+
* ## Why it is a function, and an `async` one (feature 080, T033 / D-155.4)
|
|
18
|
+
*
|
|
19
|
+
* An installed extension package may ship migrations (D-106.2), and which
|
|
20
|
+
* packages an instance installed is a fact about *the process*, not about the
|
|
21
|
+
* tree — so the committed registries stay bare core and the package half is
|
|
22
|
+
* discovered at runtime (D-119, confirmed as D-155). Discovery reads
|
|
23
|
+
* `node_modules` and dynamically `import()`s each package's `./migrations`
|
|
24
|
+
* export, so the merged order can only be a promise.
|
|
25
|
+
*
|
|
26
|
+
* It is an **async factory rather than a promise-valued export**, and the
|
|
27
|
+
* difference is the defect this file was extracted to escape, one axis over: a
|
|
28
|
+
* promise created at import starts that `node_modules` scan in *every* process
|
|
29
|
+
* that touches this module — including one that only wanted `RegisteredMigration`
|
|
30
|
+
* as a type — and turns a discovery failure into an unhandled rejection in any
|
|
31
|
+
* process that imports without awaiting. A factory does nothing until somebody
|
|
32
|
+
* asks.
|
|
33
|
+
*
|
|
34
|
+
* The result is memoised for the process, because an instance's `node_modules`
|
|
35
|
+
* does not change while the platform runs and there are fourteen direct
|
|
36
|
+
* importers of the ORM config; fourteen call sites must not mean fourteen
|
|
37
|
+
* scans. {@link configuredMigrationsFrom} is the same merge with no discovery
|
|
38
|
+
* in it, for a caller that brings its own inputs.
|
|
39
|
+
*
|
|
40
|
+
* `orderMigrations` throws on a duplicate name, a duplicate per-module
|
|
41
|
+
* timestamp, an unscoped class name or an unknown module id — a loud,
|
|
42
|
+
* actionable failure by design, now raised on the first call rather than at
|
|
43
|
+
* import. A dependency *cycle* is a diagnostic instead, and reacting to it
|
|
44
|
+
* belongs to the readers: see the comment on the warning loop in
|
|
45
|
+
* `mikro-orm.config.ts`.
|
|
46
|
+
*/
|
|
47
|
+
/** A migration this platform runs, and which producer contributed it. */
|
|
48
|
+
export interface RegisteredMigration {
|
|
49
|
+
/** The class name — what `mikro_orm_migrations` records. */
|
|
50
|
+
readonly name: string;
|
|
51
|
+
readonly origin: MigrationOrigin;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Re-exported, declared in `@endora-commerce/platform`.
|
|
55
|
+
*
|
|
56
|
+
* The orchestrator is the one caller that *asks* the question, and it lives in
|
|
57
|
+
* the platform, which may not name a file this application owns (D-52/D-53).
|
|
58
|
+
* So the shape is declared there and the **answer** — the merge of the
|
|
59
|
+
* committed core registry with whatever packages this instance installed — is
|
|
60
|
+
* built here, where the discovery is. One name for it either way.
|
|
61
|
+
*/
|
|
62
|
+
export type { MigrationOwnership } from '../lifecycle/services/migration-ownership.js';
|
|
63
|
+
import type { MigrationOwnership } from '../lifecycle/services/migration-ownership.js';
|
|
64
|
+
/** The result of merging every producer's migrations into one execution order. */
|
|
65
|
+
export interface ConfiguredMigrations {
|
|
66
|
+
/** Assigned verbatim to `migrations.migrationsList`. */
|
|
67
|
+
readonly migrations: MigrationObject[];
|
|
68
|
+
/** The ordered set with each entry's origin. */
|
|
69
|
+
readonly registered: readonly RegisteredMigration[];
|
|
70
|
+
/** The class names, in execution order — what a migrated database records. */
|
|
71
|
+
readonly names: readonly string[];
|
|
72
|
+
readonly diagnostics: readonly MigrationOrderDiagnostic[];
|
|
73
|
+
/** Who owns what, for the lifecycle orchestrator's uninstall-revert. */
|
|
74
|
+
readonly ownership: MigrationOwnership;
|
|
75
|
+
/** The installed packages this order was merged from. Empty for bare core. */
|
|
76
|
+
readonly packages: readonly PackageSchemaContribution[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The cross-cutting pseudo-module owning the platform's own migrations.
|
|
80
|
+
*
|
|
81
|
+
* Declared in `./platform-schema.ts`, beside the twelve migrations it owns, and
|
|
82
|
+
* re-exported here because five programs outside that file need the same
|
|
83
|
+
* literal — the scaffolder, the registry round-trip, the instance-order guard
|
|
84
|
+
* and the two merges below — and a second spelling of a module id is a second
|
|
85
|
+
* answer waiting to disagree. It moved when this file learned to read that one:
|
|
86
|
+
* a constant declared here and read back from there is an import cycle
|
|
87
|
+
* evaluated in whichever order a consumer happened to enter it.
|
|
88
|
+
*/
|
|
89
|
+
export { CORE_MODULE_ID } from './platform-schema.js';
|
|
90
|
+
/**
|
|
91
|
+
* The committed core artefacts, **received** rather than imported
|
|
92
|
+
* (`specs/110-instance-repository/` R7.4, FR-014).
|
|
93
|
+
*
|
|
94
|
+
* `migrations-registry.generated.ts` and `manifest-index.generated.ts` are
|
|
95
|
+
* facts about *one repository's tree*, are host-owned (D-160.3, D-104) and stay
|
|
96
|
+
* bare core under every value of `DEPLOYMENT` — so the platform may not name
|
|
97
|
+
* either (D-52/D-53). `backend/src/db/configured-migrations.ts` is the binding
|
|
98
|
+
* that supplies them, and an instance writes the same two lines against its own
|
|
99
|
+
* artefacts.
|
|
100
|
+
*/
|
|
101
|
+
export interface CoreMigrationSources {
|
|
102
|
+
/** The committed migration registry — `MIGRATION_REGISTRY` in this tree. */
|
|
103
|
+
readonly coreEntries: readonly MigrationRegistryEntry[];
|
|
104
|
+
/**
|
|
105
|
+
* The generated manifest index this build ships — `DISCOVERED_MANIFESTS`.
|
|
106
|
+
*
|
|
107
|
+
* Declared structurally in `../lifecycle/manifest-registry.ts` for the reason
|
|
108
|
+
* given there: `tsc` holds the generated shape and this one together at the
|
|
109
|
+
* binding's call site.
|
|
110
|
+
*/
|
|
111
|
+
readonly manifests: readonly DiscoveredManifestEntry[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Build an ownership answer over an explicit registry and an explicit set of
|
|
115
|
+
* modules that registry is authoritative for.
|
|
116
|
+
*
|
|
117
|
+
* The covered set is **not** derived from the entries: a module that ships no
|
|
118
|
+
* migration is covered and owns none, and those are the two answers that must
|
|
119
|
+
* not be confused. It comes from the manifests the registry was built
|
|
120
|
+
* alongside, which is the only thing that knows a module exists at all.
|
|
121
|
+
*/
|
|
122
|
+
export declare function migrationOwnershipOf(entries: readonly MigrationRegistryEntry[], coveredModuleIds: Iterable<string>): MigrationOwnership;
|
|
123
|
+
/**
|
|
124
|
+
* Ownership over the **committed core registry alone** — no discovery, no
|
|
125
|
+
* `node_modules`, nothing async.
|
|
126
|
+
*
|
|
127
|
+
* This is what a caller that never merged a package gets, and it is a
|
|
128
|
+
* declaration rather than a fallback: it says *"I was given the core registry,
|
|
129
|
+
* so I answer for core modules and for nothing else"*. Handed a package's
|
|
130
|
+
* module id it returns `null`, which the orchestrator refuses on — the right
|
|
131
|
+
* answer, because a core-only registry genuinely cannot enumerate a package's
|
|
132
|
+
* chain and reverting nothing would leave the package's table behind.
|
|
133
|
+
*/
|
|
134
|
+
export declare function committedMigrationOwnership(sources: CoreMigrationSources): MigrationOwnership;
|
|
135
|
+
/**
|
|
136
|
+
* Merge one producer set into an execution order — the whole computation, with
|
|
137
|
+
* no discovery in it.
|
|
138
|
+
*
|
|
139
|
+
* Exported so a test can drive the merge over inputs it built itself, and so
|
|
140
|
+
* the discovery path below has nothing of its own to get wrong.
|
|
141
|
+
*/
|
|
142
|
+
export declare function configuredMigrationsFrom(inputs: {
|
|
143
|
+
readonly coreEntries: readonly MigrationRegistryEntry[];
|
|
144
|
+
readonly coreModuleDependencies: ReadonlyMap<string, readonly string[]>;
|
|
145
|
+
readonly packages: readonly PackageSchemaContribution[];
|
|
146
|
+
/**
|
|
147
|
+
* The frozen historical prefix, by identity. Defaults to the list
|
|
148
|
+
* `@endora-commerce/platform` publishes, which is what every real composition
|
|
149
|
+
* uses.
|
|
150
|
+
*
|
|
151
|
+
* It is a parameter for the reason the two inputs above are: so a guard can
|
|
152
|
+
* drive the real merge over a baseline it built itself.
|
|
153
|
+
* `test/unit/db/instance-migration-order.test.ts` computes the *unrepaired*
|
|
154
|
+
* membership predicate as a list and orders the same corpus with it, which is
|
|
155
|
+
* how the defect this feature closed stays measurable after the repair
|
|
156
|
+
* instead of becoming a sentence in a doc block.
|
|
157
|
+
*/
|
|
158
|
+
readonly baseline?: readonly string[];
|
|
159
|
+
}): ConfiguredMigrations;
|
|
160
|
+
/**
|
|
161
|
+
* The committed core dependency map: `core`, plus every manifest the index
|
|
162
|
+
* holds.
|
|
163
|
+
*
|
|
164
|
+
* This is **the** derivation of the migration ordering graph — the one
|
|
165
|
+
* expression in this platform that turns manifests into the edges
|
|
166
|
+
* `orderMigrations` walks. D-44 §8 singles it out as the site most likely to be
|
|
167
|
+
* broken by a well-meaning later edit, because unioning `nonBindingDependencies`
|
|
168
|
+
* or `acknowledgedDependencies` into it is a two-word change that no type would
|
|
169
|
+
* catch and that buys a cross-module foreign key whose ordering claim lives in
|
|
170
|
+
* an array `fk-dependency-drift.test.ts` does not read.
|
|
171
|
+
*
|
|
172
|
+
* It is exported for the same reason {@link configuredMigrationsFrom} is: so a
|
|
173
|
+
* guard can drive the real derivation instead of reading its source text.
|
|
174
|
+
* `test/contract/_lifecycle/non-binding-dependencies.contract.test.ts` calls it
|
|
175
|
+
* over the live manifests and holds every entry to `manifest.dependencies`
|
|
176
|
+
* exactly, and traces the one `orderMigrations` call back to it through
|
|
177
|
+
* {@link discoverConfiguredMigrations}.
|
|
178
|
+
*
|
|
179
|
+
* That trace, and not a rule about callers, is what refuses a second ordering
|
|
180
|
+
* graph. This sentence used to read *"nothing in `src` calls it but
|
|
181
|
+
* {@link discoverConfiguredMigrations} — a second caller would be a second
|
|
182
|
+
* ordering graph"*, and it was already false when it was written: the host binds
|
|
183
|
+
* this function a second time so that its own tests can drive it over the
|
|
184
|
+
* generated index, and a second **caller** is neither necessary nor sufficient
|
|
185
|
+
* for a second **graph**. What the guard counts is calls of `orderMigrations`;
|
|
186
|
+
* what it follows is the input of the one call there may be.
|
|
187
|
+
*/
|
|
188
|
+
export declare function committedModuleDependencies(manifests: readonly DiscoveredManifestEntry[]): Map<string, readonly string[]>;
|
|
189
|
+
/**
|
|
190
|
+
* This platform's migration order: the committed core registry the host
|
|
191
|
+
* supplies, merged with every installed package's `./migrations` export.
|
|
192
|
+
*
|
|
193
|
+
* `env` selects the `node_modules` roots (`ENDORA_INSTANCE_ROOT`). Memoisation
|
|
194
|
+
* is the binding's, not this file's: how many times one process may ask is a
|
|
195
|
+
* fact about that process, and a memo here would answer a second host's
|
|
196
|
+
* registry with the first one's order.
|
|
197
|
+
*/
|
|
198
|
+
export declare function discoverConfiguredMigrations(sources: CoreMigrationSources, env?: NodeJS.ProcessEnv): Promise<ConfiguredMigrations>;
|
|
199
|
+
//# sourceMappingURL=configured-migrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-migrations.d.ts","sourceRoot":"","sources":["../../src/db/configured-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAO9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,yEAAyE;AACzE,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,YAAY,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,CAAC;IACvC,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACpD,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAC1D,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACzD;AAED;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACxD;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,GACjC,kBAAkB,CAgBpB;AAOD;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,oBAAoB,GAAG,kBAAkB,CAE7F;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,QAAQ,CAAC,WAAW,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACxD,QAAQ,CAAC,sBAAsB,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IACxE,QAAQ,CAAC,QAAQ,EAAE,SAAS,yBAAyB,EAAE,CAAC;IACxD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,GAAG,oBAAoB,CAqDvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,uBAAuB,EAAE,GAC5C,GAAG,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAKhC;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,oBAAoB,EAC7B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,oBAAoB,CAAC,CAoB/B"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { discoverPackageSchema, } from '../packages/package-runtime.js';
|
|
2
|
+
import { BASELINE_MIGRATIONS } from '../migrations/index.js';
|
|
3
|
+
import { orderMigrations, } from './migration-order.js';
|
|
4
|
+
import { CORE_MODULE_ID, PLATFORM_MIGRATION_ENTRIES, mergeByIdentity, } from './platform-schema.js';
|
|
5
|
+
/**
|
|
6
|
+
* The cross-cutting pseudo-module owning the platform's own migrations.
|
|
7
|
+
*
|
|
8
|
+
* Declared in `./platform-schema.ts`, beside the twelve migrations it owns, and
|
|
9
|
+
* re-exported here because five programs outside that file need the same
|
|
10
|
+
* literal — the scaffolder, the registry round-trip, the instance-order guard
|
|
11
|
+
* and the two merges below — and a second spelling of a module id is a second
|
|
12
|
+
* answer waiting to disagree. It moved when this file learned to read that one:
|
|
13
|
+
* a constant declared here and read back from there is an import cycle
|
|
14
|
+
* evaluated in whichever order a consumer happened to enter it.
|
|
15
|
+
*/
|
|
16
|
+
export { CORE_MODULE_ID } from './platform-schema.js';
|
|
17
|
+
/**
|
|
18
|
+
* Build an ownership answer over an explicit registry and an explicit set of
|
|
19
|
+
* modules that registry is authoritative for.
|
|
20
|
+
*
|
|
21
|
+
* The covered set is **not** derived from the entries: a module that ships no
|
|
22
|
+
* migration is covered and owns none, and those are the two answers that must
|
|
23
|
+
* not be confused. It comes from the manifests the registry was built
|
|
24
|
+
* alongside, which is the only thing that knows a module exists at all.
|
|
25
|
+
*/
|
|
26
|
+
export function migrationOwnershipOf(entries, coveredModuleIds) {
|
|
27
|
+
const covered = new Set(coveredModuleIds);
|
|
28
|
+
const byModule = new Map();
|
|
29
|
+
for (const entry of entries) {
|
|
30
|
+
const names = byModule.get(entry.moduleId);
|
|
31
|
+
if (names)
|
|
32
|
+
names.push(entry.cls.name);
|
|
33
|
+
else
|
|
34
|
+
byModule.set(entry.moduleId, [entry.cls.name]);
|
|
35
|
+
}
|
|
36
|
+
for (const names of byModule.values())
|
|
37
|
+
names.sort();
|
|
38
|
+
return {
|
|
39
|
+
coveredModuleIds: covered,
|
|
40
|
+
migrationNamesFor(moduleId) {
|
|
41
|
+
if (!covered.has(moduleId))
|
|
42
|
+
return null;
|
|
43
|
+
return byModule.get(moduleId) ?? [];
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Every module id the committed core artefacts answer for, plus `core` itself. */
|
|
48
|
+
function coreModuleIds(manifests) {
|
|
49
|
+
return [CORE_MODULE_ID, ...manifests.map((entry) => entry.id)];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Ownership over the **committed core registry alone** — no discovery, no
|
|
53
|
+
* `node_modules`, nothing async.
|
|
54
|
+
*
|
|
55
|
+
* This is what a caller that never merged a package gets, and it is a
|
|
56
|
+
* declaration rather than a fallback: it says *"I was given the core registry,
|
|
57
|
+
* so I answer for core modules and for nothing else"*. Handed a package's
|
|
58
|
+
* module id it returns `null`, which the orchestrator refuses on — the right
|
|
59
|
+
* answer, because a core-only registry genuinely cannot enumerate a package's
|
|
60
|
+
* chain and reverting nothing would leave the package's table behind.
|
|
61
|
+
*/
|
|
62
|
+
export function committedMigrationOwnership(sources) {
|
|
63
|
+
return migrationOwnershipOf(sources.coreEntries, coreModuleIds(sources.manifests));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Merge one producer set into an execution order — the whole computation, with
|
|
67
|
+
* no discovery in it.
|
|
68
|
+
*
|
|
69
|
+
* Exported so a test can drive the merge over inputs it built itself, and so
|
|
70
|
+
* the discovery path below has nothing of its own to get wrong.
|
|
71
|
+
*/
|
|
72
|
+
export function configuredMigrationsFrom(inputs) {
|
|
73
|
+
const entries = [
|
|
74
|
+
...inputs.coreEntries,
|
|
75
|
+
...inputs.packages.flatMap((contribution) => contribution.migrations),
|
|
76
|
+
];
|
|
77
|
+
const moduleDependencies = new Map(inputs.coreModuleDependencies);
|
|
78
|
+
// A package's own module is a node in the graph like any other, so its chain
|
|
79
|
+
// lands at its topological position. Its `dependencies` are read from the
|
|
80
|
+
// manifest the package published; an id already in the map is a collision
|
|
81
|
+
// `assertNoPackageModuleIdCollisions` refused before anything got here.
|
|
82
|
+
//
|
|
83
|
+
// Until `specs/110-instance-repository/` T141 that first clause was a comment
|
|
84
|
+
// and not a fact: the fallback was `[]`, and it was unreachable in this
|
|
85
|
+
// repository because the committed index carries every module package. An
|
|
86
|
+
// instance has no index, so every module was a graph root and feature 081's
|
|
87
|
+
// per-module order became whichever order the tie-break produced.
|
|
88
|
+
for (const contribution of inputs.packages) {
|
|
89
|
+
if (!moduleDependencies.has(contribution.id)) {
|
|
90
|
+
moduleDependencies.set(contribution.id, contribution.dependencies);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const ordered = orderMigrations({
|
|
94
|
+
entries,
|
|
95
|
+
moduleDependencies,
|
|
96
|
+
baseline: inputs.baseline ?? BASELINE_MIGRATIONS,
|
|
97
|
+
});
|
|
98
|
+
const registryByName = new Map(entries.map((entry) => [entry.cls.name, entry]));
|
|
99
|
+
const registered = ordered.migrations.map((migration) => {
|
|
100
|
+
const entry = registryByName.get(migration.name);
|
|
101
|
+
if (entry === undefined) {
|
|
102
|
+
throw new Error(`[configured-migrations] "${migration.name}" is in the migration order but not in the ` +
|
|
103
|
+
`registry that order was computed from, so nothing here can say which producer it ` +
|
|
104
|
+
`came from. Whoever merges a second producer's migrations into this order must merge ` +
|
|
105
|
+
`their registry entries too — the test harness floors its template digest per origin.`);
|
|
106
|
+
}
|
|
107
|
+
return { name: migration.name, origin: entry.origin ?? 'core' };
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
migrations: ordered.migrations,
|
|
111
|
+
registered,
|
|
112
|
+
names: registered.map((migration) => migration.name),
|
|
113
|
+
diagnostics: ordered.diagnostics,
|
|
114
|
+
ownership: migrationOwnershipOf(entries, [
|
|
115
|
+
...inputs.coreModuleDependencies.keys(),
|
|
116
|
+
...inputs.packages.map((contribution) => contribution.id),
|
|
117
|
+
]),
|
|
118
|
+
packages: inputs.packages,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The committed core dependency map: `core`, plus every manifest the index
|
|
123
|
+
* holds.
|
|
124
|
+
*
|
|
125
|
+
* This is **the** derivation of the migration ordering graph — the one
|
|
126
|
+
* expression in this platform that turns manifests into the edges
|
|
127
|
+
* `orderMigrations` walks. D-44 §8 singles it out as the site most likely to be
|
|
128
|
+
* broken by a well-meaning later edit, because unioning `nonBindingDependencies`
|
|
129
|
+
* or `acknowledgedDependencies` into it is a two-word change that no type would
|
|
130
|
+
* catch and that buys a cross-module foreign key whose ordering claim lives in
|
|
131
|
+
* an array `fk-dependency-drift.test.ts` does not read.
|
|
132
|
+
*
|
|
133
|
+
* It is exported for the same reason {@link configuredMigrationsFrom} is: so a
|
|
134
|
+
* guard can drive the real derivation instead of reading its source text.
|
|
135
|
+
* `test/contract/_lifecycle/non-binding-dependencies.contract.test.ts` calls it
|
|
136
|
+
* over the live manifests and holds every entry to `manifest.dependencies`
|
|
137
|
+
* exactly, and traces the one `orderMigrations` call back to it through
|
|
138
|
+
* {@link discoverConfiguredMigrations}.
|
|
139
|
+
*
|
|
140
|
+
* That trace, and not a rule about callers, is what refuses a second ordering
|
|
141
|
+
* graph. This sentence used to read *"nothing in `src` calls it but
|
|
142
|
+
* {@link discoverConfiguredMigrations} — a second caller would be a second
|
|
143
|
+
* ordering graph"*, and it was already false when it was written: the host binds
|
|
144
|
+
* this function a second time so that its own tests can drive it over the
|
|
145
|
+
* generated index, and a second **caller** is neither necessary nor sufficient
|
|
146
|
+
* for a second **graph**. What the guard counts is calls of `orderMigrations`;
|
|
147
|
+
* what it follows is the input of the one call there may be.
|
|
148
|
+
*/
|
|
149
|
+
export function committedModuleDependencies(manifests) {
|
|
150
|
+
return new Map([
|
|
151
|
+
[CORE_MODULE_ID, []],
|
|
152
|
+
...manifests.map((entry) => [entry.id, entry.manifest.dependencies ?? []]),
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* This platform's migration order: the committed core registry the host
|
|
157
|
+
* supplies, merged with every installed package's `./migrations` export.
|
|
158
|
+
*
|
|
159
|
+
* `env` selects the `node_modules` roots (`ENDORA_INSTANCE_ROOT`). Memoisation
|
|
160
|
+
* is the binding's, not this file's: how many times one process may ask is a
|
|
161
|
+
* fact about that process, and a memo here would answer a second host's
|
|
162
|
+
* registry with the first one's order.
|
|
163
|
+
*/
|
|
164
|
+
export async function discoverConfiguredMigrations(sources, env = process.env) {
|
|
165
|
+
return configuredMigrationsFrom({
|
|
166
|
+
// The platform's own twelve are merged in here rather than asked of the
|
|
167
|
+
// host (`specs/110-instance-repository/` T141). They are this package's
|
|
168
|
+
// schema, a client receives them by installing it, and an instance supplies
|
|
169
|
+
// `coreEntries: []` — which used to mean it ran none of them and died on
|
|
170
|
+
// the first module migration to touch a table `core_foundation_init`
|
|
171
|
+
// creates. Where a host does name them, as this repository's generated
|
|
172
|
+
// registry does by bare specifier, the merge is an identity de-duplication
|
|
173
|
+
// over the same objects and changes nothing; two objects of one name mean
|
|
174
|
+
// two copies of this package in one process (D-160.6), which survives as a
|
|
175
|
+
// duplicate name and is refused by `orderMigrations`' own rule.
|
|
176
|
+
coreEntries: mergeByIdentity(sources.coreEntries, PLATFORM_MIGRATION_ENTRIES, (entry) => entry.cls),
|
|
177
|
+
coreModuleDependencies: committedModuleDependencies(sources.manifests),
|
|
178
|
+
packages: await discoverPackageSchema(env),
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=configured-migrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configured-migrations.js","sourceRoot":"","sources":["../../src/db/configured-migrations.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `./db` — the ORM configuration, the migration ordering and the bootstrap,
|
|
3
|
+
* and the platform's twelfth subpath (`specs/110-instance-repository/` T116,
|
|
4
|
+
* FR-013).
|
|
5
|
+
*
|
|
6
|
+
* ## What is on it
|
|
7
|
+
*
|
|
8
|
+
* Everything between a committed registry and an open `MikroORM`: the naming
|
|
9
|
+
* strategy Principle VI is enforced by, the order a migration corpus runs in,
|
|
10
|
+
* the two merges that fold an installed package's entities and migrations into
|
|
11
|
+
* the committed core ones, the configuration itself, the cached bootstrap and
|
|
12
|
+
* the four migration verbs.
|
|
13
|
+
*
|
|
14
|
+
* It reads no artefact. The two committed registries and the generated manifest
|
|
15
|
+
* index are facts about *one repository's tree* (D-160.3, D-104), so they arrive
|
|
16
|
+
* as parameters — R7.4, FR-014, the pattern `registered-manifests.ts` took one
|
|
17
|
+
* directory over. What is left in `backend/src/db/` is exactly that supply: the
|
|
18
|
+
* generated files themselves, five bindings that hand them over, and the
|
|
19
|
+
* `migrate.ts` entry point four `package.json` scripts name.
|
|
20
|
+
*
|
|
21
|
+
* ## Why the platform carries it
|
|
22
|
+
*
|
|
23
|
+
* A client's schema is the platform's, not the client's: the tables, the order
|
|
24
|
+
* they are created in and the strategy that names their columns are what makes
|
|
25
|
+
* an installed module's migration apply cleanly, and a tree that could edit any
|
|
26
|
+
* of them is a tree whose next `pnpm update` is a merge. `../migrations/`
|
|
27
|
+
* carries the platform's own twelve migrations for the same reason and is the
|
|
28
|
+
* other half of this answer.
|
|
29
|
+
*
|
|
30
|
+
* ## Why no module may name it
|
|
31
|
+
*
|
|
32
|
+
* D-160.14's third state, for `./composition`'s own reason. This is the code
|
|
33
|
+
* that decides which entity classes the ORM registers and which migrations run
|
|
34
|
+
* at all, so a module that could name it could configure — and eventually
|
|
35
|
+
* re-order — its siblings' schema. It is declared by the `exports` map and
|
|
36
|
+
* carried by no published barrel, so `node` and `tsc` resolve it for the host
|
|
37
|
+
* and the test kit, and `check:platform-surface` answers a module's reach into
|
|
38
|
+
* it with `host-internal-subpath`. A module reaches its own schema through its
|
|
39
|
+
* own `./migrations` subpath and its entities through `./backend`; neither
|
|
40
|
+
* needs this one.
|
|
41
|
+
*
|
|
42
|
+
* The barrel names every symbol explicitly rather than re-exporting a
|
|
43
|
+
* directory: `check:platform-surface` exits 2 on an `export *`, because a
|
|
44
|
+
* wildcard makes the published set a property of whatever the files happen to
|
|
45
|
+
* declare rather than of a decision anybody took.
|
|
46
|
+
*/
|
|
47
|
+
export { PluralizingNamingStrategy, pluralize, toSnakeCase, } from './pluralizing-naming-strategy.js';
|
|
48
|
+
export { BASELINE_THROUGH, findModuleCycles, historicalBaselineOrder, MigrationOrderError, orderMigrations, type MigrationClass, type MigrationOrderDiagnostic, type MigrationOrderErrorCode, type MigrationOrderResult, type MigrationOrigin, type MigrationRegistryEntry, type OrderMigrationsInput, } from './migration-order.js';
|
|
49
|
+
export { configuredEntitiesFrom, type ConfiguredEntity, type EntityConfigurationInputs, } from './configured-entities.js';
|
|
50
|
+
export { committedMigrationOwnership, committedModuleDependencies, configuredMigrationsFrom, discoverConfiguredMigrations, migrationOwnershipOf, CORE_MODULE_ID, type ConfiguredMigrations, type CoreMigrationSources, type MigrationOwnership, type RegisteredMigration, } from './configured-migrations.js';
|
|
51
|
+
export { mikroOrmConfigFrom, type OrmConfigurationInputs, } from './mikro-orm.config.js';
|
|
52
|
+
export { createOrmBootstrap, type OrmBootstrap } from './orm.js';
|
|
53
|
+
export { runMigrationCommand, type MigrationCommandIo } from './migrate.js';
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EACL,yBAAyB,EACzB,SAAS,EACT,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,EACd,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,KAAK,sBAAsB,GAC5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/db/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `./db` — the ORM configuration, the migration ordering and the bootstrap,
|
|
3
|
+
* and the platform's twelfth subpath (`specs/110-instance-repository/` T116,
|
|
4
|
+
* FR-013).
|
|
5
|
+
*
|
|
6
|
+
* ## What is on it
|
|
7
|
+
*
|
|
8
|
+
* Everything between a committed registry and an open `MikroORM`: the naming
|
|
9
|
+
* strategy Principle VI is enforced by, the order a migration corpus runs in,
|
|
10
|
+
* the two merges that fold an installed package's entities and migrations into
|
|
11
|
+
* the committed core ones, the configuration itself, the cached bootstrap and
|
|
12
|
+
* the four migration verbs.
|
|
13
|
+
*
|
|
14
|
+
* It reads no artefact. The two committed registries and the generated manifest
|
|
15
|
+
* index are facts about *one repository's tree* (D-160.3, D-104), so they arrive
|
|
16
|
+
* as parameters — R7.4, FR-014, the pattern `registered-manifests.ts` took one
|
|
17
|
+
* directory over. What is left in `backend/src/db/` is exactly that supply: the
|
|
18
|
+
* generated files themselves, five bindings that hand them over, and the
|
|
19
|
+
* `migrate.ts` entry point four `package.json` scripts name.
|
|
20
|
+
*
|
|
21
|
+
* ## Why the platform carries it
|
|
22
|
+
*
|
|
23
|
+
* A client's schema is the platform's, not the client's: the tables, the order
|
|
24
|
+
* they are created in and the strategy that names their columns are what makes
|
|
25
|
+
* an installed module's migration apply cleanly, and a tree that could edit any
|
|
26
|
+
* of them is a tree whose next `pnpm update` is a merge. `../migrations/`
|
|
27
|
+
* carries the platform's own twelve migrations for the same reason and is the
|
|
28
|
+
* other half of this answer.
|
|
29
|
+
*
|
|
30
|
+
* ## Why no module may name it
|
|
31
|
+
*
|
|
32
|
+
* D-160.14's third state, for `./composition`'s own reason. This is the code
|
|
33
|
+
* that decides which entity classes the ORM registers and which migrations run
|
|
34
|
+
* at all, so a module that could name it could configure — and eventually
|
|
35
|
+
* re-order — its siblings' schema. It is declared by the `exports` map and
|
|
36
|
+
* carried by no published barrel, so `node` and `tsc` resolve it for the host
|
|
37
|
+
* and the test kit, and `check:platform-surface` answers a module's reach into
|
|
38
|
+
* it with `host-internal-subpath`. A module reaches its own schema through its
|
|
39
|
+
* own `./migrations` subpath and its entities through `./backend`; neither
|
|
40
|
+
* needs this one.
|
|
41
|
+
*
|
|
42
|
+
* The barrel names every symbol explicitly rather than re-exporting a
|
|
43
|
+
* directory: `check:platform-surface` exits 2 on an `export *`, because a
|
|
44
|
+
* wildcard makes the published set a property of whatever the files happen to
|
|
45
|
+
* declare rather than of a decision anybody took.
|
|
46
|
+
*/
|
|
47
|
+
export { PluralizingNamingStrategy, pluralize, toSnakeCase, } from './pluralizing-naming-strategy.js';
|
|
48
|
+
export { BASELINE_THROUGH, findModuleCycles, historicalBaselineOrder, MigrationOrderError, orderMigrations, } from './migration-order.js';
|
|
49
|
+
export { configuredEntitiesFrom, } from './configured-entities.js';
|
|
50
|
+
export { committedMigrationOwnership, committedModuleDependencies, configuredMigrationsFrom, discoverConfiguredMigrations, migrationOwnershipOf, CORE_MODULE_ID, } from './configured-migrations.js';
|
|
51
|
+
export { mikroOrmConfigFrom, } from './mikro-orm.config.js';
|
|
52
|
+
export { createOrmBootstrap } from './orm.js';
|
|
53
|
+
export { runMigrationCommand } from './migrate.js';
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EACL,yBAAyB,EACzB,SAAS,EACT,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,GAQhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,sBAAsB,GAGvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,GAKf,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,kBAAkB,GAEnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAqB,MAAM,UAAU,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAA2B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MikroORM } from '@mikro-orm/postgresql';
|
|
2
|
+
/**
|
|
3
|
+
* The four migration verbs, as a function of an open ORM.
|
|
4
|
+
*
|
|
5
|
+
* The **entry point** stays in the application — `backend/src/db/migrate.ts`,
|
|
6
|
+
* which `db:fresh`, `migration:up`, `migration:down` and `migration:pending`
|
|
7
|
+
* spawn and which production runs as `node dist/db/migrate.js up`. That split is
|
|
8
|
+
* `specs/115-lifecycle-container-move/contracts/operator-half.md` §1.1's, one
|
|
9
|
+
* surface over: a path a `package.json` script names is an operator-facing
|
|
10
|
+
* address, so it stays where the operator's documentation says it is, while the
|
|
11
|
+
* verbs behind it are the platform's and every instance runs the same four.
|
|
12
|
+
*
|
|
13
|
+
* It writes to injected streams and returns an exit code rather than calling
|
|
14
|
+
* `process.exit`, so the entry point owns the process and this owns the work.
|
|
15
|
+
*/
|
|
16
|
+
export interface MigrationCommandIo {
|
|
17
|
+
readonly out: (line: string) => void;
|
|
18
|
+
readonly err: (line: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function runMigrationCommand(orm: MikroORM, command: string, io: MigrationCommandIo): Promise<number>;
|
|
21
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/db/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,MAAM,CAAC,CA2CjB"}
|