@fiado/api-invoker 1.1.62 → 1.1.63
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/transaction/api/TransactionApi.d.ts +22 -0
- package/bin/transaction/api/TransactionApi.js +52 -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 +88 -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 +46 -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
package/src/index.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export * from './directory';
|
|
2
|
-
export * from './identity';
|
|
3
|
-
export * from './notificationMessages';
|
|
4
|
-
export * from './sessionActivity';
|
|
5
|
-
export * from './tern';
|
|
6
|
-
export * from './pomelo';
|
|
7
|
-
export * from './address';
|
|
8
|
-
export * from './stpAccount'
|
|
9
|
-
export * from "./container.config";
|
|
10
|
-
export * from "./account-fiadoinc";
|
|
11
|
-
export * from "./account-fiadosa";
|
|
12
|
-
export * from "./account-pagoconfiado";
|
|
13
|
-
export * from "./account-beneficiary";
|
|
14
|
-
export * from "./exchangeRates";
|
|
15
|
-
export * from "./authentication";
|
|
16
|
-
export * from "./transaction";
|
|
17
|
-
export * from "./contract-generator";
|
|
18
|
-
export * from "./product-catalog";
|
|
19
|
-
export * from "./collector";
|
|
20
|
-
export * from "./p2pContact";
|
|
21
|
-
export * from "./bankAccount";
|
|
22
|
-
export * from "./stpSpei";
|
|
23
|
-
export * from "./stpServicePayment";
|
|
24
|
-
export * from "./bbvaRst";
|
|
25
|
-
export * from "./fraudPreventionEngine";
|
|
26
|
-
export * from "./group";
|
|
27
|
-
export * from "./activity-business";
|
|
28
|
-
export * from "./transactionProcessor";
|
|
29
|
-
export * from "./riskProfile";
|
|
30
|
-
export * from "./fiadoMessages";
|
|
31
|
-
export * from "./cnbv-business";
|
|
1
|
+
export * from './directory';
|
|
2
|
+
export * from './identity';
|
|
3
|
+
export * from './notificationMessages';
|
|
4
|
+
export * from './sessionActivity';
|
|
5
|
+
export * from './tern';
|
|
6
|
+
export * from './pomelo';
|
|
7
|
+
export * from './address';
|
|
8
|
+
export * from './stpAccount'
|
|
9
|
+
export * from "./container.config";
|
|
10
|
+
export * from "./account-fiadoinc";
|
|
11
|
+
export * from "./account-fiadosa";
|
|
12
|
+
export * from "./account-pagoconfiado";
|
|
13
|
+
export * from "./account-beneficiary";
|
|
14
|
+
export * from "./exchangeRates";
|
|
15
|
+
export * from "./authentication";
|
|
16
|
+
export * from "./transaction";
|
|
17
|
+
export * from "./contract-generator";
|
|
18
|
+
export * from "./product-catalog";
|
|
19
|
+
export * from "./collector";
|
|
20
|
+
export * from "./p2pContact";
|
|
21
|
+
export * from "./bankAccount";
|
|
22
|
+
export * from "./stpSpei";
|
|
23
|
+
export * from "./stpServicePayment";
|
|
24
|
+
export * from "./bbvaRst";
|
|
25
|
+
export * from "./fraudPreventionEngine";
|
|
26
|
+
export * from "./group";
|
|
27
|
+
export * from "./activity-business";
|
|
28
|
+
export * from "./transactionProcessor";
|
|
29
|
+
export * from "./riskProfile";
|
|
30
|
+
export * from "./fiadoMessages";
|
|
31
|
+
export * from "./cnbv-business";
|
|
32
32
|
export * from "./pomeloProcessor";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './queue/NotificationMessagePublisher';
|
|
1
|
+
export * from './queue/NotificationMessagePublisher';
|
|
2
2
|
export * from './queue/interfaces/INotificationMessagesPublisher';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {INotificationMessagesPublisher} from "./interfaces/INotificationMessagesPublisher";
|
|
2
|
-
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
3
|
-
import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
|
|
4
|
-
import {injectable} from "inversify";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export default class NotificationMessagePublisher implements INotificationMessagesPublisher {
|
|
8
|
-
private readonly NOTIFICATION_MESSAGES_QUEUE = process.env.NOTIFICATION_MESSAGES_QUEUE
|
|
9
|
-
|
|
10
|
-
async publish(message: NotificationQueueMessageRequest): Promise<void> {
|
|
11
|
-
try {
|
|
12
|
-
const client: SQSClient = new SQSClient();
|
|
13
|
-
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
-
QueueUrl: this.NOTIFICATION_MESSAGES_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 {INotificationMessagesPublisher} from "./interfaces/INotificationMessagesPublisher";
|
|
2
|
+
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
3
|
+
import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
|
|
4
|
+
import {injectable} from "inversify";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class NotificationMessagePublisher implements INotificationMessagesPublisher {
|
|
8
|
+
private readonly NOTIFICATION_MESSAGES_QUEUE = process.env.NOTIFICATION_MESSAGES_QUEUE
|
|
9
|
+
|
|
10
|
+
async publish(message: NotificationQueueMessageRequest): Promise<void> {
|
|
11
|
+
try {
|
|
12
|
+
const client: SQSClient = new SQSClient();
|
|
13
|
+
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
+
QueueUrl: this.NOTIFICATION_MESSAGES_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 {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
2
|
-
|
|
3
|
-
export interface INotificationMessagesPublisher {
|
|
4
|
-
publish(message: NotificationQueueMessageRequest): Promise<void>;
|
|
1
|
+
import {NotificationQueueMessageRequest} from "@fiado/type-kit/bin/notificationMessages";
|
|
2
|
+
|
|
3
|
+
export interface INotificationMessagesPublisher {
|
|
4
|
+
publish(message: NotificationQueueMessageRequest): Promise<void>;
|
|
5
5
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {IP2pContactApi} from "./interfaces/IP2pContactApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {CreateP2pContactRequest} from "@fiado/type-kit/bin/p2pContact";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export default class P2pContactApi implements IP2pContactApi {
|
|
8
|
-
private readonly baseUrl = process.env.P2P_CONTACTS_LAMBDA_URL || "";
|
|
9
|
-
|
|
10
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async createP2pContact(request: CreateP2pContactRequest): Promise<any> {
|
|
14
|
-
const url = `${this.baseUrl}p2pcontacts/contacts/create`;
|
|
15
|
-
const headers = {
|
|
16
|
-
'Content-Type': 'application/json'
|
|
17
|
-
}
|
|
18
|
-
return await this.httpRequest.post(url, request, headers);
|
|
19
|
-
}
|
|
1
|
+
import {IP2pContactApi} from "./interfaces/IP2pContactApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {CreateP2pContactRequest} from "@fiado/type-kit/bin/p2pContact";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class P2pContactApi implements IP2pContactApi {
|
|
8
|
+
private readonly baseUrl = process.env.P2P_CONTACTS_LAMBDA_URL || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async createP2pContact(request: CreateP2pContactRequest): Promise<any> {
|
|
14
|
+
const url = `${this.baseUrl}p2pcontacts/contacts/create`;
|
|
15
|
+
const headers = {
|
|
16
|
+
'Content-Type': 'application/json'
|
|
17
|
+
}
|
|
18
|
+
return await this.httpRequest.post(url, request, headers);
|
|
19
|
+
}
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {CreateP2pContactRequest} from "@fiado/type-kit/bin/p2pContact";
|
|
2
|
-
|
|
3
|
-
export interface IP2pContactApi {
|
|
4
|
-
createP2pContact(request: CreateP2pContactRequest): Promise<any>;
|
|
1
|
+
import {CreateP2pContactRequest} from "@fiado/type-kit/bin/p2pContact";
|
|
2
|
+
|
|
3
|
+
export interface IP2pContactApi {
|
|
4
|
+
createP2pContact(request: CreateP2pContactRequest): Promise<any>;
|
|
5
5
|
}
|
package/src/p2pContact/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IP2pContactApi';
|
|
1
|
+
export * from './api/interfaces/IP2pContactApi';
|
|
2
2
|
export * from './api/P2pContactApi';
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
5
|
-
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export default class PomeloApi implements IPomeloApi {
|
|
10
|
-
|
|
11
|
-
private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
|
|
12
|
-
|
|
13
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//USER
|
|
17
|
-
async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
18
|
-
const url: string = `${this.baseUrl}users/create`;
|
|
19
|
-
return await this.httpRequest.post(url, request);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public async getUserById(externalUserId: string): Promise<any> {
|
|
23
|
-
const url: string = `${this.baseUrl}users/${externalUserId}`;
|
|
24
|
-
return await this.httpRequest.get(url);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
|
|
28
|
-
const url: string = `${this.baseUrl}/users/${object.id}`;
|
|
29
|
-
return await this.httpRequest.put(url, object);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// //Card
|
|
33
|
-
public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
34
|
-
const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
35
|
-
return await this.httpRequest.get(url);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public async getCardsById(externalCardId: string): Promise<any> {
|
|
39
|
-
const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
40
|
-
return await this.httpRequest.get(url);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public async getCardsByUserId(externalUserId: string): Promise<any> {
|
|
44
|
-
const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
45
|
-
return await this.httpRequest.get(url);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public async createCard(object: CreateBankAccountRequest): Promise<any> {
|
|
49
|
-
const url: string = `${this.baseUrl}cards/create`;
|
|
50
|
-
return await this.httpRequest.post(url, object);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public async blockCard(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
54
|
-
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
55
|
-
return await this.httpRequest.put(url, object);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public async changePin(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
59
|
-
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
60
|
-
return await this.httpRequest.put(url, object);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public async updateCard(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
64
|
-
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
65
|
-
return await this.httpRequest.put(url, object);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public async activateCard(object: ActivateBankAccountCardRequest): Promise<any> {
|
|
69
|
-
const url: string = `${this.baseUrl}cards/activate`;
|
|
70
|
-
return await this.httpRequest.post(url, object);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public async assignCardToUser(request: AssignCardRequest): Promise<any> {
|
|
74
|
-
const url: string = `${this.baseUrl}cards/activate`;
|
|
75
|
-
return await this.httpRequest.post(url, request);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// //Shipping
|
|
80
|
-
|
|
81
|
-
public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
|
|
82
|
-
const url: string = `${this.baseUrl}shipment/create`;
|
|
83
|
-
return await this.httpRequest.post(url, object);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
public async getShipment(object: GetBankAccountShippingRequest): Promise<any> {
|
|
87
|
-
const url: string = `${this.baseUrl}shipment/${object.externalShippingId}`;
|
|
88
|
-
return await this.httpRequest.get(url);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
|
|
92
|
-
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
93
|
-
// return await this.httpRequest.put(url, object);
|
|
94
|
-
// }
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
1
|
+
import { IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
5
|
+
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export default class PomeloApi implements IPomeloApi {
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//USER
|
|
17
|
+
async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
18
|
+
const url: string = `${this.baseUrl}users/create`;
|
|
19
|
+
return await this.httpRequest.post(url, request);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public async getUserById(externalUserId: string): Promise<any> {
|
|
23
|
+
const url: string = `${this.baseUrl}users/${externalUserId}`;
|
|
24
|
+
return await this.httpRequest.get(url);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
|
|
28
|
+
const url: string = `${this.baseUrl}/users/${object.id}`;
|
|
29
|
+
return await this.httpRequest.put(url, object);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// //Card
|
|
33
|
+
public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
34
|
+
const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
35
|
+
return await this.httpRequest.get(url);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public async getCardsById(externalCardId: string): Promise<any> {
|
|
39
|
+
const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
40
|
+
return await this.httpRequest.get(url);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public async getCardsByUserId(externalUserId: string): Promise<any> {
|
|
44
|
+
const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
45
|
+
return await this.httpRequest.get(url);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public async createCard(object: CreateBankAccountRequest): Promise<any> {
|
|
49
|
+
const url: string = `${this.baseUrl}cards/create`;
|
|
50
|
+
return await this.httpRequest.post(url, object);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public async blockCard(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
54
|
+
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
55
|
+
return await this.httpRequest.put(url, object);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public async changePin(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
59
|
+
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
60
|
+
return await this.httpRequest.put(url, object);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public async updateCard(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
64
|
+
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
65
|
+
return await this.httpRequest.put(url, object);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public async activateCard(object: ActivateBankAccountCardRequest): Promise<any> {
|
|
69
|
+
const url: string = `${this.baseUrl}cards/activate`;
|
|
70
|
+
return await this.httpRequest.post(url, object);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public async assignCardToUser(request: AssignCardRequest): Promise<any> {
|
|
74
|
+
const url: string = `${this.baseUrl}cards/activate`;
|
|
75
|
+
return await this.httpRequest.post(url, request);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
// //Shipping
|
|
80
|
+
|
|
81
|
+
public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
|
|
82
|
+
const url: string = `${this.baseUrl}shipment/create`;
|
|
83
|
+
return await this.httpRequest.post(url, object);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public async getShipment(object: GetBankAccountShippingRequest): Promise<any> {
|
|
87
|
+
const url: string = `${this.baseUrl}shipment/${object.externalShippingId}`;
|
|
88
|
+
return await this.httpRequest.get(url);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
|
|
92
|
+
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
93
|
+
// return await this.httpRequest.put(url, object);
|
|
94
|
+
// }
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
|
-
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
3
|
-
|
|
4
|
-
export interface IPomeloApi {
|
|
5
|
-
|
|
6
|
-
updateUser(object: UpdateBankAccountUserRequest): Promise<any>
|
|
7
|
-
getUserById(externalUserId: string): Promise<any>
|
|
8
|
-
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// //Card
|
|
12
|
-
getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>
|
|
13
|
-
getCardsById(externalCardId: string): Promise<any>
|
|
14
|
-
getCardsByUserId(externalUserId: string): Promise<any>
|
|
15
|
-
createCard(object: CreateBankAccountRequest): Promise<any>
|
|
16
|
-
blockCard(object: UpdateBankAccountCardRequest): Promise<any>
|
|
17
|
-
changePin(object: UpdateBankAccountCardRequest): Promise<any>
|
|
18
|
-
activateCard(object: ActivateBankAccountCardRequest): Promise<any>
|
|
19
|
-
|
|
20
|
-
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
21
|
-
// //Shipping
|
|
22
|
-
|
|
23
|
-
createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>
|
|
24
|
-
getShipment(object: GetBankAccountShippingRequest): Promise<any>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
3
|
+
|
|
4
|
+
export interface IPomeloApi {
|
|
5
|
+
|
|
6
|
+
updateUser(object: UpdateBankAccountUserRequest): Promise<any>
|
|
7
|
+
getUserById(externalUserId: string): Promise<any>
|
|
8
|
+
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// //Card
|
|
12
|
+
getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>
|
|
13
|
+
getCardsById(externalCardId: string): Promise<any>
|
|
14
|
+
getCardsByUserId(externalUserId: string): Promise<any>
|
|
15
|
+
createCard(object: CreateBankAccountRequest): Promise<any>
|
|
16
|
+
blockCard(object: UpdateBankAccountCardRequest): Promise<any>
|
|
17
|
+
changePin(object: UpdateBankAccountCardRequest): Promise<any>
|
|
18
|
+
activateCard(object: ActivateBankAccountCardRequest): Promise<any>
|
|
19
|
+
|
|
20
|
+
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
21
|
+
// //Shipping
|
|
22
|
+
|
|
23
|
+
createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>
|
|
24
|
+
getShipment(object: GetBankAccountShippingRequest): Promise<any>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
28
|
}
|
package/src/pomelo/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/PomeloApi';
|
|
1
|
+
export * from './api/PomeloApi';
|
|
2
2
|
export * from './api/interfaces/IPomeloApi';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {inject, injectable} from "inversify";
|
|
2
|
-
import {IPomeloProcessorApi} from "./interfaces/IPomeloProcessorApi";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
|
|
5
|
-
@injectable()
|
|
6
|
-
export class PomeloProcessorApi implements IPomeloProcessorApi {
|
|
7
|
-
private readonly baseUrl = process.env.POMELO_PROCESSOR_LAMBDA_URL || "";
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
10
|
-
@inject("IHttpRequest") private httpRequest: IHttpRequest
|
|
11
|
-
) {
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async getPomeloTransactionById(transactionId: string) {
|
|
15
|
-
const url: string = `${this.baseUrl}transactions/${encodeURIComponent(transactionId)}`;
|
|
16
|
-
return await this.httpRequest.get(url);
|
|
17
|
-
}
|
|
1
|
+
import {inject, injectable} from "inversify";
|
|
2
|
+
import {IPomeloProcessorApi} from "./interfaces/IPomeloProcessorApi";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
|
|
5
|
+
@injectable()
|
|
6
|
+
export class PomeloProcessorApi implements IPomeloProcessorApi {
|
|
7
|
+
private readonly baseUrl = process.env.POMELO_PROCESSOR_LAMBDA_URL || "";
|
|
8
|
+
|
|
9
|
+
constructor(
|
|
10
|
+
@inject("IHttpRequest") private httpRequest: IHttpRequest
|
|
11
|
+
) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async getPomeloTransactionById(transactionId: string) {
|
|
15
|
+
const url: string = `${this.baseUrl}transactions/${encodeURIComponent(transactionId)}`;
|
|
16
|
+
return await this.httpRequest.get(url);
|
|
17
|
+
}
|
|
18
18
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface IPomeloProcessorApi {
|
|
2
|
-
getPomeloTransactionById(transactionId: string): Promise<any>;
|
|
1
|
+
export interface IPomeloProcessorApi {
|
|
2
|
+
getPomeloTransactionById(transactionId: string): Promise<any>;
|
|
3
3
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IPomeloProcessorApi';
|
|
2
|
-
export * from './api/PomeloProcessorApi';
|
|
1
|
+
export * from './api/interfaces/IPomeloProcessorApi';
|
|
2
|
+
export * from './api/PomeloProcessorApi';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {IProductCatalogApi} from "./interfaces/IProductCatalogApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
5
|
-
import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
|
|
6
|
-
|
|
7
|
-
@injectable()
|
|
8
|
-
export default class ProductCatalogApi implements IProductCatalogApi {
|
|
9
|
-
private readonly baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
|
|
10
|
-
|
|
11
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
|
|
15
|
-
const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
|
|
16
|
-
return await this.httpRequest.get(url);
|
|
17
|
-
}
|
|
1
|
+
import {IProductCatalogApi} from "./interfaces/IProductCatalogApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
5
|
+
import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class ProductCatalogApi implements IProductCatalogApi {
|
|
9
|
+
private readonly baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
|
|
10
|
+
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
|
|
15
|
+
const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
|
|
16
|
+
return await this.httpRequest.get(url);
|
|
17
|
+
}
|
|
18
18
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/IProductCatalogApi';
|
|
1
|
+
export * from './interfaces/IProductCatalogApi';
|
|
2
2
|
export * from './ProductCatalogApi';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
2
|
-
import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface IProductCatalogApi {
|
|
6
|
-
getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
|
|
1
|
+
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
2
|
+
import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface IProductCatalogApi {
|
|
6
|
+
getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
|
|
7
7
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {IRiskProfileApi} from "./interfaces/IRiskProfileApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
5
|
-
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
6
|
-
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
7
|
-
|
|
8
|
-
@injectable()
|
|
9
|
-
export default class RiskProfileApi implements IRiskProfileApi {
|
|
10
|
-
private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
|
|
11
|
-
|
|
12
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async createRiskProfile(request: CreateRiskProfileRequest): Promise<any> {
|
|
16
|
-
const url = `${this.baseUrl}/profiles`;
|
|
17
|
-
return await this.httpRequest.post(url, request);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any> {
|
|
21
|
-
const url = `${this.baseUrl}/profiles`;
|
|
22
|
-
return await this.httpRequest.put(url, request);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any> {
|
|
26
|
-
const url = `${this.baseUrl}/alarms`;
|
|
27
|
-
return await this.httpRequest.put(url, request);
|
|
28
|
-
}
|
|
29
|
-
|
|
1
|
+
import {IRiskProfileApi} from "./interfaces/IRiskProfileApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
5
|
+
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
6
|
+
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
7
|
+
|
|
8
|
+
@injectable()
|
|
9
|
+
export default class RiskProfileApi implements IRiskProfileApi {
|
|
10
|
+
private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
|
|
11
|
+
|
|
12
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async createRiskProfile(request: CreateRiskProfileRequest): Promise<any> {
|
|
16
|
+
const url = `${this.baseUrl}/profiles`;
|
|
17
|
+
return await this.httpRequest.post(url, request);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any> {
|
|
21
|
+
const url = `${this.baseUrl}/profiles`;
|
|
22
|
+
return await this.httpRequest.put(url, request);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any> {
|
|
26
|
+
const url = `${this.baseUrl}/alarms`;
|
|
27
|
+
return await this.httpRequest.put(url, request);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
30
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
2
|
-
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
3
|
-
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
4
|
-
|
|
5
|
-
export interface IRiskProfileApi {
|
|
6
|
-
createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
|
|
7
|
-
|
|
8
|
-
updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any>;
|
|
9
|
-
|
|
10
|
-
updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
|
|
1
|
+
import {CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
2
|
+
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
3
|
+
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
4
|
+
|
|
5
|
+
export interface IRiskProfileApi {
|
|
6
|
+
createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
|
|
7
|
+
|
|
8
|
+
updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any>;
|
|
9
|
+
|
|
10
|
+
updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
|
|
11
11
|
}
|