@fiado/api-invoker 1.2.61 → 1.2.62
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/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +2 -0
- package/bin/service-business/ServiceApi.d.ts +7 -5
- package/bin/service-business/ServiceApi.js +4 -0
- package/bin/service-business/interfaces/IServiceApi.d.ts +7 -5
- package/package.json +27 -27
- 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 +73 -73
- package/src/account-fiadoinc/index.ts +1 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +36 -36
- package/src/account-fiadosa/AccountFiadoSAApi.ts +37 -37
- package/src/account-fiadosa/index.ts +1 -1
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +15 -15
- 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 +36 -36
- package/src/activity-business/index.ts +5 -5
- package/src/activity-business/interfaces/IActivityApi.ts +13 -13
- 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/blacklist/BlackListApi.ts +19 -19
- package/src/blacklist/index.ts +2 -2
- package/src/blacklist/interfaces/IBlackListApi.ts +20 -20
- package/src/card/CardApi.ts +53 -53
- package/src/card/index.ts +3 -3
- package/src/card/interfaces/ICardApi.ts +16 -16
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +183 -183
- package/src/centralPayments/index.ts +1 -1
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +85 -85
- 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/cognitoConnector/CognitoConnectorApi.ts +106 -106
- package/src/cognitoConnector/CognitoConnectorV2.ts +81 -81
- package/src/cognitoConnector/index.ts +11 -11
- package/src/cognitoConnector/interfaces/ICognitoConnectorApi.ts +15 -15
- package/src/cognitoConnector/interfaces/ICognitoV2Api.ts +58 -58
- 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 +126 -126
- 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/device/DeviceApi.ts +23 -23
- package/src/device/index.ts +2 -2
- package/src/device/interfaces/IDeviceApi.ts +24 -24
- package/src/directories/DirectoriesApi.ts +53 -53
- package/src/directories/index.ts +3 -3
- package/src/directories/interfaces/IDirectoriesApi.ts +16 -16
- package/src/directory/DirectoryApi.ts +150 -150
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +69 -69
- package/src/disputes/DisputesApi.ts +50 -50
- package/src/disputes/index.ts +2 -2
- package/src/disputes/interfaces/IDisputesApi.ts +54 -54
- 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 +78 -78
- package/src/identity/index.ts +3 -3
- package/src/identity/interfaces/IIdentityApi.ts +38 -38
- package/src/index.ts +41 -41
- package/src/legalDocument/api/LegalDocumentApi.ts +26 -26
- package/src/legalDocument/api/interfaces/ILegalDocumentApi.ts +6 -6
- package/src/legalDocument/index.ts +3 -3
- 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/observations/ObservationsApi.ts +23 -23
- package/src/observations/index.ts +3 -3
- package/src/observations/interfaces/IObservationsApi.ts +9 -9
- 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 +39 -39
- package/src/riskProfile/api/TransactionAlertApi.ts +22 -22
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +14 -14
- package/src/riskProfile/api/interfaces/ITransactionAlertApi.ts +7 -7
- package/src/riskProfile/index.ts +7 -7
- package/src/riskProfile/queue/TransactionAlarmPublisher.ts +24 -24
- package/src/riskProfile/queue/interfaces/ITransactionAlarmPublisher.ts +4 -4
- package/src/service-business/ServiceApi.ts +66 -60
- package/src/service-business/index.ts +2 -2
- package/src/service-business/interfaces/IServiceApi.ts +48 -44
- 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 +147 -147
- package/src/tern/api/interfaces/ITernApi.ts +47 -47
- package/src/tern/index.ts +1 -1
- package/src/transaction/api/TransactionApi.ts +92 -92
- package/src/transaction/api/interfaces/ITransactionApi.ts +35 -35
- package/src/transaction/index.ts +5 -5
- package/src/transaction/queue/TransactionPublisher.ts +24 -24
- package/src/transaction/queue/interfaces/ITransactionPublisher.ts +4 -4
- package/src/transactionProcessor/api/TransactionProcessorApi.ts +42 -42
- package/src/transactionProcessor/api/interfaces/ITransactionProcessorApi.ts +18 -18
- package/src/transactionProcessor/index.ts +1 -1
- package/src/utils/InvokerUtils.ts +18 -18
- package/src/zendesk/ZendeskApi.ts +24 -24
- package/src/zendesk/index.ts +3 -3
- package/src/zendesk/interfaces/IZendeskApi.ts +10 -10
- package/tsconfig.json +21 -21
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
|
|
4
|
-
*/
|
|
5
|
-
export interface IDisputesApi {
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Obtener disputas por directoryId.
|
|
9
|
-
* @param directoryId DirectoryId del usuario a consultar.
|
|
10
|
-
* @param pageSize Tamaño de la página.
|
|
11
|
-
* @param index Índice de la página.
|
|
12
|
-
* @returns Una promesa que resuelve a void.
|
|
13
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
14
|
-
*/
|
|
15
|
-
getByDirectoryId(params:{
|
|
16
|
-
directoryId:string,
|
|
17
|
-
pageSize?:number,
|
|
18
|
-
index?:string
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Agregar PROV Y REV_PROV a una disputa.
|
|
24
|
-
* @param disputeId Id de la disputa.
|
|
25
|
-
* @param amount Monto de la transacción.
|
|
26
|
-
* @param date Fecha de la transacción.
|
|
27
|
-
* @param type REV ó PROV.
|
|
28
|
-
* @returns Una promesa que resuelve a void.
|
|
29
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
30
|
-
*/
|
|
31
|
-
addProvisional(params:{
|
|
32
|
-
disputeId:string,
|
|
33
|
-
amount:number,
|
|
34
|
-
date:string,
|
|
35
|
-
type:"PROV"|"REV_PROV"
|
|
36
|
-
}): Promise<void>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Consultar disputas entre fechas.
|
|
41
|
-
* @param index indice de consulta.
|
|
42
|
-
* @param pageSize tamaño de paginación.
|
|
43
|
-
* @param startDate Fecha inicial de consulta.
|
|
44
|
-
* @param endDate Fecha final de consulta
|
|
45
|
-
* @returns Una promesa que resuelve a void.
|
|
46
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
47
|
-
*/
|
|
48
|
-
getListBetweenDates(params:{
|
|
49
|
-
index?:string,
|
|
50
|
-
pageSize?:number,
|
|
51
|
-
startDate:string,
|
|
52
|
-
endDate:string
|
|
53
|
-
}): Promise<void>;
|
|
54
|
-
}
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Interfaz que define las operaciones que se pueden realizar en el servicio de disputas.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDisputesApi {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Obtener disputas por directoryId.
|
|
9
|
+
* @param directoryId DirectoryId del usuario a consultar.
|
|
10
|
+
* @param pageSize Tamaño de la página.
|
|
11
|
+
* @param index Índice de la página.
|
|
12
|
+
* @returns Una promesa que resuelve a void.
|
|
13
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
14
|
+
*/
|
|
15
|
+
getByDirectoryId(params:{
|
|
16
|
+
directoryId:string,
|
|
17
|
+
pageSize?:number,
|
|
18
|
+
index?:string
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Agregar PROV Y REV_PROV a una disputa.
|
|
24
|
+
* @param disputeId Id de la disputa.
|
|
25
|
+
* @param amount Monto de la transacción.
|
|
26
|
+
* @param date Fecha de la transacción.
|
|
27
|
+
* @param type REV ó PROV.
|
|
28
|
+
* @returns Una promesa que resuelve a void.
|
|
29
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
30
|
+
*/
|
|
31
|
+
addProvisional(params:{
|
|
32
|
+
disputeId:string,
|
|
33
|
+
amount:number,
|
|
34
|
+
date:string,
|
|
35
|
+
type:"PROV"|"REV_PROV"
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Consultar disputas entre fechas.
|
|
41
|
+
* @param index indice de consulta.
|
|
42
|
+
* @param pageSize tamaño de paginación.
|
|
43
|
+
* @param startDate Fecha inicial de consulta.
|
|
44
|
+
* @param endDate Fecha final de consulta
|
|
45
|
+
* @returns Una promesa que resuelve a void.
|
|
46
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
47
|
+
*/
|
|
48
|
+
getListBetweenDates(params:{
|
|
49
|
+
index?:string,
|
|
50
|
+
pageSize?:number,
|
|
51
|
+
startDate:string,
|
|
52
|
+
endDate:string
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {IExchangeRatesApi} from "./interfaces/IExchangeRatesApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
|
|
5
|
-
import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
|
|
6
|
-
import {promises} from "node:dns";
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export default class ExchangeRatesApi implements IExchangeRatesApi {
|
|
10
|
-
private readonly baseUrl = process.env.EXCHANGE_RATES_LAMBDA_URL || "";
|
|
11
|
-
|
|
12
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async getExchangeRates(request: GetExchangeRatesRequest): Promise<any> {
|
|
16
|
-
const headers = {
|
|
17
|
-
"operationName": "getExchangeRates"
|
|
18
|
-
}
|
|
19
|
-
return await this.httpRequest.post(this.baseUrl, request, headers);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async postExchangeRates(request: ExchangeRateCreateRequest): Promise<any> {
|
|
23
|
-
const headers = {
|
|
24
|
-
"operationName": "postExchangeRates"
|
|
25
|
-
}
|
|
26
|
-
return await this.httpRequest.post(this.baseUrl, request, headers);
|
|
27
|
-
}
|
|
1
|
+
import {IExchangeRatesApi} from "./interfaces/IExchangeRatesApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
|
|
5
|
+
import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
|
|
6
|
+
import {promises} from "node:dns";
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export default class ExchangeRatesApi implements IExchangeRatesApi {
|
|
10
|
+
private readonly baseUrl = process.env.EXCHANGE_RATES_LAMBDA_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async getExchangeRates(request: GetExchangeRatesRequest): Promise<any> {
|
|
16
|
+
const headers = {
|
|
17
|
+
"operationName": "getExchangeRates"
|
|
18
|
+
}
|
|
19
|
+
return await this.httpRequest.post(this.baseUrl, request, headers);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async postExchangeRates(request: ExchangeRateCreateRequest): Promise<any> {
|
|
23
|
+
const headers = {
|
|
24
|
+
"operationName": "postExchangeRates"
|
|
25
|
+
}
|
|
26
|
+
return await this.httpRequest.post(this.baseUrl, request, headers);
|
|
27
|
+
}
|
|
28
28
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/IExchangeRatesApi';
|
|
1
|
+
export * from './interfaces/IExchangeRatesApi';
|
|
2
2
|
export * from './ExchangeRatesApi';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
|
|
2
|
-
import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface IExchangeRatesApi {
|
|
6
|
-
getExchangeRates(request: GetExchangeRatesRequest): Promise<any>;
|
|
7
|
-
|
|
8
|
-
postExchangeRates(request: ExchangeRateCreateRequest): Promise<any>;
|
|
1
|
+
import GetExchangeRatesRequest from "@fiado/type-kit/bin/exchangeRate/dtos/GetExchangeRatesRequest";
|
|
2
|
+
import {ExchangeRateCreateRequest} from "@fiado/type-kit/bin/exchangeRate";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface IExchangeRatesApi {
|
|
6
|
+
getExchangeRates(request: GetExchangeRatesRequest): Promise<any>;
|
|
7
|
+
|
|
8
|
+
postExchangeRates(request: ExchangeRateCreateRequest): Promise<any>;
|
|
9
9
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {inject, injectable} from "inversify";
|
|
2
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
3
|
-
import {IFiadoMessagesApi} from "./interfaces/IFiadoMessagesApi";
|
|
4
|
-
|
|
5
|
-
@injectable()
|
|
6
|
-
export class FiadoMessagesApi implements IFiadoMessagesApi {
|
|
7
|
-
private readonly baseUrl = process.env.MESSAGE_LAMBDA_URL || "";
|
|
8
|
-
|
|
9
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any> {
|
|
13
|
-
const url: string = `${this.baseUrl}`;
|
|
14
|
-
const operationName: string = "getValidatedOtpByDirectoryIdAndOtpCode";
|
|
15
|
-
const request = {
|
|
16
|
-
directoryId: directoryId,
|
|
17
|
-
otpCode: otpCode
|
|
18
|
-
};
|
|
19
|
-
return await this.httpRequest.post(`${url}`, request, {'operationName': operationName});
|
|
20
|
-
}
|
|
1
|
+
import {inject, injectable} from "inversify";
|
|
2
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
3
|
+
import {IFiadoMessagesApi} from "./interfaces/IFiadoMessagesApi";
|
|
4
|
+
|
|
5
|
+
@injectable()
|
|
6
|
+
export class FiadoMessagesApi implements IFiadoMessagesApi {
|
|
7
|
+
private readonly baseUrl = process.env.MESSAGE_LAMBDA_URL || "";
|
|
8
|
+
|
|
9
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any> {
|
|
13
|
+
const url: string = `${this.baseUrl}`;
|
|
14
|
+
const operationName: string = "getValidatedOtpByDirectoryIdAndOtpCode";
|
|
15
|
+
const request = {
|
|
16
|
+
directoryId: directoryId,
|
|
17
|
+
otpCode: otpCode
|
|
18
|
+
};
|
|
19
|
+
return await this.httpRequest.post(`${url}`, request, {'operationName': operationName});
|
|
20
|
+
}
|
|
21
21
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface IFiadoMessagesApi {
|
|
2
|
-
getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
|
|
1
|
+
export interface IFiadoMessagesApi {
|
|
2
|
+
getValidatedOtpByDirectoryIdAndOtpCode(directoryId: string, otpCode: string): Promise<any>;
|
|
3
3
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IFiadoMessagesApi';
|
|
1
|
+
export * from './api/interfaces/IFiadoMessagesApi';
|
|
2
2
|
export * from './api/FiadoMessagesApi';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {IFraudPreventionEngineApi} from "./interfaces/IFraudPreventionEngineApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
|
|
5
|
-
import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
|
|
6
|
-
|
|
7
|
-
@injectable()
|
|
8
|
-
export default class FraudPreventionEngineApi implements IFraudPreventionEngineApi {
|
|
9
|
-
private readonly baseUrl = process.env.FRAUD_PREVENTION_ENGINE_LAMBDA_URL || "";
|
|
10
|
-
|
|
11
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async getAccountLevel(params: GetAccountLevelParams): Promise<any> {
|
|
15
|
-
const url: string = `${this.baseUrl}/account/levels?${Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&')}`;
|
|
16
|
-
return await this.httpRequest.get(url);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async createAccountLevel(request: CreateAccountLevelRequest): Promise<any> {
|
|
20
|
-
const url: string = `${this.baseUrl}/account/levels`;
|
|
21
|
-
return await this.httpRequest.post(url, request);
|
|
22
|
-
}
|
|
1
|
+
import {IFraudPreventionEngineApi} from "./interfaces/IFraudPreventionEngineApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
|
|
5
|
+
import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class FraudPreventionEngineApi implements IFraudPreventionEngineApi {
|
|
9
|
+
private readonly baseUrl = process.env.FRAUD_PREVENTION_ENGINE_LAMBDA_URL || "";
|
|
10
|
+
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async getAccountLevel(params: GetAccountLevelParams): Promise<any> {
|
|
15
|
+
const url: string = `${this.baseUrl}/account/levels?${Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&')}`;
|
|
16
|
+
return await this.httpRequest.get(url);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async createAccountLevel(request: CreateAccountLevelRequest): Promise<any> {
|
|
20
|
+
const url: string = `${this.baseUrl}/account/levels`;
|
|
21
|
+
return await this.httpRequest.post(url, request);
|
|
22
|
+
}
|
|
23
23
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
|
|
2
|
-
import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
|
|
3
|
-
|
|
4
|
-
export interface IFraudPreventionEngineApi {
|
|
5
|
-
getAccountLevel(params: GetAccountLevelParams): Promise<any>;
|
|
6
|
-
|
|
7
|
-
createAccountLevel(request: CreateAccountLevelRequest): Promise<any>;
|
|
1
|
+
import GetAccountLevelParams from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/GetAccountLevelParams";
|
|
2
|
+
import CreateAccountLevelRequest from "@fiado/type-kit/bin/fraudPreventionEngine/dtos/CreateAccountLevelRequest";
|
|
3
|
+
|
|
4
|
+
export interface IFraudPreventionEngineApi {
|
|
5
|
+
getAccountLevel(params: GetAccountLevelParams): Promise<any>;
|
|
6
|
+
|
|
7
|
+
createAccountLevel(request: CreateAccountLevelRequest): Promise<any>;
|
|
8
8
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IFraudPreventionEngineApi';
|
|
1
|
+
export * from './api/interfaces/IFraudPreventionEngineApi';
|
|
2
2
|
export * from './api/FraudPreventionEngineApi';
|
package/src/group/GroupApi.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { inject, injectable } from "inversify";
|
|
2
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import dotenv from 'dotenv';
|
|
4
|
-
import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
|
|
5
|
-
import { IGroupApi } from "./interfaces/IGroupApi";
|
|
6
|
-
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
@injectable()
|
|
10
|
-
export class GroupApi implements IGroupApi {
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
-
|
|
16
|
-
async findByCategory(categoryId: string): Promise<any> {
|
|
17
|
-
const url = `${this.baseUrl}groups/categories/${categoryId}`;
|
|
18
|
-
return await this.httpRequest.get(`${url}`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async members(params: GroupAddDirectoryRequest): Promise<any> {
|
|
22
|
-
const url = `${this.baseUrl}members`;
|
|
23
|
-
return await this.httpRequest.post(`${url}`,params);
|
|
24
|
-
}
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import dotenv from 'dotenv';
|
|
4
|
+
import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
|
|
5
|
+
import { IGroupApi } from "./interfaces/IGroupApi";
|
|
6
|
+
|
|
7
|
+
dotenv.config();
|
|
8
|
+
|
|
9
|
+
@injectable()
|
|
10
|
+
export class GroupApi implements IGroupApi {
|
|
11
|
+
|
|
12
|
+
private readonly baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
|
|
13
|
+
|
|
14
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
15
|
+
|
|
16
|
+
async findByCategory(categoryId: string): Promise<any> {
|
|
17
|
+
const url = `${this.baseUrl}groups/categories/${categoryId}`;
|
|
18
|
+
return await this.httpRequest.get(`${url}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async members(params: GroupAddDirectoryRequest): Promise<any> {
|
|
22
|
+
const url = `${this.baseUrl}members`;
|
|
23
|
+
return await this.httpRequest.post(`${url}`,params);
|
|
24
|
+
}
|
|
25
25
|
}
|
package/src/group/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/IGroupApi';
|
|
1
|
+
export * from './interfaces/IGroupApi';
|
|
2
2
|
export * from './GroupApi';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
5
|
-
*/
|
|
6
|
-
export interface IGroupApi {
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Agrega o elimina miembros a un grupo.
|
|
10
|
-
* @param GroupAddDirectoryRequest
|
|
11
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
-
*/
|
|
13
|
-
members(params: GroupAddDirectoryRequest): Promise<any>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Buscar grupos por categoria.
|
|
18
|
-
* @param categoryId ID de la categoria.
|
|
19
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
20
|
-
*/
|
|
21
|
-
findByCategory(categoryId: string): Promise<any>;
|
|
22
|
-
|
|
23
|
-
}
|
|
1
|
+
import { GroupAddDirectoryRequest } from "@fiado/type-kit/bin/group";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
5
|
+
*/
|
|
6
|
+
export interface IGroupApi {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Agrega o elimina miembros a un grupo.
|
|
10
|
+
* @param GroupAddDirectoryRequest
|
|
11
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
12
|
+
*/
|
|
13
|
+
members(params: GroupAddDirectoryRequest): Promise<any>;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Buscar grupos por categoria.
|
|
18
|
+
* @param categoryId ID de la categoria.
|
|
19
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
20
|
+
*/
|
|
21
|
+
findByCategory(categoryId: string): Promise<any>;
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import {inject, injectable} from "inversify";
|
|
2
|
-
import {IIdentityApi} from "./interfaces/IIdentityApi";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import dotenv from 'dotenv';
|
|
5
|
-
import {PeopleUpdateRequest, UploadDocumentRequest} from "@fiado/type-kit/bin/identity";
|
|
6
|
-
|
|
7
|
-
dotenv.config();
|
|
8
|
-
|
|
9
|
-
@injectable()
|
|
10
|
-
export class IdentityApi implements IIdentityApi {
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.IDENTITY_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async getPeopleByIds(ids: string[]): Promise<any> {
|
|
18
|
-
|
|
19
|
-
if (ids.length === 0) {
|
|
20
|
-
throw new Error("At least one people ID is required.")
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const url = `${this.baseUrl}identities/people?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
|
|
24
|
-
return await this.httpRequest.get(`${url}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async getPeopleByCurp(curp: string): Promise<any> {
|
|
28
|
-
|
|
29
|
-
if (!curp) {
|
|
30
|
-
throw new Error("CURP is required.")
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const operationName = "getPeopleByCurp";
|
|
34
|
-
|
|
35
|
-
const url = `${this.baseUrl}?curp=${curp}`;
|
|
36
|
-
|
|
37
|
-
return await this.httpRequest.post(`${url}`, null, {'operationName': operationName});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void> {
|
|
41
|
-
|
|
42
|
-
if (!id) {
|
|
43
|
-
throw new Error("People ID is required.")
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const url = `${this.baseUrl}identities/people/${id}`;
|
|
47
|
-
await this.httpRequest.put<void>(url, data);
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async getProfilePicture(directoryId: string): Promise<any> {
|
|
52
|
-
|
|
53
|
-
if (!directoryId) {
|
|
54
|
-
throw new Error("Directory ID is required.")
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const url = `${this.baseUrl}identities/profile?directoryId=${directoryId}&typeOfDirectoryId=USER`;
|
|
58
|
-
// const operationName = "getUserInfoByIds";
|
|
59
|
-
|
|
60
|
-
return await this.httpRequest.get<any>(url);
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async privateUploadDocument(directoryId: string, document: UploadDocumentRequest): Promise<any> {
|
|
65
|
-
if (!directoryId) {
|
|
66
|
-
throw new Error("Directory ID is required.")
|
|
67
|
-
}
|
|
68
|
-
const url = `${this.baseUrl}/documents/${directoryId}/upload`;
|
|
69
|
-
return await this.httpRequest.post(url, document);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async getPeopleByFullName(fullName: string): Promise<any> {
|
|
73
|
-
if (!fullName) {
|
|
74
|
-
throw new Error("Full name is required.")
|
|
75
|
-
}
|
|
76
|
-
const url = `${this.baseUrl}identities/people/search?fullName=${fullName}`;
|
|
77
|
-
return await this.httpRequest.get(url);
|
|
78
|
-
}
|
|
1
|
+
import {inject, injectable} from "inversify";
|
|
2
|
+
import {IIdentityApi} from "./interfaces/IIdentityApi";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import dotenv from 'dotenv';
|
|
5
|
+
import {PeopleUpdateRequest, UploadDocumentRequest} from "@fiado/type-kit/bin/identity";
|
|
6
|
+
|
|
7
|
+
dotenv.config();
|
|
8
|
+
|
|
9
|
+
@injectable()
|
|
10
|
+
export class IdentityApi implements IIdentityApi {
|
|
11
|
+
|
|
12
|
+
private readonly baseUrl = process.env.IDENTITY_LAMBDA_URL || "";
|
|
13
|
+
|
|
14
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async getPeopleByIds(ids: string[]): Promise<any> {
|
|
18
|
+
|
|
19
|
+
if (ids.length === 0) {
|
|
20
|
+
throw new Error("At least one people ID is required.")
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const url = `${this.baseUrl}identities/people?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
|
|
24
|
+
return await this.httpRequest.get(`${url}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async getPeopleByCurp(curp: string): Promise<any> {
|
|
28
|
+
|
|
29
|
+
if (!curp) {
|
|
30
|
+
throw new Error("CURP is required.")
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const operationName = "getPeopleByCurp";
|
|
34
|
+
|
|
35
|
+
const url = `${this.baseUrl}?curp=${curp}`;
|
|
36
|
+
|
|
37
|
+
return await this.httpRequest.post(`${url}`, null, {'operationName': operationName});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async updatePeopleById(id: string, data: PeopleUpdateRequest): Promise<void> {
|
|
41
|
+
|
|
42
|
+
if (!id) {
|
|
43
|
+
throw new Error("People ID is required.")
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const url = `${this.baseUrl}identities/people/${id}`;
|
|
47
|
+
await this.httpRequest.put<void>(url, data);
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async getProfilePicture(directoryId: string): Promise<any> {
|
|
52
|
+
|
|
53
|
+
if (!directoryId) {
|
|
54
|
+
throw new Error("Directory ID is required.")
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const url = `${this.baseUrl}identities/profile?directoryId=${directoryId}&typeOfDirectoryId=USER`;
|
|
58
|
+
// const operationName = "getUserInfoByIds";
|
|
59
|
+
|
|
60
|
+
return await this.httpRequest.get<any>(url);
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async privateUploadDocument(directoryId: string, document: UploadDocumentRequest): Promise<any> {
|
|
65
|
+
if (!directoryId) {
|
|
66
|
+
throw new Error("Directory ID is required.")
|
|
67
|
+
}
|
|
68
|
+
const url = `${this.baseUrl}/documents/${directoryId}/upload`;
|
|
69
|
+
return await this.httpRequest.post(url, document);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async getPeopleByFullName(fullName: string): Promise<any> {
|
|
73
|
+
if (!fullName) {
|
|
74
|
+
throw new Error("Full name is required.")
|
|
75
|
+
}
|
|
76
|
+
const url = `${this.baseUrl}identities/people/search?fullName=${fullName}`;
|
|
77
|
+
return await this.httpRequest.get(url);
|
|
78
|
+
}
|
|
79
79
|
}
|
package/src/identity/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './interfaces/IIdentityApi';
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export * from './interfaces/IIdentityApi';
|
|
4
4
|
export * from './IdentityApi';
|