@midwayjs/process-agent 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.ProcessAgentConfiguration = void 0;
|
|
13
|
-
const
|
|
13
|
+
const core_1 = require("@midwayjs/core");
|
|
14
14
|
const utils_1 = require("./utils/utils");
|
|
15
15
|
const os = require("os");
|
|
16
16
|
const path = require("path");
|
|
@@ -19,7 +19,7 @@ const http = require("http");
|
|
|
19
19
|
const qs = require("querystring");
|
|
20
20
|
let ProcessAgentConfiguration = class ProcessAgentConfiguration {
|
|
21
21
|
async onReady() {
|
|
22
|
-
const modules = (0,
|
|
22
|
+
const modules = (0, core_1.listModule)('primary:primary');
|
|
23
23
|
const handlers = {};
|
|
24
24
|
let sockFile = path.join(os.tmpdir(), 'midway-primary.sock');
|
|
25
25
|
if (process.platform === 'win32') {
|
|
@@ -53,7 +53,7 @@ let ProcessAgentConfiguration = class ProcessAgentConfiguration {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
for (const module of modules) {
|
|
56
|
-
const rules = (0,
|
|
56
|
+
const rules = (0, core_1.getClassMetadata)('primary:primary:options', module);
|
|
57
57
|
for (const rule of rules) {
|
|
58
58
|
if ((0, utils_1.isPrimary)()) {
|
|
59
59
|
handlers[rule.name] = async (...args) => {
|
|
@@ -74,11 +74,11 @@ let ProcessAgentConfiguration = class ProcessAgentConfiguration {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
__decorate([
|
|
77
|
-
(0,
|
|
77
|
+
(0, core_1.App)(),
|
|
78
78
|
__metadata("design:type", Object)
|
|
79
79
|
], ProcessAgentConfiguration.prototype, "app", void 0);
|
|
80
80
|
ProcessAgentConfiguration = __decorate([
|
|
81
|
-
(0,
|
|
81
|
+
(0, core_1.Configuration)({
|
|
82
82
|
namespace: 'process-agent',
|
|
83
83
|
})
|
|
84
84
|
], ProcessAgentConfiguration);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RunInPrimary = void 0;
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@midwayjs/core");
|
|
5
5
|
const request = require("request");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const os = require("os");
|
|
@@ -9,7 +9,7 @@ const utils_1 = require("../utils/utils");
|
|
|
9
9
|
const qs = require("querystring");
|
|
10
10
|
function RunInPrimary() {
|
|
11
11
|
return function (target, propertyKey, descriptor) {
|
|
12
|
-
(0,
|
|
12
|
+
(0, core_1.saveModule)('primary:primary', target.constructor);
|
|
13
13
|
const sockFile = path.join(os.tmpdir(), 'midway-primary.sock');
|
|
14
14
|
if (!(0, utils_1.isPrimary)()) {
|
|
15
15
|
descriptor.value = (...args) => {
|
|
@@ -39,7 +39,7 @@ function RunInPrimary() {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
(0,
|
|
42
|
+
(0, core_1.attachClassMetadata)('primary:primary:options', {
|
|
43
43
|
name: `${target.constructor.name}_${propertyKey}`,
|
|
44
44
|
value: descriptor.value,
|
|
45
45
|
}, target.constructor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/process-agent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -25,13 +25,12 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@midwayjs/core": "^3.
|
|
29
|
-
"@midwayjs/
|
|
30
|
-
"@midwayjs/
|
|
31
|
-
"@midwayjs/mock": "^3.5.3"
|
|
28
|
+
"@midwayjs/core": "^3.6.0",
|
|
29
|
+
"@midwayjs/koa": "^3.6.0",
|
|
30
|
+
"@midwayjs/mock": "^3.6.0"
|
|
32
31
|
},
|
|
33
32
|
"dependencies": {
|
|
34
33
|
"request": "2.88.2"
|
|
35
34
|
},
|
|
36
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "22643b0e8519766bb7c68b975930199fc136336e"
|
|
37
36
|
}
|