@fiado/api-invoker 3.12.0 → 3.13.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/riskProfile/api/RiskProfileApi.d.ts +0 -5
- package/bin/riskProfile/api/RiskProfileApi.js +0 -12
- package/bin/riskProfile/api/TransactionAlertApi.d.ts +1 -5
- package/bin/riskProfile/api/TransactionAlertApi.js +0 -16
- package/bin/riskProfile/api/interfaces/IRiskProfileApi.d.ts +0 -27
- package/bin/riskProfile/api/interfaces/ITransactionAlertApi.d.ts +1 -49
- 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/index.d.ts +2 -0
- package/bin/uniteller-connector/index.js +23 -0
- package/package.json +3 -4
- package/src/container.config.ts +6 -0
- package/src/riskProfile/api/RiskProfileApi.ts +0 -24
- package/src/riskProfile/api/TransactionAlertApi.ts +7 -33
- package/src/riskProfile/api/interfaces/IRiskProfileApi.ts +0 -37
- package/src/riskProfile/api/interfaces/ITransactionAlertApi.ts +3 -65
- 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/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- package/bin/estafeta/EstafetaApi.d.ts +0 -0
- package/bin/estafeta/EstafetaApi.js +0 -0
- package/bin/report-processor-business/api/IReportProcessorBusiness.d.ts +0 -3
- package/bin/report-processor-business/api/IReportProcessorBusiness.js +0 -2
- /package/bin/{cognitoConnector/interfaces/ICognitoConnectorApiV2.js → uniteller-connector/api/interfaces/IUnitellerConnectorApi.js} +0 -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
|
});
|
|
@@ -3,8 +3,6 @@ import { IHttpRequest } from "@fiado/http-client";
|
|
|
3
3
|
import { CreatePrivateAlarm, CreateRiskProfileRequest } from "@fiado/type-kit/bin/riskProfile";
|
|
4
4
|
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
5
5
|
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
6
|
-
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
7
|
-
import { SetCustomAlarmRequest, SetCustomAlarmResponse, SetDeclaredIncomeRequest, SetDeclaredIncomeResponse, SetManualRiskLevelRequest, SetManualRiskLevelResponse } from "@fiado/type-kit/bin/riskProfile";
|
|
8
6
|
export default class RiskProfileApi implements IRiskProfileApi {
|
|
9
7
|
private httpRequest;
|
|
10
8
|
private readonly baseUrl;
|
|
@@ -14,7 +12,4 @@ export default class RiskProfileApi implements IRiskProfileApi {
|
|
|
14
12
|
updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
|
|
15
13
|
getRiskProfileByDirectoryId(directoryId: string): Promise<any>;
|
|
16
14
|
createAlarm(params: CreatePrivateAlarm): Promise<any>;
|
|
17
|
-
setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>>;
|
|
18
|
-
setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>>;
|
|
19
|
-
setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>>;
|
|
20
15
|
}
|
|
@@ -38,18 +38,6 @@ let RiskProfileApi = class RiskProfileApi {
|
|
|
38
38
|
const url = `${this.baseUrl}/alarms/create`;
|
|
39
39
|
return await this.httpRequest.post(url, params);
|
|
40
40
|
}
|
|
41
|
-
async setManualRiskLevel(directoryId, request) {
|
|
42
|
-
const url = `${this.baseUrl}/profiles/${directoryId}/manual-risk`;
|
|
43
|
-
return await this.httpRequest.put(url, request);
|
|
44
|
-
}
|
|
45
|
-
async setCustomAlarm(directoryId, request) {
|
|
46
|
-
const url = `${this.baseUrl}/profiles/${directoryId}/custom-alarm`;
|
|
47
|
-
return await this.httpRequest.put(url, request);
|
|
48
|
-
}
|
|
49
|
-
async setDeclaredIncome(directoryId, request) {
|
|
50
|
-
const url = `${this.baseUrl}/profiles/${directoryId}/declared-income`;
|
|
51
|
-
return await this.httpRequest.put(url, request);
|
|
52
|
-
}
|
|
53
41
|
};
|
|
54
42
|
RiskProfileApi = __decorate([
|
|
55
43
|
(0, inversify_1.injectable)(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITransactionAlertApi } from "./interfaces/ITransactionAlertApi";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
|
-
import { AlarmOperationType,
|
|
3
|
+
import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
|
|
4
4
|
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
5
5
|
export default class TransactionAlertApi implements ITransactionAlertApi {
|
|
6
6
|
private httpRequest;
|
|
@@ -10,8 +10,4 @@ export default class TransactionAlertApi implements ITransactionAlertApi {
|
|
|
10
10
|
items: TransactionAlertResponse[];
|
|
11
11
|
lastKey: any;
|
|
12
12
|
}>>;
|
|
13
|
-
dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>>;
|
|
14
|
-
appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>>;
|
|
15
|
-
createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>>;
|
|
16
|
-
markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>>;
|
|
17
13
|
}
|
|
@@ -22,22 +22,6 @@ let TransactionAlertApi = class TransactionAlertApi {
|
|
|
22
22
|
const url = `${this.baseUrl}/alarms?status=${status}&reported=${reported}`;
|
|
23
23
|
return await this.httpRequest.get(url);
|
|
24
24
|
}
|
|
25
|
-
async dictaminateAlert(alertId, request) {
|
|
26
|
-
const url = `${this.baseUrl}/alerts/${alertId}/dictamen`;
|
|
27
|
-
return await this.httpRequest.post(url, request);
|
|
28
|
-
}
|
|
29
|
-
async appendAlertNote(alertId, request) {
|
|
30
|
-
const url = `${this.baseUrl}/alerts/${alertId}/notes`;
|
|
31
|
-
return await this.httpRequest.post(url, request);
|
|
32
|
-
}
|
|
33
|
-
async createBlockedListAlert(request) {
|
|
34
|
-
const url = `${this.baseUrl}/alerts/blocked-list`;
|
|
35
|
-
return await this.httpRequest.post(url, request);
|
|
36
|
-
}
|
|
37
|
-
async markAlertReported(alertId, request) {
|
|
38
|
-
const url = `${this.baseUrl}/alerts/${alertId}/reported`;
|
|
39
|
-
return await this.httpRequest.post(url, request);
|
|
40
|
-
}
|
|
41
25
|
};
|
|
42
26
|
TransactionAlertApi = __decorate([
|
|
43
27
|
(0, inversify_1.injectable)(),
|
|
@@ -1,37 +1,10 @@
|
|
|
1
1
|
import { CreatePrivateAlarm, CreateRiskProfileRequest } from "@fiado/type-kit/bin/riskProfile";
|
|
2
2
|
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
3
3
|
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
4
|
-
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
5
|
-
import { SetCustomAlarmRequest, SetCustomAlarmResponse, SetDeclaredIncomeRequest, SetDeclaredIncomeResponse, SetManualRiskLevelRequest, SetManualRiskLevelResponse } from "@fiado/type-kit/bin/riskProfile";
|
|
6
4
|
export interface IRiskProfileApi {
|
|
7
5
|
createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
|
|
8
6
|
updateRiskProfile(request: UpdateRiskProfileRequest): Promise<any>;
|
|
9
7
|
updateAlarmProfile(request: UpdateAlarmProfileRequest): Promise<any>;
|
|
10
8
|
getRiskProfileByDirectoryId(directoryId: string): Promise<any>;
|
|
11
9
|
createAlarm(params: CreatePrivateAlarm): Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* Cambia el manualRiskLevel del perfil con recálculo de alarmas base y posible creación
|
|
14
|
-
* de alerta MANUAL_RISK_INCREASE si el nivel sube.
|
|
15
|
-
* Endpoint: `PUT /profiles/{directoryId}/manual-risk`
|
|
16
|
-
*
|
|
17
|
-
* Idempotencia: si previousLevel === newLevel, devuelve 200 con noop=true sin escribir.
|
|
18
|
-
*
|
|
19
|
-
* Errores:
|
|
20
|
-
* - 404 NOT_FOUND si el perfil no existe.
|
|
21
|
-
*/
|
|
22
|
-
setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>>;
|
|
23
|
-
/**
|
|
24
|
-
* Cambia el umbral de una alarma custom (customHighAmount o customMonthlyIncrease).
|
|
25
|
-
* Endpoint: `PUT /profiles/{directoryId}/custom-alarm`
|
|
26
|
-
*
|
|
27
|
-
* Idempotencia: si previousValue === newValue, devuelve 200 con noop=true.
|
|
28
|
-
*/
|
|
29
|
-
setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>>;
|
|
30
|
-
/**
|
|
31
|
-
* Cambia el declaredMonthlyIncome del perfil y recalcula las 5 alarmas base.
|
|
32
|
-
* Endpoint: `PUT /profiles/{directoryId}/declared-income`
|
|
33
|
-
*
|
|
34
|
-
* Idempotencia: si previousIncome === newValue, devuelve 200 con noop=true.
|
|
35
|
-
*/
|
|
36
|
-
setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>>;
|
|
37
10
|
}
|
|
@@ -1,56 +1,8 @@
|
|
|
1
1
|
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
2
|
-
import { AlarmOperationType,
|
|
3
|
-
/**
|
|
4
|
-
* Cliente para invocar los endpoints privados de alertas del Lambda `risk-profile-business`.
|
|
5
|
-
*
|
|
6
|
-
* Los endpoints viven bajo `RISK_PROFILE_LAMBDA_URL` (API Gateway privado, VPC-only).
|
|
7
|
-
* Todos requieren `email` en el body como audit trail del autor del cambio.
|
|
8
|
-
*/
|
|
2
|
+
import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
|
|
9
3
|
export interface ITransactionAlertApi {
|
|
10
|
-
/**
|
|
11
|
-
* Lista alertas filtradas por status y reported.
|
|
12
|
-
* Endpoint: `GET /alarms?status={status}&reported={reported}`
|
|
13
|
-
*/
|
|
14
4
|
getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{
|
|
15
5
|
items: TransactionAlertResponse[];
|
|
16
6
|
lastKey: any;
|
|
17
7
|
}>>;
|
|
18
|
-
/**
|
|
19
|
-
* Dictamina una alerta en estado NEW o PENDING.
|
|
20
|
-
* Endpoint: `POST /alerts/{alertId}/dictamen`
|
|
21
|
-
*
|
|
22
|
-
* Side effects:
|
|
23
|
-
* - Update de TransactionAlert_GT con nuevos campos de dictamen y dictamenSnapshotHash.
|
|
24
|
-
* - Crea Observation con tag ALARM_DICTAMEN.
|
|
25
|
-
* - Sube snapshot inmutable a S3.
|
|
26
|
-
*
|
|
27
|
-
* Errores:
|
|
28
|
-
* - 404 NOT_FOUND si la alerta no existe.
|
|
29
|
-
* - 409 ALREADY_DICTATED si la alerta no está en NEW/PENDING.
|
|
30
|
-
*/
|
|
31
|
-
dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>>;
|
|
32
|
-
/**
|
|
33
|
-
* Agrega o reemplaza nota a una alerta sin dictaminar.
|
|
34
|
-
* Endpoint: `POST /alerts/{alertId}/notes`
|
|
35
|
-
*/
|
|
36
|
-
appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>>;
|
|
37
|
-
/**
|
|
38
|
-
* Crea una alerta BLOCKED_LIST manualmente.
|
|
39
|
-
* Endpoint: `POST /alerts/blocked-list`
|
|
40
|
-
*
|
|
41
|
-
* Errores:
|
|
42
|
-
* - 409 ALERT_ALREADY_EXISTS si ya existe una alerta BLOCKED_LIST abierta para el directoryId.
|
|
43
|
-
*/
|
|
44
|
-
createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>>;
|
|
45
|
-
/**
|
|
46
|
-
* Marca una alerta como reportada a SITI (ROI enviado).
|
|
47
|
-
* Endpoint: `POST /alerts/{alertId}/reported`
|
|
48
|
-
*
|
|
49
|
-
* Precondiciones:
|
|
50
|
-
* - Alerta en estado CLOSE_RULED y reported=0.
|
|
51
|
-
*
|
|
52
|
-
* Errores:
|
|
53
|
-
* - 409 ALERT_NOT_ELIGIBLE si no cumple precondiciones.
|
|
54
|
-
*/
|
|
55
|
-
markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>>;
|
|
56
8
|
}
|
|
@@ -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,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.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",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "test",
|
|
9
|
-
"build": "tsc"
|
|
10
|
-
"prepublishOnly": "npm run build"
|
|
9
|
+
"build": "tsc"
|
|
11
10
|
},
|
|
12
11
|
"keywords": [],
|
|
13
12
|
"author": "Fiado Inc",
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
"@fiado/gateway-adapter": "^1.1.50",
|
|
18
17
|
"@fiado/http-client": "^1.0.7",
|
|
19
18
|
"@fiado/logger": "^1.0.3",
|
|
20
|
-
"@fiado/type-kit": "^3.
|
|
19
|
+
"@fiado/type-kit": "^3.23.0",
|
|
21
20
|
"dotenv": "^16.4.7",
|
|
22
21
|
"i": "^0.3.7",
|
|
23
22
|
"inversify": "^6.2.2",
|
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
|
});
|
|
@@ -4,15 +4,6 @@ import {IHttpRequest} from "@fiado/http-client";
|
|
|
4
4
|
import {CreatePrivateAlarm, CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
5
5
|
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
6
6
|
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
7
|
-
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
8
|
-
import {
|
|
9
|
-
SetCustomAlarmRequest,
|
|
10
|
-
SetCustomAlarmResponse,
|
|
11
|
-
SetDeclaredIncomeRequest,
|
|
12
|
-
SetDeclaredIncomeResponse,
|
|
13
|
-
SetManualRiskLevelRequest,
|
|
14
|
-
SetManualRiskLevelResponse,
|
|
15
|
-
} from "@fiado/type-kit/bin/riskProfile";
|
|
16
7
|
|
|
17
8
|
@injectable()
|
|
18
9
|
export default class RiskProfileApi implements IRiskProfileApi {
|
|
@@ -46,19 +37,4 @@ export default class RiskProfileApi implements IRiskProfileApi {
|
|
|
46
37
|
return await this.httpRequest.post(url,params);
|
|
47
38
|
}
|
|
48
39
|
|
|
49
|
-
async setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>> {
|
|
50
|
-
const url = `${this.baseUrl}/profiles/${directoryId}/manual-risk`;
|
|
51
|
-
return await this.httpRequest.put(url, request);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>> {
|
|
55
|
-
const url = `${this.baseUrl}/profiles/${directoryId}/custom-alarm`;
|
|
56
|
-
return await this.httpRequest.put(url, request);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>> {
|
|
60
|
-
const url = `${this.baseUrl}/profiles/${directoryId}/declared-income`;
|
|
61
|
-
return await this.httpRequest.put(url, request);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
40
|
}
|
|
@@ -1,49 +1,23 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
2
|
import { ITransactionAlertApi } from "./interfaces/ITransactionAlertApi";
|
|
3
3
|
import { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import {
|
|
5
|
-
AlarmOperationType,
|
|
6
|
-
AppendAlertNoteRequest,
|
|
7
|
-
AppendAlertNoteResponse,
|
|
8
|
-
CreateBlockedListAlertRequest,
|
|
9
|
-
CreateBlockedListAlertResponse,
|
|
10
|
-
DictaminateAlertRequest,
|
|
11
|
-
DictaminateAlertResponse,
|
|
12
|
-
MarkAlertReportedRequest,
|
|
13
|
-
MarkAlertReportedResponse,
|
|
14
|
-
TransactionAlertResponse,
|
|
15
|
-
} from "@fiado/type-kit/bin/riskProfile";
|
|
4
|
+
import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
|
|
16
5
|
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
17
6
|
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
18
10
|
@injectable()
|
|
19
11
|
export default class TransactionAlertApi implements ITransactionAlertApi {
|
|
20
12
|
private readonly baseUrl = process.env.RISK_PROFILE_LAMBDA_URL || "";
|
|
21
13
|
|
|
14
|
+
|
|
22
15
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) {
|
|
23
16
|
}
|
|
24
17
|
|
|
25
18
|
async getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{ items: TransactionAlertResponse[], lastKey: any }>> {
|
|
26
19
|
const url = `${this.baseUrl}/alarms?status=${status}&reported=${reported}`;
|
|
27
|
-
return await this.httpRequest.get(url);
|
|
28
|
-
}
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
const url = `${this.baseUrl}/alerts/${alertId}/dictamen`;
|
|
32
|
-
return await this.httpRequest.post(url, request);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>> {
|
|
36
|
-
const url = `${this.baseUrl}/alerts/${alertId}/notes`;
|
|
37
|
-
return await this.httpRequest.post(url, request);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>> {
|
|
41
|
-
const url = `${this.baseUrl}/alerts/blocked-list`;
|
|
42
|
-
return await this.httpRequest.post(url, request);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>> {
|
|
46
|
-
const url = `${this.baseUrl}/alerts/${alertId}/reported`;
|
|
47
|
-
return await this.httpRequest.post(url, request);
|
|
21
|
+
return await this.httpRequest.get(url);
|
|
48
22
|
}
|
|
49
|
-
}
|
|
23
|
+
}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import {CreatePrivateAlarm, CreateRiskProfileRequest} from "@fiado/type-kit/bin/riskProfile";
|
|
2
2
|
import UpdateAlarmProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateAlarmProfileRequest";
|
|
3
3
|
import UpdateRiskProfileRequest from "@fiado/type-kit/bin/riskProfile/dtos/UpdateRiskProfileRequest";
|
|
4
|
-
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
5
|
-
import {
|
|
6
|
-
SetCustomAlarmRequest,
|
|
7
|
-
SetCustomAlarmResponse,
|
|
8
|
-
SetDeclaredIncomeRequest,
|
|
9
|
-
SetDeclaredIncomeResponse,
|
|
10
|
-
SetManualRiskLevelRequest,
|
|
11
|
-
SetManualRiskLevelResponse,
|
|
12
|
-
} from "@fiado/type-kit/bin/riskProfile";
|
|
13
4
|
|
|
14
5
|
export interface IRiskProfileApi {
|
|
15
6
|
createRiskProfile(request: CreateRiskProfileRequest): Promise<any>;
|
|
@@ -21,32 +12,4 @@ export interface IRiskProfileApi {
|
|
|
21
12
|
getRiskProfileByDirectoryId(directoryId: string): Promise<any>
|
|
22
13
|
|
|
23
14
|
createAlarm(params: CreatePrivateAlarm): Promise<any>
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Cambia el manualRiskLevel del perfil con recálculo de alarmas base y posible creación
|
|
27
|
-
* de alerta MANUAL_RISK_INCREASE si el nivel sube.
|
|
28
|
-
* Endpoint: `PUT /profiles/{directoryId}/manual-risk`
|
|
29
|
-
*
|
|
30
|
-
* Idempotencia: si previousLevel === newLevel, devuelve 200 con noop=true sin escribir.
|
|
31
|
-
*
|
|
32
|
-
* Errores:
|
|
33
|
-
* - 404 NOT_FOUND si el perfil no existe.
|
|
34
|
-
*/
|
|
35
|
-
setManualRiskLevel(directoryId: string, request: SetManualRiskLevelRequest): Promise<ResponseOptions<SetManualRiskLevelResponse>>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Cambia el umbral de una alarma custom (customHighAmount o customMonthlyIncrease).
|
|
39
|
-
* Endpoint: `PUT /profiles/{directoryId}/custom-alarm`
|
|
40
|
-
*
|
|
41
|
-
* Idempotencia: si previousValue === newValue, devuelve 200 con noop=true.
|
|
42
|
-
*/
|
|
43
|
-
setCustomAlarm(directoryId: string, request: SetCustomAlarmRequest): Promise<ResponseOptions<SetCustomAlarmResponse>>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Cambia el declaredMonthlyIncome del perfil y recalcula las 5 alarmas base.
|
|
47
|
-
* Endpoint: `PUT /profiles/{directoryId}/declared-income`
|
|
48
|
-
*
|
|
49
|
-
* Idempotencia: si previousIncome === newValue, devuelve 200 con noop=true.
|
|
50
|
-
*/
|
|
51
|
-
setDeclaredIncome(directoryId: string, request: SetDeclaredIncomeRequest): Promise<ResponseOptions<SetDeclaredIncomeResponse>>;
|
|
52
15
|
}
|
|
@@ -1,70 +1,8 @@
|
|
|
1
1
|
import { ResponseOptions } from "@fiado/gateway-adapter";
|
|
2
|
-
import {
|
|
3
|
-
AlarmOperationType,
|
|
4
|
-
AppendAlertNoteRequest,
|
|
5
|
-
AppendAlertNoteResponse,
|
|
6
|
-
CreateBlockedListAlertRequest,
|
|
7
|
-
CreateBlockedListAlertResponse,
|
|
8
|
-
DictaminateAlertRequest,
|
|
9
|
-
DictaminateAlertResponse,
|
|
10
|
-
MarkAlertReportedRequest,
|
|
11
|
-
MarkAlertReportedResponse,
|
|
12
|
-
TransactionAlertResponse,
|
|
13
|
-
} from "@fiado/type-kit/bin/riskProfile";
|
|
2
|
+
import { AlarmOperationType, TransactionAlertResponse } from "@fiado/type-kit/bin/riskProfile";
|
|
14
3
|
|
|
15
|
-
/**
|
|
16
|
-
* Cliente para invocar los endpoints privados de alertas del Lambda `risk-profile-business`.
|
|
17
|
-
*
|
|
18
|
-
* Los endpoints viven bajo `RISK_PROFILE_LAMBDA_URL` (API Gateway privado, VPC-only).
|
|
19
|
-
* Todos requieren `email` en el body como audit trail del autor del cambio.
|
|
20
|
-
*/
|
|
21
4
|
export interface ITransactionAlertApi {
|
|
22
5
|
|
|
23
|
-
|
|
24
|
-
* Lista alertas filtradas por status y reported.
|
|
25
|
-
* Endpoint: `GET /alarms?status={status}&reported={reported}`
|
|
26
|
-
*/
|
|
27
|
-
getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{ items: TransactionAlertResponse[], lastKey: any }>>;
|
|
6
|
+
getAlerts(status: AlarmOperationType, reported: 1 | 0): Promise<ResponseOptions<{ items: TransactionAlertResponse[], lastKey: any }>>
|
|
28
7
|
|
|
29
|
-
|
|
30
|
-
* Dictamina una alerta en estado NEW o PENDING.
|
|
31
|
-
* Endpoint: `POST /alerts/{alertId}/dictamen`
|
|
32
|
-
*
|
|
33
|
-
* Side effects:
|
|
34
|
-
* - Update de TransactionAlert_GT con nuevos campos de dictamen y dictamenSnapshotHash.
|
|
35
|
-
* - Crea Observation con tag ALARM_DICTAMEN.
|
|
36
|
-
* - Sube snapshot inmutable a S3.
|
|
37
|
-
*
|
|
38
|
-
* Errores:
|
|
39
|
-
* - 404 NOT_FOUND si la alerta no existe.
|
|
40
|
-
* - 409 ALREADY_DICTATED si la alerta no está en NEW/PENDING.
|
|
41
|
-
*/
|
|
42
|
-
dictaminateAlert(alertId: string, request: DictaminateAlertRequest): Promise<ResponseOptions<DictaminateAlertResponse>>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Agrega o reemplaza nota a una alerta sin dictaminar.
|
|
46
|
-
* Endpoint: `POST /alerts/{alertId}/notes`
|
|
47
|
-
*/
|
|
48
|
-
appendAlertNote(alertId: string, request: AppendAlertNoteRequest): Promise<ResponseOptions<AppendAlertNoteResponse>>;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Crea una alerta BLOCKED_LIST manualmente.
|
|
52
|
-
* Endpoint: `POST /alerts/blocked-list`
|
|
53
|
-
*
|
|
54
|
-
* Errores:
|
|
55
|
-
* - 409 ALERT_ALREADY_EXISTS si ya existe una alerta BLOCKED_LIST abierta para el directoryId.
|
|
56
|
-
*/
|
|
57
|
-
createBlockedListAlert(request: CreateBlockedListAlertRequest): Promise<ResponseOptions<CreateBlockedListAlertResponse>>;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Marca una alerta como reportada a SITI (ROI enviado).
|
|
61
|
-
* Endpoint: `POST /alerts/{alertId}/reported`
|
|
62
|
-
*
|
|
63
|
-
* Precondiciones:
|
|
64
|
-
* - Alerta en estado CLOSE_RULED y reported=0.
|
|
65
|
-
*
|
|
66
|
-
* Errores:
|
|
67
|
-
* - 409 ALERT_NOT_ELIGIBLE si no cumple precondiciones.
|
|
68
|
-
*/
|
|
69
|
-
markAlertReported(alertId: string, request: MarkAlertReportedRequest): Promise<ResponseOptions<MarkAlertReportedResponse>>;
|
|
70
|
-
}
|
|
8
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ChangePasswordRequest, GetUserRequest, GetUserResponse, RefreshTokenRequest, RefreshTokenResponse, RespondToAuthChallengeRequest, SetPasswordRequest, SignInRequest, SignInResponse, SignUpConfirmRequest, SignUpRequest, SignUpResponse } from "@fiado/type-kit/bin/cognitoConnector";
|
|
2
|
-
export interface ICognitoApi {
|
|
3
|
-
/**
|
|
4
|
-
* Healthcheck for the cognito-connector
|
|
5
|
-
*/
|
|
6
|
-
healthcheck(): Promise<HealthcheckResponse>;
|
|
7
|
-
/**
|
|
8
|
-
* Create a new user in Cognito
|
|
9
|
-
*/
|
|
10
|
-
signUp(request: SignUpRequest): Promise<SignUpResponse>;
|
|
11
|
-
/**
|
|
12
|
-
* Confirm sign-up for a user in Cognito
|
|
13
|
-
*/
|
|
14
|
-
signUpConfirm(request: SignUpConfirmRequest): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Sign in a user
|
|
17
|
-
*/
|
|
18
|
-
signIn(request: SignInRequest): Promise<SignInResponse>;
|
|
19
|
-
/**
|
|
20
|
-
* Sign out a user
|
|
21
|
-
*/
|
|
22
|
-
signOut(): Promise<void>;
|
|
23
|
-
/**
|
|
24
|
-
* Change a user's password
|
|
25
|
-
*/
|
|
26
|
-
changePassword(request: ChangePasswordRequest): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Retrieve user details
|
|
29
|
-
*/
|
|
30
|
-
getUser(request: GetUserRequest): Promise<GetUserResponse>;
|
|
31
|
-
/**
|
|
32
|
-
* Refresh a user's tokens
|
|
33
|
-
*/
|
|
34
|
-
refreshToken(request: RefreshTokenRequest): Promise<RefreshTokenResponse>;
|
|
35
|
-
/**
|
|
36
|
-
* Respond to an auth challenge
|
|
37
|
-
*/
|
|
38
|
-
respondToAuthChallenge(request: RespondToAuthChallengeRequest): Promise<any>;
|
|
39
|
-
/**
|
|
40
|
-
* Reset a user's password
|
|
41
|
-
*/
|
|
42
|
-
resetPassword(request: SetPasswordRequest): Promise<void>;
|
|
43
|
-
}
|
|
44
|
-
export interface HealthcheckResponse {
|
|
45
|
-
status: string;
|
|
46
|
-
}
|
|
File without changes
|
|
File without changes
|