apacuana-sdk-core 1.0.0 → 1.2.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/.eslintrc.cjs +22 -0
- package/CHANGELOG.md +1 -0
- package/README.md +794 -0
- package/babel.config.cjs +11 -0
- package/coverage/clover.xml +628 -0
- package/coverage/coverage-final.json +13 -0
- 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/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/certs.js.html +175 -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/favicon.png +0 -0
- package/coverage/lcov-report/index.html +191 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/api/certs.js.html +856 -0
- package/coverage/lcov-report/src/api/faceLiveness.js.html +523 -0
- package/coverage/lcov-report/src/api/index.html +176 -0
- package/coverage/lcov-report/src/api/revocations.js.html +412 -0
- package/coverage/lcov-report/src/api/signatures.js.html +1420 -0
- package/coverage/lcov-report/src/api/users.js.html +466 -0
- package/coverage/lcov-report/src/config/index.html +116 -0
- package/coverage/lcov-report/src/config/index.js.html +256 -0
- package/coverage/lcov-report/src/errors/index.html +116 -0
- package/coverage/lcov-report/src/errors/index.js.html +148 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.js.html +592 -0
- 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 +256 -0
- package/coverage/lcov-report/src/utils/helpers.js.html +1195 -0
- package/coverage/lcov-report/src/utils/httpClient.js.html +622 -0
- package/coverage/lcov-report/src/utils/index.html +146 -0
- 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 +1259 -0
- package/dist/api/certs.d.ts +15 -0
- package/dist/api/faceLiveness.d.ts +6 -0
- package/dist/api/revocations.d.ts +6 -0
- package/dist/api/signatures.d.ts +19 -0
- package/dist/api/users.d.ts +47 -0
- package/dist/config/index.d.ts +22 -0
- package/dist/errors/index.d.ts +10 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +34493 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +34491 -0
- package/dist/index.mjs.map +1 -0
- package/dist/success/index.d.ts +7 -0
- package/dist/types/certs.d.ts +83 -0
- package/dist/types/faceLiveness.d.ts +11 -0
- package/dist/types/revocations.d.ts +51 -0
- package/dist/types/signatures.d.ts +162 -0
- package/dist/types/users.d.ts +260 -0
- package/dist/utils/constant.d.ts +49 -0
- package/dist/utils/helpers.d.ts +25 -0
- package/dist/utils/httpClient.d.ts +3 -0
- package/jest.config.cjs +12 -0
- package/package.json +51 -9
- package/rollup.config.js +32 -0
- package/src/api/certs.js +257 -0
- package/src/api/faceLiveness.js +146 -0
- package/src/api/revocations.js +109 -0
- package/src/api/signatures.js +445 -0
- package/src/api/users.js +127 -0
- package/src/config/index.js +57 -0
- package/src/errors/index.js +21 -0
- package/src/index.js +169 -0
- package/src/success/index.js +8 -0
- package/src/types/certs.js +67 -0
- package/src/types/faceLiveness.js +16 -0
- package/src/types/revocations.js +45 -0
- package/src/types/signatures.js +96 -0
- package/src/types/users.js +73 -0
- package/src/utils/constant.js +57 -0
- package/src/utils/helpers.js +370 -0
- package/src/utils/httpClient.js +179 -0
- package/tests/api/certs.test.js +311 -0
- package/tests/api/faceLiveness.test.js +170 -0
- package/tests/api/revocations.test.js +119 -0
- package/tests/api/signatures.test.js +530 -0
- package/tests/api/users.test.js +117 -0
- package/tests/index.test.js +131 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function generateCert(encryptedCSR: EncryptedCSRObject): Promise<GenerateCertResponse>;
|
|
2
|
+
export function getCertStatus(isCertificateInDevice?: boolean): GetCertStatusResponse;
|
|
3
|
+
export function getCertTypes(): Promise<GetCertTypesResponse>;
|
|
4
|
+
export function getRequerimentsByTypeUser(params: {
|
|
5
|
+
type: number;
|
|
6
|
+
}): Promise<GetRequirementsResponse>;
|
|
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";
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function signDocument(signData: SignDocumentData): Promise<object>;
|
|
2
|
+
export function getDigest(signData: GetDigestData): Promise<GetDigestResponse>;
|
|
3
|
+
export function addSigner(signerData: SignerData): Promise<AddSignerResponse>;
|
|
4
|
+
export function getDocs(data: GetDocsParams): Promise<GetDocsResponse>;
|
|
5
|
+
export function uploadSignatureVariant(data: {
|
|
6
|
+
file: File;
|
|
7
|
+
}): Promise<object>;
|
|
8
|
+
export function getSignatureVariant(): Promise<object>;
|
|
9
|
+
export function deleteSignatureVariant(): Promise<object>;
|
|
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;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function getCustomer(): Promise<GetCustomerResponse>;
|
|
2
|
+
export function createApacuanaUser(userData: CreateUserPayload): Promise<ApacuanaSuccess>;
|
|
3
|
+
export type GetCustomerData = {
|
|
4
|
+
/**
|
|
5
|
+
* - El token de sesión del usuario.
|
|
6
|
+
*/
|
|
7
|
+
token: string;
|
|
8
|
+
/**
|
|
9
|
+
* - Los datos del usuario obtenidos.
|
|
10
|
+
*/
|
|
11
|
+
userData: object;
|
|
12
|
+
};
|
|
13
|
+
export type GetCustomerResponse = {
|
|
14
|
+
/**
|
|
15
|
+
* - Indica que la operación fue exitosa.
|
|
16
|
+
*/
|
|
17
|
+
success: true;
|
|
18
|
+
/**
|
|
19
|
+
* - El payload de la respuesta.
|
|
20
|
+
*/
|
|
21
|
+
data: GetCustomerData;
|
|
22
|
+
};
|
|
23
|
+
export type CreateUserPayload = {
|
|
24
|
+
/**
|
|
25
|
+
* - Correo electrónico del usuario.
|
|
26
|
+
*/
|
|
27
|
+
usr: string;
|
|
28
|
+
/**
|
|
29
|
+
* - Contraseña del usuario.
|
|
30
|
+
*/
|
|
31
|
+
pwd: string;
|
|
32
|
+
/**
|
|
33
|
+
* - Tipo de documento de identidad (ej. 'V', 'P', 'E').
|
|
34
|
+
*/
|
|
35
|
+
kinddoc: string;
|
|
36
|
+
/**
|
|
37
|
+
* - Número de documento de identidad.
|
|
38
|
+
*/
|
|
39
|
+
doc: string;
|
|
40
|
+
};
|
|
41
|
+
export type CreateUserResponse = {
|
|
42
|
+
/**
|
|
43
|
+
* - Mensaje de confirmación de la creación del usuario.
|
|
44
|
+
*/
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
47
|
+
import ApacuanaSuccess from "../success";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function setConfig(newConfig: any): void;
|
|
2
|
+
export function getConfig(): {
|
|
3
|
+
apiUrl: string;
|
|
4
|
+
secretKey: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
verificationId: string;
|
|
7
|
+
customerId: string;
|
|
8
|
+
integrationType: string;
|
|
9
|
+
userData?: object | undefined;
|
|
10
|
+
token?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export function close(): 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;
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clase de error personalizada para errores de la API de Apacuana.
|
|
3
|
+
*/
|
|
4
|
+
export class ApacuanaAPIError extends Error {
|
|
5
|
+
constructor(message: any, statusCode?: number, errorCode?: null);
|
|
6
|
+
statusCode: number;
|
|
7
|
+
errorCode: any;
|
|
8
|
+
success: boolean;
|
|
9
|
+
}
|
|
10
|
+
export default ApacuanaAPIError;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default apacuana;
|
|
2
|
+
declare namespace apacuana {
|
|
3
|
+
export function init(config: any): Promise<ApacuanaSuccess>;
|
|
4
|
+
export function requestRevocation(data: any): Promise<import("./types/revocations").RequestRevocationResponse>;
|
|
5
|
+
export function getRevocationReasons(): Promise<import("./types/revocations").GetRevocationReasonsResponse>;
|
|
6
|
+
export function generateCert(data: any): Promise<any>;
|
|
7
|
+
export function getCertStatus(isCertificateInDevice: any): any;
|
|
8
|
+
export function getCertTypes(): Promise<any>;
|
|
9
|
+
export function getRequerimentsByTypeUser(data: any): Promise<any>;
|
|
10
|
+
export function addSigner(data: any): Promise<import("./types/signatures").AddSignerResponse>;
|
|
11
|
+
export function deleteSignatureVariant(): Promise<object>;
|
|
12
|
+
export function getDigest(data: any): Promise<import("./types/signatures").GetDigestResponse>;
|
|
13
|
+
export function getDocs(data: any): Promise<import("./types/signatures").GetDocsResponse>;
|
|
14
|
+
export function getSignatureVariant(): Promise<object>;
|
|
15
|
+
export function signDocument(data: any): Promise<object>;
|
|
16
|
+
export function uploadSignatureVariant(data: any): Promise<object>;
|
|
17
|
+
export function getCustomer(): Promise<import("./api/users").GetCustomerResponse>;
|
|
18
|
+
export function createFaceLivenessSession(): Promise<import("./types/faceLiveness").CreateFaceLivenessSessionResponse>;
|
|
19
|
+
export function createApacuanaUser(data: any): Promise<ApacuanaSuccess>;
|
|
20
|
+
export function validateFaceLiveness(data: any): Promise<ApacuanaSuccess>;
|
|
21
|
+
export function close(): void;
|
|
22
|
+
export { getConfig };
|
|
23
|
+
}
|
|
24
|
+
import ApacuanaSuccess from "./success/index";
|
|
25
|
+
import { getConfig } from "./config/index";
|