@fiado/api-invoker 1.2.51 → 1.2.53
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 -0
- package/bin/account-fiadoinc/AccountFiadoIncApi.js +4 -0
- package/bin/account-fiadoinc/interfaces/IAccountFiadoIncApi.d.ts +1 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +2 -0
- package/package.json +1 -1
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +5 -0
- package/src/account-fiadoinc/interfaces/IAccountFiadoIncApi.ts +3 -0
- package/src/centralPayments/CentralPaymentsConnectorApi.ts +5 -5
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +0 -1
|
@@ -8,6 +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
12
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
12
13
|
getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>>;
|
|
13
14
|
getPocketBalance(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>>;
|
|
@@ -18,6 +18,10 @@ 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) {
|
|
22
|
+
const url = `${this.baseUrl}${provider}/users/${externalUserId}/confirm`;
|
|
23
|
+
return await this.httpRequest.put(url);
|
|
24
|
+
}
|
|
21
25
|
async createAccount(provider, data) {
|
|
22
26
|
const url = `${this.baseUrl}${provider}`;
|
|
23
27
|
return await this.httpRequest.post(url, data);
|
|
@@ -3,6 +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
7
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
7
8
|
getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>>;
|
|
8
9
|
getPocketBalance(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.53",
|
|
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",
|
|
@@ -22,6 +22,11 @@ export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
|
22
22
|
constructor(@inject("IHttpRequest") private readonly httpRequest: IHttpRequest) {
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
async confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<AccountCreateResponse>> {
|
|
26
|
+
const url = `${this.baseUrl}${provider}/users/${externalUserId}/confirm`;
|
|
27
|
+
return await this.httpRequest.put(url);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
async createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>> {
|
|
26
31
|
const url = `${this.baseUrl}${provider}`;
|
|
27
32
|
return await this.httpRequest.post(url, data);
|
|
@@ -14,6 +14,9 @@ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiRespo
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
export interface IAccountFiadoIncApi {
|
|
17
|
+
|
|
18
|
+
confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
19
|
+
|
|
17
20
|
createAccount(provider: Provider, data: AccountCreateRequest): Promise<FiadoApiResponse<AccountCreateResponse>>;
|
|
18
21
|
|
|
19
22
|
getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {ICentralPaymentsConnectorApi} from "./interfaces/ICentralPaymentsConnectorApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
1
|
+
import { ICentralPaymentsConnectorApi } from "./interfaces/ICentralPaymentsConnectorApi";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
4
|
import {
|
|
5
5
|
CreateBankAccountUserRequest,
|
|
6
6
|
CreateBankAccountUserResponse,
|
|
@@ -25,14 +25,13 @@ import {
|
|
|
25
25
|
UpdateBankAccountCardRequest,
|
|
26
26
|
UpdateBankAccountCardResponse
|
|
27
27
|
} from "@fiado/type-kit/bin/card";
|
|
28
|
-
import {Status} from "@fiado/type-kit/bin/directory/enums/Status";
|
|
29
28
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
30
29
|
import {
|
|
31
30
|
CentralPaymentsQueryParams,
|
|
32
31
|
CentralPaymentsTransactionItem,
|
|
33
32
|
TransactionListResponse
|
|
34
33
|
} from "@fiado/type-kit/bin/transaction";
|
|
35
|
-
import {InvokerUtils} from "../utils/InvokerUtils";
|
|
34
|
+
import { InvokerUtils } from "../utils/InvokerUtils";
|
|
36
35
|
|
|
37
36
|
@injectable()
|
|
38
37
|
export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
@@ -51,6 +50,7 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
/* CARDHOLDERS */
|
|
53
|
+
|
|
54
54
|
async createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>> {
|
|
55
55
|
const url = `${this.baseUrl}/cardholders`;
|
|
56
56
|
return await this.httpRequest.post(url, request);
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
UpdateBankAccountCardRequest,
|
|
23
23
|
UpdateBankAccountCardResponse
|
|
24
24
|
} from "@fiado/type-kit/bin/card";
|
|
25
|
-
import {Status} from "@fiado/type-kit/bin/directory/enums/Status";
|
|
26
25
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
27
26
|
import {
|
|
28
27
|
CentralPaymentsQueryParams,
|