@fiado/api-invoker 1.0.23 → 1.0.25
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { CreateBankAccountUserRequest, CreateBankAccountUserResponse } from "@fiado/type-kit/bin/account";
|
|
3
|
+
import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse } from "@fiado/type-kit/bin/account";
|
|
4
4
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
5
5
|
export default class PomeloApi implements IPomeloApi {
|
|
6
6
|
private httpRequest;
|
|
7
7
|
private readonly baseUrl;
|
|
8
8
|
constructor(httpRequest: IHttpRequest);
|
|
9
9
|
createUser(request: CreateBankAccountUserRequest): Promise<ApiGatewayResponse<CreateBankAccountUserResponse>>;
|
|
10
|
+
getUserById(externalUserId: string): Promise<ApiGatewayResponse<GetBankAccountUserResponse>>;
|
|
11
|
+
updateUser(object: UpdateBankAccountUserRequest): Promise<ApiGatewayResponse<UpdateBankAccountUserResponse>>;
|
|
10
12
|
}
|
|
@@ -18,10 +18,19 @@ let PomeloApi = class PomeloApi {
|
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
19
|
this.baseUrl = process.env.POMELO_LAMBDA_URL || "";
|
|
20
20
|
}
|
|
21
|
+
//USER
|
|
21
22
|
async createUser(request) {
|
|
22
23
|
const url = `${this.baseUrl}users/create`;
|
|
23
24
|
return await this.httpRequest.post(url, request);
|
|
24
25
|
}
|
|
26
|
+
async getUserById(externalUserId) {
|
|
27
|
+
const url = `${this.baseUrl}users/${externalUserId}`;
|
|
28
|
+
return await this.httpRequest.get(url);
|
|
29
|
+
}
|
|
30
|
+
async updateUser(object) {
|
|
31
|
+
const url = `${this.baseUrl}/users/${object.id}`;
|
|
32
|
+
return await this.httpRequest.put(url, object);
|
|
33
|
+
}
|
|
25
34
|
};
|
|
26
35
|
PomeloApi = __decorate([
|
|
27
36
|
(0, inversify_1.injectable)(),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { CreateBankAccountUserRequest, CreateBankAccountUserResponse } from "@fiado/type-kit/bin/account";
|
|
1
|
+
import { CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse } from "@fiado/type-kit/bin/account";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
3
|
export interface IPomeloApi {
|
|
4
|
+
updateUser(object: UpdateBankAccountUserRequest): Promise<ApiGatewayResponse<UpdateBankAccountUserResponse>>;
|
|
5
|
+
getUserById(externalUserId: string): Promise<ApiGatewayResponse<GetBankAccountUserResponse>>;
|
|
4
6
|
createUser(request: CreateBankAccountUserRequest): Promise<ApiGatewayResponse<CreateBankAccountUserResponse>>;
|
|
5
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@fiado/api-invoker": "^1.0.19",
|
|
17
17
|
"@fiado/gateway-adapter": "^1.0.30",
|
|
18
18
|
"@fiado/http-client": "^1.0.1",
|
|
19
|
-
"@fiado/type-kit": "^1.0.
|
|
19
|
+
"@fiado/type-kit": "^1.0.71",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"inversify": "^6.0.2",
|
|
22
22
|
"reflect-metadata": "^0.2.1",
|
package/src/index.ts
CHANGED
|
@@ -1,20 +1,96 @@
|
|
|
1
1
|
import {IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
2
|
import {inject, injectable} from "inversify";
|
|
3
3
|
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {CreateBankAccountUserRequest, CreateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
|
|
4
|
+
import {CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
|
|
5
5
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@injectable()
|
|
9
9
|
export default class PomeloApi implements IPomeloApi {
|
|
10
|
+
|
|
11
|
+
|
|
10
12
|
private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
|
|
11
13
|
|
|
12
14
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
13
15
|
}
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
//USER
|
|
15
19
|
async createUser(request: CreateBankAccountUserRequest): Promise<ApiGatewayResponse<CreateBankAccountUserResponse>> {
|
|
16
20
|
const url: string = `${this.baseUrl}users/create`;
|
|
17
21
|
return await this.httpRequest.post(url, request);
|
|
18
22
|
}
|
|
19
23
|
|
|
24
|
+
public async getUserById(externalUserId: string): Promise<ApiGatewayResponse<GetBankAccountUserResponse>> {
|
|
25
|
+
const url: string = `${this.baseUrl}users/${externalUserId}`;
|
|
26
|
+
return await this.httpRequest.get(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async updateUser(object: UpdateBankAccountUserRequest): Promise<ApiGatewayResponse<UpdateBankAccountUserResponse>> {
|
|
30
|
+
const url: string = `${this.baseUrl}/users/${object.id}`;
|
|
31
|
+
return await this.httpRequest.put(url, object);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// //Card
|
|
35
|
+
// public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
|
|
36
|
+
// const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
37
|
+
// return await this.httpRequest.get(url);
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
// public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
|
|
41
|
+
// const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
42
|
+
// return await this.httpRequest.get(url);
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
// public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
|
|
46
|
+
// const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
47
|
+
// return await this.httpRequest.get(url);
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
// public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
|
|
51
|
+
// const url: string = `${this.baseUrl}cards/create`;
|
|
52
|
+
// return await this.httpRequest.post(url, object);
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
// public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
56
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
57
|
+
// return await this.httpRequest.put(url, object);
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
// public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
61
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
62
|
+
// return await this.httpRequest.put(url, object);
|
|
63
|
+
// }
|
|
64
|
+
|
|
65
|
+
// public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
|
|
66
|
+
// const url: string = `${this.baseUrl}cards/activate`;
|
|
67
|
+
// return await this.httpRequest.post(url, object);
|
|
68
|
+
// }
|
|
69
|
+
|
|
70
|
+
// public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
71
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
72
|
+
// return await this.httpRequest.put(url, object);
|
|
73
|
+
// }
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
// //Shipping
|
|
77
|
+
|
|
78
|
+
// public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
|
|
79
|
+
// const url: string = `${this.baseUrl}shipment/create`;
|
|
80
|
+
// return await this.httpRequest.post(url, object);
|
|
81
|
+
// }
|
|
82
|
+
|
|
83
|
+
// public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
|
|
84
|
+
// const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
|
|
85
|
+
// return await this.httpRequest.get(url);
|
|
86
|
+
// }
|
|
87
|
+
|
|
88
|
+
// public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
|
|
89
|
+
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
90
|
+
// return await this.httpRequest.put(url, object);
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
20
96
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {CreateBankAccountUserRequest, CreateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
|
|
1
|
+
import {CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserRequest, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
|
|
2
2
|
import {ApiGatewayResponse} from "@fiado/gateway-adapter";
|
|
3
3
|
|
|
4
4
|
export interface IPomeloApi {
|
|
5
|
+
|
|
6
|
+
updateUser(object: UpdateBankAccountUserRequest): Promise<ApiGatewayResponse<UpdateBankAccountUserResponse>>
|
|
7
|
+
getUserById(externalUserId: string): Promise<ApiGatewayResponse<GetBankAccountUserResponse>>
|
|
5
8
|
createUser(request: CreateBankAccountUserRequest): Promise<ApiGatewayResponse<CreateBankAccountUserResponse>>;
|
|
6
9
|
}
|