apacuana-sdk-core 1.9.0 → 1.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 (35) hide show
  1. package/coverage/clover.xml +81 -80
  2. package/coverage/coverage-final.json +3 -3
  3. package/coverage/lcov-report/index.html +10 -10
  4. package/coverage/lcov-report/src/api/certs.js.html +190 -7
  5. package/coverage/lcov-report/src/api/faceLiveness.js.html +1 -1
  6. package/coverage/lcov-report/src/api/index.html +10 -10
  7. package/coverage/lcov-report/src/api/revocations.js.html +1 -1
  8. package/coverage/lcov-report/src/api/signatures.js.html +1 -1
  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 +1 -1
  12. package/coverage/lcov-report/src/errors/index.html +1 -1
  13. package/coverage/lcov-report/src/errors/index.js.html +1 -1
  14. package/coverage/lcov-report/src/index.html +1 -1
  15. package/coverage/lcov-report/src/index.js.html +14 -2
  16. package/coverage/lcov-report/src/success/index.html +1 -1
  17. package/coverage/lcov-report/src/success/index.js.html +1 -1
  18. package/coverage/lcov-report/src/utils/constant.js.html +5 -2
  19. package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
  20. package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
  21. package/coverage/lcov-report/src/utils/index.html +1 -1
  22. package/coverage/lcov.info +128 -127
  23. package/dist/api/certs.d.ts +2 -0
  24. package/dist/index.js +66 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +66 -0
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/types/certs.d.ts +16 -0
  29. package/dist/utils/constant.d.ts +5 -4
  30. package/dist/utils/helpers.d.ts +1 -1
  31. package/package.json +1 -1
  32. package/src/api/certs.js +62 -1
  33. package/src/index.js +4 -0
  34. package/src/types/certs.js +9 -0
  35. package/src/utils/constant.js +1 -0
package/dist/index.mjs CHANGED
@@ -274,6 +274,7 @@ function _wrapNativeSuper(t) {
274
274
 
275
275
  var STATUS_CERTIFICATE = {
276
276
  request: "SOLICITUD",
277
+ request_cert: "REVISION",
277
278
  generate: "GENERAR",
278
279
  current: "VIGENTE",
279
280
  revoque: "REVOCADO",
@@ -33308,6 +33309,10 @@ var getCertStatus = /*#__PURE__*/function () {
33308
33309
  userData = customer.data.userData;
33309
33310
  status = helpers.getCertificateStatus(userData, isCertificateInDevice, config.integrationType);
33310
33311
  parseStatus = PARSE_STATUS[status];
33312
+ console.log({
33313
+ status: status,
33314
+ parseStatus: parseStatus
33315
+ });
33311
33316
  return _context4.a(2, new ApacuanaSuccess({
33312
33317
  status: parseStatus
33313
33318
  }));
@@ -33492,6 +33497,62 @@ var getRequerimentsByTypeUser = /*#__PURE__*/function () {
33492
33497
  };
33493
33498
  }();
33494
33499
 
33500
+ // const validateCertificateOnBoarding = async (params) => {
33501
+ // throw new ApacuanaAPIError(
33502
+ // "Requesting a certificate is not supported for integration type: ONBOARDING",
33503
+ // 501,
33504
+ // "NOT_IMPLEMENTED"
33505
+ // );
33506
+ // // try {
33507
+ // // const response = await httpRequest(
33508
+ // // "services/api/customer/request-certificate",
33509
+ // // params,
33510
+ // // "POST"
33511
+ // // );
33512
+ // // return new ApacuanaSuccess(response);
33513
+ // // } catch (error) {
33514
+ // // if (error instanceof ApacuanaAPIError) {
33515
+ // // throw error;
33516
+ // // }
33517
+ // // throw new Error(`Failed to request certificate: ${error.message}`);
33518
+ // // }
33519
+ // };
33520
+
33521
+ // const validateCertificateOnPremise = async () => {
33522
+ // throw new ApacuanaAPIError(
33523
+ // "Requesting a certificate is not supported for integration type: ONPREMISE",
33524
+ // 501,
33525
+ // "NOT_IMPLEMENTED"
33526
+ // );
33527
+ // };
33528
+
33529
+ // /**
33530
+ // * Requests a certificate for the user.
33531
+ // * @param {ValidateCertificateRequestParams} params - The parameters for the certificate request.
33532
+ // * @returns {Promise<ValidateCertificateResponseData>} Object with a confirmation message and a success indicator.
33533
+ // * @throws {ApacuanaAPIError} If the API response is invalid or the integration type is not supported.
33534
+ // * @throws {Error} If the request fails for another reason or the params are invalid.
33535
+ // */
33536
+ // export const validateCertificate = async (params) => {
33537
+ // if (!params || typeof params.challenge !== "string") {
33538
+ // throw new Error("Invalid params.");
33539
+ // }
33540
+
33541
+ // const { integrationType } = getConfig();
33542
+ // if (integrationType === INTEGRATION_TYPE.ONBOARDING) {
33543
+ // return requestCertificateOnBoarding(params);
33544
+ // }
33545
+ // if (integrationType === INTEGRATION_TYPE.ONPREMISE) {
33546
+ // return requestCertificateOnPremise();
33547
+ // }
33548
+
33549
+ // throw new ApacuanaAPIError(
33550
+ // `Unsupported integration type: ${integrationType}`,
33551
+ // 400,
33552
+ // "UNSUPPORTED_INTEGRATION_TYPE"
33553
+ // );
33554
+ // };
33555
+
33495
33556
  /** @typedef {import("../types/signatures").Signer} Signer */
33496
33557
  /** @typedef {import("../types/signatures").SignerData} SignerData */
33497
33558
  /** @typedef {import("../types/signatures").AddSignerResponse} AddSignerResponse */
@@ -34503,6 +34564,11 @@ var apacuana = {
34503
34564
  checkSdk(true);
34504
34565
  return validateFaceLiveness(data);
34505
34566
  },
34567
+ // validateCertificate: (data) => {
34568
+ // checkSdk(true);
34569
+ // validateCertificate(data);
34570
+ // },
34571
+
34506
34572
  close: function close$1() {
34507
34573
  return close();
34508
34574
  },