@fiado/api-invoker 4.31.0 → 4.33.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.
@@ -3,7 +3,7 @@ import { IHttpRequest } from "@fiado/http-client";
3
3
  import { BenefitPaymentRequest, BenefitPaymentResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
4
4
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
5
5
  import { BenefitLeafDisplayResponse } from "./dtos/BenefitLeafDisplayResponse.js";
6
- import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFundingReferenceRequest, CancelFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
6
+ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
7
7
  export default class BenefitsMarketplaceApi implements IBenefitsMarketplaceApi {
8
8
  private httpRequest;
9
9
  private readonly baseUrl;
@@ -12,6 +12,5 @@ export default class BenefitsMarketplaceApi implements IBenefitsMarketplaceApi {
12
12
  consultPayment(moduleName: string, transactionNumber: string): Promise<ApiGatewayResponse<BenefitPaymentResponse>>;
13
13
  getLeafDisplay(benefitId: string, leafId: string): Promise<ApiGatewayResponse<BenefitLeafDisplayResponse>>;
14
14
  fundingCreate(moduleName: string, request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
15
- fundingCancel(moduleName: string, fundingId: string, request: CancelFundingReferenceRequest): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
16
15
  fundingList(moduleName: string, directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
17
16
  }
@@ -33,10 +33,6 @@ let BenefitsMarketplaceApi = class BenefitsMarketplaceApi {
33
33
  const url = `${this.baseUrl}/funding/${encodeURIComponent(moduleName)}`;
34
34
  return await this.httpRequest.post(url, request);
35
35
  }
36
- async fundingCancel(moduleName, fundingId, request) {
37
- const url = `${this.baseUrl}/funding/${encodeURIComponent(moduleName)}/${encodeURIComponent(fundingId)}/cancel`;
38
- return await this.httpRequest.post(url, request);
39
- }
40
36
  async fundingList(moduleName, directoryId, status) {
41
37
  const params = new URLSearchParams({ directoryId });
42
38
  if (status)
@@ -1,7 +1,7 @@
1
1
  import { BenefitPaymentRequest, BenefitPaymentResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
2
2
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
3
  import { BenefitLeafDisplayResponse } from "../dtos/BenefitLeafDisplayResponse.js";
4
- import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFundingReferenceRequest, CancelFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
4
+ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
5
5
  /**
6
6
  * Cliente único del procesador hacia benefits-marketplace-business (Fase 2).
7
7
  *
@@ -12,6 +12,9 @@ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFu
12
12
  * Endpoint backend: POST /pay/{moduleName} (privado, dentro de la VPC).
13
13
  * El marketplace resuelve `moduleName` a un publisher y reenvía la request
14
14
  * tal cual al conector correspondiente con `BenefitPaymentRequest`.
15
+ *
16
+ * Schema v3 (2026-06-24): método `fundingCancel` eliminado. Las referencias
17
+ * OPEN no se cancelan por regla de negocio.
15
18
  */
16
19
  export interface IBenefitsMarketplaceApi {
17
20
  /**
@@ -63,12 +66,6 @@ export interface IBenefitsMarketplaceApi {
63
66
  * futuros providers (OpenPay, etc.).
64
67
  */
65
68
  fundingCreate(moduleName: string, request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
66
- /**
67
- * Cancela una referencia ACTIVA.
68
- * Backend: POST /funding/{moduleName}/{fundingId}/cancel (privado VPC).
69
- * El marketplace delega al connector que verifica ownership por directoryId.
70
- */
71
- fundingCancel(moduleName: string, fundingId: string, request: CancelFundingReferenceRequest): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
72
69
  /**
73
70
  * Lista las referencias del usuario.
74
71
  * Backend: GET /funding/{moduleName}/references?directoryId=&status=
@@ -20,5 +20,10 @@ export declare class DirectoryApi implements IDirectoryApi {
20
20
  updateUserProfile(directoryId: string, profile: Profile): Promise<void>;
21
21
  updateStatus(directoryId: string, status: Status): Promise<void>;
22
22
  getByPeopleId(peopleId: string): Promise<any>;
23
+ getDirectoryList(params: {
24
+ index?: string;
25
+ pageSize?: number;
26
+ sort?: "ascending" | "descending";
27
+ }): Promise<any>;
23
28
  private normalizeE164Light;
24
29
  }
@@ -132,6 +132,19 @@ let DirectoryApi = class DirectoryApi {
132
132
  const operationName = "getUserInfoByParams";
133
133
  return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
134
134
  }
135
+ async getDirectoryList(params) {
136
+ const queryParams = [];
137
+ if (params.index)
138
+ queryParams.push(`index=${encodeURIComponent(params.index)}`);
139
+ if (params.pageSize)
140
+ queryParams.push(`pageSize=${params.pageSize}`);
141
+ if (params.sort)
142
+ queryParams.push(`sort=${params.sort}`);
143
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
144
+ const url = `${this.baseUrl}${queryString}`;
145
+ const operationName = "getAllDirectories";
146
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
147
+ }
135
148
  // --- Helper ligero para E.164 limpia espacios y garantiza '+'
136
149
  normalizeE164Light(input) {
137
150
  if (!input)
@@ -54,4 +54,14 @@ export interface IDirectoryApi {
54
54
  validateSecretNumber(directoryId: string, secretNumber: string): Promise<void>;
55
55
  deleteDirectory(directoryId: string): Promise<void>;
56
56
  getDirectoriesByPeopleId(peopleIds: string[]): Promise<any>;
57
+ /**
58
+ * Lista todos los directorios de usuario paginados por createDate (desc por defecto).
59
+ * @param params index (cursor de paginación), pageSize, sort opcional.
60
+ * @returns { data: { items: Directory[], index: string | null } }
61
+ */
62
+ getDirectoryList(params: {
63
+ index?: string;
64
+ pageSize?: number;
65
+ sort?: "ascending" | "descending";
66
+ }): Promise<any>;
57
67
  }
@@ -1,14 +1,13 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
3
  import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
4
- import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFundingReferenceRequest, CancelFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
4
+ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
5
5
  import { IEqualityConnectorApi } from "./interfaces/IEqualityConnectorApi.js";
6
6
  export default class EqualityConnectorApi implements IEqualityConnectorApi {
7
7
  private httpRequest;
8
8
  private readonly baseUrl;
9
9
  constructor(httpRequest: IHttpRequest);
10
10
  createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
11
- cancelFundingReference(fundingId: string, request: CancelFundingReferenceRequest): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
12
11
  listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
13
12
  getStandardCatalog(query: {
14
13
  benefitId: string;
@@ -21,10 +21,6 @@ let EqualityConnectorApi = class EqualityConnectorApi {
21
21
  const url = `${this.baseUrl}/funding`;
22
22
  return await this.httpRequest.post(url, request);
23
23
  }
24
- async cancelFundingReference(fundingId, request) {
25
- const url = `${this.baseUrl}/funding/${encodeURIComponent(fundingId)}/cancel`;
26
- return await this.httpRequest.post(url, request);
27
- }
28
24
  async listFundingReferences(directoryId, status) {
29
25
  const params = new URLSearchParams({ directoryId });
30
26
  if (status)
@@ -1,6 +1,6 @@
1
1
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
2
  import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
3
- import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFundingReferenceRequest, CancelFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
3
+ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
4
4
  /**
5
5
  * Cliente del marketplace hacia equality-connector (privado, dentro de la VPC).
6
6
  *
@@ -9,15 +9,16 @@ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, CancelFu
9
9
  *
10
10
  * Endpoints backend en equality-connector:
11
11
  * - POST /funding (privado VPC)
12
- * - POST /funding/{fundingId}/cancel (privado VPC)
13
12
  * - GET /funding/references?directoryId=&status= (privado VPC)
14
13
  * - GET /catalog/standard?benefitId=&includeDisabled= (privado VPC) — patron canonico Centro de Beneficios
14
+ *
15
+ * Schema v3 (2026-06-24): endpoint cancel eliminado. Las referencias OPEN
16
+ * no se cancelan por regla de negocio (no vencen ni se cancelan — se
17
+ * reutilizan indefinidamente).
15
18
  */
16
19
  export interface IEqualityConnectorApi {
17
20
  /** Genera una referencia de fondeo en Passport via el connector. */
18
21
  createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
19
- /** Cancela una referencia ACTIVA. Verifica ownership por `directoryId`. */
20
- cancelFundingReference(fundingId: string, request: CancelFundingReferenceRequest): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
21
22
  /**
22
23
  * Lista las referencias del usuario, opcionalmente filtradas por status.
23
24
  * Status default (cuando no se pasa) lo decide el connector — hoy: ACTIVE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "4.31.0",
3
+ "version": "4.33.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",
@@ -34,7 +34,7 @@
34
34
  "@fiado/gateway-adapter": "^2.0.2",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.105.0",
37
+ "@fiado/type-kit": "^3.115.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -7,8 +7,6 @@ import {BenefitLeafDisplayResponse} from "./dtos/BenefitLeafDisplayResponse.js";
7
7
  import {
8
8
  CreateFundingReferenceRequest,
9
9
  CreateFundingReferenceResponse,
10
- CancelFundingReferenceRequest,
11
- CancelFundingReferenceResponse,
12
10
  ListFundingReferencesResponse,
13
11
  } from "@fiado/type-kit/bin/walletFunding/index.js";
14
12
 
@@ -48,15 +46,6 @@ export default class BenefitsMarketplaceApi implements IBenefitsMarketplaceApi {
48
46
  return await this.httpRequest.post(url, request);
49
47
  }
50
48
 
51
- async fundingCancel(
52
- moduleName: string,
53
- fundingId: string,
54
- request: CancelFundingReferenceRequest,
55
- ): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>> {
56
- const url = `${this.baseUrl}/funding/${encodeURIComponent(moduleName)}/${encodeURIComponent(fundingId)}/cancel`;
57
- return await this.httpRequest.post(url, request);
58
- }
59
-
60
49
  async fundingList(
61
50
  moduleName: string,
62
51
  directoryId: string,
@@ -4,8 +4,6 @@ import {BenefitLeafDisplayResponse} from "../dtos/BenefitLeafDisplayResponse.js"
4
4
  import {
5
5
  CreateFundingReferenceRequest,
6
6
  CreateFundingReferenceResponse,
7
- CancelFundingReferenceRequest,
8
- CancelFundingReferenceResponse,
9
7
  ListFundingReferencesResponse,
10
8
  } from "@fiado/type-kit/bin/walletFunding/index.js";
11
9
 
@@ -19,6 +17,9 @@ import {
19
17
  * Endpoint backend: POST /pay/{moduleName} (privado, dentro de la VPC).
20
18
  * El marketplace resuelve `moduleName` a un publisher y reenvía la request
21
19
  * tal cual al conector correspondiente con `BenefitPaymentRequest`.
20
+ *
21
+ * Schema v3 (2026-06-24): método `fundingCancel` eliminado. Las referencias
22
+ * OPEN no se cancelan por regla de negocio.
22
23
  */
23
24
  export interface IBenefitsMarketplaceApi {
24
25
  /**
@@ -80,17 +81,6 @@ export interface IBenefitsMarketplaceApi {
80
81
  request: CreateFundingReferenceRequest,
81
82
  ): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
82
83
 
83
- /**
84
- * Cancela una referencia ACTIVA.
85
- * Backend: POST /funding/{moduleName}/{fundingId}/cancel (privado VPC).
86
- * El marketplace delega al connector que verifica ownership por directoryId.
87
- */
88
- fundingCancel(
89
- moduleName: string,
90
- fundingId: string,
91
- request: CancelFundingReferenceRequest,
92
- ): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
93
-
94
84
  /**
95
85
  * Lista las referencias del usuario.
96
86
  * Backend: GET /funding/{moduleName}/references?directoryId=&status=
@@ -181,6 +181,20 @@ export class DirectoryApi implements IDirectoryApi {
181
181
  return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
182
182
  }
183
183
 
184
+ public async getDirectoryList(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending" }): Promise<any> {
185
+
186
+ const queryParams: string[] = [];
187
+ if (params.index) queryParams.push(`index=${encodeURIComponent(params.index)}`);
188
+ if (params.pageSize) queryParams.push(`pageSize=${params.pageSize}`);
189
+ if (params.sort) queryParams.push(`sort=${params.sort}`);
190
+ const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
191
+
192
+ const url = `${this.baseUrl}${queryString}`;
193
+ const operationName = "getAllDirectories";
194
+
195
+ return await this.httpRequest.post(`${url}`, null, { 'operationName': operationName });
196
+ }
197
+
184
198
  // --- Helper ligero para E.164 limpia espacios y garantiza '+'
185
199
  private normalizeE164Light(input?: string): string {
186
200
  if (!input) return input as any;
@@ -69,5 +69,12 @@ export interface IDirectoryApi {
69
69
 
70
70
  getDirectoriesByPeopleId(peopleIds: string[]): Promise<any>;
71
71
 
72
+ /**
73
+ * Lista todos los directorios de usuario paginados por createDate (desc por defecto).
74
+ * @param params index (cursor de paginación), pageSize, sort opcional.
75
+ * @returns { data: { items: Directory[], index: string | null } }
76
+ */
77
+ getDirectoryList(params: { index?: string; pageSize?: number; sort?: "ascending" | "descending" }): Promise<any>;
78
+
72
79
 
73
80
  }
@@ -5,8 +5,6 @@ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/inde
5
5
  import {
6
6
  CreateFundingReferenceRequest,
7
7
  CreateFundingReferenceResponse,
8
- CancelFundingReferenceRequest,
9
- CancelFundingReferenceResponse,
10
8
  ListFundingReferencesResponse,
11
9
  } from "@fiado/type-kit/bin/walletFunding/index.js";
12
10
  import { IEqualityConnectorApi } from "./interfaces/IEqualityConnectorApi.js";
@@ -24,14 +22,6 @@ export default class EqualityConnectorApi implements IEqualityConnectorApi {
24
22
  return await this.httpRequest.post(url, request);
25
23
  }
26
24
 
27
- async cancelFundingReference(
28
- fundingId: string,
29
- request: CancelFundingReferenceRequest,
30
- ): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>> {
31
- const url = `${this.baseUrl}/funding/${encodeURIComponent(fundingId)}/cancel`;
32
- return await this.httpRequest.post(url, request);
33
- }
34
-
35
25
  async listFundingReferences(
36
26
  directoryId: string,
37
27
  status?: string,
@@ -3,8 +3,6 @@ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/inde
3
3
  import {
4
4
  CreateFundingReferenceRequest,
5
5
  CreateFundingReferenceResponse,
6
- CancelFundingReferenceRequest,
7
- CancelFundingReferenceResponse,
8
6
  ListFundingReferencesResponse,
9
7
  } from "@fiado/type-kit/bin/walletFunding/index.js";
10
8
 
@@ -16,9 +14,12 @@ import {
16
14
  *
17
15
  * Endpoints backend en equality-connector:
18
16
  * - POST /funding (privado VPC)
19
- * - POST /funding/{fundingId}/cancel (privado VPC)
20
17
  * - GET /funding/references?directoryId=&status= (privado VPC)
21
18
  * - GET /catalog/standard?benefitId=&includeDisabled= (privado VPC) — patron canonico Centro de Beneficios
19
+ *
20
+ * Schema v3 (2026-06-24): endpoint cancel eliminado. Las referencias OPEN
21
+ * no se cancelan por regla de negocio (no vencen ni se cancelan — se
22
+ * reutilizan indefinidamente).
22
23
  */
23
24
  export interface IEqualityConnectorApi {
24
25
  /** Genera una referencia de fondeo en Passport via el connector. */
@@ -26,12 +27,6 @@ export interface IEqualityConnectorApi {
26
27
  request: CreateFundingReferenceRequest,
27
28
  ): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
28
29
 
29
- /** Cancela una referencia ACTIVA. Verifica ownership por `directoryId`. */
30
- cancelFundingReference(
31
- fundingId: string,
32
- request: CancelFundingReferenceRequest,
33
- ): Promise<ApiGatewayResponse<CancelFundingReferenceResponse>>;
34
-
35
30
  /**
36
31
  * Lista las referencias del usuario, opcionalmente filtradas por status.
37
32
  * Status default (cuando no se pasa) lo decide el connector — hoy: ACTIVE.