@fiado/api-invoker 3.0.30 → 3.0.32

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,8 @@ 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");
93
95
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
94
96
  // UTILS bindings
95
97
  bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
@@ -181,4 +183,6 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
181
183
  bind("IPlatformErrorEventsPublisher").to(PlatformErrorEventsPublisher_1.default);
182
184
  // Teams connector - SQS publisher
183
185
  bind("ITeamsNotificationPublisher").to(TeamsNotificationPublisher_1.default);
186
+ // Legal document
187
+ bind("ILegalDocumentApi").to(legalDocument_1.LegalDocumentApi);
184
188
  });
@@ -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.30",
3
+ "version": "3.0.32",
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",
@@ -16,7 +16,7 @@
16
16
  "@fiado/gateway-adapter": "^1.1.50",
17
17
  "@fiado/http-client": "^1.0.7",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^3.1.3",
19
+ "@fiado/type-kit": "^3.1.4",
20
20
  "dotenv": "^16.4.7",
21
21
  "i": "^0.3.7",
22
22
  "inversify": "^6.2.2",
@@ -132,6 +132,8 @@ import PlatformErrorEventsPublisher from "./platform-error-events/queue/Platform
132
132
  // Teams connector - SQS publisher
133
133
  import { ITeamsNotificationPublisher } from "./teams-connector";
134
134
  import TeamsNotificationPublisher from "./teams-connector/queue/TeamsNotificationPublisher";
135
+ // Legal document
136
+ import { ILegalDocumentApi, LegalDocumentApi } from "./legalDocument";
135
137
 
136
138
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
137
139
  // UTILS bindings
@@ -229,4 +231,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
229
231
 
230
232
  // Teams connector - SQS publisher
231
233
  bind<ITeamsNotificationPublisher>("ITeamsNotificationPublisher").to(TeamsNotificationPublisher);
234
+
235
+ // Legal document
236
+ bind<ILegalDocumentApi>("ILegalDocumentApi").to(LegalDocumentApi);
232
237
  });
@@ -1,10 +1,11 @@
1
- import { inject } from "inversify";
1
+ import { inject, injectable } from "inversify";
2
2
  import { ILegalDocumentApi } from "./interfaces/ILegalDocumentApi";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
4
 
5
5
 
6
6
 
7
7
 
8
+ @injectable()
8
9
  export class LegalDocumentApi implements ILegalDocumentApi {
9
10
 
10
11
  private readonly baseUrl = process.env.LEGAL_DOCUMENT_LAMBDA_URL || "";
@@ -22,5 +23,16 @@ export class LegalDocumentApi implements ILegalDocumentApi {
22
23
 
23
24
  return await this.httpRequest.get<any>(url);
24
25
  }
26
+
27
+ async getDirectoryAcceptanceByDirectoryId(directoryId: string): Promise<any> {
28
+
29
+ if (!directoryId) {
30
+ throw new Error("Directory ID is required.")
31
+ }
32
+
33
+ const url = `${this.baseUrl}directories/${directoryId}`;
34
+
35
+ return await this.httpRequest.get<any>(url);
36
+ }
25
37
  }
26
38
 
@@ -3,5 +3,6 @@
3
3
  export interface ILegalDocumentApi {
4
4
 
5
5
  getPendingSign(directoryId: string): Promise<any>;
6
+ getDirectoryAcceptanceByDirectoryId(directoryId: string): Promise<any>;
6
7
 
7
8
  }