@fiado/api-invoker 1.0.2 → 1.0.4

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.
@@ -0,0 +1,2 @@
1
+ import { Container } from "inversify";
2
+ export declare const apiInvokerContainer: Container;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.apiInvokerContainer = void 0;
4
+ const inversify_1 = require("inversify");
5
+ const directory_1 = require("./directory");
6
+ exports.apiInvokerContainer = new inversify_1.Container();
7
+ exports.apiInvokerContainer.bind("IDirectoryApi").to(directory_1.DirectoryApi);
@@ -8,6 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.DirectoryApi = void 0;
13
16
  const inversify_1 = require("inversify");
@@ -28,5 +31,6 @@ let DirectoryApi = class DirectoryApi {
28
31
  exports.DirectoryApi = DirectoryApi;
29
32
  exports.DirectoryApi = DirectoryApi = __decorate([
30
33
  (0, inversify_1.injectable)(),
34
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
31
35
  __metadata("design:paramtypes", [Object])
32
36
  ], DirectoryApi);
package/bin/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './directory';
2
+ export * from "./container.config";
package/bin/index.js CHANGED
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./directory"), exports);
18
+ __exportStar(require("./container.config"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
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",
@@ -0,0 +1,8 @@
1
+
2
+ import { Container } from "inversify";
3
+ import { DirectoryApi, IDirectoryApi } from "./directory";
4
+
5
+
6
+ export const apiInvokerContainer = new Container();
7
+
8
+ apiInvokerContainer.bind<IDirectoryApi>("IDirectoryApi").to(DirectoryApi);
@@ -1,5 +1,5 @@
1
1
 
2
- import { injectable } from "inversify";
2
+ import { inject, injectable } from "inversify";
3
3
  import { IDirectoryApi } from "./interfaces/IDirectoryApi";
4
4
  import { IHttpRequest } from "@fiado/http-client";
5
5
 
@@ -8,7 +8,7 @@ export class DirectoryApi implements IDirectoryApi {
8
8
 
9
9
  private readonly baseUrl = process.env.DIRECTORY_LAMBDA_URL || "";
10
10
 
11
- constructor(private httpRequest: IHttpRequest) { }
11
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
12
12
 
13
13
  public async getByIds(ids: string[]): Promise<Array<{ [key: string]: any }>> {
14
14
 
package/src/index.ts CHANGED
@@ -2,5 +2,7 @@
2
2
 
3
3
 
4
4
  export * from './directory';
5
+ export * from "./container.config";
6
+
5
7
 
6
8