@tstdl/base 0.81.35 → 0.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/client/client.d.ts +3 -3
- package/api/default-error-handlers.d.ts +1 -1
- package/api/response.d.ts +8 -8
- package/api/server/api-controller.d.ts +1 -1
- package/api/server/gateway.d.ts +9 -9
- package/api/server/middlewares/cors.middleware.d.ts +1 -1
- package/api/server/module.d.ts +1 -1
- package/api/types.d.ts +30 -30
- package/api/utils.d.ts +1 -1
- package/api/utils.js +3 -1
- package/api/utils.js.map +1 -1
- package/authentication/authentication-credentials.service.d.ts +6 -0
- package/authentication/authentication-credentials.service.js +17 -0
- package/authentication/authentication-credentials.service.js.map +1 -0
- package/authentication/authentication-session.repository.d.ts +6 -0
- package/authentication/authentication-session.repository.js +18 -0
- package/authentication/authentication-session.repository.js.map +1 -0
- package/authentication/authentication-token-payload.provider.d.ts +3 -0
- package/authentication/authentication-token-payload.provider.js +17 -0
- package/authentication/authentication-token-payload.provider.js.map +1 -0
- package/authentication/authentication.service.d.ts +42 -0
- package/authentication/authentication.service.js +133 -0
- package/authentication/authentication.service.js.map +1 -0
- package/authentication/models/authentication-credentials.model.d.ts +11 -0
- package/authentication/models/authentication-credentials.model.js +44 -0
- package/authentication/models/authentication-credentials.model.js.map +1 -0
- package/authentication/models/authentication-session.model.d.ts +14 -0
- package/authentication/models/authentication-session.model.js +59 -0
- package/authentication/models/authentication-session.model.js.map +1 -0
- package/authentication/models/index.d.ts +2 -0
- package/authentication/models/index.js +19 -0
- package/authentication/models/index.js.map +1 -0
- package/authentication/tokens.d.ts +2 -0
- package/authentication/tokens.js +6 -0
- package/authentication/tokens.js.map +1 -0
- package/collections/keyed-set.d.ts +1 -1
- package/collections/observable/observable-collection.d.ts +1 -1
- package/collections/observable/observable-list.d.ts +2 -2
- package/container/container.d.ts +3 -3
- package/container/container.js +3 -3
- package/container/container.js.map +1 -1
- package/container/decorators.d.ts +3 -3
- package/container/decorators.js +0 -1
- package/container/decorators.js.map +1 -1
- package/container/interfaces.d.ts +1 -1
- package/container/provider.d.ts +6 -6
- package/container/resolve-chain.d.ts +2 -2
- package/container/resolve-chain.js +1 -1
- package/container/resolve-chain.js.map +1 -1
- package/container/token.d.ts +3 -3
- package/container/type-info.d.ts +1 -1
- package/container/types.d.ts +4 -4
- package/core.d.ts +1 -1
- package/data-structures/linked-list.d.ts +1 -1
- package/data-structures/multi-key-map.d.ts +2 -2
- package/data-structures/sorted-array-list.d.ts +1 -1
- package/database/entity-repository.d.ts +2 -2
- package/database/entity.d.ts +3 -3
- package/database/module.d.ts +1 -1
- package/database/mongo/classes.d.ts +3 -3
- package/database/mongo/model/document.d.ts +3 -3
- package/database/mongo/module.d.ts +1 -1
- package/database/mongo/mongo-base.repository.d.ts +11 -11
- package/database/mongo/mongo-bulk.d.ts +1 -1
- package/database/mongo/mongo-entity-repository.d.ts +7 -7
- package/database/mongo/types.d.ts +16 -16
- package/database/query.d.ts +38 -38
- package/disposable/async-disposer.d.ts +3 -3
- package/distributed-loop/distributed-loop.d.ts +2 -2
- package/error/custom.error.d.ts +1 -1
- package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
- package/http/client/http-client-request.d.ts +5 -5
- package/http/client/http-client-response.d.ts +2 -2
- package/http/client/http-client.d.ts +5 -5
- package/http/http-body.d.ts +3 -1
- package/http/http-body.js +18 -12
- package/http/http-body.js.map +1 -1
- package/http/http-form.d.ts +2 -2
- package/http/http-headers.d.ts +3 -3
- package/http/http-query.d.ts +2 -2
- package/http/http-url-parameters.d.ts +2 -2
- package/http/http-value-map.d.ts +1 -1
- package/http/server/http-server-request.d.ts +1 -1
- package/http/server/http-server-response.d.ts +1 -1
- package/http/server/http-server.d.ts +1 -1
- package/http/server/node/node-http-server.d.ts +1 -1
- package/http/types.d.ts +5 -5
- package/http/utils.d.ts +3 -3
- package/image-service/imgproxy/imgproxy-image-service.d.ts +1 -1
- package/json-path/json-path.d.ts +4 -4
- package/key-value-store/key-value.store.d.ts +1 -1
- package/key-value-store/mongo/module.d.ts +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +1 -1
- package/lock/lock.d.ts +4 -4
- package/lock/mongo/model.d.ts +1 -1
- package/lock/mongo/module.d.ts +1 -1
- package/lock/provider.d.ts +1 -1
- package/logger/logger.d.ts +6 -6
- package/mail/mail.client.d.ts +1 -1
- package/mail/mail.service.d.ts +3 -1
- package/mail/mail.service.js +11 -6
- package/mail/mail.service.js.map +1 -1
- package/mail/models/mail-address.model.d.ts +1 -1
- package/mail/models/mail-content.model.d.ts +1 -1
- package/mail/models/mail-data.model.d.ts +2 -1
- package/mail/models/mail-log.model.d.ts +2 -2
- package/mail/models/mail-send-result.model.d.ts +1 -1
- package/mail/models/mail-template.model.d.ts +1 -1
- package/mail/module.d.ts +4 -2
- package/mail/module.js +6 -2
- package/mail/module.js.map +1 -1
- package/mail/repositories/mongo-mail-log.repository.d.ts +2 -2
- package/mail/tokens.d.ts +1 -0
- package/mail/tokens.js +2 -1
- package/mail/tokens.js.map +1 -1
- package/message-bus/local/types.d.ts +1 -1
- package/message-bus/message-bus.d.ts +1 -1
- package/migration/migration-state.d.ts +2 -2
- package/migration/migrator.d.ts +4 -4
- package/migration/mongo/module.d.ts +1 -1
- package/module/module-metric-reporter.d.ts +2 -2
- package/module/module.d.ts +1 -1
- package/module/modules/function.module.d.ts +1 -1
- package/module/modules/web-server.module.d.ts +1 -1
- package/notification/api.d.ts +3 -6
- package/notification/api.js +2 -5
- package/notification/api.js.map +1 -1
- package/notification/models/index.d.ts +2 -0
- package/notification/models/index.js +19 -0
- package/notification/models/index.js.map +1 -0
- package/notification/models/notification-channel-job.model.d.ts +3 -0
- package/notification/models/notification-channel-job.model.js +3 -0
- package/notification/models/notification-channel-job.model.js.map +1 -0
- package/notification/models/notification.model.d.ts +27 -0
- package/notification/{model.js → models/notification.model.js} +28 -16
- package/notification/models/notification.model.js.map +1 -0
- package/notification/module.d.ts +1 -1
- package/notification/notification-channel.service.d.ts +5 -0
- package/notification/notification-channel.service.js +7 -0
- package/notification/notification-channel.service.js.map +1 -0
- package/notification/notification.service.d.ts +8 -0
- package/notification/notification.service.js +40 -0
- package/notification/notification.service.js.map +1 -0
- package/object-storage/object-storage.d.ts +2 -2
- package/object-storage/object.d.ts +1 -1
- package/object-storage/s3/s3.object-storage-provider.d.ts +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +1 -1
- package/openid-connect/oidc-configuration.service.d.ts +1 -1
- package/openid-connect/oidc-state.model.d.ts +2 -2
- package/openid-connect/oidc.service-model.d.ts +8 -8
- package/orm/decorators.d.ts +26 -0
- package/orm/decorators.js +170 -0
- package/orm/decorators.js.map +1 -1
- package/orm/entity-definition.model.d.ts +51 -0
- package/orm/entity-definition.model.js +27 -0
- package/orm/entity-definition.model.js.map +1 -0
- package/orm/index.d.ts +1 -0
- package/orm/index.js +18 -0
- package/orm/index.js.map +1 -0
- package/orm/models/entity.d.ts +22 -0
- package/orm/models/entity.js +87 -0
- package/orm/models/entity.js.map +1 -0
- package/orm/models/index.d.ts +1 -0
- package/orm/models/index.js +18 -0
- package/orm/models/index.js.map +1 -0
- package/orm/repository/mongo/classes.d.ts +25 -0
- package/orm/repository/mongo/classes.js +33 -0
- package/orm/repository/mongo/classes.js.map +1 -0
- package/orm/repository/mongo/module.d.ts +8 -0
- package/orm/repository/mongo/module.js +88 -0
- package/orm/repository/mongo/module.js.map +1 -0
- package/orm/repository/mongo/mongo-repository.d.ts +11 -0
- package/orm/repository/mongo/mongo-repository.js +55 -0
- package/orm/repository/mongo/mongo-repository.js.map +1 -0
- package/orm/repository/mongo/mongo-transaction.d.ts +10 -0
- package/orm/repository/mongo/mongo-transaction.js +28 -0
- package/orm/repository/mongo/mongo-transaction.js.map +1 -0
- package/orm/repository/repository.d.ts +75 -0
- package/orm/repository/repository.js +182 -0
- package/orm/repository/repository.js.map +1 -0
- package/orm/repository/transaction.d.ts +26 -0
- package/orm/repository/transaction.js +65 -0
- package/orm/repository/transaction.js.map +1 -0
- package/orm/{types.d.ts → types/definition.d.ts} +5 -5
- package/orm/{types.js → types/definition.js} +8 -8
- package/orm/types/definition.js.map +1 -0
- package/orm/types/index.d.ts +3 -0
- package/orm/types/index.js +20 -0
- package/orm/types/index.js.map +1 -0
- package/orm/types/options.d.ts +36 -0
- package/orm/types/options.js +5 -0
- package/orm/types/options.js.map +1 -0
- package/orm/types/query.d.ts +110 -0
- package/orm/types/query.js +10 -0
- package/orm/types/query.js.map +1 -0
- package/package.json +5 -5
- package/pdf/pdf.service.d.ts +3 -3
- package/pool/pool.d.ts +4 -4
- package/promise/cancelable-promise.d.ts +1 -1
- package/promise/lazy-promise.d.ts +1 -1
- package/queue/mongo/job.d.ts +2 -2
- package/queue/mongo/queue.js +2 -2
- package/queue/mongo/queue.js.map +1 -1
- package/queue/queue.d.ts +11 -6
- package/queue/queue.js +2 -1
- package/queue/queue.js.map +1 -1
- package/reflection/decorator-data.js +2 -1
- package/reflection/decorator-data.js.map +1 -1
- package/reflection/registry.d.ts +18 -17
- package/reflection/registry.js +25 -10
- package/reflection/registry.js.map +1 -1
- package/reflection/types.d.ts +34 -34
- package/reflection/utils.d.ts +8 -8
- package/reflection/utils.js +6 -6
- package/reflection/utils.js.map +1 -1
- package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
- package/rpc/model.d.ts +22 -22
- package/rpc/rpc.d.ts +1 -1
- package/rxjs/intersection-observer.d.ts +1 -1
- package/rxjs/mutation-observer.d.ts +1 -1
- package/rxjs/performance-observer.d.ts +1 -1
- package/rxjs/resize-observer.d.ts +1 -1
- package/rxjs/slow-array.d.ts +1 -1
- package/rxjs/touch.d.ts +1 -1
- package/schema/array-constraints/maximum-length.d.ts +2 -2
- package/schema/array-constraints/maximum-length.js +2 -2
- package/schema/array-constraints/maximum-length.js.map +1 -1
- package/schema/array-constraints/minimum-length.d.ts +2 -2
- package/schema/array-constraints/minimum-length.js +2 -2
- package/schema/array-constraints/minimum-length.js.map +1 -1
- package/schema/constraints/enumeration.d.ts +4 -4
- package/schema/constraints/enumeration.js +5 -5
- package/schema/constraints/enumeration.js.map +1 -1
- package/schema/constraints/generic.d.ts +4 -4
- package/schema/constraints/generic.js +2 -2
- package/schema/constraints/generic.js.map +1 -1
- package/schema/constraints/integer.d.ts +2 -2
- package/schema/constraints/integer.js +3 -2
- package/schema/constraints/integer.js.map +1 -1
- package/schema/constraints/length.d.ts +1 -1
- package/schema/constraints/literal.d.ts +2 -2
- package/schema/constraints/literal.js +2 -2
- package/schema/constraints/literal.js.map +1 -1
- package/schema/constraints/maximum-date.d.ts +2 -2
- package/schema/constraints/maximum-date.js +3 -2
- package/schema/constraints/maximum-date.js.map +1 -1
- package/schema/constraints/maximum-length.d.ts +2 -2
- package/schema/constraints/maximum-length.js +2 -2
- package/schema/constraints/maximum-length.js.map +1 -1
- package/schema/constraints/maximum.d.ts +2 -2
- package/schema/constraints/maximum.js +3 -2
- package/schema/constraints/maximum.js.map +1 -1
- package/schema/constraints/minimum-date.d.ts +2 -2
- package/schema/constraints/minimum-date.js +3 -2
- package/schema/constraints/minimum-date.js.map +1 -1
- package/schema/constraints/minimum-length.d.ts +2 -2
- package/schema/constraints/minimum-length.js +2 -2
- package/schema/constraints/minimum-length.js.map +1 -1
- package/schema/constraints/minimum.d.ts +2 -2
- package/schema/constraints/minimum.js +3 -2
- package/schema/constraints/minimum.js.map +1 -1
- package/schema/constraints/pattern.d.ts +2 -2
- package/schema/constraints/pattern.js +3 -2
- package/schema/constraints/pattern.js.map +1 -1
- package/schema/decorators/types.d.ts +3 -3
- package/schema/decorators/utils.d.ts +4 -1
- package/schema/decorators/utils.js +1 -1
- package/schema/decorators/utils.js.map +1 -1
- package/schema/schema.d.ts +4 -4
- package/schema/schema.error.d.ts +1 -1
- package/schema/schema.js +10 -13
- package/schema/schema.js.map +1 -1
- package/schema/schemas/any.d.ts +1 -1
- package/schema/schemas/array.d.ts +2 -2
- package/schema/schemas/array.js +2 -2
- package/schema/schemas/array.js.map +1 -1
- package/schema/schemas/boolean.d.ts +1 -1
- package/schema/schemas/date.d.ts +2 -2
- package/schema/schemas/date.js +2 -2
- package/schema/schemas/date.js.map +1 -1
- package/schema/schemas/enumeration.d.ts +2 -2
- package/schema/schemas/enumeration.js +2 -2
- package/schema/schemas/enumeration.js.map +1 -1
- package/schema/schemas/instance.d.ts +1 -1
- package/schema/schemas/literal.d.ts +2 -2
- package/schema/schemas/literal.js +2 -2
- package/schema/schemas/literal.js.map +1 -1
- package/schema/schemas/nullable.d.ts +1 -1
- package/schema/schemas/number.d.ts +2 -2
- package/schema/schemas/number.js +2 -2
- package/schema/schemas/number.js.map +1 -1
- package/schema/schemas/object.d.ts +1 -1
- package/schema/schemas/omit.d.ts +2 -2
- package/schema/schemas/omit.js.map +1 -1
- package/schema/schemas/one-or-many.d.ts +2 -2
- package/schema/schemas/optional.d.ts +1 -1
- package/schema/schemas/readable-stream.d.ts +1 -1
- package/schema/schemas/record.d.ts +1 -1
- package/schema/schemas/regexp.d.ts +1 -1
- package/schema/schemas/string.d.ts +2 -2
- package/schema/schemas/string.js +3 -3
- package/schema/schemas/string.js.map +1 -1
- package/schema/schemas/uint8-array.d.ts +2 -2
- package/schema/schemas/uint8-array.js +3 -3
- package/schema/schemas/uint8-array.js.map +1 -1
- package/schema/schemas/union.d.ts +1 -1
- package/schema/schemas/unknown.d.ts +1 -1
- package/schema/transformers/generic.d.ts +1 -1
- package/schema/types/index.d.ts +5 -0
- package/schema/types/index.js +22 -0
- package/schema/types/index.js.map +1 -0
- package/schema/types/schema-array-constraint.d.ts +5 -0
- package/schema/types/schema-array-constraint.js +7 -0
- package/schema/types/schema-array-constraint.js.map +1 -0
- package/schema/types/schema-value-coercer.d.ts +8 -0
- package/schema/types/schema-value-coercer.js +7 -0
- package/schema/types/schema-value-coercer.js.map +1 -0
- package/schema/types/schema-value-constraint.d.ts +8 -0
- package/schema/types/schema-value-constraint.js +7 -0
- package/schema/types/schema-value-constraint.js.map +1 -0
- package/schema/types/schema-value-transformer.d.ts +7 -0
- package/schema/types/schema-value-transformer.js +7 -0
- package/schema/types/schema-value-transformer.js.map +1 -0
- package/schema/{types.d.ts → types/types.d.ts} +47 -57
- package/schema/types/types.js +174 -0
- package/schema/types/types.js.map +1 -0
- package/schema/utils/schema.js +1 -1
- package/schema/utils/schema.js.map +1 -1
- package/schema/utils/value-type.d.ts +1 -1
- package/schema/utils/value-type.js +1 -1
- package/schema/utils/value-type.js.map +1 -1
- package/search-index/elastic/config.d.ts +1 -1
- package/search-index/elastic/model/elastic-query.d.ts +15 -15
- package/search-index/elastic/model/index-mapping.d.ts +14 -14
- package/search-index/elastic/model/sort.d.ts +3 -3
- package/search-index/elastic/module.d.ts +1 -1
- package/search-index/search-index.d.ts +1 -1
- package/search-index/search-result.d.ts +2 -2
- package/serializer/handlers/error.d.ts +1 -1
- package/serializer/handlers/map.d.ts +1 -1
- package/serializer/handlers/regex.d.ts +1 -1
- package/serializer/handlers/set.d.ts +1 -1
- package/serializer/serializable.d.ts +6 -6
- package/serializer/serializer.d.ts +1 -1
- package/serializer/types.d.ts +15 -15
- package/sse/server-sent-events.d.ts +3 -3
- package/tailwind/theme-adapter.d.ts +1 -1
- package/templates/module.d.ts +1 -1
- package/templates/providers/file.provider-template.d.ts +2 -2
- package/templates/providers/file.provider-template.js +2 -1
- package/templates/providers/file.provider-template.js.map +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +9 -9
- package/templates/renderers/mjml.template-renderer.d.ts +3 -3
- package/templates/renderers/string.template-renderer.d.ts +1 -1
- package/templates/resolvers/file.template-resolver.d.ts +2 -2
- package/templates/template.model.d.ts +1 -1
- package/templates/template.renderer.d.ts +4 -4
- package/templates/template.service.d.ts +1 -1
- package/text/dynamic-text.model.d.ts +1 -1
- package/text/localizable-text.model.d.ts +1 -1
- package/text/localization.service.d.ts +11 -11
- package/theme/theme-service.d.ts +6 -6
- package/threading/thread-pool.d.ts +1 -1
- package/threading/thread-worker.d.ts +1 -1
- package/types/geo-json.d.ts +12 -12
- package/types.d.ts +91 -91
- package/utils/any-iterable-iterator.d.ts +3 -3
- package/utils/array/array.d.ts +14 -1
- package/utils/array/array.js +16 -2
- package/utils/array/array.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
- package/utils/async-iterable-helpers/types.d.ts +7 -7
- package/utils/backoff.d.ts +5 -5
- package/utils/benchmark.d.ts +1 -1
- package/utils/binary-search.d.ts +1 -1
- package/utils/binary.js.map +1 -1
- package/utils/cancellation-token.d.ts +1 -1
- package/utils/compression.d.ts +1 -1
- package/utils/cryptography.d.ts +11 -11
- package/utils/date-time.d.ts +8 -7
- package/utils/date-time.js +6 -2
- package/utils/date-time.js.map +1 -1
- package/utils/equals.d.ts +3 -3
- package/utils/factory-map.d.ts +1 -1
- package/utils/format-error.d.ts +1 -1
- package/utils/function/memoize.d.ts +1 -1
- package/utils/helpers.d.ts +1 -1
- package/utils/iterable-helpers/types.d.ts +6 -6
- package/utils/jwt.d.ts +4 -4
- package/utils/math.d.ts +1 -1
- package/utils/merge.d.ts +1 -1
- package/utils/middleware.d.ts +9 -9
- package/utils/moving-metric.d.ts +1 -1
- package/utils/object/decycle.d.ts +1 -1
- package/utils/object/dereference.d.ts +1 -1
- package/utils/object/forward-ref.d.ts +2 -2
- package/utils/object/lazy-property.d.ts +5 -5
- package/utils/object/merge.d.ts +1 -1
- package/utils/object/object.js +1 -2
- package/utils/object/object.js.map +1 -1
- package/utils/object/property-name.d.ts +5 -5
- package/utils/patch-worker.d.ts +1 -1
- package/utils/periodic-sampler.d.ts +1 -1
- package/utils/provider-function-iterable.d.ts +2 -2
- package/utils/proxy.d.ts +1 -1
- package/utils/singleton.d.ts +2 -2
- package/utils/sort.d.ts +2 -2
- package/utils/stream/stream-helper-types.d.ts +5 -5
- package/utils/type-guards.d.ts +3 -3
- package/utils/url-builder.d.ts +4 -4
- package/web-types.d.ts +4 -4
- package/notification/model.d.ts +0 -18
- package/notification/model.js.map +0 -1
- package/orm/mongo/mongo-repository.d.ts +0 -2
- package/orm/mongo/mongo-repository.js +0 -7
- package/orm/mongo/mongo-repository.js.map +0 -1
- package/orm/types.js.map +0 -1
- package/schema/types.js +0 -102
- package/schema/types.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./schema-array-constraint"), exports);
|
|
18
|
+
__exportStar(require("./schema-value-coercer"), exports);
|
|
19
|
+
__exportStar(require("./schema-value-constraint"), exports);
|
|
20
|
+
__exportStar(require("./schema-value-transformer"), exports);
|
|
21
|
+
__exportStar(require("./types"), exports);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/schema/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,yDAAuC;AACvC,4DAA0C;AAC1C,6DAA2C;AAC3C,0CAAwB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonPath } from "../../json-path/json-path";
|
|
2
|
+
import type { ConstraintContext, ConstraintResult } from './types';
|
|
3
|
+
export declare abstract class SchemaArrayConstraint {
|
|
4
|
+
abstract validate(value: readonly unknown[], path: JsonPath, context: ConstraintContext): ConstraintResult;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-array-constraint.js","sourceRoot":"","sources":["../../../source/schema/types/schema-array-constraint.ts"],"names":[],"mappings":";;;AAGA,MAAsB,qBAAqB;CAE1C;AAFD,sDAEC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonPath } from "../../json-path/json-path";
|
|
2
|
+
import type { OneOrMany } from "../../types";
|
|
3
|
+
import type { CoercerContext, CoerceResult, ValueType } from './types';
|
|
4
|
+
export declare abstract class SchemaValueCoercer {
|
|
5
|
+
abstract readonly sourceType: OneOrMany<ValueType>;
|
|
6
|
+
abstract readonly targetType: ValueType;
|
|
7
|
+
abstract coerce(value: unknown, path: JsonPath, context: CoercerContext): CoerceResult;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-value-coercer.js","sourceRoot":"","sources":["../../../source/schema/types/schema-value-coercer.ts"],"names":[],"mappings":";;;AAIA,MAAsB,kBAAkB;CAKvC;AALD,gDAKC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonPath } from "../../json-path/json-path";
|
|
2
|
+
import type { OneOrMany } from "../../types";
|
|
3
|
+
import type { ConstraintContext, ConstraintResult, ValueType } from './types';
|
|
4
|
+
export declare abstract class SchemaValueConstraint {
|
|
5
|
+
abstract readonly suitableTypes: OneOrMany<ValueType>;
|
|
6
|
+
abstract readonly expects: OneOrMany<string>;
|
|
7
|
+
abstract validate(value: unknown, path: JsonPath, context: ConstraintContext): ConstraintResult;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-value-constraint.js","sourceRoot":"","sources":["../../../source/schema/types/schema-value-constraint.ts"],"names":[],"mappings":";;;AAIA,MAAsB,qBAAqB;CAK1C;AALD,sDAKC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JsonPath } from "../../json-path/json-path";
|
|
2
|
+
import type { OneOrMany } from "../../types";
|
|
3
|
+
import type { TransformerContext, TransformResult, ValueType } from './types';
|
|
4
|
+
export declare abstract class SchemaValueTransformer<T = any, O = any> {
|
|
5
|
+
abstract readonly sourceType?: OneOrMany<ValueType<T>>;
|
|
6
|
+
abstract transform(value: T, path: JsonPath, context: TransformerContext): TransformResult<O>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchemaValueTransformer = void 0;
|
|
4
|
+
class SchemaValueTransformer {
|
|
5
|
+
}
|
|
6
|
+
exports.SchemaValueTransformer = SchemaValueTransformer;
|
|
7
|
+
//# sourceMappingURL=schema-value-transformer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-value-transformer.js","sourceRoot":"","sources":["../../../source/schema/types/schema-value-transformer.ts"],"names":[],"mappings":";;;AAIA,MAAsB,sBAAsB;CAI3C;AAJD,wDAIC"}
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import type { AbstractConstructor, OneOrMany, Record, Type, TypedOmit } from "../../types";
|
|
2
|
+
import type { NormalizedSchema, Schema, SchemaTestable } from '../schema';
|
|
3
|
+
import type { SchemaError } from '../schema.error';
|
|
4
|
+
import type { SchemaArrayConstraint } from './schema-array-constraint';
|
|
5
|
+
import type { SchemaValueCoercer } from './schema-value-coercer';
|
|
6
|
+
import type { SchemaValueConstraint } from './schema-value-constraint';
|
|
7
|
+
import type { SchemaValueTransformer } from './schema-value-transformer';
|
|
5
8
|
declare const schemaOutputTypeSymbol: unique symbol;
|
|
6
|
-
export
|
|
7
|
-
export
|
|
9
|
+
export type SchemaFactoryFunction<T> = (data: T) => T;
|
|
10
|
+
export type SchemaFactory<T> = {
|
|
8
11
|
type: Type<T>;
|
|
9
12
|
builder?: undefined;
|
|
10
13
|
} | {
|
|
11
14
|
type?: undefined;
|
|
12
15
|
builder: SchemaFactoryFunction<T>;
|
|
13
16
|
};
|
|
14
|
-
export
|
|
17
|
+
export type ObjectSchemaProperties<T> = {
|
|
15
18
|
[K in keyof T]-?: OneOrMany<SchemaTestable<T[K]>>;
|
|
16
19
|
};
|
|
17
|
-
export
|
|
20
|
+
export type NormalizedObjectSchemaProperties<T> = {
|
|
18
21
|
[K in keyof T]-?: Schema<T[K]>;
|
|
19
22
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
23
|
+
export type SchemaOutput<T extends SchemaTestable> = T extends ObjectSchema<infer O> ? O : T extends ValueSchema<infer O> ? O : T extends TypeSchema<infer O> ? O : T extends ValueType<infer O> ? NormalizeValueType<O> : never;
|
|
24
|
+
export type TupleSchemaOutput<T extends readonly SchemaTestable[]> = {
|
|
22
25
|
[P in keyof T]: SchemaOutput<T[P]>;
|
|
23
26
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
27
|
+
export type ObjectSchemaOrType<T = any> = ObjectSchema<T> | AbstractConstructor<T>;
|
|
28
|
+
export type ObjectSchema<T = any> = {
|
|
26
29
|
[schemaOutputTypeSymbol]?: T;
|
|
27
30
|
sourceType?: ValueType;
|
|
28
31
|
factory?: SchemaFactory<T>;
|
|
@@ -30,13 +33,13 @@ export declare type ObjectSchema<T = any> = {
|
|
|
30
33
|
mask?: boolean;
|
|
31
34
|
allowUnknownProperties?: OneOrMany<SchemaTestable>;
|
|
32
35
|
};
|
|
33
|
-
export
|
|
36
|
+
export type TypeSchema<T = any> = {
|
|
34
37
|
type: ValueType<T>;
|
|
35
38
|
};
|
|
36
|
-
export
|
|
39
|
+
export type NormalizedTypeSchema<T = any> = {
|
|
37
40
|
foo: ResolvedValueType<T>;
|
|
38
41
|
};
|
|
39
|
-
export
|
|
42
|
+
export type ValueSchema<T = unknown> = {
|
|
40
43
|
[schemaOutputTypeSymbol]?: T;
|
|
41
44
|
schema: OneOrMany<SchemaTestable<T>>;
|
|
42
45
|
array?: boolean;
|
|
@@ -50,15 +53,15 @@ export declare type ValueSchema<T = unknown> = {
|
|
|
50
53
|
arrayConstraints?: OneOrMany<SchemaArrayConstraint>;
|
|
51
54
|
valueConstraints?: OneOrMany<SchemaValueConstraint>;
|
|
52
55
|
};
|
|
53
|
-
export
|
|
54
|
-
export
|
|
56
|
+
export type ValueSchemaOptions = TypedOmit<ValueSchema, 'schema' | typeof schemaOutputTypeSymbol>;
|
|
57
|
+
export type NormalizedObjectSchema<T = any> = {
|
|
55
58
|
[schemaOutputTypeSymbol]?: T;
|
|
56
59
|
factory?: SchemaFactory<T>;
|
|
57
60
|
properties: NormalizedObjectSchemaProperties<T>;
|
|
58
61
|
mask?: boolean;
|
|
59
62
|
allowUnknownProperties: Set<Schema>;
|
|
60
63
|
};
|
|
61
|
-
export
|
|
64
|
+
export type NormalizedValueSchema<T = any> = {
|
|
62
65
|
[schemaOutputTypeSymbol]?: T;
|
|
63
66
|
schema: Set<Schema<T>>;
|
|
64
67
|
array: boolean;
|
|
@@ -70,44 +73,27 @@ export declare type NormalizedValueSchema<T = any> = {
|
|
|
70
73
|
arrayConstraints: readonly SchemaArrayConstraint[];
|
|
71
74
|
valueConstraints: readonly SchemaValueConstraint[];
|
|
72
75
|
};
|
|
73
|
-
export
|
|
76
|
+
export type SchemaContext = {
|
|
74
77
|
schema: NormalizedSchema;
|
|
75
78
|
options: SchemaTestOptions;
|
|
76
79
|
};
|
|
77
|
-
export
|
|
78
|
-
export
|
|
79
|
-
export
|
|
80
|
-
export
|
|
81
|
-
export
|
|
82
|
-
export
|
|
83
|
-
export
|
|
80
|
+
export type ConstraintContext = SchemaContext;
|
|
81
|
+
export type TransformerContext = SchemaContext;
|
|
82
|
+
export type CoercerContext = SchemaContext;
|
|
83
|
+
export type NormalizeValueType<T> = T extends String ? string : T extends Number ? number : T extends Boolean ? boolean : T extends BigInt ? bigint : T extends Symbol ? symbol : T extends 'undefined' ? undefined : T extends 'null' ? null : T extends 'any' ? any : T;
|
|
84
|
+
export type NormalizeToValueType<T> = T extends string | String ? typeof String : T extends number ? typeof Number : T extends boolean ? typeof Boolean : T extends bigint ? typeof BigInt : T extends symbol ? typeof Symbol : T extends undefined ? 'undefined' : T extends null ? 'null' : T extends any ? 'any' : never;
|
|
85
|
+
export type ValueType<T = any> = AbstractConstructor<T> | NormalizeToValueType<T> | DeferredValueType<T>;
|
|
86
|
+
export type DeferredValueType<T = any> = {
|
|
84
87
|
deferred: () => ValueType<T>;
|
|
85
88
|
};
|
|
86
|
-
export
|
|
87
|
-
export
|
|
89
|
+
export type ResolvedValueType<T = any> = Exclude<ValueType<T>, DeferredValueType>;
|
|
90
|
+
export type Coercible = {
|
|
88
91
|
coerce?: boolean;
|
|
89
92
|
};
|
|
90
93
|
export declare const primitiveConstructors: ValueType[];
|
|
91
94
|
export declare const primitiveConstructorSet: Set<ValueType<any>>;
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
export declare type OptionKeys<T extends Record> = readonly (keyof T)[];
|
|
96
|
-
export declare abstract class SchemaValueConstraint {
|
|
97
|
-
abstract readonly suitableTypes: OneOrMany<ValueType>;
|
|
98
|
-
abstract readonly expects: OneOrMany<string>;
|
|
99
|
-
abstract validate(value: unknown, path: JsonPath, context: ConstraintContext): ConstraintResult;
|
|
100
|
-
}
|
|
101
|
-
export declare abstract class SchemaValueTransformer<T = any, O = any> {
|
|
102
|
-
abstract readonly sourceType?: OneOrMany<ValueType<T>>;
|
|
103
|
-
abstract transform(value: T, path: JsonPath, context: TransformerContext): TransformResult<O>;
|
|
104
|
-
}
|
|
105
|
-
export declare abstract class SchemaValueCoercer {
|
|
106
|
-
abstract readonly sourceType: OneOrMany<ValueType>;
|
|
107
|
-
abstract readonly targetType: ValueType;
|
|
108
|
-
abstract coerce(value: unknown, path: JsonPath, context: CoercerContext): CoerceResult;
|
|
109
|
-
}
|
|
110
|
-
export declare type SchemaTestOptions = {
|
|
95
|
+
export type OptionKeys<T extends Record> = readonly (keyof T)[];
|
|
96
|
+
export type SchemaTestOptions = {
|
|
111
97
|
/**
|
|
112
98
|
* Try to convert wrong input into desired output.
|
|
113
99
|
* Can be specified on definition and validation. If specified on both, definition has higher priority
|
|
@@ -123,7 +109,7 @@ export declare type SchemaTestOptions = {
|
|
|
123
109
|
*/
|
|
124
110
|
fastErrors?: boolean;
|
|
125
111
|
};
|
|
126
|
-
export
|
|
112
|
+
export type SchemaTestResult<T> = {
|
|
127
113
|
valid: true;
|
|
128
114
|
value: T;
|
|
129
115
|
error?: undefined;
|
|
@@ -132,14 +118,14 @@ export declare type SchemaTestResult<T> = {
|
|
|
132
118
|
value?: undefined;
|
|
133
119
|
error: SchemaError;
|
|
134
120
|
};
|
|
135
|
-
export
|
|
121
|
+
export type ConstraintResult = {
|
|
136
122
|
valid: true;
|
|
137
123
|
error?: undefined;
|
|
138
124
|
} | {
|
|
139
125
|
valid: false;
|
|
140
126
|
error: SchemaError;
|
|
141
127
|
};
|
|
142
|
-
export
|
|
128
|
+
export type CoerceResult = {
|
|
143
129
|
success: true;
|
|
144
130
|
value: any;
|
|
145
131
|
error?: undefined;
|
|
@@ -149,10 +135,10 @@ export declare type CoerceResult = {
|
|
|
149
135
|
error: SchemaError;
|
|
150
136
|
};
|
|
151
137
|
export declare const transformErrorResultSymbol: unique symbol;
|
|
152
|
-
export
|
|
138
|
+
export type TransformErrorResult = {
|
|
153
139
|
[transformErrorResultSymbol]: SchemaError;
|
|
154
140
|
};
|
|
155
|
-
export
|
|
141
|
+
export type TransformResult<T> = T | TransformErrorResult;
|
|
156
142
|
export declare function transformErrorResult(error: SchemaError): TransformErrorResult;
|
|
157
143
|
export declare function isTransformErrorResult(value: any): value is TransformErrorResult;
|
|
158
144
|
export declare function objectSchemaProperties<T extends Record>(properties: ObjectSchemaProperties<T>): ObjectSchemaProperties<T>;
|
|
@@ -160,16 +146,20 @@ export declare function objectSchema<T extends Record>(schema: ObjectSchema<T>):
|
|
|
160
146
|
export declare function valueSchema<T>(schema: OneOrMany<SchemaTestable<T>>, options?: TypedOmit<ValueSchema<T>, 'schema'>): ValueSchema<T>;
|
|
161
147
|
export declare function typeSchema<T>(type: ValueType<T>): TypeSchema<NormalizeValueType<T>>;
|
|
162
148
|
export declare function isSchema<T>(value: any): value is Schema<T>;
|
|
163
|
-
export declare function isObjectSchema<T extends Record>(schema:
|
|
164
|
-
export declare function isObjectSchema<T extends Record>(schema: any): schema is ObjectSchema<T>;
|
|
165
|
-
export declare function isValueSchema<T>(schema:
|
|
149
|
+
export declare function isObjectSchema<T extends Record = any>(schema: SchemaTestable<T>): schema is ObjectSchema<T>;
|
|
150
|
+
export declare function isObjectSchema<T extends Record = any>(schema: any): schema is ObjectSchema<T>;
|
|
151
|
+
export declare function isValueSchema<T>(schema: SchemaTestable<T>): schema is ValueSchema<T>;
|
|
166
152
|
export declare function isValueSchema<T>(schema: any): schema is ValueSchema<T>;
|
|
167
|
-
export declare function isTypeSchema<T>(schema:
|
|
153
|
+
export declare function isTypeSchema<T>(schema: SchemaTestable<T>): schema is TypeSchema<T>;
|
|
168
154
|
export declare function isTypeSchema<T>(schema: any): schema is TypeSchema<T>;
|
|
169
|
-
export declare function isDeferredValueType<T>(value:
|
|
155
|
+
export declare function isDeferredValueType<T>(value: SchemaTestable<T>): value is DeferredValueType<T>;
|
|
170
156
|
export declare function isDeferredValueType(value: any): value is DeferredValueType;
|
|
171
157
|
export declare function resolveValueTypes<T>(valueTypes: OneOrMany<ValueType<T>>): OneOrMany<ResolvedValueType<T>>;
|
|
172
158
|
export declare function resolveValueType<T>(valueType: ValueType<T>): ResolvedValueType<T>;
|
|
173
159
|
export declare function valueTypesOrSchemasToSchemas<T>(valueTypesOrSchemas: OneOrMany<SchemaTestable<T>>): OneOrMany<Schema<T>>;
|
|
174
160
|
export declare function schemaTestableToSchema<T>(valueTypeOrSchema: SchemaTestable<T>): Schema<T>;
|
|
161
|
+
export declare function optimizeObjectSchema<T>(schema: ObjectSchema<T>): ObjectSchema<T>;
|
|
162
|
+
export declare function optimizeObjectSchemaProperties<T>(properties: ObjectSchemaProperties<T>): ObjectSchemaProperties<T>;
|
|
163
|
+
export declare function optimizeValueSchema<T>(schema: ValueSchema<T>): ValueSchema<T>;
|
|
164
|
+
export declare function optimizeSchema<T>(schema: OneOrMany<SchemaTestable<T>>): OneOrMany<SchemaTestable<T>>;
|
|
175
165
|
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.optimizeSchema = exports.optimizeValueSchema = exports.optimizeObjectSchemaProperties = exports.optimizeObjectSchema = exports.schemaTestableToSchema = exports.valueTypesOrSchemasToSchemas = exports.resolveValueType = exports.resolveValueTypes = exports.isDeferredValueType = exports.isTypeSchema = exports.isValueSchema = exports.isObjectSchema = exports.isSchema = exports.typeSchema = exports.valueSchema = exports.objectSchema = exports.objectSchemaProperties = exports.isTransformErrorResult = exports.transformErrorResult = exports.transformErrorResultSymbol = exports.primitiveConstructorSet = exports.primitiveConstructors = void 0;
|
|
5
|
+
const object_1 = require("../../utils/object/object");
|
|
6
|
+
const type_guards_1 = require("../../utils/type-guards");
|
|
7
|
+
exports.primitiveConstructors = [String, Number, Boolean, Symbol, BigInt, Function, 'undefined', 'null'];
|
|
8
|
+
exports.primitiveConstructorSet = new Set(exports.primitiveConstructors);
|
|
9
|
+
exports.transformErrorResultSymbol = Symbol('Transform error');
|
|
10
|
+
function transformErrorResult(error) {
|
|
11
|
+
return { [exports.transformErrorResultSymbol]: error };
|
|
12
|
+
}
|
|
13
|
+
exports.transformErrorResult = transformErrorResult;
|
|
14
|
+
function isTransformErrorResult(value) {
|
|
15
|
+
return (0, type_guards_1.isObject)(value) && (0, object_1.hasOwnProperty)(value, exports.transformErrorResultSymbol);
|
|
16
|
+
}
|
|
17
|
+
exports.isTransformErrorResult = isTransformErrorResult;
|
|
18
|
+
function objectSchemaProperties(properties) {
|
|
19
|
+
return optimizeObjectSchemaProperties(properties);
|
|
20
|
+
}
|
|
21
|
+
exports.objectSchemaProperties = objectSchemaProperties;
|
|
22
|
+
function objectSchema(schema) {
|
|
23
|
+
return optimizeObjectSchema(schema);
|
|
24
|
+
}
|
|
25
|
+
exports.objectSchema = objectSchema;
|
|
26
|
+
function valueSchema(schema, options) {
|
|
27
|
+
return optimizeValueSchema({ schema, ...options });
|
|
28
|
+
}
|
|
29
|
+
exports.valueSchema = valueSchema;
|
|
30
|
+
function typeSchema(type) {
|
|
31
|
+
return { type };
|
|
32
|
+
}
|
|
33
|
+
exports.typeSchema = typeSchema;
|
|
34
|
+
function isSchema(value) {
|
|
35
|
+
return isObjectSchema(value) || isValueSchema(value) || isTypeSchema(value);
|
|
36
|
+
}
|
|
37
|
+
exports.isSchema = isSchema;
|
|
38
|
+
function isObjectSchema(schema) {
|
|
39
|
+
return (0, type_guards_1.isObject)(schema?.properties);
|
|
40
|
+
}
|
|
41
|
+
exports.isObjectSchema = isObjectSchema;
|
|
42
|
+
function isValueSchema(schema) {
|
|
43
|
+
return (0, type_guards_1.isObject)(schema) && (0, type_guards_1.isDefined)(schema?.schema);
|
|
44
|
+
}
|
|
45
|
+
exports.isValueSchema = isValueSchema;
|
|
46
|
+
function isTypeSchema(schema) {
|
|
47
|
+
if (!(0, type_guards_1.isObject)(schema)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const type = schema.type;
|
|
51
|
+
return (0, type_guards_1.isObject)(schema)
|
|
52
|
+
&& ((0, type_guards_1.isFunction)(type)
|
|
53
|
+
|| ((0, type_guards_1.isObject)(type) && (0, type_guards_1.isFunction)(type.deferred))
|
|
54
|
+
|| (type == 'undefined')
|
|
55
|
+
|| (type == 'null')
|
|
56
|
+
|| (type == 'any'));
|
|
57
|
+
}
|
|
58
|
+
exports.isTypeSchema = isTypeSchema;
|
|
59
|
+
function isDeferredValueType(value) {
|
|
60
|
+
return (0, type_guards_1.isObject)(value) && (0, type_guards_1.isFunction)(value.deferred);
|
|
61
|
+
}
|
|
62
|
+
exports.isDeferredValueType = isDeferredValueType;
|
|
63
|
+
function resolveValueTypes(valueTypes) {
|
|
64
|
+
if ((0, type_guards_1.isArray)(valueTypes)) {
|
|
65
|
+
return valueTypes.map(resolveValueType);
|
|
66
|
+
}
|
|
67
|
+
return resolveValueType(valueTypes);
|
|
68
|
+
}
|
|
69
|
+
exports.resolveValueTypes = resolveValueTypes;
|
|
70
|
+
function resolveValueType(valueType) {
|
|
71
|
+
return isDeferredValueType(valueType)
|
|
72
|
+
? resolveValueType(valueType.deferred())
|
|
73
|
+
: valueType;
|
|
74
|
+
}
|
|
75
|
+
exports.resolveValueType = resolveValueType;
|
|
76
|
+
function valueTypesOrSchemasToSchemas(valueTypesOrSchemas) {
|
|
77
|
+
if ((0, type_guards_1.isArray)(valueTypesOrSchemas)) {
|
|
78
|
+
return valueTypesOrSchemas.map(schemaTestableToSchema);
|
|
79
|
+
}
|
|
80
|
+
return schemaTestableToSchema(valueTypesOrSchemas);
|
|
81
|
+
}
|
|
82
|
+
exports.valueTypesOrSchemasToSchemas = valueTypesOrSchemasToSchemas;
|
|
83
|
+
function schemaTestableToSchema(valueTypeOrSchema) {
|
|
84
|
+
if (isSchema(valueTypeOrSchema)) {
|
|
85
|
+
return valueTypeOrSchema;
|
|
86
|
+
}
|
|
87
|
+
return typeSchema(valueTypeOrSchema);
|
|
88
|
+
}
|
|
89
|
+
exports.schemaTestableToSchema = schemaTestableToSchema;
|
|
90
|
+
function optimizeObjectSchema(schema) {
|
|
91
|
+
return {
|
|
92
|
+
...(0, object_1.filterObject)(schema, type_guards_1.isDefined),
|
|
93
|
+
properties: optimizeObjectSchemaProperties(schema.properties)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
exports.optimizeObjectSchema = optimizeObjectSchema;
|
|
97
|
+
function optimizeObjectSchemaProperties(properties) {
|
|
98
|
+
const entries = (0, object_1.objectEntries)(properties)
|
|
99
|
+
.map(([property, innerSchema]) => [property, optimizeSchema(innerSchema)]);
|
|
100
|
+
return Object.fromEntries(entries);
|
|
101
|
+
}
|
|
102
|
+
exports.optimizeObjectSchemaProperties = optimizeObjectSchemaProperties;
|
|
103
|
+
function optimizeValueSchema(schema) {
|
|
104
|
+
const optimized = optimizeSchema(schema);
|
|
105
|
+
return isValueSchema(optimized) ? optimized : { schema: optimized };
|
|
106
|
+
}
|
|
107
|
+
exports.optimizeValueSchema = optimizeValueSchema;
|
|
108
|
+
function optimizeSchema(schema) {
|
|
109
|
+
if ((0, type_guards_1.isArray)(schema)) {
|
|
110
|
+
if (schema.length == 1) {
|
|
111
|
+
return optimizeSchema(schema[0]);
|
|
112
|
+
}
|
|
113
|
+
return schema.flatMap(optimizeSchema);
|
|
114
|
+
}
|
|
115
|
+
if ((0, type_guards_1.isFunction)(schema) || (0, type_guards_1.isString)(schema) || isDeferredValueType(schema)) {
|
|
116
|
+
return schema;
|
|
117
|
+
}
|
|
118
|
+
if (isTypeSchema(schema)) {
|
|
119
|
+
return schema.type;
|
|
120
|
+
}
|
|
121
|
+
if (isValueSchema(schema)) {
|
|
122
|
+
const entries = (0, object_1.objectEntries)(schema).filter(([, value]) => (0, type_guards_1.isDefined)(value));
|
|
123
|
+
if (entries.length == 1) {
|
|
124
|
+
if (!(0, type_guards_1.isArray)(schema.schema)) {
|
|
125
|
+
return optimizeSchema(schema.schema);
|
|
126
|
+
}
|
|
127
|
+
else if (schema.schema.length == 1) {
|
|
128
|
+
return optimizeSchema(schema.schema[0]);
|
|
129
|
+
}
|
|
130
|
+
return schema.schema.map(optimizeSchema);
|
|
131
|
+
}
|
|
132
|
+
const combinedProperties = new Set([...(0, object_1.objectKeys)(schema), ...(0, object_1.objectKeys)(schema.schema)]);
|
|
133
|
+
if (isValueSchema(schema.schema)
|
|
134
|
+
&& !combinedProperties.has('array')
|
|
135
|
+
&& !combinedProperties.has('coerce')
|
|
136
|
+
&& !combinedProperties.has('coercers')
|
|
137
|
+
&& !combinedProperties.has('transformers')
|
|
138
|
+
&& !combinedProperties.has('arrayConstraints')
|
|
139
|
+
&& !combinedProperties.has('valueConstraints')) {
|
|
140
|
+
return {
|
|
141
|
+
schema: optimizeSchema(schema.schema.schema),
|
|
142
|
+
...(0, object_1.filterObject)({
|
|
143
|
+
optional: ((schema.optional ?? false) || (schema.schema.optional ?? false)) ? true : undefined,
|
|
144
|
+
nullable: ((schema.nullable ?? false) || (schema.schema.nullable ?? false)) ? true : undefined
|
|
145
|
+
}, type_guards_1.isDefined)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const { schema: innerSchema, optional, nullable, coercers, transformers, arrayConstraints, valueConstraints, ...rest } = schema;
|
|
149
|
+
return (0, object_1.filterObject)({
|
|
150
|
+
schema: optimizeSchema(innerSchema),
|
|
151
|
+
optional: (optional ?? false) ? true : undefined,
|
|
152
|
+
nullable: (nullable ?? false) ? true : undefined,
|
|
153
|
+
coercers: optimizeOneOrMany(coercers),
|
|
154
|
+
transformers: optimizeOneOrMany(transformers),
|
|
155
|
+
arrayConstraints: optimizeOneOrMany(arrayConstraints),
|
|
156
|
+
valueConstraints: optimizeOneOrMany(valueConstraints),
|
|
157
|
+
...rest
|
|
158
|
+
}, type_guards_1.isDefined);
|
|
159
|
+
}
|
|
160
|
+
return optimizeObjectSchema(schema);
|
|
161
|
+
}
|
|
162
|
+
exports.optimizeSchema = optimizeSchema;
|
|
163
|
+
function optimizeOneOrMany(values) {
|
|
164
|
+
if ((0, type_guards_1.isArray)(values)) {
|
|
165
|
+
if (values.length == 0) {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
if (values.length == 1) {
|
|
169
|
+
return values[0];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return values;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../source/schema/types/types.ts"],"names":[],"mappings":";AAAA,iDAAiD;;;AAGjD,sDAAgG;AAChG,yDAAyF;AAyH5E,QAAA,qBAAqB,GAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAwC,EAAE,MAAwC,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AAClL,QAAA,uBAAuB,GAAG,IAAI,GAAG,CAAC,6BAAqB,CAAC,CAAC;AAoCzD,QAAA,0BAA0B,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAKpE,SAAgB,oBAAoB,CAAC,KAAkB;IACrD,OAAO,EAAE,CAAC,kCAA0B,CAAC,EAAE,KAAK,EAAE,CAAC;AACjD,CAAC;AAFD,oDAEC;AAED,SAAgB,sBAAsB,CAAC,KAAU;IAC/C,OAAO,IAAA,sBAAQ,EAAC,KAAK,CAAC,IAAI,IAAA,uBAAc,EAAC,KAA6B,EAAE,kCAA0B,CAAC,CAAC;AACtG,CAAC;AAFD,wDAEC;AAED,SAAgB,sBAAsB,CAAmB,UAAqC;IAC5F,OAAO,8BAA8B,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC;AAFD,wDAEC;AAED,SAAgB,YAAY,CAAmB,MAAuB;IACpE,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAFD,oCAEC;AAED,SAAgB,WAAW,CAAI,MAAoC,EAAE,OAA6C;IAChH,OAAO,mBAAmB,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC;AAFD,kCAEC;AAED,SAAgB,UAAU,CAAI,IAAkB;IAC9C,OAAO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gBAAgB,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAEhI,OAAO,IAAA,qBAAY,EAAC;YAClB,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC;YACnC,QAAQ,EAAE,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAChD,QAAQ,EAAE,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;YAChD,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC;YACrC,YAAY,EAAE,iBAAiB,CAAC,YAAY,CAAC;YAC7C,gBAAgB,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;YACrD,gBAAgB,EAAE,iBAAiB,CAAC,gBAAgB,CAAC;YACrD,GAAG,IAAI;SACiB,EAAE,uBAAS,CAAmB,CAAC;KAC1D;IAED,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC;AAlED,wCAkEC;AAED,SAAS,iBAAiB,CAAI,MAAgC;IAC5D,IAAI,IAAA,qBAAO,EAAC,MAAM,CAAC,EAAE;QACnB,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;YACtB,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;YACtB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;SAClB;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/schema/utils/schema.js
CHANGED
|
@@ -87,7 +87,7 @@ function getObjectSchemaFromReflection(type) {
|
|
|
87
87
|
exports.getObjectSchemaFromReflection = getObjectSchemaFromReflection;
|
|
88
88
|
function _tryGetObjectSchemaFromReflection(type) {
|
|
89
89
|
const metadata = registry_1.reflectionRegistry.getMetadata(type);
|
|
90
|
-
if (
|
|
90
|
+
if ((0, type_guards_1.isUndefined)(metadata)) {
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
93
|
const typeData = metadata.data.tryGet('schema') ?? {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../source/schema/utils/schema.ts"],"names":[],"mappings":";;;AACA,wDAA2D;AAE3D,mDAA8C;AAC9C,0DAAyD;AACzD,sDAAwD;AACxD,yDAAqG;AAGrG,8CAA2C;AAE3C,oCAA0K;AAE7J,QAAA,eAAe,GAAG,IAAA,uBAAa,EAAC,gBAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAClE,QAAA,qBAAqB,GAAG,IAAA,uBAAa,EAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9E,QAAA,oBAAoB,GAAG,IAAA,uBAAa,EAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC5E,QAAA,mBAAmB,GAAG,IAAA,uBAAa,EAAC,oBAAoB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1E,QAAA,kBAAkB,GAAG,IAAA,uBAAa,EAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACxE,QAAA,gCAAgC,GAAG,IAAA,uBAAa,EAAC,iCAAiC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAGjH,SAAgB,eAAe,CAAI,YAAmC;IACpE,OAAO,IAAA,wBAAU,EAAC,YAAY,CAAC;QAC7B,CAAC,CAAC,6BAA6B,CAAC,YAAY,CAAC;QAC7C,CAAC,CAAC,YAAY,CAAC;AACnB,CAAC;AAJD,0CAIC;AAED,SAAS,gBAAgB,CAAI,MAAiB;IAC5C,IAAI,IAAA,sBAAc,EAAC,MAAM,CAAC,EAAE;QAC1B,OAAO,IAAA,6BAAqB,EAAC,MAAM,CAAwB,CAAC;KAC7D;IAED,IAAI,IAAA,qBAAa,EAAC,MAAM,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AAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,IAAI,iBAAiB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;SACxF;QAED,UAAU,CAAC,GAAc,CAAC,GAAG,IAAA,mBAAW,EAAC,IAAA,oCAA4B,EAAC,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;YACxG,KAAK;YACL,QAAQ,EAAE,cAAc,EAAE,QAAQ;YAClC,QAAQ,EAAE,cAAc,EAAE,QAAQ;YAClC,MAAM,EAAE,cAAc,EAAE,MAAM;YAC9B,QAAQ,EAAE,cAAc,EAAE,QAAQ;YAClC,YAAY,EAAE,cAAc,EAAE,YAAY;YAC1C,gBAAgB,EAAE,cAAc,EAAE,gBAAgB;YAClD,gBAAgB,EAAE,cAAc,EAAE,gBAAgB;SACnD,CAAC,CAAC;KACJ;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OneOrMany } from "../../types";
|
|
2
2
|
import type { SchemaTestable } from '../schema';
|
|
3
|
-
import type { ResolvedValueType, ValueType } from '../types';
|
|
3
|
+
import type { ResolvedValueType, ValueType } from '../types/types';
|
|
4
4
|
export declare function getValueType(value: unknown): ResolvedValueType;
|
|
5
5
|
export declare function includesValueType(valueType: ValueType, valueTypes: OneOrMany<ValueType>): boolean;
|
|
6
6
|
export declare function getValueTypeName(valueType: ValueType): string;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getSchemaValueTypes = exports.getSchemaTypeNames = exports.getValueTypeName = exports.includesValueType = exports.getValueType = void 0;
|
|
4
4
|
const array_1 = require("../../utils/array/array");
|
|
5
5
|
const type_guards_1 = require("../../utils/type-guards");
|
|
6
|
-
const types_1 = require("../types");
|
|
6
|
+
const types_1 = require("../types/types");
|
|
7
7
|
function getValueType(value) {
|
|
8
8
|
if ((0, type_guards_1.isUndefined)(value)) {
|
|
9
9
|
return 'undefined';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-type.js","sourceRoot":"","sources":["../../../source/schema/utils/value-type.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAC9C,yDAAyF;AAGzF,
|
|
1
|
+
{"version":3,"file":"value-type.js","sourceRoot":"","sources":["../../../source/schema/utils/value-type.ts"],"names":[],"mappings":";;;AACA,mDAA8C;AAC9C,yDAAyF;AAGzF,0CAAuI;AAEvI,SAAgB,YAAY,CAAC,KAAc;IACzC,IAAI,IAAA,yBAAW,EAAC,KAAK,CAAC,EAAE;QACtB,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,IAAA,oBAAM,EAAC,KAAK,CAAC,EAAE;QACjB,OAAO,MAAM,CAAC;KACf;IAED,OAAQ,KAAgB,CAAC,WAAkC,CAAC;AAC9D,CAAC;AAVD,oCAUC;AAED,SAAgB,iBAAiB,CAAC,SAAoB,EAAE,UAAgC;IACtF,MAAM,kBAAkB,GAAG,IAAA,yBAAiB,EAAC,UAAU,CAAC,CAAC;IACzD,MAAM,iBAAiB,GAAG,IAAA,wBAAgB,EAAC,SAAS,CAAC,CAAC;IAEtD,IAAI,IAAA,qBAAO,EAAC,kBAAkB,CAAC,EAAE;QAC/B,OAAO,kBAAkB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;KACvD;IAED,OAAO,iBAAiB,IAAI,kBAAkB,CAAC;AACjD,CAAC;AATD,8CASC;AAED,SAAgB,gBAAgB,CAAC,SAAoB;IACnD,MAAM,iBAAiB,GAAG,IAAA,wBAAgB,EAAC,SAAS,CAAC,CAAC;IAEtD,OAAO,IAAA,sBAAQ,EAAC,iBAAiB,CAAC;QAChC,CAAC,CAAC,iBAAiB;QACnB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC;AAC7B,CAAC;AAND,4CAMC;AAED,SAAgB,kBAAkB,CAAC,MAAsB;IACvD,OAAO,mBAAmB,CAAC,MAAM,CAAC;SAC/B,GAAG,CAAC,C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2
|
import { resolveArgumentType } from "../../container";
|
|
3
3
|
import type { Entity } from "../../database";
|
|
4
|
-
export
|
|
4
|
+
export type ElasticSearchIndexConfigArgument<T extends Entity = Entity> = string | ElasticSearchIndexConfig<T>;
|
|
5
5
|
export declare abstract class ElasticSearchIndexConfig<T extends Entity = Entity> implements Injectable<ElasticSearchIndexConfigArgument> {
|
|
6
6
|
readonly indexName: string;
|
|
7
7
|
readonly [resolveArgumentType]: ElasticSearchIndexConfigArgument<T>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
2
|
+
export type ElasticQuery = QueryDslQueryContainer;
|
|
3
|
+
export type ElasticBooleanQuery = Required<Pick<QueryDslQueryContainer, 'bool'>>;
|
|
4
|
+
export type ElasticIdsQuery = Required<Pick<QueryDslQueryContainer, 'ids'>>;
|
|
5
|
+
export type ElasticMatchAllQuery = Required<Pick<QueryDslQueryContainer, 'match_all'>>;
|
|
6
|
+
export type ElasticRangeQuery = Required<Pick<QueryDslQueryContainer, 'range'>>;
|
|
7
|
+
export type ElasticRegexQuery = Required<Pick<QueryDslQueryContainer, 'regexp'>>;
|
|
8
|
+
export type ElasticTermQuery = Required<Pick<QueryDslQueryContainer, 'term'>>;
|
|
9
|
+
export type ElasticTermsQuery = Required<Pick<QueryDslQueryContainer, 'terms'>>;
|
|
10
|
+
export type ElasticMatchQuery = Required<Pick<QueryDslQueryContainer, 'match'>>;
|
|
11
|
+
export type ElasticExistsQuery = Required<Pick<QueryDslQueryContainer, 'exists'>>;
|
|
12
|
+
export type ElasticMultiMatchQuery = Required<Pick<QueryDslQueryContainer, 'multi_match'>>;
|
|
13
|
+
export type ElasticGeoBoundingBoxQuery = Required<Pick<QueryDslQueryContainer, 'geo_bounding_box'>>;
|
|
14
|
+
export type ElasticGeoDistanceQuery = Required<Pick<QueryDslQueryContainer, 'geo_distance'>>;
|
|
15
|
+
export type ElasticGeoPolygonQuery = Required<Pick<QueryDslQueryContainer, 'geo_polygon'>>;
|
|
16
|
+
export type ElasticGeoShapeQuery = Required<Pick<QueryDslQueryContainer, 'geo_shape'>>;
|