@velajs/vela 1.19.0 → 1.19.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/CHANGELOG.md +22 -14
- package/dist/configurable-module.builder-5FGMaXG6.js +91 -0
- package/dist/configurable-module.builder-5FGMaXG6.js.map +1 -0
- package/dist/container-BqUHID4l.js +645 -0
- package/dist/container-BqUHID4l.js.map +1 -0
- package/dist/cron-matcher-C9qv5OUA.js +113 -0
- package/dist/cron-matcher-C9qv5OUA.js.map +1 -0
- package/dist/decorate-GcSMAbKn.js +528 -0
- package/dist/decorate-GcSMAbKn.js.map +1 -0
- package/dist/decorators-C8YBFCIk.js +53 -0
- package/dist/decorators-C8YBFCIk.js.map +1 -0
- package/dist/define-module-NOyOZNXD.js +235 -0
- package/dist/define-module-NOyOZNXD.js.map +1 -0
- package/dist/discovery.service-BYm95SSD.js +368 -0
- package/dist/discovery.service-BYm95SSD.js.map +1 -0
- package/dist/discovery.service-Cpf1QcZ5.d.ts +648 -0
- package/dist/i18n/index.d.ts +138 -10
- package/dist/i18n/index.js +270 -8
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-D72EQfcC.d.ts +430 -0
- package/dist/index-DhShDLCM.d.ts +2310 -0
- package/dist/index.d.ts +6 -70
- package/dist/index.js +14 -76
- package/dist/internal.d.ts +13 -17
- package/dist/internal.js +6 -19
- package/dist/live/index.d.ts +2 -12
- package/dist/live/index.js +826 -16
- package/dist/live/index.js.map +1 -0
- package/dist/metadata.registry-D1od8ZBt.d.ts +842 -0
- package/dist/plugin-ByBlVOve.js +1387 -0
- package/dist/plugin-ByBlVOve.js.map +1 -0
- package/dist/queue/index.d.ts +247 -10
- package/dist/queue/index.js +384 -12
- package/dist/queue/index.js.map +1 -0
- package/dist/request-context-C3nCGJNd.js +26 -0
- package/dist/request-context-C3nCGJNd.js.map +1 -0
- package/dist/route.manager-DRAZ5X04.js +991 -0
- package/dist/route.manager-DRAZ5X04.js.map +1 -0
- package/dist/schedule-node/index.d.ts +32 -3
- package/dist/schedule-node/index.js +97 -3
- package/dist/schedule-node/index.js.map +1 -0
- package/dist/schedule.registry-DVm7Jp5w.d.ts +55 -0
- package/dist/seeder/index.d.ts +75 -5
- package/dist/seeder/index.js +105 -4
- package/dist/seeder/index.js.map +1 -0
- package/dist/signed-url-CMmi0SIb.js +56 -0
- package/dist/signed-url-CMmi0SIb.js.map +1 -0
- package/dist/signed-url-DKhgja4U.d.ts +16 -0
- package/dist/src-eb5CI6Xn.js +2151 -0
- package/dist/src-eb5CI6Xn.js.map +1 -0
- package/dist/storage/index.d.ts +57 -4
- package/dist/storage/index.js +22 -5
- package/dist/storage/index.js.map +1 -0
- package/dist/streaming/index.d.ts +2 -2
- package/dist/streaming/index.js +2 -1
- package/dist/websocket/index.d.ts +3 -12
- package/dist/websocket/index.js +2 -16
- package/dist/websocket-DXmB-MWJ.js +697 -0
- package/dist/websocket-DXmB-MWJ.js.map +1 -0
- package/dist/websocket-node/index.d.ts +108 -6
- package/dist/websocket-node/index.js +228 -6
- package/dist/websocket-node/index.js.map +1 -0
- package/package.json +66 -53
- package/dist/__tests__/workers/entry.d.ts +0 -9
- package/dist/__tests__/workers-als/entry-als.d.ts +0 -9
- package/dist/application.d.ts +0 -104
- package/dist/application.js +0 -364
- package/dist/cache/cache.decorators.d.ts +0 -2
- package/dist/cache/cache.decorators.js +0 -4
- package/dist/cache/cache.interceptor.d.ts +0 -9
- package/dist/cache/cache.interceptor.js +0 -60
- package/dist/cache/cache.module.d.ts +0 -7
- package/dist/cache/cache.module.js +0 -58
- package/dist/cache/cache.service.d.ts +0 -9
- package/dist/cache/cache.service.js +0 -42
- package/dist/cache/cache.store.d.ts +0 -12
- package/dist/cache/cache.store.js +0 -51
- package/dist/cache/cache.tokens.d.ts +0 -6
- package/dist/cache/cache.tokens.js +0 -5
- package/dist/cache/cache.types.d.ts +0 -41
- package/dist/cache/cache.types.js +0 -1
- package/dist/cache/index.d.ts +0 -8
- package/dist/cache/index.js +0 -7
- package/dist/cache/tiered-cache.store.d.ts +0 -19
- package/dist/cache/tiered-cache.store.js +0 -40
- package/dist/config/config.module.d.ts +0 -19
- package/dist/config/config.module.js +0 -98
- package/dist/config/config.service.d.ts +0 -20
- package/dist/config/config.service.js +0 -43
- package/dist/config/config.store.d.ts +0 -46
- package/dist/config/config.store.js +0 -119
- package/dist/config/config.tokens.d.ts +0 -13
- package/dist/config/config.tokens.js +0 -14
- package/dist/config/config.types.d.ts +0 -41
- package/dist/config/config.types.js +0 -4
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -5
- package/dist/config/register-as.d.ts +0 -52
- package/dist/config/register-as.js +0 -39
- package/dist/constants.d.ts +0 -44
- package/dist/constants.js +0 -46
- package/dist/container/container.d.ts +0 -154
- package/dist/container/container.js +0 -849
- package/dist/container/decorators.d.ts +0 -17
- package/dist/container/decorators.js +0 -57
- package/dist/container/disposable.d.ts +0 -5
- package/dist/container/disposable.js +0 -33
- package/dist/container/index.d.ts +0 -6
- package/dist/container/index.js +0 -5
- package/dist/container/mixin.d.ts +0 -24
- package/dist/container/mixin.js +0 -26
- package/dist/container/module-ref.d.ts +0 -21
- package/dist/container/module-ref.js +0 -48
- package/dist/container/types.d.ts +0 -154
- package/dist/container/types.js +0 -49
- package/dist/cors/cors.module.d.ts +0 -7
- package/dist/cors/cors.module.js +0 -37
- package/dist/cors/cors.tokens.d.ts +0 -3
- package/dist/cors/cors.tokens.js +0 -2
- package/dist/cors/cors.types.d.ts +0 -8
- package/dist/cors/cors.types.js +0 -1
- package/dist/cors/index.d.ts +0 -3
- package/dist/cors/index.js +0 -2
- package/dist/crypto/signed-url.d.ts +0 -12
- package/dist/crypto/signed-url.js +0 -60
- package/dist/discovery/discoverable.decorator.d.ts +0 -38
- package/dist/discovery/discoverable.decorator.js +0 -42
- package/dist/discovery/discovery.service.d.ts +0 -102
- package/dist/discovery/discovery.service.js +0 -177
- package/dist/discovery/index.d.ts +0 -2
- package/dist/discovery/index.js +0 -2
- package/dist/entrypoint/entrypoint.registry.d.ts +0 -42
- package/dist/entrypoint/entrypoint.registry.js +0 -112
- package/dist/entrypoint/entrypoint.types.d.ts +0 -41
- package/dist/entrypoint/entrypoint.types.js +0 -3
- package/dist/entrypoint/execution-context.d.ts +0 -15
- package/dist/entrypoint/execution-context.js +0 -21
- package/dist/entrypoint/execution-scope.d.ts +0 -21
- package/dist/entrypoint/execution-scope.js +0 -28
- package/dist/entrypoint/index.d.ts +0 -4
- package/dist/entrypoint/index.js +0 -4
- package/dist/errors/http-exception.d.ts +0 -63
- package/dist/errors/http-exception.js +0 -142
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/event-emitter/event-emitter.decorators.d.ts +0 -1
- package/dist/event-emitter/event-emitter.decorators.js +0 -10
- package/dist/event-emitter/event-emitter.module.d.ts +0 -2
- package/dist/event-emitter/event-emitter.module.js +0 -23
- package/dist/event-emitter/event-emitter.service.d.ts +0 -13
- package/dist/event-emitter/event-emitter.service.js +0 -127
- package/dist/event-emitter/event-emitter.subscriber.d.ts +0 -9
- package/dist/event-emitter/event-emitter.subscriber.js +0 -45
- package/dist/event-emitter/event-emitter.tokens.d.ts +0 -1
- package/dist/event-emitter/event-emitter.tokens.js +0 -1
- package/dist/event-emitter/event-emitter.types.d.ts +0 -5
- package/dist/event-emitter/event-emitter.types.js +0 -1
- package/dist/event-emitter/index.d.ts +0 -6
- package/dist/event-emitter/index.js +0 -5
- package/dist/exceptions/errors.module.d.ts +0 -40
- package/dist/exceptions/errors.module.js +0 -46
- package/dist/exceptions/exception-handler.d.ts +0 -56
- package/dist/exceptions/exception-handler.js +0 -17
- package/dist/exceptions/index.d.ts +0 -6
- package/dist/exceptions/index.js +0 -3
- package/dist/exceptions/reporter.d.ts +0 -21
- package/dist/exceptions/reporter.js +0 -70
- package/dist/factory/adapter.d.ts +0 -36
- package/dist/factory/adapter.js +0 -18
- package/dist/factory/bootstrap.d.ts +0 -23
- package/dist/factory/bootstrap.js +0 -110
- package/dist/factory.d.ts +0 -16
- package/dist/factory.js +0 -36
- package/dist/fetch/fetch.module.d.ts +0 -7
- package/dist/fetch/fetch.module.js +0 -31
- package/dist/fetch/fetch.service.d.ts +0 -24
- package/dist/fetch/fetch.service.js +0 -145
- package/dist/fetch/fetch.types.d.ts +0 -24
- package/dist/fetch/fetch.types.js +0 -1
- package/dist/fetch/index.d.ts +0 -3
- package/dist/fetch/index.js +0 -2
- package/dist/health/health.http.d.ts +0 -14
- package/dist/health/health.http.js +0 -75
- package/dist/health/health.indicator.d.ts +0 -9
- package/dist/health/health.indicator.js +0 -32
- package/dist/health/health.module.d.ts +0 -2
- package/dist/health/health.module.js +0 -26
- package/dist/health/health.service.d.ts +0 -7
- package/dist/health/health.service.js +0 -69
- package/dist/health/health.types.d.ts +0 -15
- package/dist/health/health.types.js +0 -1
- package/dist/health/index.d.ts +0 -6
- package/dist/health/index.js +0 -4
- package/dist/http/ambient.d.ts +0 -17
- package/dist/http/ambient.js +0 -44
- package/dist/http/argument-resolver.d.ts +0 -10
- package/dist/http/argument-resolver.js +0 -89
- package/dist/http/decorators.d.ts +0 -198
- package/dist/http/decorators.js +0 -321
- package/dist/http/execution-context.d.ts +0 -8
- package/dist/http/execution-context.js +0 -35
- package/dist/http/handler-executor.d.ts +0 -20
- package/dist/http/handler-executor.js +0 -133
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.js +0 -7
- package/dist/http/instantiate.d.ts +0 -4
- package/dist/http/instantiate.js +0 -45
- package/dist/http/lazy-param.decorator.d.ts +0 -37
- package/dist/http/lazy-param.decorator.js +0 -117
- package/dist/http/request-container.d.ts +0 -16
- package/dist/http/request-container.js +0 -19
- package/dist/http/request-context.d.ts +0 -13
- package/dist/http/request-context.js +0 -22
- package/dist/http/response-mapper.d.ts +0 -8
- package/dist/http/response-mapper.js +0 -42
- package/dist/http/route-contributor.d.ts +0 -68
- package/dist/http/route-contributor.js +0 -22
- package/dist/http/route-map.d.ts +0 -30
- package/dist/http/route-map.js +0 -27
- package/dist/http/route.manager.d.ts +0 -92
- package/dist/http/route.manager.js +0 -481
- package/dist/http/types.d.ts +0 -37
- package/dist/http/types.js +0 -1
- package/dist/http/url/index.d.ts +0 -4
- package/dist/http/url/index.js +0 -3
- package/dist/http/url/signed-url.guard.d.ts +0 -27
- package/dist/http/url/signed-url.guard.js +0 -62
- package/dist/http/url/signing-secret.d.ts +0 -20
- package/dist/http/url/signing-secret.js +0 -24
- package/dist/http/url/url-generator.service.d.ts +0 -52
- package/dist/http/url/url-generator.service.js +0 -104
- package/dist/i18n/deep-merge.d.ts +0 -2
- package/dist/i18n/deep-merge.js +0 -15
- package/dist/i18n/i18n.middleware.d.ts +0 -15
- package/dist/i18n/i18n.middleware.js +0 -94
- package/dist/i18n/i18n.module.d.ts +0 -13
- package/dist/i18n/i18n.module.js +0 -69
- package/dist/i18n/i18n.options.d.ts +0 -30
- package/dist/i18n/i18n.options.js +0 -16
- package/dist/i18n/i18n.service.d.ts +0 -20
- package/dist/i18n/i18n.service.js +0 -49
- package/dist/i18n/i18n.tokens.d.ts +0 -6
- package/dist/i18n/i18n.tokens.js +0 -3
- package/dist/i18n/i18n.types.d.ts +0 -6
- package/dist/i18n/i18n.types.js +0 -1
- package/dist/i18n/message-loader.service.d.ts +0 -21
- package/dist/i18n/message-loader.service.js +0 -90
- package/dist/i18n/message-registry.d.ts +0 -16
- package/dist/i18n/message-registry.js +0 -49
- package/dist/lifecycle/index.d.ts +0 -20
- package/dist/lifecycle/index.js +0 -15
- package/dist/live/live.cursor.d.ts +0 -22
- package/dist/live/live.cursor.js +0 -56
- package/dist/live/live.decorators.d.ts +0 -32
- package/dist/live/live.decorators.js +0 -46
- package/dist/live/live.delta.d.ts +0 -15
- package/dist/live/live.delta.js +0 -51
- package/dist/live/live.engine.d.ts +0 -88
- package/dist/live/live.engine.js +0 -471
- package/dist/live/live.invalidation.d.ts +0 -45
- package/dist/live/live.invalidation.js +0 -99
- package/dist/live/live.module.d.ts +0 -28
- package/dist/live/live.module.js +0 -87
- package/dist/live/live.tokens.d.ts +0 -9
- package/dist/live/live.tokens.js +0 -8
- package/dist/live/live.types.d.ts +0 -138
- package/dist/live/live.types.js +0 -1
- package/dist/live/presence.d.ts +0 -44
- package/dist/live/presence.js +0 -130
- package/dist/metadata.d.ts +0 -10
- package/dist/metadata.js +0 -20
- package/dist/module/configurable-module.builder.d.ts +0 -56
- package/dist/module/configurable-module.builder.js +0 -84
- package/dist/module/configurable-module.types.d.ts +0 -93
- package/dist/module/configurable-module.types.js +0 -5
- package/dist/module/decorators.d.ts +0 -10
- package/dist/module/decorators.js +0 -47
- package/dist/module/define-module.d.ts +0 -112
- package/dist/module/define-module.js +0 -232
- package/dist/module/graph.d.ts +0 -10
- package/dist/module/graph.js +0 -35
- package/dist/module/index.d.ts +0 -10
- package/dist/module/index.js +0 -7
- package/dist/module/lazy-modules.d.ts +0 -82
- package/dist/module/lazy-modules.js +0 -231
- package/dist/module/lazy-provider.d.ts +0 -65
- package/dist/module/lazy-provider.js +0 -111
- package/dist/module/middleware.d.ts +0 -30
- package/dist/module/middleware.js +0 -67
- package/dist/module/module-loader.d.ts +0 -58
- package/dist/module/module-loader.js +0 -484
- package/dist/module/stable-hash.d.ts +0 -15
- package/dist/module/stable-hash.js +0 -52
- package/dist/module/types.d.ts +0 -1
- package/dist/module/types.js +0 -1
- package/dist/openapi/decorators.d.ts +0 -34
- package/dist/openapi/decorators.js +0 -66
- package/dist/openapi/document.d.ts +0 -3
- package/dist/openapi/document.js +0 -316
- package/dist/openapi/index.d.ts +0 -7
- package/dist/openapi/index.js +0 -6
- package/dist/openapi/redoc-ui.d.ts +0 -1
- package/dist/openapi/redoc-ui.js +0 -19
- package/dist/openapi/scalar-ui.d.ts +0 -1
- package/dist/openapi/scalar-ui.js +0 -19
- package/dist/openapi/swagger-ui.d.ts +0 -1
- package/dist/openapi/swagger-ui.js +0 -23
- package/dist/openapi/types.d.ts +0 -182
- package/dist/openapi/types.js +0 -4
- package/dist/openapi/zod-to-json-schema.d.ts +0 -4
- package/dist/openapi/zod-to-json-schema.js +0 -57
- package/dist/pipeline/app-providers.d.ts +0 -10
- package/dist/pipeline/app-providers.js +0 -43
- package/dist/pipeline/component.manager.d.ts +0 -25
- package/dist/pipeline/component.manager.js +0 -66
- package/dist/pipeline/decorators.d.ts +0 -10
- package/dist/pipeline/decorators.js +0 -42
- package/dist/pipeline/index.d.ts +0 -12
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/pipeline-runner.d.ts +0 -31
- package/dist/pipeline/pipeline-runner.js +0 -40
- package/dist/pipeline/pipes.d.ts +0 -48
- package/dist/pipeline/pipes.js +0 -104
- package/dist/pipeline/reflector.d.ts +0 -86
- package/dist/pipeline/reflector.js +0 -121
- package/dist/pipeline/scoped-components.d.ts +0 -26
- package/dist/pipeline/scoped-components.js +0 -27
- package/dist/pipeline/tokens.d.ts +0 -57
- package/dist/pipeline/tokens.js +0 -47
- package/dist/pipeline/types.d.ts +0 -64
- package/dist/pipeline/types.js +0 -1
- package/dist/plugin/plugin.d.ts +0 -31
- package/dist/plugin/plugin.js +0 -111
- package/dist/queue/inline.driver.d.ts +0 -30
- package/dist/queue/inline.driver.js +0 -58
- package/dist/queue/queue.binding.d.ts +0 -23
- package/dist/queue/queue.binding.js +0 -60
- package/dist/queue/queue.client.d.ts +0 -20
- package/dist/queue/queue.client.js +0 -33
- package/dist/queue/queue.decorators.d.ts +0 -23
- package/dist/queue/queue.decorators.js +0 -46
- package/dist/queue/queue.dispatch.d.ts +0 -36
- package/dist/queue/queue.dispatch.js +0 -109
- package/dist/queue/queue.module.d.ts +0 -32
- package/dist/queue/queue.module.js +0 -80
- package/dist/queue/queue.tokens.d.ts +0 -21
- package/dist/queue/queue.tokens.js +0 -34
- package/dist/queue/queue.types.d.ts +0 -61
- package/dist/queue/queue.types.js +0 -4
- package/dist/registry/index.d.ts +0 -2
- package/dist/registry/index.js +0 -1
- package/dist/registry/metadata.registry.d.ts +0 -73
- package/dist/registry/metadata.registry.js +0 -357
- package/dist/registry/paths.d.ts +0 -3
- package/dist/registry/paths.js +0 -15
- package/dist/registry/types.d.ts +0 -116
- package/dist/registry/types.js +0 -1
- package/dist/registry/util.d.ts +0 -3
- package/dist/registry/util.js +0 -8
- package/dist/schedule/cron-matcher.d.ts +0 -2
- package/dist/schedule/cron-matcher.js +0 -62
- package/dist/schedule/index.d.ts +0 -8
- package/dist/schedule/index.js +0 -5
- package/dist/schedule/schedule.decorators.d.ts +0 -2
- package/dist/schedule/schedule.decorators.js +0 -18
- package/dist/schedule/schedule.module.d.ts +0 -9
- package/dist/schedule/schedule.module.js +0 -28
- package/dist/schedule/schedule.registry.d.ts +0 -23
- package/dist/schedule/schedule.registry.js +0 -63
- package/dist/schedule/schedule.tokens.d.ts +0 -2
- package/dist/schedule/schedule.tokens.js +0 -2
- package/dist/schedule/schedule.types.d.ts +0 -8
- package/dist/schedule/schedule.types.js +0 -1
- package/dist/schedule-node/schedule-node.module.d.ts +0 -9
- package/dist/schedule-node/schedule-node.module.js +0 -28
- package/dist/schedule-node/schedule.executor.d.ts +0 -19
- package/dist/schedule-node/schedule.executor.js +0 -112
- package/dist/seeder/seeder.decorator.d.ts +0 -7
- package/dist/seeder/seeder.decorator.js +0 -15
- package/dist/seeder/seeder.module.d.ts +0 -16
- package/dist/seeder/seeder.module.js +0 -44
- package/dist/seeder/seeder.registry.d.ts +0 -23
- package/dist/seeder/seeder.registry.js +0 -83
- package/dist/seeder/seeder.tokens.d.ts +0 -2
- package/dist/seeder/seeder.tokens.js +0 -1
- package/dist/seeder/seeder.types.d.ts +0 -20
- package/dist/seeder/seeder.types.js +0 -1
- package/dist/serialization/index.d.ts +0 -2
- package/dist/serialization/index.js +0 -2
- package/dist/serialization/serialize.decorator.d.ts +0 -6
- package/dist/serialization/serialize.decorator.js +0 -7
- package/dist/serialization/serializer.interceptor.d.ts +0 -4
- package/dist/serialization/serializer.interceptor.js +0 -16
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -1
- package/dist/services/logger.d.ts +0 -59
- package/dist/services/logger.js +0 -159
- package/dist/storage/path-template.d.ts +0 -9
- package/dist/storage/path-template.js +0 -20
- package/dist/storage/storage.types.d.ts +0 -41
- package/dist/storage/storage.types.js +0 -5
- package/dist/throttler/index.d.ts +0 -6
- package/dist/throttler/index.js +0 -5
- package/dist/throttler/throttler.decorators.d.ts +0 -3
- package/dist/throttler/throttler.decorators.js +0 -4
- package/dist/throttler/throttler.guard.d.ts +0 -9
- package/dist/throttler/throttler.guard.js +0 -72
- package/dist/throttler/throttler.module.d.ts +0 -7
- package/dist/throttler/throttler.module.js +0 -41
- package/dist/throttler/throttler.storage.d.ts +0 -10
- package/dist/throttler/throttler.storage.js +0 -44
- package/dist/throttler/throttler.tokens.d.ts +0 -6
- package/dist/throttler/throttler.tokens.js +0 -5
- package/dist/throttler/throttler.types.d.ts +0 -25
- package/dist/throttler/throttler.types.js +0 -1
- package/dist/validation/create-zod-dto.d.ts +0 -13
- package/dist/validation/create-zod-dto.js +0 -18
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -2
- package/dist/validation/validation.pipe.d.ts +0 -4
- package/dist/validation/validation.pipe.js +0 -19
- package/dist/websocket/websocket.decorators.d.ts +0 -47
- package/dist/websocket/websocket.decorators.js +0 -80
- package/dist/websocket/websocket.module.d.ts +0 -35
- package/dist/websocket/websocket.module.js +0 -63
- package/dist/websocket/websocket.tokens.d.ts +0 -30
- package/dist/websocket/websocket.tokens.js +0 -27
- package/dist/websocket/websocket.types.d.ts +0 -102
- package/dist/websocket/websocket.types.js +0 -4
- package/dist/websocket/ws-argument-resolver.d.ts +0 -13
- package/dist/websocket/ws-argument-resolver.js +0 -40
- package/dist/websocket/ws-dispatcher.d.ts +0 -54
- package/dist/websocket/ws-dispatcher.js +0 -343
- package/dist/websocket/ws-exception.d.ts +0 -25
- package/dist/websocket/ws-exception.js +0 -42
- package/dist/websocket/ws-execution-context.d.ts +0 -9
- package/dist/websocket/ws-execution-context.js +0 -24
- package/dist/websocket/ws-server.d.ts +0 -31
- package/dist/websocket/ws-server.js +0 -74
- package/dist/websocket/ws-sync.d.ts +0 -47
- package/dist/websocket/ws-sync.js +0 -74
- package/dist/websocket-node/node-ws-client.d.ts +0 -24
- package/dist/websocket-node/node-ws-client.js +0 -49
- package/dist/websocket-node/redis-live.d.ts +0 -24
- package/dist/websocket-node/redis-live.js +0 -57
- package/dist/websocket-node/redis-sync.d.ts +0 -33
- package/dist/websocket-node/redis-sync.js +0 -56
- package/dist/websocket-node/register-gateways.d.ts +0 -20
- package/dist/websocket-node/register-gateways.js +0 -61
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import type { InferTokens, InjectionToken, Token, Type } from '../container/types';
|
|
2
|
-
import type { DynamicModule, ModuleImport } from '../registry/types';
|
|
3
|
-
/**
|
|
4
|
-
* Arbitrary extra keys a module accepts alongside its options bag (e.g.
|
|
5
|
-
* `isGlobal`). Kept separate from the options type so the extras-transform can
|
|
6
|
-
* reshape the generated {@link DynamicModule} without polluting `Opts`.
|
|
7
|
-
*/
|
|
8
|
-
export type ConfigurableModuleExtras = Record<string, unknown>;
|
|
9
|
-
/**
|
|
10
|
-
* Reshape the generated definition based on the resolved extras. Runs after the
|
|
11
|
-
* options provider + `key` are computed; the return value is the final
|
|
12
|
-
* `DynamicModule`. Mirrors NestJS's `extras` transform.
|
|
13
|
-
*/
|
|
14
|
-
export type ConfigurableModuleExtrasTransform<E extends ConfigurableModuleExtras> = (definition: DynamicModule, extras: E) => DynamicModule;
|
|
15
|
-
/**
|
|
16
|
-
* The contract a `useClass`/`useExisting` async-options factory must satisfy:
|
|
17
|
-
* a single method (default name `create`) returning the module options.
|
|
18
|
-
*/
|
|
19
|
-
export type ConfigurableModuleOptionsFactory<Opts, MethodName extends string> = {
|
|
20
|
-
[K in MethodName]: () => Opts | Promise<Opts>;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Async configuration accepted by the generated `<method>Async` static.
|
|
24
|
-
*
|
|
25
|
-
* Superset of `AsyncModuleOptions` (`registry/types.ts`): adds NestJS's
|
|
26
|
-
* `useClass`/`useExisting` while preserving the headline `const Inject` tuple
|
|
27
|
-
* inference for `useFactory` params (no `as const` needed at the call site).
|
|
28
|
-
*/
|
|
29
|
-
export interface ConfigurableModuleAsyncOptions<Opts, MethodName extends string = 'create', Inject extends readonly Token<unknown>[] = readonly Token<unknown>[]> {
|
|
30
|
-
imports?: ModuleImport[];
|
|
31
|
-
inject?: Inject;
|
|
32
|
-
useFactory?: (...args: InferTokens<Inject>) => Opts | Promise<Opts>;
|
|
33
|
-
useClass?: Type<ConfigurableModuleOptionsFactory<Opts, MethodName>>;
|
|
34
|
-
useExisting?: Token<ConfigurableModuleOptionsFactory<Opts, MethodName>>;
|
|
35
|
-
/** Explicit instance discriminator (see {@link DynamicModule.key}). */
|
|
36
|
-
key?: string;
|
|
37
|
-
}
|
|
38
|
-
export interface ConfigurableModuleBuilderOptions {
|
|
39
|
-
/** Names the generated base class + the auto-minted options token, and feeds diagnostics. */
|
|
40
|
-
moduleName?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Reuse an existing options token instead of minting one. **Critical for
|
|
43
|
-
* migrations** so the module's public token keeps its identity.
|
|
44
|
-
*/
|
|
45
|
-
optionsInjectionToken?: InjectionToken<unknown>;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* The generated base class type, carrying dynamically-named `<method>` and
|
|
49
|
-
* `<method>Async` statics. A module does `class Foo extends ConfigurableModuleClass {}`
|
|
50
|
-
* and gets `Foo.forRoot(...)` / `Foo.forRootAsync(...)` for free.
|
|
51
|
-
*/
|
|
52
|
-
export type ConfigurableModuleClassType<Opts, MethodKey extends string, FactoryMethodKey extends string, Extras extends ConfigurableModuleExtras> = (new () => object) & Record<MethodKey, (options: Opts & Partial<Extras> & {
|
|
53
|
-
key?: string;
|
|
54
|
-
}) => DynamicModule> & Record<`${MethodKey}Async`, <const Inject extends readonly Token<unknown>[]>(options: ConfigurableModuleAsyncOptions<Opts, FactoryMethodKey, Inject> & Partial<Extras> & {
|
|
55
|
-
key?: string;
|
|
56
|
-
}) => DynamicModule>;
|
|
57
|
-
export interface ConfigurableModuleHost<Opts, MethodKey extends string = 'forRoot', FactoryMethodKey extends string = 'create', Extras extends ConfigurableModuleExtras = {
|
|
58
|
-
isGlobal?: boolean;
|
|
59
|
-
}> {
|
|
60
|
-
/** Base class to `extends`. */
|
|
61
|
-
ConfigurableModuleClass: ConfigurableModuleClassType<Opts, MethodKey, FactoryMethodKey, Extras>;
|
|
62
|
-
/** The options token — inject it into derived providers (`inject: [MODULE_OPTIONS_TOKEN]`). */
|
|
63
|
-
MODULE_OPTIONS_TOKEN: InjectionToken<Opts>;
|
|
64
|
-
/** Type-only helper: the shape accepted by the sync `<method>` static. */
|
|
65
|
-
OPTIONS_TYPE: Opts & Partial<Extras> & {
|
|
66
|
-
key?: string;
|
|
67
|
-
};
|
|
68
|
-
/** Type-only helper: the shape accepted by the `<method>Async` static. */
|
|
69
|
-
ASYNC_OPTIONS_TYPE: ConfigurableModuleAsyncOptions<Opts, FactoryMethodKey> & Partial<Extras> & {
|
|
70
|
-
key?: string;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Low-level engine spec (see `defineConfigurableModule`). Used for the cases a
|
|
75
|
-
* class-mixin can't express — notably runtime-generated module classes whose
|
|
76
|
-
* providers depend on a call-time argument (e.g. Cloudflare binding modules).
|
|
77
|
-
*/
|
|
78
|
-
export interface DefineConfigurableModuleSpec<Args> {
|
|
79
|
-
/** The module class to reference in `{ module }`. */
|
|
80
|
-
module: Type;
|
|
81
|
-
/** Static method name to generate (e.g. `forRoot`). */
|
|
82
|
-
methodName?: string;
|
|
83
|
-
/** Derive the instance `key` from the call args. */
|
|
84
|
-
keyFrom: (args: Args) => string;
|
|
85
|
-
/** Build the provider list from the call args. */
|
|
86
|
-
providers: (args: Args) => DynamicModule['providers'];
|
|
87
|
-
/** Optional exports (usually prefer declaring these on `@Module`). */
|
|
88
|
-
exports?: DynamicModule['exports'];
|
|
89
|
-
/** Optional imports. */
|
|
90
|
-
imports?: (args: Args) => DynamicModule['imports'];
|
|
91
|
-
/** Mark the produced module global. */
|
|
92
|
-
global?: boolean;
|
|
93
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Constructor, DynamicModule, ModuleMetadata, ModuleOptions } from '../registry/types';
|
|
2
|
-
export declare function Global(): ClassDecorator;
|
|
3
|
-
export declare function Module(options?: ModuleOptions): ClassDecorator;
|
|
4
|
-
export declare function isModule(target: Constructor): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Normalize a DynamicModule, defaulting `key` to `"default"`. Module authors
|
|
7
|
-
* call this from `forRoot()` so the loader always sees an explicit key.
|
|
8
|
-
*/
|
|
9
|
-
export declare function defineDynamicModule(input: DynamicModule): DynamicModule;
|
|
10
|
-
export declare function getModuleMetadata(target: Constructor): ModuleMetadata | undefined;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { MetadataRegistry } from "../registry/metadata.registry.js";
|
|
2
|
-
export function Global() {
|
|
3
|
-
return (target)=>{
|
|
4
|
-
const ctor = target;
|
|
5
|
-
const existing = MetadataRegistry.getModuleOptions(ctor);
|
|
6
|
-
MetadataRegistry.setModuleOptions(ctor, {
|
|
7
|
-
...existing,
|
|
8
|
-
isGlobal: true
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export function Module(options = {}) {
|
|
13
|
-
return (target)=>{
|
|
14
|
-
MetadataRegistry.setModuleOptions(target, {
|
|
15
|
-
imports: options.imports,
|
|
16
|
-
providers: options.providers,
|
|
17
|
-
controllers: options.controllers,
|
|
18
|
-
exports: options.exports,
|
|
19
|
-
isGlobal: options.isGlobal,
|
|
20
|
-
lazy: options.lazy
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export function isModule(target) {
|
|
25
|
-
return MetadataRegistry.getModuleOptions(target) !== undefined;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Normalize a DynamicModule, defaulting `key` to `"default"`. Module authors
|
|
29
|
-
* call this from `forRoot()` so the loader always sees an explicit key.
|
|
30
|
-
*/ export function defineDynamicModule(input) {
|
|
31
|
-
return {
|
|
32
|
-
...input,
|
|
33
|
-
key: input.key ?? 'default'
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function getModuleMetadata(target) {
|
|
37
|
-
const options = MetadataRegistry.getModuleOptions(target);
|
|
38
|
-
if (!options) return undefined;
|
|
39
|
-
return {
|
|
40
|
-
providers: options.providers ?? [],
|
|
41
|
-
controllers: options.controllers ?? [],
|
|
42
|
-
imports: options.imports ?? [],
|
|
43
|
-
exports: options.exports ?? [],
|
|
44
|
-
isGlobal: options.isGlobal === true,
|
|
45
|
-
lazy: options.lazy === true
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, type ProviderOptions, type Token, type Type } from '../container/types';
|
|
2
|
-
import type { ComponentInstance, ModuleImport } from '../registry/types';
|
|
3
|
-
import type { ConfigurableModuleAsyncOptions, ConfigurableModuleExtras, ConfigurableModuleExtrasTransform, ConfigurableModuleHost } from './configurable-module.types';
|
|
4
|
-
/** The `global:` slot's component groups, lowered to `APP_*` registrations. */
|
|
5
|
-
export interface GlobalComponentSlot {
|
|
6
|
-
guards?: Array<Type | ComponentInstance>;
|
|
7
|
-
pipes?: Array<Type | ComponentInstance>;
|
|
8
|
-
interceptors?: Array<Type | ComponentInstance>;
|
|
9
|
-
filters?: Array<Type | ComponentInstance>;
|
|
10
|
-
middleware?: Array<Type | ComponentInstance>;
|
|
11
|
-
}
|
|
12
|
-
/** What a module instance contributes, computed from its call-time options. */
|
|
13
|
-
export interface ModuleContributions {
|
|
14
|
-
providers?: Array<Type | ProviderOptions>;
|
|
15
|
-
controllers?: Type[];
|
|
16
|
-
imports?: ModuleImport[];
|
|
17
|
-
exports?: Array<Type | InjectionToken>;
|
|
18
|
-
/**
|
|
19
|
-
* Standardized global-component registration — the one idiom replacing both
|
|
20
|
-
* the `@Module({ providers: [{ provide: APP_GUARD, useExisting: X }] })`
|
|
21
|
-
* pattern and the conditional-push-into-forRoot pattern. Class entries are
|
|
22
|
-
* registered as providers and wired via `useExisting`; instances via `useValue`.
|
|
23
|
-
*/
|
|
24
|
-
global?: GlobalComponentSlot;
|
|
25
|
-
}
|
|
26
|
-
export interface ModuleSetupContext<Opts> {
|
|
27
|
-
/** The options token — derived providers do `inject: [OPTIONS]`. */
|
|
28
|
-
readonly OPTIONS: InjectionToken<Opts>;
|
|
29
|
-
/**
|
|
30
|
-
* Structural options known at call time. For `forRoot` this is the full
|
|
31
|
-
* bag; for `forRootAsync` it is only the structural fields passed alongside
|
|
32
|
-
* the factory (the DI-resolved options exist only at resolution time —
|
|
33
|
-
* read them through `OPTIONS`, never here).
|
|
34
|
-
*/
|
|
35
|
-
readonly options: Partial<Opts>;
|
|
36
|
-
/** The instance key in effect (for deriving per-instance token names). */
|
|
37
|
-
readonly key: string;
|
|
38
|
-
}
|
|
39
|
-
export interface DefineModuleSpec<Opts, Extras extends ConfigurableModuleExtras = {
|
|
40
|
-
isGlobal?: boolean;
|
|
41
|
-
}, MethodKey extends string = 'forRoot', FactoryMethodKey extends string = 'create'> {
|
|
42
|
-
/** Names the generated base class, the minted options token, and diagnostics. */
|
|
43
|
-
name: string;
|
|
44
|
-
/**
|
|
45
|
-
* Reuse an existing options token instead of minting one — critical for
|
|
46
|
-
* migrations so the module's public token keeps its identity.
|
|
47
|
-
*/
|
|
48
|
-
optionsToken?: InjectionToken<Opts>;
|
|
49
|
-
/**
|
|
50
|
-
* Structural contributions as a function of the call-time options. Runs at
|
|
51
|
-
* `forRoot`/`forRootAsync` call time, once per module instance.
|
|
52
|
-
*/
|
|
53
|
-
setup?: (ctx: ModuleSetupContext<Opts>) => ModuleContributions;
|
|
54
|
-
/**
|
|
55
|
-
* Dedup key from the structural options. Defaults to `stableHash(options)`.
|
|
56
|
-
* Modules whose options carry stateful instances (drivers, registries)
|
|
57
|
-
* should derive from the stable identifying subset — or document that
|
|
58
|
-
* callers pass an explicit `key` for multi-instance setups.
|
|
59
|
-
*/
|
|
60
|
-
key?: (options: Partial<Opts>) => string;
|
|
61
|
-
/** Call-site extras defaults (default `{ isGlobal: false }`). */
|
|
62
|
-
extras?: Extras;
|
|
63
|
-
/** Reshape the definition from resolved extras (default: `isGlobal` → `global: true`). */
|
|
64
|
-
transform?: ConfigurableModuleExtrasTransform<Extras>;
|
|
65
|
-
/** Rename the sync static (default `forRoot`); the async static becomes `<name>Async`. */
|
|
66
|
-
methodName?: MethodKey;
|
|
67
|
-
/** Method a `useClass`/`useExisting` options factory must implement (default `create`). */
|
|
68
|
-
factoryMethodName?: FactoryMethodKey;
|
|
69
|
-
/**
|
|
70
|
-
* Default every generated module instance to deferred (first-use)
|
|
71
|
-
* materialization. Call sites can also opt in per instance by passing
|
|
72
|
-
* `lazy: true` alongside the options (recognized like `isGlobal`).
|
|
73
|
-
* See MODULE_AUTHORING.md "Lazy modules".
|
|
74
|
-
*/
|
|
75
|
-
lazy?: boolean;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* The one blessed module-authoring engine. Generates `forRoot` AND
|
|
79
|
-
* `forRootAsync` statics with: `stableHash` key derivation (multi-instance
|
|
80
|
-
* dedup that survives HMR), typed `inject` tuple inference on the async
|
|
81
|
-
* factory, an `isGlobal` extra, and — the piece `ConfigurableModuleBuilder`
|
|
82
|
-
* could not express — providers/controllers/imports/exports/global components
|
|
83
|
-
* computed **as functions of the options**.
|
|
84
|
-
*
|
|
85
|
-
* ```ts
|
|
86
|
-
* const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = defineModule<CorsOptions>({
|
|
87
|
-
* name: 'Cors',
|
|
88
|
-
* setup: ({ OPTIONS }) => ({
|
|
89
|
-
* providers: [{
|
|
90
|
-
* provide: APP_MIDDLEWARE,
|
|
91
|
-
* useFactory: (o: CorsOptions) => buildCorsMiddleware(o),
|
|
92
|
-
* inject: [OPTIONS],
|
|
93
|
-
* }],
|
|
94
|
-
* exports: [OPTIONS],
|
|
95
|
-
* }),
|
|
96
|
-
* });
|
|
97
|
-
* export class CorsModule extends ConfigurableModuleClass {}
|
|
98
|
-
* ```
|
|
99
|
-
*
|
|
100
|
-
* `ConfigurableModuleBuilder` remains supported (NestJS parity) and is a thin
|
|
101
|
-
* adapter over this engine.
|
|
102
|
-
*/
|
|
103
|
-
export declare function defineModule<Opts, Extras extends ConfigurableModuleExtras = {
|
|
104
|
-
isGlobal?: boolean;
|
|
105
|
-
}, MethodKey extends string = 'forRoot', FactoryMethodKey extends string = 'create'>(spec: DefineModuleSpec<Opts, Extras, MethodKey, FactoryMethodKey>): ConfigurableModuleHost<Opts, MethodKey, FactoryMethodKey, Extras>;
|
|
106
|
-
/**
|
|
107
|
-
* Lower `useFactory`/`useClass`/`useExisting` async options into provider
|
|
108
|
-
* registrations. Structural fields from the call site merge UNDER the resolved
|
|
109
|
-
* options (`{ ...structural, ...resolved }`) so sync-declared fields act as
|
|
110
|
-
* defaults and the factory stays authoritative.
|
|
111
|
-
*/
|
|
112
|
-
export declare function buildAsyncOptionsProviders<Opts>(optionsToken: Token, factoryMethodName: string, async: Pick<ConfigurableModuleAsyncOptions<Opts>, 'inject' | 'useFactory' | 'useClass' | 'useExisting'>, structural?: Record<string, unknown>): Array<ProviderOptions>;
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from "../container/types.js";
|
|
2
|
-
import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_MIDDLEWARE, APP_PIPE } from "../pipeline/tokens.js";
|
|
3
|
-
import { stableHash } from "./stable-hash.js";
|
|
4
|
-
const DEFAULT_EXTRAS = {
|
|
5
|
-
isGlobal: false
|
|
6
|
-
};
|
|
7
|
-
const DEFAULT_TRANSFORM = (def, extras)=>extras.isGlobal ? {
|
|
8
|
-
...def,
|
|
9
|
-
global: true
|
|
10
|
-
} : def;
|
|
11
|
-
const GLOBAL_SLOT_TOKENS = {
|
|
12
|
-
guards: APP_GUARD,
|
|
13
|
-
pipes: APP_PIPE,
|
|
14
|
-
interceptors: APP_INTERCEPTOR,
|
|
15
|
-
filters: APP_FILTER,
|
|
16
|
-
middleware: APP_MIDDLEWARE
|
|
17
|
-
};
|
|
18
|
-
/** Lower a `global:` slot to `APP_*` provider registrations. */ function lowerGlobalSlot(slot) {
|
|
19
|
-
const out = [];
|
|
20
|
-
for (const kind of Object.keys(GLOBAL_SLOT_TOKENS)){
|
|
21
|
-
for (const component of slot[kind] ?? []){
|
|
22
|
-
const token = GLOBAL_SLOT_TOKENS[kind];
|
|
23
|
-
if (typeof component === 'function') {
|
|
24
|
-
out.push(component, {
|
|
25
|
-
provide: token,
|
|
26
|
-
useExisting: component
|
|
27
|
-
});
|
|
28
|
-
} else {
|
|
29
|
-
out.push({
|
|
30
|
-
provide: token,
|
|
31
|
-
useValue: component
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return out;
|
|
37
|
-
}
|
|
38
|
-
const ASYNC_OPTION_KEYS = new Set([
|
|
39
|
-
'key',
|
|
40
|
-
'imports',
|
|
41
|
-
'inject',
|
|
42
|
-
'useFactory',
|
|
43
|
-
'useClass',
|
|
44
|
-
'useExisting'
|
|
45
|
-
]);
|
|
46
|
-
/**
|
|
47
|
-
* The one blessed module-authoring engine. Generates `forRoot` AND
|
|
48
|
-
* `forRootAsync` statics with: `stableHash` key derivation (multi-instance
|
|
49
|
-
* dedup that survives HMR), typed `inject` tuple inference on the async
|
|
50
|
-
* factory, an `isGlobal` extra, and — the piece `ConfigurableModuleBuilder`
|
|
51
|
-
* could not express — providers/controllers/imports/exports/global components
|
|
52
|
-
* computed **as functions of the options**.
|
|
53
|
-
*
|
|
54
|
-
* ```ts
|
|
55
|
-
* const { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } = defineModule<CorsOptions>({
|
|
56
|
-
* name: 'Cors',
|
|
57
|
-
* setup: ({ OPTIONS }) => ({
|
|
58
|
-
* providers: [{
|
|
59
|
-
* provide: APP_MIDDLEWARE,
|
|
60
|
-
* useFactory: (o: CorsOptions) => buildCorsMiddleware(o),
|
|
61
|
-
* inject: [OPTIONS],
|
|
62
|
-
* }],
|
|
63
|
-
* exports: [OPTIONS],
|
|
64
|
-
* }),
|
|
65
|
-
* });
|
|
66
|
-
* export class CorsModule extends ConfigurableModuleClass {}
|
|
67
|
-
* ```
|
|
68
|
-
*
|
|
69
|
-
* `ConfigurableModuleBuilder` remains supported (NestJS parity) and is a thin
|
|
70
|
-
* adapter over this engine.
|
|
71
|
-
*/ export function defineModule(spec) {
|
|
72
|
-
const optionsToken = spec.optionsToken ?? new InjectionToken(`${spec.name}_MODULE_OPTIONS`);
|
|
73
|
-
const syncName = spec.methodName ?? 'forRoot';
|
|
74
|
-
const asyncName = `${syncName}Async`;
|
|
75
|
-
const factoryMethodName = spec.factoryMethodName ?? 'create';
|
|
76
|
-
const extrasDefaults = spec.extras ?? DEFAULT_EXTRAS;
|
|
77
|
-
const transform = spec.transform ?? DEFAULT_TRANSFORM;
|
|
78
|
-
const deriveKey = (explicit, structural)=>explicit ?? spec.key?.(structural) ?? stableHash(structural);
|
|
79
|
-
// Laziness is OR-composed: the spec defaults it, a call site can add it.
|
|
80
|
-
const applyLazy = (definition, callSiteLazy)=>spec.lazy === true || callSiteLazy === true ? {
|
|
81
|
-
...definition,
|
|
82
|
-
lazy: true
|
|
83
|
-
} : definition;
|
|
84
|
-
const applyContributions = (definition, structural, key)=>{
|
|
85
|
-
if (!spec.setup) return definition;
|
|
86
|
-
const contributions = spec.setup({
|
|
87
|
-
OPTIONS: optionsToken,
|
|
88
|
-
options: structural,
|
|
89
|
-
key
|
|
90
|
-
});
|
|
91
|
-
const providers = [
|
|
92
|
-
...definition.providers ?? [],
|
|
93
|
-
...contributions.providers ?? [],
|
|
94
|
-
...contributions.global ? lowerGlobalSlot(contributions.global) : []
|
|
95
|
-
];
|
|
96
|
-
return {
|
|
97
|
-
...definition,
|
|
98
|
-
providers,
|
|
99
|
-
controllers: [
|
|
100
|
-
...definition.controllers ?? [],
|
|
101
|
-
...contributions.controllers ?? []
|
|
102
|
-
],
|
|
103
|
-
imports: [
|
|
104
|
-
...definition.imports ?? [],
|
|
105
|
-
...contributions.imports ?? []
|
|
106
|
-
],
|
|
107
|
-
exports: [
|
|
108
|
-
...definition.exports ?? [],
|
|
109
|
-
...contributions.exports ?? []
|
|
110
|
-
]
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
let GeneratedModuleClass = class GeneratedModuleClass {
|
|
114
|
-
};
|
|
115
|
-
Object.defineProperty(GeneratedModuleClass, 'name', {
|
|
116
|
-
value: `${spec.name}ModuleHost`
|
|
117
|
-
});
|
|
118
|
-
Object.defineProperty(GeneratedModuleClass, syncName, {
|
|
119
|
-
configurable: true,
|
|
120
|
-
writable: true,
|
|
121
|
-
enumerable: false,
|
|
122
|
-
value (options = {}) {
|
|
123
|
-
const { key: explicitKey, ...rest } = options;
|
|
124
|
-
const key = deriveKey(explicitKey, rest);
|
|
125
|
-
const definition = {
|
|
126
|
-
module: this,
|
|
127
|
-
key,
|
|
128
|
-
providers: [
|
|
129
|
-
{
|
|
130
|
-
provide: optionsToken,
|
|
131
|
-
useValue: rest
|
|
132
|
-
}
|
|
133
|
-
]
|
|
134
|
-
};
|
|
135
|
-
return applyLazy(transform(applyContributions(definition, rest, key), {
|
|
136
|
-
...extrasDefaults,
|
|
137
|
-
...rest
|
|
138
|
-
}), rest.lazy);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
Object.defineProperty(GeneratedModuleClass, asyncName, {
|
|
142
|
-
configurable: true,
|
|
143
|
-
writable: true,
|
|
144
|
-
enumerable: false,
|
|
145
|
-
value (options = {}) {
|
|
146
|
-
const bag = options;
|
|
147
|
-
const structural = {};
|
|
148
|
-
for (const [k, v] of Object.entries(bag)){
|
|
149
|
-
if (!ASYNC_OPTION_KEYS.has(k)) structural[k] = v;
|
|
150
|
-
}
|
|
151
|
-
const key = deriveKey(bag.key, // Async factories aren't structurally hashable in a useful way, so the
|
|
152
|
-
// default key hashes the async wiring + structural fields — same
|
|
153
|
-
// instance-identity semantics ConfigurableModuleBuilder always had.
|
|
154
|
-
spec.key ? structural : {
|
|
155
|
-
inject: bag.inject,
|
|
156
|
-
useFactory: bag.useFactory,
|
|
157
|
-
useClass: bag.useClass,
|
|
158
|
-
useExisting: bag.useExisting,
|
|
159
|
-
...structural
|
|
160
|
-
});
|
|
161
|
-
const definition = {
|
|
162
|
-
module: this,
|
|
163
|
-
key,
|
|
164
|
-
imports: bag.imports ?? [],
|
|
165
|
-
providers: buildAsyncOptionsProviders(optionsToken, factoryMethodName, bag, structural)
|
|
166
|
-
};
|
|
167
|
-
return applyLazy(transform(applyContributions(definition, structural, key), {
|
|
168
|
-
...extrasDefaults,
|
|
169
|
-
...structural
|
|
170
|
-
}), structural.lazy);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
return {
|
|
174
|
-
ConfigurableModuleClass: GeneratedModuleClass,
|
|
175
|
-
MODULE_OPTIONS_TOKEN: optionsToken,
|
|
176
|
-
// Type-only sentinels — never read at runtime.
|
|
177
|
-
OPTIONS_TYPE: undefined,
|
|
178
|
-
ASYNC_OPTIONS_TYPE: undefined
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Lower `useFactory`/`useClass`/`useExisting` async options into provider
|
|
183
|
-
* registrations. Structural fields from the call site merge UNDER the resolved
|
|
184
|
-
* options (`{ ...structural, ...resolved }`) so sync-declared fields act as
|
|
185
|
-
* defaults and the factory stays authoritative.
|
|
186
|
-
*/ export function buildAsyncOptionsProviders(optionsToken, factoryMethodName, async, structural = {}) {
|
|
187
|
-
const hasStructural = Object.keys(structural).length > 0;
|
|
188
|
-
const merge = (resolved)=>resolved instanceof Promise ? resolved.then((o)=>({
|
|
189
|
-
...structural,
|
|
190
|
-
...o
|
|
191
|
-
})) : {
|
|
192
|
-
...structural,
|
|
193
|
-
...resolved
|
|
194
|
-
};
|
|
195
|
-
if (async.useFactory) {
|
|
196
|
-
const factory = async.useFactory;
|
|
197
|
-
return [
|
|
198
|
-
{
|
|
199
|
-
provide: optionsToken,
|
|
200
|
-
// No structural fields → pass the caller's factory through untouched
|
|
201
|
-
// (function identity preserved; nothing to merge).
|
|
202
|
-
useFactory: hasStructural ? (...deps)=>merge(factory(...deps)) : factory,
|
|
203
|
-
inject: async.inject ?? []
|
|
204
|
-
}
|
|
205
|
-
];
|
|
206
|
-
}
|
|
207
|
-
if (async.useClass) {
|
|
208
|
-
const factoryClass = async.useClass;
|
|
209
|
-
return [
|
|
210
|
-
factoryClass,
|
|
211
|
-
{
|
|
212
|
-
provide: optionsToken,
|
|
213
|
-
useFactory: (instance)=>merge(instance[factoryMethodName]()),
|
|
214
|
-
inject: [
|
|
215
|
-
factoryClass
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
];
|
|
219
|
-
}
|
|
220
|
-
if (async.useExisting) {
|
|
221
|
-
return [
|
|
222
|
-
{
|
|
223
|
-
provide: optionsToken,
|
|
224
|
-
useFactory: (instance)=>merge(instance[factoryMethodName]()),
|
|
225
|
-
inject: [
|
|
226
|
-
async.useExisting
|
|
227
|
-
]
|
|
228
|
-
}
|
|
229
|
-
];
|
|
230
|
-
}
|
|
231
|
-
throw new Error('Async module options require one of `useFactory`, `useClass`, or `useExisting`.');
|
|
232
|
-
}
|
package/dist/module/graph.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Type } from '../container/types';
|
|
2
|
-
/**
|
|
3
|
-
* Walks the module dependency graph from a root, unwrapping ForwardRef and
|
|
4
|
-
* dynamic-module imports along the way, and returns every controller
|
|
5
|
-
* reachable from it. Pure metadata read — no Container, no side effects.
|
|
6
|
-
*
|
|
7
|
-
* Used by createOpenApiDocument and any other consumer that needs a
|
|
8
|
-
* controller list without bootstrapping the application.
|
|
9
|
-
*/
|
|
10
|
-
export declare function collectControllers(rootModule: Type): Type[];
|
package/dist/module/graph.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ForwardRef } from "../container/types.js";
|
|
2
|
-
import { getModuleMetadata } from "./decorators.js";
|
|
3
|
-
function isDynamicModuleLike(value) {
|
|
4
|
-
return !!value && typeof value === 'object' && 'module' in value && typeof value.module === 'function';
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Walks the module dependency graph from a root, unwrapping ForwardRef and
|
|
8
|
-
* dynamic-module imports along the way, and returns every controller
|
|
9
|
-
* reachable from it. Pure metadata read — no Container, no side effects.
|
|
10
|
-
*
|
|
11
|
-
* Used by createOpenApiDocument and any other consumer that needs a
|
|
12
|
-
* controller list without bootstrapping the application.
|
|
13
|
-
*/ export function collectControllers(rootModule) {
|
|
14
|
-
const visited = new Set();
|
|
15
|
-
const controllers = new Set();
|
|
16
|
-
const visit = (entry)=>{
|
|
17
|
-
const unwrapped = entry instanceof ForwardRef ? entry.factory() : entry;
|
|
18
|
-
const moduleClass = isDynamicModuleLike(unwrapped) ? unwrapped.module : unwrapped;
|
|
19
|
-
const extraControllers = isDynamicModuleLike(unwrapped) ? unwrapped.controllers ?? [] : [];
|
|
20
|
-
const extraImports = isDynamicModuleLike(unwrapped) ? unwrapped.imports ?? [] : [];
|
|
21
|
-
if (typeof moduleClass !== 'function' || visited.has(moduleClass)) return;
|
|
22
|
-
visited.add(moduleClass);
|
|
23
|
-
const metadata = getModuleMetadata(moduleClass);
|
|
24
|
-
if (metadata) {
|
|
25
|
-
for (const controller of metadata.controllers)controllers.add(controller);
|
|
26
|
-
for (const imp of metadata.imports)visit(imp);
|
|
27
|
-
}
|
|
28
|
-
for (const controller of extraControllers)controllers.add(controller);
|
|
29
|
-
for (const imp of extraImports)visit(imp);
|
|
30
|
-
};
|
|
31
|
-
visit(rootModule);
|
|
32
|
-
return [
|
|
33
|
-
...controllers
|
|
34
|
-
];
|
|
35
|
-
}
|
package/dist/module/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { Global, Module, isModule, getModuleMetadata, defineDynamicModule, } from './decorators';
|
|
2
|
-
export { stableHash } from './stable-hash';
|
|
3
|
-
export { ConfigurableModuleBuilder, defineConfigurableModule, moduleKey, } from './configurable-module.builder';
|
|
4
|
-
export { defineModule, buildAsyncOptionsProviders, type DefineModuleSpec, type GlobalComponentSlot, type ModuleContributions, type ModuleSetupContext, } from './define-module';
|
|
5
|
-
export { lazyProvider, moduleToken, provideGlobal, sideEffectModule, type LazyProviderSpec, } from './lazy-provider';
|
|
6
|
-
export type { ConfigurableModuleAsyncOptions, ConfigurableModuleBuilderOptions, ConfigurableModuleClassType, ConfigurableModuleExtras, ConfigurableModuleExtrasTransform, ConfigurableModuleHost, ConfigurableModuleOptionsFactory, DefineConfigurableModuleSpec, } from './configurable-module.types';
|
|
7
|
-
export { ModuleLoader } from './module-loader';
|
|
8
|
-
export { MiddlewareBuilder } from './middleware';
|
|
9
|
-
export type { MiddlewareConsumer, MiddlewareConfigProxy, MiddlewareRouteDefinition, NestModule, RouteInfo, } from './middleware';
|
|
10
|
-
export type { ModuleOptions, ModuleMetadata, DynamicModule, AsyncModuleOptions, ModuleImport } from './types';
|
package/dist/module/index.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { Global, Module, isModule, getModuleMetadata, defineDynamicModule } from "./decorators.js";
|
|
2
|
-
export { stableHash } from "./stable-hash.js";
|
|
3
|
-
export { ConfigurableModuleBuilder, defineConfigurableModule, moduleKey } from "./configurable-module.builder.js";
|
|
4
|
-
export { defineModule, buildAsyncOptionsProviders } from "./define-module.js";
|
|
5
|
-
export { lazyProvider, moduleToken, provideGlobal, sideEffectModule } from "./lazy-provider.js";
|
|
6
|
-
export { ModuleLoader } from "./module-loader.js";
|
|
7
|
-
export { MiddlewareBuilder } from "./middleware.js";
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { Container } from '../container/container';
|
|
2
|
-
import type { LazyResolutionHook, Token } from '../container/types';
|
|
3
|
-
/** One lazy module instance's deferral unit: its own tokens, in registration order. */
|
|
4
|
-
export interface LazyModuleGroup {
|
|
5
|
-
moduleId: string;
|
|
6
|
-
tokens: Token[];
|
|
7
|
-
/**
|
|
8
|
-
* A class provider's prototype declares `collectEntrypoints` — the module
|
|
9
|
-
* must be materialized before the entrypoint registry snapshot or its
|
|
10
|
-
* computed contributions would be silently absent.
|
|
11
|
-
*/
|
|
12
|
-
hasEntrypointContributor: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Owns deferred-module state for one application: which module instances are
|
|
16
|
-
* still pending, which have been claimed by a container trigger, and how
|
|
17
|
-
* claimed groups get completed (construction + lifecycle-hook replay).
|
|
18
|
-
*
|
|
19
|
-
* Phases:
|
|
20
|
-
* - `'bootstrap'` (until the end of `callOnApplicationBootstrap`): completed
|
|
21
|
-
* groups are *absorbed* — their instances queue up for the application's
|
|
22
|
-
* normal hook phases, so a lazy module dragged in by an eager consumer gets
|
|
23
|
-
* today-identical semantics.
|
|
24
|
-
* - `'live'`: hooks replay at drain time (memoized, exactly once), then the
|
|
25
|
-
* instances are handed to the application for shutdown-hook symmetry.
|
|
26
|
-
*
|
|
27
|
-
* Sync/async duality: sync drains throw a descriptive error when a member
|
|
28
|
-
* factory or hook yields a thenable — lazy modules with async providers or
|
|
29
|
-
* hooks must be reached through an async seam (`materializeLazyModules()`,
|
|
30
|
-
* `resolveAsync`) or stay eager.
|
|
31
|
-
*/
|
|
32
|
-
export declare class LazyModuleManager implements LazyResolutionHook {
|
|
33
|
-
private readonly container;
|
|
34
|
-
private readonly pending;
|
|
35
|
-
private readonly claimed;
|
|
36
|
-
private readonly absorbed;
|
|
37
|
-
private phase;
|
|
38
|
-
private draining;
|
|
39
|
-
private drainPromise?;
|
|
40
|
-
private onMaterialized?;
|
|
41
|
-
constructor(container: Container);
|
|
42
|
-
registerGroup(group: LazyModuleGroup): void;
|
|
43
|
-
/** Application sink for live-phase materializations (shutdown symmetry). */
|
|
44
|
-
setOnMaterialized(sink: (instances: unknown[]) => void): void;
|
|
45
|
-
setPhaseLive(): void;
|
|
46
|
-
isPending(moduleId: string): boolean;
|
|
47
|
-
/** Tokens whose owning modules are ALL still pending are deferred. */
|
|
48
|
-
hasPendingModules(): boolean;
|
|
49
|
-
claim(moduleId: string): void;
|
|
50
|
-
hasClaimed(): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* A drain loop is running. The container consults this before its
|
|
53
|
-
* post-resolution drain: `constructGroupAsync` resolves members through
|
|
54
|
-
* `resolveAsync`, whose end-of-cascade check would otherwise re-enter and
|
|
55
|
-
* AWAIT the very drain promise it is executing inside — a self-referential
|
|
56
|
-
* await that never settles (with ≥2 claimed groups). Claims made while
|
|
57
|
-
* draining are picked up by the running loop instead.
|
|
58
|
-
*/
|
|
59
|
-
isDraining(): boolean;
|
|
60
|
-
/** Instances constructed during the bootstrap phase, owed their hooks. */
|
|
61
|
-
takeAbsorbed(): unknown[];
|
|
62
|
-
drainSync(): void;
|
|
63
|
-
drainAsync(): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Materialize every still-pending group whose providers compute entrypoints
|
|
66
|
-
* (`collectEntrypoints` on a class prototype). Called by the application
|
|
67
|
-
* right before the entrypoint-registry snapshot so computed contributions
|
|
68
|
-
* are never silently absent. The cost — those modules are effectively
|
|
69
|
-
* eager — is the documented price of contributing computed entrypoints.
|
|
70
|
-
*/
|
|
71
|
-
materializeContributors(): Promise<void>;
|
|
72
|
-
/** Materialize everything still pending (warmup / tests / node runtimes). */
|
|
73
|
-
materializeAll(): Promise<void>;
|
|
74
|
-
private groupTokensToConstruct;
|
|
75
|
-
private constructGroupSync;
|
|
76
|
-
private constructGroupAsync;
|
|
77
|
-
/** Reversed batch = dependency-before-consumer (see drainSync comment). */
|
|
78
|
-
private orderBatch;
|
|
79
|
-
private finishBatchSync;
|
|
80
|
-
private finishBatchAsync;
|
|
81
|
-
private describeSyncFailure;
|
|
82
|
-
}
|