@midwayjs/axios 3.4.10 → 3.4.13

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.
@@ -24,6 +24,19 @@ AxiosConfiguration = __decorate([
24
24
  },
25
25
  },
26
26
  ],
27
+ importConfigFilter: config => {
28
+ if (config['axios']) {
29
+ if (!config['axios']['clients'] || !config['axios']['client']) {
30
+ config['axios'] = {
31
+ default: {},
32
+ clients: {
33
+ default: config['axios'],
34
+ },
35
+ };
36
+ }
37
+ }
38
+ return config;
39
+ },
27
40
  })
28
41
  ], AxiosConfiguration);
29
42
  exports.AxiosConfiguration = AxiosConfiguration;
@@ -54,6 +54,9 @@ let HttpService = class HttpService {
54
54
  }
55
55
  async init() {
56
56
  this.instance = this.serviceFactory.get('default');
57
+ if (!this.instance) {
58
+ throw new core_1.MidwayCommonError('axios default instance not found.');
59
+ }
57
60
  }
58
61
  getUri(config) {
59
62
  return this.instance.getUri(config);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/axios",
3
3
  "description": "midway http client with axios",
4
- "version": "3.4.10",
4
+ "version": "3.4.13",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -10,9 +10,9 @@
10
10
  "index.d.ts"
11
11
  ],
12
12
  "devDependencies": {
13
- "@midwayjs/core": "^3.4.10",
14
- "@midwayjs/decorator": "^3.4.4",
15
- "@midwayjs/mock": "^3.4.10"
13
+ "@midwayjs/core": "^3.4.13",
14
+ "@midwayjs/decorator": "^3.4.11",
15
+ "@midwayjs/mock": "^3.4.13"
16
16
  },
17
17
  "dependencies": {
18
18
  "axios": "0.27.2"
@@ -37,5 +37,5 @@
37
37
  "type": "git",
38
38
  "url": "https://github.com/midwayjs/midway.git"
39
39
  },
40
- "gitHead": "aeb117633ecbc3299002b220f436dc3b5450d361"
40
+ "gitHead": "bde878f01df0a4b27919eea367d100b5ee5edb04"
41
41
  }