@fiado/api-invoker 1.1.7 → 1.1.8
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/exchangeRates/ExchangeRatesApi.d.ts +2 -0
- package/bin/exchangeRates/ExchangeRatesApi.js +6 -0
- package/bin/exchangeRates/interfaces/IExchangeRatesApi.d.ts +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 +60 -60
- package/src/account-fiadoinc/index.ts +1 -1
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +29 -29
- package/src/account-fiadosa/AccountFiadoSAApi.ts +22 -22
- package/src/account-fiadosa/index.ts +1 -1
- package/src/account-fiadosa/interfaces/IAccountFiadoSAApi.ts +9 -9
- package/src/account-pagoconfiado/AccountPagoConfiadoApi.ts +27 -27
- package/src/account-pagoconfiado/index.ts +2 -2
- package/src/account-pagoconfiado/interfaces/IAccountPagoConfiadoApi.ts +8 -8
- 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 +37 -37
- package/src/bankAccount/index.ts +1 -1
- package/src/bankAccount/interfaces/IBankAccountApi.ts +4 -4
- 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 +33 -33
- package/src/card/index.ts +3 -3
- package/src/card/interfaces/ICardApi.ts +10 -10
- package/src/collector/CollectorApi.ts +21 -21
- package/src/collector/index.ts +2 -2
- package/src/collector/interfaces/ICollectorApi.ts +19 -19
- package/src/container.config.ts +70 -70
- 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 +115 -115
- package/src/directory/index.ts +3 -3
- package/src/directory/interfaces/IDirectoryApi.ts +66 -66
- package/src/exchangeRates/ExchangeRatesApi.ts +27 -18
- package/src/exchangeRates/index.ts +1 -1
- package/src/exchangeRates/interfaces/IExchangeRatesApi.ts +8 -5
- 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 +25 -25
- 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/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/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 +102 -102
- package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +6 -6
- package/src/stpAccount/index.ts +1 -1
- package/src/stpServicePayment/api/StpServicePaymentApi.ts +35 -35
- package/src/stpServicePayment/api/interfaces/IStpServicePaymentApi.ts +11 -11
- package/src/stpServicePayment/index.ts +1 -1
- package/src/stpSpei/api/StpSpeiApi.ts +20 -20
- package/src/stpSpei/api/interfaces/IStpSpeiApi.ts +4 -4
- package/src/stpSpei/index.ts +1 -1
- package/src/tern/api/TernApi.ts +96 -96
- package/src/tern/api/interfaces/ITernApi.ts +29 -29
- 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/tsconfig.json +21 -21
- package/bin/activity/ActivityApi.d.ts +0 -17
- package/bin/activity/ActivityApi.js +0 -72
- package/bin/activity/index.d.ts +0 -2
- package/bin/activity/index.js +0 -18
- package/bin/activity/interfaces/IActivityApi.d.ts +0 -39
- package/bin/activity/interfaces/IActivityApi.js +0 -2
|
@@ -1,36 +1,36 @@
|
|
|
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 getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
25
|
-
const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
|
|
26
|
-
return await this.httpRequest.get(url);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>> {
|
|
30
|
-
let url = `${this.baseUrl}/catalog`;
|
|
31
|
-
if (params) {
|
|
32
|
-
url += `?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
|
|
33
|
-
}
|
|
34
|
-
return await this.httpRequest.get(url);
|
|
35
|
-
}
|
|
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 getPaymentValidation(transactionNumber: string): Promise<ApiGatewayResponse<any>> {
|
|
25
|
+
const url = `${this.baseUrl}/pay/validation/${transactionNumber}`;
|
|
26
|
+
return await this.httpRequest.get(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>> {
|
|
30
|
+
let url = `${this.baseUrl}/catalog`;
|
|
31
|
+
if (params) {
|
|
32
|
+
url += `?${Object.keys(params).map(key => `${key}=${encodeURIComponent(params[key])}`).join('&')}`;
|
|
33
|
+
}
|
|
34
|
+
return await this.httpRequest.get(url);
|
|
35
|
+
}
|
|
36
36
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
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>>;
|
|
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
12
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './api/interfaces/IStpServicePaymentApi';
|
|
1
|
+
export * from './api/interfaces/IStpServicePaymentApi';
|
|
2
2
|
export * from './api/StpServicePaymentApi';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {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
|
-
}
|
|
1
|
+
import {IStpSpeiApi} from "./interfaces/IStpSpeiApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import {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
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
|
|
2
|
-
|
|
3
|
-
export interface IStpSpeiApi {
|
|
4
|
-
putStpOrder(request: PutStpOrderRequest): Promise<any>;
|
|
1
|
+
import {PutStpOrderRequest} from "@fiado/type-kit/bin/stpSpei";
|
|
2
|
+
|
|
3
|
+
export interface IStpSpeiApi {
|
|
4
|
+
putStpOrder(request: PutStpOrderRequest): Promise<any>;
|
|
5
5
|
}
|
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';
|
package/src/tern/api/TernApi.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
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 createAccount(request: CreateBankAccountRequest): Promise<any> {
|
|
44
|
-
const url: string = `${this.baseUrl}accounts/create`;
|
|
45
|
-
return await this.httpRequest.post(url, request);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/// CARDS
|
|
49
|
-
|
|
50
|
-
async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
51
|
-
|
|
52
|
-
const url = `${this.baseUrl}cards/${externalCardId}/sensitive`;
|
|
53
|
-
return await this.httpRequest.get(url);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async getCardsById(externalCardId: string): Promise<any> {
|
|
57
|
-
|
|
58
|
-
const url = `${this.baseUrl}cards/${externalCardId}/`;
|
|
59
|
-
return await this.httpRequest.get(url);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async createCard(request: CreateBankAccountCardRequest): Promise<any> {
|
|
63
|
-
const url = `${this.baseUrl}cards/create`;
|
|
64
|
-
return await this.httpRequest.post(url, request);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async blockCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
68
|
-
const url = `${this.baseUrl}cards/block`;
|
|
69
|
-
return await this.httpRequest.post(url, request);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
async changePin(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
73
|
-
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
74
|
-
return await this.httpRequest.put(url, request);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async updateCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
78
|
-
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
79
|
-
return await this.httpRequest.put(url, request);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async activateCard(request: ActivateBankAccountCardRequest): Promise<any> {
|
|
83
|
-
const url = `${this.baseUrl}cards/activate`;
|
|
84
|
-
return await this.httpRequest.post(url, request);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
async assignCardToUser(request: AssignCardRequest): Promise<any> {
|
|
88
|
-
const url = `${this.baseUrl}cards/activate`;
|
|
89
|
-
return await this.httpRequest.post(url, request);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async p2pTransfer(request: BankAccountP2pTransferRequest): Promise<any> {
|
|
93
|
-
const url: string = `${this.baseUrl}users/accounts/transfer_balances`;
|
|
94
|
-
return await this.httpRequest.patch(url, request);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
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 createAccount(request: CreateBankAccountRequest): Promise<any> {
|
|
44
|
+
const url: string = `${this.baseUrl}accounts/create`;
|
|
45
|
+
return await this.httpRequest.post(url, request);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/// CARDS
|
|
49
|
+
|
|
50
|
+
async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
51
|
+
|
|
52
|
+
const url = `${this.baseUrl}cards/${externalCardId}/sensitive`;
|
|
53
|
+
return await this.httpRequest.get(url);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async getCardsById(externalCardId: string): Promise<any> {
|
|
57
|
+
|
|
58
|
+
const url = `${this.baseUrl}cards/${externalCardId}/`;
|
|
59
|
+
return await this.httpRequest.get(url);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async createCard(request: CreateBankAccountCardRequest): Promise<any> {
|
|
63
|
+
const url = `${this.baseUrl}cards/create`;
|
|
64
|
+
return await this.httpRequest.post(url, request);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async blockCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
68
|
+
const url = `${this.baseUrl}cards/block`;
|
|
69
|
+
return await this.httpRequest.post(url, request);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async changePin(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
73
|
+
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
74
|
+
return await this.httpRequest.put(url, request);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async updateCard(request: UpdateBankAccountCardRequest): Promise<any> {
|
|
78
|
+
const url = `${this.baseUrl}cards/${request.cardId}/`;
|
|
79
|
+
return await this.httpRequest.put(url, request);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async activateCard(request: ActivateBankAccountCardRequest): Promise<any> {
|
|
83
|
+
const url = `${this.baseUrl}cards/activate`;
|
|
84
|
+
return await this.httpRequest.post(url, request);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async assignCardToUser(request: AssignCardRequest): Promise<any> {
|
|
88
|
+
const url = `${this.baseUrl}cards/activate`;
|
|
89
|
+
return await this.httpRequest.post(url, request);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async p2pTransfer(request: BankAccountP2pTransferRequest): Promise<any> {
|
|
93
|
+
const url: string = `${this.baseUrl}users/accounts/transfer_balances`;
|
|
94
|
+
return await this.httpRequest.patch(url, request);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
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
|
-
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
12
|
-
|
|
13
|
-
createAccount(request: CreateBankAccountRequest): Promise<any>
|
|
14
|
-
|
|
15
|
-
getCardsById(externalCardId: string): Promise<any>;
|
|
16
|
-
|
|
17
|
-
createCard(request: CreateBankAccountCardRequest): Promise<any>;
|
|
18
|
-
|
|
19
|
-
blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
20
|
-
|
|
21
|
-
changePin(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
22
|
-
|
|
23
|
-
updateCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
24
|
-
|
|
25
|
-
activateCard(request: ActivateBankAccountCardRequest): Promise<any>;
|
|
26
|
-
|
|
27
|
-
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
28
|
-
|
|
29
|
-
p2pTransfer(request: any): Promise<any>
|
|
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
|
+
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
12
|
+
|
|
13
|
+
createAccount(request: CreateBankAccountRequest): Promise<any>
|
|
14
|
+
|
|
15
|
+
getCardsById(externalCardId: string): Promise<any>;
|
|
16
|
+
|
|
17
|
+
createCard(request: CreateBankAccountCardRequest): Promise<any>;
|
|
18
|
+
|
|
19
|
+
blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
20
|
+
|
|
21
|
+
changePin(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
22
|
+
|
|
23
|
+
updateCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
|
24
|
+
|
|
25
|
+
activateCard(request: ActivateBankAccountCardRequest): Promise<any>;
|
|
26
|
+
|
|
27
|
+
assignCardToUser(request: AssignCardRequest): Promise<any>;
|
|
28
|
+
|
|
29
|
+
p2pTransfer(request: any): Promise<any>
|
|
30
30
|
}
|
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
|
}
|
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
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { IActivityApi } from './interfaces/IActivityApi';
|
|
3
|
-
import { TypeOfDirectoryId } from '@fiado/type-kit/bin/directory';
|
|
4
|
-
export declare class ActivityApi implements IActivityApi {
|
|
5
|
-
private httpRequest;
|
|
6
|
-
private readonly baseUrl;
|
|
7
|
-
constructor(httpRequest: IHttpRequest);
|
|
8
|
-
getActivities(typeOfActivities: string[]): Promise<any>;
|
|
9
|
-
getActivitiesByDirectoryIdAndTypeOfActivity(directoryId: string, typeOfActivities: string[]): Promise<any>;
|
|
10
|
-
postActivity(params: {
|
|
11
|
-
directoryId: string;
|
|
12
|
-
typeOfDirectoryId: TypeOfDirectoryId;
|
|
13
|
-
typeOfActivity: string;
|
|
14
|
-
amount: string;
|
|
15
|
-
date: string;
|
|
16
|
-
}): Promise<any>;
|
|
17
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ActivityApi = void 0;
|
|
19
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
|
20
|
-
const inversify_1 = require("inversify");
|
|
21
|
-
dotenv_1.default.config();
|
|
22
|
-
let ActivityApi = class ActivityApi {
|
|
23
|
-
constructor(httpRequest) {
|
|
24
|
-
this.httpRequest = httpRequest;
|
|
25
|
-
this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
|
|
26
|
-
}
|
|
27
|
-
async getActivities(typeOfActivities) {
|
|
28
|
-
let url = `${this.baseUrl}activities`;
|
|
29
|
-
if (typeOfActivities.length > 0) {
|
|
30
|
-
url = `${this.baseUrl}activities?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
|
|
31
|
-
}
|
|
32
|
-
const operationName = "getActivities";
|
|
33
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
34
|
-
}
|
|
35
|
-
async getActivitiesByDirectoryIdAndTypeOfActivity(directoryId, typeOfActivities) {
|
|
36
|
-
if (directoryId == null || directoryId == undefined || directoryId == "") {
|
|
37
|
-
throw new Error("At least directory ID is required.");
|
|
38
|
-
}
|
|
39
|
-
let url = `${this.baseUrl}activities/directory/${directoryId}`;
|
|
40
|
-
if (typeOfActivities.length > 0) {
|
|
41
|
-
url = `${this.baseUrl}activities/directory/${directoryId}?${typeOfActivities.map(id => `typeOfActivities=${encodeURIComponent(id)}`).join('&')}`;
|
|
42
|
-
}
|
|
43
|
-
const operationName = "getActivitiesByDirectoryIdAndTypeOfActivity";
|
|
44
|
-
return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
|
|
45
|
-
}
|
|
46
|
-
async postActivity(params) {
|
|
47
|
-
if (params.directoryId == null || params.directoryId == undefined || params.directoryId == "") {
|
|
48
|
-
throw new Error("At least directory ID is required.");
|
|
49
|
-
}
|
|
50
|
-
if (params.typeOfDirectoryId == null || params.typeOfDirectoryId == undefined) {
|
|
51
|
-
throw new Error("At least typeOfDirectoryId is required.");
|
|
52
|
-
}
|
|
53
|
-
if (params.typeOfActivity == null || params.typeOfActivity == undefined || params.typeOfActivity == "") {
|
|
54
|
-
throw new Error("At least typeOfActivity is required.");
|
|
55
|
-
}
|
|
56
|
-
if (params.amount == null || params.amount == undefined || params.amount == "") {
|
|
57
|
-
throw new Error("At least amount is required.");
|
|
58
|
-
}
|
|
59
|
-
if (params.date == null || params.date == undefined || params.date == "") {
|
|
60
|
-
throw new Error("At least date is required.");
|
|
61
|
-
}
|
|
62
|
-
const url = `${this.baseUrl}/activities/create`;
|
|
63
|
-
const operationName = "postActivity";
|
|
64
|
-
return await this.httpRequest.post(`${url}`, params, { 'operationName': operationName });
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
exports.ActivityApi = ActivityApi;
|
|
68
|
-
exports.ActivityApi = ActivityApi = __decorate([
|
|
69
|
-
(0, inversify_1.injectable)(),
|
|
70
|
-
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
71
|
-
__metadata("design:paramtypes", [Object])
|
|
72
|
-
], ActivityApi);
|
package/bin/activity/index.d.ts
DELETED
package/bin/activity/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./interfaces/IActivityApi"), exports);
|
|
18
|
-
__exportStar(require("./ActivityApi"), exports);
|