@fiado/api-invoker 1.1.62 → 1.1.64
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 +64 -64
- package/bin/activity/ActivityApi.d.ts +17 -0
- package/bin/activity/ActivityApi.js +72 -0
- package/bin/activity/index.d.ts +2 -0
- package/bin/activity/index.js +18 -0
- package/bin/activity/interfaces/IActivityApi.d.ts +39 -0
- package/bin/activity/interfaces/IActivityApi.js +2 -0
- package/bin/container.config.js +2 -0
- package/bin/transaction/api/TransactionApi.d.ts +27 -0
- package/bin/transaction/api/TransactionApi.js +56 -0
- package/bin/transaction/api/interfaces/ITransactionApi.d.ts +17 -0
- package/bin/transaction/api/interfaces/ITransactionApi.js +2 -0
- package/bin/transaction/index.d.ts +2 -0
- package/bin/transaction/index.js +2 -0
- package/package.json +28 -28
- package/src/account-beneficiary/AccountBeneficiaryApi.ts +18 -18
- package/src/account-beneficiary/index.ts +2 -2
- package/src/account-beneficiary/interfaces/IAccountBeneficiaryApi.ts +7 -7
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +65 -65
- package/src/account-fiadoinc/index.ts +1 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +32 -32
- package/src/account-fiadosa/AccountFiadoSAApi.ts +32 -32
- package/src/account-fiadosa/index.ts +1 -1
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +13 -13
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +46 -46
- package/src/account-pagoconfiado/index.ts +2 -2
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +24 -24
- package/src/activity-business/ActivityApi.ts +34 -34
- package/src/activity-business/index.ts +5 -5
- package/src/activity-business/interfaces/IActivityApi.ts +9 -9
- package/src/activity-business/queue/ActivityPublisher.ts +28 -28
- package/src/activity-business/queue/IActivityPublisher.ts +4 -4
- package/src/address/AddressApi.ts +46 -46
- package/src/address/index.ts +3 -3
- package/src/address/interfaces/IAddressApi.ts +30 -30
- package/src/authentication/AuthenticationApi.ts +16 -16
- package/src/authentication/index.ts +4 -4
- package/src/authentication/interfaces/IAuthenticationApi.ts +5 -5
- package/src/bankAccount/BankAccountApi.ts +48 -48
- package/src/bankAccount/index.ts +1 -1
- package/src/bankAccount/interfaces/IBankAccountApi.ts +6 -6
- package/src/bbvaRst/api/BBVARstApi.ts +16 -16
- package/src/bbvaRst/api/interfaces/IBBVARstApi.ts +4 -4
- package/src/bbvaRst/index.ts +1 -1
- package/src/card/CardApi.ts +36 -36
- package/src/card/index.ts +3 -3
- package/src/card/interfaces/ICardApi.ts +10 -10
- package/src/cnbv-business/CnbvApi.ts +22 -22
- package/src/cnbv-business/index.ts +4 -4
- package/src/cnbv-business/interfaces/ICnbvApi.ts +6 -6
- package/src/collector/CollectorApi.ts +25 -25
- package/src/collector/index.ts +2 -2
- package/src/collector/interfaces/ICollectorApi.ts +21 -21
- package/src/contactInformation/ContactInformationApi.ts +20 -20
- package/src/contactInformation/index.ts +2 -2
- package/src/contactInformation/interface/IContactInformationApi.ts +8 -8
- package/src/container.config.ts +90 -88
- package/src/contract-generator/ContractGeneratorApi.ts +18 -18
- package/src/contract-generator/index.ts +2 -2
- package/src/contract-generator/interfaces/IContractGeneratorApi.ts +16 -16
- package/src/directory/DirectoryApi.ts +128 -128
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +63 -63
- package/src/exchangeRates/ExchangeRatesApi.ts +27 -27
- package/src/exchangeRates/index.ts +1 -1
- package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -8
- package/src/fiadoMessages/api/FiadoMessagesApi.ts +20 -20
- package/src/fiadoMessages/api/interfaces/IFiadoMessagesApi.ts +2 -2
- package/src/fiadoMessages/index.ts +1 -1
- package/src/fraudPreventionEngine/api/FraudPreventionEngineApi.ts +22 -22
- package/src/fraudPreventionEngine/api/interfaces/IFraudPreventionEngineApi.ts +7 -7
- package/src/fraudPreventionEngine/index.ts +1 -1
- package/src/group/GroupApi.ts +24 -24
- package/src/group/index.ts +1 -1
- package/src/group/interfaces/IGroupApi.ts +23 -23
- package/src/identity/IdentityApi.ts +47 -47
- package/src/identity/index.ts +3 -3
- package/src/identity/interfaces/IIdentityApi.ts +33 -33
- package/src/index.ts +31 -31
- package/src/notificationMessages/index.ts +1 -1
- package/src/notificationMessages/queue/NotificationMessagePublisher.ts +22 -22
- package/src/notificationMessages/queue/interfaces/INotificationMessagesPublisher.ts +4 -4
- package/src/p2pContact/api/P2pContactApi.ts +19 -19
- package/src/p2pContact/api/interfaces/IP2pContactApi.ts +4 -4
- package/src/p2pContact/index.ts +1 -1
- package/src/pomelo/api/PomeloApi.ts +99 -99
- package/src/pomelo/api/interfaces/IPomeloApi.ts +27 -27
- package/src/pomelo/index.ts +1 -1
- package/src/pomeloProcessor/api/PomeloProcessorApi.ts +17 -17
- package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +2 -2
- package/src/pomeloProcessor/index.ts +2 -2
- package/src/product-catalog/ProductCatalogApi.ts +17 -17
- package/src/product-catalog/index.ts +1 -1
- package/src/product-catalog/interfaces/IProductCatalogApi.ts +6 -6
- package/src/riskProfile/api/RiskProfileApi.ts +29 -29
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +10 -10
- package/src/riskProfile/index.ts +4 -4
- package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
- package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
- package/src/sessionActivity/index.ts +2 -2
- package/src/sessionActivity/queue/SessionActivityPublisher.ts +22 -22
- package/src/sessionActivity/queue/interfaces/ISessionActivityPublisher.ts +4 -4
- package/src/stpAccount/api/STPAccountApi.ts +111 -111
- package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -7
- package/src/stpAccount/index.ts +1 -1
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +40 -40
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +13 -13
- package/src/stpServicePayment/index.ts +1 -1
- package/src/stpSpei/api/StpSpeiApi.ts +32 -32
- package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +6 -6
- package/src/stpSpei/index.ts +1 -1
- package/src/tern/api/TernApi.ts +137 -137
- package/src/tern/api/interfaces/ITernApi.ts +38 -38
- package/src/tern/index.ts +1 -1
- package/src/transaction/api/TransactionApi.ts +51 -0
- package/src/transaction/api/interfaces/ITransactionApi.ts +20 -0
- package/src/transaction/index.ts +5 -2
- package/src/transaction/queue/TransactionPublisher.ts +24 -24
- package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +37 -37
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +15 -15
- package/src/transactionProcessor/index.ts +1 -1
- package/tsconfig.json +21 -21
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { AddressCreateRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
3
|
-
import { inject, injectable } from "inversify";
|
|
4
|
-
import { IAddressApi } from "./interfaces/IAddressApi";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@injectable()
|
|
8
|
-
export class AddressApi implements IAddressApi {
|
|
9
|
-
|
|
10
|
-
private readonly baseUrl = process.env.ADDRESS_LAMBDA_URL || "";
|
|
11
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
12
|
-
|
|
13
|
-
async getByDirectoryId(directoryId: string): Promise<any> {
|
|
14
|
-
|
|
15
|
-
this.validateBaseUrl();
|
|
16
|
-
this.validateDirectoryId(directoryId);
|
|
17
|
-
|
|
18
|
-
const url = `${this.baseUrl}users/${directoryId}`;
|
|
19
|
-
|
|
20
|
-
return await this.httpRequest.get(`${url}`, null);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async create(directoryId: string, address: AddressCreateRequest): Promise<void> {
|
|
24
|
-
this.validateBaseUrl();
|
|
25
|
-
this.validateDirectoryId(directoryId);
|
|
26
|
-
const url = `${this.baseUrl}users/${directoryId}`;
|
|
27
|
-
await this.httpRequest.post<void>(url, address);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse> {
|
|
31
|
-
this.validateBaseUrl();
|
|
32
|
-
const url = `${this.baseUrl}shipping`;
|
|
33
|
-
return await this.httpRequest.post<AddressShippingCardResponse>(url, { directoryId });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
private validateBaseUrl() {
|
|
37
|
-
if (!this.baseUrl) {
|
|
38
|
-
throw new Error("Environment variable ADDRESS_LAMBDA_URL value not found");
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
private validateDirectoryId(directoryId: string) {
|
|
43
|
-
if (!directoryId) {
|
|
44
|
-
throw new Error("Directory ID is required.");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { AddressCreateRequest, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
3
|
+
import { inject, injectable } from "inversify";
|
|
4
|
+
import { IAddressApi } from "./interfaces/IAddressApi";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export class AddressApi implements IAddressApi {
|
|
9
|
+
|
|
10
|
+
private readonly baseUrl = process.env.ADDRESS_LAMBDA_URL || "";
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
12
|
+
|
|
13
|
+
async getByDirectoryId(directoryId: string): Promise<any> {
|
|
14
|
+
|
|
15
|
+
this.validateBaseUrl();
|
|
16
|
+
this.validateDirectoryId(directoryId);
|
|
17
|
+
|
|
18
|
+
const url = `${this.baseUrl}users/${directoryId}`;
|
|
19
|
+
|
|
20
|
+
return await this.httpRequest.get(`${url}`, null);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async create(directoryId: string, address: AddressCreateRequest): Promise<void> {
|
|
24
|
+
this.validateBaseUrl();
|
|
25
|
+
this.validateDirectoryId(directoryId);
|
|
26
|
+
const url = `${this.baseUrl}users/${directoryId}`;
|
|
27
|
+
await this.httpRequest.post<void>(url, address);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
async getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse> {
|
|
31
|
+
this.validateBaseUrl();
|
|
32
|
+
const url = `${this.baseUrl}shipping`;
|
|
33
|
+
return await this.httpRequest.post<AddressShippingCardResponse>(url, { directoryId });
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
private validateBaseUrl() {
|
|
37
|
+
if (!this.baseUrl) {
|
|
38
|
+
throw new Error("Environment variable ADDRESS_LAMBDA_URL value not found");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
private validateDirectoryId(directoryId: string) {
|
|
43
|
+
if (!directoryId) {
|
|
44
|
+
throw new Error("Directory ID is required.");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
47
|
}
|
package/src/address/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './interfaces/IAddressApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './interfaces/IAddressApi';
|
|
4
4
|
export * from './AddressApi';
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { AddressCreateRequest, AddressResponse, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
2
|
-
|
|
3
|
-
export interface IAddressApi {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Obtiene una lista de direcciones por su ID de directorio.
|
|
7
|
-
* @param directoryId ID de directorio (UUID) a buscar.
|
|
8
|
-
* @returns Una promesa que resuelve a un arreglo de objetos de dirección.
|
|
9
|
-
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
10
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
11
|
-
*/
|
|
12
|
-
getByDirectoryId(directoryId: string): Promise<AddressResponse[]>;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Crea una nueva dirección para un directorio.
|
|
16
|
-
* @param directoryId ID de directorio (UUID) a buscar.
|
|
17
|
-
* @param address Objeto de dirección a crear.
|
|
18
|
-
* @returns Una promesa que resuelve a void.
|
|
19
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
20
|
-
*/
|
|
21
|
-
create(directoryId: string, address: AddressCreateRequest): Promise<void>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Obtiene la dirección de envío de una tarjeta.
|
|
25
|
-
* @param input Objeto de solicitud de dirección de envío.
|
|
26
|
-
* @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
|
|
27
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
|
-
*/
|
|
29
|
-
getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>
|
|
30
|
-
|
|
1
|
+
import { AddressCreateRequest, AddressResponse, AddressShippingCardResponse } from "@fiado/type-kit/bin/address";
|
|
2
|
+
|
|
3
|
+
export interface IAddressApi {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Obtiene una lista de direcciones por su ID de directorio.
|
|
7
|
+
* @param directoryId ID de directorio (UUID) a buscar.
|
|
8
|
+
* @returns Una promesa que resuelve a un arreglo de objetos de dirección.
|
|
9
|
+
* Puede devolver un arreglo vacío si no se encuentran coincidencias.
|
|
10
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
11
|
+
*/
|
|
12
|
+
getByDirectoryId(directoryId: string): Promise<AddressResponse[]>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Crea una nueva dirección para un directorio.
|
|
16
|
+
* @param directoryId ID de directorio (UUID) a buscar.
|
|
17
|
+
* @param address Objeto de dirección a crear.
|
|
18
|
+
* @returns Una promesa que resuelve a void.
|
|
19
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
20
|
+
*/
|
|
21
|
+
create(directoryId: string, address: AddressCreateRequest): Promise<void>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Obtiene la dirección de envío de una tarjeta.
|
|
25
|
+
* @param input Objeto de solicitud de dirección de envío.
|
|
26
|
+
* @returns Una promesa que resuelve a un objeto de respuesta de dirección de envío.
|
|
27
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
28
|
+
*/
|
|
29
|
+
getAddressLocationShipping(directoryId: string): Promise<AddressShippingCardResponse>
|
|
30
|
+
|
|
31
31
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
|
|
3
|
-
import { inject, injectable } from "inversify";
|
|
4
|
-
import { IAuthenticationApi } from "./interfaces/IAuthenticationApi";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export class AuthenticationApi implements IAuthenticationApi {
|
|
8
|
-
|
|
9
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
10
|
-
|
|
11
|
-
async signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any> {
|
|
12
|
-
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
13
|
-
const operation = "postSignUpAdditionalCard";
|
|
14
|
-
|
|
15
|
-
return await this.httpRequest.post(url, createAdditionalCard, { 'operationName': operation });
|
|
16
|
-
}
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
|
|
3
|
+
import { inject, injectable } from "inversify";
|
|
4
|
+
import { IAuthenticationApi } from "./interfaces/IAuthenticationApi";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class AuthenticationApi implements IAuthenticationApi {
|
|
8
|
+
|
|
9
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
10
|
+
|
|
11
|
+
async signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any> {
|
|
12
|
+
const url = `${process.env.AUTH_LAMBDA_URL}`;
|
|
13
|
+
const operation = "postSignUpAdditionalCard";
|
|
14
|
+
|
|
15
|
+
return await this.httpRequest.post(url, createAdditionalCard, { 'operationName': operation });
|
|
16
|
+
}
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export * from './interfaces/IAuthenticationApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export * from './interfaces/IAuthenticationApi';
|
|
5
5
|
export * from './AuthenticationApi';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
|
|
2
|
-
|
|
3
|
-
export interface IAuthenticationApi {
|
|
4
|
-
|
|
5
|
-
signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
|
|
1
|
+
import { SignUpAdditionalRequest } from "@fiado/type-kit/bin/authentication";
|
|
2
|
+
|
|
3
|
+
export interface IAuthenticationApi {
|
|
4
|
+
|
|
5
|
+
signUpAdditionalCard(createAdditionalCard: SignUpAdditionalRequest): Promise<any>;
|
|
6
6
|
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import {inject, injectable} from "inversify";
|
|
2
|
-
import {IBankAccountApi} from "./interfaces/IBankAccountApi";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import GetExternalBankAccountRequest from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountRequest";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export default class BankAccountApi implements IBankAccountApi {
|
|
8
|
-
private readonly baseUrl = process.env.BANK_ACCOUNT_LAMBDA_UR || "";
|
|
9
|
-
|
|
10
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async getBankAccountById(bankAccountId: string): Promise<any> {
|
|
14
|
-
const url = `${this.baseUrl}`;
|
|
15
|
-
const body: GetExternalBankAccountRequest = {
|
|
16
|
-
accountId: bankAccountId
|
|
17
|
-
} as GetExternalBankAccountRequest;
|
|
18
|
-
const headers = {
|
|
19
|
-
'Content-Type': 'application/json',
|
|
20
|
-
operationName: "postBankAccountId"
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return await this.httpRequest.post(url, body, headers);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async getBankById(bankId: string): Promise<any> {
|
|
27
|
-
const url = `${this.baseUrl}`;
|
|
28
|
-
const body: GetExternalBankAccountRequest = {
|
|
29
|
-
bankId: bankId
|
|
30
|
-
} as GetExternalBankAccountRequest;
|
|
31
|
-
const headers = {
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
operationName: "getBanksBankId"
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return await this.httpRequest.post(url, body, headers);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async getBankByCode(bankCode?: string, shortBankCode?: string): Promise<any> {
|
|
40
|
-
const url = `${this.baseUrl}`;
|
|
41
|
-
const params = bankCode ? `bankCode=${bankCode}` : `shortBankCode=${shortBankCode}`;
|
|
42
|
-
const headers = {
|
|
43
|
-
'Content-Type': 'application/json',
|
|
44
|
-
operationName: "getBanks"
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return await this.httpRequest.post(`${url}?${params}`, null, headers);
|
|
48
|
-
}
|
|
1
|
+
import {inject, injectable} from "inversify";
|
|
2
|
+
import {IBankAccountApi} from "./interfaces/IBankAccountApi";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import GetExternalBankAccountRequest from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountRequest";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class BankAccountApi implements IBankAccountApi {
|
|
8
|
+
private readonly baseUrl = process.env.BANK_ACCOUNT_LAMBDA_UR || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async getBankAccountById(bankAccountId: string): Promise<any> {
|
|
14
|
+
const url = `${this.baseUrl}`;
|
|
15
|
+
const body: GetExternalBankAccountRequest = {
|
|
16
|
+
accountId: bankAccountId
|
|
17
|
+
} as GetExternalBankAccountRequest;
|
|
18
|
+
const headers = {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
operationName: "postBankAccountId"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return await this.httpRequest.post(url, body, headers);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async getBankById(bankId: string): Promise<any> {
|
|
27
|
+
const url = `${this.baseUrl}`;
|
|
28
|
+
const body: GetExternalBankAccountRequest = {
|
|
29
|
+
bankId: bankId
|
|
30
|
+
} as GetExternalBankAccountRequest;
|
|
31
|
+
const headers = {
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
operationName: "getBanksBankId"
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return await this.httpRequest.post(url, body, headers);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getBankByCode(bankCode?: string, shortBankCode?: string): Promise<any> {
|
|
40
|
+
const url = `${this.baseUrl}`;
|
|
41
|
+
const params = bankCode ? `bankCode=${bankCode}` : `shortBankCode=${shortBankCode}`;
|
|
42
|
+
const headers = {
|
|
43
|
+
'Content-Type': 'application/json',
|
|
44
|
+
operationName: "getBanks"
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return await this.httpRequest.post(`${url}?${params}`, null, headers);
|
|
48
|
+
}
|
|
49
49
|
}
|
package/src/bankAccount/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/IBankAccountApi';
|
|
1
|
+
export * from './interfaces/IBankAccountApi';
|
|
2
2
|
export * from './BankAccountApi';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface IBankAccountApi {
|
|
2
|
-
getBankAccountById(bankAccountId: string): Promise<any>;
|
|
3
|
-
|
|
4
|
-
getBankById(bankId: string): Promise<any>;
|
|
5
|
-
|
|
6
|
-
getBankByCode(bankCode?: string, shortBankCode?: string): Promise<any>;
|
|
1
|
+
export interface IBankAccountApi {
|
|
2
|
+
getBankAccountById(bankAccountId: string): Promise<any>;
|
|
3
|
+
|
|
4
|
+
getBankById(bankId: string): Promise<any>;
|
|
5
|
+
|
|
6
|
+
getBankByCode(bankCode?: string, shortBankCode?: string): Promise<any>;
|
|
7
7
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {IBBVARstApi} from "./interfaces/IBBVARstApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {CreateRSTTransactionRequest} from "@fiado/type-kit/bin/bbvaRst";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export class BBVARstApi implements IBBVARstApi {
|
|
8
|
-
private readonly baseUrl = process.env.BBVA_RSTA_LAMBDA_URL || "";
|
|
9
|
-
|
|
10
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async create(request: CreateRSTTransactionRequest): Promise<any> {
|
|
14
|
-
const url = `${this.baseUrl}/create`;
|
|
15
|
-
return await this.httpRequest.post(url, request);
|
|
16
|
-
}
|
|
1
|
+
import {IBBVARstApi} from "./interfaces/IBBVARstApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {CreateRSTTransactionRequest} from "@fiado/type-kit/bin/bbvaRst";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class BBVARstApi implements IBBVARstApi {
|
|
8
|
+
private readonly baseUrl = process.env.BBVA_RSTA_LAMBDA_URL || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async create(request: CreateRSTTransactionRequest): Promise<any> {
|
|
14
|
+
const url = `${this.baseUrl}/create`;
|
|
15
|
+
return await this.httpRequest.post(url, request);
|
|
16
|
+
}
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {CreateRSTTransactionRequest} from "@fiado/type-kit/bin/bbvaRst";
|
|
2
|
-
|
|
3
|
-
export interface IBBVARstApi {
|
|
4
|
-
create(request: CreateRSTTransactionRequest): Promise<any>;
|
|
1
|
+
import {CreateRSTTransactionRequest} from "@fiado/type-kit/bin/bbvaRst";
|
|
2
|
+
|
|
3
|
+
export interface IBBVARstApi {
|
|
4
|
+
create(request: CreateRSTTransactionRequest): Promise<any>;
|
|
5
5
|
}
|
package/src/bbvaRst/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IBBVARstApi';
|
|
1
|
+
export * from './api/interfaces/IBBVARstApi';
|
|
2
2
|
export * from './api/BBVARstApi';
|
package/src/card/CardApi.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
4
|
-
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
|
-
import { inject, injectable } from "inversify";
|
|
6
|
-
import { ICardApi } from "./interfaces/ICardApi";
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export class CardApi implements ICardApi {
|
|
10
|
-
|
|
11
|
-
private readonly baseUrl = process.env.CARD_LAMBDA_URL || "";
|
|
12
|
-
|
|
13
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
|
|
17
|
-
|
|
18
|
-
const url = `${this.baseUrl}/${countryId}?cardId=${id}`;
|
|
19
|
-
return await this.httpRequest.get(url);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
|
|
23
|
-
|
|
24
|
-
const url = `${this.baseUrl}/${countryId}?externalCardId=${externalId}`;
|
|
25
|
-
return await this.httpRequest.get(url);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async evaluateAccountLevelUpdate(directoryId: string): Promise<void> {
|
|
29
|
-
|
|
30
|
-
const url = `${this.baseUrl}accounts/levels`
|
|
31
|
-
await this.httpRequest.post(url, { directoryId });
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
4
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
|
+
import { inject, injectable } from "inversify";
|
|
6
|
+
import { ICardApi } from "./interfaces/ICardApi";
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export class CardApi implements ICardApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.CARD_LAMBDA_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
|
|
17
|
+
|
|
18
|
+
const url = `${this.baseUrl}/${countryId}?cardId=${id}`;
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>> {
|
|
23
|
+
|
|
24
|
+
const url = `${this.baseUrl}/${countryId}?externalCardId=${externalId}`;
|
|
25
|
+
return await this.httpRequest.get(url);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async evaluateAccountLevelUpdate(directoryId: string): Promise<void> {
|
|
29
|
+
|
|
30
|
+
const url = `${this.baseUrl}accounts/levels`
|
|
31
|
+
await this.httpRequest.post(url, { directoryId });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
package/src/card/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './interfaces/ICardApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './interfaces/ICardApi';
|
|
4
4
|
export * from './CardApi';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
3
|
-
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
4
|
-
|
|
5
|
-
export interface ICardApi {
|
|
6
|
-
|
|
7
|
-
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
8
|
-
|
|
9
|
-
getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>
|
|
10
|
-
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
3
|
+
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
4
|
+
|
|
5
|
+
export interface ICardApi {
|
|
6
|
+
|
|
7
|
+
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
8
|
+
|
|
9
|
+
getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>
|
|
10
|
+
|
|
11
11
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { ICnbvApi } from "./interfaces/ICnbvApi";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@injectable()
|
|
8
|
-
export default class CnbvApi implements ICnbvApi {
|
|
9
|
-
|
|
10
|
-
private readonly baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
11
|
-
|
|
12
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
|
|
16
|
-
|
|
17
|
-
const url = `${this.baseUrl}?value=${yearOfBirth}¶m=YEAR_OF_BIRTH&fullName=${fullName}`;
|
|
18
|
-
|
|
19
|
-
return await this.httpRequest.get(url);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { ICnbvApi } from "./interfaces/ICnbvApi";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class CnbvApi implements ICnbvApi {
|
|
9
|
+
|
|
10
|
+
private readonly baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
|
|
16
|
+
|
|
17
|
+
const url = `${this.baseUrl}?value=${yearOfBirth}¶m=YEAR_OF_BIRTH&fullName=${fullName}`;
|
|
18
|
+
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './interfaces/ICnbvApi';
|
|
4
|
-
export * from './CnbvApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './interfaces/ICnbvApi';
|
|
4
|
+
export * from './CnbvApi';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface ICnbvApi {
|
|
4
|
-
|
|
5
|
-
validateConcidence(fullName:string, yearOfBirth: string): Promise<any>
|
|
6
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export interface ICnbvApi {
|
|
4
|
+
|
|
5
|
+
validateConcidence(fullName:string, yearOfBirth: string): Promise<any>
|
|
6
|
+
|
|
7
7
|
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import dotenv from 'dotenv';
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import { ICollectorApi } from './interfaces/ICollectorApi';
|
|
5
|
-
import CreditContractCreateRequest from '@fiado/type-kit/bin/creditContract/dtos/CreditContractCreateRequest';
|
|
6
|
-
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
@injectable()
|
|
10
|
-
export class CollectorApi implements ICollectorApi {
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.COLLECTOR_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
-
|
|
16
|
-
async createCreditContract(object: CreditContractCreateRequest): Promise<any> {
|
|
17
|
-
const url = `${this.baseUrl}collector/creditcontracts/create`;
|
|
18
|
-
return await this.httpRequest.post(url, object);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async getCreditContract(relatedId: string): Promise<any> {
|
|
22
|
-
const url = `${this.baseUrl}collector/creditcontracts/collectordata?externalRelatedId=${relatedId}`;
|
|
23
|
-
return await this.httpRequest.get(url);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
1
|
+
import dotenv from 'dotenv';
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import { ICollectorApi } from './interfaces/ICollectorApi';
|
|
5
|
+
import CreditContractCreateRequest from '@fiado/type-kit/bin/creditContract/dtos/CreditContractCreateRequest';
|
|
6
|
+
|
|
7
|
+
dotenv.config();
|
|
8
|
+
|
|
9
|
+
@injectable()
|
|
10
|
+
export class CollectorApi implements ICollectorApi {
|
|
11
|
+
|
|
12
|
+
private readonly baseUrl = process.env.COLLECTOR_LAMBDA_URL || "";
|
|
13
|
+
|
|
14
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
+
|
|
16
|
+
async createCreditContract(object: CreditContractCreateRequest): Promise<any> {
|
|
17
|
+
const url = `${this.baseUrl}collector/creditcontracts/create`;
|
|
18
|
+
return await this.httpRequest.post(url, object);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async getCreditContract(relatedId: string): Promise<any> {
|
|
22
|
+
const url = `${this.baseUrl}collector/creditcontracts/collectordata?externalRelatedId=${relatedId}`;
|
|
23
|
+
return await this.httpRequest.get(url);
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/collector/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from './interfaces/ICollectorApi';
|
|
1
|
+
|
|
2
|
+
export * from './interfaces/ICollectorApi';
|
|
3
3
|
export * from './CollectorApi';
|