@fiado/api-invoker 3.12.0 → 3.14.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/container.config.js +4 -0
- package/bin/uniteller-connector/api/UnitellerConnectorApi.d.ts +12 -0
- package/bin/uniteller-connector/api/UnitellerConnectorApi.js +39 -0
- package/bin/uniteller-connector/api/interfaces/IUnitellerConnectorApi.d.ts +10 -0
- package/bin/uniteller-connector/api/interfaces/IUnitellerConnectorApi.js +2 -0
- package/bin/uniteller-connector/index.d.ts +2 -0
- package/bin/uniteller-connector/index.js +23 -0
- package/package.json +1 -1
- package/src/container.config.ts +6 -0
- package/src/uniteller-connector/api/UnitellerConnectorApi.ts +32 -0
- package/src/uniteller-connector/api/interfaces/IUnitellerConnectorApi.ts +18 -0
- package/src/uniteller-connector/index.ts +2 -0
package/bin/container.config.js
CHANGED
|
@@ -100,6 +100,8 @@ const CountriesBusinessApi_1 = __importDefault(require("./countries-business/Cou
|
|
|
100
100
|
// AI Engine connector
|
|
101
101
|
const ai_engine_connector_1 = require("./ai-engine-connector");
|
|
102
102
|
const BenefitsMarketplaceApi_1 = __importDefault(require("./benefits-marketplace/api/BenefitsMarketplaceApi"));
|
|
103
|
+
// UniTeller remittance connector (Fase 2 remittance)
|
|
104
|
+
const uniteller_connector_1 = require("./uniteller-connector");
|
|
103
105
|
exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
104
106
|
// UTILS bindings
|
|
105
107
|
bind("InvokerUtils").to(InvokerUtils_1.InvokerUtils);
|
|
@@ -203,4 +205,6 @@ exports.apiInvokerBindings = new inversify_1.ContainerModule((bind) => {
|
|
|
203
205
|
bind("IAiEngineApi").to(ai_engine_connector_1.AiEngineApi);
|
|
204
206
|
// Benefits marketplace (Fase 2) - cliente único del procesador → marketplace
|
|
205
207
|
bind("IBenefitsMarketplaceApi").to(BenefitsMarketplaceApi_1.default);
|
|
208
|
+
// UniTeller remittance connector (Fase 2 remittance) - benefits-marketplace → uniteller-connector
|
|
209
|
+
bind("IUnitellerConnectorApi").to(uniteller_connector_1.UnitellerConnectorApi);
|
|
206
210
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
2
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { RemittanceHomeResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittanceSecurityQuestionsResponse } from "@fiado/type-kit/bin/remittance";
|
|
4
|
+
import { IUnitellerConnectorApi } from "./interfaces/IUnitellerConnectorApi";
|
|
5
|
+
export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
6
|
+
private httpRequest;
|
|
7
|
+
private readonly baseUrl;
|
|
8
|
+
constructor(httpRequest: IHttpRequest);
|
|
9
|
+
getHome(directoryId: string): Promise<ApiGatewayResponse<RemittanceHomeResponse>>;
|
|
10
|
+
getSecurityQuestions(): Promise<ApiGatewayResponse<RemittanceSecurityQuestionsResponse>>;
|
|
11
|
+
onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
let UnitellerConnectorApi = class UnitellerConnectorApi {
|
|
17
|
+
constructor(httpRequest) {
|
|
18
|
+
this.httpRequest = httpRequest;
|
|
19
|
+
this.baseUrl = process.env.UNITELLER_CONNECTOR_LAMBDA_URL || "";
|
|
20
|
+
}
|
|
21
|
+
async getHome(directoryId) {
|
|
22
|
+
const url = `${this.baseUrl}/home`;
|
|
23
|
+
return await this.httpRequest.post(url, { directoryId });
|
|
24
|
+
}
|
|
25
|
+
async getSecurityQuestions() {
|
|
26
|
+
const url = `${this.baseUrl}/onboard/security-questions`;
|
|
27
|
+
return await this.httpRequest.get(url);
|
|
28
|
+
}
|
|
29
|
+
async onboard(request) {
|
|
30
|
+
const url = `${this.baseUrl}/onboard`;
|
|
31
|
+
return await this.httpRequest.post(url, request);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
UnitellerConnectorApi = __decorate([
|
|
35
|
+
(0, inversify_1.injectable)(),
|
|
36
|
+
__param(0, (0, inversify_1.inject)("IHttpRequest")),
|
|
37
|
+
__metadata("design:paramtypes", [Object])
|
|
38
|
+
], UnitellerConnectorApi);
|
|
39
|
+
exports.default = UnitellerConnectorApi;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { RemittanceHomeResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittanceSecurityQuestionsResponse } from "@fiado/type-kit/bin/remittance";
|
|
3
|
+
export interface IUnitellerConnectorApi {
|
|
4
|
+
/** Estado del módulo remesas para un directoryId. */
|
|
5
|
+
getHome(directoryId: string): Promise<ApiGatewayResponse<RemittanceHomeResponse>>;
|
|
6
|
+
/** Lista de preguntas de seguridad UNIR (compliance — no consumido por mobile bajo DP-05). */
|
|
7
|
+
getSecurityQuestions(): Promise<ApiGatewayResponse<RemittanceSecurityQuestionsResponse>>;
|
|
8
|
+
/** Activa el servicio de remesas (silent signup en UNIR). */
|
|
9
|
+
onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.UnitellerConnectorApi = void 0;
|
|
21
|
+
__exportStar(require("./api/interfaces/IUnitellerConnectorApi"), exports);
|
|
22
|
+
var UnitellerConnectorApi_1 = require("./api/UnitellerConnectorApi");
|
|
23
|
+
Object.defineProperty(exports, "UnitellerConnectorApi", { enumerable: true, get: function () { return __importDefault(UnitellerConnectorApi_1).default; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.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",
|
package/src/container.config.ts
CHANGED
|
@@ -150,6 +150,9 @@ import { IAiEngineApi, AiEngineApi } from "./ai-engine-connector";
|
|
|
150
150
|
import { IBenefitsMarketplaceApi } from "./benefits-marketplace";
|
|
151
151
|
import BenefitsMarketplaceApi from "./benefits-marketplace/api/BenefitsMarketplaceApi";
|
|
152
152
|
|
|
153
|
+
// UniTeller remittance connector (Fase 2 remittance)
|
|
154
|
+
import { IUnitellerConnectorApi, UnitellerConnectorApi } from "./uniteller-connector";
|
|
155
|
+
|
|
153
156
|
export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) => {
|
|
154
157
|
// UTILS bindings
|
|
155
158
|
bind<InvokerUtils>("InvokerUtils").to(InvokerUtils);
|
|
@@ -262,4 +265,7 @@ export const apiInvokerBindings = new ContainerModule((bind: interfaces.Bind) =>
|
|
|
262
265
|
|
|
263
266
|
// Benefits marketplace (Fase 2) - cliente único del procesador → marketplace
|
|
264
267
|
bind<IBenefitsMarketplaceApi>("IBenefitsMarketplaceApi").to(BenefitsMarketplaceApi);
|
|
268
|
+
|
|
269
|
+
// UniTeller remittance connector (Fase 2 remittance) - benefits-marketplace → uniteller-connector
|
|
270
|
+
bind<IUnitellerConnectorApi>("IUnitellerConnectorApi").to(UnitellerConnectorApi);
|
|
265
271
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { inject, injectable } from "inversify";
|
|
2
|
+
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import {
|
|
5
|
+
RemittanceHomeResponse,
|
|
6
|
+
RemittanceOnboardRequest,
|
|
7
|
+
RemittanceOnboardResponse,
|
|
8
|
+
RemittanceSecurityQuestionsResponse,
|
|
9
|
+
} from "@fiado/type-kit/bin/remittance";
|
|
10
|
+
import { IUnitellerConnectorApi } from "./interfaces/IUnitellerConnectorApi";
|
|
11
|
+
|
|
12
|
+
@injectable()
|
|
13
|
+
export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
14
|
+
private readonly baseUrl = process.env.UNITELLER_CONNECTOR_LAMBDA_URL || "";
|
|
15
|
+
|
|
16
|
+
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {}
|
|
17
|
+
|
|
18
|
+
async getHome(directoryId: string): Promise<ApiGatewayResponse<RemittanceHomeResponse>> {
|
|
19
|
+
const url = `${this.baseUrl}/home`;
|
|
20
|
+
return await this.httpRequest.post(url, { directoryId });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async getSecurityQuestions(): Promise<ApiGatewayResponse<RemittanceSecurityQuestionsResponse>> {
|
|
24
|
+
const url = `${this.baseUrl}/onboard/security-questions`;
|
|
25
|
+
return await this.httpRequest.get(url);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>> {
|
|
29
|
+
const url = `${this.baseUrl}/onboard`;
|
|
30
|
+
return await this.httpRequest.post(url, request);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import {
|
|
3
|
+
RemittanceHomeResponse,
|
|
4
|
+
RemittanceOnboardRequest,
|
|
5
|
+
RemittanceOnboardResponse,
|
|
6
|
+
RemittanceSecurityQuestionsResponse,
|
|
7
|
+
} from "@fiado/type-kit/bin/remittance";
|
|
8
|
+
|
|
9
|
+
export interface IUnitellerConnectorApi {
|
|
10
|
+
/** Estado del módulo remesas para un directoryId. */
|
|
11
|
+
getHome(directoryId: string): Promise<ApiGatewayResponse<RemittanceHomeResponse>>;
|
|
12
|
+
|
|
13
|
+
/** Lista de preguntas de seguridad UNIR (compliance — no consumido por mobile bajo DP-05). */
|
|
14
|
+
getSecurityQuestions(): Promise<ApiGatewayResponse<RemittanceSecurityQuestionsResponse>>;
|
|
15
|
+
|
|
16
|
+
/** Activa el servicio de remesas (silent signup en UNIR). */
|
|
17
|
+
onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>>;
|
|
18
|
+
}
|