@fiado/api-invoker 1.0.20 → 1.0.21
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/pomelo/api/PomeloApi.d.ts +9 -0
- package/bin/pomelo/api/PomeloApi.js +31 -0
- package/bin/pomelo/api/interfaces/IPomeloApi.d.ts +4 -0
- package/bin/pomelo/api/interfaces/IPomeloApi.js +2 -0
- package/bin/pomelo/index.d.ts +2 -0
- package/bin/pomelo/index.js +18 -0
- package/package.json +2 -2
- package/src/container.config.ts +3 -0
- package/src/index.ts +1 -0
- package/src/pomelo/api/PomeloApi.ts +18 -0
- package/src/pomelo/api/interfaces/IPomeloApi.ts +5 -0
- package/src/pomelo/index.ts +2 -0
package/bin/container.config.js
CHANGED
|
@@ -9,9 +9,11 @@ const directory_1 = require("./directory");
|
|
|
9
9
|
const identity_1 = require("./identity");
|
|
10
10
|
const NotificationMessagePublisher_1 = __importDefault(require("./notificationMessages/queue/NotificationMessagePublisher"));
|
|
11
11
|
const TernApi_1 = __importDefault(require("./tern/api/TernApi"));
|
|
12
|
+
const PomeloApi_1 = __importDefault(require("./pomelo/api/PomeloApi"));
|
|
12
13
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
13
14
|
bind("IDirectoryApi").to(directory_1.DirectoryApi);
|
|
14
15
|
bind("IIdentityApi").to(identity_1.IdentityApi);
|
|
15
16
|
bind("ITernApi").to(TernApi_1.default);
|
|
17
|
+
bind("IPomeloApi").to(PomeloApi_1.default);
|
|
16
18
|
bind("INotificationMessagesPublisher").to(NotificationMessagePublisher_1.default);
|
|
17
19
|
});
|
package/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
|
@@ -19,5 +19,6 @@ __exportStar(require("./identity"), exports);
|
|
|
19
19
|
__exportStar(require("./notificationMessages"), exports);
|
|
20
20
|
__exportStar(require("./sessionActivity"), exports);
|
|
21
21
|
__exportStar(require("./tern"), exports);
|
|
22
|
+
__exportStar(require("./pomelo"), exports);
|
|
22
23
|
__exportStar(require("./address"), exports);
|
|
23
24
|
__exportStar(require("./container.config"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { CreateBankAccountUserInput } from "@fiado/type-kit/bin/account";
|
|
4
|
+
export default class PomeloApi implements IPomeloApi {
|
|
5
|
+
private httpRequest;
|
|
6
|
+
private readonly baseUrl;
|
|
7
|
+
constructor(httpRequest: IHttpRequest);
|
|
8
|
+
createUser(request: CreateBankAccountUserInput): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.POMELO_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async createUser(request) {
|
|
22
|
+
const url = `${this.baseUrl}users/create`;
|
|
23
|
+
return await this.httpRequest.post(url, request);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
PomeloApi = __decorate([
|
|
27
|
+
(0, inversify_1.injectable)(),
|
|
28
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
29
|
+
__metadata("design:paramtypes", [Object])
|
|
30
|
+
], PomeloApi);
|
|
31
|
+
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/PomeloApi"), exports);
|
|
18
|
+
__exportStar(require("./api/interfaces/IPomeloApi"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
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.65",
|
|
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
|
@@ -5,10 +5,13 @@ import {INotificationMessagesPublisher} from "./notificationMessages";
|
|
|
5
5
|
import NotificationMessagePublisher from "./notificationMessages/queue/NotificationMessagePublisher";
|
|
6
6
|
import {ITernApi} from "./tern";
|
|
7
7
|
import TernApi from "./tern/api/TernApi";
|
|
8
|
+
import { IPomeloApi } from "./pomelo";
|
|
9
|
+
import PomeloApi from "./pomelo/api/PomeloApi";
|
|
8
10
|
|
|
9
11
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
10
12
|
bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
|
|
11
13
|
bind<IIdentityApi>("IIdentityApi").to(IdentityApi);
|
|
12
14
|
bind<ITernApi>("ITernApi").to(TernApi);
|
|
15
|
+
bind<IPomeloApi>("IPomeloApi").to(PomeloApi);
|
|
13
16
|
bind<INotificationMessagesPublisher>("INotificationMessagesPublisher").to(NotificationMessagePublisher);
|
|
14
17
|
});
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {IPomeloApi } from "./interfaces/IPomeloApi";
|
|
2
|
+
import {inject, injectable} from "inversify";
|
|
3
|
+
import {IHttpRequest} from "@fiado/http-client";
|
|
4
|
+
import { CreateBankAccountUserInput } from "@fiado/type-kit/bin/account";
|
|
5
|
+
|
|
6
|
+
@injectable()
|
|
7
|
+
export default class PomeloApi implements IPomeloApi {
|
|
8
|
+
private readonly baseUrl = process.env.POMELO_LAMBDA_URL || "";
|
|
9
|
+
|
|
10
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async createUser(request: CreateBankAccountUserInput): Promise<any> {
|
|
14
|
+
const url: string = `${this.baseUrl}users/create`;
|
|
15
|
+
return await this.httpRequest.post(url, request);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|