@fiado/api-invoker 1.0.39 → 1.0.41
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/container.config.js +2 -0
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/bin/stpAccount/api/STPAccountApi.d.ts +9 -0
- package/bin/stpAccount/api/STPAccountApi.js +33 -0
- package/bin/stpAccount/api/interfaces/ISTPAccountApi.d.ts +4 -0
- package/bin/stpAccount/api/interfaces/ISTPAccountApi.js +2 -0
- package/bin/stpAccount/index.d.ts +2 -0
- package/bin/stpAccount/index.js +18 -0
- package/bin/tern/api/TernApi.d.ts +1 -0
- package/bin/tern/api/TernApi.js +4 -0
- package/package.json +2 -2
- package/src/container.config.ts +3 -0
- package/src/index.ts +1 -0
- package/src/stpAccount/api/STPAccountApi.ts +102 -0
- package/src/stpAccount/api/interfaces/ISTPAccountApi.ts +7 -0
- package/src/stpAccount/index.ts +2 -0
- package/src/tern/api/TernApi.ts +7 -0
package/bin/container.config.js
CHANGED
|
@@ -14,12 +14,14 @@ const address_1 = require("./address");
|
|
|
14
14
|
const AccountFiadoIncApi_1 = __importDefault(require("./account-fiadoinc/AccountFiadoIncApi"));
|
|
15
15
|
const AccountPagoConfiadoApi_1 = __importDefault(require("./account-pagoconfiado/AccountPagoConfiadoApi"));
|
|
16
16
|
const AccountFiadoSAApi_1 = __importDefault(require("./account-fiadosa/AccountFiadoSAApi"));
|
|
17
|
+
const STPAccountApi_1 = __importDefault(require("./stpAccount/api/STPAccountApi"));
|
|
17
18
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
18
19
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
19
20
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
20
21
|
bind("IAddressApi").to(address_1.AddressApi);
|
|
21
22
|
bind("ITernApi").to(TernApi_1.default);
|
|
22
23
|
bind("IPomeloApi").to(PomeloApi_1.default);
|
|
24
|
+
bind("ISTPAccountApi").to(STPAccountApi_1.default);
|
|
23
25
|
bind("IAccountFiadoIncApi").to(AccountFiadoIncApi_1.default);
|
|
24
26
|
bind("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi_1.default);
|
|
25
27
|
bind("IAccountFiadoSAApi").to(AccountFiadoSAApi_1.default);
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -21,6 +21,7 @@ __exportStar(require("./sessionActivity"), exports);
|
|
|
21
21
|
__exportStar(require("./tern"), exports);
|
|
22
22
|
__exportStar(require("./pomelo"), exports);
|
|
23
23
|
__exportStar(require("./address"), exports);
|
|
24
|
+
__exportStar(require("./stpAccount"), exports);
|
|
24
25
|
__exportStar(require("./container.config"), exports);
|
|
25
26
|
__exportStar(require("./account-fiadoinc"), exports);
|
|
26
27
|
__exportStar(require("./account-fiadosa"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISTPAccountApi } from "./interfaces/ISTPAccountApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CreateBankAccountRequest } from "@fiado/type-kit/bin/account";
|
|
4
|
+
export default class PomeloApi implements ISTPAccountApi {
|
|
5
|
+
private httpRequest;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
createAccount(request: CreateBankAccountRequest): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let PomeloApi = class PomeloApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
//ACCOUNT
|
|
22
|
+
// //USER
|
|
23
|
+
async createAccount(request) {
|
|
24
|
+
const url = `${this.baseUrl}account/create`;
|
|
25
|
+
return await this.httpRequest.post(url, request);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
PomeloApi = __decorate([
|
|
29
|
+
(0, inversify_1.injectable)(),
|
|
30
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
31
|
+
__metadata("design:paramtypes", [Object])
|
|
32
|
+
], PomeloApi);
|
|
33
|
+
exports.default = PomeloApi;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api/STPAccountApi"), exports);
|
|
18
|
+
__exportStar(require("./api/interfaces/ISTPAccountApi"), exports);
|
|
@@ -10,6 +10,7 @@ export default class TernApi implements ITernApi {
|
|
|
10
10
|
createUser(request: CreateBankAccountUserRequest): Promise<any>;
|
|
11
11
|
getAccount(request: GetBankAccountRequest): Promise<any>;
|
|
12
12
|
createAccount(request: CreateBankAccountRequest): Promise<any>;
|
|
13
|
+
getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any>;
|
|
13
14
|
getCardsById(externalCardId: string): Promise<any>;
|
|
14
15
|
createCard(request: CreateBankAccountCardRequest): Promise<any>;
|
|
15
16
|
blockCard(request: UpdateBankAccountCardRequest): Promise<any>;
|
package/bin/tern/api/TernApi.js
CHANGED
|
@@ -37,6 +37,10 @@ let TernApi = class TernApi {
|
|
|
37
37
|
return await this.httpRequest.post(url, request);
|
|
38
38
|
}
|
|
39
39
|
/// CARDS
|
|
40
|
+
async getCardSensitiveInformation(externalCardId, externalUserId) {
|
|
41
|
+
const url = `${this.baseUrl}cards/${externalCardId}/sensitive`;
|
|
42
|
+
return await this.httpRequest.get(url);
|
|
43
|
+
}
|
|
40
44
|
async getCardsById(externalCardId) {
|
|
41
45
|
const url = `${this.baseUrl}cards/${externalCardId}/`;
|
|
42
46
|
return await this.httpRequest.get(url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.41",
|
|
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.79",
|
|
20
20
|
"dotenv": "^16.4.5",
|
|
21
21
|
"inversify": "^6.0.2",
|
|
22
22
|
"reflect-metadata": "^0.2.1",
|
package/src/container.config.ts
CHANGED
|
@@ -14,6 +14,8 @@ import {IAccountPagoConfiadoApi} from "./account-pagoconfiado";
|
|
|
14
14
|
import AccountPagoConfiadoApi from "./account-pagoconfiado/AccountPagoConfiadoApi";
|
|
15
15
|
import {IAccountFiadoSAApi} from "./account-fiadosa";
|
|
16
16
|
import AccountFiadoSAApi from "./account-fiadosa/AccountFiadoSAApi";
|
|
17
|
+
import { ISTPAccountApi } from "./stpAccount";
|
|
18
|
+
import STPAccountApi from "./stpAccount/api/STPAccountApi";
|
|
17
19
|
|
|
18
20
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
19
21
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
@@ -21,6 +23,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
21
23
|
bind<IAddressApi>("IAddressApi").to(AddressApi);
|
|
22
24
|
bind<ITernApi>("ITernApi").to(TernApi);
|
|
23
25
|
bind<IPomeloApi>("IPomeloApi").to(PomeloApi);
|
|
26
|
+
bind<ISTPAccountApi>("ISTPAccountApi").to(STPAccountApi);
|
|
24
27
|
bind<IAccountFiadoIncApi>("IAccountFiadoIncApi").to(AccountFiadoIncApi);
|
|
25
28
|
bind<IAccountPagoConfiadoApi>("IAccountPagoConfiadoApi").to(AccountPagoConfiadoApi);
|
|
26
29
|
bind<IAccountFiadoSAApi>("IAccountFiadoSAApi").to(AccountFiadoSAApi);
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {ISTPAccountApi } from "./interfaces/ISTPAccountApi";
|
|
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
|
+
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class PomeloApi implements ISTPAccountApi {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
private readonly baseUrl = process.env.STP_ACCOUNT_LAMBDA_URL || "";
|
|
12
|
+
|
|
13
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//ACCOUNT
|
|
17
|
+
// //USER
|
|
18
|
+
async createAccount(request: CreateBankAccountRequest): Promise<any> {
|
|
19
|
+
const url: string = `${this.baseUrl}account/create`;
|
|
20
|
+
return await this.httpRequest.post(url, request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
// //USER
|
|
25
|
+
// async createUser(request: CreateBankAccountUserRequest): Promise<any> {
|
|
26
|
+
// const url: string = `${this.baseUrl}users/create`;
|
|
27
|
+
// return await this.httpRequest.post(url, request);
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
// public async getUserById(externalUserId: string): Promise<any> {
|
|
31
|
+
// const url: string = `${this.baseUrl}users/${externalUserId}`;
|
|
32
|
+
// return await this.httpRequest.get(url);
|
|
33
|
+
// }
|
|
34
|
+
|
|
35
|
+
// public async updateUser(object: UpdateBankAccountUserRequest): Promise<any> {
|
|
36
|
+
// const url: string = `${this.baseUrl}/users/${object.id}`;
|
|
37
|
+
// return await this.httpRequest.put(url, object);
|
|
38
|
+
// }
|
|
39
|
+
|
|
40
|
+
// //Card
|
|
41
|
+
// public async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<GetBankAccountSensitiveInformationOutput> {
|
|
42
|
+
// const url: string = `${this.baseUrl}cards/${externalCardId}/sensitive?externalUserId=${externalUserId}`;
|
|
43
|
+
// return await this.httpRequest.get(url);
|
|
44
|
+
// }
|
|
45
|
+
|
|
46
|
+
// public async getCardsById(externalCardId: string): Promise<GetBankAccountCardOutput> {
|
|
47
|
+
// const url: string = `${this.baseUrl}cards?externalCardId=${externalCardId}`;
|
|
48
|
+
// return await this.httpRequest.get(url);
|
|
49
|
+
// }
|
|
50
|
+
|
|
51
|
+
// public async getCardsByUserId(externalUserId: string): Promise<GetBankAccountCardOutput> {
|
|
52
|
+
// const url: string = `${this.baseUrl}cards?externalUserId=${externalUserId}`;
|
|
53
|
+
// return await this.httpRequest.get(url);
|
|
54
|
+
// }
|
|
55
|
+
|
|
56
|
+
// public async createCard(object: CreateBankAccountCardInput): Promise<CreateBankAccountCardOutput> {
|
|
57
|
+
// const url: string = `${this.baseUrl}cards/create`;
|
|
58
|
+
// return await this.httpRequest.post(url, object);
|
|
59
|
+
// }
|
|
60
|
+
|
|
61
|
+
// public async blockCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
62
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
63
|
+
// return await this.httpRequest.put(url, object);
|
|
64
|
+
// }
|
|
65
|
+
|
|
66
|
+
// public async changePin(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
67
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
68
|
+
// return await this.httpRequest.put(url, object);
|
|
69
|
+
// }
|
|
70
|
+
|
|
71
|
+
// public async activateCard(object: ActivateBankAccountCardInput): Promise<ActivateBankAccountCardOutput> {
|
|
72
|
+
// const url: string = `${this.baseUrl}cards/activate`;
|
|
73
|
+
// return await this.httpRequest.post(url, object);
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
// public async updateCard(object: UpdateBankAccountCardInput): Promise<UpdateBankAccountCardOutput> {
|
|
77
|
+
// const url: string = `${this.baseUrl}cards/${object.cardId}/`;
|
|
78
|
+
// return await this.httpRequest.put(url, object);
|
|
79
|
+
// }
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
// //Shipping
|
|
83
|
+
|
|
84
|
+
// public async createShipment(object: CreateBankAccountCardShippingInput): Promise<any> {
|
|
85
|
+
// const url: string = `${this.baseUrl}shipment/create`;
|
|
86
|
+
// return await this.httpRequest.post(url, object);
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
// public async getShipment(object: GetBankAccountShippingInput): Promise<GetBankAccountShippingOutput> {
|
|
90
|
+
// const url: string = `${this.baseUrl}shipment/${object.shippingId}`;
|
|
91
|
+
// return await this.httpRequest.get(url);
|
|
92
|
+
// }
|
|
93
|
+
|
|
94
|
+
// public async replaceCardByExternalId(object: ExternalReplaceCardInput): Promise<ExternalReplaceCardOutput> {
|
|
95
|
+
// const url: string = `${this.baseUrl}cards/${object.externalCardId}/replace`;
|
|
96
|
+
// return await this.httpRequest.put(url, object);
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {CreateBankAccountRequest, CreateBankAccountUserRequest, CreateBankAccountUserResponse, GetBankAccountUserRequest, GetBankAccountUserResponse, UpdateBankAccountUserRequest, UpdateBankAccountUserResponse} from "@fiado/type-kit/bin/account";
|
|
2
|
+
|
|
3
|
+
export interface ISTPAccountApi {
|
|
4
|
+
// updateUser(object: UpdateBankAccountUserRequest): Promise<any>
|
|
5
|
+
// getUserById(externalUserId: string): Promise<any>
|
|
6
|
+
createAccount(request: CreateBankAccountRequest): Promise<any>;
|
|
7
|
+
}
|
package/src/tern/api/TernApi.ts
CHANGED
|
@@ -40,6 +40,13 @@ export default class TernApi implements ITernApi {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/// CARDS
|
|
43
|
+
|
|
44
|
+
async getCardSensitiveInformation(externalCardId: string, externalUserId?: string): Promise<any> {
|
|
45
|
+
|
|
46
|
+
const url = `${this.baseUrl}cards/${externalCardId}/sensitive`;
|
|
47
|
+
return await this.httpRequest.get(url);
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
async getCardsById(externalCardId: string): Promise<any> {
|
|
44
51
|
|
|
45
52
|
const url = `${this.baseUrl}cards/${externalCardId}/`;
|