@fiado/type-kit 1.0.4 → 1.0.5

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 (77) 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/address/dtos/AddressBase.d.ts +34 -0
  12. package/bin/address/dtos/AddressBase.js +163 -0
  13. package/bin/address/dtos/AddressResponse.d.ts +7 -0
  14. package/bin/address/dtos/AddressResponse.js +47 -0
  15. package/bin/address/dtos/CreateAddressRequest.d.ts +3 -0
  16. package/bin/address/dtos/CreateAddressRequest.js +7 -0
  17. package/bin/address/dtos/Geometry.d.ts +3 -0
  18. package/bin/address/dtos/Geometry.js +2 -0
  19. package/bin/address/dtos/Place.d.ts +21 -0
  20. package/bin/address/dtos/Place.js +112 -0
  21. package/bin/address/dtos/Shipping.d.ts +11 -0
  22. package/bin/address/dtos/Shipping.js +57 -0
  23. package/bin/address/dtos/Timezone.d.ts +4 -0
  24. package/bin/address/dtos/Timezone.js +2 -0
  25. package/bin/address/enums/AddressProvider.d.ts +9 -0
  26. package/bin/address/enums/AddressProvider.js +13 -0
  27. package/bin/address/enums/AddressStatus.d.ts +9 -0
  28. package/bin/address/enums/AddressStatus.js +13 -0
  29. package/bin/address/index.d.ts +1 -1
  30. package/bin/address/index.js +1 -1
  31. package/bin/card/dtos/CardActivateRequest.d.ts +4 -0
  32. package/bin/card/dtos/CardActivateRequest.js +26 -0
  33. package/bin/card/dtos/CardApplicationRequest.d.ts +6 -0
  34. package/bin/card/dtos/CardApplicationRequest.js +34 -0
  35. package/bin/card/dtos/CardUpdateRequest.d.ts +5 -0
  36. package/bin/card/dtos/CardUpdateRequest.js +28 -0
  37. package/bin/card/dtos/CreateCardRequest.d.ts +34 -0
  38. package/bin/card/dtos/CreateCardRequest.js +176 -0
  39. package/bin/card/validations/CardUpdateKeyConstraint.js +1 -2
  40. package/bin/card/validations/IsPhoneNumberConstraint.d.ts +6 -0
  41. package/bin/card/validations/IsPhoneNumberConstraint.js +36 -0
  42. package/bin/country/enums/Country.d.ts +4 -0
  43. package/bin/country/enums/Country.js +8 -0
  44. package/bin/country/enums/CountryId.js +1 -0
  45. package/bin/directory/enums/TypeOfDirectoryId.d.ts +5 -0
  46. package/bin/directory/enums/TypeOfDirectoryId.js +9 -0
  47. package/bin/helpers/constans/regex.d.ts +1 -0
  48. package/bin/helpers/constans/regex.js +3 -1
  49. package/bin/index.d.ts +4 -4
  50. package/bin/index.js +4 -4
  51. package/package.json +1 -1
  52. package/src/account/dtos/AccountResponse.ts +60 -0
  53. package/src/account/dtos/CreateAccountRequest.ts +45 -0
  54. package/src/account/dtos/CreatePockeRequest.ts +19 -0
  55. package/src/account/dtos/PocketResponse.ts +0 -0
  56. package/src/account/enums/AccountStatus.ts +7 -0
  57. package/src/address/dtos/AddressBase.ts +131 -0
  58. package/src/address/dtos/AddressResponse.ts +41 -0
  59. package/src/address/dtos/CreateAddressRequest.ts +7 -0
  60. package/src/address/dtos/Geometry.ts +5 -0
  61. package/src/address/dtos/Place.ts +84 -0
  62. package/src/address/dtos/{AddressShippingDto.ts → Shipping.ts} +1 -1
  63. package/src/address/dtos/Timezone.ts +6 -0
  64. package/src/address/enums/AddressProvider.ts +10 -0
  65. package/src/address/enums/AddressStatus.ts +10 -0
  66. package/src/address/index.ts +1 -1
  67. package/src/card/dtos/{CardActivateRequestDto.ts → CardActivateRequest.ts} +1 -1
  68. package/src/card/dtos/{CardApplicationRequestDto.ts → CardApplicationRequest.ts} +4 -4
  69. package/src/card/dtos/{CardUpdateRequestDto.ts → CardUpdateRequest.ts} +1 -1
  70. package/src/card/dtos/{CreateCardRequestDto.ts → CreateCardRequest.ts} +4 -4
  71. package/src/card/validations/CardUpdateKeyConstraint.ts +3 -5
  72. package/src/card/validations/IsPhoneNumberConstraint.ts +26 -0
  73. package/src/country/enums/Country.ts +6 -0
  74. package/src/country/enums/CountryId.ts +3 -0
  75. package/src/directory/enums/TypeOfDirectoryId.ts +7 -0
  76. package/src/helpers/constans/regex.ts +2 -0
  77. package/src/index.ts +4 -4
