@autofleet/network 1.4.0 → 1.4.2

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 (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -4,7 +4,7 @@ const Logger = require('@autofleet/logger');
4
4
  const qs = require('qs');
5
5
  const httpAdapter = require('axios/lib/adapters/http');
6
6
  const merge = require('deepmerge');
7
- const { setup } = require('axios-cache-adapter');
7
+ const { setup } = require('@autofleet/axios-cache-adapter');
8
8
  const Agent = require('agentkeepalive');
9
9
  const HttpsAgent = require('agentkeepalive').HttpsAgent;
10
10
 
@@ -97,7 +97,7 @@ module.exports = class Network {
97
97
  logger.info(`Finish Request: [${response.config.method.toUpperCase()} ${response.config.url}`);
98
98
  return response;
99
99
  }, (error) => {
100
- if(error.request && error.request._currentRequest &&
100
+ if(error.request && error.request._currentRequest &&
101
101
  error.request._currentRequest.reusedSocket && error.code === 'ECONNRESET') {
102
102
  // See https://www.npmjs.com/package/agentkeepalive
103
103
  // Support req.reusedSocket
@@ -106,7 +106,7 @@ module.exports = class Network {
106
106
  req: error.request._currentRequest._currentUrl,
107
107
  // method: error.request._currentRequest._options.method,
108
108
  })
109
- return axios.request(error.config);
109
+ return this.axios.request(error.config);
110
110
  }
111
111
  logger.error('Finish Request with error', {
112
112
  status: error.status,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/network",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {