apacuana-sdk-core 1.26.4 → 1.26.6

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 (38) hide show
  1. package/.env +3 -2
  2. package/README.md +34 -1
  3. package/coverage/clover.xml +295 -267
  4. package/coverage/coverage-final.json +5 -5
  5. package/coverage/lcov-report/index.html +33 -33
  6. package/coverage/lcov-report/src/api/certs.js.html +1 -1
  7. package/coverage/lcov-report/src/api/faceLiveness.js.html +1 -1
  8. package/coverage/lcov-report/src/api/index.html +18 -18
  9. package/coverage/lcov-report/src/api/revocations.js.html +1 -1
  10. package/coverage/lcov-report/src/api/signatures.js.html +275 -20
  11. package/coverage/lcov-report/src/api/users.js.html +1 -1
  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 +15 -15
  17. package/coverage/lcov-report/src/index.js.html +23 -8
  18. package/coverage/lcov-report/src/success/index.html +1 -1
  19. package/coverage/lcov-report/src/success/index.js.html +5 -5
  20. package/coverage/lcov-report/src/utils/constant.js.html +1 -1
  21. package/coverage/lcov-report/src/utils/helpers.js.html +40 -7
  22. package/coverage/lcov-report/src/utils/httpClient.js.html +1 -1
  23. package/coverage/lcov-report/src/utils/index.html +12 -12
  24. package/coverage/lcov.info +564 -501
  25. package/dist/api/signatures.d.ts +2 -0
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +234 -115
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +234 -115
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/types/signatures.d.ts +17 -0
  32. package/package.json +1 -1
  33. package/src/api/signatures.js +85 -0
  34. package/src/index.js +5 -0
  35. package/src/types/signatures.js +8 -0
  36. package/src/utils/helpers.js +11 -0
  37. package/tests/api/signatures.test.js +148 -0
  38. package/tests/integration/deleteSignature.test.js +96 -0
package/dist/index.mjs CHANGED
@@ -33005,6 +33005,9 @@ var validateGetDocsData = function validateGetDocsData(data) {
33005
33005
  if (typeof data.status !== "undefined" && ![-1, 0, 1, 2].includes(data.status)) {
33006
33006
  throw new ApacuanaAPIError("El parámetro 'status' no es válido. Los valores permitidos son: -1, 0, 1, 2.", 400, "INVALID_PARAMETER");
33007
33007
  }
33008
+ if (typeof data.blocked !== "undefined" && ![0, 1].includes(data.blocked)) {
33009
+ throw new ApacuanaAPIError("El parámetro 'blocked' no es válido. Los valores permitidos son: 0, 1.", 400, "INVALID_PARAMETER");
33010
+ }
33008
33011
  };
