@elsikora/nestjs-crud-automator 1.2.0 → 1.2.2
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/dist/class/api/base-service.class.d.ts +5 -5
- package/dist/class/api/base-service.class.js +19 -10
- package/dist/class/api/base-service.class.js.map +1 -1
- package/dist/class/api/index.d.ts +0 -1
- package/dist/class/api/index.js +0 -1
- package/dist/class/api/index.js.map +1 -1
- package/dist/class/index.d.ts +1 -0
- package/dist/class/index.js +1 -0
- package/dist/class/index.js.map +1 -1
- package/dist/class/utility/dto/index.d.ts +2 -0
- package/dist/{decorator/api/route → class/utility/dto}/index.js +2 -2
- package/dist/class/utility/dto/index.js.map +1 -0
- package/dist/class/utility/dto/property/factory/boolean.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/boolean.class.js +15 -0
- package/dist/class/utility/dto/property/factory/boolean.class.js.map +1 -0
- package/dist/class/utility/dto/property/factory/date.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/date.class.js +15 -0
- package/dist/class/utility/dto/property/factory/date.class.js.map +1 -0
- package/dist/class/utility/dto/property/factory/index.d.ts +6 -0
- package/dist/{dto/exception → class/utility/dto/property/factory}/index.js +6 -7
- package/dist/class/utility/dto/property/factory/index.js.map +1 -0
- package/dist/class/utility/dto/property/factory/number.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/number.class.js +19 -0
- package/dist/class/utility/dto/property/factory/number.class.js.map +1 -0
- package/dist/class/utility/dto/property/factory/object.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/object.class.js +17 -0
- package/dist/class/utility/dto/property/factory/object.class.js.map +1 -0
- package/dist/class/utility/dto/property/factory/relation.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/relation.class.js +11 -0
- package/dist/class/utility/dto/property/factory/relation.class.js.map +1 -0
- package/dist/class/utility/dto/property/factory/string.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/string.class.js +15 -0
- package/dist/class/utility/dto/property/factory/string.class.js.map +1 -0
- package/dist/class/utility/dto/property/factory/uuid.class.d.ts +5 -0
- package/dist/class/utility/dto/property/factory/uuid.class.js +11 -0
- package/dist/class/utility/dto/property/factory/uuid.class.js.map +1 -0
- package/dist/class/utility/dto/property/index.d.ts +1 -0
- package/dist/{dto → class/utility/dto/property}/index.js +1 -1
- package/dist/class/utility/dto/property/index.js.map +1 -0
- package/dist/class/utility/dto/strategy/body.class.d.ts +6 -0
- package/dist/class/utility/dto/strategy/body.class.js +21 -0
- package/dist/class/utility/dto/strategy/body.class.js.map +1 -0
- package/dist/class/utility/dto/strategy/index.d.ts +4 -0
- package/dist/class/utility/dto/strategy/index.js +21 -0
- package/dist/class/utility/dto/strategy/index.js.map +1 -0
- package/dist/class/utility/dto/strategy/query.class.d.ts +6 -0
- package/dist/class/utility/dto/strategy/query.class.js +18 -0
- package/dist/class/utility/dto/strategy/query.class.js.map +1 -0
- package/dist/class/utility/dto/strategy/request.class.d.ts +6 -0
- package/dist/class/utility/dto/strategy/request.class.js +26 -0
- package/dist/class/utility/dto/strategy/request.class.js.map +1 -0
- package/dist/class/utility/dto/strategy/response.class.d.ts +6 -0
- package/dist/class/utility/dto/strategy/response.class.js +18 -0
- package/dist/class/utility/dto/strategy/response.class.js.map +1 -0
- package/dist/class/utility/index.d.ts +1 -0
- package/dist/class/utility/index.js +18 -0
- package/dist/class/utility/index.js.map +1 -0
- package/dist/constant/decorator/api/controller.constant.d.ts +1 -1
- package/dist/constant/decorator/api/controller.constant.js +2 -2
- package/dist/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/constant/decorator/api/function.constant.d.ts +1 -1
- package/dist/constant/decorator/api/function.constant.js +2 -2
- package/dist/constant/decorator/api/function.constant.js.map +1 -1
- package/dist/constant/decorator/api/property-describe.constant.d.ts +1 -1
- package/dist/constant/decorator/api/property-describe.constant.js +2 -2
- package/dist/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/constant/factory/dto/get-list-query.constant.d.ts +1 -2
- package/dist/constant/factory/dto/get-list-query.constant.js +2 -2
- package/dist/constant/factory/dto/get-list-query.constant.js.map +1 -1
- package/dist/constant/interface/api/filter.constant.d.ts +1 -1
- package/dist/constant/interface/api/filter.constant.js +2 -2
- package/dist/constant/interface/api/filter.constant.js.map +1 -1
- package/dist/constant/interface/api/index.d.ts +1 -0
- package/dist/constant/interface/api/index.js +1 -0
- package/dist/constant/interface/api/index.js.map +1 -1
- package/dist/constant/interface/api/property/string.constant.d.ts +1 -1
- package/dist/constant/interface/api/property/string.constant.js +2 -2
- package/dist/constant/interface/api/property/string.constant.js.map +1 -1
- package/dist/constant/interface/api/property/wallet.constant.d.ts +1 -1
- package/dist/constant/interface/api/property/wallet.constant.js +2 -2
- package/dist/constant/interface/api/property/wallet.constant.js.map +1 -1
- package/dist/constant/utility/dto/constant.d.ts +6 -0
- package/dist/constant/utility/dto/constant.js +27 -0
- package/dist/constant/utility/dto/constant.js.map +1 -0
- package/dist/decorator/api/controller.decorator.d.ts +3 -7
- package/dist/decorator/api/controller.decorator.js +2 -2
- package/dist/decorator/api/controller.decorator.js.map +1 -1
- package/dist/decorator/api/function/create.decorator.d.ts +2 -4
- package/dist/decorator/api/function/create.decorator.js +25 -17
- package/dist/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/decorator/api/function/decorator.d.ts +3 -7
- package/dist/decorator/api/function/decorator.js +20 -16
- package/dist/decorator/api/function/decorator.js.map +1 -1
- package/dist/decorator/api/function/delete.decorator.d.ts +3 -3
- package/dist/decorator/api/function/delete.decorator.js +6 -6
- package/dist/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/decorator/api/function/get-list.decorator.d.ts +3 -3
- package/dist/decorator/api/function/get-list.decorator.js +9 -8
- package/dist/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/decorator/api/function/get.decorator.d.ts +3 -3
- package/dist/decorator/api/function/get.decorator.js +8 -9
- package/dist/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/decorator/api/function/update.decorator.d.ts +3 -3
- package/dist/decorator/api/function/update.decorator.js +10 -14
- package/dist/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/decorator/api/index.d.ts +0 -1
- package/dist/decorator/api/index.js +0 -1
- package/dist/decorator/api/index.js.map +1 -1
- package/dist/decorator/api/method.decorator.js +58 -0
- package/dist/decorator/api/method.decorator.js.map +1 -1
- package/dist/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/decorator/api/property/describe.decorator.js +1 -1
- package/dist/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/decorator/api/property/string.decorator.js +13 -6
- package/dist/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/decorator/api/property/wallet.decorator.js +3 -3
- package/dist/decorator/api/property/wallet.decorator.js.map +1 -1
- package/dist/decorator/api/service.decorator.d.ts +3 -6
- package/dist/decorator/api/service.decorator.js +23 -49
- package/dist/decorator/api/service.decorator.js.map +1 -1
- package/dist/enum/decorator/api/authentication-type.enum.d.ts +1 -0
- package/dist/enum/decorator/api/authentication-type.enum.js +1 -0
- package/dist/enum/decorator/api/authentication-type.enum.js.map +1 -1
- package/dist/enum/decorator/api/dto-type.enum.d.ts +3 -3
- package/dist/enum/decorator/api/dto-type.enum.js +2 -2
- package/dist/enum/decorator/api/dto-type.enum.js.map +1 -1
- package/dist/enum/decorator/api/property/desribe-type.enum.d.ts +2 -1
- package/dist/enum/decorator/api/property/desribe-type.enum.js +1 -0
- package/dist/enum/decorator/api/property/desribe-type.enum.js.map +1 -1
- package/dist/factory/api/controller.factory.d.ts +8 -8
- package/dist/factory/api/controller.factory.js +89 -55
- package/dist/factory/api/controller.factory.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/interceptor/correlation-id-response-body.interceptor.js +0 -8
- package/dist/interceptor/correlation-id-response-body.interceptor.js.map +1 -1
- package/dist/interface/class/dto/index.d.ts +1 -0
- package/dist/interface/class/dto/index.js +18 -0
- package/dist/interface/class/dto/index.js.map +1 -0
- package/dist/interface/class/dto/strategy.interface.d.ts +5 -0
- package/dist/{type/decorator/api/function/get-properties.type.js → interface/class/dto/strategy.interface.js} +1 -1
- package/dist/interface/class/dto/strategy.interface.js.map +1 -0
- package/dist/interface/class/index.d.ts +1 -0
- package/dist/interface/class/index.js +18 -0
- package/dist/interface/class/index.js.map +1 -0
- package/dist/interface/decorator/api/controller-properties.interface.d.ts +12 -7
- package/dist/interface/decorator/api/controller-properties.interface.js.map +1 -1
- package/dist/interface/decorator/api/function/create-properties.interface.d.ts +4 -0
- package/dist/interface/decorator/api/function/create-properties.interface.js +3 -0
- package/dist/interface/decorator/api/function/create-properties.interface.js.map +1 -0
- package/dist/interface/decorator/api/index.d.ts +1 -0
- package/dist/interface/decorator/api/index.js +1 -0
- package/dist/interface/decorator/api/index.js.map +1 -1
- package/dist/interface/decorator/api/method/properties.interface.d.ts +3 -2
- package/dist/interface/decorator/api/method/properties.interface.js.map +1 -1
- package/dist/interface/decorator/api/property/base-properties.interface.d.ts +1 -1
- package/dist/interface/decorator/api/property/base-properties.interface.js.map +1 -1
- package/dist/interface/dto-generate-factory.interface.d.ts +5 -0
- package/dist/interface/dto-generate-factory.interface.js +3 -0
- package/dist/interface/dto-generate-factory.interface.js.map +1 -0
- package/dist/interface/index.d.ts +2 -0
- package/dist/interface/index.js +2 -0
- package/dist/interface/index.js.map +1 -1
- package/dist/interface/utility/get-entity-columns-properties.interface.d.ts +5 -0
- package/dist/interface/utility/get-entity-columns-properties.interface.js +3 -0
- package/dist/interface/utility/get-entity-columns-properties.interface.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/type/decorator/api/controller/constructor.type.d.ts +4 -0
- package/dist/type/decorator/api/{function/create-properties.type.js → controller/constructor.type.js} +1 -1
- package/dist/type/decorator/api/controller/constructor.type.js.map +1 -0
- package/dist/type/decorator/api/controller/index.d.ts +1 -0
- package/dist/type/decorator/api/controller/index.js +18 -0
- package/dist/type/decorator/api/controller/index.js.map +1 -0
- package/dist/type/decorator/api/function/create/executor-properties.type.d.ts +8 -0
- package/dist/type/decorator/api/function/create/executor-properties.type.js +3 -0
- package/dist/type/decorator/api/function/create/executor-properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/create/index.d.ts +2 -0
- package/dist/type/decorator/api/function/create/index.js +19 -0
- package/dist/type/decorator/api/function/create/index.js.map +1 -0
- package/dist/type/decorator/api/function/{update-properties.type.js → create/properties.type.js} +1 -1
- package/dist/type/decorator/api/function/create/properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/delete/executor-properties.type.d.ts +9 -0
- package/dist/type/decorator/api/function/delete/executor-properties.type.js +3 -0
- package/dist/type/decorator/api/function/delete/executor-properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/delete/index.d.ts +1 -0
- package/dist/type/decorator/api/function/delete/index.js +18 -0
- package/dist/type/decorator/api/function/delete/index.js.map +1 -0
- package/dist/type/decorator/api/function/get/executor-properties.type.d.ts +7 -0
- package/dist/type/decorator/api/function/get/executor-properties.type.js +3 -0
- package/dist/type/decorator/api/function/get/executor-properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/get/index.d.ts +2 -0
- package/dist/type/decorator/api/function/get/index.js +19 -0
- package/dist/type/decorator/api/function/get/index.js.map +1 -0
- package/dist/type/decorator/api/function/get/properties.type.js +3 -0
- package/dist/type/decorator/api/function/get/properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/get-list/base-properties.type.d.ts +16 -0
- package/dist/type/decorator/api/function/get-list/base-properties.type.js +3 -0
- package/dist/type/decorator/api/function/get-list/base-properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/get-list/executor-properties.type.d.ts +9 -0
- package/dist/type/decorator/api/function/get-list/executor-properties.type.js +3 -0
- package/dist/type/decorator/api/function/get-list/executor-properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/get-list/index.d.ts +3 -0
- package/dist/type/decorator/api/function/get-list/index.js +20 -0
- package/dist/type/decorator/api/function/get-list/index.js.map +1 -0
- package/dist/type/decorator/api/function/get-list/properties.type.d.ts +9 -0
- package/dist/type/decorator/api/function/get-list/properties.type.js +3 -0
- package/dist/type/decorator/api/function/get-list/properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/index.d.ts +5 -4
- package/dist/type/decorator/api/function/index.js +5 -4
- package/dist/type/decorator/api/function/index.js.map +1 -1
- package/dist/type/decorator/api/function/properties.type.d.ts +7 -0
- package/dist/type/decorator/api/function/properties.type.js +3 -0
- package/dist/type/decorator/api/function/properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/update/executor-properties.type.d.ts +11 -0
- package/dist/type/decorator/api/function/update/executor-properties.type.js +3 -0
- package/dist/type/decorator/api/function/update/executor-properties.type.js.map +1 -0
- package/dist/type/decorator/api/function/update/index.d.ts +2 -0
- package/dist/type/decorator/api/function/update/index.js +19 -0
- package/dist/type/decorator/api/function/update/index.js.map +1 -0
- package/dist/type/decorator/api/function/update/properties.type.js +3 -0
- package/dist/type/decorator/api/function/update/properties.type.js.map +1 -0
- package/dist/type/decorator/api/index.d.ts +1 -0
- package/dist/type/decorator/api/index.js +1 -0
- package/dist/type/decorator/api/index.js.map +1 -1
- package/dist/type/decorator/api/property/describe/array/index.d.ts +2 -0
- package/dist/type/decorator/api/property/describe/array/index.js +19 -0
- package/dist/type/decorator/api/property/describe/array/index.js.map +1 -0
- package/dist/type/decorator/api/property/describe/array/optional-properties.type.d.ts +3 -0
- package/dist/type/decorator/api/property/describe/array/optional-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/array/optional-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/array/required-properties.type.d.ts +6 -0
- package/dist/type/decorator/api/property/describe/array/required-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/array/required-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/base-properties.type.d.ts +7 -0
- package/dist/type/decorator/api/property/describe/base-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/base-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/boolean-properties.type.d.ts +7 -0
- package/dist/type/decorator/api/property/describe/boolean-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/boolean-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/date-properties.type.d.ts +7 -0
- package/dist/type/decorator/api/property/describe/date-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/date-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/body-properties.type.d.ts +5 -0
- package/dist/type/decorator/api/property/describe/dto/body-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/dto/body-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/index.d.ts +5 -0
- package/dist/type/decorator/api/property/describe/dto/index.js +22 -0
- package/dist/type/decorator/api/property/describe/dto/index.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/properties.type.d.ts +6 -0
- package/dist/type/decorator/api/property/describe/dto/properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/dto/properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.d.ts +3 -0
- package/dist/type/decorator/api/property/describe/dto/query/get-list-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/query/index.d.ts +2 -0
- package/dist/type/decorator/api/property/describe/dto/query/index.js +19 -0
- package/dist/type/decorator/api/property/describe/dto/query/index.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/query/properties.type.d.ts +6 -0
- package/dist/type/decorator/api/property/describe/dto/query/properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/dto/query/properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/request-properties.type.d.ts +5 -0
- package/dist/type/decorator/api/property/describe/dto/request-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/dto/request-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/dto/response-properties.type.d.ts +5 -0
- package/dist/type/decorator/api/property/describe/dto/response-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/dto/response-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/example-properties.type.d.ts +7 -0
- package/dist/type/decorator/api/property/describe/example-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/example-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/index.d.ts +12 -0
- package/dist/type/decorator/api/property/describe/index.js +29 -0
- package/dist/type/decorator/api/property/describe/index.js.map +1 -0
- package/dist/type/decorator/api/property/describe/number-properties.type.d.ts +13 -0
- package/dist/type/decorator/api/property/describe/number-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/number-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/object-properties.type.d.ts +10 -0
- package/dist/type/decorator/api/property/describe/object-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/object-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.d.ts +2 -0
- package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/properties/base-dto-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/properties/base-properties.type.d.ts +10 -0
- package/dist/type/decorator/api/property/describe/properties/base-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/properties/base-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/properties/index.d.ts +2 -0
- package/dist/type/decorator/api/property/describe/properties/index.js +19 -0
- package/dist/type/decorator/api/property/describe/properties/index.js.map +1 -0
- package/dist/type/decorator/api/property/describe/properties.type.d.ts +8 -0
- package/dist/type/decorator/api/property/describe/properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/relation-properties.type.d.ts +6 -0
- package/dist/type/decorator/api/property/describe/relation-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/relation-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/string-properties.type.d.ts +13 -0
- package/dist/type/decorator/api/property/describe/string-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/string-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/describe/uuid-properties.type.d.ts +7 -0
- package/dist/type/decorator/api/property/describe/uuid-properties.type.js +3 -0
- package/dist/type/decorator/api/property/describe/uuid-properties.type.js.map +1 -0
- package/dist/type/decorator/api/property/index.d.ts +1 -1
- package/dist/type/decorator/api/property/index.js +1 -1
- package/dist/type/decorator/api/property/index.js.map +1 -1
- package/dist/type/decorator/api/service-properties.type.d.ts +3 -0
- package/dist/type/decorator/api/service-properties.type.js +3 -0
- package/dist/type/decorator/api/service-properties.type.js.map +1 -0
- package/dist/type/index.d.ts +1 -0
- package/dist/type/index.js +1 -0
- package/dist/type/index.js.map +1 -1
- package/dist/type/utility/dto/generate-allowed-combination.type.d.ts +9 -0
- package/dist/type/utility/dto/generate-allowed-combination.type.js +3 -0
- package/dist/type/utility/dto/generate-allowed-combination.type.js.map +1 -0
- package/dist/type/utility/dto/generate-is-allowed-combination.type.d.ts +3 -0
- package/dist/type/utility/dto/generate-is-allowed-combination.type.js +3 -0
- package/dist/type/utility/dto/generate-is-allowed-combination.type.js.map +1 -0
- package/dist/type/utility/dto/index.d.ts +2 -0
- package/dist/type/utility/dto/index.js +19 -0
- package/dist/type/utility/dto/index.js.map +1 -0
- package/dist/type/utility/index.d.ts +1 -0
- package/dist/type/utility/index.js +18 -0
- package/dist/type/utility/index.js.map +1 -0
- package/dist/utility/api/controller/get-method-name.utility.d.ts +1 -1
- package/dist/utility/api/controller/get-method-name.utility.js +1 -1
- package/dist/utility/api/controller/get-method-name.utility.js.map +1 -1
- package/dist/utility/api/controller/write-method.utility.d.ts +3 -3
- package/dist/utility/api/controller/write-method.utility.js +2 -2
- package/dist/utility/api/controller/write-method.utility.js.map +1 -1
- package/dist/utility/api/filter-order-by-from-entity.utility.d.ts +4 -2
- package/dist/utility/api/filter-order-by-from-entity.utility.js +17 -14
- package/dist/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/utility/dto/analize.utility.js.map +1 -1
- package/dist/utility/dto/build-decorator.utility.d.ts +4 -0
- package/dist/utility/dto/build-decorator.utility.js +31 -0
- package/dist/utility/dto/build-decorator.utility.js.map +1 -0
- package/dist/utility/dto/generate-decorator.utility.d.ts +3 -0
- package/dist/utility/dto/generate-decorator.utility.js +15 -0
- package/dist/utility/dto/generate-decorator.utility.js.map +1 -0
- package/dist/utility/dto/generate-exception.utility.d.ts +2 -0
- package/dist/utility/dto/generate-exception.utility.js +88 -0
- package/dist/utility/dto/generate-exception.utility.js.map +1 -0
- package/dist/utility/dto/generate.utility.d.ts +2 -2
- package/dist/utility/dto/generate.utility.js +51 -308
- package/dist/utility/dto/generate.utility.js.map +1 -1
- package/dist/utility/dto/get-base-class.utility.d.ts +3 -0
- package/dist/utility/dto/get-base-class.utility.js +65 -0
- package/dist/utility/dto/get-base-class.utility.js.map +1 -0
- package/dist/utility/dto/get-decorator-config.utility.d.ts +3 -0
- package/dist/utility/dto/get-decorator-config.utility.js +21 -0
- package/dist/utility/dto/get-decorator-config.utility.js.map +1 -0
- package/dist/utility/dto/handle-date-property.utility.d.ts +5 -0
- package/dist/utility/dto/handle-date-property.utility.js +18 -0
- package/dist/utility/dto/handle-date-property.utility.js.map +1 -0
- package/dist/utility/dto/index.d.ts +8 -0
- package/dist/utility/dto/index.js +8 -0
- package/dist/utility/dto/index.js.map +1 -1
- package/dist/utility/dto/is-property-should-be-enabled.utility.d.ts +3 -0
- package/dist/utility/dto/is-property-should-be-enabled.utility.js +26 -0
- package/dist/utility/dto/is-property-should-be-enabled.utility.js.map +1 -0
- package/dist/utility/dto/is-should-be-generated.utility.d.ts +2 -0
- package/dist/utility/dto/is-should-be-generated.utility.js +25 -0
- package/dist/utility/dto/is-should-be-generated.utility.js.map +1 -0
- package/dist/utility/dto/validate-property-config.utility.d.ts +2 -0
- package/dist/utility/dto/validate-property-config.utility.js +14 -0
- package/dist/utility/dto/validate-property-config.utility.js.map +1 -0
- package/dist/utility/generate-entity-information.utility.js +15 -6
- package/dist/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/utility/get-entity-columns.utility.d.ts +3 -2
- package/dist/utility/get-entity-columns.utility.js +4 -3
- package/dist/utility/get-entity-columns.utility.js.map +1 -1
- package/package.json +4 -1
- package/dist/class/api/base-controller.class.d.ts +0 -4
- package/dist/class/api/base-controller.class.js +0 -10
- package/dist/class/api/base-controller.class.js.map +0 -1
- package/dist/decorator/api/route/decorator.d.ts +0 -18
- package/dist/decorator/api/route/decorator.js +0 -43
- package/dist/decorator/api/route/decorator.js.map +0 -1
- package/dist/decorator/api/route/get.decorator.d.ts +0 -9
- package/dist/decorator/api/route/get.decorator.js +0 -53
- package/dist/decorator/api/route/get.decorator.js.map +0 -1
- package/dist/decorator/api/route/index.d.ts +0 -2
- package/dist/decorator/api/route/index.js.map +0 -1
- package/dist/dto/exception/bad-request.dto.d.ts +0 -8
- package/dist/dto/exception/bad-request.dto.js +0 -84
- package/dist/dto/exception/bad-request.dto.js.map +0 -1
- package/dist/dto/exception/conflict.dto.d.ts +0 -8
- package/dist/dto/exception/conflict.dto.js +0 -84
- package/dist/dto/exception/conflict.dto.js.map +0 -1
- package/dist/dto/exception/forbidden.dto.d.ts +0 -8
- package/dist/dto/exception/forbidden.dto.js +0 -84
- package/dist/dto/exception/forbidden.dto.js.map +0 -1
- package/dist/dto/exception/index.d.ts +0 -7
- package/dist/dto/exception/index.js.map +0 -1
- package/dist/dto/exception/internal-server-error.dto.d.ts +0 -8
- package/dist/dto/exception/internal-server-error.dto.js +0 -84
- package/dist/dto/exception/internal-server-error.dto.js.map +0 -1
- package/dist/dto/exception/not-found.dto.d.ts +0 -8
- package/dist/dto/exception/not-found.dto.js +0 -84
- package/dist/dto/exception/not-found.dto.js.map +0 -1
- package/dist/dto/exception/too-many-requests.dto.d.ts +0 -8
- package/dist/dto/exception/too-many-requests.dto.js +0 -84
- package/dist/dto/exception/too-many-requests.dto.js.map +0 -1
- package/dist/dto/exception/unauthorized.dto.d.ts +0 -8
- package/dist/dto/exception/unauthorized.dto.js +0 -84
- package/dist/dto/exception/unauthorized.dto.js.map +0 -1
- package/dist/dto/index.d.ts +0 -1
- package/dist/dto/index.js.map +0 -1
- package/dist/type/decorator/api/function/create-properties.type.js.map +0 -1
- package/dist/type/decorator/api/function/get-list-properties.type.d.ts +0 -23
- package/dist/type/decorator/api/function/get-list-properties.type.js.map +0 -1
- package/dist/type/decorator/api/function/get-properties.type.js.map +0 -1
- package/dist/type/decorator/api/function/update-properties.type.js.map +0 -1
- package/dist/type/decorator/api/property/describe-properties.type.d.ts +0 -64
- package/dist/type/decorator/api/property/describe-properties.type.js +0 -3
- package/dist/type/decorator/api/property/describe-properties.type.js.map +0 -1
- /package/dist/type/decorator/api/function/{create-properties.type.d.ts → create/properties.type.d.ts} +0 -0
- /package/dist/type/decorator/api/function/{get-properties.type.d.ts → get/properties.type.d.ts} +0 -0
- /package/dist/type/decorator/api/function/{update-properties.type.d.ts → update/properties.type.d.ts} +0 -0
- /package/dist/type/decorator/api/{function → property/describe/dto/query}/get-list-properties.type.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.constant.js","sourceRoot":"/","sources":["constant/decorator/api/controller.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,eAAe,CAAC;AAE1C,QAAA,iCAAiC,GAE1C;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const RESERVED_METHOD_PREFIX: string = \"apiController\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"controller.constant.js","sourceRoot":"/","sources":["constant/decorator/api/controller.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,eAAe,CAAC;AAE1C,QAAA,iCAAiC,GAE1C;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const RESERVED_METHOD_PREFIX: string = \"apiController\";\n\nexport const CONTROLLER_API_DECORATOR_CONSTANT: {\n\treadonly RESERVED_METHOD_PREFIX: string;\n} = {\n\tRESERVED_METHOD_PREFIX,\n} as const;\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FUNCTION_API_DECORATOR_CONSTANT = void 0;
|
|
4
4
|
const enum_1 = require("../../../enum");
|
|
5
5
|
const DEFAULT_FILTER_ORDER_BY_DIRECTION = enum_1.EFilterOrderDirection.ASC;
|
|
6
|
-
exports.
|
|
6
|
+
exports.FUNCTION_API_DECORATOR_CONSTANT = {
|
|
7
7
|
DEFAULT_FILTER_ORDER_BY_DIRECTION,
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=function.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.constant.js","sourceRoot":"/","sources":["constant/decorator/api/function.constant.ts"],"names":[],"mappings":";;;AAAA,wCAAsD;AAEtD,MAAM,iCAAiC,GAA0B,4BAAqB,CAAC,GAAG,CAAC;AAE9E,QAAA,+BAA+B,GAExC;IACH,iCAAiC;CACxB,CAAC","sourcesContent":["import { EFilterOrderDirection } from \"../../../enum\";\n\nconst DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection = EFilterOrderDirection.ASC;\n\nexport const
|
|
1
|
+
{"version":3,"file":"function.constant.js","sourceRoot":"/","sources":["constant/decorator/api/function.constant.ts"],"names":[],"mappings":";;;AAAA,wCAAsD;AAEtD,MAAM,iCAAiC,GAA0B,4BAAqB,CAAC,GAAG,CAAC;AAE9E,QAAA,+BAA+B,GAExC;IACH,iCAAiC;CACxB,CAAC","sourcesContent":["import { EFilterOrderDirection } from \"../../../enum\";\n\nconst DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection = EFilterOrderDirection.ASC;\n\nexport const FUNCTION_API_DECORATOR_CONSTANT: {\n\treadonly DEFAULT_FILTER_ORDER_BY_DIRECTION: EFilterOrderDirection;\n} = {\n\tDEFAULT_FILTER_ORDER_BY_DIRECTION,\n} as const;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT = void 0;
|
|
4
4
|
const METADATA_PROPERTY_NAME = "API_PROPERTY_DESCRIBE";
|
|
5
|
-
exports.
|
|
5
|
+
exports.PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT = {
|
|
6
6
|
METADATA_PROPERTY_NAME,
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=property-describe.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-describe.constant.js","sourceRoot":"/","sources":["constant/decorator/api/property-describe.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,uBAAuB,CAAC;AAElD,QAAA,wCAAwC,GAEjD;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const METADATA_PROPERTY_NAME: string = \"API_PROPERTY_DESCRIBE\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"property-describe.constant.js","sourceRoot":"/","sources":["constant/decorator/api/property-describe.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,sBAAsB,GAAW,uBAAuB,CAAC;AAElD,QAAA,wCAAwC,GAEjD;IACH,sBAAsB;CACb,CAAC","sourcesContent":["const METADATA_PROPERTY_NAME: string = \"API_PROPERTY_DESCRIBE\";\n\nexport const PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT: {\n\treadonly METADATA_PROPERTY_NAME: string;\n} = {\n\tMETADATA_PROPERTY_NAME,\n} as const;\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const GET_LIST_QUERY_DTO_FACTORY_CONSTANT: {
|
|
2
2
|
readonly MAXIMUM_LIST_LENGTH: number;
|
|
3
3
|
readonly MAXIMUM_LIST_PAGES_COUNT: number;
|
|
4
4
|
readonly MINIMUM_LIST_LENGTH: number;
|
|
5
5
|
readonly MINIMUM_LIST_PAGES_COUNT: number;
|
|
6
6
|
};
|
|
7
|
-
export default GET_LIST_QUERY_DTO_FACTOR_CONSTANT;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GET_LIST_QUERY_DTO_FACTORY_CONSTANT = void 0;
|
|
3
4
|
const MINIMUM_LIST_LENGTH = 1;
|
|
4
5
|
const MAXIMUM_LIST_LENGTH = 100;
|
|
5
6
|
const MINIMUM_LIST_PAGES_COUNT = 1;
|
|
6
7
|
const MAXIMUM_LIST_PAGES_COUNT = 100;
|
|
7
|
-
|
|
8
|
+
exports.GET_LIST_QUERY_DTO_FACTORY_CONSTANT = {
|
|
8
9
|
MAXIMUM_LIST_LENGTH,
|
|
9
10
|
MAXIMUM_LIST_PAGES_COUNT,
|
|
10
11
|
MINIMUM_LIST_LENGTH,
|
|
11
12
|
MINIMUM_LIST_PAGES_COUNT,
|
|
12
13
|
};
|
|
13
|
-
exports.default = GET_LIST_QUERY_DTO_FACTOR_CONSTANT;
|
|
14
14
|
//# sourceMappingURL=get-list-query.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-list-query.constant.js","sourceRoot":"/","sources":["constant/factory/dto/get-list-query.constant.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-list-query.constant.js","sourceRoot":"/","sources":["constant/factory/dto/get-list-query.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,mBAAmB,GAAW,GAAG,CAAC;AACxC,MAAM,wBAAwB,GAAW,CAAC,CAAC;AAC3C,MAAM,wBAAwB,GAAW,GAAG,CAAC;AAEhC,QAAA,mCAAmC,GAK5C;IACH,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,wBAAwB;CACf,CAAC","sourcesContent":["const MINIMUM_LIST_LENGTH: number = 1;\nconst MAXIMUM_LIST_LENGTH: number = 100;\nconst MINIMUM_LIST_PAGES_COUNT: number = 1;\nconst MAXIMUM_LIST_PAGES_COUNT: number = 100;\n\nexport const GET_LIST_QUERY_DTO_FACTORY_CONSTANT: {\n\treadonly MAXIMUM_LIST_LENGTH: number;\n\treadonly MAXIMUM_LIST_PAGES_COUNT: number;\n\treadonly MINIMUM_LIST_LENGTH: number;\n\treadonly MINIMUM_LIST_PAGES_COUNT: number;\n} = {\n\tMAXIMUM_LIST_LENGTH,\n\tMAXIMUM_LIST_PAGES_COUNT,\n\tMINIMUM_LIST_LENGTH,\n\tMINIMUM_LIST_PAGES_COUNT,\n} as const;\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FILTER_API_INTERFACE_CONSTANT = void 0;
|
|
4
4
|
const ALLOWED_ENTITY_TO_FILTER_COLUMNS = ["string", "text", "varchar", "char", "number", "int", "integer", "tinyint", "smallint", "mediumint", "bigint", "float", "double", "decimal", "date", "datetime", "timestamp"];
|
|
5
|
-
exports.
|
|
5
|
+
exports.FILTER_API_INTERFACE_CONSTANT = {
|
|
6
6
|
ALLOWED_ENTITY_TO_FILTER_COLUMNS,
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=filter.constant.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.constant.js","sourceRoot":"/","sources":["constant/interface/api/filter.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,gCAAgC,GAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAE1N,QAAA,6BAA6B,GAEtC;IACH,gCAAgC;CACvB,CAAC","sourcesContent":["const ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string> = [\"string\", \"text\", \"varchar\", \"char\", \"number\", \"int\", \"integer\", \"tinyint\", \"smallint\", \"mediumint\", \"bigint\", \"float\", \"double\", \"decimal\", \"date\", \"datetime\", \"timestamp\"];\n\nexport const
|
|
1
|
+
{"version":3,"file":"filter.constant.js","sourceRoot":"/","sources":["constant/interface/api/filter.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,gCAAgC,GAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;AAE1N,QAAA,6BAA6B,GAEtC;IACH,gCAAgC;CACvB,CAAC","sourcesContent":["const ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string> = [\"string\", \"text\", \"varchar\", \"char\", \"number\", \"int\", \"integer\", \"tinyint\", \"smallint\", \"mediumint\", \"bigint\", \"float\", \"double\", \"decimal\", \"date\", \"datetime\", \"timestamp\"];\n\nexport const FILTER_API_INTERFACE_CONSTANT: {\n\treadonly ALLOWED_ENTITY_TO_FILTER_COLUMNS: Array<string>;\n} = {\n\tALLOWED_ENTITY_TO_FILTER_COLUMNS,\n} as const;\n"]}
|
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./property"), exports);
|
|
18
|
+
__exportStar(require("./filter.constant"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["constant/interface/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B","sourcesContent":["export * from \"./property\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["constant/interface/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,oDAAkC","sourcesContent":["export * from \"./property\";\nexport * from \"./filter.constant\";\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IsIpVersion } from "class-validator/types/decorator/string/IsIP";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const STRING_PROPERTY_API_INTERFACE_CONSTANT: {
|
|
3
3
|
readonly IP_VERSION: IsIpVersion;
|
|
4
4
|
readonly REGEX_FLAGS_INDEX: number;
|
|
5
5
|
readonly REGEX_PATTERN_INDEX: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.STRING_PROPERTY_API_INTERFACE_CONSTANT = void 0;
|
|
4
4
|
const REGEX_PATTERN_INDEX = 1;
|
|
5
5
|
const REGEX_FLAGS_INDEX = 2;
|
|
6
6
|
const IP_VERSION = 4;
|
|
7
|
-
exports.
|
|
7
|
+
exports.STRING_PROPERTY_API_INTERFACE_CONSTANT = {
|
|
8
8
|
IP_VERSION,
|
|
9
9
|
REGEX_FLAGS_INDEX,
|
|
10
10
|
REGEX_PATTERN_INDEX,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/string.constant.ts"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,iBAAiB,GAAW,CAAC,CAAC;AACpC,MAAM,UAAU,GAAgB,CAAC,CAAC;AAErB,QAAA,sCAAsC,GAI/C;IACH,UAAU;IACV,iBAAiB;IACjB,mBAAmB;CACV,CAAC","sourcesContent":["import type { IsIpVersion } from \"class-validator/types/decorator/string/IsIP\";\n\nconst REGEX_PATTERN_INDEX: number = 1;\nconst REGEX_FLAGS_INDEX: number = 2;\nconst IP_VERSION: IsIpVersion = 4;\n\nexport const
|
|
1
|
+
{"version":3,"file":"string.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/string.constant.ts"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAW,CAAC,CAAC;AACtC,MAAM,iBAAiB,GAAW,CAAC,CAAC;AACpC,MAAM,UAAU,GAAgB,CAAC,CAAC;AAErB,QAAA,sCAAsC,GAI/C;IACH,UAAU;IACV,iBAAiB;IACjB,mBAAmB;CACV,CAAC","sourcesContent":["import type { IsIpVersion } from \"class-validator/types/decorator/string/IsIP\";\n\nconst REGEX_PATTERN_INDEX: number = 1;\nconst REGEX_FLAGS_INDEX: number = 2;\nconst IP_VERSION: IsIpVersion = 4;\n\nexport const STRING_PROPERTY_API_INTERFACE_CONSTANT: {\n\treadonly IP_VERSION: IsIpVersion;\n\treadonly REGEX_FLAGS_INDEX: number;\n\treadonly REGEX_PATTERN_INDEX: number;\n} = {\n\tIP_VERSION,\n\tREGEX_FLAGS_INDEX,\n\tREGEX_PATTERN_INDEX,\n} as const;\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.WALLET_PROPERTY_API_INTERFACE_CONSTANT = void 0;
|
|
4
4
|
const MINIMUM = 10_000_000_000;
|
|
5
5
|
const MAXIMUM = 999_999_999_999;
|
|
6
6
|
const EXAMPLE = 18_143_008_867;
|
|
7
|
-
exports.
|
|
7
|
+
exports.WALLET_PROPERTY_API_INTERFACE_CONSTANT = {
|
|
8
8
|
EXAMPLE,
|
|
9
9
|
MAXIMUM,
|
|
10
10
|
MINIMUM,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/wallet.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAW,cAAc,CAAC;AACvC,MAAM,OAAO,GAAW,eAAe,CAAC;AACxC,MAAM,OAAO,GAAW,cAAc,CAAC;AAE1B,QAAA,sCAAsC,GAI/C;IACH,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC","sourcesContent":["const MINIMUM: number = 10_000_000_000;\nconst MAXIMUM: number = 999_999_999_999;\nconst EXAMPLE: number = 18_143_008_867;\n\nexport const
|
|
1
|
+
{"version":3,"file":"wallet.constant.js","sourceRoot":"/","sources":["constant/interface/api/property/wallet.constant.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAW,cAAc,CAAC;AACvC,MAAM,OAAO,GAAW,eAAe,CAAC;AACxC,MAAM,OAAO,GAAW,cAAc,CAAC;AAE1B,QAAA,sCAAsC,GAI/C;IACH,OAAO;IACP,OAAO;IACP,OAAO;CACE,CAAC","sourcesContent":["const MINIMUM: number = 10_000_000_000;\nconst MAXIMUM: number = 999_999_999_999;\nconst EXAMPLE: number = 18_143_008_867;\n\nexport const WALLET_PROPERTY_API_INTERFACE_CONSTANT: {\n\treadonly EXAMPLE: number;\n\treadonly MAXIMUM: number;\n\treadonly MINIMUM: number;\n} = {\n\tEXAMPLE,\n\tMAXIMUM,\n\tMINIMUM,\n} as const;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EApiDtoType, EApiPropertyDescribeType } from "../../../enum";
|
|
2
|
+
import type { IDtoGenerateFactory, IDtoStrategy } from "../../../interface";
|
|
3
|
+
export declare const DTO_UTILITY_CONSTANT: {
|
|
4
|
+
readonly DTO_STRATEGIES: Record<EApiDtoType, IDtoStrategy>;
|
|
5
|
+
readonly PROPERTY_DECORATOR_FACTORIES: Record<EApiPropertyDescribeType, IDtoGenerateFactory>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DTO_UTILITY_CONSTANT = void 0;
|
|
4
|
+
const class_1 = require("../../../class");
|
|
5
|
+
const dto_1 = require("../../../class/utility/dto");
|
|
6
|
+
const enum_1 = require("../../../enum");
|
|
7
|
+
const relation_class_1 = require("../../../class/utility/dto/property/factory/relation.class");
|
|
8
|
+
const DTO_STRATEGIES = {
|
|
9
|
+
[enum_1.EApiDtoType.BODY]: new class_1.DtoStrategyBody(),
|
|
10
|
+
[enum_1.EApiDtoType.QUERY]: new class_1.DtoStrategyQuery(),
|
|
11
|
+
[enum_1.EApiDtoType.REQUEST]: new class_1.DtoStrategyRequest(),
|
|
12
|
+
[enum_1.EApiDtoType.RESPONSE]: new class_1.DtoStrategyResponse(),
|
|
13
|
+
};
|
|
14
|
+
const PROPERTY_DECORATOR_FACTORIES = {
|
|
15
|
+
[enum_1.EApiPropertyDescribeType.BOOLEAN]: new dto_1.DtoPropertyFactoryBoolean(),
|
|
16
|
+
[enum_1.EApiPropertyDescribeType.DATE]: new dto_1.DtoPropertyFactoryDate(),
|
|
17
|
+
[enum_1.EApiPropertyDescribeType.NUMBER]: new dto_1.DtoPropertyFactoryNumber(),
|
|
18
|
+
[enum_1.EApiPropertyDescribeType.OBJECT]: new dto_1.DtoPropertyFactoryObject(),
|
|
19
|
+
[enum_1.EApiPropertyDescribeType.STRING]: new dto_1.DtoPropertyFactoryString(),
|
|
20
|
+
[enum_1.EApiPropertyDescribeType.UUID]: new dto_1.DtoPropertyFactoryUuid(),
|
|
21
|
+
[enum_1.EApiPropertyDescribeType.RELATION]: new relation_class_1.DtoPropertyFactoryRelation(),
|
|
22
|
+
};
|
|
23
|
+
exports.DTO_UTILITY_CONSTANT = {
|
|
24
|
+
DTO_STRATEGIES,
|
|
25
|
+
PROPERTY_DECORATOR_FACTORIES,
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=constant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.js","sourceRoot":"/","sources":["constant/utility/dto/constant.ts"],"names":[],"mappings":";;;AAAA,0CAA4G;AAC5G,oDAAqM;AAErM,wCAAsE;AAGtE,+FAAsG;AAEtG,MAAM,cAAc,GAAsC;IACzD,CAAC,kBAAW,CAAC,IAAI,CAAC,EAAE,IAAI,uBAAe,EAAE;IACzC,CAAC,kBAAW,CAAC,KAAK,CAAC,EAAE,IAAI,wBAAgB,EAAE;IAC3C,CAAC,kBAAW,CAAC,OAAO,CAAC,EAAE,IAAI,0BAAkB,EAAE;IAC/C,CAAC,kBAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,2BAAmB,EAAE;CACjD,CAAC;AAEF,MAAM,4BAA4B,GAA0D;IAC3F,CAAC,+BAAwB,CAAC,OAAO,CAAC,EAAE,IAAI,+BAAyB,EAAE;IACnE,CAAC,+BAAwB,CAAC,IAAI,CAAC,EAAE,IAAI,4BAAsB,EAAE;IAC7D,CAAC,+BAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,8BAAwB,EAAE;IACjE,CAAC,+BAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,8BAAwB,EAAE;IACjE,CAAC,+BAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,8BAAwB,EAAE;IACjE,CAAC,+BAAwB,CAAC,IAAI,CAAC,EAAE,IAAI,4BAAsB,EAAE;IAC7D,CAAC,+BAAwB,CAAC,QAAQ,CAAC,EAAE,IAAI,2CAA0B,EAAE;CACrE,CAAC;AAEW,QAAA,oBAAoB,GAG7B;IACH,cAAc;IACd,4BAA4B;CACnB,CAAC","sourcesContent":["import { DtoStrategyBody, DtoStrategyQuery, DtoStrategyRequest, DtoStrategyResponse } from \"../../../class\";\nimport { DtoPropertyFactoryBoolean, DtoPropertyFactoryDate, DtoPropertyFactoryNumber, DtoPropertyFactoryObject, DtoPropertyFactoryString, DtoPropertyFactoryUuid } from \"../../../class/utility/dto\";\n\nimport { EApiDtoType, EApiPropertyDescribeType } from \"../../../enum\";\n\nimport type { IDtoGenerateFactory, IDtoStrategy } from \"../../../interface\";\nimport {DtoPropertyFactoryRelation} from \"../../../class/utility/dto/property/factory/relation.class\";\n\nconst DTO_STRATEGIES: Record<EApiDtoType, IDtoStrategy> = {\n\t[EApiDtoType.BODY]: new DtoStrategyBody(),\n\t[EApiDtoType.QUERY]: new DtoStrategyQuery(),\n\t[EApiDtoType.REQUEST]: new DtoStrategyRequest(),\n\t[EApiDtoType.RESPONSE]: new DtoStrategyResponse(),\n};\n\nconst PROPERTY_DECORATOR_FACTORIES: Record<EApiPropertyDescribeType, IDtoGenerateFactory> = {\n\t[EApiPropertyDescribeType.BOOLEAN]: new DtoPropertyFactoryBoolean(),\n\t[EApiPropertyDescribeType.DATE]: new DtoPropertyFactoryDate(),\n\t[EApiPropertyDescribeType.NUMBER]: new DtoPropertyFactoryNumber(),\n\t[EApiPropertyDescribeType.OBJECT]: new DtoPropertyFactoryObject(),\n\t[EApiPropertyDescribeType.STRING]: new DtoPropertyFactoryString(),\n\t[EApiPropertyDescribeType.UUID]: new DtoPropertyFactoryUuid(),\n\t[EApiPropertyDescribeType.RELATION]: new DtoPropertyFactoryRelation(),\n};\n\nexport const DTO_UTILITY_CONSTANT: {\n\treadonly DTO_STRATEGIES: Record<EApiDtoType, IDtoStrategy>;\n\treadonly PROPERTY_DECORATOR_FACTORIES: Record<EApiPropertyDescribeType, IDtoGenerateFactory>;\n} = {\n\tDTO_STRATEGIES,\n\tPROPERTY_DECORATOR_FACTORIES,\n} as const;\n"]}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { IApiBaseEntity } from "../../interface";
|
|
2
2
|
import type { IApiControllerProperties } from "../../interface/decorator/api/controller-properties.interface";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
service: BaseApiService<any>;
|
|
6
|
-
};
|
|
7
|
-
export declare const ApiController: <E extends BaseEntity>(options: IApiControllerProperties<E>) => <T extends TConstructor>(target: T) => T;
|
|
8
|
-
export {};
|
|
3
|
+
import type { TApiControllerConstructor } from "../../type";
|
|
4
|
+
export declare const ApiController: <E extends IApiBaseEntity>(options: IApiControllerProperties<E>) => <T extends TApiControllerConstructor>(target: T) => T;
|
|
@@ -6,8 +6,8 @@ const ApiController = (options) => (target) => {
|
|
|
6
6
|
const factory = new factory_1.ApiControllerFactory(target, options);
|
|
7
7
|
factory.init();
|
|
8
8
|
const ValidatedController = class extends target {
|
|
9
|
-
constructor(...
|
|
10
|
-
super(...
|
|
9
|
+
constructor(..._arguments) {
|
|
10
|
+
super(..._arguments);
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(ValidatedController, "name", { value: target.name });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.decorator.js","sourceRoot":"/","sources":["decorator/api/controller.decorator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"controller.decorator.js","sourceRoot":"/","sources":["decorator/api/controller.decorator.ts"],"names":[],"mappings":";;;AACA,2CAAqD;AAK9C,MAAM,aAAa,GACzB,CAA2B,OAAoC,EAAE,EAAE,CACnE,CAAsC,MAAS,EAAK,EAAE;IACrD,MAAM,OAAO,GAA4B,IAAI,8BAAoB,CAAI,MAAM,EAAE,OAAO,CAAC,CAAC;IACtF,OAAO,CAAC,IAAI,EAAE,CAAC;IAEf,MAAM,mBAAmB,GAA2D,KAAM,SAAQ,MAAM;QAEvG,YAAY,GAAG,UAAe;YAE7B,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC;QACtB,CAAC;KACD,CAAC;IACF,MAAM,CAAC,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAE3E,OAAO,mBAAwB,CAAC;AACjC,CAAC,CAAC;AAhBU,QAAA,aAAa,iBAgBvB","sourcesContent":["import { IApiBaseEntity } from \"../../interface\";\nimport { ApiControllerFactory } from \"../../factory\";\n\nimport type { IApiControllerProperties } from \"../../interface/decorator/api/controller-properties.interface\";\nimport type { TApiControllerConstructor } from \"../../type\";\n\nexport const ApiController =\n\t<E extends IApiBaseEntity>(options: IApiControllerProperties<E>) =>\n\t<T extends TApiControllerConstructor>(target: T): T => {\n\t\tconst factory: ApiControllerFactory<E> = new ApiControllerFactory<E>(target, options);\n\t\tfactory.init();\n\n\t\tconst ValidatedController: { new (...arguments_: Array<any>): {}; prototype: {} } = class extends target {\n\t\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\t\tconstructor(..._arguments: any) {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\t\t\t\tsuper(..._arguments);\n\t\t\t}\n\t\t};\n\t\tObject.defineProperty(ValidatedController, \"name\", { value: target.name });\n\n\t\treturn ValidatedController as T;\n\t};\n"]}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function ApiFunctionCreate
|
|
3
|
-
model: new () => E;
|
|
4
|
-
}): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1
|
+
import type { IApiFunctionCreateProperties } from "../../../interface/decorator/api/function/create-properties.interface";
|
|
2
|
+
export declare function ApiFunctionCreate(properties: IApiFunctionCreateProperties): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -4,39 +4,47 @@ exports.ApiFunctionCreate = ApiFunctionCreate;
|
|
|
4
4
|
const common_1 = require("@nestjs/common");
|
|
5
5
|
const enum_1 = require("../../../enum");
|
|
6
6
|
const utility_1 = require("../../../utility");
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
async function executor(options) {
|
|
8
|
+
const { entity, properties, repository } = options;
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
try {
|
|
11
|
+
const allColumns = (0, utility_1.GetEntityColumns)({ entity });
|
|
12
|
+
const autoGeneratedColumns = (0, utility_1.GetEntityColumns)({ entity, shouldTakeGeneratedOnly: true });
|
|
13
|
+
const filteredProperties = {};
|
|
14
|
+
for (const key of Object.keys(properties)) {
|
|
15
|
+
if (allColumns.includes(key) && !autoGeneratedColumns.includes(key)) {
|
|
16
|
+
filteredProperties[key] = properties[key];
|
|
17
|
+
}
|
|
15
18
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const newEntity = repository.create(filteredProperties);
|
|
20
|
+
return await repository.save(newEntity);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.log("FUCK", error);
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
27
|
catch (error) {
|
|
22
|
-
console.log(error);
|
|
23
28
|
if (error instanceof common_1.HttpException) {
|
|
24
29
|
throw error;
|
|
25
30
|
}
|
|
26
31
|
throw new common_1.InternalServerErrorException((0, utility_1.ErrorString)({
|
|
27
|
-
entity:
|
|
32
|
+
entity: entity,
|
|
28
33
|
type: enum_1.EErrorStringAction.CREATING_ERROR,
|
|
29
34
|
}));
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
|
-
function ApiFunctionCreate(
|
|
33
|
-
|
|
37
|
+
function ApiFunctionCreate(properties) {
|
|
38
|
+
const { entity } = properties;
|
|
39
|
+
return function (target, propertyKey, descriptor) {
|
|
40
|
+
void target;
|
|
41
|
+
void propertyKey;
|
|
34
42
|
descriptor.value = async function (properties) {
|
|
35
43
|
const repository = this.repository;
|
|
36
44
|
if (!repository) {
|
|
37
|
-
throw
|
|
45
|
+
throw (0, utility_1.ErrorException)("Repository is not available in this context");
|
|
38
46
|
}
|
|
39
|
-
return executor(
|
|
47
|
+
return executor({ entity, properties, repository });
|
|
40
48
|
};
|
|
41
49
|
return descriptor;
|
|
42
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.decorator.js","sourceRoot":"/","sources":["decorator/api/function/create.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"create.decorator.js","sourceRoot":"/","sources":["decorator/api/function/create.decorator.ts"],"names":[],"mappings":";;AAkDA,8CAwBC;AA1ED,2CAA6E;AAE7E,wCAAmD;AAEnD,8CAAiF;AAQjF,KAAK,UAAU,QAAQ,CAA2B,OAAgD;IACjG,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAA4C,OAAO,CAAC;IAE5F,IAAI,CAAC;QAEJ,IAAI,CAAC;YACJ,MAAM,UAAU,GAAmB,IAAA,0BAAgB,EAAC,EAAC,MAAM,EAAC,CAAC,CAAC;YAC9D,MAAM,oBAAoB,GAAmB,IAAA,0BAAgB,EAAC,EAAC,MAAM,EAAE,uBAAuB,EAAE,IAAI,EAAC,CAAC,CAAC;YAEvG,MAAM,kBAAkB,GAAmB,EAAoB,CAAC;YAEhE,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAiD,EAAE,CAAC;gBAC3F,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBACpE,kBAA+C,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;gBACzE,CAAC;YACF,CAAC;YAED,MAAM,SAAS,GAAM,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;YAE3D,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAC3B,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,IAAI,qCAA4B,CACrC,IAAA,qBAAW,EAAC;YACX,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAkB,CAAC,cAAc;SACvC,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAgB,iBAAiB,CAAC,UAAwC;IACzE,MAAM,EAAE,MAAM,EAAE,GAAiC,UAAU,CAAC;IAE5D,OAAO,UAAU,MAAe,EAAE,WAAmB,EAAE,UAA8B;QACpF,KAAK,MAAM,CAAC;QACZ,KAAK,WAAW,CAAC;QAEjB,UAAU,CAAC,KAAK,GAAG,KAAK,WAIvB,UAAuD;YAEvD,MAAM,UAAU,GAA8B,IAAI,CAAC,UAAU,CAAC;YAE9D,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,IAAA,wBAAc,EAAC,6CAA6C,CAAC,CAAC;YACrE,CAAC;YAED,OAAO,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC,CAAC;QACrD,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { HttpException, InternalServerErrorException } from \"@nestjs/common\";\n\nimport { EErrorStringAction } from \"../../../enum\";\n\nimport { ErrorException, ErrorString, GetEntityColumns } from \"../../../utility\";\n\nimport type { IApiBaseEntity } from \"../../../interface\";\nimport type { IApiFunctionCreateProperties } from \"../../../interface/decorator/api/function/create-properties.interface\";\nimport type { IApiFunctionCreateExecutorProperties, TApiFunctionCreateProperties } from \"../../../type\";\n\nimport type { DeepPartial, Repository } from \"typeorm\";\n\nasync function executor<E extends IApiBaseEntity>(options: IApiFunctionCreateExecutorProperties<E>): Promise<E> {\n\tconst { entity, properties, repository }: IApiFunctionCreateExecutorProperties<E> = options;\n\n\ttry {\n\n\t\ttry {\n\t\t\tconst allColumns: Array<keyof E> = GetEntityColumns({entity});\n\t\t\tconst autoGeneratedColumns: Array<keyof E> = GetEntityColumns({entity, shouldTakeGeneratedOnly: true});\n\n\t\t\tconst filteredProperties: DeepPartial<E> = {} as DeepPartial<E>;\n\n\t\t\tfor (const key of Object.keys(properties) as Array<keyof TApiFunctionCreateProperties<E>>) {\n\t\t\t\tif (allColumns.includes(key) && !autoGeneratedColumns.includes(key)) {\n\t\t\t\t\t(filteredProperties as Record<keyof E, unknown>)[key] = properties[key];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst newEntity: E = repository.create(filteredProperties);\n\n\t\t\treturn await repository.save(newEntity);\n\t\t} catch (error) {\n\t\t\tconsole.log(\"FUCK\", error);\n\t\t\tthrow error;\n\t\t}\n\t} catch (error) {\n\t\tif (error instanceof HttpException) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tthrow new InternalServerErrorException(\n\t\t\tErrorString({\n\t\t\t\tentity: entity,\n\t\t\t\ttype: EErrorStringAction.CREATING_ERROR,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport function ApiFunctionCreate(properties: IApiFunctionCreateProperties) {\n\tconst { entity }: IApiFunctionCreateProperties = properties;\n\n\treturn function (target: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tvoid target;\n\t\tvoid propertyKey;\n\n\t\tdescriptor.value = async function (\n\t\t\tthis: {\n\t\t\t\trepository: Repository<typeof entity>;\n\t\t\t},\n\t\t\tproperties: TApiFunctionCreateProperties<typeof entity>,\n\t\t): Promise<IApiBaseEntity> {\n\t\t\tconst repository: Repository<typeof entity> = this.repository;\n\n\t\t\tif (!repository) {\n\t\t\t\tthrow ErrorException(\"Repository is not available in this context\");\n\t\t\t}\n\n\t\t\treturn executor({ entity, properties, repository });\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
export declare function ApiFunction<E extends
|
|
4
|
-
model: new () => E;
|
|
5
|
-
relations?: FindOptionsRelations<E>;
|
|
6
|
-
type: EApiFunctionType;
|
|
7
|
-
}): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
1
|
+
import type { IApiBaseEntity } from "../../../interface";
|
|
2
|
+
import type { TApiFunctionProperties } from "../../../type/decorator/api/function/properties.type";
|
|
3
|
+
export declare function ApiFunction<E extends IApiBaseEntity, R>(properties: TApiFunctionProperties<E>): (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -2,42 +2,46 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApiFunction = ApiFunction;
|
|
4
4
|
const enum_1 = require("../../../enum");
|
|
5
|
+
const utility_1 = require("../../../utility");
|
|
5
6
|
const create_decorator_1 = require("./create.decorator");
|
|
6
7
|
const delete_decorator_1 = require("./delete.decorator");
|
|
7
8
|
const get_list_decorator_1 = require("./get-list.decorator");
|
|
8
9
|
const get_decorator_1 = require("./get.decorator");
|
|
9
10
|
const update_decorator_1 = require("./update.decorator");
|
|
10
|
-
function ApiFunction(
|
|
11
|
-
|
|
11
|
+
function ApiFunction(properties) {
|
|
12
|
+
const { entity, type } = properties;
|
|
13
|
+
return function (_target, propertyKey, descriptor) {
|
|
12
14
|
const originalMethod = descriptor.value;
|
|
13
15
|
descriptor.value = function (...arguments_) {
|
|
14
|
-
|
|
16
|
+
let decoratorFunction;
|
|
17
|
+
switch (type) {
|
|
15
18
|
case enum_1.EApiFunctionType.GET_LIST: {
|
|
16
|
-
|
|
19
|
+
decoratorFunction = (0, get_list_decorator_1.ApiFunctionGetList)({ model: entity });
|
|
20
|
+
break;
|
|
17
21
|
}
|
|
18
22
|
case enum_1.EApiFunctionType.GET: {
|
|
19
|
-
|
|
23
|
+
decoratorFunction = (0, get_decorator_1.ApiFunctionGet)({ model: entity });
|
|
24
|
+
break;
|
|
20
25
|
}
|
|
21
26
|
case enum_1.EApiFunctionType.CREATE: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}).value.apply(this, arguments_);
|
|
27
|
+
decoratorFunction = (0, create_decorator_1.ApiFunctionCreate)({ entity: entity });
|
|
28
|
+
break;
|
|
25
29
|
}
|
|
26
30
|
case enum_1.EApiFunctionType.UPDATE: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}).value.apply(this, arguments_);
|
|
31
|
+
decoratorFunction = (0, update_decorator_1.ApiFunctionUpdate)({ model: entity });
|
|
32
|
+
break;
|
|
30
33
|
}
|
|
31
34
|
case enum_1.EApiFunctionType.DELETE: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}).value.apply(this, arguments_);
|
|
35
|
+
decoratorFunction = (0, delete_decorator_1.ApiFunctionDelete)({ model: entity });
|
|
36
|
+
break;
|
|
35
37
|
}
|
|
36
38
|
default: {
|
|
37
|
-
throw
|
|
39
|
+
throw (0, utility_1.ErrorException)("Unsupported function");
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
const modifiedDescriptor = decoratorFunction(this, propertyKey, { value: originalMethod });
|
|
43
|
+
const modifiedMethod = modifiedDescriptor.value;
|
|
44
|
+
return modifiedMethod.apply(this, arguments_);
|
|
41
45
|
};
|
|
42
46
|
return descriptor;
|
|
43
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sourceRoot":"/","sources":["decorator/api/function/decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"decorator.js","sourceRoot":"/","sources":["decorator/api/function/decorator.ts"],"names":[],"mappings":";;AAgBA,kCAuDC;AAvED,wCAAiD;AAEjD,8CAAkD;AAElD,yDAAuD;AACvD,yDAAuD;AACvD,6DAA0D;AAC1D,mDAAiD;AACjD,yDAAuD;AAQvD,SAAgB,WAAW,CAA8B,UAAqC;IAC7F,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAA8B,UAAU,CAAC;IAG/D,OAAO,UAAU,OAAgB,EAAE,WAAmB,EAAE,UAA8B;QACrF,MAAM,cAAc,GAAY,UAAU,CAAC,KAAK,CAAC;QAGjD,UAAU,CAAC,KAAK,GAAG,UAA+C,GAAG,UAAsB;YAC1F,IAAI,iBAAqC,CAAC;YAE1C,QAAQ,IAAI,EAAE,CAAC;gBACd,KAAK,uBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAChC,iBAAiB,GAAG,IAAA,uCAAkB,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;oBAE1D,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC3B,iBAAiB,GAAG,IAAA,8BAAc,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;oBAEtD,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,iBAAiB,GAAG,IAAA,oCAAiB,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;oBAE1D,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,iBAAiB,GAAG,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;oBAEzD,MAAM;gBACP,CAAC;gBAED,KAAK,uBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9B,iBAAiB,GAAG,IAAA,oCAAiB,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;oBAEzD,MAAM;gBACP,CAAC;gBAED,OAAO,CAAC,CAAC,CAAC;oBACT,MAAM,IAAA,wBAAc,EAAC,sBAAsB,CAAC,CAAC;gBAC9C,CAAC;YACF,CAAC;YAED,MAAM,kBAAkB,GAAuB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC;YAC/G,MAAM,cAAc,GAAsC,kBAAkB,CAAC,KAA0C,CAAC;YAExH,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { EApiFunctionType } from \"../../../enum\";\n\nimport { ErrorException } from \"../../../utility\";\n\nimport { ApiFunctionCreate } from \"./create.decorator\";\nimport { ApiFunctionDelete } from \"./delete.decorator\";\nimport { ApiFunctionGetList } from \"./get-list.decorator\";\nimport { ApiFunctionGet } from \"./get.decorator\";\nimport { ApiFunctionUpdate } from \"./update.decorator\";\n\nimport type { IApiBaseEntity } from \"../../../interface\";\nimport type { TApiFunctionProperties } from \"../../../type/decorator/api/function/properties.type\";\nimport type { Repository } from \"typeorm\";\n\ntype TDecoratorFunction = (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;\n\nexport function ApiFunction<E extends IApiBaseEntity, R>(properties: TApiFunctionProperties<E>) {\n\tconst { entity, type }: TApiFunctionProperties<E> = properties;\n\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\treturn function (_target: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tconst originalMethod: unknown = descriptor.value;\n\n\t\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\t\tdescriptor.value = function (this: { repository: Repository<E> }, ...arguments_: Array<any>): any {\n\t\t\tlet decoratorFunction: TDecoratorFunction;\n\n\t\t\tswitch (type) {\n\t\t\t\tcase EApiFunctionType.GET_LIST: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionGetList({ model: entity });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.GET: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionGet({ model: entity });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.CREATE: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionCreate({ entity: entity });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.UPDATE: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionUpdate({ model: entity });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase EApiFunctionType.DELETE: {\n\t\t\t\t\tdecoratorFunction = ApiFunctionDelete({ model: entity });\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault: {\n\t\t\t\t\tthrow ErrorException(\"Unsupported function\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst modifiedDescriptor: PropertyDescriptor = decoratorFunction(this, propertyKey, { value: originalMethod });\n\t\t\tconst modifiedMethod: (...arguments__: Array<any>) => R = modifiedDescriptor.value as (...arguments__: Array<any>) => R;\n\n\t\t\treturn modifiedMethod.apply(this, arguments_);\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function ApiFunctionDelete<E extends
|
|
1
|
+
import type { IApiBaseEntity } from "../../../interface";
|
|
2
|
+
export declare function ApiFunctionDelete<E extends IApiBaseEntity>(options: {
|
|
3
3
|
model: new () => E;
|
|
4
|
-
}): (_target:
|
|
4
|
+
}): (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -5,18 +5,18 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
const enum_1 = require("../../../enum");
|
|
6
6
|
const utility_1 = require("../../../utility");
|
|
7
7
|
const get_decorator_1 = require("./get.decorator");
|
|
8
|
-
async function executor(
|
|
8
|
+
async function executor(options) {
|
|
9
|
+
const { entity, getFunction, id, repository } = options;
|
|
9
10
|
try {
|
|
10
11
|
const entity = await getFunction(id.toString());
|
|
11
12
|
await repository.remove(entity);
|
|
12
13
|
}
|
|
13
14
|
catch (error) {
|
|
14
|
-
console.log(error);
|
|
15
15
|
if (error instanceof common_1.HttpException) {
|
|
16
16
|
throw error;
|
|
17
17
|
}
|
|
18
18
|
throw new common_1.InternalServerErrorException((0, utility_1.ErrorString)({
|
|
19
|
-
entity:
|
|
19
|
+
entity: entity,
|
|
20
20
|
type: enum_1.EErrorStringAction.DELETING_ERROR,
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
@@ -28,7 +28,7 @@ function ApiFunctionDelete(options) {
|
|
|
28
28
|
descriptor.value = async function (id) {
|
|
29
29
|
const repository = this.repository;
|
|
30
30
|
if (!repository) {
|
|
31
|
-
throw
|
|
31
|
+
throw (0, utility_1.ErrorException)("Repository is not available in this context");
|
|
32
32
|
}
|
|
33
33
|
if (!getFunction) {
|
|
34
34
|
const getDescriptor = {
|
|
@@ -41,10 +41,10 @@ function ApiFunctionDelete(options) {
|
|
|
41
41
|
getFunction = getDescriptor.value.bind(this);
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
throw
|
|
44
|
+
throw (0, utility_1.ErrorException)("Get function is not properly decorated");
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return executor(
|
|
47
|
+
return executor({ entity: new options.model(), getFunction, id, repository });
|
|
48
48
|
};
|
|
49
49
|
return descriptor;
|
|
50
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.decorator.js","sourceRoot":"/","sources":["decorator/api/function/delete.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"delete.decorator.js","sourceRoot":"/","sources":["decorator/api/function/delete.decorator.ts"],"names":[],"mappings":";;AAkCA,8CAsCC;AAxED,2CAA6E;AAE7E,wCAAmD;AAEnD,8CAA+D;AAE/D,mDAAiD;AAOjD,KAAK,UAAU,QAAQ,CAA2B,OAAgD;IACjG,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,GAA4C,OAAO,CAAC;IAEjG,IAAI,CAAC;QACJ,MAAM,MAAM,GAAM,MAAM,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEnD,MAAM,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,sBAAa,EAAE,CAAC;YACpC,MAAM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,IAAI,qCAA4B,CACrC,IAAA,qBAAW,EAAC;YACX,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAkB,CAAC,cAAc;SACvC,CAAC,CACF,CAAC;IACH,CAAC;AACF,CAAC;AAED,SAAgB,iBAAiB,CAA2B,OAA+B;IAE1F,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B;QACtF,MAAM,YAAY,GAA+F,IAAA,8BAAc,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1J,IAAI,WAAkF,CAAC;QAEvF,UAAU,CAAC,KAAK,GAAG,KAAK,WAIvB,EAAmB;YAEnB,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU,CAAC;YAElD,IAAI,CAAC,UAAU,EAAE,CAAC;gBACjB,MAAM,IAAA,wBAAc,EAAC,6CAA6C,CAAC,CAAC;YACrE,CAAC;YAED,IAAI,CAAC,WAAW,EAAE,CAAC;gBAClB,MAAM,aAAa,GAAmG;oBACrH,KAAK,EAAE;wBACN,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACrD,CAAC;iBACD,CAAC;gBACF,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;gBAEzC,IAAI,aAAa,CAAC,KAAK,EAAE,CAAC;oBACzB,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9C,CAAC;qBAAM,CAAC;oBACP,MAAM,IAAA,wBAAc,EAAC,wCAAwC,CAAC,CAAC;gBAChE,CAAC;YACF,CAAC;YAED,OAAO,QAAQ,CAAI,EAAE,MAAM,EAAE,IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAClF,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC;AACH,CAAC","sourcesContent":["import { HttpException, InternalServerErrorException } from \"@nestjs/common\";\n\nimport { EErrorStringAction } from \"../../../enum\";\n\nimport { ErrorException, ErrorString } from \"../../../utility\";\n\nimport { ApiFunctionGet } from \"./get.decorator\";\n\nimport type { IApiBaseEntity } from \"../../../interface\";\nimport type { IApiFunctionDeleteExecutorProperties, TApiFunctionGetProperties } from \"../../../type\";\n\nimport type { Repository } from \"typeorm\";\n\nasync function executor<E extends IApiBaseEntity>(options: IApiFunctionDeleteExecutorProperties<E>): Promise<void> {\n\tconst { entity, getFunction, id, repository }: IApiFunctionDeleteExecutorProperties<E> = options;\n\n\ttry {\n\t\tconst entity: E = await getFunction(id.toString());\n\n\t\tawait repository.remove(entity);\n\t} catch (error) {\n\t\tif (error instanceof HttpException) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tthrow new InternalServerErrorException(\n\t\t\tErrorString({\n\t\t\t\tentity: entity,\n\t\t\t\ttype: EErrorStringAction.DELETING_ERROR,\n\t\t\t}),\n\t\t);\n\t}\n}\n\nexport function ApiFunctionDelete<E extends IApiBaseEntity>(options: { model: new () => E }) {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\treturn function (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor {\n\t\tconst getDecorator: (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor = ApiFunctionGet({ model: options.model });\n\t\tlet getFunction: (id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>;\n\n\t\tdescriptor.value = async function (\n\t\t\tthis: {\n\t\t\t\trepository: Repository<E>;\n\t\t\t},\n\t\t\tid: number | string,\n\t\t): Promise<void> {\n\t\t\tconst repository: Repository<E> = this.repository;\n\n\t\t\tif (!repository) {\n\t\t\t\tthrow ErrorException(\"Repository is not available in this context\");\n\t\t\t}\n\n\t\t\tif (!getFunction) {\n\t\t\t\tconst getDescriptor: TypedPropertyDescriptor<(id: string, properties?: TApiFunctionGetProperties<E>) => Promise<E>> = {\n\t\t\t\t\tvalue: function () {\n\t\t\t\t\t\treturn Promise.reject(new Error(\"Not implemented\"));\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tgetDecorator(this, \"get\", getDescriptor);\n\n\t\t\t\tif (getDescriptor.value) {\n\t\t\t\t\tgetFunction = getDescriptor.value.bind(this);\n\t\t\t\t} else {\n\t\t\t\t\tthrow ErrorException(\"Get function is not properly decorated\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn executor<E>({ entity: new options.model(), getFunction, id, repository });\n\t\t};\n\n\t\treturn descriptor;\n\t};\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function ApiFunctionGetList<E extends
|
|
1
|
+
import type { IApiBaseEntity } from "../../../interface";
|
|
2
|
+
export declare function ApiFunctionGetList<E extends IApiBaseEntity>(options: {
|
|
3
3
|
model: new () => E;
|
|
4
|
-
}): (_target:
|
|
4
|
+
}): (_target: unknown, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|