@fiado/api-invoker 3.0.48 → 3.2.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,13 +1,19 @@
1
1
  import { IHttpRequest } from "@fiado/http-client";
2
2
  import { ICreditEngineApi } from "./interfaces/ICreditEngineApi";
3
3
  import { CreditProfileResponse } from "@fiado/type-kit/bin/credit/dtos/internal/CreditProfileResponse";
4
- import { LienStatusResponse } from "@fiado/type-kit/bin/credit/dtos/internal/LienStatusResponse";
4
+ import { CreditDetailResponse } from "@fiado/type-kit/bin/creditEngine";
5
+ /**
6
+ * Cliente concreto para los endpoints privados del `credit-engine-business` Lambda.
7
+ * Todos los endpoints son GET. Base URL viene de `CREDIT_ENGINE_LAMBDA_URL`.
8
+ */
5
9
  export declare class CreditEngineApi implements ICreditEngineApi {
6
10
  private httpRequest;
7
11
  private readonly baseUrl;
8
12
  constructor(httpRequest: IHttpRequest);
9
- getCreditProfile(directoryId: string): Promise<CreditProfileResponse>;
10
- getActiveCredit(directoryId: string): Promise<any>;
11
- getLienStatus(directoryId: string): Promise<LienStatusResponse>;
12
- applyLien(directoryId: string, creditId: string, active: boolean, percentage?: number, maxAmount?: number): Promise<any>;
13
+ healthcheck(): Promise<{
14
+ status: string;
15
+ service: string;
16
+ }>;
17
+ getCreditProfile(directoryId: string, partnerId: string): Promise<CreditProfileResponse>;
18
+ getActiveCredit(directoryId: string): Promise<CreditDetailResponse | null>;
13
19
  }
@@ -19,31 +19,26 @@ exports.CreditEngineApi = void 0;
19
19
  const dotenv_1 = __importDefault(require("dotenv"));
20
20
  const inversify_1 = require("inversify");
21
21
  dotenv_1.default.config();
