@midwayjs/consul 3.5.3 → 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.
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ConsulConfiguration = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
13
+ const core_1 = require("@midwayjs/core");
14
14
  const provider_1 = require("./lib/provider");
15
15
  const DefaultConfig = require("./config/config.default");
16
16
  let ConsulConfiguration = class ConsulConfiguration {
@@ -43,7 +43,7 @@ let ConsulConfiguration = class ConsulConfiguration {
43
43
  config.check ||
44
44
  (config.check === false
45
45
  ? void 0
46
- : app.getFrameworkType() === decorator_1.MidwayFrameworkType.WEB
46
+ : app.getFrameworkType() === core_1.MidwayFrameworkType.WEB
47
47
  ? {
48
48
  http: `http://${address}:${port}/consul/health/self/check`,
49
49
  interval: '3s',
@@ -70,15 +70,15 @@ let ConsulConfiguration = class ConsulConfiguration {
70
70
  }
71
71
  };
72
72
  __decorate([
73
- (0, decorator_1.Config)('consul.provider'),
73
+ (0, core_1.Config)('consul.provider'),
74
74
  __metadata("design:type", Object)
75
75
  ], ConsulConfiguration.prototype, "consulProviderConfig", void 0);
76
76
  __decorate([
77
- (0, decorator_1.Config)('consul.service'),
77
+ (0, core_1.Config)('consul.service'),
78
78
  __metadata("design:type", Object)
79
79
  ], ConsulConfiguration.prototype, "consulRegisterConfig", void 0);
80
80
  ConsulConfiguration = __decorate([
81
- (0, decorator_1.Configuration)({
81
+ (0, core_1.Configuration)({
82
82
  namespace: 'consul',
83
83
  importConfigs: [
84
84
  {
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ConsulController = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
13
+ const core_1 = require("@midwayjs/core");
14
14
  let ConsulController = class ConsulController {
15
15
  async healthCheck() {
16
16
  return {
@@ -19,14 +19,13 @@ let ConsulController = class ConsulController {
19
19
  }
20
20
  };
21
21
  __decorate([
22
- (0, decorator_1.Get)('/health/self/check'),
22
+ (0, core_1.Get)('/health/self/check'),
23
23
  __metadata("design:type", Function),
24
24
  __metadata("design:paramtypes", []),
25
25
  __metadata("design:returntype", Promise)
26
26
  ], ConsulController.prototype, "healthCheck", null);
27
27
  ConsulController = __decorate([
28
- (0, decorator_1.Provide)(),
29
- (0, decorator_1.Controller)('/consul')
28
+ (0, core_1.Controller)('/consul')
30
29
  ], ConsulController);
31
30
  exports.ConsulController = ConsulController;
32
31
  //# sourceMappingURL=consul.js.map
@@ -1,5 +1,5 @@
1
1
  import * as Consul from 'consul';
2
- import { ConsulOptions } from 'consul';
2
+ import type { ConsulOptions } from 'consul';
3
3
  import RegisterOptions = Consul.Agent.Service.RegisterOptions;
4
4
  export interface IServiceBalancer {
5
5
  /**
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BalancerService = void 0;
13
- const decorator_1 = require("@midwayjs/decorator");
13
+ const core_1 = require("@midwayjs/core");
14
14
  const balancer_1 = require("../lib/balancer");
15
15
  const Consul = require("consul");
16
16
  let BalancerService = class BalancerService {
@@ -22,18 +22,18 @@ let BalancerService = class BalancerService {
22
22
  }
23
23
  };
24
24
  __decorate([
25
- (0, decorator_1.Inject)('consul:consul'),
25
+ (0, core_1.Inject)('consul:consul'),
26
26
  __metadata("design:type", Object)
27
27
  ], BalancerService.prototype, "consul", void 0);
28
28
  __decorate([
29
- (0, decorator_1.Init)(),
29
+ (0, core_1.Init)(),
30
30
  __metadata("design:type", Function),
31
31
  __metadata("design:paramtypes", []),
32
32
  __metadata("design:returntype", void 0)
33
33
  ], BalancerService.prototype, "init", null);
34
34
  BalancerService = __decorate([
35
- (0, decorator_1.Provide)(),
36
- (0, decorator_1.Scope)(decorator_1.ScopeEnum.Singleton)
35
+ (0, core_1.Provide)(),
36
+ (0, core_1.Scope)(core_1.ScopeEnum.Singleton)
37
37
  ], BalancerService);
38
38
  exports.BalancerService = BalancerService;
39
39
  //# sourceMappingURL=balancer.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midwayjs/consul",
3
3
  "description": "midway consul",
4
- "version": "3.5.3",
4
+ "version": "3.7.0",
5
5
  "main": "dist/index",
6
6
  "typings": "index.d.ts",
7
7
  "files": [
@@ -10,10 +10,9 @@
10
10
  "index.d.ts"
11
11
  ],
12
12
  "devDependencies": {
13
- "@midwayjs/core": "^3.5.3",
14
- "@midwayjs/decorator": "^3.4.11",
15
- "@midwayjs/koa": "^3.5.3",
16
- "@midwayjs/mock": "^3.5.3",
13
+ "@midwayjs/core": "^3.7.0",
14
+ "@midwayjs/koa": "^3.7.0",
15
+ "@midwayjs/mock": "^3.7.0",
17
16
  "@types/consul": "0.40.0",
18
17
  "@types/sinon": "10.0.13",
19
18
  "nock": "13.2.9"
@@ -40,5 +39,5 @@
40
39
  "type": "git",
41
40
  "url": "https://github.com/midwayjs/midway.git"
42
41
  },
43
- "gitHead": "32356484664846984f6d3d65a3a75dea015e8dcc"
42
+ "gitHead": "99386083ee26b386fd508b9c892091c914e77535"
44
43
  }