badmfck-api-server 4.1.53 → 4.1.57
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/apiServer/APIService.d.ts +3 -4
- package/dist/apiServer/APIService.js +19 -9
- package/dist/apiServer/BaseEndpoint.d.ts +2 -2
- package/dist/apiServer/LocalRequest.d.ts +1 -1
- package/dist/apiServer/LogService.js +17 -7
- package/dist/apiServer/MonitorService.d.ts +0 -1
- package/dist/apiServer/MonitorService.js +17 -7
- package/dist/apiServer/MysqlService.d.ts +1 -2
- package/dist/apiServer/MysqlService.js +17 -7
- package/dist/apiServer/TimeframeService.js +17 -7
- package/dist/apiServer/db/MysqlAdapter.d.ts +1 -1
- package/dist/apiServer/db/MysqlAdapter.js +37 -12
- package/dist/apiServer/deployment/Activate.js +1 -2
- package/dist/apiServer/deployment/ConfigService.d.ts +26 -26
- package/dist/apiServer/deployment/ConfigService.js +17 -7
- package/dist/apiServer/deployment/Deploy.js +1 -2
- package/dist/apiServer/deployment/DeployerService.d.ts +9 -9
- package/dist/apiServer/deployment/cli.js +37 -14
- package/dist/apiServer/deployment/resolveConfig.js +2 -3
- package/dist/apiServer/documentation/index.html +25 -25
- package/dist/apiServer/external/ExternalService.js +17 -7
- package/dist/apiServer/external/MicroserviceClient.js +17 -7
- package/dist/apiServer/external/MicroserviceHost.js +17 -7
- package/dist/apiServer/external/MicroserviceHostController.js +17 -7
- package/dist/apiServer/helper/JSONStableStringify.js +1 -2
- package/dist/apiServer/helper/YYYYMMDDHH.js +2 -3
- package/dist/apiServer/helper/ZipUtils.d.ts +0 -2
- package/dist/apiServer/monitor/Monitor.d.ts +1 -0
- package/dist/apiServer/monitor/Monitor.js +5 -0
- package/dist/apiServer/monitor/ProcessMonitor.d.ts +45 -1
- package/dist/apiServer/monitor/ProcessMonitor.js +147 -0
- package/dist/apiServer/monitor/SystemInfo.d.ts +7 -8
- package/dist/apiServer/monitor/SystemInfo.js +1 -2
- package/dist/apiServer/monitor/index.html +54 -54
- package/dist/apiServer/structures/Interfaces.d.ts +0 -1
- package/package.json +1 -1
|
@@ -5,27 +5,50 @@ const Deploy_1 = require("./Deploy");
|
|
|
5
5
|
const Activate_1 = require("./Activate");
|
|
6
6
|
function usage() {
|
|
7
7
|
console.error("Usage:");
|
|
8
|
-
console.error(" badmfck deploy — build + upload the current project");
|
|
9
|
-
console.error(" badmfck activate [blue|green] — switch blue-green slot (omit for lastDeployed)");
|
|
8
|
+
console.error(" badmfck deploy [config.json] — build + upload the current project");
|
|
9
|
+
console.error(" badmfck activate [config.json] [blue|green] — switch blue-green slot (omit slot for lastDeployed)");
|
|
10
|
+
console.error("");
|
|
11
|
+
console.error("Config path is optional (auto-discovers deploy/ folder → deploy.json when omitted).");
|
|
12
|
+
console.error("Via npm, prefix args with -- e.g. npm run deploy -- deploy/custom.json");
|
|
10
13
|
process.exit(1);
|
|
11
14
|
}
|
|
15
|
+
function parseArgs(args) {
|
|
16
|
+
let scheme;
|
|
17
|
+
let config;
|
|
18
|
+
for (const a of args) {
|
|
19
|
+
if (a === "blue" || a === "green") {
|
|
20
|
+
if (scheme) {
|
|
21
|
+
console.error(`Slot specified twice ("${scheme}" and "${a}").`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
scheme = a;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
if (config) {
|
|
28
|
+
console.error(`Config path specified twice ("${config}" and "${a}").`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
config = a;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { scheme, config };
|
|
35
|
+
}
|
|
12
36
|
async function main() {
|
|
13
37
|
const command = process.argv[2];
|
|
14
|
-
const
|
|
38
|
+
const rest = process.argv.slice(3);
|
|
15
39
|
switch (command) {
|
|
16
|
-
case "deploy":
|
|
17
|
-
|
|
40
|
+
case "deploy": {
|
|
41
|
+
const { scheme, config } = parseArgs(rest);
|
|
42
|
+
if (scheme) {
|
|
43
|
+
console.error(`"deploy" does not take a slot argument ("${scheme}").`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
await (0, Deploy_1.Deploy)(config);
|
|
18
47
|
break;
|
|
48
|
+
}
|
|
19
49
|
case "activate": {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (arg !== "blue" && arg !== "green") {
|
|
23
|
-
console.error(`Invalid slot "${arg}" — expected "blue" or "green".`);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
scheme = arg;
|
|
27
|
-
}
|
|
28
|
-
await (0, Activate_1.Activate)(undefined, scheme);
|
|
50
|
+
const { scheme, config } = parseArgs(rest);
|
|
51
|
+
await (0, Activate_1.Activate)(config, scheme);
|
|
29
52
|
break;
|
|
30
53
|
}
|
|
31
54
|
default:
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.validateConfig = validateConfig;
|
|
7
|
+
exports.resolveConfig = resolveConfig;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
const promises_1 = require("readline/promises");
|
|
@@ -21,7 +22,6 @@ function validateConfig(cfg) {
|
|
|
21
22
|
return "switch_host must be a string";
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
|
-
exports.validateConfig = validateConfig;
|
|
25
25
|
async function selectConfig(configs) {
|
|
26
26
|
if (configs.length === 0) {
|
|
27
27
|
throw new Error("No valid deploy configs found");
|
|
@@ -102,4 +102,3 @@ async function resolveConfig(opt) {
|
|
|
102
102
|
}
|
|
103
103
|
return opt;
|
|
104
104
|
}
|
|
105
|
-
exports.resolveConfig = resolveConfig;
|