apacuana-sdk-core 0.10.0 → 0.11.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.
Files changed (56) hide show
  1. package/README.md +305 -286
  2. package/coverage/clover.xml +337 -243
  3. package/coverage/coverage-final.json +9 -7
  4. package/coverage/lcov-report/index.html +34 -19
  5. package/coverage/lcov-report/src/api/certs.js.html +162 -87
  6. package/coverage/lcov-report/src/api/faceLiveness.js.html +496 -0
  7. package/coverage/lcov-report/src/api/index.html +43 -28
  8. package/coverage/lcov-report/src/api/revocations.js.html +103 -106
  9. package/coverage/lcov-report/src/api/signatures.js.html +25 -253
  10. package/coverage/lcov-report/src/api/users.js.html +7 -13
  11. package/coverage/lcov-report/src/config/index.html +1 -1
  12. package/coverage/lcov-report/src/config/index.js.html +1 -1
  13. package/coverage/lcov-report/src/errors/index.html +1 -1
  14. package/coverage/lcov-report/src/errors/index.js.html +8 -8
  15. package/coverage/lcov-report/src/index.html +1 -1
  16. package/coverage/lcov-report/src/index.js.html +26 -2
  17. package/coverage/lcov-report/src/success/index.html +116 -0
  18. package/coverage/lcov-report/src/success/index.js.html +106 -0
  19. package/coverage/lcov-report/src/utils/constant.js.html +4 -4
  20. package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
  21. package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
  22. package/coverage/lcov-report/src/utils/index.html +1 -1
  23. package/coverage/lcov.info +582 -406
  24. package/dist/api/certs.d.ts +9 -70
  25. package/dist/api/faceLiveness.d.ts +6 -0
  26. package/dist/api/revocations.d.ts +3 -42
  27. package/dist/api/signatures.d.ts +11 -153
  28. package/dist/index.d.ts +6 -0
  29. package/dist/index.js +463 -252
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +463 -252
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/success/index.d.ts +7 -0
  34. package/dist/types/certs.d.ts +97 -0
  35. package/dist/types/faceLiveness.d.ts +10 -0
  36. package/dist/types/revocations.d.ts +40 -0
  37. package/dist/types/signatures.d.ts +152 -0
  38. package/dist/types/users.d.ts +260 -0
  39. package/package.json +1 -1
  40. package/src/api/certs.js +74 -49
  41. package/src/api/faceLiveness.js +137 -0
  42. package/src/api/revocations.js +66 -67
  43. package/src/api/signatures.js +21 -97
  44. package/src/api/users.js +4 -6
  45. package/src/index.js +8 -0
  46. package/src/success/index.js +8 -0
  47. package/src/types/certs.js +56 -0
  48. package/src/types/faceLiveness.js +7 -0
  49. package/src/types/revocations.js +25 -0
  50. package/src/types/signatures.js +77 -0
  51. package/src/types/users.js +73 -0
  52. package/tests/api/certs.test.js +99 -6
  53. package/tests/api/faceLiveness.test.js +172 -0
  54. package/tests/api/revocations.test.js +37 -37
  55. package/tests/api/signatures.test.js +11 -5
  56. package/tests/api/users.test.js +3 -2
@@ -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 type GenerateCertResponse = {
8
- /**
9
- * - El certificado generado en formato string.
10
- */
11
- cert: string;
12
- /**
13
- * - El ID del certificado generado.
14
- */
15
- certifiedid: string;
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,3 @@
1
- export function requestRevocation(reasonCode: number): Promise<RevocationResponse>;
2
- export function getRevocationReasons(): Promise<RevocationReasonsResponse>;
3
- export type RequestRevocationResponse = {
4
- /**
5
- * - El estado de la solicitud de revocación (e.g., "pending").
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: any): Promise<ApacuanaSuccess>;
2
+ export function getRevocationReasons(): Promise<ApacuanaSuccess>;
3
+ import ApacuanaSuccess from "../success";
@@ -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: OnboardingSignerData | object): Promise<object>;
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
- * Define la estructura de un objeto Firmante.
12
- */
13
- export type Signer = {
14
- /**
15
- * - Nombre completo del firmante.
16
- */
17
- name: string;
18
- /**
19
- * - Correo electrónico del firmante.
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/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";