@fiado/api-invoker 1.3.20 → 1.3.22
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/bin/bankAccount/BankAccountApi.d.ts +7 -4
- package/bin/bankAccount/BankAccountApi.js +9 -24
- package/bin/centralPayments/CentralPaymentsConnectorApi.d.ts +3 -3
- package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.d.ts +3 -3
- package/package.json +2 -2
- package/src/bankAccount/BankAccountApi.ts +20 -34
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +3 -3
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +3 -3
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { IBankAccountApi } from "./interfaces/IBankAccountApi";
|
|
2
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { IBankAccountApi } from "./interfaces/IBankAccountApi";
|
|
3
|
+
import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
|
|
4
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
5
|
+
import { GetExternalBankResponse } from "@fiado/type-kit/bin/bankAccount";
|
|
3
6
|
export default class BankAccountApi implements IBankAccountApi {
|
|
4
7
|
private httpRequest;
|
|
5
8
|
private readonly baseUrl;
|
|
6
9
|
constructor(httpRequest: IHttpRequest);
|
|
7
|
-
getBankAccountById(bankAccountId: string): Promise<
|
|
8
|
-
getBankById(bankId: string): Promise<
|
|
9
|
-
getBankByCode(bankCode?: string, shortBankCode?: string): Promise<
|
|
10
|
+
getBankAccountById(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>>;
|
|
11
|
+
getBankById(bankId: string): Promise<FiadoApiResponse<GetExternalBankResponse>>;
|
|
12
|
+
getBankByCode(bankCode?: string, shortBankCode?: string): Promise<FiadoApiResponse<GetExternalBankResponse[]>>;
|
|
10
13
|
}
|
|
@@ -19,35 +19,20 @@ let BankAccountApi = class BankAccountApi {
|
|
|
19
19
|
this.baseUrl = process.env.BANK_ACCOUNT_LAMBDA_UR || "";
|
|
20
20
|
}
|
|
21
21
|
async getBankAccountById(bankAccountId) {
|
|
22
|
-
const url = `${this.baseUrl}`;
|
|
23
|
-
|
|
24
|
-
accountId: bankAccountId
|
|
25
|
-
};
|
|
26
|
-
const headers = {
|
|
27
|
-
'Content-Type': 'application/json',
|
|
28
|
-
operationName: "postBankAccountId"
|
|
29
|
-
};
|
|
30
|
-
return await this.httpRequest.post(url, body, headers);
|
|
22
|
+
const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
|
|
23
|
+
return await this.httpRequest.get(url);
|
|
31
24
|
}
|
|
32
25
|
async getBankById(bankId) {
|
|
33
|
-
const url = `${this.baseUrl}`;
|
|
34
|
-
|
|
35
|
-
bankId: bankId
|
|
36
|
-
};
|
|
37
|
-
const headers = {
|
|
38
|
-
'Content-Type': 'application/json',
|
|
39
|
-
operationName: "getBanksBankId"
|
|
40
|
-
};
|
|
41
|
-
return await this.httpRequest.post(url, body, headers);
|
|
26
|
+
const url = `${this.baseUrl}/banks/${bankId}`;
|
|
27
|
+
return await this.httpRequest.get(url);
|
|
42
28
|
}
|
|
43
29
|
async getBankByCode(bankCode, shortBankCode) {
|
|
44
|
-
const url = `${this.baseUrl}`;
|
|
45
|
-
const params =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
operationName: "getBanks"
|
|
30
|
+
const url = `${this.baseUrl}/banks`;
|
|
31
|
+
const params = {
|
|
32
|
+
...bankCode && { bankCode: bankCode },
|
|
33
|
+
...shortBankCode && { shortBankCode: shortBankCode },
|
|
49
34
|
};
|
|
50
|
-
return await this.httpRequest.
|
|
35
|
+
return await this.httpRequest.get(url, { params });
|
|
51
36
|
}
|
|
52
37
|
};
|
|
53
38
|
BankAccountApi = __decorate([
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
-
import { BankAccountP2pTransferRequest, BankAccountPocketTransferRequest, BankAccountPocketTransferResponse, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { BankAccountAchTransferRequest, BankAccountAchTransferResponse, BankAccountP2pTransferRequest, BankAccountPocketTransferRequest, BankAccountPocketTransferResponse, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
3
3
|
import { BankAccountP2pTransferResponse } from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
|
|
4
4
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
5
5
|
import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
|
|
6
6
|
import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
|
|
7
7
|
import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, CreateBankAccountCardRequest, CreateBankAccountCardResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, ReplaceBankAccountCardRequest, ReplaceBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
|
|
8
|
-
import {
|
|
8
|
+
import { HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
|
|
9
9
|
import { ProviderDocumentUploadRequest, ProviderDocumentUploadResponse } from "@fiado/type-kit/bin/provider";
|
|
10
10
|
import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, ProviderTransactionReversalRequest, ProviderTransactionReversalResponse, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
|
|
11
11
|
import { InvokerUtils } from "../utils/InvokerUtils";
|
|
@@ -46,7 +46,7 @@ export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConn
|
|
|
46
46
|
getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
|
|
47
47
|
executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
|
|
48
48
|
executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>>;
|
|
49
|
-
executeAchTransaction(request:
|
|
49
|
+
executeAchTransaction(request: BankAccountAchTransferRequest): Promise<FiadoApiResponse<BankAccountAchTransferResponse>>;
|
|
50
50
|
executeFinancialOperationReversal(request: ProviderTransactionReversalRequest): Promise<FiadoApiResponse<ProviderTransactionReversalResponse>>;
|
|
51
51
|
getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
|
|
52
52
|
createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BankAccountP2pTransferRequest, BankAccountPocketTransferRequest, BankAccountPocketTransferResponse, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
1
|
+
import { BankAccountAchTransferRequest, BankAccountAchTransferResponse, BankAccountP2pTransferRequest, BankAccountPocketTransferRequest, BankAccountPocketTransferResponse, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountResponse, GetBankAccountSensitiveInformationResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
2
|
import { BankAccountP2pTransferResponse } from "@fiado/type-kit/bin/account/dtos/BankAccountP2pTransferResponse";
|
|
3
3
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
4
4
|
import { CreateExternalBankAccountRequest, CreateExternalBankAccountResponse } from "@fiado/type-kit/bin/bankAccount";
|
|
5
5
|
import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
|
|
6
6
|
import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBatchRequest, CardBatchResponse, CardStatementListResponse, CreateBankAccountCardRequest, CreateBankAccountCardResponse, GetBankAccountCardBalanceResponse, GetBankAccountCardResponse, ReplaceBankAccountCardRequest, ReplaceBankAccountCardResponse, StatementDocumentResponse, UpdateBankAccountCardRequest, UpdateBankAccountCardResponse } from "@fiado/type-kit/bin/card";
|
|
7
|
-
import {
|
|
7
|
+
import { HealthcheckResponse, OOWQuestionsResponse, SubmitOOWQuestionAnswersRequest } from "@fiado/type-kit/bin/centralPayments";
|
|
8
8
|
import { ProviderDocumentUploadRequest, ProviderDocumentUploadResponse } from "@fiado/type-kit/bin/provider";
|
|
9
9
|
import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, ProviderTransactionReversalRequest, ProviderTransactionReversalResponse, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
|
|
10
10
|
export interface ICentralPaymentsConnectorApi {
|
|
@@ -39,7 +39,7 @@ export interface ICentralPaymentsConnectorApi {
|
|
|
39
39
|
getTransactionDetails(externalTransactionId: string): Promise<FiadoApiResponse<CentralPaymentsTransactionItem>>;
|
|
40
40
|
executeCardToCardTransaction(request: BankAccountP2pTransferRequest): Promise<FiadoApiResponse<BankAccountP2pTransferResponse>>;
|
|
41
41
|
executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>>;
|
|
42
|
-
executeAchTransaction(request:
|
|
42
|
+
executeAchTransaction(request: BankAccountAchTransferRequest): Promise<FiadoApiResponse<BankAccountAchTransferResponse>>;
|
|
43
43
|
executeFinancialOperationReversal(request: ProviderTransactionReversalRequest): Promise<FiadoApiResponse<ProviderTransactionReversalResponse>>;
|
|
44
44
|
getCardholderACHBankAccounts(externalUserId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse[]>>;
|
|
45
45
|
createCardholderACHBankAccount(externalUserId: string, request: CreateExternalBankAccountRequest): Promise<FiadoApiResponse<CreateExternalBankAccountResponse>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.22",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@fiado/gateway-adapter": "^1.1.40",
|
|
17
17
|
"@fiado/http-client": "^1.0.5",
|
|
18
18
|
"@fiado/logger": "^1.0.3",
|
|
19
|
-
"@fiado/type-kit": "^1.9.
|
|
19
|
+
"@fiado/type-kit": "^1.9.14",
|
|
20
20
|
"dotenv": "^16.4.7",
|
|
21
21
|
"inversify": "^6.2.2",
|
|
22
22
|
"reflect-metadata": "^0.2.2"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { ApiResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { inject, injectable } from "inversify";
|
|
4
|
+
import { IBankAccountApi } from "./interfaces/IBankAccountApi";
|
|
5
|
+
import GetExternalBankAccountResponse from "@fiado/type-kit/bin/bankAccount/dtos/GetExternalBankAccountResponse";
|
|
6
|
+
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
7
|
+
import { GetExternalBankResponse } from "@fiado/type-kit/bin/bankAccount";
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
@injectable()
|
|
7
11
|
export default class BankAccountApi implements IBankAccountApi {
|
|
@@ -10,40 +14,22 @@ export default class BankAccountApi implements IBankAccountApi {
|
|
|
10
14
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
15
|
}
|
|
12
16
|
|
|
13
|
-
async getBankAccountById(bankAccountId: string): Promise<
|
|
14
|
-
const url = `${this.baseUrl}`;
|
|
15
|
-
|
|
16
|
-
accountId: bankAccountId
|
|
17
|
-
} as GetExternalBankAccountRequest;
|
|
18
|
-
const headers = {
|
|
19
|
-
'Content-Type': 'application/json',
|
|
20
|
-
operationName: "postBankAccountId"
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return await this.httpRequest.post(url, body, headers);
|
|
17
|
+
async getBankAccountById(bankAccountId: string): Promise<FiadoApiResponse<GetExternalBankAccountResponse>> {
|
|
18
|
+
const url = `${this.baseUrl}/bank-accounts/${bankAccountId}`;
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
24
20
|
}
|
|
25
21
|
|
|
26
|
-
async getBankById(bankId: string): Promise<
|
|
27
|
-
const url = `${this.baseUrl}`;
|
|
28
|
-
|
|
29
|
-
bankId: bankId
|
|
30
|
-
} as GetExternalBankAccountRequest;
|
|
31
|
-
const headers = {
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
operationName: "getBanksBankId"
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
return await this.httpRequest.post(url, body, headers);
|
|
22
|
+
async getBankById(bankId: string): Promise<FiadoApiResponse<GetExternalBankResponse>> {
|
|
23
|
+
const url = `${this.baseUrl}/banks/${bankId}`;
|
|
24
|
+
return await this.httpRequest.get(url);
|
|
37
25
|
}
|
|
38
26
|
|
|
39
|
-
async getBankByCode(bankCode?: string, shortBankCode?: string): Promise<
|
|
40
|
-
const url = `${this.baseUrl}`;
|
|
41
|
-
const params =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
operationName: "getBanks"
|
|
27
|
+
async getBankByCode(bankCode?: string, shortBankCode?: string): Promise<FiadoApiResponse<GetExternalBankResponse[]>> {
|
|
28
|
+
const url = `${this.baseUrl}/banks`;
|
|
29
|
+
const params = {
|
|
30
|
+
...bankCode && { bankCode: bankCode },
|
|
31
|
+
...shortBankCode && { shortBankCode: shortBankCode },
|
|
45
32
|
};
|
|
46
|
-
|
|
47
|
-
return await this.httpRequest.post(`${url}?${params}`, null, headers);
|
|
33
|
+
return await this.httpRequest.get(url, { params });
|
|
48
34
|
}
|
|
49
35
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import {
|
|
3
|
+
BankAccountAchTransferRequest,
|
|
4
|
+
BankAccountAchTransferResponse,
|
|
3
5
|
BankAccountP2pTransferRequest,
|
|
4
6
|
BankAccountPocketTransferRequest,
|
|
5
7
|
BankAccountPocketTransferResponse,
|
|
@@ -31,8 +33,6 @@ import {
|
|
|
31
33
|
UpdateBankAccountCardResponse
|
|
32
34
|
} from "@fiado/type-kit/bin/card";
|
|
33
35
|
import {
|
|
34
|
-
AchTransactionRequest,
|
|
35
|
-
AchTransactionResponse,
|
|
36
36
|
HealthcheckResponse,
|
|
37
37
|
OOWQuestionsResponse,
|
|
38
38
|
SubmitOOWQuestionAnswersRequest
|
|
@@ -223,7 +223,7 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
|
|
|
223
223
|
return await this.httpRequest.post(url, request);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
async executeAchTransaction(request:
|
|
226
|
+
async executeAchTransaction(request: BankAccountAchTransferRequest): Promise<FiadoApiResponse<BankAccountAchTransferResponse>> {
|
|
227
227
|
const url = `${this.baseUrl}/transactions/ach/transfer`;
|
|
228
228
|
return await this.httpRequest.post(url, request);
|
|
229
229
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BankAccountAchTransferRequest,
|
|
3
|
+
BankAccountAchTransferResponse,
|
|
2
4
|
BankAccountP2pTransferRequest,
|
|
3
5
|
BankAccountPocketTransferRequest,
|
|
4
6
|
BankAccountPocketTransferResponse,
|
|
@@ -30,8 +32,6 @@ import {
|
|
|
30
32
|
UpdateBankAccountCardResponse
|
|
31
33
|
} from "@fiado/type-kit/bin/card";
|
|
32
34
|
import {
|
|
33
|
-
AchTransactionRequest,
|
|
34
|
-
AchTransactionResponse,
|
|
35
35
|
HealthcheckResponse,
|
|
36
36
|
OOWQuestionsResponse,
|
|
37
37
|
SubmitOOWQuestionAnswersRequest
|
|
@@ -108,7 +108,7 @@ export interface ICentralPaymentsConnectorApi {
|
|
|
108
108
|
|
|
109
109
|
executeFinancialOperation(request: BankAccountPocketTransferRequest[]): Promise<FiadoApiResponse<BankAccountPocketTransferResponse[]>>;
|
|
110
110
|
|
|
111
|
-
executeAchTransaction(request:
|
|
111
|
+
executeAchTransaction(request: BankAccountAchTransferRequest): Promise<FiadoApiResponse<BankAccountAchTransferResponse>>;
|
|
112
112
|
|
|
113
113
|
executeFinancialOperationReversal(request: ProviderTransactionReversalRequest): Promise<FiadoApiResponse<ProviderTransactionReversalResponse>>;
|
|
114
114
|
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
|
|
2
|
-
export interface ICognitoApi {
|
|
3
|
-
/**
|
|
4
|
-
* Healthcheck for the cognito-connector
|
|
5
|
-
*/
|
|
6
|
-
healthcheck(): Promise<HealthcheckResponse>;
|
|
7
|
-
/**
|
|
8
|
-
* Create a new user in Cognito
|
|
9
|
-
*/
|
|
10
|
-
signUp(request: SignUpRequest): Promise<SignUpResponse>;
|
|
11
|
-
/**
|
|
12
|
-
* Confirm sign-up for a user in Cognito
|
|
13
|
-
*/
|
|
14
|
-
signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Sign in a user
|
|
17
|
-
*/
|
|
18
|
-
signIn(request: SignInRequest): Promise<SignInResponse>;
|
|
19
|
-
/**
|
|
20
|
-
* Sign out a user
|
|
21
|
-
*/
|
|
22
|
-
signOut(): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Change a user's password
|
|
25
|
-
*/
|
|
26
|
-
changePassword(request: ChangePasswordRequest): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Retrieve user details
|
|
29
|
-
*/
|
|
30
|
-
getUser(request: GetUserRequest): Promise<GetUserResponse>;
|
|
31
|
-
/**
|
|
32
|
-
* Refresh a user's tokens
|
|
33
|
-
*/
|
|
34
|
-
refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Respond to an auth challenge
|
|
37
|
-
*/
|
|
38
|
-
respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
|
|
39
|
-
/**
|
|
40
|
-
* Reset a user's password
|
|
41
|
-
*/
|
|
42
|
-
resetPassword(request: SetPasswordRequest): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
export interface HealthcheckResponse {
|
|
45
|
-
status: string;
|
|
46
|
-
}
|