@fiado/api-invoker 4.30.0 → 4.31.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/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/index.d.ts +1 -0
- package/bin/index.js +1 -0
- package/package.json +2 -2
- 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/index.ts +1 -0
|
@@ -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
|
});
|
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.31.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.105.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -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
|
});
|
package/src/index.ts
CHANGED