apacuana-sdk-core 1.12.0 → 1.16.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/coverage/clover.xml +79 -70
- package/coverage/coverage-final.json +1 -1
- package/coverage/lcov-report/index.html +14 -14
- package/coverage/lcov-report/src/api/certs.js.html +1 -1
- package/coverage/lcov-report/src/api/faceLiveness.js.html +1 -1
- package/coverage/lcov-report/src/api/index.html +1 -1
- package/coverage/lcov-report/src/api/revocations.js.html +1 -1
- package/coverage/lcov-report/src/api/signatures.js.html +1 -1
- package/coverage/lcov-report/src/api/users.js.html +1 -1
- package/coverage/lcov-report/src/config/index.html +1 -1
- package/coverage/lcov-report/src/config/index.js.html +1 -1
- package/coverage/lcov-report/src/errors/index.html +1 -1
- package/coverage/lcov-report/src/errors/index.js.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.js.html +1 -1
- package/coverage/lcov-report/src/success/index.html +1 -1
- package/coverage/lcov-report/src/success/index.js.html +1 -1
- package/coverage/lcov-report/src/utils/constant.js.html +1 -1
- package/coverage/lcov-report/src/utils/helpers.js.html +89 -17
- package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +13 -13
- package/coverage/lcov.info +200 -165
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/utils/helpers.js +34 -10
package/dist/index.mjs
CHANGED
|
@@ -32911,12 +32911,10 @@ var encryptedCsr = function encryptedCsr(csr) {
|
|
|
32911
32911
|
};
|
|
32912
32912
|
var createPayloadGetDigest = function createPayloadGetDigest(signData) {
|
|
32913
32913
|
var formData = new FormData();
|
|
32914
|
-
|
|
32915
|
-
// Iterate over the object's own properties
|
|
32916
32914
|
Object.keys(signData).forEach(function (key) {
|
|
32917
|
-
|
|
32918
|
-
|
|
32919
|
-
if (key === "document" && signData[key] instanceof File) {
|
|
32915
|
+
var value = signData[key];
|
|
32916
|
+
var isRNFile = value && _typeof(value) === "object" && value.uri && value.name && value.type;
|
|
32917
|
+
if (key === "document" && (signData[key] instanceof File || isRNFile)) {
|
|
32920
32918
|
// Append the file directly
|
|
32921
32919
|
formData.append(key, signData[key]);
|
|
32922
32920
|
} else if (key === "cert") {
|
|
@@ -32931,15 +32929,15 @@ var validateOnBoardingSignerData = function validateOnBoardingSignerData(signerD
|
|
|
32931
32929
|
if (!validatedSignerData.name || typeof validatedSignerData.name !== "string") {
|
|
32932
32930
|
throw new ApacuanaAPIError('El campo "name" es requerido y debe ser una cadena de texto.', 400, "INVALID_PARAMETER_FORMAT");
|
|
32933
32931
|
}
|
|
32934
|
-
|
|
32935
|
-
// Limpia 'reference' si es inválido o está vacío.
|
|
32936
32932
|
if (!validatedSignerData.reference || typeof validatedSignerData.reference !== "string" || validatedSignerData.reference.trim() === "") {
|
|
32937
32933
|
delete validatedSignerData.reference;
|
|
32938
32934
|
}
|
|
32939
|
-
|
|
32940
|
-
// Limpia 'file' si no es una instancia de File.
|
|
32941
32935
|
if (typeof File === "undefined" || !validatedSignerData.file || !(validatedSignerData.file instanceof File)) {
|
|
32942
|
-
|
|
32936
|
+
var value = validatedSignerData.file;
|
|
32937
|
+
var isRNFile = value && _typeof(value) === "object" && value.uri && value.name && value.type;
|
|
32938
|
+
if (!isRNFile) {
|
|
32939
|
+
delete validatedSignerData.file;
|
|
32940
|
+
}
|
|
32943
32941
|
}
|
|
32944
32942
|
|
|
32945
32943
|
// Valida que solo uno de los dos campos exista después de la limpieza.
|
|
@@ -32972,9 +32970,11 @@ var validateOnBoardingSignerData = function validateOnBoardingSignerData(signerD
|
|
|
32972
32970
|
});
|
|
32973
32971
|
var formData = new FormData();
|
|
32974
32972
|
Object.keys(validatedSignerData).forEach(function (key) {
|
|
32973
|
+
var value = validatedSignerData[key];
|
|
32974
|
+
var isRNFile = value && _typeof(value) === "object" && value.uri && value.name && value.type;
|
|
32975
32975
|
if (key === "signature") {
|
|
32976
32976
|
formData.append(key, JSON.stringify(validatedSignerData[key]));
|
|
32977
|
-
} else if (key === "file") {
|
|
32977
|
+
} else if (key === "file" || isRNFile) {
|
|
32978
32978
|
formData.append("document", validatedSignerData[key]);
|
|
32979
32979
|
} else if (validatedSignerData[key] !== undefined) {
|
|
32980
32980
|
formData.append(key, validatedSignerData[key]);
|
|
@@ -33032,7 +33032,9 @@ var validateOnBoardingSignDocumentData = function validateOnBoardingSignDocument
|
|
|
33032
33032
|
})));
|
|
33033
33033
|
formData.append("publickey", cert);
|
|
33034
33034
|
formData.append("signeddigest", signedDigest);
|
|
33035
|
-
|
|
33035
|
+
var value = signData.document;
|
|
33036
|
+
var isRNFile = value && _typeof(value) === "object" && value.uri && value.name && value.type;
|
|
33037
|
+
if (signData.document && (signData.document instanceof File || isRNFile)) {
|
|
33036
33038
|
formData.append("document", signData.document);
|
|
33037
33039
|
}
|
|
33038
33040
|
return formData;
|