@fiado/type-kit 1.0.4 → 1.0.6

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.
Files changed (88) hide show
  1. package/bin/account/dtos/AccountResponse.d.ts +21 -0
  2. package/bin/account/dtos/AccountResponse.js +85 -0
  3. package/bin/account/dtos/CreateAccountRequest.d.ts +14 -0
  4. package/bin/account/dtos/CreateAccountRequest.js +65 -0
  5. package/bin/account/dtos/CreatePockeRequest.d.ts +4 -0
  6. package/bin/account/dtos/CreatePockeRequest.js +31 -0
  7. package/bin/account/dtos/PocketResponse.d.ts +0 -0
  8. package/bin/account/dtos/PocketResponse.js +0 -0
  9. package/bin/account/enums/AccountStatus.d.ts +5 -0
  10. package/bin/account/enums/AccountStatus.js +9 -0
  11. package/bin/account/index.d.ts +4 -0
  12. package/bin/account/index.js +22 -0
  13. package/bin/address/dtos/AddressBase.d.ts +34 -0
  14. package/bin/address/dtos/AddressBase.js +163 -0
  15. package/bin/address/dtos/AddressResponse.d.ts +7 -0
  16. package/bin/address/dtos/AddressResponse.js +47 -0
  17. package/bin/address/dtos/CreateAddressRequest.d.ts +3 -0
  18. package/bin/address/dtos/CreateAddressRequest.js +7 -0
  19. package/bin/address/dtos/Geometry.d.ts +3 -0
  20. package/bin/address/dtos/Geometry.js +2 -0
  21. package/bin/address/dtos/Place.d.ts +21 -0
  22. package/bin/address/dtos/Place.js +112 -0
  23. package/bin/address/dtos/Shipping.d.ts +11 -0
  24. package/bin/address/dtos/Shipping.js +57 -0
  25. package/bin/address/dtos/Timezone.d.ts +4 -0
  26. package/bin/address/dtos/Timezone.js +2 -0
  27. package/bin/address/enums/AddressProvider.d.ts +9 -0
  28. package/bin/address/enums/AddressProvider.js +13 -0
  29. package/bin/address/enums/AddressStatus.d.ts +9 -0
  30. package/bin/address/enums/AddressStatus.js +13 -0
  31. package/bin/address/index.d.ts +8 -1
  32. package/bin/address/index.js +10 -1
  33. package/bin/card/dtos/CardActivateRequest.d.ts +4 -0
  34. package/bin/card/dtos/CardActivateRequest.js +26 -0
  35. package/bin/card/dtos/CardApplicationRequest.d.ts +6 -0
  36. package/bin/card/dtos/CardApplicationRequest.js +34 -0
  37. package/bin/card/dtos/CardUpdateRequest.d.ts +5 -0
  38. package/bin/card/dtos/CardUpdateRequest.js +28 -0
  39. package/bin/card/dtos/CreateCardRequest.d.ts +34 -0
  40. package/bin/card/dtos/CreateCardRequest.js +176 -0
  41. package/bin/card/index.d.ts +11 -0
  42. package/bin/card/index.js +8 -4
  43. package/bin/card/validations/CardUpdateKeyConstraint.js +1 -2
  44. package/bin/card/validations/IsPhoneNumberConstraint.d.ts +6 -0
  45. package/bin/card/validations/IsPhoneNumberConstraint.js +36 -0
  46. package/bin/country/enums/Country.d.ts +4 -0
  47. package/bin/country/enums/Country.js +8 -0
  48. package/bin/country/enums/CountryId.js +1 -0
  49. package/bin/country/index.d.ts +1 -0
  50. package/bin/country/index.js +3 -0
  51. package/bin/directory/enums/TypeOfDirectoryId.d.ts +5 -0
  52. package/bin/directory/enums/TypeOfDirectoryId.js +9 -0
  53. package/bin/directory/index.d.ts +1 -0
  54. package/bin/directory/index.js +19 -0
  55. package/bin/helpers/constans/regex.d.ts +1 -0
  56. package/bin/helpers/constans/regex.js +3 -1
  57. package/bin/index.d.ts +5 -15
  58. package/bin/index.js +17 -17
  59. package/package.json +1 -1
  60. package/src/account/dtos/AccountResponse.ts +60 -0
  61. package/src/account/dtos/CreateAccountRequest.ts +45 -0
  62. package/src/account/dtos/CreatePockeRequest.ts +19 -0
  63. package/src/account/enums/AccountStatus.ts +7 -0
  64. package/src/account/index.ts +11 -0
  65. package/src/address/dtos/AddressBase.ts +131 -0
  66. package/src/address/dtos/AddressResponse.ts +41 -0
  67. package/src/address/dtos/CreateAddressRequest.ts +7 -0
  68. package/src/address/dtos/Geometry.ts +5 -0
  69. package/src/address/dtos/Place.ts +84 -0
  70. package/src/address/dtos/{AddressShippingDto.ts → Shipping.ts} +1 -1
  71. package/src/address/dtos/Timezone.ts +6 -0
  72. package/src/address/enums/AddressProvider.ts +10 -0
  73. package/src/address/enums/AddressStatus.ts +10 -0
  74. package/src/address/index.ts +12 -1
  75. package/src/card/dtos/{CardActivateRequestDto.ts → CardActivateRequest.ts} +1 -1
  76. package/src/card/dtos/{CardApplicationRequestDto.ts → CardApplicationRequest.ts} +4 -4
  77. package/src/card/dtos/{CardUpdateRequestDto.ts → CardUpdateRequest.ts} +1 -1
  78. package/src/card/dtos/{CreateCardRequestDto.ts → CreateCardRequest.ts} +4 -4
  79. package/src/card/index.ts +15 -0
  80. package/src/card/validations/CardUpdateKeyConstraint.ts +3 -5
  81. package/src/card/validations/IsPhoneNumberConstraint.ts +26 -0
  82. package/src/country/enums/Country.ts +6 -0
  83. package/src/country/enums/CountryId.ts +3 -0
  84. package/src/country/index.ts +6 -1
  85. package/src/directory/enums/TypeOfDirectoryId.ts +7 -0
  86. package/src/directory/index.ts +7 -0
  87. package/src/helpers/constans/regex.ts +2 -0
  88. package/src/index.ts +5 -18
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Place = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const Country_1 = require("../../country/enums/Country");
15
+ class Place {
16
+ }
17
+ exports.Place = Place;
18
+ __decorate([
19
+ (0, class_validator_1.ValidateNested)(),
20
+ __metadata("design:type", Object)
21
+ ], Place.prototype, "geometry", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsOptional)(),
24
+ (0, class_validator_1.IsString)(),
25
+ __metadata("design:type", String)
26
+ ], Place.prototype, "addressNumber", void 0);
27
+ __decorate([
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, class_validator_1.IsArray)(),
30
+ (0, class_validator_1.IsString)({ each: true }),
31
+ __metadata("design:type", Array)
32
+ ], Place.prototype, "categories", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsEnum)(Country_1.Country),
36
+ __metadata("design:type", String)
37
+ ], Place.prototype, "country", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsBoolean)(),
40
+ __metadata("design:type", Boolean)
41
+ ], Place.prototype, "interpolated", void 0);
42
+ __decorate([
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.Length)(1, 300),
46
+ __metadata("design:type", String)
47
+ ], Place.prototype, "label", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.Length)(1, 60),
52
+ __metadata("design:type", String)
53
+ ], Place.prototype, "municipality", void 0);
54
+ __decorate([
55
+ (0, class_validator_1.IsOptional)(),
56
+ (0, class_validator_1.IsString)(),
57
+ (0, class_validator_1.Length)(2, 60),
58
+ __metadata("design:type", String)
59
+ ], Place.prototype, "neighborhood", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsString)(),
63
+ (0, class_validator_1.Length)(5, 10),
64
+ __metadata("design:type", String)
65
+ ], Place.prototype, "postalCode", void 0);
66
+ __decorate([
67
+ (0, class_validator_1.IsOptional)(),
68
+ (0, class_validator_1.IsString)(),
69
+ (0, class_validator_1.Length)(5, 10),
70
+ __metadata("design:type", String)
71
+ ], Place.prototype, "region", void 0);
72
+ __decorate([
73
+ (0, class_validator_1.IsOptional)(),
74
+ (0, class_validator_1.IsString)(),
75
+ (0, class_validator_1.Length)(1, 100),
76
+ __metadata("design:type", String)
77
+ ], Place.prototype, "street", void 0);
78
+ __decorate([
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsString)(),
81
+ (0, class_validator_1.Length)(2, 60),
82
+ __metadata("design:type", String)
83
+ ], Place.prototype, "subMunicipality", void 0);
84
+ __decorate([
85
+ (0, class_validator_1.IsOptional)(),
86
+ (0, class_validator_1.IsString)(),
87
+ (0, class_validator_1.Length)(2, 60),
88
+ __metadata("design:type", String)
89
+ ], Place.prototype, "subRegion", void 0);
90
+ __decorate([
91
+ (0, class_validator_1.IsOptional)(),
92
+ (0, class_validator_1.IsArray)(),
93
+ (0, class_validator_1.IsString)({ each: true }),
94
+ __metadata("design:type", Array)
95
+ ], Place.prototype, "supplementalCategories", void 0);
96
+ __decorate([
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.ValidateNested)(),
99
+ __metadata("design:type", Object)
100
+ ], Place.prototype, "timezone", void 0);
101
+ __decorate([
102
+ (0, class_validator_1.IsOptional)(),
103
+ (0, class_validator_1.IsString)(),
104
+ (0, class_validator_1.Length)(1, 10),
105
+ __metadata("design:type", String)
106
+ ], Place.prototype, "unitNumber", void 0);
107
+ __decorate([
108
+ (0, class_validator_1.IsOptional)(),
109
+ (0, class_validator_1.IsString)(),
110
+ (0, class_validator_1.Length)(1, 10),
111
+ __metadata("design:type", String)
112
+ ], Place.prototype, "unitType", void 0);
@@ -0,0 +1,11 @@
1
+ import { CountryId } from '../../country/enums/CountryId';
2
+ export declare class Shipping {
3
+ municipality: string;
4
+ neighborhood: string;
5
+ postalCode: string;
6
+ street: string;
7
+ subRegion: string;
8
+ addressNumber: string;
9
+ internalNumber?: string;
10
+ countryId: CountryId;
11
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Shipping = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const CountryId_1 = require("../../country/enums/CountryId");
15
+ class Shipping {
16
+ }
17
+ exports.Shipping = Shipping;
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.Length)(2, 60),
21
+ __metadata("design:type", String)
22
+ ], Shipping.prototype, "municipality", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.Length)(2, 60),
26
+ __metadata("design:type", String)
27
+ ], Shipping.prototype, "neighborhood", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.Length)(5, 10),
31
+ __metadata("design:type", String)
32
+ ], Shipping.prototype, "postalCode", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.Length)(2, 100),
36
+ __metadata("design:type", String)
37
+ ], Shipping.prototype, "street", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsString)(),
40
+ (0, class_validator_1.Length)(2, 60),
41
+ __metadata("design:type", String)
42
+ ], Shipping.prototype, "subRegion", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.Length)(1, 10),
46
+ __metadata("design:type", String)
47
+ ], Shipping.prototype, "addressNumber", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsOptional)(),
50
+ (0, class_validator_1.IsString)(),
51
+ (0, class_validator_1.Length)(1, 200),
52
+ __metadata("design:type", String)
53
+ ], Shipping.prototype, "internalNumber", void 0);
54
+ __decorate([
55
+ (0, class_validator_1.IsString)(),
56
+ __metadata("design:type", String)
57
+ ], Shipping.prototype, "countryId", void 0);
@@ -0,0 +1,4 @@
1
+ export type Timezone = {
2
+ name: string;
3
+ offset: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AddressProvider enum
3
+ * @description AddressProvider enum is used to define the address provider
4
+ * @enum {string} AddressProvider
5
+ */
6
+ export declare enum AddressProvider {
7
+ AWS = "AWS",
8
+ MANUAL = "MANUAL"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressProvider = void 0;
4
+ /**
5
+ * AddressProvider enum
6
+ * @description AddressProvider enum is used to define the address provider
7
+ * @enum {string} AddressProvider
8
+ */
9
+ var AddressProvider;
10
+ (function (AddressProvider) {
11
+ AddressProvider["AWS"] = "AWS";
12
+ AddressProvider["MANUAL"] = "MANUAL";
13
+ })(AddressProvider || (exports.AddressProvider = AddressProvider = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * AddressProvider Status
3
+ * @description AddressProvider Status is used to define the address provider status
4
+ * @enum {string} AddressStatus
5
+ */
6
+ export declare enum AddressStatus {
7
+ VISIBLE = "VISIBLE",
8
+ NOT_VISIBLE = "NOT_VISIBLE"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressStatus = void 0;
4
+ /**
5
+ * AddressProvider Status
6
+ * @description AddressProvider Status is used to define the address provider status
7
+ * @enum {string} AddressStatus
8
+ */
9
+ var AddressStatus;
10
+ (function (AddressStatus) {
11
+ AddressStatus["VISIBLE"] = "VISIBLE";
12
+ AddressStatus["NOT_VISIBLE"] = "NOT_VISIBLE";
13
+ })(AddressStatus || (exports.AddressStatus = AddressStatus = {}));
@@ -1 +1,8 @@
1
- export * from './dtos/AddressShippingDto';
1
+ export * from './dtos/Shipping';
2
+ export * from './dtos/CreateAddressRequest';
3
+ export * from './dtos/AddressResponse';
4
+ export * from './dtos/Geometry';
5
+ export * from './dtos/Place';
6
+ export * from './dtos/Timezone';
7
+ export * from './enums/AddressStatus';
8
+ export * from './enums/AddressProvider';
@@ -14,4 +14,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./dtos/AddressShippingDto"), exports);
17
+ //dtos
18
+ __exportStar(require("./dtos/Shipping"), exports);
19
+ __exportStar(require("./dtos/CreateAddressRequest"), exports);
20
+ __exportStar(require("./dtos/AddressResponse"), exports);
21
+ __exportStar(require("./dtos/Geometry"), exports);
22
+ __exportStar(require("./dtos/Place"), exports);
23
+ __exportStar(require("./dtos/Timezone"), exports);
24
+ //enums
25
+ __exportStar(require("./enums/AddressStatus"), exports);
26
+ __exportStar(require("./enums/AddressProvider"), exports);
@@ -0,0 +1,4 @@
1
+ export declare class CardActivateRequest {
2
+ countryId: number;
3
+ panOrCode: string;
4
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CardActivateRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const CountryId_1 = require("../../country/enums/CountryId");
15
+ class CardActivateRequest {
16
+ }
17
+ exports.CardActivateRequest = CardActivateRequest;
18
+ __decorate([
19
+ (0, class_validator_1.IsEnum)(CountryId_1.CountryId),
20
+ __metadata("design:type", Number)
21
+ ], CardActivateRequest.prototype, "countryId", void 0);
22
+ __decorate([
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.Matches)(/^\d{16}$/),
25
+ __metadata("design:type", String)
26
+ ], CardActivateRequest.prototype, "panOrCode", void 0);
@@ -0,0 +1,6 @@
1
+ import { Shipping } from '../../address/dtos/Shipping';
2
+ export declare class CardApplicationRequest {
3
+ countryId: number;
4
+ type: string;
5
+ address: Shipping;
6
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CardApplicationRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const CountryId_1 = require("../../country/enums/CountryId");
16
+ const CardType_1 = require("../enums/CardType");
17
+ const Shipping_1 = require("../../address/dtos/Shipping");
18
+ class CardApplicationRequest {
19
+ }
20
+ exports.CardApplicationRequest = CardApplicationRequest;
21
+ __decorate([
22
+ (0, class_validator_1.IsEnum)(CountryId_1.CountryId),
23
+ __metadata("design:type", Number)
24
+ ], CardApplicationRequest.prototype, "countryId", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsEnum)(CardType_1.CardType),
27
+ __metadata("design:type", String)
28
+ ], CardApplicationRequest.prototype, "type", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ (0, class_validator_1.ValidateNested)(),
32
+ (0, class_transformer_1.Type)(() => Shipping_1.Shipping),
33
+ __metadata("design:type", Shipping_1.Shipping)
34
+ ], CardApplicationRequest.prototype, "address", void 0);
@@ -0,0 +1,5 @@
1
+ import { UpdateKey } from "../enums/UpdateKey";
2
+ export declare class CardUpdateRequest {
3
+ type: UpdateKey;
4
+ value: string;
5
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CardUpdateRequest = void 0;
13
+ const IsEnum_1 = require("class-validator/types/decorator/typechecker/IsEnum");
14
+ const UpdateKey_1 = require("../enums/UpdateKey");
15
+ const class_validator_1 = require("class-validator");
16
+ const CardUpdateKeyConstraint_1 = require("../validations/CardUpdateKeyConstraint");
17
+ class CardUpdateRequest {
18
+ }
19
+ exports.CardUpdateRequest = CardUpdateRequest;
20
+ __decorate([
21
+ (0, IsEnum_1.IsEnum)(UpdateKey_1.UpdateKey),
22
+ __metadata("design:type", String)
23
+ ], CardUpdateRequest.prototype, "type", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsString)(),
26
+ (0, CardUpdateKeyConstraint_1.IsValueValid)(),
27
+ __metadata("design:type", String)
28
+ ], CardUpdateRequest.prototype, "value", void 0);
@@ -0,0 +1,34 @@
1
+ import { CountryId } from '../../country/enums/CountryId';
2
+ import { CardType } from '../enums/CardType';
3
+ import { Brand } from '../enums/Brand';
4
+ import { OwnershipType } from '../enums/OwnershipType';
5
+ import { Status } from '../enums/Status';
6
+ import { Shipping } from '../../address';
7
+ export declare class CreateCardRequest {
8
+ id?: string;
9
+ accountId?: string;
10
+ activationDate?: string;
11
+ countryId: CountryId;
12
+ type: CardType;
13
+ directoryId?: string;
14
+ externalCardId: string;
15
+ externalUserId: string;
16
+ externalShipmentId: string;
17
+ shipmentProvider: string;
18
+ externalShipmentTrackingId: string;
19
+ externalShipmentTrackingUrl: string;
20
+ holderName: string;
21
+ holderLastName: string;
22
+ imageUrl?: string;
23
+ brand: Brand;
24
+ ownershipType: OwnershipType;
25
+ lastFour: string;
26
+ providerName?: string;
27
+ status: Status;
28
+ statusUpdateDate?: string;
29
+ tenantId?: string;
30
+ spendLimitByTransaction?: number;
31
+ spendLimitByDay?: number;
32
+ spendLimitByMonth?: number;
33
+ shippedAddress?: Shipping;
34
+ }
@@ -0,0 +1,176 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateCardRequest = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const CountryId_1 = require("../../country/enums/CountryId");
16
+ const CardType_1 = require("../enums/CardType");
17
+ const Brand_1 = require("../enums/Brand");
18
+ const OwnershipType_1 = require("../enums/OwnershipType");
19
+ const Status_1 = require("../enums/Status");
20
+ const regex_1 = require("../../helpers/constans/regex");
21
+ const address_1 = require("../../address");
22
+ class CreateCardRequest {
23
+ }
24
+ exports.CreateCardRequest = CreateCardRequest;
25
+ __decorate([
26
+ (0, class_validator_1.IsOptional)(),
27
+ (0, class_validator_1.IsString)(),
28
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
29
+ message: 'id must be a valid UUID v4',
30
+ }),
31
+ __metadata("design:type", String)
32
+ ], CreateCardRequest.prototype, "id", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
37
+ message: 'accountId must be a valid UUID v4 or null',
38
+ }),
39
+ __metadata("design:type", String)
40
+ ], CreateCardRequest.prototype, "accountId", void 0);
41
+ __decorate([
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.Matches)(regex_1.regexIso8601, {
45
+ message: 'activationDate must be a valid ISO 8601 date string',
46
+ }),
47
+ __metadata("design:type", String)
48
+ ], CreateCardRequest.prototype, "activationDate", void 0);
49
+ __decorate([
50
+ (0, class_validator_1.IsEnum)(CountryId_1.CountryId),
51
+ __metadata("design:type", String)
52
+ ], CreateCardRequest.prototype, "countryId", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsEnum)(CardType_1.CardType),
55
+ __metadata("design:type", String)
56
+ ], CreateCardRequest.prototype, "type", void 0);
57
+ __decorate([
58
+ (0, class_validator_1.IsString)(),
59
+ (0, class_validator_1.Matches)(regex_1.regexUuidV4, {
60
+ message: 'directoryId must be a valid UUID v4',
61
+ }),
62
+ __metadata("design:type", String)
63
+ ], CreateCardRequest.prototype, "directoryId", void 0);
64
+ __decorate([
65
+ (0, class_validator_1.IsString)(),
66
+ (0, class_validator_1.Length)(1, 100),
67
+ __metadata("design:type", String)
68
+ ], CreateCardRequest.prototype, "externalCardId", void 0);
69
+ __decorate([
70
+ (0, class_validator_1.IsString)(),
71
+ (0, class_validator_1.Length)(1, 100),
72
+ __metadata("design:type", String)
73
+ ], CreateCardRequest.prototype, "externalUserId", void 0);
74
+ __decorate([
75
+ (0, class_validator_1.IsOptional)(),
76
+ (0, class_validator_1.IsString)(),
77
+ (0, class_validator_1.Length)(1, 100),
78
+ __metadata("design:type", String)
79
+ ], CreateCardRequest.prototype, "externalShipmentId", void 0);
80
+ __decorate([
81
+ (0, class_validator_1.IsOptional)(),
82
+ (0, class_validator_1.IsString)(),
83
+ (0, class_validator_1.Length)(1, 50),
84
+ __metadata("design:type", String)
85
+ ], CreateCardRequest.prototype, "shipmentProvider", void 0);
86
+ __decorate([
87
+ (0, class_validator_1.IsOptional)(),
88
+ (0, class_validator_1.IsString)(),
89
+ (0, class_validator_1.Length)(1, 50),
90
+ __metadata("design:type", String)
91
+ ], CreateCardRequest.prototype, "externalShipmentTrackingId", void 0);
92
+ __decorate([
93
+ (0, class_validator_1.IsOptional)(),
94
+ (0, class_validator_1.IsString)(),
95
+ (0, class_validator_1.Length)(1, 200),
96
+ __metadata("design:type", String)
97
+ ], CreateCardRequest.prototype, "externalShipmentTrackingUrl", void 0);
98
+ __decorate([
99
+ (0, class_validator_1.IsOptional)(),
100
+ (0, class_validator_1.IsString)(),
101
+ (0, class_validator_1.Length)(1, 50),
102
+ __metadata("design:type", String)
103
+ ], CreateCardRequest.prototype, "holderName", void 0);
104
+ __decorate([
105
+ (0, class_validator_1.IsOptional)(),
106
+ (0, class_validator_1.IsString)(),
107
+ (0, class_validator_1.Length)(1, 50),
108
+ __metadata("design:type", String)
109
+ ], CreateCardRequest.prototype, "holderLastName", void 0);
110
+ __decorate([
111
+ (0, class_validator_1.IsOptional)(),
112
+ (0, class_validator_1.IsString)(),
113
+ (0, class_validator_1.Length)(1, 200),
114
+ __metadata("design:type", String)
115
+ ], CreateCardRequest.prototype, "imageUrl", void 0);
116
+ __decorate([
117
+ (0, class_validator_1.IsEnum)(Brand_1.Brand),
118
+ __metadata("design:type", String)
119
+ ], CreateCardRequest.prototype, "brand", void 0);
120
+ __decorate([
121
+ (0, class_validator_1.IsEnum)(OwnershipType_1.OwnershipType),
122
+ __metadata("design:type", String)
123
+ ], CreateCardRequest.prototype, "ownershipType", void 0);
124
+ __decorate([
125
+ (0, class_validator_1.IsString)(),
126
+ (0, class_validator_1.Length)(4, 4),
127
+ __metadata("design:type", String)
128
+ ], CreateCardRequest.prototype, "lastFour", void 0);
129
+ __decorate([
130
+ (0, class_validator_1.IsOptional)(),
131
+ (0, class_validator_1.IsString)(),
132
+ (0, class_validator_1.Length)(1, 50),
133
+ __metadata("design:type", String)
134
+ ], CreateCardRequest.prototype, "providerName", void 0);
135
+ __decorate([
136
+ (0, class_validator_1.IsEnum)(Status_1.Status),
137
+ __metadata("design:type", String)
138
+ ], CreateCardRequest.prototype, "status", void 0);
139
+ __decorate([
140
+ (0, class_validator_1.IsOptional)(),
141
+ (0, class_validator_1.IsString)(),
142
+ __metadata("design:type", String)
143
+ ], CreateCardRequest.prototype, "statusUpdateDate", void 0);
144
+ __decorate([
145
+ (0, class_validator_1.IsOptional)(),
146
+ (0, class_validator_1.IsString)(),
147
+ (0, class_validator_1.Length)(1, 50),
148
+ __metadata("design:type", String)
149
+ ], CreateCardRequest.prototype, "tenantId", void 0);
150
+ __decorate([
151
+ (0, class_validator_1.IsOptional)(),
152
+ (0, class_validator_1.IsNumber)(),
153
+ (0, class_validator_1.Min)(1),
154
+ (0, class_validator_1.Max)(9999999999),
155
+ __metadata("design:type", Number)
156
+ ], CreateCardRequest.prototype, "spendLimitByTransaction", void 0);
157
+ __decorate([
158
+ (0, class_validator_1.IsOptional)(),
159
+ (0, class_validator_1.IsNumber)(),
160
+ (0, class_validator_1.Min)(1),
161
+ (0, class_validator_1.Max)(9999999999),
162
+ __metadata("design:type", Number)
163
+ ], CreateCardRequest.prototype, "spendLimitByDay", void 0);
164
+ __decorate([
165
+ (0, class_validator_1.IsOptional)(),
166
+ (0, class_validator_1.IsNumber)(),
167
+ (0, class_validator_1.Min)(1),
168
+ (0, class_validator_1.Max)(9999999999),
169
+ __metadata("design:type", Number)
170
+ ], CreateCardRequest.prototype, "spendLimitByMonth", void 0);
171
+ __decorate([
172
+ (0, class_validator_1.IsOptional)(),
173
+ (0, class_validator_1.ValidateNested)(),
174
+ (0, class_transformer_1.Type)(() => address_1.Shipping),
175
+ __metadata("design:type", address_1.Shipping)
176
+ ], CreateCardRequest.prototype, "shippedAddress", void 0);
@@ -0,0 +1,11 @@
1
+ export * from './dtos/CardActivateRequest';
2
+ export * from './dtos/CardApplicationRequest';
3
+ export * from './dtos/CreateCardRequest';
4
+ export * from './dtos/CardUpdateRequest';
5
+ export * from './enums/CardType';
6
+ export * from './enums/CardUpdateKey';
7
+ export * from './enums/IssuanceType';
8
+ export * from './enums/Status';
9
+ export * from './enums/OwnershipType';
10
+ export * from './enums/Brand';
11
+ export * from './enums/UpdateKey';
package/bin/card/index.js CHANGED
@@ -14,12 +14,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./dtos/CardActivateDto"), exports);
18
- __exportStar(require("./dtos/CardRequestDto"), exports);
19
- __exportStar(require("./dtos/CreateCardDto"), exports);
17
+ //dtos
18
+ __exportStar(require("./dtos/CardActivateRequest"), exports);
19
+ __exportStar(require("./dtos/CardApplicationRequest"), exports);
20
+ __exportStar(require("./dtos/CreateCardRequest"), exports);
21
+ __exportStar(require("./dtos/CardUpdateRequest"), exports);
22
+ //enums
20
23
  __exportStar(require("./enums/CardType"), exports);
