@fiado/api-invoker 3.0.31 → 3.0.33

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.
@@ -90,6 +90,9 @@ const CreditReconciliationPublisher_1 = __importDefault(require("./credit-engine
90
90
  const CreditLienCollectionPublisher_1 = __importDefault(require("./credit-engine/queue/CreditLienCollectionPublisher"));
91
91
  const PlatformErrorEventsPublisher_1 = __importDefault(require("./platform-error-events/queue/PlatformErrorEventsPublisher"));
92
92
  const TeamsNotificationPublisher_1 = __importDefault(require("./teams-connector/queue/TeamsNotificationPublisher"));
93
+ // Legal document
94
+ const legalDocument_1 = require("./legalDocument");
95
+ const CountriesBusinessApi_1 = __importDefault(require("./countries-business/CountriesBusinessApi"));
93
96
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
94
97
  // UTILS bindings
95
98
  bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
@@ -181,4 +184,8 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
181
184
  bind("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher_1.default);
182
185
  // Teams connector - SQS publisher
183
186
  bind("ITeamsNotificationPublisher").to(TeamsNotificationPublisher_1.default);
187
+ // Legal document
188
+ bind("ILegalDocumentApi").to(legalDocument_1.LegalDocumentApi);
189
+ // Countries business
190
+ bind("ICountriesBusinessApi").to(CountriesBusinessApi_1.default);
184
191
  });
@@ -0,0 +1,9 @@
1
+ import { ICountriesBusinessApi } from "./interfaces/ICountriesBusinessApi";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ export default class CountriesBusinessApi implements ICountriesBusinessApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ getAll(): Promise<any>;
8
+ getList(params: any): Promise<any>;
9
+ }
@@ -0,0 +1,39 @@
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 CountriesBusinessApi = class CountriesBusinessApi {
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ this.baseUrl = process.env.COUNTRIES_BUSINESS_LAMBDA_URL || "";
20
+ }
21
+ async getAll() {
22
+ const headers = {
23
+ "operationName": "privateGetAll"
24
+ };
25
+ return await this.httpRequest.post(this.baseUrl, null, headers);
26
+ }
27
+ async getList(params) {
28
+ const headers = {
29
+ "operationName": "privateGetList"
30
+ };
31
+ return await this.httpRequest.post(this.baseUrl, params, headers);
32
+ }
33
+ };
34
+ CountriesBusinessApi = __decorate([
35
+ (0, inversify_1.injectable)(),
36
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
37
+ __metadata("design:paramtypes", [Object])
38
+ ], CountriesBusinessApi);
39
+ exports.default = CountriesBusinessApi;
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/ICountriesBusinessApi';
2
+ export * from './CountriesBusinessApi';
@@ -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("./interfaces/ICountriesBusinessApi"), exports);
18
+ __exportStar(require("./CountriesBusinessApi"), exports);
@@ -0,0 +1,4 @@
1
+ export interface ICountriesBusinessApi {
2
+ getAll(): Promise<any>;
3
+ getList(params: any): Promise<any>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/bin/index.d.ts CHANGED
@@ -66,3 +66,4 @@ export * from "./document-generator";
66
66
  export * from "./commission-business";
67
67
  export * from "./platform-error-events";
68
68
  export * from "./teams-connector";
69
+ export * from "./countries-business";
package/bin/index.js CHANGED
@@ -82,3 +82,4 @@ __exportStar(require("./document-generator"), exports);
82
82
  __exportStar(require("./commission-business"), exports);
83
83
  __exportStar(require("./platform-error-events"), exports);
84
84
  __exportStar(require("./teams-connector"), exports);
85
+ __exportStar(require("./countries-business"), exports);
@@ -5,4 +5,5 @@ export declare class LegalDocumentApi implements ILegalDocumentApi {
5
5
  private readonly baseUrl;
6
6
  constructor(httpRequest: IHttpRequest);
7
7
  getPendingSign(directoryId: string): Promise<any>;
8
+ getDirectoryAcceptanceByDirectoryId(directoryId: string): Promise<any>;
8
9
  }
@@ -26,9 +26,17 @@ let LegalDocumentApi = class LegalDocumentApi {
26
26
  const url = `${this.baseUrl}documents/directories/directoryId=${directoryId}`;
27
27
  return await this.httpRequest.get(url);
28
28
  }
29
+ async getDirectoryAcceptanceByDirectoryId(directoryId) {
30
+ if (!directoryId) {
31
+ throw new Error("Directory ID is required.");
32
+ }
33
+ const url = `${this.baseUrl}directories/${directoryId}`;
34
+ return await this.httpRequest.get(url);
35
+ }
29
36
  };
