@elsikora/nestjs-crud-automator 1.24.0-dev.1 → 2.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +213 -163
- package/dist/cjs/class/api/authorization/bootstrap-validation.service.class.d.ts +1 -0
- package/dist/cjs/class/api/authorization/bootstrap-validation.service.class.js +37 -3
- package/dist/cjs/class/api/authorization/bootstrap-validation.service.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/cache-invalidation.service.class.d.ts +7 -0
- package/dist/cjs/class/api/authorization/cache-invalidation.service.class.js +21 -0
- package/dist/cjs/class/api/authorization/cache-invalidation.service.class.js.map +1 -0
- package/dist/cjs/class/api/authorization/guard.class.d.ts +1 -2
- package/dist/cjs/class/api/authorization/guard.class.js +13 -18
- package/dist/cjs/class/api/authorization/guard.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/index.d.ts +1 -0
- package/dist/cjs/class/api/authorization/policy/executor.class.js +1 -2
- package/dist/cjs/class/api/authorization/policy/executor.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/policy/index.d.ts +1 -0
- package/dist/cjs/class/api/authorization/policy/registry.class.d.ts +3 -5
- package/dist/cjs/class/api/authorization/policy/registry.class.js +11 -34
- package/dist/cjs/class/api/authorization/policy/registry.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/policy/subscriber-wrapper.class.d.ts +10 -0
- package/dist/cjs/class/api/authorization/policy/subscriber-wrapper.class.js +23 -0
- package/dist/cjs/class/api/authorization/policy/subscriber-wrapper.class.js.map +1 -0
- package/dist/cjs/class/api/authorization/runtime.class.d.ts +3 -2
- package/dist/cjs/class/api/authorization/runtime.class.js +6 -5
- package/dist/cjs/class/api/authorization/runtime.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/simulator.class.d.ts +2 -0
- package/dist/cjs/class/api/authorization/simulator.class.js +1 -0
- package/dist/cjs/class/api/authorization/simulator.class.js.map +1 -1
- package/dist/cjs/class/api/function/context-storage.class.d.ts +7 -0
- package/dist/cjs/class/api/function/context-storage.class.js +16 -0
- package/dist/cjs/class/api/function/context-storage.class.js.map +1 -0
- package/dist/cjs/class/api/function/custom-runtime.class.d.ts +19 -0
- package/dist/cjs/class/api/function/custom-runtime.class.js +118 -0
- package/dist/cjs/class/api/function/custom-runtime.class.js.map +1 -0
- package/dist/cjs/class/api/function/index.d.ts +1 -0
- package/dist/cjs/class/api/function/transaction-scope.class.d.ts +6 -0
- package/dist/cjs/class/api/function/transaction-scope.class.js +34 -0
- package/dist/cjs/class/api/function/transaction-scope.class.js.map +1 -0
- package/dist/cjs/class/api/index.d.ts +2 -0
- package/dist/cjs/class/api/route-runtime.class.d.ts +21 -0
- package/dist/cjs/class/api/route-runtime.class.js +335 -0
- package/dist/cjs/class/api/route-runtime.class.js.map +1 -0
- package/dist/cjs/class/api/service-base.class.d.ts +9 -7
- package/dist/cjs/class/api/service-base.class.js +16 -6
- package/dist/cjs/class/api/service-base.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/executor.class.d.ts +7 -6
- package/dist/cjs/class/api/subscriber/executor.class.js +16 -12
- package/dist/cjs/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/index.d.ts +1 -0
- package/dist/cjs/class/api/subscriber/registry.class.d.ts +5 -2
- package/dist/cjs/class/api/subscriber/registry.class.js +26 -24
- package/dist/cjs/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/wrapper.class.d.ts +18 -0
- package/dist/cjs/class/api/subscriber/wrapper.class.js +23 -0
- package/dist/cjs/class/api/subscriber/wrapper.class.js.map +1 -0
- package/dist/cjs/class/utility/dto/exception/details/foreign-key-violation.class.js +5 -1
- package/dist/cjs/class/utility/dto/exception/details/foreign-key-violation.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/exception/details/unique-violation.class.js +5 -1
- package/dist/cjs/class/utility/dto/exception/details/unique-violation.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/property/factory/number.class.js +6 -2
- 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 +5 -1
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/body.class.js +5 -1
- package/dist/cjs/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/query.class.js +5 -1
- package/dist/cjs/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js +5 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/response.class.js +5 -1
- package/dist/cjs/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/cjs/constant/decorator/api/method.constant.d.ts +2 -3
- package/dist/cjs/constant/decorator/api/method.constant.js +4 -6
- package/dist/cjs/constant/decorator/api/method.constant.js.map +1 -1
- package/dist/cjs/constant/utility/dto/constant.js +6 -2
- package/dist/cjs/constant/utility/dto/constant.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.js +51 -24
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/custom.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/function/custom.decorator.js +47 -0
- package/dist/cjs/decorator/api/function/custom.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/function/decorator.js +16 -7
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +62 -41
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/decorator.js +40 -25
- package/dist/cjs/decorator/api/function/get/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/list.decorator.js +40 -25
- package/dist/cjs/decorator/api/function/get/list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/many.decorator.js +40 -25
- package/dist/cjs/decorator/api/function/get/many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/index.d.ts +1 -0
- package/dist/cjs/decorator/api/function/update.decorator.js +62 -41
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/index.d.ts +1 -0
- package/dist/cjs/decorator/api/method.decorator.d.ts +5 -6
- package/dist/cjs/decorator/api/method.decorator.js +65 -325
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +23 -4
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +23 -4
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +21 -3
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +28 -5
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +21 -3
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +25 -8
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +26 -4
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/route-custom.decorator.d.ts +9 -0
- package/dist/cjs/decorator/api/route-custom.decorator.js +101 -0
- package/dist/cjs/decorator/api/route-custom.decorator.js.map +1 -0
- package/dist/cjs/decorator/api/service/decorator.js +28 -23
- package/dist/cjs/decorator/api/service/decorator.js.map +1 -1
- package/dist/cjs/enum/decorator/api/controller/index.d.ts +3 -1
- package/dist/cjs/enum/decorator/api/controller/relation-reference-shape.enum.d.ts +4 -0
- package/dist/cjs/enum/decorator/api/controller/relation-reference-shape.enum.js +8 -0
- package/dist/cjs/enum/decorator/api/controller/relation-reference-shape.enum.js.map +1 -0
- package/dist/cjs/enum/decorator/api/controller/request/index.d.ts +2 -0
- package/dist/cjs/enum/decorator/api/controller/request/target.enum.d.ts +5 -0
- package/dist/cjs/enum/decorator/api/controller/request/target.enum.js +9 -0
- package/dist/cjs/enum/decorator/api/controller/request/target.enum.js.map +1 -0
- package/dist/cjs/enum/decorator/api/controller/{request-transformer-type.enum.js → request/transformer-type.enum.js} +1 -1
- package/dist/cjs/enum/decorator/api/controller/request/transformer-type.enum.js.map +1 -0
- package/dist/cjs/enum/decorator/api/controller/response-target.enum.d.ts +3 -0
- package/dist/cjs/enum/decorator/api/controller/response-target.enum.js +7 -0
- package/dist/cjs/enum/decorator/api/controller/response-target.enum.js.map +1 -0
- package/dist/cjs/enum/decorator/api/dto-type.enum.d.ts +1 -1
- package/dist/cjs/enum/decorator/api/dto-type.enum.js +1 -1
- package/dist/cjs/enum/decorator/api/dto-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/function-transaction-mode.enum.d.ts +6 -0
- package/dist/cjs/enum/decorator/api/function-transaction-mode.enum.js +10 -0
- package/dist/cjs/enum/decorator/api/function-transaction-mode.enum.js.map +1 -0
- package/dist/cjs/enum/decorator/api/function-type.enum.d.ts +1 -0
- package/dist/cjs/enum/decorator/api/function-type.enum.js +1 -0
- package/dist/cjs/enum/decorator/api/function-type.enum.js.map +1 -1
- package/dist/cjs/enum/decorator/api/index.d.ts +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/Observable.js +106 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/Observable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/Subscriber.js +158 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/Subscription.js +148 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/config.js +7 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/config.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/lastValueFrom.js +28 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/lastValueFrom.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/observable/from.js +11 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/observable/from.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/observable/innerFrom.js +154 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/observable/innerFrom.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +66 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/operators/observeOn.js +15 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/operators/observeOn.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/operators/subscribeOn.js +13 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/operators/subscribeOn.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleArray.js +23 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleArray.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js +28 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js +37 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js +12 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/schedulePromise.js +12 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/schedulePromise.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js +11 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduled.js +42 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduled/scheduled.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +20 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/symbol/iterator.js +13 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/symbol/iterator.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/symbol/observable.js +6 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/EmptyError.js +14 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/EmptyError.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +17 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/createErrorClass.js +15 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/errorContext.js +10 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/executeSchedule.js +22 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/executeSchedule.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/identity.js +8 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isArrayLike.js +6 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isArrayLike.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isAsyncIterable.js +10 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isAsyncIterable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isInteropObservable.js +11 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isInteropObservable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isIterable.js +11 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isIterable.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isPromise.js +10 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isPromise.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isReadableStreamLike.js +44 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/isReadableStreamLike.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/lift.js +26 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/lift.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/noop.js +6 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/pipe.js +18 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/reportUnhandledError.js +14 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/throwUnobservableError.js +8 -0
- package/dist/cjs/external/rxjs/dist/esm5/internal/util/throwUnobservableError.js.map +1 -0
- package/dist/cjs/external/tslib/tslib.es6.js +125 -0
- package/dist/cjs/external/tslib/tslib.es6.js.map +1 -1
- package/dist/cjs/factory/api-controller.factory.d.ts +1 -0
- package/dist/cjs/factory/api-controller.factory.js +42 -393
- package/dist/cjs/factory/api-controller.factory.js.map +1 -1
- package/dist/cjs/index.js +45 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interceptor/api-route-runtime.interceptor.d.ts +5 -0
- package/dist/cjs/interceptor/api-route-runtime.interceptor.js +29 -0
- package/dist/cjs/interceptor/api-route-runtime.interceptor.js.map +1 -0
- package/dist/cjs/interface/class/api/authorization/policy/registry.interface.d.ts +1 -0
- package/dist/cjs/interface/class/api/authorization/policy/subscriber/context/interface.d.ts +1 -1
- package/dist/cjs/interface/class/api/function/context/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/function/context/interface.d.ts +10 -0
- package/dist/cjs/interface/class/api/function/context/operations.interface.d.ts +13 -0
- package/dist/cjs/interface/class/api/function/index.d.ts +1 -0
- package/dist/cjs/interface/class/api/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/route/index.d.ts +1 -0
- package/dist/cjs/interface/class/api/route/runtime/context-data.interface.d.ts +10 -0
- package/dist/cjs/interface/class/api/route/runtime/custom-execution-options.interface.d.ts +9 -0
- package/dist/cjs/interface/class/api/route/runtime/generated/execution-options.interface.d.ts +14 -0
- package/dist/cjs/interface/class/api/route/runtime/generated/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/route/runtime/generated/targets.interface.d.ts +12 -0
- package/dist/cjs/interface/class/api/route/runtime/http-request.interface.d.ts +8 -0
- package/dist/cjs/interface/class/api/route/runtime/index.d.ts +4 -0
- package/dist/cjs/interface/class/api/subscriber/function/error-execution-context.interface.d.ts +1 -0
- package/dist/cjs/interface/class/api/subscriber/function/execution/context.interface.d.ts +1 -0
- package/dist/cjs/interface/class/api/subscriber/function.interface.d.ts +4 -0
- package/dist/cjs/interface/class/api/subscriber/route/error-execution-context.interface.d.ts +2 -1
- package/dist/cjs/interface/class/api/subscriber/route/execution/context/data/extended.interface.d.ts +36 -0
- package/dist/cjs/interface/class/api/subscriber/route/execution/context/data/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/subscriber/route/execution/context/data/interface.d.ts +32 -0
- package/dist/cjs/interface/class/api/subscriber/route/execution/context/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/subscriber/route/execution/context/interface.d.ts +11 -0
- package/dist/cjs/interface/class/api/subscriber/route/execution/index.d.ts +1 -2
- package/dist/cjs/interface/class/api/subscriber/route.interface.d.ts +6 -2
- package/dist/cjs/interface/decorator/api/controller/properties/route/authentication.interface.d.ts +1 -1
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/generation.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/index.d.ts +5 -2
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/interface.d.ts +4 -7
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/index.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/reference.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/request/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/request/interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/request/load.interface.d.ts +10 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/response/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/response/interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/relations/response/load.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/target.interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/response/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/response/interface.d.ts +7 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/response/target.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/security.interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/with/dto.interface.d.ts +1 -1
- package/dist/cjs/interface/decorator/api/function/create-executor-properties.interface.d.ts +1 -2
- package/dist/cjs/interface/decorator/api/function/custom-properties.interface.d.ts +9 -0
- package/dist/cjs/interface/decorator/api/function/delete-executor-properties.interface.d.ts +2 -3
- package/dist/cjs/interface/decorator/api/function/get/executor-properties.interface.d.ts +1 -2
- package/dist/cjs/interface/decorator/api/function/get/list-executor-properties.interface.d.ts +1 -2
- package/dist/cjs/interface/decorator/api/function/get/many-executor-properties.interface.d.ts +1 -2
- package/dist/cjs/interface/decorator/api/function/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/function/properties.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/function/update-executor-properties.interface.d.ts +2 -3
- package/dist/cjs/interface/decorator/api/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/method/index.d.ts +0 -2
- package/dist/cjs/interface/decorator/api/method/properties.interface.d.ts +4 -17
- package/dist/cjs/interface/decorator/api/route/custom-properties.interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/route/documentation-properties.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/route/index.d.ts +7 -0
- package/dist/cjs/interface/decorator/api/route/metadata/index.d.ts +3 -0
- package/dist/cjs/interface/decorator/api/route/metadata/interface.d.ts +15 -0
- package/dist/cjs/interface/decorator/api/route/metadata/resource.interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/route/metadata/route.interface.d.ts +7 -0
- package/dist/cjs/interface/decorator/api/route/response/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/route/response/properties.interface.d.ts +9 -0
- package/dist/cjs/interface/decorator/api/route/response/serialization-properties.interface.d.ts +3 -0
- package/dist/cjs/interface/decorator/api/route/runtime-properties.interface.d.ts +11 -0
- package/dist/cjs/interface/decorator/api/route/security/authentication-properties.interface.d.ts +9 -0
- package/dist/cjs/interface/decorator/api/route/security/authorization-properties.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/route/security/index.d.ts +3 -0
- package/dist/cjs/interface/decorator/api/route/security/properties.interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/route/throttling/default-properties.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/route/throttling/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/route/throttling/properties.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/subscriber/function/filter.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/subscriber/function/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/subscriber/function/properties.interface.d.ts +7 -0
- package/dist/cjs/interface/decorator/api/subscriber/index.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/subscriber/route-properties.interface.d.ts +4 -0
- package/dist/cjs/module/api/authorization.module.js +18 -1
- package/dist/cjs/module/api/authorization.module.js.map +1 -1
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/type/class/api/subscriber/route/after/create-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/after/delete-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/after/get/context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/after/get/list-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/after/partial-update-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/after/update-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/before/create-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/before/delete-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/before/get/context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/before/get/list-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/before/partial-update-context.type.d.ts +2 -2
- package/dist/cjs/type/class/api/subscriber/route/before/update-context.type.d.ts +2 -2
- package/dist/cjs/type/decorator/api/controller/properties/route/base/request/allowed-target.type.d.ts +9 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/base/request/index.d.ts +1 -1
- package/dist/cjs/type/decorator/api/controller/properties/route/base/request/transformers.type.d.ts +7 -7
- package/dist/cjs/type/decorator/api/controller/properties/route/base/response-transformers.type.d.ts +6 -6
- package/dist/cjs/type/decorator/api/controller/transformer-config.type.d.ts +5 -5
- package/dist/cjs/type/decorator/api/function/properties.type.d.ts +5 -3
- package/dist/cjs/type/decorator/api/property/describe/dto/request-properties.type.d.ts +1 -1
- package/dist/cjs/type/decorator/api/property/describe/properties/base/properties.type.d.ts +4 -4
- package/dist/cjs/type/utility/dto/generate/allowed-combination.type.d.ts +4 -4
- package/dist/cjs/utility/api/controller/apply/decorators.utility.js +58 -26
- package/dist/cjs/utility/api/controller/apply/decorators.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/apply/metadata.utility.js +6 -2
- package/dist/cjs/utility/api/controller/apply/metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get/dto.utility.js +6 -2
- package/dist/cjs/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform/filter.utility.js +5 -1
- package/dist/cjs/utility/api/controller/get-list/transform/filter.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.d.ts +4 -4
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js +37 -11
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/index.d.ts +1 -0
- package/dist/cjs/utility/api/controller/serialize-route-response.utility.d.ts +14 -0
- package/dist/cjs/utility/api/controller/serialize-route-response.utility.js +29 -0
- package/dist/cjs/utility/api/controller/serialize-route-response.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/transform-data.utility.d.ts +8 -7
- package/dist/cjs/utility/api/controller/transform-data.utility.js +21 -18
- package/dist/cjs/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/validate-request.utility.d.ts +3 -3
- package/dist/cjs/utility/api/controller/validate-request.utility.js +10 -9
- package/dist/cjs/utility/api/controller/validate-request.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.js +6 -2
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/function-transaction.utility.d.ts +20 -0
- package/dist/cjs/utility/api/function-transaction.utility.js +52 -0
- package/dist/cjs/utility/api/function-transaction.utility.js.map +1 -0
- package/dist/cjs/utility/api/index.d.ts +1 -0
- package/dist/cjs/utility/api/route/index.d.ts +1 -0
- package/dist/cjs/utility/api/route/response/index.d.ts +2 -0
- package/dist/cjs/utility/api/route/response/project-relation.utility.d.ts +11 -0
- package/dist/cjs/utility/api/route/response/project-relation.utility.js +75 -0
- package/dist/cjs/utility/api/route/response/project-relation.utility.js.map +1 -0
- package/dist/cjs/utility/api/route/response/serialize.utility.d.ts +11 -0
- package/dist/cjs/utility/api/route/response/serialize.utility.js +26 -0
- package/dist/cjs/utility/api/route/response/serialize.utility.js.map +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js +5 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/core.utility.js +5 -1
- package/dist/cjs/utility/dto/generate/core.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/dynamic.utility.js +5 -1
- package/dist/cjs/utility/dto/generate/dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/exception.utility.js +5 -1
- package/dist/cjs/utility/dto/generate/exception.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/filter-decorator.utility.js +5 -1
- package/dist/cjs/utility/dto/generate/filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/get-list-response.utility.js +5 -1
- package/dist/cjs/utility/dto/generate/get-list-response.utility.js.map +1 -1
- package/dist/cjs/utility/dto/get/get-list-query-base-class.utility.js +5 -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 +5 -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 +7 -3
- 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 +8 -4
- package/dist/cjs/utility/dto/is/should-be-generated.utility.js.map +1 -1
- package/dist/esm/class/api/authorization/bootstrap-validation.service.class.d.ts +1 -0
- package/dist/esm/class/api/authorization/bootstrap-validation.service.class.js +37 -3
- package/dist/esm/class/api/authorization/bootstrap-validation.service.class.js.map +1 -1
- package/dist/esm/class/api/authorization/cache-invalidation.service.class.d.ts +7 -0
- package/dist/esm/class/api/authorization/cache-invalidation.service.class.js +21 -0
- package/dist/esm/class/api/authorization/cache-invalidation.service.class.js.map +1 -0
- package/dist/esm/class/api/authorization/guard.class.d.ts +1 -2
- package/dist/esm/class/api/authorization/guard.class.js +13 -18
- package/dist/esm/class/api/authorization/guard.class.js.map +1 -1
- package/dist/esm/class/api/authorization/index.d.ts +1 -0
- package/dist/esm/class/api/authorization/policy/executor.class.js +1 -2
- package/dist/esm/class/api/authorization/policy/executor.class.js.map +1 -1
- package/dist/esm/class/api/authorization/policy/index.d.ts +1 -0
- package/dist/esm/class/api/authorization/policy/registry.class.d.ts +3 -5
- package/dist/esm/class/api/authorization/policy/registry.class.js +10 -33
- package/dist/esm/class/api/authorization/policy/registry.class.js.map +1 -1
- package/dist/esm/class/api/authorization/policy/subscriber-wrapper.class.d.ts +10 -0
- package/dist/esm/class/api/authorization/policy/subscriber-wrapper.class.js +21 -0
- package/dist/esm/class/api/authorization/policy/subscriber-wrapper.class.js.map +1 -0
- package/dist/esm/class/api/authorization/runtime.class.d.ts +3 -2
- package/dist/esm/class/api/authorization/runtime.class.js +6 -5
- package/dist/esm/class/api/authorization/runtime.class.js.map +1 -1
- package/dist/esm/class/api/authorization/simulator.class.d.ts +2 -0
- package/dist/esm/class/api/authorization/simulator.class.js +1 -0
- package/dist/esm/class/api/authorization/simulator.class.js.map +1 -1
- package/dist/esm/class/api/function/context-storage.class.d.ts +7 -0
- package/dist/esm/class/api/function/context-storage.class.js +14 -0
- package/dist/esm/class/api/function/context-storage.class.js.map +1 -0
- package/dist/esm/class/api/function/custom-runtime.class.d.ts +19 -0
- package/dist/esm/class/api/function/custom-runtime.class.js +116 -0
- package/dist/esm/class/api/function/custom-runtime.class.js.map +1 -0
- package/dist/esm/class/api/function/index.d.ts +1 -0
- package/dist/esm/class/api/function/transaction-scope.class.d.ts +6 -0
- package/dist/esm/class/api/function/transaction-scope.class.js +32 -0
- package/dist/esm/class/api/function/transaction-scope.class.js.map +1 -0
- package/dist/esm/class/api/index.d.ts +2 -0
- package/dist/esm/class/api/route-runtime.class.d.ts +21 -0
- package/dist/esm/class/api/route-runtime.class.js +333 -0
- package/dist/esm/class/api/route-runtime.class.js.map +1 -0
- package/dist/esm/class/api/service-base.class.d.ts +9 -7
- package/dist/esm/class/api/service-base.class.js +16 -6
- package/dist/esm/class/api/service-base.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/executor.class.d.ts +7 -6
- package/dist/esm/class/api/subscriber/executor.class.js +16 -12
- package/dist/esm/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/index.d.ts +1 -0
- package/dist/esm/class/api/subscriber/registry.class.d.ts +5 -2
- package/dist/esm/class/api/subscriber/registry.class.js +24 -22
- package/dist/esm/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/wrapper.class.d.ts +18 -0
- package/dist/esm/class/api/subscriber/wrapper.class.js +21 -0
- package/dist/esm/class/api/subscriber/wrapper.class.js.map +1 -0
- package/dist/esm/class/utility/dto/exception/details/foreign-key-violation.class.js +5 -1
- package/dist/esm/class/utility/dto/exception/details/foreign-key-violation.class.js.map +1 -1
- package/dist/esm/class/utility/dto/exception/details/unique-violation.class.js +5 -1
- package/dist/esm/class/utility/dto/exception/details/unique-violation.class.js.map +1 -1
- package/dist/esm/class/utility/dto/property/factory/number.class.js +6 -2
- 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 +5 -1
- package/dist/esm/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/body.class.js +5 -1
- package/dist/esm/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/query.class.js +5 -1
- package/dist/esm/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/request.class.js +5 -1
- package/dist/esm/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/response.class.js +5 -1
- package/dist/esm/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/esm/constant/decorator/api/method.constant.d.ts +2 -3
- package/dist/esm/constant/decorator/api/method.constant.js +4 -6
- package/dist/esm/constant/decorator/api/method.constant.js.map +1 -1
- package/dist/esm/constant/utility/dto/constant.js +6 -2
- package/dist/esm/constant/utility/dto/constant.js.map +1 -1
- package/dist/esm/decorator/api/function/create.decorator.js +51 -24
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/custom.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/function/custom.decorator.js +45 -0
- package/dist/esm/decorator/api/function/custom.decorator.js.map +1 -0
- package/dist/esm/decorator/api/function/decorator.js +16 -7
- package/dist/esm/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.js +62 -41
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/decorator.js +40 -25
- package/dist/esm/decorator/api/function/get/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/list.decorator.js +40 -25
- package/dist/esm/decorator/api/function/get/list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/many.decorator.js +40 -25
- package/dist/esm/decorator/api/function/get/many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/index.d.ts +1 -0
- package/dist/esm/decorator/api/function/update.decorator.js +62 -41
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/index.d.ts +1 -0
- package/dist/esm/decorator/api/method.decorator.d.ts +5 -6
- package/dist/esm/decorator/api/method.decorator.js +66 -326
- package/dist/esm/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.js +24 -5
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +24 -5
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.js +22 -4
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +30 -7
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.js +22 -4
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +26 -9
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +27 -5
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/route-custom.decorator.d.ts +9 -0
- package/dist/esm/decorator/api/route-custom.decorator.js +99 -0
- package/dist/esm/decorator/api/route-custom.decorator.js.map +1 -0
- package/dist/esm/decorator/api/service/decorator.js +28 -23
- package/dist/esm/decorator/api/service/decorator.js.map +1 -1
- package/dist/esm/enum/decorator/api/controller/index.d.ts +3 -1
- package/dist/esm/enum/decorator/api/controller/relation-reference-shape.enum.d.ts +4 -0
- package/dist/esm/enum/decorator/api/controller/relation-reference-shape.enum.js +8 -0
- package/dist/esm/enum/decorator/api/controller/relation-reference-shape.enum.js.map +1 -0
- package/dist/esm/enum/decorator/api/controller/request/index.d.ts +2 -0
- package/dist/esm/enum/decorator/api/controller/request/target.enum.d.ts +5 -0
- package/dist/esm/enum/decorator/api/controller/request/target.enum.js +9 -0
- package/dist/esm/enum/decorator/api/controller/request/target.enum.js.map +1 -0
- package/dist/esm/enum/decorator/api/controller/{request-transformer-type.enum.js → request/transformer-type.enum.js} +1 -1
- package/dist/esm/enum/decorator/api/controller/request/transformer-type.enum.js.map +1 -0
- package/dist/esm/enum/decorator/api/controller/response-target.enum.d.ts +3 -0
- package/dist/esm/enum/decorator/api/controller/response-target.enum.js +7 -0
- package/dist/esm/enum/decorator/api/controller/response-target.enum.js.map +1 -0
- package/dist/esm/enum/decorator/api/dto-type.enum.d.ts +1 -1
- package/dist/esm/enum/decorator/api/dto-type.enum.js +1 -1
- package/dist/esm/enum/decorator/api/dto-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/function-transaction-mode.enum.d.ts +6 -0
- package/dist/esm/enum/decorator/api/function-transaction-mode.enum.js +10 -0
- package/dist/esm/enum/decorator/api/function-transaction-mode.enum.js.map +1 -0
- package/dist/esm/enum/decorator/api/function-type.enum.d.ts +1 -0
- package/dist/esm/enum/decorator/api/function-type.enum.js +1 -0
- package/dist/esm/enum/decorator/api/function-type.enum.js.map +1 -1
- package/dist/esm/enum/decorator/api/index.d.ts +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/Observable.js +104 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/Observable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/Subscriber.js +154 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/Subscription.js +145 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/config.js +5 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/config.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/lastValueFrom.js +26 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/lastValueFrom.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/observable/from.js +9 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/observable/from.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/observable/innerFrom.js +146 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/observable/innerFrom.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +63 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/operators/observeOn.js +13 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/operators/observeOn.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/operators/subscribeOn.js +11 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/operators/subscribeOn.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleArray.js +21 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleArray.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js +26 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js +35 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js +10 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/schedulePromise.js +10 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/schedulePromise.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js +9 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduled.js +40 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduled/scheduled.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +18 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/symbol/iterator.js +10 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/symbol/iterator.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/symbol/observable.js +4 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/EmptyError.js +12 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/EmptyError.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +15 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/arrRemove.js +9 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/createErrorClass.js +13 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/errorContext.js +8 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/executeSchedule.js +20 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/executeSchedule.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/identity.js +6 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isArrayLike.js +4 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isArrayLike.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isAsyncIterable.js +8 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isAsyncIterable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isFunction.js +6 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isInteropObservable.js +9 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isInteropObservable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isIterable.js +9 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isIterable.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isPromise.js +8 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isPromise.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isReadableStreamLike.js +41 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/isReadableStreamLike.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/lift.js +23 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/lift.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/noop.js +4 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/pipe.js +16 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/reportUnhandledError.js +12 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/throwUnobservableError.js +6 -0
- package/dist/esm/external/rxjs/dist/esm5/internal/util/throwUnobservableError.js.map +1 -0
- package/dist/esm/external/tslib/tslib.es6.js +117 -1
- package/dist/esm/external/tslib/tslib.es6.js.map +1 -1
- package/dist/esm/factory/api-controller.factory.d.ts +1 -0
- package/dist/esm/factory/api-controller.factory.js +42 -393
- package/dist/esm/factory/api-controller.factory.js.map +1 -1
- package/dist/esm/index.js +15 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interceptor/api-route-runtime.interceptor.d.ts +5 -0
- package/dist/esm/interceptor/api-route-runtime.interceptor.js +29 -0
- package/dist/esm/interceptor/api-route-runtime.interceptor.js.map +1 -0
- package/dist/esm/interface/class/api/authorization/policy/registry.interface.d.ts +1 -0
- package/dist/esm/interface/class/api/authorization/policy/subscriber/context/interface.d.ts +1 -1
- package/dist/esm/interface/class/api/function/context/index.d.ts +2 -0
- package/dist/esm/interface/class/api/function/context/interface.d.ts +10 -0
- package/dist/esm/interface/class/api/function/context/operations.interface.d.ts +13 -0
- package/dist/esm/interface/class/api/function/index.d.ts +1 -0
- package/dist/esm/interface/class/api/index.d.ts +2 -0
- package/dist/esm/interface/class/api/route/index.d.ts +1 -0
- package/dist/esm/interface/class/api/route/runtime/context-data.interface.d.ts +10 -0
- package/dist/esm/interface/class/api/route/runtime/custom-execution-options.interface.d.ts +9 -0
- package/dist/esm/interface/class/api/route/runtime/generated/execution-options.interface.d.ts +14 -0
- package/dist/esm/interface/class/api/route/runtime/generated/index.d.ts +2 -0
- package/dist/esm/interface/class/api/route/runtime/generated/targets.interface.d.ts +12 -0
- package/dist/esm/interface/class/api/route/runtime/http-request.interface.d.ts +8 -0
- package/dist/esm/interface/class/api/route/runtime/index.d.ts +4 -0
- package/dist/esm/interface/class/api/subscriber/function/error-execution-context.interface.d.ts +1 -0
- package/dist/esm/interface/class/api/subscriber/function/execution/context.interface.d.ts +1 -0
- package/dist/esm/interface/class/api/subscriber/function.interface.d.ts +4 -0
- package/dist/esm/interface/class/api/subscriber/route/error-execution-context.interface.d.ts +2 -1
- package/dist/esm/interface/class/api/subscriber/route/execution/context/data/extended.interface.d.ts +36 -0
- package/dist/esm/interface/class/api/subscriber/route/execution/context/data/index.d.ts +2 -0
- package/dist/esm/interface/class/api/subscriber/route/execution/context/data/interface.d.ts +32 -0
- package/dist/esm/interface/class/api/subscriber/route/execution/context/index.d.ts +2 -0
- package/dist/esm/interface/class/api/subscriber/route/execution/context/interface.d.ts +11 -0
- package/dist/esm/interface/class/api/subscriber/route/execution/index.d.ts +1 -2
- package/dist/esm/interface/class/api/subscriber/route.interface.d.ts +6 -2
- package/dist/esm/interface/decorator/api/controller/properties/route/authentication.interface.d.ts +1 -1
- package/dist/esm/interface/decorator/api/controller/properties/route/base/generation.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/index.d.ts +5 -2
- package/dist/esm/interface/decorator/api/controller/properties/route/base/interface.d.ts +4 -7
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/index.d.ts +4 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/reference.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/request/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/request/interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/request/load.interface.d.ts +10 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/response/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/response/interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/relations/response/load.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/target.interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/response/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/response/interface.d.ts +7 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/response/target.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/security.interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/with/dto.interface.d.ts +1 -1
- package/dist/esm/interface/decorator/api/function/create-executor-properties.interface.d.ts +1 -2
- package/dist/esm/interface/decorator/api/function/custom-properties.interface.d.ts +9 -0
- package/dist/esm/interface/decorator/api/function/delete-executor-properties.interface.d.ts +2 -3
- package/dist/esm/interface/decorator/api/function/get/executor-properties.interface.d.ts +1 -2
- package/dist/esm/interface/decorator/api/function/get/list-executor-properties.interface.d.ts +1 -2
- package/dist/esm/interface/decorator/api/function/get/many-executor-properties.interface.d.ts +1 -2
- package/dist/esm/interface/decorator/api/function/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/function/properties.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/function/update-executor-properties.interface.d.ts +2 -3
- package/dist/esm/interface/decorator/api/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/method/index.d.ts +0 -2
- package/dist/esm/interface/decorator/api/method/properties.interface.d.ts +4 -17
- package/dist/esm/interface/decorator/api/route/custom-properties.interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/route/documentation-properties.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/route/index.d.ts +7 -0
- package/dist/esm/interface/decorator/api/route/metadata/index.d.ts +3 -0
- package/dist/esm/interface/decorator/api/route/metadata/interface.d.ts +15 -0
- package/dist/esm/interface/decorator/api/route/metadata/resource.interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/route/metadata/route.interface.d.ts +7 -0
- package/dist/esm/interface/decorator/api/route/response/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/route/response/properties.interface.d.ts +9 -0
- package/dist/esm/interface/decorator/api/route/response/serialization-properties.interface.d.ts +3 -0
- package/dist/esm/interface/decorator/api/route/runtime-properties.interface.d.ts +11 -0
- package/dist/esm/interface/decorator/api/route/security/authentication-properties.interface.d.ts +9 -0
- package/dist/esm/interface/decorator/api/route/security/authorization-properties.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/route/security/index.d.ts +3 -0
- package/dist/esm/interface/decorator/api/route/security/properties.interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/route/throttling/default-properties.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/route/throttling/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/route/throttling/properties.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/subscriber/function/filter.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/subscriber/function/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/subscriber/function/properties.interface.d.ts +7 -0
- package/dist/esm/interface/decorator/api/subscriber/index.d.ts +2 -2
- package/dist/esm/interface/decorator/api/subscriber/route-properties.interface.d.ts +4 -0
- package/dist/esm/module/api/authorization.module.js +18 -1
- package/dist/esm/module/api/authorization.module.js.map +1 -1
- package/dist/esm/package.json +0 -1
- package/dist/esm/type/class/api/subscriber/route/after/create-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/after/delete-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/after/get/context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/after/get/list-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/after/partial-update-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/after/update-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/before/create-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/before/delete-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/before/get/context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/before/get/list-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/before/partial-update-context.type.d.ts +2 -2
- package/dist/esm/type/class/api/subscriber/route/before/update-context.type.d.ts +2 -2
- package/dist/esm/type/decorator/api/controller/properties/route/base/request/allowed-target.type.d.ts +9 -0
- package/dist/esm/type/decorator/api/controller/properties/route/base/request/index.d.ts +1 -1
- package/dist/esm/type/decorator/api/controller/properties/route/base/request/transformers.type.d.ts +7 -7
- package/dist/esm/type/decorator/api/controller/properties/route/base/response-transformers.type.d.ts +6 -6
- package/dist/esm/type/decorator/api/controller/transformer-config.type.d.ts +5 -5
- package/dist/esm/type/decorator/api/function/properties.type.d.ts +5 -3
- package/dist/esm/type/decorator/api/property/describe/dto/request-properties.type.d.ts +1 -1
- package/dist/esm/type/decorator/api/property/describe/properties/base/properties.type.d.ts +4 -4
- package/dist/esm/type/utility/dto/generate/allowed-combination.type.d.ts +4 -4
- package/dist/esm/utility/api/controller/apply/decorators.utility.js +59 -27
- package/dist/esm/utility/api/controller/apply/decorators.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/apply/metadata.utility.js +6 -2
- package/dist/esm/utility/api/controller/apply/metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get/dto.utility.js +6 -2
- package/dist/esm/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/transform/filter.utility.js +5 -1
- package/dist/esm/utility/api/controller/get-list/transform/filter.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/handle-request-relations.utility.d.ts +4 -4
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js +37 -11
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/index.d.ts +1 -0
- package/dist/esm/utility/api/controller/serialize-route-response.utility.d.ts +14 -0
- package/dist/esm/utility/api/controller/serialize-route-response.utility.js +27 -0
- package/dist/esm/utility/api/controller/serialize-route-response.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/transform-data.utility.d.ts +8 -7
- package/dist/esm/utility/api/controller/transform-data.utility.js +19 -16
- package/dist/esm/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/validate-request.utility.d.ts +3 -3
- package/dist/esm/utility/api/controller/validate-request.utility.js +10 -9
- package/dist/esm/utility/api/controller/validate-request.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.js +6 -2
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.js.map +1 -1
- package/dist/esm/utility/api/function-transaction.utility.d.ts +20 -0
- package/dist/esm/utility/api/function-transaction.utility.js +50 -0
- package/dist/esm/utility/api/function-transaction.utility.js.map +1 -0
- package/dist/esm/utility/api/index.d.ts +1 -0
- package/dist/esm/utility/api/route/index.d.ts +1 -0
- package/dist/esm/utility/api/route/response/index.d.ts +2 -0
- package/dist/esm/utility/api/route/response/project-relation.utility.d.ts +11 -0
- package/dist/esm/utility/api/route/response/project-relation.utility.js +73 -0
- package/dist/esm/utility/api/route/response/project-relation.utility.js.map +1 -0
- package/dist/esm/utility/api/route/response/serialize.utility.d.ts +11 -0
- package/dist/esm/utility/api/route/response/serialize.utility.js +24 -0
- package/dist/esm/utility/api/route/response/serialize.utility.js.map +1 -0
- package/dist/esm/utility/dto/build-decorator.utility.js +5 -1
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/core.utility.js +5 -1
- package/dist/esm/utility/dto/generate/core.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/dynamic.utility.js +5 -1
- package/dist/esm/utility/dto/generate/dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/exception.utility.js +5 -1
- package/dist/esm/utility/dto/generate/exception.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/filter-decorator.utility.js +5 -1
- package/dist/esm/utility/dto/generate/filter-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/get-list-response.utility.js +5 -1
- package/dist/esm/utility/dto/generate/get-list-response.utility.js.map +1 -1
- package/dist/esm/utility/dto/get/get-list-query-base-class.utility.js +5 -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 +5 -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 +7 -3
- 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 +8 -4
- package/dist/esm/utility/dto/is/should-be-generated.utility.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/enum/decorator/api/controller/request-transformer-type.enum.js.map +0 -1
- package/dist/cjs/interface/class/api/subscriber/route/execution/context-data.interface.d.ts +0 -82
- package/dist/cjs/interface/class/api/subscriber/route/execution/context.interface.d.ts +0 -29
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request.interface.d.ts +0 -8
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/response.interface.d.ts +0 -7
- package/dist/cjs/interface/decorator/api/method/authorization.interface.d.ts +0 -3
- package/dist/cjs/interface/decorator/api/method/throttler-properties.interface.d.ts +0 -4
- package/dist/cjs/interface/decorator/api/subscriber/function-properties.interface.d.ts +0 -5
- package/dist/cjs/type/decorator/api/controller/properties/route/base/request/relations.type.d.ts +0 -18
- package/dist/esm/enum/decorator/api/controller/request-transformer-type.enum.js.map +0 -1
- package/dist/esm/interface/class/api/subscriber/route/execution/context-data.interface.d.ts +0 -82
- package/dist/esm/interface/class/api/subscriber/route/execution/context.interface.d.ts +0 -29
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request.interface.d.ts +0 -8
- package/dist/esm/interface/decorator/api/controller/properties/route/base/response.interface.d.ts +0 -7
- package/dist/esm/interface/decorator/api/method/authorization.interface.d.ts +0 -3
- package/dist/esm/interface/decorator/api/method/throttler-properties.interface.d.ts +0 -4
- package/dist/esm/interface/decorator/api/subscriber/function-properties.interface.d.ts +0 -5
- package/dist/esm/type/decorator/api/controller/properties/route/base/request/relations.type.d.ts +0 -18
- /package/dist/cjs/enum/decorator/api/controller/{request-transformer-type.enum.d.ts → request/transformer-type.enum.d.ts} +0 -0
- /package/dist/esm/enum/decorator/api/controller/{request-transformer-type.enum.d.ts → request/transformer-type.enum.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EApiRouteType } from '../../../enum/decorator/api/index';
|
|
2
|
+
import type { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
3
|
+
import type { Type } from "@nestjs/common";
|
|
4
|
+
import type { TApiControllerPropertiesRoute } from '../../../type/decorator/api/controller/index';
|
|
5
|
+
/**
|
|
6
|
+
* Serializes a generated route response with the route DTO and serialization settings.
|
|
7
|
+
* @template E - Entity type owned by the route.
|
|
8
|
+
* @template R - Response value type.
|
|
9
|
+
* @param {TApiControllerPropertiesRoute<E, EApiRouteType>} routeConfig - Route configuration containing response serialization settings.
|
|
10
|
+
* @param {Type<unknown> | undefined} dto - DTO type used for response serialization.
|
|
11
|
+
* @param {R} response - Response value to serialize.
|
|
12
|
+
* @returns {R} Serialized response value.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ApiControllerSerializeRouteResponse<E extends IApiBaseEntity, R>(routeConfig: TApiControllerPropertiesRoute<E, EApiRouteType>, dto: Type<unknown> | undefined, response: R): R;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('@nestjs/common');
|
|
4
|
+
var serialize_utility = require('../route/response/serialize.utility.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Serializes a generated route response with the route DTO and serialization settings.
|
|
8
|
+
* @template E - Entity type owned by the route.
|
|
9
|
+
* @template R - Response value type.
|
|
10
|
+
* @param {TApiControllerPropertiesRoute<E, EApiRouteType>} routeConfig - Route configuration containing response serialization settings.
|
|
11
|
+
* @param {Type<unknown> | undefined} dto - DTO type used for response serialization.
|
|
12
|
+
* @param {R} response - Response value to serialize.
|
|
13
|
+
* @returns {R} Serialized response value.
|
|
14
|
+
*/
|
|
15
|
+
function ApiControllerSerializeRouteResponse(routeConfig, dto, response) {
|
|
16
|
+
const serialization = routeConfig.response?.serialization ?? {
|
|
17
|
+
isEnabled: true,
|
|
18
|
+
};
|
|
19
|
+
return serialize_utility.ApiRouteSerializeResponse({
|
|
20
|
+
response: {
|
|
21
|
+
serialization,
|
|
22
|
+
status: common.HttpStatus.OK,
|
|
23
|
+
type: dto,
|
|
24
|
+
},
|
|
25
|
+
}, response);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.ApiControllerSerializeRouteResponse = ApiControllerSerializeRouteResponse;
|
|
29
|
+
//# sourceMappingURL=serialize-route-response.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize-route-response.utility.js","sources":["../../../../../../src/utility/api/controller/serialize-route-response.utility.ts"],"sourcesContent":[null],"names":["ApiRouteSerializeResponse","HttpStatus"],"mappings":";;;;;AASA;;;;;;;;AAQG;SACa,mCAAmC,CAA8B,WAA4D,EAAE,GAA8B,EAAE,QAAW,EAAA;AACzL,IAAA,MAAM,aAAa,GAA6C,WAAW,CAAC,QAAQ,EAAE,aAAa,IAAI;AACtG,QAAA,SAAS,EAAE,IAAI;KACf;AAED,IAAA,OAAOA,2CAAyB,CAC/B;AACC,QAAA,QAAQ,EAAE;YACT,aAAa;YACb,MAAM,EAAEC,iBAAU,CAAC,EAAE;AACrB,YAAA,IAAI,EAAE,GAAG;AACT,SAAA;KACD,EACD,QAAQ,CACR;AACF;;;;"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import type { EApiRouteType } from '../../../enum/decorator/api/index';
|
|
2
1
|
import type { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
3
2
|
import type { IApiControllerProperties } from '../../../interface/decorator/api/index';
|
|
4
|
-
import type {
|
|
3
|
+
import type { TApiRequestTransformer } from '../../../type/api-request-transformer.type';
|
|
5
4
|
import type { TApiControllerTransformDataData, TApiControllerTransformDataObjectToTransform } from '../../../type/utility/index';
|
|
5
|
+
import { EApiControllerRequestTarget, EApiControllerResponseTarget } from '../../../enum/decorator/api/index';
|
|
6
6
|
/**
|
|
7
7
|
* Transforms data between request/response objects and entity objects.
|
|
8
|
-
* Handles both static and dynamic transformations for body, query,
|
|
9
|
-
* @
|
|
8
|
+
* Handles both static and dynamic transformations for body, query, parameters, and response data.
|
|
9
|
+
* @template E - The entity type.
|
|
10
|
+
* @param {object | undefined} targets - Target-specific transformer configuration.
|
|
10
11
|
* @param {IApiControllerProperties<E>} properties - Controller configuration properties
|
|
11
12
|
* @param {TApiControllerTransformDataObjectToTransform<E>} objectToTransform - The object to apply transformations to
|
|
12
13
|
* @param {TApiControllerTransformDataData} data - Data sources to use for transformations including headers, IP address, and authentication
|
|
13
14
|
* @returns {void}
|
|
14
|
-
* @template E - The entity type
|
|
15
|
-
* @template R - The route type
|
|
16
15
|
*/
|
|
17
|
-
export declare function ApiControllerTransformData<E extends IApiBaseEntity
|
|
16
|
+
export declare function ApiControllerTransformData<E extends IApiBaseEntity>(targets: Partial<Record<EApiControllerRequestTarget | EApiControllerResponseTarget, {
|
|
17
|
+
transformers?: Array<TApiRequestTransformer<E>>;
|
|
18
|
+
}>> | undefined, properties: IApiControllerProperties<E>, objectToTransform: TApiControllerTransformDataObjectToTransform<E>, data: TApiControllerTransformDataData): void;
|
|
@@ -4,8 +4,12 @@ var transformerValue_constant = require('../../../constant/dto/transformer-value
|
|
|
4
4
|
require('../../../enum/decorator/api/action.enum.js');
|
|
5
5
|
require('../../../enum/decorator/api/authentication-type.enum.js');
|
|
6
6
|
require('../../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
7
|
-
|
|
8
|
-
var
|
|
7
|
+
require('../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
8
|
+
var target_enum = require('../../../enum/decorator/api/controller/request/target.enum.js');
|
|
9
|
+
var transformerType_enum = require('../../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
10
|
+
var responseTarget_enum = require('../../../enum/decorator/api/controller/response-target.enum.js');
|
|
11
|
+
require('../../../enum/decorator/api/dto-type.enum.js');
|
|
12
|
+
require('../../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
9
13
|
require('../../../enum/decorator/api/function-type.enum.js');
|
|
10
14
|
require('../../../enum/decorator/api/on-type.enum.js');
|
|
11
15
|
require('../../../enum/decorator/api/property/data-type.enum.js');
|
|
@@ -24,38 +28,37 @@ var string_utility = require('../../error/string.utility.js');
|
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
30
|
* Transforms data between request/response objects and entity objects.
|
|
27
|
-
* Handles both static and dynamic transformations for body, query,
|
|
28
|
-
* @
|
|
31
|
+
* Handles both static and dynamic transformations for body, query, parameters, and response data.
|
|
32
|
+
* @template E - The entity type.
|
|
33
|
+
* @param {object | undefined} targets - Target-specific transformer configuration.
|
|
29
34
|
* @param {IApiControllerProperties<E>} properties - Controller configuration properties
|
|
30
35
|
* @param {TApiControllerTransformDataObjectToTransform<E>} objectToTransform - The object to apply transformations to
|
|
31
36
|
* @param {TApiControllerTransformDataData} data - Data sources to use for transformations including headers, IP address, and authentication
|
|
32
37
|
* @returns {void}
|
|
33
|
-
* @template E - The entity type
|
|
34
|
-
* @template R - The route type
|
|
35
38
|
*/
|
|
36
|
-
function ApiControllerTransformData(
|
|
37
|
-
if (!
|
|
39
|
+
function ApiControllerTransformData(targets, properties, objectToTransform, data) {
|
|
40
|
+
if (!targets)
|
|
38
41
|
return;
|
|
39
|
-
if (
|
|
40
|
-
for (const transformer of
|
|
42
|
+
if (target_enum.EApiControllerRequestTarget.BODY in targets && targets[target_enum.EApiControllerRequestTarget.BODY]?.transformers) {
|
|
43
|
+
for (const transformer of targets[target_enum.EApiControllerRequestTarget.BODY].transformers) {
|
|
41
44
|
if (objectToTransform.body)
|
|
42
45
|
processTransformer(transformer, objectToTransform.body, properties, data);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
|
-
if (
|
|
46
|
-
for (const transformer of
|
|
48
|
+
if (target_enum.EApiControllerRequestTarget.QUERY in targets && targets[target_enum.EApiControllerRequestTarget.QUERY]?.transformers) {
|
|
49
|
+
for (const transformer of targets[target_enum.EApiControllerRequestTarget.QUERY].transformers) {
|
|
47
50
|
if (objectToTransform.query)
|
|
48
51
|
processTransformer(transformer, objectToTransform.query, properties, data);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
if (
|
|
52
|
-
for (const transformer of
|
|
54
|
+
if (target_enum.EApiControllerRequestTarget.PARAMETERS in targets && targets[target_enum.EApiControllerRequestTarget.PARAMETERS]?.transformers) {
|
|
55
|
+
for (const transformer of targets[target_enum.EApiControllerRequestTarget.PARAMETERS].transformers) {
|
|
53
56
|
if (objectToTransform.parameters)
|
|
54
57
|
processTransformer(transformer, objectToTransform.parameters, properties, data);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
if (
|
|
58
|
-
for (const transformer of
|
|
60
|
+
if (responseTarget_enum.EApiControllerResponseTarget.RESPONSE in targets && targets[responseTarget_enum.EApiControllerResponseTarget.RESPONSE]?.transformers) {
|
|
61
|
+
for (const transformer of targets[responseTarget_enum.EApiControllerResponseTarget.RESPONSE].transformers) {
|
|
59
62
|
if (objectToTransform.response)
|
|
60
63
|
processTransformer(transformer, objectToTransform.response, properties, data);
|
|
61
64
|
}
|
|
@@ -136,7 +139,7 @@ function isPartialE(object) {
|
|
|
136
139
|
*/
|
|
137
140
|
function processTransformer(transformer, objectToTransform, properties, data) {
|
|
138
141
|
switch (transformer.type) {
|
|
139
|
-
case
|
|
142
|
+
case transformerType_enum.EApiControllerRequestTransformerType.DYNAMIC: {
|
|
140
143
|
if (Object.values(transformerValue_constant.TRANSFORMER_VALUE_DTO_CONSTANT).includes(transformer.value)) {
|
|
141
144
|
switch (transformer.value) {
|
|
142
145
|
case transformerValue_constant.TRANSFORMER_VALUE_DTO_CONSTANT.AUTHORIZED_ENTITY: {
|
|
@@ -199,7 +202,7 @@ function processTransformer(transformer, objectToTransform, properties, data) {
|
|
|
199
202
|
}
|
|
200
203
|
break;
|
|
201
204
|
}
|
|
202
|
-
case
|
|
205
|
+
case transformerType_enum.EApiControllerRequestTransformerType.STATIC: {
|
|
203
206
|
const staticValue = transformer.value;
|
|
204
207
|
handleTransformation(objectToTransform, transformer.key, staticValue, properties.entity, transformer.shouldSetValueEvenIfMissing);
|
|
205
208
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-data.utility.js","sources":["../../../../../../src/utility/api/controller/transform-data.utility.ts"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"transform-data.utility.js","sources":["../../../../../../src/utility/api/controller/transform-data.utility.ts"],"sourcesContent":[null],"names":["EApiControllerRequestTarget","EApiControllerResponseTarget","InternalServerErrorException","ErrorString","EErrorStringAction","EApiControllerRequestTransformerType","TRANSFORMER_VALUE_DTO_CONSTANT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;AASG;AACG,SAAU,0BAA0B,CAA2B,OAAqJ,EAAE,UAAuC,EAAE,iBAAkE,EAAE,IAAqC,EAAA;AAC7W,IAAA,IAAI,CAAC,OAAO;QAAE;AAEd,IAAA,IAAIA,uCAA2B,CAAC,IAAI,IAAI,OAAO,IAAI,OAAO,CAACA,uCAA2B,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE;AAC3G,QAAA,KAAK,MAAM,WAAW,IAAI,OAAO,CAACA,uCAA2B,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE;YACjF,IAAI,iBAAiB,CAAC,IAAI;gBAAE,kBAAkB,CAAC,WAAW,EAAE,iBAAiB,CAAC,IAAkD,EAAE,UAAU,EAAE,IAAI,CAAC;QAC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AW,GAAW,WAAW,CAAC,KAAK;AAC7C,YAAA,oBAAoB,CAAC,iBAAiB,EAAE,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,EAAE,WAAW,CAAC,2BAA2B,CAAC;YAEjI;QACD;;AAEF;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
2
|
-
import type { IApiRequestValidator } from '../../../interface/api/request-validator.interface';
|
|
3
2
|
import type { IApiControllerProperties } from '../../../interface/decorator/api/index';
|
|
3
|
+
import type { IApiControllerPropertiesRouteBaseRequestTarget } from '../../../interface/decorator/api/controller/properties/route/base/index';
|
|
4
4
|
import type { TApiControllerGetListQuery } from '../../../type/decorator/api/controller/index';
|
|
5
5
|
/**
|
|
6
6
|
* Validates incoming request parameters against defined validators.
|
|
7
7
|
* Sequentially applies validation functions and throws appropriate exceptions with error messages when validation fails.
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {IApiControllerPropertiesRouteBaseRequestTarget<E> | undefined} target - Target request pipeline configuration
|
|
9
9
|
* @param {IApiControllerProperties<E>} properties - Controller configuration properties
|
|
10
10
|
* @param {Partial<E> | TApiControllerGetListQuery<E>} parameters - The request parameters to validate
|
|
11
11
|
* @returns {Promise<void>} A promise that resolves when validation passes
|
|
12
12
|
* @template E - The entity type
|
|
13
13
|
*/
|
|
14
|
-
export declare function ApiControllerValidateRequest<E extends IApiBaseEntity>(
|
|
14
|
+
export declare function ApiControllerValidateRequest<E extends IApiBaseEntity>(target: IApiControllerPropertiesRouteBaseRequestTarget<E> | undefined, properties: IApiControllerProperties<E>, parameters: Partial<E> | TApiControllerGetListQuery<E>): Promise<void>;
|
|
@@ -5,20 +5,21 @@ var string_utility = require('../../error/string.utility.js');
|
|
|
5
5
|
/**
|
|
6
6
|
* Validates incoming request parameters against defined validators.
|
|
7
7
|
* Sequentially applies validation functions and throws appropriate exceptions with error messages when validation fails.
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {IApiControllerPropertiesRouteBaseRequestTarget<E> | undefined} target - Target request pipeline configuration
|
|
9
9
|
* @param {IApiControllerProperties<E>} properties - Controller configuration properties
|
|
10
10
|
* @param {Partial<E> | TApiControllerGetListQuery<E>} parameters - The request parameters to validate
|
|
11
11
|
* @returns {Promise<void>} A promise that resolves when validation passes
|
|
12
12
|
* @template E - The entity type
|
|
13
13
|
*/
|
|
14
|
-
async function ApiControllerValidateRequest(
|
|
15
|
-
if (validators) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
async function ApiControllerValidateRequest(target, properties, parameters) {
|
|
15
|
+
if (!target?.validators) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
for (const validator of target.validators) {
|
|
19
|
+
const result = validator.validationFunction(parameters);
|
|
20
|
+
const isValid = result instanceof Promise ? await result : result;
|
|
21
|
+
if (!isValid) {
|
|
22
|
+
throw new validator.exception(string_utility.ErrorString({ entity: properties.entity, type: validator.errorType }));
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-request.utility.js","sources":["../../../../../../src/utility/api/controller/validate-request.utility.ts"],"sourcesContent":[null],"names":["ErrorString"],"mappings":";;;;AAOA;;;;;;;;AAQG;AACI,eAAe,4BAA4B,CAA2B,
|
|
1
|
+
{"version":3,"file":"validate-request.utility.js","sources":["../../../../../../src/utility/api/controller/validate-request.utility.ts"],"sourcesContent":[null],"names":["ErrorString"],"mappings":";;;;AAOA;;;;;;;;AAQG;AACI,eAAe,4BAA4B,CAA2B,MAAqE,EAAE,UAAuC,EAAE,UAAsD,EAAA;AAClP,IAAA,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE;QACxB;IACD;AAEA,IAAA,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;QAC1C,MAAM,MAAM,GAA+B,SAAS,CAAC,kBAAkB,CAAC,UAAU,CAAC;AACnF,QAAA,MAAM,OAAO,GAAY,MAAM,YAAY,OAAO,GAAG,MAAM,MAAM,GAAG,MAAM;QAE1E,IAAI,CAAC,OAAO,EAAE;YACb,MAAM,IAAI,SAAS,CAAC,SAAS,CAACA,0BAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;QACrG;IACD;AACD;;;;"}
|
|
@@ -6,8 +6,12 @@ var propertyDescribe_constant = require('../../../../constant/decorator/api/prop
|
|
|
6
6
|
require('../../../../enum/decorator/api/action.enum.js');
|
|
7
7
|
require('../../../../enum/decorator/api/authentication-type.enum.js');
|
|
8
8
|
require('../../../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
9
|
-
require('../../../../enum/decorator/api/controller/
|
|
9
|
+
require('../../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
10
|
+
require('../../../../enum/decorator/api/controller/request/target.enum.js');
|
|
11
|
+
require('../../../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
12
|
+
require('../../../../enum/decorator/api/controller/response-target.enum.js');
|
|
10
13
|
var dtoType_enum = require('../../../../enum/decorator/api/dto-type.enum.js');
|
|
14
|
+
require('../../../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
11
15
|
require('../../../../enum/decorator/api/function-type.enum.js');
|
|
12
16
|
require('../../../../enum/decorator/api/on-type.enum.js');
|
|
13
17
|
require('../../../../enum/decorator/api/property/data-type.enum.js');
|
|
@@ -53,7 +57,7 @@ function ApiControllerWriteDtoSwagger(target, entity, properties, method, routeC
|
|
|
53
57
|
else if (properties.entity.name) {
|
|
54
58
|
entityNames.push(properties.entity.name);
|
|
55
59
|
}
|
|
56
|
-
const requestDto = dto_utility.ApiControllerGetDto(properties, entity, method, dtoType_enum.EApiDtoType.
|
|
60
|
+
const requestDto = dto_utility.ApiControllerGetDto(properties, entity, method, dtoType_enum.EApiDtoType.PARAMETERS, routeConfig);
|
|
57
61
|
const queryDto = dto_utility.ApiControllerGetDto(properties, entity, method, dtoType_enum.EApiDtoType.QUERY, routeConfig);
|
|
58
62
|
const bodyDto = dto_utility.ApiControllerGetDto(properties, entity, method, dtoType_enum.EApiDtoType.BODY, routeConfig);
|
|
59
63
|
const responseDto = dto_utility.ApiControllerGetDto(properties, entity, method, dtoType_enum.EApiDtoType.RESPONSE, routeConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto-swagger.utility.js","sources":["../../../../../../../src/utility/api/controller/write/dto-swagger.utility.ts"],"sourcesContent":[null],"names":["DECORATORS","ApiControllerGetDto","EApiDtoType","MetadataStorage","PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT","EApiPropertyDescribeType","CamelCaseString"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dto-swagger.utility.js","sources":["../../../../../../../src/utility/api/controller/write/dto-swagger.utility.ts"],"sourcesContent":[null],"names":["DECORATORS","ApiControllerGetDto","EApiDtoType","MetadataStorage","PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT","EApiPropertyDescribeType","CamelCaseString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;AAYG;AACG,SAAU,4BAA4B,CAA2B,MAAc,EAAE,MAAqB,EAAE,UAAuC,EAAE,MAAqB,EAAE,WAA4D,EAAE,cAA6B,EAAA;AACxQ,IAAA,MAAM,aAAa,IAAoB,OAAO,CAAC,WAAW,CAACA,oBAAU,CAAC,gBAAgB,EAAE,MAAM,CAAC,IAAI,EAAE,CAAmB;IACxH,MAAM,WAAW,GAAkB,EAAE;AAErC,IAAA,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,UAAU,EAAE;AAC5C,QAAA,IAAI,OAAO,GAAiE,UAAU,CAAC,MAAmE;QAE1J,OAAO,OAAO,EAAE;AACf,YAAA,WAAW,CAAC,IAAI,CAAC,OAAO,C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AAe,CAACJ,wBAAW,CAAC,IAAI,CAAC,CAAA,EAAG,GAAG,CAAA,GAAA,CAAK;AAC9G,yBAAA,CAAC;AAEF,wBAAA,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC;oBAClC;gBACD;YAED,OAAO,CAAC,cAAc,CAACF,oBAAU,CAAC,gBAAgB,EAAE,aAAa,EAAE,MAAM,CAAC;QAC3E;IACD;AACD;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IApiBaseEntity } from '../../interface/api-base-entity.interface';
|
|
2
|
+
import type { EntityManager, Repository } from "typeorm";
|
|
3
|
+
import { EApiFunctionTransactionMode } from '../../enum/decorator/api/index';
|
|
4
|
+
/**
|
|
5
|
+
* Executes an ApiFunction callback according to its transaction mode.
|
|
6
|
+
* @template E - Entity type owned by the function repository.
|
|
7
|
+
* @template R - Callback result type.
|
|
8
|
+
* @param {object} options - Transaction execution options.
|
|
9
|
+
* @param {(eventManager: EntityManager | undefined) => Promise<R>} options.callback - Function body to run with the resolved transaction manager.
|
|
10
|
+
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the function.
|
|
11
|
+
* @param {EApiFunctionTransactionMode} options.mode - Transaction mode to enforce.
|
|
12
|
+
* @param {Repository<E>} options.repository - Repository used to open new transactions when required.
|
|
13
|
+
* @returns {Promise<R>} Callback result.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ApiFunctionExecuteWithTransaction<E extends IApiBaseEntity, R>(options: {
|
|
16
|
+
callback: (eventManager: EntityManager | undefined) => Promise<R>;
|
|
17
|
+
entity: new (...arguments_: Array<unknown>) => E;
|
|
18
|
+
mode: EApiFunctionTransactionMode;
|
|
19
|
+
repository: Repository<E>;
|
|
20
|
+
}): Promise<R>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var contextStorage_class = require('../../class/api/function/context-storage.class.js');
|
|
4
|
+
var transactionScope_class = require('../../class/api/function/transaction-scope.class.js');
|
|
5
|
+
require('../../enum/decorator/api/action.enum.js');
|
|
6
|
+
require('../../enum/decorator/api/authentication-type.enum.js');
|
|
7
|
+
require('../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
8
|
+
require('../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
9
|
+
require('../../enum/decorator/api/controller/request/target.enum.js');
|
|
10
|
+
require('../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
11
|
+
require('../../enum/decorator/api/controller/response-target.enum.js');
|
|
12
|
+
require('../../enum/decorator/api/dto-type.enum.js');
|
|
13
|
+
var functionTransactionMode_enum = require('../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
14
|
+
require('../../enum/decorator/api/function-type.enum.js');
|
|
15
|
+
require('../../enum/decorator/api/on-type.enum.js');
|
|
16
|
+
require('../../enum/decorator/api/property/data-type.enum.js');
|
|
17
|
+
require('../../enum/decorator/api/property/date/identifier.enum.js');
|
|
18
|
+
require('../../enum/decorator/api/property/date/type.enum.js');
|
|
19
|
+
require('../../enum/decorator/api/property/desribe-type.enum.js');
|
|
20
|
+
require('../../enum/decorator/api/property/number-type.enum.js');
|
|
21
|
+
require('../../enum/decorator/api/property/string-type.enum.js');
|
|
22
|
+
require('../../enum/decorator/api/route-type.enum.js');
|
|
23
|
+
var exception_utility = require('../error/exception.utility.js');
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Executes an ApiFunction callback according to its transaction mode.
|
|
27
|
+
* @template E - Entity type owned by the function repository.
|
|
28
|
+
* @template R - Callback result type.
|
|
29
|
+
* @param {object} options - Transaction execution options.
|
|
30
|
+
* @param {(eventManager: EntityManager | undefined) => Promise<R>} options.callback - Function body to run with the resolved transaction manager.
|
|
31
|
+
* @param {new (...arguments_: Array<unknown>) => E} options.entity - Entity constructor associated with the function.
|
|
32
|
+
* @param {EApiFunctionTransactionMode} options.mode - Transaction mode to enforce.
|
|
33
|
+
* @param {Repository<E>} options.repository - Repository used to open new transactions when required.
|
|
34
|
+
* @returns {Promise<R>} Callback result.
|
|
35
|
+
*/
|
|
36
|
+
async function ApiFunctionExecuteWithTransaction(options) {
|
|
37
|
+
const activeEventManager = contextStorage_class.ApiFunctionContextStorage.get()?.eventManager;
|
|
38
|
+
if (options.mode === functionTransactionMode_enum.EApiFunctionTransactionMode.NONE && activeEventManager) {
|
|
39
|
+
throw exception_utility.ErrorException("ApiFunction transaction mode NONE cannot run inside an active transaction");
|
|
40
|
+
}
|
|
41
|
+
if (options.mode === functionTransactionMode_enum.EApiFunctionTransactionMode.MANDATORY && !activeEventManager) {
|
|
42
|
+
throw exception_utility.ErrorException("ApiFunction transaction mode MANDATORY requires an active transaction");
|
|
43
|
+
}
|
|
44
|
+
const eventManager = options.mode === functionTransactionMode_enum.EApiFunctionTransactionMode.NONE ? undefined : activeEventManager;
|
|
45
|
+
if (options.mode === functionTransactionMode_enum.EApiFunctionTransactionMode.REQUIRED && !eventManager) {
|
|
46
|
+
return await options.repository.manager.transaction(async (transactionManager) => await transactionScope_class.ApiFunctionTransactionScope.runWithEntityManager(transactionManager, async () => await options.callback(transactionManager)));
|
|
47
|
+
}
|
|
48
|
+
return await options.callback(eventManager);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
exports.ApiFunctionExecuteWithTransaction = ApiFunctionExecuteWithTransaction;
|
|
52
|
+
//# sourceMappingURL=function-transaction.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function-transaction.utility.js","sources":["../../../../../src/utility/api/function-transaction.utility.ts"],"sourcesContent":[null],"names":["ApiFunctionContextStorage","EApiFunctionTransactionMode","ErrorException","ApiFunctionTransactionScope"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;AAUG;AACI,eAAe,iCAAiC,CAA8B,OAA8L,EAAA;IAClR,MAAM,kBAAkB,GAA8BA,8CAAyB,CAAC,GAAG,EAAK,EAAE,YAAY;IAEtG,IAAI,OAAO,CAAC,IAAI,KAAKC,wDAA2B,CAAC,IAAI,IAAI,kBAAkB,EAAE;AAC5E,QAAA,MAAMC,gCAAc,CAAC,2EAA2E,CAAC;IAClG;IAEA,IAAI,OAAO,CAAC,IAAI,KAAKD,wDAA2B,CAAC,SAAS,IAAI,CAAC,kBAAkB,EAAE;AAClF,QAAA,MAAMC,gCAAc,CAAC,uEAAuE,CAAC;IAC9F;AAEA,IAAA,MAAM,YAAY,GAA8B,OAAO,CAAC,IAAI,KAAKD,wDAA2B,CAAC,IAAI,GAAG,SAAS,GAAG,kBAAkB;IAElI,IAAI,OAAO,CAAC,IAAI,KAAKA,wDAA2B,CAAC,QAAQ,IAAI,CAAC,YAAY,EAAE;AAC3E,QAAA,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,kBAAiC,KAAiB,MAAME,kDAA2B,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,YAAwB,MAAM,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC7P;AAEA,IAAA,OAAO,MAAM,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;AAC5C;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './response/index';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IApiBaseEntity } from '../../../../interface/api-base-entity.interface';
|
|
2
|
+
import type { IApiControllerPropertiesRouteBaseRelationsResponse } from '../../../../interface/decorator/api/index';
|
|
3
|
+
/**
|
|
4
|
+
* Projects loaded relation objects into the configured response reference shape.
|
|
5
|
+
* @template E - Entity type that owns the relation configuration.
|
|
6
|
+
* @template R - Response value type.
|
|
7
|
+
* @param {IApiControllerPropertiesRouteBaseRelationsResponse<E> | undefined} relationConfig - Response relation projection configuration.
|
|
8
|
+
* @param {R} response - Response value to project.
|
|
9
|
+
* @returns {R} Response value with projected relation references.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ApiRouteProjectRelationResponse<E extends IApiBaseEntity, R>(relationConfig: IApiControllerPropertiesRouteBaseRelationsResponse<E> | undefined, response: R): R;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('../../../../enum/decorator/api/action.enum.js');
|
|
4
|
+
require('../../../../enum/decorator/api/authentication-type.enum.js');
|
|
5
|
+
require('../../../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
6
|
+
var relationReferenceShape_enum = require('../../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
7
|
+
require('../../../../enum/decorator/api/controller/request/target.enum.js');
|
|
8
|
+
require('../../../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
9
|
+
require('../../../../enum/decorator/api/controller/response-target.enum.js');
|
|
10
|
+
require('../../../../enum/decorator/api/dto-type.enum.js');
|
|
11
|
+
require('../../../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
12
|
+
require('../../../../enum/decorator/api/function-type.enum.js');
|
|
13
|
+
require('../../../../enum/decorator/api/on-type.enum.js');
|
|
14
|
+
require('../../../../enum/decorator/api/property/data-type.enum.js');
|
|
15
|
+
require('../../../../enum/decorator/api/property/date/identifier.enum.js');
|
|
16
|
+
require('../../../../enum/decorator/api/property/date/type.enum.js');
|
|
17
|
+
require('../../../../enum/decorator/api/property/desribe-type.enum.js');
|
|
18
|
+
require('../../../../enum/decorator/api/property/number-type.enum.js');
|
|
19
|
+
require('../../../../enum/decorator/api/property/string-type.enum.js');
|
|
20
|
+
require('../../../../enum/decorator/api/route-type.enum.js');
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Projects loaded relation objects into the configured response reference shape.
|
|
24
|
+
* @template E - Entity type that owns the relation configuration.
|
|
25
|
+
* @template R - Response value type.
|
|
26
|
+
* @param {IApiControllerPropertiesRouteBaseRelationsResponse<E> | undefined} relationConfig - Response relation projection configuration.
|
|
27
|
+
* @param {R} response - Response value to project.
|
|
28
|
+
* @returns {R} Response value with projected relation references.
|
|
29
|
+
*/
|
|
30
|
+
function ApiRouteProjectRelationResponse(relationConfig, response) {
|
|
31
|
+
if (!relationConfig?.load?.include) {
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
const relationNames = Object.keys(relationConfig.load.include);
|
|
35
|
+
const referenceKey = relationConfig.reference.key ?? "id";
|
|
36
|
+
const responses = [];
|
|
37
|
+
let projectedArray;
|
|
38
|
+
if (Array.isArray(response)) {
|
|
39
|
+
projectedArray = response.map((item) => {
|
|
40
|
+
if (item === null || typeof item !== "object") {
|
|
41
|
+
return item;
|
|
42
|
+
}
|
|
43
|
+
const projectedItem = { ...item };
|
|
44
|
+
responses.push(projectedItem);
|
|
45
|
+
return projectedItem;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
else if (response !== null && typeof response === "object" && "items" in response && Array.isArray(response.items)) {
|
|
49
|
+
response.items = response.items.map((item) => {
|
|
50
|
+
if (item === null || typeof item !== "object") {
|
|
51
|
+
return item;
|
|
52
|
+
}
|
|
53
|
+
const projectedItem = { ...item };
|
|
54
|
+
responses.push(projectedItem);
|
|
55
|
+
return projectedItem;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else if (response !== null && typeof response === "object") {
|
|
59
|
+
responses.push(response);
|
|
60
|
+
}
|
|
61
|
+
for (const projectedResponse of responses) {
|
|
62
|
+
for (const relationName of relationNames) {
|
|
63
|
+
const relationValue = projectedResponse[relationName];
|
|
64
|
+
if (relationValue === null || relationValue === undefined || typeof relationValue !== "object") {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const referenceValue = relationValue[referenceKey];
|
|
68
|
+
projectedResponse[relationName] = relationConfig.reference.shape === relationReferenceShape_enum.EApiControllerRelationReferenceShape.SCALAR ? referenceValue : { [referenceKey]: referenceValue };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return projectedArray ? projectedArray : response;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
exports.ApiRouteProjectRelationResponse = ApiRouteProjectRelationResponse;
|
|
75
|
+
//# sourceMappingURL=project-relation.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-relation.utility.js","sources":["../../../../../../../src/utility/api/route/response/project-relation.utility.ts"],"sourcesContent":[null],"names":["EApiControllerRelationReferenceShape"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;;;;;;;AAOG;AACG,SAAU,+BAA+B,CAA8B,cAAiF,EAAE,QAAW,EAAA;AAC1K,IAAA,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,EAAE;AACnC,QAAA,OAAO,QAAQ;IAChB;AAEA,IAAA,MAAM,aAAa,GAAkB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7E,MAAM,YAAY,GAAW,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI,IAAI;IACjE,MAAM,SAAS,GAAmC,EAAE;AACpD,IAAA,IAAI,cAA0C;AAE9C,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;QAC5B,cAAc,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAa,KAAa;YACxD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC9C,gBAAA,OAAO,IAAI;YACZ;AAEA,YAAA,MAAM,aAAa,GAA4B,EAAE,GAAI,IAAgC,EAAE;AACvF,YAAA,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;AAE7B,YAAA,OAAO,aAAa;AACrB,QAAA,CAAC,CAAC;IACH;SAAO,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,IAAI,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAE,QAAgC,CAAC,KAAK,CAAC,EAAE;AAC7I,QAAA,QAAsC,CAAC,KAAK,GAAI,QAAsC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAa,KAAa;YAC5H,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC9C,gBAAA,OAAO,IAAI;YACZ;AAEA,YAAA,MAAM,aAAa,GAA4B,EAAE,GAAI,IAAgC,EAAE;AACvF,YAAA,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC;AAE7B,YAAA,OAAO,aAAa;AACrB,QAAA,CAAC,CAAC;IACH;SAAO,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC7D,QAAA,SAAS,CAAC,IAAI,CAAC,QAAmC,CAAC;IACpD;AAEA,IAAA,KAAK,MAAM,iBAAiB,IAAI,SAAS,EAAE;AAC1C,QAAA,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE;AACzC,YAAA,MAAM,aAAa,GAAY,iBAAiB,CAAC,YAAY,CAAC;AAE9D,YAAA,IAAI,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,SAAS,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;gBAC/F;YACD;AAEA,YAAA,MAAM,cAAc,GAAa,aAAyC,CAAC,YAAY,CAAC;YACxF,iBAAiB,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,KAAK,KAAKA,gEAAoC,CAAC,MAAM,GAAG,cAAc,GAAG,EAAE,CAAC,YAAY,GAAG,cAAc,EAAE;QACvK;IACD;IAEA,OAAO,cAAc,GAAI,cAAoB,GAAG,QAAQ;AACzD;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IApiBaseEntity } from '../../../../interface/api-base-entity.interface';
|
|
2
|
+
import type { IApiRouteMetadata } from '../../../../interface/decorator/api/index';
|
|
3
|
+
/**
|
|
4
|
+
* Serializes a route response using the route metadata response DTO configuration.
|
|
5
|
+
* @template E - Entity type represented by the route metadata.
|
|
6
|
+
* @template R - Response value type.
|
|
7
|
+
* @param {Pick<IApiRouteMetadata<E>, "response">} metadata - Route metadata containing response serialization settings.
|
|
8
|
+
* @param {R} response - Response value to serialize.
|
|
9
|
+
* @returns {R} Serialized response value.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ApiRouteSerializeResponse<E extends IApiBaseEntity, R>(metadata: Pick<IApiRouteMetadata<E>, "response">, response: R): R;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var common = require('@nestjs/common');
|
|
4
|
+
var classTransformer = require('class-transformer');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Serializes a route response using the route metadata response DTO configuration.
|
|
8
|
+
* @template E - Entity type represented by the route metadata.
|
|
9
|
+
* @template R - Response value type.
|
|
10
|
+
* @param {Pick<IApiRouteMetadata<E>, "response">} metadata - Route metadata containing response serialization settings.
|
|
11
|
+
* @param {R} response - Response value to serialize.
|
|
12
|
+
* @returns {R} Serialized response value.
|
|
13
|
+
*/
|
|
14
|
+
function ApiRouteSerializeResponse(metadata, response) {
|
|
15
|
+
if (!metadata.response?.serialization?.isEnabled || !metadata.response.type || metadata.response.status === common.HttpStatus.NO_CONTENT) {
|
|
16
|
+
return response;
|
|
17
|
+
}
|
|
18
|
+
return classTransformer.plainToInstance(metadata.response.type, response, {
|
|
19
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
20
|
+
excludeExtraneousValues: true,
|
|
21
|
+
strategy: "excludeAll",
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
exports.ApiRouteSerializeResponse = ApiRouteSerializeResponse;
|
|
26
|
+
//# sourceMappingURL=serialize.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serialize.utility.js","sources":["../../../../../../../src/utility/api/route/response/serialize.utility.ts"],"sourcesContent":[null],"names":["HttpStatus","plainToInstance"],"mappings":";;;;;AAOA;;;;;;;AAOG;AACG,SAAU,yBAAyB,CAA8B,QAAgD,EAAE,QAAW,EAAA;IACnI,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,KAAKA,iBAAU,CAAC,UAAU,EAAE;AAClI,QAAA,OAAO,QAAQ;IAChB;IAEA,OAAOC,gCAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAA2B,EAAE,QAAQ,EAAE;;AAE/E,QAAA,uBAAuB,EAAE,IAAI;AAC7B,QAAA,QAAQ,EAAE,YAAY;AACtB,KAAA,CAAC;AACH;;;;"}
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
require('../../enum/decorator/api/action.enum.js');
|
|
4
4
|
require('../../enum/decorator/api/authentication-type.enum.js');
|
|
5
5
|
require('../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
6
|
-
require('../../enum/decorator/api/controller/
|
|
6
|
+
require('../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
7
|
+
require('../../enum/decorator/api/controller/request/target.enum.js');
|
|
8
|
+
require('../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
9
|
+
require('../../enum/decorator/api/controller/response-target.enum.js');
|
|
7
10
|
var dtoType_enum = require('../../enum/decorator/api/dto-type.enum.js');
|
|
11
|
+
require('../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
8
12
|
require('../../enum/decorator/api/function-type.enum.js');
|
|
9
13
|
require('../../enum/decorator/api/on-type.enum.js');
|
|
10
14
|
require('../../enum/decorator/api/property/data-type.enum.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-decorator.utility.js","sources":["../../../../../src/utility/dto/build-decorator.utility.ts"],"sourcesContent":[null],"names":["DtoIsPropertyExposedForGuard","EApiPropertyDescribeType","EApiRouteType","EApiDtoType","DtoHandleDateProperty","DtoGetDecoratorConfig","DtoGenerateDecorator"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-decorator.utility.js","sources":["../../../../../src/utility/dto/build-decorator.utility.ts"],"sourcesContent":[null],"names":["DtoIsPropertyExposedForGuard","EApiPropertyDescribeType","EApiRouteType","EApiDtoType","DtoHandleDateProperty","DtoGetDecoratorConfig","DtoGenerateDecorator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;AAcG;AACH;AACM,SAAU,iBAAiB,CAAoD,MAAS,EAAE,gBAAgD,EAAE,MAAqB,EAAE,OAAU,EAAE,YAAoB,EAAE,YAA+B,EAAE,aAA6C,EAAA;IAKxR,MAAM,UAAU,GAA2C,gBAAgB,CAAC,UAAU,GAAG,MAAM,CAA2C;AAE1I,IAAA,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,SAAS,KAAK,KAAK,KAAK,UAAU,GAAG,OAAO,CAAC,EAAE,UAAU,IAAI,UAAU,GAAG,OAAO,CAAC,EAAE,QAAQ,KAAK,KAAK,CAAC,EAAE;AACnI,QAAA,OAAO,SAAS;IACjB;AAEA,IAAA,IAAI,CAACA,oDAA4B,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE;AACnF,QAAA,OAAO,SAAS;IACjB;IAEA,IAAI,gBAAgB,CAAC,IAAI,KAAKC,yCAAwB,CAAC,IAAI,EAAE;QAC5D,MAAM,YAAY,GAAuC,gBAAgB;QAEzE,IAAI,CAAC,MAAM,KAAKC,4BAAa,CAAC,MAAM,IAAI,MAAM,KAAKA,4BAAa,CAAC,cAAc,KAAK,OAAO,KAAKC,wBAAW,CAAC,IAAI,EAAE;AACjH,YAAA,OAAO,SAAS;QACjB;AAEA,QAAA,IAAI,MAAM,KAAKD,4BAAa,CAAC,QAAQ,IAAI,OAAO,KAAKC,wBAAW,CAAC,KAAK,EAAE;YACvE,MAAM,cAAc,GAAoEC,gDAAqB,CAAC,YAAY,EAAE,YAAY,CAAC,UAAU,CAAC;AAEpJ,YAAA,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,QAAkE,KAAI;AAChG,gBAAA,MAAM,WAAW,GAAmC,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE;AACxG,gBAAA,MAAM,MAAM,GAAsCC,6CAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC;AAEpH,gBAAA,OAAOC,sCAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC;AACxF,YAAA,CAAC,CAAC;QACH;IACD;AAEA,IAAA,MAAM,MAAM,GAAsCD,6CAAqB,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAqB,CAAC;IAExH,MAAM,UAAU,GAA6B,EAAE;IAE/C,UAAU,CAAC,IAAI,CAACC,sCAAoB,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAErH,IAAA,OAAO,UAAU;AAClB;;;;"}
|
|
@@ -6,8 +6,12 @@ var generate_constant = require('../../../constant/utility/dto/generate.constant
|
|
|
6
6
|
require('../../../enum/decorator/api/action.enum.js');
|
|
7
7
|
require('../../../enum/decorator/api/authentication-type.enum.js');
|
|
8
8
|
require('../../../enum/decorator/api/controller/load-relations-strategy.enum.js');
|
|
9
|
-
require('../../../enum/decorator/api/controller/
|
|
9
|
+
require('../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
10
|
+
require('../../../enum/decorator/api/controller/request/target.enum.js');
|
|
11
|
+
require('../../../enum/decorator/api/controller/request/transformer-type.enum.js');
|
|
12
|
+
require('../../../enum/decorator/api/controller/response-target.enum.js');
|
|
10
13
|
var dtoType_enum = require('../../../enum/decorator/api/dto-type.enum.js');
|
|
14
|
+
require('../../../enum/decorator/api/function-transaction-mode.enum.js');
|
|
11
15
|
require('../../../enum/decorator/api/function-type.enum.js');
|
|
12
16
|
require('../../../enum/decorator/api/on-type.enum.js');
|
|
13
17
|
require('../../../enum/decorator/api/property/data-type.enum.js');
|