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