@fiado/api-invoker 1.2.25 → 1.2.27

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.
@@ -4,6 +4,7 @@ export default class ActivityApi implements IActivityApi {
4
4
  private httpRequest;
5
5
  private readonly baseUrl;
6
6
  constructor(httpRequest: IHttpRequest);
7
+ correctCounters(): Promise<any>;
7
8
  findByDirectoriesList(directories: string[]): Promise<any>;
8
9
  getActivityByDirectoryId(directoryId: string, typeOfActivityIds: string[]): Promise<any>;
9
10
  getActivityById(typeOfActivityIds: string[]): Promise<any>;
@@ -18,6 +18,10 @@ let ActivityApi = class ActivityApi {
18
18
  this.httpRequest = httpRequest;
19
19
  this.baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
20
20
  }
21
+ async correctCounters() {
22
+ const url = `${this.baseUrl}activities/counters/correct`;
23
+ return await this.httpRequest.post(url);
24
+ }
21
25
  async findByDirectoriesList(directories) {
22
26
  const url = `${this.baseUrl}activities/history/directories/?directories=${directories.join(',')}`;
23
27
  return await this.httpRequest.get(url);
@@ -3,4 +3,5 @@ export interface IActivityApi {
3
3
  getActivityById(typeOfActivityIds: string[]): Promise<any>;
4
4
  getActivityHistory(typeOfActivity: string, startDate: string, endDate: string): Promise<any>;
5
5
  findByDirectoriesList(directories: string[]): Promise<any>;
6
+ correctCounters(): Promise<any>;
6
7
  }
package/bin/index.d.ts CHANGED
@@ -35,3 +35,4 @@ export * from "./directories";
35
35
  export * from "./cognitoConnector";
36
36
  export * from "./zendesk";
37
37
  export * from "./blacklist";
38
+ export * from "./legalDocument";
package/bin/index.js CHANGED
@@ -51,3 +51,4 @@ __exportStar(require("./directories"), exports);
51
51
  __exportStar(require("./cognitoConnector"), exports);
52
52
  __exportStar(require("./zendesk"), exports);
53
53
  __exportStar(require("./blacklist"), exports);
54
+ __exportStar(require("./legalDocument"), exports);
@@ -0,0 +1,8 @@
1
+ import { ILegalDocumentApi } from "./interfaces/ILegalDocumentApi";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ export declare class LegalDocumentApi implements ILegalDocumentApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ getPendingSign(directoryId: string): Promise<any>;
8
+ }
@@ -0,0 +1,34 @@
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
+ exports.LegalDocumentApi = void 0;
16
+ const inversify_1 = require("inversify");
17
+ let LegalDocumentApi = class LegalDocumentApi {
18
+ constructor(httpRequest) {
19
+ this.httpRequest = httpRequest;
20
+ this.baseUrl = process.env.LEGAL_DOCUMENT_LAMBDA_URL || "";
21
+ }
22
+ async getPendingSign(directoryId) {
23
+ if (!directoryId) {
24
+ throw new Error("Directory ID is required.");
25
+ }
26
+ const url = `${this.baseUrl}documents/directories/directoryId=${directoryId}`;
27
+ return await this.httpRequest.get(url);
28
+ }
29
+ };
30
+ exports.LegalDocumentApi = LegalDocumentApi;
31
+ exports.LegalDocumentApi = LegalDocumentApi = __decorate([
32
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
33
+ __metadata("design:paramtypes", [Object])
34
+ ], LegalDocumentApi);
@@ -0,0 +1,3 @@
1
+ export interface ILegalDocumentApi {
2
+ getPendingSign(directoryId: string): Promise<any>;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/interfaces/ILegalDocumentApi';
2
+ export * from './api/LegalDocumentApi';
@@ -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("./api/interfaces/ILegalDocumentApi"), exports);
18
+ __exportStar(require("./api/LegalDocumentApi"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.2.25",
3
+ "version": "1.2.27",
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",
@@ -8,6 +8,10 @@ export default class ActivityApi implements IActivityApi {
8
8
  private readonly baseUrl = process.env.ACTIVITY_LAMBDA_URL || "";
9
9
 
10
10
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
11
+ async correctCounters(): Promise<any> {
12
+ const url = `${this.baseUrl}activities/counters/correct`;
13
+ return await this.httpRequest.post(url);
14
+ }
11
15
  async findByDirectoriesList(directories: string[]): Promise<any> {
12
16
  const url = `${this.baseUrl}activities/history/directories/?directories=${directories.join(',')}`;
13
17
  return await this.httpRequest.get(url);
@@ -9,4 +9,6 @@ export interface IActivityApi {
9
9
  getActivityHistory(typeOfActivity: string, startDate: string, endDate: string): Promise<any>
10
10
 
11
11
  findByDirectoriesList(directories: string[]): Promise<any>
12
+
13
+ correctCounters(): Promise<any>
12
14
  }
package/src/index.ts CHANGED
@@ -34,4 +34,5 @@ export * from "./disputes";
34
34
  export * from "./directories";
35
35
  export * from "./cognitoConnector";
36
36
  export * from "./zendesk";
37
- export * from "./blacklist";
37
+ export * from "./blacklist";
38
+ export * from "./legalDocument";
@@ -0,0 +1,26 @@
1
+ import { inject } from "inversify";
2
+ import { ILegalDocumentApi } from "./interfaces/ILegalDocumentApi";
3
+ import { IHttpRequest } from "@fiado/http-client";
4
+
5
+
6
+
7
+
8
+ export class LegalDocumentApi implements ILegalDocumentApi {
9
+
10
+ private readonly baseUrl = process.env.LEGAL_DOCUMENT_LAMBDA_URL || "";
11
+
12
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
13
+ }
14
+
15
+ async getPendingSign(directoryId: string): Promise<any> {
16
+
17
+ if (!directoryId) {
18
+ throw new Error("Directory ID is required.")
19
+ }
20
+
21
+ const url = `${this.baseUrl}documents/directories/directoryId=${directoryId}`;
22
+
23
+ return await this.httpRequest.get<any>(url);
24
+ }
25
+ }
26
+
@@ -0,0 +1,7 @@
1
+
2
+
3
+ export interface ILegalDocumentApi {
4
+
5
+ getPendingSign(directoryId: string): Promise<any>;
6
+
7
+ }
@@ -0,0 +1,4 @@
1
+
2
+
3
+ export * from './api/interfaces/ILegalDocumentApi';
4
+ export * from './api/LegalDocumentApi';