@fiado/api-invoker 1.5.2 → 1.5.4

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.
@@ -1,8 +1,15 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { IPayrollApi } from "./interfaces/IPayrollApi";
3
+ import { PayrollBossStatusEnum } from "@fiado/type-kit/bin/payroll-business";
3
4
  export declare class PayrollApi implements IPayrollApi {
4
5
  private httpRequest;
5
6
  private readonly baseUrl;
6
7
  constructor(httpRequest: IHttpRequest);
7
- getByDirectoryId(directoryId: string): Promise<any>;
8
+ getByDirectoryId(params: {
9
+ directoryId: string;
10
+ index?: string;
11
+ pageSize?: number;
12
+ sort?: string;
13
+ status?: PayrollBossStatusEnum;
14
+ }): Promise<any>;
8
15
  }
@@ -24,8 +24,8 @@ let PayrollApi = class PayrollApi {
24
24
  this.httpRequest = httpRequest;
25
25
  this.baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
26
26
  }
27
- async getByDirectoryId(directoryId) {
28
- const url = `${this.baseUrl}private/payroll-boss/directory/${directoryId}`;
27
+ async getByDirectoryId(params) {
28
+ const url = `${this.baseUrl}private/payroll-boss/directory/${params.directoryId}`;
29
29
  return await this.httpRequest.get(`${url}`);
30
30
  }
31
31
  };
@@ -1,3 +1,4 @@
1
+ import { PayrollBossStatusEnum } from "@fiado/type-kit/bin/payroll-business";
1
2
  /**
2
3
  * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
3
4
  */
@@ -5,7 +6,17 @@ export interface IPayrollApi {
5
6
  /**
6
7
  * Obtiene registros de payroll por directorio.
7
8
  * @param directoryId ID del directorio.
9
+ * @param index Indice de la página.
10
+ * @param pageSize Tamaño de la página.
11
+ * @param sort Orden de los resultados.
12
+ * @param status Estado del payroll.
8
13
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
9
14
  */
10
- getByDirectoryId(directoryId: string): Promise<any>;
15
+ getByDirectoryId(params: {
16
+ directoryId: string;
17
+ index?: string;
18
+ pageSize?: number;
19
+ sort?: string;
20
+ status?: PayrollBossStatusEnum;
21
+ }): Promise<any>;
11
22
  }
@@ -0,0 +1,9 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
3
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
+ export declare class ReferralBusinessApi implements IReferralBusinessApi {
5
+ private httpRequest;
6
+ private readonly baseUrl;
7
+ constructor(httpRequest: IHttpRequest);
8
+ getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>>;
9
+ }
@@ -0,0 +1,37 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ReferralBusinessApi = void 0;
19
+ const inversify_1 = require("inversify");
20
+ const dotenv_1 = __importDefault(require("dotenv"));
21
+ dotenv_1.default.config();
22
+ let ReferralBusinessApi = class ReferralBusinessApi {
23
+ constructor(httpRequest) {
24
+ this.httpRequest = httpRequest;
25
+ this.baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
26
+ }
27
+ async getByDirectoryId(directoryId) {
28
+ const url = `${this.baseUrl}private/agents/directoryId/${directoryId}`;
29
+ return await this.httpRequest.get(url);
30
+ }
31
+ };
32
+ exports.ReferralBusinessApi = ReferralBusinessApi;
33
+ exports.ReferralBusinessApi = ReferralBusinessApi = __decorate([
34
+ (0, inversify_1.injectable)(),
35
+ __param(0, (0, inversify_1.inject)("IHttpRequest")),
36
+ __metadata("design:paramtypes", [Object])
37
+ ], ReferralBusinessApi);
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IReferralBusinessApi';
2
+ export * from './PayrollApi';
@@ -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/IReferralBusinessApi"), exports);
18
+ __exportStar(require("./PayrollApi"), exports);
@@ -0,0 +1,12 @@
1
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
2
+ /**
3
+ * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
4
+ */
5
+ export interface IReferralBusinessApi {
6
+ /**
7
+ * Obtiene agentes por directorio.
8
+ * @param directoryId ID del directorio.
9
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
10
+ */
11
+ getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>>;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
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.43",
17
17
  "@fiado/http-client": "^1.0.7",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^2.0.86",
19
+ "@fiado/type-kit": "^2.0.93",
20
20
  "dotenv": "^16.4.7",
21
21
  "inversify": "^6.2.2",
22
22
  "reflect-metadata": "^0.2.2"
@@ -2,6 +2,7 @@ import { inject, injectable } from "inversify";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
3
  import dotenv from 'dotenv';
4
4
  import { IPayrollApi } from "./interfaces/IPayrollApi";
5
+ import { PayrollBossStatusEnum } from "@fiado/type-kit/bin/payroll-business";
5
6
 
6
7
  dotenv.config();
7
8
 
@@ -11,8 +12,8 @@ export class PayrollApi implements IPayrollApi {
11
12
  private readonly baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
12
13
 
13
14
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
- async getByDirectoryId(directoryId: string): Promise<any> {
15
- const url = `${this.baseUrl}private/payroll-boss/directory/${directoryId}`;
15
+ async getByDirectoryId(params: {directoryId: string,index?:string,pageSize?:number, sort?:string, status?:PayrollBossStatusEnum}): Promise<any> {
16
+ const url = `${this.baseUrl}private/payroll-boss/directory/${params.directoryId}`;
16
17
  return await this.httpRequest.get(`${url}`);
17
18
  }
18
19
 
@@ -1,3 +1,4 @@
1
+ import { PayrollBossStatusEnum } from "@fiado/type-kit/bin/payroll-business";
1
2
 
2
3
  /**
3
4
  * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
@@ -7,7 +8,11 @@ export interface IPayrollApi {
7
8
  /**
8
9
  * Obtiene registros de payroll por directorio.
9
10
  * @param directoryId ID del directorio.
11
+ * @param index Indice de la página.
12
+ * @param pageSize Tamaño de la página.
13
+ * @param sort Orden de los resultados.
14
+ * @param status Estado del payroll.
10
15
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
11
16
  */
12
- getByDirectoryId(directoryId: string): Promise<any>;
17
+ getByDirectoryId(params: {directoryId: string,index?:string,pageSize?:number, sort?:string, status?:PayrollBossStatusEnum}): Promise<any>;
13
18
  }
@@ -0,0 +1,19 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import dotenv from 'dotenv';
4
+ import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
5
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
6
+
7
+ dotenv.config();
8
+
9
+ @injectable()
10
+ export class ReferralBusinessApi implements IReferralBusinessApi {
11
+
12
+ private readonly baseUrl = process.env.PAYROLL_BUSINESS_LAMBDA_URL || "";
13
+
14
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
15
+ async getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>> {
16
+ const url = `${this.baseUrl}private/agents/directoryId/${directoryId}`;
17
+ return await this.httpRequest.get(url);
18
+ }
19
+ }
@@ -0,0 +1,2 @@
1
+ export * from './interfaces/IReferralBusinessApi';
2
+ export * from './PayrollApi';
@@ -0,0 +1,14 @@
1
+ import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
2
+
3
+ /**
4
+ * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
5
+ */
6
+ export interface IReferralBusinessApi {
7
+
8
+ /**
9
+ * Obtiene agentes por directorio.
10
+ * @param directoryId ID del directorio.
11
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
12
+ */
13
+ getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>>;
14
+ }