@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,26 +0,0 @@
|
|
|
1
|
-
import type { Container } from '../container/container';
|
|
2
|
-
import type { ComponentType, Constructor } from '../registry/types';
|
|
3
|
-
import type { CanActivate, ExceptionFilter, NestInterceptor, NestMiddleware, PipeTransform } from './types';
|
|
4
|
-
export interface ResolvedComponentMap {
|
|
5
|
-
guard: CanActivate;
|
|
6
|
-
pipe: PipeTransform;
|
|
7
|
-
interceptor: NestInterceptor;
|
|
8
|
-
filter: ExceptionFilter;
|
|
9
|
-
middleware: NestMiddleware;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Public seam for custom dispatchers: the `@UseGuards`/`@UsePipes`/
|
|
13
|
-
* `@UseInterceptors`/`@UseFilters` components scoped to a handler (class-level
|
|
14
|
-
* then method-level, declaration order), resolved to instances through the
|
|
15
|
-
* given container (classes constructed with DI; instances passed through).
|
|
16
|
-
*
|
|
17
|
-
* Order is preserved exactly as declared — conventions stay with the CALLER:
|
|
18
|
-
* filters run closest-first, so dispatchers reverse them
|
|
19
|
-
* (`resolveScopedComponents('filter', ...).reverse()`), and app-wide `APP_*`
|
|
20
|
-
* components are a separate, transport-specific decision.
|
|
21
|
-
*
|
|
22
|
-
* Promoted to the public API by the QueueModule work (the "openness proof"):
|
|
23
|
-
* it was the one capability custom entrypoint dispatchers needed that only
|
|
24
|
-
* the internal `ComponentManager` provided.
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolveScopedComponents<T extends ComponentType>(type: T, targetClass: Constructor, methodName: string | symbol, container: Container): ResolvedComponentMap[T][];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ComponentManager } from "./component.manager.js";
|
|
2
|
-
const RESOLVERS = {
|
|
3
|
-
guard: ComponentManager.resolveGuards.bind(ComponentManager),
|
|
4
|
-
pipe: ComponentManager.resolvePipes.bind(ComponentManager),
|
|
5
|
-
interceptor: ComponentManager.resolveInterceptors.bind(ComponentManager),
|
|
6
|
-
filter: ComponentManager.resolveFilters.bind(ComponentManager),
|
|
7
|
-
middleware: ComponentManager.resolveMiddleware.bind(ComponentManager)
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Public seam for custom dispatchers: the `@UseGuards`/`@UsePipes`/
|
|
11
|
-
* `@UseInterceptors`/`@UseFilters` components scoped to a handler (class-level
|
|
12
|
-
* then method-level, declaration order), resolved to instances through the
|
|
13
|
-
* given container (classes constructed with DI; instances passed through).
|
|
14
|
-
*
|
|
15
|
-
* Order is preserved exactly as declared — conventions stay with the CALLER:
|
|
16
|
-
* filters run closest-first, so dispatchers reverse them
|
|
17
|
-
* (`resolveScopedComponents('filter', ...).reverse()`), and app-wide `APP_*`
|
|
18
|
-
* components are a separate, transport-specific decision.
|
|
19
|
-
*
|
|
20
|
-
* Promoted to the public API by the QueueModule work (the "openness proof"):
|
|
21
|
-
* it was the one capability custom entrypoint dispatchers needed that only
|
|
22
|
-
* the internal `ComponentManager` provided.
|
|
23
|
-
*/ export function resolveScopedComponents(type, targetClass, methodName, container) {
|
|
24
|
-
const scoped = ComponentManager.getScopedComponents(type, targetClass, methodName);
|
|
25
|
-
const resolve = RESOLVERS[type];
|
|
26
|
-
return resolve(scoped, container);
|
|
27
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Catalog } from '@velajs/errors';
|
|
2
|
-
import { InjectionToken } from '../container/types';
|
|
3
|
-
import type { ExceptionHandler } from '../exceptions/exception-handler';
|
|
4
|
-
import type { CanActivate, ExceptionFilter, NestInterceptor, NestMiddleware, PipeTransform } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Register global guards via module providers instead of app.useGlobalGuards().
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* @Module({
|
|
11
|
-
* providers: [
|
|
12
|
-
* AuthGuard,
|
|
13
|
-
* { provide: APP_GUARD, useClass: AuthGuard },
|
|
14
|
-
* ],
|
|
15
|
-
* })
|
|
16
|
-
* class AppModule {}
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare const APP_GUARD: InjectionToken<CanActivate>;
|
|
20
|
-
/**
|
|
21
|
-
* Register global pipes via module providers.
|
|
22
|
-
*/
|
|
23
|
-
export declare const APP_PIPE: InjectionToken<PipeTransform<unknown, unknown>>;
|
|
24
|
-
/**
|
|
25
|
-
* Register global interceptors via module providers.
|
|
26
|
-
*/
|
|
27
|
-
export declare const APP_INTERCEPTOR: InjectionToken<NestInterceptor>;
|
|
28
|
-
/**
|
|
29
|
-
* Register global filters via module providers.
|
|
30
|
-
*/
|
|
31
|
-
export declare const APP_FILTER: InjectionToken<ExceptionFilter<unknown>>;
|
|
32
|
-
/**
|
|
33
|
-
* Register global middleware via module providers.
|
|
34
|
-
*/
|
|
35
|
-
export declare const APP_MIDDLEWARE: InjectionToken<NestMiddleware>;
|
|
36
|
-
/**
|
|
37
|
-
* Register the application-wide exception handler via module providers.
|
|
38
|
-
* Consumed by the shared error reporter (`resolveErrorReporter`) at every
|
|
39
|
-
* transport edge to customize how errors are reported and rendered.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* @Module({
|
|
44
|
-
* providers: [
|
|
45
|
-
* { provide: APP_EXCEPTION_HANDLER, useValue: { report: (e) => sentry.capture(e) } },
|
|
46
|
-
* ],
|
|
47
|
-
* })
|
|
48
|
-
* class AppModule {}
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare const APP_EXCEPTION_HANDLER: InjectionToken<ExceptionHandler>;
|
|
52
|
-
/**
|
|
53
|
-
* Provide the composed error catalog (`composeCatalogs(CORE_CATALOG, …)`)
|
|
54
|
-
* consulted when rendering wire-bound error bodies. Defaults to the core
|
|
55
|
-
* catalog when unset.
|
|
56
|
-
*/
|
|
57
|
-
export declare const ERROR_CATALOG: InjectionToken<Catalog<string>>;
|
package/dist/pipeline/tokens.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from "../container/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Register global guards via module providers instead of app.useGlobalGuards().
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```ts
|
|
7
|
-
* @Module({
|
|
8
|
-
* providers: [
|
|
9
|
-
* AuthGuard,
|
|
10
|
-
* { provide: APP_GUARD, useClass: AuthGuard },
|
|
11
|
-
* ],
|
|
12
|
-
* })
|
|
13
|
-
* class AppModule {}
|
|
14
|
-
* ```
|
|
15
|
-
*/ export const APP_GUARD = new InjectionToken('APP_GUARD');
|
|
16
|
-
/**
|
|
17
|
-
* Register global pipes via module providers.
|
|
18
|
-
*/ export const APP_PIPE = new InjectionToken('APP_PIPE');
|
|
19
|
-
/**
|
|
20
|
-
* Register global interceptors via module providers.
|
|
21
|
-
*/ export const APP_INTERCEPTOR = new InjectionToken('APP_INTERCEPTOR');
|
|
22
|
-
/**
|
|
23
|
-
* Register global filters via module providers.
|
|
24
|
-
*/ export const APP_FILTER = new InjectionToken('APP_FILTER');
|
|
25
|
-
/**
|
|
26
|
-
* Register global middleware via module providers.
|
|
27
|
-
*/ export const APP_MIDDLEWARE = new InjectionToken('APP_MIDDLEWARE');
|
|
28
|
-
/**
|
|
29
|
-
* Register the application-wide exception handler via module providers.
|
|
30
|
-
* Consumed by the shared error reporter (`resolveErrorReporter`) at every
|
|
31
|
-
* transport edge to customize how errors are reported and rendered.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```ts
|
|
35
|
-
* @Module({
|
|
36
|
-
* providers: [
|
|
37
|
-
* { provide: APP_EXCEPTION_HANDLER, useValue: { report: (e) => sentry.capture(e) } },
|
|
38
|
-
* ],
|
|
39
|
-
* })
|
|
40
|
-
* class AppModule {}
|
|
41
|
-
* ```
|
|
42
|
-
*/ export const APP_EXCEPTION_HANDLER = new InjectionToken('APP_EXCEPTION_HANDLER');
|
|
43
|
-
/**
|
|
44
|
-
* Provide the composed error catalog (`composeCatalogs(CORE_CATALOG, …)`)
|
|
45
|
-
* consulted when rendering wire-bound error bodies. Defaults to the core
|
|
46
|
-
* catalog when unset.
|
|
47
|
-
*/ export const ERROR_CATALOG = new InjectionToken('ERROR_CATALOG');
|
package/dist/pipeline/types.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import type { Type } from '../container/types';
|
|
3
|
-
/**
|
|
4
|
-
* HTTP-specific arguments host returned by `ExecutionContext.switchToHttp()`.
|
|
5
|
-
* In Vela/Hono, the `Context` object holds both request and response state.
|
|
6
|
-
*
|
|
7
|
-
* - `getRequest()` — the Web `Request` object
|
|
8
|
-
* - `getResponse()` — the Hono `Context` (use `c.header()`, `c.setCookie()`, etc.)
|
|
9
|
-
*/
|
|
10
|
-
export interface HttpArgumentsHost {
|
|
11
|
-
getRequest<T = Request>(): T;
|
|
12
|
-
getResponse<T = Context>(): T;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* WebSocket-specific arguments host returned by `ExecutionContext.switchToWs()`.
|
|
16
|
-
* Populated by `@velajs/vela/websocket` when a gateway message is dispatched.
|
|
17
|
-
*
|
|
18
|
-
* - `getClient()` — the connected socket (`WsClient`)
|
|
19
|
-
* - `getData()` — the inbound message payload (the envelope's `data`)
|
|
20
|
-
* - `getPattern()` — the subscribed event name that matched
|
|
21
|
-
*/
|
|
22
|
-
export interface WsArgumentsHost {
|
|
23
|
-
getClient<T = unknown>(): T;
|
|
24
|
-
getData<T = unknown>(): T;
|
|
25
|
-
getPattern<T = string>(): T;
|
|
26
|
-
}
|
|
27
|
-
/** The transport a component is executing under. `'http'` for routes, `'ws'` for gateway messages. */
|
|
28
|
-
export type ContextType = 'http' | 'ws';
|
|
29
|
-
export interface ExecutionContext {
|
|
30
|
-
getType<T extends string = ContextType>(): T;
|
|
31
|
-
getClass(): Type;
|
|
32
|
-
getHandler(): string | symbol;
|
|
33
|
-
/** Returns the Hono `Context` directly. Throws on a WebSocket context. */
|
|
34
|
-
getContext<T = Context>(): T;
|
|
35
|
-
/** Shorthand for `switchToHttp().getRequest()` — returns the Web `Request`. Throws on a WebSocket context. */
|
|
36
|
-
getRequest(): Request;
|
|
37
|
-
/** Switch to the HTTP arguments host. Throws on a WebSocket context. */
|
|
38
|
-
switchToHttp(): HttpArgumentsHost;
|
|
39
|
-
/** Switch to the WebSocket arguments host. Throws on an HTTP context. */
|
|
40
|
-
switchToWs(): WsArgumentsHost;
|
|
41
|
-
}
|
|
42
|
-
export interface CanActivate {
|
|
43
|
-
canActivate(context: ExecutionContext): boolean | Promise<boolean>;
|
|
44
|
-
}
|
|
45
|
-
export interface CallHandler {
|
|
46
|
-
handle(): Promise<unknown>;
|
|
47
|
-
}
|
|
48
|
-
export interface NestInterceptor {
|
|
49
|
-
intercept(context: ExecutionContext, next: CallHandler): Promise<unknown>;
|
|
50
|
-
}
|
|
51
|
-
export interface ArgumentMetadata {
|
|
52
|
-
type: string;
|
|
53
|
-
metatype?: Type;
|
|
54
|
-
data?: string;
|
|
55
|
-
}
|
|
56
|
-
export interface PipeTransform<T = unknown, R = unknown> {
|
|
57
|
-
transform(value: T, metadata: ArgumentMetadata): R | Promise<R>;
|
|
58
|
-
}
|
|
59
|
-
export interface ExceptionFilter<T = unknown> {
|
|
60
|
-
catch(exception: T, context: ExecutionContext): unknown | Promise<unknown>;
|
|
61
|
-
}
|
|
62
|
-
export interface NestMiddleware {
|
|
63
|
-
use(c: import('hono').Context, next: import('hono').Next): Promise<Response | void>;
|
|
64
|
-
}
|
package/dist/pipeline/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
package/dist/plugin/plugin.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '../container/types';
|
|
2
|
-
import type { Type } from '../container/types';
|
|
3
|
-
import type { DynamicModule } from '../registry/types';
|
|
4
|
-
export interface Plugin {
|
|
5
|
-
id: string;
|
|
6
|
-
version: string;
|
|
7
|
-
module: Type | DynamicModule;
|
|
8
|
-
dependsOn?: string[];
|
|
9
|
-
metadata?: Record<string, unknown>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Freeze and validate a plugin manifest. Returns the same object so it can
|
|
13
|
-
* be used in `composePlugins([definePlugin(...), ...])`.
|
|
14
|
-
*/
|
|
15
|
-
export declare function definePlugin(plugin: Plugin): Plugin;
|
|
16
|
-
export declare class PluginRegistry {
|
|
17
|
-
private byId;
|
|
18
|
-
constructor(plugins: readonly Plugin[]);
|
|
19
|
-
list(): Plugin[];
|
|
20
|
-
get(id: string): Plugin | undefined;
|
|
21
|
-
dependents(id: string): Plugin[];
|
|
22
|
-
}
|
|
23
|
-
export declare const PLUGIN_REGISTRY_TOKEN: InjectionToken<PluginRegistry>;
|
|
24
|
-
export declare class PluginRootModule {
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Compose a list of plugins into a single dynamic module that imports each
|
|
28
|
-
* plugin's module in dependency order, registers a `PluginRegistry`, and
|
|
29
|
-
* exposes it globally so any plugin can introspect peers.
|
|
30
|
-
*/
|
|
31
|
-
export declare function composePlugins(plugins: readonly Plugin[]): DynamicModule;
|
package/dist/plugin/plugin.js
DELETED
|
@@ -1,111 +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 { InjectionToken } from "../container/types.js";
|
|
8
|
-
import { Module } from "../module/decorators.js";
|
|
9
|
-
/**
|
|
10
|
-
* Freeze and validate a plugin manifest. Returns the same object so it can
|
|
11
|
-
* be used in `composePlugins([definePlugin(...), ...])`.
|
|
12
|
-
*/ export function definePlugin(plugin) {
|
|
13
|
-
if (!plugin.id) throw new Error('Plugin requires an id');
|
|
14
|
-
if (!plugin.version) throw new Error('Plugin requires a version');
|
|
15
|
-
if (!plugin.module) throw new Error('Plugin requires a module');
|
|
16
|
-
return Object.freeze({
|
|
17
|
-
...plugin
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
export class PluginRegistry {
|
|
21
|
-
byId;
|
|
22
|
-
constructor(plugins){
|
|
23
|
-
this.byId = new Map();
|
|
24
|
-
for (const p of plugins){
|
|
25
|
-
if (this.byId.has(p.id)) {
|
|
26
|
-
throw new Error(`Duplicate plugin id: '${p.id}'`);
|
|
27
|
-
}
|
|
28
|
-
this.byId.set(p.id, p);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
list() {
|
|
32
|
-
return [
|
|
33
|
-
...this.byId.values()
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
get(id) {
|
|
37
|
-
return this.byId.get(id);
|
|
38
|
-
}
|
|
39
|
-
dependents(id) {
|
|
40
|
-
return this.list().filter((p)=>p.dependsOn?.includes(id) ?? false);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export const PLUGIN_REGISTRY_TOKEN = new InjectionToken('PLUGIN_REGISTRY');
|
|
44
|
-
export class PluginRootModule {
|
|
45
|
-
}
|
|
46
|
-
PluginRootModule = _ts_decorate([
|
|
47
|
-
Module({})
|
|
48
|
-
], PluginRootModule);
|
|
49
|
-
/**
|
|
50
|
-
* Topologically sort plugins so each plugin's dependencies appear first.
|
|
51
|
-
* Throws on missing dependencies and cycles.
|
|
52
|
-
*/ function topologicalSort(plugins) {
|
|
53
|
-
const byId = new Map();
|
|
54
|
-
for (const p of plugins){
|
|
55
|
-
if (byId.has(p.id)) {
|
|
56
|
-
throw new Error(`Duplicate plugin id: '${p.id}'`);
|
|
57
|
-
}
|
|
58
|
-
byId.set(p.id, p);
|
|
59
|
-
}
|
|
60
|
-
const result = [];
|
|
61
|
-
const visiting = new Set();
|
|
62
|
-
const visited = new Set();
|
|
63
|
-
const visit = (p, path)=>{
|
|
64
|
-
if (visited.has(p.id)) return;
|
|
65
|
-
if (visiting.has(p.id)) {
|
|
66
|
-
const cycle = [
|
|
67
|
-
...path,
|
|
68
|
-
p.id
|
|
69
|
-
].join(' -> ');
|
|
70
|
-
throw new Error(`Plugin cycle detected: ${cycle}`);
|
|
71
|
-
}
|
|
72
|
-
visiting.add(p.id);
|
|
73
|
-
for (const depId of p.dependsOn ?? []){
|
|
74
|
-
const dep = byId.get(depId);
|
|
75
|
-
if (!dep) {
|
|
76
|
-
throw new Error(`Plugin '${p.id}' depends on missing plugin '${depId}'`);
|
|
77
|
-
}
|
|
78
|
-
visit(dep, [
|
|
79
|
-
...path,
|
|
80
|
-
p.id
|
|
81
|
-
]);
|
|
82
|
-
}
|
|
83
|
-
visiting.delete(p.id);
|
|
84
|
-
visited.add(p.id);
|
|
85
|
-
result.push(p);
|
|
86
|
-
};
|
|
87
|
-
for (const p of plugins)visit(p, []);
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Compose a list of plugins into a single dynamic module that imports each
|
|
92
|
-
* plugin's module in dependency order, registers a `PluginRegistry`, and
|
|
93
|
-
* exposes it globally so any plugin can introspect peers.
|
|
94
|
-
*/ export function composePlugins(plugins) {
|
|
95
|
-
const sorted = topologicalSort(plugins);
|
|
96
|
-
const registry = new PluginRegistry(sorted);
|
|
97
|
-
return {
|
|
98
|
-
module: PluginRootModule,
|
|
99
|
-
imports: sorted.map((p)=>p.module),
|
|
100
|
-
providers: [
|
|
101
|
-
{
|
|
102
|
-
provide: PLUGIN_REGISTRY_TOKEN,
|
|
103
|
-
useValue: registry
|
|
104
|
-
}
|
|
105
|
-
],
|
|
106
|
-
exports: [
|
|
107
|
-
PLUGIN_REGISTRY_TOKEN
|
|
108
|
-
],
|
|
109
|
-
global: true
|
|
110
|
-
};
|
|
111
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { QueueDriver } from './queue.types';
|
|
2
|
-
export interface InlineQueueOptions {
|
|
3
|
-
/**
|
|
4
|
-
* `immediate` (default): deliver on a microtask after `enqueue` resolves —
|
|
5
|
-
* `add()` resolving does NOT mean the job was handled. Handler errors are
|
|
6
|
-
* routed to the binding's error hook (container diagnostics), never thrown
|
|
7
|
-
* into the detached microtask.
|
|
8
|
-
*
|
|
9
|
-
* `manual`: buffer until `flush()` — deterministic delivery for tests.
|
|
10
|
-
*/
|
|
11
|
-
mode?: 'immediate' | 'manual';
|
|
12
|
-
}
|
|
13
|
-
export interface InlineQueueDriver extends QueueDriver {
|
|
14
|
-
/**
|
|
15
|
-
* Deliver everything buffered (manual mode; also drains jobs enqueued
|
|
16
|
-
* before the driver was bound). Resolves with the delivered count; rejects
|
|
17
|
-
* with an `AggregateError` after attempting ALL buffered jobs if any
|
|
18
|
-
* handler error went unclaimed — the awaiter exists here, so the
|
|
19
|
-
* platform-retry rethrow contract is meaningful.
|
|
20
|
-
*/
|
|
21
|
-
flush(): Promise<number>;
|
|
22
|
-
/** Jobs currently buffered (unbound immediate + all manual). */
|
|
23
|
-
readonly size: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* In-process driver for dev, tests, and single-isolate apps. Edge-pure: no
|
|
27
|
-
* timers — `immediate` mode uses `queueMicrotask`. `delayMs` is not
|
|
28
|
-
* supported (warns once through the bound error hook's diagnostics side).
|
|
29
|
-
*/
|
|
30
|
-
export declare function inline(options?: InlineQueueOptions): InlineQueueDriver;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-process driver for dev, tests, and single-isolate apps. Edge-pure: no
|
|
3
|
-
* timers — `immediate` mode uses `queueMicrotask`. `delayMs` is not
|
|
4
|
-
* supported (warns once through the bound error hook's diagnostics side).
|
|
5
|
-
*/ export function inline(options = {}) {
|
|
6
|
-
const mode = options.mode ?? 'immediate';
|
|
7
|
-
const buffer = [];
|
|
8
|
-
let dispatch;
|
|
9
|
-
let onError;
|
|
10
|
-
let warnedDelay = false;
|
|
11
|
-
const deliverDetached = (job)=>{
|
|
12
|
-
queueMicrotask(()=>{
|
|
13
|
-
void dispatch(job).catch((error)=>onError?.(error, job));
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
return {
|
|
17
|
-
kind: 'inline',
|
|
18
|
-
get size () {
|
|
19
|
-
return buffer.length;
|
|
20
|
-
},
|
|
21
|
-
async enqueue (job, addOptions) {
|
|
22
|
-
if (addOptions?.delayMs !== undefined && !warnedDelay) {
|
|
23
|
-
warnedDelay = true;
|
|
24
|
-
console.warn(`[vela] inline() queue driver does not support delayMs — job '${job.name}' delivers without delay.`);
|
|
25
|
-
}
|
|
26
|
-
if (mode === 'manual' || !dispatch) {
|
|
27
|
-
buffer.push(job);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
deliverDetached(job);
|
|
31
|
-
},
|
|
32
|
-
bind (fn, hooks) {
|
|
33
|
-
dispatch = fn;
|
|
34
|
-
onError = hooks?.onError;
|
|
35
|
-
if (mode === 'immediate' && buffer.length > 0) {
|
|
36
|
-
for (const job of buffer.splice(0))deliverDetached(job);
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
async flush () {
|
|
40
|
-
if (!dispatch) return 0;
|
|
41
|
-
const jobs = buffer.splice(0);
|
|
42
|
-
const errors = [];
|
|
43
|
-
let delivered = 0;
|
|
44
|
-
for (const job of jobs){
|
|
45
|
-
try {
|
|
46
|
-
await dispatch(job);
|
|
47
|
-
delivered++;
|
|
48
|
-
} catch (error) {
|
|
49
|
-
errors.push(error);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (errors.length > 0) {
|
|
53
|
-
throw new AggregateError(errors, `queue flush: ${errors.length} of ${jobs.length} jobs failed (${delivered} delivered)`);
|
|
54
|
-
}
|
|
55
|
-
return delivered;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Container, DiscoveryService } from '../index';
|
|
2
|
-
import type { QueueDriver } from './queue.types';
|
|
3
|
-
/**
|
|
4
|
-
* Wires a `QueueModule` instance's driver to the app: binds in-process
|
|
5
|
-
* delivery to the dispatch core and validates that no other module instance
|
|
6
|
-
* provides the same queue names.
|
|
7
|
-
*
|
|
8
|
-
* Delivery resolves processors from the per-app `EntrypointRegistry` once it
|
|
9
|
-
* exists (registered into the container at the end of
|
|
10
|
-
* `callOnApplicationBootstrap`); deliveries that arrive earlier (a producer's
|
|
11
|
-
* `onModuleInit` calling `add()`) fall back to `DiscoveryService` with
|
|
12
|
-
* `deferLazy` — identical entries, no buffering, no lost jobs.
|
|
13
|
-
*
|
|
14
|
-
* Every `QueueClient` injects this binding, so the driver is always bound
|
|
15
|
-
* before the first `add()` — including when the module materializes lazily.
|
|
16
|
-
*/
|
|
17
|
-
export declare class QueueDispatchBinding {
|
|
18
|
-
private readonly container;
|
|
19
|
-
private readonly discovery;
|
|
20
|
-
constructor(container: Container, discovery: DiscoveryService, driver: QueueDriver, queues: string[]);
|
|
21
|
-
private deliver;
|
|
22
|
-
private routeError;
|
|
23
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { EntrypointRegistry, resolveErrorReporter } from "../index.js";
|
|
2
|
-
import { dispatchJobToEntries } from "./queue.dispatch.js";
|
|
3
|
-
import { PROCESSOR_METADATA, queueToken } from "./queue.tokens.js";
|
|
4
|
-
/**
|
|
5
|
-
* Wires a `QueueModule` instance's driver to the app: binds in-process
|
|
6
|
-
* delivery to the dispatch core and validates that no other module instance
|
|
7
|
-
* provides the same queue names.
|
|
8
|
-
*
|
|
9
|
-
* Delivery resolves processors from the per-app `EntrypointRegistry` once it
|
|
10
|
-
* exists (registered into the container at the end of
|
|
11
|
-
* `callOnApplicationBootstrap`); deliveries that arrive earlier (a producer's
|
|
12
|
-
* `onModuleInit` calling `add()`) fall back to `DiscoveryService` with
|
|
13
|
-
* `deferLazy` — identical entries, no buffering, no lost jobs.
|
|
14
|
-
*
|
|
15
|
-
* Every `QueueClient` injects this binding, so the driver is always bound
|
|
16
|
-
* before the first `add()` — including when the module materializes lazily.
|
|
17
|
-
*/ export class QueueDispatchBinding {
|
|
18
|
-
container;
|
|
19
|
-
discovery;
|
|
20
|
-
constructor(container, discovery, driver, queues){
|
|
21
|
-
this.container = container;
|
|
22
|
-
this.discovery = discovery;
|
|
23
|
-
for (const queue of queues){
|
|
24
|
-
const owners = container.getOwnerModuleIds(queueToken(queue));
|
|
25
|
-
if (owners.length > 1) {
|
|
26
|
-
throw new Error(`Queue '${queue}' is provided by multiple QueueModule instances (${owners.join(', ')}). ` + `Queue names must be unique per app — either dedup the forRoot options or rename the queue.`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
driver.bind?.((job)=>this.deliver(job), {
|
|
30
|
-
onError: (error, job)=>this.routeError(error, job)
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async deliver(job) {
|
|
34
|
-
const entries = this.container.has(EntrypointRegistry) ? this.container.resolve(EntrypointRegistry).ofKind('queue').map((ep)=>({
|
|
35
|
-
token: ep.token,
|
|
36
|
-
meta: ep.meta
|
|
37
|
-
})) : this.discovery.providersWithMeta(PROCESSOR_METADATA, {
|
|
38
|
-
deferLazy: true
|
|
39
|
-
}).map((found)=>({
|
|
40
|
-
token: found.token,
|
|
41
|
-
meta: found.meta
|
|
42
|
-
}));
|
|
43
|
-
await dispatchJobToEntries(this.container, entries, job);
|
|
44
|
-
}
|
|
45
|
-
routeError(error, job) {
|
|
46
|
-
const mode = this.container.getDiagnostics();
|
|
47
|
-
if (mode === 'silent') return;
|
|
48
|
-
if (mode === 'throw') {
|
|
49
|
-
throw error instanceof Error ? error : new Error(String(error));
|
|
50
|
-
}
|
|
51
|
-
// Fire-and-forget (inline `immediate`) deliveries have no awaiter to rethrow
|
|
52
|
-
// into — route their unclaimed errors to the exception handler instead of a
|
|
53
|
-
// bare console.error.
|
|
54
|
-
resolveErrorReporter(this.container).report(error, {
|
|
55
|
-
edge: 'queue',
|
|
56
|
-
source: `${job.queue}/${job.name}`,
|
|
57
|
-
note: 'inline driver'
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AddJobOptions, QueueDriver, QueueJob } from './queue.types';
|
|
2
|
-
/**
|
|
3
|
-
* Producer handle for one named queue — inject via `queueToken(name)`:
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* constructor(@Inject(queueToken('email')) private readonly email: QueueClient) {}
|
|
7
|
-
* await this.email.add('welcome', { userId });
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* `add()` resolves when the DRIVER accepted the job, not when a processor
|
|
11
|
-
* handled it (the inline driver's `immediate` mode delivers on a following
|
|
12
|
-
* microtask; platform drivers deliver in another isolate entirely).
|
|
13
|
-
*/
|
|
14
|
-
export declare class QueueClient {
|
|
15
|
-
private readonly queue;
|
|
16
|
-
private readonly driver;
|
|
17
|
-
constructor(queue: string, driver: QueueDriver);
|
|
18
|
-
get name(): string;
|
|
19
|
-
add<T>(jobName: string, data: T, options?: AddJobOptions): Promise<QueueJob<T>>;
|
|
20
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Producer handle for one named queue — inject via `queueToken(name)`:
|
|
3
|
-
*
|
|
4
|
-
* ```ts
|
|
5
|
-
* constructor(@Inject(queueToken('email')) private readonly email: QueueClient) {}
|
|
6
|
-
* await this.email.add('welcome', { userId });
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* `add()` resolves when the DRIVER accepted the job, not when a processor
|
|
10
|
-
* handled it (the inline driver's `immediate` mode delivers on a following
|
|
11
|
-
* microtask; platform drivers deliver in another isolate entirely).
|
|
12
|
-
*/ export class QueueClient {
|
|
13
|
-
queue;
|
|
14
|
-
driver;
|
|
15
|
-
constructor(queue, driver){
|
|
16
|
-
this.queue = queue;
|
|
17
|
-
this.driver = driver;
|
|
18
|
-
}
|
|
19
|
-
get name() {
|
|
20
|
-
return this.queue;
|
|
21
|
-
}
|
|
22
|
-
async add(jobName, data, options = {}) {
|
|
23
|
-
const job = {
|
|
24
|
-
id: crypto.randomUUID(),
|
|
25
|
-
queue: this.queue,
|
|
26
|
-
name: jobName,
|
|
27
|
-
data,
|
|
28
|
-
attempt: 1
|
|
29
|
-
};
|
|
30
|
-
await this.driver.enqueue(job, options);
|
|
31
|
-
return job;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ProcessMetadata } from './queue.types';
|
|
2
|
-
/**
|
|
3
|
-
* Marks a provider class as a processor for one queue:
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* @Processor('email')
|
|
7
|
-
* @Injectable()
|
|
8
|
-
* class EmailProcessor {
|
|
9
|
-
* @Process('welcome')
|
|
10
|
-
* async sendWelcome(job: QueueJob<{ userId: string }>) { ... }
|
|
11
|
-
* }
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare function Processor(queueName: string): ClassDecorator;
|
|
15
|
-
/**
|
|
16
|
-
* Marks a processor method as the handler for a job name. Omit the name for
|
|
17
|
-
* the wildcard handler (receives every job on the queue that has no named
|
|
18
|
-
* handler). Named handlers win over the wildcard; a duplicate registration
|
|
19
|
-
* for the same name is first-wins with a diagnostics warning at dispatch.
|
|
20
|
-
*/
|
|
21
|
-
export declare function Process(jobName?: string): MethodDecorator;
|
|
22
|
-
/** `@Process` entries declared on a processor class (declaration order). */
|
|
23
|
-
export declare function getProcessHandlers(processorClass: object): ProcessMetadata[];
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createDiscoverableDecorator, defineMetadata, getMetadata, registerEntrypointKind } from "../index.js";
|
|
2
|
-
import { PROCESS_METADATA, PROCESSOR_METADATA } from "./queue.tokens.js";
|
|
3
|
-
const ProcessorMeta = createDiscoverableDecorator(PROCESSOR_METADATA);
|
|
4
|
-
// The open entrypoint kind: adapters enumerate processors via
|
|
5
|
-
// `app.entrypoints.ofKind<ProcessorMetadata>('queue')`. Declared at import
|
|
6
|
-
// time next to the decorator — zero kernel involvement.
|
|
7
|
-
registerEntrypointKind({
|
|
8
|
-
kind: 'queue',
|
|
9
|
-
metaKey: PROCESSOR_METADATA,
|
|
10
|
-
level: 'class'
|
|
11
|
-
});
|
|
12
|
-
/**
|
|
13
|
-
* Marks a provider class as a processor for one queue:
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* @Processor('email')
|
|
17
|
-
* @Injectable()
|
|
18
|
-
* class EmailProcessor {
|
|
19
|
-
* @Process('welcome')
|
|
20
|
-
* async sendWelcome(job: QueueJob<{ userId: string }>) { ... }
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*/ export function Processor(queueName) {
|
|
24
|
-
return ProcessorMeta({
|
|
25
|
-
queueName
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Marks a processor method as the handler for a job name. Omit the name for
|
|
30
|
-
* the wildcard handler (receives every job on the queue that has no named
|
|
31
|
-
* handler). Named handlers win over the wildcard; a duplicate registration
|
|
32
|
-
* for the same name is first-wins with a diagnostics warning at dispatch.
|
|
33
|
-
*/ export function Process(jobName) {
|
|
34
|
-
return (target, propertyKey)=>{
|
|
35
|
-
const ctor = target.constructor;
|
|
36
|
-
const existing = getMetadata(PROCESS_METADATA, ctor) ?? [];
|
|
37
|
-
existing.push({
|
|
38
|
-
jobName,
|
|
39
|
-
methodName: propertyKey
|
|
40
|
-
});
|
|
41
|
-
defineMetadata(PROCESS_METADATA, existing, ctor);
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/** `@Process` entries declared on a processor class (declaration order). */ export function getProcessHandlers(processorClass) {
|
|
45
|
-
return getMetadata(PROCESS_METADATA, processorClass) ?? [];
|
|
46
|
-
}
|