apacuana-sdk-core 0.3.0 → 0.5.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 +82 -82
- package/coverage/coverage-final.json +3 -3
- package/coverage/lcov-report/block-navigation.js +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/sorter.js +21 -7
- package/coverage/lcov-report/src/api/certs.js.html +2 -2
- package/coverage/lcov-report/src/api/index.html +1 -1
- package/coverage/lcov-report/src/api/revocations.js.html +12 -15
- package/coverage/lcov-report/src/api/signatures.js.html +320 -140
- 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 +6 -3
- package/coverage/lcov-report/src/utils/constant.js.html +1 -1
- package/coverage/lcov-report/src/utils/helpers.js.html +1 -1
- package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov.info +137 -137
- package/dist/api/certs.d.ts +8 -0
- package/dist/api/revocations.d.ts +7 -0
- package/dist/api/signatures.d.ts +107 -0
- package/dist/api/users.d.ts +15 -0
- package/dist/config/index.d.ts +11 -0
- package/dist/errors/index.d.ts +10 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +204 -97
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -97
- package/dist/index.mjs.map +1 -1
- package/dist/utils/constant.d.ts +18 -0
- package/dist/utils/helpers.d.ts +21 -0
- package/dist/utils/httpClient.d.ts +3 -0
- package/package.json +9 -4
- package/src/api/certs.js +1 -1
- package/src/api/revocations.js +10 -11
- package/src/api/signatures.js +156 -96
- package/src/index.js +2 -1
- package/tests/api/signatures.test.js +11 -4
- package/tsconfig.json +15 -0
package/dist/index.mjs
CHANGED
|
@@ -588,32 +588,32 @@ var requestRevocation = /*#__PURE__*/function () {
|
|
|
588
588
|
return _regenerator().w(function (_context) {
|
|
589
589
|
while (1) switch (_context.p = _context.n) {
|
|
590
590
|
case 0:
|
|
591
|
-
console.log(
|
|
592
|
-
console.log(
|
|
591
|
+
console.log("-> Función 'requestRevocation' ejecutada.");
|
|
592
|
+
console.log("Parámetros recibidos para solicitud de revocación:", {
|
|
593
593
|
reasonCode: reasonCode
|
|
594
594
|
});
|
|
595
595
|
if (reasonCode) {
|
|
596
596
|
_context.n = 1;
|
|
597
597
|
break;
|
|
598
598
|
}
|
|
599
|
-
throw new Error(
|
|
599
|
+
throw new Error("ID de certificado y motivo son requeridos para requestRevocation.");
|
|
600
600
|
case 1:
|
|
601
601
|
_context.p = 1;
|
|
602
602
|
_context.n = 2;
|
|
603
|
-
return httpRequest(
|
|
603
|
+
return httpRequest("users/api/customers/requestcert", {
|
|
604
604
|
reason: reasonCode
|
|
605
|
-
},
|
|
605
|
+
}, "POST");
|
|
606
606
|
case 2:
|
|
607
607
|
response = _context.v;
|
|
608
|
-
console.log(
|
|
608
|
+
console.log("Respuesta del servidor", response);
|
|
609
609
|
if (response.success) {
|
|
610
610
|
_context.n = 3;
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
613
|
-
throw new ApacuanaAPIError(response.message ||
|
|
613
|
+
throw new ApacuanaAPIError(response.message || "Error desconocido al solicitar revocación.");
|
|
614
614
|
case 3:
|
|
615
615
|
return _context.a(2, {
|
|
616
|
-
revocationStatus: response.status ||
|
|
616
|
+
revocationStatus: response.status || "pending",
|
|
617
617
|
requestId: response.id
|
|
618
618
|
});
|
|
619
619
|
case 4:
|
|
@@ -32769,6 +32769,112 @@ var helpers = {
|
|
|
32769
32769
|
validateGetDigestData: validateGetDigestData
|
|
32770
32770
|
};
|
|
32771
32771
|
|
|
32772
|
+
var generateCertOnBoarding = /*#__PURE__*/function () {
|
|
32773
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
32774
|
+
var csr,
|
|
32775
|
+
encryptedCSR,
|
|
32776
|
+
response,
|
|
32777
|
+
cert,
|
|
32778
|
+
_args = arguments,
|
|
32779
|
+
_t;
|
|
32780
|
+
return _regenerator().w(function (_context) {
|
|
32781
|
+
while (1) switch (_context.p = _context.n) {
|
|
32782
|
+
case 0:
|
|
32783
|
+
csr = _args.length > 0 && _args[0] !== undefined ? _args[0] : undefined;
|
|
32784
|
+
_context.p = 1;
|
|
32785
|
+
encryptedCSR = helpers.encryptedCsr(csr);
|
|
32786
|
+
_context.n = 2;
|
|
32787
|
+
return httpRequest("services/api/register/certificate", encryptedCSR, "POST");
|
|
32788
|
+
case 2:
|
|
32789
|
+
response = _context.v;
|
|
32790
|
+
cert = response.cert;
|
|
32791
|
+
if (cert) {
|
|
32792
|
+
_context.n = 3;
|
|
32793
|
+
break;
|
|
32794
|
+
}
|
|
32795
|
+
throw new ApacuanaAPIError("The API response does not contain the certificate.", response.status, "INVALID_API_RESPONSE");
|
|
32796
|
+
case 3:
|
|
32797
|
+
return _context.a(2, {
|
|
32798
|
+
cert: cert,
|
|
32799
|
+
success: true
|
|
32800
|
+
});
|
|
32801
|
+
case 4:
|
|
32802
|
+
_context.p = 4;
|
|
32803
|
+
_t = _context.v;
|
|
32804
|
+
if (!(_t instanceof ApacuanaAPIError)) {
|
|
32805
|
+
_context.n = 5;
|
|
32806
|
+
break;
|
|
32807
|
+
}
|
|
32808
|
+
throw _t;
|
|
32809
|
+
case 5:
|
|
32810
|
+
throw new Error("Certificate generation failed: ".concat(_t.message));
|
|
32811
|
+
case 6:
|
|
32812
|
+
return _context.a(2);
|
|
32813
|
+
}
|
|
32814
|
+
}, _callee, null, [[1, 4]]);
|
|
32815
|
+
}));
|
|
32816
|
+
return function generateCertOnBoarding() {
|
|
32817
|
+
return _ref.apply(this, arguments);
|
|
32818
|
+
};
|
|
32819
|
+
}();
|
|
32820
|
+
var generateCertOnPremise = /*#__PURE__*/function () {
|
|
32821
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
32822
|
+
return _regenerator().w(function (_context2) {
|
|
32823
|
+
while (1) switch (_context2.n) {
|
|
32824
|
+
case 0:
|
|
32825
|
+
throw new ApacuanaAPIError("Certificate generation is not supported for integration type: ONPREMISE", 501, "NOT_IMPLEMENTED");
|
|
32826
|
+
case 1:
|
|
32827
|
+
return _context2.a(2);
|
|
32828
|
+
}
|
|
32829
|
+
}, _callee2);
|
|
32830
|
+
}));
|
|
32831
|
+
return function generateCertOnPremise() {
|
|
32832
|
+
return _ref2.apply(this, arguments);
|
|
32833
|
+
};
|
|
32834
|
+
}();
|
|
32835
|
+
|
|
32836
|
+
/**
|
|
32837
|
+
* Generates a digital certificate.
|
|
32838
|
+
* @param {string} [csr] - Certificate Signing Request (CSR).
|
|
32839
|
+
* @returns {Promise<{cert: string, success: boolean}>} Object with the generated certificate and a success indicator.
|
|
32840
|
+
* @throws {ApacuanaAPIError} If the CSR is invalid, if the API response does not contain the certificate, or if the integration type is not supported.
|
|
32841
|
+
* @throws {Error} If certificate generation fails for another reason.
|
|
32842
|
+
*/
|
|
32843
|
+
var generateCert = /*#__PURE__*/function () {
|
|
32844
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
32845
|
+
var csr,
|
|
32846
|
+
_getConfig,
|
|
32847
|
+
integrationType,
|
|
32848
|
+
_args3 = arguments;
|
|
32849
|
+
return _regenerator().w(function (_context3) {
|
|
32850
|
+
while (1) switch (_context3.n) {
|
|
32851
|
+
case 0:
|
|
32852
|
+
csr = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : undefined;
|
|
32853
|
+
_getConfig = getConfig(), integrationType = _getConfig.integrationType;
|
|
32854
|
+
helpers.validateCsr(csr);
|
|
32855
|
+
if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
|
|
32856
|
+
_context3.n = 1;
|
|
32857
|
+
break;
|
|
32858
|
+
}
|
|
32859
|
+
return _context3.a(2, generateCertOnBoarding(csr));
|
|
32860
|
+
case 1:
|
|
32861
|
+
if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
|
|
32862
|
+
_context3.n = 2;
|
|
32863
|
+
break;
|
|
32864
|
+
}
|
|
32865
|
+
return _context3.a(2, generateCertOnPremise());
|
|
32866
|
+
case 2:
|
|
32867
|
+
throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
|
|
32868
|
+
case 3:
|
|
32869
|
+
return _context3.a(2);
|
|
32870
|
+
}
|
|
32871
|
+
}, _callee3);
|
|
32872
|
+
}));
|
|
32873
|
+
return function generateCert() {
|
|
32874
|
+
return _ref3.apply(this, arguments);
|
|
32875
|
+
};
|
|
32876
|
+
}();
|
|
32877
|
+
|
|
32772
32878
|
/**
|
|
32773
32879
|
* Gets the user's certificate status.
|
|
32774
32880
|
* @param {boolean} [isCertificateInDevice=false] - Indicates if the certificate is already on the device.
|
|
@@ -32785,125 +32891,83 @@ var getCertStatus = function getCertStatus() {
|
|
|
32785
32891
|
};
|
|
32786
32892
|
|
|
32787
32893
|
var addSignerOnBoarding = /*#__PURE__*/function () {
|
|
32788
|
-
var
|
|
32894
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(signerData) {
|
|
32789
32895
|
var _t2;
|
|
32790
|
-
return _regenerator().w(function (
|
|
32791
|
-
while (1) switch (
|
|
32896
|
+
return _regenerator().w(function (_context5) {
|
|
32897
|
+
while (1) switch (_context5.p = _context5.n) {
|
|
32792
32898
|
case 0:
|
|
32793
32899
|
helpers.validateOnBoardingSignerData(signerData);
|
|
32794
|
-
|
|
32795
|
-
|
|
32900
|
+
_context5.p = 1;
|
|
32901
|
+
_context5.n = 2;
|
|
32796
32902
|
return httpRequest("services/api/documents/signing", signerData, "POST");
|
|
32797
32903
|
case 2:
|
|
32798
|
-
return
|
|
32904
|
+
return _context5.a(2, {
|
|
32799
32905
|
signer: signerData.typedoc + signerData.doc,
|
|
32800
32906
|
success: true
|
|
32801
32907
|
});
|
|
32802
32908
|
case 3:
|
|
32803
|
-
|
|
32804
|
-
_t2 =
|
|
32909
|
+
_context5.p = 3;
|
|
32910
|
+
_t2 = _context5.v;
|
|
32805
32911
|
if (!(_t2 instanceof ApacuanaAPIError)) {
|
|
32806
|
-
|
|
32912
|
+
_context5.n = 4;
|
|
32807
32913
|
break;
|
|
32808
32914
|
}
|
|
32809
32915
|
throw _t2;
|
|
32810
32916
|
case 4:
|
|
32811
32917
|
throw new Error("Failed to add signer in On-Boarding: ".concat(_t2.message));
|
|
32812
32918
|
case 5:
|
|
32813
|
-
return
|
|
32919
|
+
return _context5.a(2);
|
|
32814
32920
|
}
|
|
32815
|
-
},
|
|
32921
|
+
}, _callee5, null, [[1, 3]]);
|
|
32816
32922
|
}));
|
|
32817
|
-
return function addSignerOnBoarding(
|
|
32818
|
-
return
|
|
32923
|
+
return function addSignerOnBoarding(_x2) {
|
|
32924
|
+
return _ref5.apply(this, arguments);
|
|
32819
32925
|
};
|
|
32820
32926
|
}();
|
|
32821
32927
|
var addSignerOnPremise = /*#__PURE__*/function () {
|
|
32822
|
-
var
|
|
32823
|
-
return _regenerator().w(function (
|
|
32824
|
-
while (1) switch (
|
|
32928
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
32929
|
+
return _regenerator().w(function (_context6) {
|
|
32930
|
+
while (1) switch (_context6.n) {
|
|
32825
32931
|
case 0:
|
|
32826
32932
|
throw new ApacuanaAPIError("Adding signers is not supported for integration type: ONPREMISE", 501, "NOT_IMPLEMENTED");
|
|
32827
32933
|
case 1:
|
|
32828
|
-
return
|
|
32934
|
+
return _context6.a(2);
|
|
32829
32935
|
}
|
|
32830
|
-
},
|
|
32936
|
+
}, _callee6);
|
|
32831
32937
|
}));
|
|
32832
32938
|
return function addSignerOnPremise() {
|
|
32833
|
-
return
|
|
32834
|
-
};
|
|
32835
|
-
}();
|
|
32836
|
-
|
|
32837
|
-
/**
|
|
32838
|
-
* Adds a signer to a document, handling different integration types.
|
|
32839
|
-
* @param {object} signerData - Data of the signer to be added.
|
|
32840
|
-
* @returns {Promise<{signer: string, success: boolean}>} Object with the result of adding the signer.
|
|
32841
|
-
* @throws {ApacuanaAPIError} If the signer data is invalid, if the API call fails, or if the integration type is not supported.
|
|
32842
|
-
*/
|
|
32843
|
-
var addSigner = /*#__PURE__*/function () {
|
|
32844
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(signerData) {
|
|
32845
|
-
var _getConfig3, integrationType;
|
|
32846
|
-
return _regenerator().w(function (_context9) {
|
|
32847
|
-
while (1) switch (_context9.n) {
|
|
32848
|
-
case 0:
|
|
32849
|
-
if (!(!signerData || _typeof(signerData) !== "object" || Object.keys(signerData).length === 0)) {
|
|
32850
|
-
_context9.n = 1;
|
|
32851
|
-
break;
|
|
32852
|
-
}
|
|
32853
|
-
throw new ApacuanaAPIError("Signer data (signerData) is required and must be a non-empty object.", 400, "INVALID_PARAMETER");
|
|
32854
|
-
case 1:
|
|
32855
|
-
_getConfig3 = getConfig(), integrationType = _getConfig3.integrationType;
|
|
32856
|
-
if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
|
|
32857
|
-
_context9.n = 2;
|
|
32858
|
-
break;
|
|
32859
|
-
}
|
|
32860
|
-
return _context9.a(2, addSignerOnBoarding(signerData));
|
|
32861
|
-
case 2:
|
|
32862
|
-
if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
|
|
32863
|
-
_context9.n = 3;
|
|
32864
|
-
break;
|
|
32865
|
-
}
|
|
32866
|
-
return _context9.a(2, addSignerOnPremise(signerData));
|
|
32867
|
-
case 3:
|
|
32868
|
-
throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
|
|
32869
|
-
case 4:
|
|
32870
|
-
return _context9.a(2);
|
|
32871
|
-
}
|
|
32872
|
-
}, _callee9);
|
|
32873
|
-
}));
|
|
32874
|
-
return function addSigner(_x4) {
|
|
32875
|
-
return _ref9.apply(this, arguments);
|
|
32939
|
+
return _ref6.apply(this, arguments);
|
|
32876
32940
|
};
|
|
32877
32941
|
}();
|
|
32878
32942
|
var getDocsOnPremise = /*#__PURE__*/function () {
|
|
32879
|
-
var
|
|
32880
|
-
return _regenerator().w(function (
|
|
32881
|
-
while (1) switch (
|
|
32943
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
32944
|
+
return _regenerator().w(function (_context7) {
|
|
32945
|
+
while (1) switch (_context7.n) {
|
|
32882
32946
|
case 0:
|
|
32883
|
-
throw new ApacuanaAPIError("Document retrieval is not supported for integration type:
|
|
32947
|
+
throw new ApacuanaAPIError("Document retrieval is not supported for integration type: ONPREMISE", 501, "NOT_IMPLEMENTED");
|
|
32884
32948
|
case 1:
|
|
32885
|
-
return
|
|
32949
|
+
return _context7.a(2);
|
|
32886
32950
|
}
|
|
32887
|
-
},
|
|
32951
|
+
}, _callee7);
|
|
32888
32952
|
}));
|
|
32889
32953
|
return function getDocsOnPremise() {
|
|
32890
|
-
return
|
|
32954
|
+
return _ref7.apply(this, arguments);
|
|
32891
32955
|
};
|
|
32892
32956
|
}();
|
|
32893
32957
|
var getDocsOnBoarding = /*#__PURE__*/function () {
|
|
32894
|
-
var
|
|
32895
|
-
var
|
|
32896
|
-
return _regenerator().w(function (
|
|
32897
|
-
while (1) switch (
|
|
32958
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(data) {
|
|
32959
|
+
var _getConfig, customerId, params, apiUrl, response, _t3;
|
|
32960
|
+
return _regenerator().w(function (_context8) {
|
|
32961
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
32898
32962
|
case 0:
|
|
32899
|
-
|
|
32963
|
+
_getConfig = getConfig(), customerId = _getConfig.customerId;
|
|
32900
32964
|
if (customerId) {
|
|
32901
|
-
|
|
32965
|
+
_context8.n = 1;
|
|
32902
32966
|
break;
|
|
32903
32967
|
}
|
|
32904
32968
|
throw new ApacuanaAPIError("'customerId' is not configured. Please configure the SDK.", 400, "CONFIGURATION_ERROR");
|
|
32905
32969
|
case 1:
|
|
32906
|
-
|
|
32970
|
+
_context8.p = 1;
|
|
32907
32971
|
params = new URLSearchParams({
|
|
32908
32972
|
page: data.page,
|
|
32909
32973
|
customerid: customerId,
|
|
@@ -32913,40 +32977,82 @@ var getDocsOnBoarding = /*#__PURE__*/function () {
|
|
|
32913
32977
|
params.append("status", data.status);
|
|
32914
32978
|
}
|
|
32915
32979
|
apiUrl = "services/api/documents/listcustomer?".concat(params.toString());
|
|
32916
|
-
|
|
32980
|
+
_context8.n = 2;
|
|
32917
32981
|
return httpRequest(apiUrl, {}, "GET");
|
|
32918
32982
|
case 2:
|
|
32919
|
-
response =
|
|
32920
|
-
return
|
|
32983
|
+
response = _context8.v;
|
|
32984
|
+
return _context8.a(2, {
|
|
32921
32985
|
totalRecords: response.numofrecords,
|
|
32922
32986
|
records: response.records,
|
|
32923
32987
|
success: true
|
|
32924
32988
|
});
|
|
32925
32989
|
case 3:
|
|
32926
|
-
|
|
32927
|
-
_t3 =
|
|
32990
|
+
_context8.p = 3;
|
|
32991
|
+
_t3 = _context8.v;
|
|
32928
32992
|
if (!(_t3.name === "ApacuanaAPIError")) {
|
|
32929
|
-
|
|
32993
|
+
_context8.n = 4;
|
|
32930
32994
|
break;
|
|
32931
32995
|
}
|
|
32932
32996
|
throw _t3;
|
|
32933
32997
|
case 4:
|
|
32934
|
-
throw new ApacuanaAPIError("Failed to get document list (on-
|
|
32998
|
+
throw new ApacuanaAPIError("Failed to get document list (on-boarding): ".concat(_t3.message));
|
|
32935
32999
|
case 5:
|
|
33000
|
+
return _context8.a(2);
|
|
33001
|
+
}
|
|
33002
|
+
}, _callee8, null, [[1, 3]]);
|
|
33003
|
+
}));
|
|
33004
|
+
return function getDocsOnBoarding(_x3) {
|
|
33005
|
+
return _ref8.apply(this, arguments);
|
|
33006
|
+
};
|
|
33007
|
+
}();
|
|
33008
|
+
|
|
33009
|
+
/**
|
|
33010
|
+
* Añade un firmante a un documento.
|
|
33011
|
+
* @param {SignerData} signerData - Los datos del firmante que se va a añadir.
|
|
33012
|
+
* @returns {Promise<AddSignerResponse>} Una promesa que resuelve a un objeto con el resultado de la operación.
|
|
33013
|
+
* @throws {ApacuanaAPIError} Si los datos del firmante son inválidos, la llamada a la API falla, o el tipo de integración no es soportado.
|
|
33014
|
+
*/
|
|
33015
|
+
var addSigner = /*#__PURE__*/function () {
|
|
33016
|
+
var _ref1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(signerData) {
|
|
33017
|
+
var _getConfig4, integrationType;
|
|
33018
|
+
return _regenerator().w(function (_context1) {
|
|
33019
|
+
while (1) switch (_context1.n) {
|
|
33020
|
+
case 0:
|
|
33021
|
+
if (!(!signerData || _typeof(signerData) !== "object" || Object.keys(signerData).length === 0)) {
|
|
33022
|
+
_context1.n = 1;
|
|
33023
|
+
break;
|
|
33024
|
+
}
|
|
33025
|
+
throw new ApacuanaAPIError("Signer data (signerData) is required and must be a non-empty object.", 400, "INVALID_PARAMETER");
|
|
33026
|
+
case 1:
|
|
33027
|
+
_getConfig4 = getConfig(), integrationType = _getConfig4.integrationType;
|
|
33028
|
+
if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
|
|
33029
|
+
_context1.n = 2;
|
|
33030
|
+
break;
|
|
33031
|
+
}
|
|
33032
|
+
return _context1.a(2, addSignerOnBoarding(signerData));
|
|
33033
|
+
case 2:
|
|
33034
|
+
if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
|
|
33035
|
+
_context1.n = 3;
|
|
33036
|
+
break;
|
|
33037
|
+
}
|
|
33038
|
+
return _context1.a(2, addSignerOnPremise());
|
|
33039
|
+
case 3:
|
|
33040
|
+
throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
|
|
33041
|
+
case 4:
|
|
32936
33042
|
return _context1.a(2);
|
|
32937
33043
|
}
|
|
32938
|
-
}, _callee1
|
|
33044
|
+
}, _callee1);
|
|
32939
33045
|
}));
|
|
32940
|
-
return function
|
|
33046
|
+
return function addSigner(_x5) {
|
|
32941
33047
|
return _ref1.apply(this, arguments);
|
|
32942
33048
|
};
|
|
32943
33049
|
}();
|
|
32944
33050
|
|
|
32945
33051
|
/**
|
|
32946
|
-
*
|
|
32947
|
-
* @param {
|
|
32948
|
-
* @returns {Promise<
|
|
32949
|
-
* @throws {ApacuanaAPIError}
|
|
33052
|
+
* Obtiene una lista de documentos basada en los filtros especificados.
|
|
33053
|
+
* @param {GetDocsParams} data - Objeto con parámetros de paginación y filtros.
|
|
33054
|
+
* @returns {Promise<GetDocsResponse>} Una promesa que resuelve a un objeto con la lista de documentos.
|
|
33055
|
+
* @throws {ApacuanaAPIError} Si los parámetros de paginación son inválidos, 'customerId' no está configurado, la llamada a la API falla, o el tipo de integración no es soportado.
|
|
32950
33056
|
*/
|
|
32951
33057
|
var getDocs = /*#__PURE__*/function () {
|
|
32952
33058
|
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(data) {
|
|
@@ -33052,7 +33158,8 @@ var apacuana = {
|
|
|
33052
33158
|
getCertStatus: getCertStatus,
|
|
33053
33159
|
getCustomer: getCustomer,
|
|
33054
33160
|
addSigner: addSigner,
|
|
33055
|
-
getDocs: getDocs
|
|
33161
|
+
getDocs: getDocs,
|
|
33162
|
+
generateCert: generateCert
|
|
33056
33163
|
};
|
|
33057
33164
|
|
|
33058
33165
|
export { apacuana as default };
|