@fiado/api-invoker 1.2.53 → 1.2.54
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/centralPayments/CentralPaymentsConnectorApi.d.ts +1 -0
- package/bin/centralPayments/CentralPaymentsConnectorApi.js +4 -0
- package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +1 -0
- 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 +177 -172
- package/src/centralPayments/index.ts +1 -1
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +83 -81
- 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 +60 -60
- package/src/service-business/index.ts +2 -2
- package/src/service-business/interfaces/IServiceApi.ts +44 -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 +137 -137
- package/src/tern/api/interfaces/ITernApi.ts +38 -38
- 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
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { RegisterDeviceRequest } from "@fiado/type-kit/bin/device";
|
|
2
|
-
import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
|
|
3
|
-
import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Interfaz que define las operaciones que se pueden realizar en el servicio de black list.
|
|
7
|
-
*/
|
|
8
|
-
export interface IServiceApi {
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Consulta de membresias
|
|
12
|
-
* @param value valor del parametro.
|
|
13
|
-
* @returns Una promesa que resuelve a void.
|
|
14
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
15
|
-
*/
|
|
16
|
-
getServices(params: { pageSize?: number; index?: string; company?:ServiceCompanyEnum, flow?:ServiceFlowEnum }): Promise<void>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Consulta de membresias de un directorio dado un directoryId
|
|
20
|
-
* @param value valor del parametro.
|
|
21
|
-
* @returns Una promesa que resuelve a void.
|
|
22
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
23
|
-
*/
|
|
24
|
-
getServiceMembershipsByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Consulta de membresias de un directorio dado un directoryId y un status
|
|
29
|
-
* @param value valor del parametro.
|
|
30
|
-
* @returns Una promesa que resuelve a void.
|
|
31
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
32
|
-
*/
|
|
33
|
-
getServiceMembershipsByDirectoryIdAndStatus(params: { pageSize?: number; index?: string; directoryId:string,status:ServiceMembershipStatusEnum }): Promise<void>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Actualizar una membresia de un servicio
|
|
38
|
-
* @param value valor del parametro.
|
|
39
|
-
* @returns Una promesa que resuelve a void.
|
|
40
|
-
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
41
|
-
*/
|
|
42
|
-
updateServiceMembership(serviceMembershipId:string,params: UpdateServiceMembershipRequest): Promise<void>;
|
|
43
|
-
|
|
44
|
-
}
|
|
1
|
+
import { RegisterDeviceRequest } from "@fiado/type-kit/bin/device";
|
|
2
|
+
import { ServiceFlowEnum, ServiceMembershipStatusEnum, UpdateServiceMembershipRequest } from "@fiado/type-kit/bin/services";
|
|
3
|
+
import { ServiceCompanyEnum } from "@fiado/type-kit/bin/services/enums/ServiceCompanyEnum";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interfaz que define las operaciones que se pueden realizar en el servicio de black list.
|
|
7
|
+
*/
|
|
8
|
+
export interface IServiceApi {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Consulta de membresias
|
|
12
|
+
* @param value valor del parametro.
|
|
13
|
+
* @returns Una promesa que resuelve a void.
|
|
14
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
15
|
+
*/
|
|
16
|
+
getServices(params: { pageSize?: number; index?: string; company?:ServiceCompanyEnum, flow?:ServiceFlowEnum }): Promise<void>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Consulta de membresias de un directorio dado un directoryId
|
|
20
|
+
* @param value valor del parametro.
|
|
21
|
+
* @returns Una promesa que resuelve a void.
|
|
22
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
23
|
+
*/
|
|
24
|
+
getServiceMembershipsByDirectoryId(params: { directoryId: string; pageSize?: number; index?: string; }): Promise<void>;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Consulta de membresias de un directorio dado un directoryId y un status
|
|
29
|
+
* @param value valor del parametro.
|
|
30
|
+
* @returns Una promesa que resuelve a void.
|
|
31
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
32
|
+
*/
|
|
33
|
+
getServiceMembershipsByDirectoryIdAndStatus(params: { pageSize?: number; index?: string; directoryId:string,status:ServiceMembershipStatusEnum }): Promise<void>;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Actualizar una membresia de un servicio
|
|
38
|
+
* @param value valor del parametro.
|
|
39
|
+
* @returns Una promesa que resuelve a void.
|
|
40
|
+
* @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
|
|
41
|
+
*/
|
|
42
|
+
updateServiceMembership(serviceMembershipId:string,params: UpdateServiceMembershipRequest): Promise<void>;
|
|
43
|
+
|
|
44
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './queue/SessionActivityPublisher';
|
|
2
|
-
export * from './queue/interfaces/ISessionActivityPublisher';
|
|
1
|
+
export * from './queue/SessionActivityPublisher';
|
|
2
|
+
export * from './queue/interfaces/ISessionActivityPublisher';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
|
|
2
|
-
import { ISessionActivityPublisher } from "./interfaces/ISessionActivityPublisher";
|
|
3
|
-
import { SessionActivityQueueMessageRequest } from "@fiado/type-kit/bin/sessionActivity";
|
|
4
|
-
import { injectable } from "inversify";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export class SessionActivityPublisher implements ISessionActivityPublisher {
|
|
8
|
-
private readonly SESSION_ACTIVITY_QUEUE = process.env.SESSION_ACTIVITY_QUEUE
|
|
9
|
-
|
|
10
|
-
async publish(message: SessionActivityQueueMessageRequest): Promise<void> {
|
|
11
|
-
try {
|
|
12
|
-
const client: SQSClient = new SQSClient();
|
|
13
|
-
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
-
QueueUrl: this.SESSION_ACTIVITY_QUEUE,
|
|
15
|
-
MessageBody: JSON.stringify(message)
|
|
16
|
-
};
|
|
17
|
-
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
18
|
-
await client.send(command);
|
|
19
|
-
} catch (error) {
|
|
20
|
-
throw new Error(`Error publishing message to queue ${': ' + error.message}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import { SendMessageCommand, SendMessageRequest, SQSClient } from "@aws-sdk/client-sqs";
|
|
2
|
+
import { ISessionActivityPublisher } from "./interfaces/ISessionActivityPublisher";
|
|
3
|
+
import { SessionActivityQueueMessageRequest } from "@fiado/type-kit/bin/sessionActivity";
|
|
4
|
+
import { injectable } from "inversify";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class SessionActivityPublisher implements ISessionActivityPublisher {
|
|
8
|
+
private readonly SESSION_ACTIVITY_QUEUE = process.env.SESSION_ACTIVITY_QUEUE
|
|
9
|
+
|
|
10
|
+
async publish(message: SessionActivityQueueMessageRequest): Promise<void> {
|
|
11
|
+
try {
|
|
12
|
+
const client: SQSClient = new SQSClient();
|
|
13
|
+
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
+
QueueUrl: this.SESSION_ACTIVITY_QUEUE,
|
|
15
|
+
MessageBody: JSON.stringify(message)
|
|
16
|
+
};
|
|
17
|
+
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
18
|
+
await client.send(command);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw new Error(`Error publishing message to queue ${': ' + error.message}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
|
|
2
|
-
|
|
3
|
-
export interface ISessionActivityPublisher {
|
|
4
|
-
publish(message: SessionActivityQueueMessageRequest): Promise<void>;
|
|
1
|
+
import {SessionActivityQueueMessageRequest} from "@fiado/type-kit/bin/sessionActivity";
|
|
2
|
+
|
|
3
|
+
export interface ISessionActivityPublisher {
|
|
4
|
+
publish(message: SessionActivityQueueMessageRequest): Promise<void>;
|
|
5
5
|
}
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
|
|
5
|
-
import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export default class STPAccountApi implements ISTPAccountApi {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
|
|
13
|
-
|
|
14
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any> {
|
|
18
|
-
const url: string = `${this.baseUrl}account/update`;
|
|
19
|
-
return await this.httpRequest.put(url, request);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async createAccount(request: AccountCreateRequest): Promise<any> {
|
|
23
|
-
const url: string = `${this.baseUrl}account/create`;
|
|
24
|
-
return await this.httpRequest.post(url, request);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any> {
|
|
28
|
-
const url: string = `${this.baseUrl}account/cancel`;
|
|
29
|
-
return await this.httpRequest.post(url, request);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// //USER
|
|
34
|
-
// async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
35
|
-
// const url: string = `${this.baseUrl}users/create`;
|
|
36
|
-
// return await this.httpRequest.post(url, request);
|
|
37
|
-
// }
|
|
38
|
-
|
|
39
|
-
// public async getUserById(externalUserId: string): Promise<any> {
|
|
40
|
-
// const url: string = `${this.baseUrl}users/${externalUserId}`;
|
|
41
|
-
// return await this.httpRequest.get(url);
|
|
42
|
-
// }
|
|
43
|
-
|
|
44
|
-
// public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
|
|
45
|
-
// const url: string = `${this.baseUrl}/users/${object.id}`;
|
|
46
|
-
// return await this.httpRequest.put(url, object);
|
|
47
|
-
// }
|
|
48
|
-
|
|
49
|
-
// //Card
|
|
50
|
-
// public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
|
|
51
|
-
// const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
52
|
-
// return await this.httpRequest.get(url);
|
|
53
|
-
// }
|
|
54
|
-
|
|
55
|
-
// public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
|
|
56
|
-
// const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
57
|
-
// return await this.httpRequest.get(url);
|
|
58
|
-
// }
|
|
59
|
-
|
|
60
|
-
// public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
|
|
61
|
-
// const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
62
|
-
// return await this.httpRequest.get(url);
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
|
-
// public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
|
|
66
|
-
// const url: string = `${this.baseUrl}cards/create`;
|
|
67
|
-
// return await this.httpRequest.post(url, object);
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
|
-
// public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
71
|
-
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
72
|
-
// return await this.httpRequest.put(url, object);
|
|
73
|
-
// }
|
|
74
|
-
|
|
75
|
-
// public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
76
|
-
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
77
|
-
// return await this.httpRequest.put(url, object);
|
|
78
|
-
// }
|
|
79
|
-
|
|
80
|
-
// public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
|
|
81
|
-
// const url: string = `${this.baseUrl}cards/activate`;
|
|
82
|
-
// return await this.httpRequest.post(url, object);
|
|
83
|
-
// }
|
|
84
|
-
|
|
85
|
-
// public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
86
|
-
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
87
|
-
// return await this.httpRequest.put(url, object);
|
|
88
|
-
// }
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// //Shipping
|
|
92
|
-
|
|
93
|
-
// public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
|
|
94
|
-
// const url: string = `${this.baseUrl}shipment/create`;
|
|
95
|
-
// return await this.httpRequest.post(url, object);
|
|
96
|
-
// }
|
|
97
|
-
|
|
98
|
-
// public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
|
|
99
|
-
// const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
|
|
100
|
-
// return await this.httpRequest.get(url);
|
|
101
|
-
// }
|
|
102
|
-
|
|
103
|
-
// public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
|
|
104
|
-
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
105
|
-
// return await this.httpRequest.put(url, object);
|
|
106
|
-
// }
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
1
|
+
import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
|
|
5
|
+
import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export default class STPAccountApi implements ISTPAccountApi {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
|
|
13
|
+
|
|
14
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any> {
|
|
18
|
+
const url: string = `${this.baseUrl}account/update`;
|
|
19
|
+
return await this.httpRequest.put(url, request);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async createAccount(request: AccountCreateRequest): Promise<any> {
|
|
23
|
+
const url: string = `${this.baseUrl}account/create`;
|
|
24
|
+
return await this.httpRequest.post(url, request);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any> {
|
|
28
|
+
const url: string = `${this.baseUrl}account/cancel`;
|
|
29
|
+
return await this.httpRequest.post(url, request);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
// //USER
|
|
34
|
+
// async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
35
|
+
// const url: string = `${this.baseUrl}users/create`;
|
|
36
|
+
// return await this.httpRequest.post(url, request);
|
|
37
|
+
// }
|
|
38
|
+
|
|
39
|
+
// public async getUserById(externalUserId: string): Promise<any> {
|
|
40
|
+
// const url: string = `${this.baseUrl}users/${externalUserId}`;
|
|
41
|
+
// return await this.httpRequest.get(url);
|
|
42
|
+
// }
|
|
43
|
+
|
|
44
|
+
// public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
|
|
45
|
+
// const url: string = `${this.baseUrl}/users/${object.id}`;
|
|
46
|
+
// return await this.httpRequest.put(url, object);
|
|
47
|
+
// }
|
|
48
|
+
|
|
49
|
+
// //Card
|
|
50
|
+
// public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
|
|
51
|
+
// const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
52
|
+
// return await this.httpRequest.get(url);
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
// public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
|
|
56
|
+
// const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
57
|
+
// return await this.httpRequest.get(url);
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
// public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
|
|
61
|
+
// const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
62
|
+
// return await this.httpRequest.get(url);
|
|
63
|
+
// }
|
|
64
|
+
|
|
65
|
+
// public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
|
|
66
|
+
// const url: string = `${this.baseUrl}cards/create`;
|
|
67
|
+
// return await this.httpRequest.post(url, object);
|
|
68
|
+
// }
|
|
69
|
+
|
|
70
|
+
// public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
71
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
72
|
+
// return await this.httpRequest.put(url, object);
|
|
73
|
+
// }
|
|
74
|
+
|
|
75
|
+
// public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
76
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
77
|
+
// return await this.httpRequest.put(url, object);
|
|
78
|
+
// }
|
|
79
|
+
|
|
80
|
+
// public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
|
|
81
|
+
// const url: string = `${this.baseUrl}cards/activate`;
|
|
82
|
+
// return await this.httpRequest.post(url, object);
|
|
83
|
+
// }
|
|
84
|
+
|
|
85
|
+
// public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
86
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
87
|
+
// return await this.httpRequest.put(url, object);
|
|
88
|
+
// }
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
// //Shipping
|
|
92
|
+
|
|
93
|
+
// public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
|
|
94
|
+
// const url: string = `${this.baseUrl}shipment/create`;
|
|
95
|
+
// return await this.httpRequest.post(url, object);
|
|
96
|
+
// }
|
|
97
|
+
|
|
98
|
+
// public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
|
|
99
|
+
// const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
|
|
100
|
+
// return await this.httpRequest.get(url);
|
|
101
|
+
// }
|
|
102
|
+
|
|
103
|
+
// public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
|
|
104
|
+
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
105
|
+
// return await this.httpRequest.put(url, object);
|
|
106
|
+
// }
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
|
|
2
|
-
import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
|
|
3
|
-
|
|
4
|
-
export interface ISTPAccountApi {
|
|
5
|
-
createAccount(request: AccountCreateRequest): Promise<any>;
|
|
6
|
-
updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
|
|
7
|
-
cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any>
|
|
1
|
+
import {AccountCreateRequest} from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { CreateAccountWebhookDetail } from "@fiado/type-kit/bin/stpAccount";
|
|
3
|
+
|
|
4
|
+
export interface ISTPAccountApi {
|
|
5
|
+
createAccount(request: AccountCreateRequest): Promise<any>;
|
|
6
|
+
updateAccountDetails(request: CreateAccountWebhookDetail): Promise<any>;
|
|
7
|
+
cancelAccount(request: {accountNumber:string, documentNumber:string}): Promise<any>
|
|
8
8
|
}
|
package/src/stpAccount/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/STPAccountApi';
|
|
1
|
+
export * from './api/STPAccountApi';
|
|
2
2
|
export * from './api/interfaces/ISTPAccountApi';
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
|
|
5
|
-
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
6
|
-
|
|
7
|
-
@injectable()
|
|
8
|
-
export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
9
|
-
private readonly baseUrl = process.env.STP_SERVICE_PAY_LAMBDA_URL || "";
|
|
10
|
-
|
|
11
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>> {
|
|
15
|
-
const url = `${this.baseUrl}/pay`;
|
|
16
|
-
return await this.httpRequest.post(url, request);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
20
|
-
const url = `${this.baseUrl}/transaction/${transactionNumber}`;
|
|
21
|
-
return await this.httpRequest.get(url);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
async getById(id: string): Promise<ApiGatewayResponse<any>> {
|
|
25
|
-
const url = `${this.baseUrl}/transaction/${id}`;
|
|
26
|
-
return await this.httpRequest.get(url);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
30
|
-
const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
|
|
31
|
-
return await this.httpRequest.get(url);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>> {
|
|
35
|
-
let url = `${this.baseUrl}/catalog`;
|
|
36
|
-
if (params) {
|
|
37
|
-
url += `?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
|
|
38
|
-
}
|
|
39
|
-
return await this.httpRequest.get(url);
|
|
40
|
-
}
|
|
1
|
+
import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
|
|
5
|
+
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class StpServicePaymentApi implements IStpServicePaymentApi {
|
|
9
|
+
private readonly baseUrl = process.env.STP_SERVICE_PAY_LAMBDA_URL || "";
|
|
10
|
+
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>> {
|
|
15
|
+
const url = `${this.baseUrl}/pay`;
|
|
16
|
+
return await this.httpRequest.post(url, request);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
20
|
+
const url = `${this.baseUrl}/transaction/${transactionNumber}`;
|
|
21
|
+
return await this.httpRequest.get(url);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async getById(id: string): Promise<ApiGatewayResponse<any>> {
|
|
25
|
+
const url = `${this.baseUrl}/transaction/${id}`;
|
|
26
|
+
return await this.httpRequest.get(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
30
|
+
const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
|
|
31
|
+
return await this.httpRequest.get(url);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>> {
|
|
35
|
+
let url = `${this.baseUrl}/catalog`;
|
|
36
|
+
if (params) {
|
|
37
|
+
url += `?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
|
|
38
|
+
}
|
|
39
|
+
return await this.httpRequest.get(url);
|
|
40
|
+
}
|
|
41
41
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
|
|
2
|
-
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
3
|
-
|
|
4
|
-
export interface IStpServicePaymentApi {
|
|
5
|
-
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
6
|
-
|
|
7
|
-
getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
8
|
-
|
|
9
|
-
getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>
|
|
10
|
-
|
|
11
|
-
getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
|
|
12
|
-
|
|
13
|
-
getById(id: string)
|
|
1
|
+
import {GetCatalogParams, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
|
|
2
|
+
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
3
|
+
|
|
4
|
+
export interface IStpServicePaymentApi {
|
|
5
|
+
pay(request: ServicePaymentRequest): Promise<ApiGatewayResponse<any>>;
|
|
6
|
+
|
|
7
|
+
getTransaction(transactionNumber: string): Promise<ApiGatewayResponse<any>>;
|
|
8
|
+
|
|
9
|
+
getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>>
|
|
10
|
+
|
|
11
|
+
getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
|
|
12
|
+
|
|
13
|
+
getById(id: string)
|
|
14
14
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IStpServicePaymentApi';
|
|
1
|
+
export * from './api/interfaces/IStpServicePaymentApi';
|
|
2
2
|
export * from './api/StpServicePaymentApi';
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export class StpSpeiApi implements IStpSpeiApi {
|
|
8
|
-
private readonly baseUrl = process.env.STP_SPEI_LAMBDA_URL || "";
|
|
9
|
-
|
|
10
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async putStpOrder(request: PutStpOrderRequest): Promise<any> {
|
|
14
|
-
const url = `${this.baseUrl}`;
|
|
15
|
-
const headers = {
|
|
16
|
-
'Content-Type': 'application/json',
|
|
17
|
-
operationName: "putConnectorStpOrders"
|
|
18
|
-
}
|
|
19
|
-
return await this.httpRequest.post(url, request, headers);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any> {
|
|
23
|
-
const url: string = `${this.baseUrl}`;
|
|
24
|
-
const request = {
|
|
25
|
-
business: businessName
|
|
26
|
-
}
|
|
27
|
-
const headers = {
|
|
28
|
-
'Content-Type': 'application/json',
|
|
29
|
-
operationName: "getBusinessAccountBalance"
|
|
30
|
-
}
|
|
31
|
-
return await this.httpRequest.post(url, request, headers);
|
|
32
|
-
}
|
|
1
|
+
import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class StpSpeiApi implements IStpSpeiApi {
|
|
8
|
+
private readonly baseUrl = process.env.STP_SPEI_LAMBDA_URL || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async putStpOrder(request: PutStpOrderRequest): Promise<any> {
|
|
14
|
+
const url = `${this.baseUrl}`;
|
|
15
|
+
const headers = {
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
operationName: "putConnectorStpOrders"
|
|
18
|
+
}
|
|
19
|
+
return await this.httpRequest.post(url, request, headers);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any> {
|
|
23
|
+
const url: string = `${this.baseUrl}`;
|
|
24
|
+
const request = {
|
|
25
|
+
business: businessName
|
|
26
|
+
}
|
|
27
|
+
const headers = {
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
operationName: "getBusinessAccountBalance"
|
|
30
|
+
}
|
|
31
|
+
return await this.httpRequest.post(url, request, headers);
|
|
32
|
+
}
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
|
|
2
|
-
|
|
3
|
-
export interface IStpSpeiApi {
|
|
4
|
-
putStpOrder(request: PutStpOrderRequest): Promise<any>;
|
|
5
|
-
|
|
6
|
-
getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
|
|
1
|
+
import {BusinessNameEnum, PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
|
|
2
|
+
|
|
3
|
+
export interface IStpSpeiApi {
|
|
4
|
+
putStpOrder(request: PutStpOrderRequest): Promise<any>;
|
|
5
|
+
|
|
6
|
+
getBusinessAccountBalance(businessName: BusinessNameEnum): Promise<any>;
|
|
7
7
|
}
|
package/src/stpSpei/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IStpSpeiApi';
|
|
1
|
+
export * from './api/interfaces/IStpSpeiApi';
|
|
2
2
|
export * from './api/StpSpeiApi';
|