@velajs/vela 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -14
- package/dist/configurable-module.builder-5FGMaXG6.js +91 -0
- package/dist/configurable-module.builder-5FGMaXG6.js.map +1 -0
- package/dist/container-BqUHID4l.js +645 -0
- package/dist/container-BqUHID4l.js.map +1 -0
- package/dist/cron-matcher-C9qv5OUA.js +113 -0
- package/dist/cron-matcher-C9qv5OUA.js.map +1 -0
- package/dist/decorate-GcSMAbKn.js +528 -0
- package/dist/decorate-GcSMAbKn.js.map +1 -0
- package/dist/decorators-C8YBFCIk.js +53 -0
- package/dist/decorators-C8YBFCIk.js.map +1 -0
- package/dist/define-module-NOyOZNXD.js +235 -0
- package/dist/define-module-NOyOZNXD.js.map +1 -0
- package/dist/discovery.service-BYm95SSD.js +368 -0
- package/dist/discovery.service-BYm95SSD.js.map +1 -0
- package/dist/discovery.service-Cpf1QcZ5.d.ts +648 -0
- package/dist/i18n/index.d.ts +138 -10
- package/dist/i18n/index.js +270 -8
- package/dist/i18n/index.js.map +1 -0
- package/dist/index-D72EQfcC.d.ts +430 -0
- package/dist/index-DhShDLCM.d.ts +2310 -0
- package/dist/index.d.ts +6 -66
- package/dist/index.js +14 -71
- package/dist/internal.d.ts +13 -17
- package/dist/internal.js +6 -19
- package/dist/live/index.d.ts +2 -12
- package/dist/live/index.js +826 -16
- package/dist/live/index.js.map +1 -0
- package/dist/metadata.registry-D1od8ZBt.d.ts +842 -0
- package/dist/plugin-ByBlVOve.js +1387 -0
- package/dist/plugin-ByBlVOve.js.map +1 -0
- package/dist/queue/index.d.ts +247 -10
- package/dist/queue/index.js +384 -12
- package/dist/queue/index.js.map +1 -0
- package/dist/request-context-C3nCGJNd.js +26 -0
- package/dist/request-context-C3nCGJNd.js.map +1 -0
- package/dist/route.manager-DRAZ5X04.js +991 -0
- package/dist/route.manager-DRAZ5X04.js.map +1 -0
- package/dist/schedule-node/index.d.ts +32 -3
- package/dist/schedule-node/index.js +97 -3
- package/dist/schedule-node/index.js.map +1 -0
- package/dist/schedule.registry-DVm7Jp5w.d.ts +55 -0
- package/dist/seeder/index.d.ts +75 -5
- package/dist/seeder/index.js +105 -4
- package/dist/seeder/index.js.map +1 -0
- package/dist/signed-url-CMmi0SIb.js +56 -0
- package/dist/signed-url-CMmi0SIb.js.map +1 -0
- package/dist/signed-url-DKhgja4U.d.ts +16 -0
- package/dist/src-eb5CI6Xn.js +2151 -0
- package/dist/src-eb5CI6Xn.js.map +1 -0
- package/dist/storage/index.d.ts +57 -4
- package/dist/storage/index.js +22 -5
- package/dist/storage/index.js.map +1 -0
- package/dist/streaming/index.d.ts +2 -2
- package/dist/streaming/index.js +2 -1
- package/dist/websocket/index.d.ts +3 -12
- package/dist/websocket/index.js +2 -16
- package/dist/websocket-DXmB-MWJ.js +697 -0
- package/dist/websocket-DXmB-MWJ.js.map +1 -0
- package/dist/websocket-node/index.d.ts +108 -6
- package/dist/websocket-node/index.js +228 -6
- package/dist/websocket-node/index.js.map +1 -0
- package/package.json +67 -53
- package/dist/__tests__/workers/entry.d.ts +0 -9
- package/dist/__tests__/workers-als/entry-als.d.ts +0 -9
- package/dist/application.d.ts +0 -91
- package/dist/application.js +0 -308
- package/dist/cache/cache.decorators.d.ts +0 -2
- package/dist/cache/cache.decorators.js +0 -4
- package/dist/cache/cache.interceptor.d.ts +0 -9
- package/dist/cache/cache.interceptor.js +0 -60
- package/dist/cache/cache.module.d.ts +0 -7
- package/dist/cache/cache.module.js +0 -58
- package/dist/cache/cache.service.d.ts +0 -9
- package/dist/cache/cache.service.js +0 -42
- package/dist/cache/cache.store.d.ts +0 -12
- package/dist/cache/cache.store.js +0 -51
- package/dist/cache/cache.tokens.d.ts +0 -6
- package/dist/cache/cache.tokens.js +0 -5
- package/dist/cache/cache.types.d.ts +0 -41
- package/dist/cache/cache.types.js +0 -1
- package/dist/cache/index.d.ts +0 -8
- package/dist/cache/index.js +0 -7
- package/dist/cache/tiered-cache.store.d.ts +0 -19
- package/dist/cache/tiered-cache.store.js +0 -40
- package/dist/config/config.module.d.ts +0 -19
- package/dist/config/config.module.js +0 -98
- package/dist/config/config.service.d.ts +0 -20
- package/dist/config/config.service.js +0 -43
- package/dist/config/config.store.d.ts +0 -46
- package/dist/config/config.store.js +0 -119
- package/dist/config/config.tokens.d.ts +0 -13
- package/dist/config/config.tokens.js +0 -14
- package/dist/config/config.types.d.ts +0 -41
- package/dist/config/config.types.js +0 -4
- package/dist/config/index.d.ts +0 -7
- package/dist/config/index.js +0 -5
- package/dist/config/register-as.d.ts +0 -52
- package/dist/config/register-as.js +0 -39
- package/dist/constants.d.ts +0 -44
- package/dist/constants.js +0 -46
- package/dist/container/container.d.ts +0 -154
- package/dist/container/container.js +0 -849
- package/dist/container/decorators.d.ts +0 -17
- package/dist/container/decorators.js +0 -57
- package/dist/container/disposable.d.ts +0 -5
- package/dist/container/disposable.js +0 -33
- package/dist/container/index.d.ts +0 -6
- package/dist/container/index.js +0 -5
- package/dist/container/mixin.d.ts +0 -24
- package/dist/container/mixin.js +0 -26
- package/dist/container/module-ref.d.ts +0 -21
- package/dist/container/module-ref.js +0 -48
- package/dist/container/types.d.ts +0 -154
- package/dist/container/types.js +0 -49
- package/dist/cors/cors.module.d.ts +0 -7
- package/dist/cors/cors.module.js +0 -37
- package/dist/cors/cors.tokens.d.ts +0 -3
- package/dist/cors/cors.tokens.js +0 -2
- package/dist/cors/cors.types.d.ts +0 -8
- package/dist/cors/cors.types.js +0 -1
- package/dist/cors/index.d.ts +0 -3
- package/dist/cors/index.js +0 -2
- package/dist/crypto/signed-url.d.ts +0 -12
- package/dist/crypto/signed-url.js +0 -60
- package/dist/discovery/discoverable.decorator.d.ts +0 -38
- package/dist/discovery/discoverable.decorator.js +0 -42
- package/dist/discovery/discovery.service.d.ts +0 -102
- package/dist/discovery/discovery.service.js +0 -177
- package/dist/discovery/index.d.ts +0 -2
- package/dist/discovery/index.js +0 -2
- package/dist/entrypoint/entrypoint.registry.d.ts +0 -42
- package/dist/entrypoint/entrypoint.registry.js +0 -112
- package/dist/entrypoint/entrypoint.types.d.ts +0 -41
- package/dist/entrypoint/entrypoint.types.js +0 -3
- package/dist/entrypoint/execution-context.d.ts +0 -15
- package/dist/entrypoint/execution-context.js +0 -21
- package/dist/entrypoint/execution-scope.d.ts +0 -21
- package/dist/entrypoint/execution-scope.js +0 -28
- package/dist/entrypoint/index.d.ts +0 -4
- package/dist/entrypoint/index.js +0 -4
- package/dist/errors/http-exception.d.ts +0 -62
- package/dist/errors/http-exception.js +0 -134
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/event-emitter/event-emitter.decorators.d.ts +0 -1
- package/dist/event-emitter/event-emitter.decorators.js +0 -10
- package/dist/event-emitter/event-emitter.module.d.ts +0 -2
- package/dist/event-emitter/event-emitter.module.js +0 -23
- package/dist/event-emitter/event-emitter.service.d.ts +0 -13
- package/dist/event-emitter/event-emitter.service.js +0 -127
- package/dist/event-emitter/event-emitter.subscriber.d.ts +0 -9
- package/dist/event-emitter/event-emitter.subscriber.js +0 -45
- package/dist/event-emitter/event-emitter.tokens.d.ts +0 -1
- package/dist/event-emitter/event-emitter.tokens.js +0 -1
- package/dist/event-emitter/event-emitter.types.d.ts +0 -5
- package/dist/event-emitter/event-emitter.types.js +0 -1
- package/dist/event-emitter/index.d.ts +0 -6
- package/dist/event-emitter/index.js +0 -5
- package/dist/factory/adapter.d.ts +0 -36
- package/dist/factory/adapter.js +0 -18
- package/dist/factory/bootstrap.d.ts +0 -23
- package/dist/factory/bootstrap.js +0 -108
- package/dist/factory.d.ts +0 -16
- package/dist/factory.js +0 -36
- package/dist/fetch/fetch.module.d.ts +0 -7
- package/dist/fetch/fetch.module.js +0 -31
- package/dist/fetch/fetch.service.d.ts +0 -24
- package/dist/fetch/fetch.service.js +0 -145
- package/dist/fetch/fetch.types.d.ts +0 -24
- package/dist/fetch/fetch.types.js +0 -1
- package/dist/fetch/index.d.ts +0 -3
- package/dist/fetch/index.js +0 -2
- package/dist/health/health.http.d.ts +0 -14
- package/dist/health/health.http.js +0 -75
- package/dist/health/health.indicator.d.ts +0 -9
- package/dist/health/health.indicator.js +0 -32
- package/dist/health/health.module.d.ts +0 -2
- package/dist/health/health.module.js +0 -26
- package/dist/health/health.service.d.ts +0 -7
- package/dist/health/health.service.js +0 -69
- package/dist/health/health.types.d.ts +0 -15
- package/dist/health/health.types.js +0 -1
- package/dist/health/index.d.ts +0 -6
- package/dist/health/index.js +0 -4
- package/dist/http/ambient.d.ts +0 -17
- package/dist/http/ambient.js +0 -44
- package/dist/http/argument-resolver.d.ts +0 -10
- package/dist/http/argument-resolver.js +0 -89
- package/dist/http/decorators.d.ts +0 -198
- package/dist/http/decorators.js +0 -321
- package/dist/http/execution-context.d.ts +0 -8
- package/dist/http/execution-context.js +0 -35
- package/dist/http/handler-executor.d.ts +0 -20
- package/dist/http/handler-executor.js +0 -111
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.js +0 -7
- package/dist/http/instantiate.d.ts +0 -4
- package/dist/http/instantiate.js +0 -45
- package/dist/http/lazy-param.decorator.d.ts +0 -37
- package/dist/http/lazy-param.decorator.js +0 -117
- package/dist/http/request-container.d.ts +0 -16
- package/dist/http/request-container.js +0 -19
- package/dist/http/request-context.d.ts +0 -13
- package/dist/http/request-context.js +0 -22
- package/dist/http/response-mapper.d.ts +0 -8
- package/dist/http/response-mapper.js +0 -42
- package/dist/http/route-contributor.d.ts +0 -68
- package/dist/http/route-contributor.js +0 -22
- package/dist/http/route-map.d.ts +0 -30
- package/dist/http/route-map.js +0 -27
- package/dist/http/route.manager.d.ts +0 -92
- package/dist/http/route.manager.js +0 -481
- package/dist/http/types.d.ts +0 -37
- package/dist/http/types.js +0 -1
- package/dist/http/url/index.d.ts +0 -4
- package/dist/http/url/index.js +0 -3
- package/dist/http/url/signed-url.guard.d.ts +0 -27
- package/dist/http/url/signed-url.guard.js +0 -62
- package/dist/http/url/signing-secret.d.ts +0 -20
- package/dist/http/url/signing-secret.js +0 -24
- package/dist/http/url/url-generator.service.d.ts +0 -52
- package/dist/http/url/url-generator.service.js +0 -104
- package/dist/i18n/deep-merge.d.ts +0 -2
- package/dist/i18n/deep-merge.js +0 -15
- package/dist/i18n/i18n.middleware.d.ts +0 -15
- package/dist/i18n/i18n.middleware.js +0 -94
- package/dist/i18n/i18n.module.d.ts +0 -13
- package/dist/i18n/i18n.module.js +0 -69
- package/dist/i18n/i18n.options.d.ts +0 -30
- package/dist/i18n/i18n.options.js +0 -16
- package/dist/i18n/i18n.service.d.ts +0 -20
- package/dist/i18n/i18n.service.js +0 -49
- package/dist/i18n/i18n.tokens.d.ts +0 -6
- package/dist/i18n/i18n.tokens.js +0 -3
- package/dist/i18n/i18n.types.d.ts +0 -6
- package/dist/i18n/i18n.types.js +0 -1
- package/dist/i18n/message-loader.service.d.ts +0 -21
- package/dist/i18n/message-loader.service.js +0 -90
- package/dist/i18n/message-registry.d.ts +0 -16
- package/dist/i18n/message-registry.js +0 -49
- package/dist/lifecycle/index.d.ts +0 -20
- package/dist/lifecycle/index.js +0 -15
- package/dist/live/live.cursor.d.ts +0 -22
- package/dist/live/live.cursor.js +0 -56
- package/dist/live/live.decorators.d.ts +0 -32
- package/dist/live/live.decorators.js +0 -46
- package/dist/live/live.delta.d.ts +0 -15
- package/dist/live/live.delta.js +0 -51
- package/dist/live/live.engine.d.ts +0 -81
- package/dist/live/live.engine.js +0 -448
- package/dist/live/live.invalidation.d.ts +0 -45
- package/dist/live/live.invalidation.js +0 -99
- package/dist/live/live.module.d.ts +0 -28
- package/dist/live/live.module.js +0 -87
- package/dist/live/live.tokens.d.ts +0 -9
- package/dist/live/live.tokens.js +0 -8
- package/dist/live/live.types.d.ts +0 -138
- package/dist/live/live.types.js +0 -1
- package/dist/live/presence.d.ts +0 -44
- package/dist/live/presence.js +0 -130
- package/dist/metadata.d.ts +0 -10
- package/dist/metadata.js +0 -20
- package/dist/module/configurable-module.builder.d.ts +0 -56
- package/dist/module/configurable-module.builder.js +0 -84
- package/dist/module/configurable-module.types.d.ts +0 -93
- package/dist/module/configurable-module.types.js +0 -5
- package/dist/module/decorators.d.ts +0 -10
- package/dist/module/decorators.js +0 -47
- package/dist/module/define-module.d.ts +0 -112
- package/dist/module/define-module.js +0 -232
- package/dist/module/graph.d.ts +0 -10
- package/dist/module/graph.js +0 -35
- package/dist/module/index.d.ts +0 -10
- package/dist/module/index.js +0 -7
- package/dist/module/lazy-modules.d.ts +0 -82
- package/dist/module/lazy-modules.js +0 -231
- package/dist/module/lazy-provider.d.ts +0 -65
- package/dist/module/lazy-provider.js +0 -111
- package/dist/module/middleware.d.ts +0 -30
- package/dist/module/middleware.js +0 -67
- package/dist/module/module-loader.d.ts +0 -58
- package/dist/module/module-loader.js +0 -484
- package/dist/module/stable-hash.d.ts +0 -15
- package/dist/module/stable-hash.js +0 -52
- package/dist/module/types.d.ts +0 -1
- package/dist/module/types.js +0 -1
- package/dist/openapi/decorators.d.ts +0 -34
- package/dist/openapi/decorators.js +0 -66
- package/dist/openapi/document.d.ts +0 -3
- package/dist/openapi/document.js +0 -316
- package/dist/openapi/index.d.ts +0 -7
- package/dist/openapi/index.js +0 -6
- package/dist/openapi/redoc-ui.d.ts +0 -1
- package/dist/openapi/redoc-ui.js +0 -19
- package/dist/openapi/scalar-ui.d.ts +0 -1
- package/dist/openapi/scalar-ui.js +0 -19
- package/dist/openapi/swagger-ui.d.ts +0 -1
- package/dist/openapi/swagger-ui.js +0 -23
- package/dist/openapi/types.d.ts +0 -182
- package/dist/openapi/types.js +0 -4
- package/dist/openapi/zod-to-json-schema.d.ts +0 -4
- package/dist/openapi/zod-to-json-schema.js +0 -57
- package/dist/pipeline/app-providers.d.ts +0 -10
- package/dist/pipeline/app-providers.js +0 -43
- package/dist/pipeline/component.manager.d.ts +0 -25
- package/dist/pipeline/component.manager.js +0 -66
- package/dist/pipeline/decorators.d.ts +0 -10
- package/dist/pipeline/decorators.js +0 -42
- package/dist/pipeline/index.d.ts +0 -12
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/pipeline-runner.d.ts +0 -31
- package/dist/pipeline/pipeline-runner.js +0 -40
- package/dist/pipeline/pipes.d.ts +0 -48
- package/dist/pipeline/pipes.js +0 -104
- package/dist/pipeline/reflector.d.ts +0 -86
- package/dist/pipeline/reflector.js +0 -121
- package/dist/pipeline/scoped-components.d.ts +0 -26
- package/dist/pipeline/scoped-components.js +0 -27
- package/dist/pipeline/tokens.d.ts +0 -33
- package/dist/pipeline/tokens.js +0 -27
- package/dist/pipeline/types.d.ts +0 -64
- package/dist/pipeline/types.js +0 -1
- package/dist/plugin/plugin.d.ts +0 -31
- package/dist/plugin/plugin.js +0 -111
- package/dist/queue/inline.driver.d.ts +0 -30
- package/dist/queue/inline.driver.js +0 -58
- package/dist/queue/queue.binding.d.ts +0 -23
- package/dist/queue/queue.binding.js +0 -53
- package/dist/queue/queue.client.d.ts +0 -20
- package/dist/queue/queue.client.js +0 -33
- package/dist/queue/queue.decorators.d.ts +0 -23
- package/dist/queue/queue.decorators.js +0 -46
- package/dist/queue/queue.dispatch.d.ts +0 -36
- package/dist/queue/queue.dispatch.js +0 -102
- package/dist/queue/queue.module.d.ts +0 -32
- package/dist/queue/queue.module.js +0 -80
- package/dist/queue/queue.tokens.d.ts +0 -21
- package/dist/queue/queue.tokens.js +0 -34
- package/dist/queue/queue.types.d.ts +0 -61
- package/dist/queue/queue.types.js +0 -4
- package/dist/registry/index.d.ts +0 -2
- package/dist/registry/index.js +0 -1
- package/dist/registry/metadata.registry.d.ts +0 -73
- package/dist/registry/metadata.registry.js +0 -357
- package/dist/registry/paths.d.ts +0 -3
- package/dist/registry/paths.js +0 -15
- package/dist/registry/types.d.ts +0 -116
- package/dist/registry/types.js +0 -1
- package/dist/registry/util.d.ts +0 -3
- package/dist/registry/util.js +0 -8
- package/dist/schedule/cron-matcher.d.ts +0 -2
- package/dist/schedule/cron-matcher.js +0 -62
- package/dist/schedule/index.d.ts +0 -8
- package/dist/schedule/index.js +0 -5
- package/dist/schedule/schedule.decorators.d.ts +0 -2
- package/dist/schedule/schedule.decorators.js +0 -18
- package/dist/schedule/schedule.module.d.ts +0 -9
- package/dist/schedule/schedule.module.js +0 -28
- package/dist/schedule/schedule.registry.d.ts +0 -23
- package/dist/schedule/schedule.registry.js +0 -63
- package/dist/schedule/schedule.tokens.d.ts +0 -2
- package/dist/schedule/schedule.tokens.js +0 -2
- package/dist/schedule/schedule.types.d.ts +0 -8
- package/dist/schedule/schedule.types.js +0 -1
- package/dist/schedule-node/schedule-node.module.d.ts +0 -9
- package/dist/schedule-node/schedule-node.module.js +0 -28
- package/dist/schedule-node/schedule.executor.d.ts +0 -19
- package/dist/schedule-node/schedule.executor.js +0 -107
- package/dist/seeder/seeder.decorator.d.ts +0 -7
- package/dist/seeder/seeder.decorator.js +0 -15
- package/dist/seeder/seeder.module.d.ts +0 -16
- package/dist/seeder/seeder.module.js +0 -44
- package/dist/seeder/seeder.registry.d.ts +0 -23
- package/dist/seeder/seeder.registry.js +0 -83
- package/dist/seeder/seeder.tokens.d.ts +0 -2
- package/dist/seeder/seeder.tokens.js +0 -1
- package/dist/seeder/seeder.types.d.ts +0 -20
- package/dist/seeder/seeder.types.js +0 -1
- package/dist/serialization/index.d.ts +0 -2
- package/dist/serialization/index.js +0 -2
- package/dist/serialization/serialize.decorator.d.ts +0 -6
- package/dist/serialization/serialize.decorator.js +0 -7
- package/dist/serialization/serializer.interceptor.d.ts +0 -4
- package/dist/serialization/serializer.interceptor.js +0 -16
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -1
- package/dist/services/logger.d.ts +0 -59
- package/dist/services/logger.js +0 -159
- package/dist/storage/path-template.d.ts +0 -9
- package/dist/storage/path-template.js +0 -20
- package/dist/storage/storage.types.d.ts +0 -41
- package/dist/storage/storage.types.js +0 -5
- package/dist/throttler/index.d.ts +0 -6
- package/dist/throttler/index.js +0 -5
- package/dist/throttler/throttler.decorators.d.ts +0 -3
- package/dist/throttler/throttler.decorators.js +0 -4
- package/dist/throttler/throttler.guard.d.ts +0 -9
- package/dist/throttler/throttler.guard.js +0 -72
- package/dist/throttler/throttler.module.d.ts +0 -7
- package/dist/throttler/throttler.module.js +0 -41
- package/dist/throttler/throttler.storage.d.ts +0 -10
- package/dist/throttler/throttler.storage.js +0 -44
- package/dist/throttler/throttler.tokens.d.ts +0 -6
- package/dist/throttler/throttler.tokens.js +0 -5
- package/dist/throttler/throttler.types.d.ts +0 -25
- package/dist/throttler/throttler.types.js +0 -1
- package/dist/validation/create-zod-dto.d.ts +0 -13
- package/dist/validation/create-zod-dto.js +0 -18
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -2
- package/dist/validation/validation.pipe.d.ts +0 -4
- package/dist/validation/validation.pipe.js +0 -19
- package/dist/websocket/websocket.decorators.d.ts +0 -47
- package/dist/websocket/websocket.decorators.js +0 -80
- package/dist/websocket/websocket.module.d.ts +0 -35
- package/dist/websocket/websocket.module.js +0 -63
- package/dist/websocket/websocket.tokens.d.ts +0 -30
- package/dist/websocket/websocket.tokens.js +0 -27
- package/dist/websocket/websocket.types.d.ts +0 -102
- package/dist/websocket/websocket.types.js +0 -4
- package/dist/websocket/ws-argument-resolver.d.ts +0 -13
- package/dist/websocket/ws-argument-resolver.js +0 -40
- package/dist/websocket/ws-dispatcher.d.ts +0 -54
- package/dist/websocket/ws-dispatcher.js +0 -322
- package/dist/websocket/ws-exception.d.ts +0 -16
- package/dist/websocket/ws-exception.js +0 -32
- package/dist/websocket/ws-execution-context.d.ts +0 -9
- package/dist/websocket/ws-execution-context.js +0 -24
- package/dist/websocket/ws-server.d.ts +0 -31
- package/dist/websocket/ws-server.js +0 -74
- package/dist/websocket/ws-sync.d.ts +0 -47
- package/dist/websocket/ws-sync.js +0 -74
- package/dist/websocket-node/node-ws-client.d.ts +0 -24
- package/dist/websocket-node/node-ws-client.js +0 -49
- package/dist/websocket-node/redis-live.d.ts +0 -24
- package/dist/websocket-node/redis-live.js +0 -57
- package/dist/websocket-node/redis-sync.d.ts +0 -33
- package/dist/websocket-node/redis-sync.js +0 -56
- package/dist/websocket-node/register-gateways.d.ts +0 -20
- package/dist/websocket-node/register-gateways.js +0 -61
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-BqUHID4l.js","names":[],"sources":["../src/container/disposable.ts","../src/container/container.ts"],"sourcesContent":["// Edge-safe disposal contract. Precedence:\n// Symbol.asyncDispose > Symbol.dispose > .dispose()\n// Symbol.asyncDispose/Symbol.dispose are resolved at runtime (they are not in\n// the ES2022 lib the project targets), so nothing here depends on the\n// esnext.disposable typings.\n\nconst ASYNC_DISPOSE: symbol | undefined = (Symbol as { asyncDispose?: symbol }).asyncDispose;\nconst SYNC_DISPOSE: symbol | undefined = (Symbol as { dispose?: symbol }).dispose;\n\nexport interface Disposable {\n dispose?(): void | Promise<void>;\n}\n\nfunction asRecord(value: unknown): Record<PropertyKey, unknown> | undefined {\n if (value === null) return undefined;\n return typeof value === 'object' || typeof value === 'function'\n ? (value as Record<PropertyKey, unknown>)\n : undefined;\n}\n\nexport function isDisposable(value: unknown): boolean {\n const obj = asRecord(value);\n if (!obj) return false;\n if (ASYNC_DISPOSE && typeof obj[ASYNC_DISPOSE] === 'function') return true;\n if (SYNC_DISPOSE && typeof obj[SYNC_DISPOSE] === 'function') return true;\n return typeof obj.dispose === 'function';\n}\n\nexport async function disposeInstance(value: unknown): Promise<void> {\n const obj = asRecord(value);\n if (!obj) return;\n if (ASYNC_DISPOSE && typeof obj[ASYNC_DISPOSE] === 'function') {\n await (obj[ASYNC_DISPOSE] as () => void | Promise<void>).call(obj);\n return;\n }\n if (SYNC_DISPOSE && typeof obj[SYNC_DISPOSE] === 'function') {\n (obj[SYNC_DISPOSE] as () => void).call(obj);\n return;\n }\n if (typeof obj.dispose === 'function') {\n await (obj.dispose as () => void | Promise<void>).call(obj);\n }\n}\n","import { Scope } from '../constants';\nimport { disposeInstance, isDisposable } from './disposable';\nimport {\n getConstructorDependencies,\n getInjectMetadata,\n getScope,\n isInjectable,\n} from './decorators';\nimport type {\n ContainerOptions,\n Diagnostics,\n LazyResolutionHook,\n ModuleDescription,\n ModuleScope,\n ProviderOptions,\n ProviderRegistration,\n Token,\n Type,\n} from './types';\nimport {\n describeToken,\n ForwardRef,\n InjectionToken,\n ModuleVisibilityError,\n MultipleProvidersFoundError,\n ROOT_MODULE_ID,\n} from './types';\n\nconst IMPORT_TYPE_HINT =\n 'Did you use `import type { X }`? TypeScript strips type-only imports at ' +\n 'runtime and `design:paramtypes` emits `Object`/`undefined` for their ' +\n 'positions. Use a runtime `import { X }` for DI tokens.';\n\n/**\n * Sentinel comparing a token to the bare `Object` class — `design:paramtypes`\n * emits `Object` when TypeScript erases a type-only import, so any token that\n * is `Object` (or nullish) is the fingerprint of a stripped type.\n */\nfunction isErasedTypeToken(token: unknown): boolean {\n return token === Object || token == null;\n}\n\n/**\n * Per-module provider buckets. Each module instance owns its providers under\n * its `moduleId`; the same logical token can have distinct registrations in\n * different buckets, supporting multi-instance dynamic modules.\n *\n * The `__root__` bucket holds bootstrap-time framework primitives (Container,\n * ModuleRef, REQUEST_CONTEXT, etc.) and any `register()` call that doesn't\n * supply a `declaringModuleId`.\n */\nexport class Container {\n private providers = new Map<string, Map<Token, ProviderRegistration>>();\n private exporterIndex = new Map<Token, Set<string>>();\n private resolutionStack = new Set<Token>();\n private requestInstances = new Map<Token, unknown>();\n private scopes = new Map<string, ModuleScope>();\n private globals = new Set<Token>();\n private diagnostics: Diagnostics;\n // The root container that owns shared state; a request child points back here\n // so container-constructed SINGLETONs are tracked (and disposed) at the root,\n // never by the ephemeral child that happened to first resolve them.\n private root: Container = this;\n // Container-constructed instances in creation order, for LIFO disposal.\n // useValue providers are never tracked (they return before construction).\n private disposables: unknown[] = [];\n // Lazy-module seam (root-owned; children reach it via this.root). A\n // resolution of a deferred registration CLAIMS its module; claimed groups\n // are completed (constructed + hooks replayed) only when the resolution\n // stack has unwound and no resolveAsync cascade is in flight — running the\n // replay mid-construction could force-resolve a class currently on the\n // resolution stack (discovery cascades) and mint a spurious\n // circular-dependency error.\n private lazyHook?: LazyResolutionHook;\n private asyncDepth = 0;\n\n constructor(options: ContainerOptions = {}) {\n this.diagnostics = options.diagnostics ?? 'log';\n }\n\n /** Install the lazy-module seam (bootstrap-time; root container only). */\n setLazyHook(hook: LazyResolutionHook): void {\n this.root.lazyHook = hook;\n }\n\n private claimLazyModule(declaringModuleId: string): void {\n const hook = this.root.lazyHook;\n if (hook?.isPending(declaringModuleId)) {\n hook.claim(declaringModuleId);\n }\n }\n\n private maybeDrainSync(): void {\n const root = this.root;\n const hook = root.lazyHook;\n if (!hook?.hasClaimed()) return;\n // Never replay hooks while construction is in flight; an async cascade\n // drains (with await) at its own end instead. A running drain picks\n // pending claims up itself — re-entering it is at best a no-op and on\n // the async path a self-deadlock.\n if (this.resolutionStack.size > 0) return;\n if (root.asyncDepth > 0) return;\n if (hook.isDraining()) return;\n hook.drainSync();\n }\n\n register<T>(provider: Type<T> | ProviderOptions<T>, declaringModuleId?: string): this {\n const moduleId = declaringModuleId ?? ROOT_MODULE_ID;\n if (typeof provider === 'function') {\n this.registerClass(provider, moduleId);\n } else {\n this.registerOptions(provider, moduleId);\n }\n return this;\n }\n\n private registerClass<T>(target: Type<T>, moduleId: string): void {\n if (!isInjectable(target)) {\n console.warn(\n `Warning: ${target.name} is not decorated with @Injectable(). ` +\n `It will be registered but dependency resolution may not work correctly.`,\n );\n }\n\n const scope = getScope(target);\n this.writeRegistration(moduleId, target, {\n provide: target,\n scope,\n declaringModuleId: moduleId,\n useClass: target,\n });\n }\n\n private registerOptions<T>(options: ProviderOptions<T>, moduleId: string): void {\n const token = options.provide;\n if (!token) {\n throw new Error('Provider registration requires a token');\n }\n\n const registration: ProviderRegistration<T> = {\n provide: token,\n scope: options.scope ?? Scope.SINGLETON,\n declaringModuleId: moduleId,\n };\n\n if (options.useValue !== undefined) {\n registration.useValue = options.useValue;\n registration.instance = options.useValue;\n } else if (options.useFactory) {\n registration.useFactory = options.useFactory;\n registration.inject = options.inject;\n } else if (options.useClass) {\n registration.useClass = options.useClass;\n } else if (options.useExisting) {\n registration.useExisting = options.useExisting;\n } else if (typeof token === 'function') {\n registration.useClass = token;\n }\n\n this.writeRegistration(moduleId, token, registration);\n }\n\n private writeRegistration(\n moduleId: string,\n token: Token,\n registration: ProviderRegistration,\n ): void {\n let bucket = this.providers.get(moduleId);\n if (!bucket) {\n bucket = new Map();\n this.providers.set(moduleId, bucket);\n }\n bucket.set(token, registration);\n\n let exporters = this.exporterIndex.get(token);\n if (!exporters) {\n exporters = new Set();\n this.exporterIndex.set(token, exporters);\n }\n exporters.add(moduleId);\n }\n\n registerScope(scope: ModuleScope): void {\n this.scopes.set(scope.moduleId, scope);\n if (!this.providers.has(scope.moduleId)) {\n this.providers.set(scope.moduleId, new Map());\n }\n if (scope.isGlobal) {\n // Match NestJS / the loader's existing globalExports semantic: only\n // exported tokens become globally visible. Non-exported providers of\n // a @Global module still need explicit imports.\n for (const token of scope.exportedTokens) this.globals.add(token);\n }\n }\n\n markGlobalToken(token: Token): void {\n this.globals.add(token);\n }\n\n // Pre-seed the per-request cache. Only meaningful on a child container\n // produced by createChild() — the root's requestInstances map is unused.\n // Used by RouteManager to populate framework-provided request-scope\n // values (REQUEST_CONTEXT) before any handler resolution runs, so the\n // provider's factory never fires on the request path.\n setRequestInstance(token: Token, value: unknown): void {\n this.requestInstances.set(token, value);\n }\n\n getDiagnostics(): Diagnostics {\n return this.diagnostics;\n }\n\n resolve<T>(token: Token<T>, requestingModuleId?: string): T {\n const registration = this.findRegistration<T>(token, requestingModuleId);\n if (registration) {\n const instance = this.resolveRegistration(registration, requestingModuleId);\n this.maybeDrainSync();\n return instance;\n }\n\n // Visibility error fires first when the token exists in some bucket but\n // isn't reachable from the requester's scope — the user wants to know\n // their wiring is wrong, not that the token doesn't exist.\n if (\n requestingModuleId !== undefined &&\n this.scopes.has(requestingModuleId) &&\n this.exporterIndex.has(token)\n ) {\n throw new ModuleVisibilityError(requestingModuleId, token);\n }\n\n // `Object`/undefined at a token position is the fingerprint of a\n // type-only import that TypeScript stripped — emit the hint before\n // attempting any other recovery.\n if (isErasedTypeToken(token)) {\n throw new Error(\n `No provider found for token: ${this.tokenToString(token)}. ` + IMPORT_TYPE_HINT,\n );\n }\n\n if (typeof token === 'function') {\n throw new Error(\n `No provider found for token: ${this.tokenToString(token)}. ` +\n `Declare it in a module's providers.`,\n );\n }\n\n // InjectionToken default factories are explicit user declarations\n // attached to the token at construction — self-providing singletons.\n if (token instanceof InjectionToken && token.options?.factory) {\n this.register({ provide: token, useFactory: token.options.factory });\n return this.resolve(token, requestingModuleId);\n }\n\n throw new Error(`No provider found for token: ${this.tokenToString(token)}`);\n }\n\n resolveAll<T>(token: Token<T>, requestingModuleId?: string): T[] {\n const registrations = this.findAllRegistrations<T>(token, requestingModuleId);\n const instances = registrations.map((r) => this.resolveRegistration(r, requestingModuleId));\n this.maybeDrainSync();\n return instances;\n }\n\n /**\n * Find a single reachable registration for a token, applying the visibility\n * walk: requester's bucket → globals → requester's importedModules\n * (transitively, following re-exports).\n *\n * Returns `undefined` if no candidate exists. Throws\n * `MultipleProvidersFoundError` if the imports walk yields more than one.\n */\n private findRegistration<T>(\n token: Token<T>,\n requestingModuleId?: string,\n ): ProviderRegistration<T> | undefined {\n // No requester OR no scope for this requester: framework-internal /\n // sandbox lookup. Prefer the `__root__` bucket so sandbox-registered\n // transients (ModuleRef.create) and bootstrap primitives win over module\n // buckets that may hold the same token under SINGLETON scope.\n if (requestingModuleId === undefined || !this.scopes.has(requestingModuleId)) {\n const rootHit = this.lookupInBucket<T>(ROOT_MODULE_ID, token);\n if (rootHit) return rootHit;\n const exporters = this.exporterIndex.get(token);\n if (!exporters) return undefined;\n for (const owner of exporters) {\n const hit = this.lookupInBucket<T>(owner, token);\n if (hit) return hit;\n }\n return undefined;\n }\n\n // 1. Local bucket.\n const local = this.lookupInBucket<T>(requestingModuleId, token);\n if (local) return local;\n\n // 2. Global tokens — registration still lives in some module's bucket.\n if (this.globals.has(token)) {\n const exporters = this.exporterIndex.get(token);\n if (exporters && exporters.size > 0) {\n if (exporters.size > 1) {\n throw new MultipleProvidersFoundError(requestingModuleId, token, [...exporters]);\n }\n const [owner] = [...exporters];\n return this.lookupInBucket<T>(owner!, token);\n }\n return undefined;\n }\n\n // 3. InjectionToken with default factory — self-providing from any\n // scope. If already auto-registered (in `__root__`), return that;\n // otherwise let the caller materialize it.\n if (token instanceof InjectionToken && token.options?.factory) {\n return this.lookupInBucket<T>(ROOT_MODULE_ID, token);\n }\n\n // 4. Imported modules' exports — walk transitively so re-exports work.\n const scope = this.scopes.get(requestingModuleId);\n if (!scope) return undefined;\n\n const candidates: ProviderRegistration<T>[] = [];\n const candidateModuleIds: string[] = [];\n const visited = new Set<string>([requestingModuleId]);\n this.collectFromImports<T>(scope, token, visited, candidates, candidateModuleIds);\n\n if (candidates.length === 0) return undefined;\n if (candidates.length > 1) {\n throw new MultipleProvidersFoundError(requestingModuleId, token, candidateModuleIds);\n }\n return candidates[0];\n }\n\n /** Typed bucket lookup — single seam where the Map<Token, Registration> erases T. */\n private lookupInBucket<T>(\n moduleId: string,\n token: Token<T>,\n ): ProviderRegistration<T> | undefined {\n return this.providers.get(moduleId)?.get(token) as ProviderRegistration<T> | undefined;\n }\n\n /**\n * Walk a scope's imports (and their imports' imports, …) collecting every\n * registration reachable through re-export chains. A child only contributes\n * if it explicitly exports the token — non-exported providers stay private.\n */\n private collectFromImports<T>(\n scope: ModuleScope,\n token: Token<T>,\n visited: Set<string>,\n candidates: ProviderRegistration<T>[],\n candidateModuleIds: string[],\n ): void {\n for (const importedId of scope.importedModules) {\n if (visited.has(importedId)) continue;\n visited.add(importedId);\n const imported = this.scopes.get(importedId);\n if (!imported?.exportedTokens.has(token)) continue;\n\n const direct = this.lookupInBucket<T>(importedId, token);\n if (direct) {\n candidates.push(direct);\n candidateModuleIds.push(importedId);\n continue;\n }\n\n // Imported module re-exports the token without owning it — recurse\n // into ITS imports.\n this.collectFromImports<T>(imported, token, visited, candidates, candidateModuleIds);\n }\n }\n\n private findAllRegistrations<T>(\n token: Token<T>,\n requestingModuleId?: string,\n ): ProviderRegistration<T>[] {\n if (requestingModuleId === undefined) {\n const exporters = this.exporterIndex.get(token);\n if (!exporters) return [];\n return [...exporters]\n .map((id) => this.lookupInBucket<T>(id, token))\n .filter((r): r is ProviderRegistration<T> => r !== undefined);\n }\n\n const out: ProviderRegistration<T>[] = [];\n const seen = new Set<ProviderRegistration<T>>();\n\n const local = this.lookupInBucket<T>(requestingModuleId, token);\n if (local && !seen.has(local)) {\n out.push(local);\n seen.add(local);\n }\n\n if (this.globals.has(token)) {\n for (const owner of this.exporterIndex.get(token) ?? []) {\n const reg = this.lookupInBucket<T>(owner, token);\n if (reg && !seen.has(reg)) {\n out.push(reg);\n seen.add(reg);\n }\n }\n }\n\n const scope = this.scopes.get(requestingModuleId);\n if (scope) {\n for (const importedId of scope.importedModules) {\n const imported = this.scopes.get(importedId);\n if (!imported?.exportedTokens.has(token)) continue;\n const reg = this.lookupInBucket<T>(importedId, token);\n if (reg && !seen.has(reg)) {\n out.push(reg);\n seen.add(reg);\n }\n }\n }\n\n return out;\n }\n\n /** True if any bucket has a registration for `token`. Sandbox-friendly. */\n has(token: Token): boolean {\n return this.exporterIndex.has(token);\n }\n\n /** True if the specified module's bucket has a registration for `token`. */\n hasInScope(token: Token, moduleId: string): boolean {\n return this.providers.get(moduleId)?.has(token) ?? false;\n }\n\n /** Module buckets that hold a registration for `token` (registration order). */\n getOwnerModuleIds(token: Token): string[] {\n return [...(this.exporterIndex.get(token) ?? [])];\n }\n\n /**\n * Force-replace a provider across module scopes — the supported form of the\n * override loop test harnesses need (module-scoped resolution consults the\n * module's own bucket first, so a root-only override would never win there).\n *\n * - `'all-existing'` (default): every non-root bucket that already holds the\n * token, plus `__root__` (so framework-internal lookups see it too).\n * - `'root'`: only the `__root__` bucket.\n * - `string[]`: exactly these bucket ids.\n */\n replaceProvider<T>(\n provider: Type<T> | ProviderOptions<T>,\n options: { buckets?: 'all-existing' | 'root' | string[] } = {},\n ): this {\n const buckets = options.buckets ?? 'all-existing';\n if (buckets === 'root') {\n return this.register(provider);\n }\n if (Array.isArray(buckets)) {\n for (const moduleId of buckets) this.register(provider, moduleId);\n return this;\n }\n const token = typeof provider === 'function' ? provider : provider.provide;\n if (!token) {\n throw new Error('replaceProvider requires a token (`provide`)');\n }\n for (const [moduleId, bucket] of this.providers) {\n if (moduleId === ROOT_MODULE_ID) continue;\n if (bucket.has(token)) this.register(provider, moduleId);\n }\n return this.register(provider);\n }\n\n /**\n * True when the token belongs exclusively to lazy modules that have not\n * been materialized yet — resolving it would trigger materialization.\n * Build-time probes (route-manager middleware priority, entrypoint\n * snapshots) use this to defer instead of forcing the group.\n */\n isLazyPending(token: Token): boolean {\n const hook = this.root.lazyHook;\n if (!hook) return false;\n const owners = this.exporterIndex.get(token);\n if (!owners || owners.size === 0) return false;\n for (const owner of owners) {\n if (!hook.isPending(owner)) return false;\n }\n return true;\n }\n\n /**\n * True when any registration of the token holds a constructed instance.\n * Diagnostic helper (cold-start tests): checks WITHOUT resolving, so it\n * never triggers lazy materialization.\n */\n isInstantiated(token: Token): boolean {\n for (const owner of this.exporterIndex.get(token) ?? []) {\n const reg = this.providers.get(owner)?.get(token);\n if (reg && reg.instance !== undefined) return true;\n }\n return false;\n }\n\n getProviderScope(token: Token): Scope | undefined {\n const exporters = this.exporterIndex.get(token);\n if (!exporters) return undefined;\n for (const owner of exporters) {\n const reg = this.providers.get(owner)?.get(token);\n if (reg) return reg.effectiveScope ?? reg.scope;\n }\n return undefined;\n }\n\n getTokens(): Token[] {\n const out = new Set<Token>();\n for (const bucket of this.providers.values()) {\n for (const token of bucket.keys()) out.add(token);\n }\n return [...out];\n }\n\n /**\n * Every statically-provided (useValue) instance across ALL module buckets.\n * Unlike resolving a token (which yields only the first bucket's registration),\n * this surfaces per-instance values — e.g. one BindingRef per multi-instance\n * binding module — so framework adapters can initialize all of them.\n */\n getUseValues(): unknown[] {\n const out: unknown[] = [];\n for (const bucket of this.providers.values()) {\n for (const reg of bucket.values()) {\n if (reg.useValue !== undefined) out.push(reg.useValue);\n }\n }\n return out;\n }\n\n /**\n * Serializable description of every loaded module instance (load order),\n * plus the `__root__` bucket (bootstrap primitives) when non-empty —\n * the `vela module graph` seam. Reads registration state only: safe pre-\n * and post-bootstrap, never constructs, never claims lazy modules.\n */\n getModuleDescriptions(): ModuleDescription[] {\n const out: ModuleDescription[] = [];\n for (const scope of this.scopes.values()) {\n out.push({\n moduleId: scope.moduleId,\n imports: [...scope.importedModules],\n isGlobal: scope.isGlobal,\n lazy: scope.lazy === true,\n providers: [...(this.providers.get(scope.moduleId)?.keys() ?? [])].map(describeToken),\n exports: [...scope.exportedTokens].map(describeToken),\n });\n }\n const rootBucket = this.providers.get(ROOT_MODULE_ID);\n if (rootBucket && rootBucket.size > 0) {\n out.push({\n moduleId: ROOT_MODULE_ID,\n imports: [],\n isGlobal: false,\n lazy: false,\n providers: [...rootBucket.keys()].map(describeToken),\n exports: [],\n });\n }\n return out;\n }\n\n /**\n * Compute request-scope bubbling for every registration (call once at\n * bootstrap, after all providers are registered). A provider whose declared\n * scope is not REQUEST but which (transitively) depends on a request-scoped\n * provider is marked `effectiveScope = REQUEST`, so it is rebuilt per request\n * instead of capturing the first request's instance — matching NestJS.\n */\n computeEffectiveScopes(): void {\n // Reverse-propagation worklist: seed with every declared-REQUEST provider,\n // then flood \"request-ness\" to consumers transitively. This is order- and\n // cycle-independent (a node flips to REQUEST at most once), avoiding the\n // finalize-during-in-progress-cycle hazard of a recursive DFS.\n const regs: ProviderRegistration[] = [];\n for (const bucket of this.providers.values()) {\n for (const reg of bucket.values()) {\n reg.effectiveScope = reg.scope;\n regs.push(reg);\n }\n }\n\n // Build reverse edges: dependency registration -> registrations that consume it.\n const consumers = new Map<ProviderRegistration, ProviderRegistration[]>();\n for (const reg of regs) {\n for (const depToken of this.dependencyTokensOf(reg)) {\n const depReg = this.tryFindRegistration(depToken, reg.declaringModuleId);\n if (!depReg) continue;\n const list = consumers.get(depReg);\n if (list) list.push(reg);\n else consumers.set(depReg, [reg]);\n }\n }\n\n const queue = regs.filter((r) => r.effectiveScope === Scope.REQUEST);\n while (queue.length > 0) {\n const dep = queue.pop()!;\n for (const consumer of consumers.get(dep) ?? []) {\n if (consumer.effectiveScope !== Scope.REQUEST) {\n consumer.effectiveScope = Scope.REQUEST;\n queue.push(consumer);\n }\n }\n }\n }\n\n /** The dependency tokens a registration would resolve when constructed. */\n private dependencyTokensOf(reg: ProviderRegistration): Token[] {\n if (reg.useExisting) return [reg.useExisting];\n if (reg.useFactory) {\n return (reg.inject ?? []).map((t) => (t instanceof ForwardRef ? t.factory() : t));\n }\n const cls =\n reg.useClass ?? (typeof reg.provide === 'function' ? (reg.provide as Type) : undefined);\n if (!cls) return [];\n\n const paramTypes = getConstructorDependencies(cls);\n const injectMetadata = getInjectMetadata(cls);\n const injectMap = new Map(injectMetadata.map((m) => [m.index, m]));\n const arity = Math.max(\n paramTypes.length,\n injectMetadata.reduce((max, m) => Math.max(max, m.index + 1), 0),\n );\n\n const tokens: Token[] = [];\n for (let i = 0; i < arity; i++) {\n const raw = injectMap.get(i)?.token;\n const token = raw instanceof ForwardRef ? raw.factory() : (raw ?? paramTypes[i]);\n if (token && !isErasedTypeToken(token)) tokens.push(token);\n }\n return tokens;\n }\n\n private tryFindRegistration(\n token: Token,\n requestingModuleId: string,\n ): ProviderRegistration | undefined {\n try {\n return this.findRegistration(token, requestingModuleId);\n } catch {\n // Ambiguous (MultipleProvidersFoundError) or unreachable — treat as\n // unknown for scope computation; real resolution will surface any error.\n return undefined;\n }\n }\n\n /**\n * Create a child container for request-scoped resolution.\n * The child shares the parent's providers but caches REQUEST-scoped\n * instances separately per child (per request).\n */\n createChild(): Container {\n const child = new Container({ diagnostics: this.diagnostics });\n // Share state by reference — request-scope children must see the same\n // module graph as the root.\n child.providers = this.providers;\n child.exporterIndex = this.exporterIndex;\n child.scopes = this.scopes;\n child.globals = this.globals;\n // SINGLETON disposal is owned by the root; the child keeps only its own\n // REQUEST-scoped disposables (cleared when the request ends).\n child.root = this.root;\n return child;\n }\n\n createDetached(): Container {\n const child = new Container({ diagnostics: this.diagnostics });\n // Deep-clone provider buckets so sandbox writes don't leak back to the\n // parent. Inner ProviderRegistration objects are shallow-shared (we only\n // mutate `instance` cache, and per-bucket clones already give per-sandbox\n // singleton isolation when needed).\n const clonedProviders = new Map<string, Map<Token, ProviderRegistration>>();\n for (const [moduleId, bucket] of this.providers) {\n clonedProviders.set(moduleId, new Map(bucket));\n }\n child.providers = clonedProviders;\n\n const clonedIndex = new Map<Token, Set<string>>();\n for (const [token, owners] of this.exporterIndex) {\n clonedIndex.set(token, new Set(owners));\n }\n child.exporterIndex = clonedIndex;\n\n child.scopes = this.scopes;\n child.globals = this.globals;\n // Registration objects are shallow-shared, so a sandbox resolve of a lazy\n // module's singleton caches onto the SHARED registration. Point the\n // sandbox at the real root so that resolution claims the module and\n // replays its hooks like any other trigger — otherwise ModuleRef.create\n // would leave a hook-less instance poisoning the shared cache (and its\n // disposables tracked on an ephemeral root).\n child.root = this.root;\n return child;\n }\n\n clear(): void {\n this.providers.clear();\n this.exporterIndex.clear();\n this.resolutionStack.clear();\n this.requestInstances.clear();\n this.scopes.clear();\n this.globals.clear();\n this.disposables = [];\n }\n\n /** Whether this container has any tracked disposables (cheap request-path check). */\n hasDisposables(): boolean {\n return this.disposables.length > 0;\n }\n\n /**\n * Dispose container-constructed instances (Symbol.asyncDispose /\n * Symbol.dispose / .dispose()) in reverse creation order (LIFO). Errors are\n * logged and skipped so one bad teardown never blocks the rest.\n *\n * A REQUEST child disposes only its own request-scoped instances; the root\n * disposes shared SINGLETONs and clears their cached instance so a dev HMR\n * generation cannot leak a stale graph. Shared provider maps are left intact\n * for a request child (they belong to the root).\n */\n async dispose(): Promise<void> {\n const pending = this.disposables;\n this.disposables = [];\n for (let i = pending.length - 1; i >= 0; i--) {\n try {\n await disposeInstance(pending[i]);\n } catch (error) {\n if (this.diagnostics !== 'silent') {\n console.error('Error disposing instance:', error);\n }\n }\n }\n this.requestInstances.clear();\n\n if (this.root === this) {\n // Drop cached singleton instances (except useValue, which the app owns)\n // so a rebuilt graph starts clean.\n for (const bucket of this.providers.values()) {\n for (const registration of bucket.values()) {\n if (registration.scope === Scope.SINGLETON && registration.useValue === undefined) {\n registration.instance = undefined;\n }\n }\n }\n }\n }\n\n private resolveRegistration<T>(\n registration: ProviderRegistration<T>,\n requestingModuleId?: string,\n ): T {\n if (registration.useValue !== undefined) {\n // Deliberately BEFORE the lazy claim: reading a lazy module's useValue\n // (options tokens) has no construction cost to defer and must not\n // materialize the group.\n return registration.useValue;\n }\n\n this.claimLazyModule(registration.declaringModuleId);\n\n if (registration.useExisting) {\n // Pass through the original requester to catch alias leaks\n return this.resolve(registration.useExisting, requestingModuleId);\n }\n\n // Effective scope accounts for request-scope bubbling: a SINGLETON that\n // (transitively) depends on a request-scoped provider is treated as REQUEST\n // so it is rebuilt per request instead of capturing the first one.\n const scope = registration.effectiveScope ?? registration.scope;\n\n // Singleton: return cached from registration (shared across all containers)\n if (scope === Scope.SINGLETON && registration.instance !== undefined) {\n return registration.instance;\n }\n\n // Request: return cached from this child's requestInstances\n if (scope === Scope.REQUEST) {\n const cached = this.requestInstances.get(registration.provide) as T | undefined;\n if (cached !== undefined) {\n return cached;\n }\n }\n\n if (this.resolutionStack.has(registration.provide)) {\n const chain = [...this.resolutionStack, registration.provide]\n .map((t) => this.tokenToString(t))\n .join(' -> ');\n throw new Error(`Circular dependency detected: ${chain}`);\n }\n\n this.resolutionStack.add(registration.provide);\n\n try {\n let instance: T;\n\n if (registration.useFactory) {\n // Factory inject deps resolve from the declaring module's scope first\n // (visibility-correct for forRootAsync), with the legacy no-requester\n // lookup kept as fallback — see resolveFactoryDependency.\n instance = this.resolveFactory(registration);\n } else if (registration.useClass) {\n instance = this.resolveClass(registration.useClass, registration.declaringModuleId);\n } else {\n throw new Error(\n `Invalid provider registration for: ${this.tokenToString(registration.provide)}`,\n );\n }\n\n if (scope === Scope.SINGLETON) {\n registration.instance = instance;\n // Track for disposal on the ROOT — a singleton outlives the request\n // child that may have first constructed it.\n if (isDisposable(instance)) this.root.disposables.push(instance);\n } else if (scope === Scope.REQUEST) {\n this.requestInstances.set(registration.provide, instance);\n if (isDisposable(instance)) this.disposables.push(instance);\n }\n\n return instance;\n } finally {\n this.resolutionStack.delete(registration.provide);\n }\n }\n\n private resolveClass<T>(target: Type<T>, ownerModuleId: string): T {\n const paramTypes = getConstructorDependencies(target);\n const injectMetadata = getInjectMetadata(target);\n const injectMap = new Map(injectMetadata.map((m) => [m.index, m]));\n\n // Constructor arity. Normally `design:paramtypes` (emitDecoratorMetadata)\n // gives the count, but some bundlers — notably esbuild (and therefore\n // Wrangler) — do not emit it, leaving `paramTypes` empty even when\n // `@Inject(token)` recorded explicit tokens. Fall back to the highest\n // `@Inject` index so explicit-token constructors still resolve without\n // emitted metadata. Slots with neither a param type nor an `@Inject` token\n // still hit the unresolved-dependency error below.\n const arity = Math.max(\n paramTypes.length,\n injectMetadata.reduce((max, m) => Math.max(max, m.index + 1), 0),\n );\n\n const dependencies = Array.from({ length: arity }, (_unused, index) => {\n const paramType = paramTypes[index];\n const meta = injectMap.get(index);\n const rawToken = meta?.token;\n const isForwardRef = rawToken instanceof ForwardRef;\n const token: Token | undefined = isForwardRef ? rawToken.factory() : (rawToken ?? paramType);\n\n if (!token || isErasedTypeToken(token)) {\n if (meta?.optional) return undefined;\n throw new Error(\n `Cannot resolve dependency at index ${index} for ${target.name}. ` +\n `Parameter type is undefined or Object. ` +\n IMPORT_TYPE_HINT +\n ` Alternatively, use \\`@Inject()\\` to specify the token explicitly.`,\n );\n }\n\n if (meta?.optional && !this.has(token)) {\n return undefined;\n }\n\n // forwardRef with circular dep — break the cycle with a lazy Proxy\n if (isForwardRef && this.resolutionStack.has(token)) {\n return this.createLazyProxy(token, ownerModuleId);\n }\n\n return this.resolve(token, ownerModuleId);\n });\n\n return new target(...dependencies);\n }\n\n /**\n * Resolve one factory `inject` dependency. Since 1.11 the declaring module's\n * scope is consulted FIRST (proper visibility semantics — a `forRootAsync`\n * factory can inject providers reachable through its module's imports); on\n * any failure the legacy no-requester lookup (root bucket, then first\n * exporter) is kept as fallback, so every previously-resolving graph still\n * resolves.\n */\n private resolveFactoryDependency(token: Token, declaringModuleId: string): unknown {\n if (declaringModuleId !== ROOT_MODULE_ID && this.scopes.has(declaringModuleId)) {\n try {\n return this.resolve(token, declaringModuleId);\n } catch {\n // Fall through to the legacy escape hatch below.\n }\n }\n return this.resolve(token);\n }\n\n private async resolveFactoryDependencyAsync(\n token: Token,\n declaringModuleId: string,\n ): Promise<unknown> {\n if (declaringModuleId !== ROOT_MODULE_ID && this.scopes.has(declaringModuleId)) {\n try {\n return await this.resolveAsync(token, declaringModuleId);\n } catch {\n // Fall through to the legacy escape hatch below.\n }\n }\n return this.resolveAsync(token);\n }\n\n private resolveFactory<T>(registration: ProviderRegistration<T>): T {\n if (!registration.useFactory) {\n throw new Error('Factory function is missing');\n }\n\n const dependencies = (registration.inject || []).map((token) => {\n const resolved = token instanceof ForwardRef ? token.factory() : token;\n return this.resolveFactoryDependency(resolved, registration.declaringModuleId);\n });\n const result = registration.useFactory(...dependencies);\n\n if (result instanceof Promise) {\n throw new Error(\n `Async factory for ${this.tokenToString(registration.provide)} returned a Promise. ` +\n `Use resolveAsync() for async providers.`,\n );\n }\n\n return result;\n }\n\n async resolveAsync<T>(token: Token<T>, requestingModuleId?: string): Promise<T> {\n const root = this.root;\n root.asyncDepth++;\n let result: T;\n try {\n result = await this.resolveAsyncInner<T>(token, requestingModuleId);\n } finally {\n root.asyncDepth--;\n }\n if (root.asyncDepth === 0 && root.lazyHook?.hasClaimed() && !root.lazyHook.isDraining()) {\n await root.lazyHook.drainAsync();\n }\n return result;\n }\n\n private async resolveAsyncInner<T>(token: Token<T>, requestingModuleId?: string): Promise<T> {\n const registration = this.findRegistration<T>(token, requestingModuleId);\n\n if (!registration) {\n if (\n requestingModuleId !== undefined &&\n this.scopes.has(requestingModuleId) &&\n this.exporterIndex.has(token)\n ) {\n throw new ModuleVisibilityError(requestingModuleId, token);\n }\n if (typeof token === 'function') {\n throw new Error(\n `No provider found for token: ${this.tokenToString(token)}. ` +\n `Declare it in a module's providers.`,\n );\n }\n if (token instanceof InjectionToken && token.options?.factory) {\n this.register({ provide: token, useFactory: token.options.factory });\n return this.resolveAsync(token, requestingModuleId);\n }\n throw new Error(`No provider found for token: ${this.tokenToString(token)}`);\n }\n\n if (registration.useFactory) {\n const scope = registration.effectiveScope ?? registration.scope;\n if (scope === Scope.SINGLETON && registration.instance !== undefined) {\n return registration.instance;\n }\n\n this.claimLazyModule(registration.declaringModuleId);\n\n // Module scope first, legacy no-requester fallback — same policy as the\n // sync resolveFactory path.\n const dependencies = await Promise.all(\n (registration.inject || []).map((t) => {\n const resolved = t instanceof ForwardRef ? t.factory() : t;\n return this.resolveFactoryDependencyAsync(resolved, registration.declaringModuleId);\n }),\n );\n\n const instance = await registration.useFactory(...dependencies);\n\n if (scope === Scope.SINGLETON) {\n registration.instance = instance;\n // Track for disposal on the ROOT, matching the sync resolveRegistration path.\n if (isDisposable(instance)) this.root.disposables.push(instance);\n }\n\n return instance;\n }\n\n return this.resolve(token, requestingModuleId);\n }\n\n private createLazyProxy(token: Token, requestingModuleId?: string): object {\n const container = this;\n const target: object = Object.create(null);\n return new Proxy(target, {\n get(_target, prop) {\n const instance = container.resolve<object>(token, requestingModuleId);\n // Annotate `unknown` to contain `Reflect.get`'s `any` return so the\n // typeof-narrows-to-Function guard below stays honest.\n const value: unknown = Reflect.get(instance, prop, instance);\n return typeof value === 'function' ? value.bind(instance) : value;\n },\n set(_target, prop, value) {\n const instance = container.resolve<object>(token, requestingModuleId);\n // `Reflect.set` returns whether the assignment succeeded — that's the\n // spec-correct Proxy `set` return, vs returning `true` unconditionally.\n return Reflect.set(instance, prop, value);\n },\n });\n }\n\n private tokenToString(token: Token): string {\n if (token instanceof InjectionToken) {\n return token.toString();\n }\n if (typeof token === 'function') {\n return token.name;\n }\n if (typeof token === 'symbol') {\n return token.toString();\n }\n return String(token);\n }\n}\n"],"mappings":";;AAMA,MAAM,gBAAqC,OAAqC;AAChF,MAAM,eAAoC,OAAgC;AAM1E,SAAS,SAAS,OAA0D;CAC1E,IAAI,UAAU,MAAM,OAAO,KAAA;CAC3B,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,aAChD,QACD,KAAA;AACN;AAEA,SAAgB,aAAa,OAAyB;CACpD,MAAM,MAAM,SAAS,KAAK;CAC1B,IAAI,CAAC,KAAK,OAAO;CACjB,IAAI,iBAAiB,OAAO,IAAI,mBAAmB,YAAY,OAAO;CACtE,IAAI,gBAAgB,OAAO,IAAI,kBAAkB,YAAY,OAAO;CACpE,OAAO,OAAO,IAAI,YAAY;AAChC;AAEA,eAAsB,gBAAgB,OAA+B;CACnE,MAAM,MAAM,SAAS,KAAK;CAC1B,IAAI,CAAC,KAAK;CACV,IAAI,iBAAiB,OAAO,IAAI,mBAAmB,YAAY;EAC7D,MAAO,IAAI,cAAc,CAAgC,KAAK,GAAG;EACjE;CACF;CACA,IAAI,gBAAgB,OAAO,IAAI,kBAAkB,YAAY;EAC3D,IAAK,aAAa,CAAgB,KAAK,GAAG;EAC1C;CACF;CACA,IAAI,OAAO,IAAI,YAAY,YACzB,MAAO,IAAI,QAAuC,KAAK,GAAG;AAE9D;;;;;;;;ACJA,SAAS,kBAAkB,OAAyB;CAClD,OAAO,UAAU,UAAU,SAAS;AACtC;;;;;;;;;;AAWA,IAAa,YAAb,MAAa,UAAU;CACrB,4BAAoB,IAAI,IAA8C;CACtE,gCAAwB,IAAI,IAAwB;CACpD,kCAA0B,IAAI,IAAW;CACzC,mCAA2B,IAAI,IAAoB;CACnD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kBAAkB;CAC/C;CAEA,gBAAwB,OAAc,oBAAqC;EACzE,MAAM,YAAY;EAElB,OAAO,IAAI,MADY,OAAO,OAAO,IACf,GAAG;GACvB,IAAI,SAAS,MAAM;IACjB,MAAM,WAAW,UAAU,QAAgB,OAAO,kBAAkB;IAGpE,MAAM,QAAiB,QAAQ,IAAI,UAAU,MAAM,QAAQ;IAC3D,OAAO,OAAO,UAAU,aAAa,MAAM,KAAK,QAAQ,IAAI;GAC9D;GACA,IAAI,SAAS,MAAM,OAAO;IACxB,MAAM,WAAW,UAAU,QAAgB,OAAO,kBAAkB;IAGpE,OAAO,QAAQ,IAAI,UAAU,MAAM,KAAK;GAC1C;EACF,CAAC;CACH;CAEA,cAAsB,OAAsB;EAC1C,IAAI,iBAAiB,gBACnB,OAAO,MAAM,SAAS;EAExB,IAAI,OAAO,UAAU,YACnB,OAAO,MAAM;EAEf,IAAI,OAAO,UAAU,UACnB,OAAO,MAAM,SAAS;EAExB,OAAO,OAAO,KAAK;CACrB;AACF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { a as Injectable, i as Inject, n as __decorateParam, r as __decorateMetadata, t as __decorate } from "./decorate-GcSMAbKn.js";
|
|
2
|
+
import { t as DiscoveryService } from "./discovery.service-BYm95SSD.js";
|
|
3
|
+
//#region src/schedule/schedule.tokens.ts
|
|
4
|
+
const CRON_METADATA = "vela:cron";
|
|
5
|
+
const INTERVAL_METADATA = "vela:interval";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/schedule/schedule.registry.ts
|
|
8
|
+
let ScheduleRegistry = class ScheduleRegistry {
|
|
9
|
+
discovery;
|
|
10
|
+
cronJobs = [];
|
|
11
|
+
intervalJobs = [];
|
|
12
|
+
constructor(discovery) {
|
|
13
|
+
this.discovery = discovery;
|
|
14
|
+
}
|
|
15
|
+
onApplicationBootstrap() {
|
|
16
|
+
for (const found of this.discovery.methodsWithMeta(CRON_METADATA)) {
|
|
17
|
+
if (!found.class.instance) continue;
|
|
18
|
+
this.cronJobs.push({
|
|
19
|
+
expression: found.meta.expression,
|
|
20
|
+
methodName: String(found.methodName),
|
|
21
|
+
instance: found.class.instance,
|
|
22
|
+
target: found.class.metatype
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
for (const found of this.discovery.methodsWithMeta(INTERVAL_METADATA)) {
|
|
26
|
+
if (!found.class.instance) continue;
|
|
27
|
+
this.intervalJobs.push({
|
|
28
|
+
ms: found.meta.ms,
|
|
29
|
+
methodName: String(found.methodName),
|
|
30
|
+
instance: found.class.instance,
|
|
31
|
+
target: found.class.metatype
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
getCronJobs() {
|
|
36
|
+
return [...this.cronJobs];
|
|
37
|
+
}
|
|
38
|
+
getIntervalJobs() {
|
|
39
|
+
return [...this.intervalJobs];
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
ScheduleRegistry = __decorate([
|
|
43
|
+
Injectable(),
|
|
44
|
+
__decorateParam(0, Inject(DiscoveryService)),
|
|
45
|
+
__decorateMetadata("design:paramtypes", [typeof DiscoveryService === "undefined" ? Object : DiscoveryService])
|
|
46
|
+
], ScheduleRegistry);
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/schedule/cron-matcher.ts
|
|
49
|
+
function parseCron(expression) {
|
|
50
|
+
const fields = expression.trim().split(/\s+/);
|
|
51
|
+
if (fields.length !== 5) return null;
|
|
52
|
+
const [minuteField, hourField, dayField, monthField, weekdayField] = fields;
|
|
53
|
+
const minute = parseField(minuteField, 0, 59);
|
|
54
|
+
const hour = parseField(hourField, 0, 23);
|
|
55
|
+
const day = parseField(dayField, 1, 31);
|
|
56
|
+
const month = parseField(monthField, 1, 12);
|
|
57
|
+
const weekday = parseField(weekdayField, 0, 7);
|
|
58
|
+
if (!minute || !hour || !day || !month || !weekday) return null;
|
|
59
|
+
return (date) => minute(date.getMinutes()) && hour(date.getHours()) && day(date.getDate()) && month(date.getMonth() + 1) && weekday(date.getDay());
|
|
60
|
+
}
|
|
61
|
+
function parseField(field, min, max) {
|
|
62
|
+
const segments = field.split(",");
|
|
63
|
+
const predicates = [];
|
|
64
|
+
for (const rawSegment of segments) {
|
|
65
|
+
const segment = rawSegment.trim();
|
|
66
|
+
if (!segment) return null;
|
|
67
|
+
const stepParts = segment.split("/");
|
|
68
|
+
if (stepParts.length > 2) return null;
|
|
69
|
+
const step = stepParts.length === 2 ? Number(stepParts[1]) : 1;
|
|
70
|
+
if (!Number.isInteger(step) || step <= 0) return null;
|
|
71
|
+
const range = parseRange(stepParts[0], min, max);
|
|
72
|
+
if (!range) return null;
|
|
73
|
+
predicates.push((value) => {
|
|
74
|
+
if (value < range.start || value > range.end) return false;
|
|
75
|
+
return (value - range.start) % step === 0;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return (value) => predicates.some((p) => p(value));
|
|
79
|
+
}
|
|
80
|
+
function parseRange(segment, min, max) {
|
|
81
|
+
if (segment === "*") return {
|
|
82
|
+
start: min,
|
|
83
|
+
end: max
|
|
84
|
+
};
|
|
85
|
+
const bounds = segment.split("-");
|
|
86
|
+
if (bounds.length === 1) {
|
|
87
|
+
const value = parseCronNumber(bounds[0], min, max);
|
|
88
|
+
if (value === null) return null;
|
|
89
|
+
return {
|
|
90
|
+
start: value,
|
|
91
|
+
end: value
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (bounds.length !== 2) return null;
|
|
95
|
+
const start = parseCronNumber(bounds[0], min, max);
|
|
96
|
+
const end = parseCronNumber(bounds[1], min, max);
|
|
97
|
+
if (start === null || end === null || start > end) return null;
|
|
98
|
+
return {
|
|
99
|
+
start,
|
|
100
|
+
end
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function parseCronNumber(raw, min, max) {
|
|
104
|
+
const value = Number(raw);
|
|
105
|
+
if (!Number.isInteger(value)) return null;
|
|
106
|
+
const normalized = max === 7 && value === 7 ? 0 : value;
|
|
107
|
+
if (normalized < min || normalized > max) return null;
|
|
108
|
+
return normalized;
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { INTERVAL_METADATA as i, ScheduleRegistry as n, CRON_METADATA as r, parseCron as t };
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=cron-matcher-C9qv5OUA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron-matcher-C9qv5OUA.js","names":[],"sources":["../src/schedule/schedule.tokens.ts","../src/schedule/schedule.registry.ts","../src/schedule/cron-matcher.ts"],"sourcesContent":["export const CRON_METADATA = 'vela:cron';\nexport const INTERVAL_METADATA = 'vela:interval';\n","import { Injectable, Inject } from '../container/index';\nimport { DiscoveryService } from '../discovery/discovery.service';\nimport type { OnApplicationBootstrap } from '../lifecycle/index';\nimport { CRON_METADATA, INTERVAL_METADATA } from './schedule.tokens';\nimport type { CronMetadata, IntervalMetadata } from './schedule.types';\n\nexport interface RegisteredCronJob {\n expression: string;\n methodName: string;\n instance: unknown;\n target: Function;\n}\n\nexport interface RegisteredIntervalJob {\n ms: number;\n methodName: string;\n instance: unknown;\n target: Function;\n}\n\n@Injectable()\nexport class ScheduleRegistry implements OnApplicationBootstrap {\n private cronJobs: RegisteredCronJob[] = [];\n private intervalJobs: RegisteredIntervalJob[] = [];\n\n constructor(@Inject(DiscoveryService) private readonly discovery: DiscoveryService) {}\n\n onApplicationBootstrap(): void {\n for (const found of this.discovery.methodsWithMeta<CronMetadata>(CRON_METADATA)) {\n if (!found.class.instance) continue;\n this.cronJobs.push({\n expression: found.meta.expression,\n methodName: String(found.methodName),\n instance: found.class.instance,\n target: found.class.metatype,\n });\n }\n\n for (const found of this.discovery.methodsWithMeta<IntervalMetadata>(INTERVAL_METADATA)) {\n if (!found.class.instance) continue;\n this.intervalJobs.push({\n ms: found.meta.ms,\n methodName: String(found.methodName),\n instance: found.class.instance,\n target: found.class.metatype,\n });\n }\n }\n\n getCronJobs(): RegisteredCronJob[] {\n return [...this.cronJobs];\n }\n\n getIntervalJobs(): RegisteredIntervalJob[] {\n return [...this.intervalJobs];\n }\n}\n","export type CronMatcher = (date: Date) => boolean;\n\nexport function parseCron(expression: string): CronMatcher | null {\n const fields = expression.trim().split(/\\s+/);\n if (fields.length !== 5) return null;\n\n const [minuteField, hourField, dayField, monthField, weekdayField] = fields as [\n string,\n string,\n string,\n string,\n string,\n ];\n\n const minute = parseField(minuteField, 0, 59);\n const hour = parseField(hourField, 0, 23);\n const day = parseField(dayField, 1, 31);\n const month = parseField(monthField, 1, 12);\n const weekday = parseField(weekdayField, 0, 7);\n\n if (!minute || !hour || !day || !month || !weekday) return null;\n\n return (date: Date) =>\n minute(date.getMinutes()) &&\n hour(date.getHours()) &&\n day(date.getDate()) &&\n month(date.getMonth() + 1) &&\n weekday(date.getDay());\n}\n\nfunction parseField(field: string, min: number, max: number): ((value: number) => boolean) | null {\n const segments = field.split(',');\n const predicates: Array<(value: number) => boolean> = [];\n\n for (const rawSegment of segments) {\n const segment = rawSegment.trim();\n if (!segment) return null;\n\n const stepParts = segment.split('/');\n if (stepParts.length > 2) return null;\n\n const step = stepParts.length === 2 ? Number(stepParts[1]!) : 1;\n if (!Number.isInteger(step) || step <= 0) return null;\n\n const range = parseRange(stepParts[0]!, min, max);\n if (!range) return null;\n\n predicates.push((value) => {\n if (value < range.start || value > range.end) return false;\n return (value - range.start) % step === 0;\n });\n }\n\n return (value) => predicates.some((p) => p(value));\n}\n\nfunction parseRange(\n segment: string,\n min: number,\n max: number,\n): { start: number; end: number } | null {\n if (segment === '*') return { start: min, end: max };\n\n const bounds = segment.split('-');\n if (bounds.length === 1) {\n const value = parseCronNumber(bounds[0]!, min, max);\n if (value === null) return null;\n return { start: value, end: value };\n }\n\n if (bounds.length !== 2) return null;\n const start = parseCronNumber(bounds[0]!, min, max);\n const end = parseCronNumber(bounds[1]!, min, max);\n if (start === null || end === null || start > end) return null;\n return { start, end };\n}\n\nfunction parseCronNumber(raw: string, min: number, max: number): number | null {\n const value = Number(raw);\n if (!Number.isInteger(value)) return null;\n\n // Cron allows 0 and 7 as Sunday.\n const normalized = max === 7 && value === 7 ? 0 : value;\n if (normalized < min || normalized > max) return null;\n return normalized;\n}\n"],"mappings":";;;AAAA,MAAa,gBAAgB;AAC7B,MAAa,oBAAoB;;;ACoB1B,IAAA,mBAAA,MAAM,iBAAmD;CAIP;CAHvD,WAAwC,CAAC;CACzC,eAAgD,CAAC;CAEjD,YAAY,WAAwE;EAA7B,KAAA,YAAA;CAA8B;CAErF,yBAA+B;EAC7B,KAAK,MAAM,SAAS,KAAK,UAAU,gBAA8B,aAAa,GAAG;GAC/E,IAAI,CAAC,MAAM,MAAM,UAAU;GAC3B,KAAK,SAAS,KAAK;IACjB,YAAY,MAAM,KAAK;IACvB,YAAY,OAAO,MAAM,UAAU;IACnC,UAAU,MAAM,MAAM;IACtB,QAAQ,MAAM,MAAM;GACtB,CAAC;EACH;EAEA,KAAK,MAAM,SAAS,KAAK,UAAU,gBAAkC,iBAAiB,GAAG;GACvF,IAAI,CAAC,MAAM,MAAM,UAAU;GAC3B,KAAK,aAAa,KAAK;IACrB,IAAI,MAAM,KAAK;IACf,YAAY,OAAO,MAAM,UAAU;IACnC,UAAU,MAAM,MAAM;IACtB,QAAQ,MAAM,MAAM;GACtB,CAAC;EACH;CACF;CAEA,cAAmC;EACjC,OAAO,CAAC,GAAG,KAAK,QAAQ;CAC1B;CAEA,kBAA2C;EACzC,OAAO,CAAC,GAAG,KAAK,YAAY;CAC9B;AACF;;CApCC,WAAW;oBAKG,OAAO,gBAAgB,CAAA;;;;;ACvBtC,SAAgB,UAAU,YAAwC;CAChE,MAAM,SAAS,WAAW,KAAK,CAAC,CAAC,MAAM,KAAK;CAC5C,IAAI,OAAO,WAAW,GAAG,OAAO;CAEhC,MAAM,CAAC,aAAa,WAAW,UAAU,YAAY,gBAAgB;CAQrE,MAAM,SAAS,WAAW,aAAa,GAAG,EAAE;CAC5C,MAAM,OAAO,WAAW,WAAW,GAAG,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