33009
33012
  var validateGetDigestData = function validateGetDigestData(signData) {
33010
33013
  if (!signData || !signData.cert || typeof signData.cert !== "string" || !signData.signatureId || typeof signData.signatureId !== "string") {
@@ -33604,6 +33607,7 @@ var getRequerimentsByTypeUser = /*#__PURE__*/function () {
33604
33607
  /** @typedef {import("../types/signatures").SignDocumentData} SignDocumentData */
33605
33608
  /** @typedef {import("../types/signatures").SignaturePosition} SignaturePosition */
33606
33609
  /** @typedef {import("../types/signatures").OnboardingSignerData} OnboardingSignerData */
33610
+ /** @typedef {import("../types/signatures").DeleteSignatureData} DeleteSignatureData */
33607
33611
 
33608
33612
  // =================================================================
33609
33613
  // Internal Functions
@@ -33800,6 +33804,9 @@ var getDocsOnBoarding = /*#__PURE__*/function () {
33800
33804
  if (typeof data.status !== "undefined") {
33801
33805
  params.append("status", data.status);
33802
33806
  }
33807
+ if (typeof data.blocked !== "undefined") {
33808
+ params.append("blocked", data.blocked);
33809
+ }
33803
33810
  apiUrl = "services/api/documents/listcustomer?".concat(params.toString());
33804
33811
  _context8.n = 2;
33805
33812
  return httpRequest(apiUrl, {}, "GET");
@@ -34124,6 +34131,58 @@ var lockDocumentOnPremise = /*#__PURE__*/function () {
34124
34131
  return _ref19.apply(this, arguments);
34125
34132
  };
34126
34133
  }();
34134
+ var deleteSignatureOnBoarding = /*#__PURE__*/function () {
34135
+ var _ref21 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(_ref20) {
34136
+ var documentId, signatureId, response, _t1;
34137
+ return _regenerator().w(function (_context19) {
34138
+ while (1) switch (_context19.p = _context19.n) {
34139
+ case 0:
34140
+ documentId = _ref20.documentId, signatureId = _ref20.signatureId;
34141
+ _context19.p = 1;
34142
+ _context19.n = 2;
34143
+ return httpRequest("services/api/documents/signature", {
34144
+ documentid: documentId,
34145
+ signatureid: signatureId
34146
+ }, "DELETE", {
34147
+ skipAuth: true
34148
+ });
34149
+ case 2:
34150
+ response = _context19.v;
34151
+ return _context19.a(2, new ApacuanaSuccess(response));
34152
+ case 3:
34153
+ _context19.p = 3;
34154
+ _t1 = _context19.v;
34155
+ if (!(_t1 instanceof ApacuanaAPIError)) {
34156
+ _context19.n = 4;
34157
+ break;
34158
+ }
34159
+ throw _t1;
34160
+ case 4:
34161
+ throw new ApacuanaAPIError("Failed to delete signature: ".concat(_t1.message || "Unknown error"));
34162
+ case 5:
34163
+ return _context19.a(2);
34164
+ }
34165
+ }, _callee19, null, [[1, 3]]);
34166
+ }));
34167
+ return function deleteSignatureOnBoarding(_x9) {
34168
+ return _ref21.apply(this, arguments);
34169
+ };
34170
+ }();
34171
+ var deleteSignatureOnPremise = /*#__PURE__*/function () {
34172
+ var _ref22 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20() {
34173
+ return _regenerator().w(function (_context20) {
34174
+ while (1) switch (_context20.n) {
34175
+ case 0:
34176
+ throw new ApacuanaAPIError("Deleting signatures from documents is not supported for integration type: ONPREMISE", 501, "NOT_IMPLEMENTED");
34177
+ case 1:
34178
+ return _context20.a(2);
34179
+ }
34180
+ }, _callee20);
34181
+ }));
34182
+ return function deleteSignatureOnPremise() {
34183
+ return _ref22.apply(this, arguments);
34184
+ };
34185
+ }();
34127
34186
 
34128
34187
  // =================================================================
34129
34188
  // Exported Functions
@@ -34137,32 +34196,32 @@ var lockDocumentOnPremise = /*#__PURE__*/function () {
34137
34196
  * @throws {ApacuanaAPIError} Arroja un error 'NOT_IMPLEMENTED' para cualquier tipo de integración.
34138
34197
  */
34139
34198
  var signDocument = /*#__PURE__*/function () {
34140
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee19(signData) {
34199
+ var _ref23 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(signData) {
34141
34200
  var _getConfig3, integrationType;
34142
- return _regenerator().w(function (_context19) {
34143
- while (1) switch (_context19.n) {
34201
+ return _regenerator().w(function (_context21) {
34202
+ while (1) switch (_context21.n) {
34144
34203
  case 0:
34145
34204
  _getConfig3 = getConfig(), integrationType = _getConfig3.integrationType;
34146
34205
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34147
- _context19.n = 1;
34206
+ _context21.n = 1;
34148
34207
  break;
34149
34208
  }
34150
- return _context19.a(2, signDocumentOnBoarding(signData));
34209
+ return _context21.a(2, signDocumentOnBoarding(signData));
34151
34210
  case 1:
34152
34211
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34153
- _context19.n = 2;
34212
+ _context21.n = 2;
34154
34213
  break;
34155
34214
  }
34156
- return _context19.a(2, signDocumentOnPremise());
34215
+ return _context21.a(2, signDocumentOnPremise());
34157
34216
  case 2:
34158
34217
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34159
34218
  case 3:
34160
- return _context19.a(2);
34219
+ return _context21.a(2);
34161
34220
  }
34162
- }, _callee19);
34221
+ }, _callee21);
34163
34222
  }));
