@elsikora/nestjs-crud-automator 2.1.2 → 2.2.0-dev.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/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
package/dist/cjs/constant/utility/api/get-default-string-format-properties/bigint-string/constant.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var default_constant = require('./sign/default.constant.js');
|
|
4
|
+
var properties_constant = require('./sign/properties.constant.js');
|
|
5
|
+
|
|
6
|
+
const BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = {
|
|
7
|
+
DEFAULT_SIGN: default_constant.DEFAULT_SIGN_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT,
|
|
8
|
+
SIGN_PROPERTIES: properties_constant.SIGN_PROPERTIES_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT;
|
|
12
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sources":["../../../../../../../../src/constant/utility/api/get-default-string-format-properties/bigint-string/constant.ts"],"sourcesContent":[null],"names":["DEFAULT_SIGN_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT","SIGN_PROPERTIES_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT"],"mappings":";;;;;AAIO,MAAM,uEAAuE,GAGhF;AACH,IAAA,YAAY,EAAEA,qGAAoF;AAClG,IAAA,eAAe,EAAEC,2GAAuF;;;;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_SIGN_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = "signed";
|
|
4
|
+
|
|
5
|
+
exports.DEFAULT_SIGN_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = DEFAULT_SIGN_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT;
|
|
6
|
+
//# sourceMappingURL=default.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.constant.js","sources":["../../../../../../../../../src/constant/utility/api/get-default-string-format-properties/bigint-string/sign/default.constant.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEO,MAAM,oFAAoF,GAAyD;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TApiGetDefaultStringFormatPropertiesBigIntStringSign, TApiGetDefaultStringFormatPropertiesBigIntStringSignProperties } from '../../../../../../type/utility/api';
|
|
2
|
+
export declare const SIGN_PROPERTIES_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT: Record<TApiGetDefaultStringFormatPropertiesBigIntStringSign, TApiGetDefaultStringFormatPropertiesBigIntStringSignProperties>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SIGN_PROPERTIES_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = {
|
|
4
|
+
negative: {
|
|
5
|
+
description: "negative bigint decimal string",
|
|
6
|
+
exampleValue: "-1000",
|
|
7
|
+
maxLength: 20,
|
|
8
|
+
minLength: 2,
|
|
9
|
+
pattern: String.raw `/^-[1-9]\d{0,18}$/`,
|
|
10
|
+
},
|
|
11
|
+
signed: {
|
|
12
|
+
description: "bigint decimal string",
|
|
13
|
+
exampleValue: "1000",
|
|
14
|
+
maxLength: 20,
|
|
15
|
+
minLength: 1,
|
|
16
|
+
pattern: String.raw `/^-?(0|[1-9]\d{0,18})$/`,
|
|
17
|
+
},
|
|
18
|
+
unsigned: {
|
|
19
|
+
description: "unsigned bigint decimal string",
|
|
20
|
+
exampleValue: "1000",
|
|
21
|
+
maxLength: 20,
|
|
22
|
+
minLength: 1,
|
|
23
|
+
pattern: String.raw `/^(0|[1-9]\d{0,19})$/`,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.SIGN_PROPERTIES_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = SIGN_PROPERTIES_BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT;
|
|
28
|
+
//# sourceMappingURL=properties.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.constant.js","sources":["../../../../../../../../../src/constant/utility/api/get-default-string-format-properties/bigint-string/sign/properties.constant.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGO,MAAM,uFAAuF,GAAiI;AACpO,IAAA,QAAQ,EAAE;AACT,QAAA,WAAW,EAAE,gCAAgC;AAC7C,QAAA,YAAY,EAAE,OAAO;AACrB,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,SAAS,EAAE,CAAC;AACZ,QAAA,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA,CAAA,kBAAA,CAAoB;AACvC,KAAA;AACD,IAAA,MAAM,EAAE;AACP,QAAA,WAAW,EAAE,uBAAuB;AACpC,QAAA,YAAY,EAAE,MAAM;AACpB,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,SAAS,EAAE,CAAC;AACZ,QAAA,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA,CAAA,uBAAA,CAAyB;AAC5C,KAAA;AACD,IAAA,QAAQ,EAAE;AACT,QAAA,WAAW,EAAE,gCAAgC;AAC7C,QAAA,YAAY,EAAE,MAAM;AACpB,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,SAAS,EAAE,CAAC;AACZ,QAAA,OAAO,EAAE,MAAM,CAAC,GAAG,CAAA,CAAA,qBAAA,CAAuB;AAC1C,KAAA;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TApiGetDefaultStringFormatPropertiesBigIntStringSign, TApiGetDefaultStringFormatPropertiesBigIntStringSignProperties } from '../../../../type/utility/api';
|
|
2
|
+
import { TApiGetDefaultStringFormatPropertiesCustomizerMap } from '../../../../type/utility/api/get-default-string-format-properties/customizer';
|
|
3
|
+
export declare const GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT: {
|
|
4
|
+
readonly BIGINT_STRING: {
|
|
5
|
+
readonly DEFAULT_SIGN: TApiGetDefaultStringFormatPropertiesBigIntStringSign;
|
|
6
|
+
readonly SIGN_PROPERTIES: Record<TApiGetDefaultStringFormatPropertiesBigIntStringSign, TApiGetDefaultStringFormatPropertiesBigIntStringSignProperties>;
|
|
7
|
+
};
|
|
8
|
+
readonly CUSTOMIZER_MAP: TApiGetDefaultStringFormatPropertiesCustomizerMap;
|
|
9
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var constant = require('./bigint-string/constant.js');
|
|
4
|
+
var map_constant = require('./customizer/map.constant.js');
|
|
5
|
+
|
|
6
|
+
const GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = {
|
|
7
|
+
BIGINT_STRING: constant.BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT,
|
|
8
|
+
CUSTOMIZER_MAP: map_constant.CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT;
|
|
12
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sources":["../../../../../../../src/constant/utility/api/get-default-string-format-properties/constant.ts"],"sourcesContent":[null],"names":["BIGINT_STRING_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT","CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT"],"mappings":";;;;;AAMO,MAAM,yDAAyD,GAMlE;AACH,IAAA,aAAa,EAAEA,gFAAuE;AACtF,IAAA,cAAc,EAAEC,qFAAwE;;;;;"}
|
package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT } from './map.constant';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TApiGetDefaultStringFormatPropertiesCustomizerMap } from '../../../../../type/utility/api/get-default-string-format-properties/customizer';
|
|
2
|
+
export declare const CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT: TApiGetDefaultStringFormatPropertiesCustomizerMap;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../../../../../enum/decorator/api/action.enum.js');
|
|
4
|
+
require('../../../../../enum/decorator/api/authentication-type.enum.js');
|
|
5
|
+
require('../../../../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
6
|
+
require('../../../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
7
|
+
require('../../../../../enum/decorator/api/controller/request/target.enum.js');
|
|
8
|
+
require('../../../../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
9
|
+
require('../../../../../enum/decorator/api/controller/response-target.enum.js');
|
|
10
|
+
require('../../../../../enum/decorator/api/dto-type.enum.js');
|
|
11
|
+
require('../../../../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
12
|
+
require('../../../../../enum/decorator/api/function-type.enum.js');
|
|
13
|
+
require('../../../../../enum/decorator/api/on-type.enum.js');
|
|
14
|
+
require('../../../../../enum/decorator/api/property/data-type.enum.js');
|
|
15
|
+
require('../../../../../enum/decorator/api/property/date/identifier.enum.js');
|
|
16
|
+
require('../../../../../enum/decorator/api/property/date/type.enum.js');
|
|
17
|
+
require('../../../../../enum/decorator/api/property/desribe-type.enum.js');
|
|
18
|
+
require('../../../../../enum/decorator/api/property/number-type.enum.js');
|
|
19
|
+
var stringType_enum = require('../../../../../enum/decorator/api/property/string-type.enum.js');
|
|
20
|
+
require('../../../../../enum/decorator/api/route-type.enum.js');
|
|
21
|
+
var applyOptions_utility = require('../../../../../utility/api/get-default-string-format-properties/bigint-string/apply-options.utility.js');
|
|
22
|
+
|
|
23
|
+
const CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = {
|
|
24
|
+
[stringType_enum.EApiPropertyStringType.BIGINT_STRING]: applyOptions_utility.ApplyBigIntStringGetDefaultStringFormatPropertiesOptions,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT = CUSTOMIZER_MAP_GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT;
|
|
28
|
+
//# sourceMappingURL=map.constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.constant.js","sources":["../../../../../../../../src/constant/utility/api/get-default-string-format-properties/customizer/map.constant.ts"],"sourcesContent":[null],"names":["EApiPropertyStringType","ApplyBigIntStringGetDefaultStringFormatPropertiesOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,MAAM,wEAAwE,GAAsD;AAC1I,IAAA,CAACA,sCAAsB,CAAC,aAAa,GAAGC,6EAAwD;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GET_DEFAULT_STRING_FORMAT_PROPERTIES_API_UTILITY_CONSTANT } from './constant';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-default-string-format-properties';
|
|
@@ -9,9 +9,15 @@ var controller_constant = require('../../../constant/decorator/api/controller.co
|
|
|
9
9
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-controller/api-controller-observable | API Reference - ApiControllerObservable}
|
|
10
10
|
*/
|
|
11
11
|
function ApiControllerObservable() {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return applyApiControllerObservableMetadata;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Applies controller observable metadata.
|
|
16
|
+
* @param {object} target - Decorated controller target.
|
|
17
|
+
* @returns {void}
|
|
18
|
+
*/
|
|
19
|
+
function applyApiControllerObservableMetadata(target) {
|
|
20
|
+
Reflect.defineMetadata(controller_constant.CONTROLLER_API_DECORATOR_CONSTANT.OBSERVABLE_METADATA_KEY, true, target);
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
exports.ApiControllerObservable = ApiControllerObservable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.decorator.js","sources":["../../../../../../src/decorator/api/controller/observable.decorator.ts"],"sourcesContent":[null],"names":["CONTROLLER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAEA;;;;;AAKG;SACa,uBAAuB,GAAA;
|
|
1
|
+
{"version":3,"file":"observable.decorator.js","sources":["../../../../../../src/decorator/api/controller/observable.decorator.ts"],"sourcesContent":[null],"names":["CONTROLLER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAEA;;;;;AAKG;SACa,uBAAuB,GAAA;AACtC,IAAA,OAAO,oCAAoC;AAC5C;AAEA;;;;AAIG;AACH,SAAS,oCAAoC,CAAC,MAAc,EAAA;IAC3D,OAAO,CAAC,cAAc,CAACA,qDAAiC,CAAC,uBAAuB,EAAE,IAAI,EAAE,MAAM,CAAC;AAChG;;;;"}
|
|
@@ -9,9 +9,15 @@ var controller_constant = require('../../../constant/decorator/api/controller.co
|
|
|
9
9
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-controller/api-controller-securable | API Reference - ApiControllerSecurable}
|
|
10
10
|
*/
|
|
11
11
|
function ApiControllerSecurable() {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
return applyApiControllerSecurableMetadata;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Applies controller securable metadata.
|
|
16
|
+
* @param {object} target - Decorated controller target.
|
|
17
|
+
* @returns {void}
|
|
18
|
+
*/
|
|
19
|
+
function applyApiControllerSecurableMetadata(target) {
|
|
20
|
+
Reflect.defineMetadata(controller_constant.CONTROLLER_API_DECORATOR_CONSTANT.SECURABLE_METADATA_KEY, true, target);
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
exports.ApiControllerSecurable = ApiControllerSecurable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securable.decorator.js","sources":["../../../../../../src/decorator/api/controller/securable.decorator.ts"],"sourcesContent":[null],"names":["CONTROLLER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAEA;;;;;AAKG;SACa,sBAAsB,GAAA;
|
|
1
|
+
{"version":3,"file":"securable.decorator.js","sources":["../../../../../../src/decorator/api/controller/securable.decorator.ts"],"sourcesContent":[null],"names":["CONTROLLER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAEA;;;;;AAKG;SACa,sBAAsB,GAAA;AACrC,IAAA,OAAO,mCAAmC;AAC3C;AAEA;;;;AAIG;AACH,SAAS,mCAAmC,CAAC,MAAc,EAAA;IAC1D,OAAO,CAAC,cAAc,CAACA,qDAAiC,CAAC,sBAAsB,EAAE,IAAI,EAAE,MAAM,CAAC;AAC/F;;;;"}
|
|
@@ -24,8 +24,11 @@ var routeType_enum = require('../../enum/decorator/api/route-type.enum.js');
|
|
|
24
24
|
var common = require('@nestjs/common');
|
|
25
25
|
var swagger = require('@nestjs/swagger');
|
|
26
26
|
var throttler = require('@nestjs/throttler');
|
|
27
|
-
var
|
|
28
|
-
var exception_utility
|
|
27
|
+
var buildOpenApiSchema_utility = require('../../utility/api/route/discriminator/build-open-api-schema.utility.js');
|
|
28
|
+
var exception_utility = require('../../utility/error/exception.utility.js');
|
|
29
|
+
require('@nestjs/swagger/dist/constants.js');
|
|
30
|
+
var collectWithRegisteredChildren_utility = require('../../utility/api/route/dto/collect-with-registered-children.utility.js');
|
|
31
|
+
var exception_utility$1 = require('../../utility/dto/generate/exception.utility.js');
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* Composes Nest route, Swagger, throttling, authentication, and route metadata decorators.
|
|
@@ -64,6 +67,30 @@ function ApiMethod(options) {
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
const successResponseDecorators = [];
|
|
71
|
+
if (metadata.response && metadata.response.status !== common.HttpStatus.NO_CONTENT && Array.isArray(metadata.response.type)) {
|
|
72
|
+
if (!metadata.response.discriminator) {
|
|
73
|
+
throw exception_utility.ErrorException("ApiMethod error: response.discriminator is required when response.type is an array");
|
|
74
|
+
}
|
|
75
|
+
const responseDtos = [];
|
|
76
|
+
collectWithRegisteredChildren_utility.ApiRouteCollectDtoWithRegisteredChildren(responseDtos, metadata.response.type);
|
|
77
|
+
successResponseDecorators.push(swagger.ApiExtraModels(...responseDtos), swagger.ApiResponse({
|
|
78
|
+
description: "Success",
|
|
79
|
+
schema: buildOpenApiSchema_utility.ApiRouteBuildDiscriminatedDtoOpenApiSchema({
|
|
80
|
+
discriminator: metadata.response.discriminator,
|
|
81
|
+
type: metadata.response.type,
|
|
82
|
+
}, "ApiMethod response"),
|
|
83
|
+
status: metadata.response.status,
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const responseType = Array.isArray(metadata.response?.type) ? undefined : metadata.response?.type;
|
|
88
|
+
successResponseDecorators.push(swagger.ApiResponse({
|
|
89
|
+
description: "Success",
|
|
90
|
+
status: metadata.response?.status,
|
|
91
|
+
type: responseType,
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
67
94
|
const decorators = [
|
|
68
95
|
common.SetMetadata(method_constant.METHOD_API_DECORATOR_CONSTANT.ROUTE_METADATA_KEY, metadata),
|
|
69
96
|
swagger.ApiOperation({
|
|
@@ -71,11 +98,7 @@ function ApiMethod(options) {
|
|
|
71
98
|
operationId: metadata.documentation?.operationId,
|
|
72
99
|
summary: operationSummary,
|
|
73
100
|
}),
|
|
74
|
-
|
|
75
|
-
description: "Success",
|
|
76
|
-
status: metadata.response?.status,
|
|
77
|
-
type: metadata.response?.type,
|
|
78
|
-
}),
|
|
101
|
+
...successResponseDecorators,
|
|
79
102
|
common.HttpCode(metadata.response?.status ?? common.HttpStatus.OK),
|
|
80
103
|
];
|
|
81
104
|
if (metadata.throttling?.default) {
|
|
@@ -83,25 +106,25 @@ function ApiMethod(options) {
|
|
|
83
106
|
}
|
|
84
107
|
const errors = metadata.response?.errors;
|
|
85
108
|
if (errors?.hasUnauthorized) {
|
|
86
|
-
decorators.push(swagger.ApiUnauthorizedResponse({ description: "Unauthorized", type: exception_utility.DtoGenerateException(common.HttpStatus.UNAUTHORIZED) }));
|
|
109
|
+
decorators.push(swagger.ApiUnauthorizedResponse({ description: "Unauthorized", type: exception_utility$1.DtoGenerateException(common.HttpStatus.UNAUTHORIZED) }));
|
|
87
110
|
}
|
|
88
111
|
if (errors?.hasForbidden) {
|
|
89
|
-
decorators.push(swagger.ApiForbiddenResponse({ description: "Forbidden", type: exception_utility.DtoGenerateException(common.HttpStatus.FORBIDDEN) }));
|
|
112
|
+
decorators.push(swagger.ApiForbiddenResponse({ description: "Forbidden", type: exception_utility$1.DtoGenerateException(common.HttpStatus.FORBIDDEN) }));
|
|
90
113
|
}
|
|
91
114
|
if (errors?.hasInternalServerError) {
|
|
92
|
-
decorators.push(swagger.ApiInternalServerErrorResponse({ description: "Internal Server Error", type: exception_utility.DtoGenerateException(common.HttpStatus.INTERNAL_SERVER_ERROR) }));
|
|
115
|
+
decorators.push(swagger.ApiInternalServerErrorResponse({ description: "Internal Server Error", type: exception_utility$1.DtoGenerateException(common.HttpStatus.INTERNAL_SERVER_ERROR) }));
|
|
93
116
|
}
|
|
94
117
|
if (errors?.hasNotFound) {
|
|
95
|
-
decorators.push(swagger.ApiNotFoundResponse({ description: "Not Found", type: exception_utility.DtoGenerateException(common.HttpStatus.NOT_FOUND) }));
|
|
118
|
+
decorators.push(swagger.ApiNotFoundResponse({ description: "Not Found", type: exception_utility$1.DtoGenerateException(common.HttpStatus.NOT_FOUND) }));
|
|
96
119
|
}
|
|
97
120
|
if (errors?.hasBadRequest) {
|
|
98
|
-
decorators.push(swagger.ApiBadRequestResponse({ description: "Bad Request", type: exception_utility.DtoGenerateException(common.HttpStatus.BAD_REQUEST) }));
|
|
121
|
+
decorators.push(swagger.ApiBadRequestResponse({ description: "Bad Request", type: exception_utility$1.DtoGenerateException(common.HttpStatus.BAD_REQUEST) }));
|
|
99
122
|
}
|
|
100
123
|
if (errors?.hasConflict) {
|
|
101
|
-
decorators.push(swagger.ApiConflictResponse({ description: "Conflict", type: exception_utility.DtoGenerateException(common.HttpStatus.CONFLICT) }));
|
|
124
|
+
decorators.push(swagger.ApiConflictResponse({ description: "Conflict", type: exception_utility$1.DtoGenerateException(common.HttpStatus.CONFLICT) }));
|
|
102
125
|
}
|
|
103
126
|
if (errors?.hasTooManyRequests) {
|
|
104
|
-
decorators.push(swagger.ApiTooManyRequestsResponse({ description: "Too Many Requests", type: exception_utility.DtoGenerateException(common.HttpStatus.TOO_MANY_REQUESTS) }));
|
|
127
|
+
decorators.push(swagger.ApiTooManyRequestsResponse({ description: "Too Many Requests", type: exception_utility$1.DtoGenerateException(common.HttpStatus.TOO_MANY_REQUESTS) }));
|
|
105
128
|
}
|
|
106
129
|
// eslint-disable-next-line @elsikora/typescript/switch-exhaustiveness-check
|
|
107
130
|
switch (metadata.route.method) {
|
|
@@ -126,7 +149,7 @@ function ApiMethod(options) {
|
|
|
126
149
|
break;
|
|
127
150
|
}
|
|
128
151
|
default: {
|
|
129
|
-
throw exception_utility
|
|
152
|
+
throw exception_utility.ErrorException(`ApiMethod error: Method ${String(metadata.route.method)} is not supported`);
|
|
130
153
|
}
|
|
131
154
|
}
|
|
132
155
|
for (const strategy of metadata.security?.authentication?.bearerStrategies ?? []) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.decorator.js","sources":["../../../../../src/decorator/api/method.decorator.ts"],"sourcesContent":[null],"names":["EApiRouteType","
|
|
1
|
+
{"version":3,"file":"method.decorator.js","sources":["../../../../../src/decorator/api/method.decorator.ts"],"sourcesContent":[null],"names":["EApiRouteType","HttpStatus","ErrorException","ApiRouteCollectDtoWithRegisteredChildren","ApiExtraModels","ApiResponse","ApiRouteBuildDiscriminatedDtoOpenApiSchema","SetMetadata","METHOD_API_DECORATOR_CONSTANT","ApiOperation","HttpCode","Throttle","ApiUnauthorizedResponse","DtoGenerateException","ApiForbiddenResponse","ApiInternalServerErrorResponse","ApiNotFoundResponse","ApiBadRequestResponse","ApiConflictResponse","ApiTooManyRequestsResponse","RequestMethod","Delete","Get","Patch","Post","Put","ApiBearerAuth","ApiSecurity","ApiAuthorizationGuard","UseGuards","applyDecorators"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;;;;;AAKG;AACG,SAAU,SAAS,CAA2B,OAAgC,EAAA;AACnF,IAAA,MAAM,QAAQ,GAAwC,OAAO,CAAC,QAAQ;AACtE,IAAA,IAAI,gBAAgB,GAAuB,QAAQ,CAAC,aAAa,EAAE,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM;AAEtG,IAAA,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE;AAC5D,QAAA,QAAQ,QAAQ,CAAC,KAAK,CAAC,IAAI;AAC1B,YAAA,KAAKA,4BAAa,CAAC,MAAM,EAAE;gBAC1B,gBAAgB,GAAG,iBAAiB;gBAEpC;YACD;AAEA,YAAA,KAAKA,4BAAa,CAAC,MAAM,EAAE;gBAC1B,gBAAgB,GAAG,iBAAiB;gBAEp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AK,EAAE;QAC7C,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC;IACpD;AAEA,IAAA,MAAM,CAAC,IAAI,CAACC,iCAAqB,CAAC;IAClC,UAAU,CAAC,IAAI,CAACC,gBAAS,CAAC,GAAG,MAAM,CAAC,CAAC;AAErC,IAAA,OAAOC,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;;;;"}
|
|
@@ -14,7 +14,7 @@ import { TApiPropertyBaseProperties } from '../../../type/decorator/api/property
|
|
|
14
14
|
* number values (0/non-zero), and proper boolean values. This makes it robust when working with
|
|
15
15
|
* form data and query parameters.
|
|
16
16
|
* @param {TApiPropertyBaseProperties} properties - Configuration options for the boolean property
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
18
18
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-boolean | API Reference - ApiPropertyBoolean}
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
@@ -43,7 +43,7 @@ var classValidator = require('class-validator');
|
|
|
43
43
|
* number values (0/non-zero), and proper boolean values. This makes it robust when working with
|
|
44
44
|
* form data and query parameters.
|
|
45
45
|
* @param {TApiPropertyBaseProperties} properties - Configuration options for the boolean property
|
|
46
|
-
* @returns {
|
|
46
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
47
47
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-boolean | API Reference - ApiPropertyBoolean}
|
|
48
48
|
* @example
|
|
49
49
|
* ```typescript
|
|
@@ -108,9 +108,10 @@ function buildApiPropertyOptions(properties) {
|
|
|
108
108
|
description: `${String(properties.entity.name)} ${properties.description ?? ""}`,
|
|
109
109
|
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
110
110
|
nullable: !!properties.isNullable,
|
|
111
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
112
|
+
required: properties.isRequired,
|
|
111
113
|
type: dataType_enum.EApiPropertyDataType.BOOLEAN,
|
|
112
114
|
};
|
|
113
|
-
apiPropertyOptions.required = properties.isRequired;
|
|
114
115
|
if (properties.isArray) {
|
|
115
116
|
apiPropertyOptions.isArray = true;
|
|
116
117
|
apiPropertyOptions.minItems = properties.minItems;
|
|
@@ -131,9 +132,7 @@ function buildApiPropertyOptions(properties) {
|
|
|
131
132
|
* @private
|
|
132
133
|
*/
|
|
133
134
|
function buildDecorators(properties, apiPropertyOptions) {
|
|
134
|
-
|
|
135
|
-
decorators.push(...buildResponseDecorators(properties), ...buildRequestDecorators(properties), ...buildFormatDecorators(properties), ...buildTransformDecorators(properties));
|
|
136
|
-
return decorators;
|
|
135
|
+
return [swagger.ApiProperty(apiPropertyOptions), ...buildResponseDecorators(properties), ...buildRequestDecorators(properties), ...buildFormatDecorators(properties), ...buildTransformDecorators(properties)];
|
|
137
136
|
}
|
|
138
137
|
/**
|
|
139
138
|
* Builds decorators for format validation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.decorator.js","sources":["../../../../../../src/decorator/api/property/boolean.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","RegisterManualDtoPropertyMetadata","EManualDtoPropertyMetadataDecorator","applyDecorators","ApplyAutoDtoResponseExposure","EApiPropertyDataType","ApiProperty","IsBoolean","ValidateIf","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","ErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDG;AACG,SAAU,kBAAkB,CAAC,UAAsC,EAAA;AACxE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7DA,6DAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,cAAqD,KAAI;YAC7H,MAAM,oBAAoB,GAA+B,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE;YAElG,eAAe,CAAC,oBAAoB,CAAC;AACrC,YAAAC,0DAAiC,CAAC,MAAM,EAAE,WAAW,EAAE;AACtD,gBAAA,KAAK,EAAE,kBAAkB,CAAC,oBAAoB,CAAC;gBAC/C,SAAS,EAAEC,kDAAmC,CAAC,OAAO;AACtD,gBAAA,UAAU,EAAE,oBAAoB;AAChC,aAAA,CAAC;AAEF,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,oBAAoB,CAAC;YAC5F,MAAM,UAAU,GAA6B,eAAe,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAEtGC,sBAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;AACnD,YAAAC,iEAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,oBAAoB,CAAC;AACxE,QAAA,CAAC,CAAC;AACH,IAAA,CAAC;AACF;AAEA;;;;;AAKG;AACH,SAAS,uBAAuB,CAAC,UAAsC,EAAA;AACtE,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAA,EAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,CAAA,CAAE;;AAEhF,QAAA,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"boolean.decorator.js","sources":["../../../../../../src/decorator/api/property/boolean.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","RegisterManualDtoPropertyMetadata","EManualDtoPropertyMetadataDecorator","applyDecorators","ApplyAutoDtoResponseExposure","EApiPropertyDataType","ApiProperty","IsBoolean","ValidateIf","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","ErrorException"],"mappings":";;;;;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
|
|
@@ -14,7 +14,7 @@ import { TApiPropertyDateProperties } from '../../../type/decorator/api/property
|
|
|
14
14
|
* The decorator provides appropriate examples and validation patterns based on the format,
|
|
15
15
|
* and handles string-to-Date transformation for request DTOs.
|
|
16
16
|
* @param {TApiPropertyDateProperties} properties - Configuration options for the date property
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
18
18
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-date | API Reference - ApiPropertyDate}
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
@@ -43,7 +43,7 @@ var classValidator = require('class-validator');
|
|
|
43
43
|
* The decorator provides appropriate examples and validation patterns based on the format,
|
|
44
44
|
* and handles string-to-Date transformation for request DTOs.
|
|
45
45
|
* @param {TApiPropertyDateProperties} properties - Configuration options for the date property
|
|
46
|
-
* @returns {
|
|
46
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
47
47
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-date | API Reference - ApiPropertyDate}
|
|
48
48
|
* @example
|
|
49
49
|
* ```typescript
|
|
@@ -113,9 +113,10 @@ function buildApiPropertyOptions(properties) {
|
|
|
113
113
|
description: `${String(properties.entity.name)} ${getDescription(properties.identifier)}`,
|
|
114
114
|
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
115
115
|
nullable: !!properties.isNullable,
|
|
116
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
117
|
+
required: properties.isRequired,
|
|
116
118
|
type: dataType_enum.EApiPropertyDataType.STRING,
|
|
117
119
|
};
|
|
118
|
-
apiPropertyOptions.required = properties.isRequired;
|
|
119
120
|
if (properties.isArray) {
|
|
120
121
|
apiPropertyOptions.isArray = true;
|
|
121
122
|
apiPropertyOptions.minItems = properties.minItems;
|
|
@@ -144,9 +145,7 @@ function buildApiPropertyOptions(properties) {
|
|
|
144
145
|
* @private
|
|
145
146
|
*/
|
|
146
147
|
function buildDecorators(properties, apiPropertyOptions) {
|
|
147
|
-
|
|
148
|
-
decorators.push(...buildResponseDecorators(properties), ...buildRequestDecorators(properties), ...buildFormatDecorators(properties), ...buildTransformDecorators(properties));
|
|
149
|
-
return decorators;
|
|
148
|
+
return [swagger.ApiProperty(apiPropertyOptions), ...buildResponseDecorators(properties), ...buildRequestDecorators(properties), ...buildFormatDecorators(properties), ...buildTransformDecorators(properties)];
|
|
150
149
|
}
|
|
151
150
|
/**
|
|
152
151
|
* Builds decorators for date format validation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.decorator.js","sources":["../../../../../../src/decorator/api/property/date.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","RegisterManualDtoPropertyMetadata","EManualDtoPropertyMetadataDecorator","applyDecorators","ApplyAutoDtoResponseExposure","EApiPropertyDataType","ApiProperty","IsDate","ValidateIf","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","EApiPropertyDateIdentifier","EApiPropertyDateType","ErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7DA,6DAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,cAAqD,KAAI;YAC1H,MAAM,oBAAoB,GAA+B,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE;YAElG,eAAe,CAAC,oBAAoB,CAAC;AACrC,YAAAC,0DAAiC,CAAC,MAAM,EAAE,WAAW,EAAE;AACtD,gBAAA,KAAK,EAAE,eAAe,CAAC,oBAAoB,CAAC;gBAC5C,SAAS,EAAEC,kDAAmC,CAAC,IAAI;AACnD,gBAAA,UAAU,EAAE,oBAAoB;AAChC,aAAA,CAAC;AAEF,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,oBAAoB,CAAC;YAC5F,MAAM,UAAU,GAA6B,eAAe,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAEtGC,sBAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;AACnD,YAAAC,iEAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,oBAAoB,CAAC;AACxE,QAAA,CAAC,CAAC;AACH,IAAA,CAAC;AACF;AAEA;;;;;AAKG;AACH,SAAS,uBAAuB,CAAC,UAAsC,EAAA;IACtE,MAAM,OAAO,GAAW,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;AAErD,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAA,EAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA,CAAE;;AAEzF,QAAA,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"date.decorator.js","sources":["../../../../../../src/decorator/api/property/date.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","RegisterManualDtoPropertyMetadata","EManualDtoPropertyMetadataDecorator","applyDecorators","ApplyAutoDtoResponseExposure","EApiPropertyDataType","ApiProperty","IsDate","ValidateIf","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","EApiPropertyDateIdentifier","EApiPropertyDateType","ErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,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,EAAE;QAChC,IAAI,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AAC9C,YAAA,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC;QACrD;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;QAEA,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;QAC/E;IACD;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,MAAMC,gCAAc,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACpE;AACD;;;;"}
|
|
@@ -15,7 +15,7 @@ import { TApiPropertyEnumProperties } from '../../../type/decorator/api/property
|
|
|
15
15
|
* The decorator provides proper validation and documentation of enum values, ensuring
|
|
16
16
|
* that only valid options are accepted in requests and properly documented in the API.
|
|
17
17
|
* @param {TApiPropertyEnumProperties} properties - Configuration options for the enum property
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
19
19
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-enum | API Reference - ApiPropertyEnum}
|
|
20
20
|
* @example
|
|
21
21
|
* ```typescript
|
|
@@ -26,7 +26,7 @@ var classValidator = require('class-validator');
|
|
|
26
26
|
* The decorator provides proper validation and documentation of enum values, ensuring
|
|
27
27
|
* that only valid options are accepted in requests and properly documented in the API.
|
|
28
28
|
* @param {TApiPropertyEnumProperties} properties - Configuration options for the enum property
|
|
29
|
-
* @returns {
|
|
29
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
30
30
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-enum | API Reference - ApiPropertyEnum}
|
|
31
31
|
* @example
|
|
32
32
|
* ```typescript
|
|
@@ -113,8 +113,9 @@ function buildApiPropertyOptions(properties) {
|
|
|
113
113
|
description: `${String(properties.entity.name)} ${properties.description ?? ""}`,
|
|
114
114
|
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
115
115
|
nullable: !!properties.isNullable,
|
|
116
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
117
|
+
required: properties.isRequired,
|
|
116
118
|
};
|
|
117
|
-
apiPropertyOptions.required = properties.isRequired;
|
|
118
119
|
if (properties.isArray === true) {
|
|
119
120
|
apiPropertyOptions.isArray = true;
|
|
120
121
|
apiPropertyOptions.minItems = properties.minItems;
|
|
@@ -144,9 +145,7 @@ function buildApiPropertyOptions(properties) {
|
|
|
144
145
|
* @private
|
|
145
146
|
*/
|
|
146
147
|
function buildDecorators(properties, apiPropertyOptions) {
|
|
147
|
-
|
|
148
|
-
decorators.push(...buildResponseDecorators(properties), ...buildRequestDecorators(properties), ...buildFormatDecorators(properties));
|
|
149
|
-
return decorators;
|
|
148
|
+
return [swagger.ApiProperty(apiPropertyOptions), ...buildResponseDecorators(properties), ...buildRequestDecorators(properties), ...buildFormatDecorators(properties)];
|
|
150
149
|
}
|
|
151
150
|
/**
|
|
152
151
|
* Builds decorators for enum validation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.decorator.js","sources":["../../../../../../src/decorator/api/property/enum.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","RegisterManualDtoPropertyMetadata","EManualDtoPropertyMetadataDecorator","applyDecorators","ApplyAutoDtoResponseExposure","ApiProperty","IsEnum","ValidateIf","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","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3,"file":"enum.decorator.js","sources":["../../../../../../src/decorator/api/property/enum.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","RegisterManualDtoPropertyMetadata","EManualDtoPropertyMetadataDecorator","applyDecorators","ApplyAutoDtoResponseExposure","ApiProperty","IsEnum","ValidateIf","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","ErrorException"],"mappings":";;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7DA,6DAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,cAAqD,KAAI;YAC1H,MAAM,oBAAoB,GAA+B,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE;YAElG,eAAe,CAAC,oBAAoB,CAAC;AACrC,YAAAC,0DAAiC,CAAC,MAAM,EAAE,WAAW,EAAE;AACtD,gBAAA,KAAK,EAAE,eAAe,CAAC,oBAAoB,CAAC;gBAC5C,SAAS,EAAEC,kDAAmC,CAAC,IAAI;AACnD,gBAAA,UAAU,EAAE,oBAAoB;AAChC,aAAA,CAAC;AAEF,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,oBAAoB,CAAC;YAC5F,MAAM,UAAU,GAA6B,eAAe,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAEtGC,sBAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;AACnD,YAAAC,iEAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,oBAAoB,CAAC;AACxE,QAAA,CAAC,CAAC;AACH,IAAA,CAAC;AACF;AAEA;;;;;AAKG;AACH,SAAS,uBAAuB,CAAC,UAAsC,EAAA;AACtE,IAA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IAAI,CAAC,uCAAuC,CAAC;QACrD;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;QAEA,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;QAC/E;IACD;IAEA,IAAI,UAAU,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;AACjG,QAAA,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC;IAC/C;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,MAAMC,gCAAc,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACpE;AACD;;;;"}
|
|
@@ -15,7 +15,7 @@ import { TApiPropertyNumberProperties } from '../../../type/decorator/api/proper
|
|
|
15
15
|
* The decorator can automatically generate an example value within the specified range
|
|
16
16
|
* if one is not provided, and applies appropriate validation rules based on the configuration.
|
|
17
17
|
* @param {TApiPropertyNumberProperties} properties - Configuration options for the number property
|
|
18
|
-
* @returns {
|
|
18
|
+
* @returns {PropertyDecorator} A decorator function that can be applied to a class property
|
|
19
19
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-number | API Reference - ApiPropertyNumber}
|
|
20
20
|
* @example
|
|
21
21
|
* ```typescript
|