@fiado/api-invoker 3.14.0 → 3.15.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/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 +2 -0
- package/bin/uniteller-connector/api/UnitellerConnectorApi.js +4 -0
- package/bin/uniteller-connector/api/interfaces/IUnitellerConnectorApi.d.ts +7 -0
- package/package.json +3 -4
- 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 +6 -0
- package/src/uniteller-connector/api/interfaces/IUnitellerConnectorApi.ts +8 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +0 -46
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +0 -2
- 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
|
@@ -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
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
3
|
+
import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter";
|
|
3
4
|
import { RemittanceHomeResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittanceSecurityQuestionsResponse } from "@fiado/type-kit/bin/remittance";
|
|
4
5
|
import { IUnitellerConnectorApi } from "./interfaces/IUnitellerConnectorApi";
|
|
5
6
|
export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
@@ -9,4 +10,5 @@ export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
|
9
10
|
getHome(directoryId: string): Promise<ApiGatewayResponse<RemittanceHomeResponse>>;
|
|
10
11
|
getSecurityQuestions(): Promise<ApiGatewayResponse<RemittanceSecurityQuestionsResponse>>;
|
|
11
12
|
onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>>;
|
|
13
|
+
getStandardCatalog(): Promise<ApiGatewayResponse<ConnectorCatalogItem[]>>;
|
|
12
14
|
}
|
|
@@ -30,6 +30,10 @@ let UnitellerConnectorApi = class UnitellerConnectorApi {
|
|
|
30
30
|
const url = `${this.baseUrl}/onboard`;
|
|
31
31
|
return await this.httpRequest.post(url, request);
|
|
32
32
|
}
|
|
33
|
+
async getStandardCatalog() {
|
|
34
|
+
const url = `${this.baseUrl}/catalog/standard`;
|
|
35
|
+
return await this.httpRequest.get(url);
|
|
36
|
+
}
|
|
33
37
|
};
|
|
34
38
|
UnitellerConnectorApi = __decorate([
|
|
35
39
|
(0, inversify_1.injectable)(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter";
|
|
2
3
|
import { RemittanceHomeResponse, RemittanceOnboardRequest, RemittanceOnboardResponse, RemittanceSecurityQuestionsResponse } from "@fiado/type-kit/bin/remittance";
|
|
3
4
|
export interface IUnitellerConnectorApi {
|
|
4
5
|
/** Estado del módulo remesas para un directoryId. */
|
|
@@ -7,4 +8,10 @@ export interface IUnitellerConnectorApi {
|
|
|
7
8
|
getSecurityQuestions(): Promise<ApiGatewayResponse<RemittanceSecurityQuestionsResponse>>;
|
|
8
9
|
/** Activa el servicio de remesas (silent signup en UNIR). */
|
|
9
10
|
onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>>;
|
|
11
|
+
/**
|
|
12
|
+
* Catálogo en formato estándar ConnectorCatalogItem[] que el
|
|
13
|
+
* CatalogTreeBuilder de benefits-marketplace consume para armar el árbol
|
|
14
|
+
* del benefit Remittance (D-F3.7).
|
|
15
|
+
*/
|
|
16
|
+
getStandardCatalog(): Promise<ApiGatewayResponse<ConnectorCatalogItem[]>>;
|
|
10
17
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.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",
|
|
@@ -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
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { inject, injectable } from "inversify";
|
|
2
2
|
import { IHttpRequest } from "@fiado/http-client";
|
|
3
3
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
4
|
+
import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter";
|
|
4
5
|
import {
|
|
5
6
|
RemittanceHomeResponse,
|
|
6
7
|
RemittanceOnboardRequest,
|
|
@@ -29,4 +30,9 @@ export default class UnitellerConnectorApi implements IUnitellerConnectorApi {
|
|
|
29
30
|
const url = `${this.baseUrl}/onboard`;
|
|
30
31
|
return await this.httpRequest.post(url, request);
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
async getStandardCatalog(): Promise<ApiGatewayResponse<ConnectorCatalogItem[]>> {
|
|
35
|
+
const url = `${this.baseUrl}/catalog/standard`;
|
|
36
|
+
return await this.httpRequest.get(url);
|
|
37
|
+
}
|
|
32
38
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiGatewayResponse } from "@fiado/gateway-adapter";
|
|
2
|
+
import { ConnectorCatalogItem } from "@fiado/type-kit/bin/benefitCenter";
|
|
2
3
|
import {
|
|
3
4
|
RemittanceHomeResponse,
|
|
4
5
|
RemittanceOnboardRequest,
|
|
@@ -15,4 +16,11 @@ export interface IUnitellerConnectorApi {
|
|
|
15
16
|
|
|
16
17
|
/** Activa el servicio de remesas (silent signup en UNIR). */
|
|
17
18
|
onboard(request: RemittanceOnboardRequest): Promise<ApiGatewayResponse<RemittanceOnboardResponse>>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Catálogo en formato estándar ConnectorCatalogItem[] que el
|
|
22
|
+
* CatalogTreeBuilder de benefits-marketplace consume para armar el árbol
|
|
23
|
+
* del benefit Remittance (D-F3.7).
|
|
24
|
+
*/
|
|
25
|
+
getStandardCatalog(): Promise<ApiGatewayResponse<ConnectorCatalogItem[]>>;
|
|
18
26
|
}
|
|
@@ -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
|