@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
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
import { Context } from "hono";
|
|
2
|
+
//#region src/constants.d.ts
|
|
3
|
+
declare const METADATA_KEYS: {
|
|
4
|
+
readonly INJECTABLE: 'vela:injectable';
|
|
5
|
+
readonly INJECT: 'vela:inject';
|
|
6
|
+
readonly SCOPE: 'vela:scope';
|
|
7
|
+
readonly MODULE: 'vela:module';
|
|
8
|
+
readonly MODULE_OPTIONS: 'vela:module-options';
|
|
9
|
+
readonly CONTROLLER: 'vela:controller';
|
|
10
|
+
readonly ROUTES: 'vela:routes';
|
|
11
|
+
readonly PARAMS: 'vela:params';
|
|
12
|
+
readonly HTTP_CODE: 'vela:http-code';
|
|
13
|
+
readonly RESPONSE_HEADERS: 'vela:response-headers';
|
|
14
|
+
readonly REDIRECT: 'vela:redirect';
|
|
15
|
+
readonly CATCH: 'vela:catch';
|
|
16
|
+
readonly CRUD: 'vela:crud';
|
|
17
|
+
};
|
|
18
|
+
declare const HttpMethod: {
|
|
19
|
+
readonly GET: 'GET';
|
|
20
|
+
readonly POST: 'POST';
|
|
21
|
+
readonly PUT: 'PUT';
|
|
22
|
+
readonly PATCH: 'PATCH';
|
|
23
|
+
readonly DELETE: 'DELETE';
|
|
24
|
+
readonly OPTIONS: 'OPTIONS';
|
|
25
|
+
readonly HEAD: 'HEAD';
|
|
26
|
+
readonly ALL: 'ALL';
|
|
27
|
+
};
|
|
28
|
+
type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
|
|
29
|
+
declare const ParamType: {
|
|
30
|
+
readonly BODY: 'body';
|
|
31
|
+
readonly QUERY: 'query';
|
|
32
|
+
readonly PARAM: 'param';
|
|
33
|
+
readonly HEADERS: 'headers';
|
|
34
|
+
readonly REQUEST: 'request';
|
|
35
|
+
readonly RESPONSE: 'response';
|
|
36
|
+
readonly IP: 'ip';
|
|
37
|
+
readonly COOKIE: 'cookie';
|
|
38
|
+
readonly RAW_BODY: 'raw_body';
|
|
39
|
+
};
|
|
40
|
+
type ParamType = (typeof ParamType)[keyof typeof ParamType];
|
|
41
|
+
declare const Scope: {
|
|
42
|
+
readonly SINGLETON: 'singleton';
|
|
43
|
+
readonly TRANSIENT: 'transient';
|
|
44
|
+
readonly REQUEST: 'request';
|
|
45
|
+
};
|
|
46
|
+
type Scope = (typeof Scope)[keyof typeof Scope];
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/container/types.d.ts
|
|
49
|
+
type Type<T = any> = new (...args: any[]) => T;
|
|
50
|
+
type Constructor<T = unknown> = abstract new (...args: any[]) => T;
|
|
51
|
+
interface InjectionTokenOptions<T> {
|
|
52
|
+
factory?: () => T;
|
|
53
|
+
}
|
|
54
|
+
declare class InjectionToken<T = unknown> {
|
|
55
|
+
private readonly description;
|
|
56
|
+
readonly options?: InjectionTokenOptions<T> | undefined;
|
|
57
|
+
constructor(description: string, options?: InjectionTokenOptions<T> | undefined);
|
|
58
|
+
toString(): string;
|
|
59
|
+
}
|
|
60
|
+
declare class ForwardRef<T = unknown> {
|
|
61
|
+
readonly factory: () => Token<T>;
|
|
62
|
+
constructor(factory: () => Token<T>);
|
|
63
|
+
}
|
|
64
|
+
declare function forwardRef<T>(factory: () => Token<T>): ForwardRef<T>;
|
|
65
|
+
type Token<T = any> = Type<T> | InjectionToken<T> | string | symbol;
|
|
66
|
+
/**
|
|
67
|
+
* Maps a single DI `Token<T>` to its resolved value type at the type level:
|
|
68
|
+
* - `InjectionToken<T>` → `T`
|
|
69
|
+
* - `Type<T>` / `Constructor<T>` → `T` (the instance type)
|
|
70
|
+
* - `ForwardRef<T>` → `T`
|
|
71
|
+
* - `string` / `symbol` → `unknown` (runtime-only tokens carry no
|
|
72
|
+
* static type info; the consumer asserts).
|
|
73
|
+
*
|
|
74
|
+
* Used by `AsyncModuleOptions` to give `useFactory` parameters their real
|
|
75
|
+
* types based on the literal `inject` tuple — without `as const` at the call
|
|
76
|
+
* site (relies on the `const` type parameter on the consuming generic).
|
|
77
|
+
*/
|
|
78
|
+
type InferToken<T> = T extends InjectionToken<infer U> ? U : T extends ForwardRef<infer U> ? U : T extends (abstract new (...args: any[]) => infer U) ? U : unknown;
|
|
79
|
+
/**
|
|
80
|
+
* Map every position of a `Token[]` tuple to its resolved value type.
|
|
81
|
+
* Pairs with `const Inject extends readonly Token<unknown>[]` generics to
|
|
82
|
+
* give `useFactory(...deps)` parameter types inferred from the literal
|
|
83
|
+
* `inject` array.
|
|
84
|
+
*/
|
|
85
|
+
type InferTokens<T extends readonly unknown[]> = { [K in keyof T]: InferToken<T[K]>; };
|
|
86
|
+
interface InjectableOptions {
|
|
87
|
+
scope?: Scope;
|
|
88
|
+
}
|
|
89
|
+
interface InjectMetadata {
|
|
90
|
+
index: number;
|
|
91
|
+
token?: Token | ForwardRef;
|
|
92
|
+
optional?: boolean;
|
|
93
|
+
}
|
|
94
|
+
interface ProviderOptions<T = unknown> {
|
|
95
|
+
provide?: Token<T>;
|
|
96
|
+
scope?: Scope;
|
|
97
|
+
useValue?: T;
|
|
98
|
+
useFactory?: (...args: any[]) => T | Promise<T>;
|
|
99
|
+
useClass?: Type<T>;
|
|
100
|
+
inject?: readonly Token[];
|
|
101
|
+
useExisting?: Token<T>;
|
|
102
|
+
}
|
|
103
|
+
interface ModuleScope {
|
|
104
|
+
moduleId: string;
|
|
105
|
+
localProviders: Set<Token>;
|
|
106
|
+
importedModules: Set<string>;
|
|
107
|
+
exportedTokens: Set<Token>;
|
|
108
|
+
isGlobal: boolean;
|
|
109
|
+
/** Module instance opted into deferred (first-use) materialization. */
|
|
110
|
+
lazy?: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The container's seam into lazy-module materialization (implemented by
|
|
114
|
+
* `LazyModuleManager`). The container only ever *claims* a pending module at
|
|
115
|
+
* a resolution trigger and *drains* completed claims when the resolution
|
|
116
|
+
* stack has fully unwound — construction and hook replay live behind this
|
|
117
|
+
* interface so the container stays module-system-agnostic.
|
|
118
|
+
*/
|
|
119
|
+
interface LazyResolutionHook {
|
|
120
|
+
/** Is this module instance still deferred (untriggered)? */
|
|
121
|
+
isPending(moduleId: string): boolean;
|
|
122
|
+
/** Mark a pending module as triggered; idempotent. */
|
|
123
|
+
claim(moduleId: string): void;
|
|
124
|
+
/** Any claimed-but-unmaterialized groups? (cheap fast-path check) */
|
|
125
|
+
hasClaimed(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* A drain loop is currently running. The container must NOT start (or
|
|
128
|
+
* await) another drain from inside it — the running loop picks pending
|
|
129
|
+
* claims up; awaiting would self-deadlock on the async path.
|
|
130
|
+
*/
|
|
131
|
+
isDraining(): boolean;
|
|
132
|
+
/** Complete claimed groups synchronously; throws if async work surfaces. */
|
|
133
|
+
drainSync(): void;
|
|
134
|
+
/** Complete claimed groups, awaiting async construction and hooks. */
|
|
135
|
+
drainAsync(): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
type Diagnostics = 'silent' | 'log' | 'throw';
|
|
138
|
+
interface ContainerOptions {
|
|
139
|
+
diagnostics?: Diagnostics;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Human-readable token label — class name, `InjectionToken(desc)`, symbol
|
|
143
|
+
* string, or String() fallback. Public so introspection tooling (module
|
|
144
|
+
* graphs, entrypoint listings) renders tokens the same way vela's own errors
|
|
145
|
+
* do.
|
|
146
|
+
*/
|
|
147
|
+
declare function describeToken(token: Token): string;
|
|
148
|
+
/**
|
|
149
|
+
* One module instance in the loaded graph, serializable (strings only) —
|
|
150
|
+
* what `Container.getModuleDescriptions()` returns for introspection tooling
|
|
151
|
+
* (`vela module graph`). Reads registration state only; never constructs.
|
|
152
|
+
*/
|
|
153
|
+
interface ModuleDescription {
|
|
154
|
+
moduleId: string;
|
|
155
|
+
/** moduleIds this instance imports. */
|
|
156
|
+
imports: string[];
|
|
157
|
+
isGlobal: boolean;
|
|
158
|
+
lazy: boolean;
|
|
159
|
+
/** Token labels registered in this instance's bucket (registration order). */
|
|
160
|
+
providers: string[];
|
|
161
|
+
/** Token labels this instance exports. */
|
|
162
|
+
exports: string[];
|
|
163
|
+
}
|
|
164
|
+
declare class ModuleVisibilityError extends Error {
|
|
165
|
+
readonly moduleId: string;
|
|
166
|
+
readonly token: Token;
|
|
167
|
+
constructor(moduleId: string, token: Token);
|
|
168
|
+
}
|
|
169
|
+
declare class MultipleProvidersFoundError extends Error {
|
|
170
|
+
readonly moduleId: string;
|
|
171
|
+
readonly token: Token;
|
|
172
|
+
readonly candidates: string[];
|
|
173
|
+
constructor(moduleId: string, token: Token, candidates: string[]);
|
|
174
|
+
}
|
|
175
|
+
declare const ROOT_MODULE_ID = "__root__";
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/container/container.d.ts
|
|
178
|
+
/**
|
|
179
|
+
* Per-module provider buckets. Each module instance owns its providers under
|
|
180
|
+
* its `moduleId`; the same logical token can have distinct registrations in
|
|
181
|
+
* different buckets, supporting multi-instance dynamic modules.
|
|
182
|
+
*
|
|
183
|
+
* The `__root__` bucket holds bootstrap-time framework primitives (Container,
|
|
184
|
+
* ModuleRef, REQUEST_CONTEXT, etc.) and any `register()` call that doesn't
|
|
185
|
+
* supply a `declaringModuleId`.
|
|
186
|
+
*/
|
|
187
|
+
declare class Container {
|
|
188
|
+
private providers;
|
|
189
|
+
private exporterIndex;
|
|
190
|
+
private resolutionStack;
|
|
191
|
+
private requestInstances;
|
|
192
|
+
private scopes;
|
|
193
|
+
private globals;
|
|
194
|
+
private diagnostics;
|
|
195
|
+
private root;
|
|
196
|
+
private disposables;
|
|
197
|
+
private lazyHook?;
|
|
198
|
+
private asyncDepth;
|
|
199
|
+
constructor(options?: ContainerOptions);
|
|
200
|
+
/** Install the lazy-module seam (bootstrap-time; root container only). */
|
|
201
|
+
setLazyHook(hook: LazyResolutionHook): void;
|
|
202
|
+
private claimLazyModule;
|
|
203
|
+
private maybeDrainSync;
|
|
204
|
+
register<T>(provider: Type<T> | ProviderOptions<T>, declaringModuleId?: string): this;
|
|
205
|
+
private registerClass;
|
|
206
|
+
private registerOptions;
|
|
207
|
+
private writeRegistration;
|
|
208
|
+
registerScope(scope: ModuleScope): void;
|
|
209
|
+
markGlobalToken(token: Token): void;
|
|
210
|
+
setRequestInstance(token: Token, value: unknown): void;
|
|
211
|
+
getDiagnostics(): Diagnostics;
|
|
212
|
+
resolve<T>(token: Token<T>, requestingModuleId?: string): T;
|
|
213
|
+
resolveAll<T>(token: Token<T>, requestingModuleId?: string): T[];
|
|
214
|
+
/**
|
|
215
|
+
* Find a single reachable registration for a token, applying the visibility
|
|
216
|
+
* walk: requester's bucket → globals → requester's importedModules
|
|
217
|
+
* (transitively, following re-exports).
|
|
218
|
+
*
|
|
219
|
+
* Returns `undefined` if no candidate exists. Throws
|
|
220
|
+
* `MultipleProvidersFoundError` if the imports walk yields more than one.
|
|
221
|
+
*/
|
|
222
|
+
private findRegistration;
|
|
223
|
+
/** Typed bucket lookup — single seam where the Map<Token, Registration> erases T. */
|
|
224
|
+
private lookupInBucket;
|
|
225
|
+
/**
|
|
226
|
+
* Walk a scope's imports (and their imports' imports, …) collecting every
|
|
227
|
+
* registration reachable through re-export chains. A child only contributes
|
|
228
|
+
* if it explicitly exports the token — non-exported providers stay private.
|
|
229
|
+
*/
|
|
230
|
+
private collectFromImports;
|
|
231
|
+
private findAllRegistrations;
|
|
232
|
+
/** True if any bucket has a registration for `token`. Sandbox-friendly. */
|
|
233
|
+
has(token: Token): boolean;
|
|
234
|
+
/** True if the specified module's bucket has a registration for `token`. */
|
|
235
|
+
hasInScope(token: Token, moduleId: string): boolean;
|
|
236
|
+
/** Module buckets that hold a registration for `token` (registration order). */
|
|
237
|
+
getOwnerModuleIds(token: Token): string[];
|
|
238
|
+
/**
|
|
239
|
+
* Force-replace a provider across module scopes — the supported form of the
|
|
240
|
+
* override loop test harnesses need (module-scoped resolution consults the
|
|
241
|
+
* module's own bucket first, so a root-only override would never win there).
|
|
242
|
+
*
|
|
243
|
+
* - `'all-existing'` (default): every non-root bucket that already holds the
|
|
244
|
+
* token, plus `__root__` (so framework-internal lookups see it too).
|
|
245
|
+
* - `'root'`: only the `__root__` bucket.
|
|
246
|
+
* - `string[]`: exactly these bucket ids.
|
|
247
|
+
*/
|
|
248
|
+
replaceProvider<T>(provider: Type<T> | ProviderOptions<T>, options?: {
|
|
249
|
+
buckets?: 'all-existing' | 'root' | string[];
|
|
250
|
+
}): this;
|
|
251
|
+
/**
|
|
252
|
+
* True when the token belongs exclusively to lazy modules that have not
|
|
253
|
+
* been materialized yet — resolving it would trigger materialization.
|
|
254
|
+
* Build-time probes (route-manager middleware priority, entrypoint
|
|
255
|
+
* snapshots) use this to defer instead of forcing the group.
|
|
256
|
+
*/
|
|
257
|
+
isLazyPending(token: Token): boolean;
|
|
258
|
+
/**
|
|
259
|
+
* True when any registration of the token holds a constructed instance.
|
|
260
|
+
* Diagnostic helper (cold-start tests): checks WITHOUT resolving, so it
|
|
261
|
+
* never triggers lazy materialization.
|
|
262
|
+
*/
|
|
263
|
+
isInstantiated(token: Token): boolean;
|
|
264
|
+
getProviderScope(token: Token): Scope | undefined;
|
|
265
|
+
getTokens(): Token[];
|
|
266
|
+
/**
|
|
267
|
+
* Every statically-provided (useValue) instance across ALL module buckets.
|
|
268
|
+
* Unlike resolving a token (which yields only the first bucket's registration),
|
|
269
|
+
* this surfaces per-instance values — e.g. one BindingRef per multi-instance
|
|
270
|
+
* binding module — so framework adapters can initialize all of them.
|
|
271
|
+
*/
|
|
272
|
+
getUseValues(): unknown[];
|
|
273
|
+
/**
|
|
274
|
+
* Serializable description of every loaded module instance (load order),
|
|
275
|
+
* plus the `__root__` bucket (bootstrap primitives) when non-empty —
|
|
276
|
+
* the `vela module graph` seam. Reads registration state only: safe pre-
|
|
277
|
+
* and post-bootstrap, never constructs, never claims lazy modules.
|
|
278
|
+
*/
|
|
279
|
+
getModuleDescriptions(): ModuleDescription[];
|
|
280
|
+
/**
|
|
281
|
+
* Compute request-scope bubbling for every registration (call once at
|
|
282
|
+
* bootstrap, after all providers are registered). A provider whose declared
|
|
283
|
+
* scope is not REQUEST but which (transitively) depends on a request-scoped
|
|
284
|
+
* provider is marked `effectiveScope = REQUEST`, so it is rebuilt per request
|
|
285
|
+
* instead of capturing the first request's instance — matching NestJS.
|
|
286
|
+
*/
|
|
287
|
+
computeEffectiveScopes(): void;
|
|
288
|
+
/** The dependency tokens a registration would resolve when constructed. */
|
|
289
|
+
private dependencyTokensOf;
|
|
290
|
+
private tryFindRegistration;
|
|
291
|
+
/**
|
|
292
|
+
* Create a child container for request-scoped resolution.
|
|
293
|
+
* The child shares the parent's providers but caches REQUEST-scoped
|
|
294
|
+
* instances separately per child (per request).
|
|
295
|
+
*/
|
|
296
|
+
createChild(): Container;
|
|
297
|
+
createDetached(): Container;
|
|
298
|
+
clear(): void;
|
|
299
|
+
/** Whether this container has any tracked disposables (cheap request-path check). */
|
|
300
|
+
hasDisposables(): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Dispose container-constructed instances (Symbol.asyncDispose /
|
|
303
|
+
* Symbol.dispose / .dispose()) in reverse creation order (LIFO). Errors are
|
|
304
|
+
* logged and skipped so one bad teardown never blocks the rest.
|
|
305
|
+
*
|
|
306
|
+
* A REQUEST child disposes only its own request-scoped instances; the root
|
|
307
|
+
* disposes shared SINGLETONs and clears their cached instance so a dev HMR
|
|
308
|
+
* generation cannot leak a stale graph. Shared provider maps are left intact
|
|
309
|
+
* for a request child (they belong to the root).
|
|
310
|
+
*/
|
|
311
|
+
dispose(): Promise<void>;
|
|
312
|
+
private resolveRegistration;
|
|
313
|
+
private resolveClass;
|
|
314
|
+
/**
|
|
315
|
+
* Resolve one factory `inject` dependency. Since 1.11 the declaring module's
|
|
316
|
+
* scope is consulted FIRST (proper visibility semantics — a `forRootAsync`
|
|
317
|
+
* factory can inject providers reachable through its module's imports); on
|
|
318
|
+
* any failure the legacy no-requester lookup (root bucket, then first
|
|
319
|
+
* exporter) is kept as fallback, so every previously-resolving graph still
|
|
320
|
+
* resolves.
|
|
321
|
+
*/
|
|
322
|
+
private resolveFactoryDependency;
|
|
323
|
+
private resolveFactoryDependencyAsync;
|
|
324
|
+
private resolveFactory;
|
|
325
|
+
resolveAsync<T>(token: Token<T>, requestingModuleId?: string): Promise<T>;
|
|
326
|
+
private resolveAsyncInner;
|
|
327
|
+
private createLazyProxy;
|
|
328
|
+
private tokenToString;
|
|
329
|
+
}
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region src/pipeline/types.d.ts
|
|
332
|
+
/**
|
|
333
|
+
* HTTP-specific arguments host returned by `ExecutionContext.switchToHttp()`.
|
|
334
|
+
* In Vela/Hono, the `Context` object holds both request and response state.
|
|
335
|
+
*
|
|
336
|
+
* - `getRequest()` — the Web `Request` object
|
|
337
|
+
* - `getResponse()` — the Hono `Context` (use `c.header()`, `c.setCookie()`, etc.)
|
|
338
|
+
*/
|
|
339
|
+
interface HttpArgumentsHost {
|
|
340
|
+
getRequest<T = Request>(): T;
|
|
341
|
+
getResponse<T = Context>(): T;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* WebSocket-specific arguments host returned by `ExecutionContext.switchToWs()`.
|
|
345
|
+
* Populated by `@velajs/vela/websocket` when a gateway message is dispatched.
|
|
346
|
+
*
|
|
347
|
+
* - `getClient()` — the connected socket (`WsClient`)
|
|
348
|
+
* - `getData()` — the inbound message payload (the envelope's `data`)
|
|
349
|
+
* - `getPattern()` — the subscribed event name that matched
|
|
350
|
+
*/
|
|
351
|
+
interface WsArgumentsHost {
|
|
352
|
+
getClient<T = unknown>(): T;
|
|
353
|
+
getData<T = unknown>(): T;
|
|
354
|
+
getPattern<T = string>(): T;
|
|
355
|
+
}
|
|
356
|
+
/** The transport a component is executing under. `'http'` for routes, `'ws'` for gateway messages. */
|
|
357
|
+
type ContextType = 'http' | 'ws';
|
|
358
|
+
interface ExecutionContext {
|
|
359
|
+
getType<T extends string = ContextType>(): T;
|
|
360
|
+
getClass(): Type;
|
|
361
|
+
getHandler(): string | symbol;
|
|
362
|
+
/** Returns the Hono `Context` directly. Throws on a WebSocket context. */
|
|
363
|
+
getContext<T = Context>(): T;
|
|
364
|
+
/** Shorthand for `switchToHttp().getRequest()` — returns the Web `Request`. Throws on a WebSocket context. */
|
|
365
|
+
getRequest(): Request;
|
|
366
|
+
/** Switch to the HTTP arguments host. Throws on a WebSocket context. */
|
|
367
|
+
switchToHttp(): HttpArgumentsHost;
|
|
368
|
+
/** Switch to the WebSocket arguments host. Throws on an HTTP context. */
|
|
369
|
+
switchToWs(): WsArgumentsHost;
|
|
370
|
+
}
|
|
371
|
+
interface CanActivate {
|
|
372
|
+
canActivate(context: ExecutionContext): boolean | Promise<boolean>;
|
|
373
|
+
}
|
|
374
|
+
interface CallHandler {
|
|
375
|
+
handle(): Promise<unknown>;
|
|
376
|
+
}
|
|
377
|
+
interface NestInterceptor {
|
|
378
|
+
intercept(context: ExecutionContext, next: CallHandler): Promise<unknown>;
|
|
379
|
+
}
|
|
380
|
+
interface ArgumentMetadata {
|
|
381
|
+
type: string;
|
|
382
|
+
metatype?: Type;
|
|
383
|
+
data?: string;
|
|
384
|
+
}
|
|
385
|
+
interface PipeTransform<T = unknown, R = unknown> {
|
|
386
|
+
transform(value: T, metadata: ArgumentMetadata): R | Promise<R>;
|
|
387
|
+
}
|
|
388
|
+
interface ExceptionFilter<T = unknown> {
|
|
389
|
+
catch(exception: T, context: ExecutionContext): unknown | Promise<unknown>;
|
|
390
|
+
}
|
|
391
|
+
interface NestMiddleware {
|
|
392
|
+
use(c: import('hono').Context, next: import('hono').Next): Promise<Response | void>;
|
|
393
|
+
}
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region src/registry/types.d.ts
|
|
396
|
+
type ComponentType = 'middleware' | 'guard' | 'pipe' | 'interceptor' | 'filter';
|
|
397
|
+
type MiddlewareType = Type<NestMiddleware> | NestMiddleware;
|
|
398
|
+
type GuardType = Type<CanActivate> | CanActivate;
|
|
399
|
+
type PipeType = Type<PipeTransform> | PipeTransform;
|
|
400
|
+
type InterceptorType = Type<NestInterceptor> | NestInterceptor;
|
|
401
|
+
type FilterType = Type<ExceptionFilter> | ExceptionFilter;
|
|
402
|
+
interface ComponentTypeMap {
|
|
403
|
+
middleware: MiddlewareType;
|
|
404
|
+
guard: GuardType;
|
|
405
|
+
pipe: PipeType;
|
|
406
|
+
interceptor: InterceptorType;
|
|
407
|
+
filter: FilterType;
|
|
408
|
+
}
|
|
409
|
+
type ComponentInstance = MiddlewareType | GuardType | PipeType | InterceptorType | FilterType;
|
|
410
|
+
interface RouteDefinition {
|
|
411
|
+
method: string;
|
|
412
|
+
path: string;
|
|
413
|
+
handlerName: string | symbol;
|
|
414
|
+
version?: number | number[];
|
|
415
|
+
/** Route name for URL generation / OpenAPI operationId (`@Get(path, { name })`). */
|
|
416
|
+
name?: string;
|
|
417
|
+
}
|
|
418
|
+
interface ParameterMetadata {
|
|
419
|
+
index: number;
|
|
420
|
+
type: string;
|
|
421
|
+
name?: string;
|
|
422
|
+
pipes?: PipeType[];
|
|
423
|
+
factory?: (data: unknown, ctx: Context) => unknown;
|
|
424
|
+
/**
|
|
425
|
+
* Explicit param type for programmatic routes. Methods synthesized at
|
|
426
|
+
* runtime (e.g. `@Crud()` verb handlers) have no `design:paramtypes`, so
|
|
427
|
+
* ValidationPipe and the OpenAPI walk read this instead when present.
|
|
428
|
+
*/
|
|
429
|
+
metatype?: unknown;
|
|
430
|
+
}
|
|
431
|
+
interface HttpHandlerMeta {
|
|
432
|
+
httpCode?: number;
|
|
433
|
+
responseHeaders?: Array<[string, string]>;
|
|
434
|
+
redirect?: {
|
|
435
|
+
url: string;
|
|
436
|
+
statusCode: number;
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
type ModuleImport = Type | DynamicModule | ForwardRef;
|
|
440
|
+
/**
|
|
441
|
+
* Async module options with **type-inferred `useFactory` parameters**.
|
|
442
|
+
*
|
|
443
|
+
* The `Inject` generic captures the literal `inject` tuple via `const` type
|
|
444
|
+
* parameter inference at the call site (TS 5.0+ — vela already requires it).
|
|
445
|
+
* `useFactory`'s parameter types are computed from that tuple via
|
|
446
|
+
* `InferTokens<Inject>`, so:
|
|
447
|
+
*
|
|
448
|
+
* ```ts
|
|
449
|
+
* SomeModule.forRootAsync({
|
|
450
|
+
* inject: [D1Service, ConfigService], // captured as readonly [typeof D1Service, typeof ConfigService]
|
|
451
|
+
* useFactory: (d1, config) => { ... }, // d1: D1Service, config: ConfigService — inferred
|
|
452
|
+
* });
|
|
453
|
+
* ```
|
|
454
|
+
*
|
|
455
|
+
* Backwards compatible: when `inject` isn't a literal tuple (or is omitted),
|
|
456
|
+
* `Inject` falls back to `readonly Token<unknown>[]`, `InferTokens` resolves
|
|
457
|
+
* to `unknown[]`, and `useFactory` accepts variadic `unknown[]` — the prior
|
|
458
|
+
* loose-typing behavior. Existing callers don't break.
|
|
459
|
+
*/
|
|
460
|
+
interface AsyncModuleOptions<T = unknown, Inject extends readonly Token<unknown>[] = readonly Token<unknown>[]> {
|
|
461
|
+
imports?: ModuleImport[];
|
|
462
|
+
inject?: Inject;
|
|
463
|
+
useFactory: (...args: InferTokens<Inject>) => T | Promise<T>;
|
|
464
|
+
}
|
|
465
|
+
interface DynamicModule {
|
|
466
|
+
module: Type;
|
|
467
|
+
/**
|
|
468
|
+
* Author-supplied instance discriminator. Two DynamicModules with the same
|
|
469
|
+
* `module` class and the same `key` dedup; with different keys they coexist
|
|
470
|
+
* as separate module instances. Defaults to `"default"` when absent — which
|
|
471
|
+
* preserves single-instance dedup for the common case.
|
|
472
|
+
*
|
|
473
|
+
* For `forRoot(options)`, derive `key: stableHash(options)` so identical
|
|
474
|
+
* options dedup automatically. For `forRootAsync` (factories aren't
|
|
475
|
+
* structurally hashable), pass an explicit string.
|
|
476
|
+
*/
|
|
477
|
+
key?: string;
|
|
478
|
+
imports?: ModuleImport[];
|
|
479
|
+
providers?: Array<Type | ProviderOptions>;
|
|
480
|
+
controllers?: Type[];
|
|
481
|
+
exports?: Array<Type | InjectionToken>;
|
|
482
|
+
global?: boolean;
|
|
483
|
+
/**
|
|
484
|
+
* Defer this module instance's providers/controllers to first use: nothing
|
|
485
|
+
* constructs at bootstrap; the first resolution of any of its tokens
|
|
486
|
+
* materializes the whole group and replays its lifecycle hooks (memoized).
|
|
487
|
+
* See MODULE_AUTHORING.md "Lazy modules" for the contract.
|
|
488
|
+
*/
|
|
489
|
+
lazy?: boolean;
|
|
490
|
+
}
|
|
491
|
+
interface ModuleOptions {
|
|
492
|
+
providers?: Array<Type | ProviderOptions>;
|
|
493
|
+
controllers?: Type[];
|
|
494
|
+
imports?: ModuleImport[];
|
|
495
|
+
exports?: Array<Type | InjectionToken>;
|
|
496
|
+
isGlobal?: boolean;
|
|
497
|
+
/** Defer to first use (see {@link DynamicModule.lazy}). */
|
|
498
|
+
lazy?: boolean;
|
|
499
|
+
}
|
|
500
|
+
interface ModuleMetadata {
|
|
501
|
+
providers: Array<Type | ProviderOptions>;
|
|
502
|
+
controllers: Type[];
|
|
503
|
+
imports: ModuleImport[];
|
|
504
|
+
exports: Array<Type | InjectionToken>;
|
|
505
|
+
isGlobal: boolean;
|
|
506
|
+
lazy: boolean;
|
|
507
|
+
}
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region src/discovery/discoverable.decorator.d.ts
|
|
510
|
+
/**
|
|
511
|
+
* A decorator whose annotated classes/methods are findable through
|
|
512
|
+
* `DiscoveryService` by the decorator itself (no string key at the call site).
|
|
513
|
+
*/
|
|
514
|
+
interface DiscoverableDecorator<T> {
|
|
515
|
+
(value: T): ClassDecorator & MethodDecorator;
|
|
516
|
+
/** The metadata key backing this decorator — stable across HMR re-evals. */
|
|
517
|
+
KEY: string;
|
|
518
|
+
}
|
|
519
|
+
interface CreateDiscoverableDecoratorOptions {
|
|
520
|
+
/**
|
|
521
|
+
* Append to a class-level list instead of overwriting a single slot —
|
|
522
|
+
* for stackable method decorators (`@Cron`-style: each application pushes
|
|
523
|
+
* `{ methodName, ...value }` onto the class's list, which
|
|
524
|
+
* `DiscoveryService.methodsWithMeta` flattens back to per-method entries).
|
|
525
|
+
*/
|
|
526
|
+
append?: boolean;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Mint a discoverable decorator for a module's extension surface:
|
|
530
|
+
*
|
|
531
|
+
* ```ts
|
|
532
|
+
* export interface QueueConsumerMeta { queue: string }
|
|
533
|
+
* export const QueueConsumer = createDiscoverableDecorator<QueueConsumerMeta>('vela:queue:consumer');
|
|
534
|
+
*
|
|
535
|
+
* @QueueConsumer({ queue: 'emails' })
|
|
536
|
+
* @Injectable()
|
|
537
|
+
* class EmailConsumer { ... }
|
|
538
|
+
*
|
|
539
|
+
* // At bootstrap, anywhere:
|
|
540
|
+
* discovery.providersWithMeta(QueueConsumer) // typed { meta: QueueConsumerMeta }
|
|
541
|
+
* ```
|
|
542
|
+
*
|
|
543
|
+
* Unlike `Reflector.createDecorator`, the key is required and caller-chosen:
|
|
544
|
+
* a random key would mint a fresh identity on every HMR re-eval and orphan
|
|
545
|
+
* previously-decorated classes. Namespace it (`'<pkg>:<area>:<thing>'`).
|
|
546
|
+
*/
|
|
547
|
+
declare function createDiscoverableDecorator<T>(key: string, options?: CreateDiscoverableDecoratorOptions): DiscoverableDecorator<T>;
|
|
548
|
+
//#endregion
|
|
549
|
+
//#region src/discovery/discovery.service.d.ts
|
|
550
|
+
/** A container-registered class provider surfaced by discovery. */
|
|
551
|
+
interface DiscoveredClass<T = unknown> {
|
|
552
|
+
token: Token;
|
|
553
|
+
metatype: Type<T>;
|
|
554
|
+
/** Module buckets holding this token (registration order; first = primary). */
|
|
555
|
+
moduleIds: string[];
|
|
556
|
+
scope: Scope;
|
|
557
|
+
/**
|
|
558
|
+
* Resolved instance. `undefined` only when the provider is request-scoped
|
|
559
|
+
* and `includeRequestScoped` was not set — request-scoped providers cannot
|
|
560
|
+
* be materialized at bootstrap without fabricating a phantom request.
|
|
561
|
+
*/
|
|
562
|
+
instance: T | undefined;
|
|
563
|
+
}
|
|
564
|
+
interface DiscoveredMethodMeta<M = unknown> {
|
|
565
|
+
class: DiscoveredClass;
|
|
566
|
+
methodName: string | symbol;
|
|
567
|
+
meta: M;
|
|
568
|
+
}
|
|
569
|
+
interface DiscoveryFilter {
|
|
570
|
+
/** Restrict to providers declared by these module buckets. */
|
|
571
|
+
moduleId?: string | string[];
|
|
572
|
+
/**
|
|
573
|
+
* Resolve request-scoped providers too (constructs an instance outside any
|
|
574
|
+
* request — only for callers that know what they're doing). Default false:
|
|
575
|
+
* request-scoped hits are skipped with a diagnostics warning.
|
|
576
|
+
*/
|
|
577
|
+
includeRequestScoped?: boolean;
|
|
578
|
+
/**
|
|
579
|
+
* Return providers of not-yet-materialized lazy modules as metadata-only
|
|
580
|
+
* entries (`instance: undefined`, mirroring the request-scoped convention)
|
|
581
|
+
* instead of resolving them — which would force the whole module group.
|
|
582
|
+
* Used by `EntrypointRegistry.build`; default false so every existing
|
|
583
|
+
* scanner keeps its transparent cascade-materialization semantics.
|
|
584
|
+
*/
|
|
585
|
+
deferLazy?: boolean;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Decorator-driven provider discovery — the public replacement for the
|
|
589
|
+
* bootstrap scan every subsystem used to hand-roll (`container.getTokens()` +
|
|
590
|
+
* `MetadataRegistry.getCustomClassMeta` + `resolve` + diagnostics handling).
|
|
591
|
+
*
|
|
592
|
+
* Registered globally by `bootstrap()`, so any provider can inject it:
|
|
593
|
+
*
|
|
594
|
+
* ```ts
|
|
595
|
+
* @Injectable()
|
|
596
|
+
* class MyRegistry implements OnApplicationBootstrap {
|
|
597
|
+
* constructor(private readonly discovery: DiscoveryService) {}
|
|
598
|
+
* onApplicationBootstrap() {
|
|
599
|
+
* for (const { instance, meta } of this.discovery.providersWithMeta<MyMeta>(MY_KEY)) {
|
|
600
|
+
* this.register(instance, meta);
|
|
601
|
+
* }
|
|
602
|
+
* }
|
|
603
|
+
* }
|
|
604
|
+
* ```
|
|
605
|
+
*
|
|
606
|
+
* Discovery is kernel-level, not encapsulation-scoped: module visibility
|
|
607
|
+
* protects modules from *each other*, never from the framework's own
|
|
608
|
+
* dispatchers. Use `DiscoveryFilter.moduleId` for the rare narrowing case.
|
|
609
|
+
*
|
|
610
|
+
* The resolve-failure policy honors the container's diagnostics mode exactly
|
|
611
|
+
* like the legacy loops: `throw` rethrows, `log` warns and skips, `silent`
|
|
612
|
+
* skips — so a broken provider never silently changes discovery semantics.
|
|
613
|
+
*/
|
|
614
|
+
declare class DiscoveryService {
|
|
615
|
+
private readonly container;
|
|
616
|
+
constructor(container: Container);
|
|
617
|
+
/** Every class-token provider registered in the container. */
|
|
618
|
+
getProviders(filter?: DiscoveryFilter): DiscoveredClass[];
|
|
619
|
+
/**
|
|
620
|
+
* Providers whose class carries class-level metadata under `key` — both
|
|
621
|
+
* class decorators (single value) and method decorators that append
|
|
622
|
+
* class-level lists (`@Cron`, `@OnEvent`, `@SubscribeMessage`).
|
|
623
|
+
*/
|
|
624
|
+
providersWithMeta<M>(key: string | DiscoverableDecorator<M>, filter?: DiscoveryFilter): Array<DiscoveredClass & {
|
|
625
|
+
meta: M;
|
|
626
|
+
}>;
|
|
627
|
+
/**
|
|
628
|
+
* Handler methods carrying metadata under `key`. Merges the two storage
|
|
629
|
+
* conventions:
|
|
630
|
+
* - class-level appended lists whose items carry `methodName`
|
|
631
|
+
* (`@Cron`/`@OnEvent`-style method decorators), and
|
|
632
|
+
* - true handler-level metadata (`@SetMetadata`/`createDiscoverableDecorator`
|
|
633
|
+
* applied to a method).
|
|
634
|
+
*/
|
|
635
|
+
methodsWithMeta<M>(key: string | DiscoverableDecorator<M>, filter?: DiscoveryFilter): DiscoveredMethodMeta<M>[];
|
|
636
|
+
/**
|
|
637
|
+
* Index-first candidate walk with a legacy full-scan fallback: when the
|
|
638
|
+
* reverse index knows nothing about a key, an older copy of the registry
|
|
639
|
+
* module may have taken the writes (mixed dist/src or package versions in
|
|
640
|
+
* one process) — fall back to scanning container tokens the way the
|
|
641
|
+
* pre-DiscoveryService loops did.
|
|
642
|
+
*/
|
|
643
|
+
private candidatesWithClassMeta;
|
|
644
|
+
private buildEntry;
|
|
645
|
+
}
|
|
646
|
+
//#endregion
|
|
647
|
+
export { forwardRef as $, NestInterceptor as A, InferTokens as B, RouteDefinition as C, ExceptionFilter as D, CanActivate as E, Constructor as F, ModuleScope as G, InjectableOptions as H, ContainerOptions as I, ProviderOptions as J, ModuleVisibilityError as K, Diagnostics as L, PipeTransform as M, WsArgumentsHost as N, ExecutionContext as O, Container as P, describeToken as Q, ForwardRef as R, PipeType as S, CallHandler as T, InjectionToken as U, InjectMetadata as V, ModuleDescription as W, Token as X, ROOT_MODULE_ID as Y, Type as Z, MiddlewareType as _, CreateDiscoverableDecoratorOptions as a, ModuleOptions as b, AsyncModuleOptions as c, ComponentTypeMap as d, HttpMethod as et, DynamicModule as f, InterceptorType as g, HttpHandlerMeta as h, DiscoveryService as i, NestMiddleware as j, HttpArgumentsHost as k, ComponentInstance as l, GuardType as m, DiscoveredMethodMeta as n, ParamType as nt, DiscoverableDecorator as o, FilterType as p, MultipleProvidersFoundError as q, DiscoveryFilter as r, Scope as rt, createDiscoverableDecorator as s, DiscoveredClass as t, METADATA_KEYS as tt, ComponentType as u, ModuleImport as v, ArgumentMetadata as w, ParameterMetadata as x, ModuleMetadata as y, InferToken as z };
|
|
648
|
+
//# sourceMappingURL=discovery.service-Cpf1QcZ5.d.ts.map
|