@fiado/api-invoker 5.69.0 → 5.71.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/identity/IdentityApi.d.ts +2 -1
- package/bin/identity/IdentityApi.js +7 -0
- package/bin/identity/interfaces/IIdentityApi.d.ts +3 -1
- package/bin/loanCredit/api/LoanCreditBusinessApi.d.ts +3 -1
- package/bin/loanCredit/api/LoanCreditBusinessApi.js +8 -0
- package/bin/loanCredit/api/interfaces/ILoanCreditBusinessApi.d.ts +13 -1
- package/package.json +2 -2
- package/src/identity/IdentityApi.ts +9 -1
- package/src/identity/interfaces/IIdentityApi.ts +3 -1
- package/src/loanCredit/api/LoanCreditBusinessApi.ts +22 -0
- package/src/loanCredit/api/interfaces/ILoanCreditBusinessApi.ts +26 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IIdentityApi } from "./interfaces/IIdentityApi.js";
|
|
2
2
|
import { LegacyApiResponse } from "./interfaces/LegacyApiResponse.js";
|
|
3
3
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
4
|
-
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse, PeopleSelfieResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
4
|
+
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse, PeopleSelfieResponse, PeopleIdPhotoResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
5
5
|
export declare class IdentityApi implements IIdentityApi {
|
|
6
6
|
private httpRequest;
|
|
7
7
|
private readonly baseUrl;
|
|
@@ -21,4 +21,5 @@ export declare class IdentityApi implements IIdentityApi {
|
|
|
21
21
|
privateSearchPeople(fullName: string): Promise<LegacyApiResponse<PeopleResponse[]>>;
|
|
22
22
|
privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>>;
|
|
23
23
|
privateGetPeopleSelfie(directoryId: string): Promise<LegacyApiResponse<PeopleSelfieResponse>>;
|
|
24
|
+
privateGetPeopleIdPhoto(directoryId: string): Promise<LegacyApiResponse<PeopleIdPhotoResponse>>;
|
|
24
25
|
}
|
|
@@ -130,6 +130,13 @@ let IdentityApi = class IdentityApi {
|
|
|
130
130
|
const url = `${this.baseUrl}identities/private/people/${encodeURIComponent(directoryId)}/selfie`;
|
|
131
131
|
return await this.httpRequest.get(url);
|
|
132
132
|
}
|
|
133
|
+
async privateGetPeopleIdPhoto(directoryId) {
|
|
134
|
+
if (!directoryId) {
|
|
135
|
+
throw new Error('Directory ID is required.');
|
|
136
|
+
}
|
|
137
|
+
const url = `${this.baseUrl}identities/private/people/${encodeURIComponent(directoryId)}/id-photo`;
|
|
138
|
+
return await this.httpRequest.get(url);
|
|
139
|
+
}
|
|
133
140
|
};
|
|
134
141
|
IdentityApi = __decorate([
|
|
135
142
|
injectable(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse, PeopleSelfieResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
1
|
+
import { PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse, PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse, PeopleSelfieResponse, PeopleIdPhotoResponse } from "@fiado/type-kit/bin/identity/index.js";
|
|
2
2
|
import { LegacyApiResponse } from "./LegacyApiResponse.js";
|
|
3
3
|
/**
|
|
4
4
|
* Interfaz para el servicio Directory que permite operaciones sobre directorios.
|
|
@@ -50,4 +50,6 @@ export interface IIdentityApi {
|
|
|
50
50
|
privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>>;
|
|
51
51
|
/** Selfie del KYC del usuario: URL presignado de S3 (el userPhotoLink del facematch) + vigencia. */
|
|
52
52
|
privateGetPeopleSelfie(directoryId: string): Promise<LegacyApiResponse<PeopleSelfieResponse>>;
|
|
53
|
+
/** Frente de la identificación del usuario: URL presignado de S3 + vigencia. Gemelo del de la selfie. */
|
|
54
|
+
privateGetPeopleIdPhoto(directoryId: string): Promise<LegacyApiResponse<PeopleIdPhotoResponse>>;
|
|
53
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IHttpRequest } from "@fiado/http-client";
|
|
2
2
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
3
|
-
import { ActivationCheckRequest, ActivationCheckResponse, LoanBorrowerResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest } from "@fiado/type-kit/bin/loanCredit/index.js";
|
|
3
|
+
import { ActivationCheckRequest, ActivationCheckResponse, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, LoanBorrowerResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest } from "@fiado/type-kit/bin/loanCredit/index.js";
|
|
4
4
|
import { LoanCreditAnalyticsBatchRequest, LoanCreditAnalyticsBatchResponse } from "./dtos/LoanCreditAnalyticsBatch.js";
|
|
5
5
|
import { CustomerCreditHistoryResponse } from "./dtos/CustomerCreditHistory.js";
|
|
6
6
|
import { ILoanCreditBusinessApi } from "./interfaces/ILoanCreditBusinessApi.js";
|
|
@@ -23,6 +23,8 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
|
|
|
23
23
|
originate(input: OriginateLoanCreditRequest, tenantId: string): Promise<StandardResponse<OriginateLoanCreditResponse>>;
|
|
24
24
|
quote(creditId: string, input: QuoteLoanCreditRequest, tenantId: string): Promise<StandardResponse<QuoteLoanCreditResponse>>;
|
|
25
25
|
sign(creditId: string, input: SignLoanCreditRequest, tenantId: string): Promise<StandardResponse<SignLoanCreditResponse>>;
|
|
26
|
+
applyPayment(creditId: string, input: CreditPaymentAppliedRequest, tenantId: string): Promise<StandardResponse<CreditPaymentAppliedResponse>>;
|
|
27
|
+
settle(creditId: string, input: CreditSettledRequest, tenantId: string): Promise<StandardResponse<CreditSettledResponse>>;
|
|
26
28
|
activateCheck(creditId: string, input: ActivationCheckRequest, tenantId: string): Promise<StandardResponse<ActivationCheckResponse>>;
|
|
27
29
|
discard(creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditResponse>>;
|
|
28
30
|
getCredit(creditId: string, tenantId: string): Promise<StandardResponse<LoanCreditResponse>>;
|
|
@@ -42,6 +42,14 @@ let LoanCreditBusinessApi = class LoanCreditBusinessApi {
|
|
|
42
42
|
const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/sign?tenantId=${encodeURIComponent(tenantId)}`;
|
|
43
43
|
return await this.httpRequest.post(url, input);
|
|
44
44
|
}
|
|
45
|
+
async applyPayment(creditId, input, tenantId) {
|
|
46
|
+
const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/payment-applied?tenantId=${encodeURIComponent(tenantId)}`;
|
|
47
|
+
return await this.httpRequest.post(url, input);
|
|
48
|
+
}
|
|
49
|
+
async settle(creditId, input, tenantId) {
|
|
50
|
+
const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/settled?tenantId=${encodeURIComponent(tenantId)}`;
|
|
51
|
+
return await this.httpRequest.post(url, input);
|
|
52
|
+
}
|
|
45
53
|
async activateCheck(creditId, input, tenantId) {
|
|
46
54
|
const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/activate-check?tenantId=${encodeURIComponent(tenantId)}`;
|
|
47
55
|
return await this.httpRequest.post(url, input);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
|
-
import { ActivationCheckRequest, ActivationCheckResponse, LoanBorrowerResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest } from "@fiado/type-kit/bin/loanCredit/index.js";
|
|
2
|
+
import { ActivationCheckRequest, CreditPaymentAppliedRequest, CreditPaymentAppliedResponse, CreditSettledRequest, CreditSettledResponse, ActivationCheckResponse, LoanBorrowerResponse, LoanCreditResponse, OriginateLoanCreditRequest, OriginateLoanCreditResponse, QuoteLoanCreditRequest, QuoteLoanCreditResponse, SignLoanCreditRequest, SignLoanCreditResponse, UpsertLoanBorrowerRequest } from "@fiado/type-kit/bin/loanCredit/index.js";
|
|
3
3
|
import { LoanCreditAnalyticsBatchRequest, LoanCreditAnalyticsBatchResponse } from "../dtos/LoanCreditAnalyticsBatch.js";
|
|
4
4
|
import { CustomerCreditHistoryResponse } from "../dtos/CustomerCreditHistory.js";
|
|
5
5
|
/**
|
|
@@ -43,6 +43,18 @@ export interface ILoanCreditBusinessApi {
|
|
|
43
43
|
* `imeiEnrolled`/`lockVerified` (paso 09, dispara el MDM vía abstracción). Con las 4 en `true`
|
|
44
44
|
* el crédito pasa a `ACTIVE` (vencimientos +7d, ventana de cancelación 7d).
|
|
45
45
|
*/
|
|
46
|
+
/**
|
|
47
|
+
* Pago aplicado: cura la mora del crédito y suelta el equipo si el candado era el de la mora.
|
|
48
|
+
* El body es opcional. Un candado por fraude o manual NO se suelta pagando, y un pago que no
|
|
49
|
+
* alcanza el umbral escalonado deja el equipo bloqueado — el `unlockDecision` dice cuál fue.
|
|
50
|
+
*/
|
|
51
|
+
applyPayment(creditId: string, input: CreditPaymentAppliedRequest, tenantId: string): Promise<StandardResponse<CreditPaymentAppliedResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Liquidación: VERIFICA que el crédito no deba nada, lo pasa a `SETTLED` y libera el equipo.
|
|
54
|
+
* No le cree al caller — un plan incompleto o una cuota viva lo rechazan. La liberación es
|
|
55
|
+
* IRREVERSIBLE: el equipo sale del enrolamiento, no queda desbloqueado.
|
|
56
|
+
*/
|
|
57
|
+
settle(creditId: string, input: CreditSettledRequest, tenantId: string): Promise<StandardResponse<CreditSettledResponse>>;
|
|
46
58
|
activateCheck(creditId: string, input: ActivationCheckRequest, tenantId: string): Promise<StandardResponse<ActivationCheckResponse>>;
|
|
47
59
|
/**
|
|
48
60
|
* Descarta un crédito PENDING_ACTIVATION → DISCARDED (compensación del wizard al cancelar la
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.71.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": "^3.9.0",
|
|
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.407.0",
|
|
38
38
|
"dotenv": "^16.4.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -6,7 +6,7 @@ import dotenv from 'dotenv';
|
|
|
6
6
|
import {
|
|
7
7
|
PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse,
|
|
8
8
|
PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse,
|
|
9
|
-
PeopleSelfieResponse,
|
|
9
|
+
PeopleSelfieResponse, PeopleIdPhotoResponse,
|
|
10
10
|
} from "@fiado/type-kit/bin/identity/index.js";
|
|
11
11
|
|
|
12
12
|
dotenv.config();
|
|
@@ -160,4 +160,12 @@ export class IdentityApi implements IIdentityApi {
|
|
|
160
160
|
const url = `${this.baseUrl}identities/private/people/${encodeURIComponent(directoryId)}/selfie`;
|
|
161
161
|
return await this.httpRequest.get<LegacyApiResponse<PeopleSelfieResponse>>(url);
|
|
162
162
|
}
|
|
163
|
+
|
|
164
|
+
async privateGetPeopleIdPhoto(directoryId: string): Promise<LegacyApiResponse<PeopleIdPhotoResponse>> {
|
|
165
|
+
if (!directoryId) {
|
|
166
|
+
throw new Error('Directory ID is required.');
|
|
167
|
+
}
|
|
168
|
+
const url = `${this.baseUrl}identities/private/people/${encodeURIComponent(directoryId)}/id-photo`;
|
|
169
|
+
return await this.httpRequest.get<LegacyApiResponse<PeopleIdPhotoResponse>>(url);
|
|
170
|
+
}
|
|
163
171
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PeopleUpdateRequest, UploadDocumentRequest, PeopleResponse,
|
|
3
3
|
PeopleSelfVerifiedRequest, AgentDocumentKeyResponse, DocumentUploadResponse,
|
|
4
|
-
PeopleSelfieResponse,
|
|
4
|
+
PeopleSelfieResponse, PeopleIdPhotoResponse,
|
|
5
5
|
} from "@fiado/type-kit/bin/identity/index.js";
|
|
6
6
|
import { LegacyApiResponse } from "./LegacyApiResponse.js";
|
|
7
7
|
|
|
@@ -66,4 +66,6 @@ export interface IIdentityApi {
|
|
|
66
66
|
privateUpdatePeople(directoryId: string, data: PeopleUpdateRequest): Promise<LegacyApiResponse<unknown>>;
|
|
67
67
|
/** Selfie del KYC del usuario: URL presignado de S3 (el userPhotoLink del facematch) + vigencia. */
|
|
68
68
|
privateGetPeopleSelfie(directoryId: string): Promise<LegacyApiResponse<PeopleSelfieResponse>>;
|
|
69
|
+
/** Frente de la identificación del usuario: URL presignado de S3 + vigencia. Gemelo del de la selfie. */
|
|
70
|
+
privateGetPeopleIdPhoto(directoryId: string): Promise<LegacyApiResponse<PeopleIdPhotoResponse>>;
|
|
69
71
|
}
|
|
@@ -4,6 +4,10 @@ import { StandardResponse } from "@fiado/gateway-adapter";
|
|
|
4
4
|
import {
|
|
5
5
|
ActivationCheckRequest,
|
|
6
6
|
ActivationCheckResponse,
|
|
7
|
+
CreditPaymentAppliedRequest,
|
|
8
|
+
CreditPaymentAppliedResponse,
|
|
9
|
+
CreditSettledRequest,
|
|
10
|
+
CreditSettledResponse,
|
|
7
11
|
LoanBorrowerResponse,
|
|
8
12
|
LoanCreditResponse,
|
|
9
13
|
OriginateLoanCreditRequest,
|
|
@@ -66,6 +70,24 @@ export default class LoanCreditBusinessApi implements ILoanCreditBusinessApi {
|
|
|
66
70
|
return await this.httpRequest.post(url, input);
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
async applyPayment(
|
|
74
|
+
creditId: string,
|
|
75
|
+
input: CreditPaymentAppliedRequest,
|
|
76
|
+
tenantId: string,
|
|
77
|
+
): Promise<StandardResponse<CreditPaymentAppliedResponse>> {
|
|
78
|
+
const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/payment-applied?tenantId=${encodeURIComponent(tenantId)}`;
|
|
79
|
+
return await this.httpRequest.post(url, input);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async settle(
|
|
83
|
+
creditId: string,
|
|
84
|
+
input: CreditSettledRequest,
|
|
85
|
+
tenantId: string,
|
|
86
|
+
): Promise<StandardResponse<CreditSettledResponse>> {
|
|
87
|
+
const url = `${this.baseUrl}/private/credits/${encodeURIComponent(creditId)}/settled?tenantId=${encodeURIComponent(tenantId)}`;
|
|
88
|
+
return await this.httpRequest.post(url, input);
|
|
89
|
+
}
|
|
90
|
+
|
|
69
91
|
async activateCheck(
|
|
70
92
|
creditId: string,
|
|
71
93
|
input: ActivationCheckRequest,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { StandardResponse } from "@fiado/gateway-adapter";
|
|
2
2
|
import {
|
|
3
3
|
ActivationCheckRequest,
|
|
4
|
+
CreditPaymentAppliedRequest,
|
|
5
|
+
CreditPaymentAppliedResponse,
|
|
6
|
+
CreditSettledRequest,
|
|
7
|
+
CreditSettledResponse,
|
|
4
8
|
ActivationCheckResponse,
|
|
5
9
|
LoanBorrowerResponse,
|
|
6
10
|
LoanCreditResponse,
|
|
@@ -73,6 +77,28 @@ export interface ILoanCreditBusinessApi {
|
|
|
73
77
|
* `imeiEnrolled`/`lockVerified` (paso 09, dispara el MDM vía abstracción). Con las 4 en `true`
|
|
74
78
|
* el crédito pasa a `ACTIVE` (vencimientos +7d, ventana de cancelación 7d).
|
|
75
79
|
*/
|
|
80
|
+
/**
|
|
81
|
+
* Pago aplicado: cura la mora del crédito y suelta el equipo si el candado era el de la mora.
|
|
82
|
+
* El body es opcional. Un candado por fraude o manual NO se suelta pagando, y un pago que no
|
|
83
|
+
* alcanza el umbral escalonado deja el equipo bloqueado — el `unlockDecision` dice cuál fue.
|
|
84
|
+
*/
|
|
85
|
+
applyPayment(
|
|
86
|
+
creditId: string,
|
|
87
|
+
input: CreditPaymentAppliedRequest,
|
|
88
|
+
tenantId: string,
|
|
89
|
+
): Promise<StandardResponse<CreditPaymentAppliedResponse>>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Liquidación: VERIFICA que el crédito no deba nada, lo pasa a `SETTLED` y libera el equipo.
|
|
93
|
+
* No le cree al caller — un plan incompleto o una cuota viva lo rechazan. La liberación es
|
|
94
|
+
* IRREVERSIBLE: el equipo sale del enrolamiento, no queda desbloqueado.
|
|
95
|
+
*/
|
|
96
|
+
settle(
|
|
97
|
+
creditId: string,
|
|
98
|
+
input: CreditSettledRequest,
|
|
99
|
+
tenantId: string,
|
|
100
|
+
): Promise<StandardResponse<CreditSettledResponse>>;
|
|
101
|
+
|
|
76
102
|
activateCheck(
|
|
77
103
|
creditId: string,
|
|
78
104
|
input: ActivationCheckRequest,
|