apacuana-sdk-core 0.2.0 → 0.4.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 (47) hide show
  1. package/README.md +64 -15
  2. package/coverage/clover.xml +155 -121
  3. package/coverage/coverage-final.json +8 -8
  4. package/coverage/lcov-report/block-navigation.js +1 -1
  5. package/coverage/lcov-report/index.html +30 -30
  6. package/coverage/lcov-report/sorter.js +21 -7
  7. package/coverage/lcov-report/src/api/certs.js.html +73 -28
  8. package/coverage/lcov-report/src/api/index.html +31 -31
  9. package/coverage/lcov-report/src/api/revocations.js.html +12 -15
  10. package/coverage/lcov-report/src/api/signatures.js.html +186 -159
  11. package/coverage/lcov-report/src/api/users.js.html +24 -63
  12. package/coverage/lcov-report/src/config/index.html +1 -1
  13. package/coverage/lcov-report/src/config/index.js.html +1 -1
  14. package/coverage/lcov-report/src/errors/index.html +1 -1
  15. package/coverage/lcov-report/src/errors/index.js.html +8 -8
  16. package/coverage/lcov-report/src/index.html +1 -1
  17. package/coverage/lcov-report/src/index.js.html +6 -3
  18. package/coverage/lcov-report/src/utils/constant.js.html +4 -4
  19. package/coverage/lcov-report/src/utils/helpers.js.html +101 -50
  20. package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
  21. package/coverage/lcov-report/src/utils/index.html +19 -19
  22. package/coverage/lcov.info +293 -221
  23. package/dist/api/certs.d.ts +8 -0
  24. package/dist/api/revocations.d.ts +7 -0
  25. package/dist/api/signatures.d.ts +16 -0
  26. package/dist/api/users.d.ts +15 -0
  27. package/dist/config/index.d.ts +11 -0
  28. package/dist/errors/index.d.ts +10 -0
  29. package/dist/index.d.ts +25 -0
  30. package/dist/index.js +252 -251
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +252 -251
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/utils/constant.d.ts +18 -0
  35. package/dist/utils/helpers.d.ts +21 -0
  36. package/dist/utils/httpClient.d.ts +3 -0
  37. package/package.json +9 -4
  38. package/src/api/certs.js +25 -10
  39. package/src/api/revocations.js +10 -11
  40. package/src/api/signatures.js +106 -97
  41. package/src/api/users.js +16 -29
  42. package/src/index.js +2 -1
  43. package/src/utils/helpers.js +17 -0
  44. package/tests/api/certs.test.js +58 -74
  45. package/tests/api/signatures.test.js +18 -73
  46. package/tests/api/users.test.js +10 -10
  47. package/tsconfig.json +15 -0
@@ -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;
@@ -0,0 +1,25 @@
1
+ export default apacuana;
2
+ declare namespace apacuana {
3
+ export function init(config: {
4
+ apiUrl: string;
5
+ secretKey: string;
6
+ apiKey: string;
7
+ verificationId: string;
8
+ customerId: string;
9
+ integrationType: string;
10
+ }): Promise<object>;
11
+ export { getConfig };
12
+ export { requestRevocation };
13
+ export { getCertStatus };
14
+ export { getCustomer };
15
+ export { addSigner };
16
+ export { getDocs };
17
+ export { generateCert };
18
+ }
19
+ import { getConfig } from "./config/index";
20
+ import requestRevocation from "./api/revocations";
21
+ import { getCertStatus } from "./api/certs";
22
+ import getCustomer from "./api/users";
23
+ import { addSigner } from "./api/signatures";
24
+ import { getDocs } from "./api/signatures";
25
+ import { generateCert } from "./api/certs";