@velajs/vela 1.18.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 +78 -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 -66
- package/dist/index.js +14 -71
- 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 +67 -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 -91
- package/dist/application.js +0 -308
- 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 -62
- package/dist/errors/http-exception.js +0 -134
- 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/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 -108
- 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 -111
- 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 -81
- package/dist/live/live.engine.js +0 -448
- 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 -33
- package/dist/pipeline/tokens.js +0 -27
- 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 -53
- 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 -102
- 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 -107
- 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 -322
- package/dist/websocket/ws-exception.d.ts +0 -16
- package/dist/websocket/ws-exception.js +0 -32
- 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,231 +0,0 @@
|
|
|
1
|
-
import { Scope } from "../constants.js";
|
|
2
|
-
import { hasOnApplicationBootstrap, hasOnModuleInit } from "../lifecycle/index.js";
|
|
3
|
-
function isThenable(x) {
|
|
4
|
-
return x !== null && (typeof x === 'object' || typeof x === 'function') && typeof x.then === 'function';
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Owns deferred-module state for one application: which module instances are
|
|
8
|
-
* still pending, which have been claimed by a container trigger, and how
|
|
9
|
-
* claimed groups get completed (construction + lifecycle-hook replay).
|
|
10
|
-
*
|
|
11
|
-
* Phases:
|
|
12
|
-
* - `'bootstrap'` (until the end of `callOnApplicationBootstrap`): completed
|
|
13
|
-
* groups are *absorbed* — their instances queue up for the application's
|
|
14
|
-
* normal hook phases, so a lazy module dragged in by an eager consumer gets
|
|
15
|
-
* today-identical semantics.
|
|
16
|
-
* - `'live'`: hooks replay at drain time (memoized, exactly once), then the
|
|
17
|
-
* instances are handed to the application for shutdown-hook symmetry.
|
|
18
|
-
*
|
|
19
|
-
* Sync/async duality: sync drains throw a descriptive error when a member
|
|
20
|
-
* factory or hook yields a thenable — lazy modules with async providers or
|
|
21
|
-
* hooks must be reached through an async seam (`materializeLazyModules()`,
|
|
22
|
-
* `resolveAsync`) or stay eager.
|
|
23
|
-
*/ export class LazyModuleManager {
|
|
24
|
-
container;
|
|
25
|
-
pending = new Map();
|
|
26
|
-
claimed = [];
|
|
27
|
-
absorbed = [];
|
|
28
|
-
phase = 'bootstrap';
|
|
29
|
-
draining = false;
|
|
30
|
-
// In-flight async drain: concurrent drainAsync callers must await the SAME
|
|
31
|
-
// completion (the running loop picks their claims up), never resolve early
|
|
32
|
-
// with a group's hooks still pending.
|
|
33
|
-
drainPromise;
|
|
34
|
-
onMaterialized;
|
|
35
|
-
constructor(container){
|
|
36
|
-
this.container = container;
|
|
37
|
-
}
|
|
38
|
-
registerGroup(group) {
|
|
39
|
-
this.pending.set(group.moduleId, group);
|
|
40
|
-
}
|
|
41
|
-
/** Application sink for live-phase materializations (shutdown symmetry). */ setOnMaterialized(sink) {
|
|
42
|
-
this.onMaterialized = sink;
|
|
43
|
-
}
|
|
44
|
-
setPhaseLive() {
|
|
45
|
-
this.phase = 'live';
|
|
46
|
-
}
|
|
47
|
-
isPending(moduleId) {
|
|
48
|
-
return this.pending.has(moduleId);
|
|
49
|
-
}
|
|
50
|
-
/** Tokens whose owning modules are ALL still pending are deferred. */ hasPendingModules() {
|
|
51
|
-
return this.pending.size > 0;
|
|
52
|
-
}
|
|
53
|
-
claim(moduleId) {
|
|
54
|
-
const group = this.pending.get(moduleId);
|
|
55
|
-
if (!group) return;
|
|
56
|
-
this.pending.delete(moduleId);
|
|
57
|
-
this.claimed.push(group);
|
|
58
|
-
}
|
|
59
|
-
hasClaimed() {
|
|
60
|
-
return this.claimed.length > 0;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* A drain loop is running. The container consults this before its
|
|
64
|
-
* post-resolution drain: `constructGroupAsync` resolves members through
|
|
65
|
-
* `resolveAsync`, whose end-of-cascade check would otherwise re-enter and
|
|
66
|
-
* AWAIT the very drain promise it is executing inside — a self-referential
|
|
67
|
-
* await that never settles (with ≥2 claimed groups). Claims made while
|
|
68
|
-
* draining are picked up by the running loop instead.
|
|
69
|
-
*/ isDraining() {
|
|
70
|
-
return this.draining;
|
|
71
|
-
}
|
|
72
|
-
/** Instances constructed during the bootstrap phase, owed their hooks. */ takeAbsorbed() {
|
|
73
|
-
if (this.absorbed.length === 0) return [];
|
|
74
|
-
return this.absorbed.splice(0, this.absorbed.length);
|
|
75
|
-
}
|
|
76
|
-
drainSync() {
|
|
77
|
-
if (this.draining) return;
|
|
78
|
-
this.draining = true;
|
|
79
|
-
try {
|
|
80
|
-
// Construct-all-then-hook, batch by batch: a cascade's groups arrive in
|
|
81
|
-
// consumer-before-dependency claim order (the consumer's token resolves
|
|
82
|
-
// first; constructing it claims its deps), so hook phases run over the
|
|
83
|
-
// REVERSED batch — dependency-before-consumer, matching what the eager
|
|
84
|
-
// bootstrap would have produced. Hooks can claim further groups
|
|
85
|
-
// (discovery cascades) → outer loop.
|
|
86
|
-
while(this.claimed.length > 0){
|
|
87
|
-
const batch = [];
|
|
88
|
-
while(this.claimed.length > 0){
|
|
89
|
-
const group = this.claimed.shift();
|
|
90
|
-
batch.push({
|
|
91
|
-
group,
|
|
92
|
-
instances: this.constructGroupSync(group)
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
this.finishBatchSync(batch);
|
|
96
|
-
}
|
|
97
|
-
} finally{
|
|
98
|
-
this.draining = false;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
drainAsync() {
|
|
102
|
-
if (this.draining) {
|
|
103
|
-
// External concurrent callers await the in-flight completion (its loop
|
|
104
|
-
// picks their claims up). Callers INSIDE the drain's own await chain
|
|
105
|
-
// never reach here — the container skips its post-resolution drain
|
|
106
|
-
// while isDraining() (self-await would deadlock).
|
|
107
|
-
return this.drainPromise ?? Promise.resolve();
|
|
108
|
-
}
|
|
109
|
-
this.draining = true;
|
|
110
|
-
const run = (async ()=>{
|
|
111
|
-
try {
|
|
112
|
-
while(this.claimed.length > 0){
|
|
113
|
-
const batch = [];
|
|
114
|
-
while(this.claimed.length > 0){
|
|
115
|
-
const group = this.claimed.shift();
|
|
116
|
-
batch.push({
|
|
117
|
-
group,
|
|
118
|
-
instances: await this.constructGroupAsync(group)
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
await this.finishBatchAsync(batch);
|
|
122
|
-
}
|
|
123
|
-
} finally{
|
|
124
|
-
this.draining = false;
|
|
125
|
-
this.drainPromise = undefined;
|
|
126
|
-
}
|
|
127
|
-
})();
|
|
128
|
-
this.drainPromise = run;
|
|
129
|
-
return run;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Materialize every still-pending group whose providers compute entrypoints
|
|
133
|
-
* (`collectEntrypoints` on a class prototype). Called by the application
|
|
134
|
-
* right before the entrypoint-registry snapshot so computed contributions
|
|
135
|
-
* are never silently absent. The cost — those modules are effectively
|
|
136
|
-
* eager — is the documented price of contributing computed entrypoints.
|
|
137
|
-
*/ async materializeContributors() {
|
|
138
|
-
for (const group of [
|
|
139
|
-
...this.pending.values()
|
|
140
|
-
]){
|
|
141
|
-
if (group.hasEntrypointContributor) this.claim(group.moduleId);
|
|
142
|
-
}
|
|
143
|
-
await this.drainAsync();
|
|
144
|
-
}
|
|
145
|
-
/** Materialize everything still pending (warmup / tests / node runtimes). */ async materializeAll() {
|
|
146
|
-
for (const moduleId of [
|
|
147
|
-
...this.pending.keys()
|
|
148
|
-
])this.claim(moduleId);
|
|
149
|
-
await this.drainAsync();
|
|
150
|
-
}
|
|
151
|
-
groupTokensToConstruct(group) {
|
|
152
|
-
return group.tokens.filter((token)=>this.container.getProviderScope(token) !== Scope.REQUEST);
|
|
153
|
-
}
|
|
154
|
-
constructGroupSync(group) {
|
|
155
|
-
const out = new Set();
|
|
156
|
-
for (const token of this.groupTokensToConstruct(group)){
|
|
157
|
-
try {
|
|
158
|
-
out.add(this.container.resolve(token, group.moduleId));
|
|
159
|
-
} catch (error) {
|
|
160
|
-
// Only the sync-resolution-of-async-factory error is a seam problem;
|
|
161
|
-
// genuine provider failures must surface untouched.
|
|
162
|
-
if (error instanceof Error && error.message.includes('returned a Promise')) {
|
|
163
|
-
throw this.describeSyncFailure(group.moduleId, error);
|
|
164
|
-
}
|
|
165
|
-
throw error;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return [
|
|
169
|
-
...out
|
|
170
|
-
];
|
|
171
|
-
}
|
|
172
|
-
async constructGroupAsync(group) {
|
|
173
|
-
const out = new Set();
|
|
174
|
-
for (const token of this.groupTokensToConstruct(group)){
|
|
175
|
-
out.add(await this.container.resolveAsync(token, group.moduleId));
|
|
176
|
-
}
|
|
177
|
-
return [
|
|
178
|
-
...out
|
|
179
|
-
];
|
|
180
|
-
}
|
|
181
|
-
/** Reversed batch = dependency-before-consumer (see drainSync comment). */ orderBatch(batch) {
|
|
182
|
-
return [
|
|
183
|
-
...batch
|
|
184
|
-
].reverse();
|
|
185
|
-
}
|
|
186
|
-
finishBatchSync(batch) {
|
|
187
|
-
const ordered = this.orderBatch(batch);
|
|
188
|
-
if (this.phase === 'bootstrap') {
|
|
189
|
-
for (const { instances } of ordered)this.absorbed.push(...instances);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
for (const { group, instances } of ordered){
|
|
193
|
-
for (const instance of instances){
|
|
194
|
-
if (hasOnModuleInit(instance) && isThenable(instance.onModuleInit())) {
|
|
195
|
-
throw this.describeSyncFailure(group.moduleId);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
for (const { group, instances } of ordered){
|
|
200
|
-
for (const instance of instances){
|
|
201
|
-
if (hasOnApplicationBootstrap(instance) && isThenable(instance.onApplicationBootstrap())) {
|
|
202
|
-
throw this.describeSyncFailure(group.moduleId);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
this.onMaterialized?.(ordered.flatMap((b)=>b.instances));
|
|
207
|
-
}
|
|
208
|
-
async finishBatchAsync(batch) {
|
|
209
|
-
const ordered = this.orderBatch(batch);
|
|
210
|
-
if (this.phase === 'bootstrap') {
|
|
211
|
-
for (const { instances } of ordered)this.absorbed.push(...instances);
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
for (const { instances } of ordered){
|
|
215
|
-
for (const instance of instances){
|
|
216
|
-
if (hasOnModuleInit(instance)) await instance.onModuleInit();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
for (const { instances } of ordered){
|
|
220
|
-
for (const instance of instances){
|
|
221
|
-
if (hasOnApplicationBootstrap(instance)) await instance.onApplicationBootstrap();
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
this.onMaterialized?.(ordered.flatMap((b)=>b.instances));
|
|
225
|
-
}
|
|
226
|
-
describeSyncFailure(moduleId, cause) {
|
|
227
|
-
return new Error(`[vela] lazy module '${moduleId}' has async providers or lifecycle hooks and was ` + `triggered through a synchronous resolution path. Reach it through an async seam ` + `first (app.materializeLazyModules(), an async provider) or remove lazy: true.`, cause !== undefined ? {
|
|
228
|
-
cause
|
|
229
|
-
} : undefined);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, type InferTokens, type ProviderOptions, type Token, type Type } from '../container/types';
|
|
2
|
-
import type { ComponentType, DynamicModule } from '../registry/types';
|
|
3
|
-
import type { ModuleContributions } from './define-module';
|
|
4
|
-
export interface LazyProviderSpec<T, Inject extends readonly Token<unknown>[]> {
|
|
5
|
-
/** Token under which the memoized thunk `() => T` is provided. */
|
|
6
|
-
provide: Token<() => T>;
|
|
7
|
-
inject?: Inject;
|
|
8
|
-
useFactory: (...deps: InferTokens<Inject>) => T;
|
|
9
|
-
/** Memoize the first call's result (default true). */
|
|
10
|
-
memoize?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Provide a zero-arg thunk `() => T` whose factory runs on FIRST CALL, not at
|
|
14
|
-
* provider construction — for values that don't exist yet when the module
|
|
15
|
-
* graph is built (Cloudflare bindings are only live at request time).
|
|
16
|
-
*
|
|
17
|
-
* The shared primitive replacing the hand-rolled
|
|
18
|
-
* `useFactory: (...deps) => () => build(...deps)` closure that auth and
|
|
19
|
-
* storage each copy-pasted.
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* lazyProvider({
|
|
23
|
-
* provide: STORAGE_DRIVER_BUILDER,
|
|
24
|
-
* inject: [MODULE_OPTIONS_TOKEN],
|
|
25
|
-
* useFactory: (options) => options.driver(),
|
|
26
|
-
* })
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare function lazyProvider<T, const Inject extends readonly Token<unknown>[] = readonly Token<unknown>[]>(spec: LazyProviderSpec<T, Inject>): ProviderOptions;
|
|
30
|
-
/**
|
|
31
|
-
* The one idiom for registering an app-wide component from a module's
|
|
32
|
-
* providers. Returns registrations to spread:
|
|
33
|
-
*
|
|
34
|
-
* ```ts
|
|
35
|
-
* providers: [MyService, ...provideGlobal('guard', AuthGuard)]
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* Class components are registered as providers and wired via `useExisting`
|
|
39
|
-
* (so DI constructs them with their dependencies); instances via `useValue`.
|
|
40
|
-
* Inside `defineModule`, prefer the equivalent `global:` contribution slot.
|
|
41
|
-
*/
|
|
42
|
-
export declare function provideGlobal(kind: ComponentType, component: Type | object): Array<Type | ProviderOptions>;
|
|
43
|
-
/**
|
|
44
|
-
* A first-class side-effect-only module: contributes providers/exports without
|
|
45
|
-
* being a configurable module — the supported form of the "empty marker
|
|
46
|
-
* module" trick (i18n's `registerMessages`). Content-derived `key` makes
|
|
47
|
-
* identical contributions dedup (HMR-idempotent) while distinct ones coexist.
|
|
48
|
-
*
|
|
49
|
-
* ```ts
|
|
50
|
-
* export function registerMessages(messages: Messages): DynamicModule {
|
|
51
|
-
* return sideEffectModule('I18nMessages', {
|
|
52
|
-
* providers: [{ provide: I18N_MESSAGES, useValue: messages }],
|
|
53
|
-
* exports: [I18N_MESSAGES],
|
|
54
|
-
* });
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare function sideEffectModule(name: string, contributions?: Omit<ModuleContributions, 'global'> & {
|
|
59
|
-
key?: string;
|
|
60
|
-
}): DynamicModule;
|
|
61
|
-
/**
|
|
62
|
-
* Blessed token-minting convention: always an `InjectionToken` (never a raw
|
|
63
|
-
* string), named for diagnostics. Namespace it `'<pkg>:<area>:<thing>'`.
|
|
64
|
-
*/
|
|
65
|
-
export declare function moduleToken<T>(name: string): InjectionToken<T>;
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from "../container/types.js";
|
|
2
|
-
import { Module } from "./decorators.js";
|
|
3
|
-
import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR, APP_MIDDLEWARE, APP_PIPE } from "../pipeline/tokens.js";
|
|
4
|
-
import { stableHash } from "./stable-hash.js";
|
|
5
|
-
/**
|
|
6
|
-
* Provide a zero-arg thunk `() => T` whose factory runs on FIRST CALL, not at
|
|
7
|
-
* provider construction — for values that don't exist yet when the module
|
|
8
|
-
* graph is built (Cloudflare bindings are only live at request time).
|
|
9
|
-
*
|
|
10
|
-
* The shared primitive replacing the hand-rolled
|
|
11
|
-
* `useFactory: (...deps) => () => build(...deps)` closure that auth and
|
|
12
|
-
* storage each copy-pasted.
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* lazyProvider({
|
|
16
|
-
* provide: STORAGE_DRIVER_BUILDER,
|
|
17
|
-
* inject: [MODULE_OPTIONS_TOKEN],
|
|
18
|
-
* useFactory: (options) => options.driver(),
|
|
19
|
-
* })
|
|
20
|
-
* ```
|
|
21
|
-
*/ export function lazyProvider(spec) {
|
|
22
|
-
const memoize = spec.memoize ?? true;
|
|
23
|
-
return {
|
|
24
|
-
provide: spec.provide,
|
|
25
|
-
inject: [
|
|
26
|
-
...spec.inject ?? []
|
|
27
|
-
],
|
|
28
|
-
useFactory: (...deps)=>{
|
|
29
|
-
const build = ()=>spec.useFactory(...deps);
|
|
30
|
-
if (!memoize) return build;
|
|
31
|
-
let cached;
|
|
32
|
-
return ()=>(cached ??= {
|
|
33
|
-
value: build()
|
|
34
|
-
}).value;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const GLOBAL_COMPONENT_TOKENS = {
|
|
39
|
-
guard: APP_GUARD,
|
|
40
|
-
pipe: APP_PIPE,
|
|
41
|
-
interceptor: APP_INTERCEPTOR,
|
|
42
|
-
filter: APP_FILTER,
|
|
43
|
-
middleware: APP_MIDDLEWARE
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* The one idiom for registering an app-wide component from a module's
|
|
47
|
-
* providers. Returns registrations to spread:
|
|
48
|
-
*
|
|
49
|
-
* ```ts
|
|
50
|
-
* providers: [MyService, ...provideGlobal('guard', AuthGuard)]
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* Class components are registered as providers and wired via `useExisting`
|
|
54
|
-
* (so DI constructs them with their dependencies); instances via `useValue`.
|
|
55
|
-
* Inside `defineModule`, prefer the equivalent `global:` contribution slot.
|
|
56
|
-
*/ export function provideGlobal(kind, component) {
|
|
57
|
-
const token = GLOBAL_COMPONENT_TOKENS[kind];
|
|
58
|
-
if (typeof component === 'function') {
|
|
59
|
-
return [
|
|
60
|
-
component,
|
|
61
|
-
{
|
|
62
|
-
provide: token,
|
|
63
|
-
useExisting: component
|
|
64
|
-
}
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
return [
|
|
68
|
-
{
|
|
69
|
-
provide: token,
|
|
70
|
-
useValue: component
|
|
71
|
-
}
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* A first-class side-effect-only module: contributes providers/exports without
|
|
76
|
-
* being a configurable module — the supported form of the "empty marker
|
|
77
|
-
* module" trick (i18n's `registerMessages`). Content-derived `key` makes
|
|
78
|
-
* identical contributions dedup (HMR-idempotent) while distinct ones coexist.
|
|
79
|
-
*
|
|
80
|
-
* ```ts
|
|
81
|
-
* export function registerMessages(messages: Messages): DynamicModule {
|
|
82
|
-
* return sideEffectModule('I18nMessages', {
|
|
83
|
-
* providers: [{ provide: I18N_MESSAGES, useValue: messages }],
|
|
84
|
-
* exports: [I18N_MESSAGES],
|
|
85
|
-
* });
|
|
86
|
-
* }
|
|
87
|
-
* ```
|
|
88
|
-
*/ export function sideEffectModule(name, contributions = {}) {
|
|
89
|
-
const { key, ...rest } = contributions;
|
|
90
|
-
// Computed-property-name idiom: mints a class whose .name is `name` without
|
|
91
|
-
// dynamic code evaluation (edge-safe; no `new Function`).
|
|
92
|
-
const moduleClass = {
|
|
93
|
-
[name]: class {
|
|
94
|
-
}
|
|
95
|
-
}[name];
|
|
96
|
-
Module({})(moduleClass);
|
|
97
|
-
return {
|
|
98
|
-
module: moduleClass,
|
|
99
|
-
key: key ?? stableHash(rest),
|
|
100
|
-
providers: rest.providers ?? [],
|
|
101
|
-
controllers: rest.controllers ?? [],
|
|
102
|
-
imports: rest.imports ?? [],
|
|
103
|
-
exports: rest.exports ?? []
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Blessed token-minting convention: always an `InjectionToken` (never a raw
|
|
108
|
-
* string), named for diagnostics. Namespace it `'<pkg>:<area>:<thing>'`.
|
|
109
|
-
*/ export function moduleToken(name) {
|
|
110
|
-
return new InjectionToken(name);
|
|
111
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { HttpMethod } from '../constants';
|
|
2
|
-
import type { NestMiddleware } from '../pipeline/types';
|
|
3
|
-
import type { Constructor, Type } from '../registry/types';
|
|
4
|
-
export interface RouteInfo {
|
|
5
|
-
path: string;
|
|
6
|
-
method?: HttpMethod;
|
|
7
|
-
}
|
|
8
|
-
export interface MiddlewareRouteDefinition {
|
|
9
|
-
middleware: Array<Type<NestMiddleware> | NestMiddleware>;
|
|
10
|
-
routes: RouteInfo[];
|
|
11
|
-
excludes: RouteInfo[];
|
|
12
|
-
/** Stable-sort key; lower runs first. Default 0. */
|
|
13
|
-
priority?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface MiddlewareConfigProxy {
|
|
16
|
-
exclude(...routes: Array<string | RouteInfo>): MiddlewareConfigProxy;
|
|
17
|
-
withPriority(priority: number): MiddlewareConfigProxy;
|
|
18
|
-
forRoutes(...routes: Array<string | Constructor | RouteInfo>): MiddlewareConsumer;
|
|
19
|
-
}
|
|
20
|
-
export interface MiddlewareConsumer {
|
|
21
|
-
apply(...middleware: Array<Type<NestMiddleware> | NestMiddleware>): MiddlewareConfigProxy;
|
|
22
|
-
}
|
|
23
|
-
export interface NestModule {
|
|
24
|
-
configure(consumer: MiddlewareConsumer): void;
|
|
25
|
-
}
|
|
26
|
-
export declare class MiddlewareBuilder implements MiddlewareConsumer {
|
|
27
|
-
private definitions;
|
|
28
|
-
apply(...middleware: Array<Type<NestMiddleware> | NestMiddleware>): MiddlewareConfigProxy;
|
|
29
|
-
getDefinitions(): MiddlewareRouteDefinition[];
|
|
30
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { MetadataRegistry } from "../registry/metadata.registry.js";
|
|
2
|
-
export class MiddlewareBuilder {
|
|
3
|
-
definitions = [];
|
|
4
|
-
apply(...middleware) {
|
|
5
|
-
const currentMiddleware = [
|
|
6
|
-
...middleware
|
|
7
|
-
];
|
|
8
|
-
let currentExcludes = [];
|
|
9
|
-
let currentPriority;
|
|
10
|
-
const proxy = {
|
|
11
|
-
exclude: (...routes)=>{
|
|
12
|
-
currentExcludes = routes.map(normalizeRouteArg);
|
|
13
|
-
return proxy;
|
|
14
|
-
},
|
|
15
|
-
withPriority: (priority)=>{
|
|
16
|
-
currentPriority = priority;
|
|
17
|
-
return proxy;
|
|
18
|
-
},
|
|
19
|
-
forRoutes: (...routes)=>{
|
|
20
|
-
this.definitions.push({
|
|
21
|
-
middleware: currentMiddleware,
|
|
22
|
-
routes: routes.flatMap(resolveRouteArg),
|
|
23
|
-
excludes: [
|
|
24
|
-
...currentExcludes
|
|
25
|
-
],
|
|
26
|
-
...currentPriority !== undefined ? {
|
|
27
|
-
priority: currentPriority
|
|
28
|
-
} : {}
|
|
29
|
-
});
|
|
30
|
-
currentExcludes = [];
|
|
31
|
-
currentPriority = undefined;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
return proxy;
|
|
36
|
-
}
|
|
37
|
-
getDefinitions() {
|
|
38
|
-
return [
|
|
39
|
-
...this.definitions
|
|
40
|
-
];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function normalizeRouteArg(route) {
|
|
44
|
-
return typeof route === 'string' ? {
|
|
45
|
-
path: route
|
|
46
|
-
} : route;
|
|
47
|
-
}
|
|
48
|
-
function resolveRouteArg(route) {
|
|
49
|
-
if (typeof route === 'string') {
|
|
50
|
-
return [
|
|
51
|
-
{
|
|
52
|
-
path: route
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
}
|
|
56
|
-
if (typeof route === 'function') {
|
|
57
|
-
const prefix = MetadataRegistry.getControllerPath(route);
|
|
58
|
-
return [
|
|
59
|
-
{
|
|
60
|
-
path: prefix || '/'
|
|
61
|
-
}
|
|
62
|
-
];
|
|
63
|
-
}
|
|
64
|
-
return [
|
|
65
|
-
route
|
|
66
|
-
];
|
|
67
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { Container } from "../container/container";
|
|
2
|
-
import type { Token, Type } from "../container/types";
|
|
3
|
-
import type { RouteManager } from "../http/route.manager";
|
|
4
|
-
import type { MiddlewareRouteDefinition } from "./middleware";
|
|
5
|
-
/** What the loader records per lazy module instance (see LazyModuleManager). */
|
|
6
|
-
export interface LazyModuleGroupSpec {
|
|
7
|
-
moduleId: string;
|
|
8
|
-
tokens: Token[];
|
|
9
|
-
hasEntrypointContributor: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare class ModuleLoader {
|
|
12
|
-
private container;
|
|
13
|
-
private router;
|
|
14
|
-
private processedModules;
|
|
15
|
-
private processingStack;
|
|
16
|
-
private collectedControllers;
|
|
17
|
-
private registeredProviders;
|
|
18
|
-
private moduleExportsCache;
|
|
19
|
-
private globalExports;
|
|
20
|
-
private consumerMiddlewareDefinitions;
|
|
21
|
-
private appProviderCounter;
|
|
22
|
-
private appProviderTokens;
|
|
23
|
-
private moduleIdByClassKey;
|
|
24
|
-
private seenModuleIds;
|
|
25
|
-
private lazyModuleIds;
|
|
26
|
-
private lazyGroups;
|
|
27
|
-
constructor(container: Container, router: RouteManager);
|
|
28
|
-
load(rootModule: Type): void;
|
|
29
|
-
private getModuleId;
|
|
30
|
-
private isProcessed;
|
|
31
|
-
private markProcessed;
|
|
32
|
-
private getCachedExports;
|
|
33
|
-
private cacheExports;
|
|
34
|
-
private processModule;
|
|
35
|
-
private warnOnMixedDefaultAndKeyed;
|
|
36
|
-
/** Registers the provider and returns the token it was registered under. */
|
|
37
|
-
private registerProvider;
|
|
38
|
-
private isAppToken;
|
|
39
|
-
private buildExportSet;
|
|
40
|
-
getControllers(): Type[];
|
|
41
|
-
getRegisteredProviders(): Token[];
|
|
42
|
-
getAppProviderTokens(token: Token): Token[];
|
|
43
|
-
getConsumerMiddlewareDefinitions(): MiddlewareRouteDefinition[];
|
|
44
|
-
/**
|
|
45
|
-
* Every lazy module instance recorded during load. Handed to the
|
|
46
|
-
* LazyModuleManager at bootstrap; empty when no module opted in.
|
|
47
|
-
*/
|
|
48
|
-
getLazyGroups(): LazyModuleGroupSpec[];
|
|
49
|
-
/**
|
|
50
|
-
* A token is deferred iff EVERY module bucket holding it belongs to a lazy
|
|
51
|
-
* module instance — a token also registered by a non-lazy module stays on
|
|
52
|
-
* the eager pass (and resolving it there claims the lazy sibling, which is
|
|
53
|
-
* the "any use = init" semantic, not a bug).
|
|
54
|
-
*/
|
|
55
|
-
private isLazyOnlyToken;
|
|
56
|
-
resolveAllInstances(): Promise<unknown[]>;
|
|
57
|
-
private routeError;
|
|
58
|
-
}
|