@fiado/api-invoker 1.1.61 → 1.1.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/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/pomeloProcessor/api/PomeloProcessorApi.d.ts +8 -0
- package/bin/pomeloProcessor/api/PomeloProcessorApi.js +32 -0
- package/bin/pomeloProcessor/api/interfaces/IPomeloProcessorApi.d.ts +3 -0
- package/bin/pomeloProcessor/api/interfaces/IPomeloProcessorApi.js +2 -0
- package/bin/pomeloProcessor/index.d.ts +2 -0
- package/bin/pomeloProcessor/index.js +18 -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 +32 -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 +18 -0
- package/src/pomeloProcessor/api/interfaces/IPomeloProcessorApi.ts +3 -0
- package/src/pomeloProcessor/index.ts +2 -0
- 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/index.ts +2 -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/tern/api/TernApi.ts
CHANGED
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
import { ITernApi } from "./interfaces/ITernApi";
|
|
2
|
-
import { inject, injectable } from "inversify";
|
|
3
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import {
|
|
5
|
-
BankAccountP2pTransferRequest,
|
|
6
|
-
CreateBankAccountRequest,
|
|
7
|
-
CreateBankAccountUserRequest,
|
|
8
|
-
GetBankAccountRequest,
|
|
9
|
-
GetBankAccountUserRequest,
|
|
10
|
-
} from "@fiado/type-kit/bin/account";
|
|
11
|
-
import {
|
|
12
|
-
ActivateBankAccountCardRequest,
|
|
13
|
-
AssignCardRequest,
|
|
14
|
-
CreateBankAccountCardRequest,
|
|
15
|
-
UpdateBankAccountCardRequest
|
|
16
|
-
} from "@fiado/type-kit/bin/card";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@injectable()
|
|
20
|
-
export default class TernApi implements ITernApi {
|
|
21
|
-
private readonly baseUrl = process.env.TERN_LAMBDA_URL || "";
|
|
22
|
-
|
|
23
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/// USERS
|
|
27
|
-
async getUser(request: GetBankAccountUserRequest): Promise<any> {
|
|
28
|
-
const url: string = `${this.baseUrl}users/${request.externalUserId}`;
|
|
29
|
-
return await this.httpRequest.get(url);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
33
|
-
const url: string = `${this.baseUrl}users/create`;
|
|
34
|
-
return await this.httpRequest.post(url, request);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/// ACCOUNTS
|
|
38
|
-
async getAccount(request: GetBankAccountRequest): Promise<any> {
|
|
39
|
-
const url: string = `${this.baseUrl}accounts/${request.externalAccountId}`;
|
|
40
|
-
return await this.httpRequest.get(url);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async getBusinessAccount(request: GetBankAccountRequest): Promise<any> {
|
|
44
|
-
const url: string = `${this.baseUrl}accounts/${request.externalAccountId}?accountType=BUSINESS`;
|
|
45
|
-
return await this.httpRequest.get(url);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async createAccount(request: CreateBankAccountRequest): Promise<any> {
|
|
49
|
-
const url: string = `${this.baseUrl}accounts/create`;
|
|
50
|
-
return await this.httpRequest.post(url, request);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/// CARDS
|
|
54
|
-
|
|
55
|
-
async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
56
|
-
|
|
57
|
-
const url = `${this.baseUrl}cards/${externalCardId}/sensitive`;
|
|
58
|
-
return await this.httpRequest.get(url);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async getCardsById(externalCardId: string): Promise<any> {
|
|
62
|
-
|
|
63
|
-
const url = `${this.baseUrl}cards/${externalCardId}/`;
|
|
64
|
-
return await this.httpRequest.get(url);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async createCard(request: CreateBankAccountCardRequest): Promise<any> {
|
|
68
|
-
const url = `${this.baseUrl}cards/create`;
|
|
69
|
-
return await this.httpRequest.post(url, request);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async blockCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
73
|
-
const url = `${this.baseUrl}cards/block`;
|
|
74
|
-
return await this.httpRequest.post(url, request);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async changePin(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
78
|
-
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
79
|
-
return await this.httpRequest.put(url, request);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async updateCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
83
|
-
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
84
|
-
return await this.httpRequest.put(url, request);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async activateCard(request: ActivateBankAccountCardRequest): Promise<any> {
|
|
88
|
-
const url = `${this.baseUrl}cards/activate`;
|
|
89
|
-
return await this.httpRequest.post(url, request);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async assignCardToUser(request: AssignCardRequest): Promise<any> {
|
|
93
|
-
const url = `${this.baseUrl}cards/activate`;
|
|
94
|
-
return await this.httpRequest.post(url, request);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async p2pTransfer(request: BankAccountP2pTransferRequest): Promise<any> {
|
|
98
|
-
const url: string = `${this.baseUrl}users/accounts/transfer_balances`;
|
|
99
|
-
return await this.httpRequest.patch(url, request);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
//transactions
|
|
103
|
-
async getTransactions(accountId: string, page: number, pageSize?: number | null, startDate?: string | null, endDate?: string | null, detail: boolean = false, raw: boolean = false): Promise<any> {
|
|
104
|
-
try {
|
|
105
|
-
let url = `${this.baseUrl}users/${accountId}/v2/transactions?page=${page}&detail=${detail}&raw=${raw}`;
|
|
106
|
-
|
|
107
|
-
// Verificar si pageSize es válido y agregarlo
|
|
108
|
-
if (pageSize != null) {
|
|
109
|
-
url += `&pageSize=${encodeURIComponent(pageSize)}`;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Verificar si startDate es válido y agregarlo
|
|
113
|
-
if (startDate) {
|
|
114
|
-
url += `&startDate=${encodeURIComponent(startDate)}`;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Verificar si endDate es válido y agregarlo
|
|
118
|
-
if (endDate) {
|
|
119
|
-
url += `&endDate=${encodeURIComponent(endDate)}`;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return await this.httpRequest.get(url);
|
|
123
|
-
} catch (error) {
|
|
124
|
-
console.log(error);
|
|
125
|
-
throw error;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
async getCardTransactions(externalUserId: string, page: number, pageSize: number): Promise<any> {
|
|
130
|
-
const url = `${this.baseUrl}users/${externalUserId}/transactions?page=${page}&pageSize=${pageSize}`;
|
|
131
|
-
return await this.httpRequest.get(url);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
async getAccountTransactions(accountId: string): Promise<any> {
|
|
135
|
-
const url = `${this.baseUrl}accounts/${accountId}/transactions/all`;
|
|
136
|
-
return await this.httpRequest.get(url);
|
|
137
|
-
}
|
|
1
|
+
import { ITernApi } from "./interfaces/ITernApi";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import {
|
|
5
|
+
BankAccountP2pTransferRequest,
|
|
6
|
+
CreateBankAccountRequest,
|
|
7
|
+
CreateBankAccountUserRequest,
|
|
8
|
+
GetBankAccountRequest,
|
|
9
|
+
GetBankAccountUserRequest,
|
|
10
|
+
} from "@fiado/type-kit/bin/account";
|
|
11
|
+
import {
|
|
12
|
+
ActivateBankAccountCardRequest,
|
|
13
|
+
AssignCardRequest,
|
|
14
|
+
CreateBankAccountCardRequest,
|
|
15
|
+
UpdateBankAccountCardRequest
|
|
16
|
+
} from "@fiado/type-kit/bin/card";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@injectable()
|
|
20
|
+
export default class TernApi implements ITernApi {
|
|
21
|
+
private readonly baseUrl = process.env.TERN_LAMBDA_URL || "";
|
|
22
|
+
|
|
23
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// USERS
|
|
27
|
+
async getUser(request: GetBankAccountUserRequest): Promise<any> {
|
|
28
|
+
const url: string = `${this.baseUrl}users/${request.externalUserId}`;
|
|
29
|
+
return await this.httpRequest.get(url);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
33
|
+
const url: string = `${this.baseUrl}users/create`;
|
|
34
|
+
return await this.httpRequest.post(url, request);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// ACCOUNTS
|
|
38
|
+
async getAccount(request: GetBankAccountRequest): Promise<any> {
|
|
39
|
+
const url: string = `${this.baseUrl}accounts/${request.externalAccountId}`;
|
|
40
|
+
return await this.httpRequest.get(url);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async getBusinessAccount(request: GetBankAccountRequest): Promise<any> {
|
|
44
|
+
const url: string = `${this.baseUrl}accounts/${request.externalAccountId}?accountType=BUSINESS`;
|
|
45
|
+
return await this.httpRequest.get(url);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async createAccount(request: CreateBankAccountRequest): Promise<any> {
|
|
49
|
+
const url: string = `${this.baseUrl}accounts/create`;
|
|
50
|
+
return await this.httpRequest.post(url, request);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// CARDS
|
|
54
|
+
|
|
55
|
+
async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
56
|
+
|
|
57
|
+
const url = `${this.baseUrl}cards/${externalCardId}/sensitive`;
|
|
58
|
+
return await this.httpRequest.get(url);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async getCardsById(externalCardId: string): Promise<any> {
|
|
62
|
+
|
|
63
|
+
const url = `${this.baseUrl}cards/${externalCardId}/`;
|
|
64
|
+
return await this.httpRequest.get(url);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async createCard(request: CreateBankAccountCardRequest): Promise<any> {
|
|
68
|
+
const url = `${this.baseUrl}cards/create`;
|
|
69
|
+
return await this.httpRequest.post(url, request);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async blockCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
73
|
+
const url = `${this.baseUrl}cards/block`;
|
|
74
|
+
return await this.httpRequest.post(url, request);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async changePin(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
78
|
+
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
79
|
+
return await this.httpRequest.put(url, request);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async updateCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
83
|
+
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
84
|
+
return await this.httpRequest.put(url, request);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async activateCard(request: ActivateBankAccountCardRequest): Promise<any> {
|
|
88
|
+
const url = `${this.baseUrl}cards/activate`;
|
|
89
|
+
return await this.httpRequest.post(url, request);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async assignCardToUser(request: AssignCardRequest): Promise<any> {
|
|
93
|
+
const url = `${this.baseUrl}cards/activate`;
|
|
94
|
+
return await this.httpRequest.post(url, request);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async p2pTransfer(request: BankAccountP2pTransferRequest): Promise<any> {
|
|
98
|
+
const url: string = `${this.baseUrl}users/accounts/transfer_balances`;
|
|
99
|
+
return await this.httpRequest.patch(url, request);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//transactions
|
|
103
|
+
async getTransactions(accountId: string, page: number, pageSize?: number | null, startDate?: string | null, endDate?: string | null, detail: boolean = false, raw: boolean = false): Promise<any> {
|
|
104
|
+
try {
|
|
105
|
+
let url = `${this.baseUrl}users/${accountId}/v2/transactions?page=${page}&detail=${detail}&raw=${raw}`;
|
|
106
|
+
|
|
107
|
+
// Verificar si pageSize es válido y agregarlo
|
|
108
|
+
if (pageSize != null) {
|
|
109
|
+
url += `&pageSize=${encodeURIComponent(pageSize)}`;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Verificar si startDate es válido y agregarlo
|
|
113
|
+
if (startDate) {
|
|
114
|
+
url += `&startDate=${encodeURIComponent(startDate)}`;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Verificar si endDate es válido y agregarlo
|
|
118
|
+
if (endDate) {
|
|
119
|
+
url += `&endDate=${encodeURIComponent(endDate)}`;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return await this.httpRequest.get(url);
|
|
123
|
+
} catch (error) {
|
|
124
|
+
console.log(error);
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async getCardTransactions(externalUserId: string, page: number, pageSize: number): Promise<any> {
|
|
130
|
+
const url = `${this.baseUrl}users/${externalUserId}/transactions?page=${page}&pageSize=${pageSize}`;
|
|
131
|
+
return await this.httpRequest.get(url);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async getAccountTransactions(accountId: string): Promise<any> {
|
|
135
|
+
const url = `${this.baseUrl}accounts/${accountId}/transactions/all`;
|
|
136
|
+
return await this.httpRequest.get(url);
|
|
137
|
+
}
|
|
138
138
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {CreateBankAccountRequest, CreateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
|
|
2
|
-
import {GetBankAccountUserRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountUserRequest";
|
|
3
|
-
import {GetBankAccountRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountRequest";
|
|
4
|
-
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
5
|
-
|
|
6
|
-
export interface ITernApi {
|
|
7
|
-
getUser(request: GetBankAccountUserRequest): Promise<any>;
|
|
8
|
-
|
|
9
|
-
getAccount(request: GetBankAccountRequest): Promise<any>;
|
|
10
|
-
|
|
11
|
-
getBusinessAccount(request: GetBankAccountRequest): Promise<any>
|
|
12
|
-
|
|
13
|
-
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
14
|
-
|
|
15
|
-
createAccount(request: CreateBankAccountRequest): Promise<any>
|
|
16
|
-
|
|
17
|
-
getCardsById(externalCardId: string): Promise<any>;
|
|
18
|
-
|
|
19
|
-
createCard(request: CreateBankAccountCardRequest): Promise<any>;
|
|
20
|
-
|
|
21
|
-
blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
22
|
-
|
|
23
|
-
changePin(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
24
|
-
|
|
25
|
-
updateCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
26
|
-
|
|
27
|
-
activateCard(request: ActivateBankAccountCardRequest): Promise<any>;
|
|
28
|
-
|
|
29
|
-
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
30
|
-
|
|
31
|
-
p2pTransfer(request: any): Promise<any>
|
|
32
|
-
|
|
33
|
-
getTransactions(accountId: string, page: number, pageSize?: number | null, startDate?: string | null, endDate?: string | null, detail?: boolean): Promise<any>;
|
|
34
|
-
|
|
35
|
-
getCardTransactions(externalUserId: string, page: number, pageSize: number): Promise<any>;
|
|
36
|
-
|
|
37
|
-
getAccountTransactions(accountId: string): Promise<any>
|
|
38
|
-
|
|
1
|
+
import {CreateBankAccountRequest, CreateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
|
|
2
|
+
import {GetBankAccountUserRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountUserRequest";
|
|
3
|
+
import {GetBankAccountRequest} from "@fiado/type-kit/bin/account/dtos/GetBankAccountRequest";
|
|
4
|
+
import { ActivateBankAccountCardRequest, AssignCardRequest, CreateBankAccountCardRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
5
|
+
|
|
6
|
+
export interface ITernApi {
|
|
7
|
+
getUser(request: GetBankAccountUserRequest): Promise<any>;
|
|
8
|
+
|
|
9
|
+
getAccount(request: GetBankAccountRequest): Promise<any>;
|
|
10
|
+
|
|
11
|
+
getBusinessAccount(request: GetBankAccountRequest): Promise<any>
|
|
12
|
+
|
|
13
|
+
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
14
|
+
|
|
15
|
+
createAccount(request: CreateBankAccountRequest): Promise<any>
|
|
16
|
+
|
|
17
|
+
getCardsById(externalCardId: string): Promise<any>;
|
|
18
|
+
|
|
19
|
+
createCard(request: CreateBankAccountCardRequest): Promise<any>;
|
|
20
|
+
|
|
21
|
+
blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
22
|
+
|
|
23
|
+
changePin(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
24
|
+
|
|
25
|
+
updateCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
26
|
+
|
|
27
|
+
activateCard(request: ActivateBankAccountCardRequest): Promise<any>;
|
|
28
|
+
|
|
29
|
+
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
30
|
+
|
|
31
|
+
p2pTransfer(request: any): Promise<any>
|
|
32
|
+
|
|
33
|
+
getTransactions(accountId: string, page: number, pageSize?: number | null, startDate?: string | null, endDate?: string | null, detail?: boolean): Promise<any>;
|
|
34
|
+
|
|
35
|
+
getCardTransactions(externalUserId: string, page: number, pageSize: number): Promise<any>;
|
|
36
|
+
|
|
37
|
+
getAccountTransactions(accountId: string): Promise<any>
|
|
38
|
+
|
|
39
39
|
}
|
package/src/tern/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/TernApi';
|
|
1
|
+
export * from './api/TernApi';
|
|
2
2
|
export * from './api/interfaces/ITernApi';
|
package/src/transaction/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './queue/TransactionPublisher';
|
|
2
|
-
export * from './queue/interfaces/ITransactionPublisher';
|
|
1
|
+
export * from './queue/TransactionPublisher';
|
|
2
|
+
export * from './queue/interfaces/ITransactionPublisher';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
|
|
2
|
-
import {ITransactionPublisher} from "./interfaces/ITransactionPublisher";
|
|
3
|
-
import {injectable} from "inversify";
|
|
4
|
-
import {TransactionCreateRequest} from "@fiado/type-kit/bin/transaction";
|
|
5
|
-
|
|
6
|
-
@injectable()
|
|
7
|
-
export class TransactionPublisher implements ITransactionPublisher {
|
|
8
|
-
private readonly TRANSACTION_QUEUE = process.env.TRANSACTION_QUEUE
|
|
9
|
-
|
|
10
|
-
async publish(message: TransactionCreateRequest): Promise<void> {
|
|
11
|
-
try {
|
|
12
|
-
const client: SQSClient = new SQSClient();
|
|
13
|
-
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
-
QueueUrl: this.TRANSACTION_QUEUE,
|
|
15
|
-
MessageBody: JSON.stringify(message),
|
|
16
|
-
MessageGroupId: message.transactionNumber,
|
|
17
|
-
MessageDeduplicationId: message.transactionNumber
|
|
18
|
-
};
|
|
19
|
-
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
20
|
-
await client.send(command);
|
|
21
|
-
} catch (error) {
|
|
22
|
-
throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
1
|
+
import {SendMessageCommand, SendMessageRequest, SQSClient} from "@aws-sdk/client-sqs";
|
|
2
|
+
import {ITransactionPublisher} from "./interfaces/ITransactionPublisher";
|
|
3
|
+
import {injectable} from "inversify";
|
|
4
|
+
import {TransactionCreateRequest} from "@fiado/type-kit/bin/transaction";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export class TransactionPublisher implements ITransactionPublisher {
|
|
8
|
+
private readonly TRANSACTION_QUEUE = process.env.TRANSACTION_QUEUE
|
|
9
|
+
|
|
10
|
+
async publish(message: TransactionCreateRequest): Promise<void> {
|
|
11
|
+
try {
|
|
12
|
+
const client: SQSClient = new SQSClient();
|
|
13
|
+
const sendMessageRequest: SendMessageRequest = {
|
|
14
|
+
QueueUrl: this.TRANSACTION_QUEUE,
|
|
15
|
+
MessageBody: JSON.stringify(message),
|
|
16
|
+
MessageGroupId: message.transactionNumber,
|
|
17
|
+
MessageDeduplicationId: message.transactionNumber
|
|
18
|
+
};
|
|
19
|
+
const command: SendMessageCommand = new SendMessageCommand(sendMessageRequest);
|
|
20
|
+
await client.send(command);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw new Error(`Error publishing message to queue ${': ' + error.message ?? ''}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TransactionCreateRequest } from "@fiado/type-kit/bin/transaction";
|
|
2
|
-
|
|
3
|
-
export interface ITransactionPublisher {
|
|
4
|
-
publish(message: TransactionCreateRequest): Promise<void>;
|
|
1
|
+
import { TransactionCreateRequest } from "@fiado/type-kit/bin/transaction";
|
|
2
|
+
|
|
3
|
+
export interface ITransactionPublisher {
|
|
4
|
+
publish(message: TransactionCreateRequest): Promise<void>;
|
|
5
5
|
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {ITransactionProcessorApi} from "./interfaces/ITransactionProcessorApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {
|
|
5
|
-
AuthorizeCollectorTransactionRequest,
|
|
6
|
-
AuthorizeCreditCardPurchaseRequest,
|
|
7
|
-
AuthorizeSpeiMexBankTransferInRequest
|
|
8
|
-
} from "@fiado/type-kit/bin/transactionProcessor";
|
|
9
|
-
import ProcessUpdateLevelRequest from "@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest";
|
|
10
|
-
|
|
11
|
-
@injectable()
|
|
12
|
-
export default class TransactionProcessorApi implements ITransactionProcessorApi {
|
|
13
|
-
private readonly baseUrl = process.env.TRANSACTION_PROCESSOR_LAMBDA_URL || "";
|
|
14
|
-
|
|
15
|
-
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async authorizeTransaction(request: AuthorizeCreditCardPurchaseRequest): Promise<any> {
|
|
19
|
-
const url: string = `${this.baseUrl}authorize`;
|
|
20
|
-
return await this.httpRequest.post(url, request);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async authorizeSpeiBankTransferInTransaction(request: AuthorizeSpeiMexBankTransferInRequest): Promise<any> {
|
|
24
|
-
const url: string = `${this.baseUrl}spei/authorize`;
|
|
25
|
-
return await this.httpRequest.post(url, request);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async processUpdateLevel(request: ProcessUpdateLevelRequest): Promise<any> {
|
|
29
|
-
const url: string = `${this.baseUrl}accountLevel`;
|
|
30
|
-
return await this.httpRequest.put(url, request);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async authorizeCollectorTransaction(request: AuthorizeCollectorTransactionRequest): Promise<any> {
|
|
34
|
-
const url: string = `${this.baseUrl}collector`;
|
|
35
|
-
return await this.httpRequest.post(url, request);
|
|
36
|
-
}
|
|
37
|
-
|
|
1
|
+
import {ITransactionProcessorApi} from "./interfaces/ITransactionProcessorApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {
|
|
5
|
+
AuthorizeCollectorTransactionRequest,
|
|
6
|
+
AuthorizeCreditCardPurchaseRequest,
|
|
7
|
+
AuthorizeSpeiMexBankTransferInRequest
|
|
8
|
+
} from "@fiado/type-kit/bin/transactionProcessor";
|
|
9
|
+
import ProcessUpdateLevelRequest from "@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest";
|
|
10
|
+
|
|
11
|
+
@injectable()
|
|
12
|
+
export default class TransactionProcessorApi implements ITransactionProcessorApi {
|
|
13
|
+
private readonly baseUrl = process.env.TRANSACTION_PROCESSOR_LAMBDA_URL || "";
|
|
14
|
+
|
|
15
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async authorizeTransaction(request: AuthorizeCreditCardPurchaseRequest): Promise<any> {
|
|
19
|
+
const url: string = `${this.baseUrl}authorize`;
|
|
20
|
+
return await this.httpRequest.post(url, request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async authorizeSpeiBankTransferInTransaction(request: AuthorizeSpeiMexBankTransferInRequest): Promise<any> {
|
|
24
|
+
const url: string = `${this.baseUrl}spei/authorize`;
|
|
25
|
+
return await this.httpRequest.post(url, request);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async processUpdateLevel(request: ProcessUpdateLevelRequest): Promise<any> {
|
|
29
|
+
const url: string = `${this.baseUrl}accountLevel`;
|
|
30
|
+
return await this.httpRequest.put(url, request);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async authorizeCollectorTransaction(request: AuthorizeCollectorTransactionRequest): Promise<any> {
|
|
34
|
+
const url: string = `${this.baseUrl}collector`;
|
|
35
|
+
return await this.httpRequest.post(url, request);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
38
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AuthorizeCollectorTransactionRequest,
|
|
3
|
-
AuthorizeCreditCardPurchaseRequest,
|
|
4
|
-
AuthorizeSpeiMexBankTransferInRequest
|
|
5
|
-
} from "@fiado/type-kit/bin/transactionProcessor";
|
|
6
|
-
import ProcessUpdateLevelRequest from "@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest";
|
|
7
|
-
|
|
8
|
-
export interface ITransactionProcessorApi {
|
|
9
|
-
authorizeTransaction(request: AuthorizeCreditCardPurchaseRequest): Promise<any>;
|
|
10
|
-
|
|
11
|
-
authorizeSpeiBankTransferInTransaction(request: AuthorizeSpeiMexBankTransferInRequest): Promise<any>
|
|
12
|
-
|
|
13
|
-
processUpdateLevel(request: ProcessUpdateLevelRequest): Promise<any>;
|
|
14
|
-
|
|
15
|
-
authorizeCollectorTransaction(request: AuthorizeCollectorTransactionRequest): Promise<any>;
|
|
1
|
+
import {
|
|
2
|
+
AuthorizeCollectorTransactionRequest,
|
|
3
|
+
AuthorizeCreditCardPurchaseRequest,
|
|
4
|
+
AuthorizeSpeiMexBankTransferInRequest
|
|
5
|
+
} from "@fiado/type-kit/bin/transactionProcessor";
|
|
6
|
+
import ProcessUpdateLevelRequest from "@fiado/type-kit/bin/transactionProcessor/dtos/ProcessUpdateLevelRequest";
|
|
7
|
+
|
|
8
|
+
export interface ITransactionProcessorApi {
|
|
9
|
+
authorizeTransaction(request: AuthorizeCreditCardPurchaseRequest): Promise<any>;
|
|
10
|
+
|
|
11
|
+
authorizeSpeiBankTransferInTransaction(request: AuthorizeSpeiMexBankTransferInRequest): Promise<any>
|
|
12
|
+
|
|
13
|
+
processUpdateLevel(request: ProcessUpdateLevelRequest): Promise<any>;
|
|
14
|
+
|
|
15
|
+
authorizeCollectorTransaction(request: AuthorizeCollectorTransactionRequest): Promise<any>;
|
|
16
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/TransactionProcessorApi';
|
|
1
|
+
export * from './api/TransactionProcessorApi';
|
|
2
2
|
export * from './api/interfaces/ITransactionProcessorApi';
|
package/tsconfig.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"forceConsistentCasingInFileNames": true,
|
|
8
|
-
"experimentalDecorators": true,
|
|
9
|
-
"emitDecoratorMetadata": true,
|
|
10
|
-
"outDir": "./bin",
|
|
11
|
-
"rootDir": "./src",
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"declaration": true,
|
|
14
|
-
},
|
|
15
|
-
"include": [
|
|
16
|
-
"./src/**/*"
|
|
17
|
-
],
|
|
18
|
-
"exclude": [
|
|
19
|
-
"node_modules"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"emitDecoratorMetadata": true,
|
|
10
|
+
"outDir": "./bin",
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"declaration": true,
|
|
14
|
+
},
|
|
15
|
+
"include": [
|
|
16
|
+
"./src/**/*"
|
|
17
|
+
],
|
|
18
|
+
"exclude": [
|
|
19
|
+
"node_modules"
|
|
20
|
+
]
|
|
21
|
+
}
|