@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
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
var tslib_es6 = require('../../../external/tslib/tslib.es6.js');
|
|
4
4
|
var documentSourcesToken_constant = require('../../../constant/class/authorization/policy/document-sources-token.constant.js');
|
|
5
5
|
var controller_constant = require('../../../constant/decorator/api/controller.constant.js');
|
|
6
|
+
require('../../../constant/decorator/api/function.constant.js');
|
|
7
|
+
var method_constant = require('../../../constant/decorator/api/method.constant.js');
|
|
6
8
|
require('../../../enum/class/authorization/decision-type.enum.js');
|
|
7
9
|
require('../../../enum/class/authorization/effect.enum.js');
|
|
8
10
|
var mode_enum = require('../../../enum/class/authorization/mode.enum.js');
|
|
@@ -69,12 +71,16 @@ exports.ApiAuthorizationBootstrapValidationService = class ApiAuthorizationBoots
|
|
|
69
71
|
return;
|
|
70
72
|
}
|
|
71
73
|
this.assertValidMode(authorization.defaultMode, metatype.name);
|
|
72
|
-
const enabledRouteTypes = Object.values(routeType_enum.EApiRouteType).filter((routeType) => properties.routes[routeType]?.isEnabled !== false);
|
|
73
|
-
const enabledRouteModes = new Set(enabledRouteTypes.map((routeType) => properties.routes[routeType]?.authorization?.mode ?? authorization.defaultMode));
|
|
74
|
+
const enabledRouteTypes = Object.values(routeType_enum.EApiRouteType).filter((routeType) => properties.routes[routeType]?.generation?.isEnabled !== false);
|
|
75
|
+
const enabledRouteModes = new Set(enabledRouteTypes.map((routeType) => properties.routes[routeType]?.security?.authorization?.mode ?? authorization.defaultMode));
|
|
76
|
+
const methodRouteModes = this.validateMethodLevelRouteMetadata(metatype, properties);
|
|
77
|
+
for (const routeMode of methodRouteModes) {
|
|
78
|
+
enabledRouteModes.add(routeMode);
|
|
79
|
+
}
|
|
74
80
|
const usesHooks = enabledRouteModes.has(mode_enum.EApiAuthorizationMode.HOOKS);
|
|
75
81
|
const usesIam = enabledRouteModes.has(mode_enum.EApiAuthorizationMode.IAM);
|
|
76
82
|
for (const routeType of enabledRouteTypes) {
|
|
77
|
-
const routeMode = properties.routes[routeType]?.authorization?.mode ?? authorization.defaultMode;
|
|
83
|
+
const routeMode = properties.routes[routeType]?.security?.authorization?.mode ?? authorization.defaultMode;
|
|
78
84
|
this.assertValidMode(routeMode, metatype.name, routeType);
|
|
79
85
|
}
|
|
80
86
|
if (usesHooks && !this.policyRegistry.hasSubscriberForEntity(properties.entity)) {
|
|
@@ -105,6 +111,34 @@ exports.ApiAuthorizationBootstrapValidationService = class ApiAuthorizationBoots
|
|
|
105
111
|
this.validateResourceDefinition(metatype.name, authorization.resourceDefinition);
|
|
106
112
|
}
|
|
107
113
|
}
|
|
114
|
+
validateMethodLevelRouteMetadata(metatype, properties) {
|
|
115
|
+
const modes = new Set();
|
|
116
|
+
for (const methodName of Object.getOwnPropertyNames(metatype.prototype)) {
|
|
117
|
+
if (methodName === "constructor") {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const handler = metatype.prototype[methodName];
|
|
121
|
+
const handlerMetadata = typeof handler === "function" ? Reflect.getMetadata(method_constant.METHOD_API_DECORATOR_CONSTANT.ROUTE_METADATA_KEY, handler) : undefined;
|
|
122
|
+
const prototypeMetadata = Reflect.getMetadata(method_constant.METHOD_API_DECORATOR_CONSTANT.ROUTE_METADATA_KEY, metatype.prototype, methodName);
|
|
123
|
+
const metadata = (handlerMetadata ?? prototypeMetadata);
|
|
124
|
+
if (!metadata) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
if (!metadata.resource?.action || typeof metadata.resource.action !== "string") {
|
|
128
|
+
throw exception_utility.ErrorException(`Controller "${metatype.name}" method "${methodName}" must declare route resource.action`);
|
|
129
|
+
}
|
|
130
|
+
if (metadata.resource.entity !== properties.entity) {
|
|
131
|
+
throw exception_utility.ErrorException(`Controller "${metatype.name}" method "${methodName}" route resource.entity must match controller entity`);
|
|
132
|
+
}
|
|
133
|
+
const mode = metadata.security?.authorization?.mode;
|
|
134
|
+
if (!mode) {
|
|
135
|
+
throw exception_utility.ErrorException(`Controller "${metatype.name}" method "${methodName}" must declare method-level authorization mode`);
|
|
136
|
+
}
|
|
137
|
+
this.assertValidMode(mode, metatype.name);
|
|
138
|
+
modes.add(mode);
|
|
139
|
+
}
|
|
140
|
+
return modes;
|
|
141
|
+
}
|
|
108
142
|
validateResourceDefinition(controllerName, resourceDefinition) {
|
|
109
143
|
if (!resourceDefinition) {
|
|
110
144
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap-validation.service.class.js","sources":["../../../../../../src/class/api/authorization/bootstrap-validation.service.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","ApiAuthorizationBootstrapValidationService","EApiAuthorizationMode","ErrorException","CONTROLLER_API_DECORATOR_CONSTANT","EApiRouteType","__decorate","Injectable","__param","Optional","Inject","AUTHORIZATION_POLICY_DOCUMENT_SOURCES_TOKEN","DiscoveryService","ApiAuthorizationPolicyRegistry"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bootstrap-validation.service.class.js","sources":["../../../../../../src/class/api/authorization/bootstrap-validation.service.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","ApiAuthorizationBootstrapValidationService","EApiAuthorizationMode","ErrorException","CONTROLLER_API_DECORATOR_CONSTANT","EApiRouteType","METHOD_API_DECORATOR_CONSTANT","__decorate","Injectable","__param","Optional","Inject","AUTHORIZATION_POLICY_DOCUMENT_SOURCES_TOKEN","DiscoveryService","ApiAuthorizationPolicyRegistry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAM,sCAAsC,GAAkB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E,CAAC;YACrH;YAEA,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;gBAC/B,sCAAsC,CAAC,KAAK,CAAC,CAAA,YAAA,EAAe,cAAc,CAAA,oDAAA,EAAuD,KAAK,CAAC,IAAI,CAAA,CAAA,CAAG,CAAC;gBAE/I,MAAMA,gCAAc,CAAC,CAAA,YAAA,EAAe,cAAc,CAAA,oDAAA,EAAuD,KAAK,CAAC,IAAI,CAAA,CAAA,CAAG,CAAC;YACxH;YAEA,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;gBACpC,sCAAsC,CAAC,KAAK,CAAC,CAAA,YAAA,EAAe,cAAc,CAAA,mDAAA,EAAsD,KAAK,CAAC,SAAS,CAAA,CAAA,CAAG,CAAC;gBAEnJ,MAAMA,gCAAc,CAAC,CAAA,YAAA,EAAe,cAAc,CAAA,mDAAA,EAAsD,KAAK,CAAC,SAAS,CAAA,CAAA,CAAG,CAAC;YAC5H;AAEA,YAAA,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;AAC1B,YAAA,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC;QAChC;IACD;;AAzNYF,kDAA0C,GAAAM,oBAAA,CAAA;AADtD,IAAAC,iBAAU,EAAE;IAKVC,iBAAA,CAAA,CAAA,EAAAC,eAAQ,EAAE,CAAA;AACV,IAAAD,iBAAA,CAAA,CAAA,EAAAE,aAAM,CAACC,yEAA2C,CAAC,CAAA;+CAHjBC,qBAAgB;QAClBC,6CAA8B,EAAA,KAAA,CAAA;AAHpD,CAAA,EAAAb,kDAA0C,CA0NtD;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
2
|
+
import type { IApiAuthorizationPolicyRegistry } from '../../../interface/class/api/authorization/index';
|
|
3
|
+
export declare class ApiAuthorizationCacheInvalidationService {
|
|
4
|
+
private readonly policyRegistry;
|
|
5
|
+
constructor(policyRegistry: IApiAuthorizationPolicyRegistry);
|
|
6
|
+
invalidate(entity?: new () => IApiBaseEntity): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib_es6 = require('../../../external/tslib/tslib.es6.js');
|
|
4
|
+
var tokenRegistry_constant = require('../../../constant/class/authorization/token-registry.constant.js');
|
|
5
|
+
var common = require('@nestjs/common');
|
|
6
|
+
|
|
7
|
+
exports.ApiAuthorizationCacheInvalidationService = class ApiAuthorizationCacheInvalidationService {
|
|
8
|
+
policyRegistry;
|
|
9
|
+
constructor(policyRegistry) {
|
|
10
|
+
this.policyRegistry = policyRegistry;
|
|
11
|
+
}
|
|
12
|
+
invalidate(entity) {
|
|
13
|
+
this.policyRegistry.invalidateCache(entity);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.ApiAuthorizationCacheInvalidationService = tslib_es6.__decorate([
|
|
17
|
+
common.Injectable(),
|
|
18
|
+
tslib_es6.__param(0, common.Inject(tokenRegistry_constant.AUTHORIZATION_POLICY_REGISTRY_TOKEN)),
|
|
19
|
+
tslib_es6.__metadata("design:paramtypes", [Object])
|
|
20
|
+
], exports.ApiAuthorizationCacheInvalidationService);
|
|
21
|
+
//# sourceMappingURL=cache-invalidation.service.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-invalidation.service.class.js","sources":["../../../../../../src/class/api/authorization/cache-invalidation.service.class.ts"],"sourcesContent":[null],"names":["ApiAuthorizationCacheInvalidationService","__decorate","Injectable","__param","Inject","AUTHORIZATION_POLICY_REGISTRY_TOKEN"],"mappings":";;;;;;AAOaA,gDAAwC,GAA9C,MAAM,wCAAwC,CAAA;AAGlC,IAAA,cAAA;AAFlB,IAAA,WAAA,CAEkB,cAA+C,EAAA;QAA/C,IAAA,CAAA,cAAc,GAAd,cAAc;IAC7B;AAEI,IAAA,UAAU,CAAC,MAAiC,EAAA;AAClD,QAAA,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC;IAC5C;;AARYA,gDAAwC,GAAAC,oBAAA,CAAA;AADpD,IAAAC,iBAAU,EAAE;AAGV,IAAAC,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACC,0DAAmC,CAAC,CAAA;;AAFjC,CAAA,EAAAL,gDAAwC,CASpD;;"}
|
|
@@ -6,9 +6,8 @@ export declare class ApiAuthorizationGuard implements CanActivate {
|
|
|
6
6
|
canActivate(context: ExecutionContext): Promise<boolean>;
|
|
7
7
|
private attachDecisionToRequest;
|
|
8
8
|
private isControllerSecurable;
|
|
9
|
-
private resolveAuthorization;
|
|
10
9
|
private resolveControllerProperties;
|
|
11
10
|
private resolveHeaders;
|
|
12
11
|
private resolveRequestMetadata;
|
|
13
|
-
private
|
|
12
|
+
private resolveRouteMetadata;
|
|
14
13
|
}
|
|
@@ -35,15 +35,13 @@ exports.ApiAuthorizationGuard = class ApiAuthorizationGuard {
|
|
|
35
35
|
authorizationGuardLogger.error("ApiControllerSecurable requires an authorization block in @ApiController(...)");
|
|
36
36
|
throw exception_utility.ErrorException("ApiControllerSecurable requires an authorization block in @ApiController(...)");
|
|
37
37
|
}
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const action =
|
|
41
|
-
const routeType = this.resolveRouteType(context);
|
|
38
|
+
const routeMetadata = this.resolveRouteMetadata(context);
|
|
39
|
+
const entityConstructor = routeMetadata.resource.entity;
|
|
40
|
+
const action = routeMetadata.resource.action;
|
|
42
41
|
authorizationGuardLogger.verbose(`Evaluating authorization for entity "${entityConstructor.name}" action "${action}"`);
|
|
43
42
|
const request = context.switchToHttp().getRequest();
|
|
44
43
|
const authenticationRequest = request;
|
|
45
44
|
const requestMetadata = this.resolveRequestMetadata(request);
|
|
46
|
-
const routeAuthorization = routeType ? properties.routes[routeType]?.authorization : undefined;
|
|
47
45
|
const decision = await this.runtime.evaluate({
|
|
48
46
|
action,
|
|
49
47
|
authenticationRequest,
|
|
@@ -51,8 +49,8 @@ exports.ApiAuthorizationGuard = class ApiAuthorizationGuard {
|
|
|
51
49
|
entity: entityConstructor,
|
|
52
50
|
requestMetadata,
|
|
53
51
|
resource: undefined,
|
|
54
|
-
routeAuthorization,
|
|
55
|
-
routeType,
|
|
52
|
+
routeAuthorization: routeMetadata.security?.authorization,
|
|
53
|
+
routeType: routeMetadata.route.type,
|
|
56
54
|
});
|
|
57
55
|
this.attachDecisionToRequest(request, decision);
|
|
58
56
|
if (decision.effect === effect_enum.EApiPolicyEffect.DENY) {
|
|
@@ -69,15 +67,6 @@ exports.ApiAuthorizationGuard = class ApiAuthorizationGuard {
|
|
|
69
67
|
isControllerSecurable(context) {
|
|
70
68
|
return Boolean(Reflect.getMetadata(controller_constant.CONTROLLER_API_DECORATOR_CONSTANT.SECURABLE_METADATA_KEY, context.getClass()));
|
|
71
69
|
}
|
|
72
|
-
resolveAuthorization(context) {
|
|
73
|
-
const authorization = Reflect.getMetadata(method_constant.METHOD_API_DECORATOR_CONSTANT.AUTHORIZATION_METADATA_KEY, context.getHandler());
|
|
74
|
-
if (authorization) {
|
|
75
|
-
return authorization;
|
|
76
|
-
}
|
|
77
|
-
const handlerName = context.getHandler().name || "unknown";
|
|
78
|
-
authorizationGuardLogger.error(`ApiControllerSecurable handler "${handlerName}" requires an explicit authorization.action declared via @ApiMethod(...)`);
|
|
79
|
-
throw exception_utility.ErrorException(`ApiControllerSecurable handler "${handlerName}" requires an explicit authorization.action declared via @ApiMethod(...)`);
|
|
80
|
-
}
|
|
81
70
|
resolveControllerProperties(context) {
|
|
82
71
|
return Reflect.getMetadata(controller_constant.CONTROLLER_API_DECORATOR_CONSTANT.PROPERTIES_METADATA_KEY, context.getClass());
|
|
83
72
|
}
|
|
@@ -108,8 +97,14 @@ exports.ApiAuthorizationGuard = class ApiAuthorizationGuard {
|
|
|
108
97
|
query: request.query,
|
|
109
98
|
};
|
|
110
99
|
}
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
resolveRouteMetadata(context) {
|
|
101
|
+
const metadata = Reflect.getMetadata(method_constant.METHOD_API_DECORATOR_CONSTANT.ROUTE_METADATA_KEY, context.getHandler());
|
|
102
|
+
if (metadata) {
|
|
103
|
+
return metadata;
|
|
104
|
+
}
|
|
105
|
+
const handlerName = context.getHandler().name || "unknown";
|
|
106
|
+
authorizationGuardLogger.error(`ApiControllerSecurable handler "${handlerName}" requires method-level ApiRouteMetadata`);
|
|
107
|
+
throw exception_utility.ErrorException(`ApiControllerSecurable handler "${handlerName}" requires method-level ApiRouteMetadata`);
|
|
113
108
|
}
|
|
114
109
|
};
|
|
115
110
|
exports.ApiAuthorizationGuard = tslib_es6.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.class.js","sources":["../../../../../../src/class/api/authorization/guard.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","ApiAuthorizationGuard","ErrorException","EApiPolicyEffect","ForbiddenException","AUTHORIZATION_DECISION_METADATA_CONSTANT","CONTROLLER_API_DECORATOR_CONSTANT","METHOD_API_DECORATOR_CONSTANT","__decorate","Injectable","ApiAuthorizationRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"guard.class.js","sources":["../../../../../../src/class/api/authorization/guard.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","ApiAuthorizationGuard","ErrorException","EApiPolicyEffect","ForbiddenException","AUTHORIZATION_DECISION_METADATA_CONSTANT","CONTROLLER_API_DECORATOR_CONSTANT","METHOD_API_DECORATOR_CONSTANT","__decorate","Injectable","ApiAuthorizationRuntime"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,wBAAwB,GAAkBA,4BAAa,CAAC,SAAS,CAAC,uBAAuB,CAAC;AAGnFC,6BAAqB,GAA3B,MAAM,qBAAqB,CAAA;AACG,IAAA,OAAA;AAApC,IAAA,WAAA,CAAoC,O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CAAc,CAAC,CAAA,gCAAA,EAAmC,WAAW,CAAA,wCAAA,CAA0C,CAAC;IAC/G;;AA7GYD,6BAAqB,GAAAO,oBAAA,CAAA;AADjC,IAAAC,iBAAU,EAAE;+CAEiCC,qCAAuB,CAAA;AADxD,CAAA,EAAAT,6BAAqB,CA8GjC;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ApiAuthorizationBootstrapValidationService } from './bootstrap-validation.service.class';
|
|
2
|
+
export { ApiAuthorizationCacheInvalidationService } from './cache-invalidation.service.class';
|
|
2
3
|
export { ApiAuthorizationEngine } from './engine.class';
|
|
3
4
|
export { ApiAuthorizationGuard } from './guard.class';
|
|
4
5
|
export { ApiAuthorizationHookPermissionResolver } from './hook-permission-resolver.class';
|
|
@@ -17,9 +17,8 @@ class ApiAuthorizationPolicyExecutor {
|
|
|
17
17
|
const result = typedHook.call(subscriber, context);
|
|
18
18
|
return this.normalizeRuleResult(await result);
|
|
19
19
|
}
|
|
20
|
+
return [];
|
|
20
21
|
}
|
|
21
|
-
// NOTE: This fallback exists while CRUD hooks and custom actions can still share
|
|
22
|
-
// overlapping action names through the current compatibility layer.
|
|
23
22
|
if (typeof subscriber.getCustomActionRule !== "function") {
|
|
24
23
|
return [];
|
|
25
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.class.js","sources":["../../../../../../../src/class/api/authorization/policy/executor.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","EApiPolicyOnType","CamelCaseString"],"mappings":";;;;;;AAUA,MAAM,oBAAoB,GAAkBA,4BAAa,CAAC,SAAS,CAAC,gCAAgC,CAAC;MAIxF,8BAA8B,CAAA;IACnC,aAAa,OAAO,CAAmD,UAAgD,EAAE,MAAe,EAAE,OAAoD,EAAA;AACpM,QAAA,MAAM,SAAS,GAA8B,OAAO,CAAC,SAAS;QAE9D,IAAI,SAAS,EAAE;AACd,YAAA,MAAM,QAAQ,GAAW,CAAA,EAAA,EAAKC,4BAAgB,CAAC,MAAM,CAAA,EAAGC,uCAAe,CAAC,SAAS,CAAC,CAAA,CAAE;AACpF,YAAA,MAAM,IAAI,GAAY,UAAU,CAAC,QAAsD,CAAC;AAExF,YAAA,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AAC/B,gBAAA,oBAAoB,CAAC,OAAO,CAAC,CAAA,oCAAA,EAAuC,QAAQ,CAAA,MAAA,EAAS,UAAU,CAAC,WAAW,CAAC,IAAI,CAAA,aAAA,EAAgB,MAAM,CAAA,CAAA,CAAG,CAAC;gBAC1I,MAAM,SAAS,GAAqH,IAAwH;gBAC5P,MAAM,MAAM,GAA2D,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;AAE1G,gBAAA,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,MAAM,CAAC;YAC9C;
|
|
1
|
+
{"version":3,"file":"executor.class.js","sources":["../../../../../../../src/class/api/authorization/policy/executor.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","EApiPolicyOnType","CamelCaseString"],"mappings":";;;;;;AAUA,MAAM,oBAAoB,GAAkBA,4BAAa,CAAC,SAAS,CAAC,gCAAgC,CAAC;MAIxF,8BAA8B,CAAA;IACnC,aAAa,OAAO,CAAmD,UAAgD,EAAE,MAAe,EAAE,OAAoD,EAAA;AACpM,QAAA,MAAM,SAAS,GAA8B,OAAO,CAAC,SAAS;QAE9D,IAAI,SAAS,EAAE;AACd,YAAA,MAAM,QAAQ,GAAW,CAAA,EAAA,EAAKC,4BAAgB,CAAC,MAAM,CAAA,EAAGC,uCAAe,CAAC,SAAS,CAAC,CAAA,CAAE;AACpF,YAAA,MAAM,IAAI,GAAY,UAAU,CAAC,QAAsD,CAAC;AAExF,YAAA,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;AAC/B,gBAAA,oBAAoB,CAAC,OAAO,CAAC,CAAA,oCAAA,EAAuC,QAAQ,CAAA,MAAA,EAAS,UAAU,CAAC,WAAW,CAAC,IAAI,CAAA,aAAA,EAAgB,MAAM,CAAA,CAAA,CAAG,CAAC;gBAC1I,MAAM,SAAS,GAAqH,IAAwH;gBAC5P,MAAM,MAAM,GAA2D,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;AAE1G,gBAAA,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,MAAM,CAAC;YAC9C;AAEA,YAAA,OAAO,EAAE;QACV;AAEA,QAAA,IAAI,OAAO,UAAU,CAAC,mBAAmB,KAAK,UAAU,EAAE;AACzD,YAAA,OAAO,EAAE;QACV;QAEA,MAAM,gBAAgB,GAA+I,UAAU,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAA+I;QAElW,MAAM,YAAY,GAA2D,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC;AAE9G,QAAA,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,YAAY,CAAC;IACpD;IAEQ,OAAO,mBAAmB,CAA8B,MAAyD,EAAA;AACxH,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,IAAoE,KAA0D,IAAI,IAAI,IAAI,CAAC;IAClK;AACA;;;;"}
|
|
@@ -2,3 +2,4 @@ export { ApiAuthorizationPolicyBase } from './base.class';
|
|
|
2
2
|
export { ApiAuthorizationPolicyDiscoveryService } from './discovery-service.class';
|
|
3
3
|
export { ApiAuthorizationPolicyExecutor } from './executor.class';
|
|
4
4
|
export { apiAuthorizationPolicyRegistry, ApiAuthorizationPolicyRegistry } from './registry.class';
|
|
5
|
+
export { PolicySubscriberWrapper } from './subscriber-wrapper.class';
|
|
@@ -3,16 +3,16 @@ import type { IApiAuthorizationPolicy, IApiAuthorizationPolicyRegistry, IApiAuth
|
|
|
3
3
|
import type { IApiAuthorizationPolicyBuildOptions } from '../../../../interface/class/api/authorization/policy/build-options.interface';
|
|
4
4
|
import type { IApiAuthorizationPolicyCacheOptions } from '../../../../interface/class/api/authorization/policy/cache-options.interface';
|
|
5
5
|
import type { TApiAuthorizationPolicyHookResult } from '../../../../type/class/api/authorization/policy/hook/index';
|
|
6
|
-
type TEntityConstructor<E extends IApiBaseEntity> = new () => E;
|
|
7
6
|
export declare class ApiAuthorizationPolicyRegistry implements IApiAuthorizationPolicyRegistry {
|
|
8
7
|
private cacheOptions;
|
|
9
8
|
private readonly POLICY_REGISTRY;
|
|
10
9
|
private readonly POLICY_RULE_CACHE;
|
|
11
10
|
constructor();
|
|
12
|
-
buildAggregatedPolicy<E extends IApiBaseEntity, TAction extends string>(entity:
|
|
11
|
+
buildAggregatedPolicy<E extends IApiBaseEntity, TAction extends string>(entity: new () => E, action: TAction, options?: IApiAuthorizationPolicyBuildOptions<E>): Promise<IApiAuthorizationPolicy<E, TApiAuthorizationPolicyHookResult<TAction, E>> | undefined>;
|
|
13
12
|
clear(): void;
|
|
14
13
|
configureCache(options?: IApiAuthorizationPolicyCacheOptions): void;
|
|
15
|
-
hasSubscriberForEntity(entity:
|
|
14
|
+
hasSubscriberForEntity(entity: new () => IApiBaseEntity): boolean;
|
|
15
|
+
invalidateCache(entity?: new () => IApiBaseEntity): void;
|
|
16
16
|
registerSubscriber<E extends IApiBaseEntity>(registration: IApiAuthorizationPolicySubscriberRegistration<E>): void;
|
|
17
17
|
private cacheRules;
|
|
18
18
|
private createPolicyCacheKey;
|
|
@@ -26,7 +26,5 @@ export declare class ApiAuthorizationPolicyRegistry implements IApiAuthorization
|
|
|
26
26
|
private resolvePolicyId;
|
|
27
27
|
private resolvePolicyRules;
|
|
28
28
|
private resolvePrincipal;
|
|
29
|
-
private resolveRouteType;
|
|
30
29
|
}
|
|
31
30
|
export declare const apiAuthorizationPolicyRegistry: ApiAuthorizationPolicyRegistry;
|
|
32
|
-
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var decorator_constant = require('../../../../constant/class/authorization/policy/decorator.constant.js');
|
|
4
|
-
var routeType_enum = require('../../../../enum/decorator/api/route-type.enum.js');
|
|
5
4
|
var resolveDefaultPrincipal_utility = require('../../../../utility/authorization/resolve-default-principal.utility.js');
|
|
6
5
|
var generateEntityInformation_utility = require('../../../../utility/generate-entity-information.utility.js');
|
|
7
6
|
var logger_utility = require('../../../../utility/logger.utility.js');
|
|
8
7
|
var executor_class = require('./executor.class.js');
|
|
8
|
+
var subscriberWrapper_class = require('./subscriber-wrapper.class.js');
|
|
9
9
|
|
|
10
10
|
const policyRegistryLogger = logger_utility.LoggerUtility.getLogger("ApiAuthorizationPolicyRegistry");
|
|
11
11
|
class ApiAuthorizationPolicyRegistry {
|
|
@@ -30,7 +30,6 @@ class ApiAuthorizationPolicyRegistry {
|
|
|
30
30
|
const entityMetadata = generateEntityInformation_utility.GenerateEntityInformation(entity);
|
|
31
31
|
const { authenticationRequest, permissions = [], principal: principalOverride, principalResolver, requestMetadata, routeType: routeTypeOverride } = options;
|
|
32
32
|
const principal = await this.resolvePrincipal(authenticationRequest, principalOverride, principalResolver);
|
|
33
|
-
const routeType = this.resolveRouteType(action, routeTypeOverride);
|
|
34
33
|
const contextData = {
|
|
35
34
|
action,
|
|
36
35
|
authenticationRequest,
|
|
@@ -39,7 +38,7 @@ class ApiAuthorizationPolicyRegistry {
|
|
|
39
38
|
entityMetadata,
|
|
40
39
|
permissions,
|
|
41
40
|
principal,
|
|
42
|
-
routeType,
|
|
41
|
+
routeType: routeTypeOverride,
|
|
43
42
|
};
|
|
44
43
|
const aggregatedRules = [];
|
|
45
44
|
const policyIds = new Set();
|
|
@@ -85,6 +84,13 @@ class ApiAuthorizationPolicyRegistry {
|
|
|
85
84
|
hasSubscriberForEntity(entity) {
|
|
86
85
|
return (this.POLICY_REGISTRY.get(this.getEntityName(entity))?.registrations.length ?? 0) > 0;
|
|
87
86
|
}
|
|
87
|
+
invalidateCache(entity) {
|
|
88
|
+
if (!entity) {
|
|
89
|
+
this.POLICY_RULE_CACHE.clear();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.invalidateCacheForEntity(this.getEntityName(entity));
|
|
93
|
+
}
|
|
88
94
|
registerSubscriber(registration) {
|
|
89
95
|
const normalizedRegistration = {
|
|
90
96
|
cache: registration.cache,
|
|
@@ -98,12 +104,12 @@ class ApiAuthorizationPolicyRegistry {
|
|
|
98
104
|
policyRegistryLogger.verbose(`Registering policy subscriber for entity "${entityName}" with policyId "${normalizedRegistration.policyId}" and priority ${normalizedRegistration.priority}`);
|
|
99
105
|
let wrapper = this.POLICY_REGISTRY.get(entityName);
|
|
100
106
|
if (!wrapper) {
|
|
101
|
-
wrapper = new PolicySubscriberWrapper(entityName);
|
|
107
|
+
wrapper = new subscriberWrapper_class.PolicySubscriberWrapper(entityName);
|
|
102
108
|
this.POLICY_REGISTRY.set(entityName, wrapper);
|
|
103
109
|
}
|
|
104
110
|
wrapper.addRegistration(normalizedRegistration);
|
|
105
111
|
policyRegistryLogger.debug(`Total registrations for entity "${entityName}": ${wrapper.getRegistrationCount()}`);
|
|
106
|
-
this.
|
|
112
|
+
this.invalidateCache(normalizedRegistration.entity);
|
|
107
113
|
}
|
|
108
114
|
cacheRules(cacheKey, rules, cacheOptions) {
|
|
109
115
|
if (!cacheOptions.isEnabled) {
|
|
@@ -190,37 +196,8 @@ class ApiAuthorizationPolicyRegistry {
|
|
|
190
196
|
}
|
|
191
197
|
return resolveDefaultPrincipal_utility.AuthorizationResolveDefaultPrincipal(authenticationRequest?.user);
|
|
192
198
|
}
|
|
193
|
-
// NOTE: This is a compatibility shim until buildAggregatedPolicy uses a single
|
|
194
|
-
// source of truth for CRUD actions instead of accepting both action and routeType.
|
|
195
|
-
resolveRouteType(action, routeType) {
|
|
196
|
-
if (routeType) {
|
|
197
|
-
return routeType;
|
|
198
|
-
}
|
|
199
|
-
return Object.values(routeType_enum.EApiRouteType).includes(action) ? action : undefined;
|
|
200
|
-
}
|
|
201
199
|
}
|
|
202
200
|
const apiAuthorizationPolicyRegistry = new ApiAuthorizationPolicyRegistry();
|
|
203
|
-
class PolicySubscriberWrapper {
|
|
204
|
-
name;
|
|
205
|
-
registrations;
|
|
206
|
-
constructor(name, registrations = []) {
|
|
207
|
-
this.name = name;
|
|
208
|
-
this.registrations = registrations;
|
|
209
|
-
}
|
|
210
|
-
addRegistration(registration) {
|
|
211
|
-
this.registrations.push(registration);
|
|
212
|
-
this.registrations.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
213
|
-
}
|
|
214
|
-
getName() {
|
|
215
|
-
return this.getNormalizedName();
|
|
216
|
-
}
|
|
217
|
-
getRegistrationCount() {
|
|
218
|
-
return this.registrations.length;
|
|
219
|
-
}
|
|
220
|
-
getNormalizedName() {
|
|
221
|
-
return this.name;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
201
|
|
|
225
202
|
exports.ApiAuthorizationPolicyRegistry = ApiAuthorizationPolicyRegistry;
|
|
226
203
|
exports.apiAuthorizationPolicyRegistry = apiAuthorizationPolicyRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.class.js","sources":["../../../../../../../src/class/api/authorization/policy/registry.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","GenerateEntityInformation","AUTHORIZATION_POLICY_DECORATOR_CONSTANT","ApiAuthorizationPolicyExecutor","AuthorizationResolveDefaultPrincipal"
|
|
1
|
+
{"version":3,"file":"registry.class.js","sources":["../../../../../../../src/class/api/authorization/policy/registry.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","GenerateEntityInformation","PolicySubscriberWrapper","AUTHORIZATION_POLICY_DECORATOR_CONSTANT","ApiAuthorizationPolicyExecutor","AuthorizationResolveDefaultPrincipal"],"mappings":";;;;;;;;;AAkBA,MAAM,oBAAoB,GAAkBA,4BAAa,CAAC,SAAS,CAAC,gCAAgC,CAAC;MAExF,8BAA8B,CAAA;AAClC,IAAA,YAAY;AAEH,IAAA,eAAe;AAEf,IAAA,iBAAiB;AAElC,IAAA,WAAA,GAAA;AACC,QAAA,IAAI,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAE;A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,WAAW,GAA+G,IAAI,CAAC,cAAc,CAAmD,QAAQ,EAAE,YAAY,CAAC;QAE7N,IAAI,WAAW,EAAE;AAChB,YAAA,OAAO,WAAW;QACnB;AAEA,QAAA,MAAM,KAAK,GAAmG,MAAMC,6CAA8B,CAAC,OAAO,CAAC,YAAY,CAAC,UAA6D,EAAE,MAAM,EAAE,OAAO,CAAC;QAEvP,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,YAAY,CAAC;AAE9C,QAAA,OAAO,KAAK;IACb;AAEQ,IAAA,MAAM,gBAAgB,CAA2B,qBAAsF,EAAE,iBAAyD,EAAE,iBAAiE,EAAA;QAC5Q,IAAI,iBAAiB,EAAE;AACtB,YAAA,OAAO,iBAAiB;QACzB;QAEA,IAAI,iBAAiB,EAAE;YACtB,OAAO,MAAM,iBAAiB,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,CAAC;QAC3F;AAEA,QAAA,OAAOC,oEAAoC,CAAC,qBAAqB,EAAE,IAAI,CAAC;IACzE;AACA;AAEM,MAAM,8BAA8B,GAAmC,IAAI,8BAA8B;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IApiBaseEntity } from '../../../../interface/api-base-entity.interface';
|
|
2
|
+
import type { IApiAuthorizationPolicySubscriberRegistration } from '../../../../interface/class/api/authorization/index';
|
|
3
|
+
export declare class PolicySubscriberWrapper {
|
|
4
|
+
private readonly name;
|
|
5
|
+
registrations: Array<IApiAuthorizationPolicySubscriberRegistration<IApiBaseEntity>>;
|
|
6
|
+
constructor(name: string, registrations?: Array<IApiAuthorizationPolicySubscriberRegistration<IApiBaseEntity>>);
|
|
7
|
+
addRegistration(registration: IApiAuthorizationPolicySubscriberRegistration<IApiBaseEntity>): void;
|
|
8
|
+
getName(): string;
|
|
9
|
+
getRegistrationCount(): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
class PolicySubscriberWrapper {
|
|
4
|
+
name;
|
|
5
|
+
registrations;
|
|
6
|
+
constructor(name, registrations = []) {
|
|
7
|
+
this.name = name;
|
|
8
|
+
this.registrations = registrations;
|
|
9
|
+
}
|
|
10
|
+
addRegistration(registration) {
|
|
11
|
+
this.registrations.push(registration);
|
|
12
|
+
this.registrations.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
13
|
+
}
|
|
14
|
+
getName() {
|
|
15
|
+
return this.name;
|
|
16
|
+
}
|
|
17
|
+
getRegistrationCount() {
|
|
18
|
+
return this.registrations.length;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.PolicySubscriberWrapper = PolicySubscriberWrapper;
|
|
23
|
+
//# sourceMappingURL=subscriber-wrapper.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriber-wrapper.class.js","sources":["../../../../../../../src/class/api/authorization/policy/subscriber-wrapper.class.ts"],"sourcesContent":[null],"names":[],"mappings":";;MAGa,uBAAuB,CAAA;AAIjB,IAAA,IAAA;AAHX,IAAA,aAAa;IAEpB,WAAA,CACkB,IAAY,EAC7B,aAAA,GAAsF,EAAE,EAAA;QADvE,IAAA,CAAA,IAAI,GAAJ,IAAI;AAGrB,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa;IACnC;AAEO,IAAA,eAAe,CAAC,YAA2E,EAAA;AACjG,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;AACrC,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAgE,EAAE,CAAgE,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC;IACvM;IAEO,OAAO,GAAA;QACb,OAAO,IAAI,CAAC,IAAI;IACjB;IAEO,oBAAoB,GAAA;AAC1B,QAAA,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM;IACjC;AACA;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IApiBaseEntity } from '../../../interface/api-base-entity.interface';
|
|
2
2
|
import type { IApiAuthenticationRequest } from '../../../interface/api/authentication-request.interface';
|
|
3
3
|
import type { IApiAuthorizationAuditSink, IApiAuthorizationDecision, IApiAuthorizationPolicyRegistry, IApiAuthorizationPrincipal, IApiAuthorizationPrincipalResolver, IApiAuthorizationRequestMetadata } from '../../../interface/class/api/authorization/index';
|
|
4
|
-
import type { IApiControllerAuthorizationProperties
|
|
4
|
+
import type { IApiControllerAuthorizationProperties } from '../../../interface/decorator/api/controller/properties/index';
|
|
5
|
+
import type { IApiRouteAuthorizationProperties } from '../../../interface/decorator/api/route/index';
|
|
5
6
|
import type { TApiAuthorizationRuleTransformPayload } from '../../../type/class/api/authorization/rule/transform-payload.type';
|
|
6
7
|
import { EApiRouteType } from '../../../enum/decorator/api/route-type.enum';
|
|
7
8
|
import { ApiAuthorizationEngine } from './engine.class';
|
|
@@ -25,7 +26,7 @@ export declare class ApiAuthorizationRuntime {
|
|
|
25
26
|
principal?: IApiAuthorizationPrincipal;
|
|
26
27
|
requestMetadata: IApiAuthorizationRequestMetadata<E>;
|
|
27
28
|
resource?: E;
|
|
28
|
-
routeAuthorization?:
|
|
29
|
+
routeAuthorization?: IApiRouteAuthorizationProperties;
|
|
29
30
|
routeType?: EApiRouteType;
|
|
30
31
|
}): Promise<IApiAuthorizationDecision<E, TApiAuthorizationRuleTransformPayload<E>>>;
|
|
31
32
|
private createImplicitDenyHookPolicy;
|
|
@@ -67,6 +67,7 @@ exports.ApiAuthorizationRuntime = class ApiAuthorizationRuntime {
|
|
|
67
67
|
principal,
|
|
68
68
|
requestMetadata: options.requestMetadata,
|
|
69
69
|
resource: options.resource,
|
|
70
|
+
routeType: options.routeType,
|
|
70
71
|
});
|
|
71
72
|
if (this.auditSink) {
|
|
72
73
|
authorizationRuntimeLogger.verbose(`Recording authorization audit event for principal "${principal.id}" action "${options.action}".`);
|
|
@@ -119,7 +120,7 @@ exports.ApiAuthorizationRuntime = class ApiAuthorizationRuntime {
|
|
|
119
120
|
const documents = await this.iamDocumentResolver.resolve(policyIds);
|
|
120
121
|
authorizationRuntimeLogger.verbose(`Resolved ${documents.length} IAM policy documents for namespace "${options.authorization.policyNamespace}" and principal "${options.principal.id}".`);
|
|
121
122
|
return await this.iamEngine.evaluate({
|
|
122
|
-
action: this.resolveIamAction(options.authorization.policyNamespace, options.action),
|
|
123
|
+
action: this.resolveIamAction(options.authorization.policyNamespace, options.action, options.routeType),
|
|
123
124
|
attachments,
|
|
124
125
|
documents,
|
|
125
126
|
policyNamespace: options.authorization.policyNamespace,
|
|
@@ -129,8 +130,8 @@ exports.ApiAuthorizationRuntime = class ApiAuthorizationRuntime {
|
|
|
129
130
|
resourceDefinition: options.authorization.resourceDefinition,
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
|
-
resolveIamAction(policyNamespace, action) {
|
|
133
|
-
const
|
|
133
|
+
resolveIamAction(policyNamespace, action, routeType) {
|
|
134
|
+
const actionByRouteType = {
|
|
134
135
|
[routeType_enum.EApiRouteType.CREATE]: "create",
|
|
135
136
|
[routeType_enum.EApiRouteType.DELETE]: "delete",
|
|
136
137
|
[routeType_enum.EApiRouteType.GET]: "read",
|
|
@@ -138,8 +139,8 @@ exports.ApiAuthorizationRuntime = class ApiAuthorizationRuntime {
|
|
|
138
139
|
[routeType_enum.EApiRouteType.PARTIAL_UPDATE]: "update",
|
|
139
140
|
[routeType_enum.EApiRouteType.UPDATE]: "update",
|
|
140
141
|
};
|
|
141
|
-
const
|
|
142
|
-
return
|
|
142
|
+
const resolvedAction = routeType ? actionByRouteType[routeType] : undefined;
|
|
143
|
+
return resolvedAction ? `${policyNamespace}:${resolvedAction}` : `${policyNamespace}:${action}`;
|
|
143
144
|
}
|
|
144
145
|
resolveMode(authorization, routeAuthorization) {
|
|
145
146
|
const mode = routeAuthorization?.mode ?? authorization.defaultMode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.class.js","sources":["../../../../../../src/class/api/authorization/runtime.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","ApiAuthorizationRuntime","EApiAuthorizationMode","ErrorException","EApiRouteType","AuthorizationResolveDefaultPrincipal","__decorate","Injectable","__param","Inject","AUTHORIZATION_POLICY_REGISTRY_TOKEN","Optional","AUTHORIZATION_PRINCIPAL_RESOLVER_TOKEN","AUTHORIZATION_AUDIT_SINK_TOKEN","ApiAuthorizationEngine","ApiAuthorizationHookPermissionResolver","ApiAuthorizationIamAttachmentResolver","ApiAuthorizationIamDocumentResolver","ApiAuthorizationIamEngine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"runtime.class.js","sources":["../../../../../../src/class/api/authorization/runtime.class.ts"],"sourcesContent":[null],"names":["LoggerUtility","ApiAuthorizationRuntime","EApiAuthorizationMode","ErrorException","EApiRouteType","AuthorizationResolveDefaultPrincipal","__decorate","Injectable","__param","Inject","AUTHORIZATION_POLICY_REGISTRY_TOKEN","Optional","AUTHORIZATION_PRINCIPAL_RESOLVER_TOKEN","AUTHORIZATION_AUDIT_SINK_TOKEN","ApiAuthorizationEngine","ApiAuthorizationHookPermissionResolver","ApiAuthorizationIamAttachmentResolver","ApiAuthorizationIamDocumentResolver","ApiAuthorizationIamEngine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,0BAA0B,GAAkBA,4BAAa,CAAC,SAAS,CAAC,yBAAyB,CAAC;AAGvFC,+BAAuB,GAA7B,MAAM,uBAAuB,CAAA;AAGjB,IAAA,cAAA;AACA,IAAA,mBAAA;AACA,IAAA,sBAAA;AACA,IAAA,qBAAA;AACA,IAAA,mBAAA;AACA,IAAA,SAAA;AAGA,IAAA,iBAAA;AAGA,IAAA,SAAA;AAblB,IAAA,WAAA,CAEkB,cAA+C,EAC/C,mBAA2C,EAC3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,IAAI,IAAI,CAAC,iBAAiB,EAAE;AAC3B,YAAA,0BAA0B,CAAC,OAAO,CAAC,qEAAqE,CAAC;AAEzG,YAAA,OAAO,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,CAAC;QAChG;AAEA,QAAA,0BAA0B,CAAC,OAAO,CAAC,mEAAmE,CAAC;AAEvG,QAAA,OAAOE,oEAAoC,CAAC,qBAAqB,EAAE,IAAI,CAAC;IACzE;;AAjKYJ,+BAAuB,GAAAK,oBAAA,CAAA;AADnC,IAAAC,iBAAU,EAAE;AAGV,IAAAC,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACC,0DAAmC,CAAC,CAAA;IAO3CF,iBAAA,CAAA,CAAA,EAAAG,eAAQ,EAAE,CAAA;AACV,IAAAH,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACG,sEAAsC,CAAC,CAAA;IAE9CJ,iBAAA,CAAA,CAAA,EAAAG,eAAQ,EAAE,CAAA;AACV,IAAAH,iBAAA,CAAA,CAAA,EAAAC,aAAM,CAACI,sDAA8B,CAAC,CAAA;uDATDC,mCAAsB;QACnBC,mEAAsC;QACvCC,8DAAqC;QACvCC,0DAAmC;QAC7CC,wCAAyB,EAAA,MAAA,EAAA,MAAA,CAAA;AAR1C,CAAA,EAAAjB,+BAAuB,CAkKnC;;"}
|
|
@@ -2,6 +2,7 @@ import type { IApiBaseEntity } from '../../../interface/api-base-entity.interfac
|
|
|
2
2
|
import type { IApiAuthorizationDecision, IApiAuthorizationPrincipal, IApiAuthorizationRequestMetadata } from '../../../interface/class/api/authorization/index';
|
|
3
3
|
import type { IApiControllerAuthorizationProperties, IApiControllerRouteAuthorizationProperties } from '../../../interface/decorator/api/controller/properties/index';
|
|
4
4
|
import type { TApiAuthorizationRuleTransformPayload } from '../../../type/class/api/authorization/rule/transform-payload.type';
|
|
5
|
+
import { EApiRouteType } from '../../../enum/decorator/api/index';
|
|
5
6
|
import { ApiAuthorizationRuntime } from './runtime.class';
|
|
6
7
|
export declare class ApiAuthorizationSimulator {
|
|
7
8
|
private readonly runtime;
|
|
@@ -14,5 +15,6 @@ export declare class ApiAuthorizationSimulator {
|
|
|
14
15
|
requestMetadata?: IApiAuthorizationRequestMetadata<E>;
|
|
15
16
|
resource?: E;
|
|
16
17
|
routeAuthorization?: IApiControllerRouteAuthorizationProperties;
|
|
18
|
+
routeType?: EApiRouteType;
|
|
17
19
|
}): Promise<IApiAuthorizationDecision<E, TApiAuthorizationRuleTransformPayload<E>>>;
|
|
18
20
|
}
|