@fiado/api-invoker 1.5.14 → 1.5.17

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,6 +1,7 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
3
3
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
+ import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
4
5
  export declare class ReferralBusinessApi implements IReferralBusinessApi {
5
6
  private httpRequest;
6
7
  private readonly baseUrl;
@@ -13,4 +14,5 @@ export declare class ReferralBusinessApi implements IReferralBusinessApi {
13
14
  groupId?: string;
14
15
  }): Promise<FiadoApiResponse<any>>;
15
16
  getByDirectoryId(directoryId: string): Promise<FiadoApiResponse<any>>;
17
+ accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<any>>;
16
18
  }
@@ -32,6 +32,10 @@ let ReferralBusinessApi = class ReferralBusinessApi {
32
32
  const url = `${this.baseUrl}private/agents/directoryId/${directoryId}`;
33
33
  return await this.httpRequest.get(url);
34
34
  }
35
+ async accountOpeningsBySponsor(newDirectoryId, scope) {
36
+ const url = `${this.baseUrl}private/account-openings-by-sponsor/${newDirectoryId}`;
37
+ return await this.httpRequest.post(url, { directoryId: newDirectoryId, scope });
38
+ }
35
39
  };
36
40
  exports.ReferralBusinessApi = ReferralBusinessApi;
37
41
  exports.ReferralBusinessApi = ReferralBusinessApi = __decorate([
@@ -1,4 +1,5 @@
1
1
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
2
+ import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
2
3
  /**
3
4
  * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
4
5
  */
@@ -21,4 +22,10 @@ export interface IReferralBusinessApi {
21
22
  category?: string;
22
23
  groupId?: string;
23
24
  }): Promise<FiadoApiResponse<any>>;
25
+ /**
26
+ * Registra aperturas de cuenta por patrocinador.
27
+ * @param newDirectoryId ID del nuevo directorio.
28
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
29
+ */
30
+ accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<void>>;
24
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "1.5.14",
3
+ "version": "1.5.17",
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",
@@ -3,6 +3,7 @@ import { IHttpRequest } from "@fiado/http-client";
3
3
  import dotenv from 'dotenv';
4
4
  import { IReferralBusinessApi } from "./interfaces/IReferralBusinessApi";
5
5
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
6
+ import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
6
7
 
7
8
  dotenv.config();
8
9
 
@@ -12,7 +13,7 @@ export class ReferralBusinessApi implements IReferralBusinessApi {
12
13
  private readonly baseUrl = process.env.REFERRAL_BUSINESS_LAMBDA_URL || "";
13
14
 
14
15
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
15
-
16
+
16
17
  async createAgent(params: { directoryId: string; notes?: string; type?: string; category?: string; groupId?: string; }): Promise<FiadoApiResponse<any>> {
17
18
  const url = `${this.baseUrl}private/agents`;
18
19
  return await this.httpRequest.post(url, params);
@@ -22,4 +23,11 @@ export class ReferralBusinessApi implements IReferralBusinessApi {
22
23
  const url = `${this.baseUrl}private/agents/directoryId/${directoryId}`;
23
24
  return await this.httpRequest.get(url);
24
25
  }
26
+
27
+ async accountOpeningsBySponsor(newDirectoryId: string, scope: Scope): Promise<FiadoApiResponse<any>> {
28
+
29
+ const url = `${this.baseUrl}private/account-openings-by-sponsor/${newDirectoryId}`;
30
+
31
+ return await this.httpRequest.post(url, { directoryId: newDirectoryId, scope });
32
+ }
25
33
  }
@@ -1,4 +1,5 @@
1
1
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
2
+ import { Scope } from "@fiado/type-kit/bin/directory/enums/Scope";
2
3
 
3
4
  /**
4
5
  * Interfaz para el servicio Payroll que permite operaciones sobre payroll.
@@ -19,4 +20,11 @@ export interface IReferralBusinessApi {
19
20
  * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
20
21
  */
21
22
  createAgent(params:{directoryId: string; notes?: string; type?: string; category?: string; groupId?: string}): Promise<FiadoApiResponse<any>>;
23
+
24
+ /**
25
+ * Registra aperturas de cuenta por patrocinador.
26
+ * @param newDirectoryId ID del nuevo directorio.
27
+ * @throws {Error} Lanza un error si los parámetros de entrada son inválidos.
28
+ */
29
+ accountOpeningsBySponsor(newDirectoryId: string, scope:Scope): Promise<FiadoApiResponse<void>>;
22
30
  }