@elsikora/nestjs-crud-automator 1.7.0-dev.1 → 1.8.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 +272 -226
- package/dist/cjs/class/api/service-base.class.d.ts +7 -6
- package/dist/cjs/class/api/service-base.class.js +7 -6
- package/dist/cjs/class/api/service-base.class.js.map +1 -1
- package/dist/cjs/class/metadata-storage.class.js +2 -0
- package/dist/cjs/class/metadata-storage.class.js.map +1 -1
- package/dist/cjs/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/cjs/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/cjs/constant/number.constant.js +1 -0
- package/dist/cjs/constant/number.constant.js.map +1 -1
- package/dist/cjs/decorator/api/controller.decorator.js +2 -0
- package/dist/cjs/decorator/api/controller.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/create.decorator.js +8 -3
- package/dist/cjs/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/decorator.js +2 -0
- package/dist/cjs/decorator/api/function/decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/delete.decorator.js +8 -3
- package/dist/cjs/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-list.decorator.js +16 -4
- package/dist/cjs/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get-many.decorator.js +12 -4
- package/dist/cjs/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/get.decorator.js +12 -4
- package/dist/cjs/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/function/update.decorator.js +9 -4
- package/dist/cjs/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/method.decorator.js +2 -0
- package/dist/cjs/decorator/api/method.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/boolean.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/date.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/enum.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/number.decorator.js +4 -0
- package/dist/cjs/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/object.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/string.decorator.js +21 -3
- package/dist/cjs/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/property/uuid.decorator.js +2 -0
- package/dist/cjs/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/cjs/decorator/api/service.decorator.js +55 -12
- package/dist/cjs/decorator/api/service.decorator.js.map +1 -1
- package/dist/cjs/factory/api/controller.factory.js +13 -0
- package/dist/cjs/factory/api/controller.factory.js.map +1 -1
- package/dist/cjs/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/delete-executor-properties.interface.d.ts +3 -2
- package/dist/cjs/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/cjs/interface/decorator/api/function/update-executor-properties.interface.d.ts +3 -2
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js +5 -0
- package/dist/cjs/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js +2 -0
- package/dist/cjs/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js +2 -0
- package/dist/cjs/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js +3 -0
- package/dist/cjs/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js +2 -0
- package/dist/cjs/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/cjs/utility/dto/build-decorator.utility.js +1 -0
- package/dist/cjs/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js +2 -0
- package/dist/cjs/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/cjs/utility/dto/generate.utility.js +17 -0
- package/dist/cjs/utility/dto/generate.utility.js.map +1 -1
- package/dist/cjs/utility/dto/get-decorator-config.utility.js +1 -0
- package/dist/cjs/utility/dto/get-decorator-config.utility.js.map +1 -1
- package/dist/cjs/utility/dto/validate-property-config.utility.js +1 -0
- package/dist/cjs/utility/dto/validate-property-config.utility.js.map +1 -1
- package/dist/cjs/utility/generate-entity-information.utility.js +5 -0
- package/dist/cjs/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/cjs/utility/get-entity-columns.utility.js +1 -0
- package/dist/cjs/utility/get-entity-columns.utility.js.map +1 -1
- package/dist/cjs/utility/is-error-of-type.utility.js +2 -0
- package/dist/cjs/utility/is-error-of-type.utility.js.map +1 -1
- package/dist/cjs/utility/logger.utility.d.ts +9 -0
- package/dist/cjs/utility/logger.utility.js +11 -0
- package/dist/cjs/utility/logger.utility.js.map +1 -1
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/cjs/validator/has-at-least-one-property.validator.js +1 -0
- package/dist/cjs/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js +6 -0
- package/dist/cjs/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js +1 -0
- package/dist/cjs/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/class/api/service-base.class.d.ts +7 -6
- package/dist/esm/interface/decorator/api/function/create-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/delete-executor-properties.interface.d.ts +3 -2
- package/dist/esm/interface/decorator/api/function/get-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-list-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/get-many-executor-properties.interface.d.ts +2 -1
- package/dist/esm/interface/decorator/api/function/update-executor-properties.interface.d.ts +3 -2
- package/dist/esm/src/class/api/service-base.class.js +7 -6
- package/dist/esm/src/class/api/service-base.class.js.map +1 -1
- package/dist/esm/src/class/metadata-storage.class.js +2 -0
- package/dist/esm/src/class/metadata-storage.class.js.map +1 -1
- package/dist/esm/src/class/utility/dto/strategy/request.class.js +1 -0
- package/dist/esm/src/class/utility/dto/strategy/request.class.js.map +1 -1
- package/dist/esm/src/constant/number.constant.js +1 -0
- package/dist/esm/src/constant/number.constant.js.map +1 -1
- package/dist/esm/src/decorator/api/controller.decorator.js +2 -0
- package/dist/esm/src/decorator/api/controller.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/create.decorator.js +8 -3
- package/dist/esm/src/decorator/api/function/create.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/decorator.js +2 -0
- package/dist/esm/src/decorator/api/function/decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/delete.decorator.js +8 -3
- package/dist/esm/src/decorator/api/function/delete.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/get-list.decorator.js +16 -4
- package/dist/esm/src/decorator/api/function/get-list.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/get-many.decorator.js +12 -4
- package/dist/esm/src/decorator/api/function/get-many.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/get.decorator.js +12 -4
- package/dist/esm/src/decorator/api/function/get.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/function/update.decorator.js +9 -4
- package/dist/esm/src/decorator/api/function/update.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/method.decorator.js +2 -0
- package/dist/esm/src/decorator/api/method.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/boolean.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/boolean.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/date.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/date.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/enum.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/enum.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/number.decorator.js +4 -0
- package/dist/esm/src/decorator/api/property/number.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/object.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/object.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/string.decorator.js +21 -3
- package/dist/esm/src/decorator/api/property/string.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/property/uuid.decorator.js +2 -0
- package/dist/esm/src/decorator/api/property/uuid.decorator.js.map +1 -1
- package/dist/esm/src/decorator/api/service.decorator.js +55 -12
- package/dist/esm/src/decorator/api/service.decorator.js.map +1 -1
- package/dist/esm/src/factory/api/controller.factory.js +13 -0
- package/dist/esm/src/factory/api/controller.factory.js.map +1 -1
- package/dist/esm/src/utility/api/controller/get-list/transform-filter.utility.js +5 -0
- package/dist/esm/src/utility/api/controller/get-list/transform-filter.utility.js.map +1 -1
- package/dist/esm/src/utility/api/controller/get-list/transform-operation.utility.js +2 -0
- package/dist/esm/src/utility/api/controller/get-list/transform-operation.utility.js.map +1 -1
- package/dist/esm/src/utility/api/controller/handle-request-relations.utility.js +2 -0
- package/dist/esm/src/utility/api/controller/handle-request-relations.utility.js.map +1 -1
- package/dist/esm/src/utility/api/controller/write-dto-swagger.utility.js +3 -0
- package/dist/esm/src/utility/api/controller/write-dto-swagger.utility.js.map +1 -1
- package/dist/esm/src/utility/api/filter-order-by-from-entity.utility.js +2 -0
- package/dist/esm/src/utility/api/filter-order-by-from-entity.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/build-decorator.utility.js +1 -0
- package/dist/esm/src/utility/dto/build-decorator.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/generate-filter-decorator.utility.js +2 -0
- package/dist/esm/src/utility/dto/generate-filter-decorator.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/generate.utility.js +17 -0
- package/dist/esm/src/utility/dto/generate.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/get-decorator-config.utility.js +1 -0
- package/dist/esm/src/utility/dto/get-decorator-config.utility.js.map +1 -1
- package/dist/esm/src/utility/dto/validate-property-config.utility.js +1 -0
- package/dist/esm/src/utility/dto/validate-property-config.utility.js.map +1 -1
- package/dist/esm/src/utility/generate-entity-information.utility.js +5 -0
- package/dist/esm/src/utility/generate-entity-information.utility.js.map +1 -1
- package/dist/esm/src/utility/get-entity-columns.utility.js +1 -0
- package/dist/esm/src/utility/get-entity-columns.utility.js.map +1 -1
- package/dist/esm/src/utility/is-error-of-type.utility.js +2 -0
- package/dist/esm/src/utility/is-error-of-type.utility.js.map +1 -1
- package/dist/esm/src/utility/logger.utility.js +11 -0
- package/dist/esm/src/utility/logger.utility.js.map +1 -1
- package/dist/esm/src/validator/all-or-none-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/all-or-none-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/src/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/has-at-least-one-and-only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/src/validator/has-at-least-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/has-at-least-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/src/validator/has-at-least-one-property.validator.js +1 -0
- package/dist/esm/src/validator/has-at-least-one-property.validator.js.map +1 -1
- package/dist/esm/src/validator/has-paired-custom-suffixes-fields.validator.js +6 -0
- package/dist/esm/src/validator/has-paired-custom-suffixes-fields.validator.js.map +1 -1
- package/dist/esm/src/validator/only-one-of-listed-properties.validator.js +1 -0
- package/dist/esm/src/validator/only-one-of-listed-properties.validator.js.map +1 -1
- package/dist/esm/utility/logger.utility.d.ts +9 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.decorator.js","sources":["../../../../../../src/decorator/api/property/date.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","EApiPropertyDataType","ApiProperty","IsDate","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","EApiPropertyDateIdentifier","EApiPropertyDateType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWM,SAAU,eAAe,CAAC,UAAsC,EAAA;IACrE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAsC,EAAA;IACtE,MAAM,OAAO,GAAW,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;AAErD,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAE,CAAA
|
|
1
|
+
{"version":3,"file":"date.decorator.js","sources":["../../../../../../src/decorator/api/property/date.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","EApiPropertyDataType","ApiProperty","IsDate","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Transform","EApiPropertyDateIdentifier","EApiPropertyDateType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWM,SAAU,eAAe,CAAC,UAAsC,EAAA;IACrE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAsC,EAAA;IACtE,MAAM,OAAO,GAAW,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;AAErD,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAE,CAAA;;QAEzF,QAAQ,EAAE,UAAU,CAAC,UAAU;QAC/B,IAAI,EAAEC,kCAAoB,CAAC,MAAM;KACjC;IAED,kBAAkB,CAAC,QAAQ,GAAG,UAAU,CAAC,UAAU,KAAK,KAAK,IAAI,UAAU,CAAC,UAAU,KAAK,SAAS,GAAG,UAAU,CAAC,UAAU,GAAG,KAAK;AAEpI,IAAA,IAAI,UAAU,CAAC,OAAO,EAAE;AACvB,QAAA,kBAAkB,CAAC,OAAO,GAAG,IAAI;AACjC,QAAA,kBAAkB,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ;AACjD,QAAA,kBAAkB,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ;AACjD,QAAA,kBAAkB,CAAC,WAA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O,8BAA8B;;;AAGxC;AAEA,SAAS,eAAe,CAAC,UAAsC,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;;AAGrD,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;;AAGzC,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;;QAGzC,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;;;AAIhF,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAA,CAAC;;AAEhE;;;;"}
|
|
@@ -14,6 +14,7 @@ function ApiPropertyEnum(properties) {
|
|
|
14
14
|
function buildApiPropertyOptions(properties) {
|
|
15
15
|
const apiPropertyOptions = {
|
|
16
16
|
description: `${String(properties.entity.name)} ${properties.description ?? ""}`,
|
|
17
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
17
18
|
nullable: properties.isNullable,
|
|
18
19
|
};
|
|
19
20
|
apiPropertyOptions.required = properties.isResponse === false || properties.isResponse === undefined ? properties.isRequired : false;
|
|
@@ -46,6 +47,7 @@ function buildDecorators(properties, apiPropertyOptions) {
|
|
|
46
47
|
function buildFormatDecorators(properties) {
|
|
47
48
|
const decorators = [];
|
|
48
49
|
const isArray = properties.isArray ?? false;
|
|
50
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
49
51
|
decorators.push(classValidator.IsEnum(properties.enum, { each: isArray }));
|
|
50
52
|
return decorators;
|
|
51
53
|
}
|
|
@@ -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":";;;;;;;AASM,SAAU,eAAe,CAAC,UAAsC,EAAA;IACrE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAsC,EAAA;AACtE,IAAA,MAAM,kBAAkB,GAA6C;AACpE,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,CAAE,CAAA
|
|
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":";;;;;;;AASM,SAAU,eAAe,CAAC,UAAsC,EAAA;IACrE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBA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AAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAA,CAAC;;AAEhE;;;;"}
|
|
@@ -37,6 +37,7 @@ function buildApiPropertyOptions(properties) {
|
|
|
37
37
|
const apiPropertyOptions = {
|
|
38
38
|
description: `${String(properties.entity.name)} ${properties.description ?? ""}`,
|
|
39
39
|
format: getFormat(properties),
|
|
40
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
40
41
|
nullable: properties.isNullable,
|
|
41
42
|
type: getType(properties),
|
|
42
43
|
};
|
|
@@ -69,10 +70,12 @@ function buildFormatDecorators(properties) {
|
|
|
69
70
|
if (properties.isResponse === undefined || !properties.isResponse) {
|
|
70
71
|
switch (properties.format) {
|
|
71
72
|
case numberType_enum.EApiPropertyNumberType.DOUBLE: {
|
|
73
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
72
74
|
decorators.push(classValidator.IsNumber({}, { each: isArray }));
|
|
73
75
|
break;
|
|
74
76
|
}
|
|
75
77
|
case numberType_enum.EApiPropertyNumberType.INTEGER: {
|
|
78
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
76
79
|
decorators.push(classValidator.IsInt({ each: isArray }));
|
|
77
80
|
break;
|
|
78
81
|
}
|
|
@@ -88,6 +91,7 @@ function buildNumberValidationDecorators(properties) {
|
|
|
88
91
|
const decorators = [];
|
|
89
92
|
const isArray = properties.isArray ?? false;
|
|
90
93
|
if ((properties.isResponse === false || properties.isResponse === undefined) && properties.multipleOf !== undefined) {
|
|
94
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
91
95
|
decorators.push(classValidator.IsDivisibleBy(properties.multipleOf, { each: isArray }), classValidator.Min(properties.minimum, { each: isArray }), classValidator.Max(properties.maximum, { each: isArray }));
|
|
92
96
|
}
|
|
93
97
|
return decorators;
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,iBAAiB,CAAC,UAAwC,EAAA;AACzE,IAAA,IAAI,UAAU,CAAC,YAAY,KAAK,SAAS,EAAE;AAC1C,QAAA,UAAU,CAAC,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;;IAGzE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAwC,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,CAAE,CAAA;AAChF,QAAA,MAAM,EAAE,SAAS,CAAC,UAAU,CAAC
|
|
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","EAp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QAChC,IAAI,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,EAAE;AAC9C,YAAA,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC;;AAGrD,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;;AAGzC,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;;QAGzC,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;;;AAIhF,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAA,CAAC;;AAElE;;;;"}
|
|
@@ -14,6 +14,7 @@ function ApiPropertyObject(options) {
|
|
|
14
14
|
function buildApiPropertyOptions(properties) {
|
|
15
15
|
const apiPropertyOptions = {
|
|
16
16
|
description: `${String(properties.entity.name)} ${properties.description ?? ""}`,
|
|
17
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
17
18
|
nullable: properties.isNullable,
|
|
18
19
|
type: properties.type,
|
|
19
20
|
};
|
|
@@ -39,6 +40,7 @@ function buildObjectValidationDecorators(properties) {
|
|
|
39
40
|
const decorators = [];
|
|
40
41
|
const isArray = properties.isArray ?? false;
|
|
41
42
|
if (!properties.isResponse && properties.shouldValidateNested) {
|
|
43
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
42
44
|
decorators.push(classValidator.ValidateNested({ each: isArray }));
|
|
43
45
|
}
|
|
44
46
|
return decorators;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.decorator.js","sources":["../../../../../../src/decorator/api/property/object.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","ApiProperty","ValidateNested","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Type"],"mappings":";;;;;;;AASM,SAAU,iBAAiB,CAAC,OAAqC,EAAA;IACtE,eAAe,CAAC,OAAO,CAAC;AAExB,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,OAAO,CAAC;IAC/E,MAAM,UAAU,GAA6B,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC;AAEzF,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAwC,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,CAAE,CAAA
|
|
1
|
+
{"version":3,"file":"object.decorator.js","sources":["../../../../../../src/decorator/api/property/object.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","ApiProperty","ValidateNested","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Type"],"mappings":";;;;;;;AASM,SAAU,iBAAiB,CAAC,OAAqC,EAAA;IACtE,eAAe,CAAC,OAAO,CAAC;AAExB,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,OAAO,CAAC;IAC/E,MAAM,UAAU,GAA6B,eAAe,CAAC,OAAO,EAAE,kBAAkB,CAAC;AAEzF,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAwC,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAA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const apiPropertyOptions = {
|
|
40
40
|
description: `${String(properties.entity.name)} ${properties.description ?? ""}`,
|
|
41
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
41
42
|
nullable: properties.isNullable,
|
|
42
43
|
type: dataType_enum.EApiPropertyDataType.STRING,
|
|
43
44
|
};
|
|
@@ -73,45 +74,60 @@ function buildFormatDecorators(properties) {
|
|
|
73
74
|
if (properties.isResponse === undefined || !properties.isResponse) {
|
|
74
75
|
switch (properties.format) {
|
|
75
76
|
case stringType_enum.EApiPropertyStringType.DATE: {
|
|
76
|
-
decorators.push(
|
|
77
|
+
decorators.push(
|
|
78
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
79
|
+
classValidator.IsDate({ each: isArray }), classTransformer.Type(() => Date));
|
|
77
80
|
break;
|
|
78
81
|
}
|
|
79
82
|
case stringType_enum.EApiPropertyStringType.EMAIL: {
|
|
83
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
80
84
|
decorators.push(classValidator.IsEmail({}, { each: isArray }));
|
|
81
85
|
break;
|
|
82
86
|
}
|
|
83
87
|
case stringType_enum.EApiPropertyStringType.IP: {
|
|
88
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
84
89
|
decorators.push(classValidator.IsIP(string_constant.STRING_PROPERTY_API_INTERFACE_CONSTANT.IP_VERSION, { each: isArray }));
|
|
85
90
|
break;
|
|
86
91
|
}
|
|
87
92
|
case stringType_enum.EApiPropertyStringType.LOWERCASE_STRING: {
|
|
93
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
88
94
|
decorators.push(classValidator.IsString({ each: isArray }), classValidator.IsLowercase({ each: isArray }));
|
|
89
95
|
break;
|
|
90
96
|
}
|
|
91
97
|
case stringType_enum.EApiPropertyStringType.REGEXP: {
|
|
92
98
|
decorators.push(classValidator.Validate(isRegularExpression_validator.IsRegularExpression, {
|
|
99
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
93
100
|
each: isArray,
|
|
94
101
|
message: `${String(properties.description)} must be valid regular expression string`,
|
|
95
|
-
}),
|
|
102
|
+
}),
|
|
103
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
104
|
+
classValidator.Matches(new RegExp(properties.pattern.slice(1, -1)), { each: isArray }), classTransformer.Type(() => RegExp));
|
|
96
105
|
break;
|
|
97
106
|
}
|
|
98
107
|
case stringType_enum.EApiPropertyStringType.STRING: {
|
|
108
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
99
109
|
decorators.push(classValidator.IsString({ each: isArray }));
|
|
100
110
|
break;
|
|
101
111
|
}
|
|
102
112
|
case stringType_enum.EApiPropertyStringType.UPPERCASE_STRING: {
|
|
113
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
103
114
|
decorators.push(classValidator.IsString({ each: isArray }), classValidator.IsUppercase({ each: isArray }));
|
|
104
115
|
break;
|
|
105
116
|
}
|
|
106
117
|
case stringType_enum.EApiPropertyStringType.URL: {
|
|
107
118
|
decorators.push(classValidator.IsUrl({
|
|
108
119
|
protocols: ["https", "http"],
|
|
120
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
109
121
|
require_host: true,
|
|
122
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
110
123
|
require_protocol: true,
|
|
111
|
-
},
|
|
124
|
+
},
|
|
125
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
126
|
+
{ each: isArray }));
|
|
112
127
|
break;
|
|
113
128
|
}
|
|
114
129
|
case stringType_enum.EApiPropertyStringType.UUID: {
|
|
130
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
115
131
|
decorators.push(classValidator.IsUUID("all", { each: isArray }));
|
|
116
132
|
break;
|
|
117
133
|
}
|
|
@@ -154,7 +170,9 @@ function buildStringValidationDecorators(properties) {
|
|
|
154
170
|
const decorators = [];
|
|
155
171
|
const isArray = properties.isArray ?? false;
|
|
156
172
|
if (properties.isResponse === false || properties.isResponse === undefined) {
|
|
173
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
157
174
|
classValidator.Matches(new RegExp(properties.pattern.slice(1, -1)), { each: isArray });
|
|
175
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
158
176
|
classValidator.Length(properties.minLength, properties.maxLength, { each: isArray });
|
|
159
177
|
}
|
|
160
178
|
return decorators;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.decorator.js","sources":["../../../../../../src/decorator/api/property/string.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","EApiPropertyDataType","ApiProperty","EApiPropertyStringType","IsDate","Type","IsEmail","IsIP","STRING_PROPERTY_API_INTERFACE_CONSTANT","IsString","IsLowercase","Validate","IsRegularExpression","Matches","IsUppercase","IsUrl","IsUUID","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,iBAAiB,CAAC,UAAwC,EAAA;IACzE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAwC,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAA6C;AACpE,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,CAAE,CAAA
|
|
1
|
+
{"version":3,"file":"string.decorator.js","sources":["../../../../../../src/decorator/api/property/string.decorator.ts"],"sourcesContent":[null],"names":["applyDecorators","EApiPropertyDataType","ApiProperty","EApiPropertyStringType","IsDate","Type","IsEmail","IsIP","STRING_PROPERTY_API_INTERFACE_CONSTANT","IsString","IsLowercase","Validate","IsRegularExpression","Matches","IsUppercase","IsUrl","IsUUID","IsOptional","IsArray","ArrayMinSize","ArrayMaxSize","ArrayNotEmpty","ApiResponseProperty","Expose","Exclude","Length"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,iBAAiB,CAAC,UAAwC,EAAA;IACzE,eAAe,CAAC,UAAU,CAAC;AAE3B,IAAA,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,UAAU,CAAC;IAClF,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOA,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,UAAwC,EAAA;AACxE,IAAA,MAAM,kBAAkB,GAA6C;AACpE,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,EAAE,CAAE,CAAA;;QAEhF,QAAQ,EAAE,UAAU,CAAC,UAAU;QAC/B,IAAI,EAAEC,kCAAoB,CAAC,MAAM;KACjC;IAED,kBAAkB,CAAC,QAAQ,GAAG,UAAU,CAAC,UAAU,KAAK,KAAK,IAAI,UAAU,CAAC,UAAU,KAAK,SAAS,GAAG,UAAU,CAAC,UAAU,GAAG,KAAK;AAEpI,IAAA,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI,EAAE;AAChC,QAAA,kBAAkB,CAAC,OAAO,GAAG,IAAI;AACjC,QAAA,kBAAkB,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ;AACjD,QAAA,kBAAkB,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ;AACjD,QAAA,kBAAkB,CAAC,WAAW,GAAG,UAAU,CAAC,aAAa;QACzD,kBAAkB,CAAC,KAAK,GAAG;YAC1B,SAAS,EAA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AI,CAAC,2BAA2B,CAAC;;QAGzC,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;;;AAIhF,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,yBAAA,EAA4B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAA,CAAC;;AAElE;;;;"}
|
|
@@ -32,6 +32,7 @@ function ApiPropertyUUID(properties) {
|
|
|
32
32
|
function buildApiPropertyOptions(uuidExample, properties) {
|
|
33
33
|
const apiPropertyOptions = {
|
|
34
34
|
description: `${String(properties.entity.name)} ${properties.description ?? "identifier"}`,
|
|
35
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
35
36
|
nullable: properties.isNullable,
|
|
36
37
|
type: dataType_enum.EApiPropertyDataType.STRING,
|
|
37
38
|
};
|
|
@@ -64,6 +65,7 @@ function buildDecorators(properties, apiPropertyOptions) {
|
|
|
64
65
|
function buildFormatDecorators(properties) {
|
|
65
66
|
const decorators = [];
|
|
66
67
|
const isArray = properties.isArray ?? false;
|
|
68
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
67
69
|
decorators.push(classValidator.IsUUID(undefined, { each: isArray }));
|
|
68
70
|
return decorators;
|
|
69
71
|
}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,MAAM,WAAW,GAAWA,sBAAU,EAAE;IAExC,eAAe,CAAC,UAAU,CAAC;IAE3B,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,WAAW,EAAE,UAAU,CAAC;IAC/F,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOC,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,WAAmB,EAAE,UAAsC,EAAA;AAC3F,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,YAAY,CAAE,CAAA
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;AAaM,SAAU,eAAe,CAAC,UAAsC,EAAA;AACrE,IAAA,MAAM,WAAW,GAAWA,sBAAU,EAAE;IAExC,eAAe,CAAC,UAAU,CAAC;IAE3B,MAAM,kBAAkB,GAAuB,uBAAuB,CAAC,WAAW,EAAE,UAAU,CAAC;IAC/F,MAAM,UAAU,GAA6B,eAAe,CAAC,UAAU,EAAE,kBAAkB,CAAC;AAE5F,IAAA,OAAOC,sBAAe,CAAC,GAAG,UAAU,CAAC;AACtC;AAEA,SAAS,uBAAuB,CAAC,WAAmB,EAAE,UAAsC,EAAA;AAC3F,IAAA,MAAM,kBAAkB,GAAuB;AAC9C,QAAA,WAAW,EAAE,CAAG,EAAA,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,WAAW,IAAI,Y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ACnB;AACN,YAAA,UAAU,CAAC,IAAI,CAACC,wBAAO,EAAE,CAAC;;;AAI5B,IAAA,OAAO,UAAU;AAClB;AAEA,SAAS,eAAe,CAAC,UAAsC,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;;AAGrD,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;;AAGzC,QAAA,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE;AAC5B,YAAA,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC;;QAGzC,IAAI,UAAU,CAAC,aAAa,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,EAAE;AACzD,YAAA,MAAM,CAAC,IAAI,CAAC,iEAAiE,CAAC;;;AAIhF,IAAA,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AACtB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,uBAAA,EAA0B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAA,CAAC;;AAEhE;;;;"}
|
|
@@ -26,130 +26,173 @@ function ApiService(properties) {
|
|
|
26
26
|
const originalConstructor = target;
|
|
27
27
|
const ExtendedClass = class extends originalConstructor {
|
|
28
28
|
constructor(..._arguments) {
|
|
29
|
+
// eslint-disable-next-line @elsikora/typescript/no-unsafe-argument
|
|
29
30
|
super(..._arguments);
|
|
30
31
|
if (!Object.prototype.hasOwnProperty.call(this, type_enum.EApiFunctionType.GET_LIST)) {
|
|
31
32
|
Object.defineProperty(this, type_enum.EApiFunctionType.GET_LIST, {
|
|
33
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
32
34
|
configurable: true,
|
|
35
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
33
36
|
enumerable: true,
|
|
34
|
-
value: async function (properties, relations) {
|
|
37
|
+
value: async function (properties, relations, eventManager) {
|
|
35
38
|
const apiFunctionDecorator = decorator.ApiFunction({
|
|
36
39
|
entity,
|
|
37
40
|
type: type_enum.EApiFunctionType.GET_LIST,
|
|
38
41
|
});
|
|
39
42
|
const descriptor = {
|
|
43
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
40
44
|
configurable: true,
|
|
45
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
41
46
|
enumerable: true,
|
|
47
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-functions
|
|
42
48
|
value: () => void 0,
|
|
49
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
43
50
|
writable: true,
|
|
44
51
|
};
|
|
45
52
|
const decoratedDescriptor = apiFunctionDecorator(this, type_enum.EApiFunctionType.GET_LIST, descriptor);
|
|
46
|
-
return decoratedDescriptor.value.call(this, properties);
|
|
53
|
+
return decoratedDescriptor.value.call(this, properties, relations, eventManager);
|
|
47
54
|
},
|
|
55
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
48
56
|
writable: true,
|
|
49
57
|
});
|
|
50
58
|
}
|
|
51
59
|
if (!Object.prototype.hasOwnProperty.call(this, type_enum.EApiFunctionType.GET)) {
|
|
52
60
|
Object.defineProperty(this, type_enum.EApiFunctionType.GET, {
|
|
61
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
53
62
|
configurable: true,
|
|
63
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
54
64
|
enumerable: true,
|
|
55
|
-
value: async function (properties) {
|
|
65
|
+
value: async function (properties, eventManager) {
|
|
56
66
|
const apiFunctionDecorator = decorator.ApiFunction({
|
|
57
67
|
entity,
|
|
58
68
|
type: type_enum.EApiFunctionType.GET,
|
|
59
69
|
});
|
|
60
70
|
const descriptor = {
|
|
71
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
61
72
|
configurable: true,
|
|
73
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
62
74
|
enumerable: true,
|
|
75
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-functions
|
|
63
76
|
value: () => void 0,
|
|
77
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
64
78
|
writable: true,
|
|
65
79
|
};
|
|
66
80
|
const decoratedDescriptor = apiFunctionDecorator(this, type_enum.EApiFunctionType.GET, descriptor);
|
|
67
|
-
return decoratedDescriptor.value.call(this, properties);
|
|
81
|
+
return decoratedDescriptor.value.call(this, properties, eventManager);
|
|
68
82
|
},
|
|
83
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
69
84
|
writable: true,
|
|
70
85
|
});
|
|
71
86
|
}
|
|
72
87
|
if (!Object.prototype.hasOwnProperty.call(this, type_enum.EApiFunctionType.GET_MANY)) {
|
|
73
88
|
Object.defineProperty(this, type_enum.EApiFunctionType.GET_MANY, {
|
|
89
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
74
90
|
configurable: true,
|
|
91
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
75
92
|
enumerable: true,
|
|
76
|
-
value: async function (properties) {
|
|
93
|
+
value: async function (properties, eventManager) {
|
|
77
94
|
const apiFunctionDecorator = decorator.ApiFunction({
|
|
78
95
|
entity,
|
|
79
96
|
type: type_enum.EApiFunctionType.GET_MANY,
|
|
80
97
|
});
|
|
81
98
|
const descriptor = {
|
|
99
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
82
100
|
configurable: true,
|
|
101
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
83
102
|
enumerable: true,
|
|
103
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-functions
|
|
84
104
|
value: () => void 0,
|
|
105
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
85
106
|
writable: true,
|
|
86
107
|
};
|
|
87
108
|
const decoratedDescriptor = apiFunctionDecorator(this, type_enum.EApiFunctionType.GET_MANY, descriptor);
|
|
88
|
-
return decoratedDescriptor.value.call(this, properties);
|
|
109
|
+
return decoratedDescriptor.value.call(this, properties, eventManager);
|
|
89
110
|
},
|
|
111
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
90
112
|
writable: true,
|
|
91
113
|
});
|
|
92
114
|
}
|
|
93
115
|
if (!Object.prototype.hasOwnProperty.call(this, type_enum.EApiFunctionType.CREATE)) {
|
|
94
116
|
Object.defineProperty(this, type_enum.EApiFunctionType.CREATE, {
|
|
117
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
95
118
|
configurable: true,
|
|
119
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
96
120
|
enumerable: true,
|
|
97
|
-
value: async function (properties) {
|
|
121
|
+
value: async function (properties, eventManager) {
|
|
98
122
|
const apiFunctionDecorator = decorator.ApiFunction({
|
|
99
123
|
entity,
|
|
100
124
|
type: type_enum.EApiFunctionType.CREATE,
|
|
101
125
|
});
|
|
102
126
|
const descriptor = {
|
|
127
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
103
128
|
configurable: true,
|
|
129
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
104
130
|
enumerable: true,
|
|
131
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-functions
|
|
105
132
|
value: () => void 0,
|
|
133
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
106
134
|
writable: true,
|
|
107
135
|
};
|
|
108
136
|
const decoratedDescriptor = apiFunctionDecorator(this, type_enum.EApiFunctionType.CREATE, descriptor);
|
|
109
|
-
return decoratedDescriptor.value.call(this, properties);
|
|
137
|
+
return decoratedDescriptor.value.call(this, properties, eventManager);
|
|
110
138
|
},
|
|
139
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
111
140
|
writable: true,
|
|
112
141
|
});
|
|
113
142
|
}
|
|
114
143
|
if (!Object.prototype.hasOwnProperty.call(this, type_enum.EApiFunctionType.UPDATE)) {
|
|
115
144
|
Object.defineProperty(this, type_enum.EApiFunctionType.UPDATE, {
|
|
145
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
116
146
|
configurable: true,
|
|
147
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
117
148
|
enumerable: true,
|
|
118
|
-
value: async function (criteria, properties) {
|
|
149
|
+
value: async function (criteria, properties, eventManager) {
|
|
119
150
|
const apiFunctionDecorator = decorator.ApiFunction({
|
|
120
151
|
entity,
|
|
121
152
|
type: type_enum.EApiFunctionType.UPDATE,
|
|
122
153
|
});
|
|
123
154
|
const descriptor = {
|
|
155
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
124
156
|
configurable: true,
|
|
157
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
125
158
|
enumerable: true,
|
|
159
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-functions
|
|
126
160
|
value: () => void 0,
|
|
161
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
127
162
|
writable: true,
|
|
128
163
|
};
|
|
129
164
|
const decoratedDescriptor = apiFunctionDecorator(this, type_enum.EApiFunctionType.UPDATE, descriptor);
|
|
130
|
-
return decoratedDescriptor.value.call(this, criteria, properties);
|
|
165
|
+
return decoratedDescriptor.value.call(this, criteria, properties, eventManager);
|
|
131
166
|
},
|
|
167
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
132
168
|
writable: true,
|
|
133
169
|
});
|
|
134
170
|
}
|
|
135
171
|
if (!Object.prototype.hasOwnProperty.call(this, type_enum.EApiFunctionType.DELETE)) {
|
|
136
172
|
Object.defineProperty(this, type_enum.EApiFunctionType.DELETE, {
|
|
173
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
137
174
|
configurable: true,
|
|
175
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
138
176
|
enumerable: true,
|
|
139
|
-
value: async function (criteria) {
|
|
177
|
+
value: async function (criteria, eventManager) {
|
|
140
178
|
const apiFunctionDecorator = decorator.ApiFunction({
|
|
141
179
|
entity,
|
|
142
180
|
type: type_enum.EApiFunctionType.DELETE,
|
|
143
181
|
});
|
|
144
182
|
const descriptor = {
|
|
183
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
145
184
|
configurable: true,
|
|
185
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
146
186
|
enumerable: true,
|
|
187
|
+
// eslint-disable-next-line @elsikora/sonar/no-nested-functions
|
|
147
188
|
value: () => void 0,
|
|
189
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
148
190
|
writable: true,
|
|
149
191
|
};
|
|
150
192
|
const decoratedDescriptor = apiFunctionDecorator(this, type_enum.EApiFunctionType.DELETE, descriptor);
|
|
151
|
-
return decoratedDescriptor.value.call(this, criteria);
|
|
193
|
+
return decoratedDescriptor.value.call(this, criteria, eventManager);
|
|
152
194
|
},
|
|
195
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
153
196
|
writable: true,
|
|
154
197
|
});
|
|
155
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.decorator.js","sources":["../../../../../src/decorator/api/service.decorator.ts"],"sourcesContent":[null],"names":["EApiFunctionType","ApiFunction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASM,SAAU,UAAU,CAA2B,UAAoC,EAAA;AACxF,IAAA,MAAM,EAAE,MAAM,EAAE,GAA6B,UAAU;AAEvD,IAAA,OAAO,UAAuE,MAAiB,EAAA;QAC9F,MAAM,mBAAmB,GAAc,MAAM;AAE7C,QAAA,MAAM,aAAa,GAAmE,cAAc,mBAAmB,CAAA;AACtH,YAAA,WAAA,CAAY,GAAG,UAAsB,EAAA
|
|
1
|
+
{"version":3,"file":"service.decorator.js","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;oBACzE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAEA,0BAAgB,CAAC,MAAM,EAAE;;AAEpD,wBAAA,YAAY,EAAE,IAAI;;AAElB,wBAAA,UAAU,EAAE,IAAI;AAChB,wBAAA,KAAK,EAAE,gBAAgB,QAAuC,EAAE,YAA4B,EAAA;4BAC3F,MAAM,oBAAoB,GAAkGC,qBAAW,CAAC;gCACvI,MAAM;gCACN,IAAI,EAAED,0BAAgB,CAAC,MAAM;AAC7B,6BAAA,CAAC;AAEF,4BAAA,MAAM,UAAU,GAQZ;;AAEH,gCAAA,YAAY,EAAE,IAAI;;AAElB,gCAAA,UAAU,EAAE,IAAI;;AAEhB,gCAAA,KAAK,EAAE,MAAM,MAAM;;AAEnB,gCAAA,QAAQ,EAAE,IAAI;6BACd;AAED,4BAAA,MAAM,mBAAmB,GAAuB,oBAAoB,CAAC,IAAI,EAAEA,0BAAgB,CAAC,MAAM,EAAE,UAAU,CAAC;AAE/G,4BAAA,OAAQ,mBAAmB,CAAC,KAA6G,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC;yBAC5K;;AAED,wBAAA,QAAQ,EAAE,IAAI;AACd,qBAAA,CAAC;;;SAGJ;AAED,QAAA,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,mBAAmB,CAAC;AAEzD,QAAA,OAAO,aAA0B;AAClC,KAAC;AACF;;;;"}
|
|
@@ -78,6 +78,13 @@ class ApiControllerFactory {
|
|
|
78
78
|
applyMetadata_utility.ApiControllerApplyMetadata(this.target, this.targetPrototype, this.ENTITY, this.properties, method, methodName, routeConfig);
|
|
79
79
|
applyDecorators_utility.ApiControllerApplyDecorators(targetMethod, this.ENTITY, this.properties, method, methodName, routeConfig, routeDecorators);
|
|
80
80
|
writeDtoSwagger_utility.ApiControllerWriteDtoSwagger(this.target, this.ENTITY, this.properties, method, routeConfig, this.ENTITY);
|
|
81
|
+
// Reflect.defineMetadata(PARAMTYPES_METADATA, [routeConfig.dto.request], this.target, methodNameOnController);
|
|
82
|
+
// Reflect.defineMetadata(PATH_METADATA, `:${this.ENTITY.name}`, this.target, methodNameOnController);
|
|
83
|
+
/* const dtoProperties: Record<string, unknown> = (Reflect.getMetadata(DECORATORS.API_MODEL_PROPERTIES, routeConfig.dto.request) || {}) as Record<string, unknown>;
|
|
84
|
+
const dtoPropertiesArray: Array<unknown> = (Reflect.getMetadata(DECORATORS.API_MODEL_PROPERTIES_ARRAY, routeConfig.dto.request) || []) as Array<unknown>;
|
|
85
|
+
|
|
86
|
+
Reflect.defineMetadata(DECORATORS.API_MODEL_PROPERTIES, dtoProperties, routeConfig.dto.request);
|
|
87
|
+
Reflect.defineMetadata(DECORATORS.API_MODEL_PROPERTIES_ARRAY, dtoPropertiesArray, routeConfig.dto.request); */
|
|
81
88
|
}
|
|
82
89
|
}
|
|
83
90
|
init() {
|
|
@@ -105,6 +112,7 @@ class ApiControllerFactory {
|
|
|
105
112
|
const response = await this.service.get(requestProperties);
|
|
106
113
|
transformData_utility.ApiControllerTransformData(properties.routes[method]?.response?.transformers, properties, { response }, { authenticationRequest, headers, ip });
|
|
107
114
|
return classTransformer.plainToInstance(dto, response, {
|
|
115
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
108
116
|
excludeExtraneousValues: true,
|
|
109
117
|
});
|
|
110
118
|
}, "name", { value: methodName });
|
|
@@ -143,6 +151,7 @@ class ApiControllerFactory {
|
|
|
143
151
|
transformData_utility.ApiControllerTransformData(properties.routes[method]?.response?.transformers, properties, { response }, { authenticationRequest, headers, ip });
|
|
144
152
|
const dto = generate_utility.DtoGenerate(properties.entity, entityMetadata, method, dtoType_enum.EApiDtoType.RESPONSE, properties.routes[method]?.autoDto?.[dtoType_enum.EApiDtoType.RESPONSE], properties.routes[method]?.authentication?.guard);
|
|
145
153
|
return classTransformer.plainToInstance(dto, response, {
|
|
154
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
146
155
|
excludeExtraneousValues: true,
|
|
147
156
|
});
|
|
148
157
|
}, "name", { value: methodName });
|
|
@@ -169,6 +178,7 @@ class ApiControllerFactory {
|
|
|
169
178
|
transformData_utility.ApiControllerTransformData(properties.routes[method]?.request?.transformers, properties, { response }, { authenticationRequest, headers, ip });
|
|
170
179
|
const dto = generate_utility.DtoGenerate(properties.entity, entityMetadata, method, dtoType_enum.EApiDtoType.RESPONSE, properties.routes[method]?.autoDto?.[dtoType_enum.EApiDtoType.RESPONSE], properties.routes[method]?.authentication?.guard);
|
|
171
180
|
return classTransformer.plainToInstance(dto, response, {
|
|
181
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
172
182
|
excludeExtraneousValues: true,
|
|
173
183
|
});
|
|
174
184
|
}, "name", { value: methodName });
|
|
@@ -189,10 +199,12 @@ class ApiControllerFactory {
|
|
|
189
199
|
transformData_utility.ApiControllerTransformData(properties.routes[method]?.request?.transformers, properties, { response }, { authenticationRequest, headers, ip });
|
|
190
200
|
const dto = generate_utility.DtoGenerate(properties.entity, entityMetadata, method, dtoType_enum.EApiDtoType.RESPONSE, properties.routes[method]?.autoDto?.[dtoType_enum.EApiDtoType.RESPONSE], properties.routes[method]?.authentication?.guard);
|
|
191
201
|
return classTransformer.plainToInstance(dto, response, {
|
|
202
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
192
203
|
excludeExtraneousValues: true,
|
|
193
204
|
});
|
|
194
205
|
}, "name", { value: methodName });
|
|
195
206
|
}
|
|
207
|
+
// eslint-disable-next-line @elsikora/sonar/no-identical-functions
|
|
196
208
|
[routeType_enum.EApiRouteType.UPDATE](method, methodName, properties, entityMetadata) {
|
|
197
209
|
this.targetPrototype[methodName] = Object.defineProperty(async function (parameters, body, headers, ip, authenticationRequest) {
|
|
198
210
|
const primaryKey = getPrimaryColumn_utility.ApiControllerGetPrimaryColumn(parameters, entityMetadata);
|
|
@@ -209,6 +221,7 @@ class ApiControllerFactory {
|
|
|
209
221
|
transformData_utility.ApiControllerTransformData(properties.routes[method]?.request?.transformers, properties, { response }, { authenticationRequest, headers, ip });
|
|
210
222
|
const dto = generate_utility.DtoGenerate(properties.entity, entityMetadata, method, dtoType_enum.EApiDtoType.RESPONSE, properties.routes[method]?.autoDto?.[dtoType_enum.EApiDtoType.RESPONSE], properties.routes[method]?.authentication?.guard);
|
|
211
223
|
return classTransformer.plainToInstance(dto, response, {
|
|
224
|
+
// eslint-disable-next-line @elsikora/typescript/naming-convention
|
|
212
225
|
excludeExtraneousValues: true,
|
|
213
226
|
});
|
|
214
227
|
}, "name", { value: methodName });
|