apacuana-sdk-core 1.6.0 → 1.8.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.
@@ -11,7 +11,7 @@ declare namespace _default {
11
11
  export { createPayloadGetDigest };
12
12
  }
13
13
  export default _default;
14
- declare function getCertificateStatus(userData: any, certificateInDevice: any, integrationType: any): string;
14
+ declare function getCertificateStatus(userData: any, certificateInDevice: any, integrationType: any): any;
15
15
  declare function exportPrivateKey(key: any): Promise<string>;
16
16
  declare function arrayBufferToBase64(buffer: any): string;
17
17
  declare function encryptedCsr(csr: any, encryptKey?: string): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apacuana-sdk-core",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Core SDK para interacciones con las APIs de Apacuana.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,6 +32,13 @@ const getCertificateStatus = (
32
32
  if (integrationType === INTEGRATION_TYPE.ONBOARDING) {
33
33
  if (userData?.verificationstatus?.id !== VERIFICATION_STATUS.APPROVED)
34
34
  return STATUS_CERTIFICATE.request;
35
+ if (
36
+ !userData?.certificationId &&
37
+ userData?.requestscert?.requests.length === 0 &&
38
+ !userData?.certificatestatus?.cangenerate
39
+ )
40
+ return STATUS_CERTIFICATE.request_cert;
41
+
35
42
  if (
36
43
  userData?.certifiedid &&
37
44
  !userData?.certificatestatus?.cangenerate &&