@midwayjs/axios 3.6.1 → 3.7.0
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/serviceManager.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
1
|
+
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
import * as axios from 'axios';
|
|
2
3
|
import { ServiceFactory } from '@midwayjs/core';
|
|
3
4
|
import { AxiosHttpService } from './interface';
|
|
4
5
|
export declare class HttpServiceFactory extends ServiceFactory<AxiosInstance> {
|
|
@@ -11,8 +12,8 @@ export declare class HttpService implements AxiosHttpService {
|
|
|
11
12
|
private instance;
|
|
12
13
|
private serviceFactory;
|
|
13
14
|
get interceptors(): {
|
|
14
|
-
request:
|
|
15
|
-
response:
|
|
15
|
+
request: axios.AxiosInterceptorManager<AxiosRequestConfig<any>>;
|
|
16
|
+
response: axios.AxiosInterceptorManager<AxiosResponse<any, any>>;
|
|
16
17
|
};
|
|
17
18
|
protected init(): Promise<void>;
|
|
18
19
|
getUri(config?: AxiosRequestConfig): string;
|
package/dist/serviceManager.js
CHANGED
|
@@ -8,12 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.HttpService = exports.HttpServiceFactory = void 0;
|
|
16
|
-
const
|
|
13
|
+
const axios = require("axios");
|
|
17
14
|
const core_1 = require("@midwayjs/core");
|
|
18
15
|
let HttpServiceFactory = class HttpServiceFactory extends core_1.ServiceFactory {
|
|
19
16
|
async init() {
|
|
@@ -29,7 +26,7 @@ let HttpServiceFactory = class HttpServiceFactory extends core_1.ServiceFactory
|
|
|
29
26
|
await this.initClients(axiosConfig);
|
|
30
27
|
}
|
|
31
28
|
async createClient(config, clientName) {
|
|
32
|
-
return
|
|
29
|
+
return axios.create(config);
|
|
33
30
|
}
|
|
34
31
|
getName() {
|
|
35
32
|
return 'axios';
|
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
|
+
"version": "3.7.0",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"typings": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"index.d.ts"
|
|
11
11
|
],
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@midwayjs/core": "^3.
|
|
14
|
-
"@midwayjs/mock": "^3.
|
|
13
|
+
"@midwayjs/core": "^3.7.0",
|
|
14
|
+
"@midwayjs/mock": "^3.7.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"axios": "1.1.
|
|
17
|
+
"axios": "1.1.3"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"http client",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"type": "git",
|
|
37
37
|
"url": "https://github.com/midwayjs/midway.git"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "99386083ee26b386fd508b9c892091c914e77535"
|
|
40
40
|
}
|