@elsikora/nestjs-crud-automator 1.9.0-dev.2 → 1.10.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/class/api/index.d.ts +2 -1
- package/dist/cjs/class/api/subscriber/base.class.d.ts +3 -0
- package/dist/cjs/class/api/subscriber/base.class.js +7 -0
- package/dist/cjs/class/api/subscriber/base.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.d.ts +9 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.js +46 -0
- package/dist/cjs/class/api/subscriber/discovery-service.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/executor.class.d.ts +10 -0
- package/dist/cjs/class/api/subscriber/executor.class.js +52 -0
- package/dist/cjs/class/api/subscriber/executor.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/function-base.class.d.ts +5 -0
- package/dist/cjs/class/api/subscriber/function-base.class.js +9 -0
- package/dist/cjs/class/api/subscriber/function-base.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/index.d.ts +6 -0
- package/dist/cjs/class/api/subscriber/registry.class.d.ts +15 -0
- package/dist/cjs/class/api/subscriber/registry.class.js +57 -0
- package/dist/cjs/class/api/subscriber/registry.class.js.map +1 -0
- package/dist/cjs/class/api/subscriber/route-base.class.d.ts +5 -0
- package/dist/cjs/class/api/subscriber/route-base.class.js +9 -0
- package/dist/cjs/class/api/subscriber/route-base.class.js.map +1 -0
- package/dist/cjs/class/metadata-storage.class.js +1 -2
- package/dist/cjs/class/metadata-storage.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/property/factory/number.class.js +1 -0
- package/dist/cjs/class/utility/dto/property/factory/number.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js +1 -0
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/body.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/query.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/response.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/cjs/constant/decorator/api/controller.constant.d.ts +1 -0
- package/dist/cjs/constant/decorator/api/controller.constant.js +2 -0
- package/dist/cjs/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/property-describe.constant.d.ts +1 -1
- package/dist/cjs/constant/decorator/api/property-describe.constant.js +2 -2
- package/dist/cjs/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/cjs/constant/decorator/api/service.constant.d.ts +3 -0
- package/dist/cjs/constant/decorator/api/service.constant.js +9 -0
- package/dist/cjs/constant/decorator/api/service.constant.js.map +1 -0
- package/dist/cjs/constant/decorator/api/subscriber.constant.d.ts +4 -0
- package/dist/cjs/constant/decorator/api/subscriber.constant.js +11 -0
- package/dist/cjs/constant/decorator/api/subscriber.constant.js.map +1 -0
- package/dist/cjs/constant/utility/dto/constant.js +1 -0
- package/dist/cjs/constant/utility/dto/constant.js.map +1 -1
- package/dist/cjs/constant/validator/has-paired-custom-suffixes-fields.constant.js +0 -1
- package/dist/cjs/constant/validator/has-paired-custom-suffixes-fields.constant.js.map +1 -1
- package/dist/cjs/decorator/api/controller/index.d.ts +1 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.d.ts +4 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js +15 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/function/create.decorator.d.ts +2 -2
- package/dist/cjs/decorator/api/function/create.decorator.js +45 -8
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.js +1 -1
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +59 -7
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.js +56 -10
- package/dist/cjs/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.js +53 -5
- package/dist/cjs/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/get.decorator.js +53 -5
- package/dist/cjs/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.d.ts +5 -1
- package/dist/cjs/decorator/api/function/update.decorator.js +60 -11
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/index.d.ts +6 -3
- package/dist/cjs/decorator/api/method.decorator.js +1 -0
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +1 -2
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/copy.decorator.js +1 -1
- package/dist/cjs/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +1 -2
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.js +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +0 -2
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +1 -4
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +0 -4
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +4 -21
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +1 -2
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/index.d.ts +1 -0
- package/dist/cjs/decorator/api/service/observable.decorator.d.ts +4 -0
- package/dist/cjs/decorator/api/service/observable.decorator.js +15 -0
- package/dist/cjs/decorator/api/service/observable.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/service.decorator.js +3 -37
- package/dist/cjs/decorator/api/service.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/subscriber/function.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/subscriber/function.decorator.js +18 -0
- package/dist/cjs/decorator/api/subscriber/function.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.js +18 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.js.map +1 -0
- package/dist/cjs/enum/decorator/api/index.d.ts +5 -4
- package/dist/cjs/enum/decorator/api/on-type.enum.d.ts +6 -0
- package/dist/cjs/enum/decorator/api/on-type.enum.js +10 -0
- package/dist/cjs/enum/decorator/api/on-type.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js +14 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js +31 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js +222 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js +11 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js +131 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js.map +1 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js +19 -0
- package/dist/cjs/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js.map +1 -0
- package/dist/cjs/factory/api/controller.factory.d.ts +2 -1
- package/dist/cjs/factory/api/controller.factory.js +299 -105
- package/dist/cjs/factory/api/controller.factory.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interface/class/api/subscriber/execution-context.interface.d.ts +15 -0
- package/dist/cjs/interface/class/api/subscriber/function-execution-context.interface.d.ts +6 -0
- package/dist/cjs/interface/class/api/subscriber/function.interface.d.ts +31 -0
- package/dist/cjs/interface/class/api/subscriber/interface.d.ts +2 -0
- package/dist/cjs/interface/class/api/subscriber/route-execution-context.interface.d.ts +6 -0
- package/dist/cjs/interface/class/api/subscriber/route.interface.d.ts +39 -0
- package/dist/cjs/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/delete-executor-properties.interface.d.ts +5 -4
- package/dist/cjs/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/properties.interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/function/update-executor-properties.interface.d.ts +5 -4
- package/dist/cjs/interface/decorator/api/index.d.ts +6 -5
- package/dist/cjs/interface/decorator/api/subscriber/function-properties.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/subscriber/route-properties.interface.d.ts +5 -0
- package/dist/cjs/module/api-subscriber.module.d.ts +2 -0
- package/dist/cjs/module/api-subscriber.module.js +17 -0
- package/dist/cjs/module/api-subscriber.module.js.map +1 -0
- package/dist/cjs/module/index.d.ts +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/utility/api/controller/apply-decorators.utility.js +1 -0
- package/dist/cjs/utility/api/controller/apply-decorators.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/apply-metadata.utility.js +1 -0
- package/dist/cjs/utility/api/controller/apply-metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js +1 -0
- 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 +5 -0
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js +5 -1
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js +4 -0
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/transform-data.utility.js +1 -0
- package/dist/cjs/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js +2 -4
- 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 +1 -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 +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-dynamic.utility.js +1 -3
- package/dist/cjs/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-exception.utility.js +1 -0
- package/dist/cjs/utility/dto/generate-exception.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-get-list-response.utility.js +1 -0
- package/dist/cjs/utility/dto/generate-get-list-response.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate.utility.js +4 -18
- package/dist/cjs/utility/dto/generate.utility.js.map +1 -1
- package/dist/cjs/utility/dto/get-get-list-query-base-class.utility.js +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/cjs/utility/dto/is-property-should-be-marked.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is-should-be-generated.utility.js +1 -0
- package/dist/cjs/utility/dto/is-should-be-generated.utility.js.map +1 -1
- package/dist/cjs/utility/logger.utility.js +3 -2
- package/dist/cjs/utility/logger.utility.js.map +1 -1
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/cjs/validator/must-match-one-of-schemas.validator.js +0 -1
- 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 +0 -1
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/class/api/index.d.ts +2 -1
- package/dist/esm/class/api/subscriber/base.class.d.ts +3 -0
- package/dist/esm/class/api/subscriber/base.class.js +5 -0
- package/dist/esm/class/api/subscriber/base.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.d.ts +9 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.js +46 -0
- package/dist/esm/class/api/subscriber/discovery-service.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/executor.class.d.ts +10 -0
- package/dist/esm/class/api/subscriber/executor.class.js +50 -0
- package/dist/esm/class/api/subscriber/executor.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/function-base.class.d.ts +5 -0
- package/dist/esm/class/api/subscriber/function-base.class.js +7 -0
- package/dist/esm/class/api/subscriber/function-base.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/index.d.ts +6 -0
- package/dist/esm/class/api/subscriber/registry.class.d.ts +15 -0
- package/dist/esm/class/api/subscriber/registry.class.js +55 -0
- package/dist/esm/class/api/subscriber/registry.class.js.map +1 -0
- package/dist/esm/class/api/subscriber/route-base.class.d.ts +5 -0
- package/dist/esm/class/api/subscriber/route-base.class.js +7 -0
- package/dist/esm/class/api/subscriber/route-base.class.js.map +1 -0
- package/dist/esm/class/metadata-storage.class.js +1 -2
- package/dist/esm/class/metadata-storage.class.js.map +1 -1
- package/dist/esm/class/utility/dto/property/factory/number.class.js +1 -0
- package/dist/esm/class/utility/dto/property/factory/number.class.js.map +1 -1
- package/dist/esm/class/utility/dto/property/factory/relation.class.js +1 -0
- package/dist/esm/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/body.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/query.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/response.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/esm/constant/decorator/api/controller.constant.d.ts +1 -0
- package/dist/esm/constant/decorator/api/controller.constant.js +2 -0
- package/dist/esm/constant/decorator/api/controller.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/property-describe.constant.d.ts +1 -1
- package/dist/esm/constant/decorator/api/property-describe.constant.js +2 -2
- package/dist/esm/constant/decorator/api/property-describe.constant.js.map +1 -1
- package/dist/esm/constant/decorator/api/service.constant.d.ts +3 -0
- package/dist/esm/constant/decorator/api/service.constant.js +7 -0
- package/dist/esm/constant/decorator/api/service.constant.js.map +1 -0
- package/dist/esm/constant/decorator/api/subscriber.constant.d.ts +4 -0
- package/dist/esm/constant/decorator/api/subscriber.constant.js +9 -0
- package/dist/esm/constant/decorator/api/subscriber.constant.js.map +1 -0
- package/dist/esm/constant/utility/dto/constant.js +1 -0
- package/dist/esm/constant/utility/dto/constant.js.map +1 -1
- package/dist/esm/constant/validator/has-paired-custom-suffixes-fields.constant.js +0 -1
- package/dist/esm/constant/validator/has-paired-custom-suffixes-fields.constant.js.map +1 -1
- package/dist/esm/decorator/api/controller/index.d.ts +1 -0
- package/dist/esm/decorator/api/controller/observable.decorator.d.ts +4 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js +13 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js.map +1 -0
- package/dist/esm/decorator/api/function/create.decorator.d.ts +2 -2
- package/dist/esm/decorator/api/function/create.decorator.js +45 -8
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/decorator.js +1 -1
- package/dist/esm/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/delete.decorator.js +59 -7
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-list.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/get-list.decorator.js +56 -10
- package/dist/esm/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-many.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/get-many.decorator.js +53 -5
- package/dist/esm/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/get.decorator.js +53 -5
- package/dist/esm/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/update.decorator.d.ts +5 -1
- package/dist/esm/decorator/api/function/update.decorator.js +60 -11
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/index.d.ts +6 -3
- package/dist/esm/decorator/api/method.decorator.js +1 -0
- package/dist/esm/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.js +1 -2
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/copy.decorator.js +1 -1
- package/dist/esm/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +1 -2
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.js +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.js +0 -2
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +1 -4
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.js +0 -4
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +4 -21
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +1 -2
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/index.d.ts +1 -0
- package/dist/esm/decorator/api/service/observable.decorator.d.ts +4 -0
- package/dist/esm/decorator/api/service/observable.decorator.js +13 -0
- package/dist/esm/decorator/api/service/observable.decorator.js.map +1 -0
- package/dist/esm/decorator/api/service.decorator.js +3 -37
- package/dist/esm/decorator/api/service.decorator.js.map +1 -1
- package/dist/esm/decorator/api/subscriber/function.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/subscriber/function.decorator.js +16 -0
- package/dist/esm/decorator/api/subscriber/function.decorator.js.map +1 -0
- package/dist/esm/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.js +16 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.js.map +1 -0
- package/dist/esm/enum/decorator/api/index.d.ts +5 -4
- package/dist/esm/enum/decorator/api/on-type.enum.d.ts +6 -0
- package/dist/esm/enum/decorator/api/on-type.enum.js +10 -0
- package/dist/esm/enum/decorator/api/on-type.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js +14 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/domain/enum/logger-log-level.enum.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js +29 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/error.class.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js +220 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/class/base/registry.class.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js +9 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/constant/console-logger-default-options.constant.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js +129 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/infrastructure/service/console-logger.service.js.map +1 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js +17 -0
- package/dist/esm/external/@elsikora/cladi/dist/esm/presentation/utility/create/registry.utility.js.map +1 -0
- package/dist/esm/factory/api/controller.factory.d.ts +2 -1
- package/dist/esm/factory/api/controller.factory.js +299 -105
- package/dist/esm/factory/api/controller.factory.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interface/class/api/subscriber/execution-context.interface.d.ts +15 -0
- package/dist/esm/interface/class/api/subscriber/function-execution-context.interface.d.ts +6 -0
- package/dist/esm/interface/class/api/subscriber/function.interface.d.ts +31 -0
- package/dist/esm/interface/class/api/subscriber/interface.d.ts +2 -0
- package/dist/esm/interface/class/api/subscriber/route-execution-context.interface.d.ts +6 -0
- package/dist/esm/interface/class/api/subscriber/route.interface.d.ts +39 -0
- package/dist/esm/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/delete-executor-properties.interface.d.ts +5 -4
- package/dist/esm/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/properties.interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/function/update-executor-properties.interface.d.ts +5 -4
- package/dist/esm/interface/decorator/api/index.d.ts +6 -5
- package/dist/esm/interface/decorator/api/subscriber/function-properties.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/subscriber/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/subscriber/route-properties.interface.d.ts +5 -0
- package/dist/esm/module/api-subscriber.module.d.ts +2 -0
- package/dist/esm/module/api-subscriber.module.js +17 -0
- package/dist/esm/module/api-subscriber.module.js.map +1 -0
- package/dist/esm/module/index.d.ts +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/utility/api/controller/apply-decorators.utility.js +1 -0
- package/dist/esm/utility/api/controller/apply-decorators.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/apply-metadata.utility.js +1 -0
- package/dist/esm/utility/api/controller/apply-metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/transform-filter.utility.js +1 -0
- 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 +5 -0
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.js +5 -1
- package/dist/esm/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js +4 -0
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/transform-data.utility.js +1 -0
- package/dist/esm/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/write-dto-swagger.utility.js +2 -4
- 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 +1 -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 +1 -0
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-dynamic.utility.js +1 -3
- package/dist/esm/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-exception.utility.js +1 -0
- package/dist/esm/utility/dto/generate-exception.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-filter-decorator.utility.js +1 -0
- package/dist/esm/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-get-list-response.utility.js +1 -0
- package/dist/esm/utility/dto/generate-get-list-response.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate.utility.js +4 -18
- package/dist/esm/utility/dto/generate.utility.js.map +1 -1
- package/dist/esm/utility/dto/get-get-list-query-base-class.utility.js +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/esm/utility/dto/is-property-should-be-marked.utility.js.map +1 -1
- package/dist/esm/utility/dto/is-should-be-generated.utility.js +1 -0
- package/dist/esm/utility/dto/is-should-be-generated.utility.js.map +1 -1
- package/dist/esm/utility/logger.utility.js +3 -2
- package/dist/esm/utility/logger.utility.js.map +1 -1
- package/dist/esm/validator/all-or-none-of-listed-properties.validator.js +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/dist/esm/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/esm/validator/must-match-one-of-schemas.validator.js +0 -1
- 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 +0 -1
- package/dist/esm/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/package.json +21 -18
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ApiSubscriberExecutor } from '../../../class/api/subscriber/executor.class.js';
|
|
2
|
+
import { EApiFunctionType } from '../../../enum/decorator/api/function/type.enum.js';
|
|
3
|
+
import { EApiSubscriberOnType } from '../../../enum/decorator/api/on-type.enum.js';
|
|
1
4
|
import { EErrorStringAction } from '../../../enum/utility/error-string/action.enum.js';
|
|
2
5
|
import '../../../enum/utility/error-string/composite-action.enum.js';
|
|
3
6
|
import { HttpException, InternalServerErrorException } from '@nestjs/common';
|
|
@@ -7,19 +10,30 @@ import { LoggerUtility } from '../../../utility/logger.utility.js';
|
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* Creates a decorator that adds entity creation functionality to a service method
|
|
10
|
-
* @param {IApiFunctionProperties} properties - Configuration properties for the create function
|
|
13
|
+
* @param {IApiFunctionProperties<E>} properties - Configuration properties for the create function
|
|
11
14
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity creation
|
|
12
15
|
*/
|
|
13
|
-
// eslint-disable-next-line @elsikora/typescript/no-unnecessary-type-parameters
|
|
14
16
|
function ApiFunctionCreate(properties) {
|
|
15
17
|
const { entity } = properties;
|
|
16
|
-
return function (
|
|
17
|
-
descriptor.value = async function (
|
|
18
|
+
return function (_target, _propertyKey, descriptor) {
|
|
19
|
+
descriptor.value = async function (createProperties, eventManager) {
|
|
20
|
+
const entityInstance = new entity();
|
|
21
|
+
const executionContext = {
|
|
22
|
+
data: { eventManager, repository: this.repository },
|
|
23
|
+
entity: entityInstance,
|
|
24
|
+
functionType: EApiFunctionType.CREATE,
|
|
25
|
+
result: createProperties,
|
|
26
|
+
};
|
|
27
|
+
const result = await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.CREATE, EApiSubscriberOnType.BEFORE, executionContext);
|
|
28
|
+
if (result) {
|
|
29
|
+
executionContext.result = result;
|
|
30
|
+
}
|
|
18
31
|
const repository = this.repository;
|
|
19
32
|
if (!repository) {
|
|
33
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.CREATE, EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
20
34
|
throw ErrorException("Repository is not available in this context");
|
|
21
35
|
}
|
|
22
|
-
return executor({ entity, eventManager, properties, repository });
|
|
36
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
23
37
|
};
|
|
24
38
|
return descriptor;
|
|
25
39
|
};
|
|
@@ -31,19 +45,42 @@ function ApiFunctionCreate(properties) {
|
|
|
31
45
|
* @throws {InternalServerErrorException} If the creation operation fails
|
|
32
46
|
*/
|
|
33
47
|
async function executor(options) {
|
|
34
|
-
const { entity, eventManager, properties, repository } = options;
|
|
48
|
+
const { constructor, entity, eventManager, properties, repository } = options;
|
|
35
49
|
try {
|
|
50
|
+
let result;
|
|
36
51
|
if (eventManager) {
|
|
37
52
|
const eventRepository = eventManager.getRepository(entity);
|
|
38
|
-
|
|
53
|
+
result = await eventRepository.save(properties);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
result = await repository.save(properties);
|
|
39
57
|
}
|
|
40
|
-
|
|
58
|
+
const entityInstance = new entity();
|
|
59
|
+
const executionContext = {
|
|
60
|
+
data: { eventManager, repository },
|
|
61
|
+
entity: entityInstance,
|
|
62
|
+
functionType: EApiFunctionType.CREATE,
|
|
63
|
+
result: result,
|
|
64
|
+
};
|
|
65
|
+
const afterResult = await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.CREATE, EApiSubscriberOnType.AFTER, executionContext);
|
|
66
|
+
if (afterResult) {
|
|
67
|
+
return afterResult;
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
41
70
|
}
|
|
42
71
|
catch (error) {
|
|
72
|
+
const entityInstance = new entity();
|
|
73
|
+
const executionContext = {
|
|
74
|
+
data: { eventManager, properties, repository },
|
|
75
|
+
entity: entityInstance,
|
|
76
|
+
functionType: EApiFunctionType.CREATE,
|
|
77
|
+
};
|
|
43
78
|
if (error instanceof HttpException) {
|
|
79
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.CREATE, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
44
80
|
throw error;
|
|
45
81
|
}
|
|
46
82
|
LoggerUtility.getLogger("ApiFunctionCreate").verbose(`Error creating entity ${String(entity.name)}:`, error);
|
|
83
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.CREATE, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
47
84
|
throw new InternalServerErrorException(ErrorString({
|
|
48
85
|
entity: entity,
|
|
49
86
|
type: EErrorStringAction.CREATING_ERROR,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.decorator.js","sources":["../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.decorator.js","sources":["../../../../../../src/decorator/api/function/create.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAeA;;;;AAIG;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,GAAG,IAAI,MAAM,EAAE;AAEnC,YAAA,MAAM,gBAAgB,GAAoG;gBACzH,IAAI,EAAE,EAAE,YAAY,EAAE,UAA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,MAAM,EAAE,oBAAoB,CAAC,WAAW,EAAE,gBAAgB,EAAE,KAAc,CAAC;AAEhL,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -4,6 +4,7 @@ import '../../../enum/decorator/api/controller/load-relations-strategy.enum.js';
|
|
|
4
4
|
import '../../../enum/decorator/api/controller/request-transformer-type.enum.js';
|
|
5
5
|
import '../../../enum/decorator/api/dto-type.enum.js';
|
|
6
6
|
import { EApiFunctionType } from '../../../enum/decorator/api/function/type.enum.js';
|
|
7
|
+
import '../../../enum/decorator/api/on-type.enum.js';
|
|
7
8
|
import '../../../enum/decorator/api/property/data-type.enum.js';
|
|
8
9
|
import '../../../enum/decorator/api/property/date/identifier.enum.js';
|
|
9
10
|
import '../../../enum/decorator/api/property/date/type.enum.js';
|
|
@@ -31,7 +32,6 @@ function ApiFunction(properties) {
|
|
|
31
32
|
const { entity, type } = properties;
|
|
32
33
|
return function (_target, propertyKey, descriptor) {
|
|
33
34
|
const originalMethod = descriptor.value;
|
|
34
|
-
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
35
35
|
descriptor.value = function (...arguments_) {
|
|
36
36
|
let decoratorFunction;
|
|
37
37
|
switch (type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator.js","sources":["../../../../../../src/decorator/api/function/decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"decorator.js","sources":["../../../../../../src/decorator/api/function/decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;AAMG;AACH;AACM,SAAU,WAAW,CAA8B,UAAqC,EAAA;AAC7F,IAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAA8B,UAAU;AAE9D,IAAA,OAA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,SAAC;AAED,QAAA,OAAO,UAAU;AAClB,KAAC;AACF;;;;"}
|
|
@@ -5,4 +5,8 @@ import type { IApiFunctionProperties } from '../../../interface/decorator/api/in
|
|
|
5
5
|
* @param {IApiFunctionProperties} properties - Configuration properties for the delete function
|
|
6
6
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity deletion
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param properties
|
|
11
|
+
*/
|
|
12
|
+
export declare function ApiFunctionDelete<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import { ApiSubscriberExecutor } from '../../../class/api/subscriber/executor.class.js';
|
|
2
|
+
import '../../../enum/decorator/api/action.enum.js';
|
|
3
|
+
import '../../../enum/decorator/api/authentication-type.enum.js';
|
|
4
|
+
import '../../../enum/decorator/api/controller/load-relations-strategy.enum.js';
|
|
5
|
+
import '../../../enum/decorator/api/controller/request-transformer-type.enum.js';
|
|
6
|
+
import '../../../enum/decorator/api/dto-type.enum.js';
|
|
7
|
+
import { EApiFunctionType } from '../../../enum/decorator/api/function/type.enum.js';
|
|
8
|
+
import { EApiSubscriberOnType } from '../../../enum/decorator/api/on-type.enum.js';
|
|
9
|
+
import '../../../enum/decorator/api/property/data-type.enum.js';
|
|
10
|
+
import '../../../enum/decorator/api/property/date/identifier.enum.js';
|
|
11
|
+
import '../../../enum/decorator/api/property/date/type.enum.js';
|
|
12
|
+
import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
13
|
+
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
|
+
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
|
+
import '../../../enum/decorator/api/route-type.enum.js';
|
|
1
16
|
import { EErrorStringAction } from '../../../enum/utility/error-string/action.enum.js';
|
|
2
17
|
import '../../../enum/utility/error-string/composite-action.enum.js';
|
|
3
18
|
import { HttpException, InternalServerErrorException } from '@nestjs/common';
|
|
@@ -11,15 +26,30 @@ import { ApiFunctionGet } from './get.decorator.js';
|
|
|
11
26
|
* @param {IApiFunctionProperties} properties - Configuration properties for the delete function
|
|
12
27
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity deletion
|
|
13
28
|
*/
|
|
14
|
-
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param properties
|
|
32
|
+
*/
|
|
15
33
|
function ApiFunctionDelete(properties) {
|
|
16
34
|
const { entity } = properties;
|
|
17
35
|
const getDecorator = ApiFunctionGet({ entity });
|
|
18
36
|
let getFunction;
|
|
19
|
-
return function (
|
|
37
|
+
return function (_target, _propertyKey, descriptor) {
|
|
20
38
|
descriptor.value = async function (criteria, eventManager) {
|
|
39
|
+
const entityInstance = new entity();
|
|
40
|
+
const executionContext = {
|
|
41
|
+
data: { criteria, eventManager, repository: this.repository },
|
|
42
|
+
entity: entityInstance,
|
|
43
|
+
functionType: EApiFunctionType.DELETE,
|
|
44
|
+
result: criteria,
|
|
45
|
+
};
|
|
46
|
+
const result = await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.DELETE, EApiSubscriberOnType.BEFORE, executionContext);
|
|
47
|
+
if (result) {
|
|
48
|
+
executionContext.result = result;
|
|
49
|
+
}
|
|
21
50
|
const repository = this.repository;
|
|
22
51
|
if (!repository) {
|
|
52
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.DELETE, EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
23
53
|
throw ErrorException("Repository is not available in this context");
|
|
24
54
|
}
|
|
25
55
|
if (!getFunction) {
|
|
@@ -36,7 +66,7 @@ function ApiFunctionDelete(properties) {
|
|
|
36
66
|
throw ErrorException("Get function is not properly decorated");
|
|
37
67
|
}
|
|
38
68
|
}
|
|
39
|
-
return executor({ criteria, entity, eventManager, getFunction, repository });
|
|
69
|
+
return executor({ constructor: this.constructor, criteria: executionContext.result, entity, eventManager, getFunction, repository });
|
|
40
70
|
};
|
|
41
71
|
return descriptor;
|
|
42
72
|
};
|
|
@@ -48,23 +78,45 @@ function ApiFunctionDelete(properties) {
|
|
|
48
78
|
* @throws {InternalServerErrorException} If the deletion operation fails
|
|
49
79
|
*/
|
|
50
80
|
async function executor(options) {
|
|
51
|
-
const { criteria, entity, eventManager, getFunction, repository } = options;
|
|
81
|
+
const { constructor, criteria, entity, eventManager, getFunction, repository } = options;
|
|
52
82
|
try {
|
|
53
83
|
const existingEntity = await getFunction({ where: criteria });
|
|
84
|
+
let result;
|
|
54
85
|
if (eventManager) {
|
|
55
86
|
const eventRepository = eventManager.getRepository(entity);
|
|
56
|
-
|
|
87
|
+
result = await eventRepository.remove(existingEntity);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
result = await repository.remove(existingEntity);
|
|
57
91
|
}
|
|
58
|
-
|
|
92
|
+
const executionContext = {
|
|
93
|
+
data: { criteria, eventManager, repository },
|
|
94
|
+
entity: existingEntity,
|
|
95
|
+
functionType: EApiFunctionType.DELETE,
|
|
96
|
+
result: result,
|
|
97
|
+
};
|
|
98
|
+
const afterResult = await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, existingEntity, EApiFunctionType.DELETE, EApiSubscriberOnType.AFTER, executionContext);
|
|
99
|
+
if (afterResult) {
|
|
100
|
+
return afterResult;
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
59
103
|
}
|
|
60
104
|
catch (error) {
|
|
105
|
+
const entityInstance = new entity();
|
|
106
|
+
const executionContext = {
|
|
107
|
+
data: { criteria, eventManager, repository },
|
|
108
|
+
entity: entityInstance,
|
|
109
|
+
functionType: EApiFunctionType.DELETE,
|
|
110
|
+
};
|
|
61
111
|
if (error instanceof HttpException) {
|
|
112
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.DELETE, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
62
113
|
throw error;
|
|
63
114
|
}
|
|
64
115
|
LoggerUtility.getLogger("ApiFunctionDelete").verbose(`Error deleting entity ${String(entity.name)}:`, error);
|
|
116
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.DELETE, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
65
117
|
throw new InternalServerErrorException(ErrorString({
|
|
66
118
|
entity: entity,
|
|
67
|
-
type: EErrorStringAction.
|
|
119
|
+
type: EErrorStringAction.DELETING_ERROR,
|
|
68
120
|
}));
|
|
69
121
|
}
|
|
70
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete.decorator.js","sources":["../../../../../../src/decorator/api/function/delete.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;AAIG;AAEH;;;AAGG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,YAAY,GAA6F,cAAc,CAAI,EAAE,MAAM,EAAE,CAAC;AAC5I,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,GAAG,IAAI,MAAM,EAAE;AAEnC,YAAA,MAAM,gBAAgB,GAAkF;gBACvG,IAAI,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,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AAY,EAAE,gBAAgB,CAAC,MAAM;SACrC;AAED,QAAA,IAAI,KAAK,YAAY,aAAa,EAAE;YACnC,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,CAAC,WAAkB,EAAE,gBAAgB,EAAE,KAAK,CAAC;AAC9K,YAAA,MAAM,KAAK;;AAGZ,QAAA,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;QAC5G,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,CAAC,WAAkB,EAAE,gBAAgB,EAAE,KAAc,CAAC;AAEvL,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -5,4 +5,8 @@ import type { IApiFunctionProperties } from '../../../interface/decorator/api/in
|
|
|
5
5
|
* @param {IApiFunctionProperties} properties - Configuration properties for the get-list function
|
|
6
6
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity list retrieval
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param properties
|
|
11
|
+
*/
|
|
12
|
+
export declare function ApiFunctionGetList<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import { ApiSubscriberExecutor } from '../../../class/api/subscriber/executor.class.js';
|
|
2
|
+
import '../../../enum/decorator/api/action.enum.js';
|
|
3
|
+
import '../../../enum/decorator/api/authentication-type.enum.js';
|
|
4
|
+
import '../../../enum/decorator/api/controller/load-relations-strategy.enum.js';
|
|
5
|
+
import '../../../enum/decorator/api/controller/request-transformer-type.enum.js';
|
|
6
|
+
import '../../../enum/decorator/api/dto-type.enum.js';
|
|
7
|
+
import { EApiFunctionType } from '../../../enum/decorator/api/function/type.enum.js';
|
|
8
|
+
import { EApiSubscriberOnType } from '../../../enum/decorator/api/on-type.enum.js';
|
|
9
|
+
import '../../../enum/decorator/api/property/data-type.enum.js';
|
|
10
|
+
import '../../../enum/decorator/api/property/date/identifier.enum.js';
|
|
11
|
+
import '../../../enum/decorator/api/property/date/type.enum.js';
|
|
12
|
+
import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
13
|
+
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
|
+
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
|
+
import '../../../enum/decorator/api/route-type.enum.js';
|
|
1
16
|
import { EErrorStringAction } from '../../../enum/utility/error-string/action.enum.js';
|
|
2
17
|
import '../../../enum/utility/error-string/composite-action.enum.js';
|
|
3
18
|
import { HttpException, InternalServerErrorException } from '@nestjs/common';
|
|
@@ -10,16 +25,31 @@ import { LoggerUtility } from '../../../utility/logger.utility.js';
|
|
|
10
25
|
* @param {IApiFunctionProperties} properties - Configuration properties for the get-list function
|
|
11
26
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle entity list retrieval
|
|
12
27
|
*/
|
|
13
|
-
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param properties
|
|
31
|
+
*/
|
|
14
32
|
function ApiFunctionGetList(properties) {
|
|
15
33
|
const { entity } = properties;
|
|
16
34
|
return function (_target, _propertyKey, descriptor) {
|
|
17
|
-
descriptor.value = async function (
|
|
35
|
+
descriptor.value = async function (getListProperties, eventManager) {
|
|
36
|
+
const entityInstance = new entity();
|
|
37
|
+
const executionContext = {
|
|
38
|
+
data: { eventManager, getListProperties, repository: this.repository },
|
|
39
|
+
entity: entityInstance,
|
|
40
|
+
functionType: EApiFunctionType.GET_LIST,
|
|
41
|
+
result: getListProperties,
|
|
42
|
+
};
|
|
43
|
+
const result = await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.GET_LIST, EApiSubscriberOnType.BEFORE, executionContext);
|
|
44
|
+
if (result) {
|
|
45
|
+
executionContext.result = result;
|
|
46
|
+
}
|
|
18
47
|
const repository = this.repository;
|
|
19
48
|
if (!repository) {
|
|
49
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.GET_LIST, EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
20
50
|
throw ErrorException("Repository is not available in this context");
|
|
21
51
|
}
|
|
22
|
-
return executor({ entity, eventManager, properties, repository });
|
|
52
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
23
53
|
};
|
|
24
54
|
return descriptor;
|
|
25
55
|
};
|
|
@@ -31,7 +61,7 @@ function ApiFunctionGetList(properties) {
|
|
|
31
61
|
* @throws {InternalServerErrorException} If the list retrieval operation fails
|
|
32
62
|
*/
|
|
33
63
|
async function executor(options) {
|
|
34
|
-
const { entity, eventManager, properties, repository } = options;
|
|
64
|
+
const { constructor, entity, eventManager, properties, repository } = options;
|
|
35
65
|
try {
|
|
36
66
|
let items;
|
|
37
67
|
let totalCount;
|
|
@@ -42,22 +72,38 @@ async function executor(options) {
|
|
|
42
72
|
else {
|
|
43
73
|
[items, totalCount] = await repository.findAndCount(properties);
|
|
44
74
|
}
|
|
45
|
-
|
|
75
|
+
const result = {
|
|
46
76
|
count: items.length,
|
|
47
|
-
|
|
48
|
-
// eslint-disable-next-line @elsikora/sonar/no-nested-conditional,@elsikora/unicorn/no-nested-ternary
|
|
49
|
-
currentPage: items.length === 0 ? 0 : properties.skip ? Math.ceil(properties.skip / properties?.take) + 1 : 1,
|
|
77
|
+
currentPage: items.length === 0 ? 0 : (properties.skip ? Math.ceil(properties.skip / (properties.take ?? 1)) + 1 : 1),
|
|
50
78
|
items,
|
|
51
79
|
totalCount,
|
|
52
|
-
|
|
53
|
-
totalPages: Math.ceil(totalCount / properties.take),
|
|
80
|
+
totalPages: Math.ceil(totalCount / (properties.take ?? 1)),
|
|
54
81
|
};
|
|
82
|
+
const executionContext = {
|
|
83
|
+
data: { eventManager, properties, repository },
|
|
84
|
+
entity: new entity(),
|
|
85
|
+
functionType: EApiFunctionType.GET_LIST,
|
|
86
|
+
result: result,
|
|
87
|
+
};
|
|
88
|
+
const afterResult = await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, new entity(), EApiFunctionType.GET_LIST, EApiSubscriberOnType.AFTER, executionContext);
|
|
89
|
+
if (afterResult) {
|
|
90
|
+
return afterResult;
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
55
93
|
}
|
|
56
94
|
catch (error) {
|
|
95
|
+
const entityInstance = new entity();
|
|
96
|
+
const executionContext = {
|
|
97
|
+
data: { properties, eventManager, repository },
|
|
98
|
+
entity: entityInstance,
|
|
99
|
+
functionType: EApiFunctionType.GET_LIST,
|
|
100
|
+
};
|
|
57
101
|
if (error instanceof HttpException) {
|
|
102
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.GET_LIST, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
58
103
|
throw error;
|
|
59
104
|
}
|
|
60
105
|
LoggerUtility.getLogger("ApiFunctionGetList").verbose(`Error fetching list for entity ${String(entity.name)}:`, error);
|
|
106
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.GET_LIST, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
61
107
|
throw new InternalServerErrorException(ErrorString({
|
|
62
108
|
entity: entity,
|
|
63
109
|
type: EErrorStringAction.FETCHING_LIST_ERROR,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-list.decorator.js","sources":["../../../../../../src/decorator/api/function/get-list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-list.decorator.js","sources":["../../../../../../src/decorator/api/function/get-list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcA;;;;AAIG;AAEH;;;AAGG;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,GAAG,IAAI,MAAM,EAAE;AAEnC,YAAA,MAAM,gBAAgB,GAAqF;gBAC1G,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,gBAAA,MAAM,EAAE,cAAc;gBACtB,YAAY,EAAE,gBAAgB,CAAC,QAAQ;AACvC,gBAAA,MAAM,EAAE,iBAAiB;aACzB;YAED,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA4B,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAa,EAAE,gBAAgB,CAAC;YAEzM,IAAI,MAAM,EAAE;AACX,gBAAA,gBAAgB,CAAC,MAAM,GAAG,MAAM;;AAGjC,YAAA,MAAM,UAAU,GAAkB,IAAI,CAAC,UAAU;YAEjD,IAAI,CAAC,UAAU,EAAE;gBAChB,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA4B,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAA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QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,mBAAmB;AAC5C,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -5,4 +5,8 @@ import type { IApiFunctionProperties } from '../../../interface/decorator/api/in
|
|
|
5
5
|
* @param {IApiFunctionProperties} properties - Configuration properties for the get-many function
|
|
6
6
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle retrieving multiple entities
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param properties
|
|
11
|
+
*/
|
|
12
|
+
export declare function ApiFunctionGetMany<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
import { ApiSubscriberExecutor } from '../../../class/api/subscriber/executor.class.js';
|
|
2
|
+
import '../../../enum/decorator/api/action.enum.js';
|
|
3
|
+
import '../../../enum/decorator/api/authentication-type.enum.js';
|
|
4
|
+
import '../../../enum/decorator/api/controller/load-relations-strategy.enum.js';
|
|
5
|
+
import '../../../enum/decorator/api/controller/request-transformer-type.enum.js';
|
|
6
|
+
import '../../../enum/decorator/api/dto-type.enum.js';
|
|
7
|
+
import { EApiFunctionType } from '../../../enum/decorator/api/function/type.enum.js';
|
|
8
|
+
import { EApiSubscriberOnType } from '../../../enum/decorator/api/on-type.enum.js';
|
|
9
|
+
import '../../../enum/decorator/api/property/data-type.enum.js';
|
|
10
|
+
import '../../../enum/decorator/api/property/date/identifier.enum.js';
|
|
11
|
+
import '../../../enum/decorator/api/property/date/type.enum.js';
|
|
12
|
+
import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
13
|
+
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
|
+
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
|
+
import '../../../enum/decorator/api/route-type.enum.js';
|
|
1
16
|
import { EErrorStringAction } from '../../../enum/utility/error-string/action.enum.js';
|
|
2
17
|
import '../../../enum/utility/error-string/composite-action.enum.js';
|
|
3
18
|
import { NotFoundException, HttpException, InternalServerErrorException } from '@nestjs/common';
|
|
@@ -10,16 +25,31 @@ import { LoggerUtility } from '../../../utility/logger.utility.js';
|
|
|
10
25
|
* @param {IApiFunctionProperties} properties - Configuration properties for the get-many function
|
|
11
26
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle retrieving multiple entities
|
|
12
27
|
*/
|
|
13
|
-
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param properties
|
|
31
|
+
*/
|
|
14
32
|
function ApiFunctionGetMany(properties) {
|
|
15
33
|
const { entity } = properties;
|
|
16
|
-
return function (
|
|
17
|
-
descriptor.value = async function (
|
|
34
|
+
return function (_target, _propertyKey, descriptor) {
|
|
35
|
+
descriptor.value = async function (getManyProperties, eventManager) {
|
|
36
|
+
const entityInstance = new entity();
|
|
37
|
+
const executionContext = {
|
|
38
|
+
data: { eventManager, getManyProperties, repository: this.repository },
|
|
39
|
+
entity: entityInstance,
|
|
40
|
+
functionType: EApiFunctionType.GET_MANY,
|
|
41
|
+
result: getManyProperties,
|
|
42
|
+
};
|
|
43
|
+
const result = await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.GET_MANY, EApiSubscriberOnType.BEFORE, executionContext);
|
|
44
|
+
if (result) {
|
|
45
|
+
executionContext.result = result;
|
|
46
|
+
}
|
|
18
47
|
const repository = this.repository;
|
|
19
48
|
if (!repository) {
|
|
49
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(this.constructor, entityInstance, EApiFunctionType.GET_MANY, EApiSubscriberOnType.BEFORE_ERROR, executionContext, new Error("Repository is not available in this context"));
|
|
20
50
|
throw ErrorException("Repository is not available in this context");
|
|
21
51
|
}
|
|
22
|
-
return executor({ entity, eventManager, properties, repository });
|
|
52
|
+
return executor({ constructor: this.constructor, entity, eventManager, properties: executionContext.result, repository });
|
|
23
53
|
};
|
|
24
54
|
return descriptor;
|
|
25
55
|
};
|
|
@@ -32,7 +62,7 @@ function ApiFunctionGetMany(properties) {
|
|
|
32
62
|
* @throws {InternalServerErrorException} If the retrieval operation fails
|
|
33
63
|
*/
|
|
34
64
|
async function executor(options) {
|
|
35
|
-
const { entity, eventManager, properties, repository } = options;
|
|
65
|
+
const { constructor, entity, eventManager, properties, repository } = options;
|
|
36
66
|
try {
|
|
37
67
|
let items;
|
|
38
68
|
if (eventManager) {
|
|
@@ -45,13 +75,31 @@ async function executor(options) {
|
|
|
45
75
|
if (items.length === 0) {
|
|
46
76
|
throw new NotFoundException(ErrorString({ entity, type: EErrorStringAction.NOT_FOUND }));
|
|
47
77
|
}
|
|
78
|
+
const executionContext = {
|
|
79
|
+
data: { eventManager, properties, repository },
|
|
80
|
+
entity: new entity(),
|
|
81
|
+
functionType: EApiFunctionType.GET_MANY,
|
|
82
|
+
result: items,
|
|
83
|
+
};
|
|
84
|
+
const afterResult = await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, new entity(), EApiFunctionType.GET_MANY, EApiSubscriberOnType.AFTER, executionContext);
|
|
85
|
+
if (afterResult) {
|
|
86
|
+
return afterResult;
|
|
87
|
+
}
|
|
48
88
|
return items;
|
|
49
89
|
}
|
|
50
90
|
catch (error) {
|
|
91
|
+
const entityInstance = new entity();
|
|
92
|
+
const executionContext = {
|
|
93
|
+
data: { properties, eventManager, repository },
|
|
94
|
+
entity: entityInstance,
|
|
95
|
+
functionType: EApiFunctionType.GET_MANY,
|
|
96
|
+
};
|
|
51
97
|
if (error instanceof HttpException) {
|
|
98
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.GET_MANY, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
52
99
|
throw error;
|
|
53
100
|
}
|
|
54
101
|
LoggerUtility.getLogger("ApiFunctionGetMany").verbose(`Error fetching multiple entity ${String(entity.name)}:`, error);
|
|
102
|
+
await ApiSubscriberExecutor.executeFunctionSubscribers(constructor, entityInstance, EApiFunctionType.GET_MANY, EApiSubscriberOnType.AFTER_ERROR, executionContext, error);
|
|
55
103
|
throw new InternalServerErrorException(ErrorString({
|
|
56
104
|
entity,
|
|
57
105
|
type: EErrorStringAction.FETCHING_ERROR,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-many.decorator.js","sources":["../../../../../../src/decorator/api/function/get-many.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-many.decorator.js","sources":["../../../../../../src/decorator/api/function/get-many.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcA;;;;AAIG;AAEH;;;AAGG;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,GAAG,IAAI,MAAM,EAAE;AAEnC,YAAA,MAAM,gBAAgB,GAAqF;gBAC1G,IAAI,EAAE,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;AACtE,gBAAA,MAAM,EAAE,cAAc;gBACtB,YAAY,EAAE,gBAAgB,CAAC,QAAQ;AACvC,gBAAA,MAAM,EAAE,iBAAiB;aACzB;YAED,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,0BAA0B,CAAC,IAAI,CAAC,WAA4B,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,E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4B,CACrC,WAAW,CAAC;YACX,MAAM;YACN,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,CACF;;AAEH;;;;"}
|
|
@@ -5,4 +5,8 @@ import type { IApiFunctionProperties } from '../../../interface/decorator/api/in
|
|
|
5
5
|
* @param {IApiFunctionProperties} properties - Configuration properties for the get function
|
|
6
6
|
* @returns {(target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor} A decorator function that modifies the target method to handle single entity retrieval
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param properties
|
|
11
|
+
*/
|
|
12
|
+
export declare function ApiFunctionGet<E extends IApiBaseEntity>(properties: IApiFunctionProperties<E>): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|