@midwayjs/axios
Advanced tools
Comparing version 3.19.2 to 4.0.0-alpha.1
@@ -17,3 +17,4 @@ "use strict"; | ||
}; | ||
AxiosConfiguration = __decorate([ | ||
exports.AxiosConfiguration = AxiosConfiguration; | ||
exports.AxiosConfiguration = AxiosConfiguration = __decorate([ | ||
(0, core_1.Configuration)({ | ||
@@ -48,3 +49,2 @@ namespace: 'axios', | ||
], AxiosConfiguration); | ||
exports.AxiosConfiguration = AxiosConfiguration; | ||
//# sourceMappingURL=configuration.js.map |
@@ -1,2 +0,2 @@ | ||
import axios from 'axios'; | ||
import * as axios from 'axios'; | ||
import * as Axios from 'axios'; | ||
@@ -3,0 +3,0 @@ export { AxiosConfiguration as Configuration } from './configuration'; |
@@ -18,4 +18,4 @@ "use strict"; | ||
exports.Axios = exports.axios = exports.Configuration = void 0; | ||
const axios_1 = require("axios"); | ||
exports.axios = axios_1.default; | ||
const axios = require("axios"); | ||
exports.axios = axios; | ||
const Axios = require("axios"); | ||
@@ -22,0 +22,0 @@ exports.Axios = Axios; |
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse, CreateAxiosDefaults } from 'axios'; | ||
import * as axios from 'axios'; | ||
import { ServiceFactory } from '@midwayjs/core'; | ||
@@ -13,10 +14,10 @@ import { AxiosHttpService } from './interface'; | ||
private serviceFactory; | ||
get defaults(): Omit<import("axios").AxiosDefaults<any>, "headers"> & { | ||
headers: import("axios").HeadersDefaults & { | ||
[key: string]: import("axios").AxiosHeaderValue; | ||
get defaults(): Omit<axios.AxiosDefaults<any>, "headers"> & { | ||
headers: axios.HeadersDefaults & { | ||
[key: string]: axios.AxiosHeaderValue; | ||
}; | ||
}; | ||
get interceptors(): { | ||
request: import("axios").AxiosInterceptorManager<import("axios").InternalAxiosRequestConfig<any>>; | ||
response: import("axios").AxiosInterceptorManager<AxiosResponse<any, any>>; | ||
request: axios.AxiosInterceptorManager<axios.InternalAxiosRequestConfig<any>>; | ||
response: axios.AxiosInterceptorManager<AxiosResponse<any, any>>; | ||
}; | ||
@@ -23,0 +24,0 @@ protected init(): Promise<void>; |
@@ -13,3 +13,3 @@ "use strict"; | ||
exports.HttpService = exports.HttpServiceFactory = void 0; | ||
const axios_1 = require("axios"); | ||
const axios = require("axios"); | ||
const core_1 = require("@midwayjs/core"); | ||
@@ -30,3 +30,3 @@ let HttpServiceFactory = class HttpServiceFactory extends core_1.ServiceFactory { | ||
async createClient(config, clientName) { | ||
return axios_1.default.create(config); | ||
return axios.create(config); | ||
} | ||
@@ -37,2 +37,3 @@ getName() { | ||
}; | ||
exports.HttpServiceFactory = HttpServiceFactory; | ||
__decorate([ | ||
@@ -48,7 +49,6 @@ (0, core_1.Config)('axios'), | ||
], HttpServiceFactory.prototype, "init", null); | ||
HttpServiceFactory = __decorate([ | ||
exports.HttpServiceFactory = HttpServiceFactory = __decorate([ | ||
(0, core_1.Provide)(), | ||
(0, core_1.Scope)(core_1.ScopeEnum.Singleton) | ||
], HttpServiceFactory); | ||
exports.HttpServiceFactory = HttpServiceFactory; | ||
let HttpService = class HttpService { | ||
@@ -62,4 +62,3 @@ get defaults() { | ||
async init() { | ||
var _a, _b; | ||
this.instance = this.serviceFactory.get(((_b = (_a = this.serviceFactory).getDefaultClientName) === null || _b === void 0 ? void 0 : _b.call(_a)) || 'default'); | ||
this.instance = this.serviceFactory.get(this.serviceFactory.getDefaultClientName?.() || 'default'); | ||
if (!this.instance) { | ||
@@ -106,2 +105,3 @@ throw new core_1.MidwayCommonError('axios default instance not found.'); | ||
}; | ||
exports.HttpService = HttpService; | ||
__decorate([ | ||
@@ -117,7 +117,6 @@ (0, core_1.Inject)(), | ||
], HttpService.prototype, "init", null); | ||
HttpService = __decorate([ | ||
exports.HttpService = HttpService = __decorate([ | ||
(0, core_1.Provide)(), | ||
(0, core_1.Scope)(core_1.ScopeEnum.Singleton) | ||
], HttpService); | ||
exports.HttpService = HttpService; | ||
//# sourceMappingURL=serviceManager.js.map |
{ | ||
"name": "@midwayjs/axios", | ||
"description": "midway http client with axios", | ||
"version": "3.19.2", | ||
"version": "4.0.0-alpha.1", | ||
"main": "dist/index.js", | ||
@@ -13,4 +13,4 @@ "typings": "index.d.ts", | ||
"devDependencies": { | ||
"@midwayjs/core": "^3.19.0", | ||
"@midwayjs/mock": "^3.19.2", | ||
"@midwayjs/core": "^4.0.0-alpha.1", | ||
"@midwayjs/mock": "^4.0.0-alpha.1", | ||
"nock": "13.5.6" | ||
@@ -29,4 +29,4 @@ }, | ||
"build": "tsc", | ||
"test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand", | ||
"cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit", | ||
"test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand", | ||
"cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit", | ||
"ci": "npm run test", | ||
@@ -42,3 +42,3 @@ "lint": "mwts check" | ||
}, | ||
"gitHead": "57fd034be94897fb819b0d9ef776de0b9923ab0f" | ||
"gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14649
2