@fiado/api-invoker 1.1.87 → 1.1.88

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,12 @@ export declare class DisputesApi implements IDisputesApi {
4
4
  private httpRequest;
5
5
  private readonly baseUrl;
6
6
  constructor(httpRequest: IHttpRequest);
7
+ getListBetweenDates(params: {
8
+ index?: string;
9
+ pageSize?: number;
10
+ startDate: string;
11
+ endDate: string;
12
+ }): Promise<void>;
7
13
  addProvisional(params: {
8
14
  disputeId: string;
9
15
  amount: number;
@@ -24,6 +24,19 @@ let DisputesApi = class DisputesApi {
24
24
  this.httpRequest = httpRequest;
25
25
  this.baseUrl = process.env.DISPUTES_LAMBDA_URL || "";
26
26
  }
27
+ async getListBetweenDates(params) {
28
+ let queryParams = [];
29
+ if (!params.index) {
30
+ queryParams.push(`index=${params.index}`);
31
+ }
32
+ if (!params.pageSize) {
33
+ queryParams.push(`pageSize=${params.pageSize}`);
34
+ }
35
+ queryParams.push(`startDate=${params.startDate}`);
36
+ queryParams.push(`endDate=${params.endDate}`);
37
+ const url = `${this.baseUrl}disputes/bdates?${queryParams.join('&')}`;
38
+ return await this.httpRequest.get(url);
39
+ }
27
40
  async addProvisional(params) {
28
41
  const url = `${this.baseUrl}disputes/provisional/add/${params.disputeId}`;
29
42
  return await this.httpRequest.put(url, { amount: params.amount, date: params.date, type: params.type });
@@ -30,4 +30,19 @@ export interface IDisputesApi {
30
30
  date: string;
31
31
  type: "PROV" | "REV_PROV";
32
32
  }): Promise<void>;
33
+ /**
34
+ * Consultar disputas entre fechas.
35
+ * @param index indice de consulta.
36
+ * @param pageSize tamaño de paginación.
37
+ * @param startDate Fecha inicial de consulta.
38
+ * @param endDate Fecha final de consulta
39
+ * @returns Una promesa que resuelve a void.
40
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
41
+ */
42
+ getListBetweenDates(params: {
43
+ index?: string;
44
+ pageSize?: number;
45
+ startDate: string;
46
+ endDate: string;
47
+ }): Promise<void>;
33
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.1.87",
3
+ "version": "1.1.88",
4
4
  "description": "Sirve como un puente entre diferentes funciones lambda, facilitando la comunicación entre ellas a traves de invocaciones http",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -11,6 +11,23 @@ export class DisputesApi implements IDisputesApi {
11
11
  private readonly baseUrl = process.env.DISPUTES_LAMBDA_URL || "";
12
12
 
13
13
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
14
+ async getListBetweenDates(params: { index?: string; pageSize?: number; startDate: string; endDate: string; }): Promise<void> {
15
+ let queryParams = [];
16
+
17
+ if (!params.index) {
18
+ queryParams.push(`index=${params.index}`);
19
+ }
20
+
21
+ if (!params.pageSize) {
22
+ queryParams.push(`pageSize=${params.pageSize}`);
23
+ }
24
+
25
+ queryParams.push(`startDate=${params.startDate}`);
26
+ queryParams.push(`endDate=${params.endDate}`);
27
+
28
+ const url = `${this.baseUrl}disputes/bdates?${queryParams.join('&')}`;
29
+ return await this.httpRequest.get(url);
30
+ }
14
31
  async addProvisional(params: { disputeId: string; amount: number; date: string; type: "PROV" | "REV_PROV"; }): Promise<void> {
15
32
  const url = `${this.baseUrl}disputes/provisional/add/${params.disputeId}`;
16
33
  return await this.httpRequest.put(url, {amount: params.amount, date: params.date, type: params.type});
@@ -35,4 +35,20 @@ export interface IDisputesApi {
35
35
  type:"PROV"|"REV_PROV"
36
36
  }): Promise<void>;
37
37
 
38
+
39
+ /**
40
+ * Consultar disputas entre fechas.
41
+ * @param index indice de consulta.
42
+ * @param pageSize tamaño de paginación.
43
+ * @param startDate Fecha inicial de consulta.
44
+ * @param endDate Fecha final de consulta
45
+ * @returns Una promesa que resuelve a void.
46
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
47
+ */
48
+ getListBetweenDates(params:{
49
+ index?:string,
50
+ pageSize?:number,
51
+ startDate:string,
52
+ endDate:string
53
+ }): Promise<void>;
38
54
  }