@fiado/api-invoker 1.5.1 → 1.5.3

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
  }
@@ -22,10 +22,10 @@ dotenv_1.default.config();
22
22
  let PayrollApi = class PayrollApi {
23
23
  constructor(httpRequest) {
24
24
  this.httpRequest = httpRequest;
25
- this.baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
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,17 +2,18 @@ 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
 
8
9
  @injectable()
9
10
  export class PayrollApi implements IPayrollApi {
10
11
 
11
- private readonly baseUrl = process.env.FIADO_GROUP_LAMBDA_URL || "";
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
  }