34164
- return function signDocument(_x9) {
34165
- return _ref20.apply(this, arguments);
34223
+ return function signDocument(_x0) {
34224
+ return _ref23.apply(this, arguments);
34166
34225
  };
34167
34226
  }();
34168
34227
 
@@ -34173,33 +34232,33 @@ var signDocument = /*#__PURE__*/function () {
34173
34232
  * @throws {ApacuanaAPIError} Si los datos de entrada son inválidos, la llamada a la API falla, o el tipo de integración no es soportado.
34174
34233
  */
34175
34234
  var getDigest = /*#__PURE__*/function () {
34176
- var _ref21 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee20(signData) {
34235
+ var _ref24 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(signData) {
34177
34236
  var _getConfig4, integrationType;
34178
- return _regenerator().w(function (_context20) {
34179
- while (1) switch (_context20.n) {
34237
+ return _regenerator().w(function (_context22) {
34238
+ while (1) switch (_context22.n) {
34180
34239
  case 0:
34181
34240
  helpers.validateGetDigestData(signData);
34182
34241
  _getConfig4 = getConfig(), integrationType = _getConfig4.integrationType;
34183
34242
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34184
- _context20.n = 1;
34243
+ _context22.n = 1;
34185
34244
  break;
34186
34245
  }
34187
- return _context20.a(2, getDigestToSignOnBoarding(signData));
34246
+ return _context22.a(2, getDigestToSignOnBoarding(signData));
34188
34247
  case 1:
34189
34248
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34190
- _context20.n = 2;
34249
+ _context22.n = 2;
34191
34250
  break;
34192
34251
  }
34193
- return _context20.a(2, getDigestToSignOnPremise());
34252
+ return _context22.a(2, getDigestToSignOnPremise());
34194
34253
  case 2:
34195
34254
  throw new ApacuanaAPIError("Document retrieval is not supported for an unknown integration type: ".concat(integrationType), 501, "NOT_IMPLEMENTED");
34196
34255
  case 3:
34197
- return _context20.a(2);
34256
+ return _context22.a(2);
34198
34257
  }
34199
- }, _callee20);
34258
+ }, _callee22);
34200
34259
  }));
34201
- return function getDigest(_x0) {
34202
- return _ref21.apply(this, arguments);
34260
+ return function getDigest(_x1) {
34261
+ return _ref24.apply(this, arguments);
34203
34262
  };
34204
34263
  }();
34205
34264
 
@@ -34210,38 +34269,38 @@ var getDigest = /*#__PURE__*/function () {
34210
34269
  * @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.
34211
34270
  */
34212
34271
  var addSigner = /*#__PURE__*/function () {
34213
- var _ref22 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee21(signerData) {
34272
+ var _ref25 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(signerData) {
34214
34273
  var _getConfig5, integrationType;
34215
- return _regenerator().w(function (_context21) {
34216
- while (1) switch (_context21.n) {
34274
+ return _regenerator().w(function (_context23) {
34275
+ while (1) switch (_context23.n) {
34217
34276
  case 0:
34218
34277
  if (!(!signerData || _typeof(signerData) !== "object" || Object.keys(signerData).length === 0)) {
34219
- _context21.n = 1;
34278
+ _context23.n = 1;
34220
34279
  break;
34221
34280
  }
34222
34281
  throw new ApacuanaAPIError("Signer data (signerData) is required and must be a non-empty object.", 400, "INVALID_PARAMETER");
34223
34282
  case 1:
34224
34283
  _getConfig5 = getConfig(), integrationType = _getConfig5.integrationType;
34225
34284
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34226
- _context21.n = 2;
34285
+ _context23.n = 2;
34227
34286
  break;
34228
34287
  }
34229
- return _context21.a(2, addSignerOnBoarding(signerData));
34288
+ return _context23.a(2, addSignerOnBoarding(signerData));
34230
34289
  case 2:
34231
34290
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34232
- _context21.n = 3;
34291
+ _context23.n = 3;
34233
34292
  break;
34234
34293
  }
34235
- return _context21.a(2, addSignerOnPremise());
34294
+ return _context23.a(2, addSignerOnPremise());
34236
34295
  case 3:
34237
34296
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34238
34297
  case 4:
34239
- return _context21.a(2);
34298
+ return _context23.a(2);
34240
34299
  }
34241
- }, _callee21);
34300
+ }, _callee23);
34242
34301
  }));
