apacuana-sdk-core 0.6.0 → 0.7.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 +105 -250
- package/babel.config.cjs +11 -0
- package/coverage/clover.xml +189 -195
- package/coverage/coverage-final.json +8 -8
- package/coverage/lcov-report/api/index.html +131 -0
- package/coverage/lcov-report/api/signatures.js.html +1093 -0
- package/coverage/lcov-report/api/users.js.html +292 -0
- package/coverage/lcov-report/config/index.html +116 -0
- package/coverage/lcov-report/config/index.js.html +208 -0
- package/coverage/lcov-report/errors/index.html +116 -0
- package/coverage/lcov-report/errors/index.js.html +148 -0
- package/coverage/lcov-report/index.html +41 -41
- package/coverage/lcov-report/src/api/certs.js.html +55 -34
- package/coverage/lcov-report/src/api/index.html +25 -25
- package/coverage/lcov-report/src/api/revocations.js.html +135 -30
- package/coverage/lcov-report/src/api/signatures.js.html +76 -4
- package/coverage/lcov-report/src/api/users.js.html +1 -1
- package/coverage/lcov-report/src/config/index.html +13 -13
- package/coverage/lcov-report/src/config/index.js.html +69 -18
- 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 +15 -15
- package/coverage/lcov-report/src/index.js.html +14 -68
- package/coverage/lcov-report/src/utils/constant.js.html +1 -1
- package/coverage/lcov-report/src/utils/helpers.js.html +18 -51
- package/coverage/lcov-report/src/utils/httpClient.js.html +6 -72
- package/coverage/lcov-report/src/utils/index.html +19 -19
- package/coverage/lcov-report/utils/constant.js.html +145 -0
- package/coverage/lcov-report/utils/httpClient.js.html +646 -0
- package/coverage/lcov-report/utils/index.html +131 -0
- package/coverage/lcov.info +334 -337
- package/dist/api/certs.d.ts +11 -1
- package/dist/api/revocations.d.ts +32 -12
- package/dist/api/signatures.d.ts +37 -5
- package/dist/config/index.d.ts +13 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.js +436 -290
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +436 -290
- package/dist/index.mjs.map +1 -1
- package/dist/utils/helpers.d.ts +1 -1
- package/jest.config.cjs +6 -1
- package/package.json +12 -7
- package/rollup.config.js +1 -1
- package/src/api/certs.js +17 -10
- package/src/api/revocations.js +55 -20
- package/src/api/signatures.js +25 -1
- package/src/config/index.js +25 -8
- package/src/index.js +4 -22
- package/src/utils/helpers.js +11 -22
- package/src/utils/httpClient.js +0 -22
- package/tests/api/certs.test.js +30 -48
- package/tsconfig.json +2 -1
- package/.babelrc +0 -3
package/dist/api/certs.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
export function generateCert(
|
|
1
|
+
export function generateCert(encryptedCSR: EncryptedCSRObject): Promise<GenerateCertResponse>;
|
|
2
2
|
export function getCertStatus(isCertificateInDevice?: boolean): GetCertStatusResponse;
|
|
3
3
|
export type GenerateCertResponse = {
|
|
4
4
|
/**
|
|
5
5
|
* - El certificado generado en formato string.
|
|
6
6
|
*/
|
|
7
7
|
cert: string;
|
|
8
|
+
/**
|
|
9
|
+
* - El ID del certificado generado.
|
|
10
|
+
*/
|
|
11
|
+
certifiedid: string;
|
|
8
12
|
/**
|
|
9
13
|
* - Indica si la operación fue exitosa.
|
|
10
14
|
*/
|
|
@@ -20,3 +24,9 @@ export type GetCertStatusResponse = {
|
|
|
20
24
|
*/
|
|
21
25
|
success: boolean;
|
|
22
26
|
};
|
|
27
|
+
export type EncryptedCSRObject = {
|
|
28
|
+
/**
|
|
29
|
+
* - The encrypted Certificate Signing Request.
|
|
30
|
+
*/
|
|
31
|
+
csr: string;
|
|
32
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function requestRevocation(reasonCode: number): Promise<RevocationResponse>;
|
|
2
|
+
export function getRevocationReasons(): Promise<RevocationReasonsResponse>;
|
|
2
3
|
export type RequestRevocationResponse = {
|
|
3
4
|
/**
|
|
4
5
|
* - El estado de la solicitud de revocación (e.g., "pending").
|
|
@@ -9,14 +10,33 @@ export type RequestRevocationResponse = {
|
|
|
9
10
|
*/
|
|
10
11
|
requestId: string | number;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
};
|
package/dist/api/signatures.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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: OnboardingSignerData | object): Promise<object>;
|
|
4
4
|
export function getDocs(data: GetDocsParams): Promise<GetDocsResponse>;
|
|
5
5
|
/**
|
|
6
6
|
* Define la estructura de un objeto Firmante.
|
|
@@ -27,10 +27,6 @@ export type SignerData = {
|
|
|
27
27
|
* - Identificador único del documento.
|
|
28
28
|
*/
|
|
29
29
|
docId: string;
|
|
30
|
-
/**
|
|
31
|
-
* - Objeto con la información del firmante.
|
|
32
|
-
*/
|
|
33
|
-
signer: Signer;
|
|
34
30
|
};
|
|
35
31
|
/**
|
|
36
32
|
* Define la estructura de la respuesta al añadir un firmante.
|
|
@@ -122,3 +118,39 @@ export type SignDocumentData = {
|
|
|
122
118
|
*/
|
|
123
119
|
signedDigest: string;
|
|
124
120
|
};
|
|
121
|
+
export type SignaturePosition = {
|
|
122
|
+
/**
|
|
123
|
+
* - The page number for the signature.
|
|
124
|
+
*/
|
|
125
|
+
page: number;
|
|
126
|
+
/**
|
|
127
|
+
* - The x-coordinate for the signature's position (from 0 to 1).
|
|
128
|
+
*/
|
|
129
|
+
x: number;
|
|
130
|
+
/**
|
|
131
|
+
* - The y-coordinate for the signature's position (from 0 to 1).
|
|
132
|
+
*/
|
|
133
|
+
y: number;
|
|
134
|
+
};
|
|
135
|
+
export type OnboardingSignerData = {
|
|
136
|
+
/**
|
|
137
|
+
* - The name of the document.
|
|
138
|
+
*/
|
|
139
|
+
name: string;
|
|
140
|
+
/**
|
|
141
|
+
* - An external reference for the document.
|
|
142
|
+
*/
|
|
143
|
+
reference: string;
|
|
144
|
+
/**
|
|
145
|
+
* - The type of document of the signer (e.g., "V", "E", "J").
|
|
146
|
+
*/
|
|
147
|
+
typedoc: string;
|
|
148
|
+
/**
|
|
149
|
+
* - The document number of the signer.
|
|
150
|
+
*/
|
|
151
|
+
doc: string;
|
|
152
|
+
/**
|
|
153
|
+
* - An array of signature positions.
|
|
154
|
+
*/
|
|
155
|
+
signature: SignaturePosition[];
|
|
156
|
+
};
|
package/dist/config/index.d.ts
CHANGED
|
@@ -6,6 +6,17 @@ export function getConfig(): {
|
|
|
6
6
|
verificationId: string;
|
|
7
7
|
customerId: string;
|
|
8
8
|
integrationType: string;
|
|
9
|
-
userData
|
|
10
|
-
token
|
|
9
|
+
userData?: object | undefined;
|
|
10
|
+
token?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export function cleanConfig(): void;
|
|
13
|
+
export type SDKConfig = {
|
|
14
|
+
apiUrl: string;
|
|
15
|
+
secretKey: string;
|
|
16
|
+
apiKey: string;
|
|
17
|
+
verificationId: string;
|
|
18
|
+
customerId: string;
|
|
19
|
+
integrationType: string;
|
|
20
|
+
userData?: object | undefined;
|
|
21
|
+
token?: string | undefined;
|
|
11
22
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare namespace apacuana {
|
|
|
8
8
|
customerId: string;
|
|
9
9
|
integrationType: string;
|
|
10
10
|
}): Promise<object>;
|
|
11
|
+
export function close(): void;
|
|
11
12
|
export { getConfig };
|
|
12
13
|
export { requestRevocation };
|
|
13
14
|
export { getCertStatus };
|
|
@@ -17,9 +18,10 @@ declare namespace apacuana {
|
|
|
17
18
|
export { generateCert };
|
|
18
19
|
export { signDocument };
|
|
19
20
|
export { getDigest };
|
|
21
|
+
export { getRevocationReasons };
|
|
20
22
|
}
|
|
21
23
|
import { getConfig } from "./config/index";
|
|
22
|
-
import requestRevocation from "./api/revocations";
|
|
24
|
+
import { requestRevocation } from "./api/revocations";
|
|
23
25
|
import { getCertStatus } from "./api/certs";
|
|
24
26
|
import getCustomer from "./api/users";
|
|
25
27
|
import { addSigner } from "./api/signatures";
|
|
@@ -27,3 +29,4 @@ import { getDocs } from "./api/signatures";
|
|
|
27
29
|
import { generateCert } from "./api/certs";
|
|
28
30
|
import { signDocument } from "./api/signatures";
|
|
29
31
|
import { getDigest } from "./api/signatures";
|
|
32
|
+
import { getRevocationReasons } from "./api/revocations";
|