@velajs/vela 1.19.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -14
- package/dist/configurable-module.builder-5FGMaXG6.js +91 -0
- package/dist/configurable-module.builder-5FGMaXG6.js.map +1 -0
- package/dist/container-BqUHID4l.js +645 -0
- package/dist/container-BqUHID4l.js.map +1 -0
- package/dist/cron-matcher-C9qv5OUA.js +113 -0
- package/dist/cron-matcher-C9qv5OUA.js.map +1 -0
- package/dist/decorate-GcSMAbKn.js +528 -0
- package/dist/decorate-GcSMAbKn.js.map +1 -0
- package/dist/decorators-C8YBFCIk.js +53 -0
- package/dist/decorators-C8YBFCIk.js.map +1 -0
- package/dist/define-module-NOyOZNXD.js +235 -0
- package/dist/define-module-NOyOZNXD.js.map +1 -0
- package/dist/discovery.service-BYm95SSD.js +368 -0
- package/dist/discovery.service-BYm95SSD.js.map +1 -0
- package/dist/discovery.service-Cpf1QcZ5.d.ts +648 -0
- package/dist/i18n/index.d.ts +138 -10
- package/dist/i18n/index.js +270 -8
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-D72EQfcC.d.ts +430 -0
- package/dist/index-DhShDLCM.d.ts +2310 -0
- package/dist/index.d.ts +6 -70
- package/dist/index.js +14 -76
- package/dist/internal.d.ts +13 -17
- package/dist/internal.js +6 -19
- package/dist/live/index.d.ts +2 -12
- package/dist/live/index.js +826 -16
- package/dist/live/index.js.map +1 -0
- package/dist/metadata.registry-D1od8ZBt.d.ts +842 -0
- package/dist/plugin-ByBlVOve.js +1387 -0
- package/dist/plugin-ByBlVOve.js.map +1 -0
- package/dist/queue/index.d.ts +247 -10
- package/dist/queue/index.js +384 -12
- package/dist/queue/index.js.map +1 -0
- package/dist/request-context-C3nCGJNd.js +26 -0
- package/dist/request-context-C3nCGJNd.js.map +1 -0
- package/dist/route.manager-DRAZ5X04.js +991 -0
- package/dist/route.manager-DRAZ5X04.js.map +1 -0
- package/dist/schedule-node/index.d.ts +32 -3
- package/dist/schedule-node/index.js +97 -3
- package/dist/schedule-node/index.js.map +1 -0
- package/dist/schedule.registry-DVm7Jp5w.d.ts +55 -0
- package/dist/seeder/index.d.ts +75 -5
- package/dist/seeder/index.js +105 -4
- package/dist/seeder/index.js.map +1 -0
- package/dist/signed-url-CMmi0SIb.js +56 -0
- package/dist/signed-url-CMmi0SIb.js.map +1 -0
- package/dist/signed-url-DKhgja4U.d.ts +16 -0
- package/dist/src-eb5CI6Xn.js +2151 -0
- package/dist/src-eb5CI6Xn.js.map +1 -0
- package/dist/storage/index.d.ts +57 -4
- package/dist/storage/index.js +22 -5
- package/dist/storage/index.js.map +1 -0
- package/dist/streaming/index.d.ts +2 -2
- package/dist/streaming/index.js +2 -1
- package/dist/websocket/index.d.ts +3 -12
- package/dist/websocket/index.js +2 -16
- package/dist/websocket-DXmB-MWJ.js +697 -0
- package/dist/websocket-DXmB-MWJ.js.map +1 -0
- package/dist/websocket-node/index.d.ts +108 -6
- package/dist/websocket-node/index.js +228 -6
- package/dist/websocket-node/index.js.map +1 -0
- package/package.json +66 -53
- package/dist/__tests__/workers/entry.d.ts +0 -9
- package/dist/__tests__/workers-als/entry-als.d.ts +0 -9
- package/dist/application.d.ts +0 -104
- package/dist/application.js +0 -364
- package/dist/cache/cache.decorators.d.ts +0 -2
- package/dist/cache/cache.decorators.js +0 -4
- package/dist/cache/cache.interceptor.d.ts +0 -9
- package/dist/cache/cache.interceptor.js +0 -60
- package/dist/cache/cache.module.d.ts +0 -7
- package/dist/cache/cache.module.js +0 -58
- package/dist/cache/cache.service.d.ts +0 -9
- package/dist/cache/cache.service.js +0 -42
- package/dist/cache/cache.store.d.ts +0 -12
- package/dist/cache/cache.store.js +0 -51
- package/dist/cache/cache.tokens.d.ts +0 -6
- package/dist/cache/cache.tokens.js +0 -5
- package/dist/cache/cache.types.d.ts +0 -41
- package/dist/cache/cache.types.js +0 -1
- package/dist/cache/index.d.ts +0 -8
- package/dist/cache/index.js +0 -7
- package/dist/cache/tiered-cache.store.d.ts +0 -19
- package/dist/cache/tiered-cache.store.js +0 -40
- package/dist/config/config.module.d.ts +0 -19
- package/dist/config/config.module.js +0 -98
- package/dist/config/config.service.d.ts +0 -20
- package/dist/config/config.service.js +0 -43
- package/dist/config/config.store.d.ts +0 -46
- package/dist/config/config.store.js +0 -119
- package/dist/config/config.tokens.d.ts +0 -13
- package/dist/config/config.tokens.js +0 -14
- package/dist/config/config.types.d.ts +0 -41
- package/dist/config/config.types.js +0 -4
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -5
- package/dist/config/register-as.d.ts +0 -52
- package/dist/config/register-as.js +0 -39
- package/dist/constants.d.ts +0 -44
- package/dist/constants.js +0 -46
- package/dist/container/container.d.ts +0 -154
- package/dist/container/container.js +0 -849
- package/dist/container/decorators.d.ts +0 -17
- package/dist/container/decorators.js +0 -57
- package/dist/container/disposable.d.ts +0 -5
- package/dist/container/disposable.js +0 -33
- package/dist/container/index.d.ts +0 -6
- package/dist/container/index.js +0 -5
- package/dist/container/mixin.d.ts +0 -24
- package/dist/container/mixin.js +0 -26
- package/dist/container/module-ref.d.ts +0 -21
- package/dist/container/module-ref.js +0 -48
- package/dist/container/types.d.ts +0 -154
- package/dist/container/types.js +0 -49
- package/dist/cors/cors.module.d.ts +0 -7
- package/dist/cors/cors.module.js +0 -37
- package/dist/cors/cors.tokens.d.ts +0 -3
- package/dist/cors/cors.tokens.js +0 -2
- package/dist/cors/cors.types.d.ts +0 -8
- package/dist/cors/cors.types.js +0 -1
- package/dist/cors/index.d.ts +0 -3
- package/dist/cors/index.js +0 -2
- package/dist/crypto/signed-url.d.ts +0 -12
- package/dist/crypto/signed-url.js +0 -60
- package/dist/discovery/discoverable.decorator.d.ts +0 -38
- package/dist/discovery/discoverable.decorator.js +0 -42
- package/dist/discovery/discovery.service.d.ts +0 -102
- package/dist/discovery/discovery.service.js +0 -177
- package/dist/discovery/index.d.ts +0 -2
- package/dist/discovery/index.js +0 -2
- package/dist/entrypoint/entrypoint.registry.d.ts +0 -42
- package/dist/entrypoint/entrypoint.registry.js +0 -112
- package/dist/entrypoint/entrypoint.types.d.ts +0 -41
- package/dist/entrypoint/entrypoint.types.js +0 -3
- package/dist/entrypoint/execution-context.d.ts +0 -15
- package/dist/entrypoint/execution-context.js +0 -21
- package/dist/entrypoint/execution-scope.d.ts +0 -21
- package/dist/entrypoint/execution-scope.js +0 -28
- package/dist/entrypoint/index.d.ts +0 -4
- package/dist/entrypoint/index.js +0 -4
- package/dist/errors/http-exception.d.ts +0 -63
- package/dist/errors/http-exception.js +0 -142
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/event-emitter/event-emitter.decorators.d.ts +0 -1
- package/dist/event-emitter/event-emitter.decorators.js +0 -10
- package/dist/event-emitter/event-emitter.module.d.ts +0 -2
- package/dist/event-emitter/event-emitter.module.js +0 -23
- package/dist/event-emitter/event-emitter.service.d.ts +0 -13
- package/dist/event-emitter/event-emitter.service.js +0 -127
- package/dist/event-emitter/event-emitter.subscriber.d.ts +0 -9
- package/dist/event-emitter/event-emitter.subscriber.js +0 -45
- package/dist/event-emitter/event-emitter.tokens.d.ts +0 -1
- package/dist/event-emitter/event-emitter.tokens.js +0 -1
- package/dist/event-emitter/event-emitter.types.d.ts +0 -5
- package/dist/event-emitter/event-emitter.types.js +0 -1
- package/dist/event-emitter/index.d.ts +0 -6
- package/dist/event-emitter/index.js +0 -5
- package/dist/exceptions/errors.module.d.ts +0 -40
- package/dist/exceptions/errors.module.js +0 -46
- package/dist/exceptions/exception-handler.d.ts +0 -56
- package/dist/exceptions/exception-handler.js +0 -17
- package/dist/exceptions/index.d.ts +0 -6
- package/dist/exceptions/index.js +0 -3
- package/dist/exceptions/reporter.d.ts +0 -21
- package/dist/exceptions/reporter.js +0 -70
- package/dist/factory/adapter.d.ts +0 -36
- package/dist/factory/adapter.js +0 -18
- package/dist/factory/bootstrap.d.ts +0 -23
- package/dist/factory/bootstrap.js +0 -110
- package/dist/factory.d.ts +0 -16
- package/dist/factory.js +0 -36
- package/dist/fetch/fetch.module.d.ts +0 -7
- package/dist/fetch/fetch.module.js +0 -31
- package/dist/fetch/fetch.service.d.ts +0 -24
- package/dist/fetch/fetch.service.js +0 -145
- package/dist/fetch/fetch.types.d.ts +0 -24
- package/dist/fetch/fetch.types.js +0 -1
- package/dist/fetch/index.d.ts +0 -3
- package/dist/fetch/index.js +0 -2
- package/dist/health/health.http.d.ts +0 -14
- package/dist/health/health.http.js +0 -75
- package/dist/health/health.indicator.d.ts +0 -9
- package/dist/health/health.indicator.js +0 -32
- package/dist/health/health.module.d.ts +0 -2
- package/dist/health/health.module.js +0 -26
- package/dist/health/health.service.d.ts +0 -7
- package/dist/health/health.service.js +0 -69
- package/dist/health/health.types.d.ts +0 -15
- package/dist/health/health.types.js +0 -1
- package/dist/health/index.d.ts +0 -6
- package/dist/health/index.js +0 -4
- package/dist/http/ambient.d.ts +0 -17
- package/dist/http/ambient.js +0 -44
- package/dist/http/argument-resolver.d.ts +0 -10
- package/dist/http/argument-resolver.js +0 -89
- package/dist/http/decorators.d.ts +0 -198
- package/dist/http/decorators.js +0 -321
- package/dist/http/execution-context.d.ts +0 -8
- package/dist/http/execution-context.js +0 -35
- package/dist/http/handler-executor.d.ts +0 -20
- package/dist/http/handler-executor.js +0 -133
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.js +0 -7
- package/dist/http/instantiate.d.ts +0 -4
- package/dist/http/instantiate.js +0 -45
- package/dist/http/lazy-param.decorator.d.ts +0 -37
- package/dist/http/lazy-param.decorator.js +0 -117
- package/dist/http/request-container.d.ts +0 -16
- package/dist/http/request-container.js +0 -19
- package/dist/http/request-context.d.ts +0 -13
- package/dist/http/request-context.js +0 -22
- package/dist/http/response-mapper.d.ts +0 -8
- package/dist/http/response-mapper.js +0 -42
- package/dist/http/route-contributor.d.ts +0 -68
- package/dist/http/route-contributor.js +0 -22
- package/dist/http/route-map.d.ts +0 -30
- package/dist/http/route-map.js +0 -27
- package/dist/http/route.manager.d.ts +0 -92
- package/dist/http/route.manager.js +0 -481
- package/dist/http/types.d.ts +0 -37
- package/dist/http/types.js +0 -1
- package/dist/http/url/index.d.ts +0 -4
- package/dist/http/url/index.js +0 -3
- package/dist/http/url/signed-url.guard.d.ts +0 -27
- package/dist/http/url/signed-url.guard.js +0 -62
- package/dist/http/url/signing-secret.d.ts +0 -20
- package/dist/http/url/signing-secret.js +0 -24
- package/dist/http/url/url-generator.service.d.ts +0 -52
- package/dist/http/url/url-generator.service.js +0 -104
- package/dist/i18n/deep-merge.d.ts +0 -2
- package/dist/i18n/deep-merge.js +0 -15
- package/dist/i18n/i18n.middleware.d.ts +0 -15
- package/dist/i18n/i18n.middleware.js +0 -94
- package/dist/i18n/i18n.module.d.ts +0 -13
- package/dist/i18n/i18n.module.js +0 -69
- package/dist/i18n/i18n.options.d.ts +0 -30
- package/dist/i18n/i18n.options.js +0 -16
- package/dist/i18n/i18n.service.d.ts +0 -20
- package/dist/i18n/i18n.service.js +0 -49
- package/dist/i18n/i18n.tokens.d.ts +0 -6
- package/dist/i18n/i18n.tokens.js +0 -3
- package/dist/i18n/i18n.types.d.ts +0 -6
- package/dist/i18n/i18n.types.js +0 -1
- package/dist/i18n/message-loader.service.d.ts +0 -21
- package/dist/i18n/message-loader.service.js +0 -90
- package/dist/i18n/message-registry.d.ts +0 -16
- package/dist/i18n/message-registry.js +0 -49
- package/dist/lifecycle/index.d.ts +0 -20
- package/dist/lifecycle/index.js +0 -15
- package/dist/live/live.cursor.d.ts +0 -22
- package/dist/live/live.cursor.js +0 -56
- package/dist/live/live.decorators.d.ts +0 -32
- package/dist/live/live.decorators.js +0 -46
- package/dist/live/live.delta.d.ts +0 -15
- package/dist/live/live.delta.js +0 -51
- package/dist/live/live.engine.d.ts +0 -88
- package/dist/live/live.engine.js +0 -471
- package/dist/live/live.invalidation.d.ts +0 -45
- package/dist/live/live.invalidation.js +0 -99
- package/dist/live/live.module.d.ts +0 -28
- package/dist/live/live.module.js +0 -87
- package/dist/live/live.tokens.d.ts +0 -9
- package/dist/live/live.tokens.js +0 -8
- package/dist/live/live.types.d.ts +0 -138
- package/dist/live/live.types.js +0 -1
- package/dist/live/presence.d.ts +0 -44
- package/dist/live/presence.js +0 -130
- package/dist/metadata.d.ts +0 -10
- package/dist/metadata.js +0 -20
- package/dist/module/configurable-module.builder.d.ts +0 -56
- package/dist/module/configurable-module.builder.js +0 -84
- package/dist/module/configurable-module.types.d.ts +0 -93
- package/dist/module/configurable-module.types.js +0 -5
- package/dist/module/decorators.d.ts +0 -10
- package/dist/module/decorators.js +0 -47
- package/dist/module/define-module.d.ts +0 -112
- package/dist/module/define-module.js +0 -232
- package/dist/module/graph.d.ts +0 -10
- package/dist/module/graph.js +0 -35
- package/dist/module/index.d.ts +0 -10
- package/dist/module/index.js +0 -7
- package/dist/module/lazy-modules.d.ts +0 -82
- package/dist/module/lazy-modules.js +0 -231
- package/dist/module/lazy-provider.d.ts +0 -65
- package/dist/module/lazy-provider.js +0 -111
- package/dist/module/middleware.d.ts +0 -30
- package/dist/module/middleware.js +0 -67
- package/dist/module/module-loader.d.ts +0 -58
- package/dist/module/module-loader.js +0 -484
- package/dist/module/stable-hash.d.ts +0 -15
- package/dist/module/stable-hash.js +0 -52
- package/dist/module/types.d.ts +0 -1
- package/dist/module/types.js +0 -1
- package/dist/openapi/decorators.d.ts +0 -34
- package/dist/openapi/decorators.js +0 -66
- package/dist/openapi/document.d.ts +0 -3
- package/dist/openapi/document.js +0 -316
- package/dist/openapi/index.d.ts +0 -7
- package/dist/openapi/index.js +0 -6
- package/dist/openapi/redoc-ui.d.ts +0 -1
- package/dist/openapi/redoc-ui.js +0 -19
- package/dist/openapi/scalar-ui.d.ts +0 -1
- package/dist/openapi/scalar-ui.js +0 -19
- package/dist/openapi/swagger-ui.d.ts +0 -1
- package/dist/openapi/swagger-ui.js +0 -23
- package/dist/openapi/types.d.ts +0 -182
- package/dist/openapi/types.js +0 -4
- package/dist/openapi/zod-to-json-schema.d.ts +0 -4
- package/dist/openapi/zod-to-json-schema.js +0 -57
- package/dist/pipeline/app-providers.d.ts +0 -10
- package/dist/pipeline/app-providers.js +0 -43
- package/dist/pipeline/component.manager.d.ts +0 -25
- package/dist/pipeline/component.manager.js +0 -66
- package/dist/pipeline/decorators.d.ts +0 -10
- package/dist/pipeline/decorators.js +0 -42
- package/dist/pipeline/index.d.ts +0 -12
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/pipeline-runner.d.ts +0 -31
- package/dist/pipeline/pipeline-runner.js +0 -40
- package/dist/pipeline/pipes.d.ts +0 -48
- package/dist/pipeline/pipes.js +0 -104
- package/dist/pipeline/reflector.d.ts +0 -86
- package/dist/pipeline/reflector.js +0 -121
- package/dist/pipeline/scoped-components.d.ts +0 -26
- package/dist/pipeline/scoped-components.js +0 -27
- package/dist/pipeline/tokens.d.ts +0 -57
- package/dist/pipeline/tokens.js +0 -47
- package/dist/pipeline/types.d.ts +0 -64
- package/dist/pipeline/types.js +0 -1
- package/dist/plugin/plugin.d.ts +0 -31
- package/dist/plugin/plugin.js +0 -111
- package/dist/queue/inline.driver.d.ts +0 -30
- package/dist/queue/inline.driver.js +0 -58
- package/dist/queue/queue.binding.d.ts +0 -23
- package/dist/queue/queue.binding.js +0 -60
- package/dist/queue/queue.client.d.ts +0 -20
- package/dist/queue/queue.client.js +0 -33
- package/dist/queue/queue.decorators.d.ts +0 -23
- package/dist/queue/queue.decorators.js +0 -46
- package/dist/queue/queue.dispatch.d.ts +0 -36
- package/dist/queue/queue.dispatch.js +0 -109
- package/dist/queue/queue.module.d.ts +0 -32
- package/dist/queue/queue.module.js +0 -80
- package/dist/queue/queue.tokens.d.ts +0 -21
- package/dist/queue/queue.tokens.js +0 -34
- package/dist/queue/queue.types.d.ts +0 -61
- package/dist/queue/queue.types.js +0 -4
- package/dist/registry/index.d.ts +0 -2
- package/dist/registry/index.js +0 -1
- package/dist/registry/metadata.registry.d.ts +0 -73
- package/dist/registry/metadata.registry.js +0 -357
- package/dist/registry/paths.d.ts +0 -3
- package/dist/registry/paths.js +0 -15
- package/dist/registry/types.d.ts +0 -116
- package/dist/registry/types.js +0 -1
- package/dist/registry/util.d.ts +0 -3
- package/dist/registry/util.js +0 -8
- package/dist/schedule/cron-matcher.d.ts +0 -2
- package/dist/schedule/cron-matcher.js +0 -62
- package/dist/schedule/index.d.ts +0 -8
- package/dist/schedule/index.js +0 -5
- package/dist/schedule/schedule.decorators.d.ts +0 -2
- package/dist/schedule/schedule.decorators.js +0 -18
- package/dist/schedule/schedule.module.d.ts +0 -9
- package/dist/schedule/schedule.module.js +0 -28
- package/dist/schedule/schedule.registry.d.ts +0 -23
- package/dist/schedule/schedule.registry.js +0 -63
- package/dist/schedule/schedule.tokens.d.ts +0 -2
- package/dist/schedule/schedule.tokens.js +0 -2
- package/dist/schedule/schedule.types.d.ts +0 -8
- package/dist/schedule/schedule.types.js +0 -1
- package/dist/schedule-node/schedule-node.module.d.ts +0 -9
- package/dist/schedule-node/schedule-node.module.js +0 -28
- package/dist/schedule-node/schedule.executor.d.ts +0 -19
- package/dist/schedule-node/schedule.executor.js +0 -112
- package/dist/seeder/seeder.decorator.d.ts +0 -7
- package/dist/seeder/seeder.decorator.js +0 -15
- package/dist/seeder/seeder.module.d.ts +0 -16
- package/dist/seeder/seeder.module.js +0 -44
- package/dist/seeder/seeder.registry.d.ts +0 -23
- package/dist/seeder/seeder.registry.js +0 -83
- package/dist/seeder/seeder.tokens.d.ts +0 -2
- package/dist/seeder/seeder.tokens.js +0 -1
- package/dist/seeder/seeder.types.d.ts +0 -20
- package/dist/seeder/seeder.types.js +0 -1
- package/dist/serialization/index.d.ts +0 -2
- package/dist/serialization/index.js +0 -2
- package/dist/serialization/serialize.decorator.d.ts +0 -6
- package/dist/serialization/serialize.decorator.js +0 -7
- package/dist/serialization/serializer.interceptor.d.ts +0 -4
- package/dist/serialization/serializer.interceptor.js +0 -16
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -1
- package/dist/services/logger.d.ts +0 -59
- package/dist/services/logger.js +0 -159
- package/dist/storage/path-template.d.ts +0 -9
- package/dist/storage/path-template.js +0 -20
- package/dist/storage/storage.types.d.ts +0 -41
- package/dist/storage/storage.types.js +0 -5
- package/dist/throttler/index.d.ts +0 -6
- package/dist/throttler/index.js +0 -5
- package/dist/throttler/throttler.decorators.d.ts +0 -3
- package/dist/throttler/throttler.decorators.js +0 -4
- package/dist/throttler/throttler.guard.d.ts +0 -9
- package/dist/throttler/throttler.guard.js +0 -72
- package/dist/throttler/throttler.module.d.ts +0 -7
- package/dist/throttler/throttler.module.js +0 -41
- package/dist/throttler/throttler.storage.d.ts +0 -10
- package/dist/throttler/throttler.storage.js +0 -44
- package/dist/throttler/throttler.tokens.d.ts +0 -6
- package/dist/throttler/throttler.tokens.js +0 -5
- package/dist/throttler/throttler.types.d.ts +0 -25
- package/dist/throttler/throttler.types.js +0 -1
- package/dist/validation/create-zod-dto.d.ts +0 -13
- package/dist/validation/create-zod-dto.js +0 -18
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -2
- package/dist/validation/validation.pipe.d.ts +0 -4
- package/dist/validation/validation.pipe.js +0 -19
- package/dist/websocket/websocket.decorators.d.ts +0 -47
- package/dist/websocket/websocket.decorators.js +0 -80
- package/dist/websocket/websocket.module.d.ts +0 -35
- package/dist/websocket/websocket.module.js +0 -63
- package/dist/websocket/websocket.tokens.d.ts +0 -30
- package/dist/websocket/websocket.tokens.js +0 -27
- package/dist/websocket/websocket.types.d.ts +0 -102
- package/dist/websocket/websocket.types.js +0 -4
- package/dist/websocket/ws-argument-resolver.d.ts +0 -13
- package/dist/websocket/ws-argument-resolver.js +0 -40
- package/dist/websocket/ws-dispatcher.d.ts +0 -54
- package/dist/websocket/ws-dispatcher.js +0 -343
- package/dist/websocket/ws-exception.d.ts +0 -25
- package/dist/websocket/ws-exception.js +0 -42
- package/dist/websocket/ws-execution-context.d.ts +0 -9
- package/dist/websocket/ws-execution-context.js +0 -24
- package/dist/websocket/ws-server.d.ts +0 -31
- package/dist/websocket/ws-server.js +0 -74
- package/dist/websocket/ws-sync.d.ts +0 -47
- package/dist/websocket/ws-sync.js +0 -74
- package/dist/websocket-node/node-ws-client.d.ts +0 -24
- package/dist/websocket-node/node-ws-client.js +0 -49
- package/dist/websocket-node/redis-live.d.ts +0 -24
- package/dist/websocket-node/redis-live.js +0 -57
- package/dist/websocket-node/redis-sync.d.ts +0 -33
- package/dist/websocket-node/redis-sync.js +0 -56
- package/dist/websocket-node/register-gateways.d.ts +0 -20
- package/dist/websocket-node/register-gateways.js +0 -61
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { MetadataRegistry } from "../registry/metadata.registry.js";
|
|
2
|
-
import { buildExecutionContext } from "./execution-context.js";
|
|
3
|
-
const CUSTOM_PARAM_TYPE = 'custom';
|
|
4
|
-
/**
|
|
5
|
-
* Factory for parameter decorators whose value materializes lazily — the
|
|
6
|
-
* factory does not run during argument extraction; it runs the first time
|
|
7
|
-
* the handler reads a property on the resolved value.
|
|
8
|
-
*
|
|
9
|
-
* Why this exists: vela's argument resolver runs *before* guards
|
|
10
|
-
* (handler-executor order: extract args → guards → handler). A custom
|
|
11
|
-
* `createParamDecorator` factory that depends on guard-populated state
|
|
12
|
-
* (e.g. a value a guard places into `REQUEST_CONTEXT`) therefore observes
|
|
13
|
-
* an empty slot. `createLazyParamDecorator` defers factory execution to
|
|
14
|
-
* first property access on the proxied result, by which point guards have
|
|
15
|
-
* run and the slot is populated.
|
|
16
|
-
*
|
|
17
|
-
* The proxy explicitly short-circuits `prop === 'then'` so `await value`
|
|
18
|
-
* does not consider the proxy a thenable, which would otherwise trigger
|
|
19
|
-
* eager resolution. This single invariant is what makes the helper safe to
|
|
20
|
-
* pass through `async` boundaries without surprise.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const CurrentUser = createLazyParamDecorator(
|
|
25
|
-
* (_data: unknown, ctx: ExecutionContext) => {
|
|
26
|
-
* const reqCtx = ctx.getContext().get('container').resolve(REQUEST_CONTEXT);
|
|
27
|
-
* return reqCtx.get('user'); // populated by AuthGuard
|
|
28
|
-
* },
|
|
29
|
-
* );
|
|
30
|
-
*
|
|
31
|
-
* @UseGuards(AuthGuard)
|
|
32
|
-
* @Get('/me')
|
|
33
|
-
* me(@CurrentUser() user: User) {
|
|
34
|
-
* return { id: user.id }; // factory runs here, after AuthGuard
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/ export function createLazyParamDecorator(factory) {
|
|
38
|
-
return (data, ...pipes)=>{
|
|
39
|
-
return (target, propertyKey, parameterIndex)=>{
|
|
40
|
-
if (propertyKey === undefined) {
|
|
41
|
-
throw new Error('Parameter decorators can only be used on method parameters');
|
|
42
|
-
}
|
|
43
|
-
MetadataRegistry.addParameter(target.constructor, propertyKey, {
|
|
44
|
-
index: parameterIndex,
|
|
45
|
-
type: CUSTOM_PARAM_TYPE,
|
|
46
|
-
name: undefined,
|
|
47
|
-
factory: (_unused, ctx)=>{
|
|
48
|
-
const honoCtx = ctx;
|
|
49
|
-
const execCtx = buildExecutionContext(honoCtx, target.constructor, propertyKey);
|
|
50
|
-
return createLazyProxy(()=>factory(data, execCtx));
|
|
51
|
-
},
|
|
52
|
-
...pipes.length > 0 ? {
|
|
53
|
-
pipes
|
|
54
|
-
} : {}
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
// Single-shot resolution: the factory runs at most once; subsequent reads
|
|
60
|
-
// share the cached real value. The proxy's traps all funnel through
|
|
61
|
-
// `materialize` to keep that invariant in one place.
|
|
62
|
-
function createLazyProxy(produce) {
|
|
63
|
-
let resolved = false;
|
|
64
|
-
let value;
|
|
65
|
-
const materialize = ()=>{
|
|
66
|
-
if (!resolved) {
|
|
67
|
-
value = produce();
|
|
68
|
-
resolved = true;
|
|
69
|
-
}
|
|
70
|
-
return value;
|
|
71
|
-
};
|
|
72
|
-
// Target is an empty null-prototype object — proxies still need a
|
|
73
|
-
// backing target for the runtime to forward to, but using a real object
|
|
74
|
-
// would leak its own properties (`hasOwnProperty`, etc.) into trap
|
|
75
|
-
// results. `Object.create(null)` keeps the namespace clean.
|
|
76
|
-
const target = Object.create(null);
|
|
77
|
-
const handler = {
|
|
78
|
-
get (_t, prop, receiver) {
|
|
79
|
-
// Critical: do NOT report the proxy as thenable. If we let the JS
|
|
80
|
-
// runtime read `then` (during `await proxy`), the engine would
|
|
81
|
-
// observe a function-shaped value, treat the proxy as a promise,
|
|
82
|
-
// call `then(resolve, reject)` and trigger eager resolution before
|
|
83
|
-
// the consumer ever touches a real property. Returning `undefined`
|
|
84
|
-
// here makes `await proxy` return the proxy itself, untouched.
|
|
85
|
-
if (prop === 'then') return undefined;
|
|
86
|
-
const real = materialize();
|
|
87
|
-
if (real === null || real === undefined) return undefined;
|
|
88
|
-
const descriptor = Reflect.get(real, prop, receiver);
|
|
89
|
-
// Bind functions back to the real target so `this` works as the
|
|
90
|
-
// consumer expects on instance methods.
|
|
91
|
-
if (typeof descriptor === 'function') {
|
|
92
|
-
return descriptor.bind(real);
|
|
93
|
-
}
|
|
94
|
-
return descriptor;
|
|
95
|
-
},
|
|
96
|
-
has (_t, prop) {
|
|
97
|
-
const real = materialize();
|
|
98
|
-
return real !== null && real !== undefined && Reflect.has(real, prop);
|
|
99
|
-
},
|
|
100
|
-
ownKeys () {
|
|
101
|
-
const real = materialize();
|
|
102
|
-
if (real === null || real === undefined) return [];
|
|
103
|
-
return Reflect.ownKeys(real);
|
|
104
|
-
},
|
|
105
|
-
getOwnPropertyDescriptor (_t, prop) {
|
|
106
|
-
const real = materialize();
|
|
107
|
-
if (real === null || real === undefined) return undefined;
|
|
108
|
-
const descriptor = Reflect.getOwnPropertyDescriptor(real, prop);
|
|
109
|
-
// Proxy invariants require returned descriptors to be configurable
|
|
110
|
-
// when the underlying target lacks the property, which is always
|
|
111
|
-
// true for our null-prototype empty target.
|
|
112
|
-
if (descriptor) descriptor.configurable = true;
|
|
113
|
-
return descriptor;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
return new Proxy(target, handler);
|
|
117
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import type { Container } from '../container/container';
|
|
3
|
-
/**
|
|
4
|
-
* Returns the request-scoped child container for the current request.
|
|
5
|
-
*
|
|
6
|
-
* `@Inject(Container)` resolves the ROOT container (request children share the
|
|
7
|
-
* provider map and never rebind `Container`), so module authors who need
|
|
8
|
-
* request-scoped resolution from inside a handler, param-decorator factory, or
|
|
9
|
-
* scoped middleware must read the child seeded by RouteManager instead. The
|
|
10
|
-
* child is created before guards, pipes, params, and handlers run, so it is
|
|
11
|
-
* always present on the Vela request path.
|
|
12
|
-
*
|
|
13
|
-
* Throws outside a Vela-managed request rather than materializing an orphan
|
|
14
|
-
* child (mirrors the REQUEST_CONTEXT fail-fast).
|
|
15
|
-
*/
|
|
16
|
-
export declare function getRequestContainer(c: Context): Container;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns the request-scoped child container for the current request.
|
|
3
|
-
*
|
|
4
|
-
* `@Inject(Container)` resolves the ROOT container (request children share the
|
|
5
|
-
* provider map and never rebind `Container`), so module authors who need
|
|
6
|
-
* request-scoped resolution from inside a handler, param-decorator factory, or
|
|
7
|
-
* scoped middleware must read the child seeded by RouteManager instead. The
|
|
8
|
-
* child is created before guards, pipes, params, and handlers run, so it is
|
|
9
|
-
* always present on the Vela request path.
|
|
10
|
-
*
|
|
11
|
-
* Throws outside a Vela-managed request rather than materializing an orphan
|
|
12
|
-
* child (mirrors the REQUEST_CONTEXT fail-fast).
|
|
13
|
-
*/ export function getRequestContainer(c) {
|
|
14
|
-
const container = c.get('container');
|
|
15
|
-
if (!container) {
|
|
16
|
-
throw new Error('getRequestContainer(c) can only be called inside a Vela-managed request — ' + 'the request child container is seeded by RouteManager when the request enters the pipeline.');
|
|
17
|
-
}
|
|
18
|
-
return container;
|
|
19
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import { InjectionToken } from '../container/types';
|
|
3
|
-
export interface RequestContext {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly receivedAt: Date;
|
|
6
|
-
readonly request: Request;
|
|
7
|
-
readonly hono: Context;
|
|
8
|
-
set<T>(key: string | symbol, value: T): void;
|
|
9
|
-
get<T>(key: string | symbol): T | undefined;
|
|
10
|
-
has(key: string | symbol): boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const REQUEST_CONTEXT: InjectionToken<RequestContext>;
|
|
13
|
-
export declare function createRequestContext(c: Context): RequestContext;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from "../container/types.js";
|
|
2
|
-
export const REQUEST_CONTEXT = new InjectionToken('vela.RequestContext');
|
|
3
|
-
export function createRequestContext(c) {
|
|
4
|
-
const bag = new Map();
|
|
5
|
-
const inboundId = c.req.raw.headers.get('x-request-id');
|
|
6
|
-
const id = inboundId && inboundId.length > 0 ? inboundId : crypto.randomUUID();
|
|
7
|
-
return {
|
|
8
|
-
id,
|
|
9
|
-
receivedAt: new Date(),
|
|
10
|
-
request: c.req.raw,
|
|
11
|
-
hono: c,
|
|
12
|
-
set (key, value) {
|
|
13
|
-
bag.set(key, value);
|
|
14
|
-
},
|
|
15
|
-
get (key) {
|
|
16
|
-
return bag.get(key);
|
|
17
|
-
},
|
|
18
|
-
has (key) {
|
|
19
|
-
return bag.has(key);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
export interface ResponseRedirect {
|
|
3
|
-
url: string;
|
|
4
|
-
statusCode: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function mapResponse(c: Context, result: unknown, statusCode?: number): Response;
|
|
7
|
-
export declare function mapRedirect(c: Context, result: unknown, redirect: ResponseRedirect): Response;
|
|
8
|
-
export declare function applyResponseHeaders(response: Response, headers: Iterable<readonly [string, string]>): void;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// A handler returning `{ url, statusCode? }` may override the @Redirect-decorator
|
|
2
|
-
// destination — kept identical to the previous inline behavior.
|
|
3
|
-
function parseRedirectResult(result) {
|
|
4
|
-
if (typeof result !== 'object' || result === null) return undefined;
|
|
5
|
-
if (!('url' in result)) return undefined;
|
|
6
|
-
const obj = result;
|
|
7
|
-
if (typeof obj.url !== 'string') return undefined;
|
|
8
|
-
return {
|
|
9
|
-
url: obj.url,
|
|
10
|
-
...typeof obj.statusCode === 'number' ? {
|
|
11
|
-
statusCode: obj.statusCode
|
|
12
|
-
} : {}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
// Maps a controller return value to a Hono Response. `null`/`undefined` → 204
|
|
16
|
-
// (empty body); strings → text; anything else → JSON. A pre-built Response
|
|
17
|
-
// passes through unchanged.
|
|
18
|
-
export function mapResponse(c, result, statusCode) {
|
|
19
|
-
if (result instanceof Response) {
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
if (result === null || result === undefined) {
|
|
23
|
-
return c.body(null, statusCode ?? 204);
|
|
24
|
-
}
|
|
25
|
-
if (typeof result === 'string') {
|
|
26
|
-
return c.text(result, statusCode ?? 200);
|
|
27
|
-
}
|
|
28
|
-
return c.json(result, statusCode ?? 200);
|
|
29
|
-
}
|
|
30
|
-
// Honors @Redirect on the handler. If the handler returned `{ url, statusCode? }`,
|
|
31
|
-
// those override the decorator's defaults; otherwise the decorator wins.
|
|
32
|
-
export function mapRedirect(c, result, redirect) {
|
|
33
|
-
const overrides = parseRedirectResult(result);
|
|
34
|
-
const finalUrl = overrides?.url ?? redirect.url;
|
|
35
|
-
const finalStatus = overrides?.statusCode ?? redirect.statusCode;
|
|
36
|
-
return c.redirect(finalUrl, finalStatus);
|
|
37
|
-
}
|
|
38
|
-
export function applyResponseHeaders(response, headers) {
|
|
39
|
-
for (const [name, value] of headers){
|
|
40
|
-
response.headers.set(name, value);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { Hono } from 'hono';
|
|
2
|
-
import type { Container } from '../container/container';
|
|
3
|
-
import type { Type } from '../container/types';
|
|
4
|
-
import type { OpenApiPathItem } from '../openapi/types';
|
|
5
|
-
import type { CanActivate } from '../pipeline/types';
|
|
6
|
-
/**
|
|
7
|
-
* Context passed to {@link RouteContributor.buildRoutes} for each controller
|
|
8
|
-
* the contributor claims. The contributor receives the framework's resolved
|
|
9
|
-
* view of the world so generated routes behave identically to hand-written
|
|
10
|
-
* ones: same global prefix, same global guard instances, same path joining.
|
|
11
|
-
*/
|
|
12
|
-
export interface RouteContributorContext {
|
|
13
|
-
/** The claimed controller class. */
|
|
14
|
-
controller: Type;
|
|
15
|
-
/** Controller-level prefix as registered with `@Controller(...)`. */
|
|
16
|
-
controllerPrefix: string;
|
|
17
|
-
/** The metadata value (under `claimsMetaKey`) that claimed this controller. */
|
|
18
|
-
meta: unknown;
|
|
19
|
-
/** Application-wide path prefix (e.g. `/api`), already normalized. */
|
|
20
|
-
globalPrefix: string;
|
|
21
|
-
/** Global guard instances, pre-resolved from the root container. */
|
|
22
|
-
globalGuards: CanActivate[];
|
|
23
|
-
/** The app's root container — resolve controller/services from here. */
|
|
24
|
-
container: Container;
|
|
25
|
-
/** Path joiner used by the framework — handles slash normalization. */
|
|
26
|
-
joinPaths: (...parts: string[]) => string;
|
|
27
|
-
}
|
|
28
|
-
/** Context for {@link RouteContributor.buildOpenApiPaths}. */
|
|
29
|
-
export interface RouteContributorOpenApiContext {
|
|
30
|
-
controller: Type;
|
|
31
|
-
meta: unknown;
|
|
32
|
-
/** Application-wide path prefix (e.g. `/api`), already normalized. */
|
|
33
|
-
globalPrefix: string;
|
|
34
|
-
/** Controller-level prefix as registered with `@Controller(...)`. */
|
|
35
|
-
controllerPrefix: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* A route generator that claims controllers by class-level metadata and
|
|
39
|
-
* mounts routes for them — the public extension point behind `@Crud()` (and
|
|
40
|
-
* any future metadata-driven route generator: storage HTTP surfaces, admin
|
|
41
|
-
* panels, RPC bridges).
|
|
42
|
-
*
|
|
43
|
-
* Register once at import time (`registerRouteContributor`); the framework
|
|
44
|
-
* consults contributors during `RouteManager.build` — AFTER all explicit
|
|
45
|
-
* `@Get`/`@Post` routes, so generated `/:id` catch-alls never shadow custom
|
|
46
|
-
* routes — and during OpenAPI document generation.
|
|
47
|
-
*
|
|
48
|
-
* This contract exists instead of dynamic `import()` because esbuild leaves
|
|
49
|
-
* `await import(variable)` as a runtime import Cloudflare Workers cannot
|
|
50
|
-
* resolve.
|
|
51
|
-
*/
|
|
52
|
-
export interface RouteContributor {
|
|
53
|
-
/** Stable identifier; re-registering the same id overwrites (HMR-friendly). */
|
|
54
|
-
id: string;
|
|
55
|
-
/** Class-level metadata key whose presence claims a controller. */
|
|
56
|
-
claimsMetaKey: string;
|
|
57
|
-
buildRoutes(app: Hono, ctx: RouteContributorContext): void | Promise<void>;
|
|
58
|
-
buildOpenApiPaths?(ctx: RouteContributorOpenApiContext): Record<string, OpenApiPathItem>;
|
|
59
|
-
}
|
|
60
|
-
/** Register a contributor. Last registration per `id` wins. */
|
|
61
|
-
export declare function registerRouteContributor(contributor: RouteContributor): void;
|
|
62
|
-
/** All registered contributors (registration order). */
|
|
63
|
-
export declare function getRouteContributors(): RouteContributor[];
|
|
64
|
-
/**
|
|
65
|
-
* Reset all contributor registrations. Test-only.
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
|
-
export declare function _resetRouteContributors(): void;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Contributors register at import time (package side effect), so the store is
|
|
2
|
-
// anchored on `globalThis` like MetadataRegistry state: a Vite HMR re-eval
|
|
3
|
-
// reuses the same store instead of minting an empty one.
|
|
4
|
-
const STORE_KEY = Symbol.for('vela:route-contributors:v1');
|
|
5
|
-
function store() {
|
|
6
|
-
const g = globalThis;
|
|
7
|
-
return g[STORE_KEY] ??= new Map();
|
|
8
|
-
}
|
|
9
|
-
/** Register a contributor. Last registration per `id` wins. */ export function registerRouteContributor(contributor) {
|
|
10
|
-
store().set(contributor.id, contributor);
|
|
11
|
-
}
|
|
12
|
-
/** All registered contributors (registration order). */ export function getRouteContributors() {
|
|
13
|
-
return [
|
|
14
|
-
...store().values()
|
|
15
|
-
];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Reset all contributor registrations. Test-only.
|
|
19
|
-
* @internal
|
|
20
|
-
*/ export function _resetRouteContributors() {
|
|
21
|
-
store().clear();
|
|
22
|
-
}
|
package/dist/http/route-map.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Augmentable map of route name → its path params. Users opt in to type-safe
|
|
3
|
-
* URL generation by augmenting this interface — no build step, no codegen:
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* declare module '@velajs/vela' {
|
|
7
|
-
* interface VelaRouteMap {
|
|
8
|
-
* 'users.index': Record<string, never>;
|
|
9
|
-
* 'users.show': { id: string };
|
|
10
|
-
* }
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Until augmented it stays empty, so `RouteName` falls back to `string` and
|
|
15
|
-
* `RouteParams<N>` to a loose `Record<string, string> | undefined` — untyped
|
|
16
|
-
* callers keep working unchanged.
|
|
17
|
-
*/
|
|
18
|
-
export interface VelaRouteMap {
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Every valid route name. Falls back to `string` when `VelaRouteMap` has not
|
|
22
|
-
* been augmented, so `urlFor`/`signedUrl` accept any name in an untyped app.
|
|
23
|
-
*/
|
|
24
|
-
export type RouteName = keyof VelaRouteMap extends never ? string : Extract<keyof VelaRouteMap, string>;
|
|
25
|
-
/**
|
|
26
|
-
* The params object required to build a named route's URL. When `VelaRouteMap`
|
|
27
|
-
* is augmented, resolves to the declared params shape for `N`; otherwise a
|
|
28
|
-
* loose `Record<string, string> | undefined`.
|
|
29
|
-
*/
|
|
30
|
-
export type RouteParams<N extends RouteName> = N extends keyof VelaRouteMap ? VelaRouteMap[N] : Record<string, string> | undefined;
|
package/dist/http/route-map.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Zero-codegen, type-safe route names — mirrors the augmentation pattern from
|
|
2
|
-
// stratal `packages/core/src/router/route-map.ts` (MIT © Temitayo Fadojutimi).
|
|
3
|
-
// Adapted for vela: `VelaRouteMap` maps a route name directly to its params
|
|
4
|
-
// object (stratal wraps params in `{ params: … }`; vela keeps it flat to match
|
|
5
|
-
// the `urlFor(name, params)` call shape).
|
|
6
|
-
/**
|
|
7
|
-
* Augmentable map of route name → its path params. Users opt in to type-safe
|
|
8
|
-
* URL generation by augmenting this interface — no build step, no codegen:
|
|
9
|
-
*
|
|
10
|
-
* ```ts
|
|
11
|
-
* declare module '@velajs/vela' {
|
|
12
|
-
* interface VelaRouteMap {
|
|
13
|
-
* 'users.index': Record<string, never>;
|
|
14
|
-
* 'users.show': { id: string };
|
|
15
|
-
* }
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* Until augmented it stays empty, so `RouteName` falls back to `string` and
|
|
20
|
-
* `RouteParams<N>` to a loose `Record<string, string> | undefined` — untyped
|
|
21
|
-
* callers keep working unchanged.
|
|
22
|
-
*/ // eslint-disable-next-line @typescript-eslint/no-empty-object-type -- augmentable interface, intentionally empty until a consumer declares routes
|
|
23
|
-
/**
|
|
24
|
-
* The params object required to build a named route's URL. When `VelaRouteMap`
|
|
25
|
-
* is augmented, resolves to the declared params shape for `N`; otherwise a
|
|
26
|
-
* loose `Record<string, string> | undefined`.
|
|
27
|
-
*/ export { };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { type Context, type MiddlewareHandler, Hono } from 'hono';
|
|
2
|
-
import type { Container } from '../container/container';
|
|
3
|
-
import type { Token, Type } from '../container/types';
|
|
4
|
-
import type { MiddlewareRouteDefinition } from '../module/middleware';
|
|
5
|
-
import type { CanActivate, ExceptionFilter, NestInterceptor, NestMiddleware, PipeTransform } from '../pipeline/types';
|
|
6
|
-
import type { FilterType, GuardType, InterceptorType, MiddlewareType, PipeType } from '../registry/types';
|
|
7
|
-
import type { ControllerRegistration } from './types';
|
|
8
|
-
/**
|
|
9
|
-
* One explicit controller route as the framework registered it — recorded by
|
|
10
|
-
* `build()` with the SAME composed path handed to Hono (global prefix +
|
|
11
|
-
* version segment + controller prefix + route path), so introspection tooling
|
|
12
|
-
* (`vela route list`) never re-derives composition. Contributed routes
|
|
13
|
-
* (`RouteContributor`, e.g. `@velajs/crud`) mount directly on the Hono app
|
|
14
|
-
* and are not described here — diff `app.getHonoApp().routes` for those.
|
|
15
|
-
*/
|
|
16
|
-
export interface RouteDescription {
|
|
17
|
-
/** As declared on the handler — `@Head()` reports HEAD (Hono serves it under GET). */
|
|
18
|
-
method: string;
|
|
19
|
-
/** Fully composed path exactly as registered. */
|
|
20
|
-
path: string;
|
|
21
|
-
controller: string;
|
|
22
|
-
handler: string;
|
|
23
|
-
version?: number;
|
|
24
|
-
/** Route name (`@Get(path, { name })`) — the URL-generation / `operationId` key. */
|
|
25
|
-
name?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface RouteManagerOptions {
|
|
28
|
-
getClientIp?: (c: Context) => string | null;
|
|
29
|
-
middleware?: MiddlewareHandler[];
|
|
30
|
-
globalPrefix?: string;
|
|
31
|
-
/**
|
|
32
|
-
* Opt into ambient request-container access (`getCurrentContainer()` /
|
|
33
|
-
* `getCurrentRequestContext()`). Registers Hono's `contextStorage()` as the
|
|
34
|
-
* first middleware. Off by default — the explicit child container is unchanged.
|
|
35
|
-
*/
|
|
36
|
-
ambientContainer?: boolean;
|
|
37
|
-
}
|
|
38
|
-
export declare class RouteManager {
|
|
39
|
-
private container;
|
|
40
|
-
private static readonly METHOD_REGISTRAR;
|
|
41
|
-
private controllers;
|
|
42
|
-
private globalMiddleware;
|
|
43
|
-
private globalPipes;
|
|
44
|
-
private globalGuards;
|
|
45
|
-
private globalInterceptors;
|
|
46
|
-
private globalFilters;
|
|
47
|
-
private globalPrefix;
|
|
48
|
-
private consumerMiddlewareDefinitions;
|
|
49
|
-
private routeDescriptions;
|
|
50
|
-
private readonly handlerExecutor;
|
|
51
|
-
private readonly ambientContainer;
|
|
52
|
-
constructor(container: Container, options?: RouteManagerOptions);
|
|
53
|
-
/**
|
|
54
|
-
* The global-tier components (`APP_*` provider tokens + imperative
|
|
55
|
-
* `app.useGlobalX()` instances). Exposed so non-HTTP transports (the
|
|
56
|
-
* WebSocket dispatcher) can apply the same app-wide guards/pipes/interceptors/
|
|
57
|
-
* filters as HTTP routes, read live so late registrations propagate.
|
|
58
|
-
*/
|
|
59
|
-
getGlobalComponents(): {
|
|
60
|
-
guards: Array<GuardType | Token<CanActivate>>;
|
|
61
|
-
pipes: Array<PipeType | Token<PipeTransform>>;
|
|
62
|
-
interceptors: Array<InterceptorType | Token<NestInterceptor>>;
|
|
63
|
-
filters: Array<FilterType | Token<ExceptionFilter>>;
|
|
64
|
-
};
|
|
65
|
-
registerConsumerMiddleware(definitions: MiddlewareRouteDefinition[]): this;
|
|
66
|
-
setGlobalPrefix(prefix: string): this;
|
|
67
|
-
useGlobalMiddleware(...middleware: MiddlewareType[]): this;
|
|
68
|
-
useGlobalMiddlewareTokens(...middlewareTokens: Array<Token<NestMiddleware>>): this;
|
|
69
|
-
useGlobalPipes(...pipes: PipeType[]): this;
|
|
70
|
-
useGlobalPipeTokens(...pipeTokens: Array<Token<PipeTransform>>): this;
|
|
71
|
-
useGlobalGuards(...guards: GuardType[]): this;
|
|
72
|
-
useGlobalGuardTokens(...guardTokens: Array<Token<CanActivate>>): this;
|
|
73
|
-
useGlobalInterceptors(...interceptors: InterceptorType[]): this;
|
|
74
|
-
useGlobalInterceptorTokens(...interceptorTokens: Array<Token<NestInterceptor>>): this;
|
|
75
|
-
useGlobalFilters(...filters: FilterType[]): this;
|
|
76
|
-
useGlobalFilterTokens(...filterTokens: Array<Token<ExceptionFilter>>): this;
|
|
77
|
-
private getMiddlewarePriority;
|
|
78
|
-
private getRequestContainer;
|
|
79
|
-
private wrapMiddlewareWithFilters;
|
|
80
|
-
private mapMiddlewareError;
|
|
81
|
-
registerController(controller: Type): this;
|
|
82
|
-
/** The explicit controller routes recorded by the last `build()`. */
|
|
83
|
-
getRouteDescriptions(): RouteDescription[];
|
|
84
|
-
/** The global prefix in effect (set at bootstrap; '' when none). */
|
|
85
|
-
getGlobalPrefix(): string;
|
|
86
|
-
build(): Promise<Hono>;
|
|
87
|
-
private registerRoute;
|
|
88
|
-
private buildVersionedPaths;
|
|
89
|
-
private compilePathMatcher;
|
|
90
|
-
private compileRouteMatcher;
|
|
91
|
-
getControllers(): ControllerRegistration[];
|
|
92
|
-
}
|