34243
- return function addSigner(_x1) {
34244
- return _ref22.apply(this, arguments);
34302
+ return function addSigner(_x10) {
34303
+ return _ref25.apply(this, arguments);
34245
34304
  };
34246
34305
  }();
34247
34306
 
@@ -34252,33 +34311,33 @@ var addSigner = /*#__PURE__*/function () {
34252
34311
  * @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.
34253
34312
  */
34254
34313
  var getDocs = /*#__PURE__*/function () {
34255
- var _ref23 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee22(data) {
34314
+ var _ref26 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24(data) {
34256
34315
  var _getConfig6, integrationType;
34257
- return _regenerator().w(function (_context22) {
34258
- while (1) switch (_context22.n) {
34316
+ return _regenerator().w(function (_context24) {
34317
+ while (1) switch (_context24.n) {
34259
34318
  case 0:
34260
34319
  helpers.validateGetDocsData(data);
34261
34320
  _getConfig6 = getConfig(), integrationType = _getConfig6.integrationType;
34262
34321
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34263
- _context22.n = 1;
34322
+ _context24.n = 1;
34264
34323
  break;
34265
34324
  }
34266
- return _context22.a(2, getDocsOnBoarding(data));
34325
+ return _context24.a(2, getDocsOnBoarding(data));
34267
34326
  case 1:
34268
34327
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34269
- _context22.n = 2;
34328
+ _context24.n = 2;
34270
34329
  break;
34271
34330
  }
34272
- return _context22.a(2, getDocsOnPremise());
34331
+ return _context24.a(2, getDocsOnPremise());
34273
34332
  case 2:
34274
34333
  throw new ApacuanaAPIError("Document retrieval is not supported for an unknown integration type: ".concat(integrationType), 501, "NOT_IMPLEMENTED");
34275
34334
  case 3:
34276
- return _context22.a(2);
34335
+ return _context24.a(2);
34277
34336
  }
34278
- }, _callee22);
34337
+ }, _callee24);
34279
34338
  }));
34280
- return function getDocs(_x10) {
34281
- return _ref23.apply(this, arguments);
34339
+ return function getDocs(_x11) {
34340
+ return _ref26.apply(this, arguments);
34282
34341
  };
34283
34342
  }();
34284
34343
 
