@verdocs/js-sdk 6.3.2 → 6.3.3

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/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import axiosRetry from 'axios-retry';
2
3
 
3
4
  const FIELD_TYPES = [
4
5
  'textbox',
@@ -1253,6 +1254,8 @@ class VerdocsEndpoint {
1253
1254
  this.clientID = options?.clientID ?? this.clientID;
1254
1255
  this.persist = options?.persist ?? this.persist;
1255
1256
  this.api = axios.create({ baseURL: this.baseURL, timeout: this.timeout });
1257
+ // Enable the module but not for any requests, only a few get this
1258
+ axiosRetry(this.api, { retries: 0 });
1256
1259
  }
1257
1260
  setDefault() {
1258
1261
  globalThis$1[ENDPOINT_KEY] = this;
@@ -1623,7 +1626,10 @@ const getEnvelopeDocument = async (endpoint, documentId) => endpoint.api //
1623
1626
  * Download a document directly.
1624
1627
  */
1625
1628
  const downloadEnvelopeDocument = async (endpoint, documentId) => endpoint.api //
1626
- .get(`/v2/envelope-documents/${documentId}?type=file`, { responseType: 'blob' })
1629
+ .get(`/v2/envelope-documents/${documentId}?type=file`, {
1630
+ responseType: 'blob',
1631
+ 'axios-retry': { retries: 5, retryDelay: axiosRetry.linearDelay(3000) },
1632
+ })
1627
1633
  .then((r) => r.data);
1628
1634
  /**
1629
1635
  * Get an envelope document's metadata, or the document itself. If no "type" parameter is specified,
@@ -1639,14 +1645,18 @@ const downloadEnvelopeDocument = async (endpoint, documentId) => endpoint.api //
1639
1645
  * @apiSuccess string . The generated link.
1640
1646
  */
1641
1647
  const getEnvelopeDocumentDownloadLink = async (endpoint, documentId) => endpoint.api //
1642
- .get(`/v2/envelope-documents/${documentId}?type=download`)
1648
+ .get(`/v2/envelope-documents/${documentId}?type=download`, {
1649
+ 'axios-retry': { retries: 5, retryDelay: axiosRetry.linearDelay(3000) },
1650
+ })
1643
1651
  .then((r) => r.data);
1644
1652
  /**
1645
1653
  * Get a pre-signed preview link for an Envelope Document. This link expires quickly, so it should
1646
1654
  * be accessed immediately and never shared. Content-Disposition will be set to "inline".
1647
1655
  */
1648
1656
  const getEnvelopeDocumentPreviewLink = async (endpoint, documentId) => endpoint.api //
1649
- .get(`/v2/envelope-documents/${documentId}?type=preview`)
1657
+ .get(`/v2/envelope-documents/${documentId}?type=preview`, {
1658
+ 'axios-retry': { retries: 5, retryDelay: axiosRetry.linearDelay(3000) },
1659
+ })
1650
1660
  .then((r) => r.data);
1651
1661
  /**
1652
1662
  * Cancel an Envelope.