@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
package/dist/factory.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { VelaApplication } from './application';
|
|
2
|
-
import type { Type } from './container/types';
|
|
3
|
-
import type { RuntimeAdapter } from './factory/adapter';
|
|
4
|
-
import type { BootstrapOptions } from './factory/bootstrap';
|
|
5
|
-
export interface VelaCreateOptions extends BootstrapOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Runtime adapters binding this app to a platform (Cloudflare bindings,
|
|
8
|
-
* WebSocket transports, …). Their `requestMiddleware` is prepended to the
|
|
9
|
-
* global middleware chain; `onBootstrap`/`onRoutesBuilt` hooks run around
|
|
10
|
-
* route building. See {@link RuntimeAdapter}.
|
|
11
|
-
*/
|
|
12
|
-
adapters?: RuntimeAdapter[];
|
|
13
|
-
}
|
|
14
|
-
export declare const VelaFactory: {
|
|
15
|
-
create(rootModule: Type, options?: VelaCreateOptions): Promise<VelaApplication>;
|
|
16
|
-
};
|
package/dist/factory.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { VelaApplication } from "./application.js";
|
|
2
|
-
import { DiscoveryService } from "./discovery/discovery.service.js";
|
|
3
|
-
import { bootstrap } from "./factory/bootstrap.js";
|
|
4
|
-
export const VelaFactory = {
|
|
5
|
-
async create (rootModule, options = {}) {
|
|
6
|
-
const { adapters = [], ...bootstrapOptions } = options;
|
|
7
|
-
const adapterMiddleware = adapters.flatMap((a)=>a.requestMiddleware ?? []);
|
|
8
|
-
if (adapterMiddleware.length > 0) {
|
|
9
|
-
bootstrapOptions.middleware = [
|
|
10
|
-
...adapterMiddleware,
|
|
11
|
-
...bootstrapOptions.middleware ?? []
|
|
12
|
-
];
|
|
13
|
-
}
|
|
14
|
-
const { container, routeManager, loader } = await bootstrap(rootModule, bootstrapOptions);
|
|
15
|
-
const app = new VelaApplication(container, routeManager);
|
|
16
|
-
const instances = await loader.resolveAllInstances();
|
|
17
|
-
app.setInstances(instances);
|
|
18
|
-
await app.callOnModuleInit();
|
|
19
|
-
await app.callOnApplicationBootstrap();
|
|
20
|
-
const adapterContext = {
|
|
21
|
-
app,
|
|
22
|
-
container,
|
|
23
|
-
routeManager,
|
|
24
|
-
discovery: container.resolve(DiscoveryService)
|
|
25
|
-
};
|
|
26
|
-
for (const adapter of adapters){
|
|
27
|
-
await adapter.onBootstrap?.(adapterContext);
|
|
28
|
-
}
|
|
29
|
-
// Build routes (async — supports route-contributor integration)
|
|
30
|
-
await app.initRoutes();
|
|
31
|
-
for (const adapter of adapters){
|
|
32
|
-
await adapter.onRoutesBuilt?.(adapterContext);
|
|
33
|
-
}
|
|
34
|
-
return app;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HttpModuleOptions } from './fetch.types';
|
|
2
|
-
declare const ConfigurableModuleClass: import("..").ConfigurableModuleClassType<HttpModuleOptions, "forRoot", "create", {
|
|
3
|
-
isGlobal?: boolean;
|
|
4
|
-
}>;
|
|
5
|
-
export declare class HttpModule extends ConfigurableModuleClass {
|
|
6
|
-
}
|
|
7
|
-
export {};
|
|
@@ -1,31 +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
|
-
import { Module } from "../module/decorators.js";
|
|
8
|
-
import { ConfigurableModuleBuilder } from "../module/configurable-module.builder.js";
|
|
9
|
-
import { HttpService, HTTP_MODULE_OPTIONS } from "./fetch.service.js";
|
|
10
|
-
const { ConfigurableModuleClass } = new ConfigurableModuleBuilder({
|
|
11
|
-
moduleName: 'Http',
|
|
12
|
-
optionsInjectionToken: HTTP_MODULE_OPTIONS
|
|
13
|
-
}).build();
|
|
14
|
-
export class HttpModule extends ConfigurableModuleClass {
|
|
15
|
-
}
|
|
16
|
-
HttpModule = _ts_decorate([
|
|
17
|
-
Module({
|
|
18
|
-
providers: [
|
|
19
|
-
// Default for bare `imports: [HttpModule]`; forRoot(options) overrides via merge.
|
|
20
|
-
{
|
|
21
|
-
provide: HTTP_MODULE_OPTIONS,
|
|
22
|
-
useValue: {}
|
|
23
|
-
},
|
|
24
|
-
HttpService
|
|
25
|
-
],
|
|
26
|
-
exports: [
|
|
27
|
-
HttpService,
|
|
28
|
-
HTTP_MODULE_OPTIONS
|
|
29
|
-
]
|
|
30
|
-
})
|
|
31
|
-
], HttpModule);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '../container/index';
|
|
2
|
-
import type { HttpModuleOptions, HttpRequestConfig, HttpResponse, RequestConfig } from './fetch.types';
|
|
3
|
-
export declare const HTTP_MODULE_OPTIONS: InjectionToken<HttpModuleOptions>;
|
|
4
|
-
export declare class HttpRequestException extends Error {
|
|
5
|
-
readonly status: number;
|
|
6
|
-
readonly statusText: string;
|
|
7
|
-
readonly response: Response;
|
|
8
|
-
constructor(status: number, statusText: string, response: Response);
|
|
9
|
-
}
|
|
10
|
-
export declare class HttpService {
|
|
11
|
-
private readonly baseURL;
|
|
12
|
-
private readonly defaultHeaders;
|
|
13
|
-
private readonly defaultTimeout;
|
|
14
|
-
constructor(options: HttpModuleOptions);
|
|
15
|
-
get<T = unknown>(url: string, config?: RequestConfig): Promise<HttpResponse<T>>;
|
|
16
|
-
post<T = unknown>(url: string, body?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>;
|
|
17
|
-
put<T = unknown>(url: string, body?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>;
|
|
18
|
-
patch<T = unknown>(url: string, body?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>;
|
|
19
|
-
delete<T = unknown>(url: string, config?: RequestConfig): Promise<HttpResponse<T>>;
|
|
20
|
-
head(url: string, config?: RequestConfig): Promise<HttpResponse<void>>;
|
|
21
|
-
request<T = unknown>(config: HttpRequestConfig): Promise<HttpResponse<T>>;
|
|
22
|
-
private buildUrl;
|
|
23
|
-
private parseBody;
|
|
24
|
-
}
|
|
@@ -1,145 +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
|
-
function _ts_param(paramIndex, decorator) {
|
|
11
|
-
return function(target, key) {
|
|
12
|
-
decorator(target, key, paramIndex);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
import { Inject, Injectable, InjectionToken, Optional } from "../container/index.js";
|
|
16
|
-
export const HTTP_MODULE_OPTIONS = new InjectionToken('HTTP_MODULE_OPTIONS');
|
|
17
|
-
export class HttpRequestException extends Error {
|
|
18
|
-
status;
|
|
19
|
-
statusText;
|
|
20
|
-
response;
|
|
21
|
-
constructor(status, statusText, response){
|
|
22
|
-
super(`HTTP ${status} ${statusText}`), this.status = status, this.statusText = statusText, this.response = response;
|
|
23
|
-
this.name = 'HttpRequestException';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class HttpService {
|
|
27
|
-
baseURL;
|
|
28
|
-
defaultHeaders;
|
|
29
|
-
defaultTimeout;
|
|
30
|
-
constructor(options){
|
|
31
|
-
const opts = options ?? {};
|
|
32
|
-
this.baseURL = opts.baseURL ?? '';
|
|
33
|
-
this.defaultHeaders = opts.headers ?? {};
|
|
34
|
-
this.defaultTimeout = opts.timeout;
|
|
35
|
-
}
|
|
36
|
-
get(url, config) {
|
|
37
|
-
return this.request({
|
|
38
|
-
method: 'GET',
|
|
39
|
-
url,
|
|
40
|
-
...config
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
post(url, body, config) {
|
|
44
|
-
return this.request({
|
|
45
|
-
method: 'POST',
|
|
46
|
-
url,
|
|
47
|
-
body,
|
|
48
|
-
...config
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
put(url, body, config) {
|
|
52
|
-
return this.request({
|
|
53
|
-
method: 'PUT',
|
|
54
|
-
url,
|
|
55
|
-
body,
|
|
56
|
-
...config
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
patch(url, body, config) {
|
|
60
|
-
return this.request({
|
|
61
|
-
method: 'PATCH',
|
|
62
|
-
url,
|
|
63
|
-
body,
|
|
64
|
-
...config
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
delete(url, config) {
|
|
68
|
-
return this.request({
|
|
69
|
-
method: 'DELETE',
|
|
70
|
-
url,
|
|
71
|
-
...config
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
head(url, config) {
|
|
75
|
-
return this.request({
|
|
76
|
-
method: 'HEAD',
|
|
77
|
-
url,
|
|
78
|
-
...config
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
async request(config) {
|
|
82
|
-
const fullUrl = this.buildUrl(config.url, config.params);
|
|
83
|
-
const headers = {
|
|
84
|
-
...this.defaultHeaders,
|
|
85
|
-
...config.headers
|
|
86
|
-
};
|
|
87
|
-
const init = {
|
|
88
|
-
method: config.method,
|
|
89
|
-
headers
|
|
90
|
-
};
|
|
91
|
-
if (config.body !== undefined) {
|
|
92
|
-
if (typeof config.body === 'string' || config.body instanceof FormData) {
|
|
93
|
-
init.body = config.body;
|
|
94
|
-
} else {
|
|
95
|
-
init.body = JSON.stringify(config.body);
|
|
96
|
-
if (!headers['Content-Type'] && !headers['content-type']) {
|
|
97
|
-
headers['Content-Type'] = 'application/json';
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const timeout = config.timeout ?? this.defaultTimeout;
|
|
102
|
-
if (timeout !== undefined) {
|
|
103
|
-
init.signal = AbortSignal.timeout(timeout);
|
|
104
|
-
}
|
|
105
|
-
const response = await fetch(fullUrl, init);
|
|
106
|
-
if (!response.ok) {
|
|
107
|
-
throw new HttpRequestException(response.status, response.statusText, response);
|
|
108
|
-
}
|
|
109
|
-
const data = await this.parseBody(response);
|
|
110
|
-
return {
|
|
111
|
-
data,
|
|
112
|
-
status: response.status,
|
|
113
|
-
statusText: response.statusText,
|
|
114
|
-
headers: response.headers
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
buildUrl(url, params) {
|
|
118
|
-
const base = this.baseURL ? `${this.baseURL}${url}` : url;
|
|
119
|
-
if (!params || Object.keys(params).length === 0) return base;
|
|
120
|
-
const searchParams = new URLSearchParams(Object.entries(params).map(([k, v])=>[
|
|
121
|
-
k,
|
|
122
|
-
String(v)
|
|
123
|
-
]));
|
|
124
|
-
return `${base}?${searchParams.toString()}`;
|
|
125
|
-
}
|
|
126
|
-
async parseBody(response) {
|
|
127
|
-
if (response.status === 204 || response.headers.get('content-length') === '0') {
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
const contentType = response.headers.get('content-type') ?? '';
|
|
131
|
-
if (contentType.includes('application/json')) {
|
|
132
|
-
return response.json();
|
|
133
|
-
}
|
|
134
|
-
return response.text();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
HttpService = _ts_decorate([
|
|
138
|
-
Injectable(),
|
|
139
|
-
_ts_param(0, Optional()),
|
|
140
|
-
_ts_param(0, Inject(HTTP_MODULE_OPTIONS)),
|
|
141
|
-
_ts_metadata("design:type", Function),
|
|
142
|
-
_ts_metadata("design:paramtypes", [
|
|
143
|
-
typeof HttpModuleOptions === "undefined" ? Object : HttpModuleOptions
|
|
144
|
-
])
|
|
145
|
-
], HttpService);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface HttpModuleOptions {
|
|
2
|
-
/** Base URL prepended to all requests. */
|
|
3
|
-
baseURL?: string;
|
|
4
|
-
/** Default headers sent with every request. */
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
/** Default timeout in milliseconds (uses AbortSignal.timeout). */
|
|
7
|
-
timeout?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface RequestConfig {
|
|
10
|
-
headers?: Record<string, string>;
|
|
11
|
-
params?: Record<string, string | number | boolean>;
|
|
12
|
-
timeout?: number;
|
|
13
|
-
}
|
|
14
|
-
export interface HttpRequestConfig extends RequestConfig {
|
|
15
|
-
method: string;
|
|
16
|
-
url: string;
|
|
17
|
-
body?: unknown;
|
|
18
|
-
}
|
|
19
|
-
export interface HttpResponse<T = unknown> {
|
|
20
|
-
data: T;
|
|
21
|
-
status: number;
|
|
22
|
-
statusText: string;
|
|
23
|
-
headers: Headers;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/fetch/index.d.ts
DELETED
package/dist/fetch/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HealthIndicatorService } from './health.indicator';
|
|
2
|
-
import type { HealthIndicatorResult, ResponseCheckCallback } from './health.types';
|
|
3
|
-
export interface HttpPingOptions {
|
|
4
|
-
method?: string;
|
|
5
|
-
headers?: Record<string, string>;
|
|
6
|
-
timeout?: number;
|
|
7
|
-
expectedStatus?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare class HttpHealthIndicator {
|
|
10
|
-
private indicator;
|
|
11
|
-
constructor(indicator: HealthIndicatorService);
|
|
12
|
-
pingCheck(key: string, url: string, options?: HttpPingOptions): Promise<HealthIndicatorResult>;
|
|
13
|
-
responseCheck(key: string, url: string, callback: ResponseCheckCallback, options?: HttpPingOptions): Promise<HealthIndicatorResult>;
|
|
14
|
-
}
|
|
@@ -1,75 +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 { Injectable } from "../container/index.js";
|
|
11
|
-
import { HealthIndicatorService } from "./health.indicator.js";
|
|
12
|
-
export class HttpHealthIndicator {
|
|
13
|
-
indicator;
|
|
14
|
-
constructor(indicator){
|
|
15
|
-
this.indicator = indicator;
|
|
16
|
-
}
|
|
17
|
-
async pingCheck(key, url, options) {
|
|
18
|
-
const { method = 'GET', headers, timeout = 5000, expectedStatus } = options ?? {};
|
|
19
|
-
try {
|
|
20
|
-
const response = await fetch(url, {
|
|
21
|
-
method,
|
|
22
|
-
headers,
|
|
23
|
-
signal: AbortSignal.timeout(timeout)
|
|
24
|
-
});
|
|
25
|
-
const statusCode = response.status;
|
|
26
|
-
const isHealthy = expectedStatus !== undefined ? statusCode === expectedStatus : statusCode >= 200 && statusCode < 300;
|
|
27
|
-
if (isHealthy) {
|
|
28
|
-
return this.indicator.check(key).up({
|
|
29
|
-
statusCode
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return this.indicator.check(key).down({
|
|
33
|
-
statusCode,
|
|
34
|
-
message: response.statusText
|
|
35
|
-
});
|
|
36
|
-
} catch (error) {
|
|
37
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
38
|
-
return this.indicator.check(key).down({
|
|
39
|
-
message
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async responseCheck(key, url, callback, options) {
|
|
44
|
-
const { method = 'GET', headers, timeout = 5000 } = options ?? {};
|
|
45
|
-
try {
|
|
46
|
-
const response = await fetch(url, {
|
|
47
|
-
method,
|
|
48
|
-
headers,
|
|
49
|
-
signal: AbortSignal.timeout(timeout)
|
|
50
|
-
});
|
|
51
|
-
const statusCode = response.status;
|
|
52
|
-
const isHealthy = await callback(response);
|
|
53
|
-
if (isHealthy) {
|
|
54
|
-
return this.indicator.check(key).up({
|
|
55
|
-
statusCode
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return this.indicator.check(key).down({
|
|
59
|
-
statusCode
|
|
60
|
-
});
|
|
61
|
-
} catch (error) {
|
|
62
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
63
|
-
return this.indicator.check(key).down({
|
|
64
|
-
message
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
HttpHealthIndicator = _ts_decorate([
|
|
70
|
-
Injectable(),
|
|
71
|
-
_ts_metadata("design:type", Function),
|
|
72
|
-
_ts_metadata("design:paramtypes", [
|
|
73
|
-
typeof HealthIndicatorService === "undefined" ? Object : HealthIndicatorService
|
|
74
|
-
])
|
|
75
|
-
], HttpHealthIndicator);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { HealthIndicatorResult } from './health.types';
|
|
2
|
-
interface HealthIndicatorBuilder {
|
|
3
|
-
up(data?: Record<string, unknown>): HealthIndicatorResult;
|
|
4
|
-
down(data?: Record<string, unknown>): HealthIndicatorResult;
|
|
5
|
-
}
|
|
6
|
-
export declare class HealthIndicatorService {
|
|
7
|
-
check(key: string): HealthIndicatorBuilder;
|
|
8
|
-
}
|
|
9
|
-
export {};
|
|
@@ -1,32 +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
|
-
import { Injectable } from "../container/index.js";
|
|
8
|
-
export class HealthIndicatorService {
|
|
9
|
-
check(key) {
|
|
10
|
-
return {
|
|
11
|
-
up (data) {
|
|
12
|
-
return {
|
|
13
|
-
[key]: {
|
|
14
|
-
status: 'up',
|
|
15
|
-
...data
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
down (data) {
|
|
20
|
-
return {
|
|
21
|
-
[key]: {
|
|
22
|
-
status: 'down',
|
|
23
|
-
...data
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
HealthIndicatorService = _ts_decorate([
|
|
31
|
-
Injectable()
|
|
32
|
-
], HealthIndicatorService);
|
|
@@ -1,26 +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
|
-
import { Module } from "../module/index.js";
|
|
8
|
-
import { HealthCheckService } from "./health.service.js";
|
|
9
|
-
import { HealthIndicatorService } from "./health.indicator.js";
|
|
10
|
-
import { HttpHealthIndicator } from "./health.http.js";
|
|
11
|
-
export class HealthModule {
|
|
12
|
-
}
|
|
13
|
-
HealthModule = _ts_decorate([
|
|
14
|
-
Module({
|
|
15
|
-
providers: [
|
|
16
|
-
HealthCheckService,
|
|
17
|
-
HealthIndicatorService,
|
|
18
|
-
HttpHealthIndicator
|
|
19
|
-
],
|
|
20
|
-
exports: [
|
|
21
|
-
HealthCheckService,
|
|
22
|
-
HealthIndicatorService,
|
|
23
|
-
HttpHealthIndicator
|
|
24
|
-
]
|
|
25
|
-
})
|
|
26
|
-
], HealthModule);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BeforeApplicationShutdown } from '../lifecycle/index';
|
|
2
|
-
import type { HealthCheckResult, HealthIndicatorFunction } from './health.types';
|
|
3
|
-
export declare class HealthCheckService implements BeforeApplicationShutdown {
|
|
4
|
-
private isShuttingDown;
|
|
5
|
-
beforeApplicationShutdown(): void;
|
|
6
|
-
check(indicators: HealthIndicatorFunction[]): Promise<HealthCheckResult>;
|
|
7
|
-
}
|
|
@@ -1,69 +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
|
-
import { Injectable } from "../container/index.js";
|
|
8
|
-
import { ServiceUnavailableException } from "../errors/http-exception.js";
|
|
9
|
-
export class HealthCheckService {
|
|
10
|
-
isShuttingDown = false;
|
|
11
|
-
beforeApplicationShutdown() {
|
|
12
|
-
this.isShuttingDown = true;
|
|
13
|
-
}
|
|
14
|
-
async check(indicators) {
|
|
15
|
-
if (this.isShuttingDown) {
|
|
16
|
-
const result = {
|
|
17
|
-
status: 'shutting_down',
|
|
18
|
-
info: {},
|
|
19
|
-
error: {},
|
|
20
|
-
details: {}
|
|
21
|
-
};
|
|
22
|
-
throw new ServiceUnavailableException({
|
|
23
|
-
...result
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const results = await Promise.allSettled(indicators.map((fn)=>fn()));
|
|
27
|
-
const info = {};
|
|
28
|
-
const error = {};
|
|
29
|
-
const details = {};
|
|
30
|
-
for (const result of results){
|
|
31
|
-
if (result.status === 'fulfilled') {
|
|
32
|
-
const indicatorResult = result.value;
|
|
33
|
-
for (const [key, value] of Object.entries(indicatorResult)){
|
|
34
|
-
details[key] = value;
|
|
35
|
-
if (value.status === 'up') {
|
|
36
|
-
info[key] = value;
|
|
37
|
-
} else {
|
|
38
|
-
error[key] = value;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
const message = result.reason instanceof Error ? result.reason.message : 'Health check failed';
|
|
43
|
-
const key = 'unknown';
|
|
44
|
-
const value = {
|
|
45
|
-
status: 'down',
|
|
46
|
-
message
|
|
47
|
-
};
|
|
48
|
-
details[key] = value;
|
|
49
|
-
error[key] = value;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const status = Object.keys(error).length > 0 ? 'error' : 'ok';
|
|
53
|
-
const checkResult = {
|
|
54
|
-
status,
|
|
55
|
-
info,
|
|
56
|
-
error,
|
|
57
|
-
details
|
|
58
|
-
};
|
|
59
|
-
if (status === 'error') {
|
|
60
|
-
throw new ServiceUnavailableException({
|
|
61
|
-
...checkResult
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return checkResult;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
HealthCheckService = _ts_decorate([
|
|
68
|
-
Injectable()
|
|
69
|
-
], HealthCheckService);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type HealthCheckStatus = 'ok' | 'error' | 'shutting_down';
|
|
2
|
-
export interface HealthIndicatorResult {
|
|
3
|
-
[key: string]: {
|
|
4
|
-
status: 'up' | 'down';
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export interface HealthCheckResult {
|
|
9
|
-
status: HealthCheckStatus;
|
|
10
|
-
info: HealthIndicatorResult;
|
|
11
|
-
error: HealthIndicatorResult;
|
|
12
|
-
details: HealthIndicatorResult;
|
|
13
|
-
}
|
|
14
|
-
export type HealthIndicatorFunction = () => Promise<HealthIndicatorResult>;
|
|
15
|
-
export type ResponseCheckCallback = (response: Response) => boolean | Promise<boolean>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/health/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { HealthModule } from './health.module';
|
|
2
|
-
export { HealthCheckService } from './health.service';
|
|
3
|
-
export { HealthIndicatorService } from './health.indicator';
|
|
4
|
-
export { HttpHealthIndicator } from './health.http';
|
|
5
|
-
export type { HealthCheckResult, HealthCheckStatus, HealthIndicatorResult, HealthIndicatorFunction, ResponseCheckCallback, } from './health.types';
|
|
6
|
-
export type { HttpPingOptions } from './health.http';
|
package/dist/health/index.js
DELETED
package/dist/http/ambient.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { MiddlewareHandler } from 'hono';
|
|
2
|
-
import type { Container } from '../container/container';
|
|
3
|
-
import { type RequestContext } from './request-context';
|
|
4
|
-
/**
|
|
5
|
-
* Returns Hono's `contextStorage()` middleware. Register it as the FIRST global
|
|
6
|
-
* middleware so `getCurrentContainer()` works everywhere downstream. When using
|
|
7
|
-
* `VelaFactory.create(module, { ambientContainer: true })` this is wired
|
|
8
|
-
* automatically — call this only for manual/raw Hono setups.
|
|
9
|
-
*/
|
|
10
|
-
export declare function enableAmbientContainer(): MiddlewareHandler;
|
|
11
|
-
/**
|
|
12
|
-
* The current request's DI container. Throws with actionable guidance if
|
|
13
|
-
* ambient access isn't enabled or this runs outside a request.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getCurrentContainer(): Container;
|
|
16
|
-
/** The current request's {@link RequestContext} (via the ambient container). */
|
|
17
|
-
export declare function getCurrentRequestContext(): RequestContext;
|
package/dist/http/ambient.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { contextStorage, getContext } from "hono/context-storage";
|
|
2
|
-
import { REQUEST_CONTEXT } from "./request-context.js";
|
|
3
|
-
// Opt-in ambient access to the per-request DI container / RequestContext,
|
|
4
|
-
// for deep code that lacks the Hono `Context` (services, standalone helpers).
|
|
5
|
-
//
|
|
6
|
-
// Portable across vela's target runtimes because the `node:async_hooks`
|
|
7
|
-
// dependency lives inside Hono's `contextStorage()` middleware — vela's own
|
|
8
|
-
// source never imports `node:*`. Uses only the workerd-safe ALS subset
|
|
9
|
-
// (`run()`/`getStore()`); no `enterWith`, no cross-thenable propagation.
|
|
10
|
-
//
|
|
11
|
-
// Default path is unchanged: request scope is still carried by the per-request
|
|
12
|
-
// child container (see RouteManager.getRequestContainer). This is a second
|
|
13
|
-
// READ path, active only when enabled.
|
|
14
|
-
/**
|
|
15
|
-
* Returns Hono's `contextStorage()` middleware. Register it as the FIRST global
|
|
16
|
-
* middleware so `getCurrentContainer()` works everywhere downstream. When using
|
|
17
|
-
* `VelaFactory.create(module, { ambientContainer: true })` this is wired
|
|
18
|
-
* automatically — call this only for manual/raw Hono setups.
|
|
19
|
-
*/ export function enableAmbientContainer() {
|
|
20
|
-
return contextStorage();
|
|
21
|
-
}
|
|
22
|
-
function tryGetContext() {
|
|
23
|
-
try {
|
|
24
|
-
return getContext();
|
|
25
|
-
} catch {
|
|
26
|
-
// Thrown when called outside the contextStorage() middleware (i.e. ambient
|
|
27
|
-
// access not enabled, or outside a request).
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* The current request's DI container. Throws with actionable guidance if
|
|
33
|
-
* ambient access isn't enabled or this runs outside a request.
|
|
34
|
-
*/ export function getCurrentContainer() {
|
|
35
|
-
const context = tryGetContext();
|
|
36
|
-
const container = context?.get('container');
|
|
37
|
-
if (!container) {
|
|
38
|
-
throw new Error('getCurrentContainer() is unavailable: enable ambient access via ' + "VelaFactory.create(module, { ambientContainer: true }) (or app.use(enableAmbientContainer())) " + 'and only call it within a request.');
|
|
39
|
-
}
|
|
40
|
-
return container;
|
|
41
|
-
}
|
|
42
|
-
/** The current request's {@link RequestContext} (via the ambient container). */ export function getCurrentRequestContext() {
|
|
43
|
-
return getCurrentContainer().resolve(REQUEST_CONTEXT);
|
|
44
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import type { Container } from '../container/container';
|
|
3
|
-
import type { PipeTransform } from '../pipeline/types';
|
|
4
|
-
import type { ParamMetadata } from './types';
|
|
5
|
-
export declare class ArgumentResolver {
|
|
6
|
-
private readonly ipExtractor;
|
|
7
|
-
constructor(ipExtractor: (c: Context) => string | null);
|
|
8
|
-
extract(c: Context, paramMetadata: ParamMetadata[], pipes: PipeTransform[], requestContainer: Container, paramTypes?: unknown[]): Promise<unknown[]>;
|
|
9
|
-
private extractParam;
|
|
10
|
-
}
|