@fiado/api-invoker 1.0.7 → 1.0.8

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.
@@ -30,7 +30,7 @@ let DirectoryApi = class DirectoryApi {
30
30
  }
31
31
  const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
32
32
  const operationName = "getUserInfoByIds";
33
- return await this.httpRequest.post(`${this.baseUrl}`, {}, { 'operationName': operationName });
33
+ return await this.httpRequest.post(`${url}`, {}, { 'operationName': operationName });
34
34
  }
35
35
  };
36
36
  exports.DirectoryApi = DirectoryApi;
@@ -11,9 +11,14 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  return function (target, key) { decorator(target, key, paramIndex); }
13
13
  };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
14
17
  Object.defineProperty(exports, "__esModule", { value: true });
15
18
  exports.IdentityApi = void 0;
16
19
  const inversify_1 = require("inversify");
20
+ const dotenv_1 = __importDefault(require("dotenv"));
21
+ dotenv_1.default.config();
17
22
  let IdentityApi = class IdentityApi {
18
23
  constructor(httpRequest) {
19
24
  this.httpRequest = httpRequest;
@@ -21,10 +26,10 @@ let IdentityApi = class IdentityApi {
21
26
  }
22
27
  async getPeopleByIds(ids) {
23
28
  if (ids.length === 0) {
24
- throw new Error("At least one identity ID is required.");
29
+ throw new Error("At least one people ID is required.");
25
30
  }
26
31
  const url = `${this.baseUrl}identities/people?${ids.map(id => `peopleId=${encodeURIComponent(id)}`).join('&')}`;
27
- return await this.httpRequest.post(`${this.baseUrl}`, {});
32
+ return await this.httpRequest.post(`${url}`, {});
28
33
  }
29
34
  };
30
35
  exports.IdentityApi = IdentityApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
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,4 +1,3 @@
1
-
2
1
  import { inject, injectable } from "inversify";
3
2
  import { IDirectoryApi } from "./interfaces/IDirectoryApi";
4
3
  import { IHttpRequest } from "@fiado/http-client";
@@ -21,6 +20,6 @@ export class DirectoryApi implements IDirectoryApi {
21
20
  const url = `${this.baseUrl}?${ids.map(id => `directoryId=${encodeURIComponent(id)}`).join('&')}`;
22
21
  const operationName = "getUserInfoByIds";
23
22
 
24
- return await this.httpRequest.post(`${this.baseUrl}`, {}, { 'operationName': operationName } );
23
+ return await this.httpRequest.post(`${url}`, {}, { 'operationName': operationName } );
25
24
  }
26
25
  }
@@ -1,6 +1,8 @@
1
1
  import { inject, injectable } from "inversify";
2
2
  import { IIdentityApi } from "./interfaces/IIdentityApi";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
+ import dotenv from 'dotenv';
5
+ dotenv.config();
4
6
 
5
7
  @injectable()
6
8
  export class IdentityApi implements IIdentityApi {
@@ -12,12 +14,12 @@ export class IdentityApi implements IIdentityApi {
12
14
  async getPeopleByIds(ids: string[]): Promise<{ [key: string]: any; }[]> {
13
15
 
14
16
  if (ids.length === 0) {
15
- throw new Error("At least one identity ID is required.")
17
+ throw new Error("At least one people ID is required.")
16
18
  }
17
19
 
18
20
  const url = `${this.baseUrl}identities/people?${ids.map(id => `peopleId=${encodeURIComponent(id)}`).join('&')}`;
19
21
 
20
- return await this.httpRequest.post(`${this.baseUrl}`, {} );
22
+ return await this.httpRequest.post(`${url}`, {} );
21
23
 
22
24
  }
23
25
  }