@fiado/api-invoker 1.3.9 → 1.3.11
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/card/CardApi.d.ts +3 -3
- package/bin/card/CardApi.js +8 -4
- package/bin/card/interfaces/ICardApi.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/card/CardApi.ts +11 -5
- package/src/card/interfaces/ICardApi.ts +2 -0
package/bin/card/CardApi.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest } from "@fiado/type-kit/bin/card";
|
|
4
|
-
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
4
|
import { ICardApi } from "./interfaces/ICardApi";
|
|
6
5
|
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
7
6
|
export declare class CardApi implements ICardApi {
|
|
8
7
|
private httpRequest;
|
|
9
8
|
private readonly baseUrl;
|
|
10
9
|
constructor(httpRequest: IHttpRequest);
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
getByDirectoryId(provider: Provider, directoryId: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
11
|
+
getById(provider: Provider, id: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
12
|
+
getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
13
13
|
evaluateAccountLevelUpdate(directoryId: string): Promise<void>;
|
|
14
14
|
findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
|
|
15
15
|
updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
|
package/bin/card/CardApi.js
CHANGED
|
@@ -19,12 +19,16 @@ let CardApi = class CardApi {
|
|
|
19
19
|
this.httpRequest = httpRequest;
|
|
20
20
|
this.baseUrl = process.env.CARD_LAMBDA_URL || "";
|
|
21
21
|
}
|
|
22
|
-
async
|
|
23
|
-
const url = `${this.baseUrl}
|
|
22
|
+
async getByDirectoryId(provider, directoryId) {
|
|
23
|
+
const url = `${this.baseUrl}${provider}/${directoryId}/find`;
|
|
24
24
|
return await this.httpRequest.get(url);
|
|
25
25
|
}
|
|
26
|
-
async
|
|
27
|
-
const url = `${this.baseUrl}/${
|
|
26
|
+
async getById(provider, id) {
|
|
27
|
+
const url = `${this.baseUrl}/${provider}?cardId=${id}`;
|
|
28
|
+
return await this.httpRequest.get(url);
|
|
29
|
+
}
|
|
30
|
+
async getByExternalId(provider, externalId) {
|
|
31
|
+
const url = `${this.baseUrl}/${provider}?externalCardId=${externalId}`;
|
|
28
32
|
return await this.httpRequest.get(url);
|
|
29
33
|
}
|
|
30
34
|
async evaluateAccountLevelUpdate(directoryId) {
|
|
@@ -3,6 +3,7 @@ import { CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceR
|
|
|
3
3
|
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
4
4
|
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
5
5
|
export interface ICardApi {
|
|
6
|
+
getByDirectoryId(provider: Provider, directoryId: string): Promise<ApiGatewayResponse<CardResponse>>;
|
|
6
7
|
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
7
8
|
getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
8
9
|
findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
|
|
@@ -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.3.
|
|
3
|
+
"version": "1.3.11",
|
|
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",
|
package/src/card/CardApi.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { CardIssuanceObservationUpdateRequest, CardResponse, CardUpdateIssuanceRequest } from "@fiado/type-kit/bin/card";
|
|
4
|
-
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
4
|
import { inject, injectable } from "inversify";
|
|
6
5
|
import { ICardApi } from "./interfaces/ICardApi";
|
|
7
6
|
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
@@ -14,15 +13,22 @@ export class CardApi implements ICardApi {
|
|
|
14
13
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
async
|
|
16
|
+
async getByDirectoryId(provider: Provider, directoryId: string): Promise<ApiGatewayResponse<CardResponse>> {
|
|
18
17
|
|
|
19
|
-
const url = `${this.baseUrl}
|
|
18
|
+
const url = `${this.baseUrl}${provider}/${directoryId}/find`;
|
|
19
|
+
return await this.httpRequest.get(url);
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async getById(provider: Provider, id: string): Promise<ApiGatewayResponse<CardResponse>> {
|
|
24
|
+
|
|
25
|
+
const url = `${this.baseUrl}/${provider}?cardId=${id}`;
|
|
20
26
|
return await this.httpRequest.get(url);
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
async getByExternalId(
|
|
29
|
+
async getByExternalId(provider: Provider, externalId: string): Promise<ApiGatewayResponse<CardResponse>> {
|
|
24
30
|
|
|
25
|
-
const url = `${this.baseUrl}/${
|
|
31
|
+
const url = `${this.baseUrl}/${provider}?externalCardId=${externalId}`;
|
|
26
32
|
return await this.httpRequest.get(url);
|
|
27
33
|
}
|
|
28
34
|
|
|
@@ -5,6 +5,8 @@ import { Provider } from "@fiado/type-kit/bin/provider";
|
|
|
5
5
|
|
|
6
6
|
export interface ICardApi {
|
|
7
7
|
|
|
8
|
+
getByDirectoryId(provider: Provider, directoryId: string): Promise<ApiGatewayResponse<CardResponse>>
|
|
9
|
+
|
|
8
10
|
getById(id: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
9
11
|
|
|
10
12
|
getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|