@@ -34290,50 +34349,50 @@ var getDocs = /*#__PURE__*/function () {
34290
34349
  * @throws {ApacuanaAPIError} Si los datos son inválidos o la llamada a la API falla.
34291
34350
  */
34292
34351
  var uploadSignatureVariant = /*#__PURE__*/function () {
34293
- var _ref24 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee23(data) {
34352
+ var _ref27 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25(data) {
34294
34353
  var _getConfig7, integrationType;
34295
- return _regenerator().w(function (_context23) {
34296
- while (1) switch (_context23.n) {
34354
+ return _regenerator().w(function (_context25) {
34355
+ while (1) switch (_context25.n) {
34297
34356
  case 0:
34298
34357
  if (!(!data || !data.file)) {
34299
- _context23.n = 1;
34358
+ _context25.n = 1;
34300
34359
  break;
34301
34360
  }
34302
34361
  throw new ApacuanaAPIError("El parámetro 'file' es requerido.", 400, "INVALID_PARAMETER");
34303
34362
  case 1:
34304
34363
  if (!(typeof File === "undefined" || !(data.file instanceof File))) {
34305
- _context23.n = 2;
34364
+ _context25.n = 2;
34306
34365
  break;
34307
34366
  }
34308
34367
  throw new ApacuanaAPIError("El parámetro 'file' debe ser una instancia de 'File'.", 400, "INVALID_PARAMETER");
34309
34368
  case 2:
34310
34369
  if (!(data.file.type !== "image/png")) {
34311
- _context23.n = 3;
34370
+ _context25.n = 3;
34312
34371
  break;
34313
34372
  }
34314
34373
  throw new ApacuanaAPIError("El archivo debe ser de tipo PNG (image/png).", 400, "INVALID_PARAMETER");
34315
34374
  case 3:
34316
34375
  _getConfig7 = getConfig(), integrationType = _getConfig7.integrationType;
34317
34376
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34318
- _context23.n = 4;
34377
+ _context25.n = 4;
34319
34378
  break;
34320
34379
  }
34321
- return _context23.a(2, uploadSignatureVariantOnBoarding(data));
34380
+ return _context25.a(2, uploadSignatureVariantOnBoarding(data));
34322
34381
  case 4:
34323
34382
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34324
- _context23.n = 5;
34383
+ _context25.n = 5;
34325
34384
  break;
34326
34385
  }
34327
- return _context23.a(2, uploadSignatureVariantOnPremise());
34386
+ return _context25.a(2, uploadSignatureVariantOnPremise());
34328
34387
  case 5:
34329
34388
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34330
34389
  case 6:
34331
- return _context23.a(2);
34390
+ return _context25.a(2);
34332
34391
  }
34333
- }, _callee23);
34392
+ }, _callee25);
34334
34393
  }));
34335
- return function uploadSignatureVariant(_x11) {
34336
- return _ref24.apply(this, arguments);
34394
+ return function uploadSignatureVariant(_x12) {
34395
+ return _ref27.apply(this, arguments);
34337
34396
  };
34338
34397
  }();
34339
34398
 
@@ -34343,32 +34402,32 @@ var uploadSignatureVariant = /*#__PURE__*/function () {
34343
34402
  * @throws {ApacuanaAPIError} Si la llamada a la API falla o el tipo de integración no es soportado.
34344
34403
  */
34345
34404
  var getSignatureVariant = /*#__PURE__*/function () {
34346
- var _ref25 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee24() {
34405
+ var _ref28 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26() {
34347
34406
  var _getConfig8, integrationType;
34348
- return _regenerator().w(function (_context24) {
34349
- while (1) switch (_context24.n) {
34407
+ return _regenerator().w(function (_context26) {
34408
+ while (1) switch (_context26.n) {
34350
34409
  case 0:
34351
34410
  _getConfig8 = getConfig(), integrationType = _getConfig8.integrationType;
34352
34411
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34353
- _context24.n = 1;
34412
+ _context26.n = 1;
34354
34413
  break;
34355
34414
  }
34356
- return _context24.a(2, getSignatureVariantOnBoarding());
34415
+ return _context26.a(2, getSignatureVariantOnBoarding());
34357
34416
  case 1:
34358
34417
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34359
- _context24.n = 2;
34418
+ _context26.n = 2;
34360
34419
  break;
34361
34420
  }
34362
- return _context24.a(2, getSignatureVariantOnPremise());
34421
+ return _context26.a(2, getSignatureVariantOnPremise());
34363
34422
  case 2:
34364
34423
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34365
34424
  case 3:
34366
- return _context24.a(2);
34425
+ return _context26.a(2);
34367
34426
  }
34368
- }, _callee24);
34427
+ }, _callee26);
34369
34428
  }));
34370
34429
  return function getSignatureVariant() {
34371
- return _ref25.apply(this, arguments);
34430
+ return _ref28.apply(this, arguments);
34372
34431
  };
34373
34432
  }();
34374
34433
 
