sigo-entities 1.2.42 → 1.2.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -3
- package/dist/index.mjs +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -630,6 +630,9 @@ function convertStringsToDates(obj) {
|
|
|
630
630
|
var import_class_transformer2 = require("class-transformer");
|
|
631
631
|
var import_class_validator2 = require("class-validator");
|
|
632
632
|
async function validateAndFormatData(data, dtoClass, propertiesToValidate) {
|
|
633
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
634
|
+
throw new Error(`El cuerpo debe ser un objeto v\xE1lido de tipo ${dtoClass.name}`);
|
|
635
|
+
}
|
|
633
636
|
if (propertiesToValidate) {
|
|
634
637
|
if (propertiesToValidate.length === 0) {
|
|
635
638
|
throw new Error(`Debes especificar al menos una propiedad a validar`);
|
|
@@ -4817,12 +4820,12 @@ __decorateClass([
|
|
|
4817
4820
|
], DocumentacionBaremoPexENTITY.prototype, "ContratoCod", 2);
|
|
4818
4821
|
__decorateClass([
|
|
4819
4822
|
(0, import_class_validator99.IsString)({ message: "debe ser un texto" }),
|
|
4820
|
-
(0, import_class_validator99.Length)(1,
|
|
4823
|
+
(0, import_class_validator99.Length)(1, 200, { message: "debe tener entre 1 y 200 caracteres" }),
|
|
4821
4824
|
(0, import_class_transformer98.Expose)()
|
|
4822
4825
|
], DocumentacionBaremoPexENTITY.prototype, "CodigoMO", 2);
|
|
4823
4826
|
__decorateClass([
|
|
4824
4827
|
(0, import_class_validator99.IsString)({ message: "debe ser un texto" }),
|
|
4825
|
-
(0, import_class_validator99.Length)(1,
|
|
4828
|
+
(0, import_class_validator99.Length)(1, 200, { message: "debe tener entre 1 y 200 caracteres" }),
|
|
4826
4829
|
(0, import_class_transformer98.Expose)()
|
|
4827
4830
|
], DocumentacionBaremoPexENTITY.prototype, "DescripcionMO", 2);
|
|
4828
4831
|
__decorateClass([
|
|
@@ -4832,7 +4835,7 @@ __decorateClass([
|
|
|
4832
4835
|
], DocumentacionBaremoPexENTITY.prototype, "Codigo", 2);
|
|
4833
4836
|
__decorateClass([
|
|
4834
4837
|
(0, import_class_validator99.IsString)({ message: "debe ser un texto" }),
|
|
4835
|
-
(0, import_class_validator99.Length)(1,
|
|
4838
|
+
(0, import_class_validator99.Length)(1, 200, { message: "debe tener entre 1 y 200 caracteres" }),
|
|
4836
4839
|
(0, import_class_transformer98.Expose)()
|
|
4837
4840
|
], DocumentacionBaremoPexENTITY.prototype, "Nombre", 2);
|
|
4838
4841
|
__decorateClass([
|
package/dist/index.mjs
CHANGED
|
@@ -78,6 +78,9 @@ function convertStringsToDates(obj) {
|
|
|
78
78
|
import { plainToInstance } from "class-transformer";
|
|
79
79
|
import { validate } from "class-validator";
|
|
80
80
|
async function validateAndFormatData(data, dtoClass, propertiesToValidate) {
|
|
81
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
82
|
+
throw new Error(`El cuerpo debe ser un objeto v\xE1lido de tipo ${dtoClass.name}`);
|
|
83
|
+
}
|
|
81
84
|
if (propertiesToValidate) {
|
|
82
85
|
if (propertiesToValidate.length === 0) {
|
|
83
86
|
throw new Error(`Debes especificar al menos una propiedad a validar`);
|
|
@@ -4265,12 +4268,12 @@ __decorateClass([
|
|
|
4265
4268
|
], DocumentacionBaremoPexENTITY.prototype, "ContratoCod", 2);
|
|
4266
4269
|
__decorateClass([
|
|
4267
4270
|
IsString78({ message: "debe ser un texto" }),
|
|
4268
|
-
Length69(1,
|
|
4271
|
+
Length69(1, 200, { message: "debe tener entre 1 y 200 caracteres" }),
|
|
4269
4272
|
Expose96()
|
|
4270
4273
|
], DocumentacionBaremoPexENTITY.prototype, "CodigoMO", 2);
|
|
4271
4274
|
__decorateClass([
|
|
4272
4275
|
IsString78({ message: "debe ser un texto" }),
|
|
4273
|
-
Length69(1,
|
|
4276
|
+
Length69(1, 200, { message: "debe tener entre 1 y 200 caracteres" }),
|
|
4274
4277
|
Expose96()
|
|
4275
4278
|
], DocumentacionBaremoPexENTITY.prototype, "DescripcionMO", 2);
|
|
4276
4279
|
__decorateClass([
|
|
@@ -4280,7 +4283,7 @@ __decorateClass([
|
|
|
4280
4283
|
], DocumentacionBaremoPexENTITY.prototype, "Codigo", 2);
|
|
4281
4284
|
__decorateClass([
|
|
4282
4285
|
IsString78({ message: "debe ser un texto" }),
|
|
4283
|
-
Length69(1,
|
|
4286
|
+
Length69(1, 200, { message: "debe tener entre 1 y 200 caracteres" }),
|
|
4284
4287
|
Expose96()
|
|
4285
4288
|
], DocumentacionBaremoPexENTITY.prototype, "Nombre", 2);
|
|
4286
4289
|
__decorateClass([
|