@fiado/type-kit 1.0.5 → 1.0.7
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 +36 -1
- package/bin/account/dtos/AccountCreateRequest.d.ts +14 -0
- package/bin/account/dtos/AccountCreateRequest.js +65 -0
- package/bin/account/dtos/AccountResponse.js +0 -79
- package/bin/account/dtos/PocketCreateRequest.d.ts +4 -0
- package/bin/account/dtos/PocketCreateRequest.js +31 -0
- package/bin/account/index.d.ts +4 -0
- package/bin/account/index.js +22 -0
- package/bin/address/dtos/AddressCreateRequest.d.ts +3 -0
- package/bin/address/dtos/AddressCreateRequest.js +7 -0
- package/bin/address/index.d.ts +7 -0
- package/bin/address/index.js +9 -0
- package/bin/app/enums/App.d.ts +9 -0
- package/bin/app/enums/App.js +13 -0
- package/bin/authentication/dtos/SignUpAdditionalRequest.d.ts +7 -0
- package/bin/authentication/dtos/SignUpAdditionalRequest.js +46 -0
- package/bin/authentication/dtos/SignUpAdditionalResponse.d.ts +4 -0
- package/bin/authentication/dtos/SignUpAdditionalResponse.js +6 -0
- package/bin/authentication/index.d.ts +1 -0
- package/bin/authentication/index.js +28 -0
- package/bin/card/dtos/CardBalanceResponse.d.ts +9 -0
- package/bin/card/dtos/CardBalanceResponse.js +6 -0
- package/bin/card/dtos/CardCreateAdditionalRequest.d.ts +10 -0
- package/bin/card/dtos/CardCreateAdditionalRequest.js +59 -0
- package/bin/card/dtos/CardCreateRequest.d.ts +34 -0
- package/bin/card/dtos/CardCreateRequest.js +176 -0
- package/bin/card/dtos/CardResponse.js +0 -0
- package/bin/card/index.d.ts +13 -0
- package/bin/card/index.js +10 -4
- package/bin/country/index.d.ts +1 -0
- package/bin/country/index.js +3 -0
- package/bin/currency/dtos/CurrencyResponse.d.ts +6 -0
- package/bin/currency/dtos/CurrencyResponse.js +6 -0
- package/bin/directory/dtos/DirectoryResponse.d.ts +16 -0
- package/bin/directory/dtos/DirectoryResponse.js +2 -0
- package/bin/directory/dtos/External.d.ts +5 -0
- package/bin/directory/dtos/External.js +2 -0
- package/bin/directory/enums/Profile.d.ts +5 -0
- package/bin/directory/enums/Profile.js +9 -0
- package/bin/directory/enums/Scope.d.ts +6 -0
- package/bin/directory/enums/Scope.js +10 -0
- package/bin/directory/enums/Status.d.ts +6 -0
- package/bin/directory/enums/Status.js +10 -0
- package/bin/directory/index.d.ts +1 -0
- package/bin/directory/index.js +19 -0
- package/bin/exchangeRate/dtos/ExchangeRateCreateRequest.d.ts +17 -0
- package/bin/exchangeRate/dtos/ExchangeRateCreateRequest.js +74 -0
- package/bin/exchangeRate/dtos/ExchangeRateResponse.d.ts +18 -0
- package/bin/exchangeRate/dtos/ExchangeRateResponse.js +6 -0
- package/bin/exchangeRate/enums/ExchangeRateStatus.d.ts +4 -0
- package/bin/exchangeRate/enums/ExchangeRateStatus.js +8 -0
- package/bin/exchangeRate/index.d.ts +2 -0
- package/bin/exchangeRate/index.js +20 -0
- package/bin/identity/dtos/IdentificationDocument.d.ts +22 -0
- package/bin/identity/dtos/IdentificationDocument.js +6 -0
- package/bin/identity/dtos/PeopleCreateRequest.d.ts +0 -0
- package/bin/identity/dtos/PeopleCreateRequest.js +0 -0
- package/bin/identity/dtos/PeopleResponse.d.ts +75 -0
- package/bin/identity/dtos/PeopleResponse.js +6 -0
- package/bin/identity/dtos/TypeOfDocument.d.ts +10 -0
- package/bin/identity/dtos/TypeOfDocument.js +6 -0
- package/bin/identity/enums/IdentificationDocumentStatus.d.ts +5 -0
- package/bin/identity/enums/IdentificationDocumentStatus.js +9 -0
- package/bin/identity/enums/SexDocument.d.ts +4 -0
- package/bin/identity/enums/SexDocument.js +8 -0
- package/bin/identity/index.d.ts +0 -0
- package/bin/identity/index.js +0 -0
- package/bin/index.d.ts +6 -15
- package/bin/index.js +18 -17
- package/package.json +1 -1
- package/src/account/dtos/{CreateAccountRequest.ts → AccountCreateRequest.ts} +1 -1
- package/src/account/dtos/AccountResponse.ts +2 -36
- package/src/account/dtos/{CreatePockeRequest.ts → PocketCreateRequest.ts} +1 -1
- package/src/account/index.ts +11 -0
- package/src/address/dtos/AddressCreateRequest.ts +7 -0
- package/src/address/index.ts +11 -0
- package/src/app/enums/App.ts +11 -0
- package/src/authentication/dtos/SignUpAdditionalRequest.ts +34 -0
- package/src/authentication/dtos/SignUpAdditionalResponse.ts +6 -0
- package/src/authentication/index.ts +3 -0
- package/src/card/dtos/CardBalanceResponse.ts +12 -0
- package/src/card/dtos/CardCreateAdditionalRequest.ts +41 -0
- package/src/card/dtos/{CreateCardRequest.ts → CardCreateRequest.ts} +1 -1
- package/src/card/dtos/CardResponse.ts +0 -0
- package/src/card/index.ts +17 -0
- package/src/country/index.ts +6 -1
- package/src/currency/dtos/CurrencyResponse.ts +10 -0
- package/src/directory/dtos/DirectoryResponse.ts +18 -0
- package/src/directory/dtos/External.ts +7 -0
- package/src/directory/enums/Profile.ts +7 -0
- package/src/directory/enums/Scope.ts +8 -0
- package/src/directory/enums/Status.ts +8 -0
- package/src/directory/index.ts +7 -0
- package/src/exchangeRate/dtos/ExchangeRateCreateRequest.ts +51 -0
- package/src/exchangeRate/dtos/ExchangeRateResponse.ts +22 -0
- package/src/exchangeRate/enums/ExchangeRateStatus.ts +6 -0
- package/src/exchangeRate/index.ts +7 -0
- package/src/identity/dtos/IdentificationDocument.ts +25 -0
- package/src/identity/dtos/PeopleCreateRequest.ts +0 -0
- package/src/identity/dtos/PeopleResponse.ts +80 -0
- package/src/identity/dtos/TypeOfDocument.ts +12 -0
- package/src/identity/enums/IdentificationDocumentStatus.ts +7 -0
- package/src/identity/enums/SexDocument.ts +6 -0
- package/src/identity/index.ts +0 -0
- package/src/index.ts +6 -18
- package/src/address/dtos/CreateAddressRequest.ts +0 -7
- /package/{src/account/dtos/PocketResponse.ts → bin/card/dtos/CardResponse.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -20,16 +20,51 @@
|
|
|
20
20
|
- [Repita la estructura similar a `card`]
|
|
21
21
|
- 📁 `user` - Funciones y tipos relacionados con usuarios.
|
|
22
22
|
- [Repita la estructura similar a `card`]
|
|
23
|
-
📁 `/
|
|
23
|
+
📁 `/bin` - Contiene los archivos transpilados y listos para producción.
|
|
24
24
|
📁 `/test` - Incluye pruebas para los distintos componentes de la biblioteca.
|
|
25
25
|
📄 `package.json`
|
|
26
26
|
📄 `tsconfig.json`
|
|
27
27
|
📄 `README.md`
|
|
28
28
|
|
|
29
|
+
## Convenciones de Nombres y Validaciones
|
|
30
|
+
### Convenciones de Nombres para DTOs
|
|
31
|
+
Para mantener la coherencia y claridad en nuestros DTOs (Data Transfer Objects), seguimos una convención de nombres estricta. Los nombres de los archivos DTO deben reflejar claramente su propósito y el dominio al que pertenecen. Por ejemplo, para **card**:
|
|
29
32
|
|
|
33
|
+
- **Solicitudes**: El nombre debe comenzar con la entidad a la que pertenece, seguir con la acción y terminar con Request. Ejemplo: **CardActivateRequest.ts**, **CardCreateRequest.ts**, **CardUpdateRequest.ts**, **CardDeleteRequest.ts**.
|
|
34
|
+
- **Respuestas**: Debe comenzar con la entidad y terminar con Response. Ejemplo: **CardBalanceResponse.ts**. **CardResponse.ts**
|
|
35
|
+
|
|
36
|
+
### Uso de class-validator en DTOs
|
|
37
|
+
Al definir DTOs de solicitud, es esencial aplicar validaciones a todas las propiedades de la clase para garantizar que los datos recibidos cumplan con nuestras expectativas y restricciones. Usamos **class-validator** para este propósito:
|
|
38
|
+
|
|
39
|
+
- **Solicitudes**: Todas las propiedades de las clases de solicitud deben tener decoradores de **class-validator** para validar la entrada.
|
|
40
|
+
- **Respuestas**: Las clases de respuesta no deben incluir validaciones de **class-validator**, ya que son utilizadas solo para enviar datos al cliente.
|
|
41
|
+
|
|
42
|
+
#### Ejemplo de un DTO de Solicitud con class-validator:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { IsNotEmpty, IsString, IsNumber } from 'class-validator';
|
|
46
|
+
|
|
47
|
+
export class CardActivateRequest {
|
|
48
|
+
@IsNotEmpty()
|
|
49
|
+
@IsString()
|
|
50
|
+
readonly userId: string;
|
|
51
|
+
|
|
52
|
+
@IsNotEmpty()
|
|
53
|
+
@IsNumber()
|
|
54
|
+
readonly cardId: number;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
30
57
|
## Uso
|
|
31
58
|
Para utilizar **fiado-type-kit** en tu proyecto, asegúrate de importar los componentes específicos que necesitas de cada dominio. Por ejemplo:
|
|
32
59
|
|
|
33
60
|
```typescript
|
|
61
|
+
import { AccountResponse, AccountCreateRequest } from "@fiado/type-kit/bin/account";
|
|
34
62
|
import { CardRequest } from 'fiado-type-kit/dist/card/dtos/cardRequest.dto';
|
|
35
63
|
import { AccountType } from 'fiado-type-kit/dist/account/enums/accountType.enum';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Instalación
|
|
67
|
+
Para instalar la biblioteca fiado-type-kit en tu proyecto, ejecuta el siguiente comando usando npm:
|
|
68
|
+
|
|
69
|
+
npm i @fiado/type-kit
|
|
70
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AddressResponse } from "../../address/dtos/AddressResponse";
|
|
2
|
+
import { Country } from "../../country/enums/Country";
|
|
3
|
+
export declare class AccountCreateRequest {
|
|
4
|
+
directoryId: string;
|
|
5
|
+
typeOfDirectoryId: string;
|
|
6
|
+
firstName: string;
|
|
7
|
+
lastName: string;
|
|
8
|
+
phoneNumber: string;
|
|
9
|
+
address: AddressResponse;
|
|
10
|
+
email: string;
|
|
11
|
+
dob: string;
|
|
12
|
+
documentNumber: string;
|
|
13
|
+
countryId: Country;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.AccountCreateRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const AddressResponse_1 = require("../../address/dtos/AddressResponse");
|
|
15
|
+
const Country_1 = require("../../country/enums/Country");
|
|
16
|
+
const regex_1 = require("../../helpers/constans/regex");
|
|
17
|
+
const TypeOfDirectoryId_1 = require("../../directory/enums/TypeOfDirectoryId");
|
|
18
|
+
const IsPhoneNumberConstraint_1 = require("../../card/validations/IsPhoneNumberConstraint");
|
|
19
|
+
class AccountCreateRequest {
|
|
20
|
+
}
|
|
21
|
+
exports.AccountCreateRequest = AccountCreateRequest;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
|
|
25
|
+
message: 'directoryId must be a valid UUID v4',
|
|
26
|
+
}),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], AccountCreateRequest.prototype, "directoryId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsEnum)(TypeOfDirectoryId_1.TypeOfDirectoryId),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], AccountCreateRequest.prototype, "typeOfDirectoryId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AccountCreateRequest.prototype, "firstName", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_validator_1.IsString)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], AccountCreateRequest.prototype, "lastName", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, IsPhoneNumberConstraint_1.IsPhoneNumberFiado)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], AccountCreateRequest.prototype, "phoneNumber", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.ValidateNested)(),
|
|
47
|
+
__metadata("design:type", AddressResponse_1.AddressResponse)
|
|
48
|
+
], AccountCreateRequest.prototype, "address", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, class_validator_1.IsEmail)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], AccountCreateRequest.prototype, "email", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, class_validator_1.IsDateString)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], AccountCreateRequest.prototype, "dob", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, class_validator_1.IsString)(),
|
|
59
|
+
(0, class_validator_1.Length)(1, 30),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], AccountCreateRequest.prototype, "documentNumber", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, class_validator_1.IsEnum)(Country_1.Country),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], AccountCreateRequest.prototype, "countryId", void 0);
|
|
@@ -1,85 +1,6 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.AccountResponse = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
const Provider_1 = require("../../provider/enums/Provider");
|
|
15
|
-
const Country_1 = require("../../country/enums/Country");
|
|
16
|
-
const AccountStatus_1 = require("../enums/AccountStatus");
|
|
17
|
-
const TypeOfDirectoryId_1 = require("../../directory/enums/TypeOfDirectoryId");
|
|
18
4
|
class AccountResponse {
|
|
19
5
|
}
|
|
20
6
|
exports.AccountResponse = AccountResponse;
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, class_validator_1.IsString)(),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], AccountResponse.prototype, "id", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, class_validator_1.IsOptional)(),
|
|
27
|
-
(0, class_validator_1.IsString)(),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], AccountResponse.prototype, "typeOfAccountId", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, class_validator_1.IsOptional)(),
|
|
32
|
-
(0, class_validator_1.IsString)(),
|
|
33
|
-
__metadata("design:type", String)
|
|
34
|
-
], AccountResponse.prototype, "externalAccountId", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, class_validator_1.IsOptional)(),
|
|
37
|
-
(0, class_validator_1.IsString)(),
|
|
38
|
-
__metadata("design:type", String)
|
|
39
|
-
], AccountResponse.prototype, "externalSubAccountId", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, class_validator_1.IsEnum)(Provider_1.Provider),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], AccountResponse.prototype, "provider", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, class_validator_1.IsString)(),
|
|
46
|
-
__metadata("design:type", String)
|
|
47
|
-
], AccountResponse.prototype, "directoryId", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, class_validator_1.IsEnum)(TypeOfDirectoryId_1.TypeOfDirectoryId),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], AccountResponse.prototype, "typeOfDirectoryId", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, class_validator_1.IsNumber)(),
|
|
54
|
-
__metadata("design:type", Number)
|
|
55
|
-
], AccountResponse.prototype, "currentBalance", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, class_validator_1.IsNumber)(),
|
|
58
|
-
__metadata("design:type", Number)
|
|
59
|
-
], AccountResponse.prototype, "balanceLock", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, class_validator_1.IsEnum)(Country_1.Country),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], AccountResponse.prototype, "countryId", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, class_validator_1.IsDateString)(),
|
|
66
|
-
__metadata("design:type", String)
|
|
67
|
-
], AccountResponse.prototype, "createDate", void 0);
|
|
68
|
-
__decorate([
|
|
69
|
-
(0, class_validator_1.IsDateString)(),
|
|
70
|
-
__metadata("design:type", String)
|
|
71
|
-
], AccountResponse.prototype, "lastUpdateDate", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, class_validator_1.IsOptional)(),
|
|
74
|
-
(0, class_validator_1.IsString)(),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], AccountResponse.prototype, "accountNumber", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
(0, class_validator_1.IsOptional)(),
|
|
79
|
-
(0, class_validator_1.IsString)(),
|
|
80
|
-
__metadata("design:type", String)
|
|
81
|
-
], AccountResponse.prototype, "routingNumber", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, class_validator_1.IsEnum)(AccountStatus_1.AccountStatus),
|
|
84
|
-
__metadata("design:type", String)
|
|
85
|
-
], AccountResponse.prototype, "status", void 0);
|
|
@@ -0,0 +1,31 @@
|
|
|
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.PocketCreateRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const regex_1 = require("../../helpers/constans/regex");
|
|
15
|
+
class PocketCreateRequest {
|
|
16
|
+
}
|
|
17
|
+
exports.PocketCreateRequest = PocketCreateRequest;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
|
|
21
|
+
message: 'beneficiaryDirectoryId must be a valid UUID v4',
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], PocketCreateRequest.prototype, "beneficiaryDirectoryId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
|
|
28
|
+
message: 'accountId must be a valid UUID v4',
|
|
29
|
+
}),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], PocketCreateRequest.prototype, "accountId", void 0);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
//dtos
|
|
18
|
+
__exportStar(require("./dtos/AccountResponse"), exports);
|
|
19
|
+
__exportStar(require("./dtos/AccountCreateRequest"), exports);
|
|
20
|
+
__exportStar(require("./dtos/PocketCreateRequest"), exports);
|
|
21
|
+
//enums
|
|
22
|
+
__exportStar(require("./enums/AccountStatus"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddressCreateRequest = void 0;
|
|
4
|
+
const AddressBase_1 = require("./AddressBase");
|
|
5
|
+
class AddressCreateRequest extends AddressBase_1.AddressBase {
|
|
6
|
+
}
|
|
7
|
+
exports.AddressCreateRequest = AddressCreateRequest;
|
package/bin/address/index.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export * from './dtos/Shipping';
|
|
2
|
+
export * from './dtos/AddressCreateRequest';
|
|
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';
|
package/bin/address/index.js
CHANGED
|
@@ -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
|
+
//dtos
|
|
17
18
|
__exportStar(require("./dtos/Shipping"), exports);
|
|
19
|
+
__exportStar(require("./dtos/AddressCreateRequest"), 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,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.App = void 0;
|
|
4
|
+
var App;
|
|
5
|
+
(function (App) {
|
|
6
|
+
App["USER"] = "USER";
|
|
7
|
+
App["MERCHANT"] = "MERCHANT";
|
|
8
|
+
App["BACKOFFICE"] = "BACKOFFICE";
|
|
9
|
+
App["AGENT"] = "AGENT";
|
|
10
|
+
App["USER_APP"] = "APP";
|
|
11
|
+
App["USER_WEB"] = "WEB";
|
|
12
|
+
App["HYBRID"] = "HYBRID";
|
|
13
|
+
})(App || (exports.App = App = {}));
|
|
@@ -0,0 +1,46 @@
|
|
|
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.SignUpAdditionalRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const IsPhoneNumberConstraint_1 = require("../../card/validations/IsPhoneNumberConstraint");
|
|
15
|
+
const regex_1 = require("../../helpers/constans/regex");
|
|
16
|
+
class SignUpAdditionalRequest {
|
|
17
|
+
}
|
|
18
|
+
exports.SignUpAdditionalRequest = SignUpAdditionalRequest;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
21
|
+
(0, class_validator_1.IsString)(),
|
|
22
|
+
(0, class_validator_1.Length)(3, 70),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SignUpAdditionalRequest.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
27
|
+
(0, class_validator_1.IsString)(),
|
|
28
|
+
(0, IsPhoneNumberConstraint_1.IsPhoneNumberFiado)(),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], SignUpAdditionalRequest.prototype, "phoneNumber", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, class_validator_1.IsBoolean)(),
|
|
33
|
+
__metadata("design:type", Boolean)
|
|
34
|
+
], SignUpAdditionalRequest.prototype, "mexCreditAdditionalWish", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.Matches)(regex_1.regexUuidV4, {
|
|
38
|
+
message: 'ownerDirectoryId must be a valid UUID v4',
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], SignUpAdditionalRequest.prototype, "ownerDirectoryId", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsString)(),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SignUpAdditionalRequest.prototype, "ownerRelation", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as authentication from './dtos/SignUpAdditionalRequest';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.authentication = void 0;
|
|
27
|
+
//dtos
|
|
28
|
+
exports.authentication = __importStar(require("./dtos/SignUpAdditionalRequest"));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TypeOfDirectoryId } from "../../directory";
|
|
2
|
+
import { CountryId } from "../../country";
|
|
3
|
+
export declare class CardBalanceResponse {
|
|
4
|
+
cardBalanceId: string;
|
|
5
|
+
currentBalance: number;
|
|
6
|
+
directoryId: string;
|
|
7
|
+
typeOfDirectoryId: TypeOfDirectoryId;
|
|
8
|
+
currencyId: CountryId;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AddressCreateRequest } from "../../address";
|
|
2
|
+
export declare class CardCreateAdditionalRequest {
|
|
3
|
+
name: string;
|
|
4
|
+
lastNamePaternal: string;
|
|
5
|
+
lastNameMaternal: string;
|
|
6
|
+
phoneNumber: string;
|
|
7
|
+
dateOfBirth: string;
|
|
8
|
+
ownerRelation: string;
|
|
9
|
+
address: AddressCreateRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.CardCreateAdditionalRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const IsNotEmpty_1 = require("class-validator/types/decorator/common/IsNotEmpty");
|
|
15
|
+
const IsPhoneNumberConstraint_1 = require("../validations/IsPhoneNumberConstraint");
|
|
16
|
+
const class_transformer_1 = require("class-transformer");
|
|
17
|
+
const address_1 = require("../../address");
|
|
18
|
+
class CardCreateAdditionalRequest {
|
|
19
|
+
}
|
|
20
|
+
exports.CardCreateAdditionalRequest = CardCreateAdditionalRequest;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, IsNotEmpty_1.IsNotEmpty)(),
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.Length)(3, 40),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CardCreateAdditionalRequest.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, IsNotEmpty_1.IsNotEmpty)(),
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.Length)(3, 20),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CardCreateAdditionalRequest.prototype, "lastNamePaternal", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, IsNotEmpty_1.IsNotEmpty)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.Length)(3, 20),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CardCreateAdditionalRequest.prototype, "lastNameMaternal", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, IsNotEmpty_1.IsNotEmpty)(),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, IsPhoneNumberConstraint_1.IsPhoneNumberFiado)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], CardCreateAdditionalRequest.prototype, "phoneNumber", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsDateString)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], CardCreateAdditionalRequest.prototype, "dateOfBirth", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, IsNotEmpty_1.IsNotEmpty)(),
|
|
51
|
+
(0, class_validator_1.IsString)(),
|
|
52
|
+
(0, class_validator_1.Length)(3, 20),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], CardCreateAdditionalRequest.prototype, "ownerRelation", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.ValidateNested)(),
|
|
57
|
+
(0, class_transformer_1.Type)(() => address_1.AddressCreateRequest),
|
|
58
|
+
__metadata("design:type", address_1.AddressCreateRequest)
|
|
59
|
+
], CardCreateAdditionalRequest.prototype, "address", 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 CardCreateRequest {
|
|
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
|
+
}
|