@elsikora/nestjs-crud-automator 3.0.2 → 4.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -11
- package/dist/cjs/class/api/authorization/guard.class.d.ts +1 -0
- package/dist/cjs/class/api/authorization/guard.class.js +39 -3
- package/dist/cjs/class/api/authorization/guard.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/iam/engine.class.d.ts +3 -2
- package/dist/cjs/class/api/authorization/iam/engine.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/iam/query-planner.class.d.ts +3 -2
- package/dist/cjs/class/api/authorization/iam/query-planner.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/policy/base.class.js +1 -0
- package/dist/cjs/class/api/authorization/policy/base.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/policy/executor.class.d.ts +2 -1
- package/dist/cjs/class/api/authorization/policy/executor.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/policy/registry.class.d.ts +3 -2
- package/dist/cjs/class/api/authorization/policy/registry.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/runtime.class.d.ts +3 -2
- package/dist/cjs/class/api/authorization/runtime.class.js +2 -1
- package/dist/cjs/class/api/authorization/runtime.class.js.map +1 -1
- package/dist/cjs/class/api/authorization/simulator.class.d.ts +3 -3
- package/dist/cjs/class/api/authorization/simulator.class.js.map +1 -1
- package/dist/cjs/class/api/controller/generated/function-capability.class.d.ts +12 -0
- package/dist/cjs/class/api/controller/generated/function-capability.class.js +47 -0
- package/dist/cjs/class/api/controller/generated/function-capability.class.js.map +1 -0
- package/dist/cjs/class/api/controller/generated/get-many-contract.class.d.ts +25 -0
- package/dist/cjs/class/api/controller/generated/get-many-contract.class.js +250 -0
- package/dist/cjs/class/api/controller/generated/get-many-contract.class.js.map +1 -0
- package/dist/cjs/class/api/controller/generated/index.d.ts +3 -0
- package/dist/cjs/class/api/controller/generated/read-scope-storage.class.d.ts +19 -0
- package/dist/cjs/class/api/controller/generated/read-scope-storage.class.js +120 -0
- package/dist/cjs/class/api/controller/generated/read-scope-storage.class.js.map +1 -0
- package/dist/cjs/class/api/controller/generated/relation-cache-contract.class.d.ts +11 -0
- package/dist/cjs/class/api/controller/generated/relation-cache-contract.class.js +70 -0
- package/dist/cjs/class/api/controller/generated/relation-cache-contract.class.js.map +1 -0
- package/dist/cjs/class/api/controller/generated/scope-where-contract.class.d.ts +14 -0
- package/dist/cjs/class/api/controller/generated/scope-where-contract.class.js +68 -0
- package/dist/cjs/class/api/controller/generated/scope-where-contract.class.js.map +1 -0
- package/dist/cjs/class/api/controller/generated/security-snapshot.class.d.ts +14 -0
- package/dist/cjs/class/api/controller/generated/security-snapshot.class.js +165 -0
- package/dist/cjs/class/api/controller/generated/security-snapshot.class.js.map +1 -0
- package/dist/cjs/class/api/controller/generated/write-hydration-contract.class.d.ts +9 -0
- package/dist/cjs/class/api/controller/generated/write-hydration-contract.class.js +69 -0
- package/dist/cjs/class/api/controller/generated/write-hydration-contract.class.js.map +1 -0
- package/dist/cjs/class/api/controller/get-list/cursor/data-source-contract.class.d.ts +32 -0
- package/dist/cjs/class/api/controller/get-list/cursor/data-source-contract.class.js +424 -0
- package/dist/cjs/class/api/controller/get-list/cursor/data-source-contract.class.js.map +1 -0
- package/dist/cjs/class/api/controller/get-list/cursor/index.d.ts +2 -0
- package/dist/cjs/class/api/controller/get-list/cursor/runtime.class.d.ts +28 -0
- package/dist/cjs/class/api/controller/get-list/cursor/runtime.class.js +371 -0
- package/dist/cjs/class/api/controller/get-list/cursor/runtime.class.js.map +1 -0
- package/dist/cjs/class/api/controller/get-list/query/plan-compiler.class.d.ts +20 -0
- package/dist/cjs/class/api/controller/get-list/query/plan-compiler.class.js +479 -41
- package/dist/cjs/class/api/controller/get-list/query/plan-compiler.class.js.map +1 -1
- package/dist/cjs/class/api/controller/get-list/query/runtime.class.d.ts +2 -0
- package/dist/cjs/class/api/controller/get-list/query/runtime.class.js +45 -2
- package/dist/cjs/class/api/controller/get-list/query/runtime.class.js.map +1 -1
- package/dist/cjs/class/api/controller/identity-plan-compiler.class.d.ts +14 -0
- package/dist/cjs/class/api/controller/identity-plan-compiler.class.js +150 -0
- package/dist/cjs/class/api/controller/identity-plan-compiler.class.js.map +1 -0
- package/dist/cjs/class/api/controller/index.d.ts +1 -0
- package/dist/cjs/class/api/controller/read-plan-compiler.class.d.ts +17 -0
- package/dist/cjs/class/api/controller/read-plan-compiler.class.js +240 -0
- package/dist/cjs/class/api/controller/read-plan-compiler.class.js.map +1 -0
- package/dist/cjs/class/api/function/context-storage.class.js +1 -0
- package/dist/cjs/class/api/function/context-storage.class.js.map +1 -1
- package/dist/cjs/class/api/function/custom-runtime.class.js +1 -0
- package/dist/cjs/class/api/function/custom-runtime.class.js.map +1 -1
- package/dist/cjs/class/api/function/step-runtime.class.js +1 -0
- package/dist/cjs/class/api/function/step-runtime.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/exception/commit-unknown-outcome.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/exception/commit-unknown-outcome.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/exception/post-commit.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/exception/post-commit.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/exception/rollback.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/exception/rollback.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/lifecycle.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/lifecycle.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/registry.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/registry.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/runtime.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/runtime.class.js.map +1 -1
- package/dist/cjs/class/api/function/transaction/scope.class.js +1 -0
- package/dist/cjs/class/api/function/transaction/scope.class.js.map +1 -1
- package/dist/cjs/class/api/route-runtime.class.d.ts +2 -0
- package/dist/cjs/class/api/route-runtime.class.js +202 -60
- package/dist/cjs/class/api/route-runtime.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/executor.class.js +1 -0
- package/dist/cjs/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/registry.class.d.ts +3 -3
- package/dist/cjs/class/api/subscriber/registry.class.js +3 -1
- package/dist/cjs/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/route-base.class.d.ts +2 -2
- package/dist/cjs/class/api/subscriber/route-base.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/exception/details/foreign-key-violation.class.js +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/cjs/class/utility/dto/property/factory/number.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js +1 -0
- package/dist/cjs/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/body.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/query.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/response.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/cjs/constant/api-controller-cursor.constant.d.ts +1 -0
- package/dist/cjs/constant/api-controller-cursor.constant.js +6 -0
- package/dist/cjs/constant/api-controller-cursor.constant.js.map +1 -0
- package/dist/cjs/constant/filter/operator-registry.constant.js +1 -0
- package/dist/cjs/constant/filter/operator-registry.constant.js.map +1 -1
- package/dist/cjs/constant/safe-object-property-names.constant.d.ts +1 -0
- package/dist/cjs/constant/safe-object-property-names.constant.js +6 -0
- package/dist/cjs/constant/safe-object-property-names.constant.js.map +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer-map.constant.js +1 -0
- package/dist/cjs/constant/utility/api/get-default-string-format-properties/customizer-map.constant.js.map +1 -1
- package/dist/cjs/constant/utility/dto/constant.js +1 -0
- package/dist/cjs/constant/utility/dto/constant.js.map +1 -1
- package/dist/cjs/decorator/api/controller/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/custom.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/custom.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.js +5 -0
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +19 -7
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/decorator.js +53 -19
- package/dist/cjs/decorator/api/function/get/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/list.decorator.js +41 -27
- package/dist/cjs/decorator/api/function/get/list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get/many.decorator.js +70 -19
- package/dist/cjs/decorator/api/function/get/many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/step.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/step.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.js +20 -1
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/method.decorator.js +1 -0
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +1 -0
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +1 -0
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +1 -0
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +1 -0
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +1 -0
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/route-custom.decorator.js +1 -0
- package/dist/cjs/decorator/api/route-custom.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/decorator.js +16 -0
- package/dist/cjs/decorator/api/service/decorator.js.map +1 -1
- package/dist/cjs/enum/decorator/api/controller/get-list/query/index.d.ts +1 -0
- package/dist/cjs/enum/decorator/api/controller/get-list/query/pagination-mode.enum.d.ts +4 -0
- package/dist/cjs/enum/decorator/api/controller/get-list/query/pagination-mode.enum.js +8 -0
- package/dist/cjs/enum/decorator/api/controller/get-list/query/pagination-mode.enum.js.map +1 -0
- package/dist/cjs/factory/api-controller.factory.d.ts +4 -4
- package/dist/cjs/factory/api-controller.factory.js +37 -11
- package/dist/cjs/factory/api-controller.factory.js.map +1 -1
- package/dist/cjs/index.js +15 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interface/api/request-validator.interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/authorization/policy/build-options.interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/authorization/policy/registry.interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/authorization/policy/subscriber/context/data.interface.d.ts +2 -1
- package/dist/cjs/interface/class/api/authorization/policy/subscriber/context/interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/authorization/policy/subscriber/interface.d.ts +9 -8
- package/dist/cjs/interface/class/api/authorization/policy/subscriber/registration.interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/authorization/request-metadata.interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/controller/generated/get-many-session.interface.d.ts +11 -0
- package/dist/cjs/interface/class/api/controller/generated/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/controller/generated/read-scope-entry.interface.d.ts +10 -0
- package/dist/cjs/interface/class/api/controller/get-list/query/plan/order/entry.interface.d.ts +5 -0
- package/dist/cjs/interface/class/api/controller/get-list/query/plan/order/index.d.ts +1 -0
- package/dist/cjs/interface/class/api/controller/get-list/query/plan/order/interface.d.ts +3 -0
- package/dist/cjs/interface/class/api/controller/get-list/query/plan/pagination.interface.d.ts +4 -0
- package/dist/cjs/interface/class/api/controller/get-list/query/runtime-result.interface.d.ts +2 -0
- package/dist/cjs/interface/class/api/controller/identity-plan.interface.d.ts +7 -0
- package/dist/cjs/interface/class/api/controller/index.d.ts +1 -0
- package/dist/cjs/interface/class/api/controller/read/index.d.ts +1 -0
- package/dist/cjs/interface/class/api/controller/read/plan/index.d.ts +2 -0
- package/dist/cjs/interface/class/api/controller/read/plan/interface.d.ts +7 -0
- package/dist/cjs/interface/class/api/controller/read/plan/parameter.interface.d.ts +4 -0
- package/dist/cjs/interface/class/api/route/runtime/generated/targets.interface.d.ts +2 -1
- package/dist/cjs/interface/class/api/subscriber/route/execution/context/data/extended.interface.d.ts +3 -2
- package/dist/cjs/interface/class/api/subscriber/route.interface.d.ts +7 -7
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/read/index.d.ts +3 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/read/interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/read/scope-parameter.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/read/scope.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/interface.d.ts +2 -2
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/query/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/query/interface.d.ts +4 -1
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/query/order/entry.interface.d.ts +6 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/query/order/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/query/order/interface.d.ts +3 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/query/pagination.interface.d.ts +4 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/read-parameters-target.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/base/request/target.interface.d.ts +3 -2
- package/dist/cjs/interface/decorator/api/controller/properties/route/identity.interface.d.ts +3 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/get-list/cursor-response-result.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/get-list/index.d.ts +2 -0
- package/dist/cjs/interface/decorator/api/index.d.ts +1 -1
- package/dist/cjs/module/api/authorization.module.js +2 -1
- package/dist/cjs/module/api/authorization.module.js.map +1 -1
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/type/api-request-transformer.type.d.ts +4 -2
- package/dist/cjs/type/class/api/authorization/policy/before/get/list-result.type.d.ts +2 -1
- package/dist/cjs/type/class/api/authorization/policy/context/before/get/list-context.type.d.ts +4 -3
- package/dist/cjs/type/class/api/authorization/policy/context/with-request-metadata.type.d.ts +4 -3
- package/dist/cjs/type/class/api/authorization/policy/hook/execution-result.type.d.ts +5 -0
- package/dist/cjs/type/class/api/authorization/policy/hook/result.type.d.ts +3 -2
- package/dist/cjs/type/class/api/authorization/policy/hook/type.d.ts +2 -1
- package/dist/cjs/type/class/api/authorization/rule/transform-payload.type.d.ts +2 -2
- package/dist/cjs/type/class/api/controller/generated/function.type.d.ts +1 -0
- package/dist/cjs/type/class/api/controller/generated/index.d.ts +2 -0
- package/dist/cjs/type/class/api/controller/generated/scope-function-type.type.d.ts +2 -0
- package/dist/cjs/type/class/api/controller/get-list/compiled/index.d.ts +3 -0
- package/dist/cjs/type/class/api/controller/get-list/compiled/order-field.type.d.ts +16 -0
- package/dist/cjs/type/class/api/controller/get-list/compiled/order.type.d.ts +6 -0
- package/dist/cjs/type/class/api/controller/get-list/compiled/plan.type.d.ts +8 -0
- package/dist/cjs/type/class/api/controller/get-list/cursor/execution-options.type.d.ts +18 -0
- package/dist/cjs/type/class/api/controller/get-list/cursor/index.d.ts +2 -0
- package/dist/cjs/type/class/api/controller/get-list/cursor/query-runtime-result.type.d.ts +8 -0
- package/dist/cjs/type/class/api/controller/get-list/index.d.ts +2 -0
- package/dist/cjs/type/class/api/controller/index.d.ts +1 -0
- package/dist/cjs/type/class/api/subscriber/route/after/get/list-context.type.d.ts +3 -2
- package/dist/cjs/type/class/api/subscriber/route/before/get/list-context.type.d.ts +5 -6
- package/dist/cjs/type/decorator/api/controller/get-list/index.d.ts +1 -0
- package/dist/cjs/type/decorator/api/controller/get-list/query/dto-contract.type.d.ts +1 -0
- package/dist/cjs/type/decorator/api/controller/get-list/query/request-target.type.d.ts +7 -0
- package/dist/cjs/type/decorator/api/controller/get-list/query/type.d.ts +22 -2
- package/dist/cjs/type/decorator/api/controller/get-list/response.type.d.ts +3 -0
- package/dist/cjs/type/decorator/api/controller/index.d.ts +1 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/contract.type.d.ts +5 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/identity/index.d.ts +2 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/identity/with.type.d.ts +11 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/identity/without.type.d.ts +3 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/read/dto.type.d.ts +10 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/read/index.d.ts +3 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/read/with.type.d.ts +11 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/read/without.type.d.ts +3 -0
- package/dist/cjs/type/decorator/api/controller/properties/route/without-parameters-dto.type.d.ts +4 -0
- package/dist/cjs/type/decorator/api/controller/properties-route.type.d.ts +3 -3
- package/dist/cjs/type/decorator/api/controller/read/direct-scalar-field.type.d.ts +2 -0
- package/dist/cjs/type/decorator/api/controller/read/index.d.ts +2 -0
- package/dist/cjs/type/decorator/api/controller/read/parameter-transformer/index.d.ts +1 -0
- package/dist/cjs/type/decorator/api/controller/read/parameter-transformer/type.d.ts +3 -0
- package/dist/cjs/type/decorator/api/controller/read/parameter-transformer/with-string-key.type.d.ts +5 -0
- package/dist/cjs/type/decorator/api/property/describe/properties/base/properties.type.d.ts +1 -1
- package/dist/cjs/type/factory/api/controller/method/map.type.d.ts +4 -5
- package/dist/cjs/type/factory/api/controller/target-methods.type.d.ts +3 -3
- package/dist/cjs/type/utility/api/controller/transform-data/is-validation-properties.type.d.ts +3 -2
- package/dist/cjs/type/utility/api/controller/transform-data/object-to-transform.type.d.ts +4 -3
- package/dist/cjs/type/utility/api/controller/transform-data/runtime-transformer.type.d.ts +3 -0
- package/dist/cjs/type/utility/api/controller/transform-data/targets.type.d.ts +17 -0
- package/dist/cjs/type/utility/dto/generate/allowed-combination.type.d.ts +1 -1
- package/dist/cjs/utility/api/controller/apply/decorators.utility.d.ts +18 -2
- package/dist/cjs/utility/api/controller/apply/decorators.utility.js +24 -2
- package/dist/cjs/utility/api/controller/apply/decorators.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/apply/metadata.utility.d.ts +18 -0
- package/dist/cjs/utility/api/controller/apply/metadata.utility.js +23 -3
- package/dist/cjs/utility/api/controller/apply/metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/build-route-documentation.utility.js +1 -0
- package/dist/cjs/utility/api/controller/build-route-documentation.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get/dto.utility.d.ts +17 -0
- package/dist/cjs/utility/api/controller/get/dto.utility.js +90 -11
- package/dist/cjs/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/query/get-pagination-mode.utility.d.ts +8 -0
- package/dist/cjs/utility/api/controller/get-list/query/get-pagination-mode.utility.js +43 -0
- package/dist/cjs/utility/api/controller/get-list/query/get-pagination-mode.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/get-list/query/open-api/decorators.utility.js +1 -0
- package/dist/cjs/utility/api/controller/get-list/query/open-api/decorators.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/query/open-api/value-schema.utility.js +1 -0
- package/dist/cjs/utility/api/controller/get-list/query/open-api/value-schema.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.d.ts +7 -0
- package/dist/cjs/utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.js +26 -0
- package/dist/cjs/utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/get-list/transform/filter.utility.js +1 -0
- package/dist/cjs/utility/api/controller/get-list/transform/filter.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.d.ts +2 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js +1 -0
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/identity/assert-plan.utility.d.ts +8 -0
- package/dist/cjs/utility/api/controller/identity/assert-plan.utility.js +18 -0
- package/dist/cjs/utility/api/controller/identity/assert-plan.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/identity/index.d.ts +2 -0
- package/dist/cjs/utility/api/controller/identity/plan/get.utility.d.ts +7 -0
- package/dist/cjs/utility/api/controller/identity/plan/get.utility.js +15 -0
- package/dist/cjs/utility/api/controller/identity/plan/get.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/identity/plan/index.d.ts +2 -0
- package/dist/cjs/utility/api/controller/identity/plan/metadata-key.constant.d.ts +1 -0
- package/dist/cjs/utility/api/controller/identity/plan/metadata-key.constant.js +6 -0
- package/dist/cjs/utility/api/controller/identity/plan/metadata-key.constant.js.map +1 -0
- package/dist/cjs/utility/api/controller/identity/plan/set.utility.d.ts +8 -0
- package/dist/cjs/utility/api/controller/identity/plan/set.utility.js +16 -0
- package/dist/cjs/utility/api/controller/identity/plan/set.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/read/assert-plan.utility.d.ts +8 -0
- package/dist/cjs/utility/api/controller/read/assert-plan.utility.js +18 -0
- package/dist/cjs/utility/api/controller/read/assert-plan.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/read/index.d.ts +3 -0
- package/dist/cjs/utility/api/controller/read/plan/get.utility.d.ts +8 -0
- package/dist/cjs/utility/api/controller/read/plan/get.utility.js +16 -0
- package/dist/cjs/utility/api/controller/read/plan/get.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/read/plan/index.d.ts +2 -0
- package/dist/cjs/utility/api/controller/read/plan/metadata-key.constant.d.ts +1 -0
- package/dist/cjs/utility/api/controller/read/plan/metadata-key.constant.js +6 -0
- package/dist/cjs/utility/api/controller/read/plan/metadata-key.constant.js.map +1 -0
- package/dist/cjs/utility/api/controller/read/plan/set.utility.d.ts +9 -0
- package/dist/cjs/utility/api/controller/read/plan/set.utility.js +17 -0
- package/dist/cjs/utility/api/controller/read/plan/set.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/read/scope.utility.d.ts +12 -0
- package/dist/cjs/utility/api/controller/read/scope.utility.js +38 -0
- package/dist/cjs/utility/api/controller/read/scope.utility.js.map +1 -0
- package/dist/cjs/utility/api/controller/transform-data.utility.js +13 -11
- package/dist/cjs/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/validate-request.utility.d.ts +2 -1
- package/dist/cjs/utility/api/controller/validate-request.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.d.ts +17 -0
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.js +23 -4
- package/dist/cjs/utility/api/controller/write/dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/function-transaction.utility.js +1 -0
- package/dist/cjs/utility/api/function-transaction.utility.js.map +1 -1
- package/dist/cjs/utility/api/route/apply-dto-metadata.utility.js +1 -0
- package/dist/cjs/utility/api/route/apply-dto-metadata.utility.js.map +1 -1
- package/dist/cjs/utility/api/route/response/project-relation.utility.js +1 -0
- package/dist/cjs/utility/api/route/response/project-relation.utility.js.map +1 -1
- package/dist/cjs/utility/authorization/scope-merge-where.utility.js +247 -130
- package/dist/cjs/utility/authorization/scope-merge-where.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/core.utility.js +19 -7
- package/dist/cjs/utility/dto/generate/core.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/dynamic.utility.js +1 -0
- package/dist/cjs/utility/dto/generate/dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/exception.utility.js +1 -0
- package/dist/cjs/utility/dto/generate/exception.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/filter-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/generate/filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/get-list/cursor-response.utility.d.ts +10 -0
- package/dist/cjs/utility/dto/generate/get-list/cursor-response.utility.js +100 -0
- package/dist/cjs/utility/dto/generate/get-list/cursor-response.utility.js.map +1 -0
- package/dist/cjs/utility/dto/generate/get-list/index.d.ts +3 -0
- package/dist/cjs/utility/dto/generate/{get-list-query-properties.utility.d.ts → get-list/query-properties.utility.d.ts} +4 -4
- package/dist/cjs/utility/dto/generate/{get-list-query-properties.utility.js → get-list/query-properties.utility.js} +35 -34
- package/dist/cjs/utility/dto/generate/get-list/query-properties.utility.js.map +1 -0
- package/dist/cjs/utility/dto/generate/{get-list-response.utility.d.ts → get-list/response.utility.d.ts} +1 -1
- package/dist/cjs/utility/dto/generate/{get-list-response.utility.js → get-list/response.utility.js} +33 -32
- package/dist/cjs/utility/dto/generate/get-list/response.utility.js.map +1 -0
- package/dist/cjs/utility/dto/generate/identity-read-parameters.utility.d.ts +17 -0
- package/dist/cjs/utility/dto/generate/identity-read-parameters.utility.js +113 -0
- package/dist/cjs/utility/dto/generate/identity-read-parameters.utility.js.map +1 -0
- package/dist/cjs/utility/dto/generate/index.d.ts +1 -1
- package/dist/cjs/utility/dto/generate/read-parameters.utility.d.ts +17 -0
- package/dist/cjs/utility/dto/generate/read-parameters.utility.js +111 -0
- package/dist/cjs/utility/dto/generate/read-parameters.utility.js.map +1 -0
- package/dist/cjs/utility/dto/get/get-list-query-base-class.utility.d.ts +3 -2
- package/dist/cjs/utility/dto/get/get-list-query-base-class.utility.js +48 -15
- package/dist/cjs/utility/dto/get/get-list-query-base-class.utility.js.map +1 -1
- package/dist/cjs/utility/dto/handle-date-property.utility.js +1 -0
- package/dist/cjs/utility/dto/handle-date-property.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is/property/infrastructure-timestamp.utility.js +1 -0
- package/dist/cjs/utility/dto/is/property/infrastructure-timestamp.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is/property/should-be-marked.utility.js +1 -0
- package/dist/cjs/utility/dto/is/property/should-be-marked.utility.js.map +1 -1
- package/dist/cjs/utility/dto/is/should-be-generated.utility.js +1 -0
- package/dist/cjs/utility/dto/is/should-be-generated.utility.js.map +1 -1
- package/dist/cjs/utility/object-find-property-descriptor.utility.d.ts +7 -0
- package/dist/cjs/utility/object-find-property-descriptor.utility.js +22 -0
- package/dist/cjs/utility/object-find-property-descriptor.utility.js.map +1 -0
- package/dist/cjs/validator/at-most-one-of-listed-properties.validator.d.ts +5 -0
- package/dist/cjs/validator/at-most-one-of-listed-properties.validator.js +21 -0
- package/dist/cjs/validator/at-most-one-of-listed-properties.validator.js.map +1 -0
- package/dist/esm/class/api/authorization/guard.class.d.ts +1 -0
- package/dist/esm/class/api/authorization/guard.class.js +39 -3
- package/dist/esm/class/api/authorization/guard.class.js.map +1 -1
- package/dist/esm/class/api/authorization/iam/engine.class.d.ts +3 -2
- package/dist/esm/class/api/authorization/iam/engine.class.js.map +1 -1
- package/dist/esm/class/api/authorization/iam/query-planner.class.d.ts +3 -2
- package/dist/esm/class/api/authorization/iam/query-planner.class.js.map +1 -1
- package/dist/esm/class/api/authorization/policy/base.class.js +1 -0
- package/dist/esm/class/api/authorization/policy/base.class.js.map +1 -1
- package/dist/esm/class/api/authorization/policy/executor.class.d.ts +2 -1
- package/dist/esm/class/api/authorization/policy/executor.class.js.map +1 -1
- package/dist/esm/class/api/authorization/policy/registry.class.d.ts +3 -2
- package/dist/esm/class/api/authorization/policy/registry.class.js.map +1 -1
- package/dist/esm/class/api/authorization/runtime.class.d.ts +3 -2
- package/dist/esm/class/api/authorization/runtime.class.js +2 -1
- package/dist/esm/class/api/authorization/runtime.class.js.map +1 -1
- package/dist/esm/class/api/authorization/simulator.class.d.ts +3 -3
- package/dist/esm/class/api/authorization/simulator.class.js.map +1 -1
- package/dist/esm/class/api/controller/generated/function-capability.class.d.ts +12 -0
- package/dist/esm/class/api/controller/generated/function-capability.class.js +45 -0
- package/dist/esm/class/api/controller/generated/function-capability.class.js.map +1 -0
- package/dist/esm/class/api/controller/generated/get-many-contract.class.d.ts +25 -0
- package/dist/esm/class/api/controller/generated/get-many-contract.class.js +248 -0
- package/dist/esm/class/api/controller/generated/get-many-contract.class.js.map +1 -0
- package/dist/esm/class/api/controller/generated/index.d.ts +3 -0
- package/dist/esm/class/api/controller/generated/read-scope-storage.class.d.ts +19 -0
- package/dist/esm/class/api/controller/generated/read-scope-storage.class.js +118 -0
- package/dist/esm/class/api/controller/generated/read-scope-storage.class.js.map +1 -0
- package/dist/esm/class/api/controller/generated/relation-cache-contract.class.d.ts +11 -0
- package/dist/esm/class/api/controller/generated/relation-cache-contract.class.js +68 -0
- package/dist/esm/class/api/controller/generated/relation-cache-contract.class.js.map +1 -0
- package/dist/esm/class/api/controller/generated/scope-where-contract.class.d.ts +14 -0
- package/dist/esm/class/api/controller/generated/scope-where-contract.class.js +66 -0
- package/dist/esm/class/api/controller/generated/scope-where-contract.class.js.map +1 -0
- package/dist/esm/class/api/controller/generated/security-snapshot.class.d.ts +14 -0
- package/dist/esm/class/api/controller/generated/security-snapshot.class.js +163 -0
- package/dist/esm/class/api/controller/generated/security-snapshot.class.js.map +1 -0
- package/dist/esm/class/api/controller/generated/write-hydration-contract.class.d.ts +9 -0
- package/dist/esm/class/api/controller/generated/write-hydration-contract.class.js +67 -0
- package/dist/esm/class/api/controller/generated/write-hydration-contract.class.js.map +1 -0
- package/dist/esm/class/api/controller/get-list/cursor/data-source-contract.class.d.ts +32 -0
- package/dist/esm/class/api/controller/get-list/cursor/data-source-contract.class.js +422 -0
- package/dist/esm/class/api/controller/get-list/cursor/data-source-contract.class.js.map +1 -0
- package/dist/esm/class/api/controller/get-list/cursor/index.d.ts +2 -0
- package/dist/esm/class/api/controller/get-list/cursor/runtime.class.d.ts +28 -0
- package/dist/esm/class/api/controller/get-list/cursor/runtime.class.js +369 -0
- package/dist/esm/class/api/controller/get-list/cursor/runtime.class.js.map +1 -0
- package/dist/esm/class/api/controller/get-list/query/plan-compiler.class.d.ts +20 -0
- package/dist/esm/class/api/controller/get-list/query/plan-compiler.class.js +479 -41
- package/dist/esm/class/api/controller/get-list/query/plan-compiler.class.js.map +1 -1
- package/dist/esm/class/api/controller/get-list/query/runtime.class.d.ts +2 -0
- package/dist/esm/class/api/controller/get-list/query/runtime.class.js +45 -2
- package/dist/esm/class/api/controller/get-list/query/runtime.class.js.map +1 -1
- package/dist/esm/class/api/controller/identity-plan-compiler.class.d.ts +14 -0
- package/dist/esm/class/api/controller/identity-plan-compiler.class.js +148 -0
- package/dist/esm/class/api/controller/identity-plan-compiler.class.js.map +1 -0
- package/dist/esm/class/api/controller/index.d.ts +1 -0
- package/dist/esm/class/api/controller/read-plan-compiler.class.d.ts +17 -0
- package/dist/esm/class/api/controller/read-plan-compiler.class.js +238 -0
- package/dist/esm/class/api/controller/read-plan-compiler.class.js.map +1 -0
- package/dist/esm/class/api/function/context-storage.class.js +1 -0
- package/dist/esm/class/api/function/context-storage.class.js.map +1 -1
- package/dist/esm/class/api/function/custom-runtime.class.js +1 -0
- package/dist/esm/class/api/function/custom-runtime.class.js.map +1 -1
- package/dist/esm/class/api/function/step-runtime.class.js +1 -0
- package/dist/esm/class/api/function/step-runtime.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/exception/commit-unknown-outcome.class.js +1 -0
- package/dist/esm/class/api/function/transaction/exception/commit-unknown-outcome.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/exception/post-commit.class.js +1 -0
- package/dist/esm/class/api/function/transaction/exception/post-commit.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/exception/rollback.class.js +1 -0
- package/dist/esm/class/api/function/transaction/exception/rollback.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/lifecycle.class.js +1 -0
- package/dist/esm/class/api/function/transaction/lifecycle.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/registry.class.js +1 -0
- package/dist/esm/class/api/function/transaction/registry.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/runtime.class.js +1 -0
- package/dist/esm/class/api/function/transaction/runtime.class.js.map +1 -1
- package/dist/esm/class/api/function/transaction/scope.class.js +1 -0
- package/dist/esm/class/api/function/transaction/scope.class.js.map +1 -1
- package/dist/esm/class/api/route-runtime.class.d.ts +2 -0
- package/dist/esm/class/api/route-runtime.class.js +201 -59
- package/dist/esm/class/api/route-runtime.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/executor.class.js +1 -0
- package/dist/esm/class/api/subscriber/executor.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/registry.class.d.ts +3 -3
- package/dist/esm/class/api/subscriber/registry.class.js +3 -1
- package/dist/esm/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/route-base.class.d.ts +2 -2
- package/dist/esm/class/api/subscriber/route-base.class.js.map +1 -1
- package/dist/esm/class/utility/dto/exception/details/foreign-key-violation.class.js +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/esm/class/utility/dto/property/factory/number.class.js.map +1 -1
- package/dist/esm/class/utility/dto/property/factory/relation.class.js +1 -0
- package/dist/esm/class/utility/dto/property/factory/relation.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/body.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/body.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/query.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/query.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/esm/class/utility/dto/strategy/response.class.js +1 -0
- package/dist/esm/class/utility/dto/strategy/response.class.js.map +1 -1
- package/dist/esm/constant/api-controller-cursor.constant.d.ts +1 -0
- package/dist/esm/constant/api-controller-cursor.constant.js +4 -0
- package/dist/esm/constant/api-controller-cursor.constant.js.map +1 -0
- package/dist/esm/constant/filter/operator-registry.constant.js +1 -0
- package/dist/esm/constant/filter/operator-registry.constant.js.map +1 -1
- package/dist/esm/constant/safe-object-property-names.constant.d.ts +1 -0
- package/dist/esm/constant/safe-object-property-names.constant.js +4 -0
- package/dist/esm/constant/safe-object-property-names.constant.js.map +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/customizer-map.constant.js +1 -0
- package/dist/esm/constant/utility/api/get-default-string-format-properties/customizer-map.constant.js.map +1 -1
- package/dist/esm/constant/utility/dto/constant.js +1 -0
- package/dist/esm/constant/utility/dto/constant.js.map +1 -1
- package/dist/esm/decorator/api/controller/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/create.decorator.js +1 -0
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/custom.decorator.js +1 -0
- package/dist/esm/decorator/api/function/custom.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/decorator.js +5 -0
- package/dist/esm/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.js +19 -7
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/decorator.js +53 -19
- package/dist/esm/decorator/api/function/get/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/list.decorator.js +41 -27
- package/dist/esm/decorator/api/function/get/list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get/many.decorator.js +70 -19
- package/dist/esm/decorator/api/function/get/many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/step.decorator.js +1 -0
- package/dist/esm/decorator/api/function/step.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/update.decorator.js +20 -1
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/method.decorator.js +1 -0
- package/dist/esm/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/boolean.decorator.js +1 -0
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +1 -0
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +1 -0
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +1 -0
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +1 -0
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/route-custom.decorator.js +1 -0
- package/dist/esm/decorator/api/route-custom.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/decorator.js +16 -0
- package/dist/esm/decorator/api/service/decorator.js.map +1 -1
- package/dist/esm/enum/decorator/api/controller/get-list/query/index.d.ts +1 -0
- package/dist/esm/enum/decorator/api/controller/get-list/query/pagination-mode.enum.d.ts +4 -0
- package/dist/esm/enum/decorator/api/controller/get-list/query/pagination-mode.enum.js +8 -0
- package/dist/esm/enum/decorator/api/controller/get-list/query/pagination-mode.enum.js.map +1 -0
- package/dist/esm/factory/api-controller.factory.d.ts +4 -4
- package/dist/esm/factory/api-controller.factory.js +36 -10
- package/dist/esm/factory/api-controller.factory.js.map +1 -1
- package/dist/esm/index.js +7 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interface/api/request-validator.interface.d.ts +3 -2
- package/dist/esm/interface/class/api/authorization/policy/build-options.interface.d.ts +3 -2
- package/dist/esm/interface/class/api/authorization/policy/registry.interface.d.ts +3 -2
- package/dist/esm/interface/class/api/authorization/policy/subscriber/context/data.interface.d.ts +2 -1
- package/dist/esm/interface/class/api/authorization/policy/subscriber/context/interface.d.ts +3 -2
- package/dist/esm/interface/class/api/authorization/policy/subscriber/interface.d.ts +9 -8
- package/dist/esm/interface/class/api/authorization/policy/subscriber/registration.interface.d.ts +3 -2
- package/dist/esm/interface/class/api/authorization/request-metadata.interface.d.ts +3 -2
- package/dist/esm/interface/class/api/controller/generated/get-many-session.interface.d.ts +11 -0
- package/dist/esm/interface/class/api/controller/generated/index.d.ts +2 -0
- package/dist/esm/interface/class/api/controller/generated/read-scope-entry.interface.d.ts +10 -0
- package/dist/esm/interface/class/api/controller/get-list/query/plan/order/entry.interface.d.ts +5 -0
- package/dist/esm/interface/class/api/controller/get-list/query/plan/order/index.d.ts +1 -0
- package/dist/esm/interface/class/api/controller/get-list/query/plan/order/interface.d.ts +3 -0
- package/dist/esm/interface/class/api/controller/get-list/query/plan/pagination.interface.d.ts +4 -0
- package/dist/esm/interface/class/api/controller/get-list/query/runtime-result.interface.d.ts +2 -0
- package/dist/esm/interface/class/api/controller/identity-plan.interface.d.ts +7 -0
- package/dist/esm/interface/class/api/controller/index.d.ts +1 -0
- package/dist/esm/interface/class/api/controller/read/index.d.ts +1 -0
- package/dist/esm/interface/class/api/controller/read/plan/index.d.ts +2 -0
- package/dist/esm/interface/class/api/controller/read/plan/interface.d.ts +7 -0
- package/dist/esm/interface/class/api/controller/read/plan/parameter.interface.d.ts +4 -0
- package/dist/esm/interface/class/api/route/runtime/generated/targets.interface.d.ts +2 -1
- package/dist/esm/interface/class/api/subscriber/route/execution/context/data/extended.interface.d.ts +3 -2
- package/dist/esm/interface/class/api/subscriber/route.interface.d.ts +7 -7
- package/dist/esm/interface/decorator/api/controller/properties/route/base/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/read/index.d.ts +3 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/read/interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/read/scope-parameter.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/read/scope.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/interface.d.ts +2 -2
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/query/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/query/interface.d.ts +4 -1
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/query/order/entry.interface.d.ts +6 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/query/order/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/query/order/interface.d.ts +3 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/query/pagination.interface.d.ts +4 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/read-parameters-target.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/base/request/target.interface.d.ts +3 -2
- package/dist/esm/interface/decorator/api/controller/properties/route/identity.interface.d.ts +3 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/get-list/cursor-response-result.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/get-list/index.d.ts +2 -0
- package/dist/esm/interface/decorator/api/index.d.ts +1 -1
- package/dist/esm/module/api/authorization.module.js +2 -1
- package/dist/esm/module/api/authorization.module.js.map +1 -1
- package/dist/esm/package.json +1 -0
- package/dist/esm/type/api-request-transformer.type.d.ts +4 -2
- package/dist/esm/type/class/api/authorization/policy/before/get/list-result.type.d.ts +2 -1
- package/dist/esm/type/class/api/authorization/policy/context/before/get/list-context.type.d.ts +4 -3
- package/dist/esm/type/class/api/authorization/policy/context/with-request-metadata.type.d.ts +4 -3
- package/dist/esm/type/class/api/authorization/policy/hook/execution-result.type.d.ts +5 -0
- package/dist/esm/type/class/api/authorization/policy/hook/result.type.d.ts +3 -2
- package/dist/esm/type/class/api/authorization/policy/hook/type.d.ts +2 -1
- package/dist/esm/type/class/api/authorization/rule/transform-payload.type.d.ts +2 -2
- package/dist/esm/type/class/api/controller/generated/function.type.d.ts +1 -0
- package/dist/esm/type/class/api/controller/generated/index.d.ts +2 -0
- package/dist/esm/type/class/api/controller/generated/scope-function-type.type.d.ts +2 -0
- package/dist/esm/type/class/api/controller/get-list/compiled/index.d.ts +3 -0
- package/dist/esm/type/class/api/controller/get-list/compiled/order-field.type.d.ts +16 -0
- package/dist/esm/type/class/api/controller/get-list/compiled/order.type.d.ts +6 -0
- package/dist/esm/type/class/api/controller/get-list/compiled/plan.type.d.ts +8 -0
- package/dist/esm/type/class/api/controller/get-list/cursor/execution-options.type.d.ts +18 -0
- package/dist/esm/type/class/api/controller/get-list/cursor/index.d.ts +2 -0
- package/dist/esm/type/class/api/controller/get-list/cursor/query-runtime-result.type.d.ts +8 -0
- package/dist/esm/type/class/api/controller/get-list/index.d.ts +2 -0
- package/dist/esm/type/class/api/controller/index.d.ts +1 -0
- package/dist/esm/type/class/api/subscriber/route/after/get/list-context.type.d.ts +3 -2
- package/dist/esm/type/class/api/subscriber/route/before/get/list-context.type.d.ts +5 -6
- package/dist/esm/type/decorator/api/controller/get-list/index.d.ts +1 -0
- package/dist/esm/type/decorator/api/controller/get-list/query/dto-contract.type.d.ts +1 -0
- package/dist/esm/type/decorator/api/controller/get-list/query/request-target.type.d.ts +7 -0
- package/dist/esm/type/decorator/api/controller/get-list/query/type.d.ts +22 -2
- package/dist/esm/type/decorator/api/controller/get-list/response.type.d.ts +3 -0
- package/dist/esm/type/decorator/api/controller/index.d.ts +1 -0
- package/dist/esm/type/decorator/api/controller/properties/route/contract.type.d.ts +5 -0
- package/dist/esm/type/decorator/api/controller/properties/route/identity/index.d.ts +2 -0
- package/dist/esm/type/decorator/api/controller/properties/route/identity/with.type.d.ts +11 -0
- package/dist/esm/type/decorator/api/controller/properties/route/identity/without.type.d.ts +3 -0
- package/dist/esm/type/decorator/api/controller/properties/route/read/dto.type.d.ts +10 -0
- package/dist/esm/type/decorator/api/controller/properties/route/read/index.d.ts +3 -0
- package/dist/esm/type/decorator/api/controller/properties/route/read/with.type.d.ts +11 -0
- package/dist/esm/type/decorator/api/controller/properties/route/read/without.type.d.ts +3 -0
- package/dist/esm/type/decorator/api/controller/properties/route/without-parameters-dto.type.d.ts +4 -0
- package/dist/esm/type/decorator/api/controller/properties-route.type.d.ts +3 -3
- package/dist/esm/type/decorator/api/controller/read/direct-scalar-field.type.d.ts +2 -0
- package/dist/esm/type/decorator/api/controller/read/index.d.ts +2 -0
- package/dist/esm/type/decorator/api/controller/read/parameter-transformer/index.d.ts +1 -0
- package/dist/esm/type/decorator/api/controller/read/parameter-transformer/type.d.ts +3 -0
- package/dist/esm/type/decorator/api/controller/read/parameter-transformer/with-string-key.type.d.ts +5 -0
- package/dist/esm/type/decorator/api/property/describe/properties/base/properties.type.d.ts +1 -1
- package/dist/esm/type/factory/api/controller/method/map.type.d.ts +4 -5
- package/dist/esm/type/factory/api/controller/target-methods.type.d.ts +3 -3
- package/dist/esm/type/utility/api/controller/transform-data/is-validation-properties.type.d.ts +3 -2
- package/dist/esm/type/utility/api/controller/transform-data/object-to-transform.type.d.ts +4 -3
- package/dist/esm/type/utility/api/controller/transform-data/runtime-transformer.type.d.ts +3 -0
- package/dist/esm/type/utility/api/controller/transform-data/targets.type.d.ts +17 -0
- package/dist/esm/type/utility/dto/generate/allowed-combination.type.d.ts +1 -1
- package/dist/esm/utility/api/controller/apply/decorators.utility.d.ts +18 -2
- package/dist/esm/utility/api/controller/apply/decorators.utility.js +25 -4
- package/dist/esm/utility/api/controller/apply/decorators.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/apply/metadata.utility.d.ts +18 -0
- package/dist/esm/utility/api/controller/apply/metadata.utility.js +24 -5
- package/dist/esm/utility/api/controller/apply/metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/build-route-documentation.utility.js +1 -0
- package/dist/esm/utility/api/controller/build-route-documentation.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get/dto.utility.d.ts +17 -0
- package/dist/esm/utility/api/controller/get/dto.utility.js +90 -12
- package/dist/esm/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/query/get-pagination-mode.utility.d.ts +8 -0
- package/dist/esm/utility/api/controller/get-list/query/get-pagination-mode.utility.js +41 -0
- package/dist/esm/utility/api/controller/get-list/query/get-pagination-mode.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/get-list/query/open-api/decorators.utility.js +1 -0
- package/dist/esm/utility/api/controller/get-list/query/open-api/decorators.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/query/open-api/value-schema.utility.js +1 -0
- package/dist/esm/utility/api/controller/get-list/query/open-api/value-schema.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.d.ts +7 -0
- package/dist/esm/utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.js +24 -0
- package/dist/esm/utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/get-list/transform/filter.utility.js +1 -0
- package/dist/esm/utility/api/controller/get-list/transform/filter.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/handle-request-relations.utility.d.ts +2 -1
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js +1 -0
- package/dist/esm/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/identity/assert-plan.utility.d.ts +8 -0
- package/dist/esm/utility/api/controller/identity/assert-plan.utility.js +16 -0
- package/dist/esm/utility/api/controller/identity/assert-plan.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/identity/index.d.ts +2 -0
- package/dist/esm/utility/api/controller/identity/plan/get.utility.d.ts +7 -0
- package/dist/esm/utility/api/controller/identity/plan/get.utility.js +13 -0
- package/dist/esm/utility/api/controller/identity/plan/get.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/identity/plan/index.d.ts +2 -0
- package/dist/esm/utility/api/controller/identity/plan/metadata-key.constant.d.ts +1 -0
- package/dist/esm/utility/api/controller/identity/plan/metadata-key.constant.js +4 -0
- package/dist/esm/utility/api/controller/identity/plan/metadata-key.constant.js.map +1 -0
- package/dist/esm/utility/api/controller/identity/plan/set.utility.d.ts +8 -0
- package/dist/esm/utility/api/controller/identity/plan/set.utility.js +14 -0
- package/dist/esm/utility/api/controller/identity/plan/set.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/read/assert-plan.utility.d.ts +8 -0
- package/dist/esm/utility/api/controller/read/assert-plan.utility.js +16 -0
- package/dist/esm/utility/api/controller/read/assert-plan.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/read/index.d.ts +3 -0
- package/dist/esm/utility/api/controller/read/plan/get.utility.d.ts +8 -0
- package/dist/esm/utility/api/controller/read/plan/get.utility.js +14 -0
- package/dist/esm/utility/api/controller/read/plan/get.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/read/plan/index.d.ts +2 -0
- package/dist/esm/utility/api/controller/read/plan/metadata-key.constant.d.ts +1 -0
- package/dist/esm/utility/api/controller/read/plan/metadata-key.constant.js +4 -0
- package/dist/esm/utility/api/controller/read/plan/metadata-key.constant.js.map +1 -0
- package/dist/esm/utility/api/controller/read/plan/set.utility.d.ts +9 -0
- package/dist/esm/utility/api/controller/read/plan/set.utility.js +15 -0
- package/dist/esm/utility/api/controller/read/plan/set.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/read/scope.utility.d.ts +12 -0
- package/dist/esm/utility/api/controller/read/scope.utility.js +36 -0
- package/dist/esm/utility/api/controller/read/scope.utility.js.map +1 -0
- package/dist/esm/utility/api/controller/transform-data.utility.js +13 -11
- package/dist/esm/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/validate-request.utility.d.ts +2 -1
- package/dist/esm/utility/api/controller/validate-request.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.d.ts +17 -0
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.js +24 -6
- package/dist/esm/utility/api/controller/write/dto-swagger.utility.js.map +1 -1
- package/dist/esm/utility/api/function-transaction.utility.js +1 -0
- package/dist/esm/utility/api/function-transaction.utility.js.map +1 -1
- package/dist/esm/utility/api/route/apply-dto-metadata.utility.js +1 -0
- package/dist/esm/utility/api/route/apply-dto-metadata.utility.js.map +1 -1
- package/dist/esm/utility/api/route/response/project-relation.utility.js +1 -0
- package/dist/esm/utility/api/route/response/project-relation.utility.js.map +1 -1
- package/dist/esm/utility/authorization/scope-merge-where.utility.js +248 -131
- package/dist/esm/utility/authorization/scope-merge-where.utility.js.map +1 -1
- package/dist/esm/utility/dto/build-decorator.utility.js +1 -0
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/core.utility.js +18 -6
- package/dist/esm/utility/dto/generate/core.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/dynamic.utility.js +1 -0
- package/dist/esm/utility/dto/generate/dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/exception.utility.js +1 -0
- package/dist/esm/utility/dto/generate/exception.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/filter-decorator.utility.js +1 -0
- package/dist/esm/utility/dto/generate/filter-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/get-list/cursor-response.utility.d.ts +10 -0
- package/dist/esm/utility/dto/generate/get-list/cursor-response.utility.js +98 -0
- package/dist/esm/utility/dto/generate/get-list/cursor-response.utility.js.map +1 -0
- package/dist/esm/utility/dto/generate/get-list/index.d.ts +3 -0
- package/dist/esm/utility/dto/generate/{get-list-query-properties.utility.d.ts → get-list/query-properties.utility.d.ts} +4 -4
- package/dist/esm/utility/dto/generate/{get-list-query-properties.utility.js → get-list/query-properties.utility.js} +35 -34
- package/dist/esm/utility/dto/generate/get-list/query-properties.utility.js.map +1 -0
- package/dist/esm/utility/dto/generate/{get-list-response.utility.d.ts → get-list/response.utility.d.ts} +1 -1
- package/dist/esm/utility/dto/generate/{get-list-response.utility.js → get-list/response.utility.js} +33 -32
- package/dist/esm/utility/dto/generate/get-list/response.utility.js.map +1 -0
- package/dist/esm/utility/dto/generate/identity-read-parameters.utility.d.ts +17 -0
- package/dist/esm/utility/dto/generate/identity-read-parameters.utility.js +111 -0
- package/dist/esm/utility/dto/generate/identity-read-parameters.utility.js.map +1 -0
- package/dist/esm/utility/dto/generate/index.d.ts +1 -1
- package/dist/esm/utility/dto/generate/read-parameters.utility.d.ts +17 -0
- package/dist/esm/utility/dto/generate/read-parameters.utility.js +109 -0
- package/dist/esm/utility/dto/generate/read-parameters.utility.js.map +1 -0
- package/dist/esm/utility/dto/get/get-list-query-base-class.utility.d.ts +3 -2
- package/dist/esm/utility/dto/get/get-list-query-base-class.utility.js +48 -15
- package/dist/esm/utility/dto/get/get-list-query-base-class.utility.js.map +1 -1
- package/dist/esm/utility/dto/handle-date-property.utility.js +1 -0
- package/dist/esm/utility/dto/handle-date-property.utility.js.map +1 -1
- package/dist/esm/utility/dto/is/property/infrastructure-timestamp.utility.js +1 -0
- package/dist/esm/utility/dto/is/property/infrastructure-timestamp.utility.js.map +1 -1
- package/dist/esm/utility/dto/is/property/should-be-marked.utility.js +1 -0
- package/dist/esm/utility/dto/is/property/should-be-marked.utility.js.map +1 -1
- package/dist/esm/utility/dto/is/should-be-generated.utility.js +1 -0
- package/dist/esm/utility/dto/is/should-be-generated.utility.js.map +1 -1
- package/dist/esm/utility/object-find-property-descriptor.utility.d.ts +7 -0
- package/dist/esm/utility/object-find-property-descriptor.utility.js +20 -0
- package/dist/esm/utility/object-find-property-descriptor.utility.js.map +1 -0
- package/dist/esm/validator/at-most-one-of-listed-properties.validator.d.ts +5 -0
- package/dist/esm/validator/at-most-one-of-listed-properties.validator.js +21 -0
- package/dist/esm/validator/at-most-one-of-listed-properties.validator.js.map +1 -0
- package/package.json +2 -1
- package/dist/cjs/utility/dto/generate/get-list-query-properties.utility.js.map +0 -1
- package/dist/cjs/utility/dto/generate/get-list-response.utility.js.map +0 -1
- package/dist/esm/utility/dto/generate/get-list-query-properties.utility.js.map +0 -1
- package/dist/esm/utility/dto/generate/get-list-response.utility.js.map +0 -1
- /package/dist/cjs/interface/decorator/api/{get-list-response-result.interface.d.ts → get-list/response-result.interface.d.ts} +0 -0
- /package/dist/esm/interface/decorator/api/{get-list-response-result.interface.d.ts → get-list/response-result.interface.d.ts} +0 -0
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var node_crypto = require('node:crypto');
|
|
4
|
+
var apiControllerCursor_constant = require('../../../../../constant/api-controller-cursor.constant.js');
|
|
4
5
|
require('../../../../../constant/decorator/api/function.constant.js');
|
|
5
6
|
var propertyDescribe_constant = require('../../../../../constant/decorator/api/property-describe.constant.js');
|
|
6
7
|
var operatorRegistry_constant = require('../../../../../constant/filter/operator-registry.constant.js');
|
|
8
|
+
var safeObjectPropertyNames_constant = require('../../../../../constant/safe-object-property-names.constant.js');
|
|
7
9
|
var generate_constant = require('../../../../../constant/utility/dto/generate.constant.js');
|
|
8
10
|
require('../../../../../enum/decorator/api/action.enum.js');
|
|
9
11
|
require('../../../../../enum/decorator/api/authentication-type.enum.js');
|
|
10
12
|
var missingBehavior_enum = require('../../../../../enum/decorator/api/controller/get-list/query/filter/missing-behavior.enum.js');
|
|
13
|
+
var paginationMode_enum = require('../../../../../enum/decorator/api/controller/get-list/query/pagination-mode.enum.js');
|
|
11
14
|
var unlistedFields_enum = require('../../../../../enum/decorator/api/controller/get-list/query/unlisted-fields.enum.js');
|
|
12
15
|
require('../../../../../enum/decorator/api/controller/relation-reference-shape.enum.js');
|
|
13
16
|
var target_enum = require('../../../../../enum/decorator/api/controller/request/target.enum.js');
|
|
@@ -29,64 +32,133 @@ require('../../../../../enum/decorator/api/property/date/identifier.enum.js');
|
|
|
29
32
|
require('../../../../../enum/decorator/api/property/date/type.enum.js');
|
|
30
33
|
var desribeType_enum = require('../../../../../enum/decorator/api/property/desribe-type.enum.js');
|
|
31
34
|
var numberType_enum = require('../../../../../enum/decorator/api/property/number-type.enum.js');
|
|
32
|
-
require('../../../../../enum/decorator/api/property/string-type.enum.js');
|
|
35
|
+
var stringType_enum = require('../../../../../enum/decorator/api/property/string-type.enum.js');
|
|
33
36
|
require('../../../../../enum/decorator/api/route/subscriber-authorization-expectation.enum.js');
|
|
34
37
|
var type_enum = require('../../../../../enum/decorator/api/route/type.enum.js');
|
|
35
38
|
var operand_enum = require('../../../../../enum/filter/operand.enum.js');
|
|
36
39
|
var operation_enum = require('../../../../../enum/filter/operation.enum.js');
|
|
37
|
-
require('../../../../../enum/filter/order-direction.enum.js');
|
|
40
|
+
var orderDirection_enum = require('../../../../../enum/filter/order-direction.enum.js');
|
|
41
|
+
var manualDtoPropertyMetadataDecorator_enum = require('../../../../../enum/utility/manual-dto-property-metadata-decorator.enum.js');
|
|
38
42
|
var enumValues_utility = require('../../../../../utility/api/controller/get-list/query/enum-values.utility.js');
|
|
43
|
+
var resolveCursorOrderFields_utility = require('../../../../../utility/api/controller/get-list/query/resolve-cursor-order-fields.utility.js');
|
|
39
44
|
var filterOrderByFromEntity_utility = require('../../../../../utility/api/filter-order-by-from-entity.utility.js');
|
|
45
|
+
var decoratorConfig_utility = require('../../../../../utility/dto/get/decorator-config.utility.js');
|
|
40
46
|
var shouldBeMarked_utility = require('../../../../../utility/dto/is/property/should-be-marked.utility.js');
|
|
47
|
+
var get_utility = require('../../../../../utility/dto/manual/property-metadata/get.utility.js');
|
|
41
48
|
var exception_utility = require('../../../../../utility/error/exception.utility.js');
|
|
42
49
|
var generateEntityInformation_utility = require('../../../../../utility/generate-entity-information.utility.js');
|
|
43
50
|
var typeorm = require('typeorm');
|
|
44
51
|
|
|
52
|
+
const CURSOR_RESPONSE_PROPERTY_COUNT = 3;
|
|
53
|
+
const CURSOR_MAXIMUM_ARRAY_INDEX_PROPERTY = 4_294_967_294;
|
|
54
|
+
const CURSOR_BIGINT_COLUMN_TYPES = new Set(["bigint", "int8"]);
|
|
55
|
+
const CURSOR_BOOLEAN_COLUMN_TYPES = new Set(["bool", "boolean", "boolean-constructor"]);
|
|
56
|
+
const CURSOR_ENUM_INTEGER_COLUMN_TYPES = new Set(["int", "int2", "int4", "integer", "smallint"]);
|
|
57
|
+
const CURSOR_INTEGER_COLUMN_TYPES = new Set([...CURSOR_ENUM_INTEGER_COLUMN_TYPES, "number-constructor"]);
|
|
58
|
+
const CURSOR_NON_PERSISTED_COLUMN_MODES = new Set(["array", "treeChildrenCount", "virtual", "virtual-property"]);
|
|
59
|
+
const CURSOR_UUID_COLUMN_TYPES = new Set(["uuid"]);
|
|
45
60
|
class ApiControllerGetListQueryPlanCompiler {
|
|
46
61
|
static compile(controller, entity, entityMetadata, routeConfig) {
|
|
47
62
|
const queryTarget = routeConfig.request?.[target_enum.EApiControllerRequestTarget.QUERY];
|
|
48
|
-
if (!queryTarget?.filter && !queryTarget?.order) {
|
|
63
|
+
if (!queryTarget?.filter && !queryTarget?.order && !queryTarget?.pagination) {
|
|
49
64
|
return undefined;
|
|
50
65
|
}
|
|
51
66
|
if (routeConfig.dto?.[dtoType_enum.EApiDtoType.QUERY]) {
|
|
52
67
|
throw exception_utility.ErrorException("Generated GET_LIST query configuration cannot be combined with a manual QUERY DTO");
|
|
53
68
|
}
|
|
54
69
|
const currentGuard = routeConfig.security?.authentication?.guard;
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
70
|
+
const pagination = this.compilePagination(queryTarget.pagination);
|
|
71
|
+
const isCursor = pagination.mode === paginationMode_enum.EApiControllerGetListQueryPaginationMode.CURSOR;
|
|
72
|
+
const filterBaseline = this.buildFilterBaseline(entity, entityMetadata, currentGuard, isCursor);
|
|
73
|
+
const serverOrderBaseline = this.buildServerOrderBaseline(entity, entityMetadata, isCursor);
|
|
74
|
+
const orderBaseline = this.buildOrderBaseline(entity, entityMetadata, serverOrderBaseline, isCursor);
|
|
75
|
+
const filter = queryTarget.filter ? this.compileFilter(queryTarget.filter, filterBaseline, isCursor) : Object.freeze({ fields: filterBaseline, isLegacy: !isCursor, ...(isCursor ? { unlistedFields: unlistedFields_enum.EApiControllerGetListQueryUnlistedFields.INHERIT } : {}) });
|
|
76
|
+
const order = queryTarget.order ? this.compileOrder(queryTarget.order, orderBaseline, serverOrderBaseline, isCursor) : Object.freeze({ fields: orderBaseline, isLegacy: true, serverFields: serverOrderBaseline });
|
|
77
|
+
const cursorFields = isCursor ? resolveCursorOrderFields_utility.ApiControllerGetListQueryResolveCursorOrderFields(order) : Object.freeze([]);
|
|
78
|
+
if (isCursor) {
|
|
79
|
+
this.validateCursorPlan(entity, entityMetadata, order, cursorFields, routeConfig);
|
|
80
|
+
}
|
|
81
|
+
const normalizedOrder = {
|
|
82
|
+
fields: Object.values(order.fields).map((field) => ({
|
|
83
|
+
isEnabled: field.isEnabled,
|
|
84
|
+
...(isCursor ? { metadata: this.createCursorOrderFieldFingerprint(field) } : {}),
|
|
85
|
+
path: field.path,
|
|
86
|
+
})),
|
|
87
|
+
isLegacy: order.isLegacy,
|
|
88
|
+
unlistedFields: order.unlistedFields,
|
|
89
|
+
};
|
|
90
|
+
if (queryTarget.order?.defaultOrder !== undefined) {
|
|
91
|
+
normalizedOrder.defaultOrder = order.defaultOrder;
|
|
92
|
+
}
|
|
93
|
+
if (queryTarget.order?.tieBreakers !== undefined) {
|
|
94
|
+
normalizedOrder.tieBreakers = order.tieBreakers;
|
|
95
|
+
}
|
|
96
|
+
if (isCursor) {
|
|
97
|
+
normalizedOrder.effectiveFields = cursorFields.map((path) => {
|
|
98
|
+
const field = order.serverFields[path];
|
|
99
|
+
if (!field) {
|
|
100
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${path}" is unavailable`);
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
metadata: this.createCursorOrderFieldFingerprint(field),
|
|
104
|
+
path,
|
|
105
|
+
storage: {
|
|
106
|
+
hasTransformer: field.hasTransformer,
|
|
107
|
+
isArray: field.isColumnArray,
|
|
108
|
+
isSelected: field.isSelected,
|
|
109
|
+
isUnsigned: field.isUnsigned,
|
|
110
|
+
mode: field.columnMode,
|
|
111
|
+
precision: field.precision,
|
|
112
|
+
scale: field.scale,
|
|
113
|
+
type: field.columnType,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
59
118
|
const normalizedPlan = {
|
|
60
119
|
filter: {
|
|
61
120
|
fields: Object.values(filter.fields).map((field) => ({
|
|
62
121
|
allowedOperations: field.allowedOperations,
|
|
63
122
|
defaultCondition: field.defaultCondition,
|
|
64
123
|
isEnabled: field.isEnabled,
|
|
124
|
+
...(isCursor ? { metadata: this.createFieldFingerprint(field) } : {}),
|
|
65
125
|
missingBehavior: field.missingBehavior,
|
|
66
126
|
path: field.path,
|
|
67
127
|
})),
|
|
68
128
|
isLegacy: filter.isLegacy,
|
|
69
129
|
unlistedFields: filter.unlistedFields,
|
|
70
130
|
},
|
|
71
|
-
order:
|
|
72
|
-
fields: Object.values(order.fields).map((field) => ({
|
|
73
|
-
isEnabled: field.isEnabled,
|
|
74
|
-
path: field.path,
|
|
75
|
-
})),
|
|
76
|
-
isLegacy: order.isLegacy,
|
|
77
|
-
unlistedFields: order.unlistedFields,
|
|
78
|
-
},
|
|
131
|
+
order: normalizedOrder,
|
|
79
132
|
};
|
|
133
|
+
if (isCursor) {
|
|
134
|
+
normalizedPlan.pagination = pagination;
|
|
135
|
+
}
|
|
80
136
|
const signature = node_crypto.createHash("sha256").update(JSON.stringify(normalizedPlan)).digest("hex");
|
|
81
|
-
|
|
82
|
-
|
|
137
|
+
const controllerName = controller.name || "AnonymousController";
|
|
138
|
+
const schemaName = `${controllerName}${entityMetadata.name ?? "UnknownResource"}GetListQuery${signature}DTO`;
|
|
139
|
+
if (!isCursor) {
|
|
140
|
+
const pageFields = Object.freeze(Object.fromEntries(Object.entries(order.fields).map(([path, field]) => [path, Object.freeze({ isEnabled: field.isEnabled, path: field.path })])));
|
|
141
|
+
const pageOrderProperties = {};
|
|
142
|
+
for (const [key, value] of Object.entries(order)) {
|
|
143
|
+
if (key === "serverFields") {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
pageOrderProperties[key] = key === "fields" ? pageFields : value;
|
|
147
|
+
}
|
|
148
|
+
const pageOrder = Object.freeze(pageOrderProperties);
|
|
149
|
+
return Object.freeze({ controllerName, filter, order: pageOrder, schemaName, signature });
|
|
150
|
+
}
|
|
151
|
+
const plan = Object.freeze({
|
|
152
|
+
controllerName,
|
|
83
153
|
filter,
|
|
84
154
|
order,
|
|
85
|
-
|
|
155
|
+
pagination: pagination,
|
|
156
|
+
schemaName,
|
|
86
157
|
signature,
|
|
87
158
|
});
|
|
159
|
+
return plan;
|
|
88
160
|
}
|
|
89
|
-
static buildFilterBaseline(entityMetadata, currentGuard) {
|
|
161
|
+
static buildFilterBaseline(entity, entityMetadata, currentGuard, isCursor) {
|
|
90
162
|
const fields = {};
|
|
91
163
|
for (const column of entityMetadata.columns) {
|
|
92
164
|
const metadata = this.getPropertyMetadata(column);
|
|
@@ -98,7 +170,7 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
98
170
|
if (!shouldBeMarked_utility.DtoIsPropertyShouldBeMarked(type_enum.EApiRouteType.GET_LIST, dtoType_enum.EApiDtoType.QUERY, path, metadata, column.isPrimary, currentGuard)) {
|
|
99
171
|
continue;
|
|
100
172
|
}
|
|
101
|
-
fields[path] = this.createFilterField(path, metadata, this.isColumnNullable(entityMetadata.name, path, metadata));
|
|
173
|
+
fields[path] = this.createFilterField(path, metadata, this.isColumnNullable(entity, entityMetadata.name, path, metadata, isCursor));
|
|
102
174
|
continue;
|
|
103
175
|
}
|
|
104
176
|
if (!column.relation?.target || !this.isToOneRelation(column) || !shouldBeMarked_utility.DtoIsPropertyShouldBeMarked(type_enum.EApiRouteType.GET_LIST, dtoType_enum.EApiDtoType.QUERY, path, metadata, column.isPrimary, currentGuard)) {
|
|
@@ -121,22 +193,46 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
121
193
|
continue;
|
|
122
194
|
}
|
|
123
195
|
const nestedPath = `${path}.${nestedName}`;
|
|
124
|
-
fields[nestedPath] = this.createFilterField(nestedPath, nestedMetadata, this.isColumnNullable(relationMetadata.name, nestedName, nestedMetadata));
|
|
196
|
+
fields[nestedPath] = this.createFilterField(nestedPath, nestedMetadata, this.isColumnNullable(column.relation.target, relationMetadata.name, nestedName, nestedMetadata, isCursor));
|
|
125
197
|
}
|
|
126
198
|
}
|
|
127
|
-
return Object.freeze(this.sortRecord(fields));
|
|
199
|
+
return Object.freeze(this.sortRecord(fields, isCursor));
|
|
128
200
|
}
|
|
129
|
-
static buildOrderBaseline(entity, entityMetadata) {
|
|
201
|
+
static buildOrderBaseline(entity, entityMetadata, serverBaseline, isCursor) {
|
|
130
202
|
const fields = {};
|
|
131
203
|
const orderFields = filterOrderByFromEntity_utility.FilterOrderByFromEntity(entity, entityMetadata, type_enum.EApiRouteType.GET_LIST, dtoType_enum.EApiDtoType.QUERY);
|
|
132
204
|
for (const path of Object.values(orderFields)
|
|
133
205
|
.map(String)
|
|
134
|
-
.toSorted((left, right) =>
|
|
135
|
-
|
|
206
|
+
.toSorted((left, right) => this.compareStrings(left, right, isCursor))) {
|
|
207
|
+
const field = serverBaseline[path];
|
|
208
|
+
if (field) {
|
|
209
|
+
fields[path] = field;
|
|
210
|
+
}
|
|
136
211
|
}
|
|
137
212
|
return Object.freeze(fields);
|
|
138
213
|
}
|
|
139
|
-
static
|
|
214
|
+
static buildServerOrderBaseline(entity, entityMetadata, isCursor) {
|
|
215
|
+
const fields = {};
|
|
216
|
+
for (const column of entityMetadata.columns) {
|
|
217
|
+
const metadata = this.getPropertyMetadata(column);
|
|
218
|
+
if (!column.relation && metadata && metadata.type !== desribeType_enum.EApiPropertyDescribeType.OBJECT && metadata.type !== desribeType_enum.EApiPropertyDescribeType.RELATION) {
|
|
219
|
+
const path = String(column.name);
|
|
220
|
+
const columnMetadata = this.findColumnMetadata(entity, entityMetadata.name, path);
|
|
221
|
+
fields[path] = this.createOrderField(path, metadata, this.isColumnNullable(entity, entityMetadata.name, path, metadata, isCursor), columnMetadata);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return Object.freeze(this.sortRecord(fields, isCursor));
|
|
225
|
+
}
|
|
226
|
+
static compareStrings(left, right, isCursor) {
|
|
227
|
+
if (!isCursor) {
|
|
228
|
+
return left.localeCompare(right);
|
|
229
|
+
}
|
|
230
|
+
if (left < right) {
|
|
231
|
+
return -1;
|
|
232
|
+
}
|
|
233
|
+
return left > right ? 1 : 0;
|
|
234
|
+
}
|
|
235
|
+
static compileAllowedOperations(rawOperations, field, isCursor) {
|
|
140
236
|
if (!Array.isArray(rawOperations) || rawOperations.length === 0) {
|
|
141
237
|
throw exception_utility.ErrorException(`Enabled GET_LIST filter field "${field.path}" requires non-empty allowedOperations`);
|
|
142
238
|
}
|
|
@@ -154,7 +250,7 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
154
250
|
operations.push(operation);
|
|
155
251
|
}
|
|
156
252
|
}
|
|
157
|
-
return Object.freeze(operations.toSorted((left, right) =>
|
|
253
|
+
return Object.freeze(operations.toSorted((left, right) => this.compareStrings(left, right, isCursor)));
|
|
158
254
|
}
|
|
159
255
|
static compileDefaultCondition(rawCondition, field, allowedOperations) {
|
|
160
256
|
const condition = this.requireRecord(rawCondition, `GET_LIST filter defaultCondition for "${field.path}"`);
|
|
@@ -183,13 +279,13 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
183
279
|
}
|
|
184
280
|
return Object.freeze({ operation, values: Object.freeze([...conditionValues]) });
|
|
185
281
|
}
|
|
186
|
-
static compileFilter(config, baseline) {
|
|
282
|
+
static compileFilter(config, baseline, isCursor) {
|
|
187
283
|
const rawConfig = this.requireRecord(config, "GET_LIST filter");
|
|
188
284
|
this.requireExactKeys(rawConfig, ["fields", "unlistedFields"], "GET_LIST filter");
|
|
189
285
|
this.validateUnlistedFields(config.unlistedFields, "filter");
|
|
190
286
|
const configuredFields = this.requireRecord(config.fields, "GET_LIST filter fields");
|
|
191
287
|
const fields = config.unlistedFields === unlistedFields_enum.EApiControllerGetListQueryUnlistedFields.INHERIT ? { ...baseline } : {};
|
|
192
|
-
for (const [path, rawField] of Object.entries(configuredFields).toSorted(([left], [right]) =>
|
|
288
|
+
for (const [path, rawField] of Object.entries(configuredFields).toSorted(([left], [right]) => this.compareStrings(left, right, isCursor))) {
|
|
193
289
|
const baselineField = baseline[path];
|
|
194
290
|
if (!baselineField) {
|
|
195
291
|
throw exception_utility.ErrorException(`GET_LIST filter field "${path}" is not an enabled direct scalar or one-hop to-one scalar path`);
|
|
@@ -205,7 +301,7 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
205
301
|
throw exception_utility.ErrorException(`GET_LIST filter field "${path}" must declare isEnabled`);
|
|
206
302
|
}
|
|
207
303
|
this.requireAllowedKeys(field, ["allowedOperations", "defaultCondition", "isEnabled", "missingBehavior"], `GET_LIST filter field "${path}"`);
|
|
208
|
-
const allowedOperations = this.compileAllowedOperations(field.allowedOperations, baselineField);
|
|
304
|
+
const allowedOperations = this.compileAllowedOperations(field.allowedOperations, baselineField, isCursor);
|
|
209
305
|
const missingBehavior = field.missingBehavior ?? missingBehavior_enum.EApiControllerGetListQueryFilterMissingBehavior.OMIT;
|
|
210
306
|
if (!Object.values(missingBehavior_enum.EApiControllerGetListQueryFilterMissingBehavior).includes(missingBehavior)) {
|
|
211
307
|
throw exception_utility.ErrorException(`GET_LIST filter field "${path}" has an invalid missingBehavior`);
|
|
@@ -226,18 +322,18 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
226
322
|
});
|
|
227
323
|
}
|
|
228
324
|
return Object.freeze({
|
|
229
|
-
fields: Object.freeze(this.sortRecord(fields)),
|
|
325
|
+
fields: Object.freeze(this.sortRecord(fields, isCursor)),
|
|
230
326
|
isLegacy: false,
|
|
231
327
|
unlistedFields: config.unlistedFields,
|
|
232
328
|
});
|
|
233
329
|
}
|
|
234
|
-
static compileOrder(config, baseline) {
|
|
330
|
+
static compileOrder(config, baseline, serverBaseline, isCursor) {
|
|
235
331
|
const rawConfig = this.requireRecord(config, "GET_LIST order");
|
|
236
|
-
this.
|
|
332
|
+
this.requireAllowedKeys(rawConfig, ["defaultOrder", "fields", "tieBreakers", "unlistedFields"], "GET_LIST order");
|
|
237
333
|
this.validateUnlistedFields(config.unlistedFields, "order");
|
|
238
334
|
const configuredFields = this.requireRecord(config.fields, "GET_LIST order fields");
|
|
239
335
|
const fields = config.unlistedFields === unlistedFields_enum.EApiControllerGetListQueryUnlistedFields.INHERIT ? { ...baseline } : {};
|
|
240
|
-
for (const [path, rawField] of Object.entries(configuredFields).toSorted(([left], [right]) =>
|
|
336
|
+
for (const [path, rawField] of Object.entries(configuredFields).toSorted(([left], [right]) => this.compareStrings(left, right, isCursor))) {
|
|
241
337
|
const baselineField = baseline[path];
|
|
242
338
|
if (!baselineField) {
|
|
243
339
|
throw exception_utility.ErrorException(`GET_LIST order field "${path}" is not an enabled direct scalar path`);
|
|
@@ -249,41 +345,236 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
249
345
|
}
|
|
250
346
|
fields[path] = Object.freeze({ ...baselineField, isEnabled: field.isEnabled });
|
|
251
347
|
}
|
|
348
|
+
const defaultOrder = this.compileOrderEntries(config.defaultOrder, serverBaseline, "defaultOrder");
|
|
349
|
+
const tieBreakers = this.compileOrderEntries(config.tieBreakers, serverBaseline, "tieBreakers");
|
|
350
|
+
for (const defaultEntry of defaultOrder) {
|
|
351
|
+
const tieBreaker = tieBreakers.find((entry) => entry.field === defaultEntry.field);
|
|
352
|
+
if (tieBreaker && tieBreaker.direction !== defaultEntry.direction) {
|
|
353
|
+
throw exception_utility.ErrorException(`GET_LIST order field "${defaultEntry.field}" has conflicting directions across defaultOrder and tieBreakers`);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
252
356
|
return Object.freeze({
|
|
253
|
-
|
|
357
|
+
...(config.defaultOrder === undefined ? {} : { defaultOrder }),
|
|
358
|
+
fields: Object.freeze(this.sortRecord(fields, isCursor)),
|
|
254
359
|
isLegacy: false,
|
|
360
|
+
serverFields: serverBaseline,
|
|
361
|
+
...(config.tieBreakers === undefined ? {} : { tieBreakers }),
|
|
255
362
|
unlistedFields: config.unlistedFields,
|
|
256
363
|
});
|
|
257
364
|
}
|
|
365
|
+
static compileOrderEntries(rawEntries, baseline, context) {
|
|
366
|
+
if (rawEntries === undefined) {
|
|
367
|
+
return Object.freeze([]);
|
|
368
|
+
}
|
|
369
|
+
if (!Array.isArray(rawEntries)) {
|
|
370
|
+
throw exception_utility.ErrorException(`GET_LIST order ${context} must be an array`);
|
|
371
|
+
}
|
|
372
|
+
const entries = [];
|
|
373
|
+
const seenFields = new Set();
|
|
374
|
+
for (const [index, rawEntry] of rawEntries.entries()) {
|
|
375
|
+
const entry = this.requireRecord(rawEntry, `GET_LIST order ${context}[${index}]`);
|
|
376
|
+
this.requireExactKeys(entry, ["direction", "field"], `GET_LIST order ${context}[${index}]`);
|
|
377
|
+
const field = entry.field;
|
|
378
|
+
const direction = entry.direction;
|
|
379
|
+
if (typeof field !== "string" || !baseline[field]) {
|
|
380
|
+
throw exception_utility.ErrorException(`GET_LIST order ${context}[${index}] must target a described direct scalar entity field`);
|
|
381
|
+
}
|
|
382
|
+
if (direction !== orderDirection_enum.EFilterOrderDirection.ASC && direction !== orderDirection_enum.EFilterOrderDirection.DESC) {
|
|
383
|
+
throw exception_utility.ErrorException(`GET_LIST order ${context}[${index}] has an invalid direction`);
|
|
384
|
+
}
|
|
385
|
+
if (seenFields.has(field)) {
|
|
386
|
+
throw exception_utility.ErrorException(`GET_LIST order ${context} contains duplicate field "${field}"`);
|
|
387
|
+
}
|
|
388
|
+
seenFields.add(field);
|
|
389
|
+
entries.push(Object.freeze({ direction, field }));
|
|
390
|
+
}
|
|
391
|
+
return Object.freeze(entries);
|
|
392
|
+
}
|
|
393
|
+
static compilePagination(config) {
|
|
394
|
+
if (config === undefined) {
|
|
395
|
+
return Object.freeze({ mode: paginationMode_enum.EApiControllerGetListQueryPaginationMode.PAGE });
|
|
396
|
+
}
|
|
397
|
+
const rawConfig = this.requireRecord(config, "GET_LIST pagination");
|
|
398
|
+
this.requireExactKeys(rawConfig, ["mode"], "GET_LIST pagination");
|
|
399
|
+
if (!Object.values(paginationMode_enum.EApiControllerGetListQueryPaginationMode).includes(config.mode)) {
|
|
400
|
+
throw exception_utility.ErrorException("GET_LIST pagination mode must be PAGE or CURSOR");
|
|
401
|
+
}
|
|
402
|
+
return Object.freeze({ mode: config.mode });
|
|
403
|
+
}
|
|
404
|
+
static createCursorOrderFieldFingerprint(field) {
|
|
405
|
+
const fingerprint = { type: field.type };
|
|
406
|
+
if ("format" in field.metadata) {
|
|
407
|
+
fingerprint.format = field.metadata.format;
|
|
408
|
+
}
|
|
409
|
+
if ("enum" in field.metadata) {
|
|
410
|
+
const values = enumValues_utility.ApiControllerGetListQueryEnumValues(field.metadata.enum);
|
|
411
|
+
let enumKind = "mixed";
|
|
412
|
+
if (values.every((value) => typeof value === "number")) {
|
|
413
|
+
enumKind = "number";
|
|
414
|
+
}
|
|
415
|
+
else if (values.every((value) => typeof value === "string")) {
|
|
416
|
+
enumKind = "string";
|
|
417
|
+
}
|
|
418
|
+
fingerprint.enumKind = enumKind;
|
|
419
|
+
}
|
|
420
|
+
return fingerprint;
|
|
421
|
+
}
|
|
422
|
+
static createFieldFingerprint(field) {
|
|
423
|
+
const metadata = field.metadata;
|
|
424
|
+
const fingerprint = {
|
|
425
|
+
isNullable: field.isNullable,
|
|
426
|
+
type: field.type,
|
|
427
|
+
};
|
|
428
|
+
for (const key of ["format", "identifier", "isArray", "maximum", "maxLength", "minimum", "minLength", "multipleOf", "pattern"]) {
|
|
429
|
+
if (key in metadata) {
|
|
430
|
+
fingerprint[key] = metadata[key];
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if ("enum" in field.metadata) {
|
|
434
|
+
fingerprint.enum = enumValues_utility.ApiControllerGetListQueryEnumValues(field.metadata.enum);
|
|
435
|
+
}
|
|
436
|
+
return fingerprint;
|
|
437
|
+
}
|
|
258
438
|
static createFilterField(path, metadata, isNullable) {
|
|
259
439
|
const allowedOperations = Object.freeze(Object.values(operation_enum.EFilterOperation).filter((operation) => {
|
|
260
440
|
const descriptor = operatorRegistry_constant.FILTER_OPERATOR_REGISTRY_CONSTANT.OPERATORS[operation];
|
|
261
441
|
return descriptor.kinds.includes(metadata.type) && (descriptor.operand !== operand_enum.EFilterOperand.NONE || isNullable);
|
|
262
442
|
}));
|
|
263
|
-
const planMetadata =
|
|
443
|
+
const planMetadata = this.createPlanMetadata(metadata);
|
|
264
444
|
return Object.freeze({
|
|
265
445
|
allowedOperations,
|
|
266
446
|
isEnabled: true,
|
|
267
447
|
isNullable,
|
|
268
|
-
metadata:
|
|
448
|
+
metadata: planMetadata,
|
|
269
449
|
missingBehavior: missingBehavior_enum.EApiControllerGetListQueryFilterMissingBehavior.OMIT,
|
|
270
450
|
path,
|
|
271
451
|
type: metadata.type,
|
|
272
452
|
});
|
|
273
453
|
}
|
|
454
|
+
static createOrderField(path, metadata, isNullable, columnMetadata) {
|
|
455
|
+
return Object.freeze({
|
|
456
|
+
columnMode: columnMetadata?.mode ?? "unknown",
|
|
457
|
+
columnType: this.normalizeColumnType(columnMetadata),
|
|
458
|
+
hasTransformer: columnMetadata?.options.transformer !== undefined,
|
|
459
|
+
isColumnArray: columnMetadata?.options.array === true,
|
|
460
|
+
isEnabled: true,
|
|
461
|
+
isNullable,
|
|
462
|
+
isSelected: columnMetadata?.options.select !== false,
|
|
463
|
+
isUnsigned: columnMetadata?.options.unsigned === true,
|
|
464
|
+
metadata: this.createPlanMetadata(metadata),
|
|
465
|
+
path,
|
|
466
|
+
...(columnMetadata?.options.precision === undefined ? {} : { precision: columnMetadata.options.precision }),
|
|
467
|
+
...(columnMetadata?.options.scale === undefined ? {} : { scale: columnMetadata.options.scale }),
|
|
468
|
+
type: metadata.type,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
static createPlanMetadata(metadata) {
|
|
472
|
+
const planMetadata = "enum" in metadata ? { ...metadata, enum: Object.freeze({ ...metadata.enum }) } : { ...metadata };
|
|
473
|
+
return Object.freeze(planMetadata);
|
|
474
|
+
}
|
|
475
|
+
static findColumnMetadata(entity, entityName, propertyName) {
|
|
476
|
+
const targets = [];
|
|
477
|
+
if (typeof entity === "function") {
|
|
478
|
+
let current = entity;
|
|
479
|
+
while (typeof current === "function" && current !== Object) {
|
|
480
|
+
targets.push(current, current.name);
|
|
481
|
+
current = Object.getPrototypeOf(current);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
else if (typeof entity.name === "string") {
|
|
485
|
+
targets.push(entity.name);
|
|
486
|
+
}
|
|
487
|
+
if (entityName && !targets.includes(entityName)) {
|
|
488
|
+
targets.push(entityName);
|
|
489
|
+
}
|
|
490
|
+
for (const expectedTarget of targets) {
|
|
491
|
+
const column = typeorm.getMetadataArgsStorage().columns.find(({ propertyName: currentPropertyName, target }) => currentPropertyName === propertyName && (target === expectedTarget || (typeof expectedTarget === "string" && typeof target !== "string" && target.name === expectedTarget)));
|
|
492
|
+
if (column) {
|
|
493
|
+
return column;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return undefined;
|
|
497
|
+
}
|
|
274
498
|
static getPropertyMetadata(column) {
|
|
275
499
|
return column.metadata?.[propertyDescribe_constant.PROPERTY_DESCRIBE_DECORATOR_API_CONSTANT.METADATA_KEY];
|
|
276
500
|
}
|
|
277
|
-
static
|
|
278
|
-
|
|
501
|
+
static hasAfterLoadListener(entity) {
|
|
502
|
+
if (typeof entity !== "function") {
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
const targets = new Set();
|
|
506
|
+
let current = entity;
|
|
507
|
+
while (typeof current === "function" && current !== Object) {
|
|
508
|
+
targets.add(current);
|
|
509
|
+
current = Object.getPrototypeOf(current);
|
|
510
|
+
}
|
|
511
|
+
return typeorm.getMetadataArgsStorage().entityListeners.some((listener) => listener.type === "after-load" && targets.has(listener.target));
|
|
512
|
+
}
|
|
513
|
+
static hasPropertyAccessor(entity, propertyName) {
|
|
514
|
+
if (typeof entity === "function") {
|
|
515
|
+
try {
|
|
516
|
+
const instance = Reflect.construct(entity, []);
|
|
517
|
+
const ownDescriptor = Object.getOwnPropertyDescriptor(instance, propertyName);
|
|
518
|
+
if (ownDescriptor && !("value" in ownDescriptor)) {
|
|
519
|
+
return true;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
catch {
|
|
523
|
+
return true;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
let current = typeof entity === "function" ? Reflect.get(entity, "prototype") : undefined;
|
|
527
|
+
while (current && typeof current === "object" && current !== Object.prototype) {
|
|
528
|
+
const descriptor = Object.getOwnPropertyDescriptor(current, propertyName);
|
|
529
|
+
if (descriptor && !("value" in descriptor)) {
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
current = Object.getPrototypeOf(current);
|
|
533
|
+
}
|
|
534
|
+
return false;
|
|
535
|
+
}
|
|
536
|
+
static isColumnNullable(entity, entityName, propertyName, metadata, isCursor) {
|
|
537
|
+
const column = isCursor ? this.findColumnMetadata(entity, entityName, propertyName) : typeorm.getMetadataArgsStorage().columns.find(({ propertyName: currentPropertyName, target }) => currentPropertyName === propertyName && (typeof target === "string" ? target === entityName : target.name === entityName));
|
|
279
538
|
return column?.options.nullable === true || metadata.isNullable === true;
|
|
280
539
|
}
|
|
540
|
+
static isCursorEnvelopeStringMetadata(metadata) {
|
|
541
|
+
if (metadata.decorator !== manualDtoPropertyMetadataDecorator_enum.EManualDtoPropertyMetadataDecorator.STRING || !this.isManualRawResponseProperty(metadata, false, true)) {
|
|
542
|
+
return false;
|
|
543
|
+
}
|
|
544
|
+
return metadata.properties.format === stringType_enum.EApiPropertyStringType.STRING && metadata.properties.minLength === 1 && metadata.properties.maxLength === apiControllerCursor_constant.API_CONTROLLER_CURSOR_TOKEN_MAX_LENGTH && metadata.properties.pattern === "/^[A-Za-z0-9_-]+$/";
|
|
545
|
+
}
|
|
281
546
|
static isGloballyDisabled(metadata) {
|
|
282
547
|
return metadata.properties?.[type_enum.EApiRouteType.GET_LIST]?.[dtoType_enum.EApiDtoType.QUERY]?.isEnabled === false;
|
|
283
548
|
}
|
|
549
|
+
static isManualRawResponseProperty(metadata, isArray, isNullable) {
|
|
550
|
+
const properties = metadata.properties;
|
|
551
|
+
const hasExpectedArrayShape = isArray ? properties.isArray === true : properties.isArray !== true;
|
|
552
|
+
const hasExpectedNullability = isNullable ? properties.isNullable === true : properties.isNullable !== true;
|
|
553
|
+
return hasExpectedArrayShape && hasExpectedNullability && properties.isRequired === true && properties.isResponse === true && properties.isExpose !== false;
|
|
554
|
+
}
|
|
284
555
|
static isToOneRelation(column) {
|
|
285
556
|
return column.type === "many-to-one" || column.type === "one-to-one";
|
|
286
557
|
}
|
|
558
|
+
static isUnsafeCursorFieldName(fieldName) {
|
|
559
|
+
const numericName = Number(fieldName);
|
|
560
|
+
return safeObjectPropertyNames_constant.UNSAFE_OBJECT_PROPERTY_NAMES_CONSTANT.has(fieldName) || (Number.isInteger(numericName) && numericName >= 0 && numericName <= CURSOR_MAXIMUM_ARRAY_INDEX_PROPERTY && String(numericName) === fieldName);
|
|
561
|
+
}
|
|
562
|
+
static normalizeColumnType(column) {
|
|
563
|
+
const columnType = column?.options.type;
|
|
564
|
+
if (columnType === Boolean) {
|
|
565
|
+
return "boolean-constructor";
|
|
566
|
+
}
|
|
567
|
+
if (columnType === Date) {
|
|
568
|
+
return "date-constructor";
|
|
569
|
+
}
|
|
570
|
+
if (columnType === Number) {
|
|
571
|
+
return "number-constructor";
|
|
572
|
+
}
|
|
573
|
+
if (columnType === String) {
|
|
574
|
+
return "string-constructor";
|
|
575
|
+
}
|
|
576
|
+
return typeof columnType === "string" ? columnType.trim().toLowerCase() : "unknown";
|
|
577
|
+
}
|
|
287
578
|
static requireAllowedKeys(value, allowedKeys, context) {
|
|
288
579
|
const invalidKey = Object.keys(value).find((key) => !allowedKeys.includes(key));
|
|
289
580
|
if (invalidKey) {
|
|
@@ -303,8 +594,155 @@ class ApiControllerGetListQueryPlanCompiler {
|
|
|
303
594
|
}
|
|
304
595
|
return value;
|
|
305
596
|
}
|
|
306
|
-
static sortRecord(record) {
|
|
307
|
-
return Object.fromEntries(Object.entries(record).toSorted(([left], [right]) =>
|
|
597
|
+
static sortRecord(record, isCursor) {
|
|
598
|
+
return Object.fromEntries(Object.entries(record).toSorted(([left], [right]) => this.compareStrings(left, right, isCursor)));
|
|
599
|
+
}
|
|
600
|
+
static validateCursorCustomResponseDto(routeConfig, fields, order) {
|
|
601
|
+
const responseDto = routeConfig.dto?.[dtoType_enum.EApiDtoType.RESPONSE];
|
|
602
|
+
if (!responseDto) {
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
let itemType;
|
|
606
|
+
if (typeof responseDto === "function") {
|
|
607
|
+
const wrapperMetadata = get_utility.GetManualDtoPropertyMetadata(Reflect.get(responseDto, "prototype"));
|
|
608
|
+
const itemsMetadata = wrapperMetadata.get("items");
|
|
609
|
+
const nextCursorMetadata = wrapperMetadata.get("nextCursor");
|
|
610
|
+
const previousCursorMetadata = wrapperMetadata.get("previousCursor");
|
|
611
|
+
if (wrapperMetadata.size !== CURSOR_RESPONSE_PROPERTY_COUNT ||
|
|
612
|
+
itemsMetadata?.decorator !== manualDtoPropertyMetadataDecorator_enum.EManualDtoPropertyMetadataDecorator.OBJECT ||
|
|
613
|
+
nextCursorMetadata?.decorator !== manualDtoPropertyMetadataDecorator_enum.EManualDtoPropertyMetadataDecorator.STRING ||
|
|
614
|
+
previousCursorMetadata?.decorator !== manualDtoPropertyMetadataDecorator_enum.EManualDtoPropertyMetadataDecorator.STRING ||
|
|
615
|
+
!this.isManualRawResponseProperty(itemsMetadata, true, false) ||
|
|
616
|
+
Array.isArray(itemsMetadata.properties.type) ||
|
|
617
|
+
typeof itemsMetadata.properties.type !== "function" ||
|
|
618
|
+
itemsMetadata.properties.type === Object ||
|
|
619
|
+
!this.isCursorEnvelopeStringMetadata(nextCursorMetadata) ||
|
|
620
|
+
!this.isCursorEnvelopeStringMetadata(previousCursorMetadata) ||
|
|
621
|
+
this.hasPropertyAccessor(responseDto, "items") ||
|
|
622
|
+
this.hasPropertyAccessor(responseDto, "nextCursor") ||
|
|
623
|
+
this.hasPropertyAccessor(responseDto, "previousCursor")) {
|
|
624
|
+
throw exception_utility.ErrorException("CURSOR GET_LIST custom response DTO must prove the flat raw cursor envelope through Automator property metadata");
|
|
625
|
+
}
|
|
626
|
+
itemType = itemsMetadata.properties.type;
|
|
627
|
+
}
|
|
628
|
+
else if (typeof responseDto === "object" && "itemType" in responseDto && typeof responseDto.itemType === "function") {
|
|
629
|
+
itemType = responseDto.itemType;
|
|
630
|
+
}
|
|
631
|
+
if (!itemType) {
|
|
632
|
+
throw exception_utility.ErrorException("CURSOR GET_LIST custom response DTO must expose a statically provable item type");
|
|
633
|
+
}
|
|
634
|
+
this.validateCursorItemDto(itemType, fields, order);
|
|
635
|
+
}
|
|
636
|
+
static validateCursorItemDto(itemType, fields, order) {
|
|
637
|
+
const itemMetadata = get_utility.GetManualDtoPropertyMetadata(Reflect.get(itemType, "prototype"));
|
|
638
|
+
for (const fieldName of fields) {
|
|
639
|
+
const field = order.serverFields[fieldName];
|
|
640
|
+
const metadata = itemMetadata.get(fieldName);
|
|
641
|
+
const expectedDecorator = field && field.type !== desribeType_enum.EApiPropertyDescribeType.OBJECT && field.type !== desribeType_enum.EApiPropertyDescribeType.RELATION ? field.type : undefined;
|
|
642
|
+
const expectedFormat = field && "format" in field.metadata ? field.metadata.format : undefined;
|
|
643
|
+
const actualFormat = metadata && "format" in metadata.properties ? metadata.properties.format : undefined;
|
|
644
|
+
if (!field || !metadata || metadata.decorator !== expectedDecorator || !this.isManualRawResponseProperty(metadata, false, false) || actualFormat !== expectedFormat || this.hasPropertyAccessor(itemType, fieldName)) {
|
|
645
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST custom item DTO must raw-expose protected field "${fieldName}" through compatible Automator property metadata`);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
static validateCursorPlan(entity, entityMetadata, order, cursorFields, routeConfig) {
|
|
650
|
+
const primaryColumns = entityMetadata.columns.filter((column) => column.isPrimary);
|
|
651
|
+
if (primaryColumns.length !== 1) {
|
|
652
|
+
throw exception_utility.ErrorException("CURSOR GET_LIST requires exactly one primary column");
|
|
653
|
+
}
|
|
654
|
+
if (order.isLegacy) {
|
|
655
|
+
throw exception_utility.ErrorException("CURSOR GET_LIST requires explicit order configuration");
|
|
656
|
+
}
|
|
657
|
+
if (this.hasAfterLoadListener(entity)) {
|
|
658
|
+
throw exception_utility.ErrorException("CURSOR GET_LIST entity cannot declare TypeORM after-load listeners");
|
|
659
|
+
}
|
|
660
|
+
const primaryField = String(primaryColumns[0]?.name);
|
|
661
|
+
const tieBreakers = order.tieBreakers ?? [];
|
|
662
|
+
const finalTieBreaker = tieBreakers.at(-1);
|
|
663
|
+
if (finalTieBreaker?.field !== primaryField) {
|
|
664
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST requires the sole primary field "${primaryField}" as the final explicit tie-breaker`);
|
|
665
|
+
}
|
|
666
|
+
if ((order.defaultOrder ?? []).some((entry) => entry.field === primaryField) || tieBreakers.slice(0, -1).some((entry) => entry.field === primaryField) || order.fields[primaryField]?.isEnabled === true) {
|
|
667
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST primary field "${primaryField}" may appear only as the final tie-breaker`);
|
|
668
|
+
}
|
|
669
|
+
const potentialFields = new Set(cursorFields);
|
|
670
|
+
for (const fieldName of potentialFields) {
|
|
671
|
+
const field = order.serverFields[fieldName];
|
|
672
|
+
if (this.isUnsafeCursorFieldName(fieldName)) {
|
|
673
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${fieldName}" is not a safe stable object property name`);
|
|
674
|
+
}
|
|
675
|
+
if (!field || field.isNullable || ("isArray" in field.metadata && field.metadata.isArray === true)) {
|
|
676
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${fieldName}" must be a described non-null direct scalar field`);
|
|
677
|
+
}
|
|
678
|
+
this.validateCursorStorageField(field);
|
|
679
|
+
if (this.hasPropertyAccessor(entity, fieldName)) {
|
|
680
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${fieldName}" must be a raw data property, not an accessor`);
|
|
681
|
+
}
|
|
682
|
+
this.validateCursorResponseExposure(entityMetadata, fieldName);
|
|
683
|
+
}
|
|
684
|
+
this.validateCursorCustomResponseDto(routeConfig, potentialFields, order);
|
|
685
|
+
}
|
|
686
|
+
static validateCursorResponseExposure(entityMetadata, fieldName) {
|
|
687
|
+
const column = entityMetadata.columns.find((candidate) => String(candidate.name) === fieldName);
|
|
688
|
+
const metadata = column ? this.getPropertyMetadata(column) : undefined;
|
|
689
|
+
if (!column || !metadata) {
|
|
690
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${fieldName}" must be raw-exposed in the generated response`);
|
|
691
|
+
}
|
|
692
|
+
const effectiveResponse = decoratorConfig_utility.DtoGetDecoratorConfig(type_enum.EApiRouteType.GET_LIST, metadata, dtoType_enum.EApiDtoType.RESPONSE);
|
|
693
|
+
if (effectiveResponse.guard || !shouldBeMarked_utility.DtoIsPropertyShouldBeMarked(type_enum.EApiRouteType.GET_LIST, dtoType_enum.EApiDtoType.RESPONSE, fieldName, metadata, column.isPrimary) || effectiveResponse.isEnabled === false || effectiveResponse.isResponse !== true || effectiveResponse.isExpose !== true) {
|
|
694
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${fieldName}" must be unconditionally raw-exposed in the generated response`);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
static validateCursorStorageField(field) {
|
|
698
|
+
if (field.columnType === "unknown" || CURSOR_NON_PERSISTED_COLUMN_MODES.has(field.columnMode) || field.hasTransformer || field.isColumnArray || !field.isSelected) {
|
|
699
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${field.path}" must be a selected persisted column without a transformer`);
|
|
700
|
+
}
|
|
701
|
+
if (field.isUnsigned) {
|
|
702
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${field.path}" cannot use unsigned storage in PostgreSQL v1`);
|
|
703
|
+
}
|
|
704
|
+
if (field.type === desribeType_enum.EApiPropertyDescribeType.BOOLEAN) {
|
|
705
|
+
if (!CURSOR_BOOLEAN_COLUMN_TYPES.has(field.columnType)) {
|
|
706
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST boolean order field "${field.path}" requires PostgreSQL boolean storage`);
|
|
707
|
+
}
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
if (field.type === desribeType_enum.EApiPropertyDescribeType.NUMBER) {
|
|
711
|
+
if (!("format" in field.metadata) || field.metadata.format !== numberType_enum.EApiPropertyNumberType.INTEGER) {
|
|
712
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST numeric order field "${field.path}" supports only INTEGER metadata in PostgreSQL v1`);
|
|
713
|
+
}
|
|
714
|
+
if (!CURSOR_INTEGER_COLUMN_TYPES.has(field.columnType)) {
|
|
715
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST integer order field "${field.path}" requires signed PostgreSQL int2/int4 storage`);
|
|
716
|
+
}
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
if (field.type === desribeType_enum.EApiPropertyDescribeType.STRING) {
|
|
720
|
+
const format = "format" in field.metadata ? field.metadata.format : undefined;
|
|
721
|
+
if (format !== stringType_enum.EApiPropertyStringType.BIGINT_STRING) {
|
|
722
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST string order field "${field.path}" supports only BIGINT_STRING metadata in PostgreSQL v1`);
|
|
723
|
+
}
|
|
724
|
+
if (!CURSOR_BIGINT_COLUMN_TYPES.has(field.columnType)) {
|
|
725
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST bigint-string order field "${field.path}" requires signed PostgreSQL int8 storage`);
|
|
726
|
+
}
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
if (field.type === desribeType_enum.EApiPropertyDescribeType.ENUM) {
|
|
730
|
+
const enumValues = enumValues_utility.ApiControllerGetListQueryEnumValues("enum" in field.metadata ? field.metadata.enum : {});
|
|
731
|
+
if (enumValues.length === 0 || !enumValues.every((value) => typeof value === "number" && Number.isSafeInteger(value))) {
|
|
732
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST enum order field "${field.path}" requires safe numeric values in PostgreSQL v1`);
|
|
733
|
+
}
|
|
734
|
+
if (!CURSOR_ENUM_INTEGER_COLUMN_TYPES.has(field.columnType)) {
|
|
735
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST enum order field "${field.path}" requires signed PostgreSQL int2/int4 storage`);
|
|
736
|
+
}
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
if (field.type === desribeType_enum.EApiPropertyDescribeType.UUID) {
|
|
740
|
+
if (!CURSOR_UUID_COLUMN_TYPES.has(field.columnType)) {
|
|
741
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST UUID order field "${field.path}" requires native PostgreSQL UUID storage`);
|
|
742
|
+
}
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
throw exception_utility.ErrorException(`CURSOR GET_LIST order field "${field.path}" is not supported by PostgreSQL CURSOR v1`);
|
|
308
746
|
}
|
|
309
747
|
static validateStaticValue(value, field) {
|
|
310
748
|
let isValid;
|