21
24
  __exportStar(require("./enums/CardUpdateKey"), exports);
22
25
  __exportStar(require("./enums/IssuanceType"), exports);
23
26
  __exportStar(require("./enums/Status"), exports);
24
- __exportStar(require("./enums/IssuanceType"), exports);
25
27
  __exportStar(require("./enums/OwnershipType"), exports);
28
+ __exportStar(require("./enums/Brand"), exports);
29
+ __exportStar(require("./enums/UpdateKey"), exports);
@@ -36,8 +36,7 @@ let CardUpdateKeyConstraint = class CardUpdateKeyConstraint {
36
36
  return false;
37
37
  }
38
38
  defaultMessage(args) {
39
- // Se4 puede usar args para personalizar aún más el mensaje de error basado en el valor o las propiedades.
40
- return "El valor no es adecuado para el tipo de actualización.";
39
+ return "The value is not valid for the update type.";
41
40
  }
42
41
  };
43
42
  exports.CardUpdateKeyConstraint = CardUpdateKeyConstraint;
@@ -0,0 +1,6 @@
1
+ import { ValidatorConstraintInterface, ValidationArguments, ValidationOptions } from 'class-validator';
2
+ export declare class IsPhoneNumberConstraint implements ValidatorConstraintInterface {
3
+ validate(phoneNumber: string, args: ValidationArguments): boolean;
4
+ defaultMessage(args: ValidationArguments): string;
5
+ }
6
+ export declare function IsPhoneNumberFiado(validationOptions?: ValidationOptions): (object: Object, propertyName: string) => void;