@fiado/api-invoker 1.0.66 → 1.0.67

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.
@@ -19,8 +19,8 @@ const sessionActivity_1 = require("./sessionActivity");
19
19
  const ExchangeRatesApi_1 = __importDefault(require("./exchangeRates/ExchangeRatesApi"));
20
20
  const authentication_1 = require("./authentication");
21
21
  const card_1 = require("./card");
22
- const TransactionPublisher_1 = require("./transaction/queue/TransactionPublisher");
23
- const ContractGeneratorApi_1 = require("./contract-generator/ContractGeneratorApi");
22
+ const transaction_1 = require("./transaction");
23
+ const contract_generator_1 = require("./contract-generator");
24
24
  const ProductCatalogApi_1 = __importDefault(require("./product-catalog/ProductCatalogApi"));
25
25
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
26
26
  bind("IDirectoryApi").to(directory_1.DirectoryApi);
@@ -35,9 +35,9 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
35
35
  bind("IAccountFiadoSAApi").to(AccountFiadoSAApi_1.default);
36
36
  bind("INotificationMessagesPublisher").to(NotificationMessagePublisher_1.default);
37
37
  bind("ISessionActivityPublisher").to(sessionActivity_1.SessionActivityPublisher);
38
- bind("ITransactionPublisher").to(TransactionPublisher_1.TransactionPublisher);
38
+ bind("ITransactionPublisher").to(transaction_1.TransactionPublisher);
39
39
  bind("IAuthenticationApi").to(authentication_1.AuthenticationApi);
40
40
  bind("ICardApi").to(card_1.CardApi);
41
- bind("IContractGeneratorApi").to(ContractGeneratorApi_1.ContractGeneratorApi);
41
+ bind("IContractGeneratorApi").to(contract_generator_1.ContractGeneratorApi);
42
42
  bind("IProductCatalogApi").to(ProductCatalogApi_1.default);
43
43
  });
@@ -6,6 +6,5 @@ export default class ProductCatalogApi implements IProductCatalogApi {
6
6
  private httpRequest;
7
7
  private readonly baseUrl;
8
8
  constructor(httpRequest: IHttpRequest);
9
- getProductCatalog(): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
10
9
  getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
11
10
  }
@@ -18,13 +18,9 @@ let ProductCatalogApi = class ProductCatalogApi {
18
18
  this.httpRequest = httpRequest;
19
19
  this.baseUrl = process.env.PRODUCT_CATALOG_LAMBDA_URL || "";
20
20
  }
21
- async getProductCatalog() {
22
- const url = `${this.baseUrl}`;
23
- return await this.httpRequest.get(url);
24
- }
25
21
  async getProductCatalogByIds(ids) {
26
- const url = `${this.baseUrl}/ids`;
27
- return await this.httpRequest.get(url, { ids });
22
+ const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
23
+ return await this.httpRequest.get(url);
28
24
  }
29
25
  };
30
26
  ProductCatalogApi = __decorate([
@@ -1,6 +1,5 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
2
  import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/GetProductCatalogResponse";
3
3
  export interface IProductCatalogApi {
4
- getProductCatalog(): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
5
4
  getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
6
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.0.66",
3
+ "version": "1.0.67",
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",
@@ -21,10 +21,10 @@ import {IExchangeRatesApi} from "./exchangeRates";
21
21
  import ExchangeRatesApi from "./exchangeRates/ExchangeRatesApi";
22
22
  import {AuthenticationApi, IAuthenticationApi} from "./authentication";
23
23
  import {CardApi, ICardApi} from "./card";
24
- import {ITransactionPublisher} from "./transaction/queue/interfaces/ITransactionPublisher";
25
- import {TransactionPublisher} from "./transaction/queue/TransactionPublisher";
26
- import {ContractGeneratorApi} from "./contract-generator/ContractGeneratorApi";
27
- import {IContractGeneratorApi} from "./contract-generator/interfaces/IContractGeneratorApi";
24
+ import {ITransactionPublisher} from "./transaction";
25
+ import {TransactionPublisher} from "./transaction";
26
+ import {ContractGeneratorApi} from "./contract-generator";
27
+ import {IContractGeneratorApi} from "./contract-generator";
28
28
  import {IProductCatalogApi} from "./product-catalog";
29
29
  import ProductCatalogApi from "./product-catalog/ProductCatalogApi";
30
30
 
@@ -11,13 +11,8 @@ export default class ProductCatalogApi implements IProductCatalogApi {
11
11
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
12
12
  }
13
13
 
14
- async getProductCatalog(): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
15
- const url = `${this.baseUrl}`;
16
- return await this.httpRequest.get(url);
17
- }
18
-
19
14
  async getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>> {
20
- const url = `${this.baseUrl}/ids`;
21
- return await this.httpRequest.get(url, {ids});
15
+ const url = `${this.baseUrl}?${ids.map(id => `id=${encodeURIComponent(id)}`).join('&')}`;
16
+ return await this.httpRequest.get(url);
22
17
  }
23
18
  }
@@ -3,7 +3,5 @@ import GetProductCatalogResponse from "@fiado/type-kit/bin/productCatalog/dtos/G
3
3
 
4
4
 
5
5
  export interface IProductCatalogApi {
6
- getProductCatalog(): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
7
-
8
6
  getProductCatalogByIds(ids: string[]): Promise<ApiGatewayResponse<GetProductCatalogResponse[]>>;
9
7
  }