@midwayjs/axios 3.5.3 → 3.6.1

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.
@@ -7,8 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.AxiosConfiguration = void 0;
10
- // import { MidwayConfigMissingError } from '@midwayjs/core';
11
- const decorator_1 = require("@midwayjs/decorator");
10
+ const core_1 = require("@midwayjs/core");
12
11
  const serviceManager_1 = require("./serviceManager");
13
12
  let AxiosConfiguration = class AxiosConfiguration {
14
13
  async onReady(container) {
@@ -16,7 +15,7 @@ let AxiosConfiguration = class AxiosConfiguration {
16
15
  }
17
16
  };
18
17
  AxiosConfiguration = __decorate([
19
- (0, decorator_1.Configuration)({
18
+ (0, core_1.Configuration)({
20
19
  namespace: 'axios',
21
20
  importConfigs: [
22
21
  {
@@ -1,5 +1,4 @@
1
1
  import { AxiosRequestConfig, AxiosResponse, AxiosInterceptorManager } from 'axios';
2
- export declare const AXIOS_INSTANCE_KEY = "axios:instance";
3
2
  export interface AxiosHttpService {
4
3
  interceptors: {
5
4
  request: AxiosInterceptorManager<AxiosRequestConfig>;
package/dist/interface.js CHANGED
@@ -1,5 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AXIOS_INSTANCE_KEY = void 0;
4
- exports.AXIOS_INSTANCE_KEY = 'axios:instance';
5
3
  //# sourceMappingURL=interface.js.map
@@ -8,10 +8,12 @@ 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
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.HttpService = exports.HttpServiceFactory = void 0;
13
- const axios_1 = require("axios");
14
- const decorator_1 = require("@midwayjs/decorator");
16
+ const axios_1 = __importDefault(require("axios"));
15
17
  const core_1 = require("@midwayjs/core");
16
18
  let HttpServiceFactory = class HttpServiceFactory extends core_1.ServiceFactory {
17
19
  async init() {
@@ -34,18 +36,18 @@ let HttpServiceFactory = class HttpServiceFactory extends core_1.ServiceFactory
34
36
  }
35
37
  };
36
38
  __decorate([
37
- (0, decorator_1.Config)('axios'),
39
+ (0, core_1.Config)('axios'),
38
40
  __metadata("design:type", Object)
39
41
  ], HttpServiceFactory.prototype, "axiosConfig", void 0);
40
42
  __decorate([
41
- (0, decorator_1.Init)(),
43
+ (0, core_1.Init)(),
42
44
  __metadata("design:type", Function),
43
45
  __metadata("design:paramtypes", []),
44
46
  __metadata("design:returntype", Promise)
45
47
  ], HttpServiceFactory.prototype, "init", null);
46
48
  HttpServiceFactory = __decorate([
47
- (0, decorator_1.Provide)(),
48
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
49
+ (0, core_1.Provide)(),
50
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
49
51
  ], HttpServiceFactory);
50
52
  exports.HttpServiceFactory = HttpServiceFactory;
51
53
  let HttpService = class HttpService {
@@ -87,18 +89,18 @@ let HttpService = class HttpService {
87
89
  }
88
90
  };
89
91
  __decorate([
90
- (0, decorator_1.Inject)(),
92
+ (0, core_1.Inject)(),
91
93
  __metadata("design:type", HttpServiceFactory)
92
94
  ], HttpService.prototype, "serviceFactory", void 0);
93
95
  __decorate([
94
- (0, decorator_1.Init)(),
96
+ (0, core_1.Init)(),
95
97
  __metadata("design:type", Function),
96
98
  __metadata("design:paramtypes", []),
97
99
  __metadata("design:returntype", Promise)
98
100
  ], HttpService.prototype, "init", null);
99
101
  HttpService = __decorate([
100
- (0, decorator_1.Provide)(),
101
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
102
+ (0, core_1.Provide)(),
103
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
102
104
  ], HttpService);
103
105
  exports.HttpService = HttpService;
104
106
  //# sourceMappingURL=serviceManager.js.map
package/index.d.ts CHANGED
@@ -4,6 +4,6 @@ export * from './dist/index';
4
4
 
5
5
  declare module '@midwayjs/core/dist/interface' {
6
6
  interface MidwayConfig {
7
- axios?: AxiosRequestConfig;
7
+ axios?: ServiceFactoryConfigOption<AxiosRequestConfig> & AxiosRequestConfig;
8
8
  }
9
9
  }
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.5.3",
4
+ "version": "3.6.1",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -10,12 +10,11 @@
10
10
  "index.d.ts"
11
11
  ],
12
12
  "devDependencies": {
13
- "@midwayjs/core": "^3.5.3",
14
- "@midwayjs/decorator": "^3.4.11",
15
- "@midwayjs/mock": "^3.5.3"
13
+ "@midwayjs/core": "^3.6.0",
14
+ "@midwayjs/mock": "^3.6.0"
16
15
  },
17
16
  "dependencies": {
18
- "axios": "0.27.2"
17
+ "axios": "1.1.2"
19
18
  },
20
19
  "keywords": [
21
20
  "http client",
@@ -37,5 +36,5 @@
37
36
  "type": "git",
38
37
  "url": "https://github.com/midwayjs/midway.git"
39
38
  },
40
- "gitHead": "32356484664846984f6d3d65a3a75dea015e8dcc"
39
+ "gitHead": "7aa8d1d712ff5ae7e3b27eb2e154d3f7ee40889a"
41
40
  }