@@ -34378,32 +34437,32 @@ var getSignatureVariant = /*#__PURE__*/function () {
34378
34437
  * @throws {ApacuanaAPIError} Si la llamada a la API falla o el tipo de integración no es soportado.
34379
34438
  */
34380
34439
  var deleteSignatureVariant = /*#__PURE__*/function () {
34381
- var _ref26 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee25() {
34440
+ var _ref29 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27() {
34382
34441
  var _getConfig9, integrationType;
34383
- return _regenerator().w(function (_context25) {
34384
- while (1) switch (_context25.n) {
34442
+ return _regenerator().w(function (_context27) {
34443
+ while (1) switch (_context27.n) {
34385
34444
  case 0:
34386
34445
  _getConfig9 = getConfig(), integrationType = _getConfig9.integrationType;
34387
34446
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34388
- _context25.n = 1;
34447
+ _context27.n = 1;
34389
34448
  break;
34390
34449
  }
34391
- return _context25.a(2, deleteSignatureVariantOnBoarding());
34450
+ return _context27.a(2, deleteSignatureVariantOnBoarding());
34392
34451
  case 1:
34393
34452
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34394
- _context25.n = 2;
34453
+ _context27.n = 2;
34395
34454
  break;
34396
34455
  }
34397
- return _context25.a(2, deleteSignatureVariantOnPremise());
34456
+ return _context27.a(2, deleteSignatureVariantOnPremise());
34398
34457
  case 2:
34399
34458
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34400
34459
  case 3:
34401
- return _context25.a(2);
34460
+ return _context27.a(2);
34402
34461
  }
34403
- }, _callee25);
34462
+ }, _callee27);
34404
34463
  }));
34405
34464
  return function deleteSignatureVariant() {
34406
- return _ref26.apply(this, arguments);
34465
+ return _ref29.apply(this, arguments);
34407
34466
  };
34408
34467
  }();
34409
34468
 
@@ -34414,32 +34473,32 @@ var deleteSignatureVariant = /*#__PURE__*/function () {
34414
34473
  * @throws {ApacuanaAPIError} Si los datos del signatario son inválidos, la llamada a la API falla, o el tipo de integración no es soportado.
34415
34474
  */
34416
34475
  var addMember = /*#__PURE__*/function () {
34417
- var _ref27 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee26(memberData) {
34476
+ var _ref30 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(memberData) {
34418
34477
  var _getConfig0, integrationType;
34419
- return _regenerator().w(function (_context26) {
34420
- while (1) switch (_context26.n) {
34478
+ return _regenerator().w(function (_context28) {
34479
+ while (1) switch (_context28.n) {
34421
34480
  case 0:
34422
34481
  _getConfig0 = getConfig(), integrationType = _getConfig0.integrationType;
34423
34482
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34424
- _context26.n = 1;
34483
+ _context28.n = 1;
34425
34484
  break;
34426
34485
  }
34427
- return _context26.a(2, addMemberOnBoarding(memberData));
34486
+ return _context28.a(2, addMemberOnBoarding(memberData));
34428
34487
  case 1:
34429
34488
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34430
- _context26.n = 2;
34489
+ _context28.n = 2;
34431
34490
  break;
34432
34491
  }
34433
- return _context26.a(2, addMemberOnPremise());
34492
+ return _context28.a(2, addMemberOnPremise());
34434
34493
  case 2:
34435
34494
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34436
34495
  case 3:
34437
- return _context26.a(2);
34496
+ return _context28.a(2);
34438
34497
  }
34439
- }, _callee26);
34498
+ }, _callee28);
34440
34499
  }));
34441
- return function addMember(_x12) {
34442
- return _ref27.apply(this, arguments);
34500
+ return function addMember(_x13) {
34501
+ return _ref30.apply(this, arguments);
34443
34502
  };
34444
34503
  }();
34445
34504
 
