@fiado/api-invoker 1.0.37 → 1.0.39
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,6 +1,7 @@
|
|
|
1
1
|
import { IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
3
|
+
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
4
|
+
import { ActivateBankAccountCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
4
5
|
export default class PomeloApi implements IPomeloApi {
|
|
5
6
|
private httpRequest;
|
|
6
7
|
private readonly baseUrl;
|
|
@@ -8,4 +9,14 @@ export default class PomeloApi implements IPomeloApi {
|
|
|
8
9
|
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
9
10
|
getUserById(externalUserId: string): Promise<any>;
|
|
10
11
|
updateUser(object: UpdateBankAccountUserRequest): Promise<any>;
|
|
12
|
+
getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>;
|
|
13
|
+
getCardsById(externalCardId: string): Promise<any>;
|
|
14
|
+
getCardsByUserId(externalUserId: string): Promise<any>;
|
|
15
|
+
createCard(object: CreateBankAccountRequest): Promise<any>;
|
|
16
|
+
blockCard(object: UpdateBankAccountCardRequest): Promise<any>;
|
|
17
|
+
changePin(object: UpdateBankAccountCardRequest): Promise<any>;
|
|
18
|
+
activateCard(object: ActivateBankAccountCardRequest): Promise<any>;
|
|
19
|
+
updateCard(object: UpdateBankAccountCardRequest): Promise<any>;
|
|
20
|
+
createShipment(object: CreateBankAccountCardShippingRequest): Promise<any>;
|
|
21
|
+
getShipment(object: GetBankAccountShippingRequest): Promise<any>;
|
|
11
22
|
}
|
|
@@ -31,6 +31,48 @@ let PomeloApi = class PomeloApi {
|
|
|
31
31
|
const url = `${this.baseUrl}/users/${object.id}`;
|
|
32
32
|
return await this.httpRequest.put(url, object);
|
|
33
33
|
}
|
|
34
|
+
// //Card
|
|
35
|
+
async getCardSensitiveInformation(externalCardId, externalUserId) {
|
|
36
|
+
const url = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
37
|
+
return await this.httpRequest.get(url);
|
|
38
|
+
}
|
|
39
|
+
async getCardsById(externalCardId) {
|
|
40
|
+
const url = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
41
|
+
return await this.httpRequest.get(url);
|
|
42
|
+
}
|
|
43
|
+
async getCardsByUserId(externalUserId) {
|
|
44
|
+
const url = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
45
|
+
return await this.httpRequest.get(url);
|
|
46
|
+
}
|
|
47
|
+
async createCard(object) {
|
|
48
|
+
const url = `${this.baseUrl}cards/create`;
|
|
49
|
+
return await this.httpRequest.post(url, object);
|
|
50
|
+
}
|
|
51
|
+
async blockCard(object) {
|
|
52
|
+
const url = `${this.baseUrl}cards/${object.cardId}/`;
|
|
53
|
+
return await this.httpRequest.put(url, object);
|
|
54
|
+
}
|
|
55
|
+
async changePin(object) {
|
|
56
|
+
const url = `${this.baseUrl}cards/${object.cardId}/`;
|
|
57
|
+
return await this.httpRequest.put(url, object);
|
|
58
|
+
}
|
|
59
|
+
async activateCard(object) {
|
|
60
|
+
const url = `${this.baseUrl}cards/activate`;
|
|
61
|
+
return await this.httpRequest.post(url, object);
|
|
62
|
+
}
|
|
63
|
+
async updateCard(object) {
|
|
64
|
+
const url = `${this.baseUrl}cards/${object.cardId}/`;
|
|
65
|
+
return await this.httpRequest.put(url, object);
|
|
66
|
+
}
|
|
67
|
+
// //Shipping
|
|
68
|
+
async createShipment(object) {
|
|
69
|
+
const url = `${this.baseUrl}shipment/create`;
|
|
70
|
+
return await this.httpRequest.post(url, object);
|
|
71
|
+
}
|
|
72
|
+
async getShipment(object) {
|
|
73
|
+
const url = `${this.baseUrl}shipment/${object.externalShippingId}`;
|
|
74
|
+
return await this.httpRequest.get(url);
|
|
75
|
+
}
|
|
34
76
|
};
|
|
35
77
|
PomeloApi = __decorate([
|
|
36
78
|
(0, inversify_1.injectable)(),
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
1
|
+
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
2
3
|
export interface IPomeloApi {
|
|
3
4
|
updateUser(object: UpdateBankAccountUserRequest): Promise<any>;
|
|
4
5
|
getUserById(externalUserId: string): Promise<any>;
|
|
5
6
|
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
7
|
+
getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>;
|
|
8
|
+
getCardsById(externalCardId: string): Promise<any>;
|
|
9
|
+
getCardsByUserId(externalUserId: string): Promise<any>;
|
|
10
|
+
createCard(object: CreateBankAccountRequest): Promise<any>;
|
|
11
|
+
blockCard(object: UpdateBankAccountCardRequest): Promise<any>;
|
|
12
|
+
changePin(object: UpdateBankAccountCardRequest): Promise<any>;
|
|
13
|
+
activateCard(object: UpdateBankAccountCardRequest): Promise<any>;
|
|
6
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.39",
|
|
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",
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import {IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
|
-
import {inject, injectable} from "inversify";
|
|
3
|
-
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
-
import {CreateBankAccountUserRequest, UpdateBankAccountUserRequest} from "@fiado/type-kit/bin/account";
|
|
1
|
+
import { IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
|
+
import { inject, injectable } from "inversify";
|
|
3
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
+
import { CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
5
|
+
import { ActivateBankAccountCardRequest, CreateBankAccountCardShippingRequest, GetBankAccountShippingRequest, UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
@injectable()
|
|
8
9
|
export default class PomeloApi implements IPomeloApi {
|
|
9
10
|
|
|
10
|
-
|
|
11
11
|
private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
|
|
12
12
|
|
|
13
13
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
//USER
|
|
18
17
|
async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
19
18
|
const url: string = `${this.baseUrl}users/create`;
|
|
@@ -31,65 +30,65 @@ export default class PomeloApi implements IPomeloApi {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
// //Card
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
34
|
+
const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
35
|
+
return await this.httpRequest.get(url);
|
|
36
|
+
}
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
public async getCardsById(externalCardId: string): Promise<any> {
|
|
39
|
+
const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
40
|
+
return await this.httpRequest.get(url);
|
|
41
|
+
}
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
public async getCardsByUserId(externalUserId: string): Promise<any> {
|
|
44
|
+
const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
45
|
+
return await this.httpRequest.get(url);
|
|
46
|
+
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
public async createCard(object: CreateBankAccountRequest): Promise<any> {
|
|
49
|
+
const url: string = `${this.baseUrl}cards/create`;
|
|
50
|
+
return await this.httpRequest.post(url, object);
|
|
51
|
+
}
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
public async blockCard(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
54
|
+
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
55
|
+
return await this.httpRequest.put(url, object);
|
|
56
|
+
}
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
public async changePin(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
59
|
+
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
60
|
+
return await this.httpRequest.put(url, object);
|
|
61
|
+
}
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
public async activateCard(object: ActivateBankAccountCardRequest): Promise<any> {
|
|
64
|
+
const url: string = `${this.baseUrl}cards/activate`;
|
|
65
|
+
return await this.httpRequest.post(url, object);
|
|
66
|
+
}
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
public async updateCard(object: UpdateBankAccountCardRequest): Promise<any> {
|
|
69
|
+
const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
70
|
+
return await this.httpRequest.put(url, object);
|
|
71
|
+
}
|
|
73
72
|
|
|
74
73
|
|
|
75
74
|
// //Shipping
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
public async createShipment(object: CreateBankAccountCardShippingRequest): Promise<any> {
|
|
77
|
+
const url: string = `${this.baseUrl}shipment/create`;
|
|
78
|
+
return await this.httpRequest.post(url, object);
|
|
79
|
+
}
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
public async getShipment(object: GetBankAccountShippingRequest): Promise<any> {
|
|
82
|
+
const url: string = `${this.baseUrl}shipment/${object.externalShippingId}`;
|
|
83
|
+
return await this.httpRequest.get(url);
|
|
84
|
+
}
|
|
86
85
|
|
|
87
|
-
// public async replaceCardByExternalId(object:
|
|
86
|
+
// public async replaceCardByExternalId(object: ExternalReplaceCardRequest): Promise<any> {
|
|
88
87
|
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
89
88
|
// return await this.httpRequest.put(url, object);
|
|
90
89
|
// }
|
|
91
90
|
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
|
|
94
93
|
|
|
95
94
|
}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {CreateBankAccountRequest, CreateBankAccountUserRequest, UpdateBankAccountUserRequest } from "@fiado/type-kit/bin/account";
|
|
2
|
+
import { UpdateBankAccountCardRequest } from "@fiado/type-kit/bin/card";
|
|
2
3
|
|
|
3
4
|
export interface IPomeloApi {
|
|
4
5
|
|
|
5
6
|
updateUser(object: UpdateBankAccountUserRequest): Promise<any>
|
|
6
7
|
getUserById(externalUserId: string): Promise<any>
|
|
7
8
|
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// //Card
|
|
12
|
+
getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>
|
|
13
|
+
getCardsById(externalCardId: string): Promise<any>
|
|
14
|
+
getCardsByUserId(externalUserId: string): Promise<any>
|
|
15
|
+
createCard(object: CreateBankAccountRequest): Promise<any>
|
|
16
|
+
blockCard(object: UpdateBankAccountCardRequest): Promise<any>
|
|
17
|
+
changePin(object: UpdateBankAccountCardRequest): Promise<any>
|
|
18
|
+
activateCard(object: UpdateBankAccountCardRequest): Promise<any>
|
|
19
|
+
|
|
8
20
|
}
|