@fiado/api-invoker 5.9.0 → 5.10.0

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,10 +1,14 @@
1
1
  import { IAccountBeneficiaryApi } from "./interfaces/IAccountBeneficiaryApi.js";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
- import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
3
+ import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
4
4
  import { CountryId } from "@fiado/type-kit/bin/country/index.js";
5
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
5
6
  export declare class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
6
7
  private httpRequest;
7
8
  private readonly baseUrl;
8
9
  constructor(httpRequest: IHttpRequest);
9
10
  create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
11
+ getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>>;
12
+ update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>>;
10
13
  }
14
+ export {};
@@ -21,6 +21,14 @@ let AccountBeneficiaryApi = class AccountBeneficiaryApi {
21
21
  const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
22
22
  return await this.httpRequest.post(url, input);
23
23
  }
24
+ async getByDirectoryId(directoryId, countryId) {
25
+ const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
26
+ return await this.httpRequest.get(url);
27
+ }
28
+ async update(directoryId, countryId, input) {
29
+ const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
30
+ return await this.httpRequest.put(url, input);
31
+ }
24
32
  };
25
33
  AccountBeneficiaryApi = __decorate([
26
34
  injectable(),
@@ -1,5 +1,20 @@
1
- import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
1
+ import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
2
2
  import { CountryId } from "@fiado/type-kit/bin/country/index.js";
3
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
4
+ /**
5
+ * API PRIVADA de `beneficiary-business` (M2M, VPC-only). Las tres operaciones viven en la MISMA ruta
6
+ * (`/{countryId}/users/{directoryId}`) y se distinguen por método HTTP.
7
+ */
3
8
  export interface IAccountBeneficiaryApi {
4
9
  create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
10
+ /** Beneficiarios vigentes del directorio. Lista vacía si no tiene ninguno. */
11
+ getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>>;
12
+ /**
13
+ * Reemplaza el conjunto de beneficiarios del directorio.
14
+ *
15
+ * ⚠️ Es un REEMPLAZO, no un alta incremental: se manda SIEMPRE la lista completa que debe quedar.
16
+ * Mandar uno solo deja uno solo.
17
+ */
18
+ update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>>;
5
19
  }
20
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
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
  "type": "module",
6
6
  "main": "bin/index.js",
@@ -1,9 +1,10 @@
1
1
  import { inject, injectable } from "inversify";
2
2
  import { IAccountBeneficiaryApi } from "./interfaces/IAccountBeneficiaryApi.js";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
- import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
4
+ import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
5
5
  import { CountryId } from "@fiado/type-kit/bin/country/index.js";
6
6
 
7
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
7
8
 
8
9
  @injectable()
9
10
  export class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
@@ -16,4 +17,14 @@ export class AccountBeneficiaryApi implements IAccountBeneficiaryApi {
16
17
  const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
17
18
  return await this.httpRequest.post(url, input);
18
19
  }
19
- }
20
+
21
+ async getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>> {
22
+ const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
23
+ return await this.httpRequest.get<FiadoApiResponse<AccountBeneficiaryResponse[]>>(url);
24
+ }
25
+
26
+ async update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>> {
27
+ const url = `${this.baseUrl}${countryId}/users/${directoryId}`;
28
+ return await this.httpRequest.put<FiadoApiResponse<unknown>>(url, input);
29
+ }
30
+ }
@@ -1,8 +1,25 @@
1
- import { AccountBeneficiaryCreateRequest } from "@fiado/type-kit/bin/beneficiary/index.js";
1
+ import { AccountBeneficiaryCreateRequest, AccountBeneficiaryResponse } from "@fiado/type-kit/bin/beneficiary/index.js";
2
2
  import { CountryId } from "@fiado/type-kit/bin/country/index.js";
3
3
 
4
+ type FiadoApiResponse<T> = import("@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse.js").default<T>;
5
+
6
+ /**
7
+ * API PRIVADA de `beneficiary-business` (M2M, VPC-only). Las tres operaciones viven en la MISMA ruta
8
+ * (`/{countryId}/users/{directoryId}`) y se distinguen por método HTTP.
9
+ */
4
10
  export interface IAccountBeneficiaryApi {
5
11
 
6
12
  create(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<void>;
7
13
 
8
- }
14
+ /** Beneficiarios vigentes del directorio. Lista vacía si no tiene ninguno. */
15
+ getByDirectoryId(directoryId: string, countryId: CountryId): Promise<FiadoApiResponse<AccountBeneficiaryResponse[]>>;
16
+
17
+ /**
18
+ * Reemplaza el conjunto de beneficiarios del directorio.
19
+ *
20
+ * ⚠️ Es un REEMPLAZO, no un alta incremental: se manda SIEMPRE la lista completa que debe quedar.
21
+ * Mandar uno solo deja uno solo.
22
+ */
23
+ update(directoryId: string, countryId: CountryId, input: AccountBeneficiaryCreateRequest[]): Promise<FiadoApiResponse<unknown>>;
24
+
25
+ }