@elsikora/nestjs-crud-automator 1.23.0-dev.1 → 1.24.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/cjs/constant/dto/contextual-manual.constant.d.ts +3 -0
- package/dist/cjs/constant/dto/contextual-manual.constant.js +9 -0
- package/dist/cjs/constant/dto/contextual-manual.constant.js.map +1 -0
- package/dist/cjs/constant/dto/index.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/delete.decorator.js +1 -0
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- 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/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.js +1 -0
- package/dist/cjs/decorator/api/function/get/many.decorator.js.map +1 -1
- 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/property/boolean.decorator.js +10 -3
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +11 -1
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +7 -0
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +19 -2
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +72 -2
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +7 -0
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +7 -0
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service/decorator.js +1 -0
- package/dist/cjs/decorator/api/service/decorator.js.map +1 -1
- package/dist/cjs/enum/utility/dto/manual/property-metadata/decorator.enum.d.ts +9 -0
- package/dist/cjs/enum/utility/dto/manual/property-metadata/decorator.enum.js +13 -0
- package/dist/cjs/enum/utility/dto/manual/property-metadata/decorator.enum.js.map +1 -0
- package/dist/cjs/enum/utility/index.d.ts +1 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interface/decorator/api/controller/properties/route/index.d.ts +1 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/list-response-dto-config.interface.d.ts +5 -0
- package/dist/cjs/interface/decorator/api/controller/properties/route/with/dto.interface.d.ts +6 -1
- package/dist/cjs/type/utility/dto/index.d.ts +1 -0
- package/dist/cjs/type/utility/dto/manual/property-metadata.type.d.ts +31 -0
- package/dist/cjs/utility/api/controller/get/dto.utility.js +56 -3
- package/dist/cjs/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/transform-data.utility.js +1 -0
- package/dist/cjs/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/cjs/utility/apply-auto-dto-response-exposure.utility.d.ts +5 -2
- package/dist/cjs/utility/apply-auto-dto-response-exposure.utility.js +14 -37
- package/dist/cjs/utility/apply-auto-dto-response-exposure.utility.js.map +1 -1
- package/dist/cjs/utility/auto-dto-context-queue.utility.js +0 -17
- package/dist/cjs/utility/auto-dto-context-queue.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js +0 -6
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/core.utility.js +3 -3
- package/dist/cjs/utility/dto/generate/core.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/dynamic.utility.js +3 -3
- package/dist/cjs/utility/dto/generate/dynamic.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate/manual-child.utility.d.ts +20 -0
- package/dist/cjs/utility/dto/generate/manual-child.utility.js +106 -0
- package/dist/cjs/utility/dto/generate/manual-child.utility.js.map +1 -0
- package/dist/cjs/utility/dto/manual/property-metadata.utility.d.ts +16 -0
- package/dist/cjs/utility/dto/manual/property-metadata.utility.js +47 -0
- package/dist/cjs/utility/dto/manual/property-metadata.utility.js.map +1 -0
- package/dist/esm/constant/dto/contextual-manual.constant.d.ts +3 -0
- package/dist/esm/constant/dto/contextual-manual.constant.js +7 -0
- package/dist/esm/constant/dto/contextual-manual.constant.js.map +1 -0
- package/dist/esm/constant/dto/index.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/delete.decorator.js +1 -0
- package/dist/esm/decorator/api/function/delete.decorator.js.map +1 -1
- 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/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.js +1 -0
- package/dist/esm/decorator/api/function/get/many.decorator.js.map +1 -1
- 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/property/boolean.decorator.js +10 -3
- package/dist/esm/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/date.decorator.js +11 -1
- package/dist/esm/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/enum.decorator.js +7 -0
- package/dist/esm/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/number.decorator.js +19 -2
- package/dist/esm/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/object.decorator.js +72 -2
- package/dist/esm/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/string.decorator.js +7 -0
- package/dist/esm/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/decorator/api/property/uuid.decorator.js +7 -0
- package/dist/esm/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/decorator/api/service/decorator.js +1 -0
- package/dist/esm/decorator/api/service/decorator.js.map +1 -1
- package/dist/esm/enum/utility/dto/manual/property-metadata/decorator.enum.d.ts +9 -0
- package/dist/esm/enum/utility/dto/manual/property-metadata/decorator.enum.js +13 -0
- package/dist/esm/enum/utility/dto/manual/property-metadata/decorator.enum.js.map +1 -0
- package/dist/esm/enum/utility/index.d.ts +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interface/decorator/api/controller/properties/route/index.d.ts +1 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/list-response-dto-config.interface.d.ts +5 -0
- package/dist/esm/interface/decorator/api/controller/properties/route/with/dto.interface.d.ts +6 -1
- package/dist/esm/type/utility/dto/index.d.ts +1 -0
- package/dist/esm/type/utility/dto/manual/property-metadata.type.d.ts +31 -0
- package/dist/esm/utility/api/controller/get/dto.utility.js +56 -3
- package/dist/esm/utility/api/controller/get/dto.utility.js.map +1 -1
- package/dist/esm/utility/api/controller/transform-data.utility.js +1 -0
- package/dist/esm/utility/api/controller/transform-data.utility.js.map +1 -1
- package/dist/esm/utility/apply-auto-dto-response-exposure.utility.d.ts +5 -2
- package/dist/esm/utility/apply-auto-dto-response-exposure.utility.js +14 -37
- package/dist/esm/utility/apply-auto-dto-response-exposure.utility.js.map +1 -1
- package/dist/esm/utility/auto-dto-context-queue.utility.js +1 -17
- package/dist/esm/utility/auto-dto-context-queue.utility.js.map +1 -1
- package/dist/esm/utility/dto/build-decorator.utility.js +0 -6
- package/dist/esm/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/core.utility.js +3 -3
- package/dist/esm/utility/dto/generate/core.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/dynamic.utility.js +3 -3
- package/dist/esm/utility/dto/generate/dynamic.utility.js.map +1 -1
- package/dist/esm/utility/dto/generate/manual-child.utility.d.ts +20 -0
- package/dist/esm/utility/dto/generate/manual-child.utility.js +103 -0
- package/dist/esm/utility/dto/generate/manual-child.utility.js.map +1 -0
- package/dist/esm/utility/dto/manual/property-metadata.utility.d.ts +16 -0
- package/dist/esm/utility/dto/manual/property-metadata.utility.js +44 -0
- package/dist/esm/utility/dto/manual/property-metadata.utility.js.map +1 -0
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ import '../../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
13
13
|
import '../../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
14
|
import '../../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
15
|
import '../../../../enum/decorator/api/route-type.enum.js';
|
|
16
|
+
import '../../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
16
17
|
import { EErrorStringAction } from '../../../../enum/utility/error-string/action.enum.js';
|
|
17
18
|
import '../../../../enum/utility/error-string/composite-action.enum.js';
|
|
18
19
|
import '../../../../enum/utility/exception-details-type.enum.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/list.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;AAMG;AACG,SAAU,kBAAkB,CAA2B,UAAqC,EAAA;AACjG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;AAExD,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;AACtF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,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAK,CAAC;AAEnL,YAAA,MAAM,KAAK;QACZ;AAEA,QAAA,aAAa,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAA,+BAAA,EAAkC,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QAC9G,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE5L,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,mBAAmB;AAC5C,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -13,6 +13,7 @@ import '../../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
13
13
|
import '../../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
14
|
import '../../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
15
|
import '../../../../enum/decorator/api/route-type.enum.js';
|
|
16
|
+
import '../../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
16
17
|
import { EErrorStringAction } from '../../../../enum/utility/error-string/action.enum.js';
|
|
17
18
|
import '../../../../enum/utility/error-string/composite-action.enum.js';
|
|
18
19
|
import '../../../../enum/utility/exception-details-type.enum.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"many.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/many.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"many.decorator.js","sources":["../../../../../../../src/decorator/api/function/get/many.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":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ACX,MAAM;YACN,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -13,6 +13,7 @@ import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
13
13
|
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
14
|
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
15
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
16
|
+
import '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
16
17
|
import { EErrorStringAction } from '../../../enum/utility/error-string/action.enum.js';
|
|
17
18
|
import '../../../enum/utility/error-string/composite-action.enum.js';
|
|
18
19
|
import { EApiExceptionDetailsType } from '../../../enum/utility/exception-details-type.enum.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.decorator.js","sources":["../../../../../../src/decorator/api/function/update.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;AAMG;AACG,SAAU,iBAAiB,CAA2B,UAAqC,EAAA;AAChG,IAAA,MAAM,EAAE,MAAM,EAAE,GAA8B,UAAU;IACxD,MAAM,YAAY,GAAiG,cAAc,CAAI,EAAE,MAAM,EAAE,CAAC;AAChJ,IAAA,IAAI,WAAmG;AAEvG,IAAA,OAAO,UAAU,OAAgB,EAAE,YAAoB,EAAE,UAA8B,EAAA;QACtF,UAAU,CAAC,KAAK,GAAG,gBAAqD,QAAuC,EAAE,gBAAiD,EAAE,YAA4B,EAAA;AAC/L,YAAA,MAAM,cAAc,GAAM,IAAI,MAAM,EAAE;AAEtC,YAAA,MAAM,gBAAgB,GAA+E;gBACpG,IAAI,EAAE,EAAE,QAAQ,EAAE,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AM,KAAK;QACZ;AAEA,QAAA,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA,sBAAA,EAAyB,MAAM,CAAC,IAAI,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;QACpG,MAAM,qBAAqB,CAAC,+BAA+B,CAAC,WAAW,EAAE,cAAc,EAAE,gBAAgB,CAAC,MAAM,EAAE,oBAAoB,CAAC,WAAW,EAAE,qBAAqB,EAAE,KAAc,CAAC;AAE1L,QAAA,MAAM,IAAI,4BAA4B,CACrC,WAAW,CAAC;AACX,YAAA,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB,CAAC,cAAc;AACvC,SAAA,CAAC,EACF,EAAE,KAAK,EAAE,WAAW,EAAE,CACtB;IACF;AACD;;;;"}
|
|
@@ -12,9 +12,11 @@ import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
12
12
|
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
13
13
|
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
14
14
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
15
|
+
import { EManualDtoPropertyMetadataDecorator } from '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
15
16
|
import { applyDecorators } from '@nestjs/common';
|
|
16
17
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
17
18
|
import { ApplyAutoDtoResponseExposure } from '../../../utility/apply-auto-dto-response-exposure.utility.js';
|
|
19
|
+
import { RegisterManualDtoPropertyMetadata } from '../../../utility/dto/manual/property-metadata.utility.js';
|
|
18
20
|
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
19
21
|
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
20
22
|
import { Expose, Exclude, Transform } from 'class-transformer';
|
|
@@ -77,6 +79,11 @@ function ApiPropertyBoolean(properties) {
|
|
|
77
79
|
WithResolvedPropertyEntity(properties.entity, "ApiPropertyBoolean", (resolvedEntity) => {
|
|
78
80
|
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
79
81
|
validateOptions(normalizedProperties);
|
|
82
|
+
RegisterManualDtoPropertyMetadata(target, propertyKey, {
|
|
83
|
+
apply: ApiPropertyBoolean(normalizedProperties),
|
|
84
|
+
decorator: EManualDtoPropertyMetadataDecorator.BOOLEAN,
|
|
85
|
+
properties: normalizedProperties,
|
|
86
|
+
});
|
|
80
87
|
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
81
88
|
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
82
89
|
applyDecorators(...decorators)(target, propertyKey);
|
|
@@ -189,12 +196,12 @@ function buildTransformDecorators(properties) {
|
|
|
189
196
|
if (properties.isArray) {
|
|
190
197
|
decorators.push(Transform(({ value }) => {
|
|
191
198
|
if (value === null || value === undefined) {
|
|
192
|
-
return
|
|
199
|
+
return value;
|
|
193
200
|
}
|
|
194
201
|
if (!Array.isArray(value)) {
|
|
195
202
|
const singleValue = value;
|
|
196
203
|
if (singleValue === undefined || singleValue === null)
|
|
197
|
-
return
|
|
204
|
+
return singleValue;
|
|
198
205
|
if (typeof singleValue === "boolean")
|
|
199
206
|
return [singleValue];
|
|
200
207
|
if (typeof singleValue === "number")
|
|
@@ -231,7 +238,7 @@ function buildTransformDecorators(properties) {
|
|
|
231
238
|
else {
|
|
232
239
|
decorators.push(Transform(({ value }) => {
|
|
233
240
|
if (value === undefined || value === null)
|
|
234
|
-
return
|
|
241
|
+
return value;
|
|
235
242
|
if (typeof value === "boolean")
|
|
236
243
|
return value;
|
|
237
244
|
if (typeof value === "number")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean.decorator.js","sources":["../../../../../../src/decorator/api/property/boolean.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"boolean.decorator.js","sources":["../../../../../../src/decorator/api/property/boolean.decorator.ts"],"sourcesContent":[null],"names":[],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sC,EAAA;IAC9D,MAAM,MAAM,GAAkB,EAAE;AAEhC,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;QACtB,MAAM,cAAc,CAAC,CAAA,0BAAA,EAA6B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACvE;AACD;;;;"}
|
|
@@ -12,9 +12,11 @@ import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
12
12
|
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
13
13
|
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
14
14
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
15
|
+
import { EManualDtoPropertyMetadataDecorator } from '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
15
16
|
import { applyDecorators } from '@nestjs/common';
|
|
16
17
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
17
18
|
import { ApplyAutoDtoResponseExposure } from '../../../utility/apply-auto-dto-response-exposure.utility.js';
|
|
19
|
+
import { RegisterManualDtoPropertyMetadata } from '../../../utility/dto/manual/property-metadata.utility.js';
|
|
18
20
|
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
19
21
|
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
20
22
|
import { Expose, Exclude, Transform } from 'class-transformer';
|
|
@@ -81,6 +83,11 @@ function ApiPropertyDate(properties) {
|
|
|
81
83
|
WithResolvedPropertyEntity(properties.entity, "ApiPropertyDate", (resolvedEntity) => {
|
|
82
84
|
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
83
85
|
validateOptions(normalizedProperties);
|
|
86
|
+
RegisterManualDtoPropertyMetadata(target, propertyKey, {
|
|
87
|
+
apply: ApiPropertyDate(normalizedProperties),
|
|
88
|
+
decorator: EManualDtoPropertyMetadataDecorator.DATE,
|
|
89
|
+
properties: normalizedProperties,
|
|
90
|
+
});
|
|
84
91
|
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
85
92
|
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
86
93
|
applyDecorators(...decorators)(target, propertyKey);
|
|
@@ -206,9 +213,12 @@ function buildTransformDecorators(properties) {
|
|
|
206
213
|
if (!properties.isResponse) {
|
|
207
214
|
if (properties.isArray) {
|
|
208
215
|
decorators.push(Transform(({ value }) => {
|
|
216
|
+
if (value === undefined || value === null) {
|
|
217
|
+
return value;
|
|
218
|
+
}
|
|
209
219
|
if (!Array.isArray(value)) {
|
|
210
220
|
const singleValue = value;
|
|
211
|
-
return singleValue ? [new Date(singleValue)] :
|
|
221
|
+
return singleValue ? [new Date(singleValue)] : undefined;
|
|
212
222
|
}
|
|
213
223
|
return value.map((dateString) => (dateString ? new Date(dateString) : undefined));
|
|
214
224
|
}, { toClassOnly: true }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.decorator.js","sources":["../../../../../../src/decorator/api/property/date.decorator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date.decorator.js","sources":["../../../../../../src/decor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C5B,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;QACtB,MAAM,cAAc,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACpE;AACD;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { EManualDtoPropertyMetadataDecorator } from '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
1
2
|
import { applyDecorators } from '@nestjs/common';
|
|
2
3
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
3
4
|
import { ApplyAutoDtoResponseExposure } from '../../../utility/apply-auto-dto-response-exposure.utility.js';
|
|
5
|
+
import { RegisterManualDtoPropertyMetadata } from '../../../utility/dto/manual/property-metadata.utility.js';
|
|
4
6
|
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
5
7
|
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
6
8
|
import { Expose, Exclude } from 'class-transformer';
|
|
@@ -86,6 +88,11 @@ function ApiPropertyEnum(properties) {
|
|
|
86
88
|
WithResolvedPropertyEntity(properties.entity, "ApiPropertyEnum", (resolvedEntity) => {
|
|
87
89
|
const normalizedProperties = { ...properties, entity: resolvedEntity };
|
|
88
90
|
validateOptions(normalizedProperties);
|
|
91
|
+
RegisterManualDtoPropertyMetadata(target, propertyKey, {
|
|
92
|
+
apply: ApiPropertyEnum(normalizedProperties),
|
|
93
|
+
decorator: EManualDtoPropertyMetadataDecorator.ENUM,
|
|
94
|
+
properties: normalizedProperties,
|
|
95
|
+
});
|
|
89
96
|
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
90
97
|
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
91
98
|
applyDecorators(...decorators)(target, propertyKey);
|
|
@@ -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":";;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0EG;AACG,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7D,0BAA0B,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;AACrC,YAAA,iCAAiC,CAAC,MAAM,EAAE,WAAW,EAAE;AACtD,gBAAA,KAAK,EAAE,eAAe,CAAC,oBAAoB,CAAC;gBAC5C,SAAS,EAAE,mCAAmC,CAAC,IAAI;AACnD,gBAAA,UAAU,EAAE,oBAAoB;AAChC,aAAA,CAAC;AAEF,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;AACnD,YAAA,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,oBAAoB,CAAC;AACxE,QAAA,CAAC,CAAC;AACH,IAAA,CAAC;AACF;AAEA;;;;;AAKG;AACH,SA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AAC,UAAU,CAAC,YAAY,CAAC,EAAE;AACjG,QAAA,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC;IAC/C;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,MAAM,cAAc,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACpE;AACD;;;;"}
|
|
@@ -13,9 +13,11 @@ import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
13
13
|
import { EApiPropertyNumberType } from '../../../enum/decorator/api/property/number-type.enum.js';
|
|
14
14
|
import '../../../enum/decorator/api/property/string-type.enum.js';
|
|
15
15
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
16
|
+
import { EManualDtoPropertyMetadataDecorator } from '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
16
17
|
import { applyDecorators } from '@nestjs/common';
|
|
17
18
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
18
19
|
import { ApplyAutoDtoResponseExposure } from '../../../utility/apply-auto-dto-response-exposure.utility.js';
|
|
20
|
+
import { RegisterManualDtoPropertyMetadata } from '../../../utility/dto/manual/property-metadata.utility.js';
|
|
19
21
|
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
20
22
|
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
21
23
|
import { Expose, Exclude, Type, Transform } from 'class-transformer';
|
|
@@ -98,6 +100,11 @@ function ApiPropertyNumber(properties) {
|
|
|
98
100
|
};
|
|
99
101
|
normalizedProperties.exampleValue ??= random(normalizedProperties.minimum, normalizedProperties.maximum);
|
|
100
102
|
validateOptions(normalizedProperties);
|
|
103
|
+
RegisterManualDtoPropertyMetadata(target, propertyKey, {
|
|
104
|
+
apply: ApiPropertyNumber(normalizedProperties),
|
|
105
|
+
decorator: EManualDtoPropertyMetadataDecorator.NUMBER,
|
|
106
|
+
properties: normalizedProperties,
|
|
107
|
+
});
|
|
101
108
|
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
102
109
|
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
103
110
|
applyDecorators(...decorators)(target, propertyKey);
|
|
@@ -252,10 +259,20 @@ function buildTransformDecorators(properties) {
|
|
|
252
259
|
const decorators = [];
|
|
253
260
|
if (!properties.isResponse) {
|
|
254
261
|
if (properties.isArray) {
|
|
255
|
-
decorators.push(Transform(({ value }) =>
|
|
262
|
+
decorators.push(Transform(({ value }) => {
|
|
263
|
+
if (value === undefined || value === null) {
|
|
264
|
+
return value;
|
|
265
|
+
}
|
|
266
|
+
return value.map(Number);
|
|
267
|
+
}, { toClassOnly: true }));
|
|
256
268
|
}
|
|
257
269
|
else {
|
|
258
|
-
decorators.push(Transform(({ value }) =>
|
|
270
|
+
decorators.push(Transform(({ value }) => {
|
|
271
|
+
if (value === undefined || value === null) {
|
|
272
|
+
return value;
|
|
273
|
+
}
|
|
274
|
+
return Number(value);
|
|
275
|
+
}, { toClassOnly: true }));
|
|
259
276
|
}
|
|
260
277
|
}
|
|
261
278
|
return decorators;
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAA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AC;QAC/E;IACD;AAEA,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACtB,MAAM,cAAc,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACtE;AACD;;;;"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { EManualDtoPropertyMetadataDecorator } from '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
1
2
|
import { applyDecorators } from '@nestjs/common';
|
|
2
3
|
import { getSchemaPath, ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
3
4
|
import { ApplyAutoDtoResponseExposure } from '../../../utility/apply-auto-dto-response-exposure.utility.js';
|
|
5
|
+
import { CamelCaseString } from '../../../utility/camel-case-string.utility.js';
|
|
6
|
+
import { DtoGenerateContextualManualDto } from '../../../utility/dto/generate/manual-child.utility.js';
|
|
7
|
+
import { RegisterManualDtoPropertyMetadata } from '../../../utility/dto/manual/property-metadata.utility.js';
|
|
4
8
|
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
9
|
+
import { GetAutoDtoContext } from '../../../utility/get/auto-dto-context.utility.js';
|
|
5
10
|
import { RegisterAutoDtoChild } from '../../../utility/register-auto-dto-child.utility.js';
|
|
6
11
|
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
7
12
|
import { MustMatchOneOfSchemasValidator } from '../../../validator/must-match-one-of-schemas.validator.js';
|
|
@@ -37,10 +42,15 @@ import { IsOptional, IsArray, ArrayMinSize, ArrayMaxSize, ArrayNotEmpty, Validat
|
|
|
37
42
|
*/
|
|
38
43
|
function ApiPropertyObject(options) {
|
|
39
44
|
return (target, propertyKey) => {
|
|
40
|
-
RegisterAutoDtoChild(target, options.type);
|
|
41
45
|
WithResolvedPropertyEntity(options.entity, "ApiPropertyObject", (resolvedEntity) => {
|
|
42
|
-
const normalizedOptions = { ...options, entity: resolvedEntity };
|
|
46
|
+
const normalizedOptions = resolveContextualObjectOptions(target, propertyKey, { ...options, entity: resolvedEntity });
|
|
47
|
+
RegisterAutoDtoChild(target, normalizedOptions.type);
|
|
43
48
|
validateOptions(normalizedOptions);
|
|
49
|
+
RegisterManualDtoPropertyMetadata(target, propertyKey, {
|
|
50
|
+
apply: ApiPropertyObject(normalizedOptions),
|
|
51
|
+
decorator: EManualDtoPropertyMetadataDecorator.OBJECT,
|
|
52
|
+
properties: normalizedOptions,
|
|
53
|
+
});
|
|
44
54
|
const apiPropertyOptions = buildApiPropertyOptions(normalizedOptions);
|
|
45
55
|
const decorators = buildDecorators(normalizedOptions, apiPropertyOptions);
|
|
46
56
|
applyDecorators(...decorators)(target, propertyKey);
|
|
@@ -227,6 +237,66 @@ function buildTransformDecorators(properties) {
|
|
|
227
237
|
}
|
|
228
238
|
return decorators;
|
|
229
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Replaces manual nested DTO references with context-specific generated wrappers when the property
|
|
242
|
+
* is applied inside an auto-generated DTO scope.
|
|
243
|
+
* @param {object} target - Decorated DTO prototype.
|
|
244
|
+
* @param {string | symbol} propertyKey - Decorated property key.
|
|
245
|
+
* @param {TApiPropertyObjectProperties} properties - Normalized object property options.
|
|
246
|
+
* @returns {TApiPropertyObjectProperties} Contextualized object property options.
|
|
247
|
+
*/
|
|
248
|
+
function resolveContextualObjectOptions(target, propertyKey, properties) {
|
|
249
|
+
const context = GetAutoDtoContext(target);
|
|
250
|
+
const parentDtoName = target.constructor?.name;
|
|
251
|
+
if (!context || !parentDtoName || ("isDynamicallyGenerated" in properties && properties.isDynamicallyGenerated)) {
|
|
252
|
+
return properties;
|
|
253
|
+
}
|
|
254
|
+
if (Array.isArray(properties.type)) {
|
|
255
|
+
const resolvedTypes = properties.type.map((type) => {
|
|
256
|
+
const variantName = properties.discriminator ? Object.entries(properties.discriminator.mapping).find(([, value]) => value === type)?.[0] : undefined;
|
|
257
|
+
return resolveContextualObjectType(type, context.method, context.dtoType, parentDtoName, propertyKey, variantName);
|
|
258
|
+
});
|
|
259
|
+
if (!properties.discriminator) {
|
|
260
|
+
return {
|
|
261
|
+
...properties,
|
|
262
|
+
type: resolvedTypes,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const resolvedMapping = Object.fromEntries(Object.entries(properties.discriminator.mapping).map(([key, value]) => {
|
|
266
|
+
return [key, resolveContextualObjectType(value, context.method, context.dtoType, parentDtoName, propertyKey, key)];
|
|
267
|
+
}));
|
|
268
|
+
return {
|
|
269
|
+
...properties,
|
|
270
|
+
discriminator: {
|
|
271
|
+
...properties.discriminator,
|
|
272
|
+
mapping: resolvedMapping,
|
|
273
|
+
},
|
|
274
|
+
type: resolvedTypes,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
const resolvedType = properties.type ? resolveContextualObjectType(properties.type, context.method, context.dtoType, parentDtoName, propertyKey) : properties.type;
|
|
278
|
+
return {
|
|
279
|
+
...properties,
|
|
280
|
+
type: resolvedType,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Generates a contextual wrapper for a nested manual DTO type when possible.
|
|
285
|
+
* @param {Type<unknown>} type - Original nested DTO type.
|
|
286
|
+
* @param {string} method - Auto DTO route method.
|
|
287
|
+
* @param {string} dtoType - Auto DTO type.
|
|
288
|
+
* @param {string} parentDtoName - Parent generated DTO class name.
|
|
289
|
+
* @param {string | symbol} propertyKey - Current property key.
|
|
290
|
+
* @param {string} [variantName] - Optional discriminator variant suffix.
|
|
291
|
+
* @returns {Type<unknown>} Contextualized nested DTO type.
|
|
292
|
+
*/
|
|
293
|
+
function resolveContextualObjectType(type, method, dtoType, parentDtoName, propertyKey, variantName) {
|
|
294
|
+
if (type === Object) {
|
|
295
|
+
return type;
|
|
296
|
+
}
|
|
297
|
+
const propertyPathSegment = variantName ? `${String(propertyKey)}${CamelCaseString(variantName)}` : String(propertyKey);
|
|
298
|
+
return DtoGenerateContextualManualDto(type, method, dtoType, parentDtoName, propertyPathSegment);
|
|
299
|
+
}
|
|
230
300
|
/**
|
|
231
301
|
* Validates the configuration options for the API property object.
|
|
232
302
|
* Throws an error if the configuration is invalid.
|
|
@@ -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":";;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACG,SAAU,iBAAiB,CAAC,OAAqC,EAAA;AACtE,IAAA,OAAO,CAAC,MAAc,EAAE,WAA4B,KAAU;QAC7D,0BAA0B,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,cAAyD,KAAI;AAC7H,YAAA,MAAM,iBAAiB,GAAiC,8BAA8B,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AAEnJ,YAAA,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,CAAC,IAAI,CAAC;YAEpD,eAAe,CAAC,iBAAiB,CAAC;AAClC,YAAA,iCAAiC,CAAC,MAAM,EAAE,WAAW,EAAE;AACtD,gBAAA,KAAK,EAAE,iBAAiB,CAAC,iBAAiB,CAAC;gBAC3C,SAAS,EAAE,mCAAmC,CAAC,MAAM;AACrD,gBAAA,UAAU,EAAE,iBAAiB;AAC7B,aAAA,CAAC;AAEF,YAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,iBAAiB,CAAC;YACzF,MAAM,UAAU,GAA6B,eAAe,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;YAEnG,eAAe,CAAC,GAAG,UAAU,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC;AACnD,YAAA,4BAA4B,CAAC,MAAM,EAAE,WAAW,EAAE,iBAAiB,C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AAC,+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;QACtB,MAAM,cAAc,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IACtE;AACD;;;;"}
|
|
@@ -14,9 +14,11 @@ import '../../../enum/decorator/api/property/desribe-type.enum.js';
|
|
|
14
14
|
import '../../../enum/decorator/api/property/number-type.enum.js';
|
|
15
15
|
import { EApiPropertyStringType } from '../../../enum/decorator/api/property/string-type.enum.js';
|
|
16
16
|
import '../../../enum/decorator/api/route-type.enum.js';
|
|
17
|
+
import { EManualDtoPropertyMetadataDecorator } from '../../../enum/utility/dto/manual/property-metadata/decorator.enum.js';
|
|
17
18
|
import { applyDecorators } from '@nestjs/common';
|
|
18
19
|
import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger';
|
|
19
20
|
import { ApplyAutoDtoResponseExposure } from '../../../utility/apply-auto-dto-response-exposure.utility.js';
|
|
21
|
+
import { RegisterManualDtoPropertyMetadata } from '../../../utility/dto/manual/property-metadata.utility.js';
|
|
20
22
|
import { ErrorException } from '../../../utility/error/exception.utility.js';
|
|
21
23
|
import { WithResolvedPropertyEntity } from '../../../utility/with-resolved-property-entity.utility.js';
|
|
22
24
|
import { IsRegularExpressionValidator } from '../../../validator/is-regular-expression.validator.js';
|
|
@@ -99,6 +101,11 @@ function ApiPropertyString(properties) {
|
|
|
99
101
|
entity: resolvedEntity,
|
|
100
102
|
};
|
|
101
103
|
validateOptions(normalizedProperties);
|
|
104
|
+
RegisterManualDtoPropertyMetadata(target, propertyKey, {
|
|
105
|
+
apply: ApiPropertyString(normalizedProperties),
|
|
106
|
+
decorator: EManualDtoPropertyMetadataDecorator.STRING,
|
|
107
|
+
properties: normalizedProperties,
|
|
108
|
+
});
|
|
102
109
|
const apiPropertyOptions = buildApiPropertyOptions(normalizedProperties);
|
|
103
110
|
const decorators = buildDecorators(normalizedProperties, apiPropertyOptions);
|
|
104
111
|
applyDecorators(...decorators)(target, propertyKey);
|