@fiado/api-invoker 3.8.0 → 3.9.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/cnbv-business/CnbvApi.d.ts +1 -1
- package/bin/cnbv-business/CnbvApi.js +10 -2
- package/bin/cnbv-business/interfaces/ICnbvApi.d.ts +13 -1
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.d.ts +46 -0
- package/bin/cognitoConnector/interfaces/ICognitoConnectorApiV2.js +2 -0
- package/bin/estafeta/EstafetaApi.d.ts +0 -0
- package/bin/estafeta/EstafetaApi.js +0 -0
- package/bin/report-processor-business/api/IReportProcessorBusiness.d.ts +3 -0
- package/bin/report-processor-business/api/IReportProcessorBusiness.js +2 -0
- package/package.json +1 -1
- package/src/cnbv-business/CnbvApi.ts +12 -3
- package/src/cnbv-business/interfaces/ICnbvApi.ts +14 -2
|
@@ -4,5 +4,5 @@ export default class CnbvApi implements ICnbvApi {
|
|
|
4
4
|
private httpRequest;
|
|
5
5
|
private readonly baseUrl;
|
|
6
6
|
constructor(httpRequest: IHttpRequest);
|
|
7
|
-
validateConcidence(fullName: string, yearOfBirth: string): Promise<any>;
|
|
7
|
+
validateConcidence(fullName: string, yearOfBirth: string, curp10?: string): Promise<any>;
|
|
8
8
|
}
|
|
@@ -18,8 +18,16 @@ let CnbvApi = class CnbvApi {
|
|
|
18
18
|
this.httpRequest = httpRequest;
|
|
19
19
|
this.baseUrl = process.env.CNBV_LAMBDA_URL || "";
|
|
20
20
|
}
|
|
21
|
-
async validateConcidence(fullName, yearOfBirth) {
|
|
22
|
-
const
|
|
21
|
+
async validateConcidence(fullName, yearOfBirth, curp10) {
|
|
22
|
+
const query = [
|
|
23
|
+
`value=${encodeURIComponent(yearOfBirth)}`,
|
|
24
|
+
`param=YEAR_OF_BIRTH`,
|
|
25
|
+
`fullName=${encodeURIComponent(fullName)}`,
|
|
26
|
+
];
|
|
27
|
+
if (curp10 !== undefined && curp10 !== null && curp10 !== "") {
|
|
28
|
+
query.push(`curp=${encodeURIComponent(curp10)}`);
|
|
29
|
+
}
|
|
30
|
+
const url = `${this.baseUrl}?${query.join("&")}`;
|
|
23
31
|
return await this.httpRequest.get(url);
|
|
24
32
|
}
|
|
25
33
|
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
export interface ICnbvApi {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Consulta coincidencias en la lista CNBV (LPB).
|
|
4
|
+
* El matching real ya no usa yearOfBirth (cnbv-business hace fuzzy match sólo por nombre
|
|
5
|
+
* sobre toda la tabla ACTIVE). El parámetro se mantiene por compatibilidad con
|
|
6
|
+
* consumidores antiguos pero su valor es ignorado.
|
|
7
|
+
*
|
|
8
|
+
* @param fullName nombre completo del people de Fiado (requerido)
|
|
9
|
+
* @param yearOfBirth año de nacimiento (ignorado en el matching pero el endpoint sigue
|
|
10
|
+
* aceptándolo por backwards compatibility)
|
|
11
|
+
* @param curp10 primeros 10 chars del CURP del people. Si se provee, cnbv-business además
|
|
12
|
+
* hace match exacto contra `rfc.substring(0, 10)` en los registros CNBV.
|
|
13
|
+
*/
|
|
14
|
+
validateConcidence(fullName: string, yearOfBirth: string, curp10?: string): Promise<any>;
|
|
3
15
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/api-invoker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.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",
|
|
@@ -12,11 +12,20 @@ export default class CnbvApi implements ICnbvApi {
|
|
|
12
12
|
constructor(@inject("IHttpRequest") private httpRequest: IHttpRequest) { }
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
async validateConcidence(fullName: string, yearOfBirth: string): Promise<any> {
|
|
15
|
+
async validateConcidence(fullName: string, yearOfBirth: string, curp10?: string): Promise<any> {
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const query: string[] = [
|
|
18
|
+
`value=${encodeURIComponent(yearOfBirth)}`,
|
|
19
|
+
`param=YEAR_OF_BIRTH`,
|
|
20
|
+
`fullName=${encodeURIComponent(fullName)}`,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
if (curp10 !== undefined && curp10 !== null && curp10 !== "") {
|
|
24
|
+
query.push(`curp=${encodeURIComponent(curp10)}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const url = `${this.baseUrl}?${query.join("&")}`;
|
|
18
28
|
|
|
19
29
|
return await this.httpRequest.get(url);
|
|
20
30
|
}
|
|
21
31
|
}
|
|
22
|
-
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
export interface ICnbvApi {
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Consulta coincidencias en la lista CNBV (LPB).
|
|
7
|
+
* El matching real ya no usa yearOfBirth (cnbv-business hace fuzzy match sólo por nombre
|
|
8
|
+
* sobre toda la tabla ACTIVE). El parámetro se mantiene por compatibilidad con
|
|
9
|
+
* consumidores antiguos pero su valor es ignorado.
|
|
10
|
+
*
|
|
11
|
+
* @param fullName nombre completo del people de Fiado (requerido)
|
|
12
|
+
* @param yearOfBirth año de nacimiento (ignorado en el matching pero el endpoint sigue
|
|
13
|
+
* aceptándolo por backwards compatibility)
|
|
14
|
+
* @param curp10 primeros 10 chars del CURP del people. Si se provee, cnbv-business además
|
|
15
|
+
* hace match exacto contra `rfc.substring(0, 10)` en los registros CNBV.
|
|
16
|
+
*/
|
|
17
|
+
validateConcidence(fullName: string, yearOfBirth: string, curp10?: string): Promise<any>
|
|
6
18
|
|
|
7
|
-
}
|
|
19
|
+
}
|