@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
package/dist/openapi/document.js
DELETED
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { ParamType } from "../constants.js";
|
|
2
|
-
import { getRouteContributors } from "../http/route-contributor.js";
|
|
3
|
-
import { getMetadata } from "../metadata.js";
|
|
4
|
-
import { collectControllers } from "../module/graph.js";
|
|
5
|
-
import { MetadataRegistry } from "../registry/metadata.registry.js";
|
|
6
|
-
import { joinPaths, toOpenApiPath } from "../registry/paths.js";
|
|
7
|
-
import { getApiDoc, getApiResponses, getApiTags } from "./decorators.js";
|
|
8
|
-
import { isOptional, zodToJsonSchema } from "./zod-to-json-schema.js";
|
|
9
|
-
/**
|
|
10
|
-
* Tracks DTO classes referenced during document generation and registers
|
|
11
|
-
* each under `components.schemas`. Handles name collisions by suffixing.
|
|
12
|
-
*/ let ComponentsRegistry = class ComponentsRegistry {
|
|
13
|
-
schemas = new Map();
|
|
14
|
-
classToKey = new WeakMap();
|
|
15
|
-
ref(dtoClass) {
|
|
16
|
-
const existing = this.classToKey.get(dtoClass);
|
|
17
|
-
if (existing) return {
|
|
18
|
-
$ref: `#/components/schemas/${existing}`
|
|
19
|
-
};
|
|
20
|
-
const baseName = dtoClass.name && dtoClass.name !== '' ? dtoClass.name : 'Schema';
|
|
21
|
-
let key = baseName;
|
|
22
|
-
let counter = 2;
|
|
23
|
-
while(this.schemas.has(key)){
|
|
24
|
-
key = `${baseName}${counter++}`;
|
|
25
|
-
}
|
|
26
|
-
this.classToKey.set(dtoClass, key);
|
|
27
|
-
const staticSchema = dtoClass.schema;
|
|
28
|
-
this.schemas.set(key, zodToJsonSchema(staticSchema));
|
|
29
|
-
return {
|
|
30
|
-
$ref: `#/components/schemas/${key}`
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
build() {
|
|
34
|
-
if (this.schemas.size === 0) return undefined;
|
|
35
|
-
return Object.fromEntries(this.schemas);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
function isDtoClass(value) {
|
|
39
|
-
return typeof value === 'function' && value.schema != null;
|
|
40
|
-
}
|
|
41
|
-
function getParamSchema(param, paramtypes, registry) {
|
|
42
|
-
const metatype = param.metatype ?? paramtypes?.[param.index];
|
|
43
|
-
if (!metatype) return undefined;
|
|
44
|
-
if (isDtoClass(metatype)) {
|
|
45
|
-
return registry.ref(metatype);
|
|
46
|
-
}
|
|
47
|
-
const maybeSchema = metatype.schema;
|
|
48
|
-
if (maybeSchema) {
|
|
49
|
-
return zodToJsonSchema(maybeSchema);
|
|
50
|
-
}
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
function isParamOptional(param, paramtypes) {
|
|
54
|
-
const metatype = param.metatype ?? paramtypes?.[param.index];
|
|
55
|
-
if (metatype?.schema) {
|
|
56
|
-
return isOptional(metatype.schema);
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
function isLikelyJsonSchema(value) {
|
|
61
|
-
if (!value || typeof value !== 'object') return false;
|
|
62
|
-
const v = value;
|
|
63
|
-
if (typeof v.toJSONSchema === 'function') return false;
|
|
64
|
-
return 'type' in v || '$ref' in v || 'oneOf' in v || 'anyOf' in v || 'allOf' in v || 'enum' in v || 'const' in v;
|
|
65
|
-
}
|
|
66
|
-
function resolveResponseSchema(input, registry) {
|
|
67
|
-
if (input === undefined || input === null) return undefined;
|
|
68
|
-
if (isDtoClass(input)) {
|
|
69
|
-
return registry.ref(input);
|
|
70
|
-
}
|
|
71
|
-
if (isLikelyJsonSchema(input)) {
|
|
72
|
-
return {
|
|
73
|
-
...input
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
if (typeof input === 'object' && typeof input.toJSONSchema === 'function') {
|
|
77
|
-
return zodToJsonSchema(input);
|
|
78
|
-
}
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
function buildOperation(controller, route, pathString, registry) {
|
|
82
|
-
const handlerName = route.handlerName;
|
|
83
|
-
const paramMetadata = MetadataRegistry.getParameters(controller).get(handlerName) ?? [];
|
|
84
|
-
const paramtypes = Reflect.getMetadata('design:paramtypes', controller.prototype, handlerName);
|
|
85
|
-
const parameters = [];
|
|
86
|
-
let requestBody;
|
|
87
|
-
const declaredPathParams = new Set();
|
|
88
|
-
const pathParamNames = [
|
|
89
|
-
...pathString.matchAll(/\{([^}]+)\}/g)
|
|
90
|
-
].map((m)=>m[1]);
|
|
91
|
-
for (const param of paramMetadata){
|
|
92
|
-
if (param.type === ParamType.PARAM && param.name) {
|
|
93
|
-
declaredPathParams.add(param.name);
|
|
94
|
-
parameters.push({
|
|
95
|
-
name: param.name,
|
|
96
|
-
in: 'path',
|
|
97
|
-
required: true,
|
|
98
|
-
schema: getParamSchema(param, paramtypes, registry) ?? {
|
|
99
|
-
type: 'string'
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
} else if (param.type === ParamType.QUERY && param.name) {
|
|
103
|
-
parameters.push({
|
|
104
|
-
name: param.name,
|
|
105
|
-
in: 'query',
|
|
106
|
-
required: !isParamOptional(param, paramtypes),
|
|
107
|
-
schema: getParamSchema(param, paramtypes, registry) ?? {
|
|
108
|
-
type: 'string'
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
} else if (param.type === ParamType.HEADERS && param.name) {
|
|
112
|
-
parameters.push({
|
|
113
|
-
name: param.name,
|
|
114
|
-
in: 'header',
|
|
115
|
-
required: !isParamOptional(param, paramtypes),
|
|
116
|
-
schema: getParamSchema(param, paramtypes, registry) ?? {
|
|
117
|
-
type: 'string'
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
} else if (param.type === ParamType.BODY) {
|
|
121
|
-
const schema = getParamSchema(param, paramtypes, registry);
|
|
122
|
-
if (schema) {
|
|
123
|
-
requestBody = {
|
|
124
|
-
required: !isParamOptional(param, paramtypes),
|
|
125
|
-
content: {
|
|
126
|
-
'application/json': {
|
|
127
|
-
schema
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
for (const name of pathParamNames){
|
|
135
|
-
if (!declaredPathParams.has(name)) {
|
|
136
|
-
parameters.push({
|
|
137
|
-
name,
|
|
138
|
-
in: 'path',
|
|
139
|
-
required: true,
|
|
140
|
-
schema: {
|
|
141
|
-
type: 'string'
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
const docMeta = getApiDoc(controller, handlerName);
|
|
147
|
-
const controllerTags = getApiTags(controller) ?? [];
|
|
148
|
-
const handlerTags = getApiTags(controller, handlerName) ?? [];
|
|
149
|
-
const docTags = docMeta?.tags ?? [];
|
|
150
|
-
const mergedTags = [
|
|
151
|
-
...new Set([
|
|
152
|
-
...controllerTags,
|
|
153
|
-
...handlerTags,
|
|
154
|
-
...docTags
|
|
155
|
-
])
|
|
156
|
-
];
|
|
157
|
-
const responses = {
|
|
158
|
-
'200': {
|
|
159
|
-
description: 'OK'
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
const apiResponses = getApiResponses(controller, handlerName) ?? [];
|
|
163
|
-
for (const entry of apiResponses){
|
|
164
|
-
const key = String(entry.status);
|
|
165
|
-
const resolved = {
|
|
166
|
-
description: entry.description
|
|
167
|
-
};
|
|
168
|
-
const schema = resolveResponseSchema(entry.schema, registry);
|
|
169
|
-
if (schema) {
|
|
170
|
-
resolved.content = {
|
|
171
|
-
'application/json': {
|
|
172
|
-
schema
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
responses[key] = resolved;
|
|
177
|
-
}
|
|
178
|
-
const operation = {
|
|
179
|
-
responses
|
|
180
|
-
};
|
|
181
|
-
if (parameters.length > 0) operation.parameters = parameters;
|
|
182
|
-
if (requestBody) operation.requestBody = requestBody;
|
|
183
|
-
if (docMeta?.summary) operation.summary = docMeta.summary;
|
|
184
|
-
if (docMeta?.description) operation.description = docMeta.description;
|
|
185
|
-
const operationId = docMeta?.operationId ?? route.name;
|
|
186
|
-
if (operationId) operation.operationId = operationId;
|
|
187
|
-
if (docMeta?.deprecated) operation.deprecated = docMeta.deprecated;
|
|
188
|
-
if (mergedTags.length > 0) operation.tags = mergedTags;
|
|
189
|
-
return operation;
|
|
190
|
-
}
|
|
191
|
-
const VERB_WHITELIST = new Set([
|
|
192
|
-
'get',
|
|
193
|
-
'post',
|
|
194
|
-
'put',
|
|
195
|
-
'patch',
|
|
196
|
-
'delete',
|
|
197
|
-
'options',
|
|
198
|
-
'head'
|
|
199
|
-
]);
|
|
200
|
-
export function createOpenApiDocument(rootModule, options = {}) {
|
|
201
|
-
const paths = {};
|
|
202
|
-
const globalPrefix = options.globalPrefix ?? '';
|
|
203
|
-
const registry = new ComponentsRegistry();
|
|
204
|
-
const controllers = collectControllers(rootModule);
|
|
205
|
-
for (const controller of controllers){
|
|
206
|
-
const controllerPath = MetadataRegistry.getControllerPath(controller);
|
|
207
|
-
const routes = MetadataRegistry.getRoutes(controller);
|
|
208
|
-
for (const route of routes){
|
|
209
|
-
const method = route.method.toLowerCase();
|
|
210
|
-
if (!VERB_WHITELIST.has(method)) continue;
|
|
211
|
-
const rawPath = joinPaths(joinPaths(globalPrefix, controllerPath), route.path);
|
|
212
|
-
const pathString = toOpenApiPath(rawPath);
|
|
213
|
-
const operation = buildOperation(controller, route, pathString, registry);
|
|
214
|
-
const pathItem = paths[pathString] ?? {};
|
|
215
|
-
pathItem[method] = operation;
|
|
216
|
-
paths[pathString] = pathItem;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
// Second pass: include contributor-generated routes (e.g. `@Crud()` via
|
|
220
|
-
// `@velajs/crud`'s registered RouteContributor). Silent when no contributor
|
|
221
|
-
// is registered or no controller carries claiming metadata, so consumers
|
|
222
|
-
// without contributor packages see no behavioral change.
|
|
223
|
-
for (const contributor of getRouteContributors()){
|
|
224
|
-
if (!contributor.buildOpenApiPaths) continue;
|
|
225
|
-
for (const controller of controllers){
|
|
226
|
-
const meta = getMetadata(contributor.claimsMetaKey, controller);
|
|
227
|
-
if (meta === undefined) continue;
|
|
228
|
-
const controllerPrefix = MetadataRegistry.getControllerPath(controller);
|
|
229
|
-
const contributedPaths = contributor.buildOpenApiPaths({
|
|
230
|
-
controller: controller,
|
|
231
|
-
meta,
|
|
232
|
-
globalPrefix,
|
|
233
|
-
controllerPrefix
|
|
234
|
-
});
|
|
235
|
-
for (const [pathKey, pathItem] of Object.entries(contributedPaths)){
|
|
236
|
-
// Verb-level merge: a hand-written `@Get('/')` on the same controller
|
|
237
|
-
// is preserved when the contributor adds `post`/`patch`/etc. on the
|
|
238
|
-
// same path key.
|
|
239
|
-
paths[pathKey] = {
|
|
240
|
-
...paths[pathKey] ?? {},
|
|
241
|
-
...pathItem
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
// Aggregate the document-root `tags` array. NestJS declares tag
|
|
247
|
-
// groups/descriptions/order via `DocumentBuilder().addTag(name, desc)`
|
|
248
|
-
// while its scanner auto-collects operation tags; we wire both halves
|
|
249
|
-
// here. Walk every operation's `tags` in first-seen order (stable: paths
|
|
250
|
-
// insertion order, then verb order), then merge with `options.tags`
|
|
251
|
-
// (caller-declared tags first — preserving their order + descriptions —
|
|
252
|
-
// followed by any purely-collected tag not already declared, as `{ name }`).
|
|
253
|
-
const seenTagNames = new Set();
|
|
254
|
-
const collectedTagNames = [];
|
|
255
|
-
for (const pathItem of Object.values(paths)){
|
|
256
|
-
for (const verb of VERB_WHITELIST){
|
|
257
|
-
const operation = pathItem[verb];
|
|
258
|
-
if (!operation?.tags) continue;
|
|
259
|
-
for (const tagName of operation.tags){
|
|
260
|
-
if (seenTagNames.has(tagName)) continue;
|
|
261
|
-
seenTagNames.add(tagName);
|
|
262
|
-
collectedTagNames.push(tagName);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
const declaredTags = options.tags ?? [];
|
|
267
|
-
const declaredTagNames = new Set(declaredTags.map((t)=>t.name));
|
|
268
|
-
const tags = [
|
|
269
|
-
...declaredTags,
|
|
270
|
-
...collectedTagNames.filter((name)=>!declaredTagNames.has(name)).map((name)=>({
|
|
271
|
-
name
|
|
272
|
-
}))
|
|
273
|
-
];
|
|
274
|
-
const document = {
|
|
275
|
-
openapi: '3.1.0',
|
|
276
|
-
info: {
|
|
277
|
-
title: options.info?.title ?? 'Vela API',
|
|
278
|
-
version: options.info?.version ?? '1.0.0',
|
|
279
|
-
...options.info?.description ? {
|
|
280
|
-
description: options.info.description
|
|
281
|
-
} : {}
|
|
282
|
-
},
|
|
283
|
-
// servers sits between info and paths (OpenAPI convention). Omitted when
|
|
284
|
-
// the caller passes none, mirroring the components/tags handling below.
|
|
285
|
-
...options.servers?.length ? {
|
|
286
|
-
servers: options.servers
|
|
287
|
-
} : {},
|
|
288
|
-
paths
|
|
289
|
-
};
|
|
290
|
-
// components.schemas (generated from DTOs) and components.securitySchemes
|
|
291
|
-
// (caller-supplied) share the same `components` object — attach it when
|
|
292
|
-
// either is present so neither clobbers the other.
|
|
293
|
-
const schemas = registry.build();
|
|
294
|
-
if (schemas || options.securitySchemes) {
|
|
295
|
-
document.components = {
|
|
296
|
-
...schemas ? {
|
|
297
|
-
schemas
|
|
298
|
-
} : {},
|
|
299
|
-
...options.securitySchemes ? {
|
|
300
|
-
securitySchemes: options.securitySchemes
|
|
301
|
-
} : {}
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
// Document-level default security requirements (each operation may override).
|
|
305
|
-
// Omitted entirely when the caller passes none.
|
|
306
|
-
if (options.security?.length) {
|
|
307
|
-
document.security = options.security;
|
|
308
|
-
}
|
|
309
|
-
// Only attach `tags` when non-empty. Emitting `tags: []` on a tag-less
|
|
310
|
-
// spec is the exact symptom the consumer reported, so omit the key
|
|
311
|
-
// entirely in that case (mirrors the `components` handling above).
|
|
312
|
-
if (tags.length > 0) {
|
|
313
|
-
document.tags = tags;
|
|
314
|
-
}
|
|
315
|
-
return document;
|
|
316
|
-
}
|
package/dist/openapi/index.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { createOpenApiDocument } from './document';
|
|
2
|
-
export { ApiDoc, ApiTags, ApiResponse, API_DOC_METADATA, API_TAGS_METADATA, API_RESPONSES_METADATA, } from './decorators';
|
|
3
|
-
export { zodToJsonSchema } from './zod-to-json-schema';
|
|
4
|
-
export { renderScalarUi } from './scalar-ui';
|
|
5
|
-
export { renderSwaggerUi } from './swagger-ui';
|
|
6
|
-
export { renderRedocUi } from './redoc-ui';
|
|
7
|
-
export type { ApiDocMetadata, ApiResponseEntry, ApiResponseOptions, CreateOpenApiDocumentOptions, HttpVerb, JsonSchema, MountOpenApiOptions, OpenApiUi, OpenApiDocument, OpenApiInfo, OpenApiOperation, OpenApiParameter, OpenApiPathItem, OpenApiRequestBody, OpenApiResponse, } from './types';
|
package/dist/openapi/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { createOpenApiDocument } from "./document.js";
|
|
2
|
-
export { ApiDoc, ApiTags, ApiResponse, API_DOC_METADATA, API_TAGS_METADATA, API_RESPONSES_METADATA } from "./decorators.js";
|
|
3
|
-
export { zodToJsonSchema } from "./zod-to-json-schema.js";
|
|
4
|
-
export { renderScalarUi } from "./scalar-ui.js";
|
|
5
|
-
export { renderSwaggerUi } from "./swagger-ui.js";
|
|
6
|
-
export { renderRedocUi } from "./redoc-ui.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderRedocUi(specUrl: string, title?: string): string;
|
package/dist/openapi/redoc-ui.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Minimal HTML shell that bootstraps ReDoc from a CDN. Served as a static
|
|
2
|
-
// string so it works on every edge runtime with no Node or bundler deps —
|
|
3
|
-
// ReDoc itself is loaded from a CDN at runtime.
|
|
4
|
-
export function renderRedocUi(specUrl, title) {
|
|
5
|
-
const safeUrl = specUrl.replace(/"/g, '"');
|
|
6
|
-
const safeTitle = (title ?? 'API Reference').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
7
|
-
return `<!doctype html>
|
|
8
|
-
<html>
|
|
9
|
-
<head>
|
|
10
|
-
<title>${safeTitle}</title>
|
|
11
|
-
<meta charset="utf-8" />
|
|
12
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<redoc spec-url="${safeUrl}"></redoc>
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"></script>
|
|
17
|
-
</body>
|
|
18
|
-
</html>`;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderScalarUi(jsonUrl: string, title?: string): string;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Minimal HTML shell that bootstraps Scalar's hosted API-reference UI.
|
|
2
|
-
// Served as a static string so it works on every edge runtime with no
|
|
3
|
-
// Node or bundler deps. Scalar itself is loaded from a CDN at runtime.
|
|
4
|
-
export function renderScalarUi(jsonUrl, title) {
|
|
5
|
-
const safeUrl = jsonUrl.replace(/"/g, '"');
|
|
6
|
-
const safeTitle = (title ?? 'API Reference').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
7
|
-
return `<!doctype html>
|
|
8
|
-
<html>
|
|
9
|
-
<head>
|
|
10
|
-
<title>${safeTitle}</title>
|
|
11
|
-
<meta charset="utf-8" />
|
|
12
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
<script id="api-reference" data-url="${safeUrl}"></script>
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
17
|
-
</body>
|
|
18
|
-
</html>`;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function renderSwaggerUi(specUrl: string, title?: string): string;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Minimal HTML shell that bootstraps Swagger UI from a CDN. Served as a
|
|
2
|
-
// static string so it works on every edge runtime with no Node or bundler
|
|
3
|
-
// deps — Swagger UI itself is loaded from a CDN at runtime.
|
|
4
|
-
export function renderSwaggerUi(specUrl, title) {
|
|
5
|
-
const safeUrl = specUrl.replace(/"/g, '"');
|
|
6
|
-
const safeTitle = (title ?? 'API Reference').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
7
|
-
return `<!doctype html>
|
|
8
|
-
<html>
|
|
9
|
-
<head>
|
|
10
|
-
<title>${safeTitle}</title>
|
|
11
|
-
<meta charset="utf-8" />
|
|
12
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
13
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist/swagger-ui.css" />
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div id="swagger-ui"></div>
|
|
17
|
-
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist/swagger-ui-bundle.js"></script>
|
|
18
|
-
<script>
|
|
19
|
-
window.ui = SwaggerUIBundle({ url: "${safeUrl}", dom_id: '#swagger-ui' });
|
|
20
|
-
</script>
|
|
21
|
-
</body>
|
|
22
|
-
</html>`;
|
|
23
|
-
}
|
package/dist/openapi/types.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
export interface OpenApiInfo {
|
|
2
|
-
title: string;
|
|
3
|
-
version: string;
|
|
4
|
-
description?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface JsonSchema {
|
|
7
|
-
type?: string | string[];
|
|
8
|
-
format?: string;
|
|
9
|
-
enum?: Array<string | number | boolean | null>;
|
|
10
|
-
const?: unknown;
|
|
11
|
-
description?: string;
|
|
12
|
-
nullable?: boolean;
|
|
13
|
-
default?: unknown;
|
|
14
|
-
items?: JsonSchema;
|
|
15
|
-
properties?: Record<string, JsonSchema>;
|
|
16
|
-
required?: string[];
|
|
17
|
-
additionalProperties?: boolean | JsonSchema;
|
|
18
|
-
oneOf?: JsonSchema[];
|
|
19
|
-
anyOf?: JsonSchema[];
|
|
20
|
-
allOf?: JsonSchema[];
|
|
21
|
-
minimum?: number;
|
|
22
|
-
maximum?: number;
|
|
23
|
-
minLength?: number;
|
|
24
|
-
maxLength?: number;
|
|
25
|
-
pattern?: string;
|
|
26
|
-
$ref?: string;
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
}
|
|
29
|
-
export interface OpenApiParameter {
|
|
30
|
-
name: string;
|
|
31
|
-
in: 'path' | 'query' | 'header' | 'cookie';
|
|
32
|
-
required?: boolean;
|
|
33
|
-
description?: string;
|
|
34
|
-
schema?: JsonSchema;
|
|
35
|
-
}
|
|
36
|
-
export interface OpenApiRequestBody {
|
|
37
|
-
description?: string;
|
|
38
|
-
required?: boolean;
|
|
39
|
-
content?: Record<string, {
|
|
40
|
-
schema: JsonSchema;
|
|
41
|
-
}>;
|
|
42
|
-
}
|
|
43
|
-
export interface OpenApiResponse {
|
|
44
|
-
description: string;
|
|
45
|
-
content?: Record<string, {
|
|
46
|
-
schema: JsonSchema;
|
|
47
|
-
}>;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* A single security requirement: maps a securityScheme name to the scopes it
|
|
51
|
-
* requires (empty array for apiKey/http schemes). An operation- or document-
|
|
52
|
-
* level array is an OR of these objects. Kept as a plain record so callers can
|
|
53
|
-
* build them inline (`{ cookieAuth: [] }`).
|
|
54
|
-
*/
|
|
55
|
-
export type OpenApiSecurityRequirement = Record<string, string[]>;
|
|
56
|
-
export interface OpenApiOperation {
|
|
57
|
-
summary?: string;
|
|
58
|
-
description?: string;
|
|
59
|
-
operationId?: string;
|
|
60
|
-
deprecated?: boolean;
|
|
61
|
-
tags?: string[];
|
|
62
|
-
parameters?: OpenApiParameter[];
|
|
63
|
-
requestBody?: OpenApiRequestBody;
|
|
64
|
-
responses: Record<string, OpenApiResponse>;
|
|
65
|
-
/** Per-operation security requirements (overrides the document-level array). */
|
|
66
|
-
security?: OpenApiSecurityRequirement[];
|
|
67
|
-
}
|
|
68
|
-
/** An OpenAPI Server Object. Kept loose so callers can add `variables`. */
|
|
69
|
-
export interface OpenApiServer {
|
|
70
|
-
url: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
variables?: Record<string, {
|
|
73
|
-
enum?: string[];
|
|
74
|
-
default: string;
|
|
75
|
-
description?: string;
|
|
76
|
-
}>;
|
|
77
|
-
[key: string]: unknown;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* An OpenAPI Security Scheme Object (apiKey / http / oauth2 / openIdConnect /
|
|
81
|
-
* mutualTLS). Index signature keeps it open so any valid scheme shape passes
|
|
82
|
-
* without fighting the types (mirrors JsonSchema above).
|
|
83
|
-
*/
|
|
84
|
-
export interface OpenApiSecurityScheme {
|
|
85
|
-
type: 'apiKey' | 'http' | 'oauth2' | 'openIdConnect' | 'mutualTLS';
|
|
86
|
-
description?: string;
|
|
87
|
-
name?: string;
|
|
88
|
-
in?: 'query' | 'header' | 'cookie';
|
|
89
|
-
scheme?: string;
|
|
90
|
-
bearerFormat?: string;
|
|
91
|
-
flows?: Record<string, unknown>;
|
|
92
|
-
openIdConnectUrl?: string;
|
|
93
|
-
[key: string]: unknown;
|
|
94
|
-
}
|
|
95
|
-
export type HttpVerb = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'options' | 'head';
|
|
96
|
-
export type OpenApiPathItem = {
|
|
97
|
-
[verb in HttpVerb]?: OpenApiOperation;
|
|
98
|
-
};
|
|
99
|
-
export interface OpenApiDocument {
|
|
100
|
-
openapi: '3.1.0';
|
|
101
|
-
info: OpenApiInfo;
|
|
102
|
-
servers?: OpenApiServer[];
|
|
103
|
-
paths: Record<string, OpenApiPathItem>;
|
|
104
|
-
components?: {
|
|
105
|
-
schemas?: Record<string, JsonSchema>;
|
|
106
|
-
securitySchemes?: Record<string, OpenApiSecurityScheme>;
|
|
107
|
-
};
|
|
108
|
-
security?: OpenApiSecurityRequirement[];
|
|
109
|
-
tags?: Array<{
|
|
110
|
-
name: string;
|
|
111
|
-
description?: string;
|
|
112
|
-
}>;
|
|
113
|
-
}
|
|
114
|
-
export interface ApiDocMetadata {
|
|
115
|
-
summary?: string;
|
|
116
|
-
description?: string;
|
|
117
|
-
operationId?: string;
|
|
118
|
-
deprecated?: boolean;
|
|
119
|
-
tags?: string[];
|
|
120
|
-
}
|
|
121
|
-
export interface ApiResponseOptions {
|
|
122
|
-
description: string;
|
|
123
|
-
/** Zod schema, DTO class (from createZodDto), or raw JSON Schema. */
|
|
124
|
-
schema?: unknown;
|
|
125
|
-
}
|
|
126
|
-
export interface ApiResponseEntry extends ApiResponseOptions {
|
|
127
|
-
status: number | string;
|
|
128
|
-
}
|
|
129
|
-
export interface CreateOpenApiDocumentOptions {
|
|
130
|
-
info?: Partial<OpenApiInfo>;
|
|
131
|
-
globalPrefix?: string;
|
|
132
|
-
/**
|
|
133
|
-
* Declare top-level tag groups with descriptions and an explicit order
|
|
134
|
-
* (mirrors NestJS `DocumentBuilder().addTag(name, description)`). Tags
|
|
135
|
-
* actually used by operations but NOT declared here are still emitted —
|
|
136
|
-
* appended after the declared ones in first-seen order. Declared tags
|
|
137
|
-
* with no operations are kept (lets you pre-declare ordering/description).
|
|
138
|
-
*/
|
|
139
|
-
tags?: Array<{
|
|
140
|
-
name: string;
|
|
141
|
-
description?: string;
|
|
142
|
-
}>;
|
|
143
|
-
/**
|
|
144
|
-
* Top-level `servers` array (base URLs the API is served from). Emitted
|
|
145
|
-
* verbatim between `info` and `paths` when non-empty; omitted otherwise.
|
|
146
|
-
*/
|
|
147
|
-
servers?: OpenApiServer[];
|
|
148
|
-
/**
|
|
149
|
-
* Named security schemes, emitted under `components.securitySchemes` (merged
|
|
150
|
-
* with generated `components.schemas`). Reference them from `security`.
|
|
151
|
-
*/
|
|
152
|
-
securitySchemes?: Record<string, OpenApiSecurityScheme>;
|
|
153
|
-
/**
|
|
154
|
-
* Document-level default security requirements (applies to every operation
|
|
155
|
-
* unless the operation overrides it). Emitted verbatim when non-empty.
|
|
156
|
-
*/
|
|
157
|
-
security?: OpenApiSecurityRequirement[];
|
|
158
|
-
}
|
|
159
|
-
export type OpenApiUi = 'swagger' | 'scalar' | 'redoc';
|
|
160
|
-
export interface MountOpenApiOptions {
|
|
161
|
-
/** Pre-built OpenAPI document to serve. */
|
|
162
|
-
document: OpenApiDocument;
|
|
163
|
-
/** OpenAPI JSON spec path. @default '/openapi.json' */
|
|
164
|
-
specPath?: string;
|
|
165
|
-
/**
|
|
166
|
-
* UI(s) to mount. 'all' mounts swagger + scalar + redoc.
|
|
167
|
-
* @default 'scalar'
|
|
168
|
-
*/
|
|
169
|
-
ui?: OpenApiUi | OpenApiUi[] | 'all';
|
|
170
|
-
/** Swagger UI path. @default '/docs' */
|
|
171
|
-
swaggerPath?: string;
|
|
172
|
-
/** Scalar path. @default '/scalar' */
|
|
173
|
-
scalarPath?: string;
|
|
174
|
-
/** ReDoc path. @default '/redoc' */
|
|
175
|
-
redocPath?: string;
|
|
176
|
-
/** Page title for the UIs. */
|
|
177
|
-
title?: string;
|
|
178
|
-
/** @deprecated use `specPath`. Back-compat alias; if set, overrides specPath default. */
|
|
179
|
-
path?: string;
|
|
180
|
-
/** @deprecated single-UI path override; applies to the single `ui` when a string. */
|
|
181
|
-
uiPath?: string;
|
|
182
|
-
}
|
package/dist/openapi/types.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Zod v4 exposes `schema.toJSONSchema()` on every schema instance — an
|
|
2
|
-
// authoritative, zero-cost converter. We delegate to it when present and
|
|
3
|
-
// strip the `$schema` meta so the result embeds cleanly into OpenAPI
|
|
4
|
-
// components. For non-Zod schemas (anything that doesn't expose the
|
|
5
|
-
// method) we return an empty (permissive) schema.
|
|
6
|
-
function stripOpenApiIncompatible(schema) {
|
|
7
|
-
const out = {
|
|
8
|
-
...schema
|
|
9
|
-
};
|
|
10
|
-
delete out.$schema;
|
|
11
|
-
// Zod v4 emits `additionalProperties: false` by default; users rarely
|
|
12
|
-
// want that constraint in their published OpenAPI doc, so leave it in
|
|
13
|
-
// — it's a faithful reflection of the schema. No change here.
|
|
14
|
-
if (Array.isArray(out.properties)) {
|
|
15
|
-
// shouldn't happen, but guard
|
|
16
|
-
} else if (out.properties && typeof out.properties === 'object') {
|
|
17
|
-
const props = out.properties;
|
|
18
|
-
const cleaned = {};
|
|
19
|
-
for (const [key, val] of Object.entries(props)){
|
|
20
|
-
cleaned[key] = stripOpenApiIncompatible(val);
|
|
21
|
-
}
|
|
22
|
-
out.properties = cleaned;
|
|
23
|
-
}
|
|
24
|
-
if (out.items && typeof out.items === 'object') {
|
|
25
|
-
out.items = stripOpenApiIncompatible(out.items);
|
|
26
|
-
}
|
|
27
|
-
return out;
|
|
28
|
-
}
|
|
29
|
-
export function zodToJsonSchema(schema) {
|
|
30
|
-
if (!schema || typeof schema !== 'object') return {};
|
|
31
|
-
const maybe = schema.toJSONSchema;
|
|
32
|
-
if (typeof maybe === 'function') {
|
|
33
|
-
try {
|
|
34
|
-
const result = maybe.call(schema);
|
|
35
|
-
if (result && typeof result === 'object') {
|
|
36
|
-
return stripOpenApiIncompatible(result);
|
|
37
|
-
}
|
|
38
|
-
} catch {
|
|
39
|
-
// Zod may refuse to convert certain schemas; fall through.
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return {};
|
|
43
|
-
}
|
|
44
|
-
// Zod v4 and v3 both name constructors `ZodOptional` / `ZodDefault` /
|
|
45
|
-
// `ZodNullable`. Checking the constructor name is cheap and avoids
|
|
46
|
-
// depending on internal `_def` shape.
|
|
47
|
-
function ctorName(schema) {
|
|
48
|
-
if (!schema || typeof schema !== 'object') return undefined;
|
|
49
|
-
return schema.constructor?.name;
|
|
50
|
-
}
|
|
51
|
-
export function isOptional(schema) {
|
|
52
|
-
const name = ctorName(schema);
|
|
53
|
-
return name === 'ZodOptional' || name === 'ZodDefault';
|
|
54
|
-
}
|
|
55
|
-
export function isNullable(schema) {
|
|
56
|
-
return ctorName(schema) === 'ZodNullable';
|
|
57
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Container } from '../container/container';
|
|
2
|
-
import type { RouteManager } from '../http/route.manager';
|
|
3
|
-
import type { ModuleLoader } from '../module/module-loader';
|
|
4
|
-
/**
|
|
5
|
-
* Bind every APP_* provider registered in the container as a global
|
|
6
|
-
* component on the RouteManager. The single source of truth for app-level
|
|
7
|
-
* pipeline configuration — used by both VelaFactory.create and
|
|
8
|
-
* @velajs/testing's TestingModuleBuilder.compile.
|
|
9
|
-
*/
|
|
10
|
-
export declare function bindAppProviders(routeManager: RouteManager, container: Container, loader: ModuleLoader): void;
|