@@ -34452,44 +34511,44 @@ var addMember = /*#__PURE__*/function () {
34452
34511
  * @throws {ApacuanaAPIError} Si los datos son inválidos, la llamada a la API falla, o el tipo de integración no es soportado.
34453
34512
  */
34454
34513
  var createDocument = /*#__PURE__*/function () {
34455
- var _ref28 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee27(documentData) {
34514
+ var _ref31 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee29(documentData) {
34456
34515
  var _getConfig1, integrationType;
34457
- return _regenerator().w(function (_context27) {
34458
- while (1) switch (_context27.n) {
34516
+ return _regenerator().w(function (_context29) {
34517
+ while (1) switch (_context29.n) {
34459
34518
  case 0:
34460
34519
  if (!(!documentData || _typeof(documentData) !== "object" || Object.keys(documentData).length === 0)) {
34461
- _context27.n = 1;
34520
+ _context29.n = 1;
34462
34521
  break;
34463
34522
  }
34464
34523
  throw new ApacuanaAPIError("Document data (documentData) is required and must be a non-empty object.", 400, "INVALID_PARAMETER");
34465
34524
  case 1:
34466
34525
  if (!(!documentData.name || !documentData.reference)) {
34467
- _context27.n = 2;
34526
+ _context29.n = 2;
34468
34527
  break;
34469
34528
  }
34470
34529
  throw new ApacuanaAPIError("Fields 'name' and 'reference' are required.", 400, "INVALID_PARAMETER");
34471
34530
  case 2:
34472
34531
  _getConfig1 = getConfig(), integrationType = _getConfig1.integrationType;
34473
34532
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34474
- _context27.n = 3;
34533
+ _context29.n = 3;
34475
34534
  break;
34476
34535
  }
34477
- return _context27.a(2, createDocumentOnBoarding(documentData));
34536
+ return _context29.a(2, createDocumentOnBoarding(documentData));
34478
34537
  case 3:
34479
34538
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34480
- _context27.n = 4;
34539
+ _context29.n = 4;
34481
34540
  break;
34482
34541
  }
34483
- return _context27.a(2, createDocumentOnPremise());
34542
+ return _context29.a(2, createDocumentOnPremise());
34484
34543
  case 4:
34485
34544
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34486
34545
  case 5:
34487
- return _context27.a(2);
34546
+ return _context29.a(2);
34488
34547
  }
34489
- }, _callee27);
34548
+ }, _callee29);
34490
34549
  }));
34491
- return function createDocument(_x13) {
34492
- return _ref28.apply(this, arguments);
34550
+ return function createDocument(_x14) {
34551
+ return _ref31.apply(this, arguments);
34493
34552
  };
34494
34553
  }();
34495
34554
 
@@ -34500,38 +34559,94 @@ var createDocument = /*#__PURE__*/function () {
34500
34559
  * @throws {ApacuanaAPIError} Si el documentId es inválido, la llamada a la API falla, o el tipo de integración no es soportado.
34501
34560
  */
34502
34561
  var lockDocument = /*#__PURE__*/function () {
34503
- var _ref29 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee28(documentId) {
34562
+ var _ref32 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee30(documentId) {
34504
34563
  var _getConfig10, integrationType;
34505
- return _regenerator().w(function (_context28) {
34506
- while (1) switch (_context28.n) {
34564
+ return _regenerator().w(function (_context30) {
34565
+ while (1) switch (_context30.n) {
34507
34566
  case 0:
34508
34567
  if (!(!documentId || typeof documentId !== "string")) {
34509
- _context28.n = 1;
34568
+ _context30.n = 1;
34510
34569
  break;
34511
34570
  }
34512
34571
  throw new ApacuanaAPIError("Field 'documentId' is required and must be a string.", 400, "INVALID_PARAMETER");
34513
34572
  case 1:
34514
34573
  _getConfig10 = getConfig(), integrationType = _getConfig10.integrationType;
34515
34574
  if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34516
- _context28.n = 2;
34575
+ _context30.n = 2;
34517
34576
  break;
34518
34577
  }
34519
- return _context28.a(2, lockDocumentOnBoarding(documentId));
34578
+ return _context30.a(2, lockDocumentOnBoarding(documentId));
34520
34579
  case 2:
34521
34580
  if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34522
- _context28.n = 3;
34581
+ _context30.n = 3;
34523
34582
  break;
34524
34583
  }
34525
- return _context28.a(2, lockDocumentOnPremise());
34584
+ return _context30.a(2, lockDocumentOnPremise());
34526
34585
  case 3:
34527
34586
  throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34528
34587
  case 4:
34529
- return _context28.a(2);
34588
+ return _context30.a(2);
34530
34589
  }
34531
- }, _callee28);
34590
+ }, _callee30);
34532
34591
  }));