@@ -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 @@
1
- export * from './dtos/AddressShippingDto';
1
+ export * from './dtos/Shipping';
@@ -14,4 +14,4 @@ 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
+ __exportStar(require("./dtos/Shipping"), 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);
@@ -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;
@@ -0,0 +1,36 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.IsPhoneNumberFiado = exports.IsPhoneNumberConstraint = void 0;
10
+ const class_validator_1 = require("class-validator");
11
+ const regex_1 = require("../../helpers/constans/regex");
12
+ let IsPhoneNumberConstraint = class IsPhoneNumberConstraint {
13
+ validate(phoneNumber, args) {
14
+ return regex_1.regexPhoneNumber.test(phoneNumber);
15
+ }
16
+ defaultMessage(args) {
17
+ return "The phone number is not valid. The expected format is +############.";
18
+ }
19
+ };
20
+ exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint;
21
+ exports.IsPhoneNumberConstraint = IsPhoneNumberConstraint = __decorate([
22
+ (0, class_validator_1.ValidatorConstraint)({ async: true })
23
+ ], IsPhoneNumberConstraint);
24
+ // Decorador que usaremos en nuestras clases DTO
25
+ function IsPhoneNumberFiado(validationOptions) {
26
+ return function (object, propertyName) {
27
+ (0, class_validator_1.registerDecorator)({
28
+ target: object.constructor,
29
+ propertyName: propertyName,
30
+ options: validationOptions,
31
+ constraints: [],
32
+ validator: IsPhoneNumberConstraint,
33
+ });
34
+ };
35
+ }
36
+ exports.IsPhoneNumberFiado = IsPhoneNumberFiado;
@@ -0,0 +1,4 @@
1
+ export declare enum Country {
2
+ MEX = "MEX",
3
+ USA = "USA"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Country = void 0;
4
+ var Country;
5
+ (function (Country) {
6
+ Country["MEX"] = "MEX";
7
+ Country["USA"] = "USA";
8
+ })(Country || (exports.Country = Country = {}));
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ //*
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
4
  exports.CountryId = void 0;
4
5
  var CountryId;
@@ -0,0 +1,5 @@
1
+ export declare enum TypeOfDirectoryId {
2
+ USER = "USER",
3
+ BACKOFFICE = "BACKOFFICE",
4
+ AGENT = "AGENT"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeOfDirectoryId = void 0;
4
+ var TypeOfDirectoryId;
5
+ (function (TypeOfDirectoryId) {
6
+ TypeOfDirectoryId["USER"] = "USER";
7
+ TypeOfDirectoryId["BACKOFFICE"] = "BACKOFFICE";
8
+ TypeOfDirectoryId["AGENT"] = "AGENT";
9
+ })(TypeOfDirectoryId || (exports.TypeOfDirectoryId = TypeOfDirectoryId = {}));
@@ -1,2 +1,3 @@
1
1
  export declare const regexUuidV4: RegExp;
2
2
  export declare const regexIso8601: RegExp;
3
+ export declare const regexPhoneNumber: RegExp;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.regexIso8601 = exports.regexUuidV4 = void 0;
3
+ exports.regexPhoneNumber = exports.regexIso8601 = exports.regexUuidV4 = void 0;
4
4
  // Expresión regular para validar UUID v4
5
5
  exports.regexUuidV4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
6
6
  // Expresión regular para validar fecha ISO 8601
7
7
  exports.regexIso8601 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
8
+ // Expresión regular para validar un número de teléfono
9
+ exports.regexPhoneNumber = /^\+\d{12}$/;
package/bin/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from './card/dtos/CardActivateRequestDto';
2
- export * from './card/dtos/CardApplicationRequestDto';
3
- export * from './card/dtos/CreateCardRequestDto';
4
- export * from './card/dtos/CardUpdateRequestDto';
1
+ export * from './card/dtos/CardActivateRequest';
2
+ export * from './card/dtos/CardApplicationRequest';
3
+ export * from './card/dtos/CreateCardRequest';
4
+ export * from './card/dtos/CardUpdateRequest';
5
5
  export * from './card/enums/CardType';
6
6
  export * from './card/enums/CardUpdateKey';
7
7
  export * from './card/enums/IssuanceType';
package/bin/index.js CHANGED
@@ -14,10 +14,10 @@ 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("./card/dtos/CardActivateRequestDto"), exports);
18
- __exportStar(require("./card/dtos/CardApplicationRequestDto"), exports);
19
- __exportStar(require("./card/dtos/CreateCardRequestDto"), exports);
20
- __exportStar(require("./card/dtos/CardUpdateRequestDto"), exports);
17
+ __exportStar(require("./card/dtos/CardActivateRequest"), exports);
18
+ __exportStar(require("./card/dtos/CardApplicationRequest"), exports);
19
+ __exportStar(require("./card/dtos/CreateCardRequest"), exports);
20
+ __exportStar(require("./card/dtos/CardUpdateRequest"), exports);
21
21
  __exportStar(require("./card/enums/CardType"), exports);
22
22
  __exportStar(require("./card/enums/CardUpdateKey"), exports);
23
23
  __exportStar(require("./card/enums/IssuanceType"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",