@verdocs/js-sdk 3.1.8 → 3.1.10
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/Envelopes/Envelopes.js +6 -1
- package/Templates/Pages.js +6 -1
- package/VerdocsEndpoint.js +9 -0
- package/package.json +3 -2
package/Envelopes/Envelopes.js
CHANGED
|
@@ -258,7 +258,12 @@ export var getEnvelopesByTemplateId = function (endpoint, templateId) { return _
|
|
|
258
258
|
export var getEnvelopeDocumentPageDisplayUri = function (endpoint, envelopeId, documentId, page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
259
259
|
return __generator(this, function (_a) {
|
|
260
260
|
return [2 /*return*/, endpoint.api
|
|
261
|
-
.get("/envelopes/".concat(envelopeId, "/envelope_documents/").concat(documentId, "/pages/").concat(page, "/image"), {
|
|
261
|
+
.get("/envelopes/".concat(envelopeId, "/envelope_documents/").concat(documentId, "/pages/").concat(page, "/image"), {
|
|
262
|
+
timeout: 20000,
|
|
263
|
+
'axios-retry': {
|
|
264
|
+
retries: 5,
|
|
265
|
+
},
|
|
266
|
+
})
|
|
262
267
|
.then(function (r) { return r.data; })];
|
|
263
268
|
});
|
|
264
269
|
}); };
|
package/Templates/Pages.js
CHANGED
|
@@ -20,7 +20,12 @@ export var editPage = function (endpoint, templateId, sequence) {
|
|
|
20
20
|
export var getPage = function (endpoint, templateId, sequence, thumbnail) {
|
|
21
21
|
if (thumbnail === void 0) { thumbnail = false; }
|
|
22
22
|
return endpoint.api //
|
|
23
|
-
.get("/templates/".concat(templateId, "/pages/").concat(sequence).concat(thumbnail ? '?thumbnail=true' : '')
|
|
23
|
+
.get("/templates/".concat(templateId, "/pages/").concat(sequence).concat(thumbnail ? '?thumbnail=true' : ''), {
|
|
24
|
+
timeout: 20000,
|
|
25
|
+
'axios-retry': {
|
|
26
|
+
retries: 5,
|
|
27
|
+
},
|
|
28
|
+
})
|
|
24
29
|
.then(function (r) { return r.data; });
|
|
25
30
|
};
|
|
26
31
|
/**
|
package/VerdocsEndpoint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import axiosRetry from 'axios-retry';
|
|
1
2
|
import axios from 'axios';
|
|
2
3
|
import { decodeAccessTokenBody } from './Utils/Token';
|
|
3
4
|
import globalThis from './Utils/globalThis';
|
|
@@ -61,6 +62,14 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
|
61
62
|
this.sessionType = (options === null || options === void 0 ? void 0 : options.sessionType) || 'user';
|
|
62
63
|
this.clientID = (options === null || options === void 0 ? void 0 : options.clientID) || 'not-set';
|
|
63
64
|
this.api = axios.create({ baseURL: this.baseURL, timeout: this.timeout });
|
|
65
|
+
// We set the default retries to zero because we only actually want this feature on certain calls for now
|
|
66
|
+
axiosRetry(this.api, {
|
|
67
|
+
retries: 0,
|
|
68
|
+
retryDelay: axiosRetry.exponentialDelay,
|
|
69
|
+
onRetry: function (retryCount, error, requestConfig) {
|
|
70
|
+
window.console.debug("[JS_SDK] Retrying request (".concat(retryCount, ")"), error.message, requestConfig.url);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
64
73
|
}
|
|
65
74
|
VerdocsEndpoint.prototype.setDefault = function () {
|
|
66
75
|
globalThis[ENDPOINT_KEY] = this;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdocs/js-sdk",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"homepage": "https://github.com/Verdocs/js-sdk",
|
|
6
6
|
"description": "Verdocs JS SDK",
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"axios": "^1.3.4"
|
|
49
|
+
"axios": "^1.3.4",
|
|
50
|
+
"axios-retry": "^3.4.0"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"typescript": "^4.7.3"
|