34533
- return function lockDocument(_x14) {
34534
- return _ref29.apply(this, arguments);
34592
+ return function lockDocument(_x15) {
34593
+ return _ref32.apply(this, arguments);
34594
+ };
34595
+ }();
34596
+
34597
+ /**
34598
+ * Elimina la firma de un firmante de un documento.
34599
+ * @param {DeleteSignatureData} data - IDs del documento y de la firma.
34600
+ * @param {string} data.documentId - ID (UUID) del documento.
34601
+ * @param {string} data.signatureId - ID (UUID) de la firma a eliminar.
34602
+ * @returns {Promise<object>} Una promesa que resuelve al response de la API.
34603
+ * @throws {ApacuanaAPIError} Si los IDs son inválidos, la llamada a la API falla, o el tipo de integración no es soportado.
34604
+ */
34605
+ var deleteSignature = /*#__PURE__*/function () {
34606
+ var _ref33 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31(data) {
34607
+ var _getConfig11, integrationType;
34608
+ return _regenerator().w(function (_context31) {
34609
+ while (1) switch (_context31.n) {
34610
+ case 0:
34611
+ if (!(!data || _typeof(data) !== "object" || Object.keys(data).length === 0)) {
34612
+ _context31.n = 1;
34613
+ break;
34614
+ }
34615
+ throw new ApacuanaAPIError("Fields 'documentId' and 'signatureId' are required.", 400, "INVALID_PARAMETER");
34616
+ case 1:
34617
+ if (!(!data.documentId || typeof data.documentId !== "string")) {
34618
+ _context31.n = 2;
34619
+ break;
34620
+ }
34621
+ throw new ApacuanaAPIError("Field 'documentId' is required and must be a string.", 400, "INVALID_PARAMETER");
34622
+ case 2:
34623
+ if (!(!data.signatureId || typeof data.signatureId !== "string")) {
34624
+ _context31.n = 3;
34625
+ break;
34626
+ }
34627
+ throw new ApacuanaAPIError("Field 'signatureId' is required and must be a string.", 400, "INVALID_PARAMETER");
34628
+ case 3:
34629
+ _getConfig11 = getConfig(), integrationType = _getConfig11.integrationType;
34630
+ if (!(integrationType === INTEGRATION_TYPE.ONBOARDING)) {
34631
+ _context31.n = 4;
34632
+ break;
34633
+ }
34634
+ return _context31.a(2, deleteSignatureOnBoarding(data));
34635
+ case 4:
34636
+ if (!(integrationType === INTEGRATION_TYPE.ONPREMISE)) {
34637
+ _context31.n = 5;
34638
+ break;
34639
+ }
34640
+ return _context31.a(2, deleteSignatureOnPremise());
34641
+ case 5:
34642
+ throw new ApacuanaAPIError("Unsupported integration type: ".concat(integrationType), 400, "UNSUPPORTED_INTEGRATION_TYPE");
34643
+ case 6:
34644
+ return _context31.a(2);
34645
+ }
34646
+ }, _callee31);
34647
+ }));
34648
+ return function deleteSignature(_x16) {
34649
+ return _ref33.apply(this, arguments);
34535
34650
  };
34536
34651
  }();
34537
34652
 
@@ -34741,6 +34856,10 @@ var apacuana = {
34741
34856
  checkSdk(true);
34742
34857
  return addMember(data);
34743
34858
  },
34859
+ deleteSignature: function deleteSignature$1(data) {
34860
+ checkSdk(false);
34861
+ return deleteSignature(data);
34862
+ },
34744
34863
  deleteSignatureVariant: function deleteSignatureVariant$1() {
34745
34864
  checkSdk(true);
34746
34865
  return deleteSignatureVariant();