@fiado/api-invoker 1.2.46 → 1.2.47
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.js +8 -8
- package/bin/card/CardApi.d.ts +3 -1
- package/bin/card/CardApi.js +4 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +2 -0
- package/package.json +7 -8
- package/src/account-fiadoinc/AccountFiadoIncApi.ts +8 -8
- package/src/card/CardApi.ts +9 -1
|
@@ -23,35 +23,35 @@ let AccountFiadoIncApi = class AccountFiadoIncApi {
|
|
|
23
23
|
return await this.httpRequest.post(url, data);
|
|
24
24
|
}
|
|
25
25
|
async getAccountByDirectoryId(provider, directoryId) {
|
|
26
|
-
const url = `${this.baseUrl}users/${directoryId}/`;
|
|
26
|
+
const url = `${this.baseUrl}${provider}/users/${directoryId}/`;
|
|
27
27
|
return await this.httpRequest.get(url);
|
|
28
28
|
}
|
|
29
29
|
async getPocketBalance(provider, directoryId) {
|
|
30
|
-
const url = `${this.baseUrl}/pockets/users/${directoryId}/balance`;
|
|
30
|
+
const url = `${this.baseUrl}${provider}/pockets/users/${directoryId}/balance`;
|
|
31
31
|
return await this.httpRequest.get(url);
|
|
32
32
|
}
|
|
33
33
|
async updatePocketBalance(provider, pocketId, request) {
|
|
34
|
-
const url = `${this.baseUrl}/pockets/${pocketId}/balance`;
|
|
34
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/balance`;
|
|
35
35
|
return await this.httpRequest.put(url, request);
|
|
36
36
|
}
|
|
37
37
|
async getPocketBalanceById(provider, pocketId) {
|
|
38
|
-
const url = `${this.baseUrl}/pockets/${pocketId}/balance/${provider}`;
|
|
38
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/balance/${provider}`;
|
|
39
39
|
return await this.httpRequest.get(url);
|
|
40
40
|
}
|
|
41
41
|
async executePocketTransaction(provider, pocketId, operation, request) {
|
|
42
|
-
const url = `${this.baseUrl}/pockets/${pocketId}/${operation}`;
|
|
42
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/${operation}`;
|
|
43
43
|
return await this.httpRequest.post(url, request);
|
|
44
44
|
}
|
|
45
45
|
async executeP2pTransaction(provider, request) {
|
|
46
|
-
const url = `${this.baseUrl}/p2p/send`;
|
|
46
|
+
const url = `${this.baseUrl}${provider}/p2p/send`;
|
|
47
47
|
return await this.httpRequest.post(url, request);
|
|
48
48
|
}
|
|
49
49
|
async deletePocket(provider, pocketId) {
|
|
50
|
-
const url = `${this.baseUrl}pockets/${pocketId}`;
|
|
50
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}`;
|
|
51
51
|
return await this.httpRequest.delete(url);
|
|
52
52
|
}
|
|
53
53
|
async update(provider, directoryId, data) {
|
|
54
|
-
const url = `${this.baseUrl}users/${directoryId}`;
|
|
54
|
+
const url = `${this.baseUrl}${provider}/users/${directoryId}`;
|
|
55
55
|
return await this.httpRequest.put(url, data);
|
|
56
56
|
}
|
|
57
57
|
};
|
package/bin/card/CardApi.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
3
|
+
import { CardResponse, CardUpdateIssuanceRequest } from "@fiado/type-kit/bin/card";
|
|
4
4
|
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
5
|
import { ICardApi } from "./interfaces/ICardApi";
|
|
6
|
+
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
6
7
|
export declare class CardApi implements ICardApi {
|
|
7
8
|
private httpRequest;
|
|
8
9
|
private readonly baseUrl;
|
|
@@ -11,4 +12,5 @@ export declare class CardApi implements ICardApi {
|
|
|
11
12
|
getByExternalId(externalId: string, countryId: CountryId): Promise<ApiGatewayResponse<CardResponse>>;
|
|
12
13
|
evaluateAccountLevelUpdate(directoryId: string): Promise<void>;
|
|
13
14
|
findCardIssuanceByIds(directoryIds: string[]): Promise<ApiGatewayResponse<any>>;
|
|
15
|
+
updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>>;
|
|
14
16
|
}
|
package/bin/card/CardApi.js
CHANGED
|
@@ -36,6 +36,10 @@ let CardApi = class CardApi {
|
|
|
36
36
|
const url = `${this.baseUrl}?${queryparams}`;
|
|
37
37
|
return await this.httpRequest.get(url);
|
|
38
38
|
}
|
|
39
|
+
async updateIssuance(provider, input) {
|
|
40
|
+
const url = `${this.baseUrl}${provider}/issuance`;
|
|
41
|
+
return await this.httpRequest.put(url, input);
|
|
42
|
+
}
|
|
39
43
|
};
|
|
40
44
|
exports.CardApi = CardApi;
|
|
41
45
|
exports.CardApi = CardApi = __decorate([
|
|
@@ -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.47",
|
|
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",
|
|
@@ -12,17 +12,16 @@
|
|
|
12
12
|
"author": "Fiado Inc",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@aws-sdk/client-sqs": "^3.
|
|
15
|
+
"@aws-sdk/client-sqs": "^3.758.0",
|
|
16
16
|
"@fiado/gateway-adapter": "^1.1.40",
|
|
17
17
|
"@fiado/http-client": "^1.0.4",
|
|
18
18
|
"@fiado/logger": "^1.0.3",
|
|
19
|
-
"@fiado/type-kit": "^1.8.
|
|
20
|
-
"dotenv": "^16.4.
|
|
21
|
-
"inversify": "^6.
|
|
22
|
-
"reflect-metadata": "^0.2.
|
|
23
|
-
"typescript": "^5.4.3"
|
|
19
|
+
"@fiado/type-kit": "^1.8.20",
|
|
20
|
+
"dotenv": "^16.4.7",
|
|
21
|
+
"inversify": "^6.2.2",
|
|
22
|
+
"reflect-metadata": "^0.2.2"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@types/node": "^20.
|
|
25
|
+
"@types/node": "^20.17.24"
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -28,42 +28,42 @@ export default class AccountFiadoIncApi implements IAccountFiadoIncApi {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async getAccountByDirectoryId(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetAccountResponse[]>> {
|
|
31
|
-
const url = `${this.baseUrl}users/${directoryId}/`;
|
|
31
|
+
const url = `${this.baseUrl}${provider}/users/${directoryId}/`;
|
|
32
32
|
return await this.httpRequest.get(url);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
async getPocketBalance(provider: Provider, directoryId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>> {
|
|
36
|
-
const url = `${this.baseUrl}/pockets/users/${directoryId}/balance`;
|
|
36
|
+
const url = `${this.baseUrl}${provider}/pockets/users/${directoryId}/balance`;
|
|
37
37
|
return await this.httpRequest.get(url);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
async updatePocketBalance(provider: Provider, pocketId: string, request: AccountUpdateBalanceRequest): Promise<FiadoApiResponse<null>> {
|
|
41
|
-
const url = `${this.baseUrl}/pockets/${pocketId}/balance`;
|
|
41
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/balance`;
|
|
42
42
|
return await this.httpRequest.put(url, request);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
async getPocketBalanceById(provider: Provider, pocketId: string): Promise<FiadoApiResponse<GetPocketBalanceResponse>> {
|
|
46
|
-
const url = `${this.baseUrl}/pockets/${pocketId}/balance/${provider}`;
|
|
46
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/balance/${provider}`;
|
|
47
47
|
return await this.httpRequest.get(url);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
async executePocketTransaction(provider: Provider, pocketId: string, operation: OperationEnum, request: ExecutePocketOperationRequest): Promise<FiadoApiResponse<any>> {
|
|
51
|
-
const url = `${this.baseUrl}/pockets/${pocketId}/${operation}`;
|
|
51
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}/${operation}`;
|
|
52
52
|
return await this.httpRequest.post(url, request);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
async executeP2pTransaction(provider: Provider, request: ExecuteP2pOperationRequest): Promise<FiadoApiResponse<any>> {
|
|
56
|
-
const url = `${this.baseUrl}/p2p/send`;
|
|
56
|
+
const url = `${this.baseUrl}${provider}/p2p/send`;
|
|
57
57
|
return await this.httpRequest.post(url, request);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
async deletePocket(provider: Provider, pocketId: string): Promise<FiadoApiResponse<void>> {
|
|
61
|
-
const url = `${this.baseUrl}pockets/${pocketId}`;
|
|
61
|
+
const url = `${this.baseUrl}${provider}/pockets/${pocketId}`;
|
|
62
62
|
return await this.httpRequest.delete(url);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async update(provider: Provider, directoryId: string, data: AccountUpdateRequest): Promise<FiadoApiResponse<void>> {
|
|
66
|
-
const url = `${this.baseUrl}users/${directoryId}`;
|
|
66
|
+
const url = `${this.baseUrl}${provider}/users/${directoryId}`;
|
|
67
67
|
return await this.httpRequest.put(url, data);
|
|
68
68
|
}
|
|
69
69
|
}
|
package/src/card/CardApi.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { CardResponse } from "@fiado/type-kit/bin/card";
|
|
3
|
+
import { CardResponse, CardUpdateIssuanceRequest } from "@fiado/type-kit/bin/card";
|
|
4
4
|
import { CountryId } from "@fiado/type-kit/bin/country";
|
|
5
5
|
import { inject, injectable } from "inversify";
|
|
6
6
|
import { ICardApi } from "./interfaces/ICardApi";
|
|
7
|
+
import { Provider } from "@fiado/type-kit/bin/provider";
|
|
7
8
|
|
|
8
9
|
@injectable()
|
|
9
10
|
export class CardApi implements ICardApi {
|
|
@@ -39,7 +40,14 @@ export class CardApi implements ICardApi {
|
|
|
39
40
|
|
|
40
41
|
return await this.httpRequest.get(url);
|
|
41
42
|
}
|
|
43
|
+
|
|
44
|
+
async updateIssuance(provider: Provider, input: CardUpdateIssuanceRequest): Promise<ApiGatewayResponse<void>> {
|
|
45
|
+
|
|
46
|
+
const url = `${this.baseUrl}${provider}/issuance`;
|
|
47
|
+
return await this.httpRequest.put(url, input);
|
|
48
|
+
}
|
|
42
49
|
}
|
|
43
50
|
|
|
44
51
|
|
|
45
52
|
|
|
53
|
+
|