sigo-entities 0.0.72 → 0.0.74
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 +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ declare class DestinatarioDTO {
|
|
|
4
4
|
Email: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
declare function validateAndFormatData<T extends object>(data: any, dtoClass: new () => T): Promise<T>;
|
|
7
|
+
declare function validateAndFormatData<T extends object>(data: any, dtoClass: new () => T, skipMissingProperties?: boolean): Promise<T>;
|
|
8
8
|
|
|
9
9
|
declare class AlmacenDTO {
|
|
10
10
|
Codigo: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ declare class DestinatarioDTO {
|
|
|
4
4
|
Email: string;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
declare function validateAndFormatData<T extends object>(data: any, dtoClass: new () => T): Promise<T>;
|
|
7
|
+
declare function validateAndFormatData<T extends object>(data: any, dtoClass: new () => T, skipMissingProperties?: boolean): Promise<T>;
|
|
8
8
|
|
|
9
9
|
declare class AlmacenDTO {
|
|
10
10
|
Codigo: string;
|
package/dist/index.js
CHANGED
|
@@ -186,9 +186,9 @@ var import_class_validator48 = require("class-validator");
|
|
|
186
186
|
// src/shared/utils/validarYFormatearDatos.ts
|
|
187
187
|
var import_class_transformer2 = require("class-transformer");
|
|
188
188
|
var import_class_validator2 = require("class-validator");
|
|
189
|
-
async function validateAndFormatData(data, dtoClass) {
|
|
189
|
+
async function validateAndFormatData(data, dtoClass, skipMissingProperties = false) {
|
|
190
190
|
const instance = (0, import_class_transformer2.plainToInstance)(dtoClass, data, { excludeExtraneousValues: true });
|
|
191
|
-
const errors = await (0, import_class_validator2.validate)(instance);
|
|
191
|
+
const errors = await (0, import_class_validator2.validate)(instance, { skipMissingProperties });
|
|
192
192
|
if (errors.length > 0) {
|
|
193
193
|
const formattedErrors = formatErrors(errors);
|
|
194
194
|
const errorMessage = `Response validation failed: ${formattedErrors[0]}`;
|
|
@@ -3586,7 +3586,7 @@ __decorateClass([
|
|
|
3586
3586
|
(0, import_class_validator69.IsNumber)({}, { message: "debe ser un numero" }),
|
|
3587
3587
|
(0, import_class_validator69.IsNotEmpty)({ message: "es requerido" }),
|
|
3588
3588
|
(0, import_class_transformer69.Expose)(),
|
|
3589
|
-
(0, import_class_validator69.Min)(
|
|
3589
|
+
(0, import_class_validator69.Min)(0)
|
|
3590
3590
|
], FaseDTO.prototype, "ID_Fase", 2);
|
|
3591
3591
|
__decorateClass([
|
|
3592
3592
|
(0, import_class_validator69.IsNumber)({}, { message: "debe ser un numero" }),
|
package/dist/index.mjs
CHANGED
|
@@ -43,9 +43,9 @@ import { IsArray as IsArray6, IsEmail as IsEmail2, IsNotEmpty as IsNotEmpty47, I
|
|
|
43
43
|
// src/shared/utils/validarYFormatearDatos.ts
|
|
44
44
|
import { plainToInstance } from "class-transformer";
|
|
45
45
|
import { validate } from "class-validator";
|
|
46
|
-
async function validateAndFormatData(data, dtoClass) {
|
|
46
|
+
async function validateAndFormatData(data, dtoClass, skipMissingProperties = false) {
|
|
47
47
|
const instance = plainToInstance(dtoClass, data, { excludeExtraneousValues: true });
|
|
48
|
-
const errors = await validate(instance);
|
|
48
|
+
const errors = await validate(instance, { skipMissingProperties });
|
|
49
49
|
if (errors.length > 0) {
|
|
50
50
|
const formattedErrors = formatErrors(errors);
|
|
51
51
|
const errorMessage = `Response validation failed: ${formattedErrors[0]}`;
|
|
@@ -3443,7 +3443,7 @@ __decorateClass([
|
|
|
3443
3443
|
IsNumber41({}, { message: "debe ser un numero" }),
|
|
3444
3444
|
IsNotEmpty68({ message: "es requerido" }),
|
|
3445
3445
|
Expose68(),
|
|
3446
|
-
Min23(
|
|
3446
|
+
Min23(0)
|
|
3447
3447
|
], FaseDTO.prototype, "ID_Fase", 2);
|
|
3448
3448
|
__decorateClass([
|
|
3449
3449
|
IsNumber41({}, { message: "debe ser un numero" }),
|