@elsikora/nestjs-crud-automator 1.17.1-dev.1 → 1.18.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/class/api/authorization/policy/registry.class.d.ts +1 -5
- package/dist/cjs/class/api/authorization/policy/registry.class.js +41 -34
- package/dist/cjs/class/api/authorization/policy/registry.class.js.map +1 -1
- package/dist/cjs/class/api/subscriber/registry.class.js +13 -0
- package/dist/cjs/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/cjs/class/metadata-storage.class.d.ts +2 -1
- package/dist/cjs/class/metadata-storage.class.js +53 -17
- package/dist/cjs/class/metadata-storage.class.js.map +1 -1
- package/dist/cjs/constant/dto/auto-context.constant.d.ts +4 -0
- package/dist/cjs/constant/dto/auto-context.constant.js +10 -0
- package/dist/cjs/constant/dto/auto-context.constant.js.map +1 -0
- package/dist/cjs/constant/dto/index.d.ts +1 -0
- package/dist/cjs/decorator/api/authorization/policy.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/authorization/policy.decorator.js +1 -0
- package/dist/cjs/decorator/api/authorization/policy.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/controller/decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/controller/decorator.js +1 -1
- package/dist/cjs/decorator/api/controller/observable.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js +1 -0
- package/dist/cjs/decorator/api/controller/observable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/controller/securable.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/controller/securable.decorator.js +1 -0
- package/dist/cjs/decorator/api/controller/securable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/create.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/decorator.js +1 -0
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/delete.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/get-list.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/get-many.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/get.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/function/update.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/method.decorator.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/cjs/decorator/api/property/boolean.decorator.js +11 -4
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/copy.decorator.d.ts +34 -14
- package/dist/cjs/decorator/api/property/copy.decorator.js +83 -30
- package/dist/cjs/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/property/date.decorator.js +11 -4
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/property/describe.decorator.js +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/property/enum.decorator.js +11 -4
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/property/number.decorator.js +15 -5
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/property/object.decorator.js +13 -4
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/property/string.decorator.js +15 -5
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/property/uuid.decorator.js +12 -5
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/observable.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/service/observable.decorator.js +1 -0
- package/dist/cjs/decorator/api/service/observable.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service.decorator.d.ts +1 -1
- package/dist/cjs/decorator/api/service.decorator.js +1 -1
- package/dist/cjs/decorator/api/subscriber/function.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/subscriber/function.decorator.js +1 -0
- package/dist/cjs/decorator/api/subscriber/function.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/subscriber/route.decorator.d.ts +1 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.js +1 -0
- package/dist/cjs/decorator/api/subscriber/route.decorator.js.map +1 -1
- package/dist/cjs/factory/api/controller.factory.js +0 -2
- package/dist/cjs/factory/api/controller.factory.js.map +1 -1
- package/dist/cjs/index.js +27 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interface/class/api/authorization/policy/registry.interface.d.ts +0 -1
- package/dist/cjs/type/auto-context-metadata.type.d.ts +5 -0
- package/dist/cjs/type/decorator/api/property/base/properties.type.d.ts +2 -1
- package/dist/cjs/type/decorator/api/property/copy-properties.type.d.ts +13 -0
- package/dist/cjs/type/decorator/api/property/entity.type.d.ts +3 -0
- package/dist/cjs/type/decorator/api/property/index.d.ts +2 -0
- package/dist/cjs/type/index.d.ts +1 -0
- package/dist/cjs/utility/api/controller/apply-metadata.utility.js +1 -1
- package/dist/cjs/utility/auto-dto-context-queue.utility.d.ts +11 -0
- package/dist/cjs/utility/auto-dto-context-queue.utility.js +40 -0
- package/dist/cjs/utility/auto-dto-context-queue.utility.js.map +1 -0
- package/dist/cjs/utility/defer-property-decorator-execution.utility.d.ts +5 -0
- package/dist/cjs/utility/defer-property-decorator-execution.utility.js +16 -0
- package/dist/cjs/utility/defer-property-decorator-execution.utility.js.map +1 -0
- package/dist/cjs/utility/dto/auto-context-pop.utility.d.ts +6 -0
- package/dist/cjs/utility/dto/auto-context-pop.utility.js +38 -0
- package/dist/cjs/utility/dto/auto-context-pop.utility.js.map +1 -0
- package/dist/cjs/utility/dto/auto-context-push.utility.d.ts +9 -0
- package/dist/cjs/utility/dto/auto-context-push.utility.js +35 -0
- package/dist/cjs/utility/dto/auto-context-push.utility.js.map +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js +9 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-dynamic.utility.js +21 -13
- package/dist/cjs/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate.utility.js +35 -27
- package/dist/cjs/utility/dto/generate.utility.js.map +1 -1
- package/dist/cjs/utility/dto/index.d.ts +2 -1
- package/dist/cjs/utility/get-auto-dto-context.utility.d.ts +7 -0
- package/dist/cjs/utility/get-auto-dto-context.utility.js +19 -0
- package/dist/cjs/utility/get-auto-dto-context.utility.js.map +1 -0
- package/dist/cjs/utility/index.d.ts +9 -0
- package/dist/cjs/utility/is-entity-constructor.utility.d.ts +8 -0
- package/dist/cjs/utility/is-entity-constructor.utility.js +13 -0
- package/dist/cjs/utility/is-entity-constructor.utility.js.map +1 -0
- package/dist/cjs/utility/is-entity-factory.utility.d.ts +8 -0
- package/dist/cjs/utility/is-entity-factory.utility.js +15 -0
- package/dist/cjs/utility/is-entity-factory.utility.js.map +1 -0
- package/dist/cjs/utility/is-entity-literal.utility.d.ts +7 -0
- package/dist/cjs/utility/is-entity-literal.utility.js +13 -0
- package/dist/cjs/utility/is-entity-literal.utility.js.map +1 -0
- package/dist/cjs/utility/queue-auto-context-retry.utility.d.ts +6 -0
- package/dist/cjs/utility/queue-auto-context-retry.utility.js +23 -0
- package/dist/cjs/utility/queue-auto-context-retry.utility.js.map +1 -0
- package/dist/cjs/utility/register-auto-dto-child.utility.d.ts +14 -0
- package/dist/cjs/utility/register-auto-dto-child.utility.js +69 -0
- package/dist/cjs/utility/register-auto-dto-child.utility.js.map +1 -0
- package/dist/cjs/utility/resolve/decorator-context.utility.d.ts +13 -0
- package/dist/cjs/utility/resolve/decorator-context.utility.js +31 -0
- package/dist/cjs/utility/resolve/decorator-context.utility.js.map +1 -0
- package/dist/cjs/utility/resolve/index.d.ts +2 -0
- package/dist/cjs/utility/resolve/property-entity.utility.d.ts +16 -0
- package/dist/cjs/utility/resolve/property-entity.utility.js +43 -0
- package/dist/cjs/utility/resolve/property-entity.utility.js.map +1 -0
- package/dist/cjs/utility/with-resolved-property-entity.utility.d.ts +11 -0
- package/dist/cjs/utility/with-resolved-property-entity.utility.js +30 -0
- package/dist/cjs/utility/with-resolved-property-entity.utility.js.map +1 -0
- package/dist/esm/class/api/authorization/policy/registry.class.d.ts +1 -5
- package/dist/esm/class/api/authorization/policy/registry.class.js +41 -34
- package/dist/esm/class/api/authorization/policy/registry.class.js.map +1 -1
- package/dist/esm/class/api/subscriber/registry.class.js +13 -0
- package/dist/esm/class/api/subscriber/registry.class.js.map +1 -1
- package/dist/esm/class/metadata-storage.class.d.ts +2 -1
- package/dist/esm/class/metadata-storage.class.js +53 -17
- package/dist/esm/class/metadata-storage.class.js.map +1 -1
- package/dist/esm/constant/dto/auto-context.constant.d.ts +4 -0
- package/dist/esm/constant/dto/auto-context.constant.js +7 -0
- package/dist/esm/constant/dto/auto-context.constant.js.map +1 -0
- package/dist/esm/constant/dto/index.d.ts +1 -0
- package/dist/esm/decorator/api/authorization/policy.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/authorization/policy.decorator.js +1 -0
- package/dist/esm/decorator/api/authorization/policy.decorator.js.map +1 -1
- package/dist/esm/decorator/api/controller/decorator.d.ts +1 -1
- package/dist/esm/decorator/api/controller/decorator.js +1 -1
- package/dist/esm/decorator/api/controller/observable.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js +1 -0
- package/dist/esm/decorator/api/controller/observable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/controller/securable.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/controller/securable.decorator.js +1 -0
- package/dist/esm/decorator/api/controller/securable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/create.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/create.decorator.js +1 -0
- package/dist/esm/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/decorator.js +1 -0
- package/dist/esm/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/delete.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/delete.decorator.js +1 -0
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-list.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/get-list.decorator.js +1 -0
- package/dist/esm/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get-many.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/get-many.decorator.js +1 -0
- package/dist/esm/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/get.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/get.decorator.js +1 -0
- package/dist/esm/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/esm/decorator/api/function/update.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/function/update.decorator.js +1 -0
- package/dist/esm/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/decorator/api/method.decorator.d.ts +1 -0
- 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.d.ts +1 -0
- package/dist/esm/decorator/api/property/boolean.decorator.js +12 -5
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/copy.decorator.d.ts +34 -14
- package/dist/esm/decorator/api/property/copy.decorator.js +83 -30
- package/dist/esm/decorator/api/property/copy.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/property/date.decorator.js +12 -5
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/property/describe.decorator.js +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/property/enum.decorator.js +12 -5
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/property/number.decorator.js +17 -7
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/property/object.decorator.js +14 -5
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/property/string.decorator.js +17 -7
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/property/uuid.decorator.js +13 -6
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/observable.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/service/observable.decorator.js +1 -0
- package/dist/esm/decorator/api/service/observable.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service.decorator.d.ts +1 -1
- package/dist/esm/decorator/api/service.decorator.js +1 -1
- package/dist/esm/decorator/api/subscriber/function.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/subscriber/function.decorator.js +1 -0
- package/dist/esm/decorator/api/subscriber/function.decorator.js.map +1 -1
- package/dist/esm/decorator/api/subscriber/route.decorator.d.ts +1 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.js +1 -0
- package/dist/esm/decorator/api/subscriber/route.decorator.js.map +1 -1
- package/dist/esm/factory/api/controller.factory.js +0 -2
- package/dist/esm/factory/api/controller.factory.js.map +1 -1
- package/dist/esm/index.js +13 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interface/class/api/authorization/policy/registry.interface.d.ts +0 -1
- package/dist/esm/type/auto-context-metadata.type.d.ts +5 -0
- package/dist/esm/type/decorator/api/property/base/properties.type.d.ts +2 -1
- package/dist/esm/type/decorator/api/property/copy-properties.type.d.ts +13 -0
- package/dist/esm/type/decorator/api/property/entity.type.d.ts +3 -0
- package/dist/esm/type/decorator/api/property/index.d.ts +2 -0
- package/dist/esm/type/index.d.ts +1 -0
- package/dist/esm/utility/api/controller/apply-metadata.utility.js +1 -1
- package/dist/esm/utility/auto-dto-context-queue.utility.d.ts +11 -0
- package/dist/esm/utility/auto-dto-context-queue.utility.js +37 -0
- package/dist/esm/utility/auto-dto-context-queue.utility.js.map +1 -0
- package/dist/esm/utility/defer-property-decorator-execution.utility.d.ts +5 -0
- package/dist/esm/utility/defer-property-decorator-execution.utility.js +14 -0
- package/dist/esm/utility/defer-property-decorator-execution.utility.js.map +1 -0
- package/dist/esm/utility/dto/auto-context-pop.utility.d.ts +6 -0
- package/dist/esm/utility/dto/auto-context-pop.utility.js +36 -0
- package/dist/esm/utility/dto/auto-context-pop.utility.js.map +1 -0
- package/dist/esm/utility/dto/auto-context-push.utility.d.ts +9 -0
- package/dist/esm/utility/dto/auto-context-push.utility.js +33 -0
- package/dist/esm/utility/dto/auto-context-push.utility.js.map +1 -0
- package/dist/esm/utility/dto/build-decorator.utility.js +9 -1
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate-dynamic.utility.js +21 -13
- package/dist/esm/utility/dto/generate-dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate.utility.js +35 -27
- package/dist/esm/utility/dto/generate.utility.js.map +1 -1
- package/dist/esm/utility/dto/index.d.ts +2 -1
- package/dist/esm/utility/get-auto-dto-context.utility.d.ts +7 -0
- package/dist/esm/utility/get-auto-dto-context.utility.js +17 -0
- package/dist/esm/utility/get-auto-dto-context.utility.js.map +1 -0
- package/dist/esm/utility/index.d.ts +9 -0
- package/dist/esm/utility/is-entity-constructor.utility.d.ts +8 -0
- package/dist/esm/utility/is-entity-constructor.utility.js +11 -0
- package/dist/esm/utility/is-entity-constructor.utility.js.map +1 -0
- package/dist/esm/utility/is-entity-factory.utility.d.ts +8 -0
- package/dist/esm/utility/is-entity-factory.utility.js +13 -0
- package/dist/esm/utility/is-entity-factory.utility.js.map +1 -0
- package/dist/esm/utility/is-entity-literal.utility.d.ts +7 -0
- package/dist/esm/utility/is-entity-literal.utility.js +11 -0
- package/dist/esm/utility/is-entity-literal.utility.js.map +1 -0
- package/dist/esm/utility/queue-auto-context-retry.utility.d.ts +6 -0
- package/dist/esm/utility/queue-auto-context-retry.utility.js +21 -0
- package/dist/esm/utility/queue-auto-context-retry.utility.js.map +1 -0
- package/dist/esm/utility/register-auto-dto-child.utility.d.ts +14 -0
- package/dist/esm/utility/register-auto-dto-child.utility.js +66 -0
- package/dist/esm/utility/register-auto-dto-child.utility.js.map +1 -0
- package/dist/esm/utility/resolve/decorator-context.utility.d.ts +13 -0
- package/dist/esm/utility/resolve/decorator-context.utility.js +29 -0
- package/dist/esm/utility/resolve/decorator-context.utility.js.map +1 -0
- package/dist/esm/utility/resolve/index.d.ts +2 -0
- package/dist/esm/utility/resolve/property-entity.utility.d.ts +16 -0
- package/dist/esm/utility/resolve/property-entity.utility.js +40 -0
- package/dist/esm/utility/resolve/property-entity.utility.js.map +1 -0
- package/dist/esm/utility/with-resolved-property-entity.utility.d.ts +11 -0
- package/dist/esm/utility/with-resolved-property-entity.utility.js +28 -0
- package/dist/esm/utility/with-resolved-property-entity.utility.js.map +1 -0
- package/package.json +4 -1
- package/dist/cjs/utility/dto/analize.utility.d.ts +0 -8
- package/dist/cjs/utility/dto/analize.utility.js +0 -17
- package/dist/cjs/utility/dto/analize.utility.js.map +0 -1
- package/dist/esm/utility/dto/analize.utility.d.ts +0 -8
- package/dist/esm/utility/dto/analize.utility.js +0 -15
- package/dist/esm/utility/dto/analize.utility.js.map +0 -1
|
@@ -84,7 +84,7 @@ var propertyDescribe_constant = require('../../../constant/decorator/api/propert
|
|
|
84
84
|
* })
|
|
85
85
|
* posts: Post[];
|
|
86
86
|
* ```
|
|
87
|
-
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators
|
|
87
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-describe | API Reference - ApiPropertyDescribe}
|
|
88
88
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/core-concepts/entities | Core Concepts - Entities}
|
|
89
89
|
*/
|
|
90
90
|
function ApiPropertyDescribe(properties) {
|
|
@@ -16,6 +16,7 @@ import type { TApiPropertyEnumProperties } from '../../../type/decorator/api/pro
|
|
|
16
16
|
* that only valid options are accepted in requests and properly documented in the API.
|
|
17
17
|
* @param {TApiPropertyEnumProperties} properties - Configuration options for the enum property
|
|
18
18
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
19
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-enum | API Reference - ApiPropertyEnum}
|
|
19
20
|
* @example
|
|
20
21
|
* ```typescript
|
|
21
22
|
* // String enum example
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var common = require('@nestjs/common');
|
|
4
4
|
var swagger = require('@nestjs/swagger');
|
|
5
|
+
var withResolvedPropertyEntity_utility = require('../../../utility/with-resolved-property-entity.utility.js');
|
|
5
6
|
var classTransformer = require('class-transformer');
|
|
6
7
|
var classValidator = require('class-validator');
|
|
7
8
|
|
|
@@ -22,6 +23,7 @@ var classValidator = require('class-validator');
|
|
|
22
23
|
* that only valid options are accepted in requests and properly documented in the API.
|
|
23
24
|
* @param {TApiPropertyEnumProperties} properties - Configuration options for the enum property
|
|
24
25
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
26
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-enum | API Reference - ApiPropertyEnum}
|
|
25
27
|
* @example
|
|
26
28
|
* ```typescript
|
|
27
29
|
* // String enum example
|
|
@@ -80,10 +82,15 @@ var classValidator = require('class-validator');
|
|
|
80
82
|
* ```
|
|
81
83
|
*/
|
|
82
84
|
function ApiPropertyEnum(properties) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
return (target, propertyKey) => {
|
|
86
|
+
withResolvedPropertyEntity_utility.WithResolvedPropertyEntity(properties.entity, "ApiPropertyEnum", (resolvedEntity) => {
|
|
87
|
+
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
88
|
+
validateOptions(normalizedProperties);
|
|
89
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
90
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
91
|
+
common.applyDecorators(...decorators)(target, propertyKey);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
87
94
|
}
|
|
88
95
|
/**
|
|
89
96
|
* Builds the API property options object from the provided enum property configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.decorator.js","sources":["../../../../../../src/decorator/api/property/enum.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","ApiProperty","IsEnum","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude"],"mappings":"
|
|
1
|
+
{"version":3,"file":"enum.decorator.js","sources":["../../../../../../src/decorator/api/property/enum.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","applyDecorators","ApiProperty","IsEnum","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude"],"mappings":";;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7DA,6DAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,cAAqD,KAAI;YAC1H,MAAM,oBAAoB,GAA+B,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE;YAElG,eAAe,CAAC,oBAAoB,CAAC;AAErC,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,oBAAoB,CAAC;YAC5F,MAAM,UAAU,GAA6B,eAAe,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAEtGC,sBAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;AACpD,QAAA,CAAC,CAAC;AACH,IAAA,CAAC;AACF;AAEA;;;;;AAKG;AACH,SAAS,uBAAuB,CAAC,UAAsC,EAAA;AACtE,IAAA,MAAM,kBAAkB,GAAiD;AACxE,QAAA,WAAW,EAAE,CAAA,EAAG,M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/C;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IAC/D;AACD;;;;"}
|
|
@@ -16,6 +16,7 @@ import type { TApiPropertyNumberProperties } from '../../../type/decorator/api/p
|
|
|
16
16
|
* if one is not provided, and applies appropriate validation rules based on the configuration.
|
|
17
17
|
* @param {TApiPropertyNumberProperties} properties - Configuration options for the number property
|
|
18
18
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
19
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-number | API Reference - ApiPropertyNumber}
|
|
19
20
|
* @example
|
|
20
21
|
* ```typescript
|
|
21
22
|
* // Simple integer property
|
|
@@ -17,6 +17,7 @@ require('../../../enum/decorator/api/property/string-type.enum.js');
|
|
|
17
17
|
require('../../../enum/decorator/api/route-type.enum.js');
|
|
18
18
|
var common = require('@nestjs/common');
|
|
19
19
|
var swagger = require('@nestjs/swagger');
|
|
20
|
+
var withResolvedPropertyEntity_utility = require('../../../utility/with-resolved-property-entity.utility.js');
|
|
20
21
|
var classTransformer = require('class-transformer');
|
|
21
22
|
var classValidator = require('class-validator');
|
|
22
23
|
var random = require('lodash/random');
|
|
@@ -38,6 +39,7 @@ var random = require('lodash/random');
|
|
|
38
39
|
* if one is not provided, and applies appropriate validation rules based on the configuration.
|
|
39
40
|
* @param {TApiPropertyNumberProperties} properties - Configuration options for the number property
|
|
40
41
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
42
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-number | API Reference - ApiPropertyNumber}
|
|
41
43
|
* @example
|
|
42
44
|
* ```typescript
|
|
43
45
|
* // Simple integer property
|
|
@@ -88,11 +90,19 @@ var random = require('lodash/random');
|
|
|
88
90
|
* ```
|
|
89
91
|
*/
|
|
90
92
|
function ApiPropertyNumber(properties) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
return (target, propertyKey) => {
|
|
94
|
+
withResolvedPropertyEntity_utility.WithResolvedPropertyEntity(properties.entity, "ApiPropertyNumber", (resolvedEntity) => {
|
|
95
|
+
const normalizedProperties = {
|
|
96
|
+
...properties,
|
|
97
|
+
entity: resolvedEntity,
|
|
98
|
+
};
|
|
99
|
+
normalizedProperties.exampleValue ??= random(normalizedProperties.minimum, normalizedProperties.maximum);
|
|
100
|
+
validateOptions(normalizedProperties);
|
|
101
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
102
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
103
|
+
common.applyDecorators(...decorators)(target, propertyKey);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
96
106
|
}
|
|
97
107
|
/**
|
|
98
108
|
* Builds the API property options object from the provided property configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.decorator.js","sources":["../../../../../../src/decorator/api/property/number.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","ApiProperty","EApiPropertyNumberType","IsNumber","IsInt","Type","IsDivisibleBy","Min","Max","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","NUMBER_CONSTANT","EApiPropertyDataType","isInt"],"mappings":"
|
|
1
|
+
{"version":3,"file":"number.decorator.js","sources":["../../../../../../src/decorator/api/property/number.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","applyDecorators","ApiProperty","EApiPropertyNumberType","IsNumber","IsInt","Type","IsDivisibleBy","Min","Max","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","NUMBER_CONSTANT","EApiPropertyDataType","isInt"],"mappings":";;;;;;;;;;;;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I,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACjE;AACD;;;;"}
|
|
@@ -12,6 +12,7 @@ import type { TApiPropertyObjectProperties } from '../../../type/decorator/api/p
|
|
|
12
12
|
* - Transformation rules
|
|
13
13
|
* @param {TApiPropertyObjectProperties} options - Configuration options for the object property
|
|
14
14
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
15
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-object | API Reference - ApiPropertyObject}
|
|
15
16
|
* @example
|
|
16
17
|
* ```typescript
|
|
17
18
|
* class UserDto {
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var common = require('@nestjs/common');
|
|
4
4
|
var swagger = require('@nestjs/swagger');
|
|
5
|
+
var registerAutoDtoChild_utility = require('../../../utility/register-auto-dto-child.utility.js');
|
|
6
|
+
var withResolvedPropertyEntity_utility = require('../../../utility/with-resolved-property-entity.utility.js');
|
|
5
7
|
var mustMatchOneOfSchemas_validator = require('../../../validator/must-match-one-of-schemas.validator.js');
|
|
6
8
|
var classTransformer = require('class-transformer');
|
|
7
9
|
var classValidator = require('class-validator');
|
|
@@ -19,6 +21,7 @@ var classValidator = require('class-validator');
|
|
|
19
21
|
* - Transformation rules
|
|
20
22
|
* @param {TApiPropertyObjectProperties} options - Configuration options for the object property
|
|
21
23
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
24
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-object | API Reference - ApiPropertyObject}
|
|
22
25
|
* @example
|
|
23
26
|
* ```typescript
|
|
24
27
|
* class UserDto {
|
|
@@ -33,10 +36,16 @@ var classValidator = require('class-validator');
|
|
|
33
36
|
* ```
|
|
34
37
|
*/
|
|
35
38
|
function ApiPropertyObject(options) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
return (target, propertyKey) => {
|
|
40
|
+
registerAutoDtoChild_utility.RegisterAutoDtoChild(target, options.type);
|
|
41
|
+
withResolvedPropertyEntity_utility.WithResolvedPropertyEntity(options.entity, "ApiPropertyObject", (resolvedEntity) => {
|
|
42
|
+
const normalizedOptions = { ...options, entity: resolvedEntity };
|
|
43
|
+
validateOptions(normalizedOptions);
|
|
44
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedOptions);
|
|
45
|
+
const decorators = buildDecorators(normalizedOptions, apiPropertyOptions);
|
|
46
|
+
common.applyDecorators(...decorators)(target, propertyKey);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
40
49
|
}
|
|
41
50
|
/**
|
|
42
51
|
* Builds the API property options object from the provided property configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.decorator.js","sources":["../../../../../../src/decorator/api/property/object.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","getSchemaPath","ApiProperty","ValidateNested","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","MustMatchOneOfSchemasValidator","Type"],"mappings":"
|
|
1
|
+
{"version":3,"file":"object.decorator.js","sources":["../../../../../../src/decorator/api/property/object.decorator.ts"],"sourcesContent":[null],"names":["RegisterAutoDtoChild","WithResolvedPropertyEntity","applyDecorators","getSchemaPath","ApiProperty","ValidateNested","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","MustMatchOneOfSchemasValidator","Type"],"mappings":";;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,SAAU,iBAAiB,CAAC,OAAqC,EAAA;AACtE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;AAC7D,QAAAA,iDAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC;QAE1CC,6DAA0B,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,cAAyD,KAAI;YAC7H,MAAM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O,UAAU;AAClB;AAEA;;;;;;;AAOG;AACH,SAAS,eAAe,CAAC,UAAwC,EAAA;IAChE,MAAM,MAAM,GAAkB,EAAE;AAEhC,IAAA,IAAI,UAAU,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,oBAAoB,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE;AACrF,QAAA,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC;IAC7D;AAEA,IAAA,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI,EAAE;QAChC,IAAI,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AAC9C,YAAA,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC;QACrD;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;QAEA,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;QAC/E;IACD;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACjE;AACD;;;;"}
|
|
@@ -15,6 +15,7 @@ import type { TApiPropertyStringProperties } from '../../../type/decorator/api/p
|
|
|
15
15
|
* The decorator applies appropriate validation rules based on the format and configuration.
|
|
16
16
|
* @param {TApiPropertyStringProperties} properties - Configuration options for the string property
|
|
17
17
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
18
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-string | API Reference - ApiPropertyString}
|
|
18
19
|
* @example
|
|
19
20
|
* ```typescript
|
|
20
21
|
* // Simple string property
|
|
@@ -18,6 +18,7 @@ var stringType_enum = require('../../../enum/decorator/api/property/string-type.
|
|
|
18
18
|
require('../../../enum/decorator/api/route-type.enum.js');
|
|
19
19
|
var common = require('@nestjs/common');
|
|
20
20
|
var swagger = require('@nestjs/swagger');
|
|
21
|
+
var withResolvedPropertyEntity_utility = require('../../../utility/with-resolved-property-entity.utility.js');
|
|
21
22
|
var isRegularExpression_validator = require('../../../validator/is-regular-expression.validator.js');
|
|
22
23
|
var classTransformer = require('class-transformer');
|
|
23
24
|
var classValidator = require('class-validator');
|
|
@@ -38,6 +39,7 @@ var classValidator = require('class-validator');
|
|
|
38
39
|
* The decorator applies appropriate validation rules based on the format and configuration.
|
|
39
40
|
* @param {TApiPropertyStringProperties} properties - Configuration options for the string property
|
|
40
41
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
42
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-string | API Reference - ApiPropertyString}
|
|
41
43
|
* @example
|
|
42
44
|
* ```typescript
|
|
43
45
|
* // Simple string property
|
|
@@ -90,10 +92,18 @@ var classValidator = require('class-validator');
|
|
|
90
92
|
* ```
|
|
91
93
|
*/
|
|
92
94
|
function ApiPropertyString(properties) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
return (target, propertyKey) => {
|
|
96
|
+
withResolvedPropertyEntity_utility.WithResolvedPropertyEntity(properties.entity, "ApiPropertyString", (resolvedEntity) => {
|
|
97
|
+
const normalizedProperties = {
|
|
98
|
+
...properties,
|
|
99
|
+
entity: resolvedEntity,
|
|
100
|
+
};
|
|
101
|
+
validateOptions(normalizedProperties);
|
|
102
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
103
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
104
|
+
common.applyDecorators(...decorators)(target, propertyKey);
|
|
105
|
+
});
|
|
106
|
+
};
|
|
97
107
|
}
|
|
98
108
|
/**
|
|
99
109
|
* Builds the API property options object from the provided property configuration.
|
|
@@ -487,7 +497,7 @@ function validateOptions(properties) {
|
|
|
487
497
|
}
|
|
488
498
|
}
|
|
489
499
|
else if (!regex.test(properties.exampleValue)) {
|
|
490
|
-
errors.push("RegExp 'pattern' does not match '
|
|
500
|
+
errors.push("RegExp 'pattern' does not match 'exampleValue' string: " + properties.exampleValue);
|
|
491
501
|
}
|
|
492
502
|
}
|
|
493
503
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.decorator.js","sources":["../../../../../../src/decorator/api/property/string.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","EApiPropertyDataType","ApiProperty","EApiPropertyStringType","IsString","IsBase64","IsBtcAddress","IsISO31661Alpha2","IsISO31661Alpha3","IsCreditCard","IsISO4217CurrencyCode","IsDataURI","IsDate","Type","IsFQDN","IsEmail","IsEthereumAddress","IsHash","IsHexColor","IsHSL","IsIBAN","IsIP","STRING_PROPERTY_API_INTERFACE_CONSTANT","IsISBN","IsJWT","IsLocale","IsLowercase","IsMACAddress","IsMimeType","IsMongoId","IsStrongPassword","IsPhoneNumber","IsPostalCode","Validate","IsRegularExpressionValidator","IsRgbColor","IsSemVer","IsTimeZone","IsUppercase","IsUrl","IsUUID","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Matches","Length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEG;AACG,SAAU,iBAAiB,CAAC,UAAwC,EAAA;IACzE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,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AAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;QAEA,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;QAC/E;IACD;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACjE;AACD;;;;"}
|
|
1
|
+
{"version":3,"file":"string.decorator.js","sources":["../../../../../../src/decorator/api/property/string.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","applyDecorators","EApiPropertyDataType","ApiProperty","EApiPropertyStringType","IsString","IsBase64","IsBtcAddress","IsISO31661Alpha2","IsISO31661Alpha3","IsCreditCard","IsISO4217CurrencyCode","IsDataURI","IsDate","Type","IsFQDN","IsEmail","IsEthereumAddress","IsHash","IsHexColor","IsHSL","IsIBAN","IsIP","STRING_PROPERTY_API_INTERFACE_CONSTANT","IsISBN","IsJWT","IsLocale","IsLowercase","IsMACAddress","IsMimeType","IsMongoId","IsStrongPassword","IsPhoneNumber","IsPostalCode","Validate","IsRegularExpressionValidator","IsRgbColor","IsSemVer","IsTimeZone","IsUppercase","IsUrl","IsUUID","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Matches","Length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AM,GAAG,UAAU,CAAC,SAAS,EAAE;AAC1C,gBAAA,MAAM,CAAC,IAAI,CAAC,8CAA8C,GAAG,OAAO,CAAC;YACtE;QACD;IACD;SAAO,IAAI,UAAU,CAAC,YAAY,CAAC,MAAM,GAAG,UAAU,CAAC,SAAS,EAAE;QACjE,MAAM,CAAC,IAAI,CAAC,8CAA8C,GAAG,UAAU,CAAC,YAAY,CAAC;IACtF;AAEA,IAAA,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI,EAAE;QAChC,IAAI,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AAC9C,YAAA,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC;QACrD;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;AAEA,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;QACzC;QAEA,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;QAC/E;IACD;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACjE;AACD;;;;"}
|
|
@@ -14,6 +14,7 @@ import type { TApiPropertyUuidProperties } from '../../../type/decorator/api/pro
|
|
|
14
14
|
* applies appropriate validation rules based on the configuration.
|
|
15
15
|
* @param {TApiPropertyUuidProperties} properties - Configuration options for the UUID property
|
|
16
16
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
17
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-uuid | API Reference - ApiPropertyUUID}
|
|
17
18
|
* @example
|
|
18
19
|
* ```typescript
|
|
19
20
|
* // Single UUID property
|
|
@@ -17,6 +17,7 @@ var stringType_enum = require('../../../enum/decorator/api/property/string-type.
|
|
|
17
17
|
require('../../../enum/decorator/api/route-type.enum.js');
|
|
18
18
|
var common = require('@nestjs/common');
|
|
19
19
|
var swagger = require('@nestjs/swagger');
|
|
20
|
+
var withResolvedPropertyEntity_utility = require('../../../utility/with-resolved-property-entity.utility.js');
|
|
20
21
|
var classTransformer = require('class-transformer');
|
|
21
22
|
var classValidator = require('class-validator');
|
|
22
23
|
|
|
@@ -35,6 +36,7 @@ var classValidator = require('class-validator');
|
|
|
35
36
|
* applies appropriate validation rules based on the configuration.
|
|
36
37
|
* @param {TApiPropertyUuidProperties} properties - Configuration options for the UUID property
|
|
37
38
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
39
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-uuid | API Reference - ApiPropertyUUID}
|
|
38
40
|
* @example
|
|
39
41
|
* ```typescript
|
|
40
42
|
* // Single UUID property
|
|
@@ -62,11 +64,16 @@ var classValidator = require('class-validator');
|
|
|
62
64
|
* ```
|
|
63
65
|
*/
|
|
64
66
|
function ApiPropertyUUID(properties) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
return (target, propertyKey) => {
|
|
68
|
+
withResolvedPropertyEntity_utility.WithResolvedPropertyEntity(properties.entity, "ApiPropertyUUID", (resolvedEntity) => {
|
|
69
|
+
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
70
|
+
const uuidExample = node_crypto.randomUUID();
|
|
71
|
+
validateOptions(normalizedProperties);
|
|
72
|
+
const apiPropertyOptions = buildApiPropertyOptions(uuidExample, normalizedProperties);
|
|
73
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
74
|
+
common.applyDecorators(...decorators)(target, propertyKey);
|
|
75
|
+
});
|
|
76
|
+
};
|
|
70
77
|
}
|
|
71
78
|
/**
|
|
72
79
|
* Builds the API property options object from the provided property configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.decorator.js","sources":["../../../../../../src/decorator/api/property/uuid.decorator.ts"],"sourcesContent":[null],"names":["randomUUID","applyDecorators","EApiPropertyDataType","EApiPropertyStringType","ApiProperty","IsUUID","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude"],"mappings":"
|
|
1
|
+
{"version":3,"file":"uuid.decorator.js","sources":["../../../../../../src/decorator/api/property/uuid.decorator.ts"],"sourcesContent":[null],"names":["WithResolvedPropertyEntity","randomUUID","applyDecorators","EApiPropertyDataType","EApiPropertyStringType","ApiProperty","IsUUID","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7DA,6DAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,cAAqD,KAAI;YAC1H,MAAM,oBAAoB,GAA+B,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE;AAClG,YAAA,MAAM,WAAW,GAAWC,sBAAU,EAAE;YAExC,eAAe,CAAC,oBAAoB,CAAC;YAErC,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,WAAW,EAAE,oBAAoB,CAAC;YACzG,MAAM,UAAU,GAA6B,eAAe,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAEtGC,sBAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;A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AC,IAAI,CAAC,CAAA,CAAE,CAAC;IAC/D;AACD;;;;"}
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* Decorator that marks a service as observable, allowing it to be monitored by subscribers.
|
|
3
3
|
* When a service is marked as observable, its methods can be intercepted by subscribers that listen for specific events.
|
|
4
4
|
* @returns {ClassDecorator} A class decorator that enables service observability.
|
|
5
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-service/api-service-observable | API Reference - ApiServiceObservable}
|
|
5
6
|
*/
|
|
6
7
|
export declare function ApiServiceObservable(): ClassDecorator;
|
|
@@ -6,6 +6,7 @@ var service_constant = require('../../../constant/decorator/api/service.constant
|
|
|
6
6
|
* Decorator that marks a service as observable, allowing it to be monitored by subscribers.
|
|
7
7
|
* When a service is marked as observable, its methods can be intercepted by subscribers that listen for specific events.
|
|
8
8
|
* @returns {ClassDecorator} A class decorator that enables service observability.
|
|
9
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-service/api-service-observable | API Reference - ApiServiceObservable}
|
|
9
10
|
*/
|
|
10
11
|
function ApiServiceObservable() {
|
|
11
12
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.decorator.js","sources":["../../../../../../src/decorator/api/service/observable.decorator.ts"],"sourcesContent":[null],"names":["SERVICE_API_DECORATOR_CONSTANT"],"mappings":";;;;AAEA
|
|
1
|
+
{"version":3,"file":"observable.decorator.js","sources":["../../../../../../src/decorator/api/service/observable.decorator.ts"],"sourcesContent":[null],"names":["SERVICE_API_DECORATOR_CONSTANT"],"mappings":";;;;AAEA;;;;;AAKG;SACa,oBAAoB,GAAA;IACnC,OAAO,CAAC,MAAc,KAAI;QACzB,OAAO,CAAC,cAAc,CAACA,+CAA8B,CAAC,uBAAuB,EAAE,IAAI,EAAE,MAAM,CAAC;AAC7F,IAAA,CAAC;AACF;;;;"}
|
|
@@ -5,7 +5,7 @@ import type { TApiServiceProperties } from '../../type/decorator/api/service/ind
|
|
|
5
5
|
* @param {TApiServiceProperties<E>} properties - Configuration properties for the service
|
|
6
6
|
* @returns {Function} A class decorator function that extends the target class with CRUD methods
|
|
7
7
|
* @template E - The entity type
|
|
8
|
-
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators
|
|
8
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-service/api-service | API Reference - ApiService}
|
|
9
9
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/core-concepts/services | Core Concepts - Services}
|
|
10
10
|
*/
|
|
11
11
|
export declare function ApiService<E extends IApiBaseEntity>(properties: TApiServiceProperties<E>): <TFunction extends new (...arguments_: Array<any>) => object>(target: TFunction) => TFunction;
|
|
@@ -26,7 +26,7 @@ require('../../enum/decorator/api/route-type.enum.js');
|
|
|
26
26
|
* @param {TApiServiceProperties<E>} properties - Configuration properties for the service
|
|
27
27
|
* @returns {Function} A class decorator function that extends the target class with CRUD methods
|
|
28
28
|
* @template E - The entity type
|
|
29
|
-
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators
|
|
29
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-service/api-service | API Reference - ApiService}
|
|
30
30
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/core-concepts/services | Core Concepts - Services}
|
|
31
31
|
*/
|
|
32
32
|
function ApiService(properties) {
|
|
@@ -23,5 +23,6 @@ import type { IApiFunctionSubscriberProperties } from '../../../interface/decora
|
|
|
23
23
|
* @param {E} properties.entity - The entity that the subscriber will listen to.
|
|
24
24
|
* @param {number} [properties.priority] - The priority of the subscriber. The lower the number, the higher the priority.
|
|
25
25
|
* @returns {ClassDecorator} - A decorator that creates a new subscriber.
|
|
26
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-subscriber/api-function-subscriber | API Reference - ApiFunctionSubscriber}
|
|
26
27
|
*/
|
|
27
28
|
export declare function ApiFunctionSubscriber<E extends IApiBaseEntity>(properties: IApiFunctionSubscriberProperties<E>): ClassDecorator;
|
|
@@ -25,6 +25,7 @@ var subscriber_constant = require('../../../constant/decorator/api/subscriber.co
|
|
|
25
25
|
* @param {E} properties.entity - The entity that the subscriber will listen to.
|
|
26
26
|
* @param {number} [properties.priority] - The priority of the subscriber. The lower the number, the higher the priority.
|
|
27
27
|
* @returns {ClassDecorator} - A decorator that creates a new subscriber.
|
|
28
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-subscriber/api-function-subscriber | API Reference - ApiFunctionSubscriber}
|
|
28
29
|
*/
|
|
29
30
|
function ApiFunctionSubscriber(properties) {
|
|
30
31
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/function.decorator.ts"],"sourcesContent":[null],"names":["SUBSCRIBER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAKA
|
|
1
|
+
{"version":3,"file":"function.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/function.decorator.ts"],"sourcesContent":[null],"names":["SUBSCRIBER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,qBAAqB,CAA2B,UAA+C,EAAA;IAC9G,OAAO,CAAC,MAAc,KAAI;QACzB,OAAO,CAAC,cAAc,CAACA,qDAAiC,CAAC,qBAAqB,EAAE,UAAU,EAAE,MAAM,CAAC;AACpG,IAAA,CAAC;AACF;;;;"}
|
|
@@ -23,5 +23,6 @@ import type { IApiRouteSubscriberProperties } from '../../../interface/decorator
|
|
|
23
23
|
* @param {E} properties.entity - The entity that the subscriber will listen to.
|
|
24
24
|
* @param {number} [properties.priority] - The priority of the subscriber. The lower the number, the higher the priority.
|
|
25
25
|
* @returns {ClassDecorator} - A decorator that creates a new subscriber.
|
|
26
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-subscriber/api-route-subscriber | API Reference - ApiRouteSubscriber}
|
|
26
27
|
*/
|
|
27
28
|
export declare function ApiRouteSubscriber<E extends IApiBaseEntity>(properties: IApiRouteSubscriberProperties<E>): ClassDecorator;
|
|
@@ -25,6 +25,7 @@ var subscriber_constant = require('../../../constant/decorator/api/subscriber.co
|
|
|
25
25
|
* @param {E} properties.entity - The entity that the subscriber will listen to.
|
|
26
26
|
* @param {number} [properties.priority] - The priority of the subscriber. The lower the number, the higher the priority.
|
|
27
27
|
* @returns {ClassDecorator} - A decorator that creates a new subscriber.
|
|
28
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-subscriber/api-route-subscriber | API Reference - ApiRouteSubscriber}
|
|
28
29
|
*/
|
|
29
30
|
function ApiRouteSubscriber(properties) {
|
|
30
31
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/route.decorator.ts"],"sourcesContent":[null],"names":["SUBSCRIBER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAKA
|
|
1
|
+
{"version":3,"file":"route.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/route.decorator.ts"],"sourcesContent":[null],"names":["SUBSCRIBER_API_DECORATOR_CONSTANT"],"mappings":";;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,kBAAkB,CAA2B,UAA4C,EAAA;IACxG,OAAO,CAAC,MAAc,KAAI;QACzB,OAAO,CAAC,cAAc,CAACA,qDAAiC,CAAC,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC;AACjG,IAAA,CAAC;AACF;;;;"}
|
|
@@ -38,7 +38,6 @@ var applyResult_utility = require('../../utility/authorization/decision/apply-re
|
|
|
38
38
|
var attachResource_utility = require('../../utility/authorization/decision/attach-resource.utility.js');
|
|
39
39
|
var resolveFromRequest_utility = require('../../utility/authorization/decision/resolve-from-request.utility.js');
|
|
40
40
|
var where_utility = require('../../utility/authorization/scope/merge/where.utility.js');
|
|
41
|
-
var analize_utility = require('../../utility/dto/analize.utility.js');
|
|
42
41
|
require('../../constant/utility/dto/constant.js');
|
|
43
42
|
var errorException_utility = require('../../utility/error-exception.utility.js');
|
|
44
43
|
require('../../external/tslib/tslib.es6.js');
|
|
@@ -64,7 +63,6 @@ class ApiControllerFactory {
|
|
|
64
63
|
this.target = target;
|
|
65
64
|
this.properties = properties;
|
|
66
65
|
this.ENTITY = generateEntityInformation_utility.GenerateEntityInformation(properties.entity);
|
|
67
|
-
analize_utility.analyzeEntityMetadata(this.properties.entity);
|
|
68
66
|
if (!this.ENTITY.primaryKey) {
|
|
69
67
|
throw errorException_utility.ErrorException(`Primary key for entity ${this.properties.entity.name ?? "UnknownResource"} not found`);
|
|
70
68
|
}
|