@fiado/api-invoker 4.60.0 → 4.61.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.
@@ -106,6 +106,8 @@ import MessagesBusinessPublisher from "./messages-business/queue/MessagesBusines
106
106
  import { TotpSecurityApi } from "./totp-security/index.js";
107
107
  // Equality connector — wallet-funding HTTP client (benefits-marketplace → equality-connector)
108
108
  import { EqualityConnectorApi } from "./equality-connector/index.js";
109
+ // SynergyPay connector — wallet-funding HTTP client (benefits-marketplace → synergypay-connector)
110
+ import { SynergyPayConnectorApi } from "./synergypay-connector/index.js";
109
111
  // Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
110
112
  import { ContactsBusinessApi } from "./contacts-business/index.js";
111
113
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
@@ -233,6 +235,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
233
235
  bind("ITotpSecurityApi").to(TotpSecurityApi);
234
236
  // Equality connector — wallet-funding (benefits-marketplace → equality-connector)
235
237
  bind("IEqualityConnectorApi").to(EqualityConnectorApi);
238
+ // SynergyPay connector — wallet-funding (benefits-marketplace → synergypay-connector)
239
+ bind("ISynergyPayConnectorApi").to(SynergyPayConnectorApi);
236
240
  // Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
237
241
  bind("IContactsBusinessApi").to(ContactsBusinessApi);
238
242
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in
package/bin/index.d.ts CHANGED
@@ -79,6 +79,7 @@ export * from "./platformRbac/index.js";
79
79
  export * from "./messages-business/index.js";
80
80
  export * from "./totp-security/index.js";
81
81
  export * from "./equality-connector/index.js";
82
+ export * from "./synergypay-connector/index.js";
82
83
  export * from "./contacts-business/index.js";
83
84
  export * from "./uniteller-connector/index.js";
84
85
  export * from "./walletFundingSettlement/index.js";
package/bin/index.js CHANGED
@@ -79,6 +79,7 @@ export * from "./platformRbac/index.js";
79
79
  export * from "./messages-business/index.js";
80
80
  export * from "./totp-security/index.js";
81
81
  export * from "./equality-connector/index.js";
82
+ export * from "./synergypay-connector/index.js";
82
83
  export * from "./contacts-business/index.js";
83
84
  export * from "./uniteller-connector/index.js";
84
85
  export * from "./walletFundingSettlement/index.js";
