@fiado/api-invoker 1.2.51 → 1.2.52
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/centralPayments/CentralPaymentsConnectorApi.d.ts +2 -0
- package/bin/centralPayments/CentralPaymentsConnectorApi.js +4 -0
- package/bin/centralPayments/interfaces/ICentralPaymentsConnectorApi.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/centralPayments/CentralPaymentsConnectorApi.ts +11 -5
- package/src/centralPayments/interfaces/ICentralPaymentsConnectorApi.ts +2 -1
|
@@ -6,12 +6,14 @@ import { ActivateBankAccountCardRequest, ActivateBankAccountCardResponse, CardBa
|
|
|
6
6
|
import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
|
|
7
7
|
import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
|
|
8
8
|
import { InvokerUtils } from "../utils/InvokerUtils";
|
|
9
|
+
import { Provider } from "@fiado/type-kit/bin/provider/enums/Provider";
|
|
9
10
|
export declare class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
10
11
|
private readonly httpRequest;
|
|
11
12
|
private readonly _invokerUtils;
|
|
12
13
|
private readonly baseUrl;
|
|
13
14
|
constructor(httpRequest: IHttpRequest, _invokerUtils: InvokerUtils);
|
|
14
15
|
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
16
|
+
confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
15
17
|
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
16
18
|
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
17
19
|
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
@@ -27,6 +27,10 @@ let CentralPaymentsConnectorApi = class CentralPaymentsConnectorApi {
|
|
|
27
27
|
return await this.httpRequest.get(url);
|
|
28
28
|
}
|
|
29
29
|
/* CARDHOLDERS */
|
|
30
|
+
async confirmUserCreation(provider, externalUserId) {
|
|
31
|
+
const url = `${this.baseUrl}${provider}/users/${externalUserId}/confirm`;
|
|
32
|
+
return await this.httpRequest.put(url);
|
|
33
|
+
}
|
|
30
34
|
async createCardholder(request) {
|
|
31
35
|
const url = `${this.baseUrl}/cardholders`;
|
|
32
36
|
return await this.httpRequest.post(url, request);
|
|
@@ -5,6 +5,7 @@ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiRespo
|
|
|
5
5
|
import { CentralPaymentsQueryParams, CentralPaymentsTransactionItem, TransactionListResponse } from "@fiado/type-kit/bin/transaction";
|
|
6
6
|
export interface ICentralPaymentsConnectorApi {
|
|
7
7
|
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
8
|
+
confirmUserCreation(provider: string, externalUserId: string): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
8
9
|
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
9
10
|
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
10
11
|
updateCardholder(externalUserId: string, request: UpdateBankAccountUserRequest): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|
|
@@ -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.52",
|
|
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,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,14 @@ 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";
|
|
35
|
+
import { Provider } from "@fiado/type-kit/bin/provider/enums/Provider";
|
|
36
36
|
|
|
37
37
|
@injectable()
|
|
38
38
|
export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi {
|
|
@@ -51,6 +51,12 @@ export class CentralPaymentsConnectorApi implements ICentralPaymentsConnectorApi
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/* CARDHOLDERS */
|
|
54
|
+
|
|
55
|
+
async confirmUserCreation(provider: Provider, externalUserId: string): Promise<FiadoApiResponse<CreateBankAccountUserResponse>> {
|
|
56
|
+
const url = `${this.baseUrl}${provider}/users/${externalUserId}/confirm`;
|
|
57
|
+
return await this.httpRequest.put(url);
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
async createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>> {
|
|
55
61
|
const url = `${this.baseUrl}/cardholders`;
|
|
56
62
|
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,
|
|
@@ -33,6 +32,8 @@ import {
|
|
|
33
32
|
export interface ICentralPaymentsConnectorApi {
|
|
34
33
|
healthcheck(): Promise<FiadoApiResponse<HealthcheckResponse>>;
|
|
35
34
|
|
|
35
|
+
confirmUserCreation(provider: string, externalUserId: string): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
36
|
+
|
|
36
37
|
createCardholder(request: CreateBankAccountUserRequest): Promise<FiadoApiResponse<CreateBankAccountUserResponse>>;
|
|
37
38
|
|
|
38
39
|
getCardholder(externalUserId: string): Promise<FiadoApiResponse<GetBankAccountUserResponse>>;
|