@velajs/vela 1.19.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -14
- package/dist/configurable-module.builder-5FGMaXG6.js +91 -0
- package/dist/configurable-module.builder-5FGMaXG6.js.map +1 -0
- package/dist/container-BqUHID4l.js +645 -0
- package/dist/container-BqUHID4l.js.map +1 -0
- package/dist/cron-matcher-C9qv5OUA.js +113 -0
- package/dist/cron-matcher-C9qv5OUA.js.map +1 -0
- package/dist/decorate-GcSMAbKn.js +528 -0
- package/dist/decorate-GcSMAbKn.js.map +1 -0
- package/dist/decorators-C8YBFCIk.js +53 -0
- package/dist/decorators-C8YBFCIk.js.map +1 -0
- package/dist/define-module-NOyOZNXD.js +235 -0
- package/dist/define-module-NOyOZNXD.js.map +1 -0
- package/dist/discovery.service-BYm95SSD.js +368 -0
- package/dist/discovery.service-BYm95SSD.js.map +1 -0
- package/dist/discovery.service-Cpf1QcZ5.d.ts +648 -0
- package/dist/i18n/index.d.ts +138 -10
- package/dist/i18n/index.js +270 -8
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-D72EQfcC.d.ts +430 -0
- package/dist/index-DhShDLCM.d.ts +2310 -0
- package/dist/index.d.ts +6 -70
- package/dist/index.js +14 -76
- package/dist/internal.d.ts +13 -17
- package/dist/internal.js +6 -19
- package/dist/live/index.d.ts +2 -12
- package/dist/live/index.js +826 -16
- package/dist/live/index.js.map +1 -0
- package/dist/metadata.registry-D1od8ZBt.d.ts +842 -0
- package/dist/plugin-ByBlVOve.js +1387 -0
- package/dist/plugin-ByBlVOve.js.map +1 -0
- package/dist/queue/index.d.ts +247 -10
- package/dist/queue/index.js +384 -12
- package/dist/queue/index.js.map +1 -0
- package/dist/request-context-C3nCGJNd.js +26 -0
- package/dist/request-context-C3nCGJNd.js.map +1 -0
- package/dist/route.manager-DRAZ5X04.js +991 -0
- package/dist/route.manager-DRAZ5X04.js.map +1 -0
- package/dist/schedule-node/index.d.ts +32 -3
- package/dist/schedule-node/index.js +97 -3
- package/dist/schedule-node/index.js.map +1 -0
- package/dist/schedule.registry-DVm7Jp5w.d.ts +55 -0
- package/dist/seeder/index.d.ts +75 -5
- package/dist/seeder/index.js +105 -4
- package/dist/seeder/index.js.map +1 -0
- package/dist/signed-url-CMmi0SIb.js +56 -0
- package/dist/signed-url-CMmi0SIb.js.map +1 -0
- package/dist/signed-url-DKhgja4U.d.ts +16 -0
- package/dist/src-eb5CI6Xn.js +2151 -0
- package/dist/src-eb5CI6Xn.js.map +1 -0
- package/dist/storage/index.d.ts +57 -4
- package/dist/storage/index.js +22 -5
- package/dist/storage/index.js.map +1 -0
- package/dist/streaming/index.d.ts +2 -2
- package/dist/streaming/index.js +2 -1
- package/dist/websocket/index.d.ts +3 -12
- package/dist/websocket/index.js +2 -16
- package/dist/websocket-DXmB-MWJ.js +697 -0
- package/dist/websocket-DXmB-MWJ.js.map +1 -0
- package/dist/websocket-node/index.d.ts +108 -6
- package/dist/websocket-node/index.js +228 -6
- package/dist/websocket-node/index.js.map +1 -0
- package/package.json +66 -53
- package/dist/__tests__/workers/entry.d.ts +0 -9
- package/dist/__tests__/workers-als/entry-als.d.ts +0 -9
- package/dist/application.d.ts +0 -104
- package/dist/application.js +0 -364
- package/dist/cache/cache.decorators.d.ts +0 -2
- package/dist/cache/cache.decorators.js +0 -4
- package/dist/cache/cache.interceptor.d.ts +0 -9
- package/dist/cache/cache.interceptor.js +0 -60
- package/dist/cache/cache.module.d.ts +0 -7
- package/dist/cache/cache.module.js +0 -58
- package/dist/cache/cache.service.d.ts +0 -9
- package/dist/cache/cache.service.js +0 -42
- package/dist/cache/cache.store.d.ts +0 -12
- package/dist/cache/cache.store.js +0 -51
- package/dist/cache/cache.tokens.d.ts +0 -6
- package/dist/cache/cache.tokens.js +0 -5
- package/dist/cache/cache.types.d.ts +0 -41
- package/dist/cache/cache.types.js +0 -1
- package/dist/cache/index.d.ts +0 -8
- package/dist/cache/index.js +0 -7
- package/dist/cache/tiered-cache.store.d.ts +0 -19
- package/dist/cache/tiered-cache.store.js +0 -40
- package/dist/config/config.module.d.ts +0 -19
- package/dist/config/config.module.js +0 -98
- package/dist/config/config.service.d.ts +0 -20
- package/dist/config/config.service.js +0 -43
- package/dist/config/config.store.d.ts +0 -46
- package/dist/config/config.store.js +0 -119
- package/dist/config/config.tokens.d.ts +0 -13
- package/dist/config/config.tokens.js +0 -14
- package/dist/config/config.types.d.ts +0 -41
- package/dist/config/config.types.js +0 -4
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -5
- package/dist/config/register-as.d.ts +0 -52
- package/dist/config/register-as.js +0 -39
- package/dist/constants.d.ts +0 -44
- package/dist/constants.js +0 -46
- package/dist/container/container.d.ts +0 -154
- package/dist/container/container.js +0 -849
- package/dist/container/decorators.d.ts +0 -17
- package/dist/container/decorators.js +0 -57
- package/dist/container/disposable.d.ts +0 -5
- package/dist/container/disposable.js +0 -33
- package/dist/container/index.d.ts +0 -6
- package/dist/container/index.js +0 -5
- package/dist/container/mixin.d.ts +0 -24
- package/dist/container/mixin.js +0 -26
- package/dist/container/module-ref.d.ts +0 -21
- package/dist/container/module-ref.js +0 -48
- package/dist/container/types.d.ts +0 -154
- package/dist/container/types.js +0 -49
- package/dist/cors/cors.module.d.ts +0 -7
- package/dist/cors/cors.module.js +0 -37
- package/dist/cors/cors.tokens.d.ts +0 -3
- package/dist/cors/cors.tokens.js +0 -2
- package/dist/cors/cors.types.d.ts +0 -8
- package/dist/cors/cors.types.js +0 -1
- package/dist/cors/index.d.ts +0 -3
- package/dist/cors/index.js +0 -2
- package/dist/crypto/signed-url.d.ts +0 -12
- package/dist/crypto/signed-url.js +0 -60
- package/dist/discovery/discoverable.decorator.d.ts +0 -38
- package/dist/discovery/discoverable.decorator.js +0 -42
- package/dist/discovery/discovery.service.d.ts +0 -102
- package/dist/discovery/discovery.service.js +0 -177
- package/dist/discovery/index.d.ts +0 -2
- package/dist/discovery/index.js +0 -2
- package/dist/entrypoint/entrypoint.registry.d.ts +0 -42
- package/dist/entrypoint/entrypoint.registry.js +0 -112
- package/dist/entrypoint/entrypoint.types.d.ts +0 -41
- package/dist/entrypoint/entrypoint.types.js +0 -3
- package/dist/entrypoint/execution-context.d.ts +0 -15
- package/dist/entrypoint/execution-context.js +0 -21
- package/dist/entrypoint/execution-scope.d.ts +0 -21
- package/dist/entrypoint/execution-scope.js +0 -28
- package/dist/entrypoint/index.d.ts +0 -4
- package/dist/entrypoint/index.js +0 -4
- package/dist/errors/http-exception.d.ts +0 -63
- package/dist/errors/http-exception.js +0 -142
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/event-emitter/event-emitter.decorators.d.ts +0 -1
- package/dist/event-emitter/event-emitter.decorators.js +0 -10
- package/dist/event-emitter/event-emitter.module.d.ts +0 -2
- package/dist/event-emitter/event-emitter.module.js +0 -23
- package/dist/event-emitter/event-emitter.service.d.ts +0 -13
- package/dist/event-emitter/event-emitter.service.js +0 -127
- package/dist/event-emitter/event-emitter.subscriber.d.ts +0 -9
- package/dist/event-emitter/event-emitter.subscriber.js +0 -45
- package/dist/event-emitter/event-emitter.tokens.d.ts +0 -1
- package/dist/event-emitter/event-emitter.tokens.js +0 -1
- package/dist/event-emitter/event-emitter.types.d.ts +0 -5
- package/dist/event-emitter/event-emitter.types.js +0 -1
- package/dist/event-emitter/index.d.ts +0 -6
- package/dist/event-emitter/index.js +0 -5
- package/dist/exceptions/errors.module.d.ts +0 -40
- package/dist/exceptions/errors.module.js +0 -46
- package/dist/exceptions/exception-handler.d.ts +0 -56
- package/dist/exceptions/exception-handler.js +0 -17
- package/dist/exceptions/index.d.ts +0 -6
- package/dist/exceptions/index.js +0 -3
- package/dist/exceptions/reporter.d.ts +0 -21
- package/dist/exceptions/reporter.js +0 -70
- package/dist/factory/adapter.d.ts +0 -36
- package/dist/factory/adapter.js +0 -18
- package/dist/factory/bootstrap.d.ts +0 -23
- package/dist/factory/bootstrap.js +0 -110
- package/dist/factory.d.ts +0 -16
- package/dist/factory.js +0 -36
- package/dist/fetch/fetch.module.d.ts +0 -7
- package/dist/fetch/fetch.module.js +0 -31
- package/dist/fetch/fetch.service.d.ts +0 -24
- package/dist/fetch/fetch.service.js +0 -145
- package/dist/fetch/fetch.types.d.ts +0 -24
- package/dist/fetch/fetch.types.js +0 -1
- package/dist/fetch/index.d.ts +0 -3
- package/dist/fetch/index.js +0 -2
- package/dist/health/health.http.d.ts +0 -14
- package/dist/health/health.http.js +0 -75
- package/dist/health/health.indicator.d.ts +0 -9
- package/dist/health/health.indicator.js +0 -32
- package/dist/health/health.module.d.ts +0 -2
- package/dist/health/health.module.js +0 -26
- package/dist/health/health.service.d.ts +0 -7
- package/dist/health/health.service.js +0 -69
- package/dist/health/health.types.d.ts +0 -15
- package/dist/health/health.types.js +0 -1
- package/dist/health/index.d.ts +0 -6
- package/dist/health/index.js +0 -4
- package/dist/http/ambient.d.ts +0 -17
- package/dist/http/ambient.js +0 -44
- package/dist/http/argument-resolver.d.ts +0 -10
- package/dist/http/argument-resolver.js +0 -89
- package/dist/http/decorators.d.ts +0 -198
- package/dist/http/decorators.js +0 -321
- package/dist/http/execution-context.d.ts +0 -8
- package/dist/http/execution-context.js +0 -35
- package/dist/http/handler-executor.d.ts +0 -20
- package/dist/http/handler-executor.js +0 -133
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.js +0 -7
- package/dist/http/instantiate.d.ts +0 -4
- package/dist/http/instantiate.js +0 -45
- package/dist/http/lazy-param.decorator.d.ts +0 -37
- package/dist/http/lazy-param.decorator.js +0 -117
- package/dist/http/request-container.d.ts +0 -16
- package/dist/http/request-container.js +0 -19
- package/dist/http/request-context.d.ts +0 -13
- package/dist/http/request-context.js +0 -22
- package/dist/http/response-mapper.d.ts +0 -8
- package/dist/http/response-mapper.js +0 -42
- package/dist/http/route-contributor.d.ts +0 -68
- package/dist/http/route-contributor.js +0 -22
- package/dist/http/route-map.d.ts +0 -30
- package/dist/http/route-map.js +0 -27
- package/dist/http/route.manager.d.ts +0 -92
- package/dist/http/route.manager.js +0 -481
- package/dist/http/types.d.ts +0 -37
- package/dist/http/types.js +0 -1
- package/dist/http/url/index.d.ts +0 -4
- package/dist/http/url/index.js +0 -3
- package/dist/http/url/signed-url.guard.d.ts +0 -27
- package/dist/http/url/signed-url.guard.js +0 -62
- package/dist/http/url/signing-secret.d.ts +0 -20
- package/dist/http/url/signing-secret.js +0 -24
- package/dist/http/url/url-generator.service.d.ts +0 -52
- package/dist/http/url/url-generator.service.js +0 -104
- package/dist/i18n/deep-merge.d.ts +0 -2
- package/dist/i18n/deep-merge.js +0 -15
- package/dist/i18n/i18n.middleware.d.ts +0 -15
- package/dist/i18n/i18n.middleware.js +0 -94
- package/dist/i18n/i18n.module.d.ts +0 -13
- package/dist/i18n/i18n.module.js +0 -69
- package/dist/i18n/i18n.options.d.ts +0 -30
- package/dist/i18n/i18n.options.js +0 -16
- package/dist/i18n/i18n.service.d.ts +0 -20
- package/dist/i18n/i18n.service.js +0 -49
- package/dist/i18n/i18n.tokens.d.ts +0 -6
- package/dist/i18n/i18n.tokens.js +0 -3
- package/dist/i18n/i18n.types.d.ts +0 -6
- package/dist/i18n/i18n.types.js +0 -1
- package/dist/i18n/message-loader.service.d.ts +0 -21
- package/dist/i18n/message-loader.service.js +0 -90
- package/dist/i18n/message-registry.d.ts +0 -16
- package/dist/i18n/message-registry.js +0 -49
- package/dist/lifecycle/index.d.ts +0 -20
- package/dist/lifecycle/index.js +0 -15
- package/dist/live/live.cursor.d.ts +0 -22
- package/dist/live/live.cursor.js +0 -56
- package/dist/live/live.decorators.d.ts +0 -32
- package/dist/live/live.decorators.js +0 -46
- package/dist/live/live.delta.d.ts +0 -15
- package/dist/live/live.delta.js +0 -51
- package/dist/live/live.engine.d.ts +0 -88
- package/dist/live/live.engine.js +0 -471
- package/dist/live/live.invalidation.d.ts +0 -45
- package/dist/live/live.invalidation.js +0 -99
- package/dist/live/live.module.d.ts +0 -28
- package/dist/live/live.module.js +0 -87
- package/dist/live/live.tokens.d.ts +0 -9
- package/dist/live/live.tokens.js +0 -8
- package/dist/live/live.types.d.ts +0 -138
- package/dist/live/live.types.js +0 -1
- package/dist/live/presence.d.ts +0 -44
- package/dist/live/presence.js +0 -130
- package/dist/metadata.d.ts +0 -10
- package/dist/metadata.js +0 -20
- package/dist/module/configurable-module.builder.d.ts +0 -56
- package/dist/module/configurable-module.builder.js +0 -84
- package/dist/module/configurable-module.types.d.ts +0 -93
- package/dist/module/configurable-module.types.js +0 -5
- package/dist/module/decorators.d.ts +0 -10
- package/dist/module/decorators.js +0 -47
- package/dist/module/define-module.d.ts +0 -112
- package/dist/module/define-module.js +0 -232
- package/dist/module/graph.d.ts +0 -10
- package/dist/module/graph.js +0 -35
- package/dist/module/index.d.ts +0 -10
- package/dist/module/index.js +0 -7
- package/dist/module/lazy-modules.d.ts +0 -82
- package/dist/module/lazy-modules.js +0 -231
- package/dist/module/lazy-provider.d.ts +0 -65
- package/dist/module/lazy-provider.js +0 -111
- package/dist/module/middleware.d.ts +0 -30
- package/dist/module/middleware.js +0 -67
- package/dist/module/module-loader.d.ts +0 -58
- package/dist/module/module-loader.js +0 -484
- package/dist/module/stable-hash.d.ts +0 -15
- package/dist/module/stable-hash.js +0 -52
- package/dist/module/types.d.ts +0 -1
- package/dist/module/types.js +0 -1
- package/dist/openapi/decorators.d.ts +0 -34
- package/dist/openapi/decorators.js +0 -66
- package/dist/openapi/document.d.ts +0 -3
- package/dist/openapi/document.js +0 -316
- package/dist/openapi/index.d.ts +0 -7
- package/dist/openapi/index.js +0 -6
- package/dist/openapi/redoc-ui.d.ts +0 -1
- package/dist/openapi/redoc-ui.js +0 -19
- package/dist/openapi/scalar-ui.d.ts +0 -1
- package/dist/openapi/scalar-ui.js +0 -19
- package/dist/openapi/swagger-ui.d.ts +0 -1
- package/dist/openapi/swagger-ui.js +0 -23
- package/dist/openapi/types.d.ts +0 -182
- package/dist/openapi/types.js +0 -4
- package/dist/openapi/zod-to-json-schema.d.ts +0 -4
- package/dist/openapi/zod-to-json-schema.js +0 -57
- package/dist/pipeline/app-providers.d.ts +0 -10
- package/dist/pipeline/app-providers.js +0 -43
- package/dist/pipeline/component.manager.d.ts +0 -25
- package/dist/pipeline/component.manager.js +0 -66
- package/dist/pipeline/decorators.d.ts +0 -10
- package/dist/pipeline/decorators.js +0 -42
- package/dist/pipeline/index.d.ts +0 -12
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/pipeline-runner.d.ts +0 -31
- package/dist/pipeline/pipeline-runner.js +0 -40
- package/dist/pipeline/pipes.d.ts +0 -48
- package/dist/pipeline/pipes.js +0 -104
- package/dist/pipeline/reflector.d.ts +0 -86
- package/dist/pipeline/reflector.js +0 -121
- package/dist/pipeline/scoped-components.d.ts +0 -26
- package/dist/pipeline/scoped-components.js +0 -27
- package/dist/pipeline/tokens.d.ts +0 -57
- package/dist/pipeline/tokens.js +0 -47
- package/dist/pipeline/types.d.ts +0 -64
- package/dist/pipeline/types.js +0 -1
- package/dist/plugin/plugin.d.ts +0 -31
- package/dist/plugin/plugin.js +0 -111
- package/dist/queue/inline.driver.d.ts +0 -30
- package/dist/queue/inline.driver.js +0 -58
- package/dist/queue/queue.binding.d.ts +0 -23
- package/dist/queue/queue.binding.js +0 -60
- package/dist/queue/queue.client.d.ts +0 -20
- package/dist/queue/queue.client.js +0 -33
- package/dist/queue/queue.decorators.d.ts +0 -23
- package/dist/queue/queue.decorators.js +0 -46
- package/dist/queue/queue.dispatch.d.ts +0 -36
- package/dist/queue/queue.dispatch.js +0 -109
- package/dist/queue/queue.module.d.ts +0 -32
- package/dist/queue/queue.module.js +0 -80
- package/dist/queue/queue.tokens.d.ts +0 -21
- package/dist/queue/queue.tokens.js +0 -34
- package/dist/queue/queue.types.d.ts +0 -61
- package/dist/queue/queue.types.js +0 -4
- package/dist/registry/index.d.ts +0 -2
- package/dist/registry/index.js +0 -1
- package/dist/registry/metadata.registry.d.ts +0 -73
- package/dist/registry/metadata.registry.js +0 -357
- package/dist/registry/paths.d.ts +0 -3
- package/dist/registry/paths.js +0 -15
- package/dist/registry/types.d.ts +0 -116
- package/dist/registry/types.js +0 -1
- package/dist/registry/util.d.ts +0 -3
- package/dist/registry/util.js +0 -8
- package/dist/schedule/cron-matcher.d.ts +0 -2
- package/dist/schedule/cron-matcher.js +0 -62
- package/dist/schedule/index.d.ts +0 -8
- package/dist/schedule/index.js +0 -5
- package/dist/schedule/schedule.decorators.d.ts +0 -2
- package/dist/schedule/schedule.decorators.js +0 -18
- package/dist/schedule/schedule.module.d.ts +0 -9
- package/dist/schedule/schedule.module.js +0 -28
- package/dist/schedule/schedule.registry.d.ts +0 -23
- package/dist/schedule/schedule.registry.js +0 -63
- package/dist/schedule/schedule.tokens.d.ts +0 -2
- package/dist/schedule/schedule.tokens.js +0 -2
- package/dist/schedule/schedule.types.d.ts +0 -8
- package/dist/schedule/schedule.types.js +0 -1
- package/dist/schedule-node/schedule-node.module.d.ts +0 -9
- package/dist/schedule-node/schedule-node.module.js +0 -28
- package/dist/schedule-node/schedule.executor.d.ts +0 -19
- package/dist/schedule-node/schedule.executor.js +0 -112
- package/dist/seeder/seeder.decorator.d.ts +0 -7
- package/dist/seeder/seeder.decorator.js +0 -15
- package/dist/seeder/seeder.module.d.ts +0 -16
- package/dist/seeder/seeder.module.js +0 -44
- package/dist/seeder/seeder.registry.d.ts +0 -23
- package/dist/seeder/seeder.registry.js +0 -83
- package/dist/seeder/seeder.tokens.d.ts +0 -2
- package/dist/seeder/seeder.tokens.js +0 -1
- package/dist/seeder/seeder.types.d.ts +0 -20
- package/dist/seeder/seeder.types.js +0 -1
- package/dist/serialization/index.d.ts +0 -2
- package/dist/serialization/index.js +0 -2
- package/dist/serialization/serialize.decorator.d.ts +0 -6
- package/dist/serialization/serialize.decorator.js +0 -7
- package/dist/serialization/serializer.interceptor.d.ts +0 -4
- package/dist/serialization/serializer.interceptor.js +0 -16
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -1
- package/dist/services/logger.d.ts +0 -59
- package/dist/services/logger.js +0 -159
- package/dist/storage/path-template.d.ts +0 -9
- package/dist/storage/path-template.js +0 -20
- package/dist/storage/storage.types.d.ts +0 -41
- package/dist/storage/storage.types.js +0 -5
- package/dist/throttler/index.d.ts +0 -6
- package/dist/throttler/index.js +0 -5
- package/dist/throttler/throttler.decorators.d.ts +0 -3
- package/dist/throttler/throttler.decorators.js +0 -4
- package/dist/throttler/throttler.guard.d.ts +0 -9
- package/dist/throttler/throttler.guard.js +0 -72
- package/dist/throttler/throttler.module.d.ts +0 -7
- package/dist/throttler/throttler.module.js +0 -41
- package/dist/throttler/throttler.storage.d.ts +0 -10
- package/dist/throttler/throttler.storage.js +0 -44
- package/dist/throttler/throttler.tokens.d.ts +0 -6
- package/dist/throttler/throttler.tokens.js +0 -5
- package/dist/throttler/throttler.types.d.ts +0 -25
- package/dist/throttler/throttler.types.js +0 -1
- package/dist/validation/create-zod-dto.d.ts +0 -13
- package/dist/validation/create-zod-dto.js +0 -18
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -2
- package/dist/validation/validation.pipe.d.ts +0 -4
- package/dist/validation/validation.pipe.js +0 -19
- package/dist/websocket/websocket.decorators.d.ts +0 -47
- package/dist/websocket/websocket.decorators.js +0 -80
- package/dist/websocket/websocket.module.d.ts +0 -35
- package/dist/websocket/websocket.module.js +0 -63
- package/dist/websocket/websocket.tokens.d.ts +0 -30
- package/dist/websocket/websocket.tokens.js +0 -27
- package/dist/websocket/websocket.types.d.ts +0 -102
- package/dist/websocket/websocket.types.js +0 -4
- package/dist/websocket/ws-argument-resolver.d.ts +0 -13
- package/dist/websocket/ws-argument-resolver.js +0 -40
- package/dist/websocket/ws-dispatcher.d.ts +0 -54
- package/dist/websocket/ws-dispatcher.js +0 -343
- package/dist/websocket/ws-exception.d.ts +0 -25
- package/dist/websocket/ws-exception.js +0 -42
- package/dist/websocket/ws-execution-context.d.ts +0 -9
- package/dist/websocket/ws-execution-context.js +0 -24
- package/dist/websocket/ws-server.d.ts +0 -31
- package/dist/websocket/ws-server.js +0 -74
- package/dist/websocket/ws-sync.d.ts +0 -47
- package/dist/websocket/ws-sync.js +0 -74
- package/dist/websocket-node/node-ws-client.d.ts +0 -24
- package/dist/websocket-node/node-ws-client.js +0 -49
- package/dist/websocket-node/redis-live.d.ts +0 -24
- package/dist/websocket-node/redis-live.js +0 -57
- package/dist/websocket-node/redis-sync.d.ts +0 -33
- package/dist/websocket-node/redis-sync.js +0 -56
- package/dist/websocket-node/register-gateways.d.ts +0 -20
- package/dist/websocket-node/register-gateways.js +0 -61
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Scope } from '../constants';
|
|
2
|
-
import type { InjectableOptions, InjectMetadata, Token } from './types';
|
|
3
|
-
import { ForwardRef } from './types';
|
|
4
|
-
export declare function Injectable(options?: InjectableOptions): ClassDecorator;
|
|
5
|
-
export declare function Optional(): ParameterDecorator;
|
|
6
|
-
export declare function Inject(token: Token | ForwardRef): ParameterDecorator;
|
|
7
|
-
export declare function isInjectable(target: object): boolean;
|
|
8
|
-
export declare function getScope(target: object): Scope;
|
|
9
|
-
/**
|
|
10
|
-
* Read through Reflect so dist/src coexistence in tests routes through the
|
|
11
|
-
* single polyfill-installed registry — SWC writes `design:paramtypes` via
|
|
12
|
-
* Reflect, so reads must too. The runtime contract is that each entry is a
|
|
13
|
-
* constructor reference (a `Token`); we surface that contract directly so
|
|
14
|
-
* callers don't need to re-cast.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getConstructorDependencies(target: object): Array<Token | undefined>;
|
|
17
|
-
export declare function getInjectMetadata(target: object): InjectMetadata[];
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Scope } from "../constants.js";
|
|
2
|
-
import { MetadataRegistry } from "../registry/metadata.registry.js";
|
|
3
|
-
export function Injectable(options = {}) {
|
|
4
|
-
return (target)=>{
|
|
5
|
-
const { scope = Scope.SINGLETON } = options;
|
|
6
|
-
MetadataRegistry.markInjectable(target);
|
|
7
|
-
MetadataRegistry.setScope(target, scope);
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export function Optional() {
|
|
11
|
-
return (target, _propertyKey, parameterIndex)=>{
|
|
12
|
-
const existing = getInjectMetadata(target);
|
|
13
|
-
const entry = existing.find((m)=>m.index === parameterIndex);
|
|
14
|
-
if (entry) {
|
|
15
|
-
entry.optional = true;
|
|
16
|
-
} else {
|
|
17
|
-
existing.push({
|
|
18
|
-
index: parameterIndex,
|
|
19
|
-
optional: true
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
MetadataRegistry.setInjectTokens(target, existing);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export function Inject(token) {
|
|
26
|
-
return (target, _propertyKey, parameterIndex)=>{
|
|
27
|
-
const existing = getInjectMetadata(target);
|
|
28
|
-
const entry = existing.find((m)=>m.index === parameterIndex);
|
|
29
|
-
if (entry) {
|
|
30
|
-
entry.token = token;
|
|
31
|
-
} else {
|
|
32
|
-
existing.push({
|
|
33
|
-
index: parameterIndex,
|
|
34
|
-
token
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
MetadataRegistry.setInjectTokens(target, existing);
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export function isInjectable(target) {
|
|
41
|
-
return MetadataRegistry.hasInjectable(target);
|
|
42
|
-
}
|
|
43
|
-
export function getScope(target) {
|
|
44
|
-
return MetadataRegistry.getScope(target) ?? Scope.SINGLETON;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Read through Reflect so dist/src coexistence in tests routes through the
|
|
48
|
-
* single polyfill-installed registry — SWC writes `design:paramtypes` via
|
|
49
|
-
* Reflect, so reads must too. The runtime contract is that each entry is a
|
|
50
|
-
* constructor reference (a `Token`); we surface that contract directly so
|
|
51
|
-
* callers don't need to re-cast.
|
|
52
|
-
*/ export function getConstructorDependencies(target) {
|
|
53
|
-
return Reflect.getMetadata('design:paramtypes', target) ?? [];
|
|
54
|
-
}
|
|
55
|
-
export function getInjectMetadata(target) {
|
|
56
|
-
return MetadataRegistry.getInjectTokens(target) ?? [];
|
|
57
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// Edge-safe disposal contract. Precedence:
|
|
2
|
-
// Symbol.asyncDispose > Symbol.dispose > .dispose()
|
|
3
|
-
// Symbol.asyncDispose/Symbol.dispose are resolved at runtime (they are not in
|
|
4
|
-
// the ES2022 lib the project targets), so nothing here depends on the
|
|
5
|
-
// esnext.disposable typings.
|
|
6
|
-
const ASYNC_DISPOSE = Symbol.asyncDispose;
|
|
7
|
-
const SYNC_DISPOSE = Symbol.dispose;
|
|
8
|
-
function asRecord(value) {
|
|
9
|
-
if (value === null) return undefined;
|
|
10
|
-
return typeof value === 'object' || typeof value === 'function' ? value : undefined;
|
|
11
|
-
}
|
|
12
|
-
export function isDisposable(value) {
|
|
13
|
-
const obj = asRecord(value);
|
|
14
|
-
if (!obj) return false;
|
|
15
|
-
if (ASYNC_DISPOSE && typeof obj[ASYNC_DISPOSE] === 'function') return true;
|
|
16
|
-
if (SYNC_DISPOSE && typeof obj[SYNC_DISPOSE] === 'function') return true;
|
|
17
|
-
return typeof obj.dispose === 'function';
|
|
18
|
-
}
|
|
19
|
-
export async function disposeInstance(value) {
|
|
20
|
-
const obj = asRecord(value);
|
|
21
|
-
if (!obj) return;
|
|
22
|
-
if (ASYNC_DISPOSE && typeof obj[ASYNC_DISPOSE] === 'function') {
|
|
23
|
-
await obj[ASYNC_DISPOSE].call(obj);
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (SYNC_DISPOSE && typeof obj[SYNC_DISPOSE] === 'function') {
|
|
27
|
-
obj[SYNC_DISPOSE].call(obj);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (typeof obj.dispose === 'function') {
|
|
31
|
-
await obj.dispose.call(obj);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Container } from './container';
|
|
2
|
-
export { Injectable, Inject, Optional, isInjectable, getScope } from './decorators';
|
|
3
|
-
export { InjectionToken, ForwardRef, forwardRef, ModuleVisibilityError, MultipleProvidersFoundError, ROOT_MODULE_ID, describeToken, } from './types';
|
|
4
|
-
export { ModuleRef } from './module-ref';
|
|
5
|
-
export { mixin } from './mixin';
|
|
6
|
-
export type { Type, Token, InferToken, InferTokens, InjectableOptions, InjectMetadata, ProviderOptions, ProviderRegistration, InjectionTokenOptions, ModuleScope, ModuleDescription, ContainerOptions, Diagnostics, } from './types';
|
package/dist/container/index.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { Container } from "./container.js";
|
|
2
|
-
export { Injectable, Inject, Optional, isInjectable, getScope } from "./decorators.js";
|
|
3
|
-
export { InjectionToken, ForwardRef, forwardRef, ModuleVisibilityError, MultipleProvidersFoundError, ROOT_MODULE_ID, describeToken } from "./types.js";
|
|
4
|
-
export { ModuleRef } from "./module-ref.js";
|
|
5
|
-
export { mixin } from "./mixin.js";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Type } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a reusable injectable mixin class from a base class.
|
|
4
|
-
* Applies @Injectable() so the returned class can be registered as a provider.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* function RoleGuardMixin(role: string) {
|
|
9
|
-
* class MixedRoleGuard implements CanActivate {
|
|
10
|
-
* canActivate(ctx: ExecutionContext) {
|
|
11
|
-
* return ctx.getRequest().headers.get('x-role') === role;
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
* return mixin(MixedRoleGuard);
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* const AdminGuard = RoleGuardMixin('admin');
|
|
18
|
-
*
|
|
19
|
-
* @UseGuards(AdminGuard)
|
|
20
|
-
* @Get('/admin')
|
|
21
|
-
* adminOnly() { ... }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export declare function mixin<T>(mixinClass: Type<T>): Type<T>;
|
package/dist/container/mixin.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Injectable } from "./decorators.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates a reusable injectable mixin class from a base class.
|
|
4
|
-
* Applies @Injectable() so the returned class can be registered as a provider.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* function RoleGuardMixin(role: string) {
|
|
9
|
-
* class MixedRoleGuard implements CanActivate {
|
|
10
|
-
* canActivate(ctx: ExecutionContext) {
|
|
11
|
-
* return ctx.getRequest().headers.get('x-role') === role;
|
|
12
|
-
* }
|
|
13
|
-
* }
|
|
14
|
-
* return mixin(MixedRoleGuard);
|
|
15
|
-
* }
|
|
16
|
-
*
|
|
17
|
-
* const AdminGuard = RoleGuardMixin('admin');
|
|
18
|
-
*
|
|
19
|
-
* @UseGuards(AdminGuard)
|
|
20
|
-
* @Get('/admin')
|
|
21
|
-
* adminOnly() { ... }
|
|
22
|
-
* ```
|
|
23
|
-
*/ export function mixin(mixinClass) {
|
|
24
|
-
Injectable()(mixinClass);
|
|
25
|
-
return mixinClass;
|
|
26
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Token, Type } from './types';
|
|
2
|
-
import type { Container } from './container';
|
|
3
|
-
export declare class ModuleRef {
|
|
4
|
-
private readonly container;
|
|
5
|
-
constructor(container: Container);
|
|
6
|
-
/**
|
|
7
|
-
* Retrieve a provider instance from the DI container.
|
|
8
|
-
* Returns the existing singleton (or cached value) for the token.
|
|
9
|
-
*/
|
|
10
|
-
get<T>(token: Token<T>): T;
|
|
11
|
-
/**
|
|
12
|
-
* Resolve a provider, creating a new instance for TRANSIENT-scoped providers.
|
|
13
|
-
* For SINGLETON-scoped providers this is equivalent to get().
|
|
14
|
-
*/
|
|
15
|
-
resolve<T>(token: Token<T>): T;
|
|
16
|
-
/**
|
|
17
|
-
* Instantiate a class outside of the DI container's singleton cache.
|
|
18
|
-
* Dependencies are resolved from the container. Each call returns a new instance.
|
|
19
|
-
*/
|
|
20
|
-
create<T>(type: Type<T>): T;
|
|
21
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
function _ts_metadata(k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
}
|
|
10
|
-
import { Scope } from "../constants.js";
|
|
11
|
-
import { Injectable } from "./decorators.js";
|
|
12
|
-
export class ModuleRef {
|
|
13
|
-
container;
|
|
14
|
-
constructor(container){
|
|
15
|
-
this.container = container;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Retrieve a provider instance from the DI container.
|
|
19
|
-
* Returns the existing singleton (or cached value) for the token.
|
|
20
|
-
*/ get(token) {
|
|
21
|
-
return this.container.resolve(token);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Resolve a provider, creating a new instance for TRANSIENT-scoped providers.
|
|
25
|
-
* For SINGLETON-scoped providers this is equivalent to get().
|
|
26
|
-
*/ resolve(token) {
|
|
27
|
-
return this.container.resolve(token);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Instantiate a class outside of the DI container's singleton cache.
|
|
31
|
-
* Dependencies are resolved from the container. Each call returns a new instance.
|
|
32
|
-
*/ create(type) {
|
|
33
|
-
const sandbox = this.container.createDetached();
|
|
34
|
-
sandbox.register({
|
|
35
|
-
provide: type,
|
|
36
|
-
useClass: type,
|
|
37
|
-
scope: Scope.TRANSIENT
|
|
38
|
-
});
|
|
39
|
-
return sandbox.resolve(type);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
ModuleRef = _ts_decorate([
|
|
43
|
-
Injectable(),
|
|
44
|
-
_ts_metadata("design:type", Function),
|
|
45
|
-
_ts_metadata("design:paramtypes", [
|
|
46
|
-
typeof Container === "undefined" ? Object : Container
|
|
47
|
-
])
|
|
48
|
-
], ModuleRef);
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import type { Scope } from '../constants';
|
|
2
|
-
export type Type<T = any> = new (...args: any[]) => T;
|
|
3
|
-
export type Constructor<T = unknown> = abstract new (...args: any[]) => T;
|
|
4
|
-
export interface InjectionTokenOptions<T> {
|
|
5
|
-
factory?: () => T;
|
|
6
|
-
}
|
|
7
|
-
export declare class InjectionToken<T = unknown> {
|
|
8
|
-
private readonly description;
|
|
9
|
-
readonly options?: InjectionTokenOptions<T> | undefined;
|
|
10
|
-
constructor(description: string, options?: InjectionTokenOptions<T> | undefined);
|
|
11
|
-
toString(): string;
|
|
12
|
-
}
|
|
13
|
-
export declare class ForwardRef<T = unknown> {
|
|
14
|
-
readonly factory: () => Token<T>;
|
|
15
|
-
constructor(factory: () => Token<T>);
|
|
16
|
-
}
|
|
17
|
-
export declare function forwardRef<T>(factory: () => Token<T>): ForwardRef<T>;
|
|
18
|
-
export type Token<T = any> = Type<T> | InjectionToken<T> | string | symbol;
|
|
19
|
-
/**
|
|
20
|
-
* Maps a single DI `Token<T>` to its resolved value type at the type level:
|
|
21
|
-
* - `InjectionToken<T>` → `T`
|
|
22
|
-
* - `Type<T>` / `Constructor<T>` → `T` (the instance type)
|
|
23
|
-
* - `ForwardRef<T>` → `T`
|
|
24
|
-
* - `string` / `symbol` → `unknown` (runtime-only tokens carry no
|
|
25
|
-
* static type info; the consumer asserts).
|
|
26
|
-
*
|
|
27
|
-
* Used by `AsyncModuleOptions` to give `useFactory` parameters their real
|
|
28
|
-
* types based on the literal `inject` tuple — without `as const` at the call
|
|
29
|
-
* site (relies on the `const` type parameter on the consuming generic).
|
|
30
|
-
*/
|
|
31
|
-
export type InferToken<T> = T extends InjectionToken<infer U> ? U : T extends ForwardRef<infer U> ? U : T extends abstract new (...args: any[]) => infer U ? U : unknown;
|
|
32
|
-
/**
|
|
33
|
-
* Map every position of a `Token[]` tuple to its resolved value type.
|
|
34
|
-
* Pairs with `const Inject extends readonly Token<unknown>[]` generics to
|
|
35
|
-
* give `useFactory(...deps)` parameter types inferred from the literal
|
|
36
|
-
* `inject` array.
|
|
37
|
-
*/
|
|
38
|
-
export type InferTokens<T extends readonly unknown[]> = {
|
|
39
|
-
[K in keyof T]: InferToken<T[K]>;
|
|
40
|
-
};
|
|
41
|
-
export interface InjectableOptions {
|
|
42
|
-
scope?: Scope;
|
|
43
|
-
}
|
|
44
|
-
export interface InjectMetadata {
|
|
45
|
-
index: number;
|
|
46
|
-
token?: Token | ForwardRef;
|
|
47
|
-
optional?: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface ProviderOptions<T = unknown> {
|
|
50
|
-
provide?: Token<T>;
|
|
51
|
-
scope?: Scope;
|
|
52
|
-
useValue?: T;
|
|
53
|
-
useFactory?: (...args: any[]) => T | Promise<T>;
|
|
54
|
-
useClass?: Type<T>;
|
|
55
|
-
inject?: readonly Token[];
|
|
56
|
-
useExisting?: Token<T>;
|
|
57
|
-
}
|
|
58
|
-
export interface ProviderRegistration<T = unknown> {
|
|
59
|
-
provide: Token<T>;
|
|
60
|
-
/** The declared scope (from `@Injectable`/`@Controller`/provider options). */
|
|
61
|
-
scope: Scope;
|
|
62
|
-
/**
|
|
63
|
-
* Scope after request-scope bubbling: `REQUEST` if this provider (transitively)
|
|
64
|
-
* depends on a request-scoped provider, else the declared scope. Computed once
|
|
65
|
-
* at bootstrap (`Container.computeEffectiveScopes`); falls back to `scope`
|
|
66
|
-
* until then. Governs caching + eager instantiation.
|
|
67
|
-
*/
|
|
68
|
-
effectiveScope?: Scope;
|
|
69
|
-
/**
|
|
70
|
-
* Module that owns this registration. Used by `resolveClass` to determine
|
|
71
|
-
* the POV from which the class's dependencies resolve. Sandbox/bootstrap
|
|
72
|
-
* registrations land in the `"__root__"` bucket.
|
|
73
|
-
*/
|
|
74
|
-
declaringModuleId: string;
|
|
75
|
-
instance?: T;
|
|
76
|
-
useValue?: T;
|
|
77
|
-
useFactory?: (...args: any[]) => T | Promise<T>;
|
|
78
|
-
useClass?: Type<T>;
|
|
79
|
-
inject?: readonly Token[];
|
|
80
|
-
useExisting?: Token<T>;
|
|
81
|
-
}
|
|
82
|
-
export interface ModuleScope {
|
|
83
|
-
moduleId: string;
|
|
84
|
-
localProviders: Set<Token>;
|
|
85
|
-
importedModules: Set<string>;
|
|
86
|
-
exportedTokens: Set<Token>;
|
|
87
|
-
isGlobal: boolean;
|
|
88
|
-
/** Module instance opted into deferred (first-use) materialization. */
|
|
89
|
-
lazy?: boolean;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* The container's seam into lazy-module materialization (implemented by
|
|
93
|
-
* `LazyModuleManager`). The container only ever *claims* a pending module at
|
|
94
|
-
* a resolution trigger and *drains* completed claims when the resolution
|
|
95
|
-
* stack has fully unwound — construction and hook replay live behind this
|
|
96
|
-
* interface so the container stays module-system-agnostic.
|
|
97
|
-
*/
|
|
98
|
-
export interface LazyResolutionHook {
|
|
99
|
-
/** Is this module instance still deferred (untriggered)? */
|
|
100
|
-
isPending(moduleId: string): boolean;
|
|
101
|
-
/** Mark a pending module as triggered; idempotent. */
|
|
102
|
-
claim(moduleId: string): void;
|
|
103
|
-
/** Any claimed-but-unmaterialized groups? (cheap fast-path check) */
|
|
104
|
-
hasClaimed(): boolean;
|
|
105
|
-
/**
|
|
106
|
-
* A drain loop is currently running. The container must NOT start (or
|
|
107
|
-
* await) another drain from inside it — the running loop picks pending
|
|
108
|
-
* claims up; awaiting would self-deadlock on the async path.
|
|
109
|
-
*/
|
|
110
|
-
isDraining(): boolean;
|
|
111
|
-
/** Complete claimed groups synchronously; throws if async work surfaces. */
|
|
112
|
-
drainSync(): void;
|
|
113
|
-
/** Complete claimed groups, awaiting async construction and hooks. */
|
|
114
|
-
drainAsync(): Promise<void>;
|
|
115
|
-
}
|
|
116
|
-
export type Diagnostics = 'silent' | 'log' | 'throw';
|
|
117
|
-
export interface ContainerOptions {
|
|
118
|
-
diagnostics?: Diagnostics;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Human-readable token label — class name, `InjectionToken(desc)`, symbol
|
|
122
|
-
* string, or String() fallback. Public so introspection tooling (module
|
|
123
|
-
* graphs, entrypoint listings) renders tokens the same way vela's own errors
|
|
124
|
-
* do.
|
|
125
|
-
*/
|
|
126
|
-
export declare function describeToken(token: Token): string;
|
|
127
|
-
/**
|
|
128
|
-
* One module instance in the loaded graph, serializable (strings only) —
|
|
129
|
-
* what `Container.getModuleDescriptions()` returns for introspection tooling
|
|
130
|
-
* (`vela module graph`). Reads registration state only; never constructs.
|
|
131
|
-
*/
|
|
132
|
-
export interface ModuleDescription {
|
|
133
|
-
moduleId: string;
|
|
134
|
-
/** moduleIds this instance imports. */
|
|
135
|
-
imports: string[];
|
|
136
|
-
isGlobal: boolean;
|
|
137
|
-
lazy: boolean;
|
|
138
|
-
/** Token labels registered in this instance's bucket (registration order). */
|
|
139
|
-
providers: string[];
|
|
140
|
-
/** Token labels this instance exports. */
|
|
141
|
-
exports: string[];
|
|
142
|
-
}
|
|
143
|
-
export declare class ModuleVisibilityError extends Error {
|
|
144
|
-
readonly moduleId: string;
|
|
145
|
-
readonly token: Token;
|
|
146
|
-
constructor(moduleId: string, token: Token);
|
|
147
|
-
}
|
|
148
|
-
export declare class MultipleProvidersFoundError extends Error {
|
|
149
|
-
readonly moduleId: string;
|
|
150
|
-
readonly token: Token;
|
|
151
|
-
readonly candidates: string[];
|
|
152
|
-
constructor(moduleId: string, token: Token, candidates: string[]);
|
|
153
|
-
}
|
|
154
|
-
export declare const ROOT_MODULE_ID = "__root__";
|
package/dist/container/types.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export class InjectionToken {
|
|
2
|
-
description;
|
|
3
|
-
options;
|
|
4
|
-
constructor(description, options){
|
|
5
|
-
this.description = description;
|
|
6
|
-
this.options = options;
|
|
7
|
-
}
|
|
8
|
-
toString() {
|
|
9
|
-
return `InjectionToken(${this.description})`;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export class ForwardRef {
|
|
13
|
-
factory;
|
|
14
|
-
constructor(factory){
|
|
15
|
-
this.factory = factory;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function forwardRef(factory) {
|
|
19
|
-
return new ForwardRef(factory);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Human-readable token label — class name, `InjectionToken(desc)`, symbol
|
|
23
|
-
* string, or String() fallback. Public so introspection tooling (module
|
|
24
|
-
* graphs, entrypoint listings) renders tokens the same way vela's own errors
|
|
25
|
-
* do.
|
|
26
|
-
*/ export function describeToken(token) {
|
|
27
|
-
if (token instanceof InjectionToken) return token.toString();
|
|
28
|
-
if (typeof token === 'function') return token.name;
|
|
29
|
-
if (typeof token === 'symbol') return token.toString();
|
|
30
|
-
return String(token);
|
|
31
|
-
}
|
|
32
|
-
export class ModuleVisibilityError extends Error {
|
|
33
|
-
moduleId;
|
|
34
|
-
token;
|
|
35
|
-
constructor(moduleId, token){
|
|
36
|
-
super(`Module '${moduleId}' cannot resolve '${describeToken(token)}': ` + `not declared in providers, not imported from another module's exports, not @Global. ` + `Either add to imports/exports or mark as @Global.`), this.moduleId = moduleId, this.token = token;
|
|
37
|
-
this.name = 'ModuleVisibilityError';
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export class MultipleProvidersFoundError extends Error {
|
|
41
|
-
moduleId;
|
|
42
|
-
token;
|
|
43
|
-
candidates;
|
|
44
|
-
constructor(moduleId, token, candidates){
|
|
45
|
-
super(`Multiple providers found for '${describeToken(token)}' in module '${moduleId}':\n` + candidates.map((c)=>` - ${c}`).join('\n') + `\nResolve ambiguity by importing only one instance, or by using a per-instance ` + `accessor exposed by the module (e.g., Module.tokenFor(key)).`), this.moduleId = moduleId, this.token = token, this.candidates = candidates;
|
|
46
|
-
this.name = 'MultipleProvidersFoundError';
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
export const ROOT_MODULE_ID = '__root__';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CorsOptions } from './cors.types';
|
|
2
|
-
declare const ConfigurableModuleClass: import("..").ConfigurableModuleClassType<CorsOptions, "forRoot", "create", {
|
|
3
|
-
isGlobal?: boolean;
|
|
4
|
-
}>;
|
|
5
|
-
export declare class CorsModule extends ConfigurableModuleClass {
|
|
6
|
-
}
|
|
7
|
-
export {};
|
package/dist/cors/cors.module.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { cors } from "hono/cors";
|
|
2
|
-
import { defineModule } from "../module/define-module.js";
|
|
3
|
-
import { APP_MIDDLEWARE } from "../pipeline/tokens.js";
|
|
4
|
-
import { CORS_OPTIONS } from "./cors.tokens.js";
|
|
5
|
-
function buildCorsMiddleware(options) {
|
|
6
|
-
const corsMiddleware = cors({
|
|
7
|
-
origin: options.origin ?? '*',
|
|
8
|
-
allowMethods: options.allowMethods,
|
|
9
|
-
allowHeaders: options.allowHeaders,
|
|
10
|
-
exposeHeaders: options.exposeHeaders,
|
|
11
|
-
credentials: options.credentials,
|
|
12
|
-
maxAge: options.maxAge
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
use: (c, next)=>corsMiddleware(c, next)
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const { ConfigurableModuleClass } = defineModule({
|
|
19
|
-
name: 'Cors',
|
|
20
|
-
optionsToken: CORS_OPTIONS,
|
|
21
|
-
setup: ({ OPTIONS })=>({
|
|
22
|
-
providers: [
|
|
23
|
-
{
|
|
24
|
-
provide: APP_MIDDLEWARE,
|
|
25
|
-
useFactory: (options)=>buildCorsMiddleware(options),
|
|
26
|
-
inject: [
|
|
27
|
-
OPTIONS
|
|
28
|
-
]
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
exports: [
|
|
32
|
-
OPTIONS
|
|
33
|
-
]
|
|
34
|
-
})
|
|
35
|
-
});
|
|
36
|
-
export class CorsModule extends ConfigurableModuleClass {
|
|
37
|
-
}
|
package/dist/cors/cors.tokens.js
DELETED
package/dist/cors/cors.types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/cors/index.d.ts
DELETED
package/dist/cors/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface SignedUrlOptions {
|
|
2
|
-
/** Time-to-live in seconds; a matching `expires` param is added + enforced. */
|
|
3
|
-
expiresIn?: number;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Sign a URL (or path) with HMAC-SHA256, appending `signature` (and `expires`).
|
|
7
|
-
* The signature covers `pathname + search` (minus the signature param). Returns
|
|
8
|
-
* the full URL for absolute inputs, or `pathname?search` for relative ones.
|
|
9
|
-
*/
|
|
10
|
-
export declare function signUrl(url: string, secret: string, options?: SignedUrlOptions): Promise<string>;
|
|
11
|
-
/** Verify a signed URL (timing-safe) and enforce `expires`. */
|
|
12
|
-
export declare function verifySignedUrl(url: string, secret: string): Promise<boolean>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Signed-URL utilities using HMAC-SHA256 via the Web Crypto API (edge-safe;
|
|
2
|
-
// no node:crypto). Verification uses crypto.subtle.verify for timing-safety.
|
|
3
|
-
// Pattern: https://developers.cloudflare.com/workers/examples/signing-requests/
|
|
4
|
-
//
|
|
5
|
-
// This is the canonical home for the util. `@velajs/vela/storage` re-exports it
|
|
6
|
-
// (see src/storage/index.ts) so the storage subpath API is unchanged, while
|
|
7
|
-
// core (the URL generator + signed-URL guard) imports it here directly — core
|
|
8
|
-
// never reaches into a published subpath.
|
|
9
|
-
async function importKey(secret) {
|
|
10
|
-
return crypto.subtle.importKey('raw', new TextEncoder().encode(secret), {
|
|
11
|
-
name: 'HMAC',
|
|
12
|
-
hash: 'SHA-256'
|
|
13
|
-
}, false, [
|
|
14
|
-
'sign',
|
|
15
|
-
'verify'
|
|
16
|
-
]);
|
|
17
|
-
}
|
|
18
|
-
function toBase64Url(buffer) {
|
|
19
|
-
const bytes = new Uint8Array(buffer);
|
|
20
|
-
let binary = '';
|
|
21
|
-
for (const byte of bytes)binary += String.fromCharCode(byte);
|
|
22
|
-
return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
23
|
-
}
|
|
24
|
-
function fromBase64Url(value) {
|
|
25
|
-
const base64 = value.replace(/-/g, '+').replace(/_/g, '/');
|
|
26
|
-
const binary = atob(base64);
|
|
27
|
-
const bytes = new Uint8Array(new ArrayBuffer(binary.length));
|
|
28
|
-
for(let i = 0; i < binary.length; i++)bytes[i] = binary.charCodeAt(i);
|
|
29
|
-
return bytes;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Sign a URL (or path) with HMAC-SHA256, appending `signature` (and `expires`).
|
|
33
|
-
* The signature covers `pathname + search` (minus the signature param). Returns
|
|
34
|
-
* the full URL for absolute inputs, or `pathname?search` for relative ones.
|
|
35
|
-
*/ export async function signUrl(url, secret, options) {
|
|
36
|
-
const parsed = new URL(url, 'https://placeholder.local');
|
|
37
|
-
const key = await importKey(secret);
|
|
38
|
-
if (options?.expiresIn) {
|
|
39
|
-
const expires = Math.floor(Date.now() / 1000) + options.expiresIn;
|
|
40
|
-
parsed.searchParams.set('expires', String(expires));
|
|
41
|
-
}
|
|
42
|
-
const dataToSign = `${parsed.pathname}?${parsed.searchParams.toString()}`;
|
|
43
|
-
const signatureBuffer = await crypto.subtle.sign('HMAC', key, new TextEncoder().encode(dataToSign));
|
|
44
|
-
parsed.searchParams.set('signature', toBase64Url(signatureBuffer));
|
|
45
|
-
return url.startsWith('http') ? parsed.toString() : `${parsed.pathname}?${parsed.searchParams.toString()}`;
|
|
46
|
-
}
|
|
47
|
-
/** Verify a signed URL (timing-safe) and enforce `expires`. */ export async function verifySignedUrl(url, secret) {
|
|
48
|
-
const parsed = new URL(url, 'https://placeholder.local');
|
|
49
|
-
const signature = parsed.searchParams.get('signature');
|
|
50
|
-
if (!signature) return false;
|
|
51
|
-
const expires = parsed.searchParams.get('expires');
|
|
52
|
-
if (expires) {
|
|
53
|
-
const expiryTime = parseInt(expires, 10);
|
|
54
|
-
if (Number.isNaN(expiryTime) || Math.floor(Date.now() / 1000) > expiryTime) return false;
|
|
55
|
-
}
|
|
56
|
-
parsed.searchParams.delete('signature');
|
|
57
|
-
const dataToVerify = `${parsed.pathname}?${parsed.searchParams.toString()}`;
|
|
58
|
-
const key = await importKey(secret);
|
|
59
|
-
return crypto.subtle.verify('HMAC', key, fromBase64Url(signature), new TextEncoder().encode(dataToVerify));
|
|
60
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A decorator whose annotated classes/methods are findable through
|
|
3
|
-
* `DiscoveryService` by the decorator itself (no string key at the call site).
|
|
4
|
-
*/
|
|
5
|
-
export interface DiscoverableDecorator<T> {
|
|
6
|
-
(value: T): ClassDecorator & MethodDecorator;
|
|
7
|
-
/** The metadata key backing this decorator — stable across HMR re-evals. */
|
|
8
|
-
KEY: string;
|
|
9
|
-
}
|
|
10
|
-
export interface CreateDiscoverableDecoratorOptions {
|
|
11
|
-
/**
|
|
12
|
-
* Append to a class-level list instead of overwriting a single slot —
|
|
13
|
-
* for stackable method decorators (`@Cron`-style: each application pushes
|
|
14
|
-
* `{ methodName, ...value }` onto the class's list, which
|
|
15
|
-
* `DiscoveryService.methodsWithMeta` flattens back to per-method entries).
|
|
16
|
-
*/
|
|
17
|
-
append?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Mint a discoverable decorator for a module's extension surface:
|
|
21
|
-
*
|
|
22
|
-
* ```ts
|
|
23
|
-
* export interface QueueConsumerMeta { queue: string }
|
|
24
|
-
* export const QueueConsumer = createDiscoverableDecorator<QueueConsumerMeta>('vela:queue:consumer');
|
|
25
|
-
*
|
|
26
|
-
* @QueueConsumer({ queue: 'emails' })
|
|
27
|
-
* @Injectable()
|
|
28
|
-
* class EmailConsumer { ... }
|
|
29
|
-
*
|
|
30
|
-
* // At bootstrap, anywhere:
|
|
31
|
-
* discovery.providersWithMeta(QueueConsumer) // typed { meta: QueueConsumerMeta }
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* Unlike `Reflector.createDecorator`, the key is required and caller-chosen:
|
|
35
|
-
* a random key would mint a fresh identity on every HMR re-eval and orphan
|
|
36
|
-
* previously-decorated classes. Namespace it (`'<pkg>:<area>:<thing>'`).
|
|
37
|
-
*/
|
|
38
|
-
export declare function createDiscoverableDecorator<T>(key: string, options?: CreateDiscoverableDecoratorOptions): DiscoverableDecorator<T>;
|