@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
package/dist/db/orm.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MikroORM } from '@mikro-orm/postgresql';
|
|
2
|
+
import type { Options } from '@mikro-orm/postgresql';
|
|
3
|
+
/**
|
|
4
|
+
* Thin ORM bootstrap wrapper.
|
|
5
|
+
*
|
|
6
|
+
* `initOrm()` boots MikroORM once and caches it; `getOrm()` returns it;
|
|
7
|
+
* `closeOrm()` disposes it. That is the whole surface.
|
|
8
|
+
*
|
|
9
|
+
* **`getEm()` and `withTransaction()` were removed in feature 072 (T144).**
|
|
10
|
+
* They were the only `RequestContext` reference in the tree, and they had no
|
|
11
|
+
* callers outside this file — the header still advertised `withTransaction` as
|
|
12
|
+
* used by "order-placement, credit-limit reservation, and every multi-row
|
|
13
|
+
* mutation", none of which had called it for a long time.
|
|
14
|
+
*
|
|
15
|
+
* They are not worth restoring. `RequestContext` is AsyncLocalStorage-backed
|
|
16
|
+
* ambient state: a service reached the request's EntityManager by asking the
|
|
17
|
+
* runtime rather than by being given one, so what a service could touch was
|
|
18
|
+
* invisible in its signature and untestable without a live request scope. Every
|
|
19
|
+
* module takes an explicit `emFactory` now, and the kernel's request scope
|
|
20
|
+
* (`../kernel/scope.ts`) is where per-request state lives — declared, not
|
|
21
|
+
* ambient. Deleting these is what makes that a property of the tree rather than
|
|
22
|
+
* a convention.
|
|
23
|
+
*
|
|
24
|
+
* ## Why it is a factory (`specs/110-instance-repository/` T116)
|
|
25
|
+
*
|
|
26
|
+
* The cached instance is one process's, and so is the configuration it was
|
|
27
|
+
* booted from: which database this process talks to is decided by the host's
|
|
28
|
+
* `DATABASE_URL`, and which registries it was configured over is decided by the
|
|
29
|
+
* host's committed artefacts (R7.4). So the platform owns the bootstrap and the
|
|
30
|
+
* host owns the one call that binds it — `backend/src/db/index.ts` creates it
|
|
31
|
+
* once, at module scope, and re-exports the three names every caller already
|
|
32
|
+
* uses. One creation, one cached instance; two would be two ORMs over one pool.
|
|
33
|
+
*/
|
|
34
|
+
export interface OrmBootstrap {
|
|
35
|
+
initOrm(): Promise<MikroORM>;
|
|
36
|
+
getOrm(): MikroORM;
|
|
37
|
+
closeOrm(): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare function createOrmBootstrap(config: () => Promise<Options>): OrmBootstrap;
|
|
40
|
+
//# sourceMappingURL=orm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orm.d.ts","sourceRoot":"","sources":["../../src/db/orm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,IAAI,QAAQ,CAAC;IACnB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,YAAY,CAuB/E"}
|
package/dist/db/orm.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MikroORM } from '@mikro-orm/postgresql';
|
|
2
|
+
export function createOrmBootstrap(config) {
|
|
3
|
+
let ormInstance;
|
|
4
|
+
return {
|
|
5
|
+
async initOrm() {
|
|
6
|
+
if (!ormInstance) {
|
|
7
|
+
ormInstance = await MikroORM.init(await config());
|
|
8
|
+
}
|
|
9
|
+
return ormInstance;
|
|
10
|
+
},
|
|
11
|
+
getOrm() {
|
|
12
|
+
if (!ormInstance) {
|
|
13
|
+
throw new Error('ORM not initialised — call initOrm() during application bootstrap.');
|
|
14
|
+
}
|
|
15
|
+
return ormInstance;
|
|
16
|
+
},
|
|
17
|
+
async closeOrm() {
|
|
18
|
+
if (ormInstance) {
|
|
19
|
+
await ormInstance.close(true);
|
|
20
|
+
ormInstance = undefined;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=orm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orm.js","sourceRoot":"","sources":["../../src/db/orm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwCjD,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,IAAI,WAAiC,CAAC;IAEtC,OAAO;QACL,KAAK,CAAC,OAAO;YACX,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,MAAM;YACJ,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;YACxF,CAAC;YACD,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,KAAK,CAAC,QAAQ;YACZ,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC9B,WAAW,GAAG,SAAS,CAAC;YAC1B,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The platform's **own** schema — its six entity classes and its thirteen
|
|
3
|
+
* migrations — as a value the platform contributes to every composition
|
|
4
|
+
* (`specs/110-instance-repository/` T141).
|
|
5
|
+
*
|
|
6
|
+
* **Every count below is a derived fact written down, so re-derive before you
|
|
7
|
+
* edit one** (D-100). `PLATFORM_ENTITIES.length` and
|
|
8
|
+
* `PLATFORM_MIGRATION_ENTRIES.length` are the two answers, and their sum is what
|
|
9
|
+
* the generated registries name. `platform-schema.test.ts` derives rather than
|
|
10
|
+
* counts, so it does **not** catch this prose going stale — the bare `ls` of
|
|
11
|
+
* `../migrations/` does not either, since that directory also holds `index.ts`
|
|
12
|
+
* and `baseline-migrations.generated.ts`, which are not migrations.
|
|
13
|
+
*
|
|
14
|
+
* ## The defect this closes
|
|
15
|
+
*
|
|
16
|
+
* `configuredEntitiesFrom` and `discoverConfiguredMigrations` take the
|
|
17
|
+
* committed core registry from the host (R7.4), and an instance has none: it
|
|
18
|
+
* ships no generated index and no committed registry, so it passes
|
|
19
|
+
* `coreEntities: []` and `coreEntries: []`. Measured on the first end-to-end run
|
|
20
|
+
* of `endora new instance` (T140), that is not "an instance runs its packages'
|
|
21
|
+
* schema and no more" — it is an instance that runs **none of the platform's
|
|
22
|
+
* own**, because `AuditLogEntry`, `ModuleRegistration`, `SalesChannel`,
|
|
23
|
+
* `SettingGroup`, `SettingValue` and `Setting` live in this package and reach a
|
|
24
|
+
* composition only by being named. The first migration to touch a table
|
|
25
|
+
* `core_foundation_init` creates dies with `relation … does not exist`, and
|
|
26
|
+
* there is nothing a client could write in their own tree to prevent it.
|
|
27
|
+
*
|
|
28
|
+
* ## Why the platform carries it, and why that is not a new principle
|
|
29
|
+
*
|
|
30
|
+
* `../migrations/index.ts` already makes this argument for `BASELINE_MIGRATIONS`
|
|
31
|
+
* and R1.5 rules it: *"it is data about **this platform's** history, a client
|
|
32
|
+
* receives it by installing the platform, and a client receives a correction to
|
|
33
|
+
* it by `pnpm update`"*. The order and the migrations it orders are the same
|
|
34
|
+
* datum one step apart. A client's tree listing our thirteen class names would
|
|
35
|
+
* be a fact about our history held in a repository we cannot grep — exactly what
|
|
36
|
+
* R1.5 refuses — and it went stale on the thirteenth, which has now landed.
|
|
37
|
+
*
|
|
38
|
+
* ## Why merging is safe where a host **does** supply them
|
|
39
|
+
*
|
|
40
|
+
* This repository's own `entities-registry.generated.ts` and
|
|
41
|
+
* `migrations-registry.generated.ts` name all nineteen, by the bare specifiers
|
|
42
|
+
* this package's `exports` map declares. So the host's array and this one hold
|
|
43
|
+
* **the same objects**, and the merge below is an identity de-duplication — not
|
|
44
|
+
* a heuristic, and not a name comparison that could coalesce two different
|
|
45
|
+
* classes. Two *different* objects of one name can only come from two copies of
|
|
46
|
+
* this package in one process, which is D-160.6's failure; it survives the merge
|
|
47
|
+
* as a duplicate name, which `orderMigrations` refuses by its own rule.
|
|
48
|
+
*
|
|
49
|
+
* Nothing is removed from the generated registries in the same breath: they are
|
|
50
|
+
* the host's artefacts, emitted by a tree walk this file cannot reach, and a
|
|
51
|
+
* merge that is exact needs no second edit to be correct.
|
|
52
|
+
*/
|
|
53
|
+
import type { EntityClassLike } from '../packages/package-runtime.js';
|
|
54
|
+
import type { MigrationRegistryEntry } from './migration-order.js';
|
|
55
|
+
/**
|
|
56
|
+
* The cross-cutting pseudo-module owning the platform's own migrations.
|
|
57
|
+
*
|
|
58
|
+
* Declared here, beside the migrations it owns, and re-exported from
|
|
59
|
+
* `./configured-migrations.ts` where it used to live: that file now reads this
|
|
60
|
+
* one, so a constant declared there and read back would be an import cycle
|
|
61
|
+
* evaluated in whichever order a consumer happened to enter it. Five programs
|
|
62
|
+
* need the same literal and a second spelling of a module id is a second answer
|
|
63
|
+
* waiting to disagree.
|
|
64
|
+
*/
|
|
65
|
+
export declare const CORE_MODULE_ID = "core";
|
|
66
|
+
/**
|
|
67
|
+
* The entity classes this package persists.
|
|
68
|
+
*
|
|
69
|
+
* Named one per line rather than re-exported from the two barrels that publish
|
|
70
|
+
* them: `./kernel` carries five and `./composition` carries
|
|
71
|
+
* `ModuleRegistration`, and a barrel import here would pull the composition
|
|
72
|
+
* root into every process that only wanted an ORM configuration.
|
|
73
|
+
*/
|
|
74
|
+
export declare const PLATFORM_ENTITIES: readonly EntityClassLike[];
|
|
75
|
+
/**
|
|
76
|
+
* The platform's thirteen migrations, owned by the cross-cutting `core`
|
|
77
|
+
* pseudo-module.
|
|
78
|
+
*
|
|
79
|
+
* `origin` is left absent, which {@link MigrationRegistryEntry} documents as
|
|
80
|
+
* meaning `'core'` — these are not an external producer's, and writing the
|
|
81
|
+
* default would be a second spelling of it.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PLATFORM_MIGRATION_ENTRIES: readonly MigrationRegistryEntry[];
|
|
84
|
+
/**
|
|
85
|
+
* `first`, then every member of `second` whose **identity** is not already in
|
|
86
|
+
* it.
|
|
87
|
+
*
|
|
88
|
+
* `identity` is what a member is compared on, and it is a parameter because the
|
|
89
|
+
* two merges compare different things. An entity set holds the classes
|
|
90
|
+
* themselves, so a member is its own identity. A migration registry holds
|
|
91
|
+
* `{ moduleId, cls }` *wrappers*, and the host builds its own — so comparing
|
|
92
|
+
* the wrappers finds no overlap at all and hands `orderMigrations` twelve
|
|
93
|
+
* duplicate names. The class is the identity there, which is also what the
|
|
94
|
+
* platform persists: `cls.name` is the string `mikro_orm_migrations` records.
|
|
95
|
+
*
|
|
96
|
+
* Order is `first`'s and then `second`'s, so a host that already names these
|
|
97
|
+
* keeps its own positions and an instance receives them in the order declared
|
|
98
|
+
* above. For migrations neither order is the execution order: `orderMigrations`
|
|
99
|
+
* computes that from the baseline and the manifest graph.
|
|
100
|
+
*/
|
|
101
|
+
export declare function mergeByIdentity<T>(first: readonly T[], second: readonly T[], identity?: (member: T) => unknown): T[];
|
|
102
|
+
//# sourceMappingURL=platform-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-schema.d.ts","sourceRoot":"","sources":["../../src/db/platform-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAsBtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,eAAe,EAOvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAcrB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,QAAQ,GAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAA4B,GACpD,CAAC,EAAE,CAGL"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AuditLogEntry } from '../kernel/audit/audit-log-entry.entity.js';
|
|
2
|
+
import { ModuleRegistration } from '../kernel/lifecycle/module-registration.entity.js';
|
|
3
|
+
import { SalesChannel } from '../kernel/sales-channels/sales-channel.entity.js';
|
|
4
|
+
import { Setting } from '../kernel/settings/setting.entity.js';
|
|
5
|
+
import { SettingGroup } from '../kernel/settings/setting-group.entity.js';
|
|
6
|
+
import { SettingValue } from '../kernel/settings/setting-value.entity.js';
|
|
7
|
+
import { Migration20260424T165847CoreFoundationInit, Migration20260425T050720CoreCommerceInit, Migration20260430T101450CoreSettingsInit, Migration20260430T170044CoreSalesChannelsPromote, Migration20260506T200657CoreModuleLifecycleInit, Migration20260514T111329CoreSettingsGlobalValue, Migration20260611T140411CoreSettingsSecretValueType, Migration20260611T140419CoreSettingsEnumOptions, Migration20260629T090100CoreSettingsHiddenFlag, Migration20260717T134752CoreTenantScopeIndexes, Migration20260721T011510CoreSettingsCredentialRefValueType, Migration20260816T203339CoreRetireCoreActivationSettings, Migration20260919T101500CoreModuleRegistrationsBootConverged, } from '../migrations/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* The cross-cutting pseudo-module owning the platform's own migrations.
|
|
10
|
+
*
|
|
11
|
+
* Declared here, beside the migrations it owns, and re-exported from
|
|
12
|
+
* `./configured-migrations.ts` where it used to live: that file now reads this
|
|
13
|
+
* one, so a constant declared there and read back would be an import cycle
|
|
14
|
+
* evaluated in whichever order a consumer happened to enter it. Five programs
|
|
15
|
+
* need the same literal and a second spelling of a module id is a second answer
|
|
16
|
+
* waiting to disagree.
|
|
17
|
+
*/
|
|
18
|
+
export const CORE_MODULE_ID = 'core';
|
|
19
|
+
/**
|
|
20
|
+
* The entity classes this package persists.
|
|
21
|
+
*
|
|
22
|
+
* Named one per line rather than re-exported from the two barrels that publish
|
|
23
|
+
* them: `./kernel` carries five and `./composition` carries
|
|
24
|
+
* `ModuleRegistration`, and a barrel import here would pull the composition
|
|
25
|
+
* root into every process that only wanted an ORM configuration.
|
|
26
|
+
*/
|
|
27
|
+
export const PLATFORM_ENTITIES = [
|
|
28
|
+
AuditLogEntry,
|
|
29
|
+
ModuleRegistration,
|
|
30
|
+
SalesChannel,
|
|
31
|
+
Setting,
|
|
32
|
+
SettingGroup,
|
|
33
|
+
SettingValue,
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* The platform's thirteen migrations, owned by the cross-cutting `core`
|
|
37
|
+
* pseudo-module.
|
|
38
|
+
*
|
|
39
|
+
* `origin` is left absent, which {@link MigrationRegistryEntry} documents as
|
|
40
|
+
* meaning `'core'` — these are not an external producer's, and writing the
|
|
41
|
+
* default would be a second spelling of it.
|
|
42
|
+
*/
|
|
43
|
+
export const PLATFORM_MIGRATION_ENTRIES = [
|
|
44
|
+
Migration20260424T165847CoreFoundationInit,
|
|
45
|
+
Migration20260425T050720CoreCommerceInit,
|
|
46
|
+
Migration20260430T101450CoreSettingsInit,
|
|
47
|
+
Migration20260430T170044CoreSalesChannelsPromote,
|
|
48
|
+
Migration20260506T200657CoreModuleLifecycleInit,
|
|
49
|
+
Migration20260514T111329CoreSettingsGlobalValue,
|
|
50
|
+
Migration20260611T140411CoreSettingsSecretValueType,
|
|
51
|
+
Migration20260611T140419CoreSettingsEnumOptions,
|
|
52
|
+
Migration20260629T090100CoreSettingsHiddenFlag,
|
|
53
|
+
Migration20260717T134752CoreTenantScopeIndexes,
|
|
54
|
+
Migration20260721T011510CoreSettingsCredentialRefValueType,
|
|
55
|
+
Migration20260816T203339CoreRetireCoreActivationSettings,
|
|
56
|
+
Migration20260919T101500CoreModuleRegistrationsBootConverged,
|
|
57
|
+
].map((cls) => ({ moduleId: CORE_MODULE_ID, cls }));
|
|
58
|
+
/**
|
|
59
|
+
* `first`, then every member of `second` whose **identity** is not already in
|
|
60
|
+
* it.
|
|
61
|
+
*
|
|
62
|
+
* `identity` is what a member is compared on, and it is a parameter because the
|
|
63
|
+
* two merges compare different things. An entity set holds the classes
|
|
64
|
+
* themselves, so a member is its own identity. A migration registry holds
|
|
65
|
+
* `{ moduleId, cls }` *wrappers*, and the host builds its own — so comparing
|
|
66
|
+
* the wrappers finds no overlap at all and hands `orderMigrations` twelve
|
|
67
|
+
* duplicate names. The class is the identity there, which is also what the
|
|
68
|
+
* platform persists: `cls.name` is the string `mikro_orm_migrations` records.
|
|
69
|
+
*
|
|
70
|
+
* Order is `first`'s and then `second`'s, so a host that already names these
|
|
71
|
+
* keeps its own positions and an instance receives them in the order declared
|
|
72
|
+
* above. For migrations neither order is the execution order: `orderMigrations`
|
|
73
|
+
* computes that from the baseline and the manifest graph.
|
|
74
|
+
*/
|
|
75
|
+
export function mergeByIdentity(first, second, identity = (member) => member) {
|
|
76
|
+
const seen = new Set(first.map(identity));
|
|
77
|
+
return [...first, ...second.filter((member) => !seen.has(identity(member)))];
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=platform-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-schema.js","sourceRoot":"","sources":["../../src/db/platform-schema.ts"],"names":[],"mappings":"AAqDA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EACL,0CAA0C,EAC1C,wCAAwC,EACxC,wCAAwC,EACxC,gDAAgD,EAChD,+CAA+C,EAC/C,+CAA+C,EAC/C,mDAAmD,EACnD,+CAA+C,EAC/C,8CAA8C,EAC9C,8CAA8C,EAC9C,0DAA0D,EAC1D,wDAAwD,EACxD,4DAA4D,GAC7D,MAAM,wBAAwB,CAAC;AAGhC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAA+B;IAC3D,aAAa;IACb,kBAAkB;IAClB,YAAY;IACZ,OAAO;IACP,YAAY;IACZ,YAAY;CACb,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsC;IAC3E,0CAA0C;IAC1C,wCAAwC;IACxC,wCAAwC;IACxC,gDAAgD;IAChD,+CAA+C;IAC/C,+CAA+C;IAC/C,mDAAmD;IACnD,+CAA+C;IAC/C,8CAA8C;IAC9C,8CAA8C;IAC9C,0DAA0D;IAC1D,wDAAwD;IACxD,4DAA4D;CAC7D,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAmB,EACnB,MAAoB,EACpB,WAAmC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;IAErD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { UnderscoreNamingStrategy } from '@mikro-orm/core';
|
|
2
|
+
export declare class PluralizingNamingStrategy extends UnderscoreNamingStrategy {
|
|
3
|
+
classToTableName(entityName: string): string;
|
|
4
|
+
referenceColumnName(): string;
|
|
5
|
+
joinKeyColumnName(entityName: string, _referencedColumnName?: string): string;
|
|
6
|
+
joinTableName(sourceEntity: string, targetEntity: string, propertyName: string): string;
|
|
7
|
+
}
|
|
8
|
+
/** PascalCase / camelCase → snake_case. */
|
|
9
|
+
export declare function toSnakeCase(input: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Minimal English pluralizer. Covers the patterns we actually produce
|
|
12
|
+
* (names ending in s/x/z/ch/sh/y/consonant-y). Good enough for the entity inventory in
|
|
13
|
+
* data-model.md; a full inflector is YAGNI.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pluralize(snake: string): string;
|
|
16
|
+
//# sourceMappingURL=pluralizing-naming-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluralizing-naming-strategy.d.ts","sourceRoot":"","sources":["../../src/db/pluralizing-naming-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAmB3D,qBAAa,yBAA0B,SAAQ,wBAAwB;IAC5D,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAQ5C,mBAAmB,IAAI,MAAM;IAK7B,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM;IAM7E,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM;CAOjG;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ/C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { UnderscoreNamingStrategy } from '@mikro-orm/core';
|
|
2
|
+
/**
|
|
3
|
+
* MikroORM naming strategy enforcing Principle VI of the constitution:
|
|
4
|
+
*
|
|
5
|
+
* - Table names: plural `snake_case` (e.g. `Product` → `products`, `ComponentRoleTime` →
|
|
6
|
+
* `component_role_times`).
|
|
7
|
+
* - Columns: `snake_case` (inherited from UnderscoreNamingStrategy).
|
|
8
|
+
* - Foreign keys: `{referenced_table_singular}_id` (e.g. `offer_id`, `user_id`).
|
|
9
|
+
* - Join tables: `{a}_{b}` in plural form.
|
|
10
|
+
*
|
|
11
|
+
* Permitted singular-class exceptions: `Auth`, `Example`. Any class name matching these
|
|
12
|
+
* exact PascalCase forms maps to the same lowercase snake_case without pluralization.
|
|
13
|
+
*
|
|
14
|
+
* See specs/001-b2b-platform-foundation/research.md R-04.
|
|
15
|
+
*/
|
|
16
|
+
const SINGULAR_EXCEPTIONS = new Set(['auth', 'example']);
|
|
17
|
+
export class PluralizingNamingStrategy extends UnderscoreNamingStrategy {
|
|
18
|
+
classToTableName(entityName) {
|
|
19
|
+
const snake = toSnakeCase(entityName);
|
|
20
|
+
if (SINGULAR_EXCEPTIONS.has(snake)) {
|
|
21
|
+
return snake;
|
|
22
|
+
}
|
|
23
|
+
return pluralize(snake);
|
|
24
|
+
}
|
|
25
|
+
referenceColumnName() {
|
|
26
|
+
// FK column base: keep plain `id`. The prefix is added by joinKeyColumnName below.
|
|
27
|
+
return 'id';
|
|
28
|
+
}
|
|
29
|
+
joinKeyColumnName(entityName, _referencedColumnName) {
|
|
30
|
+
// Always produce `{referenced_table_singular}_id`, even if the class name is already singular.
|
|
31
|
+
const singular = toSnakeCase(entityName);
|
|
32
|
+
return `${singular}_id`;
|
|
33
|
+
}
|
|
34
|
+
joinTableName(sourceEntity, targetEntity, propertyName) {
|
|
35
|
+
// Default behaviour, but with plural snake_case on both sides.
|
|
36
|
+
const a = this.classToTableName(sourceEntity);
|
|
37
|
+
const b = this.classToTableName(targetEntity);
|
|
38
|
+
const prop = toSnakeCase(propertyName);
|
|
39
|
+
return `${a}_${b}_${prop}`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** PascalCase / camelCase → snake_case. */
|
|
43
|
+
export function toSnakeCase(input) {
|
|
44
|
+
return input
|
|
45
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
|
|
46
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1_$2')
|
|
47
|
+
.toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Minimal English pluralizer. Covers the patterns we actually produce
|
|
51
|
+
* (names ending in s/x/z/ch/sh/y/consonant-y). Good enough for the entity inventory in
|
|
52
|
+
* data-model.md; a full inflector is YAGNI.
|
|
53
|
+
*/
|
|
54
|
+
export function pluralize(snake) {
|
|
55
|
+
if (snake.endsWith('s') || snake.endsWith('ch') || snake.endsWith('sh') || snake.endsWith('x') || snake.endsWith('z')) {
|
|
56
|
+
return `${snake}es`;
|
|
57
|
+
}
|
|
58
|
+
if (snake.endsWith('y') && snake.length > 1 && !isVowel(snake[snake.length - 2] ?? '')) {
|
|
59
|
+
return `${snake.slice(0, -1)}ies`;
|
|
60
|
+
}
|
|
61
|
+
return `${snake}s`;
|
|
62
|
+
}
|
|
63
|
+
function isVowel(ch) {
|
|
64
|
+
return ['a', 'e', 'i', 'o', 'u'].includes(ch);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=pluralizing-naming-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluralizing-naming-strategy.js","sourceRoot":"","sources":["../../src/db/pluralizing-naming-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AAEH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAEzD,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IAC5D,gBAAgB,CAAC,UAAkB;QAC1C,MAAM,KAAK,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAEQ,mBAAmB;QAC1B,mFAAmF;QACnF,OAAO,IAAI,CAAC;IACd,CAAC;IAEQ,iBAAiB,CAAC,UAAkB,EAAE,qBAA8B;QAC3E,+FAA+F;QAC/F,MAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QACzC,OAAO,GAAG,QAAQ,KAAK,CAAC;IAC1B,CAAC;IAEQ,aAAa,CAAC,YAAoB,EAAE,YAAoB,EAAE,YAAoB;QACrF,+DAA+D;QAC/D,MAAM,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;QACvC,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAC7B,CAAC;CACF;AAED,2CAA2C;AAC3C,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK;SACT,OAAO,CAAC,uBAAuB,EAAE,OAAO,CAAC;SACzC,OAAO,CAAC,oBAAoB,EAAE,OAAO,CAAC;SACtC,WAAW,EAAE,CAAC;AACnB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACtH,OAAO,GAAG,KAAK,IAAI,CAAC;IACtB,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QACvF,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,KAAK,GAAG,CAAC;AACrB,CAAC;AAED,SAAS,OAAO,CAAC,EAAU;IACzB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two guards standing between a demo seed and somebody's live data.
|
|
3
|
+
*
|
|
4
|
+
* ## Why they are the platform's (feature 113, spec §7)
|
|
5
|
+
*
|
|
6
|
+
* `mustBeNonProduction()` is the safety property that makes every one of these
|
|
7
|
+
* commands runnable at all, and under **D-207** a client's backend takes
|
|
8
|
+
* `@endora-commerce/platform` and never receives the host's `backend/src`. A
|
|
9
|
+
* client running a demo seed against production is precisely what this file
|
|
10
|
+
* prevents, so it has to ship. It moved here from
|
|
11
|
+
* `backend/src/seeds/dev-seed-guard.ts`, which is now a re-export shim; the two
|
|
12
|
+
* consumers standing when it moved are `seed:dev` and
|
|
13
|
+
* `backend/scripts/conformance/seed-storefront-fixtures.ts`, and §3.3 requires
|
|
14
|
+
* the demo runner's entry point to call **this** implementation rather than a
|
|
15
|
+
* second copy.
|
|
16
|
+
*
|
|
17
|
+
* The body below is unchanged but for the operation its two refusals name:
|
|
18
|
+
* `dev-catalog-seed` became *"the demo seed"*, because from Phase 0 the same
|
|
19
|
+
* guard answers `endora demo seed` and an operator refused by it must not be
|
|
20
|
+
* sent to a host file they have never heard of and, under D-207, do not have.
|
|
21
|
+
* The sentence is true of `seed:dev` as well, which still runs throughout Phase
|
|
22
|
+
* 0 (FR-013 — the replacement exists before the removal).
|
|
23
|
+
*
|
|
24
|
+
* They live apart from the seed body, not inside it, because
|
|
25
|
+
* `dev-catalog-seed.ts` calls `main()` at import time: a test importing that
|
|
26
|
+
* file would run the seed it is supposed to be testing.
|
|
27
|
+
* `backend/test/unit/seeds/dev-seed-guard.test.ts` covers this module; the seed
|
|
28
|
+
* had no test at all, which is part of how issue #224 stood.
|
|
29
|
+
*
|
|
30
|
+
* ## Issue #224 — the second guard had never refused anything
|
|
31
|
+
*
|
|
32
|
+
* The database check used to be a regex over the whole DSN:
|
|
33
|
+
*
|
|
34
|
+
* /localhost|127\.0\.0\.1|postgres(?::\d+)?/.test(url)
|
|
35
|
+
*
|
|
36
|
+
* The `postgres` alternative was meant to match the docker-compose service
|
|
37
|
+
* hostname. Tested against the whole DSN it matches the **scheme** instead —
|
|
38
|
+
* every PostgreSQL DSN begins `postgresql://` — so it accepted
|
|
39
|
+
* `postgresql://user:pw@db.production.example.com:5432/shop` and every other
|
|
40
|
+
* remote database, on every host, for as long as it existed. `NODE_ENV` was
|
|
41
|
+
* the only guard actually guarding; the second one was decoration.
|
|
42
|
+
*
|
|
43
|
+
* So: parse the DSN and test the **host**, and where the host cannot answer,
|
|
44
|
+
* test the database **name**.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* A database name that says "this database exists to be wiped".
|
|
48
|
+
*
|
|
49
|
+
* Deliberately the *same* judgement `test/global-setup.ts` makes before it
|
|
50
|
+
* lets the vitest harness truncate a database — a second, parallel convention
|
|
51
|
+
* would be one more thing to keep true. The unit test pins the two together by
|
|
52
|
+
* reading that file, so the day the harness changes its mind this stops
|
|
53
|
+
* compiling agreement rather than drifting quietly.
|
|
54
|
+
*/
|
|
55
|
+
export declare const TEST_DATABASE_NAME_PATTERN: RegExp;
|
|
56
|
+
export interface SeedTargetVerdict {
|
|
57
|
+
readonly safe: boolean;
|
|
58
|
+
/** Host and database only — a DSN carries a password and this reaches logs. */
|
|
59
|
+
readonly describe: string;
|
|
60
|
+
readonly why: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Is `url` a database the seed may truncate?
|
|
64
|
+
*
|
|
65
|
+
* Three answers, in order:
|
|
66
|
+
*
|
|
67
|
+
* 1. **Unparseable** — refuse. `new URL()` throws where the old regex merely
|
|
68
|
+
* failed to match, and an unhandled `TypeError: Invalid URL` from a
|
|
69
|
+
* data-wipe guard reads like a crash rather than a refusal. Caught, and
|
|
70
|
+
* re-thrown by the caller as the guard's own sentence.
|
|
71
|
+
* 2. **Loopback host** — allow, whatever the database is called. This is the
|
|
72
|
+
* dev path: `backend/.env` ships
|
|
73
|
+
* `postgresql://b2b:b2b@localhost:5432/b2b` and `pnpm run dev` runs on
|
|
74
|
+
* the host against the published compose port.
|
|
75
|
+
* 3. **Anything else** — allow only if the database *name* follows the test
|
|
76
|
+
* convention. `postgres` is the compose service name in `docker-compose.yml`
|
|
77
|
+
* *and* in `deploy/compose.prod.yml`, so the host genuinely cannot tell a
|
|
78
|
+
* dev stack from a production one; the CI DSN
|
|
79
|
+
* (`postgresql://b2b:b2b@postgres:5432/b2b_test`) is separated from the
|
|
80
|
+
* production DSN (`…@postgres:5432/b2b`) by the database name and by
|
|
81
|
+
* nothing else.
|
|
82
|
+
*
|
|
83
|
+
* This is the most restrictive rule that leaves `pnpm run dev` working. The
|
|
84
|
+
* looser arm considered and rejected: keeping the host `postgres` sufficient
|
|
85
|
+
* on its own, which is what the old regex was reaching for. That admits
|
|
86
|
+
* `deploy/compose.prod.yml`'s own `DATABASE_URL` verbatim — the exact DSN a
|
|
87
|
+
* `seed` service in the production stack would have been handed.
|
|
88
|
+
*/
|
|
89
|
+
export declare function classifySeedTarget(url: string): SeedTargetVerdict;
|
|
90
|
+
/**
|
|
91
|
+
* Refuse to seed anything but a development or test database.
|
|
92
|
+
*
|
|
93
|
+
* Two independent questions — "is this a production runtime?" and "is this a
|
|
94
|
+
* disposable database?" — with an explicit opt-out each. Neither answers for
|
|
95
|
+
* the other (issue #224).
|
|
96
|
+
*
|
|
97
|
+
* `env` is a parameter so the unit test can hand over a whole environment
|
|
98
|
+
* rather than mutating the process's.
|
|
99
|
+
*/
|
|
100
|
+
export declare function mustBeNonProduction(env?: NodeJS.ProcessEnv): void;
|
|
101
|
+
//# sourceMappingURL=guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/demo/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAiBH;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAwB3D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAyBjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,IAAI,CAsB9E"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two guards standing between a demo seed and somebody's live data.
|
|
3
|
+
*
|
|
4
|
+
* ## Why they are the platform's (feature 113, spec §7)
|
|
5
|
+
*
|
|
6
|
+
* `mustBeNonProduction()` is the safety property that makes every one of these
|
|
7
|
+
* commands runnable at all, and under **D-207** a client's backend takes
|
|
8
|
+
* `@endora-commerce/platform` and never receives the host's `backend/src`. A
|
|
9
|
+
* client running a demo seed against production is precisely what this file
|
|
10
|
+
* prevents, so it has to ship. It moved here from
|
|
11
|
+
* `backend/src/seeds/dev-seed-guard.ts`, which is now a re-export shim; the two
|
|
12
|
+
* consumers standing when it moved are `seed:dev` and
|
|
13
|
+
* `backend/scripts/conformance/seed-storefront-fixtures.ts`, and §3.3 requires
|
|
14
|
+
* the demo runner's entry point to call **this** implementation rather than a
|
|
15
|
+
* second copy.
|
|
16
|
+
*
|
|
17
|
+
* The body below is unchanged but for the operation its two refusals name:
|
|
18
|
+
* `dev-catalog-seed` became *"the demo seed"*, because from Phase 0 the same
|
|
19
|
+
* guard answers `endora demo seed` and an operator refused by it must not be
|
|
20
|
+
* sent to a host file they have never heard of and, under D-207, do not have.
|
|
21
|
+
* The sentence is true of `seed:dev` as well, which still runs throughout Phase
|
|
22
|
+
* 0 (FR-013 — the replacement exists before the removal).
|
|
23
|
+
*
|
|
24
|
+
* They live apart from the seed body, not inside it, because
|
|
25
|
+
* `dev-catalog-seed.ts` calls `main()` at import time: a test importing that
|
|
26
|
+
* file would run the seed it is supposed to be testing.
|
|
27
|
+
* `backend/test/unit/seeds/dev-seed-guard.test.ts` covers this module; the seed
|
|
28
|
+
* had no test at all, which is part of how issue #224 stood.
|
|
29
|
+
*
|
|
30
|
+
* ## Issue #224 — the second guard had never refused anything
|
|
31
|
+
*
|
|
32
|
+
* The database check used to be a regex over the whole DSN:
|
|
33
|
+
*
|
|
34
|
+
* /localhost|127\.0\.0\.1|postgres(?::\d+)?/.test(url)
|
|
35
|
+
*
|
|
36
|
+
* The `postgres` alternative was meant to match the docker-compose service
|
|
37
|
+
* hostname. Tested against the whole DSN it matches the **scheme** instead —
|
|
38
|
+
* every PostgreSQL DSN begins `postgresql://` — so it accepted
|
|
39
|
+
* `postgresql://user:pw@db.production.example.com:5432/shop` and every other
|
|
40
|
+
* remote database, on every host, for as long as it existed. `NODE_ENV` was
|
|
41
|
+
* the only guard actually guarding; the second one was decoration.
|
|
42
|
+
*
|
|
43
|
+
* So: parse the DSN and test the **host**, and where the host cannot answer,
|
|
44
|
+
* test the database **name**.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Hosts that can only mean "the machine running the seed".
|
|
48
|
+
*
|
|
49
|
+
* A loopback DSN cannot reach another machine's database, so the operator is
|
|
50
|
+
* seeding something in front of them. Seeding a production box's own database
|
|
51
|
+
* over loopback is the case `NODE_ENV=production` answers — that guard, and
|
|
52
|
+
* not this one.
|
|
53
|
+
*
|
|
54
|
+
* `::1` arrives from `new URL()` as `[::1]`; `hostOf` strips the brackets.
|
|
55
|
+
* Only these three exact spellings: `127.0.0.2` and friends are loopback too,
|
|
56
|
+
* but nothing in this repository uses one, and the whole defect above came
|
|
57
|
+
* from a host test that was broader than it looked.
|
|
58
|
+
*/
|
|
59
|
+
const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '::1']);
|
|
60
|
+
/**
|
|
61
|
+
* A database name that says "this database exists to be wiped".
|
|
62
|
+
*
|
|
63
|
+
* Deliberately the *same* judgement `test/global-setup.ts` makes before it
|
|
64
|
+
* lets the vitest harness truncate a database — a second, parallel convention
|
|
65
|
+
* would be one more thing to keep true. The unit test pins the two together by
|
|
66
|
+
* reading that file, so the day the harness changes its mind this stops
|
|
67
|
+
* compiling agreement rather than drifting quietly.
|
|
68
|
+
*/
|
|
69
|
+
export const TEST_DATABASE_NAME_PATTERN = /(^|_)test(_|$)/;
|
|
70
|
+
/**
|
|
71
|
+
* Set to `true` to run the seed against a database that is neither loopback
|
|
72
|
+
* nor named as a test database — a demo deployment being the case that has a
|
|
73
|
+
* claim on it.
|
|
74
|
+
*
|
|
75
|
+
* It is a *separate* flag from `ALLOW_DEV_SEED_IN_PRODUCTION` on purpose. The
|
|
76
|
+
* lesson of issue #224 is that one guard silently covering for the other is
|
|
77
|
+
* how a wipe reaches live data: a deliberate demo seed must now say both "yes,
|
|
78
|
+
* production" and "yes, that database", and each answer is visible on its own
|
|
79
|
+
* in whatever ran the command.
|
|
80
|
+
*/
|
|
81
|
+
const NON_LOCAL_OVERRIDE = 'ALLOW_DEV_SEED_ON_NON_LOCAL_DATABASE';
|
|
82
|
+
/** Lower-cased host with IPv6 brackets removed, or `''` for a unix-socket DSN. */
|
|
83
|
+
function hostOf(parsed) {
|
|
84
|
+
return parsed.hostname.toLowerCase().replace(/^\[|\]$/g, '');
|
|
85
|
+
}
|
|
86
|
+
function databaseNameOf(parsed) {
|
|
87
|
+
return decodeURIComponent(parsed.pathname).replace(/^\//, '');
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Is `url` a database the seed may truncate?
|
|
91
|
+
*
|
|
92
|
+
* Three answers, in order:
|
|
93
|
+
*
|
|
94
|
+
* 1. **Unparseable** — refuse. `new URL()` throws where the old regex merely
|
|
95
|
+
* failed to match, and an unhandled `TypeError: Invalid URL` from a
|
|
96
|
+
* data-wipe guard reads like a crash rather than a refusal. Caught, and
|
|
97
|
+
* re-thrown by the caller as the guard's own sentence.
|
|
98
|
+
* 2. **Loopback host** — allow, whatever the database is called. This is the
|
|
99
|
+
* dev path: `backend/.env` ships
|
|
100
|
+
* `postgresql://b2b:b2b@localhost:5432/b2b` and `pnpm run dev` runs on
|
|
101
|
+
* the host against the published compose port.
|
|
102
|
+
* 3. **Anything else** — allow only if the database *name* follows the test
|
|
103
|
+
* convention. `postgres` is the compose service name in `docker-compose.yml`
|
|
104
|
+
* *and* in `deploy/compose.prod.yml`, so the host genuinely cannot tell a
|
|
105
|
+
* dev stack from a production one; the CI DSN
|
|
106
|
+
* (`postgresql://b2b:b2b@postgres:5432/b2b_test`) is separated from the
|
|
107
|
+
* production DSN (`…@postgres:5432/b2b`) by the database name and by
|
|
108
|
+
* nothing else.
|
|
109
|
+
*
|
|
110
|
+
* This is the most restrictive rule that leaves `pnpm run dev` working. The
|
|
111
|
+
* looser arm considered and rejected: keeping the host `postgres` sufficient
|
|
112
|
+
* on its own, which is what the old regex was reaching for. That admits
|
|
113
|
+
* `deploy/compose.prod.yml`'s own `DATABASE_URL` verbatim — the exact DSN a
|
|
114
|
+
* `seed` service in the production stack would have been handed.
|
|
115
|
+
*/
|
|
116
|
+
export function classifySeedTarget(url) {
|
|
117
|
+
let parsed;
|
|
118
|
+
try {
|
|
119
|
+
parsed = new URL(url);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return { safe: false, describe: '<unparseable DATABASE_URL>', why: 'it is not a URL' };
|
|
123
|
+
}
|
|
124
|
+
const host = hostOf(parsed);
|
|
125
|
+
const database = databaseNameOf(parsed);
|
|
126
|
+
const describe = `host "${host || '<none>'}", database "${database}"`;
|
|
127
|
+
if (LOOPBACK_HOSTS.has(host)) {
|
|
128
|
+
return { safe: true, describe, why: 'the host is loopback' };
|
|
129
|
+
}
|
|
130
|
+
if (TEST_DATABASE_NAME_PATTERN.test(database)) {
|
|
131
|
+
return { safe: true, describe, why: 'the database name follows the test convention' };
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
safe: false,
|
|
135
|
+
describe,
|
|
136
|
+
why: 'the host is not loopback and the database name does not contain "test" ' +
|
|
137
|
+
'(the convention test/global-setup.ts uses before it truncates)',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Refuse to seed anything but a development or test database.
|
|
142
|
+
*
|
|
143
|
+
* Two independent questions — "is this a production runtime?" and "is this a
|
|
144
|
+
* disposable database?" — with an explicit opt-out each. Neither answers for
|
|
145
|
+
* the other (issue #224).
|
|
146
|
+
*
|
|
147
|
+
* `env` is a parameter so the unit test can hand over a whole environment
|
|
148
|
+
* rather than mutating the process's.
|
|
149
|
+
*/
|
|
150
|
+
export function mustBeNonProduction(env = process.env) {
|
|
151
|
+
// The seed is destructive (it truncates the public catalog/business tables),
|
|
152
|
+
// so it refuses NODE_ENV=production by default. A deliberate demo deployment
|
|
153
|
+
// can opt in with ALLOW_DEV_SEED_IN_PRODUCTION=true — this is intentionally a
|
|
154
|
+
// separate, explicit flag so an accidental run never wipes real data.
|
|
155
|
+
const forced = env['ALLOW_DEV_SEED_IN_PRODUCTION'] === 'true';
|
|
156
|
+
if (env['NODE_ENV'] === 'production' && !forced) {
|
|
157
|
+
throw new Error('refusing to run the demo seed in NODE_ENV=production ' +
|
|
158
|
+
'(set ALLOW_DEV_SEED_IN_PRODUCTION=true to override — this WIPES business data)');
|
|
159
|
+
}
|
|
160
|
+
const url = env['DATABASE_URL'] ?? 'postgresql://b2b:b2b@localhost:5432/b2b';
|
|
161
|
+
const verdict = classifySeedTarget(url);
|
|
162
|
+
if (!verdict.safe && env[NON_LOCAL_OVERRIDE] !== 'true') {
|
|
163
|
+
throw new Error(`refusing to run the demo seed against ${verdict.describe}: ${verdict.why}. ` +
|
|
164
|
+
`This seed truncates the catalog and business tables. Set ${NON_LOCAL_OVERRIDE}=true ` +
|
|
165
|
+
'if that database really is disposable.');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guard.js","sourceRoot":"","sources":["../../src/demo/guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AAEvF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,MAAM,kBAAkB,GAAG,sCAAsC,CAAC;AAElE,kFAAkF;AAClF,SAAS,MAAM,CAAC,MAAW;IACzB,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,cAAc,CAAC,MAAW;IACjC,OAAO,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AASD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,4BAA4B,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC;IACzF,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,SAAS,IAAI,IAAI,QAAQ,gBAAgB,QAAQ,GAAG,CAAC;IAEtE,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,sBAAsB,EAAE,CAAC;IAC/D,CAAC;IACD,IAAI,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,+CAA+C,EAAE,CAAC;IACxF,CAAC;IACD,OAAO;QACL,IAAI,EAAE,KAAK;QACX,QAAQ;QACR,GAAG,EACD,yEAAyE;YACzE,gEAAgE;KACnE,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACtE,6EAA6E;IAC7E,6EAA6E;IAC7E,8EAA8E;IAC9E,sEAAsE;IACtE,MAAM,MAAM,GAAG,GAAG,CAAC,8BAA8B,CAAC,KAAK,MAAM,CAAC;IAC9D,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,IAAI,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,uDAAuD;YACrD,gFAAgF,CACnF,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,yCAAyC,CAAC;IAC7E,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,kBAAkB,CAAC,KAAK,MAAM,EAAE,CAAC;QACxD,MAAM,IAAI,KAAK,CACb,yCAAyC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,GAAG,IAAI;YAC3E,4DAA4D,kBAAkB,QAAQ;YACtF,wCAAwC,CAC3C,CAAC;IACJ,CAAC;AACH,CAAC"}
|