@@ -0,0 +1,17 @@
1
+ import { IHttpRequest } from "@fiado/http-client";
2
+ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
3
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
4
+ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse, ApplyWalletFundingRequest, ApplyWalletFundingResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
5
+ import { ISynergyPayConnectorApi } from "./interfaces/ISynergyPayConnectorApi.js";
6
+ export default class SynergyPayConnectorApi implements ISynergyPayConnectorApi {
7
+ private httpRequest;
8
+ private readonly baseUrl;
9
+ constructor(httpRequest: IHttpRequest);
10
+ createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
11
+ listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
12
+ getStandardCatalog(query: {
13
+ benefitId: string;
14
+ includeDisabled?: boolean;
15
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
16
+ applyFunding(request: ApplyWalletFundingRequest): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
17
+ }
@@ -0,0 +1,48 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
12
+ };
13
+ import { inject, injectable } from "inversify";
14
+ let SynergyPayConnectorApi = class SynergyPayConnectorApi {
15
+ httpRequest;
16
+ baseUrl = process.env.SYNERGYPAY_CONNECTOR_LAMBDA_URL || "";
17
+ constructor(httpRequest) {
18
+ this.httpRequest = httpRequest;
19
+ }
20
+ async createFundingReference(request) {
21
+ const url = `${this.baseUrl}/funding`;
22
+ return await this.httpRequest.post(url, request);
23
+ }
24
+ async listFundingReferences(directoryId, status) {
25
+ const params = new URLSearchParams({ directoryId });
26
+ if (status)
27
+ params.set("status", status);
28
+ const url = `${this.baseUrl}/funding/references?${params.toString()}`;
29
+ return await this.httpRequest.get(url);
30
+ }
31
+ async getStandardCatalog(query) {
32
+ const params = new URLSearchParams({ benefitId: query.benefitId });
33
+ if (query.includeDisabled)
34
+ params.set("includeDisabled", "true");
35
+ const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
36
+ return await this.httpRequest.get(url);
37
+ }
38
+ async applyFunding(request) {
39
+ const url = `${this.baseUrl}/funding/apply`;
40
+ return await this.httpRequest.post(url, request);
41
+ }
42
+ };
43
+ SynergyPayConnectorApi = __decorate([
44
+ injectable(),
45
+ __param(0, inject("IHttpRequest")),
46
+ __metadata("design:paramtypes", [Object])
47
+ ], SynergyPayConnectorApi);
48
+ export default SynergyPayConnectorApi;
@@ -0,0 +1,45 @@
1
+ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
3
+ import { CreateFundingReferenceRequest, CreateFundingReferenceResponse, ListFundingReferencesResponse, ApplyWalletFundingRequest, ApplyWalletFundingResponse } from "@fiado/type-kit/bin/walletFunding/index.js";
4
+ /**
5
+ * Cliente del marketplace hacia synergypay-connector (privado, dentro de la VPC).
6
+ *
7
+ * Segundo proveedor de Cash In (SinergyPay). Lo consume `SynergyPayFundingPublisher`
8
+ * + `SynergyPayCatalogPublisher` del benefits-marketplace-business. Mismo contrato
9
+ * provider-agnostic que `IEqualityConnectorApi` — el marketplace no sabe con qué
10
+ * proveedor habla.
11
+ *
12
+ * Endpoints backend en synergypay-connector (privado VPC):
13
+ * - POST /funding
14
+ * - GET /funding/references?directoryId=&status=
15
+ * - GET /catalog/standard?benefitId=&includeDisabled=
16
+ * - POST /funding/apply
17
+ *
18
+ * NOTA: los endpoints `/passport/*` del BackOffice (SPEC 1.3) NO están incluidos —
19
+ * el synergypay-connector aún no los expone (F6.1 construyó solo el money-path).
20
+ * Se agregan en F6.4 junto con `SynergyPayPassportBackofficePublisher`.
21
+ */
22
+ export interface ISynergyPayConnectorApi {
23
+ /** Genera una referencia de fondeo en SinergyPay via el connector. */
24
+ createFundingReference(request: CreateFundingReferenceRequest): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
25
+ /**
26
+ * Lista las referencias del usuario, opcionalmente filtradas por status.
27
+ * Status default (cuando no se pasa) lo decide el connector.
28
+ */
29
+ listFundingReferences(directoryId: string, status?: string): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
30
+ /**
31
+ * Devuelve el catalogo standard de productos de wallet-funding del connector.
32
+ * Patron canonico del Centro de Beneficios — el marketplace lo consume via
33
+ * `IConnectorCatalogPublisher.getStandardCatalog` (mismo flow que Equality).
34
+ */
35
+ getStandardCatalog(query: {
36
+ benefitId: string;
37
+ includeDisabled?: boolean;
38
+ }): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
39
+ /**
40
+ * Aplica el resultado de la conciliación de un pago (POST /funding/apply).
41
+ * En SinergyPay el crédito se hace inline en el webhook firmado; este endpoint
42
+ * queda para el cierre SETTLED (conciliación bancaria) — mismo contrato canónico.
43
+ */
44
+ applyFunding(request: ApplyWalletFundingRequest): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
45
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api/interfaces/ISynergyPayConnectorApi.js";
2
+ export { default as SynergyPayConnectorApi } from "./api/SynergyPayConnectorApi.js";
@@ -0,0 +1,2 @@
1
+ export * from "./api/interfaces/ISynergyPayConnectorApi.js";
2
+ export { default as SynergyPayConnectorApi } from "./api/SynergyPayConnectorApi.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/api-invoker",
3
- "version": "4.60.0",
3
+ "version": "4.61.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": "^3.9.0",
35
35
  "@fiado/http-client": "^2.0.1",
36
36
  "@fiado/logger": "^1.1.3",
37
- "@fiado/type-kit": "^3.177.0",
37
+ "@fiado/type-kit": "^3.178.0",
38
38
  "dotenv": "^16.4.7"
39
39
  },
40
40
  "peerDependencies": {
@@ -165,6 +165,8 @@ import { IMessagesBusinessPublisher } from "./messages-business/queue/interfaces
165
165
  import { ITotpSecurityApi, TotpSecurityApi } from "./totp-security/index.js";
166
166
  // Equality connector — wallet-funding HTTP client (benefits-marketplace → equality-connector)
167
167
  import { IEqualityConnectorApi, EqualityConnectorApi } from "./equality-connector/index.js";
168
+ // SynergyPay connector — wallet-funding HTTP client (benefits-marketplace → synergypay-connector)
169
+ import { ISynergyPayConnectorApi, SynergyPayConnectorApi } from "./synergypay-connector/index.js";
168
170
  // Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
169
171
  import { IContactsBusinessApi, ContactsBusinessApi } from "./contacts-business/index.js";
170
172
  // Wallet funding settlement — TransactWriteItems atómico del money path cash-in (spec 15)
@@ -308,6 +310,8 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
308
310
 
309
311
  // Equality connector — wallet-funding (benefits-marketplace → equality-connector)
310
312
  bind<IEqualityConnectorApi>("IEqualityConnectorApi").to(EqualityConnectorApi);
313
+ // SynergyPay connector — wallet-funding (benefits-marketplace → synergypay-connector)
314
+ bind<ISynergyPayConnectorApi>("ISynergyPayConnectorApi").to(SynergyPayConnectorApi);
311
315
 
312
316
  // Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
313
317
  bind<IContactsBusinessApi>("IContactsBusinessApi").to(ContactsBusinessApi);
package/src/index.ts CHANGED
@@ -79,6 +79,7 @@ export * from "./platformRbac/index.js";
79
79
  export * from "./messages-business/index.js";
80
80
  export * from "./totp-security/index.js";
81
81
  export * from "./equality-connector/index.js";
82
+ export * from "./synergypay-connector/index.js";
82
83
  export * from "./contacts-business/index.js";
83
84
  export * from "./uniteller-connector/index.js";
84
85
  export * from "./walletFundingSettlement/index.js";
@@ -0,0 +1,52 @@
1
+ import { inject, injectable } from "inversify";
2
+ import { IHttpRequest } from "@fiado/http-client";
3
+ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
4
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
5
+ import {
6
+ CreateFundingReferenceRequest,
7
+ CreateFundingReferenceResponse,
8
+ ListFundingReferencesResponse,
9
+ ApplyWalletFundingRequest,
10
+ ApplyWalletFundingResponse,
11
+ } from "@fiado/type-kit/bin/walletFunding/index.js";
12
+ import { ISynergyPayConnectorApi } from "./interfaces/ISynergyPayConnectorApi.js";
13
+
14
+ @injectable()
15
+ export default class SynergyPayConnectorApi implements ISynergyPayConnectorApi {
16
+ private readonly baseUrl = process.env.SYNERGYPAY_CONNECTOR_LAMBDA_URL || "";
17
+
18
+ constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
19
+
20
+ async createFundingReference(
21
+ request: CreateFundingReferenceRequest,
22
+ ): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>> {
23
+ const url = `${this.baseUrl}/funding`;
24
+ return await this.httpRequest.post(url, request);
25
+ }
26
+
27
+ async listFundingReferences(
28
+ directoryId: string,
29
+ status?: string,
30
+ ): Promise<ApiGatewayResponse<ListFundingReferencesResponse>> {
31
+ const params = new URLSearchParams({ directoryId });
32
+ if (status) params.set("status", status);
33
+ const url = `${this.baseUrl}/funding/references?${params.toString()}`;
34
+ return await this.httpRequest.get(url);
35
+ }
36
+
37
+ async getStandardCatalog(
38
+ query: { benefitId: string; includeDisabled?: boolean },
39
+ ): Promise<ApiGatewayResponse<ConnectorCatalogResponse>> {
40
+ const params = new URLSearchParams({ benefitId: query.benefitId });
41
+ if (query.includeDisabled) params.set("includeDisabled", "true");
42
+ const url = `${this.baseUrl}/catalog/standard?${params.toString()}`;
43
+ return await this.httpRequest.get(url);
44
+ }
45
+
46
+ async applyFunding(
47
+ request: ApplyWalletFundingRequest,
48
+ ): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>> {
49
+ const url = `${this.baseUrl}/funding/apply`;
50
+ return await this.httpRequest.post(url, request);
51
+ }
52
+ }
@@ -0,0 +1,61 @@
1
+ import { ApiGatewayResponse } from "@fiado/gateway-adapter";
2
+ import { ConnectorCatalogResponse } from "@fiado/type-kit/bin/benefitCenter/index.js";
3
+ import {
4
+ CreateFundingReferenceRequest,
5
+ CreateFundingReferenceResponse,
6
+ ListFundingReferencesResponse,
7
+ ApplyWalletFundingRequest,
8
+ ApplyWalletFundingResponse,
9
+ } from "@fiado/type-kit/bin/walletFunding/index.js";
10
+
11
+ /**
12
+ * Cliente del marketplace hacia synergypay-connector (privado, dentro de la VPC).
13
+ *
14
+ * Segundo proveedor de Cash In (SinergyPay). Lo consume `SynergyPayFundingPublisher`
15
+ * + `SynergyPayCatalogPublisher` del benefits-marketplace-business. Mismo contrato
16
+ * provider-agnostic que `IEqualityConnectorApi` — el marketplace no sabe con qué
17
+ * proveedor habla.
18
+ *
19
+ * Endpoints backend en synergypay-connector (privado VPC):
20
+ * - POST /funding
21
+ * - GET /funding/references?directoryId=&status=
22
+ * - GET /catalog/standard?benefitId=&includeDisabled=
23
+ * - POST /funding/apply
24
+ *
25
+ * NOTA: los endpoints `/passport/*` del BackOffice (SPEC 1.3) NO están incluidos —
26
+ * el synergypay-connector aún no los expone (F6.1 construyó solo el money-path).
27
+ * Se agregan en F6.4 junto con `SynergyPayPassportBackofficePublisher`.
28
+ */
29
+ export interface ISynergyPayConnectorApi {
30
+ /** Genera una referencia de fondeo en SinergyPay via el connector. */
31
+ createFundingReference(
32
+ request: CreateFundingReferenceRequest,
33
+ ): Promise<ApiGatewayResponse<CreateFundingReferenceResponse>>;
34
+
35
+ /**
36
+ * Lista las referencias del usuario, opcionalmente filtradas por status.
37
+ * Status default (cuando no se pasa) lo decide el connector.
38
+ */
39
+ listFundingReferences(
40
+ directoryId: string,
41
+ status?: string,
42
+ ): Promise<ApiGatewayResponse<ListFundingReferencesResponse>>;
43
+
44
+ /**
45
+ * Devuelve el catalogo standard de productos de wallet-funding del connector.
46
+ * Patron canonico del Centro de Beneficios — el marketplace lo consume via
47
+ * `IConnectorCatalogPublisher.getStandardCatalog` (mismo flow que Equality).
48
+ */
49
+ getStandardCatalog(
50
+ query: { benefitId: string; includeDisabled?: boolean },
51
+ ): Promise<ApiGatewayResponse<ConnectorCatalogResponse>>;
52
+
53
+ /**
54
+ * Aplica el resultado de la conciliación de un pago (POST /funding/apply).
55
+ * En SinergyPay el crédito se hace inline en el webhook firmado; este endpoint
56
+ * queda para el cierre SETTLED (conciliación bancaria) — mismo contrato canónico.
57
+ */
58
+ applyFunding(
59
+ request: ApplyWalletFundingRequest,
60
+ ): Promise<ApiGatewayResponse<ApplyWalletFundingResponse>>;
61
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api/interfaces/ISynergyPayConnectorApi.js";
2
+ export { default as SynergyPayConnectorApi } from "./api/SynergyPayConnectorApi.js";