@fiado/type-kit 2.1.39 → 2.1.41
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 +556 -54
- package/bin/card/validations/CardUpdateKeyConstraint.js +2 -2
- package/bin/card/validations/IsPhoneNumberConstraint.js +2 -2
- package/bin/index.d.ts +1 -0
- package/bin/index.js +19 -8
- package/bin/transactionProcessor/enums/AsyncTxStatusEnum.d.ts +2 -1
- package/bin/transactionProcessor/enums/AsyncTxStatusEnum.js +1 -0
- package/bin/zendeskMessaging/index.d.ts +3 -0
- package/bin/zendeskMessaging/index.js +19 -0
- package/bin/zendeskMessaging/interfaces/INormalizedNotificationEvent.d.ts +21 -0
- package/bin/zendeskMessaging/interfaces/INormalizedNotificationEvent.js +2 -0
- package/bin/zendeskMessaging/interfaces/ISunshineConversations.d.ts +15 -0
- package/bin/zendeskMessaging/interfaces/ISunshineConversations.js +2 -0
- package/bin/zendeskMessaging/interfaces/IZendeskWebhook.d.ts +51 -0
- package/bin/zendeskMessaging/interfaces/IZendeskWebhook.js +2 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/transactionProcessor/enums/AsyncTxStatusEnum.ts +1 -0
- package/src/zendeskMessaging/index.ts +3 -0
- package/src/zendeskMessaging/interfaces/INormalizedNotificationEvent.ts +21 -0
- package/src/zendeskMessaging/interfaces/ISunshineConversations.ts +14 -0
- package/src/zendeskMessaging/interfaces/IZendeskWebhook.ts +40 -0
- package/bin/bankAccount/dtos/ExternalAccountType.d.ts +0 -4
- package/bin/bankAccount/dtos/ExternalAccountType.js +0 -6
- package/bin/centralPayments/dtos/CentralPaymentsDocumentImages.d.ts +0 -6
- package/bin/centralPayments/dtos/CentralPaymentsDocumentImages.js +0 -6
- package/bin/centralPayments/dtos/CentralPaymentsDocumentUploadRequest.d.ts +0 -6
- package/bin/centralPayments/dtos/CentralPaymentsDocumentUploadRequest.js +0 -6
- package/bin/cognitoConnector/dtos/SignUpBackofficeRequest.d.ts +0 -13
- package/bin/cognitoConnector/dtos/SignUpBackofficeRequest.js +0 -71
- package/bin/directorySetting/dtos/DirectorySettingCreateResponse.d.ts +0 -0
- package/bin/directorySetting/dtos/DirectorySettingCreateResponse.js +0 -0
- package/bin/pricelist/dtos/GetPriceListDirectoriesResponse.d.ts +0 -28
- package/bin/pricelist/dtos/GetPriceListDirectoriesResponse.js +0 -6
- package/bin/services/dtos/GetMembershipListAppResponse.d.ts +0 -4
- package/bin/services/dtos/GetMembershipListAppResponse.js +0 -6
- package/bin/services/dtos/GetServiceMembershipListAResponse.d.ts +0 -4
- package/bin/services/dtos/GetServiceMembershipListAResponse.js +0 -6
- package/bin/services/enums/ServiceProviderEnum.d.ts +0 -5
- package/bin/services/enums/ServiceProviderEnum.js +0 -9
package/README.md
CHANGED
|
@@ -1,70 +1,572 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
**fiado-type-kit** es una biblioteca TypeScript diseñada para facilitar el desarrollo de funciones AWS Lambda al proporcionar un conjunto estructurado de Data Transfer Objects (DTOs), enumeraciones y constantes. Está organizada por dominios específicos (`card`, `account`, `directory`, `otros`) para mejorar la modularidad y la reutilización del código en proyectos de AWS Lambda.
|
|
3
|
+
# Fiado Type Kit
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
### Biblioteca de DTOs, Enums y Tipos Compartidos para el Ecosistema Fiado
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/)
|
|
8
|
+
[](https://www.typescriptlang.org/)
|
|
9
|
+
[](https://github.com/typestack/class-validator)
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Tabla de Contenidos
|
|
16
|
+
|
|
17
|
+
- [Descripcion General](#descripcion-general)
|
|
18
|
+
- [Arquitectura](#arquitectura)
|
|
19
|
+
- [Instalacion](#instalacion)
|
|
20
|
+
- [Dominios Disponibles](#dominios-disponibles)
|
|
21
|
+
- [Uso](#uso)
|
|
22
|
+
- [Convenciones de Desarrollo](#convenciones-de-desarrollo)
|
|
23
|
+
- [Estructura de Modulos](#estructura-de-modulos)
|
|
24
|
+
- [Tipos Especiales](#tipos-especiales)
|
|
25
|
+
- [Dependencias](#dependencias)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Descripcion General
|
|
30
|
+
|
|
31
|
+
`@fiado/type-kit` es la **biblioteca central de tipos** del ecosistema Fiado que proporciona:
|
|
32
|
+
|
|
33
|
+
- **DTOs (Data Transfer Objects)**: Clases tipadas para requests y responses de APIs
|
|
34
|
+
- **Enums**: Enumeraciones para estados, tipos y categorias del negocio
|
|
35
|
+
- **Entities**: Entidades base para modelos de datos
|
|
36
|
+
- **Interfaces**: Contratos compartidos entre microservicios
|
|
37
|
+
- **Validaciones**: Decoradores de `class-validator` para validacion de entrada
|
|
38
|
+
|
|
39
|
+
### Proposito
|
|
40
|
+
|
|
41
|
+
En una arquitectura de microservicios, es fundamental mantener **consistencia en los tipos de datos** que se intercambian entre servicios. Esta biblioteca:
|
|
42
|
+
|
|
43
|
+
- **Centraliza** todas las definiciones de tipos en un solo lugar
|
|
44
|
+
- **Garantiza** que todos los microservicios usen las mismas estructuras
|
|
45
|
+
- **Facilita** la validacion de datos de entrada con decoradores
|
|
46
|
+
- **Reduce** duplicacion de codigo entre proyectos
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Arquitectura
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
+------------------+
|
|
54
|
+
| @fiado/type-kit |
|
|
55
|
+
+--------+---------+
|
|
56
|
+
|
|
|
57
|
+
+--------------------+--------------------+
|
|
58
|
+
| | |
|
|
59
|
+
v v v
|
|
60
|
+
+---------------+ +---------------+ +---------------+
|
|
61
|
+
| Lambda Card | | Lambda Account| | Lambda Trans |
|
|
62
|
+
| Microservice | | Microservice | | Microservice |
|
|
63
|
+
+---------------+ +---------------+ +---------------+
|
|
64
|
+
| | |
|
|
65
|
+
+--------------------+--------------------+
|
|
66
|
+
|
|
|
67
|
+
v
|
|
68
|
+
+------------------+
|
|
69
|
+
| API Gateway |
|
|
70
|
+
+------------------+
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Flujo de Tipos
|
|
74
|
+
|
|
75
|
+
1. **Request**: Cliente envia datos -> API Gateway -> Lambda valida con DTOs de Request
|
|
76
|
+
2. **Procesamiento**: Lambda usa Enums y Entities para logica de negocio
|
|
77
|
+
3. **Response**: Lambda retorna datos usando DTOs de Response -> Cliente
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Instalacion
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install @fiado/type-kit
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Peer Dependencies
|
|
88
|
+
|
|
89
|
+
Esta biblioteca no tiene peer dependencies, pero utiliza internamente:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"class-transformer": "^0.5.1",
|
|
94
|
+
"class-validator": "^0.14.2"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Dominios Disponibles
|
|
101
|
+
|
|
102
|
+
La biblioteca esta organizada en **60+ dominios** que cubren todas las areas del negocio:
|
|
103
|
+
|
|
104
|
+
### Servicios Core
|
|
105
|
+
|
|
106
|
+
| Dominio | Descripcion | Contenido |
|
|
107
|
+
|---------|-------------|-----------|
|
|
108
|
+
| `account` | Cuentas bancarias y operaciones | 44 DTOs, 12 Enums |
|
|
109
|
+
| `card` | Tarjetas fisicas y virtuales | 40 DTOs, 26 Enums |
|
|
110
|
+
| `transaction` | Transacciones y movimientos | 24 DTOs, 6 Enums |
|
|
111
|
+
| `directory` | Directorios de usuarios | 8 DTOs, 6 Enums |
|
|
112
|
+
| `identity` | Verificacion de identidad (KYC) | 7 DTOs, 8 Enums |
|
|
113
|
+
| `authentication` | Autenticacion y sesiones | 10 DTOs |
|
|
114
|
+
|
|
115
|
+
### Servicios de Pago
|
|
116
|
+
|
|
117
|
+
| Dominio | Descripcion | Contenido |
|
|
118
|
+
|---------|-------------|-----------|
|
|
119
|
+
| `transactionProcessor` | Procesamiento de transacciones | 39 DTOs, 7 Enums |
|
|
120
|
+
| `centralPayments` | Pagos centralizados | 14 DTOs/Enums |
|
|
121
|
+
| `stpSpei` | Transferencias SPEI | 10 DTOs/Enums |
|
|
122
|
+
| `servicePayment` | Pago de servicios | 4 DTOs/Enums |
|
|
123
|
+
| `collector` | Cobranza | 14 DTOs/Enums |
|
|
124
|
+
|
|
125
|
+
### Servicios de Usuario
|
|
126
|
+
|
|
127
|
+
| Dominio | Descripcion | Contenido |
|
|
128
|
+
|---------|-------------|-----------|
|
|
129
|
+
| `beneficiary` | Beneficiarios de transferencias | 5 DTOs/Enums |
|
|
130
|
+
| `bankAccount` | Cuentas bancarias externas | 10 DTOs/Enums |
|
|
131
|
+
| `address` | Direcciones | 24 DTOs/Enums |
|
|
132
|
+
| `contactInfo` | Informacion de contacto | 9 DTOs/Enums |
|
|
133
|
+
| `group` | Grupos de usuarios | 11 DTOs/Enums |
|
|
134
|
+
| `role` | Roles y permisos | 9 DTOs/Enums |
|
|
135
|
+
|
|
136
|
+
### Servicios de Riesgo
|
|
7
137
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
138
|
+
| Dominio | Descripcion | Contenido |
|
|
139
|
+
|---------|-------------|-----------|
|
|
140
|
+
| `riskProfile` | Perfiles de riesgo | 13 DTOs, 10 Enums |
|
|
141
|
+
| `fraudPreventionEngine` | Prevencion de fraude | 5 DTOs/Enums |
|
|
142
|
+
| `blacklist` | Listas negras | 5 DTOs/Enums |
|
|
143
|
+
|
|
144
|
+
### Servicios de Negocio
|
|
145
|
+
|
|
146
|
+
| Dominio | Descripcion | Contenido |
|
|
147
|
+
|---------|-------------|-----------|
|
|
148
|
+
| `issuanceBusiness` | Emision de tarjetas | 6 DTOs/Enums |
|
|
149
|
+
| `pricelist` | Listas de precios | 9 DTOs/Enums |
|
|
150
|
+
| `services` | Catalogo de servicios | 18 DTOs/Enums |
|
|
151
|
+
| `productCatalog` | Catalogo de productos | 7 DTOs/Enums |
|
|
152
|
+
| `contract` | Contratos | 3 DTOs/Enums |
|
|
153
|
+
| `creditContract` | Contratos de credito | 3 DTOs/Enums |
|
|
154
|
+
|
|
155
|
+
### Servicios de Comunicacion
|
|
156
|
+
|
|
157
|
+
| Dominio | Descripcion | Contenido |
|
|
158
|
+
|---------|-------------|-----------|
|
|
159
|
+
| `notificationMessages` | Mensajes y notificaciones | 4 DTOs, 2 Enums |
|
|
160
|
+
| `notificationWS` | WebSocket notifications | 2 DTOs/Enums |
|
|
161
|
+
| `helpdesk` | Soporte al cliente | 3 DTOs/Enums |
|
|
162
|
+
|
|
163
|
+
### Servicios de Infraestructura
|
|
164
|
+
|
|
165
|
+
| Dominio | Descripcion | Contenido |
|
|
166
|
+
|---------|-------------|-----------|
|
|
167
|
+
| `header` | Token payload de JWT | TokenPayload |
|
|
168
|
+
| `eventBridge` | Mensajes de EventBridge | EventBridgeMessageRequest |
|
|
169
|
+
| `genericMessage` | Mensajes genericos | GenericMessageSourceEnum |
|
|
170
|
+
| `apiResponse` | Respuesta estandar de API | FiadoApiResponse |
|
|
171
|
+
| `queue` | Tipos de colas | 1 DTO |
|
|
172
|
+
|
|
173
|
+
### Otros Dominios
|
|
174
|
+
|
|
175
|
+
| Dominio | Descripcion |
|
|
176
|
+
|---------|-------------|
|
|
177
|
+
| `activity` | Actividades de usuario |
|
|
178
|
+
| `app` | Configuracion de aplicacion |
|
|
179
|
+
| `auth` | Autorizacion |
|
|
180
|
+
| `bbvaRst` | Integracion BBVA |
|
|
181
|
+
| `cnbv` | Reportes CNBV |
|
|
182
|
+
| `cognitoConnector` | Integracion Cognito |
|
|
183
|
+
| `country` | Paises y regiones |
|
|
184
|
+
| `currency` | Monedas |
|
|
185
|
+
| `device` | Dispositivos |
|
|
186
|
+
| `exchangeRate` | Tipos de cambio |
|
|
187
|
+
| `observations` | Observaciones KYC |
|
|
188
|
+
| `p2pContact` | Contactos P2P |
|
|
189
|
+
| `provider` | Proveedores |
|
|
190
|
+
| `sessionActivity` | Actividad de sesion |
|
|
191
|
+
| `stpAccount` | Cuentas STP |
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Uso
|
|
196
|
+
|
|
197
|
+
### Importacion por Dominio (Recomendado)
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
// Importar desde el dominio especifico
|
|
201
|
+
import {
|
|
202
|
+
AccountCreateRequest,
|
|
203
|
+
AccountCreateResponse,
|
|
204
|
+
AccountLevelEnum,
|
|
205
|
+
BankAccountTypeEnum
|
|
206
|
+
} from "@fiado/type-kit/bin/account";
|
|
207
|
+
|
|
208
|
+
import {
|
|
209
|
+
CardActivateRequest,
|
|
210
|
+
CardResponse,
|
|
211
|
+
CardType,
|
|
212
|
+
CardIssuanceStatus
|
|
213
|
+
} from "@fiado/type-kit/bin/card";
|
|
214
|
+
|
|
215
|
+
import {
|
|
216
|
+
TransactionCreateRequest,
|
|
217
|
+
TransactionStatusEnum,
|
|
218
|
+
OperationEnum
|
|
219
|
+
} from "@fiado/type-kit/bin/transaction";
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Importacion con Namespace
|
|
43
223
|
|
|
44
224
|
```typescript
|
|
45
|
-
import {
|
|
225
|
+
import { Account, Card, Transaction } from "@fiado/type-kit";
|
|
226
|
+
|
|
227
|
+
// Usar con namespace
|
|
228
|
+
const request: Account.AccountCreateRequest = { ... };
|
|
229
|
+
const cardType: Card.CardType = Card.CardType.VIRTUAL;
|
|
230
|
+
const status: Transaction.TransactionStatusEnum = Transaction.TransactionStatusEnum.COMPLETED;
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Ejemplo: Crear una Cuenta
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
import {
|
|
237
|
+
AccountCreateRequest,
|
|
238
|
+
AccountCreateResponse,
|
|
239
|
+
BankAccountTypeEnum,
|
|
240
|
+
AccountLevelEnum
|
|
241
|
+
} from "@fiado/type-kit/bin/account";
|
|
242
|
+
|
|
243
|
+
async function createAccount(data: AccountCreateRequest): Promise<AccountCreateResponse> {
|
|
244
|
+
// Validar que el tipo de cuenta sea valido
|
|
245
|
+
if (data.accountType === BankAccountTypeEnum.SAVINGS) {
|
|
246
|
+
// Logica para cuenta de ahorro
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Verificar nivel de cuenta
|
|
250
|
+
if (data.level === AccountLevelEnum.LEVEL_2) {
|
|
251
|
+
// Requiere verificacion adicional
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return { accountId: "...", status: "CREATED" };
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Ejemplo: Procesar Transaccion
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import {
|
|
262
|
+
TransactionCreateRequest,
|
|
263
|
+
TransactionCreateResponse,
|
|
264
|
+
TransactionStatusEnum,
|
|
265
|
+
OperationEnum
|
|
266
|
+
} from "@fiado/type-kit/bin/transaction";
|
|
267
|
+
|
|
268
|
+
async function processTransaction(
|
|
269
|
+
request: TransactionCreateRequest
|
|
270
|
+
): Promise<TransactionCreateResponse> {
|
|
271
|
+
|
|
272
|
+
if (request.operation === OperationEnum.CREDIT) {
|
|
273
|
+
// Procesar credito
|
|
274
|
+
} else if (request.operation === OperationEnum.DEBIT) {
|
|
275
|
+
// Procesar debito
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return {
|
|
279
|
+
transactionId: "...",
|
|
280
|
+
status: TransactionStatusEnum.COMPLETED
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Ejemplo: Validar Request con class-validator
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
import { validate } from 'class-validator';
|
|
289
|
+
import { plainToClass } from 'class-transformer';
|
|
290
|
+
import { CardActivateRequest } from "@fiado/type-kit/bin/card";
|
|
291
|
+
|
|
292
|
+
async function validateRequest(body: any): Promise<CardActivateRequest> {
|
|
293
|
+
const request = plainToClass(CardActivateRequest, body);
|
|
294
|
+
const errors = await validate(request);
|
|
295
|
+
|
|
296
|
+
if (errors.length > 0) {
|
|
297
|
+
throw new Error(`Validation failed: ${errors.map(e => e.toString()).join(', ')}`);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return request;
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Convenciones de Desarrollo
|
|
307
|
+
|
|
308
|
+
### Nomenclatura de DTOs
|
|
309
|
+
|
|
310
|
+
| Tipo | Patron | Ejemplo |
|
|
311
|
+
|------|--------|---------|
|
|
312
|
+
| **Request** | `{Entity}{Action}Request` | `CardActivateRequest`, `AccountCreateRequest` |
|
|
313
|
+
| **Response** | `{Entity}{Action}Response` | `CardBalanceResponse`, `AccountCreateResponse` |
|
|
314
|
+
| **Query** | `{Entity}QueryParams` | `TransactionQueryParams` |
|
|
315
|
+
| **Item** | `{Entity}Item` | `TransactionItem`, `PocketItem` |
|
|
316
|
+
|
|
317
|
+
### Nomenclatura de Enums
|
|
318
|
+
|
|
319
|
+
| Tipo | Patron | Ejemplo |
|
|
320
|
+
|------|--------|---------|
|
|
321
|
+
| **Status** | `{Entity}StatusEnum` | `CardIssuanceStatus`, `TransactionStatusEnum` |
|
|
322
|
+
| **Type** | `{Entity}TypeEnum` | `BankAccountTypeEnum`, `CardType` |
|
|
323
|
+
| **Operation** | `{Action}Enum` | `OperationEnum`, `PocketOperationTypeEnum` |
|
|
324
|
+
|
|
325
|
+
### Validaciones con class-validator
|
|
326
|
+
|
|
327
|
+
**Requests**: DEBEN incluir decoradores de validacion
|
|
328
|
+
|
|
329
|
+
```typescript
|
|
330
|
+
import { IsNotEmpty, IsString, IsNumber, IsEnum, IsOptional } from 'class-validator';
|
|
46
331
|
|
|
47
332
|
export class CardActivateRequest {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
333
|
+
@IsNotEmpty()
|
|
334
|
+
@IsString()
|
|
335
|
+
readonly cardId: string;
|
|
336
|
+
|
|
337
|
+
@IsNotEmpty()
|
|
338
|
+
@IsString()
|
|
339
|
+
readonly userId: string;
|
|
51
340
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
341
|
+
@IsOptional()
|
|
342
|
+
@IsEnum(ActivationMethod)
|
|
343
|
+
readonly method?: ActivationMethod;
|
|
55
344
|
}
|
|
56
345
|
```
|
|
57
|
-
|
|
58
|
-
|
|
346
|
+
|
|
347
|
+
**Responses**: NO deben incluir validaciones
|
|
59
348
|
|
|
60
349
|
```typescript
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
350
|
+
export class CardActivateResponse {
|
|
351
|
+
cardId: string;
|
|
352
|
+
status: CardIssuanceStatus;
|
|
353
|
+
activatedAt: string;
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Estructura de Modulo
|
|
358
|
+
|
|
359
|
+
Cada dominio sigue esta estructura:
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
{domain}/
|
|
363
|
+
├── dtos/ # Data Transfer Objects
|
|
364
|
+
│ ├── {Entity}Request.ts
|
|
365
|
+
│ ├── {Entity}Response.ts
|
|
366
|
+
│ └── Internal/ # DTOs internos (opcional)
|
|
367
|
+
├── enums/ # Enumeraciones
|
|
368
|
+
│ ├── {Entity}StatusEnum.ts
|
|
369
|
+
│ └── {Entity}TypeEnum.ts
|
|
370
|
+
├── entities/ # Entidades base (opcional)
|
|
371
|
+
│ └── {Entity}EntityBase.ts
|
|
372
|
+
├── constants/ # Constantes (opcional)
|
|
373
|
+
│ └── {entity}Constants.ts
|
|
374
|
+
└── index.ts # Exportaciones del modulo
|
|
64
375
|
```
|
|
65
376
|
|
|
66
|
-
|
|
67
|
-
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Estructura de Modulos
|
|
380
|
+
|
|
381
|
+
### Ejemplo: Modulo Account
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
account/
|
|
385
|
+
├── dtos/
|
|
386
|
+
│ ├── AccountCreateRequest.ts
|
|
387
|
+
│ ├── AccountCreateResponse.ts
|
|
388
|
+
│ ├── AccountUpdateRequest.ts
|
|
389
|
+
│ ├── GetAccountResponse.ts
|
|
390
|
+
│ ├── GetAccountBalanceResponse.ts
|
|
391
|
+
│ ├── BankAccountP2pTransferRequest.ts
|
|
392
|
+
│ ├── BankAccountP2pTransferResponse.ts
|
|
393
|
+
│ ├── SPEITransferCreateRequest.ts
|
|
394
|
+
│ ├── SPEITransferResponse.ts
|
|
395
|
+
│ └── ... (44 DTOs total)
|
|
396
|
+
├── entities/
|
|
397
|
+
│ ├── AccountEntityBase.ts
|
|
398
|
+
│ └── BankInfo.ts
|
|
399
|
+
├── enums/
|
|
400
|
+
│ ├── AccountEntityStatusEnum.ts
|
|
401
|
+
│ ├── BankAccountTypeEnum.ts
|
|
402
|
+
│ ├── AccountLevelEnum.ts
|
|
403
|
+
│ ├── SpeiTransferStatusEnum.ts
|
|
404
|
+
│ └── ... (12 Enums total)
|
|
405
|
+
└── index.ts
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Ejemplo: Modulo Card
|
|
409
|
+
|
|
410
|
+
```
|
|
411
|
+
card/
|
|
412
|
+
├── dtos/
|
|
413
|
+
│ ├── CardActivateRequest.ts
|
|
414
|
+
│ ├── CardApplicationRequest.ts
|
|
415
|
+
│ ├── CardUpdateRequest.ts
|
|
416
|
+
│ ├── CardResponse.ts
|
|
417
|
+
│ ├── CardBalanceResponse.ts
|
|
418
|
+
│ ├── CardSensitiveInformationResponse.ts
|
|
419
|
+
│ └── Internal/
|
|
420
|
+
│ ├── CreateBankAccountCardRequest.ts
|
|
421
|
+
│ ├── CreateBankAccountCardResponse.ts
|
|
422
|
+
│ ├── ActivateBankAccountCardRequest.ts
|
|
423
|
+
│ └── ... (DTOs internos)
|
|
424
|
+
├── enums/
|
|
425
|
+
│ ├── CardType.ts
|
|
426
|
+
│ ├── CardIssuanceStatus.ts
|
|
427
|
+
│ ├── Brand.ts
|
|
428
|
+
│ ├── VirtualOrPhysical.ts
|
|
429
|
+
│ ├── ShippingStatus.ts
|
|
430
|
+
│ └── issuance/
|
|
431
|
+
│ ├── KycStatus.ts
|
|
432
|
+
│ ├── UserStatus.ts
|
|
433
|
+
│ └── IssuanceFlow.ts
|
|
434
|
+
├── validations/
|
|
435
|
+
│ └── cardValidations.ts
|
|
436
|
+
└── index.ts
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## Tipos Especiales
|
|
442
|
+
|
|
443
|
+
### TokenPayload
|
|
444
|
+
|
|
445
|
+
Interface para el payload del token JWT de Cognito:
|
|
446
|
+
|
|
447
|
+
```typescript
|
|
448
|
+
import { TokenPayload } from "@fiado/type-kit/bin/header";
|
|
449
|
+
|
|
450
|
+
interface TokenPayload {
|
|
451
|
+
directoryId: string; // ID del directorio
|
|
452
|
+
typeOfDirectoryId: TypeOfDirectoryId;
|
|
453
|
+
peopleId: string | null; // ID de persona
|
|
454
|
+
sub: string; // Subject (Cognito user ID)
|
|
455
|
+
app: string; // Aplicacion origen
|
|
456
|
+
issuer: string; // Emisor del token
|
|
457
|
+
scope: string; // Scope del token
|
|
458
|
+
phoneNumber?: string | null; // Telefono
|
|
459
|
+
status: Status | null; // Estado del usuario
|
|
460
|
+
id: string; // ID interno
|
|
461
|
+
profileId?: string | null; // ID de perfil
|
|
462
|
+
email?: string | null; // Email
|
|
463
|
+
event_id?: string; // ID de evento
|
|
464
|
+
sponsorDirectoryId?: string | null; // Sponsor
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### FiadoApiResponse
|
|
469
|
+
|
|
470
|
+
Interface estandar para respuestas de API:
|
|
471
|
+
|
|
472
|
+
```typescript
|
|
473
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse";
|
|
474
|
+
|
|
475
|
+
interface FiadoApiResponse<T> {
|
|
476
|
+
data: T; // Datos de respuesta
|
|
477
|
+
date: string | null; // Timestamp
|
|
478
|
+
code: string | null; // Codigo de respuesta
|
|
479
|
+
msg: string | null; // Mensaje
|
|
480
|
+
description: string | null; // Descripcion
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### EventBridgeMessageRequest
|
|
485
|
+
|
|
486
|
+
Clase para mensajes de EventBridge:
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
import { EventBridgeMessageRequest } from "@fiado/type-kit/bin/eventBridge";
|
|
490
|
+
|
|
491
|
+
class EventBridgeMessageRequest<T> extends GenericMessageRequest<T> {
|
|
492
|
+
// Hereda propiedades de GenericMessageRequest
|
|
493
|
+
// - source: GenericMessageSourceEnum
|
|
494
|
+
// - payload: T
|
|
495
|
+
// - eventType: string
|
|
496
|
+
}
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Dependencias
|
|
502
|
+
|
|
503
|
+
### Runtime
|
|
504
|
+
|
|
505
|
+
| Dependencia | Version | Proposito |
|
|
506
|
+
|-------------|---------|-----------|
|
|
507
|
+
| `class-transformer` | ^0.5.1 | Transformacion de objetos planos a clases |
|
|
508
|
+
| `class-validator` | ^0.14.2 | Validacion de DTOs con decoradores |
|
|
509
|
+
|
|
510
|
+
### Desarrollo
|
|
511
|
+
|
|
512
|
+
| Dependencia | Version | Proposito |
|
|
513
|
+
|-------------|---------|-----------|
|
|
514
|
+
| `@types/node` | ^20.11.20 | Tipos de Node.js |
|
|
515
|
+
| `typescript` | ^5.3.3 | Compilador TypeScript |
|
|
516
|
+
|
|
517
|
+
---
|
|
518
|
+
|
|
519
|
+
## Compilacion y Publicacion
|
|
520
|
+
|
|
521
|
+
### Build
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
npm run build
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
Genera archivos `.js` y `.d.ts` en el directorio `bin/`.
|
|
528
|
+
|
|
529
|
+
### Test
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
npm test
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
### Publicacion
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
npm version patch|minor|major
|
|
539
|
+
npm publish
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
## Estructura del Proyecto
|
|
545
|
+
|
|
546
|
+
```
|
|
547
|
+
fiado-type-kit/
|
|
548
|
+
├── src/ # Codigo fuente
|
|
549
|
+
│ ├── index.ts # Exportaciones principales
|
|
550
|
+
│ ├── account/ # Dominio Account (59 items)
|
|
551
|
+
│ ├── card/ # Dominio Card (69 items)
|
|
552
|
+
│ ├── transaction/ # Dominio Transaction (31 items)
|
|
553
|
+
│ ├── transactionProcessor/ # Dominio TransactionProcessor (47 items)
|
|
554
|
+
│ ├── directory/ # Dominio Directory (15 items)
|
|
555
|
+
│ ├── identity/ # Dominio Identity (16 items)
|
|
556
|
+
│ ├── riskProfile/ # Dominio RiskProfile (24 items)
|
|
557
|
+
│ ├── ... (60+ dominios)
|
|
558
|
+
│ └── header/ # TokenPayload
|
|
559
|
+
├── bin/ # Archivos compilados
|
|
560
|
+
├── package.json
|
|
561
|
+
├── tsconfig.json
|
|
562
|
+
└── README.md
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
<div align="center">
|
|
568
|
+
|
|
569
|
+
**Fiado Inc.** | @fiado/type-kit v2.1.40
|
|
68
570
|
|
|
69
|
-
|
|
571
|
+
</div>
|
|
70
572
|
|
|
@@ -6,7 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.CardUpdateKeyConstraint = exports.IsReasonRequiredForCancelledStatusConstraint = void 0;
|
|
10
|
+
exports.IsValueValid = IsValueValid;
|
|
10
11
|
const class_validator_1 = require("class-validator");
|
|
11
12
|
const Status_1 = require("../enums/Status");
|
|
12
13
|
const UpdateKey_1 = require("../enums/UpdateKey");
|
|
@@ -70,4 +71,3 @@ function IsValueValid(validationOptions) {
|
|
|
70
71
|
});
|
|
71
72
|
};
|
|
72
73
|
}
|
|
73
|
-
exports.IsValueValid = IsValueValid;
|
|
@@ -6,7 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.IsPhoneNumberConstraint = void 0;
|
|
10
|
+
exports.IsPhoneNumberFiado = IsPhoneNumberFiado;
|
|
10
11
|
const class_validator_1 = require("class-validator");
|
|
11
12
|
const regex_1 = require("../../helpers/constans/regex");
|
|
12
13
|
let IsPhoneNumberConstraint = class IsPhoneNumberConstraint {
|
|
@@ -36,4 +37,3 @@ function IsPhoneNumberFiado(validationOptions) {
|
|
|
36
37
|
});
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
exports.IsPhoneNumberFiado = IsPhoneNumberFiado;
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -15,16 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Collector = exports.Pricelist = exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = exports.Device = exports.Observations = exports.IssuanceBusiness = exports.Blacklist = exports.CentralPayments = exports.Helpdesk = exports.FiadoApiResponse = exports.Auth = exports.LegalDocumentsBusiness = exports.Role = exports.STPAccount = exports.RiskProfile = exports.FraudPreventionEngine = exports.BBVARst = exports.Stp = exports.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = exports.NotificationMessages = exports.ServicePayment = exports.Header = exports.Identity = exports.Group = exports.File = exports.ExchangeRate = exports.Directory = exports.Currency = exports.Country = exports.Card = exports.Authentication = exports.App = exports.Address = exports.Beneficiary = exports.Activity = exports.Account = exports.Crypto = void 0;
|
|
27
|
-
exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = void 0;
|
|
37
|
+
exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = void 0;
|
|
28
38
|
exports.Crypto = __importStar(require("./crypto"));
|
|
29
39
|
exports.Account = __importStar(require("./account"));
|
|
30
40
|
exports.Activity = __importStar(require("./activity"));
|
|
@@ -81,3 +91,4 @@ exports.Cnbv = __importStar(require("./cnbv"));
|
|
|
81
91
|
exports.PayrollBusiness = __importStar(require("./payroll-business"));
|
|
82
92
|
exports.Event = __importStar(require("./event"));
|
|
83
93
|
exports.NotificationWS = __importStar(require("./notificationWS"));
|
|
94
|
+
exports.ZendeskMessaging = __importStar(require("./zendeskMessaging"));
|
|
@@ -7,4 +7,5 @@ var AsyncTxStatusEnum;
|
|
|
7
7
|
AsyncTxStatusEnum["CANCELLED"] = "CANCELLED";
|
|
8
8
|
AsyncTxStatusEnum["RETURNED"] = "RETURNED";
|
|
9
9
|
AsyncTxStatusEnum["APPROVED"] = "APPROVED";
|
|
10
|
+
AsyncTxStatusEnum["TIMEOUT_ERROR"] = "TIMEOUT_ERROR";
|
|
10
11
|
})(AsyncTxStatusEnum || (exports.AsyncTxStatusEnum = AsyncTxStatusEnum = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
__exportStar(require("./interfaces/IZendeskWebhook"), exports);
|
|
18
|
+
__exportStar(require("./interfaces/INormalizedNotificationEvent"), exports);
|
|
19
|
+
__exportStar(require("./interfaces/ISunshineConversations"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface INormalizedNotificationEvent {
|
|
2
|
+
eventType: 'SUPPORT_MESSAGE_RECEIVED';
|
|
3
|
+
source: 'ZENDESK_MESSAGING';
|
|
4
|
+
timestamp: string;
|
|
5
|
+
correlationId: string;
|
|
6
|
+
payload: {
|
|
7
|
+
userId: string;
|
|
8
|
+
peopleId?: string;
|
|
9
|
+
message: {
|
|
10
|
+
conversationId: string;
|
|
11
|
+
preview: string;
|
|
12
|
+
senderType: 'AGENT' | 'BOT' | 'SYSTEM';
|
|
13
|
+
senderName: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
metadata: {
|
|
17
|
+
zendeskEventId: string;
|
|
18
|
+
zendeskMessageId: string;
|
|
19
|
+
priority: 'NORMAL' | 'HIGH';
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ISunshineConversationParticipant {
|
|
2
|
+
id: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
unreadCount?: number;
|
|
5
|
+
userExternalId?: string;
|
|
6
|
+
lastRead?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ISunshineUser {
|
|
9
|
+
id: string;
|
|
10
|
+
externalId?: string;
|
|
11
|
+
signedUpAt?: string;
|
|
12
|
+
profile?: {
|
|
13
|
+
locale?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface IZendeskMessagingWebhookPayload {
|
|
2
|
+
app: {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
webhook: {
|
|
6
|
+
id: string;
|
|
7
|
+
version: string;
|
|
8
|
+
};
|
|
9
|
+
events: IZendeskMessagingEvent[];
|
|
10
|
+
}
|
|
11
|
+
export interface IZendeskMessagingEvent {
|
|
12
|
+
id: string;
|
|
13
|
+
type: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
payload: {
|
|
16
|
+
conversation: {
|
|
17
|
+
id: string;
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
message: IZendeskMessage;
|
|
21
|
+
user?: IZendeskUser;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface IZendeskMessage {
|
|
25
|
+
id: string;
|
|
26
|
+
received: string;
|
|
27
|
+
content: {
|
|
28
|
+
type: string;
|
|
29
|
+
text?: string;
|
|
30
|
+
};
|
|
31
|
+
author: {
|
|
32
|
+
type: 'user' | 'business';
|
|
33
|
+
userId?: string;
|
|
34
|
+
displayName?: string;
|
|
35
|
+
};
|
|
36
|
+
source?: {
|
|
37
|
+
type: string;
|
|
38
|
+
integrationId?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface IZendeskUser {
|
|
42
|
+
id: string;
|
|
43
|
+
externalId?: string;
|
|
44
|
+
signedUpAt?: string;
|
|
45
|
+
profile?: {
|
|
46
|
+
givenName?: string;
|
|
47
|
+
surname?: string;
|
|
48
|
+
email?: string;
|
|
49
|
+
locale?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface INormalizedNotificationEvent {
|
|
2
|
+
eventType: 'SUPPORT_MESSAGE_RECEIVED';
|
|
3
|
+
source: 'ZENDESK_MESSAGING';
|
|
4
|
+
timestamp: string;
|
|
5
|
+
correlationId: string;
|
|
6
|
+
payload: {
|
|
7
|
+
userId: string;
|
|
8
|
+
peopleId?: string;
|
|
9
|
+
message: {
|
|
10
|
+
conversationId: string;
|
|
11
|
+
preview: string;
|
|
12
|
+
senderType: 'AGENT' | 'BOT' | 'SYSTEM';
|
|
13
|
+
senderName: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
metadata: {
|
|
17
|
+
zendeskEventId: string;
|
|
18
|
+
zendeskMessageId: string;
|
|
19
|
+
priority: 'NORMAL' | 'HIGH';
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ISunshineConversationParticipant {
|
|
2
|
+
id: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
unreadCount?: number;
|
|
5
|
+
userExternalId?: string;
|
|
6
|
+
lastRead?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ISunshineUser {
|
|
10
|
+
id: string;
|
|
11
|
+
externalId?: string;
|
|
12
|
+
signedUpAt?: string;
|
|
13
|
+
profile?: { locale?: string };
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface IZendeskMessagingWebhookPayload {
|
|
2
|
+
app: { id: string };
|
|
3
|
+
webhook: { id: string; version: string };
|
|
4
|
+
events: IZendeskMessagingEvent[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface IZendeskMessagingEvent {
|
|
8
|
+
id: string;
|
|
9
|
+
type: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
payload: {
|
|
12
|
+
conversation: { id: string; type: string };
|
|
13
|
+
message: IZendeskMessage;
|
|
14
|
+
user?: IZendeskUser;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IZendeskMessage {
|
|
19
|
+
id: string;
|
|
20
|
+
received: string;
|
|
21
|
+
content: { type: string; text?: string };
|
|
22
|
+
author: {
|
|
23
|
+
type: 'user' | 'business';
|
|
24
|
+
userId?: string;
|
|
25
|
+
displayName?: string;
|
|
26
|
+
};
|
|
27
|
+
source?: { type: string; integrationId?: string };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IZendeskUser {
|
|
31
|
+
id: string;
|
|
32
|
+
externalId?: string;
|
|
33
|
+
signedUpAt?: string;
|
|
34
|
+
profile?: {
|
|
35
|
+
givenName?: string;
|
|
36
|
+
surname?: string;
|
|
37
|
+
email?: string;
|
|
38
|
+
locale?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { IdentificationDocument } from "../../identity";
|
|
2
|
-
import { CentralPaymentsDocumentImages } from "./CentralPaymentsDocumentImages";
|
|
3
|
-
export declare class CentralPaymentsDocumentUploadRequest {
|
|
4
|
-
documentInfo: IdentificationDocument;
|
|
5
|
-
documentImages: CentralPaymentsDocumentImages[];
|
|
6
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CentralPaymentsDocumentUploadRequest = void 0;
|
|
4
|
-
class CentralPaymentsDocumentUploadRequest {
|
|
5
|
-
}
|
|
6
|
-
exports.CentralPaymentsDocumentUploadRequest = CentralPaymentsDocumentUploadRequest;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare class SignUpBackofficeRequest {
|
|
2
|
-
name: string;
|
|
3
|
-
phoneNumber: string;
|
|
4
|
-
countryOfBirth: string;
|
|
5
|
-
MEX_DebitAccountWish: boolean;
|
|
6
|
-
USA_DebitAccountWish: boolean;
|
|
7
|
-
countryOfDomicile: string;
|
|
8
|
-
myReferralCode?: string;
|
|
9
|
-
referralCode?: string;
|
|
10
|
-
groupId?: string;
|
|
11
|
-
isAgent: boolean;
|
|
12
|
-
agentGroupId?: string;
|
|
13
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
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.SignUpBackofficeRequest = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class SignUpBackofficeRequest {
|
|
15
|
-
}
|
|
16
|
-
exports.SignUpBackofficeRequest = SignUpBackofficeRequest;
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, class_validator_1.IsString)(),
|
|
19
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], SignUpBackofficeRequest.prototype, "name", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, class_validator_1.IsString)(),
|
|
24
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], SignUpBackofficeRequest.prototype, "phoneNumber", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, class_validator_1.IsString)(),
|
|
29
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
-
__metadata("design:type", String)
|
|
31
|
-
], SignUpBackofficeRequest.prototype, "countryOfBirth", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, class_validator_1.IsBoolean)(),
|
|
34
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
-
__metadata("design:type", Boolean)
|
|
36
|
-
], SignUpBackofficeRequest.prototype, "MEX_DebitAccountWish", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, class_validator_1.IsBoolean)(),
|
|
39
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
-
__metadata("design:type", Boolean)
|
|
41
|
-
], SignUpBackofficeRequest.prototype, "USA_DebitAccountWish", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, class_validator_1.IsString)(),
|
|
44
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
45
|
-
__metadata("design:type", String)
|
|
46
|
-
], SignUpBackofficeRequest.prototype, "countryOfDomicile", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, class_validator_1.IsString)(),
|
|
49
|
-
(0, class_validator_1.IsOptional)(),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], SignUpBackofficeRequest.prototype, "myReferralCode", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, class_validator_1.IsString)(),
|
|
54
|
-
(0, class_validator_1.IsOptional)(),
|
|
55
|
-
__metadata("design:type", String)
|
|
56
|
-
], SignUpBackofficeRequest.prototype, "referralCode", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, class_validator_1.IsString)(),
|
|
59
|
-
(0, class_validator_1.IsOptional)(),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], SignUpBackofficeRequest.prototype, "groupId", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, class_validator_1.IsBoolean)(),
|
|
64
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
-
__metadata("design:type", Boolean)
|
|
66
|
-
], SignUpBackofficeRequest.prototype, "isAgent", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, class_validator_1.IsString)(),
|
|
69
|
-
(0, class_validator_1.IsOptional)(),
|
|
70
|
-
__metadata("design:type", String)
|
|
71
|
-
], SignUpBackofficeRequest.prototype, "agentGroupId", void 0);
|
|
File without changes
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Company } from "../../company";
|
|
2
|
-
import { Provider } from "../../provider";
|
|
3
|
-
import { ServiceTypeEnum } from "../../services";
|
|
4
|
-
import { ServiceRecurrenceEnum } from "../../services/enums/ServiceRecurrenceEnum";
|
|
5
|
-
export declare class GetPriceListDirectoriesResponse {
|
|
6
|
-
serviceId: string;
|
|
7
|
-
company: Company;
|
|
8
|
-
provider: Provider;
|
|
9
|
-
type: ServiceTypeEnum;
|
|
10
|
-
basePrice: number;
|
|
11
|
-
recurrence: ServiceRecurrenceEnum;
|
|
12
|
-
currencyId: string;
|
|
13
|
-
fees: any;
|
|
14
|
-
taxes: any;
|
|
15
|
-
globalDiscounts: {
|
|
16
|
-
discountType: string;
|
|
17
|
-
discountValue: number;
|
|
18
|
-
}[];
|
|
19
|
-
directories: {
|
|
20
|
-
directoryId: string;
|
|
21
|
-
appliedDiscounts: {
|
|
22
|
-
discountType: string;
|
|
23
|
-
discountValue: number;
|
|
24
|
-
source: string;
|
|
25
|
-
referenceId: string;
|
|
26
|
-
}[];
|
|
27
|
-
}[];
|
|
28
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceProviderEnum = void 0;
|
|
4
|
-
var ServiceProviderEnum;
|
|
5
|
-
(function (ServiceProviderEnum) {
|
|
6
|
-
ServiceProviderEnum["CP"] = "CP";
|
|
7
|
-
ServiceProviderEnum["TERN"] = "TERN";
|
|
8
|
-
ServiceProviderEnum["PAGOCONFIADO"] = "PAGOCONFIADO";
|
|
9
|
-
})(ServiceProviderEnum || (exports.ServiceProviderEnum = ServiceProviderEnum = {}));
|