@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["encodeListDelta","DEFAULT_KEY_FIELD","isClientLiveFrame","LIVE_PROTOCOL","LIVE_ERROR_CODES","encodeLiveEnvelope","COMMIT_CURSOR_HEADER","COMMIT_EPOCH_HEADER"],"sources":["../../src/live/live.cursor.ts","../../src/live/live.tokens.ts","../../src/live/live.decorators.ts","../../src/live/live.delta.ts","../../src/live/presence.ts","../../src/live/live.engine.ts","../../src/live/live.invalidation.ts","../../src/live/live.module.ts"],"sourcesContent":["import type { CommitStamp, CursorLog, ResumeVerdict } from './live.types';\n\ninterface LogEntry {\n seq: number;\n tags: string[];\n}\n\nconst intersects = (a: readonly string[], b: ReadonlySet<string>): boolean =>\n a.some((tag) => b.has(tag));\n\n/**\n * The in-core `CursorLog`: a bounded in-memory ring, epoch minted per process\n * (Web Crypto). A restart rolls the epoch, so every reconnecting client falls\n * back to snapshot — exactly the documented node/dev semantics. Within one\n * process lifetime resume works for gaps the ring still covers; a trimmed gap\n * degrades to snapshot (mirrors lunora's CDC retention rule,\n * `ctx-db-cdc.ts` — retention gap → snapshot).\n *\n * The Cloudflare transport replaces this with a Durable-Object SQLite log so\n * resume survives hibernation and eviction.\n */\nexport class InMemoryCursorLog implements CursorLog {\n private readonly epoch = crypto.randomUUID();\n private readonly entries: LogEntry[] = [];\n private seq = 0;\n\n constructor(private readonly maxEntries = 1024) {}\n\n append(tags: string[]): CommitStamp {\n this.seq += 1;\n this.entries.push({ seq: this.seq, tags });\n if (this.entries.length > this.maxEntries) {\n this.entries.splice(0, this.entries.length - this.maxEntries);\n }\n return { cursor: this.seq, epoch: this.epoch };\n }\n\n current(): CommitStamp {\n return { cursor: this.seq, epoch: this.epoch };\n }\n\n evaluateResume(\n sinceCursor: number,\n sinceEpoch: string,\n subscriptionTags: string[],\n ): ResumeVerdict {\n // Forked timeline (restart/reset) — the client's cursor means nothing here.\n if (sinceEpoch !== this.epoch) return 'snapshot';\n // Rollback guard: a cursor from the future is unexplainable.\n if (sinceCursor > this.seq) return 'snapshot';\n if (sinceCursor === this.seq) return 'resume';\n // Retention: the ring must still cover (sinceCursor, seq].\n const oldest = this.entries[0];\n if (oldest === undefined || oldest.seq > sinceCursor + 1) return 'snapshot';\n\n const subTags = new Set(subscriptionTags);\n for (const entry of this.entries) {\n if (entry.seq <= sinceCursor) continue;\n if (intersects(entry.tags, subTags)) return 'rerun';\n }\n return 'resume';\n }\n}\n","import { InjectionToken } from '../index';\nimport type { CursorLog, LiveDriver, LiveModuleOptions } from './live.types';\n\n// Free-form metadata keys — same string-token convention as the queue module.\nexport const LIVE_RESOLVER_METADATA = 'vela:live:resolver';\nexport const LIVE_QUERY_METADATA = 'vela:live:query';\n\n/** The invalidation driver in effect for a `LiveModule` instance (`localLive()` by default). */\nexport const LIVE_DRIVER = new InjectionToken<LiveDriver>('vela:live:driver');\n\n/** The ordered tag-invalidation log backing cursors/epochs for this log scope. */\nexport const LIVE_CURSOR_LOG = new InjectionToken<CursorLog>('vela:live:cursor-log');\n\n// forRoot() options carrier.\nexport const LIVE_MODULE_OPTIONS = new InjectionToken<LiveModuleOptions>('LIVE_MODULE_OPTIONS');\n","import { createDiscoverableDecorator, defineMetadata, getMetadata } from '../index';\nimport { LIVE_QUERY_METADATA, LIVE_RESOLVER_METADATA } from './live.tokens';\nimport type { LiveQueryMetadata, LiveQueryOptions, LiveResolverMetadata } from './live.types';\n\nconst LiveResolverMeta = createDiscoverableDecorator<LiveResolverMetadata>(LIVE_RESOLVER_METADATA);\n\n/**\n * Marks a provider class as a live-query resolver:\n *\n * ```ts\n * @LiveResolver()\n * @Injectable()\n * class TodoLive {\n * constructor(private readonly todos: TodoService) {}\n *\n * @LiveQuery('todos.list', { tags: (a: { listId: string }) => [`todos:${a.listId}`] })\n * list(args: { listId: string }, ctx: LiveQueryContext) {\n * return this.todos.byList(args.listId, ctx.identity?.userId);\n * }\n * }\n * ```\n *\n * Clients subscribe by query name over the `$live` reserved event; the engine\n * re-runs a handler whenever one of its tags is invalidated and pushes the\n * result (as a keyed delta when possible). Stack with `@Injectable()`, exactly\n * like `@Processor`.\n */\nexport function LiveResolver(): ClassDecorator {\n return LiveResolverMeta({}) as ClassDecorator;\n}\n\n/**\n * Declares a live query on a resolver method. The handler receives\n * `(args, ctx: LiveQueryContext)` positionally — args are validated once at\n * subscribe (via `options.parse`), then replayed verbatim into every re-run\n * under the subscriber's captured identity.\n */\nexport function LiveQuery<A = unknown>(\n name: string,\n options: LiveQueryOptions<A>,\n): MethodDecorator {\n return (target: object, propertyKey: string | symbol) => {\n const ctor = target.constructor;\n const existing =\n (getMetadata(LIVE_QUERY_METADATA, ctor) as LiveQueryMetadata[] | undefined) ?? [];\n existing.push({ name, methodName: propertyKey, options: options as LiveQueryOptions });\n defineMetadata(LIVE_QUERY_METADATA, existing, ctor);\n };\n}\n\n/** `@LiveQuery` entries declared on a resolver class (declaration order). */\nexport function getLiveQueries(resolverClass: object): LiveQueryMetadata[] {\n return (getMetadata(LIVE_QUERY_METADATA, resolverClass) as LiveQueryMetadata[] | undefined) ?? [];\n}\n","import { DEFAULT_KEY_FIELD, encodeListDelta } from '@velajs/live-protocol';\nimport type { ServerLiveFrame } from '@velajs/live-protocol';\nimport type { CommitStamp, SubscriptionRecord } from './live.types';\n\n/**\n * Decide what one re-run puts on the wire — pure, so the contract is\n * unit-testable without sockets:\n *\n * - byte-identical to the baseline → `settled` (cursor still advances; this\n * is what drops client optimistic layers for writes that didn't change the\n * result);\n * - baseline exists and the shared codec can diff → `delta` (batched keyed\n * row ops);\n * - otherwise (first send after subscribe/resume, codec bailed, unparseable\n * baseline) → full `data` snapshot.\n */\nexport function encodeSubscriptionUpdate(\n record: SubscriptionRecord,\n json: string,\n result: unknown,\n stamp: CommitStamp,\n initial: boolean,\n): ServerLiveFrame {\n const settled: ServerLiveFrame = {\n t: 'settled',\n sub: record.sub,\n cursor: stamp.cursor,\n epoch: stamp.epoch,\n };\n\n if (!initial && record.lastJson !== undefined) {\n if (record.lastJson === json) return settled;\n\n let previous: unknown;\n let parsed = false;\n try {\n previous = JSON.parse(record.lastJson);\n parsed = true;\n } catch {\n // Unparseable baseline — fall through to a snapshot.\n }\n if (parsed) {\n const ops = encodeListDelta(previous, result, record.key ?? DEFAULT_KEY_FIELD);\n if (ops !== undefined && ops.length > 0) {\n return { t: 'delta', sub: record.sub, ops, cursor: stamp.cursor, epoch: stamp.epoch };\n }\n if (ops !== undefined) return settled;\n }\n }\n\n return { t: 'data', sub: record.sub, snapshot: result, cursor: stamp.cursor, epoch: stamp.epoch };\n}\n","import { Inject, Injectable } from '../index';\nimport { LiveQuery, LiveResolver } from './live.decorators';\n\n/** The invalidation tag for one room's roster. `$`-prefixed: never collides with app tags. */\nexport const presenceTag = (room: string): string => `$presence:${room}`;\n\n/** The built-in roster query name (`useLiveQuery`-able like any app query). */\nexport const PRESENCE_ROSTER_QUERY = '$presence.roster';\n\n/** One present connection as returned by the roster query. Keyed by `id` so list deltas apply. */\nexport interface PresenceMember {\n /** The connection id that heartbeats this membership. */\n id: string;\n meta?: unknown;\n lastSeen: number;\n}\n\ninterface RoomState {\n members: Map<string, { meta?: unknown; lastSeen: number }>;\n}\n\n/**\n * The presence preset's server half. Heartbeats arrive as `{ t: 'presence' }`\n * frames on the live socket (routed here by the engine); the roster is a\n * built-in live query invalidated per room. Departure is immediate: the WS\n * close hook reaps the member without waiting out the TTL. Staleness (an\n * ungraceful drop the transport never noticed) is filtered AT READ TIME —\n * no timers, per the edge rules (`setInterval` is forbidden).\n *\n * Scope note: the roster lives in this log scope (one process on node, one\n * room-DO on Cloudflare — where it is exactly the room's roster).\n */\nexport class PresenceService {\n private readonly rooms = new Map<string, RoomState>();\n private readonly roomsByClient = new Map<string, Set<string>>();\n private invalidator?: (tags: string[]) => void;\n\n constructor(\n private readonly ttlMs = 30_000,\n readonly enabled = true,\n ) {}\n\n /** Wired by the engine so beats/reaps invalidate through the live driver. */\n bindInvalidator(invalidator: (tags: string[]) => void): void {\n this.invalidator = invalidator;\n }\n\n beat(room: string, clientId: string, meta?: unknown): void {\n if (!this.enabled) return;\n let state = this.rooms.get(room);\n if (!state) {\n state = { members: new Map() };\n this.rooms.set(room, state);\n }\n state.members.set(clientId, { meta, lastSeen: Date.now() });\n\n let joined = this.roomsByClient.get(clientId);\n if (!joined) {\n joined = new Set();\n this.roomsByClient.set(clientId, joined);\n }\n joined.add(room);\n\n this.invalidator?.([presenceTag(room)]);\n }\n\n /** Immediate departure on socket close — peers see it without a TTL wait. */\n reap(clientId: string): void {\n const joined = this.roomsByClient.get(clientId);\n if (!joined) return;\n this.roomsByClient.delete(clientId);\n for (const room of joined) {\n const state = this.rooms.get(room);\n if (!state) continue;\n state.members.delete(clientId);\n if (state.members.size === 0) this.rooms.delete(room);\n this.invalidator?.([presenceTag(room)]);\n }\n }\n\n roster(room: string): PresenceMember[] {\n const state = this.rooms.get(room);\n if (!state) return [];\n const oldestAlive = Date.now() - this.ttlMs;\n return [...state.members.entries()]\n .filter(([, member]) => member.lastSeen >= oldestAlive)\n .map(([id, member]) => ({ id, meta: member.meta, lastSeen: member.lastSeen }));\n }\n}\n\n/** The built-in resolver backing `$presence.roster`. Registered by `LiveModule` unless presence is disabled. */\n@LiveResolver()\n@Injectable()\nexport class PresenceResolver {\n constructor(@Inject(PresenceService) private readonly presence: PresenceService) {}\n\n @LiveQuery(PRESENCE_ROSTER_QUERY, {\n tags: (args: { room: string }) => [presenceTag(args.room)],\n parse: (args: unknown) => {\n const room = (args as { room?: unknown } | undefined)?.room;\n if (typeof room !== 'string' || room.length === 0) {\n throw new Error(\"presence roster args require a non-empty 'room' string\");\n }\n return { room };\n },\n })\n roster(args: { room: string }): PresenceMember[] {\n return this.presence.roster(args.room);\n }\n}\n","import {\n LIVE_ERROR_CODES,\n LIVE_PROTOCOL,\n encodeLiveEnvelope,\n isClientLiveFrame,\n} from '@velajs/live-protocol';\nimport type { ClientLiveFrame, LiveErrorCode, ServerLiveFrame } from '@velajs/live-protocol';\nimport {\n Container,\n DiscoveryService,\n Inject,\n Injectable,\n Optional,\n PipelineRunner,\n ReservedWsEvent,\n buildEntrypointExecutionContext,\n isVelaError,\n resolveErrorReporter,\n resolveScopedComponents,\n runInEntrypointScope,\n toErrorBody,\n} from '../index';\nimport type {\n ContributesEntrypoints,\n Entrypoint,\n OnApplicationBootstrap,\n ReservedWsEventHandler,\n Token,\n Type,\n WsClient,\n WsMessage,\n} from '../index';\nimport { getLiveQueries } from './live.decorators';\nimport { encodeSubscriptionUpdate } from './live.delta';\nimport {\n LIVE_CURSOR_LOG,\n LIVE_DRIVER,\n LIVE_MODULE_OPTIONS,\n LIVE_RESOLVER_METADATA,\n} from './live.tokens';\nimport type {\n CommitStamp,\n CursorLog,\n InvalidationCommand,\n LiveDriver,\n LiveEntrypointMeta,\n LiveIdentity,\n LiveInvalidationSink,\n LiveModuleOptions,\n LiveQueryContext,\n LiveQueryOptions,\n LiveResolverMetadata,\n SubscriptionRecord,\n} from './live.types';\nimport { PresenceService } from './presence';\n\n/** How many subscriptions refresh concurrently per flush (lunora's socket-pool default). */\nconst REFRESH_POOL_SIZE = 8;\n\ninterface RegisteredQuery {\n token: Type;\n methodName: string | symbol;\n options: LiveQueryOptions;\n}\n\ninterface ConnectionEntry {\n client: WsClient;\n path: string;\n subs: Map<string, SubscriptionRecord>;\n}\n\n/**\n * Where the engine persists a connection's subscription records inside\n * `client.data` (committed through `WsClient.commit()`). On Cloudflare that\n * lands in the hibernation attachment, so subscriptions survive DO eviction;\n * the transport replays them via `restoreSubscription` on wake. On node,\n * `commit()` is a no-op and this is just in-memory bookkeeping.\n */\nexport const LIVE_SUBS_DATA_KEY = '__velaLiveSubs';\n\n/** Read the subscription records a transport persisted for a connection (wake/restore path). */\nexport function readPersistedLiveSubscriptions(client: WsClient): SubscriptionRecord[] {\n const raw = (client.data as Record<string, unknown> | undefined)?.[LIVE_SUBS_DATA_KEY];\n if (!Array.isArray(raw)) return [];\n return raw.filter(\n (record): record is SubscriptionRecord =>\n typeof record === 'object' &&\n record !== null &&\n typeof (record as SubscriptionRecord).sub === 'string' &&\n typeof (record as SubscriptionRecord).query === 'string' &&\n Array.isArray((record as SubscriptionRecord).tags),\n );\n}\n\nconst defaultIdentity = (client: WsClient): LiveIdentity | undefined => {\n const data = client.data as Record<string, unknown> | undefined;\n if (!data || Object.keys(data).length === 0) return undefined;\n return { ...data } as LiveIdentity;\n};\n\nasync function runPool<T>(\n items: T[],\n size: number,\n run: (item: T) => Promise<void>,\n): Promise<void> {\n const queue = [...items];\n const workers = Array.from({ length: Math.min(size, queue.length) }, async () => {\n for (let item = queue.shift(); item !== undefined; item = queue.shift()) {\n await run(item);\n }\n });\n await Promise.all(workers);\n}\n\n/**\n * The live-query engine of ONE log scope: routes `$live` frames (subscribe /\n * unsubscribe / presence), owns the subscription registry, and turns tag\n * invalidations into re-run → diff → push cycles.\n *\n * Delivery semantics (ported from lunora's `shard-do.ts` refresh loop):\n * - **Coalescing**: a burst of invalidations collapses into one flush; every\n * committed invalidation is observed by a flush that STARTS after it\n * committed (`applyInvalidation` appends to the log before arming the\n * drain, and the drain re-loops while tags are pending).\n * - **At-least-once**: a subscription's diff baseline (`lastJson`) advances\n * only when the frame left the socket; keyed deltas are idempotent on\n * replay.\n * - **Frame suppression**: a byte-identical re-run sends `settled` — no\n * payload, but the cursor still advances so client optimistic layers drop.\n * - **Outbound expiry**: a subscription whose captured identity lapsed is\n * dropped (socket closed) before it receives another scoped push.\n * - **Cursor-before-run**: the stamp a frame carries is read BEFORE the\n * re-run, so a result can only be NEWER than its cursor claims — an\n * invalidation racing the run is re-observed by the next flush, never lost.\n *\n * Transports reach the engine via `app.entrypoints.ofKind('live')` (it\n * contributes itself) — the same contract the WebSocket triad uses.\n */\n@ReservedWsEvent('$live')\n@Injectable()\nexport class LiveEngine\n implements\n OnApplicationBootstrap,\n ContributesEntrypoints,\n ReservedWsEventHandler,\n LiveInvalidationSink\n{\n private readonly queries = new Map<string, RegisteredQuery>();\n private readonly connections = new Map<string, ConnectionEntry>();\n private readonly pendingTags = new Set<string>();\n private drainChain: Promise<void> = Promise.resolve();\n private draining = false;\n\n constructor(\n @Inject(Container) private readonly container: Container,\n @Inject(DiscoveryService) private readonly discovery: DiscoveryService,\n @Inject(LIVE_CURSOR_LOG) private readonly log: CursorLog,\n @Inject(LIVE_DRIVER) driver: LiveDriver,\n @Inject(LIVE_MODULE_OPTIONS) private readonly options: LiveModuleOptions,\n @Optional() @Inject(PresenceService) private readonly presence?: PresenceService,\n ) {\n driver.bind(this);\n this.presence?.bindInvalidator((tags) => {\n void driver.dispatch({ tags });\n });\n }\n\n async onApplicationBootstrap(): Promise<void> {\n for (const found of this.discovery.providersWithMeta<LiveResolverMetadata>(\n LIVE_RESOLVER_METADATA,\n )) {\n if (!found.instance) continue;\n for (const declared of getLiveQueries(found.metatype)) {\n if (this.queries.has(declared.name)) {\n const msg =\n `[vela] duplicate @LiveQuery('${declared.name}') ` +\n `(${found.metatype.name}); keeping the first.`;\n if (this.container.getDiagnostics() === 'throw') throw new Error(msg);\n console.warn(msg);\n continue;\n }\n this.queries.set(declared.name, {\n token: found.metatype,\n methodName: declared.methodName,\n options: declared.options,\n });\n }\n }\n }\n\n /** The `'live'` entrypoint — how transports (node registrar, CF DO bootstrap) find the engine. */\n collectEntrypoints(): Entrypoint<LiveEntrypointMeta>[] {\n return [\n {\n kind: 'live',\n token: LiveEngine as unknown as Token,\n instance: this,\n meta: { engine: this },\n },\n ];\n }\n\n // ---- ReservedWsEventHandler ----\n\n async handleReservedEvent(path: string, client: WsClient, message: WsMessage): Promise<void> {\n const frame = message.data;\n // Forward-compat: unknown frame shapes are ignored, not errors.\n if (!isClientLiveFrame(frame)) return;\n\n switch (frame.t) {\n case 'sub':\n await this.onSubscribe(path, client, frame);\n return;\n case 'unsub': {\n const conn = this.connections.get(client.id);\n if (!conn) return;\n conn.subs.delete(frame.sub);\n if (conn.subs.size === 0) this.connections.delete(client.id);\n await this.persistSubscriptions(conn);\n return;\n }\n case 'presence':\n if (this.presence?.enabled) {\n this.presence.beat(frame.room, client.id, frame.meta);\n }\n return;\n }\n }\n\n async handleSocketClose(_path: string, client: WsClient): Promise<void> {\n this.connections.delete(client.id);\n this.presence?.reap(client.id);\n }\n\n // ---- LiveInvalidationSink ----\n\n async applyInvalidation(cmd: InvalidationCommand): Promise<CommitStamp> {\n const stamp = await this.log.append(cmd.tags);\n for (const tag of cmd.tags) this.pendingTags.add(tag);\n this.scheduleDrain();\n return stamp;\n }\n\n /** Settles when every pending invalidation has been flushed (tests, graceful transports). */\n async whenIdle(): Promise<void> {\n do {\n await this.drainChain;\n } while (this.draining || this.pendingTags.size > 0);\n }\n\n /**\n * Re-attach a persisted subscription without the subscribe handshake — the\n * Cloudflare transport replays hibernation-attachment records through this\n * on wake. No frames are sent; the next relevant invalidation pushes.\n */\n restoreSubscription(path: string, client: WsClient, record: SubscriptionRecord): void {\n this.ensureConnection(path, client).subs.set(record.sub, record);\n }\n\n // ---- subscribe path ----\n\n private async onSubscribe(\n path: string,\n client: WsClient,\n frame: Extract<ClientLiveFrame, { t: 'sub' }>,\n ): Promise<void> {\n if (frame.v !== undefined && frame.v > LIVE_PROTOCOL) {\n this.sendFrame(client, {\n t: 'error',\n sub: frame.sub,\n code: LIVE_ERROR_CODES.UNSUPPORTED_PROTOCOL,\n message: `server speaks live protocol v${LIVE_PROTOCOL}, client asked for v${frame.v}`,\n fatal: true,\n });\n return;\n }\n\n const conn = this.ensureConnection(path, client);\n if (conn.subs.has(frame.sub)) {\n this.sendFrame(client, {\n t: 'error',\n sub: frame.sub,\n code: LIVE_ERROR_CODES.DUPLICATE_SUB,\n message: `subscription id '${frame.sub}' is already active on this socket`,\n fatal: false,\n });\n return;\n }\n\n const registered = this.queries.get(frame.query);\n if (!registered) {\n this.sendFrame(client, {\n t: 'error',\n sub: frame.sub,\n code: LIVE_ERROR_CODES.UNKNOWN_QUERY,\n message: `no @LiveQuery('${frame.query}') is registered`,\n fatal: true,\n });\n return;\n }\n\n let args: unknown = frame.args;\n if (registered.options.parse) {\n try {\n args = registered.options.parse(frame.args);\n } catch (err) {\n this.sendFrame(client, {\n t: 'error',\n sub: frame.sub,\n code: LIVE_ERROR_CODES.BAD_ARGS,\n message: err instanceof Error ? err.message : 'invalid subscription args',\n fatal: true,\n });\n return;\n }\n }\n\n // Resolver-tier guards run ONCE, here (app-wide guards already ran in the\n // dispatcher's reserved-event path). Re-runs are server-initiated and rely\n // on the identity captured below instead of re-authorizing.\n if (!(await this.runSubscribeGuards(registered, client, frame.query, args))) {\n this.sendFrame(client, {\n t: 'error',\n sub: frame.sub,\n code: LIVE_ERROR_CODES.FORBIDDEN,\n message: `subscription to '${frame.query}' was rejected`,\n fatal: true,\n });\n return;\n }\n\n const identity = (this.options.identity ?? defaultIdentity)(client);\n const tags =\n typeof registered.options.tags === 'function'\n ? registered.options.tags(args)\n : registered.options.tags;\n\n const record: SubscriptionRecord = {\n sub: frame.sub,\n query: frame.query,\n args,\n tags,\n key: frame.key ?? registered.options.key,\n identity,\n };\n conn.subs.set(frame.sub, record);\n await this.persistSubscriptions(conn);\n this.sendFrame(client, { t: 'ack', sub: frame.sub });\n\n // Resume: when the client's cursor is still explainable and none of the\n // subscription's tags were invalidated in the gap, a tiny `resume` frame\n // keeps its cached value — no re-run at all. The diff baseline stays\n // undefined, so the next relevant change sends a full snapshot.\n if (frame.sinceCursor !== undefined && frame.sinceEpoch !== undefined) {\n const verdict = await this.log.evaluateResume(frame.sinceCursor, frame.sinceEpoch, tags);\n if (verdict === 'resume') {\n const stamp = await this.log.current();\n if (\n this.sendFrame(client, {\n t: 'resume',\n sub: frame.sub,\n cursor: stamp.cursor,\n epoch: stamp.epoch,\n })\n ) {\n record.lastCursor = stamp.cursor;\n }\n return;\n }\n }\n\n await this.push(conn, record, await this.log.current(), { initial: true });\n }\n\n private async runSubscribeGuards(\n registered: RegisteredQuery,\n client: WsClient,\n query: string,\n args: unknown,\n ): Promise<boolean> {\n const guards = resolveScopedComponents(\n 'guard',\n registered.token,\n registered.methodName,\n this.container,\n );\n if (guards.length === 0) return true;\n const context = buildEntrypointExecutionContext(\n 'live',\n registered.token,\n registered.methodName,\n {\n query,\n args,\n client,\n },\n );\n try {\n for (const guard of guards) {\n if (!(await guard.canActivate(context))) return false;\n }\n return true;\n } catch {\n return false;\n }\n }\n\n // ---- refresh path ----\n\n private scheduleDrain(): void {\n if (this.draining) return;\n this.draining = true;\n this.drainChain = this.drainChain\n .then(() => this.drainLoop())\n .catch((err) => {\n if (this.container.getDiagnostics() !== 'silent') {\n console.warn('[vela] live refresh flush failed:', err);\n }\n })\n .finally(() => {\n this.draining = false;\n if (this.pendingTags.size > 0) this.scheduleDrain();\n });\n }\n\n private async drainLoop(): Promise<void> {\n while (this.pendingTags.size > 0) {\n const changed = new Set(this.pendingTags);\n this.pendingTags.clear();\n\n // The stamp is resolved once per pass, BEFORE the re-runs (lunora\n // resolves its CDC cut the same way): results can only be newer than\n // the cursor they carry.\n const stamp = await this.log.current();\n\n const work: Array<{ conn: ConnectionEntry; record: SubscriptionRecord }> = [];\n for (const conn of this.connections.values()) {\n for (const record of conn.subs.values()) {\n if (record.tags.some((tag) => changed.has(tag))) work.push({ conn, record });\n }\n }\n\n await runPool(work, REFRESH_POOL_SIZE, async ({ conn, record }) => {\n await this.push(conn, record, stamp, { initial: false });\n });\n }\n }\n\n /**\n * Map a resolver failure to its live error-frame code. A branded\n * {@link VelaError} carries an HTTP-ish status that projects onto the live\n * vocabulary (403 → forbidden, 400/422 → bad_args); everything else — and\n * every unbranded error — is `internal` (the client sees a redacted message).\n */\n private static liveFrameCode(err: unknown): LiveErrorCode {\n if (!isVelaError(err)) return LIVE_ERROR_CODES.INTERNAL;\n if (err.status === 403) return LIVE_ERROR_CODES.FORBIDDEN;\n if (err.status === 400 || err.status === 422) return LIVE_ERROR_CODES.BAD_ARGS;\n return LIVE_ERROR_CODES.INTERNAL;\n }\n\n private async push(\n conn: ConnectionEntry,\n record: SubscriptionRecord,\n stamp: CommitStamp,\n { initial }: { initial: boolean },\n ): Promise<void> {\n // Outbound expiry enforcement — the only place expiry CAN be enforced for\n // a passive subscriber.\n const expiresAt = record.identity?.expiresAt;\n if (typeof expiresAt === 'number' && expiresAt <= Date.now()) {\n this.connections.delete(conn.client.id);\n try {\n conn.client.close(1008, 'identity expired');\n } catch {\n // already gone\n }\n return;\n }\n\n let json: string;\n let result: unknown;\n try {\n result = await this.runQuery(record, conn.client);\n // `undefined` has no JSON form — normalize so the frame always carries\n // an explicit `snapshot` and the baseline stays a string.\n if (result === undefined) result = null;\n json = JSON.stringify(result);\n } catch (err) {\n if (initial) {\n // Close the leak: an initial-subscribe resolver failure is REDACTED\n // through `toErrorBody` (the single wire-redaction seam) — an unbranded\n // error's raw message never reaches the browser, it surfaces only via\n // the reporter. Branded VelaErrors keep their client-facing message.\n conn.subs.delete(record.sub);\n const reporter = resolveErrorReporter(this.container);\n reporter.report(err, { edge: 'live', source: record.query });\n const safe = toErrorBody(err, { catalog: reporter.catalog });\n this.sendFrame(conn.client, {\n t: 'error',\n sub: record.sub,\n code: LiveEngine.liveFrameCode(err),\n message: safe.body.error.message,\n fatal: true,\n });\n } else if (this.container.getDiagnostics() !== 'silent') {\n // Transient: baseline untouched, the subscription retries next flush.\n console.warn(`[vela] live query '${record.query}' re-run failed (will retry):`, err);\n }\n return;\n }\n\n const frame = encodeSubscriptionUpdate(record, json, result, stamp, initial);\n if (this.sendFrame(conn.client, frame)) {\n record.lastJson = json;\n record.lastCursor = stamp.cursor;\n }\n }\n\n private async runQuery(record: SubscriptionRecord, client: WsClient): Promise<unknown> {\n const registered = this.queries.get(record.query);\n if (!registered) throw new Error(`live query '${record.query}' disappeared from the registry`);\n\n return runInEntrypointScope(this.container, async (scope) => {\n // Async seam: lazy resolver modules materialize, request-scoped\n // resolvers rebuild per run (mirrors queue dispatch).\n const instance = (await scope.resolveAsync(registered.token)) as Record<\n string | symbol,\n unknown\n >;\n const liveContext: LiveQueryContext = {\n identity: record.identity,\n clientId: client.id,\n rooms: [...client.rooms],\n };\n const context = buildEntrypointExecutionContext(\n 'live',\n registered.token,\n registered.methodName,\n {\n query: record.query,\n args: record.args,\n client,\n },\n );\n const interceptors = resolveScopedComponents(\n 'interceptor',\n registered.token,\n registered.methodName,\n scope,\n );\n return PipelineRunner.run({\n context,\n guards: [],\n interceptors,\n resolveArgs: async () => [record.args, liveContext],\n invoke: async (args) => {\n const method = instance[registered.methodName] as (...a: unknown[]) => unknown;\n return method.apply(instance, args);\n },\n });\n });\n }\n\n /**\n * Mirror the connection's records into `client.data` + `commit()` so\n * hibernating transports can replay them on wake. The volatile diff\n * baseline (`lastJson`/`lastCursor`) is deliberately stripped: it can be\n * large (the whole last result vs the 16 KiB attachment cap) and a lost\n * baseline just means the next relevant change sends a full snapshot.\n */\n private async persistSubscriptions(conn: ConnectionEntry): Promise<void> {\n const records = [...conn.subs.values()].map(\n ({ lastJson: _lastJson, lastCursor: _lastCursor, ...persisted }) => persisted,\n );\n try {\n (conn.client.data as Record<string, unknown>)[LIVE_SUBS_DATA_KEY] = records;\n await conn.client.commit();\n } catch (err) {\n if (this.container.getDiagnostics() !== 'silent') {\n console.warn(\n '[vela] live subscription persistence failed (resume across eviction disabled):',\n err,\n );\n }\n }\n }\n\n private ensureConnection(path: string, client: WsClient): ConnectionEntry {\n let conn = this.connections.get(client.id);\n if (!conn) {\n conn = { client, path, subs: new Map() };\n this.connections.set(client.id, conn);\n }\n return conn;\n }\n\n private sendFrame(client: WsClient, frame: ServerLiveFrame): boolean {\n try {\n client.sendRaw(encodeLiveEnvelope(frame));\n return true;\n } catch {\n return false;\n }\n }\n}\n","import { COMMIT_CURSOR_HEADER, COMMIT_EPOCH_HEADER } from '@velajs/live-protocol';\nimport { getContext } from 'hono/context-storage';\nimport type {\n CommitStamp,\n InvalidationCommand,\n LiveDriver,\n LiveInvalidationSink,\n} from './live.types';\n\n/** Single-scope default driver: deliver straight to this process's engine. */\nexport function localLive(): LiveDriver {\n let sink: LiveInvalidationSink | undefined;\n return {\n kind: 'local',\n bind(s) {\n sink = s;\n },\n dispatch(cmd) {\n return sink?.applyInvalidation(cmd);\n },\n };\n}\n\n/**\n * Per-app wrapper around a (possibly SHARED) driver instance.\n *\n * A driver passed to `LiveModule.forRoot({ driver })` is a plain config object\n * — and on Cloudflare the SAME app module (thus the same driver object)\n * bootstraps in the Worker isolate AND inside each Durable Object, often\n * within one isolate. Mutable per-app state must therefore never live on the\n * driver itself: the DO flipping a shared `durableObjectLive()` into local\n * mode would otherwise poison the Worker's engine, which then executes the\n * DO's storage handle in the wrong request context (\"Cannot perform I/O on\n * behalf of a different request\").\n *\n * The wrapper owns the per-app sink and the per-app local-mode flag; isolate-\n * wide concerns (env capture) forward to the underlying driver. Platform init\n * hooks (`_setLocalMode`, `_initializeEnv`) are exposed pass-through so\n * platform packages can keep type-guarding on their presence.\n */\nexport function perAppLiveDriver(underlying: LiveDriver): LiveDriver {\n let ownSink: LiveInvalidationSink | undefined;\n let localMode = false;\n const cfHooks = underlying as Partial<{\n _setLocalMode(): void;\n _initializeEnv(env: Record<string, unknown>): void;\n }>;\n\n return {\n get kind() {\n return underlying.kind;\n },\n bind(sink) {\n ownSink = sink;\n underlying.bind(sink);\n },\n dispatch(cmd) {\n if (localMode && ownSink) return ownSink.applyInvalidation(cmd);\n return underlying.dispatch(cmd);\n },\n start: underlying.start ? () => underlying.start?.() : undefined,\n stop: underlying.stop ? () => underlying.stop?.() : undefined,\n // Platform hooks (Cloudflare): local mode is PER APP; env is per isolate.\n _setLocalMode() {\n localMode = true;\n },\n _initializeEnv(env: Record<string, unknown>) {\n cfHooks._initializeEnv?.(env);\n },\n } as LiveDriver;\n}\n\n/**\n * The injectable invalidation surface for custom (non-CRUD) write paths:\n *\n * ```ts\n * await this.live.invalidate({ tags: ['todos:' + listId] });\n * ```\n *\n * Every affected live query re-runs and pushes. Returns the commit stamp of\n * the targeted log scope so mutation endpoints can expose it to the client\n * (`Vela-Commit-Cursor` / `Vela-Commit-Epoch`) — the cursor optimistic\n * updates gate on. When ambient request access is enabled\n * (`VelaFactory.create(m, { ambientContainer: true })`) the headers are\n * stamped onto the current HTTP response automatically; otherwise stamp them\n * yourself via {@link stampCommitHeaders}.\n */\nexport class LiveInvalidation {\n constructor(private readonly driver: LiveDriver) {}\n\n async invalidate(cmd: InvalidationCommand): Promise<CommitStamp | undefined> {\n const stamp = await this.driver.dispatch(cmd);\n if (stamp) stampAmbientCommitHeaders(stamp);\n return stamp;\n }\n}\n\n/** Write the commit headers onto a Hono context (a mutation route's response). */\nexport function stampCommitHeaders(\n c: { header: (name: string, value: string) => unknown },\n stamp: CommitStamp,\n): void {\n c.header(COMMIT_CURSOR_HEADER, String(stamp.cursor));\n c.header(COMMIT_EPOCH_HEADER, stamp.epoch);\n}\n\n/**\n * Best-effort automatic header stamping through Hono's ambient context\n * storage. A no-op outside a request or when `contextStorage()` isn't\n * registered — ALS keeps this per-request-correct under concurrency (a\n * mutable singleton slot would race interleaved awaits).\n */\nfunction stampAmbientCommitHeaders(stamp: CommitStamp): void {\n try {\n stampCommitHeaders(getContext(), stamp);\n } catch {\n // Ambient access not enabled, or invalidate() ran outside a request\n // (queue job, cron tick) — there is no HTTP response to stamp.\n }\n}\n","import { defineModule } from '../index';\nimport { InMemoryCursorLog } from './live.cursor';\nimport { LiveEngine } from './live.engine';\nimport { LiveInvalidation, localLive, perAppLiveDriver } from './live.invalidation';\nimport { LIVE_CURSOR_LOG, LIVE_DRIVER, LIVE_MODULE_OPTIONS } from './live.tokens';\nimport type { LiveDriver, LiveModuleOptions } from './live.types';\nimport { PresenceResolver, PresenceService } from './presence';\n\n/**\n * First-party live-query module (tag-based realtime reactivity) — authored,\n * like the queue module, entirely on vela's public API (`live-openness.test.ts`\n * machine-verifies it; the only extra dependency is the shared wire package\n * `@velajs/live-protocol`).\n *\n * ```ts\n * imports: [WebSocketModule.forRoot({}), LiveModule.forRoot({})]\n * ```\n *\n * App code declares `@LiveResolver` classes with `@LiveQuery(name, { tags })`\n * methods; clients subscribe over the `$live` reserved WebSocket event; writes\n * invalidate tags via `LiveInvalidation` (the `@velajs/crud` bridge does it\n * automatically per table). See `LIVE.md` for the wire protocol, delivery\n * guarantees, and the resume story.\n *\n * Deliberately EAGER (like WebSocketModule): the engine self-drives — it\n * claims the `$live` event at bootstrap and receives invalidations from\n * writes that never touch a live token — so the lazy-module contract\n * (\"nothing self-drives\") rules laziness out.\n */\nconst { ConfigurableModuleClass } = defineModule<LiveModuleOptions>({\n name: 'Live',\n optionsToken: LIVE_MODULE_OPTIONS,\n key: (options) => `live#${options?.driver?.kind ?? 'local'}`,\n setup: ({ OPTIONS, options }) => ({\n providers: [\n {\n provide: LIVE_CURSOR_LOG,\n useFactory: (o: LiveModuleOptions) => o.log ?? new InMemoryCursorLog(),\n inject: [OPTIONS],\n },\n {\n provide: LIVE_DRIVER,\n // Wrapped per app: user-supplied drivers are shared config objects\n // (the same module bootstraps in the Worker AND in each Durable\n // Object), so per-app sink/mode state lives in the wrapper — see\n // perAppLiveDriver.\n useFactory: (o: LiveModuleOptions) => perAppLiveDriver(o.driver ?? localLive()),\n inject: [OPTIONS],\n },\n {\n provide: PresenceService,\n useFactory: (o: LiveModuleOptions) => {\n const presence = o.presence;\n if (presence === false) return new PresenceService(undefined, false);\n return new PresenceService(presence?.ttlMs, true);\n },\n inject: [OPTIONS],\n },\n {\n provide: LiveInvalidation,\n useFactory: (driver: LiveDriver) => new LiveInvalidation(driver),\n inject: [LIVE_DRIVER],\n },\n LiveEngine,\n // The built-in `$presence.roster` resolver. Skipping it is STRUCTURAL\n // (`presence: false` must be visible at forRoot/forRootAsync call time,\n // like queue's `queues`); a disabled-at-runtime service still no-ops.\n ...(options?.presence === false ? [] : [PresenceResolver]),\n ],\n exports: [LiveEngine, LiveInvalidation, LIVE_DRIVER, LIVE_CURSOR_LOG, PresenceService],\n }),\n});\n\nexport class LiveModule extends ConfigurableModuleClass {}\n"],"mappings":";;;;;;;;;;AAOA,MAAM,cAAc,GAAsB,MACxC,EAAE,MAAM,QAAQ,EAAE,IAAI,GAAG,CAAC;;;;;;;;;;;;AAa5B,IAAa,oBAAb,MAAoD;CAKrB;CAJ7B,QAAyB,OAAO,WAAW;CAC3C,UAAuC,CAAC;CACxC,MAAc;CAEd,YAAY,aAA8B,MAAM;EAAnB,KAAA,aAAA;CAAoB;CAEjD,OAAO,MAA6B;EAClC,KAAK,OAAO;EACZ,KAAK,QAAQ,KAAK;GAAE,KAAK,KAAK;GAAK;EAAK,CAAC;EACzC,IAAI,KAAK,QAAQ,SAAS,KAAK,YAC7B,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,SAAS,KAAK,UAAU;EAE9D,OAAO;GAAE,QAAQ,KAAK;GAAK,OAAO,KAAK;EAAM;CAC/C;CAEA,UAAuB;EACrB,OAAO;GAAE,QAAQ,KAAK;GAAK,OAAO,KAAK;EAAM;CAC/C;CAEA,eACE,aACA,YACA,kBACe;EAEf,IAAI,eAAe,KAAK,OAAO,OAAO;EAEtC,IAAI,cAAc,KAAK,KAAK,OAAO;EACnC,IAAI,gBAAgB,KAAK,KAAK,OAAO;EAErC,MAAM,SAAS,KAAK,QAAQ;EAC5B,IAAI,WAAW,KAAA,KAAa,OAAO,MAAM,cAAc,GAAG,OAAO;EAEjE,MAAM,UAAU,IAAI,IAAI,gB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