bazis 0.96.1
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 +146 -0
- package/cli/build.ts +147 -0
- package/cli/codegen.ts +40 -0
- package/cli/generateModule.ts +187 -0
- package/cli/generateProject.ts +183 -0
- package/cli/main.ts +125 -0
- package/cli/moduleRegistration.ts +127 -0
- package/cli/naming.ts +124 -0
- package/cli/parseCli.ts +151 -0
- package/cli/templates/module.ts +497 -0
- package/cli/templates/pack.ts +76 -0
- package/cli/templates/passport.ts +178 -0
- package/core/agent/AgentContextBuilder.ts +567 -0
- package/core/agent/AgentDataDefinition.ts +8 -0
- package/core/agent/AgentRegistry.ts +539 -0
- package/core/agent/AgentRuntime.ts +47 -0
- package/core/agent/AgentToolExecutor.ts +2130 -0
- package/core/agent/AgentToolHooks.ts +39 -0
- package/core/agent/ModelProvider.ts +21 -0
- package/core/agent/README.md +229 -0
- package/core/agent/Tool.contract.ts +20 -0
- package/core/agent/decorators/Agent.ts +11 -0
- package/core/agent/decorators/Prompt.ts +11 -0
- package/core/agent/decorators/Task.ts +29 -0
- package/core/agent/decorators/Tool.ts +12 -0
- package/core/agent/errors.ts +43 -0
- package/core/agent/generated/catalog.ts +26 -0
- package/core/agent/index.ts +170 -0
- package/core/agent/internal/AgentExecutionDriver.ts +1497 -0
- package/core/agent/internal/AgentExecutionState.ts +775 -0
- package/core/agent/internal/AgentJsonSchema.ts +150 -0
- package/core/agent/internal/AgentModelBinding.ts +57 -0
- package/core/agent/internal/Schema.contract.ts +36 -0
- package/core/agent/internal/ToolAudit.projector.ts +163 -0
- package/core/agent/internal/ToolContract.validator.ts +102 -0
- package/core/agent/metadata.ts +398 -0
- package/core/agent/moduleContributions-v1.ts +113 -0
- package/core/agent/semantic.ts +903 -0
- package/core/agent/session/codec.ts +33 -0
- package/core/agent/session/contracts.ts +96 -0
- package/core/agent/session/entities.ts +84 -0
- package/core/agent/session/protector.ts +92 -0
- package/core/app/index.ts +5 -0
- package/core/app/runApp.ts +293 -0
- package/core/app/ui/index.ts +29 -0
- package/core/app/ui/uiProfileResolver.ts +966 -0
- package/core/app/ui/uiSurfaceHosting.ts +38 -0
- package/core/app/ui/uiSurfaceHttp.ts +476 -0
- package/core/background/BackgroundService.ts +223 -0
- package/core/background/backgroundModule.ts +42 -0
- package/core/background/decorator.ts +43 -0
- package/core/background/delay.ts +27 -0
- package/core/background/index.ts +15 -0
- package/core/cache/COMPATIBILITY.md +13 -0
- package/core/cache/ICache.ts +71 -0
- package/core/cache/MemoryCache.ts +394 -0
- package/core/cache/README.md +83 -0
- package/core/cache/SPEC.md +1355 -0
- package/core/cache/cacheModule.ts +21 -0
- package/core/cache/decorators/Cacheable.ts +38 -0
- package/core/cache/decorators/CacheableRedis.ts +39 -0
- package/core/cache/decorators/OutputCache.ts +33 -0
- package/core/cache/decorators/OutputRedisCache.ts +33 -0
- package/core/cache/decorators/cacheableMetadata.ts +78 -0
- package/core/cache/decorators/cacheableRedisMetadata.ts +81 -0
- package/core/cache/decorators/outputCacheMetadata.ts +71 -0
- package/core/cache/decorators/outputRedisCacheMetadata.ts +77 -0
- package/core/cache/di/classProviderHook.ts +26 -0
- package/core/cache/distributed/CacheCodec.ts +5 -0
- package/core/cache/distributed/DistributedCache.ts +403 -0
- package/core/cache/distributed/DistributedCacheDriver.ts +83 -0
- package/core/cache/distributed/DistributedCacheStores.ts +28 -0
- package/core/cache/distributed/IDistributedCache.ts +40 -0
- package/core/cache/distributed/NamedCacheRegistry.ts +23 -0
- package/core/cache/distributed/codecs.ts +32 -0
- package/core/cache/distributed/index.ts +19 -0
- package/core/cache/errors/CacheError.ts +16 -0
- package/core/cache/http/CachedHttpPayload.ts +213 -0
- package/core/cache/http/applyClientCacheHeaders.ts +61 -0
- package/core/cache/http/buildOutputCacheKey.ts +154 -0
- package/core/cache/http/buildRedisOutputCacheKey.ts +16 -0
- package/core/cache/http/composeOutputCache.ts +130 -0
- package/core/cache/http/outputCacheMiddleware.ts +111 -0
- package/core/cache/http/outputCacheSecurityWarning.ts +58 -0
- package/core/cache/http/outputRedisCacheMiddleware.ts +118 -0
- package/core/cache/index.ts +97 -0
- package/core/cache/internal/AutomaticCacheKey.ts +106 -0
- package/core/cache/internal/CacheKeyGuard.ts +56 -0
- package/core/cache/internal/buildCacheProviders.ts +146 -0
- package/core/cache/internal/normalizeCacheKey.ts +9 -0
- package/core/cache/internal/resolveCachePolicy.ts +32 -0
- package/core/cache/internal/resolveCacheableRedisPolicy.ts +17 -0
- package/core/cache/internal/resolveOutputRedisCachePolicy.ts +17 -0
- package/core/cache/providers/cachedProviders.ts +68 -0
- package/core/cache/services/cacheProxy.ts +243 -0
- package/core/cache/tokens/CACHE_POLICIES.ts +5 -0
- package/core/cache/tokens/DISTRIBUTED_CACHE.ts +30 -0
- package/core/cache/types/CacheEntry.ts +7 -0
- package/core/cache/types/CacheOptions.ts +60 -0
- package/core/cache/types/CachePolicy.ts +74 -0
- package/core/cache/types/CacheableRedisOptions.ts +23 -0
- package/core/cache/types/OutputRedisCacheOptions.ts +25 -0
- package/core/di/README.md +104 -0
- package/core/di/ServiceCollection.ts +185 -0
- package/core/di/ServiceProvider.ts +689 -0
- package/core/di/ServiceScope.ts +61 -0
- package/core/di/container.ts +38 -0
- package/core/di/errors/AmbiguousNamedDependencyError.ts +10 -0
- package/core/di/errors/AsyncResolutionRequiredError.ts +12 -0
- package/core/di/errors/CircularDependencyError.ts +10 -0
- package/core/di/errors/ClassDependenciesMismatchError.ts +15 -0
- package/core/di/errors/DiError.ts +6 -0
- package/core/di/errors/InvalidProviderError.ts +9 -0
- package/core/di/errors/ModuleEncapsulationError.ts +7 -0
- package/core/di/errors/ModuleOwnedProviderConflictError.ts +8 -0
- package/core/di/errors/NamedDependencyNotFoundError.ts +7 -0
- package/core/di/errors/OptionsValidationError.ts +7 -0
- package/core/di/errors/ProviderNotFoundError.ts +10 -0
- package/core/di/errors/ScopeDisposedError.ts +7 -0
- package/core/di/errors/ScopedServiceFromRootError.ts +9 -0
- package/core/di/errors/ServiceValidationError.ts +7 -0
- package/core/di/errors/index.ts +14 -0
- package/core/di/extensions/activator.ts +39 -0
- package/core/di/extensions/application.ts +117 -0
- package/core/di/extensions/hosted-service.ts +124 -0
- package/core/di/extensions/index.ts +23 -0
- package/core/di/extensions/options-reloadable.ts +137 -0
- package/core/di/extensions/options.ts +91 -0
- package/core/di/extensions/service-provider-token.ts +21 -0
- package/core/di/index.ts +97 -0
- package/core/di/internal/GraphValidator.ts +119 -0
- package/core/di/internal/HostedServicePlan.ts +158 -0
- package/core/di/internal/NamedTokenIndex.ts +55 -0
- package/core/di/internal/OpenGenericRegistration.ts +14 -0
- package/core/di/internal/ResolutionPlan.ts +18 -0
- package/core/di/internal/ResolutionScopeState.ts +19 -0
- package/core/di/internal/ResolutionTracker.ts +153 -0
- package/core/di/internal/ScopeLifecycle.ts +159 -0
- package/core/di/internal/ServiceRegistration.ts +14 -0
- package/core/di/internal/ServiceRegistry.ts +252 -0
- package/core/di/internal/classDeps.ts +38 -0
- package/core/di/internal/disposal.ts +58 -0
- package/core/di/internal/providerDeps.ts +26 -0
- package/core/di/module/DI.ts +146 -0
- package/core/di/module/Global.ts +25 -0
- package/core/di/module/Module.ts +44 -0
- package/core/di/module/ModuleRegistrar.ts +69 -0
- package/core/di/module/autoDeps.ts +39 -0
- package/core/di/module/classProviderHooks.ts +66 -0
- package/core/di/module/collectModuleConfigs.ts +57 -0
- package/core/di/module/collectModuleControllers.ts +53 -0
- package/core/di/module/collectModuleUiProfiles.ts +53 -0
- package/core/di/module/createContainer.ts +261 -0
- package/core/di/module/encapsulation.ts +416 -0
- package/core/di/module/encapsulationHooks.ts +36 -0
- package/core/di/module/generatedProviderAttachments.ts +102 -0
- package/core/di/module/index.ts +41 -0
- package/core/di/module/moduleExtensions.ts +35 -0
- package/core/di/module/moduleNameBinding.ts +136 -0
- package/core/di/module/moduleOwnedProviderContributors.ts +409 -0
- package/core/di/module/providerSelection.ts +90 -0
- package/core/di/module/shortcuts.ts +111 -0
- package/core/di/module/types/BazisModule.ts +71 -0
- package/core/di/module/types/DiRegistrar.ts +24 -0
- package/core/di/module/types/index.ts +2 -0
- package/core/di/provider/index.ts +26 -0
- package/core/di/provider/providerGuards.ts +17 -0
- package/core/di/provider/types/AsyncFactoryProvider.ts +15 -0
- package/core/di/provider/types/ClassProvider.ts +18 -0
- package/core/di/provider/types/FactoryProvider.ts +20 -0
- package/core/di/provider/types/KeyedDependency.ts +20 -0
- package/core/di/provider/types/LazyDependency.ts +31 -0
- package/core/di/provider/types/NamedDependency.ts +16 -0
- package/core/di/provider/types/Provider.ts +10 -0
- package/core/di/provider/types/ProviderDefinition.ts +11 -0
- package/core/di/provider/types/ProviderDependencyList.ts +11 -0
- package/core/di/provider/types/ProviderLifetime.ts +1 -0
- package/core/di/provider/types/ProviderOwnership.ts +7 -0
- package/core/di/provider/types/ResolvedDeps.ts +18 -0
- package/core/di/provider/types/ValueProvider.ts +6 -0
- package/core/di/provider/types/index.ts +13 -0
- package/core/di/token.ts +84 -0
- package/core/di/types/BuildServiceProviderOptions.ts +4 -0
- package/core/di/types/ServiceKey.ts +1 -0
- package/core/di/types/ServiceResolver.ts +16 -0
- package/core/di/types/index.ts +3 -0
- package/core/generatedFingerprint.ts +60 -0
- package/core/generatedRuntime.ts +187 -0
- package/core/grpc/Grpc.module.ts +23 -0
- package/core/grpc/GrpcBinding.contract.ts +35 -0
- package/core/grpc/GrpcCall.ts +73 -0
- package/core/grpc/GrpcClient.ts +172 -0
- package/core/grpc/GrpcClientCall.ts +267 -0
- package/core/grpc/GrpcError.ts +19 -0
- package/core/grpc/GrpcRequest.binding.ts +45 -0
- package/core/grpc/GrpcServer.ts +204 -0
- package/core/grpc/GrpcStatus.ts +8 -0
- package/core/grpc/GrpcTransport.ts +174 -0
- package/core/grpc/Metadata.ts +73 -0
- package/core/grpc/ProtoCodec.ts +225 -0
- package/core/grpc/ProtoParser.ts +192 -0
- package/core/grpc/ProtoReader.ts +34 -0
- package/core/grpc/ProtoSchema.ts +52 -0
- package/core/grpc/ServerCredentials.ts +30 -0
- package/core/grpc/clientContracts.ts +39 -0
- package/core/grpc/contracts.ts +45 -0
- package/core/grpc/decorators.ts +82 -0
- package/core/grpc/grpcClientProvider.ts +9 -0
- package/core/grpc/index.ts +17 -0
- package/core/grpc/moduleControllers.ts +38 -0
- package/core/grpc/protobuf.ts +80 -0
- package/core/grpc/serviceDefinition.ts +20 -0
- package/core/http/Authorization/Authorize.ts +52 -0
- package/core/http/Authorization/authorizeComposer.ts +31 -0
- package/core/http/Authorization/metadata.ts +158 -0
- package/core/http/Binding/ParameterBinder.ts +109 -0
- package/core/http/Binding/RequestModel.ts +27 -0
- package/core/http/Binding/autoBindings.ts +125 -0
- package/core/http/Binding/bindings.ts +19 -0
- package/core/http/Binding/convert.ts +48 -0
- package/core/http/Binding/generatedSpec.ts +18 -0
- package/core/http/Binding/listModelRegistry.ts +47 -0
- package/core/http/Binding/modelBinder.ts +345 -0
- package/core/http/Binding/modelValidator.ts +30 -0
- package/core/http/Binding/requestModelRegistry.ts +117 -0
- package/core/http/Decorators/attributes.ts +92 -0
- package/core/http/Decorators/controller.ts +24 -0
- package/core/http/Decorators/metadata.ts +107 -0
- package/core/http/Decorators/routes.ts +131 -0
- package/core/http/Errors/HttpError.ts +92 -0
- package/core/http/HttpContext/HttpContext.ts +148 -0
- package/core/http/HttpContext/ResponseBuilder.ts +37 -0
- package/core/http/HttpContext/inspectableRedirects.ts +47 -0
- package/core/http/HttpContext/principal.ts +24 -0
- package/core/http/HttpContext/responseLifetime.ts +45 -0
- package/core/http/HttpServer.ts +627 -0
- package/core/http/Middleware/accessLog.ts +90 -0
- package/core/http/Middleware/cors.ts +160 -0
- package/core/http/Middleware/errorHandler.ts +100 -0
- package/core/http/Middleware/pipeline.ts +21 -0
- package/core/http/Middleware/rateLimit.ts +104 -0
- package/core/http/Middleware/securityHeaders.ts +118 -0
- package/core/http/Middleware/types.ts +19 -0
- package/core/http/OpenApi/generatedOpenApiRegistry.ts +102 -0
- package/core/http/OpenApi/openApiDocs.ts +75 -0
- package/core/http/OpenApi/openApiDocument.ts +356 -0
- package/core/http/README.md +139 -0
- package/core/http/Results/HttpResult.ts +19 -0
- package/core/http/Results/normalize.ts +93 -0
- package/core/http/Results/results.ts +70 -0
- package/core/http/Routing/Router.ts +201 -0
- package/core/http/Routing/RouterBuilder.ts +184 -0
- package/core/http/Routing/template.ts +112 -0
- package/core/http/SPEC.md +981 -0
- package/core/http/Versioning/VersionReader.ts +20 -0
- package/core/http/WebSocketUpgrade.ts +29 -0
- package/core/http/composeRouteMiddlewareComposers.ts +21 -0
- package/core/http/correlation/createCorrelationIdMiddleware.ts +79 -0
- package/core/http/httpModule.ts +48 -0
- package/core/http/index.ts +140 -0
- package/core/http/middlewareTokens.ts +48 -0
- package/core/http/options.ts +134 -0
- package/core/http-client/index.ts +105 -0
- package/core/infra/Infra.ts +158 -0
- package/core/infra/InfraConnector.ts +86 -0
- package/core/infra/InfraLifecycle.ts +86 -0
- package/core/infra/cache/RedisDistributedCacheBackend.ts +88 -0
- package/core/infra/cache/RedisDistributedCacheDriver.ts +186 -0
- package/core/infra/cache/index.ts +7 -0
- package/core/infra/connectorConfig.ts +29 -0
- package/core/infra/connectorIdentity.ts +39 -0
- package/core/infra/connectors/codex/CodexAppServer.ts +146 -0
- package/core/infra/connectors/codex/CodexAppServerClient.ts +258 -0
- package/core/infra/connectors/codex/CodexPolicy.ts +114 -0
- package/core/infra/connectors/codex/CodexTurn.ts +133 -0
- package/core/infra/connectors/codex/contracts.ts +82 -0
- package/core/infra/connectors/codex.ts +26 -0
- package/core/infra/connectors/llm.ts +78 -0
- package/core/infra/connectors/llmRouter.ts +443 -0
- package/core/infra/connectors/openaiCompatible.ts +590 -0
- package/core/infra/connectors/openaiTextStream.ts +134 -0
- package/core/infra/connectors/opensearch.ts +307 -0
- package/core/infra/connectors/postgres.ts +105 -0
- package/core/infra/connectors/redis.ts +132 -0
- package/core/infra/index.ts +58 -0
- package/core/kernel/ApplicationLifetime.ts +91 -0
- package/core/kernel/Bazis.ts +73 -0
- package/core/kernel/Environment.ts +53 -0
- package/core/kernel/Kernel.ts +391 -0
- package/core/kernel/KernelBuilder.ts +172 -0
- package/core/kernel/LifecycleCoordinator.ts +204 -0
- package/core/kernel/README.md +66 -0
- package/core/kernel/SupervisedHostedService.ts +147 -0
- package/core/kernel/config/ConfigRegistry.ts +48 -0
- package/core/kernel/config/Configuration.ts +110 -0
- package/core/kernel/config/README.md +62 -0
- package/core/kernel/config/Secret.ts +29 -0
- package/core/kernel/config/addConfigOptions.ts +63 -0
- package/core/kernel/config/defineConfig.ts +211 -0
- package/core/kernel/config/sources.ts +123 -0
- package/core/kernel/correlation/requestContext.ts +57 -0
- package/core/kernel/errors/ConfigKeyMissingError.ts +7 -0
- package/core/kernel/errors/KernelError.ts +7 -0
- package/core/kernel/errors/ShutdownTimeoutError.ts +7 -0
- package/core/kernel/errors/StartupAbortedError.ts +7 -0
- package/core/kernel/errors/StartupTimeoutError.ts +7 -0
- package/core/kernel/errors/index.ts +5 -0
- package/core/kernel/events/EventBus.ts +140 -0
- package/core/kernel/events/EventToken.ts +17 -0
- package/core/kernel/events/eventSubscribers.ts +126 -0
- package/core/kernel/events/kernelEvents.ts +16 -0
- package/core/kernel/events/onEvent.ts +32 -0
- package/core/kernel/health/HealthCheckContracts.ts +42 -0
- package/core/kernel/health/HealthService.ts +93 -0
- package/core/kernel/index.ts +96 -0
- package/core/kernel/internal/awaitAbortable.ts +18 -0
- package/core/kernel/internal/awaitShutdown.ts +21 -0
- package/core/kernel/internal/reportDiagnosticFailure.ts +8 -0
- package/core/kernel/internal/validateTimeout.ts +8 -0
- package/core/kernel/lifecycleHooks.ts +18 -0
- package/core/kernel/logging/ConsoleLogger.ts +68 -0
- package/core/kernel/logging/Logger.ts +22 -0
- package/core/kernel/types/ConfigSource.ts +9 -0
- package/core/kernel/types/EnvironmentName.ts +1 -0
- package/core/kernel/types/KernelOptions.ts +23 -0
- package/core/kernel/types/LifecycleHook.ts +18 -0
- package/core/kernel/types/index.ts +4 -0
- package/core/orm/DATABASE_PROVIDER.ts +5 -0
- package/core/orm/OrmHostedPlan.validator.ts +55 -0
- package/core/orm/OrmLifecycle.ts +146 -0
- package/core/orm/OrmOwnedStoreLifecycle.ts +96 -0
- package/core/orm/buildOrmProviders.ts +152 -0
- package/core/orm/databaseConnector.ts +108 -0
- package/core/orm/encapsulationHook.ts +19 -0
- package/core/orm/index.ts +95 -0
- package/core/orm/listQuery.ts +198 -0
- package/core/orm/ormModule.ts +173 -0
- package/core/orm/ownedStoreContributions.ts +195 -0
- package/core/orm/registerRepositories.ts +27 -0
- package/core/orm/repository.ts +45 -0
- package/core/orm/strictSchemaHostedIdentity.ts +17 -0
- package/core/scripts/agent-codegen.ts +1166 -0
- package/core/scripts/di-generate-target.ts +90 -0
- package/core/scripts/di-generate.ts +1837 -0
- package/core/scripts/orm-predicate-codegen.ts +33 -0
- package/core/scripts/request-model-codegen.ts +326 -0
- package/core/websocket/DESIGN.md +297 -0
- package/core/websocket/WsRateLimiter.ts +101 -0
- package/core/websocket/adapter/adapter.interface.ts +45 -0
- package/core/websocket/adapter/in-memory.adapter.ts +190 -0
- package/core/websocket/adapter/redis-delivery-scripts.ts +135 -0
- package/core/websocket/adapter/redis-delivery-store.ts +86 -0
- package/core/websocket/adapter/redis-operations.ts +33 -0
- package/core/websocket/adapter/redis.adapter.ts +218 -0
- package/core/websocket/codec/binary.codec.ts +87 -0
- package/core/websocket/codec/json.codec.ts +34 -0
- package/core/websocket/codec/packet-codec.interface.ts +17 -0
- package/core/websocket/decorators.ts +165 -0
- package/core/websocket/explorer.ts +126 -0
- package/core/websocket/index.ts +78 -0
- package/core/websocket/middleware.ts +146 -0
- package/core/websocket/packet-codec.ts +75 -0
- package/core/websocket/reliable-delivery.ts +56 -0
- package/core/websocket/session-creation.ts +16 -0
- package/core/websocket/session-manager.ts +856 -0
- package/core/websocket/socket-wrapper.ts +314 -0
- package/core/websocket/topic-cache.ts +59 -0
- package/core/websocket/types.ts +122 -0
- package/core/websocket/websocketModule.ts +96 -0
- package/core/websocket/ws-dispatch.ts +123 -0
- package/core/websocket/ws-server.ts +1707 -0
- package/index.ts +281 -0
- package/library/boundary/diagnostics-v1.ts +136 -0
- package/library/boundary/index.ts +73 -0
- package/library/boundary/json/decodeBoundedJsonV1.ts +518 -0
- package/library/boundary/json/limits-v1.ts +46 -0
- package/library/boundary/json/normalizeBoundedJsonV1.ts +256 -0
- package/library/boundary/json/types-v1.ts +11 -0
- package/library/boundary/schema/boundarySchemaHashV1.ts +6 -0
- package/library/boundary/schema/collectBoundaryValueDiagnosticsV1.ts +325 -0
- package/library/boundary/schema/decodeBoundarySchemaV1.ts +646 -0
- package/library/boundary/schema/index.ts +8 -0
- package/library/boundary/schema/types-v1.ts +99 -0
- package/library/boundary/schema/validateBoundaryValueV1.ts +58 -0
- package/library/boundary/serialization/canonicalJsonV1.ts +66 -0
- package/library/http-client/HttpClient.ts +969 -0
- package/library/http-client/HttpClientFactory.ts +45 -0
- package/library/http-client/errors.ts +68 -0
- package/library/http-client/index.ts +43 -0
- package/library/http-client/interceptors.ts +40 -0
- package/library/http-client/progress.ts +62 -0
- package/library/http-client/redirectProtocol.ts +6 -0
- package/library/http-client/serialize.ts +133 -0
- package/library/http-client/types.ts +174 -0
- package/library/jsonapi/ListQueryError.ts +25 -0
- package/library/jsonapi/ListRequest.ts +37 -0
- package/library/jsonapi/decorators.ts +161 -0
- package/library/jsonapi/document.ts +124 -0
- package/library/jsonapi/index.ts +40 -0
- package/library/jsonapi/parseListQuery.ts +291 -0
- package/library/jsonapi/types.ts +125 -0
- package/library/jwt/JwtEncoder.ts +40 -0
- package/library/jwt/JwtKeyRing.ts +164 -0
- package/library/jwt/JwtValidator.ts +210 -0
- package/library/jwt/TokenIssuer.ts +149 -0
- package/library/jwt/TokenService.ts +51 -0
- package/library/jwt/base64url.ts +61 -0
- package/library/jwt/claims.ts +36 -0
- package/library/jwt/errors.ts +44 -0
- package/library/jwt/index.ts +59 -0
- package/library/jwt/limits.ts +8 -0
- package/library/jwt/signing/Hs256Algorithm.ts +62 -0
- package/library/jwt/signing/Rs256Algorithm.ts +133 -0
- package/library/jwt/signing/SigningAlgorithm.ts +18 -0
- package/library/jwt/signing/pem.ts +30 -0
- package/library/openapi/codegen.ts +875 -0
- package/library/openapi/document.ts +326 -0
- package/library/openapi/index.ts +13 -0
- package/library/openapi/types.ts +69 -0
- package/library/openapi/ui.ts +182 -0
- package/library/orm/DatabaseFacade.ts +209 -0
- package/library/orm/DbContext.ts +107 -0
- package/library/orm/DbContextFactory.ts +25 -0
- package/library/orm/DbContextOptions.ts +33 -0
- package/library/orm/Metadata/DynamicModelBuilder.ts +497 -0
- package/library/orm/Metadata/KeyTuple.ts +36 -0
- package/library/orm/Metadata/ModelBuilder.ts +299 -0
- package/library/orm/Metadata/OrmModel.ts +80 -0
- package/library/orm/Metadata/ValueConverter.ts +57 -0
- package/library/orm/Metadata/conventions.ts +54 -0
- package/library/orm/Metadata/decorators.ts +396 -0
- package/library/orm/Metadata/types.ts +140 -0
- package/library/orm/Providers/OwnedStoreCatalog.reader.ts +1802 -0
- package/library/orm/Providers/PostgresDialect.ts +234 -0
- package/library/orm/Providers/PostgresProvider.ts +1494 -0
- package/library/orm/Providers/PostgresSchema.decoder.ts +107 -0
- package/library/orm/Providers/limits.ts +29 -0
- package/library/orm/Providers/operationDeadline.ts +43 -0
- package/library/orm/Providers/ormOwnedStoreRuntime.ts +19 -0
- package/library/orm/Providers/ormTransactionRuntime.ts +117 -0
- package/library/orm/Providers/propertyConversion.ts +14 -0
- package/library/orm/Providers/resolvedForeignKey.ts +16 -0
- package/library/orm/Providers/transactionCallbacks.ts +45 -0
- package/library/orm/Providers/transactionOutcome.ts +82 -0
- package/library/orm/Providers/transactionScopes.ts +78 -0
- package/library/orm/Providers/types.ts +207 -0
- package/library/orm/Query/DbSet.ts +78 -0
- package/library/orm/Query/EntityQuery.ts +247 -0
- package/library/orm/Query/ImmediateMutations.ts +226 -0
- package/library/orm/Query/IncludeLoader.ts +200 -0
- package/library/orm/Query/QueryPlan.ts +55 -0
- package/library/orm/Query/SqlTranslator.ts +195 -0
- package/library/orm/Query/conditions.ts +127 -0
- package/library/orm/Query/materialize.ts +39 -0
- package/library/orm/README.md +256 -0
- package/library/orm/Repository/README.md +684 -0
- package/library/orm/Repository/Repository.ts +68 -0
- package/library/orm/Saving/CommandBuilder.ts +139 -0
- package/library/orm/Saving/ExecutionStrategy.ts +128 -0
- package/library/orm/Saving/SaveExecutor.ts +413 -0
- package/library/orm/Saving/applyConventions.ts +64 -0
- package/library/orm/Schema/CheckExpression.ts +327 -0
- package/library/orm/Schema/ExactSchemaVerifier.ts +168 -0
- package/library/orm/Schema/ExpectedSchema.ts +43 -0
- package/library/orm/Schema/MigrationRunner.ts +146 -0
- package/library/orm/Schema/Migrator.ts +73 -0
- package/library/orm/Schema/OrmOwnedStore.ts +123 -0
- package/library/orm/Schema/OwnedStoreAdmission.ts +752 -0
- package/library/orm/Schema/OwnedStoreCanonical.ts +273 -0
- package/library/orm/Schema/OwnedStoreCatalog.ts +1325 -0
- package/library/orm/Schema/SafeAdditiveSchema.ts +100 -0
- package/library/orm/Schema/SchemaAdmission.ts +62 -0
- package/library/orm/Schema/SchemaDiffer.ts +78 -0
- package/library/orm/Schema/formatSchemaDifferences.ts +62 -0
- package/library/orm/Schema/introspection.ts +52 -0
- package/library/orm/Schema/physicalColumnTypes.ts +37 -0
- package/library/orm/Schema/tableKey.ts +26 -0
- package/library/orm/Tracking/ChangeTracker.ts +448 -0
- package/library/orm/Tracking/EntityState.ts +13 -0
- package/library/orm/Transactions/OrmTransaction.ts +30 -0
- package/library/orm/Transactions/TransactionScopeCoordinator.ts +377 -0
- package/library/orm/errors.ts +190 -0
- package/library/orm/index.ts +162 -0
- package/library/orm/runtime.ts +14 -0
- package/library/redaction/index.ts +166 -0
- package/library/ui/UiProfile.ts +77 -0
- package/library/ui/compiled-v1.ts +131 -0
- package/library/ui/compiler/compileUiSurfaceV1.ts +717 -0
- package/library/ui/compiler/contracts-v1.ts +25 -0
- package/library/ui/compiler/index.ts +12 -0
- package/library/ui/compiler/openApiIndex.ts +246 -0
- package/library/ui/defineUiProfile.ts +340 -0
- package/library/ui/diagnostics-v1.ts +33 -0
- package/library/ui/index.ts +129 -0
- package/library/ui/profile-v1.ts +191 -0
- package/library/ui/serialization.ts +130 -0
- package/library/ui/uiProfileAuthoring.ts +289 -0
- package/library/ui/uiProfileAuthoringMetadata.ts +78 -0
- package/library/validation/MessageRegistry.ts +144 -0
- package/library/validation/README.md +62 -0
- package/library/validation/RuleCompiler.ts +183 -0
- package/library/validation/RuleEngine.ts +401 -0
- package/library/validation/SPEC.md +579 -0
- package/library/validation/ValidationError.ts +37 -0
- package/library/validation/ValidationResult.ts +63 -0
- package/library/validation/Validator.ts +101 -0
- package/library/validation/index.ts +16 -0
- package/library/validation/metadata.ts +69 -0
- package/library/validation/modelValidatorAdapter.ts +119 -0
- package/library/validation/types/ValidationCode.ts +69 -0
- package/library/validation/types/ValidatorOptions.ts +153 -0
- package/package.json +80 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { ModuleOwnedProviderConflictError } from "../errors";
|
|
2
|
+
import type { ServiceCollection } from "../ServiceCollection";
|
|
3
|
+
import {
|
|
4
|
+
isClassProvider,
|
|
5
|
+
ProviderDefinition,
|
|
6
|
+
} from "../provider";
|
|
7
|
+
import type { Class, Token } from "../token";
|
|
8
|
+
import type { ServiceKey, ServiceResolver } from "../types";
|
|
9
|
+
import type { BazisModuleMetadata } from "./types";
|
|
10
|
+
|
|
11
|
+
declare const MODULE_OWNED_CHANNEL_PAYLOAD: unique symbol;
|
|
12
|
+
declare const MODULE_OWNED_CHANNEL_SERVICE: unique symbol;
|
|
13
|
+
|
|
14
|
+
interface ModuleOwnedContributionChannelBase<TPayload> {
|
|
15
|
+
/** Diagnostic-only name. Channel lookup uses this object's identity. */
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly [MODULE_OWNED_CHANNEL_PAYLOAD]?: (payload: TPayload) => TPayload;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Opaque per-container channel for owner-bound scoped providers. */
|
|
21
|
+
export interface ModuleOwnedProviderChannel<TPayload, TService>
|
|
22
|
+
extends ModuleOwnedContributionChannelBase<TPayload> {
|
|
23
|
+
readonly kind: "provider";
|
|
24
|
+
readonly [MODULE_OWNED_CHANNEL_SERVICE]?: (service: TService) => TService;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Opaque per-container channel for owner-attributed metadata without a provider. */
|
|
28
|
+
export interface ModuleOwnedMetadataChannel<TPayload>
|
|
29
|
+
extends ModuleOwnedContributionChannelBase<TPayload> {
|
|
30
|
+
readonly kind: "metadata";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type ModuleOwnedContributionChannel<TPayload, TService = never> =
|
|
34
|
+
| ModuleOwnedProviderChannel<TPayload, TService>
|
|
35
|
+
| ModuleOwnedMetadataChannel<TPayload>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Resolves exactly the provider registration created for one contribution.
|
|
39
|
+
* Its private keyed identity is deliberately not exposed.
|
|
40
|
+
*/
|
|
41
|
+
export interface ModuleOwnedProviderActivation<TService> {
|
|
42
|
+
activate(resolver: ServiceResolver): TService;
|
|
43
|
+
activateAsync(resolver: ServiceResolver): Promise<TService>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface ModuleOwnedProviderContribution<TPayload, TService> {
|
|
47
|
+
readonly kind: "provider";
|
|
48
|
+
readonly ownerName: string;
|
|
49
|
+
readonly payload: TPayload;
|
|
50
|
+
readonly activation: ModuleOwnedProviderActivation<TService>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ModuleOwnedMetadataContribution<TPayload> {
|
|
54
|
+
readonly kind: "metadata";
|
|
55
|
+
readonly ownerName: string;
|
|
56
|
+
readonly payload: TPayload;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ModuleOwnedProviderContributionContext {
|
|
60
|
+
/** Creates an ordinary scoped self-class provider when absent, otherwise attaches to its exact owner registration. */
|
|
61
|
+
registerScoped<TPayload, TService>(
|
|
62
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
63
|
+
definition: ProviderDefinition<TService>,
|
|
64
|
+
payload: TPayload,
|
|
65
|
+
): ModuleOwnedProviderActivation<TService>;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Adds an unkeyed scoped class definition under a fresh private key and
|
|
69
|
+
* attributes it to the module currently being loaded.
|
|
70
|
+
*/
|
|
71
|
+
addScoped<TPayload, TService>(
|
|
72
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
73
|
+
definition: ProviderDefinition<TService>,
|
|
74
|
+
payload: TPayload,
|
|
75
|
+
): ModuleOwnedProviderActivation<TService>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Attaches owner-attributed metadata to the exact ordinary scoped class
|
|
79
|
+
* provider which the current module has already registered. Unlike
|
|
80
|
+
* `addScoped`, this never creates a provider, keyed alias, or new lifetime.
|
|
81
|
+
*/
|
|
82
|
+
attachExistingScoped<TPayload, TService>(
|
|
83
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
84
|
+
implementation: Class<TService>,
|
|
85
|
+
payload: TPayload,
|
|
86
|
+
): ModuleOwnedProviderActivation<TService>;
|
|
87
|
+
|
|
88
|
+
/** Adds inert owner-attributed metadata without manufacturing a DI service. */
|
|
89
|
+
addMetadata<TPayload>(channel: ModuleOwnedMetadataChannel<TPayload>, payload: TPayload): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Higher-layer hook. DI invokes it once for every module in the actual root graph. */
|
|
93
|
+
export type ModuleOwnedProviderContributor = (
|
|
94
|
+
metadata: BazisModuleMetadata,
|
|
95
|
+
context: ModuleOwnedProviderContributionContext,
|
|
96
|
+
) => void;
|
|
97
|
+
|
|
98
|
+
const contributors: ModuleOwnedProviderContributor[] = [];
|
|
99
|
+
const validators: ModuleOwnedContributionValidator[] = [];
|
|
100
|
+
|
|
101
|
+
/** Registers a feature-independent owner-window contributor, idempotently by reference. */
|
|
102
|
+
export function registerModuleOwnedProviderContributor(contributor: ModuleOwnedProviderContributor): void {
|
|
103
|
+
if (!contributors.includes(contributor)) {
|
|
104
|
+
contributors.push(contributor);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Read-only, channel-capability-based view over one completed module graph. */
|
|
109
|
+
export interface ModuleOwnedContributionSnapshot {
|
|
110
|
+
getProviderContributions<TPayload, TService>(
|
|
111
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
112
|
+
): readonly ModuleOwnedProviderContribution<TPayload, TService>[];
|
|
113
|
+
getMetadataContributions<TPayload>(
|
|
114
|
+
channel: ModuleOwnedMetadataChannel<TPayload>,
|
|
115
|
+
): readonly ModuleOwnedMetadataContribution<TPayload>[];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Build-time view; the ordinary contribution snapshot remains usable at runtime. */
|
|
119
|
+
export interface ModuleOwnedValidationSnapshot extends ModuleOwnedContributionSnapshot {
|
|
120
|
+
/** Counts final registrations after configure/remove/replace, without creating services. */
|
|
121
|
+
countProviders(token: Token<unknown>, key?: ServiceKey): number;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Higher-layer cross-module validation, run once for every built container. */
|
|
125
|
+
export type ModuleOwnedContributionValidator = (snapshot: ModuleOwnedValidationSnapshot) => void;
|
|
126
|
+
|
|
127
|
+
/** Registers a final contribution validator, idempotently by function reference. */
|
|
128
|
+
export function registerModuleOwnedContributionValidator(validator: ModuleOwnedContributionValidator): void {
|
|
129
|
+
if (!validators.includes(validator)) {
|
|
130
|
+
validators.push(validator);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function createModuleOwnedProviderChannel<TPayload, TService>(
|
|
135
|
+
description: string,
|
|
136
|
+
): ModuleOwnedProviderChannel<TPayload, TService> {
|
|
137
|
+
return Object.freeze({ kind: "provider", description: requireChannelDescription(description) }) as
|
|
138
|
+
ModuleOwnedProviderChannel<TPayload, TService>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function createModuleOwnedMetadataChannel<TPayload>(
|
|
142
|
+
description: string,
|
|
143
|
+
): ModuleOwnedMetadataChannel<TPayload> {
|
|
144
|
+
return Object.freeze({ kind: "metadata", description: requireChannelDescription(description) }) as
|
|
145
|
+
ModuleOwnedMetadataChannel<TPayload>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function requireChannelDescription(description: string): string {
|
|
149
|
+
const normalized = description.trim();
|
|
150
|
+
if (normalized.length === 0) {
|
|
151
|
+
throw new TypeError("Module-owned contribution channel description must not be empty.");
|
|
152
|
+
}
|
|
153
|
+
return normalized;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
type AnyChannel = object;
|
|
157
|
+
type AnyContribution = ModuleOwnedProviderContribution<unknown, unknown> | ModuleOwnedMetadataContribution<unknown>;
|
|
158
|
+
|
|
159
|
+
interface ProviderRegistrationAudit {
|
|
160
|
+
readonly ownerName: string;
|
|
161
|
+
readonly implementation: Class<unknown>;
|
|
162
|
+
readonly token: Class<unknown>;
|
|
163
|
+
readonly definition: ProviderDefinition;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const EMPTY_CONTRIBUTIONS: readonly never[] = Object.freeze([]);
|
|
167
|
+
|
|
168
|
+
/** @internal Mutable only while createContainer builds one module graph. */
|
|
169
|
+
export class ModuleOwnedContributionStore {
|
|
170
|
+
private readonly records = new Map<AnyChannel, AnyContribution[]>();
|
|
171
|
+
private readonly providerAudits: ProviderRegistrationAudit[] = [];
|
|
172
|
+
private sealed = false;
|
|
173
|
+
|
|
174
|
+
public addProvider<TPayload, TService>(
|
|
175
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
176
|
+
ownerName: string,
|
|
177
|
+
payload: TPayload,
|
|
178
|
+
activation: ModuleOwnedProviderActivation<TService>,
|
|
179
|
+
implementation: Class<TService>,
|
|
180
|
+
definition: ProviderDefinition<TService>,
|
|
181
|
+
): void {
|
|
182
|
+
this.assertMutable();
|
|
183
|
+
this.append(channel, Object.freeze({
|
|
184
|
+
kind: "provider",
|
|
185
|
+
ownerName,
|
|
186
|
+
payload,
|
|
187
|
+
activation,
|
|
188
|
+
}));
|
|
189
|
+
this.providerAudits.push({
|
|
190
|
+
ownerName,
|
|
191
|
+
implementation: implementation as Class<unknown>,
|
|
192
|
+
token: implementation as Class<unknown>,
|
|
193
|
+
definition: definition as ProviderDefinition,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public addMetadata<TPayload>(
|
|
198
|
+
channel: ModuleOwnedMetadataChannel<TPayload>,
|
|
199
|
+
ownerName: string,
|
|
200
|
+
payload: TPayload,
|
|
201
|
+
): void {
|
|
202
|
+
this.assertMutable();
|
|
203
|
+
this.append(channel, Object.freeze({ kind: "metadata", ownerName, payload }));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public validateProviderExclusivity(definitions: readonly ProviderDefinition[]): void {
|
|
207
|
+
const issues = new Set<string>();
|
|
208
|
+
const contributedDefinitions = new Set<ProviderDefinition>(
|
|
209
|
+
this.providerAudits.map((audit) => audit.definition),
|
|
210
|
+
);
|
|
211
|
+
for (let auditIndex = 0; auditIndex < this.providerAudits.length; auditIndex += 1) {
|
|
212
|
+
const audit = this.providerAudits[auditIndex] as ProviderRegistrationAudit;
|
|
213
|
+
for (let definitionIndex = 0; definitionIndex < definitions.length; definitionIndex += 1) {
|
|
214
|
+
const definition = definitions[definitionIndex] as ProviderDefinition;
|
|
215
|
+
// Every owner-bound registration has its own private key. Reusing the
|
|
216
|
+
// same class in another owner therefore cannot collide; the higher
|
|
217
|
+
// layer validates semantic identities in its opaque channel. Only an
|
|
218
|
+
// ordinary second DI registration would create another lifetime.
|
|
219
|
+
if (contributedDefinitions.has(definition)) {
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
if (
|
|
223
|
+
definition.provider.provide === audit.token
|
|
224
|
+
|| (isClassProvider(definition.provider) && definition.provider.useClass === audit.implementation)
|
|
225
|
+
) {
|
|
226
|
+
issues.add(
|
|
227
|
+
`Module "${audit.ownerName}": class "${className(audit.implementation)}" is both a module-owned contribution and another DI registration.`,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (issues.size > 0) {
|
|
233
|
+
throw new ModuleOwnedProviderConflictError(Object.freeze([...issues]));
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public seal(): void {
|
|
238
|
+
if (this.sealed) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
for (const records of this.records.values()) {
|
|
242
|
+
Object.freeze(records);
|
|
243
|
+
}
|
|
244
|
+
this.sealed = true;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
public getProvider<TPayload, TService>(
|
|
248
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
249
|
+
): readonly ModuleOwnedProviderContribution<TPayload, TService>[] {
|
|
250
|
+
return (this.records.get(channel) ?? EMPTY_CONTRIBUTIONS) as
|
|
251
|
+
readonly ModuleOwnedProviderContribution<TPayload, TService>[];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
public getMetadata<TPayload>(
|
|
255
|
+
channel: ModuleOwnedMetadataChannel<TPayload>,
|
|
256
|
+
): readonly ModuleOwnedMetadataContribution<TPayload>[] {
|
|
257
|
+
return (this.records.get(channel) ?? EMPTY_CONTRIBUTIONS) as
|
|
258
|
+
readonly ModuleOwnedMetadataContribution<TPayload>[];
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
private append(channel: AnyChannel, contribution: AnyContribution): void {
|
|
262
|
+
const existing = this.records.get(channel);
|
|
263
|
+
if (existing) {
|
|
264
|
+
existing.push(contribution);
|
|
265
|
+
} else {
|
|
266
|
+
this.records.set(channel, [contribution]);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
private assertMutable(): void {
|
|
271
|
+
if (this.sealed) {
|
|
272
|
+
throw new Error("Module-owned contribution store is sealed.");
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
function className(target: Class<unknown>): string {
|
|
278
|
+
return target.name.trim() || "<anonymous>";
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** @internal Invoked only from createContainer while the owner record is open. */
|
|
282
|
+
export function applyModuleOwnedProviderContributors(
|
|
283
|
+
metadata: BazisModuleMetadata,
|
|
284
|
+
ownerName: string,
|
|
285
|
+
collection: ServiceCollection,
|
|
286
|
+
store: ModuleOwnedContributionStore,
|
|
287
|
+
ownerDefinitionsStart: number,
|
|
288
|
+
): void {
|
|
289
|
+
if (contributors.length === 0) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const context: ModuleOwnedProviderContributionContext = {
|
|
294
|
+
registerScoped: <TPayload, TService>(
|
|
295
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
296
|
+
definition: ProviderDefinition<TService>,
|
|
297
|
+
payload: TPayload,
|
|
298
|
+
): ModuleOwnedProviderActivation<TService> => {
|
|
299
|
+
if (channel.kind !== "provider" || definition.lifetime !== "scoped" || definition.key !== undefined
|
|
300
|
+
|| !isClassProvider(definition.provider) || definition.provider.provide !== definition.provider.useClass) {
|
|
301
|
+
throw new TypeError(`Module "${ownerName}": module-owned provider must be an unkeyed scoped self-class definition.`);
|
|
302
|
+
}
|
|
303
|
+
const implementation = definition.provider.useClass;
|
|
304
|
+
const exists = collection.definitionsFrom(ownerDefinitionsStart).some((existing) =>
|
|
305
|
+
existing.provider.provide === implementation
|
|
306
|
+
|| (isClassProvider(existing.provider) && existing.provider.useClass === implementation));
|
|
307
|
+
// An incompatible explicit registration is an error; never silently replace it.
|
|
308
|
+
if (!exists) collection.add(definition);
|
|
309
|
+
return context.attachExistingScoped(channel, implementation, payload);
|
|
310
|
+
},
|
|
311
|
+
addScoped: <TPayload, TService>(
|
|
312
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
313
|
+
definition: ProviderDefinition<TService>,
|
|
314
|
+
payload: TPayload,
|
|
315
|
+
): ModuleOwnedProviderActivation<TService> => {
|
|
316
|
+
if (channel.kind !== "provider") {
|
|
317
|
+
throw new TypeError("addScoped requires a module-owned provider channel.");
|
|
318
|
+
}
|
|
319
|
+
if (
|
|
320
|
+
definition.lifetime !== "scoped"
|
|
321
|
+
|| definition.key !== undefined
|
|
322
|
+
|| !isClassProvider(definition.provider)
|
|
323
|
+
|| definition.provider.provide !== definition.provider.useClass
|
|
324
|
+
) {
|
|
325
|
+
throw new TypeError(
|
|
326
|
+
`Module "${ownerName}": module-owned provider must be an unkeyed scoped self-class definition.`,
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
const implementation = definition.provider.useClass;
|
|
331
|
+
const privateKey = Symbol(`${channel.description}:${ownerName}:${className(implementation)}`);
|
|
332
|
+
const keyedDefinition = new ProviderDefinition(definition.provider, "scoped", privateKey);
|
|
333
|
+
const start = collection.size;
|
|
334
|
+
collection.add(keyedDefinition);
|
|
335
|
+
const storedDefinition = collection.definitionsFrom(start)[0] as ProviderDefinition<TService>;
|
|
336
|
+
const activation: ModuleOwnedProviderActivation<TService> = Object.freeze({
|
|
337
|
+
activate: (resolver: ServiceResolver): TService =>
|
|
338
|
+
resolver.resolveKeyed(storedDefinition.provider.provide, privateKey),
|
|
339
|
+
activateAsync: (resolver: ServiceResolver): Promise<TService> =>
|
|
340
|
+
resolver.resolveKeyedAsync(storedDefinition.provider.provide, privateKey),
|
|
341
|
+
});
|
|
342
|
+
store.addProvider(channel, ownerName, payload, activation, implementation, storedDefinition);
|
|
343
|
+
return activation;
|
|
344
|
+
},
|
|
345
|
+
attachExistingScoped: <TPayload, TService>(
|
|
346
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
347
|
+
implementation: Class<TService>,
|
|
348
|
+
payload: TPayload,
|
|
349
|
+
): ModuleOwnedProviderActivation<TService> => {
|
|
350
|
+
if (channel.kind !== "provider") {
|
|
351
|
+
throw new TypeError("attachExistingScoped requires a module-owned provider channel.");
|
|
352
|
+
}
|
|
353
|
+
const candidates = collection.definitionsFrom(ownerDefinitionsStart).filter((definition) =>
|
|
354
|
+
definition.lifetime === "scoped"
|
|
355
|
+
&& definition.key === undefined
|
|
356
|
+
&& isClassProvider(definition.provider)
|
|
357
|
+
&& definition.provider.provide === implementation
|
|
358
|
+
&& definition.provider.useClass === implementation,
|
|
359
|
+
) as readonly ProviderDefinition<TService>[];
|
|
360
|
+
if (candidates.length !== 1) {
|
|
361
|
+
const qualifier = candidates.length === 0 ? "missing" : "duplicated";
|
|
362
|
+
throw new TypeError(
|
|
363
|
+
`Module "${ownerName}": exact ordinary scoped provider for class "${className(implementation)}" is ${qualifier}.`,
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
const definition = candidates[0] as ProviderDefinition<TService>;
|
|
367
|
+
const activation: ModuleOwnedProviderActivation<TService> = Object.freeze({
|
|
368
|
+
activate: (resolver: ServiceResolver): TService => resolver.resolve(implementation),
|
|
369
|
+
activateAsync: (resolver: ServiceResolver): Promise<TService> => resolver.resolveAsync(implementation),
|
|
370
|
+
});
|
|
371
|
+
store.addProvider(channel, ownerName, payload, activation, implementation, definition);
|
|
372
|
+
return activation;
|
|
373
|
+
},
|
|
374
|
+
addMetadata: <TPayload>(channel: ModuleOwnedMetadataChannel<TPayload>, payload: TPayload): void => {
|
|
375
|
+
if (channel.kind !== "metadata") {
|
|
376
|
+
throw new TypeError("addMetadata requires a module-owned metadata channel.");
|
|
377
|
+
}
|
|
378
|
+
store.addMetadata(channel, ownerName, payload);
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
for (let index = 0; index < contributors.length; index += 1) {
|
|
383
|
+
(contributors[index] as ModuleOwnedProviderContributor)(metadata, context);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** @internal Runs after the complete graph has been collected and frozen. */
|
|
388
|
+
export function validateModuleOwnedContributions(
|
|
389
|
+
store: ModuleOwnedContributionStore,
|
|
390
|
+
definitions: readonly ProviderDefinition[],
|
|
391
|
+
): void {
|
|
392
|
+
store.seal();
|
|
393
|
+
if (validators.length === 0) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const snapshot: ModuleOwnedValidationSnapshot = Object.freeze({
|
|
397
|
+
countProviders: (token: Token<unknown>, key?: ServiceKey): number =>
|
|
398
|
+
definitions.reduce((count, definition) => count + Number(definition.provider.provide === token && definition.key === key), 0),
|
|
399
|
+
getProviderContributions: <TPayload, TService>(
|
|
400
|
+
channel: ModuleOwnedProviderChannel<TPayload, TService>,
|
|
401
|
+
): readonly ModuleOwnedProviderContribution<TPayload, TService>[] => store.getProvider(channel),
|
|
402
|
+
getMetadataContributions: <TPayload>(
|
|
403
|
+
channel: ModuleOwnedMetadataChannel<TPayload>,
|
|
404
|
+
): readonly ModuleOwnedMetadataContribution<TPayload>[] => store.getMetadata(channel),
|
|
405
|
+
});
|
|
406
|
+
for (let index = 0; index < validators.length; index += 1) {
|
|
407
|
+
(validators[index] as ModuleOwnedContributionValidator)(snapshot);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ModuleEncapsulationError } from "../errors";
|
|
2
|
+
import { getProviderDeps } from "../internal/providerDeps";
|
|
3
|
+
import { NamedTokenIndex } from "../internal/NamedTokenIndex";
|
|
4
|
+
import type { OpenGenericRegistration } from "../internal/OpenGenericRegistration";
|
|
5
|
+
import { isKeyedDependency, isLazyDependency, isNamedDependency, type ProviderDefinition } from "../provider";
|
|
6
|
+
import { tokenToDebugName, type Token } from "../token";
|
|
7
|
+
import type { ServiceKey } from "../types";
|
|
8
|
+
import { isFamilyExport, type ModuleGraphRecord } from "./encapsulation";
|
|
9
|
+
|
|
10
|
+
/** Validate the actual last-wins selection, not just visibility of a token.
|
|
11
|
+
* Root resolve/resolveAll retain their global semantics. A consumer may not
|
|
12
|
+
* silently receive a private implementation from an unrelated module.
|
|
13
|
+
*/
|
|
14
|
+
export function createProviderSelectionValidator(
|
|
15
|
+
records: readonly ModuleGraphRecord[],
|
|
16
|
+
definitions: readonly ProviderDefinition[],
|
|
17
|
+
recordOf: ReadonlyMap<ProviderDefinition, ModuleGraphRecord>,
|
|
18
|
+
generics: readonly OpenGenericRegistration[],
|
|
19
|
+
genericRecordOf: ReadonlyMap<OpenGenericRegistration, ModuleGraphRecord>,
|
|
20
|
+
): (definition: ProviderDefinition, record: ModuleGraphRecord) => void {
|
|
21
|
+
if (!records.some((record) => record.exports !== undefined)) return () => {};
|
|
22
|
+
|
|
23
|
+
const selected = new Map<Token<unknown>, Map<ServiceKey | undefined, ModuleGraphRecord>>();
|
|
24
|
+
const selectedFamilies = new Map<symbol, Map<ServiceKey | undefined, ModuleGraphRecord>>();
|
|
25
|
+
for (const definition of definitions) {
|
|
26
|
+
const owner = recordOf.get(definition);
|
|
27
|
+
if (!owner) continue;
|
|
28
|
+
const token = definition.provider.provide;
|
|
29
|
+
const keys = selected.get(token) ?? new Map();
|
|
30
|
+
keys.set(definition.key, owner);
|
|
31
|
+
selected.set(token, keys);
|
|
32
|
+
}
|
|
33
|
+
for (const registration of generics) {
|
|
34
|
+
const owner = genericRecordOf.get(registration);
|
|
35
|
+
if (!owner) continue;
|
|
36
|
+
const keys = selectedFamilies.get(registration.family.id) ?? new Map();
|
|
37
|
+
keys.set(registration.key, owner);
|
|
38
|
+
selectedFamilies.set(registration.family.id, keys);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Some generated names (e.g. a closed generic) have no explicit definition
|
|
42
|
+
// until registry materialization. Use the same token families/arguments;
|
|
43
|
+
// token creation is pure and does not invoke provider factories.
|
|
44
|
+
const names = new NamedTokenIndex(function* () {
|
|
45
|
+
yield* selected.keys();
|
|
46
|
+
const arguments_ = [...selected.keys()];
|
|
47
|
+
const families = new Map(generics.map((registration) => [registration.family.id, registration.family]));
|
|
48
|
+
for (const family of families.values()) {
|
|
49
|
+
for (const argument of arguments_) yield family.of(argument);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// One memo per exact token and selected owner; module graph is already acyclic.
|
|
54
|
+
const exportsMemo = new Map<Token<unknown>, Map<ModuleGraphRecord, Map<ModuleGraphRecord, boolean>>>();
|
|
55
|
+
const exportsOwner = (record: ModuleGraphRecord, owner: ModuleGraphRecord, token: Token<unknown>): boolean => {
|
|
56
|
+
let owners = exportsMemo.get(token);
|
|
57
|
+
if (!owners) exportsMemo.set(token, owners = new Map());
|
|
58
|
+
let memo = owners.get(owner);
|
|
59
|
+
if (!memo) owners.set(owner, memo = new Map());
|
|
60
|
+
const cached = memo.get(record);
|
|
61
|
+
if (cached !== undefined) return cached;
|
|
62
|
+
const publishes = record.exports === undefined || record.exports.some((ref) =>
|
|
63
|
+
ref === token || (isFamilyExport(ref) && typeof token !== "function" && ref.id === token.genericFamilyId),
|
|
64
|
+
);
|
|
65
|
+
const visible = publishes && (record === owner || record.imports.some((imported) => exportsOwner(imported, owner, token)));
|
|
66
|
+
memo.set(record, visible);
|
|
67
|
+
return visible;
|
|
68
|
+
};
|
|
69
|
+
const globals = records.filter((record) => record.global);
|
|
70
|
+
|
|
71
|
+
return (definition, record) => {
|
|
72
|
+
for (const dependency of getProviderDeps(definition.provider)) {
|
|
73
|
+
if (dependency === undefined) continue;
|
|
74
|
+
const dep = isLazyDependency(dependency) ? dependency.inner : dependency;
|
|
75
|
+
const token = isNamedDependency(dep) ? names.lookup(dep.name) : isKeyedDependency(dep) ? dep.token : dep;
|
|
76
|
+
if (!token) continue; // Missing dependencies retain their normal DI error.
|
|
77
|
+
const key = isKeyedDependency(dep) ? dep.key : undefined;
|
|
78
|
+
const owner = selected.get(token)?.get(key)
|
|
79
|
+
?? (typeof token !== "function" && token.genericFamilyId
|
|
80
|
+
? selectedFamilies.get(token.genericFamilyId)?.get(key) : undefined);
|
|
81
|
+
if (!owner || owner === record) continue;
|
|
82
|
+
if (record.imports.some((imported) => exportsOwner(imported, owner, token))
|
|
83
|
+
|| globals.some((global) => exportsOwner(global, owner, token))) continue;
|
|
84
|
+
throw new ModuleEncapsulationError([
|
|
85
|
+
`Module "${record.name}": "${tokenToDebugName(definition.provider.provide)}" selects "${tokenToDebugName(token)}"`
|
|
86
|
+
+ ` from module "${owner.name}", which is not exported to this consumer (key: ${String(key)}).`,
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Class, Token } from "../token";
|
|
2
|
+
import type { ServiceResolver } from "../types";
|
|
3
|
+
import type {
|
|
4
|
+
ProviderDefinition,
|
|
5
|
+
ProviderDependencyList,
|
|
6
|
+
ResolvedDeps,
|
|
7
|
+
} from "../provider";
|
|
8
|
+
import { DI } from "./DI";
|
|
9
|
+
|
|
10
|
+
function registerClassProvider<T, D extends ProviderDependencyList>(
|
|
11
|
+
lifetime: "singleton" | "scoped" | "transient",
|
|
12
|
+
provide: Token<T>,
|
|
13
|
+
useClass: Class<T>,
|
|
14
|
+
deps?: D,
|
|
15
|
+
): ProviderDefinition<T> {
|
|
16
|
+
const factory = lifetime === "singleton" ? DI.singleton : lifetime === "scoped" ? DI.scoped : DI.transient;
|
|
17
|
+
return factory(DI.classProvider(provide, useClass, deps));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function singleton<T>(useClass: Class<T>): ProviderDefinition<T>;
|
|
21
|
+
export function singleton<T, D extends ProviderDependencyList = []>(
|
|
22
|
+
provide: Token<T>,
|
|
23
|
+
useClass: Class<T>,
|
|
24
|
+
deps?: D,
|
|
25
|
+
): ProviderDefinition<T>;
|
|
26
|
+
export function singleton<T, D extends ProviderDependencyList = []>(
|
|
27
|
+
provide: Token<T>,
|
|
28
|
+
useClass?: Class<T>,
|
|
29
|
+
deps?: D,
|
|
30
|
+
): ProviderDefinition<T> {
|
|
31
|
+
if (!useClass) {
|
|
32
|
+
const classOnly = provide as Class<T>;
|
|
33
|
+
return registerClassProvider("singleton", classOnly, classOnly);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return registerClassProvider("singleton", provide, useClass, deps);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function scoped<T>(useClass: Class<T>): ProviderDefinition<T>;
|
|
40
|
+
export function scoped<T, D extends ProviderDependencyList = []>(
|
|
41
|
+
provide: Token<T>,
|
|
42
|
+
useClass: Class<T>,
|
|
43
|
+
deps?: D,
|
|
44
|
+
): ProviderDefinition<T>;
|
|
45
|
+
export function scoped<T, D extends ProviderDependencyList = []>(
|
|
46
|
+
provide: Token<T>,
|
|
47
|
+
useClass?: Class<T>,
|
|
48
|
+
deps?: D,
|
|
49
|
+
): ProviderDefinition<T> {
|
|
50
|
+
if (!useClass) {
|
|
51
|
+
const classOnly = provide as Class<T>;
|
|
52
|
+
return registerClassProvider("scoped", classOnly, classOnly);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return registerClassProvider("scoped", provide, useClass, deps);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function transient<T>(useClass: Class<T>): ProviderDefinition<T>;
|
|
59
|
+
export function transient<T, D extends ProviderDependencyList = []>(
|
|
60
|
+
provide: Token<T>,
|
|
61
|
+
useClass: Class<T>,
|
|
62
|
+
deps?: D,
|
|
63
|
+
): ProviderDefinition<T>;
|
|
64
|
+
export function transient<T, D extends ProviderDependencyList = []>(
|
|
65
|
+
provide: Token<T>,
|
|
66
|
+
useClass?: Class<T>,
|
|
67
|
+
deps?: D,
|
|
68
|
+
): ProviderDefinition<T> {
|
|
69
|
+
if (!useClass) {
|
|
70
|
+
const classOnly = provide as Class<T>;
|
|
71
|
+
return registerClassProvider("transient", classOnly, classOnly);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return registerClassProvider("transient", provide, useClass, deps);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function singletonFactory<T, D extends ProviderDependencyList>(
|
|
78
|
+
provide: Token<T>,
|
|
79
|
+
deps: D,
|
|
80
|
+
useFactory: (...args: ResolvedDeps<D>) => T,
|
|
81
|
+
): ProviderDefinition<T> {
|
|
82
|
+
return DI.singleton(DI.factoryProvider(provide, deps, useFactory));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function singletonFactoryWithResolver<T, D extends ProviderDependencyList>(
|
|
86
|
+
provide: Token<T>,
|
|
87
|
+
deps: D,
|
|
88
|
+
useFactory: (resolver: ServiceResolver, ...args: ResolvedDeps<D>) => T,
|
|
89
|
+
): ProviderDefinition<T> {
|
|
90
|
+
return DI.singleton(DI.factoryProviderWithResolver(provide, deps, useFactory));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function singletonAsyncFactory<T, D extends ProviderDependencyList>(
|
|
94
|
+
provide: Token<T>,
|
|
95
|
+
deps: D,
|
|
96
|
+
useAsyncFactory: (...args: ResolvedDeps<D>) => Promise<T>,
|
|
97
|
+
): ProviderDefinition<T> {
|
|
98
|
+
return DI.singleton(DI.asyncFactoryProvider(provide, deps, useAsyncFactory));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function singletonAsyncFactoryWithResolver<T, D extends ProviderDependencyList>(
|
|
102
|
+
provide: Token<T>,
|
|
103
|
+
deps: D,
|
|
104
|
+
useAsyncFactory: (resolver: ServiceResolver, ...args: ResolvedDeps<D>) => Promise<T>,
|
|
105
|
+
): ProviderDefinition<T> {
|
|
106
|
+
return DI.singleton(DI.asyncFactoryProviderWithResolver(provide, deps, useAsyncFactory));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function singletonValue<T>(provide: Token<T>, useValue: T): ProviderDefinition<T> {
|
|
110
|
+
return DI.singleton(DI.valueProvider(provide, useValue));
|
|
111
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { HostedService } from "../../extensions/hosted-service";
|
|
2
|
+
import type { ProviderDefinition } from "../../provider";
|
|
3
|
+
import type { Class, OpenGenericTokenFamily, Token } from "../../token";
|
|
4
|
+
import type { DiRegistrar } from "./DiRegistrar";
|
|
5
|
+
|
|
6
|
+
/** What a module can expose to its importers: a token, a class-token or an open generic family. */
|
|
7
|
+
export type ModuleExport = Token<unknown> | OpenGenericTokenFamily<unknown, unknown>;
|
|
8
|
+
|
|
9
|
+
/** A config the module brings into the application, to be validated at startup. */
|
|
10
|
+
export interface ModuleConfig {
|
|
11
|
+
ensureValid(environment?: "development" | "test" | "production"): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Module metadata (no name: the name comes from the class through `@Module`). */
|
|
15
|
+
export interface BazisModuleMetadata {
|
|
16
|
+
readonly imports?: readonly BazisModuleRef[];
|
|
17
|
+
/**
|
|
18
|
+
* Declarative configs owned by the module. `runApp` collects them from the
|
|
19
|
+
* module tree and calls `ensureValid()` before the container is built and the
|
|
20
|
+
* servers start. This keeps, for example, `jwtConfig` inside `AuthModule`
|
|
21
|
+
* rather than in `index.ts`.
|
|
22
|
+
*/
|
|
23
|
+
readonly config?: ModuleConfig | readonly ModuleConfig[];
|
|
24
|
+
readonly providers?: readonly ProviderDefinition[];
|
|
25
|
+
/**
|
|
26
|
+
* HTTP controllers of the module (classes with `@Controller`). Registered scoped,
|
|
27
|
+
* one instance per request. `httpModule` collects them from `imports` for
|
|
28
|
+
* routing; an explicit `controllers` in `httpModule({ ... })` remains for
|
|
29
|
+
* backward compatibility.
|
|
30
|
+
*/
|
|
31
|
+
readonly controllers?: readonly Class<object>[];
|
|
32
|
+
/**
|
|
33
|
+
* `@UiProfile()` declarations owned by this module. The DI layer keeps them
|
|
34
|
+
* opaque; `runApp` resolves their controller/request/response references and
|
|
35
|
+
* compiles the profiles per published surface.
|
|
36
|
+
*/
|
|
37
|
+
readonly uiProfiles?: readonly unknown[];
|
|
38
|
+
/**
|
|
39
|
+
* Background / hosted services of the module (subclasses of
|
|
40
|
+
* `BackgroundService` / `PeriodicBackgroundService`, or any `HostedService`).
|
|
41
|
+
* Each is registered as a singleton (with auto-resolved constructor
|
|
42
|
+
* dependencies) and exposed as a `HOSTED_SERVICE`, so the kernel starts it on
|
|
43
|
+
* boot and gracefully stops it on shutdown — no manual `HOSTED_SERVICE`
|
|
44
|
+
* factory wiring needed.
|
|
45
|
+
*/
|
|
46
|
+
readonly background?: readonly Class<HostedService>[];
|
|
47
|
+
/**
|
|
48
|
+
* Encapsulation contract:
|
|
49
|
+
* - omitted — the module is fully open (all providers visible to importers);
|
|
50
|
+
* - present — only the listed tokens/families are visible to importers,
|
|
51
|
+
* everything else is private. `exports: []` makes the module fully private.
|
|
52
|
+
*
|
|
53
|
+
* Visibility is validated at `createContainer` time (build-time, zero
|
|
54
|
+
* runtime cost). The root container itself is a composition root and can
|
|
55
|
+
* resolve anything.
|
|
56
|
+
*/
|
|
57
|
+
readonly exports?: readonly ModuleExport[];
|
|
58
|
+
/**
|
|
59
|
+
* Global module (like NestJS `@Global()`): its exported tokens are visible
|
|
60
|
+
* to every module in the graph without an explicit import. Reserved for
|
|
61
|
+
* infrastructure (kernel environment, configuration, lifetime).
|
|
62
|
+
*/
|
|
63
|
+
readonly global?: boolean;
|
|
64
|
+
configure?(di: DiRegistrar): void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Module class with metadata on its constructor (`@Module`). */
|
|
68
|
+
export type BazisModule = BazisModuleMetadata & (abstract new (...args: never) => unknown);
|
|
69
|
+
|
|
70
|
+
/** A module class (`@Module`) or plain metadata returned by module factories (`ormModule`, `memory()`, `infraModule`). */
|
|
71
|
+
export type BazisModuleRef = BazisModule | BazisModuleMetadata;
|