22
+ /**
23
+ * Cliente concreto para los endpoints privados del `credit-engine-business` Lambda.
24
+ * Todos los endpoints son GET. Base URL viene de `CREDIT_ENGINE_LAMBDA_URL`.
25
+ */
22
26
  let CreditEngineApi = class CreditEngineApi {
23
27
  constructor(httpRequest) {
24
28
  this.httpRequest = httpRequest;
25
29
  this.baseUrl = process.env.CREDIT_ENGINE_LAMBDA_URL || "";
26
30
  }
27
- async getCreditProfile(directoryId) {
31
+ async healthcheck() {
32
+ const url = `${this.baseUrl}healthcheck`;
33
+ return await this.httpRequest.get(url, undefined, { operationName: "healthcheck" });
34
+ }
35
+ async getCreditProfile(directoryId, partnerId) {
28
36
  const url = `${this.baseUrl}credit/profile/${directoryId}`;
29
- const operationName = "getCreditProfile";
30
- return await this.httpRequest.post(url, null, { 'operationName': operationName });
37
+ return await this.httpRequest.get(url, { partnerId }, { operationName: "getCreditProfile" });
31
38
  }
32
39
  async getActiveCredit(directoryId) {
33
40
  const url = `${this.baseUrl}credit/active/${directoryId}`;
34
- const operationName = "getActiveCredit";
35
- return await this.httpRequest.post(url, null, { 'operationName': operationName });
36
- }
37
- async getLienStatus(directoryId) {
38
- const url = `${this.baseUrl}credit/lien/${directoryId}`;
39
- const operationName = "getLienStatus";
40
- return await this.httpRequest.post(url, null, { 'operationName': operationName });
41
- }
42
- async applyLien(directoryId, creditId, active, percentage, maxAmount) {
43
- const url = `${this.baseUrl}credit/lien/apply`;
44
- const operationName = "applyLien";
45
- const body = { directoryId, creditId, active, percentage, maxAmount };
46
- return await this.httpRequest.post(url, body, { 'operationName': operationName });
41
+ return await this.httpRequest.get(url, undefined, { operationName: "getActiveCredit" });
47
42
  }
48
43
  };
49
44
  exports.CreditEngineApi = CreditEngineApi;
@@ -1,28 +1,33 @@
1
1
  import { CreditProfileResponse } from "@fiado/type-kit/bin/credit/dtos/internal/CreditProfileResponse";
2
- import { LienStatusResponse } from "@fiado/type-kit/bin/credit/dtos/internal/LienStatusResponse";
2
+ import { CreditDetailResponse } from "@fiado/type-kit/bin/creditEngine";
3
+ /**
4
+ * Cliente para invocar los endpoints privados del lambda `credit-engine-business`.
5
+ *
6
+ * Los endpoints viven bajo `CREDIT_ENGINE_LAMBDA_URL` (API Gateway privado / VPC).
7
+ */
3
8
  export interface ICreditEngineApi {
4
9
  /**
5
- * Obtiene el perfil crediticio de un usuario.
6
- * @param directoryId ID del directorio del usuario.
7
- */
8
- getCreditProfile(directoryId: string): Promise<CreditProfileResponse>;
9
- /**
10
- * Obtiene el crédito activo de un usuario.
11
- * @param directoryId ID del directorio del usuario.
10
+ * Healthcheck del lambda. Devuelve `{ status: "OK", service: "credit-engine-business" }`.
11
+ * Útil para validar conectividad inter-service.
12
12
  */
13
- getActiveCredit(directoryId: string): Promise<any>;
13
+ healthcheck(): Promise<{
14
+ status: string;
15
+ service: string;
16
+ }>;
14
17
  /**
15
- * Obtiene el estado del lien (cobro latente) de un usuario.
18
+ * Obtiene el perfil financiero del directorio para un partner específico.
19
+ * Endpoint: `GET /credit/profile/{directoryId}?partnerId={partnerId}`
20
+ *
16
21
  * @param directoryId ID del directorio del usuario.
22
+ * @param partnerId ID del partner (tenant) del perfil a consultar.
17
23
  */
18
- getLienStatus(directoryId: string): Promise<LienStatusResponse>;
24
+ getCreditProfile(directoryId: string, partnerId: string): Promise<CreditProfileResponse>;
19
25
  /**
20
- * Aplica o modifica la configuración de lien para un crédito.
26
+ * Obtiene el crédito activo del cliente, si existe.
27
+ * Endpoint: `GET /credit/active/{directoryId}`
28
+ *
21
29
  * @param directoryId ID del directorio del usuario.
22
- * @param creditId ID del crédito.
23
- * @param active Activar o desactivar.
24
- * @param percentage Porcentaje del depósito a retener.
25
- * @param maxAmount Monto máximo por retención.
30
+ * @returns Detalle del crédito activo, o `null` si no hay crédito activo.
26
31
  */
27
- applyLien(directoryId: string, creditId: string, active: boolean, percentage?: number, maxAmount?: number): Promise<any>;
32
+ getActiveCredit(directoryId: string): Promise<CreditDetailResponse | null>;
28
33
  }
@@ -1,6 +1,7 @@
1
1
  import { IMulticommServicePaymentApi } from "./interfaces/IMulticommServicePaymentApi";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
3
  import { GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest } from "@fiado/type-kit/bin/servicePayment";
4
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter";
4
5
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
5
6
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
6
7
  export default class MulticommServicePaymentApi implements IMulticommServicePaymentApi {
@@ -24,4 +25,8 @@ export default class MulticommServicePaymentApi implements IMulticommServicePaym
24
25
  serviceId: string;
25
26
  }): Promise<ApiGatewayResponse<any>>;
26
27
  getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
28
+ getStandardCatalog(params?: {
29
+ benefitId?: string;
30
+ includeDisabled?: boolean;
31
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
27
32
  }
@@ -60,6 +60,18 @@ let MulticommServicePaymentApi = class MulticommServicePaymentApi {
60
60
  url += `?${query}`;
61
61
  return await this.httpRequest.get(url);
62
62
  }
63
+ async getStandardCatalog(params) {
64
+ let url = `${this.baseUrl}/catalog/standard`;
65
+ if (params) {
66
+ const query = Object.keys(params)
67
+ .filter(key => params[key] !== undefined)
68
+ .map(key => `${key}=${encodeURIComponent(String(params[key]))}`)
69
+ .join('&');
70
+ if (query)
71
+ url += `?${query}`;
72
+ }
73
+ return await this.httpRequest.get(url);
74
+ }
63
75
  };
