@fiado/api-invoker 1.2.58 → 1.2.60
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/account-fiadoinc/AccountFiadoIncApi.d.ts +1 -1
- package/bin/account-fiadoinc/AccountFiadoIncApi.js +2 -2
- package/bin/account-fiadoinc/interfaces/IAccountFiadoIncApi.d.ts +1 -1
- package/bin/centralPayments/CentralPaymentsConnectorApi.js +1 -1
- package/package.json +1 -1
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +51 -51
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +1 -1
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +1 -1
|
@@ -8,7 +8,7 @@ export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
|
8
8
|
private readonly httpRequest;
|
|
9
9
|
private readonly baseUrl;
|
|
10
10
|
constructor(httpRequest: IHttpRequest);
|
|
11
|
-
confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
11
|
+
confirmUserCreation(provider: Provider, externalUserId: string, request: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
12
12
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
13
13
|
getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>>;
|
|
14
14
|
getPocketBalance(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>>;
|
|
@@ -18,9 +18,9 @@ let AccountFiadoIncApi = class AccountFiadoIncApi {
|
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
19
|
this.baseUrl = process.env.ACCOUNT_FIADOINC_LAMBDA_URL || "";
|
|
20
20
|
}
|
|
21
|
-
async confirmUserCreation(provider, externalUserId) {
|
|
21
|
+
async confirmUserCreation(provider, externalUserId, request) {
|
|
22
22
|
const url = `${this.baseUrl}${provider}/users/${externalUserId}/confirm`;
|
|
23
|
-
return await this.httpRequest.put(url);
|
|
23
|
+
return await this.httpRequest.put(url, request);
|
|
24
24
|
}
|
|
25
25
|
async createAccount(provider, data) {
|
|
26
26
|
const url = `${this.baseUrl}${provider}`;
|
|
@@ -3,7 +3,7 @@ import { OperationEnum } from "@fiado/type-kit/bin/transaction";
|
|
|
3
3
|
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
4
4
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
5
5
|
export interface IAccountFiadoIncApi {
|
|
6
|
-
confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
6
|
+
confirmUserCreation(provider: Provider, externalUserId: string, request: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
7
7
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
8
8
|
getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>>;
|
|
9
9
|
getPocketBalance(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>>;
|
|
@@ -99,7 +99,7 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
|
|
|
99
99
|
return await this.httpRequest.get(`${url}${param ?? ""}`);
|
|
100
100
|
}
|
|
101
101
|
async getAccountsByUserId(externalUserId) {
|
|
102
|
-
const url = `${this.baseUrl}/
|
|
102
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}/accounts`;
|
|
103
103
|
return await this.httpRequest.get(url);
|
|
104
104
|
}
|
|
105
105
|
async generateCardsInBatch(request) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.60",
|
|
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",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {IAccountFiadoIncApi} from "./interfaces/IAccountFiadoIncApi";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
AccountCreateRequest,
|
|
4
|
+
AccountCreateResponse,
|
|
5
|
+
AccountUpdateBalanceRequest,
|
|
6
|
+
AccountUpdateRequest,
|
|
7
|
+
ExecuteP2pOperationRequest,
|
|
8
|
+
ExecutePocketOperationRequest,
|
|
9
|
+
GetAccountResponse,
|
|
10
|
+
GetPocketBalanceResponse
|
|
11
11
|
} from "@fiado/type-kit/bin/account";
|
|
12
12
|
import {inject, injectable} from "inversify";
|
|
13
13
|
import {IHttpRequest} from "@fiado/http-client";
|
|
@@ -17,58 +17,58 @@ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiRespo
|
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
20
|
-
|
|
20
|
+
private readonly baseUrl = process.env.ACCOUNT_FIADOINC_LAMBDA_URL || "";
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
constructor(@inject("IHttpRequest") private readonly httpRequest: IHttpRequest) {
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
async confirmUserCreation(provider: Provider, externalUserId: string, request: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>> {
|
|
26
|
+
const url = `${this.baseUrl}${provider}/users/${externalUserId}/confirm`;
|
|
27
|
+
return await this.httpRequest.put(url, request);
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
async createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>> {
|
|
31
|
+
const url = `${this.baseUrl}${provider}`;
|
|
32
|
+
return await this.httpRequest.post(url, data);
|
|
33
|
+
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
async getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>> {
|
|
36
|
+
const url = `${this.baseUrl}${provider}/users/${directoryId}/`;
|
|
37
|
+
return await this.httpRequest.get(url);
|
|
38
|
+
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
async getPocketBalance(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>> {
|
|
41
|
+
const url = `${this.baseUrl}${provider}/pockets/users/${directoryId}/balance`;
|
|
42
|
+
return await this.httpRequest.get(url);
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
async updatePocketBalance(provider: Provider, pocketId: string, request: AccountUpdateBalanceRequest): Promise<FiadoApiResponse<null>> {
|
|
46
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/balance`;
|
|
47
|
+
return await this.httpRequest.put(url, request);
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
async getPocketBalanceById(provider: Provider, pocketId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>> {
|
|
51
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/balance/${provider}`;
|
|
52
|
+
return await this.httpRequest.get(url);
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
async executePocketTransaction(provider: Provider, pocketId: string, operation: OperationEnum, request: ExecutePocketOperationRequest): Promise<FiadoApiResponse<any>> {
|
|
56
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/${operation}`;
|
|
57
|
+
return await this.httpRequest.post(url, request);
|
|
58
|
+
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
async executeP2pTransaction(provider: Provider, request: ExecuteP2pOperationRequest): Promise<FiadoApiResponse<any>> {
|
|
61
|
+
const url = `${this.baseUrl}${provider}/p2p/send`;
|
|
62
|
+
return await this.httpRequest.post(url, request);
|
|
63
|
+
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
async deletePocket(provider: Provider, pocketId: string): Promise<FiadoApiResponse<void>> {
|
|
66
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}`;
|
|
67
|
+
return await this.httpRequest.delete(url);
|
|
68
|
+
}
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
async update(provider: Provider, directoryId: string, data: AccountUpdateRequest): Promise<FiadoApiResponse<void>> {
|
|
71
|
+
const url = `${this.baseUrl}${provider}/users/${directoryId}`;
|
|
72
|
+
return await this.httpRequest.put(url, data);
|
|
73
|
+
}
|
|
74
74
|
}
|
|
@@ -15,7 +15,7 @@ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiRespo
|
|
|
15
15
|
|
|
16
16
|
export interface IAccountFiadoIncApi {
|
|
17
17
|
|
|
18
|
-
confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
18
|
+
confirmUserCreation(provider: Provider, externalUserId: string, request: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
19
19
|
|
|
20
20
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
21
21
|
|
|
@@ -140,7 +140,7 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
async getAccountsByUserId(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountResponse[]>> {
|
|
143
|
-
const url = `${this.baseUrl}/
|
|
143
|
+
const url = `${this.baseUrl}/cardholders/${externalUserId}/accounts`;
|
|
144
144
|
return await this.httpRequest.get(url);
|
|
145
145
|
}
|
|
146
146
|
|