@elsikora/nestjs-crud-automator 1.10.0-dev.1 → 1.10.1-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 +193 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.js +4 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/executor.class.d.ts +8 -8
- package/dist/cjs/class/api/subscriber/executor.class.js +3 -3
- package/dist/cjs/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/registry.class.d.ts +3 -3
- package/dist/cjs/class/api/subscriber/registry.class.js +11 -11
- package/dist/cjs/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/cjs/constant/date.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/function.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/service.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/subscriber.constant.js.map +1 -1
- package/dist/cjs/constant/dto/exception.constant.js.map +1 -1
- package/dist/cjs/constant/dto/list.constant.js.map +1 -1
- package/dist/cjs/constant/dto/transformer-value.constant.js.map +1 -1
- package/dist/cjs/constant/factory/dto/get-list-query.constant.js.map +1 -1
- package/dist/cjs/constant/interface/api/filter.constant.js.map +1 -1
- package/dist/cjs/constant/interface/api/property/string.constant.js.map +1 -1
- package/dist/cjs/constant/interface/api/property/wallet.constant.js.map +1 -1
- package/dist/cjs/constant/number.constant.js.map +1 -1
- package/dist/cjs/constant/utility/dto/constant.d.ts +1 -1
- package/dist/cjs/constant/utility/dto/constant.js.map +1 -1
- package/dist/cjs/constant/utility/dto/generate.constant.js.map +1 -1
- package/dist/cjs/constant/validator/has-paired-custom-suffixes-fields.constant.js +2 -1
- package/dist/cjs/constant/validator/has-paired-custom-suffixes-fields.constant.js.map +1 -1
- package/dist/cjs/decorator/api/controller/observable.decorator.d.ts +3 -1
- package/dist/cjs/decorator/api/controller/observable.decorator.js +3 -1
- package/dist/cjs/decorator/api/controller/observable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/controller.decorator.d.ts +2 -1
- package/dist/cjs/decorator/api/controller.decorator.js +2 -1
- package/dist/cjs/decorator/api/controller.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/create.decorator.js +12 -10
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.js +1 -0
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.d.ts +2 -5
- package/dist/cjs/decorator/api/function/delete.decorator.js +13 -15
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.d.ts +2 -5
- package/dist/cjs/decorator/api/function/get-list.decorator.js +30 -16
- package/dist/cjs/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.d.ts +2 -5
- package/dist/cjs/decorator/api/function/get-many.decorator.js +13 -15
- package/dist/cjs/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get.decorator.d.ts +2 -5
- package/dist/cjs/decorator/api/function/get.decorator.js +13 -15
- package/dist/cjs/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.d.ts +2 -5
- package/dist/cjs/decorator/api/function/update.decorator.js +13 -15
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +4 -0
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +4 -2
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +21 -3
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/observable.decorator.d.ts +3 -1
- package/dist/cjs/decorator/api/service/observable.decorator.js +3 -1
- package/dist/cjs/decorator/api/service/observable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service.decorator.js +39 -0
- package/dist/cjs/decorator/api/service.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/subscriber/function.decorator.d.ts +23 -5
- package/dist/cjs/decorator/api/subscriber/function.decorator.js +21 -3
- package/dist/cjs/decorator/api/subscriber/function.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/subscriber/route.decorator.d.ts +23 -5
- package/dist/cjs/decorator/api/subscriber/route.decorator.js +21 -3
- package/dist/cjs/decorator/api/subscriber/route.decorator.js.map +1 -1
- package/dist/cjs/enum/decorator/api/action.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/authentication-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/controller/load-relations-strategy.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/controller/request-transformer-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/dto-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/function/type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/on-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/data-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/date/identifier.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/date/type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/desribe-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/number-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/property/string-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/route-type.enum.js.map +1 -1
- package/dist/cjs/enum/exception.enum.js.map +1 -1
- package/dist/cjs/enum/filter-operation.enum.js.map +1 -1
- package/dist/cjs/enum/filter-order-direction.enum.js.map +1 -1
- package/dist/cjs/enum/utility/error-string/action.enum.js.map +1 -1
- package/dist/cjs/enum/utility/error-string/composite-action.enum.js.map +1 -1
- package/dist/cjs/enum/validator/has-paired-custom-suffixes-fields-argument-type.enum.js.map +1 -1
- package/dist/cjs/enum/validator/must-match-one-of-schemas-error-type.enum.js.map +1 -1
- package/dist/cjs/factory/api/controller.factory.js +23 -18
- package/dist/cjs/factory/api/controller.factory.js.map +1 -1
- package/dist/cjs/interceptor/correlation-id-response-body.interceptor.d.ts +1 -1
- package/dist/cjs/interceptor/correlation-id-response-body.interceptor.js.map +1 -1
- package/dist/cjs/interface/api-dto-validator.interface.d.ts +1 -1
- package/dist/cjs/interface/class/api/subscriber/execution-context.interface.d.ts +2 -2
- package/dist/cjs/interface/class/api/subscriber/function-execution-context.interface.d.ts +1 -1
- package/dist/cjs/interface/class/api/subscriber/function.interface.d.ts +1 -1
- package/dist/cjs/interface/class/api/subscriber/index.d.ts +6 -0
- package/dist/cjs/interface/class/api/subscriber/route-execution-context.interface.d.ts +1 -1
- package/dist/cjs/interface/class/api/subscriber/route.interface.d.ts +0 -1
- package/dist/cjs/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/delete-executor-properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/properties.interface.d.ts +1 -1
- package/dist/cjs/interface/decorator/api/function/update-executor-properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/index.d.ts +6 -6
- package/dist/cjs/interface/decorator/api/subscriber/function-properties.interface.d.ts +1 -1
- package/dist/cjs/interface/decorator/api/subscriber/index.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/subscriber/route-properties.interface.d.ts +1 -1
- package/dist/cjs/interface/entity/column.interface.d.ts +1 -1
- package/dist/cjs/type/decorator/api/controller/constructor.type.d.ts +2 -2
- package/dist/cjs/type/decorator/api/property/describe/enum-properties.type.d.ts +1 -1
- package/dist/cjs/type/decorator/api/property/object/with-discriminator-properties.type.d.ts +1 -1
- package/dist/cjs/type/decorator/api/service/keys.type.d.ts +1 -1
- package/dist/cjs/type/factory/api/controller/target-methods.type.d.ts +1 -1
- package/dist/cjs/type/utility/dto/generate-get-list-response-resource-class.type.d.ts +1 -0
- package/dist/cjs/type/utility/dto/index.d.ts +1 -0
- package/dist/cjs/utility/api/controller/apply-decorators.utility.d.ts +2 -1
- package/dist/cjs/utility/api/controller/apply-decorators.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/apply-metadata.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 +0 -1
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.d.ts +1 -6
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js +0 -5
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-method-name.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-primary-column.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js +3 -0
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js +0 -1
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-dynamic.utility.js +3 -0
- package/dist/cjs/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-exception.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-get-list-response.utility.d.ts +4 -5
- package/dist/cjs/utility/dto/generate-get-list-response.utility.js +2 -2
- package/dist/cjs/utility/dto/generate-get-list-response.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-relation-response.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate.utility.js +15 -0
- package/dist/cjs/utility/dto/generate.utility.js.map +1 -1
- package/dist/cjs/utility/dto/get-get-list-query-base-class.utility.js.map +1 -1
- package/dist/cjs/utility/dto/handle-date-property.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is-property-should-be-marked.utility.js.map +1 -1
- package/dist/cjs/utility/dto/validate-property-config.utility.js.map +1 -1
- package/dist/cjs/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/cjs/utility/is-error-of-type.utility.js.map +1 -1
- package/dist/cjs/utility/logger.utility.js +3 -5
- package/dist/cjs/utility/logger.utility.js.map +1 -1
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-property.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js +1 -0
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js +1 -0
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js.map +1 -1
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/class/api/subscriber/discovery-service.class.js +4 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/executor.class.d.ts +8 -8
- package/dist/esm/class/api/subscriber/executor.class.js +3 -3
- package/dist/esm/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/registry.class.d.ts +3 -3
- package/dist/esm/class/api/subscriber/registry.class.js +11 -11
- package/dist/esm/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/esm/constant/date.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/function.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/service.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/subscriber.constant.js.map +1 -1
- package/dist/esm/constant/dto/exception.constant.js.map +1 -1
- package/dist/esm/constant/dto/list.constant.js.map +1 -1
- package/dist/esm/constant/dto/transformer-value.constant.js.map +1 -1
- package/dist/esm/constant/factory/dto/get-list-query.constant.js.map +1 -1
- package/dist/esm/constant/interface/api/filter.constant.js.map +1 -1
- package/dist/esm/constant/interface/api/property/string.constant.js.map +1 -1
- package/dist/esm/constant/interface/api/property/wallet.constant.js.map +1 -1
- package/dist/esm/constant/number.constant.js.map +1 -1
- package/dist/esm/constant/utility/dto/constant.d.ts +1 -1
- package/dist/esm/constant/utility/dto/constant.js.map +1 -1
- package/dist/esm/constant/utility/dto/generate.constant.js.map +1 -1
- package/dist/esm/constant/validator/has-paired-custom-suffixes-fields.constant.js +2 -1
- package/dist/esm/constant/validator/has-paired-custom-suffixes-fields.constant.js.map +1 -1
- package/dist/esm/decorator/api/controller/observable.decorator.d.ts +3 -1
- package/dist/esm/decorator/api/controller/observable.decorator.js +3 -1
- package/dist/esm/decorator/api/controller/observable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/controller.decorator.d.ts +2 -1
- package/dist/esm/decorator/api/controller.decorator.js +2 -1
- package/dist/esm/decorator/api/controller.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/create.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/create.decorator.js +12 -10
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/decorator.js +1 -0
- package/dist/esm/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.d.ts +2 -5
- package/dist/esm/decorator/api/function/delete.decorator.js +13 -15
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-list.decorator.d.ts +2 -5
- package/dist/esm/decorator/api/function/get-list.decorator.js +30 -16
- package/dist/esm/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-many.decorator.d.ts +2 -5
- package/dist/esm/decorator/api/function/get-many.decorator.js +13 -15
- package/dist/esm/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get.decorator.d.ts +2 -5
- package/dist/esm/decorator/api/function/get.decorator.js +13 -15
- package/dist/esm/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/update.decorator.d.ts +2 -5
- package/dist/esm/decorator/api/function/update.decorator.js +13 -15
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.js +2 -0
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +2 -0
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.js +2 -0
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +4 -0
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.js +4 -2
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +21 -3
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +2 -0
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/observable.decorator.d.ts +3 -1
- package/dist/esm/decorator/api/service/observable.decorator.js +3 -1
- package/dist/esm/decorator/api/service/observable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service.decorator.js +39 -0
- package/dist/esm/decorator/api/service.decorator.js.map +1 -1
- package/dist/esm/decorator/api/subscriber/function.decorator.d.ts +23 -5
- package/dist/esm/decorator/api/subscriber/function.decorator.js +21 -3
- package/dist/esm/decorator/api/subscriber/function.decorator.js.map +1 -1
- package/dist/esm/decorator/api/subscriber/route.decorator.d.ts +23 -5
- package/dist/esm/decorator/api/subscriber/route.decorator.js +21 -3
- package/dist/esm/decorator/api/subscriber/route.decorator.js.map +1 -1
- package/dist/esm/enum/decorator/api/action.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/authentication-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/controller/load-relations-strategy.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/controller/request-transformer-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/dto-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/function/type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/on-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/data-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/date/identifier.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/date/type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/desribe-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/number-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/property/string-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/route-type.enum.js.map +1 -1
- package/dist/esm/enum/exception.enum.js.map +1 -1
- package/dist/esm/enum/filter-operation.enum.js.map +1 -1
- package/dist/esm/enum/filter-order-direction.enum.js.map +1 -1
- package/dist/esm/enum/utility/error-string/action.enum.js.map +1 -1
- package/dist/esm/enum/utility/error-string/composite-action.enum.js.map +1 -1
- package/dist/esm/enum/validator/has-paired-custom-suffixes-fields-argument-type.enum.js.map +1 -1
- package/dist/esm/enum/validator/must-match-one-of-schemas-error-type.enum.js.map +1 -1
- package/dist/esm/factory/api/controller.factory.js +23 -18
- package/dist/esm/factory/api/controller.factory.js.map +1 -1
- package/dist/esm/interceptor/correlation-id-response-body.interceptor.d.ts +1 -1
- package/dist/esm/interceptor/correlation-id-response-body.interceptor.js.map +1 -1
- package/dist/esm/interface/api-dto-validator.interface.d.ts +1 -1
- package/dist/esm/interface/class/api/subscriber/execution-context.interface.d.ts +2 -2
- package/dist/esm/interface/class/api/subscriber/function-execution-context.interface.d.ts +1 -1
- package/dist/esm/interface/class/api/subscriber/function.interface.d.ts +1 -1
- package/dist/esm/interface/class/api/subscriber/index.d.ts +6 -0
- package/dist/esm/interface/class/api/subscriber/route-execution-context.interface.d.ts +1 -1
- package/dist/esm/interface/class/api/subscriber/route.interface.d.ts +0 -1
- package/dist/esm/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/delete-executor-properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/properties.interface.d.ts +1 -1
- package/dist/esm/interface/decorator/api/function/update-executor-properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/index.d.ts +6 -6
- package/dist/esm/interface/decorator/api/subscriber/function-properties.interface.d.ts +1 -1
- package/dist/esm/interface/decorator/api/subscriber/index.d.ts +2 -2
- package/dist/esm/interface/decorator/api/subscriber/route-properties.interface.d.ts +1 -1
- package/dist/esm/interface/entity/column.interface.d.ts +1 -1
- package/dist/esm/module/api-subscriber.module.js.map +1 -1
- package/dist/esm/type/decorator/api/controller/constructor.type.d.ts +2 -2
- package/dist/esm/type/decorator/api/property/describe/enum-properties.type.d.ts +1 -1
- package/dist/esm/type/decorator/api/property/object/with-discriminator-properties.type.d.ts +1 -1
- package/dist/esm/type/decorator/api/service/keys.type.d.ts +1 -1
- package/dist/esm/type/factory/api/controller/target-methods.type.d.ts +1 -1
- package/dist/esm/type/utility/dto/generate-get-list-response-resource-class.type.d.ts +1 -0
- package/dist/esm/type/utility/dto/index.d.ts +1 -0
- package/dist/esm/utility/api/controller/apply-decorators.utility.d.ts +2 -1
- package/dist/esm/utility/api/controller/apply-decorators.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/apply-metadata.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 +0 -1
- package/dist/esm/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.d.ts +1 -6
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.js +0 -5
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-method-name.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-primary-column.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/write-dto-swagger.utility.js +3 -0
- package/dist/esm/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/esm/utility/api/filter-order-by-from-entity.utility.js +0 -1
- package/dist/esm/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-dynamic.utility.js +3 -0
- package/dist/esm/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-exception.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-get-list-response.utility.d.ts +4 -5
- package/dist/esm/utility/dto/generate-get-list-response.utility.js +2 -2
- package/dist/esm/utility/dto/generate-get-list-response.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-relation-response.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate.utility.js +15 -0
- package/dist/esm/utility/dto/generate.utility.js.map +1 -1
- package/dist/esm/utility/dto/get-get-list-query-base-class.utility.js.map +1 -1
- package/dist/esm/utility/dto/handle-date-property.utility.js.map +1 -1
- package/dist/esm/utility/dto/is-property-should-be-marked.utility.js.map +1 -1
- package/dist/esm/utility/dto/validate-property-config.utility.js.map +1 -1
- package/dist/esm/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/esm/utility/is-error-of-type.utility.js.map +1 -1
- package/dist/esm/utility/logger.utility.js +3 -5
- package/dist/esm/utility/logger.utility.js.map +1 -1
- package/dist/esm/validator/all-or-none-of-listed-properties.validator.js +1 -0
- package/dist/esm/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/validator/has-at-least-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/validator/has-at-least-one-property.validator.js +1 -0
- package/dist/esm/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/esm/validator/has-paired-custom-suffixes-fields.validator.js +1 -0
- package/dist/esm/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/esm/validator/is-regular-expression.validator.js.map +1 -1
- package/dist/esm/validator/must-match-one-of-schemas.validator.js +1 -0
- package/dist/esm/validator/must-match-one-of-schemas.validator.js.map +1 -1
- package/dist/esm/validator/only-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import type { IApiBaseEntity } from '../../../interface/api-base-entity.interfac
|
|
|
2
2
|
import type { IApiFunctionProperties } from '../../../interface/decorator/api/index';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a decorator that adds entity creation functionality to a service method
|
|
5
|
+
* @template E The entity type
|
|
5
6
|
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the create function
|
|
6
7
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity creation
|
|
7
8
|
*/
|
|
@@ -12,6 +12,7 @@ var logger_utility = require('../../../utility/logger.utility.js');
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates a decorator that adds entity creation functionality to a service method
|
|
15
|
+
* @template E The entity type
|
|
15
16
|
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the create function
|
|
16
17
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity creation
|
|
17
18
|
*/
|
|
@@ -21,9 +22,9 @@ function ApiFunctionCreate(properties) {
|
|
|
21
22
|
descriptor.value = async function (createProperties, eventManager) {
|
|
22
23
|
const entityInstance = new entity();
|
|
23
24
|
const executionContext = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
DATA: { eventManager, repository: this.repository },
|
|
26
|
+
ENTITY: entityInstance,
|
|
27
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.CREATE,
|
|
27
28
|
result: createProperties,
|
|
28
29
|
};
|
|
29
30
|
const result = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.CREATE, onType_enum.EApiSubscriberOnType.BEFORE, executionContext);
|
|
@@ -35,13 +36,14 @@ function ApiFunctionCreate(properties) {
|
|
|
35
36
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.CREATE, onType_enum.EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
36
37
|
throw errorException_utility.ErrorException("Repository is not available in this context");
|
|
37
38
|
}
|
|
38
|
-
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
39
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result ?? {}, repository });
|
|
39
40
|
};
|
|
40
41
|
return descriptor;
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
/**
|
|
44
45
|
* Executes the entity creation operation with error handling
|
|
46
|
+
* @template E The entity type
|
|
45
47
|
* @param {IApiFunctionCreateExecutorProperties<E>} options - Properties required for entity creation
|
|
46
48
|
* @returns {Promise<E>} The created entity instance
|
|
47
49
|
* @throws {InternalServerErrorException} If the creation operation fails
|
|
@@ -59,9 +61,9 @@ async function executor(options) {
|
|
|
59
61
|
}
|
|
60
62
|
const entityInstance = new entity();
|
|
61
63
|
const executionContext = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
DATA: { eventManager, repository },
|
|
65
|
+
ENTITY: entityInstance,
|
|
66
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.CREATE,
|
|
65
67
|
result: result,
|
|
66
68
|
};
|
|
67
69
|
const afterResult = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, type_enum.EApiFunctionType.CREATE, onType_enum.EApiSubscriberOnType.AFTER, executionContext);
|
|
@@ -73,9 +75,9 @@ async function executor(options) {
|
|
|
73
75
|
catch (error) {
|
|
74
76
|
const entityInstance = new entity();
|
|
75
77
|
const executionContext = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
DATA: { eventManager, properties, repository },
|
|
79
|
+
ENTITY: entityInstance,
|
|
80
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.CREATE,
|
|
79
81
|
};
|
|
80
82
|
if (error instanceof common.HttpException) {
|
|
81
83
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, type_enum.EApiFunctionType.CREATE, onType_enum.EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.decorator.js","sources":["../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","HttpException","LoggerUtility","InternalServerErrorException","ErrorString","EErrorStringAction"],"mappings":";;;;;;;;;;;;AAeA
|
|
1
|
+
{"version":3,"file":"create.decorator.js","sources":["../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","HttpException","LoggerUtility","InternalServerErrorException","ErrorString","EErrorStringAction"],"mappings":";;;;;;;;;;;;AAeA;;;;;AAKG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;AAExD,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,gBAAiD,EAAE,YAA4B,EAAA;AACtJ,YAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,YAAA,MAAM,gBAAgB,GAAwG;gBAC7H,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACnD,gBAAA,MAAM,EAAE,cAAc;gBACtB,aAAa,EAAEA,0BAAgB,CAAC,MAAM;AACtC,gBAAA,MAAM,EAAE,gBAAgB;aACxB;YAED,MAAM,MAAM,GAAgD,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,0BAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;YAE9Q,IAAI,MAAM,EAAE;AACX,gBAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;;AAGjC,YAAA,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU;YAEjD,IAAI,CAAC,UAAU,EAAE;gBAChB,MAAMD,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA6D,EAAE,cAAc,EAAED,0BAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,YAAY,EAAE,gBAAgB,EAAE,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAElR,gBAAA,MAAMC,qCAAc,CAAC,6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,IAAI,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE;AAC9C,YAAA,MAAM,EAAE,cAAc;YACtB,aAAa,EAAEF,0BAAgB,CAAC,MAAM;SACtC;AAED,QAAA,IAAI,KAAK,YAAYI,oBAAa,EAAE;YACnC,MAAMH,oCAAqB,CAAC,0BAA0B,CAAC,WAAW,EAAE,cAAc,EAAED,0BAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,CAAC;AAEvK,YAAA,MAAM,KAAK;;AAGZ,QAAAG,4BAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;QAC5G,MAAMJ,oCAAqB,CAAC,0BAA0B,CAAC,WAAW,EAAE,cAAc,EAAED,0BAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAc,CAAC;AAEhL,QAAA,MAAM,IAAII,mCAA4B,CACrCC,+BAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAEC,8BAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -34,6 +34,7 @@ function ApiFunction(properties) {
|
|
|
34
34
|
const { entity, type } = properties;
|
|
35
35
|
return function (_target, propertyKey, descriptor) {
|
|
36
36
|
const originalMethod = descriptor.value;
|
|
37
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
37
38
|
descriptor.value = function (...arguments_) {
|
|
38
39
|
let decoratorFunction;
|
|
39
40
|
switch (type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sources":["../../../../../../src/decorator/api/function/decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiFunctionCreate","ApiFunctionDelete","ApiFunctionGet","ApiFunctionGetList","ApiFunctionGetMany","ApiFunctionUpdate","ErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"decorator.js","sources":["../../../../../../src/decorator/api/function/decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiFunctionCreate","ApiFunctionDelete","ApiFunctionGet","ApiFunctionGetList","ApiFunctionGetMany","ApiFunctionUpdate","ErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcA;;;;;;AAMG;AACH;AACM,SAAU,WAAW,CAA8B,UAAqC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAA8B,UAAU;AAE9D,IAAA,OAAO,UAAU,OAAgB,EAAE,WAAmB,EAAE,UAA8B,EAAA;AACrF,QAAA,MAAM,cAAc,GAAY,UAAU,CAAC,KAAK;;AAGhD,QAAA,UAAU,CAAC,KAAK,GAAG,UAA+C,GAAG,UAA0B,EAAA;AAC9F,YAAA,IAAI,iBAA+G;YAEnH,QAAQ,IAAI;AACX,gBAAA,KAAKA,0BAAgB,CAAC,MAAM,EAAE;AAC7B,oBAAA,iBAAiB,GAAGC,kCAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAEjD;;AAGD,gBAAA,KAAKD,0BAAgB,CAAC,MAAM,EAAE;AAC7B,oBAAA,iBAAiB,GAAGE,kCAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAEjD;;AAGD,gBAAA,KAAKF,0BAAgB,CAAC,GAAG,EAAE;AAC1B,oBAAA,iBAAiB,GAAGG,4BAAc,CAAC,EAAE,MAAM,EAAE,CAAC;oBAE9C;;AAGD,gBAAA,KAAKH,0BAAgB,CAAC,QAAQ,EAAE;AAC/B,oBAAA,iBAAiB,GAAGI,oCAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAElD;;AAGD,gBAAA,KAAKJ,0BAAgB,CAAC,QAAQ,EAAE;AAC/B,oBAAA,iBAAiB,GAAGK,oCAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAElD;;AAGD,gBAAA,KAAKL,0BAAgB,CAAC,MAAM,EAAE;AAC7B,oBAAA,iBAAiB,GAAGM,kCAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;oBAEjD;;gBAGD,SAAS;AACR,oBAAA,MAAMC,qCAAc,CAAC,sBAAsB,CAAC;;;AAI9C,YAAA,MAAM,kBAAkB,GAAuB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAC9G,YAAA,MAAM,cAAc,GAA0C,kBAAkB,CAAC,KAA8C;YAE/H,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC;AAC9C,SAAC;AAED,QAAA,OAAO,UAAU;AAClB,KAAC;AACF;;;;"}
|
|
@@ -2,11 +2,8 @@ import type { IApiBaseEntity } from '../../../interface/api-base-entity.interfac
|
|
|
2
2
|
import type { IApiFunctionProperties } from '../../../interface/decorator/api/index';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a decorator that adds entity deletion functionality to a service method
|
|
5
|
-
* @
|
|
5
|
+
* @template E The entity type
|
|
6
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the delete function
|
|
6
7
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity deletion
|
|
7
8
|
*/
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param properties
|
|
11
|
-
*/
|
|
12
9
|
export declare function ApiFunctionDelete<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -25,13 +25,10 @@ var get_decorator = require('./get.decorator.js');
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates a decorator that adds entity deletion functionality to a service method
|
|
28
|
-
* @
|
|
28
|
+
* @template E The entity type
|
|
29
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the delete function
|
|
29
30
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity deletion
|
|
30
31
|
*/
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param properties
|
|
34
|
-
*/
|
|
35
32
|
function ApiFunctionDelete(properties) {
|
|
36
33
|
const { entity } = properties;
|
|
37
34
|
const getDecorator = get_decorator.ApiFunctionGet({ entity });
|
|
@@ -40,9 +37,9 @@ function ApiFunctionDelete(properties) {
|
|
|
40
37
|
descriptor.value = async function (criteria, eventManager) {
|
|
41
38
|
const entityInstance = new entity();
|
|
42
39
|
const executionContext = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
DATA: { criteria, eventManager, repository: this.repository },
|
|
41
|
+
ENTITY: entityInstance,
|
|
42
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.DELETE,
|
|
46
43
|
result: criteria,
|
|
47
44
|
};
|
|
48
45
|
const result = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.DELETE, onType_enum.EApiSubscriberOnType.BEFORE, executionContext);
|
|
@@ -68,13 +65,14 @@ function ApiFunctionDelete(properties) {
|
|
|
68
65
|
throw errorException_utility.ErrorException("Get function is not properly decorated");
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
|
-
return executor({ constructor: this.constructor, criteria: executionContext.result, entity, eventManager, getFunction, repository });
|
|
68
|
+
return executor({ constructor: this.constructor, criteria: executionContext.result ?? {}, entity, eventManager, getFunction, repository });
|
|
72
69
|
};
|
|
73
70
|
return descriptor;
|
|
74
71
|
};
|
|
75
72
|
}
|
|
76
73
|
/**
|
|
77
74
|
* Executes the entity deletion operation with error handling
|
|
75
|
+
* @template E The entity type
|
|
78
76
|
* @param {IApiFunctionDeleteExecutorProperties<E>} options - Properties required for entity deletion
|
|
79
77
|
* @returns {Promise<E>} The deleted entity instance
|
|
80
78
|
* @throws {InternalServerErrorException} If the deletion operation fails
|
|
@@ -92,9 +90,9 @@ async function executor(options) {
|
|
|
92
90
|
result = await repository.remove(existingEntity);
|
|
93
91
|
}
|
|
94
92
|
const executionContext = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
DATA: { criteria, eventManager, repository },
|
|
94
|
+
ENTITY: existingEntity,
|
|
95
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.DELETE,
|
|
98
96
|
result: result,
|
|
99
97
|
};
|
|
100
98
|
const afterResult = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, existingEntity, type_enum.EApiFunctionType.DELETE, onType_enum.EApiSubscriberOnType.AFTER, executionContext);
|
|
@@ -106,9 +104,9 @@ async function executor(options) {
|
|
|
106
104
|
catch (error) {
|
|
107
105
|
const entityInstance = new entity();
|
|
108
106
|
const executionContext = {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
DATA: { criteria, eventManager, repository },
|
|
108
|
+
ENTITY: entityInstance,
|
|
109
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.DELETE,
|
|
112
110
|
};
|
|
113
111
|
if (error instanceof common.HttpException) {
|
|
114
112
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, type_enum.EApiFunctionType.DELETE, onType_enum.EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":["ApiFunctionGet","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","HttpException","LoggerUtility","InternalServerErrorException","ErrorString","EErrorStringAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":["ApiFunctionGet","EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","HttpException","LoggerUtility","InternalServerErrorException","ErrorString","EErrorStringAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiBA;;;;;AAKG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,YAAY,GAAiGA,4BAAc,CAAI,EAAE,MAAM,EAAE,CAAC;AAChJ,IAAA,IAAI,WAAmG;AAEvG,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,QAAuC,EAAE,YAA4B,EAAA;AAC5I,YAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,YAAA,MAAM,gBAAgB,GAA6E;gBAClG,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AAC7D,gBAAA,MAAM,EAAE,cAAc;gBACtB,aAAa,EAAEC,0BAAgB,CAAC,MAAM;AACtC,gBAAA,MAAM,EAAE,QAAQ;aAChB;YAED,MAAM,MAAM,GAA8C,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAAgC,EAAE,cAAc,EAAED,0BAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;YAE/O,IAAI,MAAM,EAAE;AACX,gBAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;;AAGjC,YAAA,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU;YAEjD,IAAI,CAAC,UAAU,EAAE;gBAChB,MAAMD,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAAgC,EAAE,cAAc,EAAED,0BAAgB,CAAC,MAAM,EAAEE,gCAAoB,CAAC,YAAY,EAAE,gBAAgB,EAAE,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AA4B,CACrCC,+BAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAEC,8BAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -2,11 +2,8 @@ import type { IApiBaseEntity } from '../../../interface/api-base-entity.interfac
|
|
|
2
2
|
import type { IApiFunctionProperties } from '../../../interface/decorator/api/index';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a decorator that adds entity list retrieval functionality to a service method
|
|
5
|
-
* @
|
|
5
|
+
* @template E The entity type
|
|
6
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the get-list function
|
|
6
7
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity list retrieval
|
|
7
8
|
*/
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param properties
|
|
11
|
-
*/
|
|
12
9
|
export declare function ApiFunctionGetList<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -24,22 +24,19 @@ var logger_utility = require('../../../utility/logger.utility.js');
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a decorator that adds entity list retrieval functionality to a service method
|
|
27
|
-
* @
|
|
27
|
+
* @template E The entity type
|
|
28
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the get-list function
|
|
28
29
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity list retrieval
|
|
29
30
|
*/
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @param properties
|
|
33
|
-
*/
|
|
34
31
|
function ApiFunctionGetList(properties) {
|
|
35
32
|
const { entity } = properties;
|
|
36
33
|
return function (_target, _propertyKey, descriptor) {
|
|
37
34
|
descriptor.value = async function (getListProperties, eventManager) {
|
|
38
35
|
const entityInstance = new entity();
|
|
39
36
|
const executionContext = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
DATA: { eventManager, getListProperties, repository: this.repository },
|
|
38
|
+
ENTITY: entityInstance,
|
|
39
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET_LIST,
|
|
43
40
|
result: getListProperties,
|
|
44
41
|
};
|
|
45
42
|
const result = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.GET_LIST, onType_enum.EApiSubscriberOnType.BEFORE, executionContext);
|
|
@@ -51,13 +48,30 @@ function ApiFunctionGetList(properties) {
|
|
|
51
48
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.GET_LIST, onType_enum.EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
52
49
|
throw errorException_utility.ErrorException("Repository is not available in this context");
|
|
53
50
|
}
|
|
54
|
-
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
51
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result ?? {}, repository });
|
|
55
52
|
};
|
|
56
53
|
return descriptor;
|
|
57
54
|
};
|
|
58
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Calculates the current page number based on the provided properties.
|
|
58
|
+
* @template E The entity type
|
|
59
|
+
* @param {TApiFunctionGetListProperties<E>} properties - The properties for the get-list function.
|
|
60
|
+
* @param {number} itemsLength - The number of items on the current page.
|
|
61
|
+
* @returns {number} The current page number.
|
|
62
|
+
*/
|
|
63
|
+
function calculateCurrentPage(properties, itemsLength) {
|
|
64
|
+
if (itemsLength === 0) {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
if (properties.skip) {
|
|
68
|
+
return Math.ceil(properties.skip / (properties.take ?? 1)) + 1;
|
|
69
|
+
}
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
59
72
|
/**
|
|
60
73
|
* Executes the entity list retrieval operation with error handling
|
|
74
|
+
* @template E The entity type
|
|
61
75
|
* @param {IApiFunctionGetListExecutorProperties<E>} options - Properties required for entity list retrieval
|
|
62
76
|
* @returns {Promise<IApiGetListResponseResult<E>>} The paginated list of entities with count information
|
|
63
77
|
* @throws {InternalServerErrorException} If the list retrieval operation fails
|
|
@@ -76,15 +90,15 @@ async function executor(options) {
|
|
|
76
90
|
}
|
|
77
91
|
const result = {
|
|
78
92
|
count: items.length,
|
|
79
|
-
currentPage:
|
|
93
|
+
currentPage: calculateCurrentPage(properties, items.length),
|
|
80
94
|
items,
|
|
81
95
|
totalCount,
|
|
82
96
|
totalPages: Math.ceil(totalCount / (properties.take ?? 1)),
|
|
83
97
|
};
|
|
84
98
|
const executionContext = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
99
|
+
DATA: { eventManager, properties, repository },
|
|
100
|
+
ENTITY: new entity(),
|
|
101
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET_LIST,
|
|
88
102
|
result: result,
|
|
89
103
|
};
|
|
90
104
|
const afterResult = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, new entity(), type_enum.EApiFunctionType.GET_LIST, onType_enum.EApiSubscriberOnType.AFTER, executionContext);
|
|
@@ -96,9 +110,9 @@ async function executor(options) {
|
|
|
96
110
|
catch (error) {
|
|
97
111
|
const entityInstance = new entity();
|
|
98
112
|
const executionContext = {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
113
|
+
DATA: { eventManager, properties, repository },
|
|
114
|
+
ENTITY: entityInstance,
|
|
115
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET_LIST,
|
|
102
116
|
};
|
|
103
117
|
if (error instanceof common.HttpException) {
|
|
104
118
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, type_enum.EApiFunctionType.GET_LIST, onType_enum.EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-list.decorator.js","sources":["../../../../../../src/decorator/api/function/get-list.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","HttpException","LoggerUtility","InternalServerErrorException","ErrorString","EErrorStringAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-list.decorator.js","sources":["../../../../../../src/decorator/api/function/get-list.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","HttpException","LoggerUtility","InternalServerErrorException","ErrorString","EErrorStringAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA;;;;;AAKG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;AAExD,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAE,YAA4B,EAAA;AACxJ,YAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,YAAA,MAAM,gBAAgB,GAAgF;gBACrG,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,gBAAA,MAAM,EAAE,cAAc;gBACtB,aAAa,EAAEA,0BAAgB,CAAC,QAAQ;AACxC,gBAAA,MAAM,EAAE,iBAAiB;aACzB;YAED,MAAM,MAAM,GAAmC,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAAgC,EAAE,cAAc,EAAED,0BAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;YAEtO,IAAI,MAAM,EAAE;AACX,gBAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;;A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,QAAQ,EAAEE,gCAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAK,CAAC;AAEzK,YAAA,MAAM,KAAK;;AAGZ,QAAAG,4BAAa,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAA,+BAAA,EAAkC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;QACtH,MAAMJ,oCAAqB,CAAC,0BAA0B,CAAC,WAAW,EAAE,cAAc,EAAED,0BAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAc,CAAC;AAElL,QAAA,MAAM,IAAII,mCAA4B,CACrCC,+BAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAEC,8BAAkB,CAAC,mBAAmB;AAC5C,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -2,11 +2,8 @@ import type { IApiBaseEntity } from '../../../interface/api-base-entity.interfac
|
|
|
2
2
|
import type { IApiFunctionProperties } from '../../../interface/decorator/api/index';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a decorator that adds functionality to retrieve multiple entities to a service method
|
|
5
|
-
* @
|
|
5
|
+
* @template E The entity type
|
|
6
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the get-many function
|
|
6
7
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle retrieving multiple entities
|
|
7
8
|
*/
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param properties
|
|
11
|
-
*/
|
|
12
9
|
export declare function ApiFunctionGetMany<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -24,22 +24,19 @@ var logger_utility = require('../../../utility/logger.utility.js');
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a decorator that adds functionality to retrieve multiple entities to a service method
|
|
27
|
-
* @
|
|
27
|
+
* @template E The entity type
|
|
28
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the get-many function
|
|
28
29
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle retrieving multiple entities
|
|
29
30
|
*/
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @param properties
|
|
33
|
-
*/
|
|
34
31
|
function ApiFunctionGetMany(properties) {
|
|
35
32
|
const { entity } = properties;
|
|
36
33
|
return function (_target, _propertyKey, descriptor) {
|
|
37
34
|
descriptor.value = async function (getManyProperties, eventManager) {
|
|
38
35
|
const entityInstance = new entity();
|
|
39
36
|
const executionContext = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
DATA: { eventManager, getManyProperties, repository: this.repository },
|
|
38
|
+
ENTITY: entityInstance,
|
|
39
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET_MANY,
|
|
43
40
|
result: getManyProperties,
|
|
44
41
|
};
|
|
45
42
|
const result = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.GET_MANY, onType_enum.EApiSubscriberOnType.BEFORE, executionContext);
|
|
@@ -51,13 +48,14 @@ function ApiFunctionGetMany(properties) {
|
|
|
51
48
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.GET_MANY, onType_enum.EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
52
49
|
throw errorException_utility.ErrorException("Repository is not available in this context");
|
|
53
50
|
}
|
|
54
|
-
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
51
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result ?? {}, repository });
|
|
55
52
|
};
|
|
56
53
|
return descriptor;
|
|
57
54
|
};
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* Executes the retrieval of multiple entities with error handling
|
|
58
|
+
* @template E The entity type
|
|
61
59
|
* @param {IApiFunctionGetManyExecutorProperties<E>} options - Properties required for retrieving multiple entities
|
|
62
60
|
* @returns {Promise<Array<E>>} An array of retrieved entity instances
|
|
63
61
|
* @throws {NotFoundException} If no entities are found
|
|
@@ -78,9 +76,9 @@ async function executor(options) {
|
|
|
78
76
|
throw new common.NotFoundException(errorString_utility.ErrorString({ entity, type: action_enum.EErrorStringAction.NOT_FOUND }));
|
|
79
77
|
}
|
|
80
78
|
const executionContext = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
DATA: { eventManager, properties, repository },
|
|
80
|
+
ENTITY: new entity(),
|
|
81
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET_MANY,
|
|
84
82
|
result: items,
|
|
85
83
|
};
|
|
86
84
|
const afterResult = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, new entity(), type_enum.EApiFunctionType.GET_MANY, onType_enum.EApiSubscriberOnType.AFTER, executionContext);
|
|
@@ -92,9 +90,9 @@ async function executor(options) {
|
|
|
92
90
|
catch (error) {
|
|
93
91
|
const entityInstance = new entity();
|
|
94
92
|
const executionContext = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
DATA: { eventManager, properties, repository },
|
|
94
|
+
ENTITY: entityInstance,
|
|
95
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET_MANY,
|
|
98
96
|
};
|
|
99
97
|
if (error instanceof common.HttpException) {
|
|
100
98
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, type_enum.EApiFunctionType.GET_MANY, onType_enum.EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-many.decorator.js","sources":["../../../../../../src/decorator/api/function/get-many.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","NotFoundException","ErrorString","EErrorStringAction","HttpException","LoggerUtility","InternalServerErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"get-many.decorator.js","sources":["../../../../../../src/decorator/api/function/get-many.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","NotFoundException","ErrorString","EErrorStringAction","HttpException","LoggerUtility","InternalServerErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAeA;;;;;AAKG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;AAExD,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,iBAAmD,EAAE,YAA4B,EAAA;AACxJ,YAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,YAAA,MAAM,gBAAgB,GAAgF;gBACrG,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,gBAAA,MAAM,EAAE,cAAc;gBACtB,aAAa,EAAEA,0BAAgB,CAAC,QAAQ;AACxC,gBAAA,MAAM,EAAE,iBAAiB;aACzB;YAED,MAAM,MAAM,GAAmC,MAAMC,oCAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAAgC,EAAE,cAAc,EAAED,0BAAgB,CAAC,QAAQ,EAAEE,gCAAoB,CAAC,MAAM,EAAE,gBAAgB,CAAC;YAEtO,IAAI,MAAM,EAAE;AACX,gBAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;;AAGjC,YAAA,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU;YAEjD,IAAI,CAAC,UAAU,EAAE;gBAChB,MAAMD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
|
|
|
2
2
|
import type { IApiFunctionProperties } from '../../../interface/decorator/api/index';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a decorator that adds single entity retrieval functionality to a service method
|
|
5
|
-
* @
|
|
5
|
+
* @template E The entity type
|
|
6
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the get function
|
|
6
7
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle single entity retrieval
|
|
7
8
|
*/
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param properties
|
|
11
|
-
*/
|
|
12
9
|
export declare function ApiFunctionGet<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -24,22 +24,19 @@ var logger_utility = require('../../../utility/logger.utility.js');
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Creates a decorator that adds single entity retrieval functionality to a service method
|
|
27
|
-
* @
|
|
27
|
+
* @template E The entity type
|
|
28
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the get function
|
|
28
29
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle single entity retrieval
|
|
29
30
|
*/
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @param properties
|
|
33
|
-
*/
|
|
34
31
|
function ApiFunctionGet(properties) {
|
|
35
32
|
const { entity } = properties;
|
|
36
33
|
return function (_target, _propertyKey, descriptor) {
|
|
37
34
|
descriptor.value = async function (getProperties, eventManager) {
|
|
38
35
|
const entityInstance = new entity();
|
|
39
36
|
const executionContext = {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
DATA: { eventManager, getProperties, repository: this.repository },
|
|
38
|
+
ENTITY: entityInstance,
|
|
39
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET,
|
|
43
40
|
result: getProperties,
|
|
44
41
|
};
|
|
45
42
|
const result = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.GET, onType_enum.EApiSubscriberOnType.BEFORE, executionContext);
|
|
@@ -51,13 +48,14 @@ function ApiFunctionGet(properties) {
|
|
|
51
48
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, type_enum.EApiFunctionType.GET, onType_enum.EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
52
49
|
throw errorException_utility.ErrorException("Repository is not available in this context");
|
|
53
50
|
}
|
|
54
|
-
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
51
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result ?? {}, repository });
|
|
55
52
|
};
|
|
56
53
|
return descriptor;
|
|
57
54
|
};
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* Executes the single entity retrieval operation with error handling
|
|
58
|
+
* @template E The entity type
|
|
61
59
|
* @param {IApiFunctionGetExecutorProperties<E>} options - Properties required for entity retrieval
|
|
62
60
|
* @returns {Promise<E>} The retrieved entity instance
|
|
63
61
|
* @throws {NotFoundException} If the entity is not found
|
|
@@ -78,9 +76,9 @@ async function executor(options) {
|
|
|
78
76
|
throw new common.NotFoundException(errorString_utility.ErrorString({ entity, type: action_enum.EErrorStringAction.NOT_FOUND }));
|
|
79
77
|
}
|
|
80
78
|
const executionContext = {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
DATA: { eventManager, properties, repository },
|
|
80
|
+
ENTITY: item,
|
|
81
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET,
|
|
84
82
|
result: item,
|
|
85
83
|
};
|
|
86
84
|
const afterResult = await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, item, type_enum.EApiFunctionType.GET, onType_enum.EApiSubscriberOnType.AFTER, executionContext);
|
|
@@ -92,9 +90,9 @@ async function executor(options) {
|
|
|
92
90
|
catch (error) {
|
|
93
91
|
const entityInstance = new entity();
|
|
94
92
|
const executionContext = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
DATA: { eventManager, properties, repository },
|
|
94
|
+
ENTITY: entityInstance,
|
|
95
|
+
FUNCTION_TYPE: type_enum.EApiFunctionType.GET,
|
|
98
96
|
};
|
|
99
97
|
if (error instanceof common.HttpException) {
|
|
100
98
|
await executor_class.ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, type_enum.EApiFunctionType.GET, onType_enum.EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.decorator.js","sources":["../../../../../../src/decorator/api/function/get.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","NotFoundException","ErrorString","EErrorStringAction","HttpException","LoggerUtility","InternalServerErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcA
|
|
1
|
+
{"version":3,"file":"get.decorator.js","sources":["../../../../../../src/decorator/api/function/get.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiSubscriberExecutor","EApiSubscriberOnType","ErrorException","NotFoundException","ErrorString","EErrorStringAction","HttpException","LoggerUtility","InternalServerErrorException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcA;;;;;AAKG;AACG,SAAU,cAAc,CAA2B,UAAqC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;AAExD,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AAMtF,QAAA,UAAU,CAAC,KAAK,GAAG,gBAAqD,aAA2C,EAAE,YAA4B,EAAA;AAChJ,YAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,YAAA,MAAM,gBAAgB,GAA4E;gBACjG,IAAI,E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BAAgB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;QACzG,MAAMP,oCAAqB,CAAC,0BAA0B,CAAC,WAAW,EAAE,cAAc,EAAED,0BAAgB,CAAC,GAAG,EAAEE,gCAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAc,CAAC;AAE7K,QAAA,MAAM,IAAIO,mCAA4B,CACrCJ,+BAAW,CAAC;YACX,MAAM;YACN,IAAI,EAAEC,8BAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -2,11 +2,8 @@ import type { IApiBaseEntity } from '../../../interface/api-base-entity.interfac
|
|
|
2
2
|
import type { IApiFunctionProperties } from '../../../interface/decorator/api/function/index';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a decorator that adds entity update functionality to a service method
|
|
5
|
-
* @
|
|
5
|
+
* @template E The entity type
|
|
6
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the update function
|
|
6
7
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity updates
|
|
7
8
|
*/
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
* @param properties
|
|
11
|
-
*/
|
|
12
9
|
export declare function ApiFunctionUpdate<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|