@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
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { applyDecorators } from '@nestjs/common';
|
|
2
2
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
3
|
+
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
3
4
|
import { Expose, Exclude } from 'class-transformer';
|
|
4
|
-
import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty
|
|
5
|
+
import { IsEnum, IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty } from 'class-validator';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Creates a decorator that applies NestJS Swagger and class-validator/class-transformer decorators
|
|
@@ -20,6 +21,7 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, IsEnum
|
|
|
20
21
|
* that only valid options are accepted in requests and properly documented in the API.
|
|
21
22
|
* @param {TApiPropertyEnumProperties} properties - Configuration options for the enum property
|
|
22
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-enum | API Reference - ApiPropertyEnum}
|
|
23
25
|
* @example
|
|
24
26
|
* ```typescript
|
|
25
27
|
* // String enum example
|
|
@@ -78,10 +80,15 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, IsEnum
|
|
|
78
80
|
* ```
|
|
79
81
|
*/
|
|
80
82
|
function ApiPropertyEnum(properties) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
return (target, propertyKey) => {
|
|
84
|
+
WithResolvedPropertyEntity(properties.entity, "ApiPropertyEnum", (resolvedEntity) => {
|
|
85
|
+
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
86
|
+
validateOptions(normalizedProperties);
|
|
87
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
88
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
89
|
+
applyDecorators(...decorators)(target, propertyKey);
|
|
90
|
+
});
|
|
91
|
+
};
|
|
85
92
|
}
|
|
86
93
|
/**
|
|
87
94
|
* 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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enum.decorator.js","sources":["../../../../../../src/decorator/api/property/enum.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7D,0BA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U,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;IAEA,IAAI,UAAU,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;AACjG,QAAA,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC;IAC/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
|
|
@@ -15,8 +15,9 @@ import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
|
15
15
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
16
16
|
import { applyDecorators } from '@nestjs/common';
|
|
17
17
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
19
|
+
import { Type, Expose, Exclude, Transform } from 'class-transformer';
|
|
20
|
+
import { IsInt, IsNumber, IsDivisibleBy, Min, Max, IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, isInt } from 'class-validator';
|
|
20
21
|
import random from 'lodash/random';
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -36,6 +37,7 @@ import random from 'lodash/random';
|
|
|
36
37
|
* if one is not provided, and applies appropriate validation rules based on the configuration.
|
|
37
38
|
* @param {TApiPropertyNumberProperties} properties - Configuration options for the number property
|
|
38
39
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
40
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-number | API Reference - ApiPropertyNumber}
|
|
39
41
|
* @example
|
|
40
42
|
* ```typescript
|
|
41
43
|
* // Simple integer property
|
|
@@ -86,11 +88,19 @@ import random from 'lodash/random';
|
|
|
86
88
|
* ```
|
|
87
89
|
*/
|
|
88
90
|
function ApiPropertyNumber(properties) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
return (target, propertyKey) => {
|
|
92
|
+
WithResolvedPropertyEntity(properties.entity, "ApiPropertyNumber", (resolvedEntity) => {
|
|
93
|
+
const normalizedProperties = {
|
|
94
|
+
...properties,
|
|
95
|
+
entity: resolvedEntity,
|
|
96
|
+
};
|
|
97
|
+
normalizedProperties.exampleValue ??= random(normalizedProperties.minimum, normalizedProperties.maximum);
|
|
98
|
+
validateOptions(normalizedProperties);
|
|
99
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
100
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
101
|
+
applyDecorators(...decorators)(target, propertyKey);
|
|
102
|
+
});
|
|
103
|
+
};
|
|
94
104
|
}
|
|
95
105
|
/**
|
|
96
106
|
* 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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"number.decorator.js","sources":["../../../../../../src/decorator/api/property/number.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEG;AACG,SAAU,iBAAiB,CAAC,UAAwC,EAAA;AACzE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7D,0BAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,cAAyD,KAAI;AAChI,YAAA,MAAM,oBAAoB,GAAiC;AAC1D,gBAAA,GAAG,UAAU;AACb,gBAAA,MAAM,EAAE,cAAc;aACtB;AAED,YAAA,oBAAoB,CAAC,YAAY,KAAK,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC;YAExG,eAAe,CAAC,oBAAoB,CAAC;AAErC,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,oBAAoB,CAAC;YAC5F,MAAM,UAAU,GAA6B,eAAe,CAAC,oBAAoB,EAAE,kBAAkB,CAAC;YAEtG,eAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;AACpD,QAAA,CAAC,CAAC;AACH,IAAA,CAAC;AACF;AAEA;;;;;;;AAOG;AACH,SAAS,uBAAuB,CAAC,UAAwC,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAA,EAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAA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C;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;;;;"}
|
|
@@ -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 {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { applyDecorators } from '@nestjs/common';
|
|
2
2
|
import { getSchemaPath, ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
3
|
+
import { RegisterAutoDtoChild } from '../../../utility/register-auto-dto-child.utility.js';
|
|
4
|
+
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
3
5
|
import { MustMatchOneOfSchemasValidator } from '../../../validator/must-match-one-of-schemas.validator.js';
|
|
4
6
|
import { Expose, Exclude, Type } from 'class-transformer';
|
|
5
|
-
import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty
|
|
7
|
+
import { ValidateNested, IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty } from 'class-validator';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Creates a decorator that applies NestJS Swagger and class-validator/class-transformer decorators
|
|
@@ -17,6 +19,7 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, Validat
|
|
|
17
19
|
* - Transformation rules
|
|
18
20
|
* @param {TApiPropertyObjectProperties} options - Configuration options for the object property
|
|
19
21
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
22
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-object | API Reference - ApiPropertyObject}
|
|
20
23
|
* @example
|
|
21
24
|
* ```typescript
|
|
22
25
|
* class UserDto {
|
|
@@ -31,10 +34,16 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, Validat
|
|
|
31
34
|
* ```
|
|
32
35
|
*/
|
|
33
36
|
function ApiPropertyObject(options) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
return (target, propertyKey) => {
|
|
38
|
+
RegisterAutoDtoChild(target, options.type);
|
|
39
|
+
WithResolvedPropertyEntity(options.entity, "ApiPropertyObject", (resolvedEntity) => {
|
|
40
|
+
const normalizedOptions = { ...options, entity: resolvedEntity };
|
|
41
|
+
validateOptions(normalizedOptions);
|
|
42
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedOptions);
|
|
43
|
+
const decorators = buildDecorators(normalizedOptions, apiPropertyOptions);
|
|
44
|
+
applyDecorators(...decorators)(target, propertyKey);
|
|
45
|
+
});
|
|
46
|
+
};
|
|
38
47
|
}
|
|
39
48
|
/**
|
|
40
49
|
* 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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"object.decorator.js","sources":["../../../../../../src/decorator/api/property/object.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,SA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../../../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
|
|
@@ -16,9 +16,10 @@ import { EApiPropertyStringType } from '../../../enum/decorator/api/property/str
|
|
|
16
16
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
17
17
|
import { applyDecorators } from '@nestjs/common';
|
|
18
18
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
19
|
+
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
19
20
|
import { IsRegularExpressionValidator } from '../../../validator/is-regular-expression.validator.js';
|
|
20
|
-
import { Expose, Exclude
|
|
21
|
-
import {
|
|
21
|
+
import { Type, Expose, Exclude } from 'class-transformer';
|
|
22
|
+
import { IsUUID, IsUrl, IsString, IsUppercase, IsTimeZone, IsSemVer, IsRgbColor, Validate, IsPostalCode, IsPhoneNumber, IsStrongPassword, IsMongoId, IsMimeType, IsMACAddress, IsLowercase, IsLocale, IsJWT, IsISBN, IsIP, IsIBAN, IsHSL, IsHexColor, IsHash, IsEthereumAddress, IsEmail, IsFQDN, IsDate, IsDataURI, IsISO4217CurrencyCode, IsCreditCard, IsISO31661Alpha3, IsISO31661Alpha2, IsBtcAddress, IsBase64, IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, Matches, Length } from 'class-validator';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Creates a decorator that applies NestJS Swagger and class-validator/class-transformer decorators
|
|
@@ -36,6 +37,7 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, IsUUID,
|
|
|
36
37
|
* The decorator applies appropriate validation rules based on the format and configuration.
|
|
37
38
|
* @param {TApiPropertyStringProperties} properties - Configuration options for the string property
|
|
38
39
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
40
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-string | API Reference - ApiPropertyString}
|
|
39
41
|
* @example
|
|
40
42
|
* ```typescript
|
|
41
43
|
* // Simple string property
|
|
@@ -88,10 +90,18 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, IsUUID,
|
|
|
88
90
|
* ```
|
|
89
91
|
*/
|
|
90
92
|
function ApiPropertyString(properties) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
return (target, propertyKey) => {
|
|
94
|
+
WithResolvedPropertyEntity(properties.entity, "ApiPropertyString", (resolvedEntity) => {
|
|
95
|
+
const normalizedProperties = {
|
|
96
|
+
...properties,
|
|
97
|
+
entity: resolvedEntity,
|
|
98
|
+
};
|
|
99
|
+
validateOptions(normalizedProperties);
|
|
100
|
+
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
101
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
102
|
+
applyDecorators(...decorators)(target, propertyKey);
|
|
103
|
+
});
|
|
104
|
+
};
|
|
95
105
|
}
|
|
96
106
|
/**
|
|
97
107
|
* Builds the API property options object from the provided property configuration.
|
|
@@ -485,7 +495,7 @@ function validateOptions(properties) {
|
|
|
485
495
|
}
|
|
486
496
|
}
|
|
487
497
|
else if (!regex.test(properties.exampleValue)) {
|
|
488
|
-
errors.push("RegExp 'pattern' does not match '
|
|
498
|
+
errors.push("RegExp 'pattern' does not match 'exampleValue' string: " + properties.exampleValue);
|
|
489
499
|
}
|
|
490
500
|
}
|
|
491
501
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.decorator.js","sources":["../../../../../../src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C,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;;;;"}
|
|
1
|
+
{"version":3,"file":"string.decorator.js","sources":["../../../../../../src/decorator/api/property/string.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEG;AACG,SAAU,iBAAiB,CAAC,UAAwC,EAAA;AACzE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7D,0BAA0B,CAAC,UAAU,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,cAAyD,KAAI;AAChI,YAAA,MAAM,oBAAoB,GAAiC;AAC1D,gBAAA,GAAG,UAAU;AACb,gBAAA,MAAM,EAAE,cAAc;aACtB;YAED,eAAe,CAAC,oBAAoB,CAAC;AAErC,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,oBAAoB,CAAC;YAC5F,MAAM,U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AG,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
|
|
@@ -15,8 +15,9 @@ import { EApiPropertyStringType } from '../../../enum/decorator/api/property/str
|
|
|
15
15
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
16
16
|
import { applyDecorators } from '@nestjs/common';
|
|
17
17
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
18
|
+
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
18
19
|
import { Expose, Exclude } from 'class-transformer';
|
|
19
|
-
import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty
|
|
20
|
+
import { IsUUID, IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty } from 'class-validator';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Creates a decorator that applies NestJS Swagger and class-validator/class-transformer decorators
|
|
@@ -33,6 +34,7 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, IsUUID
|
|
|
33
34
|
* applies appropriate validation rules based on the configuration.
|
|
34
35
|
* @param {TApiPropertyUuidProperties} properties - Configuration options for the UUID property
|
|
35
36
|
* @returns {Function} A decorator function that can be applied to a class property
|
|
37
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-property/api-property-uuid | API Reference - ApiPropertyUUID}
|
|
36
38
|
* @example
|
|
37
39
|
* ```typescript
|
|
38
40
|
* // Single UUID property
|
|
@@ -60,11 +62,16 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, IsUUID
|
|
|
60
62
|
* ```
|
|
61
63
|
*/
|
|
62
64
|
function ApiPropertyUUID(properties) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
return (target, propertyKey) => {
|
|
66
|
+
WithResolvedPropertyEntity(properties.entity, "ApiPropertyUUID", (resolvedEntity) => {
|
|
67
|
+
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
68
|
+
const uuidExample = randomUUID();
|
|
69
|
+
validateOptions(normalizedProperties);
|
|
70
|
+
const apiPropertyOptions = buildApiPropertyOptions(uuidExample, normalizedProperties);
|
|
71
|
+
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
72
|
+
applyDecorators(...decorators)(target, propertyKey);
|
|
73
|
+
});
|
|
74
|
+
};
|
|
68
75
|
}
|
|
69
76
|
/**
|
|
70
77
|
* 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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uuid.decorator.js","sources":["../../../../../../src/decorator/api/property/uuid.decorator.ts"],"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;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,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,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;
|
|
@@ -4,6 +4,7 @@ import { SERVICE_API_DECORATOR_CONSTANT } from '../../../constant/decorator/api/
|
|
|
4
4
|
* Decorator that marks a service as observable, allowing it to be monitored by subscribers.
|
|
5
5
|
* When a service is marked as observable, its methods can be intercepted by subscribers that listen for specific events.
|
|
6
6
|
* @returns {ClassDecorator} A class decorator that enables service observability.
|
|
7
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-service/api-service-observable | API Reference - ApiServiceObservable}
|
|
7
8
|
*/
|
|
8
9
|
function ApiServiceObservable() {
|
|
9
10
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable.decorator.js","sources":["../../../../../../src/decorator/api/service/observable.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA
|
|
1
|
+
{"version":3,"file":"observable.decorator.js","sources":["../../../../../../src/decorator/api/service/observable.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;AAKG;SACa,oBAAoB,GAAA;IACnC,OAAO,CAAC,MAAc,KAAI;QACzB,OAAO,CAAC,cAAc,CAAC,8BAA8B,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;
|
|
@@ -24,7 +24,7 @@ import '../../enum/decorator/api/route-type.enum.js';
|
|
|
24
24
|
* @param {TApiServiceProperties<E>} properties - Configuration properties for the service
|
|
25
25
|
* @returns {Function} A class decorator function that extends the target class with CRUD methods
|
|
26
26
|
* @template E - The entity type
|
|
27
|
-
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators
|
|
27
|
+
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/api-reference/decorators/api-service/api-service | API Reference - ApiService}
|
|
28
28
|
* @see {@link https://elsikora.com/docs/nestjs-crud-automator/core-concepts/services | Core Concepts - Services}
|
|
29
29
|
*/
|
|
30
30
|
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;
|
|
@@ -23,6 +23,7 @@ import { SUBSCRIBER_API_DECORATOR_CONSTANT } from '../../../constant/decorator/a
|
|
|
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
|
function ApiFunctionSubscriber(properties) {
|
|
28
29
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/function.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA
|
|
1
|
+
{"version":3,"file":"function.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/function.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,qBAAqB,CAA2B,UAA+C,EAAA;IAC9G,OAAO,CAAC,MAAc,KAAI;QACzB,OAAO,CAAC,cAAc,CAAC,iCAAiC,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;
|
|
@@ -23,6 +23,7 @@ import { SUBSCRIBER_API_DECORATOR_CONSTANT } from '../../../constant/decorator/a
|
|
|
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
|
function ApiRouteSubscriber(properties) {
|
|
28
29
|
return (target) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/route.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA
|
|
1
|
+
{"version":3,"file":"route.decorator.js","sources":["../../../../../../src/decorator/api/subscriber/route.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,kBAAkB,CAA2B,UAA4C,EAAA;IACxG,OAAO,CAAC,MAAc,KAAI;QACzB,OAAO,CAAC,cAAc,CAAC,iCAAiC,CAAC,kBAAkB,EAAE,UAAU,EAAE,MAAM,CAAC;AACjG,IAAA,CAAC;AACF;;;;"}
|
|
@@ -36,7 +36,6 @@ import { AuthorizationDecisionApplyResult } from '../../utility/authorization/de
|
|
|
36
36
|
import { AuthorizationDecisionAttachResource } from '../../utility/authorization/decision/attach-resource.utility.js';
|
|
37
37
|
import { AuthorizationDecisionResolveFromRequest } from '../../utility/authorization/decision/resolve-from-request.utility.js';
|
|
38
38
|
import { AuthorizationScopeMergeWhere } from '../../utility/authorization/scope/merge/where.utility.js';
|
|
39
|
-
import { analyzeEntityMetadata } from '../../utility/dto/analize.utility.js';
|
|
40
39
|
import '../../constant/utility/dto/constant.js';
|
|
41
40
|
import { ErrorException } from '../../utility/error-exception.utility.js';
|
|
42
41
|
import '../../external/tslib/tslib.es6.js';
|
|
@@ -62,7 +61,6 @@ class ApiControllerFactory {
|
|
|
62
61
|
this.target = target;
|
|
63
62
|
this.properties = properties;
|
|
64
63
|
this.ENTITY = GenerateEntityInformation(properties.entity);
|
|
65
|
-
analyzeEntityMetadata(this.properties.entity);
|
|
66
64
|
if (!this.ENTITY.primaryKey) {
|
|
67
65
|
throw ErrorException(`Primary key for entity ${this.properties.entity.name ?? "UnknownResource"} not found`);
|
|
68
66
|
}
|