apacuana-sdk-core 1.26.4 → 1.26.5

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