64
76
  MulticommServicePaymentApi = __decorate([
65
77
  (0, inversify_1.injectable)(),
@@ -1,4 +1,5 @@
1
1
  import { GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest } from "@fiado/type-kit/bin/servicePayment";
2
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter";
2
3
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
5
  export interface IMulticommServicePaymentApi {
@@ -19,4 +20,8 @@ export interface IMulticommServicePaymentApi {
19
20
  serviceId: string;
20
21
  }): Promise<ApiGatewayResponse<any>>;
21
22
  getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
23
+ getStandardCatalog(params?: {
24
+ benefitId?: string;
25
+ includeDisabled?: boolean;
26
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
22
27
  }
@@ -1,6 +1,7 @@
1
1
  import { IStpServicePaymentApi } from "./interfaces/IStpServicePaymentApi";
2
2
  import { IHttpRequest } from "@fiado/http-client";
3
3
  import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse } from "@fiado/type-kit/bin/servicePayment";
4
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter";
4
5
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
5
6
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
6
7
  export default class StpServicePaymentApi implements IStpServicePaymentApi {
@@ -20,4 +21,8 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
20
21
  getCatalog(params: GetCatalogParams): Promise<ApiGatewayResponse<any>>;
21
22
  verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
22
23
  getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
24
+ getStandardCatalog(params?: {
25
+ benefitId?: string;
26
+ includeDisabled?: boolean;
27
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
23
28
  }
@@ -60,6 +60,18 @@ let StpServicePaymentApi = class StpServicePaymentApi {
60
60
  url += `?${query}`;
61
61
  return await this.httpRequest.get(url);
62
62
  }
63
+ async getStandardCatalog(params) {
64
+ let url = `${this.baseUrl}/catalog/standard`;
65
+ if (params) {
66
+ const query = Object.keys(params)
67
+ .filter(key => params[key] !== undefined)
68
+ .map(key => `${key}=${encodeURIComponent(String(params[key]))}`)
69
+ .join('&');
70
+ if (query)
71
+ url += `?${query}`;
72
+ }
73
+ return await this.httpRequest.get(url);
74
+ }
63
75
  };
64
76
  StpServicePaymentApi = __decorate([
65
77
  (0, inversify_1.injectable)(),
@@ -1,4 +1,5 @@
1
1
  import { GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse } from "@fiado/type-kit/bin/servicePayment";
2
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter";
2
3
  import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
5
  export interface IStpServicePaymentApi {
@@ -15,4 +16,8 @@ export interface IStpServicePaymentApi {
15
16
  }): Promise<ApiGatewayResponse<any>>;
16
17
  verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
17
18
  getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
19
+ getStandardCatalog(params?: {
20
+ benefitId?: string;
21
+ includeDisabled?: boolean;
22
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
18
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "3.0.48",
3
+ "version": "3.2.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
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -16,7 +16,7 @@
16
16
  "@fiado/gateway-adapter": "^1.1.50",
17
17
  "@fiado/http-client": "^1.0.7",
18
18
  "@fiado/logger": "^1.0.3",
19
- "@fiado/type-kit": "^3.1.15",
19
+ "@fiado/type-kit": "^3.2.0",
20
20
  "dotenv": "^16.4.7",
21
21
  "i": "^0.3.7",
22
22
  "inversify": "^6.2.2",
@@ -3,9 +3,13 @@ import { inject, injectable } from "inversify";
3
3
  import { IHttpRequest } from "@fiado/http-client";
4
4
  import { ICreditEngineApi } from "./interfaces/ICreditEngineApi";
5
5
  import { CreditProfileResponse } from "@fiado/type-kit/bin/credit/dtos/internal/CreditProfileResponse";
6
- import { LienStatusResponse } from "@fiado/type-kit/bin/credit/dtos/internal/LienStatusResponse";
6
+ import { CreditDetailResponse } from "@fiado/type-kit/bin/creditEngine";
7
7
  dotenv.config();
8
8
 
9
+ /**
10
+ * Cliente concreto para los endpoints privados del `credit-engine-business` Lambda.
11
+ * Todos los endpoints son GET. Base URL viene de `CREDIT_ENGINE_LAMBDA_URL`.
12
+ */
9
13
  @injectable()
10
14
  export class CreditEngineApi implements ICreditEngineApi {
11
15
 
@@ -13,28 +17,26 @@ export class CreditEngineApi implements ICreditEngineApi {
13
17
 
14
18
  constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
15
19
 
16
- public async getCreditProfile(directoryId: string): Promise<CreditProfileResponse> {
17
- const url = `${this.baseUrl}credit/profile/${directoryId}`;
18
- const operationName = "getCreditProfile";
19
- return await this.httpRequest.post(url, null, { 'operationName': operationName });
20
- }
21
-
22
- public async getActiveCredit(directoryId: string): Promise<any> {
23
- const url = `${this.baseUrl}credit/active/${directoryId}`;
24
- const operationName = "getActiveCredit";
25
- return await this.httpRequest.post(url, null, { 'operationName': operationName });
20
+ public async healthcheck(): Promise<{ status: string; service: string }> {
21
+ const url = `${this.baseUrl}healthcheck`;
22
+ return await this.httpRequest.get(url, undefined, { operationName: "healthcheck" });
26
23
  }
27
24
 
28
- public async getLienStatus(directoryId: string): Promise<LienStatusResponse> {
29
- const url = `${this.baseUrl}credit/lien/${directoryId}`;
30
- const operationName = "getLienStatus";
31
- return await this.httpRequest.post(url, null, { 'operationName': operationName });
25
+ public async getCreditProfile(directoryId: string, partnerId: string): Promise<CreditProfileResponse> {
26
+ const url = `${this.baseUrl}credit/profile/${directoryId}`;
27
+ return await this.httpRequest.get(
28
+ url,
29
+ { partnerId },
30
+ { operationName: "getCreditProfile" },
31
+ );
32
32
  }
33
33
 
34
- public async applyLien(directoryId: string, creditId: string, active: boolean, percentage?: number, maxAmount?: number): Promise<any> {
35
- const url = `${this.baseUrl}credit/lien/apply`;
36
- const operationName = "applyLien";
37
- const body = { directoryId, creditId, active, percentage, maxAmount };
38
- return await this.httpRequest.post(url, body, { 'operationName': operationName });
34
+ public async getActiveCredit(directoryId: string): Promise<CreditDetailResponse | null> {
35
+ const url = `${this.baseUrl}credit/active/${directoryId}`;
36
+ return await this.httpRequest.get(
37
+ url,
38
+ undefined,
39
+ { operationName: "getActiveCredit" },
40
+ );
39
41
  }
40
42
  }
@@ -1,33 +1,34 @@
1
1
  import { CreditProfileResponse } from "@fiado/type-kit/bin/credit/dtos/internal/CreditProfileResponse";
2
- import { CreditBalanceResponse } from "@fiado/type-kit/bin/credit/dtos/internal/CreditBalanceResponse";
3
- import { LienStatusResponse } from "@fiado/type-kit/bin/credit/dtos/internal/LienStatusResponse";
2
+ import { CreditDetailResponse } from "@fiado/type-kit/bin/creditEngine";
4
3
 
4
+ /**
5
+ * Cliente para invocar los endpoints privados del lambda `credit-engine-business`.
6
+ *
7
+ * Los endpoints viven bajo `CREDIT_ENGINE_LAMBDA_URL` (API Gateway privado / VPC).
8
+ */
5
9
  export interface ICreditEngineApi {
6
- /**
7
- * Obtiene el perfil crediticio de un usuario.
8
- * @param directoryId ID del directorio del usuario.
9
- */
10
- getCreditProfile(directoryId: string): Promise<CreditProfileResponse>;
11
10
 
12
11
  /**
13
- * Obtiene el crédito activo de un usuario.
14
- * @param directoryId ID del directorio del usuario.
12
+ * Healthcheck del lambda. Devuelve `{ status: "OK", service: "credit-engine-business" }`.
13
+ * Útil para validar conectividad inter-service.
15
14
  */
16
- getActiveCredit(directoryId: string): Promise<any>;
15
+ healthcheck(): Promise<{ status: string; service: string }>;
17
16
 
18
17
  /**
19
- * Obtiene el estado del lien (cobro latente) de un usuario.
18
+ * Obtiene el perfil financiero del directorio para un partner específico.
19
+ * Endpoint: `GET /credit/profile/{directoryId}?partnerId={partnerId}`
20
+ *
20
21
  * @param directoryId ID del directorio del usuario.
22
+ * @param partnerId ID del partner (tenant) del perfil a consultar.
21
23
  */
22
- getLienStatus(directoryId: string): Promise<LienStatusResponse>;
24
+ getCreditProfile(directoryId: string, partnerId: string): Promise<CreditProfileResponse>;
23
25
 
24
26
  /**
25
- * Aplica o modifica la configuración de lien para un crédito.
27
+ * Obtiene el crédito activo del cliente, si existe.
28
+ * Endpoint: `GET /credit/active/{directoryId}`
29
+ *
26
30
  * @param directoryId ID del directorio del usuario.
27
- * @param creditId ID del crédito.
28
- * @param active Activar o desactivar.
29
- * @param percentage Porcentaje del depósito a retener.
30
- * @param maxAmount Monto máximo por retención.
31
+ * @returns Detalle del crédito activo, o `null` si no hay crédito activo.
31
32
  */
32
- applyLien(directoryId: string, creditId: string, active: boolean, percentage?: number, maxAmount?: number): Promise<any>;
33
+ getActiveCredit(directoryId: string): Promise<CreditDetailResponse | null>;
33
34
  }
@@ -2,6 +2,7 @@ import {IMulticommServicePaymentApi} from "./interfaces/IMulticommServicePayment
2
2
  import {inject, injectable} from "inversify";
3
3
  import {IHttpRequest} from "@fiado/http-client";
4
4
  import {GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
5
+ import {ConnectorCatalogResponse} from "@fiado/type-kit/bin/benefitCenter";
5
6
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
6
7
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
7
8
 
@@ -59,4 +60,16 @@ export default class MulticommServicePaymentApi implements IMulticommServicePaym
59
60
  if (query) url += `?${query}`;
60
61
  return await this.httpRequest.get(url);
61
62
  }
63
+
64
+ async getStandardCatalog(params?: { benefitId?: string; includeDisabled?: boolean }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>> {
65
+ let url = `${this.baseUrl}/catalog/standard`;
66
+ if (params) {
67
+ const query = Object.keys(params)
68
+ .filter(key => params[key as keyof typeof params] !== undefined)
69
+ .map(key => `${key}=${encodeURIComponent(String(params[key as keyof typeof params]))}`)
70
+ .join('&');
71
+ if (query) url += `?${query}`;
72
+ }
73
+ return await this.httpRequest.get(url);
74
+ }
62
75
  }
@@ -1,4 +1,5 @@
1
1
  import {GetCatalogParams, GetFavoritesParams, GetFavoritesResponse, ServicePaymentRequest} from "@fiado/type-kit/bin/servicePayment";
2
+ import {ConnectorCatalogResponse} from "@fiado/type-kit/bin/benefitCenter";
2
3
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
5
 
@@ -18,4 +19,8 @@ export interface IMulticommServicePaymentApi {
18
19
  consultTransaction(params: {transactionNumber: string, date: string, serviceId: string}): Promise<ApiGatewayResponse<any>>;
19
20
 
20
21
  getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
22
+
23
+ // Agregado en v3.1.0 — consume GET /catalog/standard del conector.
24
+ // Consumido por CatalogTreeBuilder en benefits-marketplace-business.
25
+ getStandardCatalog(params?: { benefitId?: string; includeDisabled?: boolean }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
21
26
  }
@@ -2,6 +2,7 @@ import {IStpServicePaymentApi} from "./interfaces/IStpServicePaymentApi";
2
2
  import {inject, injectable} from "inversify";
3
3
  import {IHttpRequest} from "@fiado/http-client";
4
4
  import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse} from "@fiado/type-kit/bin/servicePayment";
5
+ import {ConnectorCatalogResponse} from "@fiado/type-kit/bin/benefitCenter";
5
6
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
6
7
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
7
8
 
@@ -59,4 +60,16 @@ export default class StpServicePaymentApi implements IStpServicePaymentApi {
59
60
  if (query) url += `?${query}`;
60
61
  return await this.httpRequest.get(url);
61
62
  }
63
+
64
+ async getStandardCatalog(params?: { benefitId?: string; includeDisabled?: boolean }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>> {
65
+ let url = `${this.baseUrl}/catalog/standard`;
66
+ if (params) {
67
+ const query = Object.keys(params)
68
+ .filter(key => params[key as keyof typeof params] !== undefined)
69
+ .map(key => `${key}=${encodeURIComponent(String(params[key as keyof typeof params]))}`)
70
+ .join('&');
71
+ if (query) url += `?${query}`;
72
+ }
73
+ return await this.httpRequest.get(url);
74
+ }
62
75
  }
@@ -1,4 +1,5 @@
1
1
  import {GetCatalogParams, ServicePaymentRequest, ReferenceVerificationRequest, ReferenceVerificationResponse, GetFavoritesParams, GetFavoritesResponse} from "@fiado/type-kit/bin/servicePayment";
2
+ import {ConnectorCatalogResponse} from "@fiado/type-kit/bin/benefitCenter";
2
3
  import {ApiGatewayResponse} from "@fiado/gateway-adapter";
3
4
  import FiadoApiResponse from "@fiado/type-kit/bin/apiResponse/dtos/FiadoApiResponse";
4
5
 
@@ -17,5 +18,9 @@ export interface IStpServicePaymentApi {
17
18
 
18
19
  verificateReference(request: ReferenceVerificationRequest): Promise<ApiGatewayResponse<ReferenceVerificationResponse>>;
19
20
 
20
- getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>
21
+ getTransactions(params: GetFavoritesParams): Promise<FiadoApiResponse<GetFavoritesResponse>>;
22
+
23
+ // Agregado en v3.1.0 — consume GET /catalog/standard del conector.
24
+ // Consumido por CatalogTreeBuilder en benefits-marketplace-business.
25
+ getStandardCatalog(params?: { benefitId?: string; includeDisabled?: boolean }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
21
26
  }