30
37
  exports.LegalDocumentApi = LegalDocumentApi;
31
38
  exports.LegalDocumentApi = LegalDocumentApi = __decorate([
39
+ (0, inversify_1.injectable)(),
32
40
  __param(0, (0, inversify_1.inject)("IHttpRequest")),
33
41
  __metadata("design:paramtypes", [Object])
34
42
  ], LegalDocumentApi);
@@ -1,3 +1,4 @@
1
1
  export interface ILegalDocumentApi {
2
2
  getPendingSign(directoryId: string): Promise<any>;
3
+ getDirectoryAcceptanceByDirectoryId(directoryId: string): Promise<any>;
3
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.0.31",
3
+ "version": "3.0.33",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a través de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -134,6 +134,9 @@ import { ITeamsNotificationPublisher } from "./teams-connector";
134
134
  import TeamsNotificationPublisher from "./teams-connector/queue/TeamsNotificationPublisher";
135
135
  // Legal document
136
136
  import { ILegalDocumentApi, LegalDocumentApi } from "./legalDocument";
137
+ // Countries business
138
+ import { ICountriesBusinessApi } from "./countries-business";
139
+ import CountriesBusinessApi from "./countries-business/CountriesBusinessApi";
137
140
 
138
141
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
139
142
  // UTILS bindings
@@ -234,4 +237,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
234
237
 
235
238
  // Legal document
236
239
  bind<ILegalDocumentApi>("ILegalDocumentApi").to(LegalDocumentApi);
240
+
241
+ // Countries business
242
+ bind<ICountriesBusinessApi>("ICountriesBusinessApi").to(CountriesBusinessApi);
237
243
  });
@@ -0,0 +1,25 @@
1
+ import { ICountriesBusinessApi } from "./interfaces/ICountriesBusinessApi";
2
+ import { inject, injectable } from "inversify";
3
+ import { IHttpRequest } from "@fiado/http-client";
4
+
5
+ @injectable()
6
+ export default class CountriesBusinessApi implements ICountriesBusinessApi {
7
+ private readonly baseUrl = process.env.COUNTRIES_BUSINESS_LAMBDA_URL || "";
8
+
9
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
10
+ }
11
+
12
+ async getAll(): Promise<any> {
13
+ const headers = {
14
+ "operationName": "privateGetAll"
15
+ }
16
+ return await this.httpRequest.post(this.baseUrl, null, headers);
17
+ }
18
+
19
+ async getList(params: any): Promise<any> {
20
+ const headers = {
21
+ "operationName": "privateGetList"
22
+ }
23
+ return await this.httpRequest.post(this.baseUrl, params, headers);
24
+ }
25
+ }
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/ICountriesBusinessApi';
2
+ export * from './CountriesBusinessApi';
@@ -0,0 +1,4 @@
1
+ export interface ICountriesBusinessApi {
2
+ getAll(): Promise<any>;
3
+ getList(params: any): Promise<any>;
4
+ }
package/src/index.ts CHANGED
@@ -66,3 +66,4 @@ export * from "./document-generator";
66
66
  export * from "./commission-business";
67
67
  export * from "./platform-error-events";
68
68
  export * from "./teams-connector";
69
+ export * from "./countries-business";