@fiado/api-invoker 4.30.0 → 4.32.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.
- package/bin/benefits-marketplace/api/BenefitsMarketplaceApi.d.ts +1 -2
- package/bin/benefits-marketplace/api/BenefitsMarketplaceApi.js +0 -4
- package/bin/benefits-marketplace/api/interfaces/IBenefitsMarketplaceApi.d.ts +4 -7
- package/bin/contacts-business/api/ContactsBusinessApi.d.ts +10 -0
- package/bin/contacts-business/api/ContactsBusinessApi.js +30 -0
- package/bin/contacts-business/api/interfaces/IContactsBusinessApi.d.ts +14 -0
- package/bin/contacts-business/api/interfaces/IContactsBusinessApi.js +1 -0
- package/bin/contacts-business/index.d.ts +2 -0
- package/bin/contacts-business/index.js +2 -0
- package/bin/container.config.js +4 -0
- package/bin/equality-connector/api/EqualityConnectorApi.d.ts +1 -2
- package/bin/equality-connector/api/EqualityConnectorApi.js +0 -4
- package/bin/equality-connector/api/interfaces/IEqualityConnectorApi.d.ts +5 -4
- package/bin/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/package.json +2 -2
- package/src/benefits-marketplace/api/BenefitsMarketplaceApi.ts +0 -11
- package/src/benefits-marketplace/api/interfaces/IBenefitsMarketplaceApi.ts +3 -13
- package/src/contacts-business/api/ContactsBusinessApi.ts +17 -0
- package/src/contacts-business/api/interfaces/IContactsBusinessApi.ts +15 -0
- package/src/contacts-business/index.ts +2 -0
- package/src/container.config.ts +5 -0
- package/src/equality-connector/api/EqualityConnectorApi.ts +0 -10
- package/src/equality-connector/api/interfaces/IEqualityConnectorApi.ts +4 -9
- package/src/index.ts +1 -0
|
@@ -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,
|
|
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,
|
|
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=
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import type { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import type { PrimaryEmailByDirectoryRequest, PrimaryEmailResponse } from "@fiado/type-kit/bin/emailVerification/index.js";
|
|
4
|
+
import type { IContactsBusinessApi } from "./interfaces/IContactsBusinessApi.js";
|
|
5
|
+
export default class ContactsBusinessApi implements IContactsBusinessApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
getPrimaryEmail(request: PrimaryEmailByDirectoryRequest): Promise<ApiGatewayResponse<PrimaryEmailResponse>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 ContactsBusinessApi = class ContactsBusinessApi {
|
|
15
|
+
httpRequest;
|
|
16
|
+
baseUrl = process.env.CONTACTS_BUSINESS_LAMBDA_URL || "";
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
}
|
|
20
|
+
async getPrimaryEmail(request) {
|
|
21
|
+
const url = `${this.baseUrl}/internal/email/primary`;
|
|
22
|
+
return await this.httpRequest.get(url, { directoryId: request.directoryId });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
ContactsBusinessApi = __decorate([
|
|
26
|
+
injectable(),
|
|
27
|
+
__param(0, inject("IHttpRequest")),
|
|
28
|
+
__metadata("design:paramtypes", [Object])
|
|
29
|
+
], ContactsBusinessApi);
|
|
30
|
+
export default ContactsBusinessApi;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import type { PrimaryEmailByDirectoryRequest, PrimaryEmailResponse } from "@fiado/type-kit/bin/emailVerification/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Cliente del lambda contacts-business (fuente de verdad de correos verificados).
|
|
5
|
+
* Lo consume benefits-marketplace-business en el gate de onboarding de remesas (F2).
|
|
6
|
+
*/
|
|
7
|
+
export interface IContactsBusinessApi {
|
|
8
|
+
/**
|
|
9
|
+
* Correo principal verificado de un directorio.
|
|
10
|
+
* Backend: GET /internal/email/primary?directoryId=<id> (API privada/VPC).
|
|
11
|
+
* `email` es null si el directorio no tiene un correo verificado marcado oficial.
|
|
12
|
+
*/
|
|
13
|
+
getPrimaryEmail(request: PrimaryEmailByDirectoryRequest): Promise<ApiGatewayResponse<PrimaryEmailResponse>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/bin/container.config.js
CHANGED
|
@@ -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
|
+
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
110
|
+
import { ContactsBusinessApi } from "./contacts-business/index.js";
|
|
109
111
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
110
112
|
// UTILS bindings
|
|
111
113
|
bind("InvokerUtils").to(InvokerUtils);
|
|
@@ -223,4 +225,6 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
223
225
|
bind("ITotpSecurityApi").to(TotpSecurityApi);
|
|
224
226
|
// Equality connector — wallet-funding (benefits-marketplace → equality-connector)
|
|
225
227
|
bind("IEqualityConnectorApi").to(EqualityConnectorApi);
|
|
228
|
+
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
229
|
+
bind("IContactsBusinessApi").to(ContactsBusinessApi);
|
|
226
230
|
});
|
|
@@ -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,
|
|
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,
|
|
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/bin/index.d.ts
CHANGED
package/bin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.32.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.
|
|
37
|
+
"@fiado/type-kit": "^3.111.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=
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import type { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import type { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import type { PrimaryEmailByDirectoryRequest, PrimaryEmailResponse } from "@fiado/type-kit/bin/emailVerification/index.js";
|
|
5
|
+
import type { IContactsBusinessApi } from "./interfaces/IContactsBusinessApi.js";
|
|
6
|
+
|
|
7
|
+
@injectable()
|
|
8
|
+
export default class ContactsBusinessApi implements IContactsBusinessApi {
|
|
9
|
+
private readonly baseUrl = process.env.CONTACTS_BUSINESS_LAMBDA_URL || "";
|
|
10
|
+
|
|
11
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
12
|
+
|
|
13
|
+
async getPrimaryEmail(request: PrimaryEmailByDirectoryRequest): Promise<ApiGatewayResponse<PrimaryEmailResponse>> {
|
|
14
|
+
const url = `${this.baseUrl}/internal/email/primary`;
|
|
15
|
+
return await this.httpRequest.get(url, { directoryId: request.directoryId });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import type { PrimaryEmailByDirectoryRequest, PrimaryEmailResponse } from "@fiado/type-kit/bin/emailVerification/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Cliente del lambda contacts-business (fuente de verdad de correos verificados).
|
|
6
|
+
* Lo consume benefits-marketplace-business en el gate de onboarding de remesas (F2).
|
|
7
|
+
*/
|
|
8
|
+
export interface IContactsBusinessApi {
|
|
9
|
+
/**
|
|
10
|
+
* Correo principal verificado de un directorio.
|
|
11
|
+
* Backend: GET /internal/email/primary?directoryId=<id> (API privada/VPC).
|
|
12
|
+
* `email` es null si el directorio no tiene un correo verificado marcado oficial.
|
|
13
|
+
*/
|
|
14
|
+
getPrimaryEmail(request: PrimaryEmailByDirectoryRequest): Promise<ApiGatewayResponse<PrimaryEmailResponse>>;
|
|
15
|
+
}
|
package/src/container.config.ts
CHANGED
|
@@ -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
|
+
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
169
|
+
import { IContactsBusinessApi, ContactsBusinessApi } from "./contacts-business/index.js";
|
|
168
170
|
|
|
169
171
|
export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
170
172
|
// UTILS bindings
|
|
@@ -298,4 +300,7 @@ export const apiInvokerBindings = new ContainerModule(({ bind }) => {
|
|
|
298
300
|
|
|
299
301
|
// Equality connector — wallet-funding (benefits-marketplace → equality-connector)
|
|
300
302
|
bind<IEqualityConnectorApi>("IEqualityConnectorApi").to(EqualityConnectorApi);
|
|
303
|
+
|
|
304
|
+
// Contacts business — fuente de verdad de correos verificados (F2 gate UNIR)
|
|
305
|
+
bind<IContactsBusinessApi>("IContactsBusinessApi").to(ContactsBusinessApi);
|
|
301
306
|
});
|
|
@@ -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.
|
package/src/index.ts
CHANGED