@fiado/api-invoker 1.5.36 → 1.5.38

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.
@@ -69,6 +69,7 @@ const event_history_business_1 = require("./event-history-business");
69
69
  const ReportProcessorBusinessApi_1 = __importDefault(require("./report-processor-business/api/ReportProcessorBusinessApi"));
70
70
  const NotificationWSMessagePublisher_1 = __importDefault(require("./notificationWebsockets/queue/NotificationWSMessagePublisher"));
71
71
  const PeopleBusinessApi_1 = __importDefault(require("./people-business/api/PeopleBusinessApi"));
72
+ const STPBusinessApi_1 = __importDefault(require("./stp-business/api/STPBusinessApi"));
72
73
  exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
73
74
  // UTILS bindings
74
75
  bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
@@ -136,4 +137,5 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
136
137
  bind("IEventHistoryApi").to(event_history_business_1.EventHistoryApi);
137
138
  bind("IReportProcessorBusinessApi").to(ReportProcessorBusinessApi_1.default);
138
139
  bind("IPeopleBusinessApi").to(PeopleBusinessApi_1.default);
140
+ bind("ISTPBusinessApi").to(STPBusinessApi_1.default);
139
141
  });
@@ -6,6 +6,7 @@ export declare class DirectoriesApi implements IDirectoriesApi {
6
6
  private httpRequest;
7
7
  private readonly baseUrl;
8
8
  constructor(httpRequest: IHttpRequest);
9
+ getDirectoryBySponsorDirectoryId(sponsorDirectoryId: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
9
10
  getBackofficeDirectoryById(id: string, typeOfDirectoryId?: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
10
11
  createBackofficeDirectory(directory: DirectoryBackofficeCreateRequest & {
11
12
  typeOfDirectoryId?: TypeOfDirectoryId;
@@ -24,6 +24,10 @@ let DirectoriesApi = class DirectoriesApi {
24
24
  this.httpRequest = httpRequest;
25
25
  this.baseUrl = process.env.DIRECTORIES_LAMBDA_URL || "";
26
26
  }
27
+ async getDirectoryBySponsorDirectoryId(sponsorDirectoryId, typeOfDirectoryId) {
28
+ const url = `${this.baseUrl}/directories/search/sponsorDirectoryId/${sponsorDirectoryId}?typeOfDirectoryId=${typeOfDirectoryId}`;
29
+ return await this.httpRequest.get(url);
30
+ }
27
31
  async getBackofficeDirectoryById(id, typeOfDirectoryId) {
28
32
  const queryParam = typeOfDirectoryId ? `?typeOfDirectoryId=${typeOfDirectoryId}` : '';
29
33
  const url = `${this.baseUrl}directories/backoffice/${id}${queryParam}`;
@@ -23,4 +23,5 @@ export interface IDirectoriesApi {
23
23
  updateBackofficeDirectory(directoryId: string, params: DirectoryBackofficeUpdateRequest & {
24
24
  typeOfDirectoryId?: TypeOfDirectoryId;
25
25
  }): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
26
+ getDirectoryBySponsorDirectoryId(sponsorDirectoryId: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
26
27
  }
package/bin/index.d.ts CHANGED
@@ -56,3 +56,4 @@ export * from "./event-history-business";
56
56
  export * from "./report-processor-business";
57
57
  export * from "./notificationWebsockets";
58
58
  export * from "./people-business";
59
+ export * from "./stp-business";
package/bin/index.js CHANGED
@@ -72,3 +72,4 @@ __exportStar(require("./event-history-business"), exports);
72
72
  __exportStar(require("./report-processor-business"), exports);
73
73
  __exportStar(require("./notificationWebsockets"), exports);
74
74
  __exportStar(require("./people-business"), exports);
75
+ __exportStar(require("./stp-business"), exports);
@@ -0,0 +1,19 @@
1
+ import { ISTPBusinessApi } from "./interfaces/ISTPBusinessApi";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ export default class STPBusinessApi implements ISTPBusinessApi {
4
+ private httpRequest;
5
+ private readonly baseUrl;
6
+ constructor(httpRequest: IHttpRequest);
7
+ getFiadoSAConciliation(params: {
8
+ index?: string;
9
+ pageSize?: number;
10
+ sort?: "ascending" | "descending";
11
+ date: string;
12
+ }): Promise<any>;
13
+ getPagoConfiadoConciliation(params: {
14
+ index: string;
15
+ pageSize?: number;
16
+ sort?: "ascending" | "descending";
17
+ date: string;
18
+ }): Promise<any>;
19
+ }
@@ -0,0 +1,51 @@
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 STPBusinessApi = class STPBusinessApi {
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ this.baseUrl = process.env.STP_BUSINESS_LAMBDA_URL || "";
20
+ }
21
+ async getFiadoSAConciliation(params) {
22
+ const queryParams = new URLSearchParams();
23
+ if (params.index)
24
+ queryParams.append('index', params.index);
25
+ if (params.pageSize)
26
+ queryParams.append('pageSize', params.pageSize.toString());
27
+ if (params.sort)
28
+ queryParams.append('sort', params.sort);
29
+ queryParams.append('date', params.date);
30
+ const url = `${this.baseUrl}conciliation/FIADOSA?${queryParams.toString()}`;
31
+ return await this.httpRequest.get(url);
32
+ }
33
+ async getPagoConfiadoConciliation(params) {
34
+ const queryParams = new URLSearchParams();
35
+ if (params.index)
36
+ queryParams.append('index', params.index);
37
+ if (params.pageSize)
38
+ queryParams.append('pageSize', params.pageSize.toString());
39
+ if (params.sort)
40
+ queryParams.append('sort', params.sort);
41
+ queryParams.append('date', params.date);
42
+ const url = `${this.baseUrl}conciliation/PAGOCONFIADO?${queryParams.toString()}`;
43
+ return await this.httpRequest.get(url);
44
+ }
45
+ };
46
+ STPBusinessApi = __decorate([
47
+ (0, inversify_1.injectable)(),
48
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
49
+ __metadata("design:paramtypes", [Object])
50
+ ], STPBusinessApi);
51
+ exports.default = STPBusinessApi;
@@ -0,0 +1,14 @@
1
+ export interface ISTPBusinessApi {
2
+ getFiadoSAConciliation(params: {
3
+ index?: string;
4
+ pageSize?: number;
5
+ sort?: "ascending" | "descending";
6
+ date: string;
7
+ }): Promise<any>;
8
+ getPagoConfiadoConciliation(params: {
9
+ index: string;
10
+ pageSize?: number;
11
+ sort?: "ascending" | "descending";
12
+ date: string;
13
+ }): Promise<any>;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './api/STPBusinessApi';
2
+ export * from './api/interfaces/ISTPBusinessApi';
@@ -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/STPBusinessApi"), exports);
18
+ __exportStar(require("./api/interfaces/ISTPBusinessApi"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.5.36",
3
+ "version": "1.5.38",
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",
@@ -90,6 +90,8 @@ import { INotificationWSMessagesPublisher } from "./notificationWebsockets";
90
90
  import NotificationWSMessagePublisher from "./notificationWebsockets/queue/NotificationWSMessagePublisher";
91
91
  import PeopleBusinessApi from "./people-business/api/PeopleBusinessApi";
92
92
  import { IPeopleBusinessApi } from "./people-business";
93
+ import STPBusinessApi from "./stp-business/api/STPBusinessApi";
94
+ import { ISTPBusinessApi } from "./stp-business";
93
95
 
94
96
  export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
95
97
  // UTILS bindings
@@ -159,5 +161,6 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
159
161
  bind<IEventHistoryApi>("IEventHistoryApi").to(EventHistoryApi);
160
162
  bind<IReportProcessorBusinessApi>("IReportProcessorBusinessApi").to(ReportProcessorBusinessApi);
161
163
  bind<IPeopleBusinessApi>("IPeopleBusinessApi").to(PeopleBusinessApi);
164
+ bind<ISTPBusinessApi>("ISTPBusinessApi").to(STPBusinessApi);
162
165
 
163
166
  });
@@ -12,6 +12,10 @@ export class DirectoriesApi implements IDirectoriesApi {
12
12
  private readonly baseUrl = process.env.DIRECTORIES_LAMBDA_URL || "";
13
13
 
14
14
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
15
+ async getDirectoryBySponsorDirectoryId(sponsorDirectoryId: string, typeOfDirectoryId: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>> {
16
+ const url: string = `${this.baseUrl}/directories/search/sponsorDirectoryId/${sponsorDirectoryId}?typeOfDirectoryId=${typeOfDirectoryId}`;
17
+ return await this.httpRequest.get(url);
18
+ }
15
19
 
16
20
  async getBackofficeDirectoryById(id: string, typeOfDirectoryId?: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>> {
17
21
  const queryParam = typeOfDirectoryId ? `?typeOfDirectoryId=${typeOfDirectoryId}` : '';
@@ -13,4 +13,5 @@ export interface IDirectoriesApi {
13
13
  getBackofficeDirectoryByEmail(email:string, typeOfDirectoryId?: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
14
14
  getBackofficeDirectoryList(params:{pageSize?:number, index?:string, typeOfDirectoryId?: TypeOfDirectoryId}): Promise<FiadoApiResponse<{index:string|null, items: DirectoryBackofficeResponse[]}>>;
15
15
  updateBackofficeDirectory(directoryId:string, params:DirectoryBackofficeUpdateRequest & { typeOfDirectoryId?: TypeOfDirectoryId }): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
16
+ getDirectoryBySponsorDirectoryId(sponsorDirectoryId:string, typeOfDirectoryId: TypeOfDirectoryId): Promise<FiadoApiResponse<DirectoryBackofficeResponse>>;
16
17
  }
package/src/index.ts CHANGED
@@ -56,3 +56,5 @@ export * from "./event-history-business";
56
56
  export * from "./report-processor-business";
57
57
  export * from "./notificationWebsockets";
58
58
  export * from "./people-business";
59
+ export * from "./stp-business";
60
+
@@ -0,0 +1,32 @@
1
+ import {ISTPBusinessApi } from "./interfaces/ISTPBusinessApi";
2
+ import {inject, injectable} from "inversify";
3
+ import {IHttpRequest} from "@fiado/http-client";
4
+
5
+ @injectable()
6
+ export default class STPBusinessApi implements ISTPBusinessApi {
7
+
8
+ private readonly baseUrl = process.env.STP_BUSINESS_LAMBDA_URL || "";
9
+
10
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
11
+
12
+ }
13
+ async getFiadoSAConciliation(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending"; date: string; }): Promise<any> {
14
+ const queryParams = new URLSearchParams();
15
+ if (params.index) queryParams.append('index', params.index);
16
+ if (params.pageSize) queryParams.append('pageSize', params.pageSize.toString());
17
+ if (params.sort) queryParams.append('sort', params.sort);
18
+ queryParams.append('date', params.date);
19
+ const url: string = `${this.baseUrl}conciliation/FIADOSA?${queryParams.toString()}`;
20
+ return await this.httpRequest.get(url);
21
+ }
22
+ async getPagoConfiadoConciliation(params: { index: string; pageSize?: number; sort?: "ascending" | "descending"; date: string; }): Promise<any> {
23
+ const queryParams = new URLSearchParams();
24
+ if (params.index) queryParams.append('index', params.index);
25
+ if (params.pageSize) queryParams.append('pageSize', params.pageSize.toString());
26
+ if (params.sort) queryParams.append('sort', params.sort);
27
+ queryParams.append('date', params.date);
28
+ const url: string = `${this.baseUrl}conciliation/PAGOCONFIADO?${queryParams.toString()}`;
29
+ return await this.httpRequest.get(url);
30
+ }
31
+
32
+ }
@@ -0,0 +1,15 @@
1
+ export interface ISTPBusinessApi {
2
+ getFiadoSAConciliation(params:{
3
+ index?:string,
4
+ pageSize?:number,
5
+ sort?:"ascending"|"descending",
6
+ date:string,
7
+ }): Promise<any>;
8
+
9
+ getPagoConfiadoConciliation(params:{
10
+ index:string,
11
+ pageSize?:number,
12
+ sort?:"ascending"|"descending",
13
+ date:string,
14
+ }): Promise<any>;
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from './api/STPBusinessApi';
2
+ export * from './api/interfaces/ISTPBusinessApi';