@midwayjs/consul 3.5.3 → 3.6.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/configuration.js
CHANGED
|
@@ -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
|
|
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() ===
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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
|
package/dist/interface.d.ts
CHANGED
package/dist/service/balancer.js
CHANGED
|
@@ -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
|
|
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,
|
|
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,
|
|
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,
|
|
36
|
-
(0,
|
|
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.
|
|
4
|
+
"version": "3.6.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.
|
|
14
|
-
"@midwayjs/
|
|
15
|
-
"@midwayjs/
|
|
16
|
-
"@midwayjs/mock": "^3.5.3",
|
|
13
|
+
"@midwayjs/core": "^3.6.0",
|
|
14
|
+
"@midwayjs/koa": "^3.6.0",
|
|
15
|
+
"@midwayjs/mock": "^3.6.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": "
|
|
42
|
+
"gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
|
|
44
43
|
}
|