@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,91 @@
|
|
|
1
|
+
import type { TenantContext } from './tenant-context.js';
|
|
2
|
+
/**
|
|
3
|
+
* Actor → TenantContext derivation (feature 050, FR-002 / data-model §1).
|
|
4
|
+
*
|
|
5
|
+
* The context is computed server-side from the already-authenticated actor and
|
|
6
|
+
* (for scoped admins) their assignment set. It is never taken from request
|
|
7
|
+
* inputs. Kept as a pure function so it is trivially unit-testable.
|
|
8
|
+
*
|
|
9
|
+
* ## `TenantActorInput` is **not** `@endora-commerce/contracts`' `Actor`, and
|
|
10
|
+
* that survived T118b deliberately
|
|
11
|
+
*
|
|
12
|
+
* T118b collapsed three of the platform's four actor restatements — the two
|
|
13
|
+
* `*ActorSlice` interfaces and `product-audience.ts`' inline cast — because each
|
|
14
|
+
* existed for one reason, that D-52/D-53 forbade the platform an import of the
|
|
15
|
+
* module declaring the shape, and that reason is gone: the shape is
|
|
16
|
+
* `@endora-commerce/contracts`' and the `FastifyRequest` augmentation is
|
|
17
|
+
* `../http/request-actor.ts`'.
|
|
18
|
+
*
|
|
19
|
+
* This one is not that. It is the **input** of a derivation, not a reading of
|
|
20
|
+
* `request.actor`, and it differs from `Actor` in three ways that are the
|
|
21
|
+
* function's whole subject:
|
|
22
|
+
*
|
|
23
|
+
* - {@link CustomerActorInput.rollupSubtreeOrganizationIds} is **server-derived**
|
|
24
|
+
* — the caller resolves the buyer's org subtree and passes it. Putting it on
|
|
25
|
+
* `Actor` would put a capability decision on the request's identity, which is
|
|
26
|
+
* exactly what "never taken from request inputs" refuses.
|
|
27
|
+
* - {@link ApiKeyActorInput} carries the binding and drops `scopes` and
|
|
28
|
+
* `salesChannelId`: scope is a route gate's question and the channel is the
|
|
29
|
+
* sales-channel resolver's, and neither reaches a tenant context.
|
|
30
|
+
* - There is **no anonymous kind**. Anonymous traffic gets no tenant context;
|
|
31
|
+
* the mapping's caller answers it before calling, and a fourth member here
|
|
32
|
+
* would be a case this function has no answer for.
|
|
33
|
+
*
|
|
34
|
+
* So the two shapes agree on the fields they share and are different types on
|
|
35
|
+
* purpose. The caller that bridges them is the deployment's `buildTenantContext`.
|
|
36
|
+
*/
|
|
37
|
+
export interface CustomerActorInput {
|
|
38
|
+
readonly kind: 'customer';
|
|
39
|
+
readonly customerAccountId: string;
|
|
40
|
+
readonly organizationId: string | null;
|
|
41
|
+
readonly impersonatorAdminUserId?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Feature 056 (US2) — roll-up widening for a customer actor. When the customer
|
|
44
|
+
* holds the `organizations:rollup` capability, the server passes the actor's
|
|
45
|
+
* org subtree here (`[theirOrg, ...descendants]`), and the context resolves to
|
|
46
|
+
* an `allowed-set` instead of `single-org` (FR-004/FR-005). When absent/empty,
|
|
47
|
+
* the customer stays `single-org` (flat behavior preserved).
|
|
48
|
+
*
|
|
49
|
+
* NB: there is no customer-facing capability source wired in production today
|
|
50
|
+
* (admin permissions do not attach to customer accounts), so production
|
|
51
|
+
* customer contexts stay `single-org`; the roll-up path for scoped actors is
|
|
52
|
+
* derived at the admin scope-builder seam (`resolveAdminOrdersScope` /
|
|
53
|
+
* `resolveModerationActor`) via the subtree-aware `SalesRepAssignmentService`.
|
|
54
|
+
* This field keeps the derivation server-side (Principle XI) and ready for a
|
|
55
|
+
* future customer-capability source.
|
|
56
|
+
*/
|
|
57
|
+
readonly rollupSubtreeOrganizationIds?: readonly string[];
|
|
58
|
+
}
|
|
59
|
+
export interface AdminActorInput {
|
|
60
|
+
readonly kind: 'admin';
|
|
61
|
+
readonly adminUserId: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Feature 062 — an api-key actor. A BOUND key (organizationId present) pins the
|
|
65
|
+
* request to its organization + designated service customer account with a
|
|
66
|
+
* first-class `api_key` actor for audit attribution. An UNBOUND key keeps the
|
|
67
|
+
* legacy trusted system scope (its only mounted surface is the global-entity
|
|
68
|
+
* PIM read/write path — research §R5).
|
|
69
|
+
*/
|
|
70
|
+
export interface ApiKeyActorInput {
|
|
71
|
+
readonly kind: 'api_key';
|
|
72
|
+
readonly apiKeyId: string;
|
|
73
|
+
readonly organizationId?: string | null;
|
|
74
|
+
readonly customerAccountId?: string | null;
|
|
75
|
+
}
|
|
76
|
+
export type TenantActorInput = CustomerActorInput | AdminActorInput | ApiKeyActorInput;
|
|
77
|
+
/**
|
|
78
|
+
* A scoped admin's reach. `allowAll: true` ⇒ platform admin (no restriction).
|
|
79
|
+
* Otherwise the admin is confined to `allowedOrganizationIds`. Mirrors the
|
|
80
|
+
* shape already produced by `resolveAdminOrdersScope` in composition.ts.
|
|
81
|
+
*/
|
|
82
|
+
export interface AdminScopeInput {
|
|
83
|
+
readonly allowAll: boolean;
|
|
84
|
+
readonly allowedOrganizationIds?: readonly string[];
|
|
85
|
+
}
|
|
86
|
+
export declare function resolveTenantContext(actor: TenantActorInput, adminScope?: AdminScopeInput): TenantContext;
|
|
87
|
+
/** Context for platform-internal work (workers, migrations, escape hatch). */
|
|
88
|
+
export declare function systemTenantContext(reason: string): TenantContext;
|
|
89
|
+
/** Context pinned to a single organization (per-org jobs via the escape hatch). */
|
|
90
|
+
export declare function orgPinnedTenantContext(organizationId: string, reason: string): TenantContext;
|
|
91
|
+
//# sourceMappingURL=resolve-tenant-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-tenant-context.d.ts","sourceRoot":"","sources":["../../src/tenancy/resolve-tenant-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,qBAAqB,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,4BAA4B,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3D;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAEvF;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,aAAa,CA6DzG;AAcD,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAEjE;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAO5F"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export function resolveTenantContext(actor, adminScope) {
|
|
2
|
+
if (actor.kind === 'customer') {
|
|
3
|
+
// Feature 056 — a roll-up-enabled customer widens from single-org to the
|
|
4
|
+
// subtree allowed-set (server-derived). Absent/empty ⇒ single-org (flat).
|
|
5
|
+
if (actor.rollupSubtreeOrganizationIds && actor.rollupSubtreeOrganizationIds.length > 0) {
|
|
6
|
+
return {
|
|
7
|
+
mode: 'allowed-set',
|
|
8
|
+
allowedOrganizationIds: [...actor.rollupSubtreeOrganizationIds],
|
|
9
|
+
notices: newScopeNotices(),
|
|
10
|
+
customerAccountId: actor.customerAccountId,
|
|
11
|
+
actor: { kind: 'customer', id: actor.customerAccountId },
|
|
12
|
+
...(actor.impersonatorAdminUserId
|
|
13
|
+
? {
|
|
14
|
+
impersonation: {
|
|
15
|
+
realAdminUserId: actor.impersonatorAdminUserId,
|
|
16
|
+
impersonatedCustomerAccountId: actor.customerAccountId,
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
: {}),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
mode: 'single-org',
|
|
24
|
+
organizationId: actor.organizationId,
|
|
25
|
+
customerAccountId: actor.customerAccountId,
|
|
26
|
+
actor: { kind: 'customer', id: actor.customerAccountId },
|
|
27
|
+
...(actor.impersonatorAdminUserId
|
|
28
|
+
? {
|
|
29
|
+
impersonation: {
|
|
30
|
+
realAdminUserId: actor.impersonatorAdminUserId,
|
|
31
|
+
impersonatedCustomerAccountId: actor.customerAccountId,
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
: {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// Feature 062 — api-key actor: bound ⇒ single-org pinned to the binding;
|
|
38
|
+
// unbound ⇒ trusted system scope (unchanged legacy behavior, FR-020).
|
|
39
|
+
if (actor.kind === 'api_key') {
|
|
40
|
+
if (actor.organizationId) {
|
|
41
|
+
return {
|
|
42
|
+
mode: 'single-org',
|
|
43
|
+
organizationId: actor.organizationId,
|
|
44
|
+
customerAccountId: actor.customerAccountId ?? null,
|
|
45
|
+
actor: { kind: 'api_key', id: actor.apiKeyId },
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return systemTenantContext('actor:api_key');
|
|
49
|
+
}
|
|
50
|
+
// Admin actor.
|
|
51
|
+
if (!adminScope || adminScope.allowAll) {
|
|
52
|
+
return { mode: 'all', actor: { kind: 'admin', id: actor.adminUserId } };
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
mode: 'allowed-set',
|
|
56
|
+
allowedOrganizationIds: adminScope.allowedOrganizationIds ?? [],
|
|
57
|
+
notices: newScopeNotices(),
|
|
58
|
+
actor: { kind: 'admin', id: actor.adminUserId },
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A fresh observation sink for one execution (feature 087). Attached to the two
|
|
63
|
+
* `allowed-set` branches above and to nothing else: `all` and `system` refuse
|
|
64
|
+
* nothing, and `single-org` refuses per row rather than per table, so neither
|
|
65
|
+
* has an emptiness to explain. One object per call, so a context can never
|
|
66
|
+
* carry another request's observation — `resolveTenantContext` is called once
|
|
67
|
+
* per request by the host's scope hook.
|
|
68
|
+
*/
|
|
69
|
+
function newScopeNotices() {
|
|
70
|
+
return { organizationAttributionRefused: false };
|
|
71
|
+
}
|
|
72
|
+
/** Context for platform-internal work (workers, migrations, escape hatch). */
|
|
73
|
+
export function systemTenantContext(reason) {
|
|
74
|
+
return { mode: 'system', actor: { kind: 'system' }, reason };
|
|
75
|
+
}
|
|
76
|
+
/** Context pinned to a single organization (per-org jobs via the escape hatch). */
|
|
77
|
+
export function orgPinnedTenantContext(organizationId, reason) {
|
|
78
|
+
return {
|
|
79
|
+
mode: 'single-org',
|
|
80
|
+
organizationId,
|
|
81
|
+
actor: { kind: 'system' },
|
|
82
|
+
reason,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=resolve-tenant-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-tenant-context.js","sourceRoot":"","sources":["../../src/tenancy/resolve-tenant-context.ts"],"names":[],"mappings":"AA4FA,MAAM,UAAU,oBAAoB,CAAC,KAAuB,EAAE,UAA4B;IACxF,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC9B,yEAAyE;QACzE,0EAA0E;QAC1E,IAAI,KAAK,CAAC,4BAA4B,IAAI,KAAK,CAAC,4BAA4B,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxF,OAAO;gBACL,IAAI,EAAE,aAAa;gBACnB,sBAAsB,EAAE,CAAC,GAAG,KAAK,CAAC,4BAA4B,CAAC;gBAC/D,OAAO,EAAE,eAAe,EAAE;gBAC1B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;gBAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE;gBACxD,GAAG,CAAC,KAAK,CAAC,uBAAuB;oBAC/B,CAAC,CAAC;wBACE,aAAa,EAAE;4BACb,eAAe,EAAE,KAAK,CAAC,uBAAuB;4BAC9C,6BAA6B,EAAE,KAAK,CAAC,iBAAiB;yBACvD;qBACF;oBACH,CAAC,CAAC,EAAE,CAAC;aACR,CAAC;QACJ,CAAC;QACD,OAAO;YACL,IAAI,EAAE,YAAY;YAClB,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;YAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE;YACxD,GAAG,CAAC,KAAK,CAAC,uBAAuB;gBAC/B,CAAC,CAAC;oBACE,aAAa,EAAE;wBACb,eAAe,EAAE,KAAK,CAAC,uBAAuB;wBAC9C,6BAA6B,EAAE,KAAK,CAAC,iBAAiB;qBACvD;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CAAC;IACJ,CAAC;IAED,yEAAyE;IACzE,sEAAsE;IACtE,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;YACzB,OAAO;gBACL,IAAI,EAAE,YAAY;gBAClB,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,IAAI,IAAI;gBAClD,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,CAAC,QAAQ,EAAE;aAC/C,CAAC;QACJ,CAAC;QACD,OAAO,mBAAmB,CAAC,eAAe,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe;IACf,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;IAC1E,CAAC;IACD,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,sBAAsB,EAAE,UAAU,CAAC,sBAAsB,IAAI,EAAE;QAC/D,OAAO,EAAE,eAAe,EAAE;QAC1B,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,WAAW,EAAE;KAChD,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,eAAe;IACtB,OAAO,EAAE,8BAA8B,EAAE,KAAK,EAAE,CAAC;AACnD,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC;AAC/D,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,sBAAsB,CAAC,cAAsB,EAAE,MAAc;IAC3E,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,cAAc;QACd,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EntityManager, MikroORM } from '@mikro-orm/postgresql';
|
|
2
|
+
/**
|
|
3
|
+
* EM fork used across composition.ts (feature 050). The tenant filters read the
|
|
4
|
+
* ambient TenantContext from AsyncLocalStorage at query time (see filters.ts),
|
|
5
|
+
* so no per-fork `setFilterParams` is required — a plain fork already carries the
|
|
6
|
+
* guard. This wrapper is retained as the single, named injection seam so the
|
|
7
|
+
* intent is explicit at call sites and future per-fork wiring has one home.
|
|
8
|
+
*/
|
|
9
|
+
export declare function forkScopedEm(orm: MikroORM): EntityManager;
|
|
10
|
+
//# sourceMappingURL=scoped-em.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-em.d.ts","sourceRoot":"","sources":["../../src/tenancy/scoped-em.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,QAAQ,GAAG,aAAa,CAEzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EM fork used across composition.ts (feature 050). The tenant filters read the
|
|
3
|
+
* ambient TenantContext from AsyncLocalStorage at query time (see filters.ts),
|
|
4
|
+
* so no per-fork `setFilterParams` is required — a plain fork already carries the
|
|
5
|
+
* guard. This wrapper is retained as the single, named injection seam so the
|
|
6
|
+
* intent is explicit at call sites and future per-fork wiring has one home.
|
|
7
|
+
*/
|
|
8
|
+
export function forkScopedEm(orm) {
|
|
9
|
+
return orm.em.fork();
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=scoped-em.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoped-em.js","sourceRoot":"","sources":["../../src/tenancy/scoped-em.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,GAAa;IACxC,OAAO,GAAG,CAAC,EAAE,CAAC,IAAI,EAAmB,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Systemic Organization Tenant Scoping (feature 050).
|
|
3
|
+
*
|
|
4
|
+
* The ambient `TenantContext` is the single source of truth for "which tenant
|
|
5
|
+
* is this async execution allowed to see?". It is derived server-side from the
|
|
6
|
+
* authenticated actor (never from request inputs) and read by the MikroORM
|
|
7
|
+
* filter's `cond` thunk **when a query is built** (`filters.ts`) — never stamped
|
|
8
|
+
* onto an EntityManager. `forkScopedEm` is a bare `orm.em.fork()`; a manager
|
|
9
|
+
* therefore carries no tenancy of its own, and the same fork yields different
|
|
10
|
+
* rows under different ambient contexts (feature 072, T038).
|
|
11
|
+
*
|
|
12
|
+
* Modes:
|
|
13
|
+
* - `single-org` — a customer (or an org-pinned job); confined to one org.
|
|
14
|
+
* - `allowed-set` — a scoped sales-rep admin; confined to an assigned set.
|
|
15
|
+
* - `all` — a platform admin; no org restriction (still explicit).
|
|
16
|
+
* - `system` — worker / migration / escape hatch; crosses all orgs.
|
|
17
|
+
*
|
|
18
|
+
* Fail-closed: a query against a tenant-scoped entity with NO ambient context
|
|
19
|
+
* raises `MissingTenantContextError` (see `filters.ts`) — it never returns
|
|
20
|
+
* unscoped rows.
|
|
21
|
+
*/
|
|
22
|
+
export type TenantScopeMode = 'single-org' | 'allowed-set' | 'all' | 'system';
|
|
23
|
+
export interface TenantActor {
|
|
24
|
+
/** `api_key` (feature 062) = a bound distributor key acting as the tenant principal. */
|
|
25
|
+
readonly kind: 'customer' | 'admin' | 'system' | 'api_key';
|
|
26
|
+
readonly id?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TenantImpersonation {
|
|
29
|
+
readonly realAdminUserId: string;
|
|
30
|
+
readonly impersonatedCustomerAccountId: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What the tenant guard **did** to this execution, as opposed to what it was
|
|
34
|
+
* allowed to do (feature 087, owner decision of 2026-08-29).
|
|
35
|
+
*
|
|
36
|
+
* A predicate that refuses every row of a table is correct and silent, and the
|
|
37
|
+
* two properties are in tension: the caller receives an empty result and cannot
|
|
38
|
+
* tell "your reach excludes all of these" from "there are none". The filter is
|
|
39
|
+
* the only thing that knows which it meant, so it records it here and the host
|
|
40
|
+
* discloses it on the response envelope (`kernel/request-scope-hook.ts`).
|
|
41
|
+
*
|
|
42
|
+
* Mutable, and deliberately so: one object per request, created beside the
|
|
43
|
+
* context it hangs off, written by the filter as queries run and read once the
|
|
44
|
+
* handler has answered. It is an observation of this execution, never an input
|
|
45
|
+
* to a decision — nothing in the guard reads it, so a stale or missing sink can
|
|
46
|
+
* widen no authority.
|
|
47
|
+
*/
|
|
48
|
+
export interface TenantScopeNotices {
|
|
49
|
+
/**
|
|
50
|
+
* Set when the `customerAccount` filter answered its `allowed-set` arm with
|
|
51
|
+
* the match-nothing predicate, i.e. the filtered entity carries no
|
|
52
|
+
* organization column of its own. See `customerFilterCond`.
|
|
53
|
+
*/
|
|
54
|
+
organizationAttributionRefused: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface TenantContext {
|
|
57
|
+
readonly mode: TenantScopeMode;
|
|
58
|
+
/** Present for `single-org`. */
|
|
59
|
+
readonly organizationId?: string | null;
|
|
60
|
+
/** Present for `allowed-set`. */
|
|
61
|
+
readonly allowedOrganizationIds?: readonly string[];
|
|
62
|
+
/** Present for customer actors — drives the `customerAccount` filter. */
|
|
63
|
+
readonly customerAccountId?: string | null;
|
|
64
|
+
readonly actor: TenantActor;
|
|
65
|
+
readonly impersonation?: TenantImpersonation;
|
|
66
|
+
/** Required for `system` scope entered via the escape hatch. */
|
|
67
|
+
readonly reason?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Per-request observation sink. Attached by `resolveTenantContext` to the
|
|
70
|
+
* contexts whose predicates can refuse wholesale (`allowed-set`), absent
|
|
71
|
+
* everywhere else — a mode that never refuses has nothing to disclose.
|
|
72
|
+
*/
|
|
73
|
+
readonly notices?: TenantScopeNotices;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Record that the ambient execution was refused a whole table for want of an
|
|
77
|
+
* organization column. A context with no sink (every mode but `allowed-set`,
|
|
78
|
+
* and any context a caller built by hand) drops the observation, which is the
|
|
79
|
+
* right failure: the disclosure goes missing, never the refusal.
|
|
80
|
+
*/
|
|
81
|
+
export declare function noteOrganizationAttributionRefusal(ctx: TenantContext): void;
|
|
82
|
+
/**
|
|
83
|
+
* Thrown when a tenant-scoped entity is queried with no ambient context. This is
|
|
84
|
+
* the fail-closed guarantee: forgetting to establish a context surfaces as a loud
|
|
85
|
+
* error, never a silent cross-tenant read.
|
|
86
|
+
*/
|
|
87
|
+
export declare class MissingTenantContextError extends Error {
|
|
88
|
+
constructor(detail?: string);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Thrown when a write carries an `organizationId` the ambient scope may not act
|
|
92
|
+
* on (D-260/A). It sits beside {@link MissingTenantContextError} because the two
|
|
93
|
+
* are one guarantee failing in the two directions the data layer has: that one
|
|
94
|
+
* is "no scope was established", this one is "a scope was established and this
|
|
95
|
+
* row is outside it".
|
|
96
|
+
*
|
|
97
|
+
* **It names no organization** — neither the one the write carried nor the set
|
|
98
|
+
* the actor holds. The refusal reaches a caller that supplied the id, so
|
|
99
|
+
* "outside your scope" tells it nothing it did not already know, while echoing
|
|
100
|
+
* the *set* would put the actor's reach into a log and an HTTP body. The entity
|
|
101
|
+
* class is carried because a flush-time refusal is otherwise undiagnosable: the
|
|
102
|
+
* stack frame belongs to MikroORM's unit of work and names no caller.
|
|
103
|
+
*
|
|
104
|
+
* Thrown by `org-write-guard.ts`; mapped to `403 FORBIDDEN` in
|
|
105
|
+
* `http/error-envelope.ts`, which explains there why 403 and not 404.
|
|
106
|
+
*/
|
|
107
|
+
export declare class OrgWriteOutOfScopeError extends Error {
|
|
108
|
+
/** The entity class whose write was refused. Never the organization id. */
|
|
109
|
+
readonly entityName: string;
|
|
110
|
+
constructor(entityName: string);
|
|
111
|
+
}
|
|
112
|
+
/** The ambient context for the current async execution, or `undefined` if none is set. */
|
|
113
|
+
export declare function getTenantContext(): TenantContext | undefined;
|
|
114
|
+
/** Run `fn` with `ctx` as the ambient context for its entire async subtree. */
|
|
115
|
+
export declare function runWithTenantContext<T>(ctx: TenantContext, fn: () => Promise<T>): Promise<T>;
|
|
116
|
+
/**
|
|
117
|
+
* Set the ambient context for the current async execution. NOTE: when called
|
|
118
|
+
* inside an *async* Fastify hook this does not propagate to the route handler
|
|
119
|
+
* (the handler resumes in the hook's parent async context). Prefer
|
|
120
|
+
* `runInTenantContext` in the request pipeline; keep this only for synchronous
|
|
121
|
+
* top-level entrypoints (e.g. a worker process bootstrap).
|
|
122
|
+
*/
|
|
123
|
+
export declare function enterTenantContext(ctx: TenantContext): void;
|
|
124
|
+
/**
|
|
125
|
+
* Establish `ctx` for the remainder of a Fastify request via the callback-style
|
|
126
|
+
* hook pattern: `addHook('onRequest', (req, reply, done) => runInTenantContext(ctx, done))`.
|
|
127
|
+
* Fastify invokes the next hook/handler synchronously inside `callback`, so the
|
|
128
|
+
* store propagates across the handler's awaited continuations. This is the
|
|
129
|
+
* reliable AsyncLocalStorage-with-Fastify pattern (cf. @fastify/request-context).
|
|
130
|
+
*/
|
|
131
|
+
export declare function runInTenantContext(ctx: TenantContext, callback: () => void): void;
|
|
132
|
+
/**
|
|
133
|
+
* Run `fn` with NO ambient context (fail-closed testing / explicit clears).
|
|
134
|
+
*
|
|
135
|
+
* **`storage.run(undefined, fn)`, never `storage.exit(fn)`.** On the
|
|
136
|
+
* pre-`AsyncContextFrame` runtime — which is every Node before 24, and this
|
|
137
|
+
* repository's floor is 22.17 — `exit` is `disable(); try { fn() } finally
|
|
138
|
+
* { enable() }`: a *synchronous* try/finally around a callback that may be
|
|
139
|
+
* `async`. Where the caller's context was installed with `enterWith` and `fn`
|
|
140
|
+
* opens a nested `run()` of its own, the re-enable resurfaces the caller's
|
|
141
|
+
* store and everything after that point reads it, so the "no context" this
|
|
142
|
+
* function promises silently ends partway through. Node 24 made
|
|
143
|
+
* `AsyncContextFrame` the default and `exit` frame-scoped, which is why the
|
|
144
|
+
* defect was invisible on a developer's machine and red in CI for as long as it
|
|
145
|
+
* stood (`test/unit/seeds/seed-scope.test.ts`,
|
|
146
|
+
* `packages/platform/src/kernel/lifecycle/registry-cache-scope.test.ts`).
|
|
147
|
+
*
|
|
148
|
+
* Running with `undefined` as the store is the same observable contract —
|
|
149
|
+
* `getStore()` answers `undefined`, and the caller's context is restored on
|
|
150
|
+
* both return and throw — and it is a real frame, so it holds across `await`
|
|
151
|
+
* on both runtimes. Verified on 22.17 and on 26.
|
|
152
|
+
*/
|
|
153
|
+
export declare function runWithoutTenantContext<T>(fn: () => T): T;
|
|
154
|
+
//# sourceMappingURL=tenant-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-context.d.ts","sourceRoot":"","sources":["../../src/tenancy/tenant-context.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,aAAa,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE9E,MAAM,WAAW,WAAW;IAC1B,wFAAwF;IACxF,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3D,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;CAChD;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,8BAA8B,EAAE,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,gCAAgC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,iCAAiC;IACjC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpD,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,mBAAmB,CAAC;IAC7C,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;CACvC;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAE3E;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,MAAM,CAAC,EAAE,MAAM;CAQ5B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,UAAU,EAAE,MAAM;CAS/B;AASD,0FAA0F;AAC1F,wBAAgB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAE5D;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE5F;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAEjF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAEzD"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
+
/**
|
|
3
|
+
* Record that the ambient execution was refused a whole table for want of an
|
|
4
|
+
* organization column. A context with no sink (every mode but `allowed-set`,
|
|
5
|
+
* and any context a caller built by hand) drops the observation, which is the
|
|
6
|
+
* right failure: the disclosure goes missing, never the refusal.
|
|
7
|
+
*/
|
|
8
|
+
export function noteOrganizationAttributionRefusal(ctx) {
|
|
9
|
+
if (ctx.notices)
|
|
10
|
+
ctx.notices.organizationAttributionRefused = true;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Thrown when a tenant-scoped entity is queried with no ambient context. This is
|
|
14
|
+
* the fail-closed guarantee: forgetting to establish a context surfaces as a loud
|
|
15
|
+
* error, never a silent cross-tenant read.
|
|
16
|
+
*/
|
|
17
|
+
export class MissingTenantContextError extends Error {
|
|
18
|
+
constructor(detail) {
|
|
19
|
+
super(`No tenant context is active for a tenant-scoped query.${detail ? ` (${detail})` : ''} Establish one via the request pipeline, or opt out explicitly with withSystemScope()/withOrgScope().`);
|
|
20
|
+
this.name = 'MissingTenantContextError';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Thrown when a write carries an `organizationId` the ambient scope may not act
|
|
25
|
+
* on (D-260/A). It sits beside {@link MissingTenantContextError} because the two
|
|
26
|
+
* are one guarantee failing in the two directions the data layer has: that one
|
|
27
|
+
* is "no scope was established", this one is "a scope was established and this
|
|
28
|
+
* row is outside it".
|
|
29
|
+
*
|
|
30
|
+
* **It names no organization** — neither the one the write carried nor the set
|
|
31
|
+
* the actor holds. The refusal reaches a caller that supplied the id, so
|
|
32
|
+
* "outside your scope" tells it nothing it did not already know, while echoing
|
|
33
|
+
* the *set* would put the actor's reach into a log and an HTTP body. The entity
|
|
34
|
+
* class is carried because a flush-time refusal is otherwise undiagnosable: the
|
|
35
|
+
* stack frame belongs to MikroORM's unit of work and names no caller.
|
|
36
|
+
*
|
|
37
|
+
* Thrown by `org-write-guard.ts`; mapped to `403 FORBIDDEN` in
|
|
38
|
+
* `http/error-envelope.ts`, which explains there why 403 and not 404.
|
|
39
|
+
*/
|
|
40
|
+
export class OrgWriteOutOfScopeError extends Error {
|
|
41
|
+
/** The entity class whose write was refused. Never the organization id. */
|
|
42
|
+
entityName;
|
|
43
|
+
constructor(entityName) {
|
|
44
|
+
super(`A write to ${entityName} carries an organization outside the active tenant scope ` +
|
|
45
|
+
'(feature 050 FR-003, D-260/A). Writing for another organization needs an explicit ' +
|
|
46
|
+
'widening — withSystemScope() / withOrgScope() — or it is a scope defect.');
|
|
47
|
+
this.name = 'OrgWriteOutOfScopeError';
|
|
48
|
+
this.entityName = entityName;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The store is `TenantContext | undefined` rather than `TenantContext` so that
|
|
53
|
+
* `runWithoutTenantContext` can express "no context" as a value it *runs* with
|
|
54
|
+
* — see the note on that function for why it may not use `exit()`.
|
|
55
|
+
*/
|
|
56
|
+
const storage = new AsyncLocalStorage();
|
|
57
|
+
/** The ambient context for the current async execution, or `undefined` if none is set. */
|
|
58
|
+
export function getTenantContext() {
|
|
59
|
+
return storage.getStore();
|
|
60
|
+
}
|
|
61
|
+
/** Run `fn` with `ctx` as the ambient context for its entire async subtree. */
|
|
62
|
+
export function runWithTenantContext(ctx, fn) {
|
|
63
|
+
return storage.run(ctx, fn);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Set the ambient context for the current async execution. NOTE: when called
|
|
67
|
+
* inside an *async* Fastify hook this does not propagate to the route handler
|
|
68
|
+
* (the handler resumes in the hook's parent async context). Prefer
|
|
69
|
+
* `runInTenantContext` in the request pipeline; keep this only for synchronous
|
|
70
|
+
* top-level entrypoints (e.g. a worker process bootstrap).
|
|
71
|
+
*/
|
|
72
|
+
export function enterTenantContext(ctx) {
|
|
73
|
+
storage.enterWith(ctx);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Establish `ctx` for the remainder of a Fastify request via the callback-style
|
|
77
|
+
* hook pattern: `addHook('onRequest', (req, reply, done) => runInTenantContext(ctx, done))`.
|
|
78
|
+
* Fastify invokes the next hook/handler synchronously inside `callback`, so the
|
|
79
|
+
* store propagates across the handler's awaited continuations. This is the
|
|
80
|
+
* reliable AsyncLocalStorage-with-Fastify pattern (cf. @fastify/request-context).
|
|
81
|
+
*/
|
|
82
|
+
export function runInTenantContext(ctx, callback) {
|
|
83
|
+
storage.run(ctx, callback);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Run `fn` with NO ambient context (fail-closed testing / explicit clears).
|
|
87
|
+
*
|
|
88
|
+
* **`storage.run(undefined, fn)`, never `storage.exit(fn)`.** On the
|
|
89
|
+
* pre-`AsyncContextFrame` runtime — which is every Node before 24, and this
|
|
90
|
+
* repository's floor is 22.17 — `exit` is `disable(); try { fn() } finally
|
|
91
|
+
* { enable() }`: a *synchronous* try/finally around a callback that may be
|
|
92
|
+
* `async`. Where the caller's context was installed with `enterWith` and `fn`
|
|
93
|
+
* opens a nested `run()` of its own, the re-enable resurfaces the caller's
|
|
94
|
+
* store and everything after that point reads it, so the "no context" this
|
|
95
|
+
* function promises silently ends partway through. Node 24 made
|
|
96
|
+
* `AsyncContextFrame` the default and `exit` frame-scoped, which is why the
|
|
97
|
+
* defect was invisible on a developer's machine and red in CI for as long as it
|
|
98
|
+
* stood (`test/unit/seeds/seed-scope.test.ts`,
|
|
99
|
+
* `packages/platform/src/kernel/lifecycle/registry-cache-scope.test.ts`).
|
|
100
|
+
*
|
|
101
|
+
* Running with `undefined` as the store is the same observable contract —
|
|
102
|
+
* `getStore()` answers `undefined`, and the caller's context is restored on
|
|
103
|
+
* both return and throw — and it is a real frame, so it holds across `await`
|
|
104
|
+
* on both runtimes. Verified on 22.17 and on 26.
|
|
105
|
+
*/
|
|
106
|
+
export function runWithoutTenantContext(fn) {
|
|
107
|
+
return storage.run(undefined, fn);
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=tenant-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-context.js","sourceRoot":"","sources":["../../src/tenancy/tenant-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAkFhD;;;;;GAKG;AACH,MAAM,UAAU,kCAAkC,CAAC,GAAkB;IACnE,IAAI,GAAG,CAAC,OAAO;QAAE,GAAG,CAAC,OAAO,CAAC,8BAA8B,GAAG,IAAI,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,MAAe;QACzB,KAAK,CACH,yDACE,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,EAC5B,uGAAuG,CACxG,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,2EAA2E;IAClE,UAAU,CAAS;IAE5B,YAAY,UAAkB;QAC5B,KAAK,CACH,cAAc,UAAU,2DAA2D;YACjF,oFAAoF;YACpF,0EAA0E,CAC7E,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAA6B,CAAC;AAEnE,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,oBAAoB,CAAI,GAAkB,EAAE,EAAoB;IAC9E,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAkB;IACnD,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAkB,EAAE,QAAoB;IACzE,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,uBAAuB,CAAI,EAAW;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@endora-commerce/platform",
|
|
3
|
+
"version": "0.100.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"endora": {
|
|
7
|
+
"type": "platform"
|
|
8
|
+
},
|
|
9
|
+
"description": "The host package (feature 080, T042a). Publishes the surface an installed extension package compiles against: five enumerated subpaths, one per platform directory that has published API. No root export and no wildcard (D-160.7). The remaining subpaths are host-internal and no module may name any of them (D-160.14) — how many that is is not written here, `HOST_INTERNAL_SUBPATHS` in packages/cli/src/lib/platform-surface.ts carries one reason per member and this sentence read 'three' over six of them: ./composition, the host composition surface; ./db, the ORM configuration, the migration ordering and the bootstrap (specs/110-instance-repository/, T116); ./migrations, the platform's own twelve migrations and the frozen historical prefix an execution order is computed from (specs/110-instance-repository/, R1.5); ./lifecycle, the operator surface that drives the platform presence axis (specs/115-lifecycle-container-move/, D115-4); ./env, the environment inputs the host reads; ./packages, installed extension-package discovery; ./overlay, the loader that composes a deployment's client-only modules (specs/110-instance-repository/, T113 and T114); ./cli, the host's side of a module-declared operator command (T117); and ./demo, the demo-data guard, plan, runner and report (feature 113, T119b).",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/endora-commerce/endora-commerce.git",
|
|
14
|
+
"directory": "packages/platform"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
"./kernel": {
|
|
21
|
+
"types": "./dist/kernel/index.d.ts",
|
|
22
|
+
"default": "./dist/kernel/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./http": {
|
|
25
|
+
"types": "./dist/http/index.d.ts",
|
|
26
|
+
"default": "./dist/http/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./tenancy": {
|
|
29
|
+
"types": "./dist/tenancy/index.d.ts",
|
|
30
|
+
"default": "./dist/tenancy/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./commands": {
|
|
33
|
+
"types": "./dist/commands/index.d.ts",
|
|
34
|
+
"default": "./dist/commands/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./events": {
|
|
37
|
+
"types": "./dist/events/index.d.ts",
|
|
38
|
+
"default": "./dist/events/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./composition": {
|
|
41
|
+
"types": "./dist/composition/index.d.ts",
|
|
42
|
+
"default": "./dist/composition/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./db": {
|
|
45
|
+
"types": "./dist/db/index.d.ts",
|
|
46
|
+
"default": "./dist/db/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./migrations": {
|
|
49
|
+
"types": "./dist/migrations/index.d.ts",
|
|
50
|
+
"default": "./dist/migrations/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./lifecycle": {
|
|
53
|
+
"types": "./dist/lifecycle/index.d.ts",
|
|
54
|
+
"default": "./dist/lifecycle/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./env": {
|
|
57
|
+
"types": "./dist/env/index.d.ts",
|
|
58
|
+
"default": "./dist/env/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./packages": {
|
|
61
|
+
"types": "./dist/packages/index.d.ts",
|
|
62
|
+
"default": "./dist/packages/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./overlay": {
|
|
65
|
+
"types": "./dist/overlay/index.d.ts",
|
|
66
|
+
"default": "./dist/overlay/index.js"
|
|
67
|
+
},
|
|
68
|
+
"./cli": {
|
|
69
|
+
"types": "./dist/cli/index.d.ts",
|
|
70
|
+
"default": "./dist/cli/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./demo": {
|
|
73
|
+
"types": "./dist/demo/index.d.ts",
|
|
74
|
+
"default": "./dist/demo/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./package.json": "./package.json"
|
|
77
|
+
},
|
|
78
|
+
"files": [
|
|
79
|
+
"dist"
|
|
80
|
+
],
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=22.18.0"
|
|
83
|
+
},
|
|
84
|
+
"dependencies": {
|
|
85
|
+
"@asteasolutions/zod-to-openapi": "^8.5.0",
|
|
86
|
+
"@fastify/cookie": "^11.0.2",
|
|
87
|
+
"@fastify/cors": "^11.2.0",
|
|
88
|
+
"@fastify/helmet": "^13.0.2",
|
|
89
|
+
"@fastify/rate-limit": "^10.3.0",
|
|
90
|
+
"@fastify/type-provider-zod": "^1.0.0",
|
|
91
|
+
"argon2": "^0.44.0",
|
|
92
|
+
"awilix": "^13.0.5",
|
|
93
|
+
"bullmq": "^5.76.1",
|
|
94
|
+
"fastify-plugin": "^5.1.0",
|
|
95
|
+
"ioredis": "^5.10.1",
|
|
96
|
+
"openapi-types": "^12.1.3",
|
|
97
|
+
"pino": "^10.3.1",
|
|
98
|
+
"@endora-commerce/contracts": "0.100.0"
|
|
99
|
+
},
|
|
100
|
+
"peerDependencies": {
|
|
101
|
+
"@mikro-orm/core": "^6",
|
|
102
|
+
"@mikro-orm/migrations": "^6",
|
|
103
|
+
"@mikro-orm/postgresql": "^6",
|
|
104
|
+
"fastify": "^5",
|
|
105
|
+
"zod": "^4"
|
|
106
|
+
},
|
|
107
|
+
"devDependencies": {
|
|
108
|
+
"@mikro-orm/core": "^6.6.13",
|
|
109
|
+
"@mikro-orm/migrations": "^6.6.13",
|
|
110
|
+
"@mikro-orm/postgresql": "^6.6.13",
|
|
111
|
+
"@types/node": "^22.9.0",
|
|
112
|
+
"fastify": "^5.12.5",
|
|
113
|
+
"typescript": "^5.9.3",
|
|
114
|
+
"vitest": "^4.1.11",
|
|
115
|
+
"zod": "^4.2.0"
|
|
116
|
+
},
|
|
117
|
+
"scripts": {
|
|
118
|
+
"build": "tsc -p tsconfig.build.json && node ../../scripts/copy-package-assets.mjs --src src --out dist",
|
|
119
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.test.json",
|
|
120
|
+
"lint": "eslint src",
|
|
121
|
+
"test": "vitest run"
|
|
122
|
+
}
|
|
123
|
+
}
|