apacuana-sdk-core 0.8.0 → 0.10.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 (36) hide show
  1. package/README.md +150 -0
  2. package/coverage/clover.xml +233 -130
  3. package/coverage/coverage-final.json +8 -8
  4. package/coverage/lcov-report/index.html +29 -29
  5. package/coverage/lcov-report/src/api/certs.js.html +390 -9
  6. package/coverage/lcov-report/src/api/index.html +40 -40
  7. package/coverage/lcov-report/src/api/revocations.js.html +79 -43
  8. package/coverage/lcov-report/src/api/signatures.js.html +595 -73
  9. package/coverage/lcov-report/src/api/users.js.html +1 -1
  10. package/coverage/lcov-report/src/config/index.html +1 -1
  11. package/coverage/lcov-report/src/config/index.js.html +6 -6
  12. package/coverage/lcov-report/src/errors/index.html +1 -1
  13. package/coverage/lcov-report/src/errors/index.js.html +8 -8
  14. package/coverage/lcov-report/src/index.html +1 -1
  15. package/coverage/lcov-report/src/index.js.html +58 -4
  16. package/coverage/lcov-report/src/utils/constant.js.html +4 -4
  17. package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
  18. package/coverage/lcov-report/src/utils/httpClient.js.html +65 -35
  19. package/coverage/lcov-report/src/utils/index.html +15 -15
  20. package/coverage/lcov.info +422 -227
  21. package/dist/api/certs.d.ts +44 -0
  22. package/dist/api/signatures.d.ts +5 -0
  23. package/dist/index.d.ts +10 -0
  24. package/dist/index.js +579 -79
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +579 -79
  27. package/dist/index.mjs.map +1 -1
  28. package/package.json +1 -1
  29. package/src/api/certs.js +127 -0
  30. package/src/api/revocations.js +14 -2
  31. package/src/api/signatures.js +174 -0
  32. package/src/index.js +20 -2
  33. package/src/utils/httpClient.js +29 -19
  34. package/tests/api/certs.test.js +113 -1
  35. package/tests/api/revocations.test.js +118 -5
  36. package/tests/api/signatures.test.js +306 -0
@@ -1,5 +1,9 @@
1
1
  export function generateCert(encryptedCSR: EncryptedCSRObject): Promise<GenerateCertResponse>;
2
2
  export function getCertStatus(isCertificateInDevice?: boolean): GetCertStatusResponse;
3
+ export function getCertTypes(): Promise<GetCertTypesResponse>;
4
+ export function getRequerimentsByTypeUser(params: {
5
+ type: number;
6
+ }): Promise<GetRequirementsResponse>;
3
7
  export type GenerateCertResponse = {
4
8
  /**
5
9
  * - El certificado generado en formato string.
@@ -30,3 +34,43 @@ export type EncryptedCSRObject = {
30
34
  */
31
35
  csr: string;
32
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
+ };
@@ -2,6 +2,11 @@ export function signDocument(signData: SignDocumentData): Promise<object>;
2
2
  export function getDigest(signData: GetDigestData): Promise<GetDigestResponse>;
3
3
  export function addSigner(signerData: OnboardingSignerData | object): Promise<object>;
4
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>;
5
10
  /**
6
11
  * Define la estructura de un objeto Firmante.
7
12
  */
package/dist/index.d.ts CHANGED
@@ -19,6 +19,11 @@ declare namespace apacuana {
19
19
  export { signDocument };
20
20
  export { getDigest };
21
21
  export { getRevocationReasons };
22
+ export { uploadSignatureVariant };
23
+ export { getSignatureVariant };
24
+ export { deleteSignatureVariant };
25
+ export { getCertTypes };
26
+ export { getRequerimentsByTypeUser };
22
27
  }
23
28
  import { getConfig } from "./config/index";
24
29
  import { requestRevocation } from "./api/revocations";
@@ -30,3 +35,8 @@ import { generateCert } from "./api/certs";
30
35
  import { signDocument } from "./api/signatures";
31
36
  import { getDigest } from "./api/signatures";
32
37
  import { getRevocationReasons } from "./api/revocations";
38
+ import { uploadSignatureVariant } from "./api/signatures";
39
+ import { getSignatureVariant } from "./api/signatures";
40
+ import { deleteSignatureVariant } from "./api/signatures";
41
+ import { getCertTypes } from "./api/certs";
42
+ import { getRequerimentsByTypeUser } from "./api/certs";