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