@elsikora/nestjs-crud-automator 2.1.2 → 2.2.0
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/README.md +47 -0
- package/dist/cjs/class/api/authorization/bootstrap-validation.service.class.js +1 -1
- package/dist/cjs/class/api/authorization/bootstrap-validation.service.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/hook/permission/cache.class.js +1 -1
- package/dist/cjs/class/api/authorization/hook/permission/cache.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/hook/permission/resolver.class.js +1 -1
- package/dist/cjs/class/api/authorization/hook/permission/resolver.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/iam/attachment/cache.class.js +1 -1
- package/dist/cjs/class/api/authorization/iam/attachment/cache.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/iam/attachment/resolver.class.js +2 -2
- package/dist/cjs/class/api/authorization/iam/attachment/resolver.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/iam/document/cache.class.js +1 -1
- package/dist/cjs/class/api/authorization/iam/document/cache.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/iam/document/resolver.class.js +1 -1
- package/dist/cjs/class/api/authorization/iam/document/resolver.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/runtime.class.js +2 -2
- package/dist/cjs/class/api/authorization/runtime.class.js.map +1 -1
- package/dist/cjs/class/api/route-runtime.class.d.ts +1 -0
- package/dist/cjs/class/api/route-runtime.class.js +41 -3
- package/dist/cjs/class/api/route-runtime.class.js.map +1 -1
- package/dist/cjs/constant/interface/api/property/default-string-format.constant.js +9 -0
- package/dist/cjs/constant/interface/api/property/default-string-format.constant.js.map +1 -1
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/constant.d.ts +5 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/constant.js +12 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/constant.js.map +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/index.d.ts +2 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.d.ts +2 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.js +6 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.js.map +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/index.d.ts +2 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.d.ts +2 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.js +28 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.js.map +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/constant.d.ts +9 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/constant.js +12 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/constant.js.map +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer/index.d.ts +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer/map.constant.d.ts +2 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer/map.constant.js +28 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer/map.constant.js.map +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/index.d.ts +1 -0
- package/dist/cjs/constant/utility/api/index.d.ts +1 -0
- package/dist/cjs/constant/utility/index.d.ts +1 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js +9 -3
- package/dist/cjs/decorator/api/controller/observable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/controller/securable.decorator.js +9 -3
- package/dist/cjs/decorator/api/controller/securable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/method.decorator.js +38 -15
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +4 -5
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +4 -5
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +4 -5
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +4 -5
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +38 -6
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +8 -6
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +4 -5
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/route-custom.decorator.js +1 -0
- package/dist/cjs/decorator/api/route-custom.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/service/decorator.js +1 -1
- package/dist/cjs/decorator/api/service/observable.decorator.js +9 -3
- package/dist/cjs/decorator/api/service/observable.decorator.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/data-type.enum.d.ts +1 -0
- package/dist/cjs/enum/decorator/api/property/data-type.enum.js +1 -0
- package/dist/cjs/enum/decorator/api/property/data-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/string-type.enum.d.ts +1 -0
- package/dist/cjs/enum/decorator/api/property/string-type.enum.js +1 -0
- package/dist/cjs/enum/decorator/api/property/string-type.enum.js.map +1 -1
- package/dist/cjs/factory/api-controller.factory.js +4 -0
- package/dist/cjs/factory/api-controller.factory.js.map +1 -1
- package/dist/cjs/index.js +25 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interceptor/correlation-id-response-body.interceptor.js +2 -8
- package/dist/cjs/interceptor/correlation-id-response-body.interceptor.js.map +1 -1
- package/dist/cjs/interface/decorator/api/route/response/properties.interface.d.ts +3 -1
- package/dist/cjs/interface/decorator/api/route/runtime-properties.interface.d.ts +2 -1
- package/dist/cjs/module/api/authorization.module.js +1 -1
- package/dist/cjs/module/api/authorization.module.js.map +1 -1
- package/dist/cjs/type/decorator/api/index.d.ts +1 -0
- package/dist/cjs/type/decorator/api/property/default/string/format/type.d.ts +1 -1
- package/dist/cjs/type/decorator/api/route/custom/dto-properties.type.d.ts +8 -0
- package/dist/cjs/type/decorator/api/route/custom/index.d.ts +1 -0
- package/dist/cjs/type/decorator/api/route/discriminated/dto-properties.type.d.ts +10 -0
- package/dist/cjs/type/decorator/api/route/discriminated/index.d.ts +1 -0
- package/dist/cjs/type/decorator/api/route/index.d.ts +2 -0
- package/dist/cjs/type/index.d.ts +1 -0
- package/dist/cjs/type/utility/api/discriminator/index.d.ts +1 -0
- package/dist/cjs/type/utility/api/discriminator/validate/config-properties.type.d.ts +8 -0
- package/dist/cjs/type/utility/api/discriminator/validate/index.d.ts +1 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/bigint-string/index.d.ts +2 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/bigint-string/options.type.d.ts +4 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/bigint-string/sign/index.d.ts +2 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/bigint-string/sign/properties.type.d.ts +2 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/bigint-string/sign/type.d.ts +1 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/customizer/index.d.ts +2 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/customizer/map.type.d.ts +5 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/customizer/type.d.ts +3 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/index.d.ts +3 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/options.type.d.ts +4 -0
- package/dist/cjs/type/utility/api/get-default-string-format-properties/parameters.type.d.ts +3 -0
- package/dist/cjs/type/utility/api/index.d.ts +2 -0
- package/dist/cjs/type/utility/index.d.ts +1 -1
- package/dist/cjs/utility/api/controller/apply/decorators.utility.d.ts +1 -1
- package/dist/cjs/utility/api/controller/apply/decorators.utility.js +1 -1
- package/dist/cjs/utility/api/controller/apply/metadata.utility.js +0 -1
- package/dist/cjs/utility/api/controller/apply/metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get/dto.utility.js +1 -0
- package/dist/cjs/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform/filter.utility.d.ts +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform/filter.utility.js +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform/operation.utility.d.ts +2 -2
- package/dist/cjs/utility/api/controller/get-list/transform/operation.utility.js +2 -2
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.js +7 -3
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/discriminator/index.d.ts +1 -0
- package/dist/cjs/utility/api/discriminator/validate/config.utility.d.ts +7 -0
- package/dist/cjs/utility/api/discriminator/validate/config.utility.js +54 -0
- package/dist/cjs/utility/api/discriminator/validate/config.utility.js.map +1 -0
- package/dist/cjs/utility/api/discriminator/validate/index.d.ts +1 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.d.ts +9 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.js +20 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.js.map +1 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/bigint-string/index.d.ts +1 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/customizer/apply.utility.d.ts +11 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/customizer/apply.utility.js +20 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/customizer/apply.utility.js.map +1 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/customizer/index.d.ts +1 -0
- package/dist/cjs/utility/api/get-default-string-format-properties/index.d.ts +1 -0
- package/dist/cjs/utility/api/{get-default-string-format-properties.utility.d.ts → get-default-string-format-properties/utility.d.ts} +5 -2
- package/dist/cjs/utility/api/{get-default-string-format-properties.utility.js → get-default-string-format-properties/utility.js} +8 -5
- package/dist/cjs/utility/api/get-default-string-format-properties/utility.js.map +1 -0
- package/dist/cjs/utility/api/index.d.ts +2 -1
- package/dist/cjs/utility/api/route/apply-dto-metadata.utility.js +20 -6
- package/dist/cjs/utility/api/route/apply-dto-metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/route/discriminator/build-open-api-schema.utility.d.ts +9 -0
- package/dist/cjs/utility/api/route/discriminator/build-open-api-schema.utility.js +26 -0
- package/dist/cjs/utility/api/route/discriminator/build-open-api-schema.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/discriminator/create-validation-failure.utility.d.ts +9 -0
- package/dist/cjs/utility/api/route/discriminator/create-validation-failure.utility.js +46 -0
- package/dist/cjs/utility/api/route/discriminator/create-validation-failure.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/discriminator/index.d.ts +6 -0
- package/dist/cjs/utility/api/route/discriminator/is-dto-properties.utility.d.ts +7 -0
- package/dist/cjs/utility/api/route/discriminator/is-dto-properties.utility.js +13 -0
- package/dist/cjs/utility/api/route/discriminator/is-dto-properties.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/discriminator/prepare-payload.utility.d.ts +8 -0
- package/dist/cjs/utility/api/route/discriminator/prepare-payload.utility.js +19 -0
- package/dist/cjs/utility/api/route/discriminator/prepare-payload.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/discriminator/resolve-dto.utility.d.ts +10 -0
- package/dist/cjs/utility/api/route/discriminator/resolve-dto.utility.js +35 -0
- package/dist/cjs/utility/api/route/discriminator/resolve-dto.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/discriminator/validate-dto-properties.utility.d.ts +8 -0
- package/dist/cjs/utility/api/route/discriminator/validate-dto-properties.utility.js +21 -0
- package/dist/cjs/utility/api/route/discriminator/validate-dto-properties.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/dto/collect-with-registered-children.utility.d.ts +8 -0
- package/dist/cjs/utility/api/route/dto/collect-with-registered-children.utility.js +29 -0
- package/dist/cjs/utility/api/route/dto/collect-with-registered-children.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/dto/index.d.ts +1 -0
- package/dist/cjs/utility/api/route/index.d.ts +4 -0
- package/dist/cjs/utility/api/route/response/project-relation.utility.js +16 -13
- package/dist/cjs/utility/api/route/response/project-relation.utility.js.map +1 -1
- package/dist/cjs/utility/api/route/response/serialize.utility.js +20 -0
- package/dist/cjs/utility/api/route/response/serialize.utility.js.map +1 -1
- package/dist/cjs/utility/api/route/validation/flatten-errors.utility.d.ts +8 -0
- package/dist/cjs/utility/api/route/validation/flatten-errors.utility.js +26 -0
- package/dist/cjs/utility/api/route/validation/flatten-errors.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/validation/index.d.ts +1 -0
- package/dist/cjs/utility/authorization/scope-merge-where.utility.js +2 -2
- package/dist/cjs/utility/authorization/scope-merge-where.utility.js.map +1 -1
- package/dist/cjs/utility/database/typeorm/is/foreign-key-violation.utility.js +1 -4
- package/dist/cjs/utility/database/typeorm/is/foreign-key-violation.utility.js.map +1 -1
- package/dist/cjs/utility/database/typeorm/is/unique-violation.utility.js +1 -4
- package/dist/cjs/utility/database/typeorm/is/unique-violation.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js +1 -3
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/manual/property-metadata.utility.js +1 -1
- package/dist/cjs/utility/dto/manual/property-metadata.utility.js.map +1 -1
- package/dist/cjs/utility/generate-entity-information.utility.js +8 -15
- package/dist/cjs/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/cjs/utility/index.d.ts +1 -1
- package/dist/cjs/utility/register-auto-dto-child.utility.d.ts +6 -0
- package/dist/cjs/utility/register-auto-dto-child.utility.js +30 -0
- package/dist/cjs/utility/register-auto-dto-child.utility.js.map +1 -1
- package/dist/cjs/validator/has/paired-custom-suffixes-fields.validator.js +1 -1
- package/dist/cjs/validator/has/paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/cjs/validator/must-match-one-of-schemas.validator.d.ts +1 -2
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js +4 -33
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js.map +1 -1
- package/dist/esm/class/api/authorization/bootstrap-validation.service.class.js +2 -2
- package/dist/esm/class/api/authorization/bootstrap-validation.service.class.js.map +1 -1
- package/dist/esm/class/api/authorization/hook/permission/cache.class.js +1 -1
- package/dist/esm/class/api/authorization/hook/permission/cache.class.js.map +1 -1
- package/dist/esm/class/api/authorization/hook/permission/resolver.class.js +2 -2
- package/dist/esm/class/api/authorization/hook/permission/resolver.class.js.map +1 -1
- package/dist/esm/class/api/authorization/iam/attachment/cache.class.js +1 -1
- package/dist/esm/class/api/authorization/iam/attachment/cache.class.js.map +1 -1
- package/dist/esm/class/api/authorization/iam/attachment/resolver.class.js +3 -3
- package/dist/esm/class/api/authorization/iam/attachment/resolver.class.js.map +1 -1
- package/dist/esm/class/api/authorization/iam/document/cache.class.js +1 -1
- package/dist/esm/class/api/authorization/iam/document/cache.class.js.map +1 -1
- package/dist/esm/class/api/authorization/iam/document/resolver.class.js +2 -2
- package/dist/esm/class/api/authorization/iam/document/resolver.class.js.map +1 -1
- package/dist/esm/class/api/authorization/runtime.class.js +2 -2
- package/dist/esm/class/api/authorization/runtime.class.js.map +1 -1
- package/dist/esm/class/api/route-runtime.class.d.ts +1 -0
- package/dist/esm/class/api/route-runtime.class.js +41 -3
- package/dist/esm/class/api/route-runtime.class.js.map +1 -1
- package/dist/esm/constant/interface/api/property/default-string-format.constant.js +9 -0
- package/dist/esm/constant/interface/api/property/default-string-format.constant.js.map +1 -1
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/constant.d.ts +5 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/constant.js +10 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/constant.js.map +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/index.d.ts +2 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.d.ts +2 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.js +4 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.js.map +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/index.d.ts +2 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.d.ts +2 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.js +26 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.js.map +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/constant.d.ts +9 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/constant.js +10 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/constant.js.map +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/customizer/index.d.ts +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/customizer/map.constant.d.ts +2 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/customizer/map.constant.js +26 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/customizer/map.constant.js.map +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/index.d.ts +1 -0
- package/dist/esm/constant/utility/api/index.d.ts +1 -0
- package/dist/esm/constant/utility/index.d.ts +1 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js +9 -3
- package/dist/esm/decorator/api/controller/observable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/controller/securable.decorator.js +9 -3
- package/dist/esm/decorator/api/controller/securable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/method.decorator.js +31 -8
- package/dist/esm/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.js +4 -5
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +4 -5
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.js +4 -5
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +4 -5
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/object.decorator.js +38 -6
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +8 -6
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +4 -5
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/route-custom.decorator.js +1 -0
- package/dist/esm/decorator/api/route-custom.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/decorator.d.ts +1 -1
- package/dist/esm/decorator/api/service/decorator.js +1 -1
- package/dist/esm/decorator/api/service/observable.decorator.js +9 -3
- package/dist/esm/decorator/api/service/observable.decorator.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/data-type.enum.d.ts +1 -0
- package/dist/esm/enum/decorator/api/property/data-type.enum.js +1 -0
- package/dist/esm/enum/decorator/api/property/data-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/string-type.enum.d.ts +1 -0
- package/dist/esm/enum/decorator/api/property/string-type.enum.js +1 -0
- package/dist/esm/enum/decorator/api/property/string-type.enum.js.map +1 -1
- package/dist/esm/factory/api-controller.factory.js +4 -0
- package/dist/esm/factory/api-controller.factory.js.map +1 -1
- package/dist/esm/index.js +13 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interceptor/correlation-id-response-body.interceptor.js +2 -8
- package/dist/esm/interceptor/correlation-id-response-body.interceptor.js.map +1 -1
- package/dist/esm/interface/decorator/api/route/response/properties.interface.d.ts +3 -1
- package/dist/esm/interface/decorator/api/route/runtime-properties.interface.d.ts +2 -1
- package/dist/esm/module/api/authorization.module.js +1 -1
- package/dist/esm/module/api/authorization.module.js.map +1 -1
- package/dist/esm/type/decorator/api/index.d.ts +1 -0
- package/dist/esm/type/decorator/api/property/default/string/format/type.d.ts +1 -1
- package/dist/esm/type/decorator/api/route/custom/dto-properties.type.d.ts +8 -0
- package/dist/esm/type/decorator/api/route/custom/index.d.ts +1 -0
- package/dist/esm/type/decorator/api/route/discriminated/dto-properties.type.d.ts +10 -0
- package/dist/esm/type/decorator/api/route/discriminated/index.d.ts +1 -0
- package/dist/esm/type/decorator/api/route/index.d.ts +2 -0
- package/dist/esm/type/index.d.ts +1 -0
- package/dist/esm/type/utility/api/discriminator/index.d.ts +1 -0
- package/dist/esm/type/utility/api/discriminator/validate/config-properties.type.d.ts +8 -0
- package/dist/esm/type/utility/api/discriminator/validate/index.d.ts +1 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/bigint-string/index.d.ts +2 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/bigint-string/options.type.d.ts +4 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/bigint-string/sign/index.d.ts +2 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/bigint-string/sign/properties.type.d.ts +2 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/bigint-string/sign/type.d.ts +1 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/customizer/index.d.ts +2 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/customizer/map.type.d.ts +5 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/customizer/type.d.ts +3 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/index.d.ts +3 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/options.type.d.ts +4 -0
- package/dist/esm/type/utility/api/get-default-string-format-properties/parameters.type.d.ts +3 -0
- package/dist/esm/type/utility/api/index.d.ts +2 -0
- package/dist/esm/type/utility/index.d.ts +1 -1
- package/dist/esm/utility/api/controller/apply/decorators.utility.d.ts +1 -1
- package/dist/esm/utility/api/controller/apply/decorators.utility.js +1 -1
- package/dist/esm/utility/api/controller/apply/metadata.utility.js +0 -1
- package/dist/esm/utility/api/controller/apply/metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get/dto.utility.js +1 -0
- package/dist/esm/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/transform/filter.utility.d.ts +1 -1
- package/dist/esm/utility/api/controller/get-list/transform/filter.utility.js +1 -1
- package/dist/esm/utility/api/controller/get-list/transform/operation.utility.d.ts +2 -2
- package/dist/esm/utility/api/controller/get-list/transform/operation.utility.js +2 -2
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.js +7 -3
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.js.map +1 -1
- package/dist/esm/utility/api/discriminator/index.d.ts +1 -0
- package/dist/esm/utility/api/discriminator/validate/config.utility.d.ts +7 -0
- package/dist/esm/utility/api/discriminator/validate/config.utility.js +52 -0
- package/dist/esm/utility/api/discriminator/validate/config.utility.js.map +1 -0
- package/dist/esm/utility/api/discriminator/validate/index.d.ts +1 -0
- package/dist/esm/utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.d.ts +9 -0
- package/dist/esm/utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.js +18 -0
- package/dist/esm/utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.js.map +1 -0
- package/dist/esm/utility/api/get-default-string-format-properties/bigint-string/index.d.ts +1 -0
- package/dist/esm/utility/api/get-default-string-format-properties/customizer/apply.utility.d.ts +11 -0
- package/dist/esm/utility/api/get-default-string-format-properties/customizer/apply.utility.js +18 -0
- package/dist/esm/utility/api/get-default-string-format-properties/customizer/apply.utility.js.map +1 -0
- package/dist/esm/utility/api/get-default-string-format-properties/customizer/index.d.ts +1 -0
- package/dist/esm/utility/api/get-default-string-format-properties/index.d.ts +1 -0
- package/dist/esm/utility/api/{get-default-string-format-properties.utility.d.ts → get-default-string-format-properties/utility.d.ts} +5 -2
- package/dist/esm/utility/api/{get-default-string-format-properties.utility.js → get-default-string-format-properties/utility.js} +8 -5
- package/dist/esm/utility/api/get-default-string-format-properties/utility.js.map +1 -0
- package/dist/esm/utility/api/index.d.ts +2 -1
- package/dist/esm/utility/api/route/apply-dto-metadata.utility.js +21 -7
- package/dist/esm/utility/api/route/apply-dto-metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/route/discriminator/build-open-api-schema.utility.d.ts +9 -0
- package/dist/esm/utility/api/route/discriminator/build-open-api-schema.utility.js +24 -0
- package/dist/esm/utility/api/route/discriminator/build-open-api-schema.utility.js.map +1 -0
- package/dist/esm/utility/api/route/discriminator/create-validation-failure.utility.d.ts +9 -0
- package/dist/esm/utility/api/route/discriminator/create-validation-failure.utility.js +44 -0
- package/dist/esm/utility/api/route/discriminator/create-validation-failure.utility.js.map +1 -0
- package/dist/esm/utility/api/route/discriminator/index.d.ts +6 -0
- package/dist/esm/utility/api/route/discriminator/is-dto-properties.utility.d.ts +7 -0
- package/dist/esm/utility/api/route/discriminator/is-dto-properties.utility.js +11 -0
- package/dist/esm/utility/api/route/discriminator/is-dto-properties.utility.js.map +1 -0
- package/dist/esm/utility/api/route/discriminator/prepare-payload.utility.d.ts +8 -0
- package/dist/esm/utility/api/route/discriminator/prepare-payload.utility.js +17 -0
- package/dist/esm/utility/api/route/discriminator/prepare-payload.utility.js.map +1 -0
- package/dist/esm/utility/api/route/discriminator/resolve-dto.utility.d.ts +10 -0
- package/dist/esm/utility/api/route/discriminator/resolve-dto.utility.js +33 -0
- package/dist/esm/utility/api/route/discriminator/resolve-dto.utility.js.map +1 -0
- package/dist/esm/utility/api/route/discriminator/validate-dto-properties.utility.d.ts +8 -0
- package/dist/esm/utility/api/route/discriminator/validate-dto-properties.utility.js +19 -0
- package/dist/esm/utility/api/route/discriminator/validate-dto-properties.utility.js.map +1 -0
- package/dist/esm/utility/api/route/dto/collect-with-registered-children.utility.d.ts +8 -0
- package/dist/esm/utility/api/route/dto/collect-with-registered-children.utility.js +27 -0
- package/dist/esm/utility/api/route/dto/collect-with-registered-children.utility.js.map +1 -0
- package/dist/esm/utility/api/route/dto/index.d.ts +1 -0
- package/dist/esm/utility/api/route/index.d.ts +4 -0
- package/dist/esm/utility/api/route/response/project-relation.utility.js +16 -13
- package/dist/esm/utility/api/route/response/project-relation.utility.js.map +1 -1
- package/dist/esm/utility/api/route/response/serialize.utility.js +20 -0
- package/dist/esm/utility/api/route/response/serialize.utility.js.map +1 -1
- package/dist/esm/utility/api/route/validation/flatten-errors.utility.d.ts +8 -0
- package/dist/esm/utility/api/route/validation/flatten-errors.utility.js +24 -0
- package/dist/esm/utility/api/route/validation/flatten-errors.utility.js.map +1 -0
- package/dist/esm/utility/api/route/validation/index.d.ts +1 -0
- package/dist/esm/utility/authorization/scope-merge-where.utility.js +2 -2
- package/dist/esm/utility/authorization/scope-merge-where.utility.js.map +1 -1
- package/dist/esm/utility/database/typeorm/is/foreign-key-violation.utility.js +1 -4
- package/dist/esm/utility/database/typeorm/is/foreign-key-violation.utility.js.map +1 -1
- package/dist/esm/utility/database/typeorm/is/unique-violation.utility.js +1 -4
- package/dist/esm/utility/database/typeorm/is/unique-violation.utility.js.map +1 -1
- package/dist/esm/utility/dto/build-decorator.utility.js +1 -3
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/manual/property-metadata.utility.js +1 -1
- package/dist/esm/utility/dto/manual/property-metadata.utility.js.map +1 -1
- package/dist/esm/utility/generate-entity-information.utility.js +8 -15
- package/dist/esm/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/esm/utility/index.d.ts +1 -1
- package/dist/esm/utility/register-auto-dto-child.utility.d.ts +6 -0
- package/dist/esm/utility/register-auto-dto-child.utility.js +30 -1
- package/dist/esm/utility/register-auto-dto-child.utility.js.map +1 -1
- package/dist/esm/validator/has/paired-custom-suffixes-fields.validator.js +1 -1
- package/dist/esm/validator/has/paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/esm/validator/must-match-one-of-schemas.validator.d.ts +1 -2
- package/dist/esm/validator/must-match-one-of-schemas.validator.js +4 -33
- package/dist/esm/validator/must-match-one-of-schemas.validator.js.map +1 -1
- package/package.json +31 -30
- package/dist/cjs/utility/api/get-default-string-format-properties.utility.js.map +0 -1
- package/dist/esm/utility/api/get-default-string-format-properties.utility.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collect-with-registered-children.utility.js","sources":["../../../../../../../src/utility/api/route/dto/collect-with-registered-children.utility.ts"],"sourcesContent":[null],"names":["GetRegisteredAutoDtoChildrenRecursive"],"mappings":";;;;AAIA;;;;;AAKG;AACG,SAAU,wCAAwC,CAAC,MAA4B,EAAE,GAAyC,EAAA;AAC/H,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AACvB,QAAA,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;AACvB,YAAA,wCAAwC,CAAC,MAAM,EAAE,IAAI,CAAC;QACvD;QAEA;IACD;IAEA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1B,QAAA,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IACjB;IAEA,KAAK,MAAM,KAAK,IAAIA,kEAAqC,CAAC,GAAG,CAAC,SAAmB,CAAC,EAAE;QACnF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QACnB;IACD;AACD;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ApiRouteCollectDtoWithRegisteredChildren } from './collect-with-registered-children.utility';
|
|
@@ -45,18 +45,21 @@ function ApiRouteProjectRelationResponse(relationConfig, response) {
|
|
|
45
45
|
return projectedItem;
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
else
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
else {
|
|
49
|
+
const responseValue = response;
|
|
50
|
+
if (responseValue !== null && typeof responseValue === "object" && "items" in responseValue && Array.isArray(responseValue.items)) {
|
|
51
|
+
responseValue.items = responseValue.items.map((item) => {
|
|
52
|
+
if (item === null || typeof item !== "object") {
|
|
53
|
+
return item;
|
|
54
|
+
}
|
|
55
|
+
const projectedItem = { ...item };
|
|
56
|
+
responses.push(projectedItem);
|
|
57
|
+
return projectedItem;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else if (responseValue !== null && typeof responseValue === "object") {
|
|
61
|
+
responses.push(responseValue);
|
|
62
|
+
}
|
|
60
63
|
}
|
|
61
64
|
for (const projectedResponse of responses) {
|
|
62
65
|
for (const relationName of relationNames) {
|
|
@@ -68,7 +71,7 @@ function ApiRouteProjectRelationResponse(relationConfig, response) {
|
|
|
68
71
|
projectedResponse[relationName] = relationConfig.reference.shape === relationReferenceShape_enum.EApiControllerRelationReferenceShape.SCALAR ? referenceValue : { [referenceKey]: referenceValue };
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
|
-
return projectedArray
|
|
74
|
+
return projectedArray || response;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
exports.ApiRouteProjectRelationResponse = ApiRouteProjectRelationResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-relation.utility.js","sources":["../../../../../../../src/utility/api/route/response/project-relation.utility.ts"],"sourcesContent":[null],"names":["EApiControllerRelationReferenceShape"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;AAOG;AACG,SAAU,+BAA+B,CAA8B,cAAiF,EAAE,QAAW,EAAA;AAC1K,IAAA,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE;AACnC,QAAA,OAAO,QAAQ;IAChB;AAEA,IAAA,MAAM,aAAa,GAAkB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7E,MAAM,YAAY,GAAW,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI;IACjE,MAAM,SAAS,GAAmC,EAAE;AACpD,IAAA,IAAI,cAA0C;AAE9C,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC5B,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAa,KAAa;YACxD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC9C,gBAAA,OAAO,IAAI;YACZ;AAEA,YAAA,MAAM,aAAa,GAA4B,EAAE,GAAI,IAAgC,EAAE;AACvF,YAAA,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;AAE7B,YAAA,OAAO,aAAa;AACrB,QAAA,CAAC,CAAC;IACH;SAAO,
|
|
1
|
+
{"version":3,"file":"project-relation.utility.js","sources":["../../../../../../../src/utility/api/route/response/project-relation.utility.ts"],"sourcesContent":[null],"names":["EApiControllerRelationReferenceShape"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;AAOG;AACG,SAAU,+BAA+B,CAA8B,cAAiF,EAAE,QAAW,EAAA;AAC1K,IAAA,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE;AACnC,QAAA,OAAO,QAAQ;IAChB;AAEA,IAAA,MAAM,aAAa,GAAkB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7E,MAAM,YAAY,GAAW,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI;IACjE,MAAM,SAAS,GAAmC,EAAE;AACpD,IAAA,IAAI,cAA0C;AAE9C,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC5B,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAa,KAAa;YACxD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC9C,gBAAA,OAAO,IAAI;YACZ;AAEA,YAAA,MAAM,aAAa,GAA4B,EAAE,GAAI,IAAgC,EAAE;AACvF,YAAA,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;AAE7B,YAAA,OAAO,aAAa;AACrB,QAAA,CAAC,CAAC;IACH;SAAO;QACN,MAAM,aAAa,GAAY,QAAQ;QAEvC,IAAI,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,OAAO,IAAI,aAAa,IAAI,KAAK,CAAC,OAAO,CAAE,aAAqC,CAAC,KAAK,CAAC,EAAE;AAC1J,YAAA,aAA2C,CAAC,KAAK,GAAI,aAA2C,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAa,KAAa;gBACtI,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC9C,oBAAA,OAAO,IAAI;gBACZ;AAEA,gBAAA,MAAM,aAAa,GAA4B,EAAE,GAAI,IAAgC,EAAE;AACvF,gBAAA,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;AAE7B,gBAAA,OAAO,aAAa;AACrB,YAAA,CAAC,CAAC;QACH;aAAO,IAAI,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;AACvE,YAAA,SAAS,CAAC,IAAI,CAAC,aAAwC,CAAC;QACzD;IACD;AAEA,IAAA,KAAK,MAAM,iBAAiB,IAAI,SAAS,EAAE;AAC1C,QAAA,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;AACzC,YAAA,MAAM,aAAa,GAAY,iBAAiB,CAAC,YAAY,CAAC;AAE9D,YAAA,IAAI,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;gBAC/F;YACD;AAEA,YAAA,MAAM,cAAc,GAAa,aAAyC,CAAC,YAAY,CAAC;YACxF,iBAAiB,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,KAAKA,gEAAoC,CAAC,MAAM,GAAG,cAAc,GAAG,EAAE,CAAC,YAAY,GAAG,cAAc,EAAE;QACvK;IACD;IAEA,OAAQ,cAAoB,IAAI,QAAQ;AACzC;;;;"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var common = require('@nestjs/common');
|
|
4
|
+
require('@nestjs/swagger');
|
|
5
|
+
require('@nestjs/swagger/dist/constants.js');
|
|
6
|
+
var exception_utility = require('../../../error/exception.utility.js');
|
|
7
|
+
var preparePayload_utility = require('../discriminator/prepare-payload.utility.js');
|
|
8
|
+
var resolveDto_utility = require('../discriminator/resolve-dto.utility.js');
|
|
4
9
|
var classTransformer = require('class-transformer');
|
|
5
10
|
|
|
6
11
|
/**
|
|
@@ -15,6 +20,21 @@ function ApiRouteSerializeResponse(metadata, response) {
|
|
|
15
20
|
if (!metadata.response?.serialization?.isEnabled || !metadata.response.type || metadata.response.status === common.HttpStatus.NO_CONTENT) {
|
|
16
21
|
return response;
|
|
17
22
|
}
|
|
23
|
+
if (Array.isArray(metadata.response.type)) {
|
|
24
|
+
if (!metadata.response.discriminator) {
|
|
25
|
+
throw exception_utility.ErrorException("ApiRouteSerializeResponse error: response.discriminator is required when response.type is an array");
|
|
26
|
+
}
|
|
27
|
+
const discriminatedResponseProperties = {
|
|
28
|
+
discriminator: metadata.response.discriminator,
|
|
29
|
+
type: metadata.response.type,
|
|
30
|
+
};
|
|
31
|
+
const selectedDto = resolveDto_utility.ApiRouteResolveDiscriminatedDto(discriminatedResponseProperties, response, "ApiRouteSerializeResponse");
|
|
32
|
+
return classTransformer.plainToInstance(selectedDto, preparePayload_utility.ApiRoutePrepareDiscriminatedDtoPayload(discriminatedResponseProperties, response), {
|
|
33
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
34
|
+
excludeExtraneousValues: true,
|
|
35
|
+
strategy: "excludeAll",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
18
38
|
return classTransformer.plainToInstance(metadata.response.type, response, {
|
|
19
39
|
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
20
40
|
excludeExtraneousValues: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.utility.js","sources":["../../../../../../../src/utility/api/route/response/serialize.utility.ts"],"sourcesContent":[null],"names":["HttpStatus","plainToInstance"],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialize.utility.js","sources":["../../../../../../../src/utility/api/route/response/serialize.utility.ts"],"sourcesContent":[null],"names":["HttpStatus","ErrorException","ApiRouteResolveDiscriminatedDto","plainToIn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shape used by Nest ValidationPipe.
|
|
4
|
+
* @param {Array<ValidationError>} errors - Validation errors to flatten.
|
|
5
|
+
* @param {string} [parentProperty] - Parent property path.
|
|
6
|
+
* @returns {Array<string>} Flattened validation messages.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ApiRouteValidationFlattenErrors(errors: Array<ValidationError>, parentProperty?: string): Array<string>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Flattens class-validator errors into the same message array shape used by Nest ValidationPipe.
|
|
5
|
+
* @param {Array<ValidationError>} errors - Validation errors to flatten.
|
|
6
|
+
* @param {string} [parentProperty] - Parent property path.
|
|
7
|
+
* @returns {Array<string>} Flattened validation messages.
|
|
8
|
+
*/
|
|
9
|
+
function ApiRouteValidationFlattenErrors(errors, parentProperty) {
|
|
10
|
+
const messages = [];
|
|
11
|
+
for (const error of errors) {
|
|
12
|
+
const propertyPath = parentProperty ? `${parentProperty}.${error.property}` : error.property;
|
|
13
|
+
if (error.constraints) {
|
|
14
|
+
messages.push(...Object.values(error.constraints).map((message) => {
|
|
15
|
+
return parentProperty ? message.replace(`${error.property} `, `${propertyPath} `) : message;
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
if (error.children && error.children.length > 0) {
|
|
19
|
+
messages.push(...ApiRouteValidationFlattenErrors(error.children, propertyPath));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return messages;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.ApiRouteValidationFlattenErrors = ApiRouteValidationFlattenErrors;
|
|
26
|
+
//# sourceMappingURL=flatten-errors.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatten-errors.utility.js","sources":["../../../../../../../src/utility/api/route/validation/flatten-errors.utility.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;AAKG;AACG,SAAU,+BAA+B,CAAC,MAA8B,EAAE,cAAuB,EAAA;IACtG,MAAM,QAAQ,GAAkB,EAAE;AAElC,IAAA,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AAC3B,QAAA,MAAM,YAAY,GAAW,cAAc,GAAG,GAAG,cAAc,CAAA,CAAA,EAAI,KAAK,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,QAAQ;AAEpG,QAAA,IAAI,KAAK,CAAC,WAAW,EAAE;AACtB,YAAA,QAAQ,CAAC,IAAI,CACZ,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,OAAe,KAAY;gBACnE,OAAO,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA,EAAG,KAAK,CAAC,QAAQ,CAAA,CAAA,CAAG,EAAE,GAAG,YAAY,CAAA,CAAA,CAAG,CAAC,GAAG,OAAO;YAC5F,CAAC,CAAC,CACF;QACF;AAEA,QAAA,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;AAChD,YAAA,QAAQ,CAAC,IAAI,CAAC,GAAG,+BAA+B,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAChF;IACD;AAEA,IAAA,OAAO,QAAQ;AAChB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ApiRouteValidationFlattenErrors } from './flatten-errors.utility';
|
|
@@ -43,8 +43,8 @@ function areValuesEquivalent(left, right) {
|
|
|
43
43
|
return left.every((value, index) => areValuesEquivalent(value, right[index]));
|
|
44
44
|
}
|
|
45
45
|
if (isRecord(left) && isRecord(right)) {
|
|
46
|
-
const leftKeys = Object.keys(left).
|
|
47
|
-
const rightKeys = Object.keys(right).
|
|
46
|
+
const leftKeys = Object.keys(left).toSorted((a, b) => a.localeCompare(b));
|
|
47
|
+
const rightKeys = Object.keys(right).toSorted((a, b) => a.localeCompare(b));
|
|
48
48
|
if (!areValuesEquivalent(leftKeys, rightKeys)) {
|
|
49
49
|
return false;
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-merge-where.utility.js","sources":["../../../../../src/utility/authorization/scope-merge-where.utility.ts"],"sourcesContent":[null],"names":["In"],"mappings":";;;;AAWA;;;;;;AAMG;AACG,SAAU,4BAA4B,CAA2B,SAAyC,EAAE,WAA2C,EAAA;IAC5J,IAAI,CAAC,SAAS,EAAE;AACf,QAAA,OAAO,WAAW;IACnB;IAEA,IAAI,CAAC,WAAW,EAAE;AACjB,QAAA,OAAO,SAAS;IACjB;AAEA,IAAA,MAAM,YAAY,GAA+B,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,SAAS,CAAC;AACnG,IAAA,MAAM,cAAc,GAA+B,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,GAAG,CAAC,WAAW,CAAC;IAC3G,MAAM,cAAc,GAA+B,EAAE;AAErD,IAAA,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;AACvC,QAAA,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE;YAC3C,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,aAAa,CAAwB,CAAC;QAC1F;IACD;AAEA,IAAA,OAAO,cAAc,CAAC,MAAM,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc;AACxE;AAEA;;;;;AAKG;AACH,SAAS,mBAAmB,CAAC,IAAa,EAAE,KAAc,EAAA;IACzD,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;AAClD,QAAA,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,IAAI,mBAAmB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACpF;AAEA,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAChD,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE;AACjC,YAAA,OAAO,KAAK;QACb;QAEA,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,KAAa,KAAc,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACxG;IAEA,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;QACtC,MAAM,QAAQ,GAAkB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"scope-merge-where.utility.js","sources":["../../../../../src/utility/authorization/scope-merge-where.utility.ts"],"sourcesContent":[null],"names":["In"],"mappings":";;;;AAWA;;;;;;AAMG;AACG,SAAU,4BAA4B,CAA2B,SAAyC,EAAE,WAA2C,EAAA;IAC5J,IAAI,CAAC,SAAS,EAAE;AACf,QAAA,OAAO,WAAW;IACnB;IAEA,IAAI,CAAC,WAAW,EAAE;AACjB,QAAA,OAAO,SAAS;IACjB;AAEA,IAAA,MAAM,YAAY,GAA+B,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,CAAC,SAAS,CAAC;AACnG,IAAA,MAAM,cAAc,GAA+B,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,GAAG,CAAC,WAAW,CAAC;IAC3G,MAAM,cAAc,GAA+B,EAAE;AAErD,IAAA,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;AACvC,QAAA,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE;YAC3C,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,aAAa,CAAwB,CAAC;QAC1F;IACD;AAEA,IAAA,OAAO,cAAc,CAAC,MAAM,KAAK,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc;AACxE;AA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QAAA,OAAO,KAAK;IACb;AAEA,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;AACzF,QAAA,OAAO,KAAK,CAAC,QAAQ,EAAE;IACxB;AAEA,IAAA,IAAI,KAAK,YAAY,IAAI,EAAE;AAC1B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE;IAC3B;AAEA,IAAA,OAAO,EAAE;AACV;;;;"}
|
|
@@ -81,10 +81,7 @@ function DatabaseTypeOrmIsForeignKeyViolation(error) {
|
|
|
81
81
|
return true;
|
|
82
82
|
}
|
|
83
83
|
// MSSQL
|
|
84
|
-
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
return false;
|
|
84
|
+
return messageLower.includes("conflicted with the foreign key constraint");
|
|
88
85
|
}
|
|
89
86
|
|
|
90
87
|
exports.DatabaseTypeOrmIsForeignKeyViolation = DatabaseTypeOrmIsForeignKeyViolation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foreign-key-violation.utility.js","sources":["../../../../../../../src/utility/database/typeorm/is/foreign-key-violation.utility.ts"],"sourcesContent":[null],"names":["QueryFailedError"],"mappings":";;;;AAEA,MAAM,mCAAmC,GAAW,OAAO;AAC3D,MAAM,0CAA0C,GAAW,IAAI;AAC/D,MAAM,8CAA8C,GAAW,IAAI;AACnE,MAAM,yCAAyC,GAAW,GAAG;AAE7D;;;;;AAKG;AACG,SAAU,oCAAoC,CAAC,KAAc,EAAA;IAClE,MAAM,kBAAkB,GAAY,KAAK,YAAYA,wBAAgB,KAAK,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA4B,CAAC,IAAI,KAAK,kBAAkB,CAAC;IAElL,IAAI,CAAC,kBAAkB,EAAE;AACxB,QAAA,OAAO,KAAK;IACb;IAEA,MAAM,kBAAkB,GAAY,KAAK,IAAI,IAAI,IAAI,OAAO,KA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AI,SAAS,IAAI,KAAK,EAAE;AAC5E,QAAA,MAAM,aAAa,GAAa,KAA+B,CAAC,OAAO;AAEvE,QAAA,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACtC,OAAO,GAAG,aAAa;QACxB;IACD;AAEA,IAAA,MAAM,YAAY,GAAW,OAAO,CAAC,WAAW,EAAE;IAElD,IAAI,CAAC,YAAY,EAAE;AAClB,QAAA,OAAO,KAAK;IACb;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EAAE;AAC7D,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,gCAAgC,CAAC,EAAE;AAC5D,QAAA,OAAO,IAAI;IACZ;AAEA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAE;AAC9D,QAAA,OAAO,IAAI;IACZ;AAEA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,sCAAsC,CAAC,EAAE;AAClE,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAE;AAC3D,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,
|
|
1
|
+
{"version":3,"file":"foreign-key-violation.utility.js","sources":["../../../../../../../src/utility/database/typeorm/is/foreign-key-violation.utility.ts"],"sourcesContent":[null],"names":["QueryFailedError"],"mappings":";;;;AAEA,MAAM,mCAAmC,GAAW,OAAO;AAC3D,MAAM,0CAA0C,GAAW,IAAI;AAC/D,MAAM,8CAA8C,GAAW,IAAI;AACnE,MAAM,yCAAyC,GAAW,GAAG;AAE7D;;;;;AAKG;AACG,SAAU,oCAAoC,CAAC,KAAc,EAAA;IAClE,MAAM,kBAAkB,GAAY,KAAK,YAAYA,wBAAgB,KAAK,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA4B,CAAC,IAAI,KAAK,kBAAkB,CA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EAAE;AAClC,QAAA,OAAO,GAAG,KAAK,CAAC,OAAO;IACxB;AAAO,SAAA,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE;AAC5E,QAAA,MAAM,aAAa,GAAa,KAA+B,CAAC,OAAO;AAEvE,QAAA,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACtC,OAAO,GAAG,aAAa;QACxB;IACD;AAEA,IAAA,MAAM,YAAY,GAAW,OAAO,CAAC,WAAW,EAAE;IAElD,IAAI,CAAC,YAAY,EAAE;AAClB,QAAA,OAAO,KAAK;IACb;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,iCAAiC,CAAC,EAAE;AAC7D,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,gCAAgC,CAAC,EAAE;AAC5D,QAAA,OAAO,IAAI;IACZ;AAEA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAE;AAC9D,QAAA,OAAO,IAAI;IACZ;AAEA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,sCAAsC,CAAC,EAAE;AAClE,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EAAE;AAC3D,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,OAAO,YAAY,CAAC,QAAQ,CAAC,4CAA4C,CAAC;AAC3E;;;;"}
|
|
@@ -71,10 +71,7 @@ function DatabaseTypeOrmIsUniqueViolation(error) {
|
|
|
71
71
|
return true;
|
|
72
72
|
}
|
|
73
73
|
// MSSQL
|
|
74
|
-
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
74
|
+
return messageLower.includes("cannot insert duplicate key");
|
|
78
75
|
}
|
|
79
76
|
|
|
80
77
|
exports.DatabaseTypeOrmIsUniqueViolation = DatabaseTypeOrmIsUniqueViolation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unique-violation.utility.js","sources":["../../../../../../../src/utility/database/typeorm/is/unique-violation.utility.ts"],"sourcesContent":[null],"names":["QueryFailedError"],"mappings":";;;;AAEA,MAAM,mCAAmC,GAAW,IAAI;AACxD,MAAM,kCAAkC,GAAW,IAAI;AACvD,MAAM,kCAAkC,GAAW,IAAI;AAEvD;;;;;AAKG;AACG,SAAU,gCAAgC,CAAC,KAAc,EAAA;IAC9D,MAAM,kBAAkB,GAAY,KAAK,YAAYA,wBAAgB,KAAK,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAA4B,CAAC,IAAI,KAAK,kBAAkB,CAAC;IAElL,IAAI,CAAC,kBAAkB,EAAE;AACxB,QAAA,OAAO,KAAK;IACb;IAEA,MAAM,kBAAkB,GAAY,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,GAAI,KAAmC,CAAC,WAAW,GAAG,SAAS;AAC7I,IAAA,MAAM,WAAW,GAAwC,kBAAkB,IAAI,IAAI,IAAI,OAAO,kBAAkB,KAAK,QAAQ,GAAI,kBAA8C,GAAG,SAAS;AAE3L,IAAA,MAAM,IAAI,GAAY,WAAW,EAAE,IAAI;AACvC,IAAA,MAAM,KAAK,GAAY,WAAW,EAAE,KAAK;AACzC,IAAA,MAAM,MAAM,GAAY,WAAW,EAAE,MAAM;;AAG3C,IAAA,IAAI,IAAI,KAAK,OAAO,EAAE;AACrB,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,IAAI,KAAK,cAAc,EAAE;AAC5B,QAAA,OAAO,IAAI;IACZ;IAEA,IAAI,KAAK,KAAK,mCAAmC,IAAI,KAAK,KAAK,MAAM,CAAC,mCAAmC,CAAC,EAAE;AAC3G,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE;AACrE,QAAA,OAAO,IAAI;IACZ;;IAGA,IAAI,MAAM,KAAK,kCAAkC,IAAI,MAAM,KAAK,kCAAkC,EAAE;AACnG,QAAA,OAAO,IAAI;IACZ;AAEA,IAAA,MAAM,aAAa,GAAY,WAAW,EAAE,OAAO;IACnD,IAAI,OAAO,GAAW,EAAE;AAExB,IAAA,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACtC,OAAO,GAAG,aAAa;IACxB;AAAO,SAAA,IAAI,KAAK,YAAY,KAAK,EAAE;AAClC,QAAA,OAAO,GAAG,KAAK,CAAC,OAAO;IACxB;AAAO,SAAA,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE;AAC5E,QAAA,MAAM,aAAa,GAAa,KAA+B,CAAC,OAAO;AAEvE,QAAA,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACtC,OAAO,GAAG,aAAa;QACxB;IACD;AAEA,IAAA,MAAM,YAAY,GAAW,OAAO,CAAC,WAAW,EAAE;IAElD,IAAI,CAAC,YAAY,EAAE;AAClB,QAAA,OAAO,KAAK;IACb;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,gDAAgD,CAAC,EAAE;AAC5E,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;AAC7C,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE;AACtD,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,
|
|
1
|
+
{"version":3,"file":"unique-violation.utility.js","sources":["../../../../../../../src/utility/database/typeorm/is/unique-violation.utility.ts"],"sourcesContent":[null],"names":["QueryFailedError"],"mappings":";;;;AAEA,MAAM,mCAAmC,GAAW,IAAI;AACxD,MAAM,kCAAkC,GAAW,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W,EAAE;AAExB,IAAA,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACtC,OAAO,GAAG,aAAa;IACxB;AAAO,SAAA,IAAI,KAAK,YAAY,KAAK,EAAE;AAClC,QAAA,OAAO,GAAG,KAAK,CAAC,OAAO;IACxB;AAAO,SAAA,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE;AAC5E,QAAA,MAAM,aAAa,GAAa,KAA+B,CAAC,OAAO;AAEvE,QAAA,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;YACtC,OAAO,GAAG,aAAa;QACxB;IACD;AAEA,IAAA,MAAM,YAAY,GAAW,OAAO,CAAC,WAAW,EAAE;IAElD,IAAI,CAAC,YAAY,EAAE;AAClB,QAAA,OAAO,KAAK;IACb;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,gDAAgD,CAAC,EAAE;AAC5E,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;AAC7C,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,IAAI,YAAY,CAAC,QAAQ,CAAC,0BAA0B,CAAC,EAAE;AACtD,QAAA,OAAO,IAAI;IACZ;;AAGA,IAAA,OAAO,YAAY,CAAC,QAAQ,CAAC,6BAA6B,CAAC;AAC5D;;;;"}
|
|
@@ -62,9 +62,7 @@ function DtoBuildDecorator(method, propertyMetadata, entity, dtoType, propertyNa
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
const config = decoratorConfig_utility.DtoGetDecoratorConfig(method, propertyMetadata, dtoType);
|
|
65
|
-
|
|
66
|
-
decorators.push(decorator_utility.DtoGenerateDecorator(propertyMetadata, entity, config, method, dtoType, propertyName, generatedDTOs));
|
|
67
|
-
return decorators;
|
|
65
|
+
return [decorator_utility.DtoGenerateDecorator(propertyMetadata, entity, config, method, dtoType, propertyName, generatedDTOs)];
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
exports.DtoBuildDecorator = DtoBuildDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-decorator.utility.js","sources":["../../../../../src/utility/dto/build-decorator.utility.ts"],"sourcesContent":[null],"names":["DtoIsPropertyExposedForGuard","EApiPropertyDescribeType","EApiRouteType","EApiDtoType","DtoHandleDateProperty","DtoGetDecoratorConfig","DtoGenerateDecorator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;AAcG;AACH;AACM,SAAU,iBAAiB,CAAoD,MAAS,EAAE,gBAAgD,EAAE,MAAqB,EAAE,OAAU,EAAE,YAAoB,EAAE,YAA+B,EAAE,aAA6C,EAAA;IAKxR,MAAM,UAAU,GAA2C,gBAAgB,CAAC,UAAU,GAAG,MAAM,CAA2C;AAE1I,IAAA,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,SAAS,KAAK,KAAK,KAAK,UAAU,GAAG,OAAO,CAAC,EAAE,UAAU,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,QAAQ,KAAK,KAAK,CAAC,EAAE;AACnI,QAAA,OAAO,SAAS;IACjB;AAEA,IAAA,IAAI,CAACA,oDAA4B,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE;AACnF,QAAA,OAAO,SAAS;IACjB;IAEA,IAAI,gBAAgB,CAAC,IAAI,KAAKC,yCAAwB,CAAC,IAAI,EAAE;QAC5D,MAAM,YAAY,GAAuC,gBAAgB;QAEzE,IAAI,CAAC,MAAM,KAAKC,4BAAa,CAAC,MAAM,IAAI,MAAM,KAAKA,4BAAa,CAAC,cAAc,KAAK,OAAO,KAAKC,wBAAW,CAAC,IAAI,EAAE;AACjH,YAAA,OAAO,SAAS;QACjB;AAEA,QAAA,IAAI,MAAM,KAAKD,4BAAa,CAAC,QAAQ,IAAI,OAAO,KAAKC,wBAAW,CAAC,KAAK,EAAE;YACvE,MAAM,cAAc,GAAoEC,gDAAqB,CAAC,YAAY,EAAE,YAAY,CAAC,UAAU,CAAC;AAEpJ,YAAA,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,QAAkE,KAAI;AAChG,gBAAA,MAAM,WAAW,GAAmC,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE;gBACxG,MAAM,MAAM,GAAsCC,6CAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;AAErG,gBAAA,OAAOC,sCAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC;AACxF,YAAA,CAAC,CAAC;QACH;IACD;IAEA,MAAM,MAAM,GAAsCD,6CAAqB,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"build-decorator.utility.js","sources":["../../../../../src/utility/dto/build-decorator.utility.ts"],"sourcesContent":[null],"names":["DtoIsPropertyExposedForGuard","EApiPropertyDescribeType","EApiRouteType","EApiDtoType","DtoHandleDateProperty","DtoGetDecoratorConfig","DtoGenerateDecorator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;AAcG;AACH;AACM,SAAU,iBAAiB,CAAoD,MAAS,EAAE,gBAAgD,EAAE,MAAqB,EAAE,OAAU,EAAE,YAAoB,EAAE,YAA+B,EAAE,aAA6C,EAAA;IAKxR,MAAM,UAAU,GAA2C,gBAAgB,CAAC,UAAU,GAAG,MAAM,CAA2C;AAE1I,IAAA,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,SAAS,KAAK,KAAK,KAAK,UAAU,GAAG,OAAO,CAAC,EAAE,UAAU,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,QAAQ,KAAK,KAAK,CAAC,EAAE;AACnI,QAAA,OAAO,SAAS;IACjB;AAEA,IAAA,IAAI,CAACA,oDAA4B,C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return;
|
|
39
39
|
}
|
|
40
|
-
const registry = new Map(Reflect.getMetadata?.(MANUAL_DTO_PROPERTY_METADATA_KEY, target)
|
|
40
|
+
const registry = new Map(Reflect.getMetadata?.(MANUAL_DTO_PROPERTY_METADATA_KEY, target));
|
|
41
41
|
registry.set(propertyKey, metadata);
|
|
42
42
|
Reflect.defineMetadata?.(MANUAL_DTO_PROPERTY_METADATA_KEY, registry, target);
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-metadata.utility.js","sources":["../../../../../../src/utility/dto/manual/property-metadata.utility.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,gCAAgC,GAAW,6CAA6C;AAE9F;;;;;AAKG;AACG,SAAU,4BAA4B,CAAC,MAAc,EAAA;IAC1D,MAAM,UAAU,GAAkB,EAAE;IACpC,IAAI,OAAO,GAAkB,MAAM;IAEnC,OAAO,OAAO,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS,EAAE;AAC/C,QAAA,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC;AAC3B,QAAA,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAkB;IAC1D;AAEA,IAAA,MAAM,MAAM,GAAqD,IAAI,GAAG,EAA+C;AAEvH,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QACnC,MAAM,QAAQ,GAAiE,OAAO,CAAC,WAAW,GAAG,gCAAgC,EAAE,SAAS,CAAiE;QAEjN,IAAI,CAAC,QAAQ,EAAE;YACd;QACD;AAEA,QAAA,KAAK,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;AACzD,YAAA,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC;QAClC;IACD;AAEA,IAAA,OAAO,MAAM;AACd;AAEA;;;;;;AAMG;SACa,iCAAiC,CAAC,MAAc,EAAE,WAA4B,EAAE,QAAoC,EAAA;IACnI,IAAI,CAAC,MAAM,EAAE;QACZ;IACD;AAEA,IAAA,MAAM,QAAQ,GAAqD,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"property-metadata.utility.js","sources":["../../../../../../src/utility/dto/manual/property-metadata.utility.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,gCAAgC,GAAW,6CAA6C;AAE9F;;;;;AAKG;AACG,SAAU,4BAA4B,CAAC,MAAc,EAAA;IAC1D,MAAM,UAAU,GAAkB,EAAE;IACpC,IAAI,OAAO,GAAkB,MAAM;IAEnC,OAAO,OAAO,IAAI,OAAO,KAAK,MAAM,CAAC,SAAS,EAAE;AAC/C,QAAA,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC;AAC3B,QAAA,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAkB;IAC1D;AAEA,IAAA,MAAM,MAAM,GAAqD,IAAI,GAAG,EAA+C;AAEvH,IAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QACnC,MAAM,QAAQ,GAAiE,OAAO,CAAC,WAAW,GAAG,gCAAgC,EAAE,SAAS,CAAiE;QAEjN,IAAI,CAAC,QAAQ,EAAE;YACd;QACD;AAEA,QAAA,KAAK,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;AACzD,YAAA,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC;QAClC;IACD;AAEA,IAAA,OAAO,MAAM;AACd;AAEA;;;;;;AAMG;SACa,iCAAiC,CAAC,MAAc,EAAE,WAA4B,EAAE,QAAoC,EAAA;IACnI,IAAI,CAAC,MAAM,EAAE;QACZ;IACD;AAEA,IAAA,MAAM,QAAQ,GAAqD,IAAI,GAAG,CAA8C,OAAO,CAAC,WAAW,GAAG,gCAAgC,EAAE,MAAM,CAAiE,CAAC;AAExP,IAAA,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC;IACnC,OAAO,CAAC,cAAc,GAAG,gCAAgC,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC7E;;;;;"}
|
|
@@ -11,13 +11,7 @@ var typeorm = require('typeorm');
|
|
|
11
11
|
* @template E - The entity type
|
|
12
12
|
*/
|
|
13
13
|
function GenerateEntityInformation(entity) {
|
|
14
|
-
const
|
|
15
|
-
columns: [],
|
|
16
|
-
name: "",
|
|
17
|
-
primaryKey: undefined,
|
|
18
|
-
tableName: "",
|
|
19
|
-
};
|
|
20
|
-
generatedEntity.tableName = (() => {
|
|
14
|
+
const tableName = (() => {
|
|
21
15
|
// eslint-disable-next-line @elsikora/typescript/no-unsafe-function-type
|
|
22
16
|
const table = typeorm.getMetadataArgsStorage().tables.find(({ target }) => target.name === entity.name);
|
|
23
17
|
if (!table) {
|
|
@@ -39,7 +33,6 @@ function GenerateEntityInformation(entity) {
|
|
|
39
33
|
}
|
|
40
34
|
return namingStrategy(table.name);
|
|
41
35
|
})();
|
|
42
|
-
generatedEntity.name = entity.name;
|
|
43
36
|
const storage = metadataStorage_class.MetadataStorage.getInstance();
|
|
44
37
|
const entityHierarchy = [];
|
|
45
38
|
const entityNames = [];
|
|
@@ -137,13 +130,13 @@ function GenerateEntityInformation(entity) {
|
|
|
137
130
|
};
|
|
138
131
|
}),
|
|
139
132
|
];
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
133
|
+
const primaryKey = entityColumns.find((column) => column.isPrimary);
|
|
134
|
+
return {
|
|
135
|
+
columns: entityColumns,
|
|
136
|
+
name: entity.name,
|
|
137
|
+
primaryKey,
|
|
138
|
+
tableName,
|
|
139
|
+
};
|
|
147
140
|
}
|
|
148
141
|
|
|
149
142
|
exports.GenerateEntityInformation = GenerateEntityInformation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-entity-information.utility.js","sources":["../../../../src/utility/generate-entity-information.utility.ts"],"sourcesContent":[null],"names":["getMetadataArgsStorage","ErrorException","DefaultNamingStrategy","MetadataStorage"],"mappings":";;;;;;AAYA;;;;;AAKG;AACG,SAAU,yBAAyB,CAAI,MAAsB,EAAA;AAClE,IAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"generate-entity-information.utility.js","sources":["../../../../src/utility/generate-entity-information.utility.ts"],"sourcesContent":[null],"names":["getMetadataArgsStorage","ErrorException","DefaultNamingStrategy","MetadataStorage"],"mappings":";;;;;;AAYA;;;;;AAKG;AACG,SAAU,yBAAyB,CAAI,MAAsB,EAAA;AAClE,IAAA,MAAM,SAAS,GAAW,CAAC,MAAa;;QAEvC,MAAM,KAAK,GAAkCA,8BAAsB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAqB,KAAe,MAAmB,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;QAExK,IAAI,CAAC,KAAK,EAAE;YACX,MAAMC,gCAAc,CAAC,CAAA,iBAAA,EAAoB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,8BAAA,CAAgC,CAAC;QAC9F;QAEA,MAAM,cAAc,GAAG,CAAC,SAA6B,KAAa,IAAIC,6BAAqB,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,iBAAiB,EAAE,SAAS,CAAC;QAEpJ,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,EAAE;YACjD,MAAM,kBAAkB,GAA+CF,8BAAsB,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAkC,KAAc,MAAM,IAAI,MAAM,CAAC;AAEnM,YAAA,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE;gBAC/B,MAAMC,gCAAc,CAAC,CAAA,+BAAA,EAAkC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA,8BAAA,CAAgC,CAAC;YAC5G;AAAO,iBAAA,IAAI,OAAO,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,wBAAA,MAAM,EAAE,cAAc;AACtB;AACF,sBAAE,SAAS;AACZ,gBAAA,IAAI,EAAE,YAA0B;aAChC;AACF,QAAA,CAAC,CAAC;KACF;AAED,IAAA,MAAM,UAAU,GAAoC,aAAa,CAAC,IAAI,CAAC,CAAC,MAA2B,KAAc,MAAM,CAAC,SAAS,CAAC;IAElI,OAAO;AACN,QAAA,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,UAAU;QACV,SAAS;KACT;AACF;;;;"}
|
|
@@ -12,6 +12,6 @@ export * from './get';
|
|
|
12
12
|
export * from './is';
|
|
13
13
|
export { LoggerUtility } from './logger.utility';
|
|
14
14
|
export { QueueAutoContextRetry } from './queue-auto-context-retry.utility';
|
|
15
|
-
export { GetRegisteredAutoDtoChildren, RegisterAutoDtoChild } from './register-auto-dto-child.utility';
|
|
15
|
+
export { GetRegisteredAutoDtoChildren, GetRegisteredAutoDtoChildrenRecursive, RegisterAutoDtoChild } from './register-auto-dto-child.utility';
|
|
16
16
|
export * from './resolve';
|
|
17
17
|
export { WithResolvedPropertyEntity } from './with-resolved-property-entity.utility';
|
|
@@ -5,6 +5,12 @@ import { Type } from '@nestjs/common';
|
|
|
5
5
|
* @returns {Set<Type<unknown>> | undefined} Set of registered child constructors.
|
|
6
6
|
*/
|
|
7
7
|
export declare function GetRegisteredAutoDtoChildren(parentPrototype: object): Set<Type<unknown>> | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Returns all registered child DTO constructors for the provided parent prototype recursively.
|
|
10
|
+
* @param {object} parentPrototype - Parent DTO prototype.
|
|
11
|
+
* @returns {Array<Type<unknown>>} Registered child constructors including nested descendants.
|
|
12
|
+
*/
|
|
13
|
+
export declare function GetRegisteredAutoDtoChildrenRecursive(parentPrototype: object): Array<Type<unknown>>;
|
|
8
14
|
/**
|
|
9
15
|
* Registers DTO constructors as children of the provided parent prototype.
|
|
10
16
|
* Used to propagate auto DTO context to nested manual DTOs.
|
|
@@ -12,6 +12,16 @@ const AUTO_DTO_CHILDREN = new WeakMap();
|
|
|
12
12
|
function GetRegisteredAutoDtoChildren(parentPrototype) {
|
|
13
13
|
return AUTO_DTO_CHILDREN.get(parentPrototype);
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns all registered child DTO constructors for the provided parent prototype recursively.
|
|
17
|
+
* @param {object} parentPrototype - Parent DTO prototype.
|
|
18
|
+
* @returns {Array<Type<unknown>>} Registered child constructors including nested descendants.
|
|
19
|
+
*/
|
|
20
|
+
function GetRegisteredAutoDtoChildrenRecursive(parentPrototype) {
|
|
21
|
+
const collected = new Set();
|
|
22
|
+
collectRegisteredAutoDtoChildren(parentPrototype, collected);
|
|
23
|
+
return [...collected];
|
|
24
|
+
}
|
|
15
25
|
/**
|
|
16
26
|
* Registers DTO constructors as children of the provided parent prototype.
|
|
17
27
|
* Used to propagate auto DTO context to nested manual DTOs.
|
|
@@ -43,6 +53,25 @@ function RegisterAutoDtoChild(parentPrototype, child) {
|
|
|
43
53
|
}
|
|
44
54
|
}
|
|
45
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Collects registered child DTO constructors recursively.
|
|
58
|
+
* @param {object} parentPrototype - Parent DTO prototype.
|
|
59
|
+
* @param {Set<Type<unknown>>} collected - Accumulator for discovered constructors.
|
|
60
|
+
* @returns {void}
|
|
61
|
+
*/
|
|
62
|
+
function collectRegisteredAutoDtoChildren(parentPrototype, collected) {
|
|
63
|
+
const children = AUTO_DTO_CHILDREN.get(parentPrototype);
|
|
64
|
+
if (!children) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
for (const child of children) {
|
|
68
|
+
if (collected.has(child)) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
collected.add(child);
|
|
72
|
+
collectRegisteredAutoDtoChildren(child.prototype, collected);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
46
75
|
/**
|
|
47
76
|
* Copies currently active auto DTO contexts from parent prototype to child prototype.
|
|
48
77
|
* @param {object} parentPrototype - Parent DTO prototype.
|
|
@@ -68,5 +97,6 @@ function inheritExistingContexts(parentPrototype, childPrototype) {
|
|
|
68
97
|
}
|
|
69
98
|
|
|
70
99
|
exports.GetRegisteredAutoDtoChildren = GetRegisteredAutoDtoChildren;
|
|
100
|
+
exports.GetRegisteredAutoDtoChildrenRecursive = GetRegisteredAutoDtoChildrenRecursive;
|
|
71
101
|
exports.RegisterAutoDtoChild = RegisterAutoDtoChild;
|
|
72
102
|
//# sourceMappingURL=register-auto-dto-child.utility.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-auto-dto-child.utility.js","sources":["../../../../src/utility/register-auto-dto-child.utility.ts"],"sourcesContent":[null],"names":["AUTO_CONTEXT_DTO_CONSTANT","FlushAutoDtoContextExecutions"],"mappings":";;;;;AAMA,MAAM,iBAAiB,GAAwC,IAAI,OAAO,EAA8B;AAExG;;;;AAIG;AACG,SAAU,4BAA4B,CAAC,eAAuB,EAAA;AACnE,IAAA,OAAO,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC;AAC9C;AAEA;;;;;AAKG;AACG,SAAU,oBAAoB,CAAC,eAAuB,EAAE,KAAc,EAAA;AAC3E,IAAA,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK;QAAE;AAEhC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,QAAA,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;AAC1B,YAAA,oBAAoB,CAAC,eAAe,EAAE,KAAK,CAAC;QAC7C;QAEA;IACD;AAEA,IAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QAChC,MAAM,gBAAgB,GAAkB,KAAsB;AAE9D,QAAA,IAAI,gBAAgB,KAAK,MAAM,EAAE;YAChC;QACD;QAEA,IAAI,QAAQ,GAAmC,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC;QAErF,IAAI,CAAC,QAAQ,EAAE;AAC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.utility.js","sources":["../../../../src/utility/register-auto-dto-child.utility.ts"],"sourcesContent":[null],"names":["AUTO_CONTEXT_DTO_CONSTANT","FlushAutoDtoContextExecutions"],"mappings":";;;;;AAMA,MAAM,iBAAiB,GAAwC,IAAI,OAAO,EAA8B;AAExG;;;;AAIG;AACG,SAAU,4BAA4B,CAAC,eAAuB,EAAA;AACnE,IAAA,OAAO,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC;AAC9C;AAEA;;;;AAIG;AACG,SAAU,qCAAqC,CAAC,eAAuB,EAAA;AAC5E,IAAA,MAAM,SAAS,GAAuB,IAAI,GAAG,EAAiB;AAE9D,IAAA,gCAAgC,CAAC,eAAe,EAAE,SAAS,CAAC;AAE5D,IAAA,OAAO,CAAC,GAAG,SAAS,CAAC;AACtB;AAEA;;;;;AAKG;AACG,SAAU,oBAAoB,CAAC,eAAuB,EAAE,KAAc,EAAA;AAC3E,IAAA,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK;QAAE;AAEhC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACzB,QAAA,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE;AAC1B,YAAA,oBAAoB,CAAC,eAAe,EAAE,KAAK,CAAC;QAC7C;QAEA;IACD;AAEA,IAAA,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;QAChC,MAAM,gBAAgB,GAAkB,KAAsB;AAE9D,QAAA,IAAI,gBAAgB,KAAK,MAAM,EAAE;YAChC;QACD;QAEA,IAAI,QAAQ,GAAmC,iBAAiB,CAAC,GAAG,CAAC,eAAe,CAAC;QAErF,IAAI,CAAC,QAAQ,EAAE;AACd,YAAA,QAAQ,GAAG,IAAI,GAAG,EAAiB;AACnC,YAAA,iBAAiB,CAAC,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC;QACjD;QAEA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;AACpC,YAAA,QAAQ,CAAC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C,GAAG,CAAC,cAAc,CAAC;AAE3F,IAAA,IAAI,CAAC,aAAa;QAAE;AAEpB,IAAA,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE;AACvC,QAAA,uBAAuB,CAAC,cAAc,EAAE,UAAU,CAAC,SAAmB,CAAC;IACxE;AACD;;;;;;"}
|
|
@@ -86,7 +86,7 @@ exports.HasPairedCustomSuffixesFieldsValidator = class HasPairedCustomSuffixesFi
|
|
|
86
86
|
const fields = Object.keys(indexableObject);
|
|
87
87
|
const fieldGroups = new Map();
|
|
88
88
|
const suffixPattern = [operatorSuffix, ...valueSuffixes].map((suffix) => suffix.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw `\$&`)).join("|");
|
|
89
|
-
const regex = new RegExp(`^(.+?)
|
|
89
|
+
const regex = new RegExp(String.raw `^(.+?)\[(${suffixPattern})\]$`);
|
|
90
90
|
for (const field of fields) {
|
|
91
91
|
const match = regex.exec(field);
|
|
92
92
|
if (match) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paired-custom-suffixes-fields.validator.js","sources":["../../../../../src/validator/has/paired-custom-suffixes-fields.validator.ts"],"sourcesContent":[null],"names":["HasPairedCustomSuffixesFieldsValidator","VALIDATOR_HAS_PAIRED_CUSTOM_SUFFIXES_FIELDS_CONSTANT","EHasPairedCustomSuffixesFieldsArgumentType","__decorate","ValidatorConstraint"],"mappings":";;;;;;;;AAMA;AAEaA,8CAAsC,GAA5C,MAAM,sCAAsC,CAAA;AAClD;;;;AAIG;AACH,IAAA,cAAc,CAAC,UAA+B,EAAA;AAC7C,QAAA,MAAM,MAAM,GAAoD,UAAU,CAAC,MAAyD;AACpI,QAAA,MAAM,WAAW,GAA6B,MAAM,CAAC,aAAa;AAClE,QAAA,MAAM,cAAc,GAAW,MAAM,CAAC,gBAAgB;AACtD,QAAA,MAAM,aAAa,GAAkB,MAAM,CAAC,eAAe;AAC3D,QAAA,MAAM,eAAe,GAA4B,UAAU,CAAC,MAAiC;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es-fields.validator.js","sources":["../../../../../src/validator/has/paired-custom-suffixes-fields.validator.ts"],"sourcesContent":[null],"names":["HasPairedCustomSuffixesFieldsValidator","VALIDATOR_HAS_PAIRED_CUSTOM_SUFFIXES_FIELDS_CONSTANT","EHasPairedCustomSuffixesFieldsArgumentType","__decorate","ValidatorConstraint"],"mappings":";;;;;;;;AAMA;AAEaA,8CAAsC,GAA5C,MAAM,sCAAsC,CAAA;AAClD;;;;AAIG;AACH,IAAA,cAAc,CAAC,UAA+B,EAAA;AAC7C,QAAA,MAAM,MAAM,GAAoD,UAAU,CAAC,MAAyD;AACpI,QAAA,MAAM,WAAW,GAA6B,MAAM,CAAC,aAAa;AAClE,QAAA,MAAM,cAAc,GAAW,MAAM,CAAC,gBAAgB;AACtD,QAAA,MAAM,aAAa,GAAkB,MAAM,CAAC,eAAe;AAC3D,QAAA,MAAM,eAAe,GAA4B,UAAU,CAAC,MAAiC;QAE7F,KAAK,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,WAAW,EAAE;AACpD,YAAA,MAAM,cAAc,GAAY,aAAa,CAAC,IAAI,CAAC,CAAC,MAAc,KAAK,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAEjG,IAAI,cAAc,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AACzD,gBAAA,OAAO,CAAA,OAAA,EAAU,QAAQ,CAAA,kDAAA,EAAqD,cAAc,GAAG;YAChG;AAEA,YAAA,IAAI,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;AACtC,gBAAA,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE;AAC7B,oBAAA,OAAO,CAAA,OAAA,EAAU,QAAQ,CAAA,iEAAA,EAAoE,CAAC,GAAG,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBAC9H;AAEA,gBAAA,MAAM,aAAa,GAAW,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,c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,CAAC,MAAM,KAAK,CAAC;AAAE,oBAAA,OAAO,KAAK;;;gBAI1C,MAAM,KAAK,GAAmB,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAC7D,MAAM,OAAO,GAAY,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;gBAE7C,IAAI,cAAc,CAAC,YAAY,KAAKA,yFAA0C,CAAC,KAAK,IAAI,CAAC,OAAO;AAAE,oBAAA,OAAO,KAAK;gBAE9G,IAAI,cAAc,CAAC,YAAY,KAAKA,yFAA0C,CAAC,MAAM,IAAI,OAAO;AAAE,oBAAA,OAAO,KAAK;gBAE9G,IAAI,OAAO,EAAE;AACZ,oBAAA,IAAI,cAAc,CAAC,WAAW,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,CAAC,WAAW;AAAE,wBAAA,OAAO,KAAK;AAEzG,oBAAA,IAAI,cAAc,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC,SAAS;AAAE,wBAAA,OAAO,KAAK;AAEnG,oBAAA,IAAI,cAAc,CAAC,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC,SAAS;AAAE,wBAAA,OAAO,KAAK;gBACpG;YACD;QACD;AAEA,QAAA,OAAO,IAAI;IACZ;;AAtKYF,8CAAsC,GAAAG,oBAAA,CAAA;IADlDC,kCAAmB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,mCAAmC,EAAE;AACnE,CAAA,EAAAJ,8CAAsC,CAuKlD;;"}
|
|
@@ -5,7 +5,6 @@ export declare class MustMatchOneOfSchemasConstraint implements ValidatorConstra
|
|
|
5
5
|
private discriminatorField;
|
|
6
6
|
private discriminatorValue;
|
|
7
7
|
private errorType;
|
|
8
|
-
private schemasInfo;
|
|
9
8
|
/**
|
|
10
9
|
* Provides a custom error message based on the type of validation failure
|
|
11
10
|
* @param {ValidationArguments} _arguments - Validation arguments containing property information
|
|
@@ -20,7 +19,7 @@ export declare class MustMatchOneOfSchemasConstraint implements ValidatorConstra
|
|
|
20
19
|
*/
|
|
21
20
|
validate(value: unknown, _arguments: ValidationArguments): boolean;
|
|
22
21
|
/**
|
|
23
|
-
* Prepares the list of allowed
|
|
22
|
+
* Prepares the list of allowed discriminator values based on validation constraints
|
|
24
23
|
* @param {ValidationArguments} _arguments - Validation arguments containing constraints
|
|
25
24
|
* @returns {void}
|
|
26
25
|
* @private
|
|
@@ -12,7 +12,6 @@ exports.MustMatchOneOfSchemasConstraint = class MustMatchOneOfSchemasConstraint
|
|
|
12
12
|
discriminatorField = null;
|
|
13
13
|
discriminatorValue = null;
|
|
14
14
|
errorType = mustMatchOneOfSchemasErrorType_enum.EMastMatchOneOfSchemasValidationErrorType.UNKNOWN;
|
|
15
|
-
schemasInfo = {};
|
|
16
15
|
/**
|
|
17
16
|
* Provides a custom error message based on the type of validation failure
|
|
18
17
|
* @param {ValidationArguments} _arguments - Validation arguments containing property information
|
|
@@ -24,8 +23,7 @@ exports.MustMatchOneOfSchemasConstraint = class MustMatchOneOfSchemasConstraint
|
|
|
24
23
|
case mustMatchOneOfSchemasErrorType_enum.EMastMatchOneOfSchemasValidationErrorType.INVALID_DISCRIMINATOR: {
|
|
25
24
|
const schemasList = this.allowedValues
|
|
26
25
|
.map((value) => {
|
|
27
|
-
|
|
28
|
-
return `'${value}' (${schemaName})`;
|
|
26
|
+
return `'${value}'`;
|
|
29
27
|
})
|
|
30
28
|
.join(", ");
|
|
31
29
|
return `${propertyName} has invalid discriminator value '${String(this.discriminatorValue)}' for field '${String(this.discriminatorField)}'. must be one of: ${schemasList}`;
|
|
@@ -36,8 +34,7 @@ exports.MustMatchOneOfSchemasConstraint = class MustMatchOneOfSchemasConstraint
|
|
|
36
34
|
case mustMatchOneOfSchemasErrorType_enum.EMastMatchOneOfSchemasValidationErrorType.SCHEMA_MISMATCH: {
|
|
37
35
|
const schemasList = this.allowedValues
|
|
38
36
|
.map((value) => {
|
|
39
|
-
|
|
40
|
-
return `'${value}' (${schemaName})`;
|
|
37
|
+
return `'${value}'`;
|
|
41
38
|
})
|
|
42
39
|
.join(", ");
|
|
43
40
|
return `${propertyName} must match one of the schemas: ${schemasList}`;
|
|
@@ -111,48 +108,22 @@ exports.MustMatchOneOfSchemasConstraint = class MustMatchOneOfSchemasConstraint
|
|
|
111
108
|
}
|
|
112
109
|
}
|
|
113
110
|
/**
|
|
114
|
-
* Prepares the list of allowed
|
|
111
|
+
* Prepares the list of allowed discriminator values based on validation constraints
|
|
115
112
|
* @param {ValidationArguments} _arguments - Validation arguments containing constraints
|
|
116
113
|
* @returns {void}
|
|
117
114
|
* @private
|
|
118
115
|
*/
|
|
119
116
|
prepareAllowedSchemas(_arguments) {
|
|
120
117
|
this.allowedValues = [];
|
|
121
|
-
this.schemasInfo = {};
|
|
122
118
|
const constraints = _arguments.constraints;
|
|
123
119
|
if (!constraints?.[0]) {
|
|
124
120
|
return;
|
|
125
121
|
}
|
|
126
|
-
const { discriminator
|
|
122
|
+
const { discriminator } = constraints[0];
|
|
127
123
|
if (!discriminator?.mapping) {
|
|
128
124
|
return;
|
|
129
125
|
}
|
|
130
126
|
this.allowedValues = Object.keys(discriminator.mapping);
|
|
131
|
-
for (const [key, value] of Object.entries(discriminator.mapping)) {
|
|
132
|
-
let schemaName = "Unknown schema";
|
|
133
|
-
if (Array.isArray(schemas)) {
|
|
134
|
-
// eslint-disable-next-line @elsikora/typescript/no-unsafe-function-type
|
|
135
|
-
const schemaClass = schemas.find((schema) => {
|
|
136
|
-
if (typeof value === "function" && schema === value) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
return typeof value === "string" && schema.name === value;
|
|
140
|
-
});
|
|
141
|
-
if (schemaClass) {
|
|
142
|
-
schemaName = schemaClass.name ?? "Anonymous class";
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
else if (schemas && typeof schemas === "object") {
|
|
146
|
-
if (typeof value === "string" && value in schemas) {
|
|
147
|
-
const schemaClass = schemas[value];
|
|
148
|
-
schemaName = schemaClass.name ?? value;
|
|
149
|
-
}
|
|
150
|
-
else if (typeof value === "function") {
|
|
151
|
-
schemaName = value.name ?? "Anonymous class";
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
this.schemasInfo[key] = schemaName;
|
|
155
|
-
}
|
|
156
127
|
}
|
|
157
128
|
};
|
|
158
129
|
exports.MustMatchOneOfSchemasConstraint = tslib_es6.__decorate([
|