@velajs/vela 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -14
- package/dist/configurable-module.builder-5FGMaXG6.js +91 -0
- package/dist/configurable-module.builder-5FGMaXG6.js.map +1 -0
- package/dist/container-BqUHID4l.js +645 -0
- package/dist/container-BqUHID4l.js.map +1 -0
- package/dist/cron-matcher-C9qv5OUA.js +113 -0
- package/dist/cron-matcher-C9qv5OUA.js.map +1 -0
- package/dist/decorate-GcSMAbKn.js +528 -0
- package/dist/decorate-GcSMAbKn.js.map +1 -0
- package/dist/decorators-C8YBFCIk.js +53 -0
- package/dist/decorators-C8YBFCIk.js.map +1 -0
- package/dist/define-module-NOyOZNXD.js +235 -0
- package/dist/define-module-NOyOZNXD.js.map +1 -0
- package/dist/discovery.service-BYm95SSD.js +368 -0
- package/dist/discovery.service-BYm95SSD.js.map +1 -0
- package/dist/discovery.service-Cpf1QcZ5.d.ts +648 -0
- package/dist/i18n/index.d.ts +138 -10
- package/dist/i18n/index.js +270 -8
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-D72EQfcC.d.ts +430 -0
- package/dist/index-DhShDLCM.d.ts +2310 -0
- package/dist/index.d.ts +6 -66
- package/dist/index.js +14 -71
- package/dist/internal.d.ts +13 -17
- package/dist/internal.js +6 -19
- package/dist/live/index.d.ts +2 -12
- package/dist/live/index.js +826 -16
- package/dist/live/index.js.map +1 -0
- package/dist/metadata.registry-D1od8ZBt.d.ts +842 -0
- package/dist/plugin-ByBlVOve.js +1387 -0
- package/dist/plugin-ByBlVOve.js.map +1 -0
- package/dist/queue/index.d.ts +247 -10
- package/dist/queue/index.js +384 -12
- package/dist/queue/index.js.map +1 -0
- package/dist/request-context-C3nCGJNd.js +26 -0
- package/dist/request-context-C3nCGJNd.js.map +1 -0
- package/dist/route.manager-DRAZ5X04.js +991 -0
- package/dist/route.manager-DRAZ5X04.js.map +1 -0
- package/dist/schedule-node/index.d.ts +32 -3
- package/dist/schedule-node/index.js +97 -3
- package/dist/schedule-node/index.js.map +1 -0
- package/dist/schedule.registry-DVm7Jp5w.d.ts +55 -0
- package/dist/seeder/index.d.ts +75 -5
- package/dist/seeder/index.js +105 -4
- package/dist/seeder/index.js.map +1 -0
- package/dist/signed-url-CMmi0SIb.js +56 -0
- package/dist/signed-url-CMmi0SIb.js.map +1 -0
- package/dist/signed-url-DKhgja4U.d.ts +16 -0
- package/dist/src-eb5CI6Xn.js +2151 -0
- package/dist/src-eb5CI6Xn.js.map +1 -0
- package/dist/storage/index.d.ts +57 -4
- package/dist/storage/index.js +22 -5
- package/dist/storage/index.js.map +1 -0
- package/dist/streaming/index.d.ts +2 -2
- package/dist/streaming/index.js +2 -1
- package/dist/websocket/index.d.ts +3 -12
- package/dist/websocket/index.js +2 -16
- package/dist/websocket-DXmB-MWJ.js +697 -0
- package/dist/websocket-DXmB-MWJ.js.map +1 -0
- package/dist/websocket-node/index.d.ts +108 -6
- package/dist/websocket-node/index.js +228 -6
- package/dist/websocket-node/index.js.map +1 -0
- package/package.json +67 -53
- package/dist/__tests__/workers/entry.d.ts +0 -9
- package/dist/__tests__/workers-als/entry-als.d.ts +0 -9
- package/dist/application.d.ts +0 -91
- package/dist/application.js +0 -308
- package/dist/cache/cache.decorators.d.ts +0 -2
- package/dist/cache/cache.decorators.js +0 -4
- package/dist/cache/cache.interceptor.d.ts +0 -9
- package/dist/cache/cache.interceptor.js +0 -60
- package/dist/cache/cache.module.d.ts +0 -7
- package/dist/cache/cache.module.js +0 -58
- package/dist/cache/cache.service.d.ts +0 -9
- package/dist/cache/cache.service.js +0 -42
- package/dist/cache/cache.store.d.ts +0 -12
- package/dist/cache/cache.store.js +0 -51
- package/dist/cache/cache.tokens.d.ts +0 -6
- package/dist/cache/cache.tokens.js +0 -5
- package/dist/cache/cache.types.d.ts +0 -41
- package/dist/cache/cache.types.js +0 -1
- package/dist/cache/index.d.ts +0 -8
- package/dist/cache/index.js +0 -7
- package/dist/cache/tiered-cache.store.d.ts +0 -19
- package/dist/cache/tiered-cache.store.js +0 -40
- package/dist/config/config.module.d.ts +0 -19
- package/dist/config/config.module.js +0 -98
- package/dist/config/config.service.d.ts +0 -20
- package/dist/config/config.service.js +0 -43
- package/dist/config/config.store.d.ts +0 -46
- package/dist/config/config.store.js +0 -119
- package/dist/config/config.tokens.d.ts +0 -13
- package/dist/config/config.tokens.js +0 -14
- package/dist/config/config.types.d.ts +0 -41
- package/dist/config/config.types.js +0 -4
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -5
- package/dist/config/register-as.d.ts +0 -52
- package/dist/config/register-as.js +0 -39
- package/dist/constants.d.ts +0 -44
- package/dist/constants.js +0 -46
- package/dist/container/container.d.ts +0 -154
- package/dist/container/container.js +0 -849
- package/dist/container/decorators.d.ts +0 -17
- package/dist/container/decorators.js +0 -57
- package/dist/container/disposable.d.ts +0 -5
- package/dist/container/disposable.js +0 -33
- package/dist/container/index.d.ts +0 -6
- package/dist/container/index.js +0 -5
- package/dist/container/mixin.d.ts +0 -24
- package/dist/container/mixin.js +0 -26
- package/dist/container/module-ref.d.ts +0 -21
- package/dist/container/module-ref.js +0 -48
- package/dist/container/types.d.ts +0 -154
- package/dist/container/types.js +0 -49
- package/dist/cors/cors.module.d.ts +0 -7
- package/dist/cors/cors.module.js +0 -37
- package/dist/cors/cors.tokens.d.ts +0 -3
- package/dist/cors/cors.tokens.js +0 -2
- package/dist/cors/cors.types.d.ts +0 -8
- package/dist/cors/cors.types.js +0 -1
- package/dist/cors/index.d.ts +0 -3
- package/dist/cors/index.js +0 -2
- package/dist/crypto/signed-url.d.ts +0 -12
- package/dist/crypto/signed-url.js +0 -60
- package/dist/discovery/discoverable.decorator.d.ts +0 -38
- package/dist/discovery/discoverable.decorator.js +0 -42
- package/dist/discovery/discovery.service.d.ts +0 -102
- package/dist/discovery/discovery.service.js +0 -177
- package/dist/discovery/index.d.ts +0 -2
- package/dist/discovery/index.js +0 -2
- package/dist/entrypoint/entrypoint.registry.d.ts +0 -42
- package/dist/entrypoint/entrypoint.registry.js +0 -112
- package/dist/entrypoint/entrypoint.types.d.ts +0 -41
- package/dist/entrypoint/entrypoint.types.js +0 -3
- package/dist/entrypoint/execution-context.d.ts +0 -15
- package/dist/entrypoint/execution-context.js +0 -21
- package/dist/entrypoint/execution-scope.d.ts +0 -21
- package/dist/entrypoint/execution-scope.js +0 -28
- package/dist/entrypoint/index.d.ts +0 -4
- package/dist/entrypoint/index.js +0 -4
- package/dist/errors/http-exception.d.ts +0 -62
- package/dist/errors/http-exception.js +0 -134
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/event-emitter/event-emitter.decorators.d.ts +0 -1
- package/dist/event-emitter/event-emitter.decorators.js +0 -10
- package/dist/event-emitter/event-emitter.module.d.ts +0 -2
- package/dist/event-emitter/event-emitter.module.js +0 -23
- package/dist/event-emitter/event-emitter.service.d.ts +0 -13
- package/dist/event-emitter/event-emitter.service.js +0 -127
- package/dist/event-emitter/event-emitter.subscriber.d.ts +0 -9
- package/dist/event-emitter/event-emitter.subscriber.js +0 -45
- package/dist/event-emitter/event-emitter.tokens.d.ts +0 -1
- package/dist/event-emitter/event-emitter.tokens.js +0 -1
- package/dist/event-emitter/event-emitter.types.d.ts +0 -5
- package/dist/event-emitter/event-emitter.types.js +0 -1
- package/dist/event-emitter/index.d.ts +0 -6
- package/dist/event-emitter/index.js +0 -5
- package/dist/factory/adapter.d.ts +0 -36
- package/dist/factory/adapter.js +0 -18
- package/dist/factory/bootstrap.d.ts +0 -23
- package/dist/factory/bootstrap.js +0 -108
- package/dist/factory.d.ts +0 -16
- package/dist/factory.js +0 -36
- package/dist/fetch/fetch.module.d.ts +0 -7
- package/dist/fetch/fetch.module.js +0 -31
- package/dist/fetch/fetch.service.d.ts +0 -24
- package/dist/fetch/fetch.service.js +0 -145
- package/dist/fetch/fetch.types.d.ts +0 -24
- package/dist/fetch/fetch.types.js +0 -1
- package/dist/fetch/index.d.ts +0 -3
- package/dist/fetch/index.js +0 -2
- package/dist/health/health.http.d.ts +0 -14
- package/dist/health/health.http.js +0 -75
- package/dist/health/health.indicator.d.ts +0 -9
- package/dist/health/health.indicator.js +0 -32
- package/dist/health/health.module.d.ts +0 -2
- package/dist/health/health.module.js +0 -26
- package/dist/health/health.service.d.ts +0 -7
- package/dist/health/health.service.js +0 -69
- package/dist/health/health.types.d.ts +0 -15
- package/dist/health/health.types.js +0 -1
- package/dist/health/index.d.ts +0 -6
- package/dist/health/index.js +0 -4
- package/dist/http/ambient.d.ts +0 -17
- package/dist/http/ambient.js +0 -44
- package/dist/http/argument-resolver.d.ts +0 -10
- package/dist/http/argument-resolver.js +0 -89
- package/dist/http/decorators.d.ts +0 -198
- package/dist/http/decorators.js +0 -321
- package/dist/http/execution-context.d.ts +0 -8
- package/dist/http/execution-context.js +0 -35
- package/dist/http/handler-executor.d.ts +0 -20
- package/dist/http/handler-executor.js +0 -111
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.js +0 -7
- package/dist/http/instantiate.d.ts +0 -4
- package/dist/http/instantiate.js +0 -45
- package/dist/http/lazy-param.decorator.d.ts +0 -37
- package/dist/http/lazy-param.decorator.js +0 -117
- package/dist/http/request-container.d.ts +0 -16
- package/dist/http/request-container.js +0 -19
- package/dist/http/request-context.d.ts +0 -13
- package/dist/http/request-context.js +0 -22
- package/dist/http/response-mapper.d.ts +0 -8
- package/dist/http/response-mapper.js +0 -42
- package/dist/http/route-contributor.d.ts +0 -68
- package/dist/http/route-contributor.js +0 -22
- package/dist/http/route-map.d.ts +0 -30
- package/dist/http/route-map.js +0 -27
- package/dist/http/route.manager.d.ts +0 -92
- package/dist/http/route.manager.js +0 -481
- package/dist/http/types.d.ts +0 -37
- package/dist/http/types.js +0 -1
- package/dist/http/url/index.d.ts +0 -4
- package/dist/http/url/index.js +0 -3
- package/dist/http/url/signed-url.guard.d.ts +0 -27
- package/dist/http/url/signed-url.guard.js +0 -62
- package/dist/http/url/signing-secret.d.ts +0 -20
- package/dist/http/url/signing-secret.js +0 -24
- package/dist/http/url/url-generator.service.d.ts +0 -52
- package/dist/http/url/url-generator.service.js +0 -104
- package/dist/i18n/deep-merge.d.ts +0 -2
- package/dist/i18n/deep-merge.js +0 -15
- package/dist/i18n/i18n.middleware.d.ts +0 -15
- package/dist/i18n/i18n.middleware.js +0 -94
- package/dist/i18n/i18n.module.d.ts +0 -13
- package/dist/i18n/i18n.module.js +0 -69
- package/dist/i18n/i18n.options.d.ts +0 -30
- package/dist/i18n/i18n.options.js +0 -16
- package/dist/i18n/i18n.service.d.ts +0 -20
- package/dist/i18n/i18n.service.js +0 -49
- package/dist/i18n/i18n.tokens.d.ts +0 -6
- package/dist/i18n/i18n.tokens.js +0 -3
- package/dist/i18n/i18n.types.d.ts +0 -6
- package/dist/i18n/i18n.types.js +0 -1
- package/dist/i18n/message-loader.service.d.ts +0 -21
- package/dist/i18n/message-loader.service.js +0 -90
- package/dist/i18n/message-registry.d.ts +0 -16
- package/dist/i18n/message-registry.js +0 -49
- package/dist/lifecycle/index.d.ts +0 -20
- package/dist/lifecycle/index.js +0 -15
- package/dist/live/live.cursor.d.ts +0 -22
- package/dist/live/live.cursor.js +0 -56
- package/dist/live/live.decorators.d.ts +0 -32
- package/dist/live/live.decorators.js +0 -46
- package/dist/live/live.delta.d.ts +0 -15
- package/dist/live/live.delta.js +0 -51
- package/dist/live/live.engine.d.ts +0 -81
- package/dist/live/live.engine.js +0 -448
- package/dist/live/live.invalidation.d.ts +0 -45
- package/dist/live/live.invalidation.js +0 -99
- package/dist/live/live.module.d.ts +0 -28
- package/dist/live/live.module.js +0 -87
- package/dist/live/live.tokens.d.ts +0 -9
- package/dist/live/live.tokens.js +0 -8
- package/dist/live/live.types.d.ts +0 -138
- package/dist/live/live.types.js +0 -1
- package/dist/live/presence.d.ts +0 -44
- package/dist/live/presence.js +0 -130
- package/dist/metadata.d.ts +0 -10
- package/dist/metadata.js +0 -20
- package/dist/module/configurable-module.builder.d.ts +0 -56
- package/dist/module/configurable-module.builder.js +0 -84
- package/dist/module/configurable-module.types.d.ts +0 -93
- package/dist/module/configurable-module.types.js +0 -5
- package/dist/module/decorators.d.ts +0 -10
- package/dist/module/decorators.js +0 -47
- package/dist/module/define-module.d.ts +0 -112
- package/dist/module/define-module.js +0 -232
- package/dist/module/graph.d.ts +0 -10
- package/dist/module/graph.js +0 -35
- package/dist/module/index.d.ts +0 -10
- package/dist/module/index.js +0 -7
- package/dist/module/lazy-modules.d.ts +0 -82
- package/dist/module/lazy-modules.js +0 -231
- package/dist/module/lazy-provider.d.ts +0 -65
- package/dist/module/lazy-provider.js +0 -111
- package/dist/module/middleware.d.ts +0 -30
- package/dist/module/middleware.js +0 -67
- package/dist/module/module-loader.d.ts +0 -58
- package/dist/module/module-loader.js +0 -484
- package/dist/module/stable-hash.d.ts +0 -15
- package/dist/module/stable-hash.js +0 -52
- package/dist/module/types.d.ts +0 -1
- package/dist/module/types.js +0 -1
- package/dist/openapi/decorators.d.ts +0 -34
- package/dist/openapi/decorators.js +0 -66
- package/dist/openapi/document.d.ts +0 -3
- package/dist/openapi/document.js +0 -316
- package/dist/openapi/index.d.ts +0 -7
- package/dist/openapi/index.js +0 -6
- package/dist/openapi/redoc-ui.d.ts +0 -1
- package/dist/openapi/redoc-ui.js +0 -19
- package/dist/openapi/scalar-ui.d.ts +0 -1
- package/dist/openapi/scalar-ui.js +0 -19
- package/dist/openapi/swagger-ui.d.ts +0 -1
- package/dist/openapi/swagger-ui.js +0 -23
- package/dist/openapi/types.d.ts +0 -182
- package/dist/openapi/types.js +0 -4
- package/dist/openapi/zod-to-json-schema.d.ts +0 -4
- package/dist/openapi/zod-to-json-schema.js +0 -57
- package/dist/pipeline/app-providers.d.ts +0 -10
- package/dist/pipeline/app-providers.js +0 -43
- package/dist/pipeline/component.manager.d.ts +0 -25
- package/dist/pipeline/component.manager.js +0 -66
- package/dist/pipeline/decorators.d.ts +0 -10
- package/dist/pipeline/decorators.js +0 -42
- package/dist/pipeline/index.d.ts +0 -12
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/pipeline-runner.d.ts +0 -31
- package/dist/pipeline/pipeline-runner.js +0 -40
- package/dist/pipeline/pipes.d.ts +0 -48
- package/dist/pipeline/pipes.js +0 -104
- package/dist/pipeline/reflector.d.ts +0 -86
- package/dist/pipeline/reflector.js +0 -121
- package/dist/pipeline/scoped-components.d.ts +0 -26
- package/dist/pipeline/scoped-components.js +0 -27
- package/dist/pipeline/tokens.d.ts +0 -33
- package/dist/pipeline/tokens.js +0 -27
- package/dist/pipeline/types.d.ts +0 -64
- package/dist/pipeline/types.js +0 -1
- package/dist/plugin/plugin.d.ts +0 -31
- package/dist/plugin/plugin.js +0 -111
- package/dist/queue/inline.driver.d.ts +0 -30
- package/dist/queue/inline.driver.js +0 -58
- package/dist/queue/queue.binding.d.ts +0 -23
- package/dist/queue/queue.binding.js +0 -53
- package/dist/queue/queue.client.d.ts +0 -20
- package/dist/queue/queue.client.js +0 -33
- package/dist/queue/queue.decorators.d.ts +0 -23
- package/dist/queue/queue.decorators.js +0 -46
- package/dist/queue/queue.dispatch.d.ts +0 -36
- package/dist/queue/queue.dispatch.js +0 -102
- package/dist/queue/queue.module.d.ts +0 -32
- package/dist/queue/queue.module.js +0 -80
- package/dist/queue/queue.tokens.d.ts +0 -21
- package/dist/queue/queue.tokens.js +0 -34
- package/dist/queue/queue.types.d.ts +0 -61
- package/dist/queue/queue.types.js +0 -4
- package/dist/registry/index.d.ts +0 -2
- package/dist/registry/index.js +0 -1
- package/dist/registry/metadata.registry.d.ts +0 -73
- package/dist/registry/metadata.registry.js +0 -357
- package/dist/registry/paths.d.ts +0 -3
- package/dist/registry/paths.js +0 -15
- package/dist/registry/types.d.ts +0 -116
- package/dist/registry/types.js +0 -1
- package/dist/registry/util.d.ts +0 -3
- package/dist/registry/util.js +0 -8
- package/dist/schedule/cron-matcher.d.ts +0 -2
- package/dist/schedule/cron-matcher.js +0 -62
- package/dist/schedule/index.d.ts +0 -8
- package/dist/schedule/index.js +0 -5
- package/dist/schedule/schedule.decorators.d.ts +0 -2
- package/dist/schedule/schedule.decorators.js +0 -18
- package/dist/schedule/schedule.module.d.ts +0 -9
- package/dist/schedule/schedule.module.js +0 -28
- package/dist/schedule/schedule.registry.d.ts +0 -23
- package/dist/schedule/schedule.registry.js +0 -63
- package/dist/schedule/schedule.tokens.d.ts +0 -2
- package/dist/schedule/schedule.tokens.js +0 -2
- package/dist/schedule/schedule.types.d.ts +0 -8
- package/dist/schedule/schedule.types.js +0 -1
- package/dist/schedule-node/schedule-node.module.d.ts +0 -9
- package/dist/schedule-node/schedule-node.module.js +0 -28
- package/dist/schedule-node/schedule.executor.d.ts +0 -19
- package/dist/schedule-node/schedule.executor.js +0 -107
- package/dist/seeder/seeder.decorator.d.ts +0 -7
- package/dist/seeder/seeder.decorator.js +0 -15
- package/dist/seeder/seeder.module.d.ts +0 -16
- package/dist/seeder/seeder.module.js +0 -44
- package/dist/seeder/seeder.registry.d.ts +0 -23
- package/dist/seeder/seeder.registry.js +0 -83
- package/dist/seeder/seeder.tokens.d.ts +0 -2
- package/dist/seeder/seeder.tokens.js +0 -1
- package/dist/seeder/seeder.types.d.ts +0 -20
- package/dist/seeder/seeder.types.js +0 -1
- package/dist/serialization/index.d.ts +0 -2
- package/dist/serialization/index.js +0 -2
- package/dist/serialization/serialize.decorator.d.ts +0 -6
- package/dist/serialization/serialize.decorator.js +0 -7
- package/dist/serialization/serializer.interceptor.d.ts +0 -4
- package/dist/serialization/serializer.interceptor.js +0 -16
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -1
- package/dist/services/logger.d.ts +0 -59
- package/dist/services/logger.js +0 -159
- package/dist/storage/path-template.d.ts +0 -9
- package/dist/storage/path-template.js +0 -20
- package/dist/storage/storage.types.d.ts +0 -41
- package/dist/storage/storage.types.js +0 -5
- package/dist/throttler/index.d.ts +0 -6
- package/dist/throttler/index.js +0 -5
- package/dist/throttler/throttler.decorators.d.ts +0 -3
- package/dist/throttler/throttler.decorators.js +0 -4
- package/dist/throttler/throttler.guard.d.ts +0 -9
- package/dist/throttler/throttler.guard.js +0 -72
- package/dist/throttler/throttler.module.d.ts +0 -7
- package/dist/throttler/throttler.module.js +0 -41
- package/dist/throttler/throttler.storage.d.ts +0 -10
- package/dist/throttler/throttler.storage.js +0 -44
- package/dist/throttler/throttler.tokens.d.ts +0 -6
- package/dist/throttler/throttler.tokens.js +0 -5
- package/dist/throttler/throttler.types.d.ts +0 -25
- package/dist/throttler/throttler.types.js +0 -1
- package/dist/validation/create-zod-dto.d.ts +0 -13
- package/dist/validation/create-zod-dto.js +0 -18
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -2
- package/dist/validation/validation.pipe.d.ts +0 -4
- package/dist/validation/validation.pipe.js +0 -19
- package/dist/websocket/websocket.decorators.d.ts +0 -47
- package/dist/websocket/websocket.decorators.js +0 -80
- package/dist/websocket/websocket.module.d.ts +0 -35
- package/dist/websocket/websocket.module.js +0 -63
- package/dist/websocket/websocket.tokens.d.ts +0 -30
- package/dist/websocket/websocket.tokens.js +0 -27
- package/dist/websocket/websocket.types.d.ts +0 -102
- package/dist/websocket/websocket.types.js +0 -4
- package/dist/websocket/ws-argument-resolver.d.ts +0 -13
- package/dist/websocket/ws-argument-resolver.js +0 -40
- package/dist/websocket/ws-dispatcher.d.ts +0 -54
- package/dist/websocket/ws-dispatcher.js +0 -322
- package/dist/websocket/ws-exception.d.ts +0 -16
- package/dist/websocket/ws-exception.js +0 -32
- package/dist/websocket/ws-execution-context.d.ts +0 -9
- package/dist/websocket/ws-execution-context.js +0 -24
- package/dist/websocket/ws-server.d.ts +0 -31
- package/dist/websocket/ws-server.js +0 -74
- package/dist/websocket/ws-sync.d.ts +0 -47
- package/dist/websocket/ws-sync.js +0 -74
- package/dist/websocket-node/node-ws-client.d.ts +0 -24
- package/dist/websocket-node/node-ws-client.js +0 -49
- package/dist/websocket-node/redis-live.d.ts +0 -24
- package/dist/websocket-node/redis-live.js +0 -57
- package/dist/websocket-node/redis-sync.d.ts +0 -33
- package/dist/websocket-node/redis-sync.js +0 -56
- package/dist/websocket-node/register-gateways.d.ts +0 -20
- package/dist/websocket-node/register-gateways.js +0 -61
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-eb5CI6Xn.js","names":["honoCtx","ConfigurableModuleClass","ConfigurableModuleClass","ConfigurableModuleClass","ConfigurableModuleClass","MODULE_OPTIONS_TOKEN","ConfigurableModuleClass"],"sources":["../src/factory.ts","../src/module/graph.ts","../src/openapi/decorators.ts","../src/openapi/zod-to-json-schema.ts","../src/openapi/document.ts","../src/container/mixin.ts","../src/http/lazy-param.decorator.ts","../src/http/ambient.ts","../src/http/request-container.ts","../src/services/logger.ts","../src/config/config.store.ts","../src/config/config.service.ts","../src/config/config.module.ts","../src/config/register-as.ts","../src/fetch/fetch.service.ts","../src/fetch/fetch.module.ts","../src/cors/cors.tokens.ts","../src/cors/cors.module.ts","../src/pipeline/reflector.ts","../src/cache/cache.tokens.ts","../src/cache/cache.interceptor.ts","../src/cache/cache.service.ts","../src/cache/cache.store.ts","../src/cache/cache.module.ts","../src/cache/tiered-cache.store.ts","../src/cache/cache.decorators.ts","../src/module/lazy-provider.ts","../src/event-emitter/event-emitter.service.ts","../src/event-emitter/event-emitter.tokens.ts","../src/event-emitter/event-emitter.subscriber.ts","../src/event-emitter/event-emitter.module.ts","../src/event-emitter/event-emitter.decorators.ts","../src/schedule/schedule.module.ts","../src/schedule/schedule.decorators.ts","../src/health/health.service.ts","../src/health/health.indicator.ts","../src/health/health.http.ts","../src/health/health.module.ts","../src/throttler/throttler.tokens.ts","../src/throttler/throttler.guard.ts","../src/throttler/throttler.storage.ts","../src/throttler/throttler.module.ts","../src/throttler/throttler.decorators.ts","../src/entrypoint/execution-scope.ts","../src/entrypoint/execution-context.ts","../src/pipeline/scoped-components.ts","../src/pipeline/pipes.ts","../src/exceptions/errors.module.ts","../src/validation/create-zod-dto.ts","../src/validation/validation.pipe.ts","../src/serialization/serialize.decorator.ts","../src/serialization/serializer.interceptor.ts"],"sourcesContent":["import { VelaApplication } from './application';\nimport type { Type } from './container/types';\nimport { DiscoveryService } from './discovery/discovery.service';\nimport type { AdapterContext, RuntimeAdapter } from './factory/adapter';\nimport { bootstrap } from './factory/bootstrap';\nimport type { BootstrapOptions } from './factory/bootstrap';\n\nexport interface VelaCreateOptions extends BootstrapOptions {\n /**\n * Runtime adapters binding this app to a platform (Cloudflare bindings,\n * WebSocket transports, …). Their `requestMiddleware` is prepended to the\n * global middleware chain; `onBootstrap`/`onRoutesBuilt` hooks run around\n * route building. See {@link RuntimeAdapter}.\n */\n adapters?: RuntimeAdapter[];\n}\n\nexport const VelaFactory = {\n async create(rootModule: Type, options: VelaCreateOptions = {}): Promise<VelaApplication> {\n const { adapters = [], ...bootstrapOptions } = options;\n\n const adapterMiddleware = adapters.flatMap((a) => a.requestMiddleware ?? []);\n if (adapterMiddleware.length > 0) {\n bootstrapOptions.middleware = [...adapterMiddleware, ...(bootstrapOptions.middleware ?? [])];\n }\n\n const { container, routeManager, loader } = await bootstrap(rootModule, bootstrapOptions);\n\n const app = new VelaApplication(container, routeManager);\n const instances = await loader.resolveAllInstances();\n app.setInstances(instances);\n\n await app.callOnModuleInit();\n await app.callOnApplicationBootstrap();\n\n const adapterContext: AdapterContext = {\n app,\n container,\n routeManager,\n discovery: container.resolve(DiscoveryService),\n };\n for (const adapter of adapters) {\n await adapter.onBootstrap?.(adapterContext);\n }\n\n // Build routes (async — supports route-contributor integration)\n await app.initRoutes();\n\n for (const adapter of adapters) {\n await adapter.onRoutesBuilt?.(adapterContext);\n }\n\n return app;\n },\n};\n","import { ForwardRef } from '../container/types';\nimport type { Type } from '../container/types';\nimport { getModuleMetadata } from './decorators';\nimport type { DynamicModule, ModuleImport } from '../registry/types';\n\nfunction isDynamicModuleLike(value: unknown): value is DynamicModule {\n return (\n !!value &&\n typeof value === 'object' &&\n 'module' in value &&\n typeof (value as DynamicModule).module === 'function'\n );\n}\n\n/**\n * Walks the module dependency graph from a root, unwrapping ForwardRef and\n * dynamic-module imports along the way, and returns every controller\n * reachable from it. Pure metadata read — no Container, no side effects.\n *\n * Used by createOpenApiDocument and any other consumer that needs a\n * controller list without bootstrapping the application.\n */\nexport function collectControllers(rootModule: Type): Type[] {\n const visited = new Set<Type>();\n const controllers = new Set<Type>();\n\n const visit = (entry: ModuleImport | Type | DynamicModule): void => {\n const unwrapped =\n entry instanceof ForwardRef ? (entry.factory() as Type | DynamicModule) : entry;\n const moduleClass = isDynamicModuleLike(unwrapped) ? unwrapped.module : (unwrapped as Type);\n const extraControllers = isDynamicModuleLike(unwrapped) ? (unwrapped.controllers ?? []) : [];\n const extraImports = isDynamicModuleLike(unwrapped) ? (unwrapped.imports ?? []) : [];\n\n if (typeof moduleClass !== 'function' || visited.has(moduleClass)) return;\n visited.add(moduleClass);\n\n const metadata = getModuleMetadata(moduleClass);\n if (metadata) {\n for (const controller of metadata.controllers) controllers.add(controller);\n for (const imp of metadata.imports) visit(imp);\n }\n for (const controller of extraControllers) controllers.add(controller);\n for (const imp of extraImports) visit(imp);\n };\n\n visit(rootModule);\n return [...controllers];\n}\n","import { MetadataRegistry } from '../registry/metadata.registry';\nimport type { Constructor } from '../registry/types';\nimport type { ApiDocMetadata, ApiResponseEntry, ApiResponseOptions } from './types';\n\nexport const API_DOC_METADATA = 'vela:openapi:doc';\nexport const API_TAGS_METADATA = 'vela:openapi:tags';\nexport const API_RESPONSES_METADATA = 'vela:openapi:responses';\n\n/**\n * Attach OpenAPI documentation to a route handler (or controller).\n *\n * ```ts\n * @Get('/:id')\n * @ApiDoc({ summary: 'Get a user', description: '...', operationId: 'getUser' })\n * findOne(@Param('id') id: string) { ... }\n * ```\n */\nexport function ApiDoc(metadata: ApiDocMetadata): MethodDecorator & ClassDecorator {\n return (target: object, propertyKey?: string | symbol) => {\n if (propertyKey !== undefined) {\n MetadataRegistry.setCustomHandlerMeta(\n target.constructor as Constructor,\n propertyKey,\n API_DOC_METADATA,\n metadata,\n );\n } else {\n MetadataRegistry.setCustomClassMeta(target as Constructor, API_DOC_METADATA, metadata);\n }\n };\n}\n\n/**\n * Attach OpenAPI tags to a controller or handler. Handler-level tags merge\n * with controller-level tags; duplicates are de-duplicated in the output.\n */\nexport function ApiTags(...tags: string[]): MethodDecorator & ClassDecorator {\n return (target: object, propertyKey?: string | symbol) => {\n if (propertyKey !== undefined) {\n MetadataRegistry.setCustomHandlerMeta(\n target.constructor as Constructor,\n propertyKey,\n API_TAGS_METADATA,\n tags,\n );\n } else {\n MetadataRegistry.setCustomClassMeta(target as Constructor, API_TAGS_METADATA, tags);\n }\n };\n}\n\nexport function getApiDoc(\n target: object,\n propertyKey?: string | symbol,\n): ApiDocMetadata | undefined {\n if (propertyKey !== undefined) {\n return MetadataRegistry.getCustomHandlerMeta(\n target as Constructor,\n propertyKey,\n API_DOC_METADATA,\n ) as ApiDocMetadata | undefined;\n }\n return MetadataRegistry.getCustomClassMeta(target as Constructor, API_DOC_METADATA) as\n | ApiDocMetadata\n | undefined;\n}\n\nexport function getApiTags(target: object, propertyKey?: string | symbol): string[] | undefined {\n if (propertyKey !== undefined) {\n return MetadataRegistry.getCustomHandlerMeta(\n target as Constructor,\n propertyKey,\n API_TAGS_METADATA,\n ) as string[] | undefined;\n }\n return MetadataRegistry.getCustomClassMeta(target as Constructor, API_TAGS_METADATA) as\n | string[]\n | undefined;\n}\n\n/**\n * Document a response for a given status code. Stackable: apply multiple\n * times on the same handler to declare different statuses.\n *\n * ```ts\n * @Get('/:id')\n * @ApiResponse(200, { description: 'Found', schema: UserDto })\n * @ApiResponse(404, { description: 'Not found', schema: ErrorDto })\n * findOne() { ... }\n * ```\n */\nexport function ApiResponse(status: number | string, options: ApiResponseOptions): MethodDecorator {\n return (target: object, propertyKey: string | symbol) => {\n MetadataRegistry.appendCustomHandlerMeta<ApiResponseEntry>(\n target.constructor as Constructor,\n propertyKey,\n API_RESPONSES_METADATA,\n { status, ...options },\n );\n };\n}\n\nexport function getApiResponses(\n target: object,\n propertyKey: string | symbol,\n): ApiResponseEntry[] | undefined {\n return MetadataRegistry.getCustomHandlerMeta(\n target as Constructor,\n propertyKey,\n API_RESPONSES_METADATA,\n ) as ApiResponseEntry[] | undefined;\n}\n","import type { JsonSchema } from './types';\n\n// Zod v4 exposes `schema.toJSONSchema()` on every schema instance — an\n// authoritative, zero-cost converter. We delegate to it when present and\n// strip the `$schema` meta so the result embeds cleanly into OpenAPI\n// components. For non-Zod schemas (anything that doesn't expose the\n// method) we return an empty (permissive) schema.\n\nfunction stripOpenApiIncompatible(schema: JsonSchema): JsonSchema {\n const out = { ...schema } as Record<string, unknown>;\n delete out.$schema;\n // Zod v4 emits `additionalProperties: false` by default; users rarely\n // want that constraint in their published OpenAPI doc, so leave it in\n // — it's a faithful reflection of the schema. No change here.\n\n if (Array.isArray(out.properties)) {\n // shouldn't happen, but guard\n } else if (out.properties && typeof out.properties === 'object') {\n const props = out.properties as Record<string, JsonSchema>;\n const cleaned: Record<string, JsonSchema> = {};\n for (const [key, val] of Object.entries(props)) {\n cleaned[key] = stripOpenApiIncompatible(val);\n }\n out.properties = cleaned;\n }\n if (out.items && typeof out.items === 'object') {\n out.items = stripOpenApiIncompatible(out.items as JsonSchema);\n }\n return out as JsonSchema;\n}\n\nexport function zodToJsonSchema(schema: unknown): JsonSchema {\n if (!schema || typeof schema !== 'object') return {};\n\n const maybe = (schema as { toJSONSchema?: unknown }).toJSONSchema;\n if (typeof maybe === 'function') {\n try {\n const result = (maybe as () => unknown).call(schema);\n if (result && typeof result === 'object') {\n return stripOpenApiIncompatible(result as JsonSchema);\n }\n } catch {\n // Zod may refuse to convert certain schemas; fall through.\n }\n }\n\n return {};\n}\n\n// Zod v4 and v3 both name constructors `ZodOptional` / `ZodDefault` /\n// `ZodNullable`. Checking the constructor name is cheap and avoids\n// depending on internal `_def` shape.\nfunction ctorName(schema: unknown): string | undefined {\n if (!schema || typeof schema !== 'object') return undefined;\n return (schema as { constructor?: { name?: string } }).constructor?.name;\n}\n\nexport function isOptional(schema: unknown): boolean {\n const name = ctorName(schema);\n return name === 'ZodOptional' || name === 'ZodDefault';\n}\n\nexport function isNullable(schema: unknown): boolean {\n return ctorName(schema) === 'ZodNullable';\n}\n","import { METADATA_KEYS, ParamType } from '../constants';\nimport type { Type } from '../container/types';\nimport { getRouteContributors } from '../http/route-contributor';\nimport { getMetadata } from '../metadata';\nimport { collectControllers } from '../module/graph';\nimport { MetadataRegistry } from '../registry/metadata.registry';\nimport { joinPaths, toOpenApiPath } from '../registry/paths';\nimport type { ParameterMetadata, RouteDefinition } from '../registry/types';\nimport { getApiDoc, getApiResponses, getApiTags } from './decorators';\nimport type {\n CreateOpenApiDocumentOptions,\n HttpVerb,\n JsonSchema,\n OpenApiDocument,\n OpenApiOperation,\n OpenApiParameter,\n OpenApiPathItem,\n OpenApiRequestBody,\n} from './types';\nimport { isOptional, zodToJsonSchema } from './zod-to-json-schema';\n\n/**\n * Tracks DTO classes referenced during document generation and registers\n * each under `components.schemas`. Handles name collisions by suffixing.\n */\nclass ComponentsRegistry {\n private schemas = new Map<string, JsonSchema>();\n private classToKey = new WeakMap<object, string>();\n\n ref(dtoClass: object): { $ref: string } {\n const existing = this.classToKey.get(dtoClass);\n if (existing) return { $ref: `#/components/schemas/${existing}` };\n\n const baseName =\n (dtoClass as { name?: string }).name && (dtoClass as { name: string }).name !== ''\n ? (dtoClass as { name: string }).name\n : 'Schema';\n\n let key = baseName;\n let counter = 2;\n while (this.schemas.has(key)) {\n key = `${baseName}${counter++}`;\n }\n\n this.classToKey.set(dtoClass, key);\n const staticSchema = (dtoClass as { schema?: unknown }).schema;\n this.schemas.set(key, zodToJsonSchema(staticSchema));\n return { $ref: `#/components/schemas/${key}` };\n }\n\n build(): Record<string, JsonSchema> | undefined {\n if (this.schemas.size === 0) return undefined;\n return Object.fromEntries(this.schemas);\n }\n}\n\nfunction isDtoClass(value: unknown): value is { schema: unknown; name?: string } {\n return typeof value === 'function' && (value as { schema?: unknown }).schema != null;\n}\n\nfunction getParamSchema(\n param: ParameterMetadata,\n paramtypes: unknown[] | undefined,\n registry: ComponentsRegistry,\n): JsonSchema | undefined {\n const metatype = param.metatype ?? paramtypes?.[param.index];\n if (!metatype) return undefined;\n if (isDtoClass(metatype)) {\n return registry.ref(metatype) as JsonSchema;\n }\n const maybeSchema = (metatype as { schema?: unknown }).schema;\n if (maybeSchema) {\n return zodToJsonSchema(maybeSchema);\n }\n return undefined;\n}\n\nfunction isParamOptional(param: ParameterMetadata, paramtypes?: unknown[]): boolean {\n const metatype = (param.metatype ?? paramtypes?.[param.index]) as\n | { schema?: unknown }\n | undefined;\n if (metatype?.schema) {\n return isOptional(metatype.schema);\n }\n return true;\n}\n\nfunction isLikelyJsonSchema(value: unknown): value is JsonSchema {\n if (!value || typeof value !== 'object') return false;\n const v = value as Record<string, unknown>;\n if (typeof (v as { toJSONSchema?: unknown }).toJSONSchema === 'function') return false;\n return (\n 'type' in v ||\n '$ref' in v ||\n 'oneOf' in v ||\n 'anyOf' in v ||\n 'allOf' in v ||\n 'enum' in v ||\n 'const' in v\n );\n}\n\nfunction resolveResponseSchema(\n input: unknown,\n registry: ComponentsRegistry,\n): JsonSchema | undefined {\n if (input === undefined || input === null) return undefined;\n\n if (isDtoClass(input)) {\n return registry.ref(input) as JsonSchema;\n }\n\n if (isLikelyJsonSchema(input)) {\n return { ...(input as JsonSchema) };\n }\n\n if (\n typeof input === 'object' &&\n typeof (input as { toJSONSchema?: unknown }).toJSONSchema === 'function'\n ) {\n return zodToJsonSchema(input);\n }\n\n return undefined;\n}\n\nfunction buildOperation(\n controller: Type,\n route: RouteDefinition,\n pathString: string,\n registry: ComponentsRegistry,\n): OpenApiOperation {\n const handlerName = route.handlerName;\n const paramMetadata = MetadataRegistry.getParameters(controller).get(handlerName) ?? [];\n const paramtypes = Reflect.getMetadata('design:paramtypes', controller.prototype, handlerName) as\n | unknown[]\n | undefined;\n\n const parameters: OpenApiParameter[] = [];\n let requestBody: OpenApiRequestBody | undefined;\n\n const declaredPathParams = new Set<string>();\n const pathParamNames = [...pathString.matchAll(/\\{([^}]+)\\}/g)].map((m) => m[1]!);\n\n for (const param of paramMetadata) {\n if (param.type === ParamType.PARAM && param.name) {\n declaredPathParams.add(param.name);\n parameters.push({\n name: param.name,\n in: 'path',\n required: true,\n schema: getParamSchema(param, paramtypes, registry) ?? { type: 'string' },\n });\n } else if (param.type === ParamType.QUERY && param.name) {\n parameters.push({\n name: param.name,\n in: 'query',\n required: !isParamOptional(param, paramtypes),\n schema: getParamSchema(param, paramtypes, registry) ?? { type: 'string' },\n });\n } else if (param.type === ParamType.HEADERS && param.name) {\n parameters.push({\n name: param.name,\n in: 'header',\n required: !isParamOptional(param, paramtypes),\n schema: getParamSchema(param, paramtypes, registry) ?? { type: 'string' },\n });\n } else if (param.type === ParamType.BODY) {\n const schema = getParamSchema(param, paramtypes, registry);\n if (schema) {\n requestBody = {\n required: !isParamOptional(param, paramtypes),\n content: { 'application/json': { schema } },\n };\n }\n }\n }\n\n for (const name of pathParamNames) {\n if (!declaredPathParams.has(name)) {\n parameters.push({ name, in: 'path', required: true, schema: { type: 'string' } });\n }\n }\n\n const docMeta = getApiDoc(controller, handlerName);\n const controllerTags = getApiTags(controller) ?? [];\n const handlerTags = getApiTags(controller, handlerName) ?? [];\n const docTags = docMeta?.tags ?? [];\n const mergedTags = [...new Set([...controllerTags, ...handlerTags, ...docTags])];\n\n const responses: Record<\n string,\n { description: string; content?: Record<string, { schema: JsonSchema }> }\n > = {\n '200': { description: 'OK' },\n };\n\n const apiResponses = getApiResponses(controller, handlerName) ?? [];\n for (const entry of apiResponses) {\n const key = String(entry.status);\n const resolved: { description: string; content?: Record<string, { schema: JsonSchema }> } = {\n description: entry.description,\n };\n const schema = resolveResponseSchema(entry.schema, registry);\n if (schema) {\n resolved.content = { 'application/json': { schema } };\n }\n responses[key] = resolved;\n }\n\n const operation: OpenApiOperation = { responses };\n\n if (parameters.length > 0) operation.parameters = parameters;\n if (requestBody) operation.requestBody = requestBody;\n if (docMeta?.summary) operation.summary = docMeta.summary;\n if (docMeta?.description) operation.description = docMeta.description;\n const operationId = docMeta?.operationId ?? route.name;\n if (operationId) operation.operationId = operationId;\n if (docMeta?.deprecated) operation.deprecated = docMeta.deprecated;\n if (mergedTags.length > 0) operation.tags = mergedTags;\n\n return operation;\n}\n\nconst VERB_WHITELIST: ReadonlySet<HttpVerb> = new Set([\n 'get',\n 'post',\n 'put',\n 'patch',\n 'delete',\n 'options',\n 'head',\n]);\n\nexport function createOpenApiDocument(\n rootModule: Type,\n options: CreateOpenApiDocumentOptions = {},\n): OpenApiDocument {\n const paths: Record<string, OpenApiPathItem> = {};\n const globalPrefix = options.globalPrefix ?? '';\n const registry = new ComponentsRegistry();\n\n const controllers = collectControllers(rootModule);\n\n for (const controller of controllers) {\n const controllerPath = MetadataRegistry.getControllerPath(controller as Type);\n const routes = MetadataRegistry.getRoutes(controller as Type);\n\n for (const route of routes) {\n const method = route.method.toLowerCase() as HttpVerb;\n if (!VERB_WHITELIST.has(method)) continue;\n\n const rawPath = joinPaths(joinPaths(globalPrefix, controllerPath), route.path);\n const pathString = toOpenApiPath(rawPath);\n\n const operation = buildOperation(controller, route, pathString, registry);\n const pathItem = paths[pathString] ?? {};\n pathItem[method] = operation;\n paths[pathString] = pathItem;\n }\n }\n\n // Second pass: include contributor-generated routes (e.g. `@Crud()` via\n // `@velajs/crud`'s registered RouteContributor). Silent when no contributor\n // is registered or no controller carries claiming metadata, so consumers\n // without contributor packages see no behavioral change.\n for (const contributor of getRouteContributors()) {\n if (!contributor.buildOpenApiPaths) continue;\n for (const controller of controllers) {\n const meta = getMetadata(contributor.claimsMetaKey, controller as Type);\n if (meta === undefined) continue;\n\n const controllerPrefix = MetadataRegistry.getControllerPath(controller as Type);\n const contributedPaths = contributor.buildOpenApiPaths({\n controller: controller as Type,\n meta,\n globalPrefix,\n controllerPrefix,\n });\n\n for (const [pathKey, pathItem] of Object.entries(contributedPaths)) {\n // Verb-level merge: a hand-written `@Get('/')` on the same controller\n // is preserved when the contributor adds `post`/`patch`/etc. on the\n // same path key.\n paths[pathKey] = { ...(paths[pathKey] ?? {}), ...pathItem };\n }\n }\n }\n\n // Aggregate the document-root `tags` array. NestJS declares tag\n // groups/descriptions/order via `DocumentBuilder().addTag(name, desc)`\n // while its scanner auto-collects operation tags; we wire both halves\n // here. Walk every operation's `tags` in first-seen order (stable: paths\n // insertion order, then verb order), then merge with `options.tags`\n // (caller-declared tags first — preserving their order + descriptions —\n // followed by any purely-collected tag not already declared, as `{ name }`).\n const seenTagNames = new Set<string>();\n const collectedTagNames: string[] = [];\n for (const pathItem of Object.values(paths)) {\n for (const verb of VERB_WHITELIST) {\n const operation = pathItem[verb];\n if (!operation?.tags) continue;\n for (const tagName of operation.tags) {\n if (seenTagNames.has(tagName)) continue;\n seenTagNames.add(tagName);\n collectedTagNames.push(tagName);\n }\n }\n }\n\n const declaredTags = options.tags ?? [];\n const declaredTagNames = new Set(declaredTags.map((t) => t.name));\n const tags: Array<{ name: string; description?: string }> = [\n ...declaredTags,\n ...collectedTagNames.filter((name) => !declaredTagNames.has(name)).map((name) => ({ name })),\n ];\n\n const document: OpenApiDocument = {\n openapi: '3.1.0',\n info: {\n title: options.info?.title ?? 'Vela API',\n version: options.info?.version ?? '1.0.0',\n ...(options.info?.description ? { description: options.info.description } : {}),\n },\n // servers sits between info and paths (OpenAPI convention). Omitted when\n // the caller passes none, mirroring the components/tags handling below.\n ...(options.servers?.length ? { servers: options.servers } : {}),\n paths,\n };\n\n // components.schemas (generated from DTOs) and components.securitySchemes\n // (caller-supplied) share the same `components` object — attach it when\n // either is present so neither clobbers the other.\n const schemas = registry.build();\n if (schemas || options.securitySchemes) {\n document.components = {\n ...(schemas ? { schemas } : {}),\n ...(options.securitySchemes ? { securitySchemes: options.securitySchemes } : {}),\n };\n }\n\n // Document-level default security requirements (each operation may override).\n // Omitted entirely when the caller passes none.\n if (options.security?.length) {\n document.security = options.security;\n }\n\n // Only attach `tags` when non-empty. Emitting `tags: []` on a tag-less\n // spec is the exact symptom the consumer reported, so omit the key\n // entirely in that case (mirrors the `components` handling above).\n if (tags.length > 0) {\n document.tags = tags;\n }\n\n return document;\n}\n","import { Injectable } from './decorators';\nimport type { Type } from './types';\n\n/**\n * Creates a reusable injectable mixin class from a base class.\n * Applies @Injectable() so the returned class can be registered as a provider.\n *\n * @example\n * ```ts\n * function RoleGuardMixin(role: string) {\n * class MixedRoleGuard implements CanActivate {\n * canActivate(ctx: ExecutionContext) {\n * return ctx.getRequest().headers.get('x-role') === role;\n * }\n * }\n * return mixin(MixedRoleGuard);\n * }\n *\n * const AdminGuard = RoleGuardMixin('admin');\n *\n * @UseGuards(AdminGuard)\n * @Get('/admin')\n * adminOnly() { ... }\n * ```\n */\nexport function mixin<T>(mixinClass: Type<T>): Type<T> {\n Injectable()(mixinClass);\n return mixinClass;\n}\n","import { ParamType } from '../constants';\nimport { MetadataRegistry } from '../registry/metadata.registry';\nimport type { Constructor, PipeType, Type } from '../registry/types';\nimport type { ExecutionContext } from '../pipeline/types';\nimport { buildExecutionContext } from './execution-context';\n\nconst CUSTOM_PARAM_TYPE = 'custom';\n\n/**\n * Factory for parameter decorators whose value materializes lazily — the\n * factory does not run during argument extraction; it runs the first time\n * the handler reads a property on the resolved value.\n *\n * Why this exists: vela's argument resolver runs *before* guards\n * (handler-executor order: extract args → guards → handler). A custom\n * `createParamDecorator` factory that depends on guard-populated state\n * (e.g. a value a guard places into `REQUEST_CONTEXT`) therefore observes\n * an empty slot. `createLazyParamDecorator` defers factory execution to\n * first property access on the proxied result, by which point guards have\n * run and the slot is populated.\n *\n * The proxy explicitly short-circuits `prop === 'then'` so `await value`\n * does not consider the proxy a thenable, which would otherwise trigger\n * eager resolution. This single invariant is what makes the helper safe to\n * pass through `async` boundaries without surprise.\n *\n * @example\n * ```ts\n * const CurrentUser = createLazyParamDecorator(\n * (_data: unknown, ctx: ExecutionContext) => {\n * const reqCtx = ctx.getContext().get('container').resolve(REQUEST_CONTEXT);\n * return reqCtx.get('user'); // populated by AuthGuard\n * },\n * );\n *\n * @UseGuards(AuthGuard)\n * @Get('/me')\n * me(@CurrentUser() user: User) {\n * return { id: user.id }; // factory runs here, after AuthGuard\n * }\n * ```\n */\nexport function createLazyParamDecorator<TData = unknown>(\n factory: (data: TData, ctx: ExecutionContext) => unknown,\n): (data?: TData, ...pipes: PipeType[]) => ParameterDecorator {\n return (data?: TData, ...pipes: PipeType[]): ParameterDecorator => {\n return (target: object, propertyKey: string | symbol | undefined, parameterIndex: number) => {\n if (propertyKey === undefined) {\n throw new Error('Parameter decorators can only be used on method parameters');\n }\n\n MetadataRegistry.addParameter(target.constructor as Constructor, propertyKey, {\n index: parameterIndex,\n type: CUSTOM_PARAM_TYPE,\n name: undefined,\n factory: (_unused: unknown, ctx: unknown) => {\n const honoCtx = ctx as import('hono').Context;\n const execCtx = buildExecutionContext(honoCtx, target.constructor as Type, propertyKey);\n return createLazyProxy(() => factory(data as TData, execCtx));\n },\n ...(pipes.length > 0 ? { pipes } : {}),\n });\n };\n };\n}\n\n// Single-shot resolution: the factory runs at most once; subsequent reads\n// share the cached real value. The proxy's traps all funnel through\n// `materialize` to keep that invariant in one place.\nfunction createLazyProxy<T>(produce: () => T): T {\n let resolved = false;\n let value: unknown;\n\n const materialize = (): unknown => {\n if (!resolved) {\n value = produce();\n resolved = true;\n }\n return value;\n };\n\n // Target is an empty null-prototype object — proxies still need a\n // backing target for the runtime to forward to, but using a real object\n // would leak its own properties (`hasOwnProperty`, etc.) into trap\n // results. `Object.create(null)` keeps the namespace clean.\n const target = Object.create(null) as object;\n\n const handler: ProxyHandler<object> = {\n get(_t, prop, receiver) {\n // Critical: do NOT report the proxy as thenable. If we let the JS\n // runtime read `then` (during `await proxy`), the engine would\n // observe a function-shaped value, treat the proxy as a promise,\n // call `then(resolve, reject)` and trigger eager resolution before\n // the consumer ever touches a real property. Returning `undefined`\n // here makes `await proxy` return the proxy itself, untouched.\n if (prop === 'then') return undefined;\n\n const real = materialize();\n if (real === null || real === undefined) return undefined;\n\n const descriptor = Reflect.get(real as object, prop, receiver);\n // Bind functions back to the real target so `this` works as the\n // consumer expects on instance methods.\n if (typeof descriptor === 'function') {\n return descriptor.bind(real);\n }\n return descriptor;\n },\n\n has(_t, prop) {\n const real = materialize();\n return real !== null && real !== undefined && Reflect.has(real as object, prop);\n },\n\n ownKeys() {\n const real = materialize();\n if (real === null || real === undefined) return [];\n return Reflect.ownKeys(real as object);\n },\n\n getOwnPropertyDescriptor(_t, prop) {\n const real = materialize();\n if (real === null || real === undefined) return undefined;\n const descriptor = Reflect.getOwnPropertyDescriptor(real as object, prop);\n // Proxy invariants require returned descriptors to be configurable\n // when the underlying target lacks the property, which is always\n // true for our null-prototype empty target.\n if (descriptor) descriptor.configurable = true;\n return descriptor;\n },\n };\n\n return new Proxy(target, handler) as T;\n}\n","import type { Context, MiddlewareHandler } from 'hono';\nimport { contextStorage, getContext } from 'hono/context-storage';\nimport type { Container } from '../container/container';\nimport { REQUEST_CONTEXT, type RequestContext } from './request-context';\n\n// Opt-in ambient access to the per-request DI container / RequestContext,\n// for deep code that lacks the Hono `Context` (services, standalone helpers).\n//\n// Portable across vela's target runtimes because the `node:async_hooks`\n// dependency lives inside Hono's `contextStorage()` middleware — vela's own\n// source never imports `node:*`. Uses only the workerd-safe ALS subset\n// (`run()`/`getStore()`); no `enterWith`, no cross-thenable propagation.\n//\n// Default path is unchanged: request scope is still carried by the per-request\n// child container (see RouteManager.getRequestContainer). This is a second\n// READ path, active only when enabled.\n\n/**\n * Returns Hono's `contextStorage()` middleware. Register it as the FIRST global\n * middleware so `getCurrentContainer()` works everywhere downstream. When using\n * `VelaFactory.create(module, { ambientContainer: true })` this is wired\n * automatically — call this only for manual/raw Hono setups.\n */\nexport function enableAmbientContainer(): MiddlewareHandler {\n return contextStorage();\n}\n\nfunction tryGetContext(): Context | undefined {\n try {\n return getContext();\n } catch {\n // Thrown when called outside the contextStorage() middleware (i.e. ambient\n // access not enabled, or outside a request).\n return undefined;\n }\n}\n\n/**\n * The current request's DI container. Throws with actionable guidance if\n * ambient access isn't enabled or this runs outside a request.\n */\nexport function getCurrentContainer(): Container {\n const context = tryGetContext();\n const container = context?.get('container') as Container | undefined;\n if (!container) {\n throw new Error(\n 'getCurrentContainer() is unavailable: enable ambient access via ' +\n 'VelaFactory.create(module, { ambientContainer: true }) (or app.use(enableAmbientContainer())) ' +\n 'and only call it within a request.',\n );\n }\n return container;\n}\n\n/** The current request's {@link RequestContext} (via the ambient container). */\nexport function getCurrentRequestContext(): RequestContext {\n return getCurrentContainer().resolve(REQUEST_CONTEXT);\n}\n","import type { Context } from 'hono';\nimport type { Container } from '../container/container';\n\n/**\n * Returns the request-scoped child container for the current request.\n *\n * `@Inject(Container)` resolves the ROOT container (request children share the\n * provider map and never rebind `Container`), so module authors who need\n * request-scoped resolution from inside a handler, param-decorator factory, or\n * scoped middleware must read the child seeded by RouteManager instead. The\n * child is created before guards, pipes, params, and handlers run, so it is\n * always present on the Vela request path.\n *\n * Throws outside a Vela-managed request rather than materializing an orphan\n * child (mirrors the REQUEST_CONTEXT fail-fast).\n */\nexport function getRequestContainer(c: Context): Container {\n const container = c.get('container') as Container | undefined;\n if (!container) {\n throw new Error(\n 'getRequestContainer(c) can only be called inside a Vela-managed request — ' +\n 'the request child container is seeded by RouteManager when the request enters the pipeline.',\n );\n }\n return container;\n}\n","import { Injectable } from '../container/decorators';\n\nexport const LogLevel = {\n VERBOSE: 0,\n DEBUG: 1,\n LOG: 2,\n WARN: 3,\n ERROR: 4,\n SILENT: 5,\n} as const;\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n\nexport interface LoggerService {\n log(message: unknown, ...optionalParams: unknown[]): void;\n error(message: unknown, ...optionalParams: unknown[]): void;\n warn(message: unknown, ...optionalParams: unknown[]): void;\n debug?(message: unknown, ...optionalParams: unknown[]): void;\n verbose?(message: unknown, ...optionalParams: unknown[]): void;\n}\n\nexport type ContextProvider = () => Record<string, unknown>;\n\nexport type LoggerLevelName = 'LOG' | 'ERROR' | 'WARN' | 'DEBUG' | 'VERBOSE';\n\nexport type Writer = (level: LoggerLevelName, line: string, ...rest: unknown[]) => void;\n\nconst defaultWriter: Writer = (level, line, ...rest) => {\n if (level === 'ERROR') return console.error(line, ...rest);\n if (level === 'WARN') return console.warn(line, ...rest);\n if (level === 'DEBUG' || level === 'VERBOSE') return console.debug(line, ...rest);\n return console.log(line, ...rest);\n};\n\nfunction formatValue(v: unknown): string {\n if (typeof v === 'string') {\n return /[\\s=\"\\\\]/.test(v) ? JSON.stringify(v) : v;\n }\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n try {\n return JSON.stringify(v);\n } catch {\n return String(v);\n }\n}\n\n@Injectable()\nexport class Logger implements LoggerService {\n static level: LogLevel = LogLevel.LOG;\n\n private static globalLogger: LoggerService | false | undefined;\n private static globalContextProviders: ContextProvider[] = [];\n private static globalWriter: Writer = defaultWriter;\n\n private context?: string;\n private instanceContextProviders: ContextProvider[] = [];\n private instanceWriter?: Writer;\n\n static setLogLevel(level: LogLevel): void {\n Logger.level = level;\n }\n\n static overrideLogger(logger: LoggerService | false): void {\n Logger.globalLogger = logger;\n }\n\n /** Register a context provider run on every log line from every logger. */\n static addContextProvider(provider: ContextProvider): void {\n Logger.globalContextProviders.push(provider);\n }\n\n /** Remove all registered global context providers. */\n static clearContextProviders(): void {\n Logger.globalContextProviders = [];\n }\n\n /** Replace the default console writer. Useful on edge runtimes that have\n * a different output sink (e.g. `env.LOGS.writeDataPoint` on Workers). */\n static setWriter(writer: Writer): void {\n Logger.globalWriter = writer;\n }\n\n /** Restore the default console-based writer. */\n static resetWriter(): void {\n Logger.globalWriter = defaultWriter;\n }\n\n constructor(context?: string) {\n if (context) {\n this.context = context;\n }\n }\n\n setContext(context: string): void {\n this.context = context;\n }\n\n /** Add a context provider that runs only for THIS logger instance.\n * Children created via extend() inherit these providers by copy. */\n addContextProvider(provider: ContextProvider): this {\n this.instanceContextProviders.push(provider);\n return this;\n }\n\n /** Override the writer for this logger (and any extend() children). */\n setWriter(writer: Writer): this {\n this.instanceWriter = writer;\n return this;\n }\n\n /** Create a child logger with a nested namespace. Context becomes\n * `parent:child`; instance-level providers and writers are inherited\n * by copy so later mutations on either logger stay isolated. */\n extend(namespace: string): Logger {\n const newContext = this.context ? `${this.context}:${namespace}` : namespace;\n const child = new Logger(newContext);\n child.instanceContextProviders = [...this.instanceContextProviders];\n if (this.instanceWriter) child.instanceWriter = this.instanceWriter;\n return child;\n }\n\n log(message: unknown, ...optionalParams: unknown[]): void {\n this.emit('LOG', LogLevel.LOG, message, optionalParams);\n }\n\n error(message: unknown, ...optionalParams: unknown[]): void {\n this.emit('ERROR', LogLevel.ERROR, message, optionalParams);\n }\n\n warn(message: unknown, ...optionalParams: unknown[]): void {\n this.emit('WARN', LogLevel.WARN, message, optionalParams);\n }\n\n debug(message: unknown, ...optionalParams: unknown[]): void {\n this.emit('DEBUG', LogLevel.DEBUG, message, optionalParams);\n }\n\n verbose(message: unknown, ...optionalParams: unknown[]): void {\n this.emit('VERBOSE', LogLevel.VERBOSE, message, optionalParams);\n }\n\n private emit(\n levelName: LoggerLevelName,\n levelValue: LogLevel,\n message: unknown,\n rest: unknown[],\n ): void {\n if (Logger.level > levelValue) return;\n if (Logger.globalLogger === false) return;\n\n if (Logger.globalLogger) {\n const method = levelName.toLowerCase() as keyof LoggerService;\n const fn = Logger.globalLogger[method] as\n | ((message: unknown, ...optionalParams: unknown[]) => void)\n | undefined;\n if (fn) fn.call(Logger.globalLogger, message, ...rest);\n return;\n }\n\n const line = this.formatMessage(levelName, message);\n const writer = this.instanceWriter ?? Logger.globalWriter;\n writer(levelName, line, ...rest);\n }\n\n private formatMessage(level: string, message: unknown): string {\n const timestamp = new Date().toISOString();\n const ctx = this.context ? ` [${this.context}]` : '';\n const contextStr = this.formatContextObj(this.collectContext());\n return `[Vela] ${timestamp} ${level}${ctx} ${message}${contextStr}`;\n }\n\n private collectContext(): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const provider of Logger.globalContextProviders) {\n try {\n Object.assign(result, provider());\n } catch {\n // Provider threw; drop its contribution and keep going.\n }\n }\n for (const provider of this.instanceContextProviders) {\n try {\n Object.assign(result, provider());\n } catch {\n // Same — never let a provider break logging.\n }\n }\n return result;\n }\n\n private formatContextObj(obj: Record<string, unknown>): string {\n const parts: string[] = [];\n for (const key of Object.keys(obj)) {\n const value = obj[key];\n if (value === undefined || value === null) continue;\n parts.push(`${key}=${formatValue(value)}`);\n }\n return parts.length > 0 ? ` ${parts.join(' ')}` : '';\n }\n}\n","import { Injectable } from '../container/decorators';\nimport type { Container } from '../container/container';\nimport type { Token } from '../container/types';\nimport type { ConfigSchema } from './config.types';\nimport type { AnyConfigNamespace } from './register-as';\n\n/** Prototype-pollution guard for dot-notation segments. */\nconst DANGEROUS_KEYS = new Set(['__proto__', 'constructor', 'prototype']);\n\nfunction runSchema(schema: ConfigSchema, config: Record<string, unknown>): void {\n if (typeof schema === 'function') {\n schema(config);\n return;\n }\n if (schema && typeof schema.parse === 'function') {\n schema.parse(config);\n return;\n }\n throw new Error('ConfigModule `validateSchema` must be a function or expose a `parse()` method');\n}\n\n/**\n * Singleton source of truth for merged configuration.\n *\n * Holds the flat `config` record plus a `namespace → KEY` map. Namespaces are\n * resolved LAZILY — the KEY is pulled from the container on the first read of\n * that namespace and cached — so the store never forces namespace factories to\n * materialize at construction. Resolution uses the synchronous container seam\n * (`resolve`), which stays compatible with lazy modules.\n *\n * The merged shape is `{ ...config, [ns]: value }` — a namespace shadows a flat\n * key of the same name.\n *\n * Constructed via a factory provider in {@link ConfigModule} so it can close\n * over the `load` list and `validateSchema` without extra tokens.\n */\n@Injectable()\nexport class ConfigStore {\n private readonly namespaceKeys = new Map<string, Token>();\n private readonly cache = new Map<string, unknown>();\n private validated = false;\n private validationError: unknown;\n\n constructor(\n private readonly container: Pick<Container, 'resolve'>,\n private readonly config: Record<string, unknown> = {},\n namespaces: ReadonlyArray<AnyConfigNamespace> = [],\n private readonly validateSchema?: ConfigSchema,\n ) {\n for (const ns of namespaces) {\n this.namespaceKeys.set(ns.namespace, ns.KEY as unknown as Token);\n }\n }\n\n /** Read a value by dot-notation path; `undefined` if absent. */\n get(path: string): unknown {\n this.ensureValidated();\n return this.read(path);\n }\n\n /** Read a value by dot-notation path; throws if absent. */\n getOrThrow(path: string): unknown {\n const value = this.get(path);\n if (value === undefined) {\n throw new Error(`Configuration key \"${path}\" was not found`);\n }\n return value;\n }\n\n /** Whether a dot-notation path resolves to a defined value. */\n has(path: string): boolean {\n this.ensureValidated();\n return this.read(path) !== undefined;\n }\n\n /** The full merged config object (flat record + resolved namespaces). */\n all(): Record<string, unknown> {\n this.ensureValidated();\n return this.merged();\n }\n\n private read(path: string): unknown {\n const [head, ...rest] = path.split('.');\n if (head === undefined || DANGEROUS_KEYS.has(head)) return undefined;\n\n let current: unknown = this.namespaceKeys.has(head)\n ? this.resolveNamespace(head)\n : this.config[head];\n\n for (const key of rest) {\n if (DANGEROUS_KEYS.has(key)) return undefined;\n if (current === null || current === undefined || typeof current !== 'object') {\n return undefined;\n }\n current = (current as Record<string, unknown>)[key];\n }\n return current;\n }\n\n /** Resolve a namespace's KEY through the container on first use, then cache. */\n private resolveNamespace(namespace: string): unknown {\n if (this.cache.has(namespace)) return this.cache.get(namespace);\n const key = this.namespaceKeys.get(namespace);\n const value = key === undefined ? undefined : this.container.resolve(key);\n this.cache.set(namespace, value);\n return value;\n }\n\n private merged(): Record<string, unknown> {\n const out: Record<string, unknown> = { ...this.config };\n for (const namespace of this.namespaceKeys.keys()) {\n out[namespace] = this.resolveNamespace(namespace);\n }\n return out;\n }\n\n /**\n * Validate the merged config once, on first read. Deferred (not at bootstrap)\n * because the merged shape needs namespace factories — and their env — which\n * are only available after bootstrap on edge runtimes.\n */\n private ensureValidated(): void {\n if (this.validated) {\n if (this.validationError) throw this.validationError; // fail-closed on every read\n return;\n }\n this.validated = true; // run the schema exactly once\n if (!this.validateSchema) return;\n try {\n runSchema(this.validateSchema, this.merged());\n } catch (err) {\n this.validationError = err;\n throw err;\n }\n }\n}\n","import { Injectable, Inject } from '../container/decorators';\nimport { ConfigStore } from './config.store';\nimport type { ConfigPath, ConfigPathValue } from './config.types';\n\n/**\n * Typed, dot-notation reads over the merged config. Stays a singleton (NestJS\n * parity); delegates to the {@link ConfigStore}. Pass `ConfigType<[...]>` as the\n * generic to type namespaced paths (`cfg.get('database.url')` → `string`).\n */\n@Injectable()\nexport class ConfigService<T extends Record<string, unknown> = Record<string, unknown>> {\n constructor(@Inject(ConfigStore) private readonly store: ConfigStore) {}\n\n /** Read a config value; `undefined` when absent, or the supplied default. */\n get<P extends ConfigPath<T>>(path: P): ConfigPathValue<T, P> | undefined;\n get<P extends ConfigPath<T>>(path: P, defaultValue: ConfigPathValue<T, P>): ConfigPathValue<T, P>;\n get(path: string, defaultValue?: unknown): unknown {\n const value = this.store.get(path);\n return value === undefined ? defaultValue : value;\n }\n\n /** Read a config value; throws when the path is absent. */\n getOrThrow<P extends ConfigPath<T>>(path: P): ConfigPathValue<T, P> {\n return this.store.getOrThrow(path) as ConfigPathValue<T, P>;\n }\n\n /** Whether a config path resolves to a defined value. */\n has<P extends ConfigPath<T>>(path: P): boolean {\n return this.store.has(path);\n }\n\n /** The full merged config object (flat record + resolved namespaces). */\n getAll(): T {\n return this.store.all() as T;\n }\n}\n","import { Container } from '../container/container';\nimport type { DynamicModule } from '../module/types';\nimport { defineModule } from '../module/define-module';\nimport { ConfigService } from './config.service';\nimport { ConfigStore } from './config.store';\nimport { CONFIG_OPTIONS } from './config.tokens';\nimport type { ConfigModuleOptions } from './config.types';\nimport type { AnyConfigNamespace } from './register-as';\n\n/**\n * Carrier for the namespace `asProvider()` KEY providers ONLY. Split out of\n * ConfigModule and marked `lazy: true` so those factories — which inject\n * `CONFIG_ENV`, live per-request on edge runtimes — never run at bootstrap.\n * ConfigModule itself stays EAGER (see below).\n */\nclass ConfigNamespacesModule {}\n\n/**\n * Build the lazy sub-module holding one KEY provider per namespace. Its `key`\n * is derived from the owning ConfigModule instance key so multiple ConfigModule\n * instances get distinct sub-module instances (no import-dedup collision).\n */\nfunction namespacesSubModule(load: AnyConfigNamespace[], key: string): DynamicModule {\n return {\n module: ConfigNamespacesModule,\n key: `config-ns:${key}`,\n lazy: true,\n providers: load.map((namespace) => namespace.asProvider()),\n exports: load.map((namespace) => namespace.KEY),\n };\n}\n\n// Rebuilt on `defineModule` (the blessed engine — CLAUDE.md: changed modules\n// use it). ConfigModule is EAGER: `ConfigService`, `ConfigStore`, and\n// `CONFIG_OPTIONS` construct at bootstrap, so a `forRootAsync` async\n// `useFactory` resolves in the awaited bootstrap pass and a *synchronous*\n// `app.get(ConfigService)` afterwards returns the cached singleton (no drain).\n//\n// ONLY the namespace `asProvider()` KEY providers are deferred — they move into\n// a LAZY sub-module (`ConfigNamespacesModule`) that ConfigModule imports and\n// re-exports. Their factories inject `CONFIG_ENV` (live per-request on edge\n// runtimes), so construction must not happen at bootstrap. `ConfigStore`\n// resolves each KEY through the container on first `get()`; that first\n// resolution claims + sync-drains the sub-module (namespace factories are\n// synchronous, so the sync seam is safe). `resolveAllInstances` treats the KEY\n// tokens as lazy-only (they belong solely to the lazy sub-module) and skips\n// them at bootstrap.\nconst { ConfigurableModuleClass } = defineModule<ConfigModuleOptions>({\n name: 'Config',\n setup: ({ OPTIONS, options, key }) => {\n const load = (options.load ?? []) as AnyConfigNamespace[];\n const { validateSchema } = options;\n return {\n // Lazy sub-module carries the KEY providers; re-exported below so direct\n // `@Inject(ns.KEY)` and `ConfigStore`'s container lookup both reach them.\n imports: load.length > 0 ? [namespacesSubModule(load, key)] : [],\n providers: [\n {\n // Flat config record. `validate` is applied here for the async path;\n // `forRoot` pre-validates eagerly and strips it (see the override).\n provide: CONFIG_OPTIONS,\n useFactory: (opts: ConfigModuleOptions) =>\n opts.validate ? opts.validate(opts.config ?? {}) : (opts.config ?? {}),\n inject: [OPTIONS],\n },\n {\n // Factory-provided so the store closes over the namespace list +\n // schema; it resolves each namespace's KEY lazily via the container.\n provide: ConfigStore,\n useFactory: (container: Container, config: Record<string, unknown>) =>\n new ConfigStore(container, config, load, validateSchema),\n inject: [Container, CONFIG_OPTIONS],\n },\n ConfigService,\n ],\n exports: [ConfigService, ConfigStore, CONFIG_OPTIONS, ...load.map((n) => n.KEY)],\n };\n },\n});\n\nexport class ConfigModule extends ConfigurableModuleClass {\n /**\n * Preserve (a) per-call generic inference over the flat config record and\n * (b) the eager-validation contract: `validate` runs at call time so bad\n * config fails fast, then is stripped so the derived `CONFIG_OPTIONS`\n * provider is a passthrough (no double validation). `validateSchema` (the\n * merged-config schema) is deferred to first read — its input needs env.\n */\n static forRoot<T extends Record<string, unknown>>(\n options: ConfigModuleOptions<T> & { isGlobal?: boolean; key?: string } = {},\n ): DynamicModule {\n const validatedConfig = options.validate\n ? options.validate(options.config ?? ({} as T))\n : options.config;\n const { validate: _validate, ...rest } = options;\n return super.forRoot({ ...rest, config: validatedConfig } as ConfigModuleOptions & {\n isGlobal?: boolean;\n key?: string;\n });\n }\n}\n","// Config-namespace registration. Design ported from stratal's `registerAs`\n// (MIT, © Temitayo Fadojutimi) and reworked for vela's multi-runtime DI: env\n// enters through the `CONFIG_ENV` token instead of a Cloudflare-specific one.\nimport type { InjectionToken, ProviderOptions } from '../container/types';\nimport { CONFIG_ENV } from './config.tokens';\n\n/**\n * The result of {@link registerAs}: a namespaced config factory plus the DI\n * token it is provided under.\n */\nexport interface ConfigNamespace<\n TKey extends string = string,\n TEnv = Record<string, unknown>,\n TConfig extends object = object,\n> {\n /** Injection token for this namespace's resolved config (`Symbol.for('vela:config:<ns>')`). */\n readonly KEY: InjectionToken<TConfig>;\n /** The namespace name (e.g. `'database'`). */\n readonly namespace: TKey;\n /** Factory receiving the ambient env and returning the namespace config. */\n readonly factory: (env: TEnv) => TConfig;\n /** Provider registration injecting {@link CONFIG_ENV} — spread into a module's providers. */\n asProvider(): ProviderOptions<TConfig>;\n}\n\n/** Any config namespace — structural typing for the module `load` list. */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyConfigNamespace = ConfigNamespace<string, any, object>;\n\n/**\n * Create a namespaced configuration factory (NestJS `registerAs` parity).\n *\n * The `KEY` is minted with `Symbol.for` so it keeps a stable identity across\n * module re-evaluation (HMR / repeated imports) — a fresh `InjectionToken`\n * would mint a new identity each eval and break dedup. It is typed as\n * `InjectionToken<TConfig>` purely for injection-site DX.\n *\n * @example\n * ```ts\n * export const dbConfig = registerAs('database', (env: Env) => ({\n * url: env.DATABASE_URL,\n * pool: 10,\n * }));\n * // ConfigModule.forRoot({ load: [dbConfig] });\n * // cfg.get('database.url'); // via ConfigService\n * // constructor(@Inject(dbConfig.KEY) db: InferConfigType<typeof dbConfig>) {}\n * ```\n */\nexport function registerAs<TKey extends string, TEnv, TConfig extends object>(\n namespace: TKey,\n factory: (env: TEnv) => TConfig,\n): ConfigNamespace<TKey, TEnv, TConfig> {\n const KEY = Symbol.for(`vela:config:${namespace}`) as unknown as InjectionToken<TConfig>;\n return {\n KEY,\n namespace,\n factory,\n asProvider(): ProviderOptions<TConfig> {\n return { provide: KEY, useFactory: factory, inject: [CONFIG_ENV] };\n },\n };\n}\n\n/**\n * Extract a namespace's config shape from a {@link registerAs} result.\n *\n * @example `type Db = InferConfigType<typeof dbConfig>` → `{ url: string; pool: number }`\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type InferConfigType<T> = T extends ConfigNamespace<string, any, infer C> ? C : never;\n\n/**\n * Zero-codegen typed config shape from a tuple of namespaces — pass as the\n * `ConfigService` generic to type dot-notation reads.\n *\n * @example `ConfigService<ConfigType<[typeof dbConfig, typeof mailConfig]>>`\n */\nexport type ConfigType<L extends readonly AnyConfigNamespace[]> = {\n [N in L[number] as N['namespace']]: InferConfigType<N>;\n};\n","import { Inject, Injectable, InjectionToken, Optional } from '../container/index';\nimport type {\n HttpModuleOptions,\n HttpRequestConfig,\n HttpResponse,\n RequestConfig,\n} from './fetch.types';\n\nexport const HTTP_MODULE_OPTIONS = new InjectionToken<HttpModuleOptions>('HTTP_MODULE_OPTIONS');\n\nexport class HttpRequestException extends Error {\n constructor(\n public readonly status: number,\n public readonly statusText: string,\n public readonly response: Response,\n ) {\n super(`HTTP ${status} ${statusText}`);\n this.name = 'HttpRequestException';\n }\n}\n\n@Injectable()\nexport class HttpService {\n private readonly baseURL: string;\n private readonly defaultHeaders: Record<string, string>;\n private readonly defaultTimeout: number | undefined;\n\n constructor(@Optional() @Inject(HTTP_MODULE_OPTIONS) options: HttpModuleOptions) {\n const opts = options ?? {};\n this.baseURL = opts.baseURL ?? '';\n this.defaultHeaders = opts.headers ?? {};\n this.defaultTimeout = opts.timeout;\n }\n\n get<T = unknown>(url: string, config?: RequestConfig): Promise<HttpResponse<T>> {\n return this.request<T>({ method: 'GET', url, ...config });\n }\n\n post<T = unknown>(url: string, body?: unknown, config?: RequestConfig): Promise<HttpResponse<T>> {\n return this.request<T>({ method: 'POST', url, body, ...config });\n }\n\n put<T = unknown>(url: string, body?: unknown, config?: RequestConfig): Promise<HttpResponse<T>> {\n return this.request<T>({ method: 'PUT', url, body, ...config });\n }\n\n patch<T = unknown>(\n url: string,\n body?: unknown,\n config?: RequestConfig,\n ): Promise<HttpResponse<T>> {\n return this.request<T>({ method: 'PATCH', url, body, ...config });\n }\n\n delete<T = unknown>(url: string, config?: RequestConfig): Promise<HttpResponse<T>> {\n return this.request<T>({ method: 'DELETE', url, ...config });\n }\n\n head(url: string, config?: RequestConfig): Promise<HttpResponse<void>> {\n return this.request<void>({ method: 'HEAD', url, ...config });\n }\n\n async request<T = unknown>(config: HttpRequestConfig): Promise<HttpResponse<T>> {\n const fullUrl = this.buildUrl(config.url, config.params);\n const headers: Record<string, string> = { ...this.defaultHeaders, ...config.headers };\n\n const init: RequestInit = { method: config.method, headers };\n\n if (config.body !== undefined) {\n if (typeof config.body === 'string' || config.body instanceof FormData) {\n init.body = config.body as string | FormData;\n } else {\n init.body = JSON.stringify(config.body);\n if (!headers['Content-Type'] && !headers['content-type']) {\n headers['Content-Type'] = 'application/json';\n }\n }\n }\n\n const timeout = config.timeout ?? this.defaultTimeout;\n if (timeout !== undefined) {\n init.signal = AbortSignal.timeout(timeout);\n }\n\n const response = await fetch(fullUrl, init);\n\n if (!response.ok) {\n throw new HttpRequestException(response.status, response.statusText, response);\n }\n\n const data = await this.parseBody<T>(response);\n\n return {\n data,\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n };\n }\n\n private buildUrl(url: string, params?: Record<string, string | number | boolean>): string {\n const base = this.baseURL ? `${this.baseURL}${url}` : url;\n if (!params || Object.keys(params).length === 0) return base;\n const searchParams = new URLSearchParams(\n Object.entries(params).map(([k, v]) => [k, String(v)] as [string, string]),\n );\n return `${base}?${searchParams.toString()}`;\n }\n\n private async parseBody<T>(response: Response): Promise<T> {\n if (response.status === 204 || response.headers.get('content-length') === '0') {\n return undefined as T;\n }\n const contentType = response.headers.get('content-type') ?? '';\n if (contentType.includes('application/json')) {\n return response.json() as Promise<T>;\n }\n return response.text() as Promise<T>;\n }\n}\n","import { Module } from '../module/decorators';\nimport { ConfigurableModuleBuilder } from '../module/configurable-module.builder';\nimport { HttpService, HTTP_MODULE_OPTIONS } from './fetch.service';\nimport type { HttpModuleOptions } from './fetch.types';\n\nconst { ConfigurableModuleClass } = new ConfigurableModuleBuilder<HttpModuleOptions>({\n moduleName: 'Http',\n optionsInjectionToken: HTTP_MODULE_OPTIONS,\n}).build();\n\n@Module({\n providers: [\n // Default for bare `imports: [HttpModule]`; forRoot(options) overrides via merge.\n { provide: HTTP_MODULE_OPTIONS, useValue: {} },\n HttpService,\n ],\n exports: [HttpService, HTTP_MODULE_OPTIONS],\n})\nexport class HttpModule extends ConfigurableModuleClass {}\n","import { InjectionToken } from '../container/types';\nimport type { CorsOptions } from './cors.types';\n\nexport const CORS_OPTIONS = new InjectionToken<CorsOptions>('CORS_OPTIONS');\n","import { cors } from 'hono/cors';\nimport { defineModule } from '../module/define-module';\nimport type { NestMiddleware } from '../pipeline/types';\nimport { APP_MIDDLEWARE } from '../pipeline/tokens';\nimport { CORS_OPTIONS } from './cors.tokens';\nimport type { CorsOptions } from './cors.types';\n\nfunction buildCorsMiddleware(options: CorsOptions): NestMiddleware {\n const corsMiddleware = cors({\n origin: options.origin ?? '*',\n allowMethods: options.allowMethods,\n allowHeaders: options.allowHeaders,\n exposeHeaders: options.exposeHeaders,\n credentials: options.credentials,\n maxAge: options.maxAge,\n });\n return { use: (c, next) => corsMiddleware(c, next) as Promise<Response | void> };\n}\n\nconst { ConfigurableModuleClass } = defineModule<CorsOptions>({\n name: 'Cors',\n optionsToken: CORS_OPTIONS,\n setup: ({ OPTIONS }) => ({\n providers: [\n {\n provide: APP_MIDDLEWARE,\n useFactory: (options: CorsOptions) => buildCorsMiddleware(options),\n inject: [OPTIONS],\n },\n ],\n exports: [OPTIONS],\n }),\n});\n\nexport class CorsModule extends ConfigurableModuleClass {}\n","import { MetadataRegistry } from '../registry/metadata.registry';\nimport type { Constructor } from '../registry/types';\nimport type { ExecutionContext } from './types';\n\nexport interface CreateDecoratorOptions {\n key?: string;\n}\n\nexport interface ReflectableDecorator<TParam> {\n (value: TParam): ClassDecorator & MethodDecorator;\n KEY: string;\n}\n\n/**\n * Decorator that attaches custom metadata to a class or method.\n * Read via Reflector in guards/interceptors.\n *\n * @example\n * ```ts\n * const Roles = (...roles: string[]) => SetMetadata('roles', roles);\n *\n * @Controller('/admin')\n * @Roles('admin')\n * class AdminController { ... }\n * ```\n */\nexport function SetMetadata<V = unknown>(key: string, value: V) {\n return (target: object, propertyKey?: string | symbol) => {\n if (propertyKey !== undefined) {\n MetadataRegistry.setCustomHandlerMeta(\n target.constructor as Constructor,\n propertyKey,\n key,\n value,\n );\n } else {\n MetadataRegistry.setCustomClassMeta(target as Constructor, key, value);\n }\n };\n}\n\n/**\n * Reads custom metadata set by @SetMetadata().\n * Use in guards/interceptors via ExecutionContext.\n *\n * @example\n * ```ts\n * class RolesGuard implements CanActivate {\n * private reflector = new Reflector();\n *\n * canActivate(context: ExecutionContext): boolean {\n * const roles = this.reflector.get<string[]>('roles', context);\n * if (!roles) return true;\n * const user = ...; // extract from request\n * return roles.some(r => user.roles.includes(r));\n * }\n * }\n * ```\n */\nexport class Reflector {\n /**\n * Create a type-safe decorator that sets metadata with a typed key.\n *\n * @example\n * ```ts\n * const Roles = Reflector.createDecorator<string[]>();\n * // Roles(['admin']) — class or method decorator\n * // reflector.get(Roles, context) — typed as string[] | undefined\n * ```\n */\n static createDecorator<TParam = unknown>(\n options?: CreateDecoratorOptions,\n ): ReflectableDecorator<TParam> {\n const key = options?.key ?? `vela:custom:${crypto.randomUUID()}`;\n const decorator = (value: TParam) => SetMetadata(key, value);\n (decorator as ReflectableDecorator<TParam>).KEY = key;\n return decorator as ReflectableDecorator<TParam>;\n }\n\n private resolveKey(keyOrDecorator: string | ReflectableDecorator<unknown>): string {\n return typeof keyOrDecorator === 'string' ? keyOrDecorator : keyOrDecorator.KEY;\n }\n\n /**\n * Get metadata value from handler first, then class.\n * Handler-level metadata takes priority over class-level.\n */\n get<T = unknown>(\n key: string | ReflectableDecorator<T>,\n context: ExecutionContext,\n ): T | undefined {\n const resolvedKey = this.resolveKey(key as string | ReflectableDecorator<unknown>);\n const ctor = context.getClass();\n const handlerValue = MetadataRegistry.getCustomHandlerMeta(\n ctor,\n context.getHandler(),\n resolvedKey,\n );\n if (handlerValue !== undefined) return handlerValue as T;\n return MetadataRegistry.getCustomClassMeta(ctor, resolvedKey) as T | undefined;\n }\n\n /**\n * Get metadata only from the handler (method) level.\n */\n getHandler<T = unknown>(\n key: string | ReflectableDecorator<T>,\n context: ExecutionContext,\n ): T | undefined {\n const resolvedKey = this.resolveKey(key as string | ReflectableDecorator<unknown>);\n return MetadataRegistry.getCustomHandlerMeta(\n context.getClass(),\n context.getHandler(),\n resolvedKey,\n ) as T | undefined;\n }\n\n /**\n * Get metadata only from the class level.\n */\n getClass<T = unknown>(\n key: string | ReflectableDecorator<T>,\n context: Pick<ExecutionContext, 'getClass'>,\n ): T | undefined {\n const resolvedKey = this.resolveKey(key as string | ReflectableDecorator<unknown>);\n return MetadataRegistry.getCustomClassMeta(context.getClass(), resolvedKey) as T | undefined;\n }\n\n /**\n * Get all metadata values for a key from both handler and class.\n * Returns [handlerValue, classValue] (either may be undefined).\n */\n getAll<T = unknown>(\n key: string | ReflectableDecorator<T>,\n context: ExecutionContext,\n ): [T | undefined, T | undefined] {\n return [this.getHandler<T>(key, context), this.getClass<T>(key, context)];\n }\n\n /**\n * Returns handler value if defined, else class value, else undefined.\n * First defined value wins.\n */\n getAllAndOverride<T = unknown>(\n key: string | ReflectableDecorator<T>,\n context: ExecutionContext,\n ): T | undefined {\n return this.getHandler<T>(key, context) ?? this.getClass<T>(key, context);\n }\n\n /**\n * Collects handler + class values, filters undefineds.\n * - 0 values → []\n * - 1 value → return it\n * - Arrays → concatenate\n * - Objects → Object.assign({}, ...values)\n * - Otherwise → wrap in array\n */\n getAllAndMerge<T = unknown>(\n key: string | ReflectableDecorator<T>,\n context: ExecutionContext,\n ): T | T[] {\n const [handlerValue, classValue] = this.getAll<T>(key, context);\n const values: T[] = [];\n if (handlerValue !== undefined) values.push(handlerValue);\n if (classValue !== undefined) values.push(classValue);\n\n if (values.length === 0) return [] as T[];\n if (values.length === 1) return values[0]!;\n\n if (Array.isArray(values[0]) && Array.isArray(values[1])) {\n return [...values[0], ...values[1]] as T;\n }\n if (\n typeof values[0] === 'object' &&\n values[0] !== null &&\n !Array.isArray(values[0]) &&\n typeof values[1] === 'object' &&\n values[1] !== null &&\n !Array.isArray(values[1])\n ) {\n return Object.assign({}, values[0], values[1]) as T;\n }\n\n return values;\n }\n}\n","import { InjectionToken } from '../container/types';\nimport type { CacheStore, CacheModuleOptions } from './cache.types';\n\nexport const CACHE_MANAGER = new InjectionToken<CacheStore>('CACHE_MANAGER');\nexport const CACHE_MODULE_OPTIONS = new InjectionToken<CacheModuleOptions>('CACHE_MODULE_OPTIONS');\n\nexport const CACHE_KEY_METADATA = 'vela:cache-key';\nexport const CACHE_TTL_METADATA = 'vela:cache-ttl';\n","import { Injectable, Inject } from '../container/decorators';\nimport { Reflector } from '../pipeline/reflector';\nimport type { ExecutionContext, CallHandler, NestInterceptor } from '../pipeline/types';\nimport {\n CACHE_MANAGER,\n CACHE_MODULE_OPTIONS,\n CACHE_KEY_METADATA,\n CACHE_TTL_METADATA,\n} from './cache.tokens';\nimport type { CacheModuleOptions, CacheStore } from './cache.types';\n\n@Injectable()\nexport class CacheInterceptor implements NestInterceptor {\n private reflector = new Reflector();\n\n constructor(\n @Inject(CACHE_MANAGER) private cacheStore: CacheStore,\n @Inject(CACHE_MODULE_OPTIONS) private options: CacheModuleOptions,\n ) {}\n\n async intercept(context: ExecutionContext, next: CallHandler): Promise<unknown> {\n const request = context.getRequest();\n\n // Only cache GET requests\n if (request.method !== 'GET') {\n return next.handle();\n }\n\n // Determine cache key\n const customKey = this.reflector.getAllAndOverride<string>(CACHE_KEY_METADATA, context);\n const url = new URL(request.url);\n const cacheKey = customKey ?? `cache:GET:${url.pathname}`;\n\n // Check cache\n const cached = this.cacheStore.get(cacheKey);\n if (cached !== undefined) {\n return cached;\n }\n\n // Execute handler\n const result = await next.handle();\n\n // Determine TTL\n const customTtl = this.reflector.getAllAndOverride<number>(CACHE_TTL_METADATA, context);\n const ttl = customTtl ?? this.options.ttl ?? 5;\n\n // Store in cache\n this.cacheStore.set(cacheKey, result, ttl);\n\n return result;\n }\n}\n","import { Injectable, Inject } from '../container/decorators';\nimport { CACHE_MANAGER } from './cache.tokens';\nimport type { CacheStore } from './cache.types';\n\n@Injectable()\nexport class CacheService {\n constructor(@Inject(CACHE_MANAGER) private store: CacheStore) {}\n\n get<T = unknown>(key: string): T | undefined {\n return this.store.get<T>(key);\n }\n\n set<T = unknown>(key: string, value: T, ttl?: number): void {\n this.store.set(key, value, ttl);\n }\n\n del(key: string): void {\n this.store.del(key);\n }\n\n clear(): void {\n this.store.clear();\n }\n}\n","import type { CacheEntry, CacheStore } from './cache.types';\n\nexport class MemoryCacheStore implements CacheStore {\n private store = new Map<string, CacheEntry>();\n private defaultTtl: number;\n private max: number;\n\n constructor(ttl: number = 5, max: number = 100) {\n this.defaultTtl = ttl;\n this.max = max;\n }\n\n get<T = unknown>(key: string): T | undefined {\n const entry = this.store.get(key);\n if (!entry) return undefined;\n if (Date.now() > entry.expiresAt) {\n this.store.delete(key);\n return undefined;\n }\n return entry.value as T;\n }\n\n set<T = unknown>(key: string, value: T, ttl?: number): void {\n // Evict if at capacity\n if (!this.store.has(key) && this.store.size >= this.max) {\n this.evict();\n }\n const effectiveTtl = ttl ?? this.defaultTtl;\n this.store.set(key, {\n value,\n expiresAt: Date.now() + effectiveTtl * 1000,\n });\n }\n\n del(key: string): void {\n this.store.delete(key);\n }\n\n clear(): void {\n this.store.clear();\n }\n\n private evict(): void {\n // First remove expired entries\n const now = Date.now();\n for (const [key, entry] of this.store) {\n if (now > entry.expiresAt) {\n this.store.delete(key);\n }\n }\n // If still at capacity, remove oldest (first inserted)\n if (this.store.size >= this.max) {\n const firstKey = this.store.keys().next().value;\n if (firstKey !== undefined) {\n this.store.delete(firstKey);\n }\n }\n }\n}\n","import { Module } from '../module/decorators';\nimport { ConfigurableModuleBuilder } from '../module/configurable-module.builder';\nimport { APP_INTERCEPTOR } from '../pipeline/tokens';\nimport { CacheInterceptor } from './cache.interceptor';\nimport { CacheService } from './cache.service';\nimport { MemoryCacheStore } from './cache.store';\nimport { CACHE_MANAGER, CACHE_MODULE_OPTIONS } from './cache.tokens';\nimport type { CacheModuleOptions } from './cache.types';\n\n// Reuse the public CACHE_MODULE_OPTIONS token so its identity (and the\n// index.ts export) is unchanged. `isGlobal` here means \"register the interceptor\n// globally as APP_INTERCEPTOR\" — NOT `DynamicModule.global` — so the extras\n// transform is customized rather than using the default isGlobal→global.\nconst { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } =\n new ConfigurableModuleBuilder<CacheModuleOptions>({\n moduleName: 'Cache',\n optionsInjectionToken: CACHE_MODULE_OPTIONS,\n })\n .setExtras({ isGlobal: false }, (definition, { isGlobal }) =>\n isGlobal\n ? {\n ...definition,\n providers: [\n ...(definition.providers ?? []),\n { provide: APP_INTERCEPTOR, useExisting: CacheInterceptor },\n ],\n }\n : definition,\n )\n .build();\n\n@Module({\n providers: [\n CacheService,\n CacheInterceptor,\n // One options-injecting provider serves BOTH forRoot and forRootAsync.\n // A custom `store` (e.g. TieredCacheStore / KVCacheStore) overrides the\n // default in-memory store.\n {\n provide: CACHE_MANAGER,\n useFactory: (options: CacheModuleOptions) =>\n options.store ?? new MemoryCacheStore(options.ttl ?? 5, options.max ?? 100),\n inject: [MODULE_OPTIONS_TOKEN],\n },\n ],\n exports: [CACHE_MANAGER, CACHE_MODULE_OPTIONS, CacheService, CacheInterceptor],\n})\nexport class CacheModule extends ConfigurableModuleClass {}\n","import type { AnyCacheStore, AsyncCacheStore } from './cache.types';\n\n/**\n * Composes an ordered list of cache tiers (fastest first, e.g. in-memory L1 →\n * KV L2). Tiers may be sync ({@link CacheStore}) or async ({@link AsyncCacheStore}) —\n * results are awaited uniformly. Reads are read-through: the first tier with a\n * hit wins, and nearer tiers that missed are backfilled. Writes/deletes/clears\n * fan out to all tiers. Always async ({@link AsyncCacheStore}).\n *\n * Runtime-agnostic — the concrete tiers (memory here, KV in `@velajs/cloudflare`)\n * live wherever fits.\n */\nexport class TieredCacheStore implements AsyncCacheStore {\n private readonly tiers: AnyCacheStore[];\n\n constructor(tiers: AnyCacheStore[]) {\n if (tiers.length === 0) {\n throw new Error('TieredCacheStore requires at least one tier.');\n }\n this.tiers = tiers;\n }\n\n async get<T = unknown>(key: string): Promise<T | undefined> {\n for (let i = 0; i < this.tiers.length; i++) {\n const value = (await this.tiers[i]!.get<T>(key)) as T | undefined;\n if (value !== undefined) {\n // Backfill nearer (faster) tiers that missed.\n for (let j = 0; j < i; j++) {\n await this.tiers[j]!.set(key, value);\n }\n return value;\n }\n }\n return undefined;\n }\n\n async set<T = unknown>(key: string, value: T, ttl?: number): Promise<void> {\n await Promise.all(this.tiers.map((tier) => tier.set(key, value, ttl)));\n }\n\n async del(key: string): Promise<void> {\n await Promise.all(this.tiers.map((tier) => tier.del(key)));\n }\n\n async clear(): Promise<void> {\n await Promise.all(this.tiers.map((tier) => tier.clear()));\n }\n}\n","import { SetMetadata } from '../pipeline/reflector';\nimport { CACHE_KEY_METADATA, CACHE_TTL_METADATA } from './cache.tokens';\n\nexport const CacheKey = (key: string) => SetMetadata(CACHE_KEY_METADATA, key);\nexport const CacheTTL = (seconds: number) => SetMetadata(CACHE_TTL_METADATA, seconds);\n","import {\n InjectionToken,\n type InferTokens,\n type ProviderOptions,\n type Token,\n type Type,\n} from '../container/types';\nimport { Module } from './decorators';\nimport type { ComponentType, DynamicModule } from '../registry/types';\nimport {\n APP_FILTER,\n APP_GUARD,\n APP_INTERCEPTOR,\n APP_MIDDLEWARE,\n APP_PIPE,\n} from '../pipeline/tokens';\nimport type { ModuleContributions } from './define-module';\nimport { stableHash } from './stable-hash';\n\nexport interface LazyProviderSpec<T, Inject extends readonly Token<unknown>[]> {\n /** Token under which the memoized thunk `() => T` is provided. */\n provide: Token<() => T>;\n inject?: Inject;\n useFactory: (...deps: InferTokens<Inject>) => T;\n /** Memoize the first call's result (default true). */\n memoize?: boolean;\n}\n\n/**\n * Provide a zero-arg thunk `() => T` whose factory runs on FIRST CALL, not at\n * provider construction — for values that don't exist yet when the module\n * graph is built (Cloudflare bindings are only live at request time).\n *\n * The shared primitive replacing the hand-rolled\n * `useFactory: (...deps) => () => build(...deps)` closure that auth and\n * storage each copy-pasted.\n *\n * ```ts\n * lazyProvider({\n * provide: STORAGE_DRIVER_BUILDER,\n * inject: [MODULE_OPTIONS_TOKEN],\n * useFactory: (options) => options.driver(),\n * })\n * ```\n */\nexport function lazyProvider<\n T,\n const Inject extends readonly Token<unknown>[] = readonly Token<unknown>[],\n>(spec: LazyProviderSpec<T, Inject>): ProviderOptions {\n const memoize = spec.memoize ?? true;\n return {\n provide: spec.provide as Token,\n inject: [...(spec.inject ?? [])] as Token[],\n useFactory: (...deps: unknown[]) => {\n const build = () => (spec.useFactory as (...a: unknown[]) => T)(...deps);\n if (!memoize) return build;\n let cached: { value: T } | undefined;\n return () => (cached ??= { value: build() }).value;\n },\n };\n}\n\nconst GLOBAL_COMPONENT_TOKENS: Record<ComponentType, InjectionToken<unknown>> = {\n guard: APP_GUARD,\n pipe: APP_PIPE,\n interceptor: APP_INTERCEPTOR,\n filter: APP_FILTER,\n middleware: APP_MIDDLEWARE,\n};\n\n/**\n * The one idiom for registering an app-wide component from a module's\n * providers. Returns registrations to spread:\n *\n * ```ts\n * providers: [MyService, ...provideGlobal('guard', AuthGuard)]\n * ```\n *\n * Class components are registered as providers and wired via `useExisting`\n * (so DI constructs them with their dependencies); instances via `useValue`.\n * Inside `defineModule`, prefer the equivalent `global:` contribution slot.\n */\nexport function provideGlobal(\n kind: ComponentType,\n component: Type | object,\n): Array<Type | ProviderOptions> {\n const token = GLOBAL_COMPONENT_TOKENS[kind];\n if (typeof component === 'function') {\n return [component as Type, { provide: token, useExisting: component as Token }];\n }\n return [{ provide: token, useValue: component }];\n}\n\n/**\n * A first-class side-effect-only module: contributes providers/exports without\n * being a configurable module — the supported form of the \"empty marker\n * module\" trick (i18n's `registerMessages`). Content-derived `key` makes\n * identical contributions dedup (HMR-idempotent) while distinct ones coexist.\n *\n * ```ts\n * export function registerMessages(messages: Messages): DynamicModule {\n * return sideEffectModule('I18nMessages', {\n * providers: [{ provide: I18N_MESSAGES, useValue: messages }],\n * exports: [I18N_MESSAGES],\n * });\n * }\n * ```\n */\nexport function sideEffectModule(\n name: string,\n contributions: Omit<ModuleContributions, 'global'> & { key?: string } = {},\n): DynamicModule {\n const { key, ...rest } = contributions;\n // Computed-property-name idiom: mints a class whose .name is `name` without\n // dynamic code evaluation (edge-safe; no `new Function`).\n const moduleClass = { [name]: class {} }[name] as Type;\n Module({})(moduleClass);\n return {\n module: moduleClass,\n key: key ?? stableHash(rest),\n providers: rest.providers ?? [],\n controllers: rest.controllers ?? [],\n imports: rest.imports ?? [],\n exports: rest.exports ?? [],\n };\n}\n\n/**\n * Blessed token-minting convention: always an `InjectionToken` (never a raw\n * string), named for diagnostics. Namespace it `'<pkg>:<area>:<thing>'`.\n */\nexport function moduleToken<T>(name: string): InjectionToken<T> {\n return new InjectionToken<T>(name);\n}\n","import { Injectable } from '../container/index';\nimport type { EventHandler } from './event-emitter.types';\n\nfunction isWildcard(pattern: string): boolean {\n return pattern.includes('*');\n}\n\nfunction compilePattern(pattern: string): RegExp {\n const regexStr = pattern\n .split('.')\n .map((segment) => {\n if (segment === '**') return '.*';\n if (segment === '*') return '[^.]+';\n return segment.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n })\n .join('\\\\.');\n return new RegExp(`^${regexStr}$`);\n}\n\ninterface WildcardEntry {\n regex: RegExp;\n handlers: Set<EventHandler>;\n onceHandlers: Set<EventHandler>;\n}\n\n@Injectable()\nexport class EventEmitter {\n private exactListeners = new Map<string, Set<EventHandler>>();\n private exactOnceListeners = new Map<string, Set<EventHandler>>();\n private wildcardListeners = new Map<string, WildcardEntry>();\n\n on(event: string, handler: EventHandler): this {\n if (isWildcard(event)) {\n this.getOrCreateWildcard(event).handlers.add(handler);\n } else {\n const handlers = this.exactListeners.get(event) ?? new Set();\n handlers.add(handler);\n this.exactListeners.set(event, handlers);\n }\n return this;\n }\n\n once(event: string, handler: EventHandler): this {\n this.on(event, handler);\n if (isWildcard(event)) {\n this.getOrCreateWildcard(event).onceHandlers.add(handler);\n } else {\n const onceSet = this.exactOnceListeners.get(event) ?? new Set();\n onceSet.add(handler);\n this.exactOnceListeners.set(event, onceSet);\n }\n return this;\n }\n\n off(event: string, handler: EventHandler): this {\n if (isWildcard(event)) {\n const entry = this.wildcardListeners.get(event);\n if (entry) {\n entry.handlers.delete(handler);\n entry.onceHandlers.delete(handler);\n if (entry.handlers.size === 0) this.wildcardListeners.delete(event);\n }\n } else {\n const handlers = this.exactListeners.get(event);\n if (handlers) {\n handlers.delete(handler);\n this.exactOnceListeners.get(event)?.delete(handler);\n if (handlers.size === 0) this.exactListeners.delete(event);\n }\n }\n return this;\n }\n\n async emit(event: string, ...args: unknown[]): Promise<void> {\n const toRemove: Array<() => void> = [];\n\n // Exact match\n const exactHandlers = this.exactListeners.get(event);\n if (exactHandlers) {\n const onceSet = this.exactOnceListeners.get(event);\n await Promise.all(\n [...exactHandlers].map(async (handler) => {\n await handler(...args);\n if (onceSet?.has(handler)) {\n toRemove.push(() => this.off(event, handler));\n }\n }),\n );\n }\n\n // Wildcard match (regex pre-compiled at registration)\n for (const [pattern, entry] of this.wildcardListeners) {\n if (!entry.regex.test(event)) continue;\n await Promise.all(\n [...entry.handlers].map(async (handler) => {\n await handler(...args);\n if (entry.onceHandlers.has(handler)) {\n toRemove.push(() => this.off(pattern, handler));\n }\n }),\n );\n }\n\n for (const remove of toRemove) remove();\n }\n\n removeAllListeners(event?: string): this {\n if (event) {\n if (isWildcard(event)) {\n this.wildcardListeners.delete(event);\n } else {\n this.exactListeners.delete(event);\n this.exactOnceListeners.delete(event);\n }\n } else {\n this.exactListeners.clear();\n this.exactOnceListeners.clear();\n this.wildcardListeners.clear();\n }\n return this;\n }\n\n listenerCount(event: string): number {\n let count = this.exactListeners.get(event)?.size ?? 0;\n for (const entry of this.wildcardListeners.values()) {\n if (entry.regex.test(event)) count += entry.handlers.size;\n }\n return count;\n }\n\n private getOrCreateWildcard(pattern: string): WildcardEntry {\n const existing = this.wildcardListeners.get(pattern);\n if (existing) return existing;\n const entry: WildcardEntry = {\n regex: compilePattern(pattern),\n handlers: new Set(),\n onceHandlers: new Set(),\n };\n this.wildcardListeners.set(pattern, entry);\n return entry;\n }\n}\n","export const ON_EVENT_METADATA = 'vela:on-event';\n","import { Injectable, Inject } from '../container/index';\nimport { DiscoveryService } from '../discovery/discovery.service';\nimport type { OnApplicationBootstrap } from '../lifecycle/index';\nimport { EventEmitter } from './event-emitter.service';\nimport { ON_EVENT_METADATA } from './event-emitter.tokens';\nimport type { OnEventMetadata } from './event-emitter.types';\n\n@Injectable()\nexport class EventEmitterSubscriber implements OnApplicationBootstrap {\n constructor(\n @Inject(DiscoveryService) private readonly discovery: DiscoveryService,\n private emitter: EventEmitter,\n ) {}\n\n onApplicationBootstrap(): void {\n for (const found of this.discovery.methodsWithMeta<OnEventMetadata>(ON_EVENT_METADATA)) {\n const instance = found.class.instance;\n if (!instance) continue;\n const method = (instance as Record<string | symbol, unknown>)[found.methodName];\n if (typeof method === 'function') {\n this.emitter.on(found.meta.event, (...args: unknown[]) => method.apply(instance, args));\n }\n }\n }\n}\n","import { Module } from '../module/index';\nimport { EventEmitter } from './event-emitter.service';\nimport { EventEmitterSubscriber } from './event-emitter.subscriber';\n\n// Lazy: the whole subsystem (emitter + @OnEvent wiring pass) materializes on\n// first EventEmitter resolution — an HTTP-only worker that never emits pays\n// nothing at cold start. See MODULE_AUTHORING.md \"Lazy modules\".\n@Module({\n lazy: true,\n providers: [EventEmitter, EventEmitterSubscriber],\n exports: [EventEmitter],\n})\nexport class EventEmitterModule {}\n","import { MetadataRegistry } from '../registry/metadata.registry';\nimport type { Constructor } from '../registry/types';\nimport { ON_EVENT_METADATA } from './event-emitter.tokens';\nimport type { OnEventMetadata } from './event-emitter.types';\n\nexport function OnEvent(event: string): MethodDecorator {\n return (target: object, propertyKey: string | symbol) => {\n MetadataRegistry.appendCustomClassMeta<OnEventMetadata>(\n target.constructor as Constructor,\n ON_EVENT_METADATA,\n { event, methodName: String(propertyKey) },\n );\n };\n}\n","import { Module } from '../module/decorators';\nimport type { DynamicModule } from '../module/types';\nimport { ScheduleRegistry } from './schedule.registry';\n\n/**\n * Zero-config module (Tier C): providers live on the `@Module` bag; the\n * `forRoot()` static is NestJS-parity sugar returning the bare dynamic module\n * (default key — repeated calls dedup).\n */\n@Module({\n // Lazy: the @Cron/@Interval discovery pass runs when ScheduleRegistry is\n // first resolved (executor bootstrap, introspection, first dispatch).\n lazy: true,\n providers: [ScheduleRegistry],\n exports: [ScheduleRegistry],\n})\nexport class ScheduleModule {\n static forRoot(): DynamicModule {\n return { module: ScheduleModule };\n }\n}\n","import { MetadataRegistry } from '../registry/metadata.registry';\nimport type { Constructor } from '../registry/types';\nimport { CRON_METADATA, INTERVAL_METADATA } from './schedule.tokens';\nimport type { CronMetadata, IntervalMetadata } from './schedule.types';\n\nexport function Cron(expression: string): MethodDecorator {\n return (target: object, propertyKey: string | symbol) => {\n MetadataRegistry.appendCustomClassMeta<CronMetadata>(\n target.constructor as Constructor,\n CRON_METADATA,\n { expression, methodName: String(propertyKey) },\n );\n };\n}\n\nexport function Interval(ms: number): MethodDecorator {\n return (target: object, propertyKey: string | symbol) => {\n MetadataRegistry.appendCustomClassMeta<IntervalMetadata>(\n target.constructor as Constructor,\n INTERVAL_METADATA,\n { ms, methodName: String(propertyKey) },\n );\n };\n}\n","import { Injectable } from '../container/index';\nimport { ServiceUnavailableException } from '../errors/http-exception';\nimport type { BeforeApplicationShutdown } from '../lifecycle/index';\nimport type {\n HealthCheckResult,\n HealthIndicatorFunction,\n HealthIndicatorResult,\n} from './health.types';\n\n@Injectable()\nexport class HealthCheckService implements BeforeApplicationShutdown {\n private isShuttingDown = false;\n\n beforeApplicationShutdown(): void {\n this.isShuttingDown = true;\n }\n\n async check(indicators: HealthIndicatorFunction[]): Promise<HealthCheckResult> {\n if (this.isShuttingDown) {\n const result: HealthCheckResult = {\n status: 'shutting_down',\n info: {},\n error: {},\n details: {},\n };\n throw new ServiceUnavailableException({ ...result });\n }\n\n const results = await Promise.allSettled(indicators.map((fn) => fn()));\n\n const info: HealthIndicatorResult = {};\n const error: HealthIndicatorResult = {};\n const details: HealthIndicatorResult = {};\n\n for (const result of results) {\n if (result.status === 'fulfilled') {\n const indicatorResult = result.value;\n for (const [key, value] of Object.entries(indicatorResult)) {\n details[key] = value;\n if (value.status === 'up') {\n info[key] = value;\n } else {\n error[key] = value;\n }\n }\n } else {\n const message =\n result.reason instanceof Error ? result.reason.message : 'Health check failed';\n const key = 'unknown';\n const value = { status: 'down' as const, message };\n details[key] = value;\n error[key] = value;\n }\n }\n\n const status = Object.keys(error).length > 0 ? 'error' : 'ok';\n const checkResult: HealthCheckResult = { status, info, error, details };\n\n if (status === 'error') {\n throw new ServiceUnavailableException({ ...checkResult });\n }\n\n return checkResult;\n }\n}\n","import { Injectable } from '../container/index';\nimport type { HealthIndicatorResult } from './health.types';\n\ninterface HealthIndicatorBuilder {\n up(data?: Record<string, unknown>): HealthIndicatorResult;\n down(data?: Record<string, unknown>): HealthIndicatorResult;\n}\n\n@Injectable()\nexport class HealthIndicatorService {\n check(key: string): HealthIndicatorBuilder {\n return {\n up(data?: Record<string, unknown>): HealthIndicatorResult {\n return { [key]: { status: 'up', ...data } };\n },\n down(data?: Record<string, unknown>): HealthIndicatorResult {\n return { [key]: { status: 'down', ...data } };\n },\n };\n }\n}\n","import { Injectable } from '../container/index';\nimport { HealthIndicatorService } from './health.indicator';\nimport type { HealthIndicatorResult, ResponseCheckCallback } from './health.types';\n\nexport interface HttpPingOptions {\n method?: string;\n headers?: Record<string, string>;\n timeout?: number;\n expectedStatus?: number;\n}\n\n@Injectable()\nexport class HttpHealthIndicator {\n constructor(private indicator: HealthIndicatorService) {}\n\n async pingCheck(\n key: string,\n url: string,\n options?: HttpPingOptions,\n ): Promise<HealthIndicatorResult> {\n const { method = 'GET', headers, timeout = 5000, expectedStatus } = options ?? {};\n\n try {\n const response = await fetch(url, {\n method,\n headers,\n signal: AbortSignal.timeout(timeout),\n });\n\n const statusCode = response.status;\n const isHealthy =\n expectedStatus !== undefined\n ? statusCode === expectedStatus\n : statusCode >= 200 && statusCode < 300;\n\n if (isHealthy) {\n return this.indicator.check(key).up({ statusCode });\n }\n\n return this.indicator.check(key).down({ statusCode, message: response.statusText });\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n return this.indicator.check(key).down({ message });\n }\n }\n\n async responseCheck(\n key: string,\n url: string,\n callback: ResponseCheckCallback,\n options?: HttpPingOptions,\n ): Promise<HealthIndicatorResult> {\n const { method = 'GET', headers, timeout = 5000 } = options ?? {};\n\n try {\n const response = await fetch(url, {\n method,\n headers,\n signal: AbortSignal.timeout(timeout),\n });\n\n const statusCode = response.status;\n const isHealthy = await callback(response);\n\n if (isHealthy) {\n return this.indicator.check(key).up({ statusCode });\n }\n\n return this.indicator.check(key).down({ statusCode });\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error';\n return this.indicator.check(key).down({ message });\n }\n }\n}\n","import { Module } from '../module/index';\nimport { HealthCheckService } from './health.service';\nimport { HealthIndicatorService } from './health.indicator';\nimport { HttpHealthIndicator } from './health.http';\n\n@Module({\n providers: [HealthCheckService, HealthIndicatorService, HttpHealthIndicator],\n exports: [HealthCheckService, HealthIndicatorService, HttpHealthIndicator],\n})\nexport class HealthModule {}\n","import { InjectionToken } from '../container/types';\nimport type { ThrottlerModuleOptions, ThrottlerStore } from './throttler.types';\n\nexport const THROTTLER_OPTIONS = new InjectionToken<ThrottlerModuleOptions>('THROTTLER_OPTIONS');\nexport const THROTTLER_STORAGE = new InjectionToken<ThrottlerStore>('THROTTLER_STORAGE');\n\nexport const THROTTLE_METADATA = 'vela:throttle';\nexport const SKIP_THROTTLE_METADATA = 'vela:skip-throttle';\n","import { Injectable, Inject } from '../container/decorators';\nimport { Reflector } from '../pipeline/reflector';\nimport type { CanActivate, ExecutionContext } from '../pipeline/types';\nimport { TooManyRequestsException } from '../errors/http-exception';\nimport {\n THROTTLER_OPTIONS,\n THROTTLER_STORAGE,\n THROTTLE_METADATA,\n SKIP_THROTTLE_METADATA,\n} from './throttler.tokens';\nimport type {\n ThrottlerModuleOptions,\n ThrottlerStore,\n ThrottleConfig,\n RateLimitInfo,\n} from './throttler.types';\n\n@Injectable()\nexport class ThrottlerGuard implements CanActivate {\n private reflector = new Reflector();\n\n constructor(\n @Inject(THROTTLER_OPTIONS) private options: ThrottlerModuleOptions,\n @Inject(THROTTLER_STORAGE) private storage: ThrottlerStore,\n ) {}\n\n async canActivate(context: ExecutionContext): Promise<boolean> {\n const skip = this.reflector.getAllAndOverride<boolean>(SKIP_THROTTLE_METADATA, context);\n if (skip) {\n return true;\n }\n\n const override = this.reflector.getAllAndOverride<ThrottleConfig>(THROTTLE_METADATA, context);\n const limit = override?.limit ?? this.options.limit;\n const ttl = override?.ttl ?? this.options.ttl;\n\n const request = context.getRequest();\n const tracker = this.options.getTracker\n ? this.options.getTracker(request)\n : (request.headers.get('x-forwarded-for') ?? 'anonymous');\n\n const className = context.getClass().name;\n const handlerName = String(context.getHandler());\n\n const key = this.options.generateKey\n ? this.options.generateKey(tracker, { className, handlerName })\n : `throttler:${className}:${handlerName}:${tracker}`;\n\n const { count, ttlMs } = await this.storage.increment(key, ttl);\n\n const remaining = Math.max(0, limit - count);\n const resetSeconds = Math.ceil(ttlMs / 1000);\n\n const honoContext = context.getContext();\n honoContext.header('X-RateLimit-Limit', String(limit));\n honoContext.header('X-RateLimit-Remaining', String(remaining));\n honoContext.header('X-RateLimit-Reset', String(resetSeconds));\n\n const rateLimitInfo: RateLimitInfo = { limit, remaining, reset: resetSeconds };\n honoContext.set('rateLimit', rateLimitInfo);\n\n if (count > limit) {\n honoContext.header('Retry-After', String(resetSeconds));\n throw new TooManyRequestsException();\n }\n\n return true;\n }\n}\n","import { Injectable } from '../container/decorators';\nimport type { ThrottlerStore, ThrottlerStorageRecord } from './throttler.types';\n\ninterface StoreEntry {\n count: number;\n resetTime: number;\n}\n\n@Injectable()\nexport class ThrottlerStorage implements ThrottlerStore {\n private current = new Map<string, StoreEntry>();\n private previous = new Map<string, StoreEntry>();\n private lastSwap = Date.now();\n private readonly swapIntervalMs = 60_000;\n\n increment(key: string, ttlMs: number): ThrottlerStorageRecord {\n this.maybeSwap();\n\n const now = Date.now();\n let entry = this.current.get(key) ?? this.previous.get(key);\n\n if (!entry || now >= entry.resetTime) {\n entry = { count: 0, resetTime: now + ttlMs };\n }\n\n entry.count++;\n this.current.set(key, entry);\n\n return {\n count: entry.count,\n ttlMs: entry.resetTime - now,\n };\n }\n\n reset(key: string): void {\n this.current.delete(key);\n this.previous.delete(key);\n }\n\n private maybeSwap(): void {\n const now = Date.now();\n if (now - this.lastSwap < this.swapIntervalMs) return;\n this.previous = this.current;\n this.current = new Map();\n this.lastSwap = now;\n }\n}\n","import { Module } from '../module/decorators';\nimport { ConfigurableModuleBuilder } from '../module/configurable-module.builder';\nimport { APP_GUARD } from '../pipeline/tokens';\nimport { ThrottlerGuard } from './throttler.guard';\nimport { ThrottlerStorage } from './throttler.storage';\nimport { THROTTLER_OPTIONS, THROTTLER_STORAGE } from './throttler.tokens';\nimport type { ThrottlerModuleOptions } from './throttler.types';\n\nconst { ConfigurableModuleClass, MODULE_OPTIONS_TOKEN } =\n new ConfigurableModuleBuilder<ThrottlerModuleOptions>({\n moduleName: 'Throttler',\n optionsInjectionToken: THROTTLER_OPTIONS,\n }).build();\n\n@Module({\n providers: [\n {\n provide: THROTTLER_STORAGE,\n useFactory: (options: ThrottlerModuleOptions) => options.storage ?? new ThrottlerStorage(),\n inject: [MODULE_OPTIONS_TOKEN],\n },\n ThrottlerGuard,\n { provide: APP_GUARD, useExisting: ThrottlerGuard },\n ],\n exports: [THROTTLER_OPTIONS, THROTTLER_STORAGE, ThrottlerGuard],\n})\nexport class ThrottlerModule extends ConfigurableModuleClass {}\n","import { SetMetadata } from '../pipeline/reflector';\nimport { THROTTLE_METADATA, SKIP_THROTTLE_METADATA } from './throttler.tokens';\nimport type { ThrottleConfig } from './throttler.types';\n\nexport const Throttle = (config: ThrottleConfig) => SetMetadata(THROTTLE_METADATA, config);\n\nexport const SkipThrottle = () => SetMetadata(SKIP_THROTTLE_METADATA, true);\n","import type { Container } from '../container/container';\n\n/**\n * Run one unit of non-HTTP work (a queue batch, a scheduled tick, an RPC\n * call) inside a fresh request-scoped child container — the non-HTTP\n * equivalent of the per-request child the HTTP pipeline creates:\n *\n * ```ts\n * await runInEntrypointScope(app.getContainer(), async (scope) => {\n * const consumer = scope.resolve(ep.token);\n * await consumer.process(batch);\n * });\n * ```\n *\n * Request-scoped providers (and singletons bubbled to request scope) resolve\n * per invocation instead of leaking one boot-time instance across every\n * dispatch; the child's request-scoped disposables are disposed (LIFO) when\n * `fn` settles — success or failure. `REQUEST_CONTEXT` is deliberately NOT\n * seeded: it is an HTTP primitive, and resolving it here keeps throwing its\n * explicit misuse error.\n */\nexport async function runInEntrypointScope<T>(\n container: Container,\n fn: (scope: Container) => T | Promise<T>,\n): Promise<T> {\n const scope = container.createChild();\n try {\n return await fn(scope);\n } finally {\n if (scope.hasDisposables()) {\n await scope.dispose();\n }\n }\n}\n","import type { Type } from '../container/types';\nimport type { ExecutionContext } from '../pipeline/types';\n\n/** ExecutionContext flavor handed to components around entrypoint dispatch. */\nexport interface EntrypointExecutionContext extends ExecutionContext {\n /** The dispatch payload (queue batch, scheduled event, …). */\n getPayload<T = unknown>(): T;\n}\n\nconst WRONG_TRANSPORT = (accessor: string, kind: string) => () => {\n throw new Error(\n `${accessor} called on a '${kind}' entrypoint ExecutionContext — this ` +\n `handler runs over an entrypoint dispatch, not that transport. Use ` +\n `getType()/getPayload() to branch.`,\n );\n};\n\n/**\n * Entrypoint sibling of `buildExecutionContext` (HTTP) and\n * `buildWsExecutionContext`: lets guards/interceptors/filters written against\n * `getClass()`/`getHandler()`/`getType()` run unchanged around queue batches,\n * scheduled ticks, and any custom entrypoint kind. Transport-specific\n * accessors throw rather than fabricate fakes.\n */\nexport function buildEntrypointExecutionContext(\n kind: string,\n targetClass: Type,\n handlerName: string | symbol,\n payload: unknown,\n): EntrypointExecutionContext {\n return {\n getType: <T extends string>() => kind as T,\n getClass: () => targetClass,\n getHandler: () => handlerName,\n getPayload: <T = unknown>() => payload as T,\n getContext: WRONG_TRANSPORT('getContext()', kind) as never,\n getRequest: WRONG_TRANSPORT('getRequest()', kind) as never,\n switchToHttp: WRONG_TRANSPORT('switchToHttp()', kind) as never,\n switchToWs: WRONG_TRANSPORT('switchToWs()', kind) as never,\n } as EntrypointExecutionContext;\n}\n","import type { Container } from '../container/container';\nimport type { ComponentType, Constructor } from '../registry/types';\nimport { ComponentManager } from './component.manager';\nimport type {\n CanActivate,\n ExceptionFilter,\n NestInterceptor,\n NestMiddleware,\n PipeTransform,\n} from './types';\n\nexport interface ResolvedComponentMap {\n guard: CanActivate;\n pipe: PipeTransform;\n interceptor: NestInterceptor;\n filter: ExceptionFilter;\n middleware: NestMiddleware;\n}\n\nconst RESOLVERS = {\n guard: ComponentManager.resolveGuards.bind(ComponentManager),\n pipe: ComponentManager.resolvePipes.bind(ComponentManager),\n interceptor: ComponentManager.resolveInterceptors.bind(ComponentManager),\n filter: ComponentManager.resolveFilters.bind(ComponentManager),\n middleware: ComponentManager.resolveMiddleware.bind(ComponentManager),\n} as const;\n\n/**\n * Public seam for custom dispatchers: the `@UseGuards`/`@UsePipes`/\n * `@UseInterceptors`/`@UseFilters` components scoped to a handler (class-level\n * then method-level, declaration order), resolved to instances through the\n * given container (classes constructed with DI; instances passed through).\n *\n * Order is preserved exactly as declared — conventions stay with the CALLER:\n * filters run closest-first, so dispatchers reverse them\n * (`resolveScopedComponents('filter', ...).reverse()`), and app-wide `APP_*`\n * components are a separate, transport-specific decision.\n *\n * Promoted to the public API by the QueueModule work (the \"openness proof\"):\n * it was the one capability custom entrypoint dispatchers needed that only\n * the internal `ComponentManager` provided.\n */\nexport function resolveScopedComponents<T extends ComponentType>(\n type: T,\n targetClass: Constructor,\n methodName: string | symbol,\n container: Container,\n): ResolvedComponentMap[T][] {\n const scoped = ComponentManager.getScopedComponents(type, targetClass, methodName);\n const resolve = RESOLVERS[type] as (\n items: unknown[],\n container: Container,\n ) => ResolvedComponentMap[T][];\n return resolve(scoped, container);\n}\n","import { BadRequestException } from '../errors/http-exception';\nimport type { ArgumentMetadata, PipeTransform } from './types';\n\nexport class ParseIntPipe implements PipeTransform<string, number> {\n transform(value: string, metadata: ArgumentMetadata): number {\n const parsed = parseInt(value, 10);\n if (isNaN(parsed)) {\n throw new BadRequestException(\n `Validation failed (numeric string expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n return parsed;\n }\n}\n\nexport class ParseFloatPipe implements PipeTransform<string, number> {\n transform(value: string, metadata: ArgumentMetadata): number {\n const parsed = parseFloat(value);\n if (isNaN(parsed)) {\n throw new BadRequestException(\n `Validation failed (float string expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n return parsed;\n }\n}\n\nexport class ParseBoolPipe implements PipeTransform<string, boolean> {\n transform(value: string, metadata: ArgumentMetadata): boolean {\n if (value === 'true') return true;\n if (value === 'false') return false;\n throw new BadRequestException(\n `Validation failed (boolean string expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n}\n\nexport class DefaultValuePipe<T = unknown> implements PipeTransform<T | undefined, T> {\n constructor(private readonly defaultValue: T) {}\n\n transform(value: T | undefined, _metadata: ArgumentMetadata): T {\n return value !== undefined && value !== null ? value : this.defaultValue;\n }\n}\n\nexport class RequiredPipe implements PipeTransform {\n transform(value: unknown, metadata: ArgumentMetadata): unknown {\n if (value === undefined || value === null || value === '') {\n throw new BadRequestException(\n `Validation failed (value required)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n return value;\n }\n}\n\nexport class ZodValidationPipe implements PipeTransform {\n constructor(private readonly schema: { parse(data: unknown): unknown }) {}\n\n transform(value: unknown, _metadata: ArgumentMetadata): unknown {\n return this.schema.parse(value);\n }\n}\n\nconst UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\nconst UUID_VERSION_REGEX: Record<string, RegExp> = {\n '3': /^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,\n '4': /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,\n '5': /^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,\n};\n\nexport interface ParseUUIDPipeOptions {\n version?: '3' | '4' | '5';\n}\n\nexport class ParseUUIDPipe implements PipeTransform<string, string> {\n constructor(private readonly options?: ParseUUIDPipeOptions) {}\n\n transform(value: string, metadata: ArgumentMetadata): string {\n const regex = this.options?.version ? UUID_VERSION_REGEX[this.options.version] : UUID_REGEX;\n if (!regex!.test(value)) {\n throw new BadRequestException(\n `Validation failed (uuid${this.options?.version ? ` v${this.options.version}` : ''} expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n return value;\n }\n}\n\nexport class ParseEnumPipe<T extends Record<string, string | number>> implements PipeTransform<\n string,\n T[keyof T]\n> {\n private readonly allowedValues: Set<string | number>;\n private readonly valuesLabel: string;\n\n constructor(enumType: T) {\n const values = Object.values(enumType);\n this.allowedValues = new Set(values);\n this.valuesLabel = values.join(', ');\n }\n\n transform(value: string, metadata: ArgumentMetadata): T[keyof T] {\n if (!this.allowedValues.has(value)) {\n throw new BadRequestException(\n `Validation failed (${this.valuesLabel} expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n return value as T[keyof T];\n }\n}\n\nexport interface ParseArrayPipeOptions {\n separator?: string;\n optional?: boolean;\n}\n\nexport class ParseArrayPipe implements PipeTransform {\n constructor(private readonly options?: ParseArrayPipeOptions) {}\n\n transform(value: unknown, metadata: ArgumentMetadata): unknown[] {\n if (value === undefined || value === null || value === '') {\n if (this.options?.optional) return [];\n throw new BadRequestException(\n `Validation failed (array expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n if (Array.isArray(value)) return value;\n if (typeof value === 'string') {\n const sep = this.options?.separator ?? ',';\n return value\n .split(sep)\n .map((v) => v.trim())\n .filter((v) => v.length > 0);\n }\n throw new BadRequestException(\n `Validation failed (array expected)${metadata.data ? ` for parameter '${metadata.data}'` : ''}`,\n );\n }\n}\n","import { CORE_CATALOG, composeCatalogs, type Catalog } from '@velajs/errors';\nimport type { ProviderOptions, Type } from '../container/types';\nimport { defineModule } from '../module/define-module';\nimport { APP_EXCEPTION_HANDLER, ERROR_CATALOG } from '../pipeline/tokens';\nimport type { ExceptionHandler } from './exception-handler';\n\n/**\n * Options for {@link ErrorsModule.forRoot}. Both fields are optional — an empty\n * `forRoot()` provides just the core catalog (`CORE_CATALOG`) and no custom\n * handler, which is the framework default anyway.\n */\nexport interface ErrorsModuleOptions {\n /**\n * App-specific catalogs composed **onto** `CORE_CATALOG` via\n * {@link composeCatalogs}. Composition is eager (at `forRoot` call time), so a\n * duplicate code across two catalogs fails fast with `duplicate error code`.\n */\n catalogs?: Catalog<string>[];\n /**\n * The application-wide {@link ExceptionHandler}. A class is wired with\n * `useClass` (constructed through DI); a plain handler object with `useValue`.\n */\n handler?: Type<ExceptionHandler> | ExceptionHandler;\n}\n\n/** Lower a `handler` option to an {@link APP_EXCEPTION_HANDLER} provider. */\nconst handlerProvider = (handler: Type<ExceptionHandler> | ExceptionHandler): ProviderOptions =>\n typeof handler === 'function'\n ? { provide: APP_EXCEPTION_HANDLER, useClass: handler }\n : { provide: APP_EXCEPTION_HANDLER, useValue: handler };\n\nconst { ConfigurableModuleClass } = defineModule<ErrorsModuleOptions>({\n name: 'Errors',\n setup: ({ options }) => {\n const providers: ProviderOptions[] = [\n {\n provide: ERROR_CATALOG,\n useValue: composeCatalogs(CORE_CATALOG, ...(options.catalogs ?? [])),\n },\n ];\n const exports: Array<typeof ERROR_CATALOG | typeof APP_EXCEPTION_HANDLER> = [ERROR_CATALOG];\n if (options.handler) {\n providers.push(handlerProvider(options.handler));\n exports.push(APP_EXCEPTION_HANDLER);\n }\n return { providers, exports };\n },\n});\n\n/**\n * Registers the application-wide error surface: the composed\n * {@link ERROR_CATALOG} that every transport edge redacts against, and an\n * optional {@link APP_EXCEPTION_HANDLER}. The imperative sibling is\n * `app.useGlobalExceptionHandler(handler)`.\n *\n * ```ts\n * @Module({\n * imports: [ErrorsModule.forRoot({ catalogs: [ordersCatalog], handler: SentryHandler })],\n * })\n * class AppModule {}\n * ```\n */\nexport class ErrorsModule extends ConfigurableModuleClass {}\n","interface ZodLikeSchema {\n parse(data: unknown): unknown;\n}\n\ntype InferOutput<T extends ZodLikeSchema> = ReturnType<T['parse']>;\n\nexport interface CreateZodDtoOptions {\n /** Override the generated class name (useful for debugging and OpenAPI). */\n name?: string;\n}\n\nexport function createZodDto<T extends ZodLikeSchema>(\n schema: T,\n options: CreateZodDtoOptions = {},\n) {\n // Computed-property-name idiom: NamedEvaluation reads the property key and\n // stamps `name` on the class at creation, so callers see `MyDto` (or the\n // override) directly in stack traces and OpenAPI output — no post-hoc\n // `Object.defineProperty` patching of the class's `name` slot.\n const className = options.name ?? 'ZodDto';\n const ZodDto = {\n [className]: class {\n static schema = schema;\n\n constructor(initial?: InferOutput<T>) {\n if (initial && typeof initial === 'object') {\n Object.assign(this, initial);\n }\n }\n },\n }[className];\n\n return ZodDto as unknown as {\n new (initial?: InferOutput<T>): InferOutput<T>;\n schema: T;\n };\n}\n","import { BadRequestException } from '../errors/http-exception';\nimport type { ArgumentMetadata, PipeTransform } from '../pipeline/types';\n\nexport class ValidationPipe implements PipeTransform {\n transform(value: unknown, metadata: ArgumentMetadata): unknown {\n const metatype = metadata.metatype as { schema?: { parse(d: unknown): unknown } } | undefined;\n if (!metatype?.schema?.parse) return value;\n\n try {\n return metatype.schema.parse(value);\n } catch (error: unknown) {\n if (\n error &&\n typeof error === 'object' &&\n 'issues' in error &&\n Array.isArray((error as Record<string, unknown>).issues)\n ) {\n throw new BadRequestException({\n statusCode: 400,\n message: 'Validation failed',\n errors: (error as Record<string, unknown>).issues,\n });\n }\n throw error;\n }\n }\n}\n","import { MetadataRegistry } from '../registry/metadata.registry';\n\nexport const SERIALIZE_METADATA = 'vela:serialize';\n\nexport function Serialize(dto: { schema: { parse(data: unknown): unknown } }): MethodDecorator {\n return (target, propertyKey) => {\n MetadataRegistry.setCustomHandlerMeta(\n target.constructor as new (...args: unknown[]) => unknown,\n propertyKey,\n SERIALIZE_METADATA,\n dto,\n );\n };\n}\n","import { MetadataRegistry } from '../registry/metadata.registry';\nimport type { CallHandler, ExecutionContext, NestInterceptor } from '../pipeline/types';\nimport { SERIALIZE_METADATA } from './serialize.decorator';\n\nexport class SerializerInterceptor implements NestInterceptor {\n async intercept(context: ExecutionContext, next: CallHandler): Promise<unknown> {\n const result = await next.handle();\n const controller = context.getClass();\n const handler = context.getHandler();\n\n const dto = MetadataRegistry.getCustomHandlerMeta(controller, handler, SERIALIZE_METADATA) as\n | { schema?: { parse(data: unknown): unknown } }\n | undefined;\n\n const schema = dto?.schema;\n if (!schema?.parse) return result;\n\n if (Array.isArray(result)) {\n return result.map((item) => schema.parse(item));\n }\n return schema.parse(result);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAiBA,MAAa,cAAc,EACzB,MAAM,OAAO,YAAkB,UAA6B,CAAC,GAA6B;CACxF,MAAM,EAAE,WAAW,CAAC,GAAG,GAAG,qBAAqB;CAE/C,MAAM,oBAAoB,SAAS,SAAS,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAC3E,IAAI,kBAAkB,SAAS,GAC7B,iBAAiB,aAAa,CAAC,GAAG,mBAAmB,GAAI,iBAAiB,cAAc,CAAC,CAAE;CAG7F,MAAM,EAAE,WAAW,cAAc,WAAW,MAAM,UAAU,YAAY,gBAAgB;CAExF,MAAM,MAAM,IAAI,gBAAgB,WAAW,YAAY;CACvD,MAAM,YAAY,MAAM,OAAO,oBAAoB;CACnD,IAAI,aAAa,SAAS;CAE1B,MAAM,IAAI,iBAAiB;CAC3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AAElC,SAAgB,UAAU,KAAqE;CAC7F,QAAQ,QAAQ,gBAAgB;EAC9B,iBAAiB,qBACf,OAAO,aACP,aACA,oBACA,GACF;CACF;AACF;;;ACTA,IAAa,wBAAb,MAA8D;CAC5D,MAAM,UAAU,SAA2B,MAAqC;EAC9E,MAAM,SAAS,MAAM,KAAK,OAAO;EACjC,MAAM,aAAa,QAAQ,SAAS;EACpC,MAAM,UAAU,QAAQ,WAAW;EAMnC,MAAM,SAJM,iBAAiB,qBAAqB,YAAY,SAAS,kBAItD,CAAC,EAAE;EACpB,IAAI,CAAC,QAAQ,OAAO,OAAO;EAE3B,IAAI,MAAM,QAAQ,MAAM,GACtB,OAAO,OAAO,KAAK,SAAS,OAAO,MAAM,IAAI,CAAC;EAEhD,OAAO,OAAO,MAAM,MAAM;CAC5B;AACF"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,4 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { n as signUrl, r as verifySignedUrl, t as SignedUrlOptions } from "../signed-url-DKhgja4U.js";
|
|
2
|
+
//#region src/storage/path-template.d.ts
|
|
3
|
+
declare function expandPathTemplate(template: string, now?: Date): string;
|
|
4
|
+
/**
|
|
5
|
+
* Join a (templated) root with a relative path into a storage key. Segments are
|
|
6
|
+
* sanitized: `.`, `..`, and empty segments are dropped, so a caller-supplied
|
|
7
|
+
* `relativePath` containing `..` can never traverse above the disk root (a real
|
|
8
|
+
* hazard for the presign proxy, where the key flows through `new URL()` which
|
|
9
|
+
* would otherwise normalize `..`). Backslashes are treated as separators too.
|
|
10
|
+
*/
|
|
11
|
+
declare function joinStoragePath(root: string | undefined, relativePath: string, now?: Date): string;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/storage/storage.types.d.ts
|
|
14
|
+
/** Body payloads accepted by uploads. */
|
|
15
|
+
type StorageBody = ReadableStream | ArrayBuffer | ArrayBufferView | string | Blob | null;
|
|
16
|
+
type PresignMethod = 'GET' | 'PUT' | 'DELETE' | 'HEAD';
|
|
17
|
+
interface UploadOptions {
|
|
18
|
+
size?: number;
|
|
19
|
+
mimeType?: string;
|
|
20
|
+
metadata?: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
interface UploadResult {
|
|
23
|
+
path: string;
|
|
24
|
+
disk: string;
|
|
25
|
+
size?: number;
|
|
26
|
+
mimeType: string;
|
|
27
|
+
uploadedAt: Date;
|
|
28
|
+
}
|
|
29
|
+
interface DownloadResult {
|
|
30
|
+
toStream(): ReadableStream;
|
|
31
|
+
toArrayBuffer(): Promise<ArrayBuffer>;
|
|
32
|
+
toText(): Promise<string>;
|
|
33
|
+
contentType: string;
|
|
34
|
+
size: number;
|
|
35
|
+
metadata?: Record<string, string>;
|
|
36
|
+
}
|
|
37
|
+
interface PresignedUrlResult {
|
|
38
|
+
url: string;
|
|
39
|
+
method: PresignMethod;
|
|
40
|
+
expiresIn: number;
|
|
41
|
+
expiresAt: Date;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Runtime-agnostic storage driver contract. Implement per backend (R2 in
|
|
45
|
+
* `@velajs/cloudflare`, and e.g. S3/GCS elsewhere) so the manager/service and
|
|
46
|
+
* multi-disk logic stay driver-independent.
|
|
47
|
+
*/
|
|
48
|
+
interface StorageDriver {
|
|
49
|
+
upload(body: StorageBody, path: string, options: UploadOptions): Promise<UploadResult>;
|
|
50
|
+
download(path: string): Promise<DownloadResult>;
|
|
51
|
+
delete(path: string): Promise<void>;
|
|
52
|
+
exists(path: string): Promise<boolean>;
|
|
53
|
+
getPresignedUrl(path: string, method: PresignMethod, expiresIn: number): Promise<PresignedUrlResult>;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { type DownloadResult, type PresignMethod, type PresignedUrlResult, type SignedUrlOptions, type StorageBody, type StorageDriver, type UploadOptions, type UploadResult, expandPathTemplate, joinStoragePath, signUrl, verifySignedUrl };
|
|
57
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/storage/index.js
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { n as verifySignedUrl, t as signUrl } from "../signed-url-CMmi0SIb.js";
|
|
2
|
+
//#region src/storage/path-template.ts
|
|
3
|
+
function expandPathTemplate(template, now = /* @__PURE__ */ new Date()) {
|
|
4
|
+
const yyyy = now.getUTCFullYear().toString();
|
|
5
|
+
const mm = (now.getUTCMonth() + 1).toString().padStart(2, "0");
|
|
6
|
+
const dd = now.getUTCDate().toString().padStart(2, "0");
|
|
7
|
+
return template.replace(/\{date\}/g, `${yyyy}-${mm}-${dd}`).replace(/\{year\}/g, yyyy).replace(/\{month\}/g, mm).replace(/\{day\}/g, dd).replace(/\{uuid\}/g, () => crypto.randomUUID());
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Join a (templated) root with a relative path into a storage key. Segments are
|
|
11
|
+
* sanitized: `.`, `..`, and empty segments are dropped, so a caller-supplied
|
|
12
|
+
* `relativePath` containing `..` can never traverse above the disk root (a real
|
|
13
|
+
* hazard for the presign proxy, where the key flows through `new URL()` which
|
|
14
|
+
* would otherwise normalize `..`). Backslashes are treated as separators too.
|
|
15
|
+
*/
|
|
16
|
+
function joinStoragePath(root, relativePath, now) {
|
|
17
|
+
return `${root ? expandPathTemplate(root, now) : ""}/${relativePath}`.split(/[/\\]+/).filter((segment) => segment !== "" && segment !== "." && segment !== "..").join("/");
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { expandPathTemplate, joinStoragePath, signUrl, verifySignedUrl };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/storage/path-template.ts"],"sourcesContent":["// Expand path-template variables in a disk root / key. Supported tokens:\n// {date} → YYYY-MM-DD {year} → YYYY {month} → MM {day} → DD\n// {uuid} → crypto.randomUUID()\n// `now` is injectable for deterministic tests.\nexport function expandPathTemplate(template: string, now: Date = new Date()): string {\n const yyyy = now.getUTCFullYear().toString();\n const mm = (now.getUTCMonth() + 1).toString().padStart(2, '0');\n const dd = now.getUTCDate().toString().padStart(2, '0');\n return template\n .replace(/\\{date\\}/g, `${yyyy}-${mm}-${dd}`)\n .replace(/\\{year\\}/g, yyyy)\n .replace(/\\{month\\}/g, mm)\n .replace(/\\{day\\}/g, dd)\n .replace(/\\{uuid\\}/g, () => crypto.randomUUID());\n}\n\n/**\n * Join a (templated) root with a relative path into a storage key. Segments are\n * sanitized: `.`, `..`, and empty segments are dropped, so a caller-supplied\n * `relativePath` containing `..` can never traverse above the disk root (a real\n * hazard for the presign proxy, where the key flows through `new URL()` which\n * would otherwise normalize `..`). Backslashes are treated as separators too.\n */\nexport function joinStoragePath(\n root: string | undefined,\n relativePath: string,\n now?: Date,\n): string {\n const expandedRoot = root ? expandPathTemplate(root, now) : '';\n return `${expandedRoot}/${relativePath}`\n .split(/[/\\\\]+/)\n .filter((segment) => segment !== '' && segment !== '.' && segment !== '..')\n .join('/');\n}\n"],"mappings":";;AAIA,SAAgB,mBAAmB,UAAkB,sBAAY,IAAI,KAAK,GAAW;CACnF,MAAM,OAAO,IAAI,eAAe,CAAC,CAAC,SAAS;CAC3C,MAAM,MAAM,IAAI,YAAY,IAAI,EAAA,CAAG,SAAS,CAAC,CAAC,SAAS,GAAG,GAAG;CAC7D,MAAM,KAAK,IAAI,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,GAAG,GAAG;CACtD,OAAO,SACJ,QAAQ,aAAa,GAAG,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,CAC3C,QAAQ,aAAa,IAAI,CAAC,CAC1B,QAAQ,cAAc,EAAE,CAAC,CACzB,QAAQ,YAAY,EAAE,CAAC,CACvB,QAAQ,mBAAmB,OAAO,WAAW,CAAC;AACnD;;;;;;;;AASA,SAAgB,gBACd,MACA,cACA,KACQ;CAER,OAAO,GADc,OAAO,mBAAmB,MAAM,GAAG,IAAI,GACrC,GAAG,eACvB,MAAM,QAAQ,CAAC,CACf,QAAQ,YAAY,YAAY,MAAM,YAAY,OAAO,YAAY,IAAI,CAAC,CAC1E,KAAK,GAAG;AACb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
import { SSEMessage, SSEStreamingApi, stream, streamSSE, streamText } from "hono/streaming";
|
|
2
|
+
export { type SSEMessage, type SSEStreamingApi, stream, streamSSE, streamText };
|
package/dist/streaming/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { stream, streamSSE, streamText } from "hono/streaming";
|
|
2
|
+
export { stream, streamSSE, streamText };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
export { WsDispatcher, type WsEntrypointMeta } from './ws-dispatcher';
|
|
5
|
-
export { WsServerImpl, BroadcastOperatorImpl } from './ws-server';
|
|
6
|
-
export { InMemoryRoomRegistry, local } from './ws-sync';
|
|
7
|
-
export type { SyncDriver, RoomRegistry } from './ws-sync';
|
|
8
|
-
export { buildWsExecutionContext } from './ws-execution-context';
|
|
9
|
-
export { WsException, toErrorFrame } from './ws-exception';
|
|
10
|
-
export { resolveWsArgs } from './ws-argument-resolver';
|
|
11
|
-
export { WS_SERVER, WS_SYNC_DRIVER, WS_ROOM_REGISTRY, WS_MODULE_OPTIONS, WS_GATEWAY_METADATA, WS_SUBSCRIBE_METADATA, WS_RESERVED_METADATA, RESERVED_WS_EVENT_PREFIX, WsParamType, } from './websocket.tokens';
|
|
12
|
-
export type { WsClient, WsServer, WsMessage, WsResponse, BroadcastCommand, BroadcastOperator, WebSocketGatewayOptions, SubscribeMessageMetadata, ReservedWsEventMetadata, ReservedWsEventHandler, WsExecutionContext, WsArgumentsHost, OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect, } from './websocket.types';
|
|
1
|
+
import { N as WsArgumentsHost } from "../discovery.service-Cpf1QcZ5.js";
|
|
2
|
+
import { $n as WebSocketGatewayOptions, An as WsServerImpl, Bn as MessageBody, Cn as WS_SYNC_DRIVER, Dn as toErrorFrame, En as WsException, Fn as InMemoryRoomRegistry, Gn as BroadcastCommand, Hn as SubscribeMessage, In as RoomRegistry, Jn as OnGatewayDisconnect, Kn as BroadcastOperator, Ln as SyncDriver, Mn as WsEntrypointMeta, Nn as WebSocketModule, On as buildWsExecutionContext, Pn as WebSocketModuleOptions, Qn as SubscribeMessageMetadata, Rn as local, Sn as WS_SUBSCRIBE_METADATA, Tn as resolveWsArgs, Un as WebSocketGateway, Vn as ReservedWsEvent, Wn as WebSocketServer, Xn as ReservedWsEventHandler, Yn as OnGatewayInit, Zn as ReservedWsEventMetadata, _n as WS_GATEWAY_METADATA, bn as WS_ROOM_REGISTRY, er as WsClient, gn as RESERVED_WS_EVENT_PREFIX, ir as WsServer, jn as WsDispatcher, kn as BroadcastOperatorImpl, nr as WsMessage, qn as OnGatewayConnection, rr as WsResponse, tr as WsExecutionContext, vn as WS_MODULE_OPTIONS, wn as WsParamType, xn as WS_SERVER, yn as WS_RESERVED_METADATA, zn as ConnectedSocket } from "../index-DhShDLCM.js";
|
|
3
|
+
export { type BroadcastCommand, type BroadcastOperator, BroadcastOperatorImpl, ConnectedSocket, InMemoryRoomRegistry, MessageBody, type OnGatewayConnection, type OnGatewayDisconnect, type OnGatewayInit, RESERVED_WS_EVENT_PREFIX, ReservedWsEvent, type ReservedWsEventHandler, type ReservedWsEventMetadata, type RoomRegistry, SubscribeMessage, type SubscribeMessageMetadata, type SyncDriver, WS_GATEWAY_METADATA, WS_MODULE_OPTIONS, WS_RESERVED_METADATA, WS_ROOM_REGISTRY, WS_SERVER, WS_SUBSCRIBE_METADATA, WS_SYNC_DRIVER, WebSocketGateway, type WebSocketGatewayOptions, WebSocketModule, type WebSocketModuleOptions, WebSocketServer, type WsArgumentsHost, type WsClient, WsDispatcher, type WsEntrypointMeta, WsException, type WsExecutionContext, type WsMessage, WsParamType, type WsResponse, type WsServer, WsServerImpl, buildWsExecutionContext, local, resolveWsArgs, toErrorFrame };
|
package/dist/websocket/index.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
// Module
|
|
4
|
-
export { WebSocketModule } from "./websocket.module.js";
|
|
5
|
-
// Dispatcher (injected/called by transports) + the 'websocket' entrypoint meta
|
|
6
|
-
export { WsDispatcher } from "./ws-dispatcher.js";
|
|
7
|
-
// Server handle + rooms + sync
|
|
8
|
-
export { WsServerImpl, BroadcastOperatorImpl } from "./ws-server.js";
|
|
9
|
-
export { InMemoryRoomRegistry, local } from "./ws-sync.js";
|
|
10
|
-
// Execution context + exceptions
|
|
11
|
-
export { buildWsExecutionContext } from "./ws-execution-context.js";
|
|
12
|
-
export { WsException, toErrorFrame } from "./ws-exception.js";
|
|
13
|
-
// Argument resolution (used by transports building custom dispatch)
|
|
14
|
-
export { resolveWsArgs } from "./ws-argument-resolver.js";
|
|
15
|
-
// Tokens
|
|
16
|
-
export { WS_SERVER, WS_SYNC_DRIVER, WS_ROOM_REGISTRY, WS_MODULE_OPTIONS, WS_GATEWAY_METADATA, WS_SUBSCRIBE_METADATA, WS_RESERVED_METADATA, RESERVED_WS_EVENT_PREFIX, WsParamType } from "./websocket.tokens.js";
|
|
1
|
+
import { C as WS_SUBSCRIBE_METADATA, S as WS_SERVER, T as WsParamType, _ as RESERVED_WS_EVENT_PREFIX, a as WsServerImpl, b as WS_RESERVED_METADATA, c as toErrorFrame, d as ConnectedSocket, f as MessageBody, g as WebSocketServer, h as WebSocketGateway, i as BroadcastOperatorImpl, l as buildWsExecutionContext, m as SubscribeMessage, n as InMemoryRoomRegistry, o as WsDispatcher, p as ReservedWsEvent, r as local, s as WsException, t as WebSocketModule, u as resolveWsArgs, v as WS_GATEWAY_METADATA, w as WS_SYNC_DRIVER, x as WS_ROOM_REGISTRY, y as WS_MODULE_OPTIONS } from "../websocket-DXmB-MWJ.js";
|
|
2
|
+
export { BroadcastOperatorImpl, ConnectedSocket, InMemoryRoomRegistry, MessageBody, RESERVED_WS_EVENT_PREFIX, ReservedWsEvent, SubscribeMessage, WS_GATEWAY_METADATA, WS_MODULE_OPTIONS, WS_RESERVED_METADATA, WS_ROOM_REGISTRY, WS_SERVER, WS_SUBSCRIBE_METADATA, WS_SYNC_DRIVER, WebSocketGateway, WebSocketModule, WebSocketServer, WsDispatcher, WsException, WsParamType, WsServerImpl, buildWsExecutionContext, local, resolveWsArgs, toErrorFrame };
|