@renzosanchez1357/libreria-compartida-microservicios01 1.0.1 → 1.0.2

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.
@@ -0,0 +1,10 @@
1
+ export declare class ProductDto {
2
+ nombre: String;
3
+ tipo: String;
4
+ descripcion: String;
5
+ precio: Number;
6
+ precio_venta: Number;
7
+ es_novedad: Boolean;
8
+ es_favorito: Boolean;
9
+ }
10
+ //# sourceMappingURL=Product.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Product.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/products/Product.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,UAAU;IAarB,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,EAAE,MAAM,CAAC;IAIb,WAAW,EAAE,MAAM,CAAC;IAKpB,MAAM,EAAE,MAAM,CAAC;IAKf,YAAY,EAAE,MAAM,CAAC;IASrB,UAAU,EAAE,OAAO,CAAC;IASpB,WAAW,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,70 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Transform, Type } from "class-transformer";
8
+ import { IsBoolean, IsOptional, IsPositive } from "class-validator";
9
+ export class ProductDto {
10
+ // @IsPositive()
11
+ // @IsOptional()
12
+ // @Type(() => Number) // transformer: lo convierte a numero
13
+ // page: number = 1; // a diferencia de los pipes, no los valida, solo los transforma
14
+ // @IsPositive()
15
+ // @IsOptional()
16
+ // @Type(() => Number)
17
+ // limit: number = 10;
18
+ // @IsOptional()
19
+ nombre;
20
+ // @IsOptional()
21
+ tipo;
22
+ // @IsOptional()
23
+ descripcion;
24
+ // @IsOptional()
25
+ precio;
26
+ // @IsOptional()
27
+ precio_venta;
28
+ es_novedad;
29
+ es_favorito;
30
+ }
31
+ __decorate([
32
+ Type(() => String)
33
+ ], ProductDto.prototype, "nombre", void 0);
34
+ __decorate([
35
+ Type(() => String)
36
+ ], ProductDto.prototype, "tipo", void 0);
37
+ __decorate([
38
+ Type(() => String)
39
+ ], ProductDto.prototype, "descripcion", void 0);
40
+ __decorate([
41
+ IsPositive(),
42
+ Type(() => Number)
43
+ ], ProductDto.prototype, "precio", void 0);
44
+ __decorate([
45
+ IsPositive(),
46
+ Type(() => Number)
47
+ ], ProductDto.prototype, "precio_venta", void 0);
48
+ __decorate([
49
+ IsOptional(),
50
+ IsBoolean(),
51
+ Transform(({ value }) => {
52
+ if (value === "true")
53
+ return true;
54
+ if (value === "false")
55
+ return false;
56
+ return value;
57
+ })
58
+ ], ProductDto.prototype, "es_novedad", void 0);
59
+ __decorate([
60
+ IsOptional(),
61
+ IsBoolean(),
62
+ Transform(({ value }) => {
63
+ if (value === "true")
64
+ return true;
65
+ if (value === "false")
66
+ return false;
67
+ return value;
68
+ })
69
+ ], ProductDto.prototype, "es_favorito", void 0);
70
+ //# sourceMappingURL=Product.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Product.dto.js","sourceRoot":"","sources":["../../../src/dto/products/Product.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,OAAO,UAAU;IACrB,gBAAgB;IAChB,gBAAgB;IAChB,4DAA4D;IAC5D,qFAAqF;IAErF,gBAAgB;IAChB,gBAAgB;IAChB,sBAAsB;IACtB,sBAAsB;IAEtB,gBAAgB;IAEhB,MAAM,CAAS;IAEf,gBAAgB;IAEhB,IAAI,CAAS;IAEb,gBAAgB;IAEhB,WAAW,CAAS;IAEpB,gBAAgB;IAGhB,MAAM,CAAS;IAEf,gBAAgB;IAGhB,YAAY,CAAS;IASrB,UAAU,CAAU;IASpB,WAAW,CAAU;CACtB;AArCC;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;0CACJ;AAIf;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;wCACN;AAIb;IADC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;+CACC;AAKpB;IAFC,UAAU,EAAE;IACZ,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;0CACJ;AAKf;IAFC,UAAU,EAAE;IACZ,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;gDACE;AASrB;IAPC,UAAU,EAAE;IACZ,SAAS,EAAE;IACX,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACvB,IAAI,KAAK,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC;QAClC,IAAI,KAAK,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;8CACkB;AASpB;IAPC,UAAU,EAAE;IACZ,SAAS,EAAE;IACX,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACvB,IAAI,KAAK,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC;QAClC,IAAI,KAAK,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;+CACmB"}
@@ -0,0 +1,7 @@
1
+ import { ProductDto } from "./Product.dto";
2
+ declare const UpdateProductDto_base: import("@nestjs/mapped-types").MappedType<Partial<ProductDto>>;
3
+ export declare class UpdateProductDto extends UpdateProductDto_base {
4
+ id: number;
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=update-product.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-product.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/products/update-product.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAG3C,qBAAa,gBAAiB,SAAQ,qBAAuB;IAK3D,EAAE,EAAE,MAAM,CAAC;CACZ"}
@@ -0,0 +1,20 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { PartialType } from "@nestjs/mapped-types";
8
+ import { ProductDto } from "./Product.dto";
9
+ import { IsNumber, IsPositive } from "class-validator";
10
+ // (PartialType): UpdateProductDto de la clase ProductDto, pero sus campos (de la clase padre) son opcionales
11
+ export class UpdateProductDto extends PartialType(ProductDto) {
12
+ /* Entre microservicios, a la hora de conectarse mediante TCP,
13
+ TIENE que ir el id, del producto */
14
+ id;
15
+ }
16
+ __decorate([
17
+ IsNumber(),
18
+ IsPositive()
19
+ ], UpdateProductDto.prototype, "id", void 0);
20
+ //# sourceMappingURL=update-product.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-product.dto.js","sourceRoot":"","sources":["../../../src/dto/products/update-product.dto.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvD,6GAA6G;AAC7G,MAAM,OAAO,gBAAiB,SAAQ,WAAW,CAAC,UAAU,CAAC;IAC3D;yCACqC;IAGrC,EAAE,CAAS;CACZ;AADC;IAFC,QAAQ,EAAE;IACV,UAAU,EAAE;4CACF"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from "./dto/pagination.dto.js";
1
+ export * from "./dto/products/Product.dto.js";
2
+ export * from "./dto/products/update-product.dto.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export * from "./dto/pagination.dto.js";
1
+ export * from "./dto/products/Product.dto.js";
2
+ export * from "./dto/products/update-product.dto.js";
2
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renzosanchez1357/libreria-compartida-microservicios01",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Libreria compartida, para DTOS, y validacion",
5
5
  "main": "dist/index.js",
6
6
  "types": "module",
@@ -22,6 +22,7 @@
22
22
  "typescript": "^5.9.3"
23
23
  },
24
24
  "dependencies": {
25
+ "@nestjs/mapped-types": "^2.1.0",
25
26
  "class-transformer": "^0.5.1",
26
27
  "class-validator": "^0.14.3"
27
28
  },