@tstdl/base 0.72.0-beta1 → 0.78.0-beta3
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/.eslintrc.js +11 -8
- package/api/client/client.d.ts +4 -3
- package/api/client/client.js +29 -35
- package/api/client/client.js.map +1 -1
- package/api/client/index.d.ts +1 -1
- package/api/client/index.js +17 -1
- package/api/client/index.js.map +1 -1
- package/api/default-error-handlers.d.ts +2 -6
- package/api/default-error-handlers.js +15 -12
- package/api/default-error-handlers.js.map +1 -1
- package/api/index.d.ts +3 -3
- package/api/index.js +19 -3
- package/api/index.js.map +1 -1
- package/api/response.d.ts +2 -2
- package/api/response.js +44 -41
- package/api/response.js.map +1 -1
- package/api/server/api-controller.d.ts +3 -3
- package/api/server/api-controller.js +16 -9
- package/api/server/api-controller.js.map +1 -1
- package/api/server/error-handler.d.ts +3 -3
- package/api/server/error-handler.js +15 -12
- package/api/server/error-handler.js.map +1 -1
- package/api/server/gateway.d.ts +13 -8
- package/api/server/gateway.js +66 -67
- package/api/server/gateway.js.map +1 -1
- package/api/server/index.d.ts +4 -3
- package/api/server/index.js +20 -3
- package/api/server/index.js.map +1 -1
- package/api/server/middlewares/allowed-methods.middleware.d.ts +4 -4
- package/api/server/middlewares/allowed-methods.middleware.js +11 -7
- package/api/server/middlewares/allowed-methods.middleware.js.map +1 -1
- package/api/server/middlewares/catch-error.middleware.d.ts +3 -3
- package/api/server/middlewares/catch-error.middleware.js +7 -3
- package/api/server/middlewares/catch-error.middleware.js.map +1 -1
- package/api/server/middlewares/cors.middleware.d.ts +3 -3
- package/api/server/middlewares/cors.middleware.js +18 -14
- package/api/server/middlewares/cors.middleware.js.map +1 -1
- package/api/server/middlewares/index.d.ts +4 -4
- package/api/server/middlewares/index.js +20 -4
- package/api/server/middlewares/index.js.map +1 -1
- package/api/server/middlewares/response-time.middleware.d.ts +2 -2
- package/api/server/middlewares/response-time.middleware.js +9 -5
- package/api/server/middlewares/response-time.middleware.js.map +1 -1
- package/api/server/module.d.ts +8 -5
- package/api/server/module.js +19 -9
- package/api/server/module.js.map +1 -1
- package/api/server/tokens.d.ts +2 -0
- package/api/server/tokens.js +6 -0
- package/api/server/tokens.js.map +1 -0
- package/api/types.d.ts +12 -40
- package/api/types.js +15 -8
- package/api/types.js.map +1 -1
- package/application/application.d.ts +6 -5
- package/application/application.js +43 -30
- package/application/application.js.map +1 -1
- package/application/index.d.ts +1 -1
- package/application/index.js +17 -1
- package/application/index.js.map +1 -1
- package/async-iterator-symbol.js +5 -1
- package/async-iterator-symbol.js.map +1 -1
- package/collections/awaitable/awaitable-list.d.ts +1 -1
- package/collections/awaitable/awaitable-list.js +13 -8
- package/collections/awaitable/awaitable-list.js.map +1 -1
- package/collections/awaitable/awaitable-map.js +13 -9
- package/collections/awaitable/awaitable-map.js.map +1 -1
- package/collections/awaitable/awaitable-set.js +9 -5
- package/collections/awaitable/awaitable-set.js.map +1 -1
- package/collections/awaitable/index.d.ts +3 -3
- package/collections/awaitable/index.js +19 -3
- package/collections/awaitable/index.js.map +1 -1
- package/collections/collection.js +2 -1
- package/collections/index.d.ts +6 -6
- package/collections/index.js +22 -6
- package/collections/index.js.map +1 -1
- package/collections/keyed-set.js +9 -5
- package/collections/keyed-set.js.map +1 -1
- package/collections/list.d.ts +1 -1
- package/collections/list.js +2 -1
- package/collections/observable/index.d.ts +8 -8
- package/collections/observable/index.js +24 -8
- package/collections/observable/index.js.map +1 -1
- package/collections/observable/observable-array.d.ts +2 -2
- package/collections/observable/observable-array.js +6 -2
- package/collections/observable/observable-array.js.map +1 -1
- package/collections/observable/observable-collection-base.d.ts +2 -2
- package/collections/observable/observable-collection-base.js +23 -18
- package/collections/observable/observable-collection-base.js.map +1 -1
- package/collections/observable/observable-collection.d.ts +1 -1
- package/collections/observable/observable-collection.js +2 -1
- package/collections/observable/observable-list-base.d.ts +3 -3
- package/collections/observable/observable-list-base.js +15 -11
- package/collections/observable/observable-list-base.js.map +1 -1
- package/collections/observable/observable-list.d.ts +3 -3
- package/collections/observable/observable-list.js +2 -1
- package/collections/observable/observable-map.js +7 -3
- package/collections/observable/observable-map.js.map +1 -1
- package/collections/observable/observable-set.d.ts +2 -2
- package/collections/observable/observable-set.js +6 -2
- package/collections/observable/observable-set.js.map +1 -1
- package/collections/observable/observable-sorted-array-list.d.ts +3 -3
- package/collections/observable/observable-sorted-array-list.js +25 -21
- package/collections/observable/observable-sorted-array-list.js.map +1 -1
- package/collections/sorted-array-list.d.ts +2 -2
- package/collections/sorted-array-list.js +21 -17
- package/collections/sorted-array-list.js.map +1 -1
- package/collections/sorted-list.d.ts +1 -1
- package/collections/sorted-list.js +2 -1
- package/collections/sorted-map.d.ts +2 -2
- package/collections/sorted-map.js +12 -8
- package/collections/sorted-map.js.map +1 -1
- package/container/container.d.ts +6 -5
- package/container/container.js +147 -133
- package/container/container.js.map +1 -1
- package/container/decorators.d.ts +16 -13
- package/container/decorators.js +77 -84
- package/container/decorators.js.map +1 -1
- package/container/index.d.ts +10 -10
- package/container/index.js +26 -10
- package/container/index.js.map +1 -1
- package/container/interfaces.js +4 -2
- package/container/interfaces.js.map +1 -1
- package/container/provider.d.ts +4 -4
- package/container/provider.js +24 -13
- package/container/provider.js.map +1 -1
- package/container/resolve-chain.d.ts +6 -6
- package/container/resolve-chain.js +12 -7
- package/container/resolve-chain.js.map +1 -1
- package/container/resolve.error.d.ts +2 -2
- package/container/resolve.error.js +8 -4
- package/container/resolve.error.js.map +1 -1
- package/container/token.d.ts +1 -1
- package/container/token.js +10 -5
- package/container/token.js.map +1 -1
- package/container/type-info.d.ts +3 -23
- package/container/type-info.js +2 -36
- package/container/type-info.js.map +1 -1
- package/container/types.d.ts +2 -2
- package/container/types.js +2 -1
- package/container/utils.d.ts +2 -2
- package/container/utils.js +23 -30
- package/container/utils.js.map +1 -1
- package/core.d.ts +4 -4
- package/core.js +24 -20
- package/core.js.map +1 -1
- package/css/theme/index.d.ts +2 -2
- package/css/theme/index.js +18 -2
- package/css/theme/index.js.map +1 -1
- package/css/theme/theme.model.js +5 -1
- package/css/theme/theme.model.js.map +1 -1
- package/css/theme/theme.service.d.ts +1 -1
- package/css/theme/theme.service.js +16 -12
- package/css/theme/theme.service.js.map +1 -1
- package/data-structures/array-list.d.ts +2 -2
- package/data-structures/array-list.js +6 -2
- package/data-structures/array-list.js.map +1 -1
- package/data-structures/circular-buffer.d.ts +2 -2
- package/data-structures/circular-buffer.js +25 -21
- package/data-structures/circular-buffer.js.map +1 -1
- package/data-structures/collection.d.ts +3 -2
- package/data-structures/collection.js +21 -13
- package/data-structures/collection.js.map +1 -1
- package/data-structures/index-out-of-bounds.error.d.ts +1 -1
- package/data-structures/index-out-of-bounds.error.js +9 -5
- package/data-structures/index-out-of-bounds.error.js.map +1 -1
- package/data-structures/index.d.ts +11 -9
- package/data-structures/index.js +27 -9
- package/data-structures/index.js.map +1 -1
- package/data-structures/iterable-weak-map.d.ts +29 -0
- package/data-structures/iterable-weak-map.js +128 -0
- package/data-structures/iterable-weak-map.js.map +1 -0
- package/data-structures/linked-list.d.ts +4 -4
- package/data-structures/linked-list.js +28 -25
- package/data-structures/linked-list.js.map +1 -1
- package/data-structures/list.d.ts +2 -2
- package/data-structures/list.js +14 -10
- package/data-structures/list.js.map +1 -1
- package/data-structures/multi-key-map.d.ts +13 -2
- package/data-structures/multi-key-map.js +37 -22
- package/data-structures/multi-key-map.js.map +1 -1
- package/data-structures/set.d.ts +18 -0
- package/data-structures/set.js +59 -0
- package/data-structures/set.js.map +1 -0
- package/data-structures/sorted-array-list.d.ts +5 -5
- package/data-structures/sorted-array-list.js +22 -19
- package/data-structures/sorted-array-list.js.map +1 -1
- package/data-structures/weak-ref-map.d.ts +1 -1
- package/data-structures/weak-ref-map.js +17 -13
- package/data-structures/weak-ref-map.js.map +1 -1
- package/database/entity-repository.d.ts +4 -5
- package/database/entity-repository.js +5 -1
- package/database/entity-repository.js.map +1 -1
- package/database/entity.js +2 -1
- package/database/id.js +8 -4
- package/database/id.js.map +1 -1
- package/database/index.d.ts +6 -6
- package/database/index.js +22 -6
- package/database/index.js.map +1 -1
- package/database/module.js +10 -6
- package/database/module.js.map +1 -1
- package/database/mongo/classes.d.ts +5 -5
- package/database/mongo/classes.js +14 -11
- package/database/mongo/classes.js.map +1 -1
- package/database/mongo/index.d.ts +10 -10
- package/database/mongo/index.js +26 -10
- package/database/mongo/index.js.map +1 -1
- package/database/mongo/{model.d.ts → model/document.d.ts} +3 -3
- package/database/mongo/model/document.js +84 -0
- package/database/mongo/model/document.js.map +1 -0
- package/database/mongo/model/index.d.ts +1 -0
- package/database/mongo/model/index.js +18 -0
- package/database/mongo/model/index.js.map +1 -0
- package/database/mongo/module.d.ts +1 -1
- package/database/mongo/module.js +31 -27
- package/database/mongo/module.js.map +1 -1
- package/database/mongo/mongo-base.repository.d.ts +5 -5
- package/database/mongo/mongo-base.repository.js +43 -39
- package/database/mongo/mongo-base.repository.js.map +1 -1
- package/database/mongo/mongo-bulk.d.ts +4 -4
- package/database/mongo/mongo-bulk.js +21 -17
- package/database/mongo/mongo-bulk.js.map +1 -1
- package/database/mongo/{mongo-entity.repository.d.ts → mongo-entity-repository.d.ts} +8 -8
- package/database/mongo/{mongo-entity.repository.js → mongo-entity-repository.js} +34 -27
- package/database/mongo/mongo-entity-repository.js.map +1 -0
- package/database/mongo/operations.d.ts +4 -4
- package/database/mongo/operations.js +15 -6
- package/database/mongo/operations.js.map +1 -1
- package/database/mongo/query-converter.d.ts +4 -4
- package/database/mongo/query-converter.js +17 -12
- package/database/mongo/query-converter.js.map +1 -1
- package/database/mongo/simple-entity-repository.d.ts +7 -0
- package/database/mongo/simple-entity-repository.js +11 -0
- package/database/mongo/simple-entity-repository.js.map +1 -0
- package/database/mongo/types.d.ts +4 -4
- package/database/mongo/types.js +5 -1
- package/database/mongo/types.js.map +1 -1
- package/database/query.d.ts +2 -2
- package/database/query.js +10 -7
- package/database/query.js.map +1 -1
- package/database/utils.d.ts +1 -1
- package/database/utils.js +5 -1
- package/database/utils.js.map +1 -1
- package/disposable/async-disposer.d.ts +4 -4
- package/disposable/async-disposer.js +24 -20
- package/disposable/async-disposer.js.map +1 -1
- package/disposable/disposable.js +12 -7
- package/disposable/disposable.js.map +1 -1
- package/disposable/index.d.ts +3 -3
- package/disposable/index.js +19 -3
- package/disposable/index.js.map +1 -1
- package/disposable/using.d.ts +1 -1
- package/disposable/using.js +10 -5
- package/disposable/using.js.map +1 -1
- package/distributed-loop/controller.js +2 -1
- package/distributed-loop/distributed-loop.d.ts +5 -5
- package/distributed-loop/distributed-loop.js +18 -15
- package/distributed-loop/distributed-loop.js.map +1 -1
- package/distributed-loop/index.d.ts +3 -3
- package/distributed-loop/index.js +19 -3
- package/distributed-loop/index.js.map +1 -1
- package/distributed-loop/provider.d.ts +2 -2
- package/distributed-loop/provider.js +10 -7
- package/distributed-loop/provider.js.map +1 -1
- package/enumerable/async-enumerable.d.ts +12 -9
- package/enumerable/async-enumerable.js +84 -67
- package/enumerable/async-enumerable.js.map +1 -1
- package/enumerable/enumerable-methods.d.ts +3 -0
- package/enumerable/enumerable-methods.js +2 -1
- package/enumerable/enumerable.d.ts +10 -7
- package/enumerable/enumerable.js +61 -45
- package/enumerable/enumerable.js.map +1 -1
- package/enumerable/index.d.ts +2 -2
- package/enumerable/index.js +18 -2
- package/enumerable/index.js.map +1 -1
- package/error/api.error.d.ts +2 -2
- package/error/api.error.js +6 -2
- package/error/api.error.js.map +1 -1
- package/error/assertion.error.d.ts +1 -1
- package/error/assertion.error.js +6 -2
- package/error/assertion.error.js.map +1 -1
- package/error/bad-request.error.d.ts +1 -1
- package/error/bad-request.error.js +6 -2
- package/error/bad-request.error.js.map +1 -1
- package/error/custom.error.d.ts +3 -1
- package/error/custom.error.js +21 -8
- package/error/custom.error.js.map +1 -1
- package/error/details.error.d.ts +1 -1
- package/error/details.error.js +6 -2
- package/error/details.error.js.map +1 -1
- package/error/forbidden.error.d.ts +1 -1
- package/error/forbidden.error.js +6 -2
- package/error/forbidden.error.js.map +1 -1
- package/error/index.d.ts +15 -15
- package/error/index.js +31 -15
- package/error/index.js.map +1 -1
- package/error/invalid-token.error.d.ts +1 -1
- package/error/invalid-token.error.js +6 -2
- package/error/invalid-token.error.js.map +1 -1
- package/error/max-bytes-exceeded.error.d.ts +1 -1
- package/error/max-bytes-exceeded.error.js +6 -2
- package/error/max-bytes-exceeded.error.js.map +1 -1
- package/error/method-not-allowed.error.d.ts +1 -1
- package/error/method-not-allowed.error.js +6 -2
- package/error/method-not-allowed.error.js.map +1 -1
- package/error/multi.error.d.ts +1 -1
- package/error/multi.error.js +6 -2
- package/error/multi.error.js.map +1 -1
- package/error/not-found.error.d.ts +1 -1
- package/error/not-found.error.js +6 -2
- package/error/not-found.error.js.map +1 -1
- package/error/not-implemented.error.d.ts +1 -1
- package/error/not-implemented.error.js +6 -2
- package/error/not-implemented.error.js.map +1 -1
- package/error/unauthorized.error.d.ts +1 -1
- package/error/unauthorized.error.js +6 -2
- package/error/unauthorized.error.js.map +1 -1
- package/error/unsupported-media-type.error.d.ts +1 -1
- package/error/unsupported-media-type.error.js +6 -2
- package/error/unsupported-media-type.error.js.map +1 -1
- package/error/validation.error.d.ts +1 -1
- package/error/validation.error.js +6 -2
- package/error/validation.error.js.map +1 -1
- package/examples/api/basic-overview.js +47 -38
- package/examples/api/basic-overview.js.map +1 -1
- package/examples/http/client.d.ts +1 -0
- package/examples/http/client.js +18 -0
- package/examples/http/client.js.map +1 -0
- package/examples/mail/basic.d.ts +1 -0
- package/examples/mail/basic.js +33 -0
- package/examples/mail/basic.js.map +1 -0
- package/examples/pdf/basic.d.ts +1 -0
- package/examples/pdf/basic.js +24 -0
- package/examples/pdf/basic.js.map +1 -0
- package/examples/pdf/templates/hello-name.d.ts +5 -0
- package/examples/pdf/templates/hello-name.js +10 -0
- package/examples/pdf/templates/hello-name.js.map +1 -0
- package/examples/reflection/basic.d.ts +11 -0
- package/examples/reflection/basic.js +72 -0
- package/examples/reflection/basic.js.map +1 -0
- package/global-this.js +5 -1
- package/global-this.js.map +1 -1
- package/http/client/adapters/got-http-client.adapter.d.ts +3 -3
- package/http/client/adapters/got-http-client.adapter.js +40 -36
- package/http/client/adapters/got-http-client.adapter.js.map +1 -1
- package/http/client/adapters/undici-http-client.adapter.d.ts +5 -5
- package/http/client/adapters/undici-http-client.adapter.js +35 -31
- package/http/client/adapters/undici-http-client.adapter.js.map +1 -1
- package/http/client/adapters/utils.d.ts +2 -2
- package/http/client/adapters/utils.js +19 -12
- package/http/client/adapters/utils.js.map +1 -1
- package/http/client/http-client-request.d.ts +13 -13
- package/http/client/http-client-request.js +26 -22
- package/http/client/http-client-request.js.map +1 -1
- package/http/client/http-client-response.d.ts +5 -5
- package/http/client/http-client-response.js +7 -3
- package/http/client/http-client-response.js.map +1 -1
- package/http/client/http-client.adapter.d.ts +3 -3
- package/http/client/http-client.adapter.js +5 -1
- package/http/client/http-client.adapter.js.map +1 -1
- package/http/client/http-client.d.ts +10 -10
- package/http/client/http-client.js +50 -46
- package/http/client/http-client.js.map +1 -1
- package/http/client/index.d.ts +4 -4
- package/http/client/index.js +20 -4
- package/http/client/index.js.map +1 -1
- package/http/cookie-parser.d.ts +1 -1
- package/http/cookie-parser.js +9 -5
- package/http/cookie-parser.js.map +1 -1
- package/http/http-form.d.ts +3 -3
- package/http/http-form.js +6 -2
- package/http/http-form.js.map +1 -1
- package/http/http-headers.d.ts +3 -3
- package/http/http-headers.js +19 -15
- package/http/http-headers.js.map +1 -1
- package/http/http-query.d.ts +3 -3
- package/http/http-query.js +6 -2
- package/http/http-query.js.map +1 -1
- package/http/http-url-parameters.d.ts +3 -3
- package/http/http-url-parameters.js +6 -2
- package/http/http-url-parameters.js.map +1 -1
- package/http/http-value-map.d.ts +2 -2
- package/http/http-value-map.js +23 -19
- package/http/http-value-map.js.map +1 -1
- package/http/http.error.d.ts +6 -4
- package/http/http.error.js +17 -7
- package/http/http.error.js.map +1 -1
- package/http/index.d.ts +9 -9
- package/http/index.js +25 -9
- package/http/index.js.map +1 -1
- package/http/server/http-server-request.d.ts +5 -5
- package/http/server/http-server-request.js +17 -13
- package/http/server/http-server-request.js.map +1 -1
- package/http/server/http-server-response.d.ts +4 -3
- package/http/server/http-server-response.js +10 -3
- package/http/server/http-server-response.js.map +1 -1
- package/http/server/http-server.d.ts +3 -2
- package/http/server/http-server.js +6 -2
- package/http/server/http-server.js.map +1 -1
- package/http/server/index.d.ts +3 -3
- package/http/server/index.js +19 -3
- package/http/server/index.js.map +1 -1
- package/http/server/node/index.d.ts +2 -2
- package/http/server/node/index.js +18 -2
- package/http/server/node/index.js.map +1 -1
- package/http/server/node/module.js +9 -5
- package/http/server/node/module.js.map +1 -1
- package/http/server/node/node-http-server.d.ts +8 -8
- package/http/server/node/node-http-server.js +47 -44
- package/http/server/node/node-http-server.js.map +1 -1
- package/http/types.d.ts +1 -1
- package/http/types.js +16 -9
- package/http/types.js.map +1 -1
- package/image-service/image-service.d.ts +32 -65
- package/image-service/image-service.js +77 -15
- package/image-service/image-service.js.map +1 -1
- package/image-service/imgproxy/imgproxy-image-service.d.ts +5 -5
- package/image-service/imgproxy/imgproxy-image-service.js +35 -31
- package/image-service/imgproxy/imgproxy-image-service.js.map +1 -1
- package/image-service/imgproxy/index.d.ts +1 -1
- package/image-service/imgproxy/index.js +17 -1
- package/image-service/imgproxy/index.js.map +1 -1
- package/image-service/index.d.ts +1 -1
- package/image-service/index.js +17 -1
- package/image-service/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +17 -1
- package/index.js.map +1 -1
- package/interfaces.js +2 -1
- package/json-path/index.d.ts +1 -1
- package/json-path/index.js +17 -1
- package/json-path/index.js.map +1 -1
- package/json-path/json-path.d.ts +8 -3
- package/json-path/json-path.js +40 -17
- package/json-path/json-path.js.map +1 -1
- package/key-value-store/index.d.ts +2 -2
- package/key-value-store/index.js +18 -2
- package/key-value-store/index.js.map +1 -1
- package/key-value-store/key-value-store.provider.d.ts +2 -2
- package/key-value-store/key-value-store.provider.js +5 -1
- package/key-value-store/key-value-store.provider.js.map +1 -1
- package/key-value-store/key-value.store.d.ts +3 -3
- package/key-value-store/key-value.store.js +6 -2
- package/key-value-store/key-value.store.js.map +1 -1
- package/key-value-store/mongo/index.d.ts +5 -5
- package/key-value-store/mongo/index.js +21 -5
- package/key-value-store/mongo/index.js.map +1 -1
- package/key-value-store/mongo/module.d.ts +2 -2
- package/key-value-store/mongo/module.js +14 -10
- package/key-value-store/mongo/module.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value-store.provider.d.ts +3 -3
- package/key-value-store/mongo/mongo-key-value-store.provider.js +10 -7
- package/key-value-store/mongo/mongo-key-value-store.provider.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +2 -1
- package/key-value-store/mongo/mongo-key-value.model.js +2 -1
- package/key-value-store/mongo/mongo-key-value.repository.d.ts +6 -6
- package/key-value-store/mongo/mongo-key-value.repository.js +14 -11
- package/key-value-store/mongo/mongo-key-value.repository.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value.store.d.ts +3 -3
- package/key-value-store/mongo/mongo-key-value.store.js +19 -16
- package/key-value-store/mongo/mongo-key-value.store.js.map +1 -1
- package/lock/index.d.ts +2 -2
- package/lock/index.js +18 -2
- package/lock/index.js.map +1 -1
- package/lock/lock.d.ts +2 -2
- package/lock/lock.js +6 -2
- package/lock/lock.js.map +1 -1
- package/lock/mongo/index.d.ts +5 -5
- package/lock/mongo/index.js +21 -5
- package/lock/mongo/index.js.map +1 -1
- package/lock/mongo/lock.d.ts +4 -4
- package/lock/mongo/lock.js +32 -29
- package/lock/mongo/lock.js.map +1 -1
- package/lock/mongo/model.d.ts +1 -1
- package/lock/mongo/model.js +2 -1
- package/lock/mongo/module.d.ts +2 -2
- package/lock/mongo/module.js +14 -10
- package/lock/mongo/module.js.map +1 -1
- package/lock/mongo/{mongo-lock.repository.d.ts → mongo-lock-repository.d.ts} +6 -6
- package/lock/mongo/{mongo-lock.repository.js → mongo-lock-repository.js} +20 -17
- package/lock/mongo/mongo-lock-repository.js.map +1 -0
- package/lock/mongo/provider.d.ts +4 -4
- package/lock/mongo/provider.js +19 -16
- package/lock/mongo/provider.js.map +1 -1
- package/lock/provider.d.ts +3 -3
- package/lock/provider.js +6 -2
- package/lock/provider.js.map +1 -1
- package/logger/console/index.d.ts +1 -1
- package/logger/console/index.js +17 -1
- package/logger/console/index.js.map +1 -1
- package/logger/console/logger.d.ts +3 -3
- package/logger/console/logger.js +22 -19
- package/logger/console/logger.js.map +1 -1
- package/logger/index.d.ts +2 -2
- package/logger/index.js +18 -2
- package/logger/index.js.map +1 -1
- package/logger/level.js +5 -2
- package/logger/level.js.map +1 -1
- package/logger/logger.d.ts +3 -3
- package/logger/logger.js +17 -13
- package/logger/logger.js.map +1 -1
- package/logger/noop/index.d.ts +1 -1
- package/logger/noop/index.js +17 -1
- package/logger/noop/index.js.map +1 -1
- package/logger/noop/logger.d.ts +1 -1
- package/logger/noop/logger.js +9 -5
- package/logger/noop/logger.js.map +1 -1
- package/mail/clients/nodemailer.mail-client.d.ts +2 -2
- package/mail/clients/nodemailer.mail-client.js +18 -14
- package/mail/clients/nodemailer.mail-client.js.map +1 -1
- package/mail/index.d.ts +8 -8
- package/mail/index.js +24 -8
- package/mail/index.js.map +1 -1
- package/mail/mail-log.repository.d.ts +2 -2
- package/mail/mail-log.repository.js +6 -2
- package/mail/mail-log.repository.js.map +1 -1
- package/mail/mail-template-renderer.provider.d.ts +1 -1
- package/mail/mail-template-renderer.provider.js +9 -6
- package/mail/mail-template-renderer.provider.js.map +1 -1
- package/mail/mail-template.provider.d.ts +1 -1
- package/mail/mail-template.provider.js +5 -1
- package/mail/mail-template.provider.js.map +1 -1
- package/mail/mail-template.renderer.d.ts +1 -1
- package/mail/mail-template.renderer.js +5 -1
- package/mail/mail-template.renderer.js.map +1 -1
- package/mail/mail.client.d.ts +3 -3
- package/mail/mail.client.js +6 -2
- package/mail/mail.client.js.map +1 -1
- package/mail/mail.service.d.ts +8 -7
- package/mail/mail.service.js +32 -24
- package/mail/mail.service.js.map +1 -1
- package/mail/models/index.d.ts +6 -6
- package/mail/models/index.js +22 -6
- package/mail/models/index.js.map +1 -1
- package/mail/models/mail-address.model.js +2 -1
- package/mail/models/mail-content.model.js +2 -1
- package/mail/models/mail-data.model.d.ts +3 -3
- package/mail/models/mail-data.model.js +2 -1
- package/mail/models/mail-log.model.d.ts +6 -6
- package/mail/models/mail-log.model.js +2 -1
- package/mail/models/mail-send-result.model.d.ts +1 -1
- package/mail/models/mail-send-result.model.js +2 -1
- package/mail/models/mail-template.model.d.ts +0 -1
- package/mail/models/mail-template.model.js +2 -1
- package/mail/module.d.ts +6 -6
- package/mail/module.js +25 -21
- package/mail/module.js.map +1 -1
- package/mail/repositories/mongo-mail-log.repository.d.ts +6 -6
- package/mail/repositories/mongo-mail-log.repository.js +17 -13
- package/mail/repositories/mongo-mail-log.repository.js.map +1 -1
- package/mail/template-providers/file-mail-template.provider.d.ts +8 -9
- package/mail/template-providers/file-mail-template.provider.js +29 -47
- package/mail/template-providers/file-mail-template.provider.js.map +1 -1
- package/mail/template-providers/memory-mail-template.provider.d.ts +4 -6
- package/mail/template-providers/memory-mail-template.provider.js +8 -17
- package/mail/template-providers/memory-mail-template.provider.js.map +1 -1
- package/mail/template-renderers/handlebars.mail-template-renderer.d.ts +9 -7
- package/mail/template-renderers/handlebars.mail-template-renderer.js +33 -14
- package/mail/template-renderers/handlebars.mail-template-renderer.js.map +1 -1
- package/mail/template-renderers/mjml.mail-template-renderer.d.ts +9 -10
- package/mail/template-renderers/mjml.mail-template-renderer.js +38 -37
- package/mail/template-renderers/mjml.mail-template-renderer.js.map +1 -1
- package/mail/tokens.d.ts +5 -5
- package/mail/tokens.js +6 -3
- package/mail/tokens.js.map +1 -1
- package/memory/index.d.ts +1 -1
- package/memory/index.js +17 -1
- package/memory/index.js.map +1 -1
- package/memory/observable-finalization-registry.js +7 -3
- package/memory/observable-finalization-registry.js.map +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.d.ts +3 -3
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.js +7 -3
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.js.map +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.d.ts +3 -3
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.js +10 -6
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.js.map +1 -1
- package/message-bus/broadcast-channel/index.d.ts +2 -2
- package/message-bus/broadcast-channel/index.js +18 -2
- package/message-bus/broadcast-channel/index.js.map +1 -1
- package/message-bus/index.d.ts +3 -3
- package/message-bus/index.js +19 -3
- package/message-bus/index.js.map +1 -1
- package/message-bus/local/index.d.ts +2 -2
- package/message-bus/local/index.js +18 -2
- package/message-bus/local/index.js.map +1 -1
- package/message-bus/local/local-message-bus-provider.d.ts +3 -3
- package/message-bus/local/local-message-bus-provider.js +24 -20
- package/message-bus/local/local-message-bus-provider.js.map +1 -1
- package/message-bus/local/local-message-bus.d.ts +4 -4
- package/message-bus/local/local-message-bus.js +16 -13
- package/message-bus/local/local-message-bus.js.map +1 -1
- package/message-bus/local/types.js +2 -1
- package/message-bus/message-bus-base.d.ts +4 -4
- package/message-bus/message-bus-base.js +15 -11
- package/message-bus/message-bus-base.js.map +1 -1
- package/message-bus/message-bus-provider.d.ts +1 -1
- package/message-bus/message-bus-provider.js +5 -1
- package/message-bus/message-bus-provider.js.map +1 -1
- package/message-bus/message-bus.d.ts +4 -4
- package/message-bus/message-bus.js +7 -3
- package/message-bus/message-bus.js.map +1 -1
- package/migration/index.d.ts +3 -3
- package/migration/index.js +19 -3
- package/migration/index.js.map +1 -1
- package/migration/migration-state-repository.d.ts +2 -2
- package/migration/migration-state-repository.js +6 -2
- package/migration/migration-state-repository.js.map +1 -1
- package/migration/migration-state.d.ts +1 -1
- package/migration/migration-state.js +2 -1
- package/migration/migrator.d.ts +3 -3
- package/migration/migrator.js +26 -23
- package/migration/migrator.js.map +1 -1
- package/migration/mongo/index.d.ts +2 -2
- package/migration/mongo/index.js +18 -2
- package/migration/mongo/index.js.map +1 -1
- package/migration/mongo/migration-state-repository.d.ts +7 -7
- package/migration/mongo/migration-state-repository.js +15 -12
- package/migration/mongo/migration-state-repository.js.map +1 -1
- package/migration/mongo/module.d.ts +2 -2
- package/migration/mongo/module.js +11 -7
- package/migration/mongo/module.js.map +1 -1
- package/module/index.d.ts +4 -4
- package/module/index.js +20 -4
- package/module/index.js.map +1 -1
- package/module/module-base.d.ts +5 -5
- package/module/module-base.js +15 -11
- package/module/module-base.js.map +1 -1
- package/module/module-metric-reporter.d.ts +4 -4
- package/module/module-metric-reporter.js +12 -8
- package/module/module-metric-reporter.js.map +1 -1
- package/module/module.d.ts +1 -1
- package/module/module.js +7 -4
- package/module/module.js.map +1 -1
- package/module/modules/function.module.d.ts +10 -0
- package/module/modules/function.module.js +16 -0
- package/module/modules/function.module.js.map +1 -0
- package/module/modules/index.d.ts +2 -2
- package/module/modules/index.js +18 -2
- package/module/modules/index.js.map +1 -1
- package/module/modules/web-server.module.d.ts +10 -11
- package/module/modules/web-server.module.js +25 -29
- package/module/modules/web-server.module.js.map +1 -1
- package/module/utils.d.ts +2 -2
- package/module/utils.js +7 -2
- package/module/utils.js.map +1 -1
- package/object-storage/index.d.ts +3 -3
- package/object-storage/index.js +19 -3
- package/object-storage/index.js.map +1 -1
- package/object-storage/object-storage-provider.d.ts +1 -1
- package/object-storage/object-storage-provider.js +5 -1
- package/object-storage/object-storage-provider.js.map +1 -1
- package/object-storage/object-storage.d.ts +8 -3
- package/object-storage/object-storage.js +6 -2
- package/object-storage/object-storage.js.map +1 -1
- package/object-storage/object.js +2 -1
- package/object-storage/s3/index.d.ts +3 -3
- package/object-storage/s3/index.js +19 -3
- package/object-storage/s3/index.js.map +1 -1
- package/object-storage/s3/s3.object-storage-provider.d.ts +3 -3
- package/object-storage/s3/s3.object-storage-provider.js +24 -20
- package/object-storage/s3/s3.object-storage-provider.js.map +1 -1
- package/object-storage/s3/s3.object-storage.d.ts +4 -3
- package/object-storage/s3/s3.object-storage.js +24 -17
- package/object-storage/s3/s3.object-storage.js.map +1 -1
- package/object-storage/s3/s3.object.d.ts +1 -1
- package/object-storage/s3/s3.object.js +2 -1
- package/openid-connect/cached-oidc-configuration.service.d.ts +3 -3
- package/openid-connect/cached-oidc-configuration.service.js +17 -14
- package/openid-connect/cached-oidc-configuration.service.js.map +1 -1
- package/openid-connect/index.d.ts +7 -7
- package/openid-connect/index.js +27 -11
- package/openid-connect/index.js.map +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +8 -8
- package/openid-connect/mongo-oidc-state.repository.js +17 -13
- package/openid-connect/mongo-oidc-state.repository.js.map +1 -1
- package/openid-connect/oidc-configuration.service.d.ts +1 -1
- package/openid-connect/oidc-configuration.service.js +15 -12
- package/openid-connect/oidc-configuration.service.js.map +1 -1
- package/openid-connect/oidc-state.model.d.ts +1 -1
- package/openid-connect/oidc-state.model.js +2 -1
- package/openid-connect/oidc-state.repository.d.ts +2 -2
- package/openid-connect/oidc-state.repository.js +6 -2
- package/openid-connect/oidc-state.repository.js.map +1 -1
- package/openid-connect/oidc.service-model.js +2 -1
- package/openid-connect/oidc.service.d.ts +4 -4
- package/openid-connect/oidc.service.js +35 -32
- package/openid-connect/oidc.service.js.map +1 -1
- package/package.json +19 -19
- package/pdf/index.d.ts +1 -0
- package/pdf/index.js +18 -0
- package/pdf/index.js.map +1 -0
- package/pdf/pdf.service.d.ts +33 -0
- package/pdf/pdf.service.js +82 -0
- package/pdf/pdf.service.js.map +1 -0
- package/pool/index.d.ts +1 -0
- package/pool/index.js +18 -0
- package/pool/index.js.map +1 -0
- package/pool/pool.d.ts +24 -0
- package/pool/pool.js +83 -0
- package/pool/pool.js.map +1 -0
- package/process-shutdown.d.ts +2 -2
- package/process-shutdown.js +19 -11
- package/process-shutdown.js.map +1 -1
- package/promise/cancelable-promise.js +5 -1
- package/promise/cancelable-promise.js.map +1 -1
- package/promise/deferred-promise.js +5 -1
- package/promise/deferred-promise.js.map +1 -1
- package/promise/index.d.ts +2 -2
- package/promise/index.js +18 -2
- package/promise/index.js.map +1 -1
- package/queue/enqueue-batch.d.ts +1 -1
- package/queue/enqueue-batch.js +5 -1
- package/queue/enqueue-batch.js.map +1 -1
- package/queue/index.d.ts +3 -3
- package/queue/index.js +19 -3
- package/queue/index.js.map +1 -1
- package/queue/mongo/index.d.ts +4 -4
- package/queue/mongo/index.js +20 -4
- package/queue/mongo/index.js.map +1 -1
- package/queue/mongo/job.d.ts +3 -3
- package/queue/mongo/job.js +2 -1
- package/queue/mongo/mongo-job.repository.d.ts +7 -7
- package/queue/mongo/mongo-job.repository.js +21 -18
- package/queue/mongo/mongo-job.repository.js.map +1 -1
- package/queue/mongo/queue.d.ts +6 -6
- package/queue/mongo/queue.js +49 -46
- package/queue/mongo/queue.js.map +1 -1
- package/queue/mongo/queue.provider.d.ts +10 -10
- package/queue/mongo/queue.provider.js +20 -16
- package/queue/mongo/queue.provider.js.map +1 -1
- package/queue/provider.d.ts +1 -1
- package/queue/provider.js +5 -1
- package/queue/provider.js.map +1 -1
- package/queue/queue.d.ts +4 -4
- package/queue/queue.js +13 -9
- package/queue/queue.js.map +1 -1
- package/random/index.d.ts +1 -1
- package/random/index.js +17 -1
- package/random/index.js.map +1 -1
- package/random/number/index.d.ts +3 -3
- package/random/number/index.js +19 -3
- package/random/number/index.js.map +1 -1
- package/random/number/mulberry32.d.ts +1 -1
- package/random/number/mulberry32.js +8 -3
- package/random/number/mulberry32.js.map +1 -1
- package/random/number/seeded.js +5 -1
- package/random/number/seeded.js.map +1 -1
- package/random/number/sfc32.d.ts +1 -1
- package/random/number/sfc32.js +8 -3
- package/random/number/sfc32.js.map +1 -1
- package/reflection/decorator-data.d.ts +2 -0
- package/reflection/decorator-data.js +68 -0
- package/reflection/decorator-data.js.map +1 -0
- package/reflection/decorators.d.ts +14 -0
- package/reflection/decorators.js +53 -0
- package/reflection/decorators.js.map +1 -0
- package/reflection/index.d.ts +5 -0
- package/reflection/index.js +22 -0
- package/reflection/index.js.map +1 -0
- package/reflection/reflection-data-map.d.ts +10 -0
- package/reflection/reflection-data-map.js +40 -0
- package/reflection/reflection-data-map.js.map +1 -0
- package/reflection/registry.d.ts +58 -0
- package/reflection/registry.js +107 -0
- package/reflection/registry.js.map +1 -0
- package/reflection/types.d.ts +89 -0
- package/reflection/types.js +3 -0
- package/reflection/types.js.map +1 -0
- package/reflection/utils.d.ts +30 -0
- package/reflection/utils.js +103 -0
- package/reflection/utils.js.map +1 -0
- package/rxjs/cast.js +7 -2
- package/rxjs/cast.js.map +1 -1
- package/rxjs/compat/first-value-from.d.ts +2 -0
- package/rxjs/compat/first-value-from.js +9 -0
- package/rxjs/compat/first-value-from.js.map +1 -0
- package/rxjs/compat/index.d.ts +1 -0
- package/rxjs/compat/index.js +18 -0
- package/rxjs/compat/index.js.map +1 -0
- package/rxjs/index.d.ts +11 -11
- package/rxjs/index.js +27 -11
- package/rxjs/index.js.map +1 -1
- package/rxjs/intersection-observer.js +13 -9
- package/rxjs/intersection-observer.js.map +1 -1
- package/rxjs/mutation-observer.js +13 -9
- package/rxjs/mutation-observer.js.map +1 -1
- package/rxjs/noop.js +7 -2
- package/rxjs/noop.js.map +1 -1
- package/rxjs/performance-observer.js +13 -9
- package/rxjs/performance-observer.js.map +1 -1
- package/rxjs/resize-observer.js +13 -9
- package/rxjs/resize-observer.js.map +1 -1
- package/rxjs/retry-backoff.d.ts +1 -1
- package/rxjs/retry-backoff.js +18 -13
- package/rxjs/retry-backoff.js.map +1 -1
- package/rxjs/slow-array.js +10 -5
- package/rxjs/slow-array.js.map +1 -1
- package/rxjs/teardown.js +7 -3
- package/rxjs/teardown.js.map +1 -1
- package/rxjs/timing.js +15 -12
- package/rxjs/timing.js.map +1 -1
- package/rxjs/touch.js +11 -7
- package/rxjs/touch.js.map +1 -1
- package/schema/array-constraints/index.d.ts +2 -0
- package/schema/array-constraints/index.js +19 -0
- package/schema/array-constraints/index.js.map +1 -0
- package/schema/array-constraints/maximum-length.d.ts +11 -0
- package/schema/array-constraints/maximum-length.js +26 -0
- package/schema/array-constraints/maximum-length.js.map +1 -0
- package/schema/array-constraints/minimum-length.d.ts +11 -0
- package/schema/array-constraints/minimum-length.js +26 -0
- package/schema/array-constraints/minimum-length.js.map +1 -0
- package/schema/coercers/boolean.coercer.d.ts +9 -0
- package/schema/coercers/boolean.coercer.js +35 -0
- package/schema/coercers/boolean.coercer.js.map +1 -0
- package/schema/coercers/date.coercer.d.ts +9 -0
- package/schema/coercers/date.coercer.js +24 -0
- package/schema/coercers/date.coercer.js.map +1 -0
- package/schema/coercers/default-value.coercer.d.ts +9 -0
- package/schema/coercers/default-value.coercer.js +16 -0
- package/schema/coercers/default-value.coercer.js.map +1 -0
- package/schema/coercers/index.d.ts +7 -0
- package/schema/coercers/index.js +24 -0
- package/schema/coercers/index.js.map +1 -0
- package/schema/coercers/number.coercer.d.ts +9 -0
- package/schema/coercers/number.coercer.js +22 -0
- package/schema/coercers/number.coercer.js.map +1 -0
- package/schema/coercers/regexp.coercer.d.ts +11 -0
- package/schema/coercers/regexp.coercer.js +24 -0
- package/schema/coercers/regexp.coercer.js.map +1 -0
- package/schema/coercers/string.coercer.d.ts +9 -0
- package/schema/coercers/string.coercer.js +22 -0
- package/schema/coercers/string.coercer.js.map +1 -0
- package/schema/coercers/uint8-array.coercer.d.ts +9 -0
- package/schema/coercers/uint8-array.coercer.js +25 -0
- package/schema/coercers/uint8-array.coercer.js.map +1 -0
- package/schema/constraints/enumeration.d.ts +13 -0
- package/schema/constraints/enumeration.js +29 -0
- package/schema/constraints/enumeration.js.map +1 -0
- package/schema/constraints/generic.d.ts +22 -0
- package/schema/constraints/generic.js +32 -0
- package/schema/constraints/generic.js.map +1 -0
- package/schema/constraints/index.d.ts +12 -0
- package/schema/constraints/index.js +29 -0
- package/schema/constraints/index.js.map +1 -0
- package/schema/constraints/integer.d.ts +12 -0
- package/schema/constraints/integer.js +27 -0
- package/schema/constraints/integer.js.map +1 -0
- package/schema/constraints/length.d.ts +6 -0
- package/schema/constraints/length.js +20 -0
- package/schema/constraints/length.js.map +1 -0
- package/schema/constraints/literal.d.ts +10 -0
- package/schema/constraints/literal.js +26 -0
- package/schema/constraints/literal.js.map +1 -0
- package/schema/constraints/maximum-date.d.ts +12 -0
- package/schema/constraints/maximum-date.js +29 -0
- package/schema/constraints/maximum-date.js.map +1 -0
- package/schema/constraints/maximum-length.d.ts +12 -0
- package/schema/constraints/maximum-length.js +29 -0
- package/schema/constraints/maximum-length.js.map +1 -0
- package/schema/constraints/maximum.d.ts +12 -0
- package/schema/constraints/maximum.js +27 -0
- package/schema/constraints/maximum.js.map +1 -0
- package/schema/constraints/minimum-date.d.ts +12 -0
- package/schema/constraints/minimum-date.js +29 -0
- package/schema/constraints/minimum-date.js.map +1 -0
- package/schema/constraints/minimum-length.d.ts +12 -0
- package/schema/constraints/minimum-length.js +29 -0
- package/schema/constraints/minimum-length.js.map +1 -0
- package/schema/constraints/minimum.d.ts +12 -0
- package/schema/constraints/minimum.js +27 -0
- package/schema/constraints/minimum.js.map +1 -0
- package/schema/constraints/pattern.d.ts +13 -0
- package/schema/constraints/pattern.js +28 -0
- package/schema/constraints/pattern.js.map +1 -0
- package/schema/decorators/array.d.ts +5 -0
- package/schema/decorators/array.js +11 -0
- package/schema/decorators/array.js.map +1 -0
- package/schema/decorators/coerce.d.ts +2 -0
- package/schema/decorators/coerce.js +10 -0
- package/schema/decorators/coerce.js.map +1 -0
- package/schema/decorators/defaulted.d.ts +4 -0
- package/schema/decorators/defaulted.js +11 -0
- package/schema/decorators/defaulted.js.map +1 -0
- package/schema/decorators/index.d.ts +8 -0
- package/schema/decorators/index.js +25 -0
- package/schema/decorators/index.js.map +1 -0
- package/schema/decorators/nullable.d.ts +2 -0
- package/schema/decorators/nullable.js +10 -0
- package/schema/decorators/nullable.js.map +1 -0
- package/schema/decorators/optional.d.ts +2 -0
- package/schema/decorators/optional.js +10 -0
- package/schema/decorators/optional.js.map +1 -0
- package/schema/decorators/property.d.ts +6 -0
- package/schema/decorators/property.js +20 -0
- package/schema/decorators/property.js.map +1 -0
- package/schema/decorators/type.d.ts +3 -0
- package/schema/decorators/type.js +10 -0
- package/schema/decorators/type.js.map +1 -0
- package/schema/decorators/types.d.ts +18 -0
- package/schema/decorators/types.js +3 -0
- package/schema/decorators/types.js.map +1 -0
- package/schema/decorators/utils.d.ts +10 -0
- package/schema/decorators/utils.js +59 -0
- package/schema/decorators/utils.js.map +1 -0
- package/schema/index.d.ts +10 -4
- package/schema/index.js +26 -4
- package/schema/index.js.map +1 -1
- package/schema/schema.d.ts +18 -0
- package/schema/schema.error.d.ts +15 -9
- package/schema/schema.error.js +52 -15
- package/schema/schema.error.js.map +1 -1
- package/schema/schema.js +287 -0
- package/schema/schema.js.map +1 -0
- package/schema/schemas/any.d.ts +4 -8
- package/schema/schemas/any.js +12 -12
- package/schema/schemas/any.js.map +1 -1
- package/schema/schemas/array.d.ts +8 -13
- package/schema/schemas/array.js +19 -43
- package/schema/schemas/array.js.map +1 -1
- package/schema/schemas/assign.d.ts +8 -0
- package/schema/schemas/assign.js +27 -0
- package/schema/schemas/assign.js.map +1 -0
- package/schema/schemas/boolean.d.ts +5 -9
- package/schema/schemas/boolean.js +15 -37
- package/schema/schemas/boolean.js.map +1 -1
- package/schema/schemas/constraint.d.ts +4 -0
- package/schema/schemas/constraint.js +14 -0
- package/schema/schemas/constraint.js.map +1 -0
- package/schema/schemas/date.d.ts +7 -11
- package/schema/schemas/date.js +23 -53
- package/schema/schemas/date.js.map +1 -1
- package/schema/schemas/defaulted.d.ts +3 -15
- package/schema/schemas/defaulted.js +11 -22
- package/schema/schemas/defaulted.js.map +1 -1
- package/schema/schemas/enumeration.d.ts +6 -21
- package/schema/schemas/enumeration.js +17 -49
- package/schema/schemas/enumeration.js.map +1 -1
- package/schema/schemas/exclude.d.ts +4 -0
- package/schema/schemas/exclude.js +17 -0
- package/schema/schemas/exclude.js.map +1 -0
- package/schema/schemas/index.d.ts +23 -24
- package/schema/schemas/index.js +39 -24
- package/schema/schemas/index.js.map +1 -1
- package/schema/schemas/instance.d.ts +2 -12
- package/schema/schemas/instance.js +8 -19
- package/schema/schemas/instance.js.map +1 -1
- package/schema/schemas/literal.d.ts +4 -11
- package/schema/schemas/literal.js +17 -17
- package/schema/schemas/literal.js.map +1 -1
- package/schema/schemas/nullable.d.ts +2 -13
- package/schema/schemas/nullable.js +7 -25
- package/schema/schemas/nullable.js.map +1 -1
- package/schema/schemas/number.d.ts +7 -14
- package/schema/schemas/number.js +31 -44
- package/schema/schemas/number.js.map +1 -1
- package/schema/schemas/object.d.ts +6 -27
- package/schema/schemas/object.js +12 -82
- package/schema/schemas/object.js.map +1 -1
- package/schema/schemas/optional.d.ts +3 -13
- package/schema/schemas/optional.js +7 -25
- package/schema/schemas/optional.js.map +1 -1
- package/schema/schemas/pick.d.ts +4 -0
- package/schema/schemas/pick.js +17 -0
- package/schema/schemas/pick.js.map +1 -0
- package/schema/schemas/readable-stream.d.ts +4 -9
- package/schema/schemas/readable-stream.js +13 -14
- package/schema/schemas/readable-stream.js.map +1 -1
- package/schema/schemas/record.d.ts +4 -0
- package/schema/schemas/record.js +14 -0
- package/schema/schemas/record.js.map +1 -0
- package/schema/schemas/regexp.d.ts +6 -9
- package/schema/schemas/regexp.js +14 -26
- package/schema/schemas/regexp.js.map +1 -1
- package/schema/schemas/string.d.ts +9 -13
- package/schema/schemas/string.js +39 -46
- package/schema/schemas/string.js.map +1 -1
- package/schema/schemas/transform.d.ts +4 -16
- package/schema/schemas/transform.js +10 -35
- package/schema/schemas/transform.js.map +1 -1
- package/schema/schemas/uint8-array.d.ts +8 -11
- package/schema/schemas/uint8-array.js +25 -32
- package/schema/schemas/uint8-array.js.map +1 -1
- package/schema/schemas/union.d.ts +9 -17
- package/schema/schemas/union.js +16 -34
- package/schema/schemas/union.js.map +1 -1
- package/schema/schemas/unknown.d.ts +4 -8
- package/schema/schemas/unknown.js +12 -12
- package/schema/schemas/unknown.js.map +1 -1
- package/schema/transformers/generic.d.ts +13 -0
- package/schema/transformers/generic.js +28 -0
- package/schema/transformers/generic.js.map +1 -0
- package/schema/transformers/index.d.ts +3 -0
- package/schema/transformers/index.js +20 -0
- package/schema/transformers/index.js.map +1 -0
- package/schema/transformers/lowercase.d.ts +9 -0
- package/schema/transformers/lowercase.js +22 -0
- package/schema/transformers/lowercase.js.map +1 -0
- package/schema/transformers/trim.d.ts +9 -0
- package/schema/transformers/trim.js +22 -0
- package/schema/transformers/trim.js.map +1 -0
- package/schema/transformers/uppercase.d.ts +9 -0
- package/schema/transformers/uppercase.js +22 -0
- package/schema/transformers/uppercase.js.map +1 -0
- package/schema/types.d.ts +143 -17
- package/schema/types.js +74 -1
- package/schema/types.js.map +1 -1
- package/schema/utils/index.d.ts +2 -0
- package/schema/utils/index.js +19 -0
- package/schema/utils/index.js.map +1 -0
- package/schema/utils/schema.d.ts +8 -0
- package/schema/utils/schema.js +56 -0
- package/schema/utils/schema.js.map +1 -0
- package/schema/utils/value-type.d.ts +3 -0
- package/schema/utils/value-type.js +19 -0
- package/schema/utils/value-type.js.map +1 -0
- package/search-index/elastic/config.d.ts +3 -3
- package/search-index/elastic/config.js +9 -6
- package/search-index/elastic/config.js.map +1 -1
- package/search-index/elastic/index.d.ts +6 -5
- package/search-index/elastic/index.js +22 -5
- package/search-index/elastic/index.js.map +1 -1
- package/search-index/elastic/keyword-rewriter.d.ts +8 -0
- package/search-index/elastic/keyword-rewriter.js +22 -0
- package/search-index/elastic/keyword-rewriter.js.map +1 -0
- package/search-index/elastic/model/elastic-query.d.ts +1 -1
- package/search-index/elastic/model/elastic-query.js +2 -1
- package/search-index/elastic/model/index-mapping.d.ts +3 -3
- package/search-index/elastic/model/index-mapping.js +7 -3
- package/search-index/elastic/model/index-mapping.js.map +1 -1
- package/search-index/elastic/model/index.d.ts +3 -3
- package/search-index/elastic/model/index.js +19 -3
- package/search-index/elastic/model/index.js.map +1 -1
- package/search-index/elastic/model/sort.d.ts +3 -3
- package/search-index/elastic/model/sort.js +2 -1
- package/search-index/elastic/module.d.ts +4 -4
- package/search-index/elastic/module.js +27 -22
- package/search-index/elastic/module.js.map +1 -1
- package/search-index/elastic/query-builder/boolean-query-builder.d.ts +1 -1
- package/search-index/elastic/query-builder/boolean-query-builder.js +5 -1
- package/search-index/elastic/query-builder/boolean-query-builder.js.map +1 -1
- package/search-index/elastic/query-builder/index.d.ts +1 -1
- package/search-index/elastic/query-builder/index.js +17 -1
- package/search-index/elastic/query-builder/index.js.map +1 -1
- package/search-index/elastic/query-converter.d.ts +4 -4
- package/search-index/elastic/query-converter.js +37 -29
- package/search-index/elastic/query-converter.js.map +1 -1
- package/search-index/elastic/search-index.d.ts +13 -11
- package/search-index/elastic/search-index.js +45 -31
- package/search-index/elastic/search-index.js.map +1 -1
- package/search-index/elastic/sort-converter.d.ts +4 -3
- package/search-index/elastic/sort-converter.js +6 -3
- package/search-index/elastic/sort-converter.js.map +1 -1
- package/search-index/elastic/types.d.ts +1 -1
- package/search-index/elastic/types.js +2 -1
- package/search-index/error.d.ts +1 -1
- package/search-index/error.js +8 -4
- package/search-index/error.js.map +1 -1
- package/search-index/index.d.ts +3 -3
- package/search-index/index.js +19 -3
- package/search-index/index.js.map +1 -1
- package/search-index/memory/index.d.ts +1 -1
- package/search-index/memory/index.js +17 -1
- package/search-index/memory/index.js.map +1 -1
- package/search-index/memory/memory-search-index.d.ts +4 -4
- package/search-index/memory/memory-search-index.js +32 -24
- package/search-index/memory/memory-search-index.js.map +1 -1
- package/search-index/search-index.d.ts +4 -2
- package/search-index/search-index.js +8 -4
- package/search-index/search-index.js.map +1 -1
- package/search-index/search-result.d.ts +1 -1
- package/search-index/search-result.js +2 -1
- package/serializer/handlers/binary.d.ts +2 -2
- package/serializer/handlers/binary.js +20 -11
- package/serializer/handlers/binary.js.map +1 -1
- package/serializer/handlers/date.js +7 -2
- package/serializer/handlers/date.js.map +1 -1
- package/serializer/handlers/error.js +7 -2
- package/serializer/handlers/error.js.map +1 -1
- package/serializer/handlers/index.d.ts +7 -7
- package/serializer/handlers/index.js +23 -7
- package/serializer/handlers/index.js.map +1 -1
- package/serializer/handlers/map.d.ts +1 -1
- package/serializer/handlers/map.js +7 -2
- package/serializer/handlers/map.js.map +1 -1
- package/serializer/handlers/regex.js +7 -2
- package/serializer/handlers/regex.js.map +1 -1
- package/serializer/handlers/register.d.ts +1 -1
- package/serializer/handlers/register.js +21 -17
- package/serializer/handlers/register.js.map +1 -1
- package/serializer/handlers/set.d.ts +2 -2
- package/serializer/handlers/set.js +7 -2
- package/serializer/handlers/set.js.map +1 -1
- package/serializer/index.d.ts +4 -4
- package/serializer/index.js +24 -3
- package/serializer/index.js.map +1 -1
- package/serializer/serializable.d.ts +1 -1
- package/serializer/serializable.js +20 -12
- package/serializer/serializable.js.map +1 -1
- package/serializer/serializer.d.ts +2 -2
- package/serializer/serializer.js +41 -33
- package/serializer/serializer.js.map +1 -1
- package/serializer/types.d.ts +1 -1
- package/serializer/types.js +8 -5
- package/serializer/types.js.map +1 -1
- package/tailwind/colors.d.ts +1 -1
- package/tailwind/colors.js +9 -4
- package/tailwind/colors.js.map +1 -1
- package/tailwind/index.d.ts +1 -1
- package/tailwind/index.js +17 -1
- package/tailwind/index.js.map +1 -1
- package/templates/index.d.ts +7 -0
- package/templates/index.js +24 -0
- package/templates/index.js.map +1 -0
- package/templates/module.d.ts +12 -0
- package/templates/module.js +25 -0
- package/templates/module.js.map +1 -0
- package/templates/providers/file-template.provider.base.d.ts +12 -0
- package/templates/providers/file-template.provider.base.js +50 -0
- package/templates/providers/file-template.provider.base.js.map +1 -0
- package/templates/providers/file-template.provider.d.ts +22 -0
- package/templates/providers/file-template.provider.js +47 -0
- package/templates/providers/file-template.provider.js.map +1 -0
- package/templates/providers/memory-template.provider.base.d.ts +9 -0
- package/templates/providers/memory-template.provider.base.js +35 -0
- package/templates/providers/memory-template.provider.base.js.map +1 -0
- package/templates/providers/memory-template.provider.d.ts +4 -0
- package/templates/providers/memory-template.provider.js +18 -0
- package/templates/providers/memory-template.provider.js.map +1 -0
- package/templates/renderers/handlebars.template-renderer.d.ts +11 -0
- package/templates/renderers/handlebars.template-renderer.js +26 -0
- package/templates/renderers/handlebars.template-renderer.js.map +1 -0
- package/templates/renderers/mjml.template-renderer.d.ts +15 -0
- package/templates/renderers/mjml.template-renderer.js +57 -0
- package/templates/renderers/mjml.template-renderer.js.map +1 -0
- package/templates/template-renderer.provider.d.ts +8 -0
- package/templates/template-renderer.provider.js +60 -0
- package/templates/template-renderer.provider.js.map +1 -0
- package/templates/template.model.d.ts +5 -0
- package/templates/template.model.js +3 -0
- package/templates/template.model.js.map +1 -0
- package/templates/template.provider.d.ts +4 -0
- package/templates/template.provider.js +7 -0
- package/templates/template.provider.js.map +1 -0
- package/templates/template.renderer.d.ts +6 -0
- package/templates/template.renderer.js +7 -0
- package/templates/template.renderer.js.map +1 -0
- package/templates/template.service.d.ts +11 -0
- package/templates/template.service.js +39 -0
- package/templates/template.service.js.map +1 -0
- package/templates/tokens.d.ts +3 -0
- package/templates/tokens.js +6 -0
- package/templates/tokens.js.map +1 -0
- package/tokens.d.ts +1 -1
- package/tokens.js +5 -2
- package/tokens.js.map +1 -1
- package/tsconfig.json +3 -7
- package/types/geo-json.d.ts +1 -1
- package/types/geo-json.js +2 -1
- package/types.d.ts +57 -6
- package/types.js +2 -1
- package/types.js.map +1 -1
- package/utils/alphabet.js +5 -2
- package/utils/alphabet.js.map +1 -1
- package/utils/any-iterable-iterator.js +8 -4
- package/utils/any-iterable-iterator.js.map +1 -1
- package/utils/array/array-backtracker.js +12 -8
- package/utils/array/array-backtracker.js.map +1 -1
- package/utils/array/array.js +21 -13
- package/utils/array/array.js.map +1 -1
- package/utils/array/index.d.ts +2 -2
- package/utils/array/index.js +18 -2
- package/utils/array/index.js.map +1 -1
- package/utils/async-iterable-helpers/all.d.ts +2 -2
- package/utils/async-iterable-helpers/all.js +7 -3
- package/utils/async-iterable-helpers/all.js.map +1 -1
- package/utils/async-iterable-helpers/any.d.ts +2 -2
- package/utils/async-iterable-helpers/any.js +7 -3
- package/utils/async-iterable-helpers/any.js.map +1 -1
- package/utils/async-iterable-helpers/assert.d.ts +2 -2
- package/utils/async-iterable-helpers/assert.js +10 -6
- package/utils/async-iterable-helpers/assert.js.map +1 -1
- package/utils/async-iterable-helpers/batch.d.ts +1 -1
- package/utils/async-iterable-helpers/batch.js +7 -3
- package/utils/async-iterable-helpers/batch.js.map +1 -1
- package/utils/async-iterable-helpers/buffer.d.ts +1 -1
- package/utils/async-iterable-helpers/buffer.js +13 -9
- package/utils/async-iterable-helpers/buffer.js.map +1 -1
- package/utils/async-iterable-helpers/concat.d.ts +2 -2
- package/utils/async-iterable-helpers/concat.js +8 -3
- package/utils/async-iterable-helpers/concat.js.map +1 -1
- package/utils/async-iterable-helpers/default-if-empty.d.ts +1 -1
- package/utils/async-iterable-helpers/default-if-empty.js +5 -1
- package/utils/async-iterable-helpers/default-if-empty.js.map +1 -1
- package/utils/async-iterable-helpers/deferred.d.ts +1 -1
- package/utils/async-iterable-helpers/deferred.js +5 -1
- package/utils/async-iterable-helpers/deferred.js.map +1 -1
- package/utils/async-iterable-helpers/difference.d.ts +4 -0
- package/utils/async-iterable-helpers/difference.js +34 -0
- package/utils/async-iterable-helpers/difference.js.map +1 -0
- package/utils/async-iterable-helpers/distinct.d.ts +2 -2
- package/utils/async-iterable-helpers/distinct.js +7 -3
- package/utils/async-iterable-helpers/distinct.js.map +1 -1
- package/utils/async-iterable-helpers/drain.d.ts +1 -1
- package/utils/async-iterable-helpers/drain.js +5 -1
- package/utils/async-iterable-helpers/drain.js.map +1 -1
- package/utils/async-iterable-helpers/filter.d.ts +2 -2
- package/utils/async-iterable-helpers/filter.js +7 -3
- package/utils/async-iterable-helpers/filter.js.map +1 -1
- package/utils/async-iterable-helpers/first-or-default.d.ts +3 -3
- package/utils/async-iterable-helpers/first-or-default.js +7 -3
- package/utils/async-iterable-helpers/first-or-default.js.map +1 -1
- package/utils/async-iterable-helpers/first.d.ts +3 -3
- package/utils/async-iterable-helpers/first.js +7 -3
- package/utils/async-iterable-helpers/first.js.map +1 -1
- package/utils/async-iterable-helpers/for-each.d.ts +2 -2
- package/utils/async-iterable-helpers/for-each.js +7 -3
- package/utils/async-iterable-helpers/for-each.js.map +1 -1
- package/utils/async-iterable-helpers/group-single.d.ts +2 -2
- package/utils/async-iterable-helpers/group-single.js +7 -3
- package/utils/async-iterable-helpers/group-single.js.map +1 -1
- package/utils/async-iterable-helpers/group-to-map.d.ts +2 -2
- package/utils/async-iterable-helpers/group-to-map.js +10 -6
- package/utils/async-iterable-helpers/group-to-map.js.map +1 -1
- package/utils/async-iterable-helpers/group-to-single-map.d.ts +2 -2
- package/utils/async-iterable-helpers/group-to-single-map.js +7 -3
- package/utils/async-iterable-helpers/group-to-single-map.js.map +1 -1
- package/utils/async-iterable-helpers/group.d.ts +2 -2
- package/utils/async-iterable-helpers/group.js +7 -3
- package/utils/async-iterable-helpers/group.js.map +1 -1
- package/utils/async-iterable-helpers/index.d.ts +47 -45
- package/utils/async-iterable-helpers/index.js +63 -45
- package/utils/async-iterable-helpers/index.js.map +1 -1
- package/utils/async-iterable-helpers/interrupt.d.ts +1 -1
- package/utils/async-iterable-helpers/interrupt.js +12 -7
- package/utils/async-iterable-helpers/interrupt.js.map +1 -1
- package/utils/async-iterable-helpers/is-async-iterable.d.ts +1 -1
- package/utils/async-iterable-helpers/is-async-iterable.js +10 -5
- package/utils/async-iterable-helpers/is-async-iterable.js.map +1 -1
- package/utils/async-iterable-helpers/last-or-default.d.ts +3 -3
- package/utils/async-iterable-helpers/last-or-default.js +7 -3
- package/utils/async-iterable-helpers/last-or-default.js.map +1 -1
- package/utils/async-iterable-helpers/last.d.ts +3 -3
- package/utils/async-iterable-helpers/last.js +7 -3
- package/utils/async-iterable-helpers/last.js.map +1 -1
- package/utils/async-iterable-helpers/map-many.d.ts +2 -2
- package/utils/async-iterable-helpers/map-many.js +7 -3
- package/utils/async-iterable-helpers/map-many.js.map +1 -1
- package/utils/async-iterable-helpers/map.d.ts +2 -2
- package/utils/async-iterable-helpers/map.js +7 -3
- package/utils/async-iterable-helpers/map.js.map +1 -1
- package/utils/async-iterable-helpers/materialize.d.ts +1 -1
- package/utils/async-iterable-helpers/materialize.js +9 -5
- package/utils/async-iterable-helpers/materialize.js.map +1 -1
- package/utils/async-iterable-helpers/metadata.d.ts +2 -2
- package/utils/async-iterable-helpers/metadata.js +11 -5
- package/utils/async-iterable-helpers/metadata.js.map +1 -1
- package/utils/async-iterable-helpers/multiplex.d.ts +1 -1
- package/utils/async-iterable-helpers/multiplex.js +8 -4
- package/utils/async-iterable-helpers/multiplex.js.map +1 -1
- package/utils/async-iterable-helpers/observable-iterable.js +13 -9
- package/utils/async-iterable-helpers/observable-iterable.js.map +1 -1
- package/utils/async-iterable-helpers/pairwise.d.ts +1 -1
- package/utils/async-iterable-helpers/pairwise.js +7 -3
- package/utils/async-iterable-helpers/pairwise.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/feed.d.ts +2 -2
- package/utils/async-iterable-helpers/parallel/feed.js +11 -7
- package/utils/async-iterable-helpers/parallel/feed.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/filter.d.ts +2 -2
- package/utils/async-iterable-helpers/parallel/filter.js +7 -3
- package/utils/async-iterable-helpers/parallel/filter.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/for-each.d.ts +2 -2
- package/utils/async-iterable-helpers/parallel/for-each.js +9 -5
- package/utils/async-iterable-helpers/parallel/for-each.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/group.d.ts +2 -2
- package/utils/async-iterable-helpers/parallel/group.js +9 -5
- package/utils/async-iterable-helpers/parallel/group.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/index.d.ts +7 -7
- package/utils/async-iterable-helpers/parallel/index.js +23 -7
- package/utils/async-iterable-helpers/parallel/index.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/map.d.ts +2 -2
- package/utils/async-iterable-helpers/parallel/map.js +7 -3
- package/utils/async-iterable-helpers/parallel/map.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/tap.d.ts +2 -2
- package/utils/async-iterable-helpers/parallel/tap.js +7 -3
- package/utils/async-iterable-helpers/parallel/tap.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/types.js +2 -1
- package/utils/async-iterable-helpers/reduce.d.ts +2 -2
- package/utils/async-iterable-helpers/reduce.js +7 -3
- package/utils/async-iterable-helpers/reduce.js.map +1 -1
- package/utils/async-iterable-helpers/retry.d.ts +2 -2
- package/utils/async-iterable-helpers/retry.js +7 -3
- package/utils/async-iterable-helpers/retry.js.map +1 -1
- package/utils/async-iterable-helpers/single-or-default.d.ts +3 -3
- package/utils/async-iterable-helpers/single-or-default.js +5 -1
- package/utils/async-iterable-helpers/single-or-default.js.map +1 -1
- package/utils/async-iterable-helpers/single.d.ts +3 -3
- package/utils/async-iterable-helpers/single.js +5 -1
- package/utils/async-iterable-helpers/single.js.map +1 -1
- package/utils/async-iterable-helpers/skip.d.ts +1 -1
- package/utils/async-iterable-helpers/skip.js +7 -3
- package/utils/async-iterable-helpers/skip.js.map +1 -1
- package/utils/async-iterable-helpers/sort.d.ts +2 -2
- package/utils/async-iterable-helpers/sort.js +9 -5
- package/utils/async-iterable-helpers/sort.js.map +1 -1
- package/utils/async-iterable-helpers/take-until.d.ts +2 -2
- package/utils/async-iterable-helpers/take-until.js +11 -6
- package/utils/async-iterable-helpers/take-until.js.map +1 -1
- package/utils/async-iterable-helpers/take-while.d.ts +2 -2
- package/utils/async-iterable-helpers/take-while.js +7 -3
- package/utils/async-iterable-helpers/take-while.js.map +1 -1
- package/utils/async-iterable-helpers/take.d.ts +1 -1
- package/utils/async-iterable-helpers/take.js +5 -1
- package/utils/async-iterable-helpers/take.js.map +1 -1
- package/utils/async-iterable-helpers/tap.d.ts +2 -2
- package/utils/async-iterable-helpers/tap.js +7 -3
- package/utils/async-iterable-helpers/tap.js.map +1 -1
- package/utils/async-iterable-helpers/throttle.d.ts +2 -2
- package/utils/async-iterable-helpers/throttle.js +7 -3
- package/utils/async-iterable-helpers/throttle.js.map +1 -1
- package/utils/async-iterable-helpers/to-array.d.ts +1 -1
- package/utils/async-iterable-helpers/to-array.js +7 -3
- package/utils/async-iterable-helpers/to-array.js.map +1 -1
- package/utils/async-iterable-helpers/to-async-iterable-iterator.d.ts +1 -1
- package/utils/async-iterable-helpers/to-async-iterable-iterator.js +9 -3
- package/utils/async-iterable-helpers/to-async-iterable-iterator.js.map +1 -1
- package/utils/async-iterable-helpers/to-async-iterator.d.ts +1 -1
- package/utils/async-iterable-helpers/to-async-iterator.js +14 -9
- package/utils/async-iterable-helpers/to-async-iterator.js.map +1 -1
- package/utils/async-iterable-helpers/to-set.d.ts +2 -0
- package/utils/async-iterable-helpers/to-set.js +16 -0
- package/utils/async-iterable-helpers/to-set.js.map +1 -0
- package/utils/async-iterable-helpers/to-sync-iterable.d.ts +1 -1
- package/utils/async-iterable-helpers/to-sync-iterable.js +9 -5
- package/utils/async-iterable-helpers/to-sync-iterable.js.map +1 -1
- package/utils/async-iterable-helpers/types.d.ts +1 -1
- package/utils/async-iterable-helpers/types.js +2 -1
- package/utils/async-iterable-helpers/while.d.ts +2 -2
- package/utils/async-iterable-helpers/while.js +7 -3
- package/utils/async-iterable-helpers/while.js.map +1 -1
- package/utils/async-iterator-iterable-iterator.js +8 -4
- package/utils/async-iterator-iterable-iterator.js.map +1 -1
- package/utils/backoff.d.ts +2 -2
- package/utils/backoff.js +20 -13
- package/utils/backoff.js.map +1 -1
- package/utils/base64.d.ts +1 -1
- package/utils/base64.js +24 -13
- package/utils/base64.js.map +1 -1
- package/utils/benchmark.js +25 -17
- package/utils/benchmark.js.map +1 -1
- package/utils/binary-search.d.ts +1 -1
- package/utils/binary-search.js +18 -8
- package/utils/binary-search.js.map +1 -1
- package/utils/binary.d.ts +1 -1
- package/utils/binary.js +12 -6
- package/utils/binary.js.map +1 -1
- package/utils/cancellation-token.js +25 -21
- package/utils/cancellation-token.js.map +1 -1
- package/utils/clone.d.ts +1 -0
- package/utils/clone.js +45 -0
- package/utils/clone.js.map +1 -0
- package/utils/comparison.js +17 -7
- package/utils/comparison.js.map +1 -1
- package/utils/compression.d.ts +2 -2
- package/utils/compression.js +25 -18
- package/utils/compression.js.map +1 -1
- package/utils/config-parser.js +18 -11
- package/utils/config-parser.js.map +1 -1
- package/utils/cryptography.d.ts +1 -1
- package/utils/cryptography.js +67 -53
- package/utils/cryptography.js.map +1 -1
- package/utils/date-time.js +55 -33
- package/utils/date-time.js.map +1 -1
- package/utils/encoding.d.ts +1 -1
- package/utils/encoding.js +19 -12
- package/utils/encoding.js.map +1 -1
- package/utils/enum.d.ts +6 -5
- package/utils/enum.js +18 -7
- package/utils/enum.js.map +1 -1
- package/utils/equals.d.ts +2 -2
- package/utils/equals.js +21 -15
- package/utils/equals.js.map +1 -1
- package/utils/event-loop.d.ts +2 -2
- package/utils/event-loop.js +14 -9
- package/utils/event-loop.js.map +1 -1
- package/utils/factory-map.js +5 -1
- package/utils/factory-map.js.map +1 -1
- package/utils/feedable-async-iterable.js +13 -8
- package/utils/feedable-async-iterable.js.map +1 -1
- package/utils/file-reader.js +13 -6
- package/utils/file-reader.js.map +1 -1
- package/utils/format-error.d.ts +20 -0
- package/utils/format-error.js +42 -0
- package/utils/format-error.js.map +1 -0
- package/utils/function/index.d.ts +2 -2
- package/utils/function/index.js +18 -2
- package/utils/function/index.js.map +1 -1
- package/utils/function/memoize.d.ts +6 -2
- package/utils/function/memoize.js +34 -21
- package/utils/function/memoize.js.map +1 -1
- package/utils/function/throttle.js +9 -5
- package/utils/function/throttle.js.map +1 -1
- package/utils/helpers.d.ts +1 -32
- package/utils/helpers.js +34 -163
- package/utils/helpers.js.map +1 -1
- package/utils/image.js +30 -22
- package/utils/image.js.map +1 -1
- package/utils/index.d.ts +45 -42
- package/utils/index.js +61 -42
- package/utils/index.js.map +1 -1
- package/utils/iterable-helpers/all.d.ts +1 -1
- package/utils/iterable-helpers/all.js +5 -1
- package/utils/iterable-helpers/all.js.map +1 -1
- package/utils/iterable-helpers/any.d.ts +1 -1
- package/utils/iterable-helpers/any.js +5 -1
- package/utils/iterable-helpers/any.js.map +1 -1
- package/utils/iterable-helpers/assert.d.ts +1 -1
- package/utils/iterable-helpers/assert.js +7 -3
- package/utils/iterable-helpers/assert.js.map +1 -1
- package/utils/iterable-helpers/batch.js +5 -1
- package/utils/iterable-helpers/batch.js.map +1 -1
- package/utils/iterable-helpers/concat.d.ts +1 -1
- package/utils/iterable-helpers/concat.js +8 -3
- package/utils/iterable-helpers/concat.js.map +1 -1
- package/utils/iterable-helpers/default-if-empty.js +5 -1
- package/utils/iterable-helpers/default-if-empty.js.map +1 -1
- package/utils/iterable-helpers/deferred.js +5 -1
- package/utils/iterable-helpers/deferred.js.map +1 -1
- package/utils/iterable-helpers/difference.d.ts +3 -0
- package/utils/iterable-helpers/difference.js +31 -0
- package/utils/iterable-helpers/difference.js.map +1 -0
- package/utils/iterable-helpers/distinct.d.ts +1 -1
- package/utils/iterable-helpers/distinct.js +5 -1
- package/utils/iterable-helpers/distinct.js.map +1 -1
- package/utils/iterable-helpers/drain.js +5 -1
- package/utils/iterable-helpers/drain.js.map +1 -1
- package/utils/iterable-helpers/filter.d.ts +1 -1
- package/utils/iterable-helpers/filter.js +5 -1
- package/utils/iterable-helpers/filter.js.map +1 -1
- package/utils/iterable-helpers/first-or-default.d.ts +1 -1
- package/utils/iterable-helpers/first-or-default.js +7 -3
- package/utils/iterable-helpers/first-or-default.js.map +1 -1
- package/utils/iterable-helpers/first.d.ts +1 -1
- package/utils/iterable-helpers/first.js +7 -3
- package/utils/iterable-helpers/first.js.map +1 -1
- package/utils/iterable-helpers/for-each.d.ts +1 -1
- package/utils/iterable-helpers/for-each.js +5 -1
- package/utils/iterable-helpers/for-each.js.map +1 -1
- package/utils/iterable-helpers/group-single.d.ts +1 -1
- package/utils/iterable-helpers/group-single.js +7 -3
- package/utils/iterable-helpers/group-single.js.map +1 -1
- package/utils/iterable-helpers/group-to-map.d.ts +1 -1
- package/utils/iterable-helpers/group-to-map.js +7 -3
- package/utils/iterable-helpers/group-to-map.js.map +1 -1
- package/utils/iterable-helpers/group-to-single-map.d.ts +1 -1
- package/utils/iterable-helpers/group-to-single-map.js +5 -1
- package/utils/iterable-helpers/group-to-single-map.js.map +1 -1
- package/utils/iterable-helpers/group.d.ts +1 -1
- package/utils/iterable-helpers/group.js +7 -3
- package/utils/iterable-helpers/group.js.map +1 -1
- package/utils/iterable-helpers/index.d.ts +38 -37
- package/utils/iterable-helpers/index.js +54 -37
- package/utils/iterable-helpers/index.js.map +1 -1
- package/utils/iterable-helpers/is-iterable.d.ts +1 -1
- package/utils/iterable-helpers/is-iterable.js +10 -5
- package/utils/iterable-helpers/is-iterable.js.map +1 -1
- package/utils/iterable-helpers/last-or-default.d.ts +1 -1
- package/utils/iterable-helpers/last-or-default.js +7 -3
- package/utils/iterable-helpers/last-or-default.js.map +1 -1
- package/utils/iterable-helpers/last.d.ts +1 -1
- package/utils/iterable-helpers/last.js +7 -3
- package/utils/iterable-helpers/last.js.map +1 -1
- package/utils/iterable-helpers/map-many.d.ts +1 -1
- package/utils/iterable-helpers/map-many.js +5 -1
- package/utils/iterable-helpers/map-many.js.map +1 -1
- package/utils/iterable-helpers/map.d.ts +1 -1
- package/utils/iterable-helpers/map.js +5 -1
- package/utils/iterable-helpers/map.js.map +1 -1
- package/utils/iterable-helpers/materialize.js +5 -1
- package/utils/iterable-helpers/materialize.js.map +1 -1
- package/utils/iterable-helpers/metadata.d.ts +1 -1
- package/utils/iterable-helpers/metadata.js +5 -1
- package/utils/iterable-helpers/metadata.js.map +1 -1
- package/utils/iterable-helpers/pairwise.js +5 -1
- package/utils/iterable-helpers/pairwise.js.map +1 -1
- package/utils/iterable-helpers/range.js +5 -1
- package/utils/iterable-helpers/range.js.map +1 -1
- package/utils/iterable-helpers/reduce.d.ts +1 -1
- package/utils/iterable-helpers/reduce.js +5 -1
- package/utils/iterable-helpers/reduce.js.map +1 -1
- package/utils/iterable-helpers/single-or-default.d.ts +1 -1
- package/utils/iterable-helpers/single-or-default.js +5 -1
- package/utils/iterable-helpers/single-or-default.js.map +1 -1
- package/utils/iterable-helpers/single.d.ts +1 -1
- package/utils/iterable-helpers/single.js +5 -1
- package/utils/iterable-helpers/single.js.map +1 -1
- package/utils/iterable-helpers/skip.js +5 -1
- package/utils/iterable-helpers/skip.js.map +1 -1
- package/utils/iterable-helpers/sort.d.ts +1 -1
- package/utils/iterable-helpers/sort.js +6 -2
- package/utils/iterable-helpers/sort.js.map +1 -1
- package/utils/iterable-helpers/take-until.d.ts +1 -1
- package/utils/iterable-helpers/take-until.js +5 -1
- package/utils/iterable-helpers/take-until.js.map +1 -1
- package/utils/iterable-helpers/take-while.d.ts +1 -1
- package/utils/iterable-helpers/take-while.js +5 -1
- package/utils/iterable-helpers/take-while.js.map +1 -1
- package/utils/iterable-helpers/take.js +5 -1
- package/utils/iterable-helpers/take.js.map +1 -1
- package/utils/iterable-helpers/tap.d.ts +1 -1
- package/utils/iterable-helpers/tap.js +5 -1
- package/utils/iterable-helpers/tap.js.map +1 -1
- package/utils/iterable-helpers/types.js +2 -1
- package/utils/iterable-helpers/while.d.ts +1 -1
- package/utils/iterable-helpers/while.js +5 -1
- package/utils/iterable-helpers/while.js.map +1 -1
- package/utils/jwt.d.ts +2 -2
- package/utils/jwt.js +31 -26
- package/utils/jwt.js.map +1 -1
- package/utils/map.js +15 -7
- package/utils/map.js.map +1 -1
- package/utils/math.js +17 -7
- package/utils/math.js.map +1 -1
- package/utils/merge.d.ts +5 -0
- package/utils/merge.js +32 -0
- package/utils/merge.js.map +1 -0
- package/utils/middleware.js +7 -2
- package/utils/middleware.js.map +1 -1
- package/utils/moving-metric.js +9 -5
- package/utils/moving-metric.js.map +1 -1
- package/utils/noop.js +5 -1
- package/utils/noop.js.map +1 -1
- package/utils/object/decycle.d.ts +16 -0
- package/utils/object/decycle.js +81 -0
- package/utils/object/decycle.js.map +1 -0
- package/utils/object/dereference.js +13 -7
- package/utils/object/dereference.js.map +1 -1
- package/utils/object/forward-ref.js +15 -12
- package/utils/object/forward-ref.js.map +1 -1
- package/utils/object/index.d.ts +7 -6
- package/utils/object/index.js +23 -6
- package/utils/object/index.js.map +1 -1
- package/utils/object/lazy-property.d.ts +1 -1
- package/utils/object/lazy-property.js +22 -15
- package/utils/object/lazy-property.js.map +1 -1
- package/utils/object/merge.js +17 -13
- package/utils/object/merge.js.map +1 -1
- package/utils/object/object.d.ts +10 -2
- package/utils/object/object.js +57 -25
- package/utils/object/object.js.map +1 -1
- package/utils/object/property-name.d.ts +1 -1
- package/utils/object/property-name.js +23 -16
- package/utils/object/property-name.js.map +1 -1
- package/utils/ordered-feedable-async-iterable.d.ts +1 -1
- package/utils/ordered-feedable-async-iterable.js +7 -3
- package/utils/ordered-feedable-async-iterable.js.map +1 -1
- package/utils/patch-worker.d.ts +2 -2
- package/utils/patch-worker.js +24 -19
- package/utils/patch-worker.js.map +1 -1
- package/utils/patterns.d.ts +1 -1
- package/utils/patterns.js +8 -4
- package/utils/patterns.js.map +1 -1
- package/utils/periodic-reporter.js +13 -9
- package/utils/periodic-reporter.js.map +1 -1
- package/utils/periodic-sampler.js +19 -15
- package/utils/periodic-sampler.js.map +1 -1
- package/utils/provider-function-iterable.js +7 -3
- package/utils/provider-function-iterable.js.map +1 -1
- package/utils/random.js +8 -3
- package/utils/random.js.map +1 -1
- package/utils/reflection.d.ts +1 -1
- package/utils/reflection.js +16 -7
- package/utils/reflection.js.map +1 -1
- package/utils/set.js +15 -7
- package/utils/set.js.map +1 -1
- package/utils/singleton.js +7 -3
- package/utils/singleton.js.map +1 -1
- package/utils/sort.js +12 -5
- package/utils/sort.js.map +1 -1
- package/utils/stream/async-iterable-readable.d.ts +3 -3
- package/utils/stream/async-iterable-readable.js +10 -6
- package/utils/stream/async-iterable-readable.js.map +1 -1
- package/utils/stream/async-writable-stream.d.ts +3 -3
- package/utils/stream/async-writable-stream.js +7 -3
- package/utils/stream/async-writable-stream.js.map +1 -1
- package/utils/stream/index.d.ts +5 -5
- package/utils/stream/index.js +21 -5
- package/utils/stream/index.js.map +1 -1
- package/utils/stream/stream-helper-types.d.ts +1 -1
- package/utils/stream/stream-helper-types.js +2 -1
- package/utils/stream/stream-reader.js +16 -13
- package/utils/stream/stream-reader.js.map +1 -1
- package/utils/stream/typed-readable.d.ts +2 -2
- package/utils/stream/typed-readable.js +5 -2
- package/utils/stream/typed-readable.js.map +1 -1
- package/utils/timer.js +5 -1
- package/utils/timer.js.map +1 -1
- package/utils/timing.d.ts +1 -1
- package/utils/timing.js +23 -12
- package/utils/timing.js.map +1 -1
- package/utils/type-guards.d.ts +10 -4
- package/utils/type-guards.js +434 -209
- package/utils/type-guards.js.map +1 -1
- package/utils/type-of.js +7 -3
- package/utils/type-of.js.map +1 -1
- package/utils/units.js +55 -51
- package/utils/units.js.map +1 -1
- package/utils/url-builder.d.ts +1 -1
- package/utils/url-builder.js +16 -11
- package/utils/url-builder.js.map +1 -1
- package/utils/z-base32.d.ts +1 -1
- package/utils/z-base32.js +11 -6
- package/utils/z-base32.js.map +1 -1
- package/database/mongo/model.js +0 -71
- package/database/mongo/model.js.map +0 -1
- package/database/mongo/mongo-entity.repository.js.map +0 -1
- package/database/mongo/simple-entity.repository.d.ts +0 -7
- package/database/mongo/simple-entity.repository.js +0 -7
- package/database/mongo/simple-entity.repository.js.map +0 -1
- package/instance-provider.d.ts +0 -17
- package/instance-provider.js +0 -48
- package/instance-provider.js.map +0 -1
- package/lock/mongo/mongo-lock.repository.js.map +0 -1
- package/module/modules/old-web-server.module.d.ts +0 -22
- package/module/modules/old-web-server.module.js +0 -33
- package/module/modules/old-web-server.module.js.map +0 -1
- package/old-api/endpoint.d.ts +0 -5
- package/old-api/endpoint.js +0 -15
- package/old-api/endpoint.js.map +0 -1
- package/old-api/endpoints/echo.endpoint.d.ts +0 -2
- package/old-api/endpoints/echo.endpoint.js +0 -2
- package/old-api/endpoints/echo.endpoint.js.map +0 -1
- package/old-api/endpoints/index.d.ts +0 -1
- package/old-api/endpoints/index.js +0 -2
- package/old-api/endpoints/index.js.map +0 -1
- package/old-api/http-api.d.ts +0 -63
- package/old-api/http-api.js +0 -258
- package/old-api/http-api.js.map +0 -1
- package/old-api/index.d.ts +0 -3
- package/old-api/index.js +0 -4
- package/old-api/index.js.map +0 -1
- package/old-api/validation/index.d.ts +0 -1
- package/old-api/validation/index.js +0 -2
- package/old-api/validation/index.js.map +0 -1
- package/old-api/validation/types.d.ts +0 -6
- package/old-api/validation/types.js +0 -3
- package/old-api/validation/types.js.map +0 -1
- package/old-api/validation/validators/index.d.ts +0 -1
- package/old-api/validation/validators/index.js +0 -2
- package/old-api/validation/validators/index.js.map +0 -1
- package/old-api/validation/validators/noop.d.ts +0 -2
- package/old-api/validation/validators/noop.js +0 -4
- package/old-api/validation/validators/noop.js.map +0 -1
- package/old-api/validation/validators/superstruct.d.ts +0 -14
- package/old-api/validation/validators/superstruct.js +0 -55
- package/old-api/validation/validators/superstruct.js.map +0 -1
- package/old-api/validation/validators/yup.d.ts +0 -7
- package/old-api/validation/validators/yup.js +0 -52
- package/old-api/validation/validators/yup.js.map +0 -1
- package/schema/schema.validator.d.ts +0 -40
- package/schema/schema.validator.js +0 -71
- package/schema/schema.validator.js.map +0 -1
- package/schema/schemas/async-iterable.d.ts +0 -13
- package/schema/schemas/async-iterable.js +0 -35
- package/schema/schemas/async-iterable.js.map +0 -1
- package/schema/schemas/iterable.d.ts +0 -13
- package/schema/schemas/iterable.js +0 -35
- package/schema/schemas/iterable.js.map +0 -1
- package/schema/schemas/never.d.ts +0 -9
- package/schema/schemas/never.js +0 -17
- package/schema/schemas/never.js.map +0 -1
- package/schema/schemas/preprocess.d.ts +0 -16
- package/schema/schemas/preprocess.js +0 -30
- package/schema/schemas/preprocess.js.map +0 -1
- package/schema/schemas/refine.d.ts +0 -24
- package/schema/schemas/refine.js +0 -47
- package/schema/schemas/refine.js.map +0 -1
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { emailPattern } from "../../../utils/patterns.js";
|
|
2
|
-
import { isDefined } from "../../../utils/type-guards.js";
|
|
3
|
-
import { boolean, coerce, literal, number, pattern, string, union } from 'superstruct';
|
|
4
|
-
import { ValidationError } from '../types.js';
|
|
5
|
-
let defaultOptions = {
|
|
6
|
-
coerce: true,
|
|
7
|
-
mask: false
|
|
8
|
-
};
|
|
9
|
-
export function setDefaultSuperstructOptions(options) {
|
|
10
|
-
defaultOptions = options;
|
|
11
|
-
}
|
|
12
|
-
const coerceBooleanLiteralsStruct = union([literal(true), literal(false), literal(1), literal(0), literal('true'), literal('false'), literal('1'), literal('0'), literal('yes'), literal('no')]);
|
|
13
|
-
const coerceBooleanTrueLiterals = [true, 1, 'true', '1', 'yes'];
|
|
14
|
-
const numberStruct = number();
|
|
15
|
-
const numberStringStruct = pattern(string(), /^[+-]?(?:\d*\.)?\d+$/u);
|
|
16
|
-
export const email = () => pattern(string(), emailPattern);
|
|
17
|
-
export const coerceNumber = (struct = numberStruct) => coerce(struct, numberStringStruct, (value) => parseFloat(value));
|
|
18
|
-
export const coerceBoolean = () => coerce(boolean(), coerceBooleanLiteralsStruct, (value) => coerceBooleanTrueLiterals.includes(value));
|
|
19
|
-
export const lowercased = (struct) => coerce(struct, string(), (x) => x.toLowerCase());
|
|
20
|
-
export const nulledStructSchema = (struct) => struct;
|
|
21
|
-
export function validator(struct, options = defaultOptions) {
|
|
22
|
-
return (value) => validate(struct, value, options);
|
|
23
|
-
}
|
|
24
|
-
export function validate(struct, value, options = defaultOptions) {
|
|
25
|
-
let result;
|
|
26
|
-
let error;
|
|
27
|
-
if (options.mask == true) {
|
|
28
|
-
try {
|
|
29
|
-
result = struct.mask(value);
|
|
30
|
-
}
|
|
31
|
-
catch (_error) {
|
|
32
|
-
error = _error;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
[error, result] = struct.validate(value, { coerce: options.coerce });
|
|
37
|
-
}
|
|
38
|
-
if (isDefined(error)) {
|
|
39
|
-
throw convertError(error);
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
function convertError(error) {
|
|
44
|
-
const failures = error.failures().map((failure) => convertFailure(failure));
|
|
45
|
-
const inner = (failures.length > 0) ? failures : undefined;
|
|
46
|
-
return convertFailure(error, inner);
|
|
47
|
-
}
|
|
48
|
-
function convertFailure(failure, inner) {
|
|
49
|
-
const details = {
|
|
50
|
-
path: failure.path,
|
|
51
|
-
type: failure.type
|
|
52
|
-
};
|
|
53
|
-
return new ValidationError(failure.message, { details, inner });
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=superstruct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"superstruct.js","sourceRoot":"","sources":["../../../../source/old-api/validation/validators/superstruct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mCAA4B;AACnD,OAAO,EAAE,SAAS,EAAE,sCAA+B;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,IAAI,cAAc,GAAuB;IACvC,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK;CACZ,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAAC,OAA2B;IACtE,cAAc,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED,MAAM,2BAA2B,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,OAA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AClE,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
import type { EndpointParametersValidator, ValidationResult } from '../types.js';
|
|
3
|
-
export declare function setDefaultYupValidationOptions(options: yup.ValidateOptions): void;
|
|
4
|
-
export declare function stripNullFromSchema<T>(schema: yup.MixedSchema<T>): yup.MixedSchema<Exclude<T, null>>;
|
|
5
|
-
export declare function oneOfSchemas<T>(schemas: yup.Schema<T>[], message?: string): yup.Schema<T>;
|
|
6
|
-
export declare function validator<T>(schema: yup.Schema<T>, options?: yup.ValidateOptions): EndpointParametersValidator<unknown, T>;
|
|
7
|
-
export declare function validate<T, U>(schema: yup.Schema<T>, value: U, options?: yup.ValidateOptions): ValidationResult<T>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
import { ValidationError } from '../types.js';
|
|
3
|
-
let defaultOptions = {
|
|
4
|
-
abortEarly: false,
|
|
5
|
-
stripUnknown: false
|
|
6
|
-
};
|
|
7
|
-
export function setDefaultYupValidationOptions(options) {
|
|
8
|
-
defaultOptions = options;
|
|
9
|
-
}
|
|
10
|
-
export function stripNullFromSchema(schema) {
|
|
11
|
-
return schema;
|
|
12
|
-
}
|
|
13
|
-
export function oneOfSchemas(schemas, message = 'value did not match any of the allowed schemas') {
|
|
14
|
-
return yup.mixed().test({
|
|
15
|
-
name: 'one-of-schemas',
|
|
16
|
-
message,
|
|
17
|
-
test(value) {
|
|
18
|
-
const errors = [];
|
|
19
|
-
for (const schema of schemas) {
|
|
20
|
-
try {
|
|
21
|
-
schema.validateSync(value, this.options);
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
errors.push(error);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const error = new yup.ValidationError('none of the provided schemas validated successfully', value, this.path);
|
|
29
|
-
error.inner = errors;
|
|
30
|
-
return error;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
export function validator(schema, options) {
|
|
35
|
-
return (value) => validate(schema, value, options);
|
|
36
|
-
}
|
|
37
|
-
export function validate(schema, value, options = defaultOptions) {
|
|
38
|
-
try {
|
|
39
|
-
return schema.validateSync(value, options);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
throw convertError(error);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function convertError(error) {
|
|
46
|
-
const details = {
|
|
47
|
-
path: error.path
|
|
48
|
-
};
|
|
49
|
-
const inner = (error.inner.length > 0) ? error.inner.map(convertError) : undefined;
|
|
50
|
-
return new ValidationError(error.message, { details, inner });
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=yup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"yup.js","sourceRoot":"","sources":["../../../../source/old-api/validation/validators/yup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,IAAI,cAAc,GAAwB;IACxC,UAAU,EAAE,KAAK;IACjB,YAAY,EAAE,KAAK;CACpB,CAAC;AAEF,MAAM,UAAU,8BAA8B,CAAC,OAA4B;IACzE,cAAc,GAAG,OAAO,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAI,MAA0B;IAC/D,OAAO,MAA2C,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,YAAY,CAAI,OAAwB,EAAE,UAAkB,gDAAgD;IAC1H,OAAO,GAAG,CAAC,KAAK,EAAK,CAAC,IAAI,CAAC;QACzB,IAAI,EAAE,gBAAgB;QACtB,OAAO;QACP,IAAI,CAAC,KAAU;YACb,MAAM,MAAM,GAA0B,EAAE,CAAC;YAEzC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;gBAC5B,IAAI;oBACF,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,IAA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iveType, PrimitiveTypeString, Type } from "../types.js";
|
|
3
|
-
import { SchemaError } from './schema.error.js';
|
|
4
|
-
import type { Coercible, Maskable, SchemaDefinition, SchemaInput, SchemaOutput } from './types.js';
|
|
5
|
-
export declare const test: unique symbol;
|
|
6
|
-
export declare const testAsync: unique symbol;
|
|
7
|
-
export declare type CoercerFunction<P extends PrimitiveTypeString, T> = (value: PrimitiveType<P>, path: string | JsonPath) => ValidationTestResult<T>;
|
|
8
|
-
export declare type CoercerMap<T> = {
|
|
9
|
-
[P in PrimitiveTypeString]?: CoercerFunction<P, T>;
|
|
10
|
-
};
|
|
11
|
-
export declare type ValidationOptions = Coercible & Maskable;
|
|
12
|
-
export declare type DefinedValidationOptions = Required<ValidationOptions>;
|
|
13
|
-
export declare type ValidationTestResult<T> = {
|
|
14
|
-
valid: true;
|
|
15
|
-
value: T;
|
|
16
|
-
error?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
valid: false;
|
|
19
|
-
value?: undefined;
|
|
20
|
-
error: SchemaError;
|
|
21
|
-
};
|
|
22
|
-
export declare type EnsureTypeOptions = Coercible;
|
|
23
|
-
export declare abstract class SchemaValidator<S extends SchemaDefinition = SchemaDefinition> {
|
|
24
|
-
readonly schema: S;
|
|
25
|
-
/** used for type inference only */
|
|
26
|
-
readonly inputType: SchemaInput<S>;
|
|
27
|
-
/** used for type inference only */
|
|
28
|
-
readonly outputType: SchemaOutput<S>;
|
|
29
|
-
constructor(schema: S);
|
|
30
|
-
is(value: any, options?: ValidationOptions): value is SchemaOutput<S>;
|
|
31
|
-
isAsync(value: SchemaInput<S>, options?: ValidationOptions): Promise<boolean>;
|
|
32
|
-
parse(value: SchemaInput<S>, options?: ValidationOptions): SchemaOutput<S>;
|
|
33
|
-
parseAsync(value: SchemaInput<S>, options?: ValidationOptions): Promise<SchemaOutput<S>>;
|
|
34
|
-
test(value: SchemaInput<S>, options?: ValidationOptions): ValidationTestResult<SchemaOutput<S>>;
|
|
35
|
-
testAsync(value: SchemaInput<S>, options?: ValidationOptions): Promise<ValidationTestResult<SchemaOutput<S>>>;
|
|
36
|
-
protected ensureType<U extends PrimitiveType>(type: PrimitiveTypeString<U>, value: unknown, path: JsonPath, options?: EnsureTypeOptions, coercers?: CoercerMap<U>): ValidationTestResult<U>;
|
|
37
|
-
protected ensureInstance<U extends PrimitiveType>(type: Type, value: unknown, path: JsonPath, options?: EnsureTypeOptions, coercers?: CoercerMap<U>): ValidationTestResult<U>;
|
|
38
|
-
protected [testAsync](value: SchemaInput<S>, options: DefinedValidationOptions, path: JsonPath): Promise<ValidationTestResult<SchemaOutput<S>>>;
|
|
39
|
-
protected abstract [test](value: SchemaInput<S>, options: DefinedValidationOptions, path: JsonPath): ValidationTestResult<SchemaOutput<S>>;
|
|
40
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { JsonPath } from "../json-path/index.js";
|
|
2
|
-
import { isUndefined } from "../utils/type-guards.js";
|
|
3
|
-
import { typeOf } from "../utils/type-of.js";
|
|
4
|
-
import { SchemaError } from './schema.error.js';
|
|
5
|
-
export const test = Symbol('test');
|
|
6
|
-
export const testAsync = Symbol('testAsync');
|
|
7
|
-
export class SchemaValidator {
|
|
8
|
-
constructor(schema) {
|
|
9
|
-
this.schema = schema;
|
|
10
|
-
}
|
|
11
|
-
is(value, options) {
|
|
12
|
-
const result = this.test(value, options);
|
|
13
|
-
return result.valid;
|
|
14
|
-
}
|
|
15
|
-
async isAsync(value, options) {
|
|
16
|
-
const result = await this.testAsync(value, options);
|
|
17
|
-
return result.valid;
|
|
18
|
-
}
|
|
19
|
-
parse(value, options) {
|
|
20
|
-
const result = this.test(value, options);
|
|
21
|
-
if (result.valid) {
|
|
22
|
-
return result.value;
|
|
23
|
-
}
|
|
24
|
-
throw result.error;
|
|
25
|
-
}
|
|
26
|
-
async parseAsync(value, options) {
|
|
27
|
-
const result = await this.testAsync(value, options);
|
|
28
|
-
if (result.valid) {
|
|
29
|
-
return result.value;
|
|
30
|
-
}
|
|
31
|
-
throw result.error;
|
|
32
|
-
}
|
|
33
|
-
test(value, options) {
|
|
34
|
-
return this[test](value, convertOptions(options), new JsonPath());
|
|
35
|
-
}
|
|
36
|
-
async testAsync(value, options) {
|
|
37
|
-
return this[testAsync](value, convertOptions(options), new JsonPath());
|
|
38
|
-
}
|
|
39
|
-
ensureType(type, value, path, options, coercers) {
|
|
40
|
-
const valueType = typeof value;
|
|
41
|
-
if (valueType == type) {
|
|
42
|
-
return { valid: true, value: value };
|
|
43
|
-
}
|
|
44
|
-
const coercer = (options?.coerce ?? false) ? coercers?.[valueType] : undefined;
|
|
45
|
-
if (isUndefined(coercer)) {
|
|
46
|
-
return { valid: false, error: SchemaError.expectedButGot(type, typeOf(value), path) };
|
|
47
|
-
}
|
|
48
|
-
return coercer(value, path);
|
|
49
|
-
}
|
|
50
|
-
ensureInstance(type, value, path, options, coercers) {
|
|
51
|
-
if (value instanceof type) {
|
|
52
|
-
return { valid: true, value: value };
|
|
53
|
-
}
|
|
54
|
-
const coercer = (options?.coerce ?? false) ? coercers?.[typeof value] : undefined;
|
|
55
|
-
if (isUndefined(coercer)) {
|
|
56
|
-
return { valid: false, error: SchemaError.expectedButGot(type.name, typeOf(value), path) };
|
|
57
|
-
}
|
|
58
|
-
return coercer(value, path);
|
|
59
|
-
}
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures, @typescript-eslint/require-await
|
|
61
|
-
async [testAsync](value, options, path) {
|
|
62
|
-
return this[test](value, options, path);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function convertOptions(options) {
|
|
66
|
-
return {
|
|
67
|
-
coerce: options?.coerce ?? false,
|
|
68
|
-
mask: options?.mask ?? false
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=schema.validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.validator.js","sourceRoot":"","sources":["../../source/schema/schema.validator.ts"],"names":[],"mappings":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O,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEzH,IAAI,WAAW,CAAC,OAAO,CAAC,EAAE;YACxB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;SAC5F;QAED,OAAO,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,6GAA6G;IACnG,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,KAAqB,EAAE,OAAiC,EAAE,IAAc;QAClG,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;CAGF;AAED,SAAS,cAAc,CAAC,OAA2B;IACjD,OAAO;QACL,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,KAAK;QAChC,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,KAAK;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { JsonPath } from "../../json-path/index.js";
|
|
2
|
-
import type { DefinedValidationOptions, ValidationTestResult } from '../schema.validator.js';
|
|
3
|
-
import { SchemaValidator, test } from '../schema.validator.js';
|
|
4
|
-
import type { SchemaDefinition, SchemaInput, SchemaOptions, SchemaOutput } from '../types.js';
|
|
5
|
-
export declare type AsyncIterableSchemaDefinition<T extends SchemaDefinition> = SchemaDefinition<'asyncIterable', AsyncIterable<SchemaInput<T>>, AsyncIterable<SchemaOutput<T>>> & {
|
|
6
|
-
schema: T;
|
|
7
|
-
};
|
|
8
|
-
export declare class AsyncIterableSchemaValidator<T extends SchemaDefinition> extends SchemaValidator<AsyncIterableSchemaDefinition<T>> {
|
|
9
|
-
private readonly innerValidator;
|
|
10
|
-
constructor(innerValidator: SchemaValidator<T>, schema: AsyncIterableSchemaDefinition<T>);
|
|
11
|
-
[test](value: unknown, options: DefinedValidationOptions, path: JsonPath): ValidationTestResult<SchemaOutput<AsyncIterableSchemaDefinition<T>>>;
|
|
12
|
-
}
|
|
13
|
-
export declare function asyncIterable<T extends SchemaDefinition>(schemaValidator: SchemaValidator<T>, options?: SchemaOptions<AsyncIterableSchemaDefinition<T>, 'schema'>): AsyncIterableSchemaValidator<T>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { isAnyIterable } from "../../utils/any-iterable-iterator.js";
|
|
2
|
-
import { mapAsync } from "../../utils/async-iterable-helpers/map.js";
|
|
3
|
-
import { typeOf } from "../../utils/type-of.js";
|
|
4
|
-
import { SchemaError } from '../schema.error.js';
|
|
5
|
-
import { SchemaValidator, test, testAsync } from '../schema.validator.js';
|
|
6
|
-
import { schemaHelper } from '../types.js';
|
|
7
|
-
export class AsyncIterableSchemaValidator extends SchemaValidator {
|
|
8
|
-
constructor(innerValidator, schema) {
|
|
9
|
-
super(schema);
|
|
10
|
-
this.innerValidator = innerValidator;
|
|
11
|
-
}
|
|
12
|
-
[test](value, options, path) {
|
|
13
|
-
if (!isAnyIterable(value)) {
|
|
14
|
-
return { valid: false, error: SchemaError.expectedButGot('iterable or async-iterable', typeOf(value), path) };
|
|
15
|
-
}
|
|
16
|
-
const innerValidator = this.innerValidator;
|
|
17
|
-
const validatedAsyncIterable = mapAsync(value, async (innerValue) => {
|
|
18
|
-
const testResult = await innerValidator[testAsync](innerValue, options, path.add('@asyncIteration'));
|
|
19
|
-
if (!testResult.valid) {
|
|
20
|
-
throw testResult.error;
|
|
21
|
-
}
|
|
22
|
-
return testResult.value;
|
|
23
|
-
});
|
|
24
|
-
return { valid: true, value: validatedAsyncIterable };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function asyncIterable(schemaValidator, options) {
|
|
28
|
-
const schema = schemaHelper({
|
|
29
|
-
type: 'asyncIterable',
|
|
30
|
-
schema: schemaValidator.schema,
|
|
31
|
-
...options
|
|
32
|
-
});
|
|
33
|
-
return new AsyncIterableSchemaValidator(schemaValidator, schema);
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=async-iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"async-iterable.js","sourceRoot":"","sources":["../../../source/schema/schemas/async-iterable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,6CAAyC;AACjE,OAAO,EAAE,QAAQ,EAAE,kDAA8C;AACjE,OAAO,EAAE,MAAM,EAAE,+BAA2B;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAM3C,MAAM,OAAO,4BAAyD,SAAQ,eAAiD;IAG7H,YAAY,cAAkC,EAAE,MAAwC;QACtF,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,CAAC,IAAI,CAAC,CAAC,KAAc,EAAE,OAAiC,EAAE,IAAc;QACtE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE;YACzB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,4BAA4B,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;SAC/G;QAED,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAE3C,MAAM,sBAAsB,GAAG,QAAQ,CAAC,KAAuC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;YACpG,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,SAAS,CAAC,CAAC,UAA4B,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC;YAEvH,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE;gBACrB,MAAM,UAAU,CAAC,KAAK,CAAC;aACxB;YAED,OAAO,UAAU,CAAC,KAAK,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IACxD,CAAC;CACF;AAED,MAAM,UAAU,aAAa,CAA6B,eAAmC,EAAE,OAAmE;IAChK,MAAM,MAAM,GAAG,YAAY,CAAmC;QAC5D,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE,eAAe,CAAC,MAAM;QAC9B,GAAG,OAAO;KACX,CAAC,CAAC;IAEH,OAAO,IAAI,4BAA4B,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { JsonPath } from "../../json-path/index.js";
|
|
2
|
-
import type { DefinedValidationOptions, ValidationTestResult } from '../schema.validator.js';
|
|
3
|
-
import { SchemaValidator, test } from '../schema.validator.js';
|
|
4
|
-
import type { SchemaDefinition, SchemaInput, SchemaOptions, SchemaOutput } from '../types.js';
|
|
5
|
-
export declare type IterableSchemaDefinition<T extends SchemaDefinition> = SchemaDefinition<'iterable', Iterable<SchemaInput<T>>, Iterable<SchemaOutput<T>>> & {
|
|
6
|
-
schema: T;
|
|
7
|
-
};
|
|
8
|
-
export declare class IterableSchemaValidator<T extends SchemaDefinition> extends SchemaValidator<IterableSchemaDefinition<T>> {
|
|
9
|
-
private readonly innerValidator;
|
|
10
|
-
constructor(innerValidator: SchemaValidator<T>, schema: IterableSchemaDefinition<T>);
|
|
11
|
-
[test](value: unknown, options: DefinedValidationOptions, path: JsonPath): ValidationTestResult<SchemaOutput<IterableSchemaDefinition<T>>>;
|
|
12
|
-
}
|
|
13
|
-
export declare function iterable<T extends SchemaDefinition>(schemaValidator: SchemaValidator<T>, options?: SchemaOptions<IterableSchemaDefinition<T>, 'schema'>): IterableSchemaValidator<T>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { isIterable } from "../../utils/iterable-helpers/is-iterable.js";
|
|
2
|
-
import { map } from "../../utils/iterable-helpers/map.js";
|
|
3
|
-
import { typeOf } from "../../utils/type-of.js";
|
|
4
|
-
import { SchemaError } from '../schema.error.js';
|
|
5
|
-
import { SchemaValidator, test } from '../schema.validator.js';
|
|
6
|
-
import { schemaHelper } from '../types.js';
|
|
7
|
-
export class IterableSchemaValidator extends SchemaValidator {
|
|
8
|
-
constructor(innerValidator, schema) {
|
|
9
|
-
super(schema);
|
|
10
|
-
this.innerValidator = innerValidator;
|
|
11
|
-
}
|
|
12
|
-
[test](value, options, path) {
|
|
13
|
-
if (!isIterable(value)) {
|
|
14
|
-
return { valid: false, error: SchemaError.expectedButGot('iterable', typeOf(value), path) };
|
|
15
|
-
}
|
|
16
|
-
const innerValidator = this.innerValidator;
|
|
17
|
-
const validatedIterable = map(value, (innerValue) => {
|
|
18
|
-
const testResult = innerValidator[test](innerValue, options, path.add('@iteration'));
|
|
19
|
-
if (!testResult.valid) {
|
|
20
|
-
throw testResult.error;
|
|
21
|
-
}
|
|
22
|
-
return testResult.value;
|
|
23
|
-
});
|
|
24
|
-
return { valid: true, value: validatedIterable };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function iterable(schemaValidator, options) {
|
|
28
|
-
const schema = schemaHelper({
|
|
29
|
-
type: 'iterable',
|
|
30
|
-
schema: schemaValidator.schema,
|
|
31
|
-
...options
|
|
32
|
-
});
|
|
33
|
-
return new IterableSchemaValidator(schemaValidator, schema);
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=iterable.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"iterable.js","sourceRoot":"","sources":["../../../source/schema/schemas/iterable.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,oDA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M,GAAG,YAAY,CAA8B;QACvD,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,eAAe,CAAC,MAAM;QAC9B,GAAG,OAAO;KACX,CAAC,CAAC;IAEH,OAAO,IAAI,uBAAuB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { JsonPath } from "../../json-path/index.js";
|
|
2
|
-
import type { DefinedValidationOptions, ValidationTestResult } from '../schema.validator.js';
|
|
3
|
-
import { SchemaValidator, test } from '../schema.validator.js';
|
|
4
|
-
import type { SchemaDefinition, SchemaOptions, SchemaOutput } from '../types.js';
|
|
5
|
-
export declare type NeverSchemaDefinition = SchemaDefinition<'never', unknown, never>;
|
|
6
|
-
export declare class NeverSchemaValidator extends SchemaValidator<NeverSchemaDefinition> {
|
|
7
|
-
[test](value: unknown, _options: DefinedValidationOptions, path: JsonPath): ValidationTestResult<SchemaOutput<NeverSchemaDefinition>>;
|
|
8
|
-
}
|
|
9
|
-
export declare function never(options?: SchemaOptions<NeverSchemaDefinition>): NeverSchemaValidator;
|
package/schema/schemas/never.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { typeOf } from "../../utils/type-of.js";
|
|
2
|
-
import { SchemaError } from '../schema.error.js';
|
|
3
|
-
import { SchemaValidator, test } from '../schema.validator.js';
|
|
4
|
-
import { schemaHelper } from '../types.js';
|
|
5
|
-
export class NeverSchemaValidator extends SchemaValidator {
|
|
6
|
-
[test](value, _options, path) {
|
|
7
|
-
return { valid: false, error: SchemaError.expectedButGot('never', typeOf(value), path) };
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export function never(options) {
|
|
11
|
-
const schema = schemaHelper({
|
|
12
|
-
type: 'never',
|
|
13
|
-
...options
|
|
14
|
-
});
|
|
15
|
-
return new NeverSchemaValidator(schema);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=never.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"never.js","sourceRoot":"","sources":["../../../source/schema/schemas/never.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,+BAA2B;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,MAAM,OAAO,oBAAqB,SAAQ,eAAsC;IAC9E,CAAC,IAAI,CAAC,CAAC,KAAc,EAAE,QAAkC,EAAE,IAAc;QACvE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;IAC3F,CAAC;CACF;AAED,MAAM,UAAU,KAAK,CAAC,OAA8C;IAClE,MAAM,MAAM,GAAG,YAAY,CAAwB;QACjD,IAAI,EAAE,OAAO;QACb,GAAG,OAAO;KACX,CAAC,CAAC;IAEH,OAAO,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { JsonPath } from "../../json-path/index.js";
|
|
2
|
-
import type { DefinedValidationOptions, ValidationTestResult } from '../schema.validator.js';
|
|
3
|
-
import { SchemaValidator, test, testAsync } from '../schema.validator.js';
|
|
4
|
-
import type { SchemaDefinition, SchemaInput, SchemaOptions, SchemaOutput } from '../types.js';
|
|
5
|
-
export declare type Preprocessor<S extends SchemaDefinition, Input> = (value: Input) => SchemaInput<S> | Promise<SchemaInput<S>>;
|
|
6
|
-
export declare type PreprocessSchemaDefinition<S extends SchemaDefinition = SchemaDefinition, Input = never> = SchemaDefinition<'preprocess', Input, SchemaOutput<S>> & {
|
|
7
|
-
outputSchema: S;
|
|
8
|
-
preprocessor: Preprocessor<S, Input>;
|
|
9
|
-
};
|
|
10
|
-
export declare class PreprocessSchemaValidator<T extends SchemaDefinition, Input = never> extends SchemaValidator<PreprocessSchemaDefinition<T, Input>> {
|
|
11
|
-
private readonly outputValidator;
|
|
12
|
-
constructor(schema: PreprocessSchemaDefinition<T, Input>, outputValidator: SchemaValidator<T>);
|
|
13
|
-
[test](value: Input, options: DefinedValidationOptions, path: JsonPath): ValidationTestResult<SchemaOutput<T>>;
|
|
14
|
-
protected [testAsync](value: Input, options: DefinedValidationOptions, path: JsonPath): Promise<ValidationTestResult<SchemaOutput<T>>>;
|
|
15
|
-
}
|
|
16
|
-
export declare function preprocess<T extends SchemaDefinition, Input>(outputSchemaValidator: SchemaValidator<T>, preprocessor: Preprocessor<T, Input>, options?: SchemaOptions<PreprocessSchemaDefinition<T, Input>, 'outputSchema' | 'preprocessor'>): PreprocessSchemaValidator<T, Input>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { isPromise } from "../../utils/type-guards.js";
|
|
2
|
-
import { SchemaValidator, test, testAsync } from '../schema.validator.js';
|
|
3
|
-
import { schemaHelper } from '../types.js';
|
|
4
|
-
export class PreprocessSchemaValidator extends SchemaValidator {
|
|
5
|
-
constructor(schema, outputValidator) {
|
|
6
|
-
super(schema);
|
|
7
|
-
this.outputValidator = outputValidator;
|
|
8
|
-
}
|
|
9
|
-
[test](value, options, path) {
|
|
10
|
-
const preprocessed = this.schema.preprocessor(value);
|
|
11
|
-
if (isPromise(preprocessed)) {
|
|
12
|
-
throw new Error(`cannot handle async preprocess in sync validation. Use async instead (path: ${path.path})`);
|
|
13
|
-
}
|
|
14
|
-
return this.outputValidator[test](preprocessed, options, path);
|
|
15
|
-
}
|
|
16
|
-
async [testAsync](value, options, path) {
|
|
17
|
-
const preprocessed = await this.schema.preprocessor(value);
|
|
18
|
-
return this.outputValidator[testAsync](preprocessed, options, path);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export function preprocess(outputSchemaValidator, preprocessor, options) {
|
|
22
|
-
const schema = schemaHelper({
|
|
23
|
-
type: 'preprocess',
|
|
24
|
-
outputSchema: outputSchemaValidator.schema,
|
|
25
|
-
preprocessor,
|
|
26
|
-
...options
|
|
27
|
-
});
|
|
28
|
-
return new PreprocessSchemaValidator(schema, outputSchemaValidator);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=preprocess.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preprocess.js","sourceRoot":"","sources":["../../../source/schema/schemas/preprocess.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mCAA+B;AAEnD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAS3C,MAAM,OAAO,yBAAqE,SAAQ,eAAqD;IAG7I,YAAY,MAA4C,EAAE,eAAmC;QAC3F,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,CAAC,IAAI,CAAC,CAAC,KAAY,EAAE,OAAiC,EAAE,IAAc;QACpE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAErD,IAAI,SAAS,CAAC,YAAY,CAAC,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,+EAA+E,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;SAC9G;QAED,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IAES,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,KAAY,EAAE,OAAiC,EAAE,IAAc;QACzF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAoC,qBAAyC,EAAE,YAAoC,EAAE,OAA8F;IAC3O,MAAM,MAAM,GAAG,YAAY,CAAuC;QAChE,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,qBAAqB,CAAC,MAAM;QAC1C,YAAY;QACZ,GAAG,OAAO;KACX,CAAC,CAAC;IAEH,OAAO,IAAI,yBAAyB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { JsonPath } from "../../json-path/index.js";
|
|
2
|
-
import { SchemaError } from '../schema.error.js';
|
|
3
|
-
import type { DefinedValidationOptions, ValidationTestResult } from '../schema.validator.js';
|
|
4
|
-
import { SchemaValidator, test, testAsync } from '../schema.validator.js';
|
|
5
|
-
import type { SchemaDefinition, SchemaInput, SchemaOptions, SchemaOutput } from '../types.js';
|
|
6
|
-
export declare type RefineResult = {
|
|
7
|
-
valid: true;
|
|
8
|
-
error?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
valid: false;
|
|
11
|
-
error: SchemaError | string;
|
|
12
|
-
};
|
|
13
|
-
export declare type Refiner<T> = (value: T, path: JsonPath) => RefineResult | Promise<RefineResult>;
|
|
14
|
-
export declare type RefineSchemaDefinition<S extends SchemaDefinition = SchemaDefinition> = SchemaDefinition<'refine', SchemaInput<S>, SchemaOutput<S>> & {
|
|
15
|
-
inputSchema: S;
|
|
16
|
-
refiner: Refiner<SchemaOutput<S>>;
|
|
17
|
-
};
|
|
18
|
-
export declare class RefineSchemaValidator<T extends SchemaDefinition> extends SchemaValidator<RefineSchemaDefinition<T>> {
|
|
19
|
-
private readonly inputValidator;
|
|
20
|
-
constructor(schema: RefineSchemaDefinition<T>, inputValidator: SchemaValidator<T>);
|
|
21
|
-
[test](value: unknown, options: DefinedValidationOptions, path: JsonPath): ValidationTestResult<SchemaOutput<T>>;
|
|
22
|
-
protected [testAsync](value: unknown, options: DefinedValidationOptions, path: JsonPath): Promise<ValidationTestResult<SchemaOutput<T>>>;
|
|
23
|
-
}
|
|
24
|
-
export declare function refine<T extends SchemaDefinition>(inputSchemaValidator: SchemaValidator<T>, refiner: Refiner<SchemaOutput<T>>, options?: SchemaOptions<RefineSchemaDefinition<T>, 'inputSchema' | 'refiner'>): RefineSchemaValidator<T>;
|
package/schema/schemas/refine.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { isPromise } from "../../utils/type-guards.js";
|
|
2
|
-
import { SchemaError } from '../schema.error.js';
|
|
3
|
-
import { SchemaValidator, test, testAsync } from '../schema.validator.js';
|
|
4
|
-
import { schemaHelper } from '../types.js';
|
|
5
|
-
export class RefineSchemaValidator extends SchemaValidator {
|
|
6
|
-
constructor(schema, inputValidator) {
|
|
7
|
-
super(schema);
|
|
8
|
-
this.inputValidator = inputValidator;
|
|
9
|
-
}
|
|
10
|
-
[test](value, options, path) {
|
|
11
|
-
const inputTestResult = this.inputValidator[test](value, options, path);
|
|
12
|
-
if (!inputTestResult.valid) {
|
|
13
|
-
return inputTestResult;
|
|
14
|
-
}
|
|
15
|
-
const refineResult = this.schema.refiner(inputTestResult.value, path);
|
|
16
|
-
if (isPromise(refineResult)) {
|
|
17
|
-
throw new Error(`cannot handle async refine in sync validation. Use async instead (path: ${path.path})`);
|
|
18
|
-
}
|
|
19
|
-
if (!refineResult.valid) {
|
|
20
|
-
const error = (refineResult.error instanceof SchemaError) ? refineResult.error : new SchemaError(refineResult.error, { path });
|
|
21
|
-
return { valid: false, error };
|
|
22
|
-
}
|
|
23
|
-
return { valid: true, value: inputTestResult.value };
|
|
24
|
-
}
|
|
25
|
-
async [testAsync](value, options, path) {
|
|
26
|
-
const inputTestResult = await this.inputValidator[testAsync](value, options, path);
|
|
27
|
-
if (!inputTestResult.valid) {
|
|
28
|
-
return inputTestResult;
|
|
29
|
-
}
|
|
30
|
-
const refineResult = await this.schema.refiner(inputTestResult.value, path);
|
|
31
|
-
if (!refineResult.valid) {
|
|
32
|
-
const error = (refineResult.error instanceof SchemaError) ? refineResult.error : new SchemaError(refineResult.error, { path });
|
|
33
|
-
return { valid: false, error };
|
|
34
|
-
}
|
|
35
|
-
return { valid: true, value: inputTestResult.value };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
export function refine(inputSchemaValidator, refiner, options) {
|
|
39
|
-
const schema = schemaHelper({
|
|
40
|
-
type: 'refine',
|
|
41
|
-
inputSchema: inputSchemaValidator.schema,
|
|
42
|
-
refiner,
|
|
43
|
-
...options
|
|
44
|
-
});
|
|
45
|
-
return new RefineSchemaValidator(schema, inputSchemaValidator);
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=refine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refine.js","sourceRoot":"","sources":["../../../source/schema/schemas/refine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mCAA+B;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAa3C,MAAM,OAAO,qBAAkD,SAAQ,eAA0C;IAG/G,YAAY,MAAiC,EAAE,cAAkC;QAC/E,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,CAAC,IAAI,CAAC,CAAC,KAAc,EAAE,OAAiC,EAAE,IAAc;QACtE,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,KAAuB,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAE1F,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;YAC1B,OAAO,eAAe,CAAC;S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