apacuana-sdk-core 0.10.0 → 0.12.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/README.md +305 -286
- package/coverage/clover.xml +345 -248
- package/coverage/coverage-final.json +9 -7
- package/coverage/lcov-report/index.html +41 -26
- package/coverage/lcov-report/src/api/certs.js.html +162 -87
- package/coverage/lcov-report/src/api/faceLiveness.js.html +523 -0
- package/coverage/lcov-report/src/api/index.html +43 -28
- package/coverage/lcov-report/src/api/revocations.js.html +132 -90
- package/coverage/lcov-report/src/api/signatures.js.html +25 -253
- package/coverage/lcov-report/src/api/users.js.html +23 -14
- package/coverage/lcov-report/src/config/index.html +1 -1
- package/coverage/lcov-report/src/config/index.js.html +1 -1
- package/coverage/lcov-report/src/errors/index.html +1 -1
- package/coverage/lcov-report/src/errors/index.js.html +8 -8
- package/coverage/lcov-report/src/index.html +13 -13
- package/coverage/lcov-report/src/index.js.html +96 -12
- package/coverage/lcov-report/src/success/index.html +116 -0
- package/coverage/lcov-report/src/success/index.js.html +106 -0
- package/coverage/lcov-report/src/utils/constant.js.html +4 -4
- package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
- package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov.info +597 -414
- package/dist/api/certs.d.ts +9 -70
- package/dist/api/faceLiveness.d.ts +6 -0
- package/dist/api/revocations.d.ts +6 -42
- package/dist/api/signatures.d.ts +11 -153
- package/dist/api/users.d.ts +16 -6
- package/dist/index.d.ts +6 -0
- package/dist/index.js +513 -259
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +513 -259
- package/dist/index.mjs.map +1 -1
- package/dist/success/index.d.ts +7 -0
- package/dist/types/certs.d.ts +97 -0
- package/dist/types/faceLiveness.d.ts +11 -0
- package/dist/types/revocations.d.ts +51 -0
- package/dist/types/signatures.d.ts +147 -0
- package/dist/types/users.d.ts +260 -0
- package/package.json +1 -1
- package/src/api/certs.js +74 -49
- package/src/api/faceLiveness.js +146 -0
- package/src/api/revocations.js +76 -62
- package/src/api/signatures.js +21 -97
- package/src/api/users.js +12 -9
- package/src/index.js +33 -5
- package/src/success/index.js +8 -0
- package/src/types/certs.js +56 -0
- package/src/types/faceLiveness.js +16 -0
- package/src/types/revocations.js +45 -0
- package/src/types/signatures.js +91 -0
- package/src/types/users.js +73 -0
- package/tests/api/certs.test.js +99 -6
- package/tests/api/faceLiveness.test.js +170 -0
- package/tests/api/revocations.test.js +35 -35
- package/tests/api/signatures.test.js +11 -5
- package/tests/api/users.test.js +3 -2
- package/tests/index.test.js +16 -8
package/dist/api/certs.d.ts
CHANGED
|
@@ -4,73 +4,12 @@ export function getCertTypes(): Promise<GetCertTypesResponse>;
|
|
|
4
4
|
export function getRequerimentsByTypeUser(params: {
|
|
5
5
|
type: number;
|
|
6
6
|
}): Promise<GetRequirementsResponse>;
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* - Indica si la operación fue exitosa.
|
|
18
|
-
*/
|
|
19
|
-
success: boolean;
|
|
20
|
-
};
|
|
21
|
-
export type GetCertStatusResponse = {
|
|
22
|
-
/**
|
|
23
|
-
* - El estado actual del certificado del usuario.
|
|
24
|
-
*/
|
|
25
|
-
status: string;
|
|
26
|
-
/**
|
|
27
|
-
* - Indica si la operación fue exitosa.
|
|
28
|
-
*/
|
|
29
|
-
success: boolean;
|
|
30
|
-
};
|
|
31
|
-
export type EncryptedCSRObject = {
|
|
32
|
-
/**
|
|
33
|
-
* - The encrypted Certificate Signing Request.
|
|
34
|
-
*/
|
|
35
|
-
csr: string;
|
|
36
|
-
};
|
|
37
|
-
export type CertType = {
|
|
38
|
-
/**
|
|
39
|
-
* - The ID of the certificate type.
|
|
40
|
-
*/
|
|
41
|
-
id: string;
|
|
42
|
-
/**
|
|
43
|
-
* - The name of the certificate type.
|
|
44
|
-
*/
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
47
|
-
export type GetCertTypesResponse = {
|
|
48
|
-
/**
|
|
49
|
-
* - A list of available certificate types.
|
|
50
|
-
*/
|
|
51
|
-
types: Array<CertType>;
|
|
52
|
-
/**
|
|
53
|
-
* - Indicates if the operation was successful.
|
|
54
|
-
*/
|
|
55
|
-
success: boolean;
|
|
56
|
-
};
|
|
57
|
-
export type Requirement = {
|
|
58
|
-
/**
|
|
59
|
-
* - The ID of the requirement.
|
|
60
|
-
*/
|
|
61
|
-
id: string;
|
|
62
|
-
/**
|
|
63
|
-
* - The description of the requirement.
|
|
64
|
-
*/
|
|
65
|
-
description: string;
|
|
66
|
-
};
|
|
67
|
-
export type GetRequirementsResponse = {
|
|
68
|
-
/**
|
|
69
|
-
* - A list of requirements for the user type.
|
|
70
|
-
*/
|
|
71
|
-
requirements: Array<Requirement>;
|
|
72
|
-
/**
|
|
73
|
-
* - Indicates if the operation was successful.
|
|
74
|
-
*/
|
|
75
|
-
success: boolean;
|
|
76
|
-
};
|
|
7
|
+
export function requestCertificate(params: CertificateRequestParams): Promise<RequestCertificateResponse>;
|
|
8
|
+
export type UserData = import("../types/users").UserData;
|
|
9
|
+
export type GenerateCertResponse = import("../types/certs").GenerateCertResponse;
|
|
10
|
+
export type GetCertStatusResponse = import("../types/certs").GetCertStatusResponse;
|
|
11
|
+
export type EncryptedCSRObject = import("../types/certs").EncryptedCSRObject;
|
|
12
|
+
export type GetCertTypesResponse = import("../types/certs").GetCertTypesResponse;
|
|
13
|
+
export type GetRequirementsResponse = import("../types/certs").GetRequirementsResponse;
|
|
14
|
+
export type CertificateRequestParams = import("../types/certs").CertificateRequestParams;
|
|
15
|
+
export type RequestCertificateResponse = import("../types/certs").RequestCertificateResponse;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export function createFaceLivenessSession(): Promise<CreateFaceLivenessSessionResponse>;
|
|
2
|
+
export function validateFaceLiveness({ sessionId }: {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
}): Promise<ApacuanaSuccess>;
|
|
5
|
+
export type CreateFaceLivenessSessionResponse = import("../types/faceLiveness").CreateFaceLivenessSessionResponse;
|
|
6
|
+
import ApacuanaSuccess from "../success";
|
|
@@ -1,42 +1,6 @@
|
|
|
1
|
-
export function requestRevocation(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
revocationStatus: string;
|
|
8
|
-
/**
|
|
9
|
-
* - El ID de la solicitud de revocación.
|
|
10
|
-
*/
|
|
11
|
-
requestId: string | number;
|
|
12
|
-
};
|
|
13
|
-
export type RevocationResponse = {
|
|
14
|
-
/**
|
|
15
|
-
* - Indicates if the revocation request was successful.
|
|
16
|
-
*/
|
|
17
|
-
success: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* - A message providing details about the outcome.
|
|
20
|
-
*/
|
|
21
|
-
message?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
export type RevocationReason = {
|
|
24
|
-
/**
|
|
25
|
-
* - The code for the revocation reason.
|
|
26
|
-
*/
|
|
27
|
-
code: string;
|
|
28
|
-
/**
|
|
29
|
-
* - The description of the revocation reason.
|
|
30
|
-
*/
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
export type RevocationReasonsResponse = {
|
|
34
|
-
/**
|
|
35
|
-
* - Indicates if the request was successful.
|
|
36
|
-
*/
|
|
37
|
-
success: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* - A list of revocation reasons.
|
|
40
|
-
*/
|
|
41
|
-
reasons: RevocationReason[];
|
|
42
|
-
};
|
|
1
|
+
export function requestRevocation(params: {
|
|
2
|
+
reasonCode: number;
|
|
3
|
+
}): Promise<RequestRevocationResponse>;
|
|
4
|
+
export function getRevocationReasons(): Promise<GetRevocationReasonsResponse>;
|
|
5
|
+
export type RequestRevocationResponse = import("../types/revocations").RequestRevocationResponse;
|
|
6
|
+
export type GetRevocationReasonsResponse = import("../types/revocations").GetRevocationReasonsResponse;
|
package/dist/api/signatures.d.ts
CHANGED
|
@@ -1,161 +1,19 @@
|
|
|
1
1
|
export function signDocument(signData: SignDocumentData): Promise<object>;
|
|
2
2
|
export function getDigest(signData: GetDigestData): Promise<GetDigestResponse>;
|
|
3
|
-
export function addSigner(signerData:
|
|
3
|
+
export function addSigner(signerData: SignerData): Promise<AddSignerResponse>;
|
|
4
4
|
export function getDocs(data: GetDocsParams): Promise<GetDocsResponse>;
|
|
5
5
|
export function uploadSignatureVariant(data: {
|
|
6
6
|
file: File;
|
|
7
7
|
}): Promise<object>;
|
|
8
8
|
export function getSignatureVariant(): Promise<object>;
|
|
9
9
|
export function deleteSignatureVariant(): Promise<object>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export type
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
email: string;
|
|
22
|
-
/**
|
|
23
|
-
* - Documento de identidad del firmante.
|
|
24
|
-
*/
|
|
25
|
-
document: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Define la estructura de datos para añadir un firmante.
|
|
29
|
-
*/
|
|
30
|
-
export type SignerData = {
|
|
31
|
-
/**
|
|
32
|
-
* - Identificador único del documento.
|
|
33
|
-
*/
|
|
34
|
-
docId: string;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Define la estructura de la respuesta al añadir un firmante.
|
|
38
|
-
*/
|
|
39
|
-
export type AddSignerResponse = {
|
|
40
|
-
/**
|
|
41
|
-
* - Identificador de confirmación del firmante añadido.
|
|
42
|
-
*/
|
|
43
|
-
signer: string;
|
|
44
|
-
/**
|
|
45
|
-
* - Indica si la operación fue exitosa.
|
|
46
|
-
*/
|
|
47
|
-
success: boolean;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Define la estructura de datos para obtener el digest de un documento.
|
|
51
|
-
*/
|
|
52
|
-
export type GetDigestData = {
|
|
53
|
-
/**
|
|
54
|
-
* - Certificado del firmante en formato base64.
|
|
55
|
-
*/
|
|
56
|
-
cert: string;
|
|
57
|
-
/**
|
|
58
|
-
* - Identificador único del proceso de firma.
|
|
59
|
-
*/
|
|
60
|
-
signatureId: string;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Define la estructura de la respuesta al obtener el digest.
|
|
64
|
-
*/
|
|
65
|
-
export type GetDigestResponse = {
|
|
66
|
-
/**
|
|
67
|
-
* - El digest del documento que se va a firmar.
|
|
68
|
-
*/
|
|
69
|
-
digest: string;
|
|
70
|
-
/**
|
|
71
|
-
* - Indica si la operación fue exitosa.
|
|
72
|
-
*/
|
|
73
|
-
success: boolean;
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Define la estructura de los parámetros para obtener documentos.
|
|
77
|
-
*/
|
|
78
|
-
export type GetDocsParams = {
|
|
79
|
-
/**
|
|
80
|
-
* - Número de página para la paginación.
|
|
81
|
-
*/
|
|
82
|
-
page: number;
|
|
83
|
-
/**
|
|
84
|
-
* - Cantidad de registros por página.
|
|
85
|
-
*/
|
|
86
|
-
size: number;
|
|
87
|
-
/**
|
|
88
|
-
* - (Opcional) Estado para filtrar los documentos.
|
|
89
|
-
*/
|
|
90
|
-
status?: string | undefined;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* Define la estructura de la respuesta al obtener documentos.
|
|
94
|
-
*/
|
|
95
|
-
export type GetDocsResponse = {
|
|
96
|
-
/**
|
|
97
|
-
* - El número total de registros encontrados.
|
|
98
|
-
*/
|
|
99
|
-
totalRecords: number;
|
|
100
|
-
/**
|
|
101
|
-
* - Un arreglo con los registros de los documentos.
|
|
102
|
-
*/
|
|
103
|
-
records: Array<object>;
|
|
104
|
-
/**
|
|
105
|
-
* - Indica si la operación fue exitosa.
|
|
106
|
-
*/
|
|
107
|
-
success: boolean;
|
|
108
|
-
};
|
|
109
|
-
export type SignDocumentData = {
|
|
110
|
-
/**
|
|
111
|
-
* - Objeto con información de la firma.
|
|
112
|
-
*/
|
|
113
|
-
signature: {
|
|
114
|
-
id: string;
|
|
115
|
-
positions: Array<object>;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* - Certificado en base64.
|
|
119
|
-
*/
|
|
120
|
-
cert: string;
|
|
121
|
-
/**
|
|
122
|
-
* - Digest firmado.
|
|
123
|
-
*/
|
|
124
|
-
signedDigest: string;
|
|
125
|
-
};
|
|
126
|
-
export type SignaturePosition = {
|
|
127
|
-
/**
|
|
128
|
-
* - The page number for the signature.
|
|
129
|
-
*/
|
|
130
|
-
page: number;
|
|
131
|
-
/**
|
|
132
|
-
* - The x-coordinate for the signature's position (from 0 to 1).
|
|
133
|
-
*/
|
|
134
|
-
x: number;
|
|
135
|
-
/**
|
|
136
|
-
* - The y-coordinate for the signature's position (from 0 to 1).
|
|
137
|
-
*/
|
|
138
|
-
y: number;
|
|
139
|
-
};
|
|
140
|
-
export type OnboardingSignerData = {
|
|
141
|
-
/**
|
|
142
|
-
* - The name of the document.
|
|
143
|
-
*/
|
|
144
|
-
name: string;
|
|
145
|
-
/**
|
|
146
|
-
* - An external reference for the document.
|
|
147
|
-
*/
|
|
148
|
-
reference: string;
|
|
149
|
-
/**
|
|
150
|
-
* - The type of document of the signer (e.g., "V", "E", "J").
|
|
151
|
-
*/
|
|
152
|
-
typedoc: string;
|
|
153
|
-
/**
|
|
154
|
-
* - The document number of the signer.
|
|
155
|
-
*/
|
|
156
|
-
doc: string;
|
|
157
|
-
/**
|
|
158
|
-
* - An array of signature positions.
|
|
159
|
-
*/
|
|
160
|
-
signature: SignaturePosition[];
|
|
161
|
-
};
|
|
10
|
+
export type Signer = import("../types/signatures").Signer;
|
|
11
|
+
export type SignerData = import("../types/signatures").SignerData;
|
|
12
|
+
export type AddSignerResponse = import("../types/signatures").AddSignerResponse;
|
|
13
|
+
export type GetDigestData = import("../types/signatures").GetDigestData;
|
|
14
|
+
export type GetDigestResponse = import("../types/signatures").GetDigestResponse;
|
|
15
|
+
export type GetDocsParams = import("../types/signatures").GetDocsParams;
|
|
16
|
+
export type GetDocsResponse = import("../types/signatures").GetDocsResponse;
|
|
17
|
+
export type SignDocumentData = import("../types/signatures").SignDocumentData;
|
|
18
|
+
export type SignaturePosition = import("../types/signatures").SignaturePosition;
|
|
19
|
+
export type OnboardingSignerData = import("../types/signatures").OnboardingSignerData;
|
package/dist/api/users.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default getCustomer;
|
|
2
|
-
export type
|
|
2
|
+
export type GetCustomerData = {
|
|
3
3
|
/**
|
|
4
4
|
* - El token de sesión del usuario.
|
|
5
5
|
*/
|
|
@@ -8,23 +8,33 @@ export type GetCustomerResponse = {
|
|
|
8
8
|
* - Los datos del usuario obtenidos.
|
|
9
9
|
*/
|
|
10
10
|
userData: object;
|
|
11
|
+
};
|
|
12
|
+
export type GetCustomerResponse = {
|
|
13
|
+
/**
|
|
14
|
+
* - Indica que la operación fue exitosa.
|
|
15
|
+
*/
|
|
16
|
+
success: true;
|
|
11
17
|
/**
|
|
12
|
-
* -
|
|
18
|
+
* - El payload de la respuesta.
|
|
13
19
|
*/
|
|
14
|
-
|
|
20
|
+
data: GetCustomerData;
|
|
15
21
|
};
|
|
16
22
|
/**
|
|
17
|
-
* @typedef {object}
|
|
23
|
+
* @typedef {object} GetCustomerData
|
|
18
24
|
* @property {string} token - El token de sesión del usuario.
|
|
19
25
|
* @property {object} userData - Los datos del usuario obtenidos.
|
|
20
|
-
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {object} GetCustomerResponse
|
|
29
|
+
* @property {true} success - Indica que la operación fue exitosa.
|
|
30
|
+
* @property {GetCustomerData} data - El payload de la respuesta.
|
|
21
31
|
*/
|
|
22
32
|
/**
|
|
23
33
|
* Obtiene el token de un usuario a través de una petición POST.
|
|
24
34
|
* Este método es útil para endpoints que requieren datos en el cuerpo de la petición
|
|
25
35
|
* para buscar un usuario, como un ID de sesión o un token de acceso.
|
|
26
36
|
*
|
|
27
|
-
* @returns {Promise<GetCustomerResponse>}
|
|
37
|
+
* @returns {Promise<GetCustomerResponse>} Una promesa que resuelve a un objeto con la respuesta exitosa.
|
|
28
38
|
* @throws {Error} Si los parámetros de entrada son inválidos.
|
|
29
39
|
* @throws {ApacuanaAPIError} Si ocurre un error en la API de Apacuana.
|
|
30
40
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ declare namespace apacuana {
|
|
|
24
24
|
export { deleteSignatureVariant };
|
|
25
25
|
export { getCertTypes };
|
|
26
26
|
export { getRequerimentsByTypeUser };
|
|
27
|
+
export { createFaceLivenessSession };
|
|
28
|
+
export { validateFaceLiveness };
|
|
29
|
+
export { requestCertificate };
|
|
27
30
|
}
|
|
28
31
|
import { getConfig } from "./config/index";
|
|
29
32
|
import { requestRevocation } from "./api/revocations";
|
|
@@ -40,3 +43,6 @@ import { getSignatureVariant } from "./api/signatures";
|
|
|
40
43
|
import { deleteSignatureVariant } from "./api/signatures";
|
|
41
44
|
import { getCertTypes } from "./api/certs";
|
|
42
45
|
import { getRequerimentsByTypeUser } from "./api/certs";
|
|
46
|
+
import { createFaceLivenessSession } from "./api/faceLiveness";
|
|
47
|
+
import { validateFaceLiveness } from "./api/faceLiveness";
|
|
48
|
+
import { requestCertificate } from "./api/certs";
|