@iobroker/js-controller-cli 7.2.3 → 8.0.0-alpha.2-20260923-99da17fcc
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/build/cjs/index.js +3 -3
- package/build/cjs/lib/_Types.d.ts +8 -1
- package/build/cjs/lib/cli/cliCert.d.ts +7 -4
- package/build/cjs/lib/cli/cliCert.js +10 -6
- package/build/cjs/lib/cli/cliCert.js.map +2 -2
- package/build/cjs/lib/cli/cliCommand.d.ts +63 -15
- package/build/cjs/lib/cli/cliCommand.js +8 -1
- package/build/cjs/lib/cli/cliCommand.js.map +2 -2
- package/build/cjs/lib/cli/cliCompact.d.ts +5 -2
- package/build/cjs/lib/cli/cliCompact.js +9 -2
- package/build/cjs/lib/cli/cliCompact.js.map +2 -2
- package/build/cjs/lib/cli/cliDebug.d.ts +5 -2
- package/build/cjs/lib/cli/cliDebug.js +8 -1
- package/build/cjs/lib/cli/cliDebug.js.map +2 -2
- package/build/cjs/lib/cli/cliHost.d.ts +13 -10
- package/build/cjs/lib/cli/cliHost.js +13 -5
- package/build/cjs/lib/cli/cliHost.js.map +2 -2
- package/build/cjs/lib/cli/cliLogs.d.ts +9 -3
- package/build/cjs/lib/cli/cliLogs.js +12 -1
- package/build/cjs/lib/cli/cliLogs.js.map +2 -2
- package/build/cjs/lib/cli/cliMessage.d.ts +2 -1
- package/build/cjs/lib/cli/cliMessage.js +5 -0
- package/build/cjs/lib/cli/cliMessage.js.map +2 -2
- package/build/cjs/lib/cli/cliObjects.d.ts +21 -18
- package/build/cjs/lib/cli/cliObjects.js +51 -33
- package/build/cjs/lib/cli/cliObjects.js.map +2 -2
- package/build/cjs/lib/cli/cliPlugin.d.ts +3 -3
- package/build/cjs/lib/cli/cliPlugin.js +6 -0
- package/build/cjs/lib/cli/cliPlugin.js.map +2 -2
- package/build/cjs/lib/cli/cliProcess.d.ts +17 -7
- package/build/cjs/lib/cli/cliProcess.js +77 -24
- package/build/cjs/lib/cli/cliProcess.js.map +3 -3
- package/build/cjs/lib/cli/cliStates.d.ts +7 -4
- package/build/cjs/lib/cli/cliStates.js +14 -6
- package/build/cjs/lib/cli/cliStates.js.map +2 -2
- package/build/cjs/lib/cli/cliTools.js +11 -0
- package/build/cjs/lib/cli/cliTools.js.map +1 -1
- package/build/cjs/lib/cli/messages.js +47 -46
- package/build/cjs/lib/cli/messages.js.map +1 -1
- package/build/cjs/lib/progressBar.d.ts +59 -0
- package/build/cjs/lib/progressBar.js +115 -0
- package/build/cjs/lib/progressBar.js.map +7 -0
- package/build/cjs/lib/setup/customError.d.ts +4 -0
- package/build/cjs/lib/setup/customError.js +7 -0
- package/build/cjs/lib/setup/customError.js.map +2 -2
- package/build/cjs/lib/setup/dbConnection.js +69 -64
- package/build/cjs/lib/setup/dbConnection.js.map +3 -3
- package/build/cjs/lib/setup/formatters.d.ts +4 -4
- package/build/cjs/lib/setup/formatters.js +5 -0
- package/build/cjs/lib/setup/formatters.js.map +2 -2
- package/build/cjs/lib/setup/multihostClient.js +6 -2
- package/build/cjs/lib/setup/multihostClient.js.map +1 -1
- package/build/cjs/lib/setup/pluginInfos.d.ts +5 -0
- package/build/cjs/lib/setup/pluginInfos.js +2 -0
- package/build/cjs/lib/setup/pluginInfos.js.map +2 -2
- package/build/cjs/lib/setup/setupBackup.d.ts +53 -0
- package/build/cjs/lib/setup/setupBackup.js +125 -14
- package/build/cjs/lib/setup/setupBackup.js.map +3 -3
- package/build/cjs/lib/setup/setupInstall.d.ts +66 -15
- package/build/cjs/lib/setup/setupInstall.js +282 -28
- package/build/cjs/lib/setup/setupInstall.js.map +2 -2
- package/build/cjs/lib/setup/setupLicense.d.ts +13 -0
- package/build/cjs/lib/setup/setupLicense.js +33 -2
- package/build/cjs/lib/setup/setupLicense.js.map +2 -2
- package/build/cjs/lib/setup/setupList.d.ts +55 -1
- package/build/cjs/lib/setup/setupList.js +78 -24
- package/build/cjs/lib/setup/setupList.js.map +3 -3
- package/build/cjs/lib/setup/setupMultihost.d.ts +7 -0
- package/build/cjs/lib/setup/setupMultihost.js +78 -11
- package/build/cjs/lib/setup/setupMultihost.js.map +3 -3
- package/build/cjs/lib/setup/setupPacketManager.d.ts +10 -0
- package/build/cjs/lib/setup/setupPacketManager.js +16 -6
- package/build/cjs/lib/setup/setupPacketManager.js.map +2 -2
- package/build/cjs/lib/setup/setupRepo.d.ts +19 -0
- package/build/cjs/lib/setup/setupRepo.js +141 -13
- package/build/cjs/lib/setup/setupRepo.js.map +2 -2
- package/build/cjs/lib/setup/setupSetup.d.ts +34 -0
- package/build/cjs/lib/setup/setupSetup.js +209 -35
- package/build/cjs/lib/setup/setupSetup.js.map +3 -3
- package/build/cjs/lib/setup/setupUpgrade.d.ts +13 -2
- package/build/cjs/lib/setup/setupUpgrade.js +72 -12
- package/build/cjs/lib/setup/setupUpgrade.js.map +2 -2
- package/build/cjs/lib/setup/setupUpload.d.ts +77 -1
- package/build/cjs/lib/setup/setupUpload.js +152 -9
- package/build/cjs/lib/setup/setupUpload.js.map +2 -2
- package/build/cjs/lib/setup/setupUsers.d.ts +44 -14
- package/build/cjs/lib/setup/setupUsers.js +330 -17
- package/build/cjs/lib/setup/setupUsers.js.map +2 -2
- package/build/cjs/lib/setup/setupVendor.d.ts +14 -1
- package/build/cjs/lib/setup/setupVendor.js +40 -8
- package/build/cjs/lib/setup/setupVendor.js.map +2 -2
- package/build/cjs/lib/setup/setupVisDebug.d.ts +16 -2
- package/build/cjs/lib/setup/setupVisDebug.js +41 -17
- package/build/cjs/lib/setup/setupVisDebug.js.map +3 -3
- package/build/cjs/lib/setup/utils.d.ts +1 -1
- package/build/cjs/lib/setup/utils.js +13 -9
- package/build/cjs/lib/setup/utils.js.map +3 -3
- package/build/cjs/lib/setup.d.ts +1 -1
- package/build/cjs/lib/setup.js +858 -1758
- package/build/cjs/lib/setup.js.map +3 -3
- package/build/esm/lib/_Types.d.ts +8 -1
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/cli/cliCert.d.ts +7 -4
- package/build/esm/lib/cli/cliCert.d.ts.map +1 -1
- package/build/esm/lib/cli/cliCert.js +6 -6
- package/build/esm/lib/cli/cliCert.js.map +1 -1
- package/build/esm/lib/cli/cliCommand.d.ts +63 -15
- package/build/esm/lib/cli/cliCommand.d.ts.map +1 -1
- package/build/esm/lib/cli/cliCommand.js +4 -1
- package/build/esm/lib/cli/cliCommand.js.map +1 -1
- package/build/esm/lib/cli/cliCompact.d.ts +5 -2
- package/build/esm/lib/cli/cliCompact.d.ts.map +1 -1
- package/build/esm/lib/cli/cliCompact.js +5 -2
- package/build/esm/lib/cli/cliCompact.js.map +1 -1
- package/build/esm/lib/cli/cliDebug.d.ts +5 -2
- package/build/esm/lib/cli/cliDebug.d.ts.map +1 -1
- package/build/esm/lib/cli/cliDebug.js +4 -1
- package/build/esm/lib/cli/cliDebug.js.map +1 -1
- package/build/esm/lib/cli/cliHost.d.ts +13 -10
- package/build/esm/lib/cli/cliHost.d.ts.map +1 -1
- package/build/esm/lib/cli/cliHost.js +8 -5
- package/build/esm/lib/cli/cliHost.js.map +1 -1
- package/build/esm/lib/cli/cliLogs.d.ts +9 -3
- package/build/esm/lib/cli/cliLogs.d.ts.map +1 -1
- package/build/esm/lib/cli/cliLogs.js +8 -1
- package/build/esm/lib/cli/cliLogs.js.map +1 -1
- package/build/esm/lib/cli/cliMessage.d.ts +2 -1
- package/build/esm/lib/cli/cliMessage.d.ts.map +1 -1
- package/build/esm/lib/cli/cliMessage.js +1 -0
- package/build/esm/lib/cli/cliMessage.js.map +1 -1
- package/build/esm/lib/cli/cliObjects.d.ts +21 -18
- package/build/esm/lib/cli/cliObjects.d.ts.map +1 -1
- package/build/esm/lib/cli/cliObjects.js +44 -38
- package/build/esm/lib/cli/cliObjects.js.map +1 -1
- package/build/esm/lib/cli/cliPlugin.d.ts +3 -3
- package/build/esm/lib/cli/cliPlugin.d.ts.map +1 -1
- package/build/esm/lib/cli/cliPlugin.js +1 -1
- package/build/esm/lib/cli/cliPlugin.js.map +1 -1
- package/build/esm/lib/cli/cliProcess.d.ts +17 -7
- package/build/esm/lib/cli/cliProcess.d.ts.map +1 -1
- package/build/esm/lib/cli/cliProcess.js +73 -12
- package/build/esm/lib/cli/cliProcess.js.map +1 -1
- package/build/esm/lib/cli/cliStates.d.ts +7 -4
- package/build/esm/lib/cli/cliStates.d.ts.map +1 -1
- package/build/esm/lib/cli/cliStates.js +6 -2
- package/build/esm/lib/cli/cliStates.js.map +1 -1
- package/build/esm/lib/progressBar.d.ts +59 -0
- package/build/esm/lib/progressBar.d.ts.map +1 -0
- package/build/esm/lib/progressBar.js +104 -0
- package/build/esm/lib/progressBar.js.map +1 -0
- package/build/esm/lib/setup/customError.d.ts +4 -0
- package/build/esm/lib/setup/customError.d.ts.map +1 -1
- package/build/esm/lib/setup/customError.js +3 -0
- package/build/esm/lib/setup/customError.js.map +1 -1
- package/build/esm/lib/setup/dbConnection.d.ts.map +1 -1
- package/build/esm/lib/setup/dbConnection.js +10 -13
- package/build/esm/lib/setup/dbConnection.js.map +1 -1
- package/build/esm/lib/setup/formatters.d.ts +4 -4
- package/build/esm/lib/setup/formatters.js +4 -4
- package/build/esm/lib/setup/pluginInfos.d.ts +5 -0
- package/build/esm/lib/setup/pluginInfos.d.ts.map +1 -1
- package/build/esm/lib/setup/pluginInfos.js +5 -0
- package/build/esm/lib/setup/pluginInfos.js.map +1 -1
- package/build/esm/lib/setup/setupBackup.d.ts +53 -0
- package/build/esm/lib/setup/setupBackup.d.ts.map +1 -1
- package/build/esm/lib/setup/setupBackup.js +132 -13
- package/build/esm/lib/setup/setupBackup.js.map +1 -1
- package/build/esm/lib/setup/setupInstall.d.ts +66 -15
- package/build/esm/lib/setup/setupInstall.d.ts.map +1 -1
- package/build/esm/lib/setup/setupInstall.js +309 -23
- package/build/esm/lib/setup/setupInstall.js.map +1 -1
- package/build/esm/lib/setup/setupLicense.d.ts +13 -0
- package/build/esm/lib/setup/setupLicense.d.ts.map +1 -1
- package/build/esm/lib/setup/setupLicense.js +31 -1
- package/build/esm/lib/setup/setupLicense.js.map +1 -1
- package/build/esm/lib/setup/setupList.d.ts +55 -1
- package/build/esm/lib/setup/setupList.d.ts.map +1 -1
- package/build/esm/lib/setup/setupList.js +61 -8
- package/build/esm/lib/setup/setupList.js.map +1 -1
- package/build/esm/lib/setup/setupMultihost.d.ts +7 -0
- package/build/esm/lib/setup/setupMultihost.d.ts.map +1 -1
- package/build/esm/lib/setup/setupMultihost.js +85 -6
- package/build/esm/lib/setup/setupMultihost.js.map +1 -1
- package/build/esm/lib/setup/setupPacketManager.d.ts +10 -0
- package/build/esm/lib/setup/setupPacketManager.d.ts.map +1 -1
- package/build/esm/lib/setup/setupPacketManager.js +9 -0
- package/build/esm/lib/setup/setupPacketManager.js.map +1 -1
- package/build/esm/lib/setup/setupRepo.d.ts +19 -0
- package/build/esm/lib/setup/setupRepo.d.ts.map +1 -1
- package/build/esm/lib/setup/setupRepo.js +164 -14
- package/build/esm/lib/setup/setupRepo.js.map +1 -1
- package/build/esm/lib/setup/setupSetup.d.ts +34 -0
- package/build/esm/lib/setup/setupSetup.d.ts.map +1 -1
- package/build/esm/lib/setup/setupSetup.js +218 -21
- package/build/esm/lib/setup/setupSetup.js.map +1 -1
- package/build/esm/lib/setup/setupUpgrade.d.ts +13 -2
- package/build/esm/lib/setup/setupUpgrade.d.ts.map +1 -1
- package/build/esm/lib/setup/setupUpgrade.js +70 -6
- package/build/esm/lib/setup/setupUpgrade.js.map +1 -1
- package/build/esm/lib/setup/setupUpload.d.ts +77 -1
- package/build/esm/lib/setup/setupUpload.d.ts.map +1 -1
- package/build/esm/lib/setup/setupUpload.js +164 -7
- package/build/esm/lib/setup/setupUpload.js.map +1 -1
- package/build/esm/lib/setup/setupUsers.d.ts +44 -14
- package/build/esm/lib/setup/setupUsers.d.ts.map +1 -1
- package/build/esm/lib/setup/setupUsers.js +346 -14
- package/build/esm/lib/setup/setupUsers.js.map +1 -1
- package/build/esm/lib/setup/setupVendor.d.ts +14 -1
- package/build/esm/lib/setup/setupVendor.d.ts.map +1 -1
- package/build/esm/lib/setup/setupVendor.js +33 -2
- package/build/esm/lib/setup/setupVendor.js.map +1 -1
- package/build/esm/lib/setup/setupVisDebug.d.ts +16 -2
- package/build/esm/lib/setup/setupVisDebug.d.ts.map +1 -1
- package/build/esm/lib/setup/setupVisDebug.js +39 -14
- package/build/esm/lib/setup/setupVisDebug.js.map +1 -1
- package/build/esm/lib/setup/utils.d.ts +1 -1
- package/build/esm/lib/setup/utils.d.ts.map +1 -1
- package/build/esm/lib/setup/utils.js +2 -4
- package/build/esm/lib/setup/utils.js.map +1 -1
- package/build/esm/lib/setup.d.ts +1 -1
- package/build/esm/lib/setup.d.ts.map +1 -1
- package/build/esm/lib/setup.js +959 -1910
- package/build/esm/lib/setup.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +14 -14
package/build/cjs/index.js
CHANGED
|
@@ -16,8 +16,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
21
|
BackupRestore: () => import_setupBackup.BackupRestore,
|
|
22
22
|
PacketManager: () => import_setupPacketManager.PacketManager,
|
|
23
23
|
Upgrade: () => import_setupUpgrade.Upgrade,
|
|
@@ -26,7 +26,7 @@ __export(esm_exports, {
|
|
|
26
26
|
dbConnectAsync: () => import_dbConnection.dbConnectAsync,
|
|
27
27
|
execute: () => import_setup.execute
|
|
28
28
|
});
|
|
29
|
-
module.exports = __toCommonJS(
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
30
|
var import_setup = require("./lib/setup.js");
|
|
31
31
|
var import_dbConnection = require("./lib/setup/dbConnection.js");
|
|
32
32
|
var import_setupVendor = require("./lib/setup/setupVendor.js");
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { Client as StatesRedisClient } from '@iobroker/db-states-redis';
|
|
2
2
|
import type { Client as ObjectsRedisClient } from '@iobroker/db-objects-redis';
|
|
3
3
|
export type ProcessExitCallback = (exitCode: number) => void;
|
|
4
|
-
export type CleanDatabaseHandler = (isDeleteDb: boolean) =>
|
|
4
|
+
export type CleanDatabaseHandler = (isDeleteDb: boolean) => Promise<number>;
|
|
5
5
|
export type DbConnectCallback = (params: DbConnectAsyncReturn) => void;
|
|
6
6
|
export type DbConnect = (onlyCheckOrParams?: boolean | Record<string, any>, paramsOrCb?: Record<string, any> | DbConnectCallback, callback?: DbConnectCallback) => void;
|
|
7
|
+
/** Result returned once the database connection has been established */
|
|
7
8
|
export interface DbConnectAsyncReturn {
|
|
9
|
+
/** The connected objects database client */
|
|
8
10
|
objects: ObjectsRedisClient;
|
|
11
|
+
/** The connected states database client */
|
|
9
12
|
states: StatesRedisClient;
|
|
13
|
+
/** Whether the controller is offline (no running host) */
|
|
10
14
|
isOffline?: boolean;
|
|
15
|
+
/** Type of the objects database backend */
|
|
11
16
|
objectsDBType: string;
|
|
12
17
|
/** The iobroker.json config file */
|
|
13
18
|
config: ioBroker.IoBrokerJson;
|
|
@@ -22,7 +27,9 @@ interface IoPackageCommon extends ioBroker.AdapterCommon {
|
|
|
22
27
|
};
|
|
23
28
|
};
|
|
24
29
|
}
|
|
30
|
+
/** An adapter object as stored in io-package.json */
|
|
25
31
|
export interface IoPackage extends ioBroker.AdapterObject {
|
|
32
|
+
/** The common section including the plugins configuration */
|
|
26
33
|
common: IoPackageCommon;
|
|
27
34
|
}
|
|
28
35
|
export {};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { CLICommand, type CLICommandOptions } from './cliCommand.js';
|
|
2
2
|
/** Command ioBroker cert ... */
|
|
3
3
|
export declare class CLICert extends CLICommand {
|
|
4
|
+
/**
|
|
5
|
+
* @param options The command options including context and parameters
|
|
6
|
+
*/
|
|
4
7
|
constructor(options: CLICommandOptions);
|
|
5
8
|
/**
|
|
6
9
|
* Executes a command
|
|
7
10
|
*
|
|
8
|
-
* @param args
|
|
11
|
+
* @param args The command arguments (the first is the sub-command)
|
|
9
12
|
*/
|
|
10
|
-
execute(args:
|
|
13
|
+
execute(args: string[]): void | Promise<void>;
|
|
11
14
|
/**
|
|
12
15
|
* Create new private certificate
|
|
13
16
|
*/
|
|
@@ -15,8 +18,8 @@ export declare class CLICert extends CLICommand {
|
|
|
15
18
|
/**
|
|
16
19
|
* View the certificates on CLI
|
|
17
20
|
*
|
|
18
|
-
* @param _args
|
|
21
|
+
* @param _args The command arguments (the second is the certificate name)
|
|
19
22
|
*/
|
|
20
|
-
view(_args:
|
|
23
|
+
view(_args: string[]): void;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=cliCert.d.ts.map
|
|
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
9
|
var __export = (target, all) => {
|
|
9
10
|
for (var name in all)
|
|
10
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -36,13 +37,19 @@ var import_cliObjects = require("./cliObjects.js");
|
|
|
36
37
|
var messages = __toESM(require("./messages.js"), 1);
|
|
37
38
|
var import_js_controller_common = require("@iobroker/js-controller-common");
|
|
38
39
|
class CLICert extends import_cliCommand.CLICommand {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "CLICert");
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @param options The command options including context and parameters
|
|
45
|
+
*/
|
|
39
46
|
constructor(options) {
|
|
40
47
|
super(options);
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
43
50
|
* Executes a command
|
|
44
51
|
*
|
|
45
|
-
* @param args
|
|
52
|
+
* @param args The command arguments (the first is the sub-command)
|
|
46
53
|
*/
|
|
47
54
|
execute(args) {
|
|
48
55
|
const { callback, showHelp } = this.options;
|
|
@@ -82,13 +89,10 @@ class CLICert extends import_cliCommand.CLICommand {
|
|
|
82
89
|
/**
|
|
83
90
|
* View the certificates on CLI
|
|
84
91
|
*
|
|
85
|
-
* @param _args
|
|
92
|
+
* @param _args The command arguments (the second is the certificate name)
|
|
86
93
|
*/
|
|
87
94
|
view(_args) {
|
|
88
|
-
|
|
89
|
-
if (certName === void 0) {
|
|
90
|
-
certName = "defaultPublic";
|
|
91
|
-
}
|
|
95
|
+
const certName = _args[1] ?? "defaultPublic";
|
|
92
96
|
const { callback, dbConnect } = this.options;
|
|
93
97
|
dbConnect((params) => {
|
|
94
98
|
const { objects } = params;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/cli/cliCert.ts"],
|
|
4
|
-
"sourcesContent": ["import { CLICommand, type CLICommandOptions } from './cliCommand.js';\nimport { CLIObjects } from './cliObjects.js';\nimport * as messages from './messages.js';\nimport { tools, EXIT_CODES } from '@iobroker/js-controller-common';\n\n/** Command ioBroker cert ... */\nexport class CLICert extends CLICommand {\n constructor(options: CLICommandOptions) {\n super(options);\n }\n\n /**\n * Executes a command\n *\n * @param args\n */\n execute(args:
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { CLICommand, type CLICommandOptions } from './cliCommand.js';\nimport { CLIObjects } from './cliObjects.js';\nimport * as messages from './messages.js';\nimport { tools, EXIT_CODES } from '@iobroker/js-controller-common';\n\n/** Command ioBroker cert ... */\nexport class CLICert extends CLICommand {\n /**\n * @param options The command options including context and parameters\n */\n constructor(options: CLICommandOptions) {\n super(options);\n }\n\n /**\n * Executes a command\n *\n * @param args The command arguments (the first is the sub-command)\n */\n execute(args: string[]): void | Promise<void> {\n const { callback, showHelp } = this.options;\n const command = args[0];\n\n switch (command) {\n case 'renew':\n case 'create':\n return this.create();\n case 'view':\n return this.view(args);\n default:\n messages.error.unknownCommand('cert', command);\n showHelp();\n return void callback(3);\n }\n }\n\n /**\n * Create new private certificate\n */\n async create(): Promise<void> {\n const id = 'system.certificates';\n const certPropPath = 'native.certificates';\n\n const certificates = tools.generateDefaultCertificates();\n if (certificates) {\n console.log(JSON.stringify(certificates, null, 2));\n for (const [certName, cert] of Object.entries(certificates)) {\n // use the command `iobroker object set ...` to update the certificate\n console.log(`Update certificate ${certName}`);\n\n const objectsCommandArgs = ['set', id, `${certPropPath}.${certName}=${cert as string}`];\n await new Promise(resolve => {\n const objectsCommand = new CLIObjects({ ...this.options, callback: resolve });\n objectsCommand.execute(objectsCommandArgs);\n });\n }\n }\n\n this.options.callback(EXIT_CODES.NO_ERROR);\n }\n\n /**\n * View the certificates on CLI\n *\n * @param _args The command arguments (the second is the certificate name)\n */\n view(_args: string[]): void {\n const certName = _args[1] ?? 'defaultPublic';\n const { callback, dbConnect } = this.options;\n dbConnect(params => {\n const { objects } = params;\n\n objects.getObject('system.certificates', (err, certs) => {\n if (!err && certs?.native?.certificates?.[certName]) {\n const certInfo = tools.getCertificateInfo(certs.native.certificates[certName]);\n if (certInfo) {\n console.log(JSON.stringify(certInfo, null, 2));\n return void callback(EXIT_CODES.NO_ERROR);\n }\n messages.error.cert(certName);\n return void callback(3);\n }\n messages.error.cert(certName);\n return void callback(3);\n });\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,wBAAmD;AACnD,wBAA2B;AAC3B,eAA0B;AAC1B,kCAAkC;AAG5B,MAAO,gBAAgB,6BAAU;EANvC,OAMuC;;;;;;EAInC,YAAY,SAA0B;AAClC,UAAM,OAAO;EACjB;;;;;;EAOA,QAAQ,MAAc;AAClB,UAAM,EAAE,UAAU,S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AS,uCAAW,QAAQ;UAC5C;AACA,mBAAS,MAAM,KAAK,QAAQ;AAC5B,iBAAO,KAAK,SAAS,CAAC;QAC1B;AACA,iBAAS,MAAM,KAAK,QAAQ;AAC5B,eAAO,KAAK,SAAS,CAAC;MAC1B,CAAC;IACL,CAAC;EACL;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,46 +1,94 @@
|
|
|
1
|
-
import type { DbConnectCallback } from '../_Types.js';
|
|
1
|
+
import type { CleanDatabaseHandler, DbConnectCallback, RestartController } from '../_Types.js';
|
|
2
|
+
/** Context provided to every CLI command */
|
|
2
3
|
export interface CLICommandContext {
|
|
3
4
|
/** Invoke this before doing anything in the database */
|
|
4
5
|
dbConnect: (callback: DbConnectCallback) => void;
|
|
6
|
+
/** Finish the command with the given exit code */
|
|
5
7
|
callback: (code?: number) => void;
|
|
8
|
+
/** Show the command help */
|
|
6
9
|
showHelp: (yargs?: any) => void;
|
|
7
10
|
}
|
|
11
|
+
/** Parameters (CLI flags) that may be passed to a command */
|
|
8
12
|
export interface CLICommandParams {
|
|
13
|
+
/** Text encoding to use for output */
|
|
9
14
|
encoding?: BufferEncoding;
|
|
15
|
+
/** Pretty-print the output */
|
|
10
16
|
pretty?: boolean;
|
|
17
|
+
/** Force the operation even if it would normally be refused */
|
|
11
18
|
force?: boolean;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
/** Password to use */
|
|
20
|
+
password?: string;
|
|
21
|
+
/** Restrict the operation to the given group */
|
|
22
|
+
ingroup?: string;
|
|
23
|
+
/** Short alias for the version flag */
|
|
24
|
+
v?: string;
|
|
25
|
+
/** Show the version */
|
|
26
|
+
version?: string | number;
|
|
27
|
+
/** Timeout in milliseconds */
|
|
28
|
+
timeout?: number;
|
|
29
|
+
/** Only include enabled instances */
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
/** Only include disabled instances */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** Port to use */
|
|
34
|
+
port?: number;
|
|
35
|
+
/** Use SSL */
|
|
36
|
+
ssl?: boolean;
|
|
37
|
+
/** IP address to bind to */
|
|
38
|
+
ip?: string;
|
|
39
|
+
/** Only include updatable adapters */
|
|
40
|
+
updatable?: boolean;
|
|
41
|
+
/** Host to operate on */
|
|
42
|
+
host?: string;
|
|
43
|
+
/** Certificate to use */
|
|
44
|
+
cert?: string;
|
|
45
|
+
/** Working directory */
|
|
25
46
|
cwd?: string;
|
|
47
|
+
/** File system path */
|
|
26
48
|
path?: string;
|
|
49
|
+
/** Module name */
|
|
27
50
|
module?: string;
|
|
51
|
+
/** Wait for the operation to complete */
|
|
28
52
|
wait?: boolean;
|
|
53
|
+
/** Automatically answer yes to confirmation prompts */
|
|
29
54
|
yes?: boolean;
|
|
55
|
+
/** Short alias for force */
|
|
30
56
|
f?: boolean;
|
|
57
|
+
/** Short alias for yes */
|
|
31
58
|
y?: boolean;
|
|
59
|
+
/** Apply the operation to all matching items */
|
|
32
60
|
all?: boolean;
|
|
33
61
|
}
|
|
34
62
|
export type CLICommandOptions = CLICommandContext & CLICommandParams;
|
|
63
|
+
/** Everything a `processCommandXxx` handler needs from the {@link processCommand} dispatcher */
|
|
64
|
+
export interface ProcessCommandOptions {
|
|
65
|
+
/** the matched command (may be an alias, e.g. 'u' for 'upload') */
|
|
66
|
+
command: string | number;
|
|
67
|
+
/** positional arguments following the command */
|
|
68
|
+
args: string[];
|
|
69
|
+
/** parsed CLI flags */
|
|
70
|
+
params: Record<string, any>;
|
|
71
|
+
/** finish the command with the given exit code */
|
|
72
|
+
callback: (exitCode?: number) => void;
|
|
73
|
+
/** merged command context + params (contains dbConnect, showHelp, callback) */
|
|
74
|
+
commandOptions: CLICommandOptions;
|
|
75
|
+
/** clean the objects/states databases (defined in setup.ts) */
|
|
76
|
+
cleanDatabase: CleanDatabaseHandler;
|
|
77
|
+
/** restart the controller (defined in setup.ts) */
|
|
78
|
+
restartController: RestartController;
|
|
79
|
+
}
|
|
35
80
|
/** The base class for any CLI command */
|
|
36
81
|
export declare class CLICommand<TCommandOptions extends CLICommandOptions = CLICommandOptions> {
|
|
37
82
|
protected readonly options: TCommandOptions;
|
|
83
|
+
/**
|
|
84
|
+
* @param options The command options including the context (callback, dbConnect) and parameters
|
|
85
|
+
*/
|
|
38
86
|
constructor(options: TCommandOptions);
|
|
39
87
|
/**
|
|
40
88
|
* Ensures that an argument was passed in the options.
|
|
41
89
|
* Throws otherwise
|
|
42
90
|
*
|
|
43
|
-
* @param arg
|
|
91
|
+
* @param arg The name of the option that is required
|
|
44
92
|
*/
|
|
45
93
|
requireOption(arg: keyof CLICommandOptions): void;
|
|
46
94
|
}
|
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -22,7 +23,13 @@ __export(cliCommand_exports, {
|
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(cliCommand_exports);
|
|
24
25
|
class CLICommand {
|
|
26
|
+
static {
|
|
27
|
+
__name(this, "CLICommand");
|
|
28
|
+
}
|
|
25
29
|
options;
|
|
30
|
+
/**
|
|
31
|
+
* @param options The command options including the context (callback, dbConnect) and parameters
|
|
32
|
+
*/
|
|
26
33
|
constructor(options) {
|
|
27
34
|
if (options === null || options === void 0) {
|
|
28
35
|
throw new Error(`No options given`);
|
|
@@ -35,7 +42,7 @@ class CLICommand {
|
|
|
35
42
|
* Ensures that an argument was passed in the options.
|
|
36
43
|
* Throws otherwise
|
|
37
44
|
*
|
|
38
|
-
* @param arg
|
|
45
|
+
* @param arg The name of the option that is required
|
|
39
46
|
*/
|
|
40
47
|
requireOption(arg) {
|
|
41
48
|
if (this.options[arg] === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/cli/cliCommand.ts"],
|
|
4
|
-
"sourcesContent": ["import type { DbConnectCallback } from '../_Types.js';\n\nexport interface CLICommandContext {\n /** Invoke this before doing anything in the database */\n dbConnect: (callback: DbConnectCallback) => void;\n callback: (code?: number) => void;\n showHelp: (yargs?: any) => void;\n}\n\nexport interface CLICommandParams {\n encoding?: BufferEncoding;\n pretty?: boolean;\n force?: boolean;\n password?:
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { CleanDatabaseHandler, DbConnectCallback, RestartController } from '../_Types.js';\n\n/** Context provided to every CLI command */\nexport interface CLICommandContext {\n /** Invoke this before doing anything in the database */\n dbConnect: (callback: DbConnectCallback) => void;\n /** Finish the command with the given exit code */\n callback: (code?: number) => void;\n /** Show the command help */\n showHelp: (yargs?: any) => void;\n}\n\n/** Parameters (CLI flags) that may be passed to a command */\nexport interface CLICommandParams {\n /** Text encoding to use for output */\n encoding?: BufferEncoding;\n /** Pretty-print the output */\n pretty?: boolean;\n /** Force the operation even if it would normally be refused */\n force?: boolean;\n /** Password to use */\n password?: string;\n /** Restrict the operation to the given group */\n ingroup?: string;\n /** Short alias for the version flag */\n v?: string;\n /** Show the version */\n version?: string | number;\n /** Timeout in milliseconds */\n timeout?: number;\n /** Only include enabled instances */\n enabled?: boolean;\n /** Only include disabled instances */\n disabled?: boolean;\n /** Port to use */\n port?: number;\n /** Use SSL */\n ssl?: boolean;\n /** IP address to bind to */\n ip?: string;\n /** Only include updatable adapters */\n updatable?: boolean;\n /** Host to operate on */\n host?: string;\n /** Certificate to use */\n cert?: string;\n /** Working directory */\n cwd?: string;\n /** File system path */\n path?: string;\n /** Module name */\n module?: string;\n /** Wait for the operation to complete */\n wait?: boolean;\n /** Automatically answer yes to confirmation prompts */\n yes?: boolean;\n /** Short alias for force */\n f?: boolean;\n /** Short alias for yes */\n y?: boolean;\n /** Apply the operation to all matching items */\n all?: boolean;\n}\n\nexport type CLICommandOptions = CLICommandContext & CLICommandParams;\n\n/** Everything a `processCommandXxx` handler needs from the {@link processCommand} dispatcher */\nexport interface ProcessCommandOptions {\n /** the matched command (may be an alias, e.g. 'u' for 'upload') */\n command: string | number;\n /** positional arguments following the command */\n args: string[];\n /** parsed CLI flags */\n params: Record<string, any>;\n /** finish the command with the given exit code */\n callback: (exitCode?: number) => void;\n /** merged command context + params (contains dbConnect, showHelp, callback) */\n commandOptions: CLICommandOptions;\n /** clean the objects/states databases (defined in setup.ts) */\n cleanDatabase: CleanDatabaseHandler;\n /** restart the controller (defined in setup.ts) */\n restartController: RestartController;\n}\n\n/** The base class for any CLI command */\nexport class CLICommand<TCommandOptions extends CLICommandOptions = CLICommandOptions> {\n protected readonly options: TCommandOptions;\n\n /**\n * @param options The command options including the context (callback, dbConnect) and parameters\n */\n constructor(options: TCommandOptions) {\n if (options === null || options === undefined) {\n throw new Error(`No options given`);\n }\n\n this.options = options;\n // Always require the callback and a wrapper for DB actions\n this.requireOption('callback');\n this.requireOption('dbConnect');\n }\n\n /**\n * Ensures that an argument was passed in the options.\n * Throws otherwise\n *\n * @param arg The name of the option that is required\n */\n requireOption(arg: keyof CLICommandOptions): void {\n if (this.options[arg] === undefined) {\n throw new Error(`Invalid arguments: ${arg} is missing`);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAoFA;;;;;AACM,MAAO,WAAU;EADvB,OACuB;;;EACA;;;;EAKnB,YAAY,SAAwB;AAChC,QAAI,YAAY,QAAQ,YAAY,QAAW;AAC3C,YAAM,IAAI,MAAM,kBAAkB;IACtC;AAEA,SAAK,UAAU;AAEf,SAAK,cAAc,UAAU;AAC7B,SAAK,cAAc,WAAW;EAClC;;;;;;;EAQA,cAAc,KAA4B;AACtC,QAAI,KAAK,QAAQ,GAAG,MAAM,QAAW;AACjC,YAAM,IAAI,MAAM,sBAAsB,GAAG,aAAa;IAC1D;EACJ;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,13 +2,16 @@ import { CLICommand, type CLICommandOptions } from './cliCommand.js';
|
|
|
2
2
|
/** Command ioBroker compact ... */
|
|
3
3
|
export declare class CLICompact extends CLICommand {
|
|
4
4
|
private readonly config;
|
|
5
|
+
/**
|
|
6
|
+
* @param options The command options including context and parameters
|
|
7
|
+
*/
|
|
5
8
|
constructor(options: CLICommandOptions);
|
|
6
9
|
/**
|
|
7
10
|
* Executes a command
|
|
8
11
|
*
|
|
9
|
-
* @param args
|
|
12
|
+
* @param args The command arguments (the first is the sub-command)
|
|
10
13
|
*/
|
|
11
|
-
execute(args:
|
|
14
|
+
execute(args: string[]): void;
|
|
12
15
|
/**
|
|
13
16
|
* Output status of compact mode for host
|
|
14
17
|
*/
|
|
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
9
|
var __export = (target, all) => {
|
|
9
10
|
for (var name in all)
|
|
10
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -36,14 +37,20 @@ var import_cliCommand = require("./cliCommand.js");
|
|
|
36
37
|
var import_js_controller_common = require("@iobroker/js-controller-common");
|
|
37
38
|
var import_fs_extra = __toESM(require("fs-extra"), 1);
|
|
38
39
|
class CLICompact extends import_cliCommand.CLICommand {
|
|
40
|
+
static {
|
|
41
|
+
__name(this, "CLICompact");
|
|
42
|
+
}
|
|
39
43
|
config = import_fs_extra.default.readJSONSync(import_js_controller_common.tools.getConfigFileName());
|
|
44
|
+
/**
|
|
45
|
+
* @param options The command options including context and parameters
|
|
46
|
+
*/
|
|
40
47
|
constructor(options) {
|
|
41
48
|
super(options);
|
|
42
49
|
}
|
|
43
50
|
/**
|
|
44
51
|
* Executes a command
|
|
45
52
|
*
|
|
46
|
-
* @param args
|
|
53
|
+
* @param args The command arguments (the first is the sub-command)
|
|
47
54
|
*/
|
|
48
55
|
execute(args) {
|
|
49
56
|
const { callback, showHelp } = this.options;
|
|
@@ -58,7 +65,7 @@ class CLICompact extends import_cliCommand.CLICommand {
|
|
|
58
65
|
case "off":
|
|
59
66
|
return this.setCompactModeHost(false);
|
|
60
67
|
default:
|
|
61
|
-
if (command
|
|
68
|
+
if (command?.includes(".")) {
|
|
62
69
|
if (args[1]) {
|
|
63
70
|
switch (args[1]) {
|
|
64
71
|
case "status":
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/cli/cliCompact.ts"],
|
|
4
|
-
"sourcesContent": ["import * as CLI from './messages.js';\nimport { CLICommand, type CLICommandOptions } from './cliCommand.js';\nimport { tools } from '@iobroker/js-controller-common';\nimport fs from 'fs-extra';\n\n/** Command ioBroker compact ... */\nexport class CLICompact extends CLICommand {\n private readonly config: ioBroker.IoBrokerJson = fs.readJSONSync(tools.getConfigFileName());\n\n constructor(options: CLICommandOptions) {\n super(options);\n }\n /**\n * Executes a command\n *\n * @param args\n */\n execute(args:
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as CLI from './messages.js';\nimport { CLICommand, type CLICommandOptions } from './cliCommand.js';\nimport { tools } from '@iobroker/js-controller-common';\nimport fs from 'fs-extra';\n\n/** Command ioBroker compact ... */\nexport class CLICompact extends CLICommand {\n private readonly config: ioBroker.IoBrokerJson = fs.readJSONSync(tools.getConfigFileName());\n\n /**\n * @param options The command options including context and parameters\n */\n constructor(options: CLICommandOptions) {\n super(options);\n }\n /**\n * Executes a command\n *\n * @param args The command arguments (the first is the sub-command)\n */\n execute(args: string[]): void {\n const { callback, showHelp } = this.options;\n const command = args[0];\n switch (command) {\n case 'status':\n return this.statusCompactModeHost();\n case 'enable':\n case 'on':\n return this.setCompactModeHost(true);\n case 'disable':\n case 'off':\n return this.setCompactModeHost(false);\n default:\n if (command?.includes('.')) {\n if (args[1]) {\n switch (args[1]) {\n case 'status':\n return this.statusCompactModeInstance(command as `${string}.${number}`);\n case 'enable':\n case 'on':\n return this.setCompactModeInstance(command as `${string}.${number}`, true, args[2]);\n case 'disable':\n case 'off':\n return this.setCompactModeInstance(command as `${string}.${number}`, false);\n case 'group':\n return this.setCompactModeInstance(\n command as `${string}.${number}`,\n undefined,\n args[2],\n );\n }\n }\n }\n\n CLI.error.unknownCommand('compact', command);\n showHelp();\n return void callback(3);\n }\n }\n\n /**\n * Output status of compact mode for host\n */\n statusCompactModeHost(): void {\n const { callback } = this.options;\n\n const compactMode = !!this.config?.system?.compact;\n console.log(`Compact mode for this host is currently ${compactMode ? 'enabled' : 'disabled'}`);\n\n return void callback();\n }\n\n /**\n * Set compact mode for this host\n *\n * @param targetState enable or disable compact mode for host\n */\n setCompactModeHost(targetState: boolean): void {\n const { callback, dbConnect } = this.options;\n\n dbConnect(params => {\n const { isOffline } = params;\n\n const currentState = !!this.config?.system?.compact;\n\n if (targetState === currentState) {\n console.log(`Compact mode for this host is already ${currentState ? 'enabled' : 'disabled'}`);\n return void callback();\n }\n\n this.config.system = this.config.system || {};\n this.config.system.compact = targetState;\n const configFileName = tools.getConfigFileName();\n fs.writeFileSync(configFileName, JSON.stringify(this.config, null, 4), 'utf8');\n\n console.log();\n console.log(`Compact mode for this host is now ${targetState ? 'enabled' : 'disabled'}`);\n\n if (!isOffline) {\n console.log();\n console.log('Please restart ioBroker for this change to take effect!');\n }\n return void callback();\n });\n }\n\n /**\n * Output the compact mode status for a defined adapter instance\n *\n * @param instance instance to output status for\n */\n statusCompactModeInstance(instance: `${string}.${number}`): void {\n const { callback, dbConnect } = this.options;\n\n dbConnect(params => {\n const { objects } = params;\n\n if (!this.config.system?.compact) {\n console.log('Compact mode is disabled for this host. All compact mode settings will have no effect!');\n console.log();\n }\n objects.getObject(`system.adapter.${instance}`, (err, obj) => {\n if (!err && obj) {\n if (!obj.common.compact) {\n console.log(\n 'This adapter does not support compact mode. The below settings will have no effect!',\n );\n console.log();\n } else {\n console.log(`Adapter supports compact mode: ${!!obj.common.compact}`);\n }\n console.log(`Compact mode enabled for instance: ${!!obj.common.runAsCompactMode}`);\n console.log(\n `Compact group: ${\n obj.common.compactGroup !== undefined ? obj.common.compactGroup : 1\n }`,\n );\n return void callback();\n }\n CLI.error.invalidInstance(instance);\n return void callback(24);\n });\n });\n }\n\n /**\n * Put given instance in compact mode group\n *\n * @param instance instance to put in group\n * @param targetState if compact mode should be enabled for instance, if undefined `instance.common.runAsCompact` will not be updated\n * @param groupId the compact group id, if not given, it will be put in controller group\n */\n setCompactModeInstance(instance: `${string}.${number}`, targetState?: boolean, groupId?: string | number): void {\n const { callback, dbConnect } = this.options;\n\n dbConnect(async params => {\n const { objects } = params;\n\n if (!this.config.system?.compact) {\n console.log('Compact mode is disabled on this host. This setting will have no effect!');\n console.log();\n }\n\n let obj: ioBroker.InstanceObject | undefined | null;\n try {\n obj = await objects.getObject(`system.adapter.${instance}`);\n } catch {\n // ignore\n }\n\n if (!obj) {\n CLI.error.invalidInstance(instance);\n return void callback(24);\n }\n\n if (!obj.common.compact) {\n console.log('This adapter does not support compact mode. The below settings will have no effect!');\n console.log();\n } else {\n console.log(`Adapter supports compact mode : ${!!obj.common.compact}`);\n }\n let newRunAsCompactMode;\n if (targetState !== undefined && targetState !== !!obj.common.runAsCompactMode) {\n newRunAsCompactMode = targetState;\n }\n let newCompactGroup;\n if (obj.common.compactGroup === undefined) {\n obj.common.compactGroup = 1;\n newCompactGroup = obj.common.compactGroup;\n }\n if (groupId !== undefined) {\n groupId = typeof groupId === 'string' ? parseInt(groupId, 10) : groupId;\n if (groupId !== obj.common.compactGroup) {\n newCompactGroup = groupId;\n }\n }\n console.log(\n `Compact mode enabled for instance: ${\n newRunAsCompactMode !== undefined ? `--> ${newRunAsCompactMode}` : !!obj.common.runAsCompactMode\n }`,\n );\n console.log(\n `Compact group: ${\n newCompactGroup !== undefined && obj.common.compactGroup !== newCompactGroup\n ? `--> ${newCompactGroup}`\n : obj.common.compactGroup\n }`,\n );\n if (newRunAsCompactMode !== undefined || newCompactGroup !== undefined) {\n if (newCompactGroup !== undefined) {\n obj.common.compactGroup = newCompactGroup;\n }\n if (newRunAsCompactMode !== undefined) {\n obj.common.runAsCompactMode = newRunAsCompactMode;\n }\n\n obj.from = `system.host.${tools.getHostName()}.cli`;\n obj.ts = new Date().getTime();\n objects.setObject(`system.adapter.${instance}`, obj, err => {\n if (err) {\n console.log(err);\n }\n console.log(`Instance settings for \"${instance}\" are changed.`);\n callback();\n });\n } else {\n console.log('No settings changed.');\n return void callback();\n }\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAAA,UAAqB;AACrB,wBAAmD;AACnD,kCAAsB;AACtB,sBAAe;AAGT,MAAO,mBAAmB,6BAAU;EAN1C,OAM0C;;;EACrB,SAAgC,gBAAAA,QAAG,aAAa,kCAAM,kBAAiB,CAAE;;;;EAK1F,YAAY,SAA0B;AAClC,UAAM,OAAO;EACjB;;;;;;EAMA,QAAQ,MAAc;AAClB,UAAM,EAAE,UAAU,SAAQ,IAAK,KAAK;AACpC,UAAM,UAAU,KAAK,CAAC;AACtB,YAAQ,SAAS;MACb,KAAK;AACD,eAAO,KAAK,sBAAqB;MACrC,KAAK;MACL,KAAK;AACD,eAAO,KAAK,mBAAmB,IAAI;MACvC,KAAK;MACL,KAAK;AACD,eAAO,KAAK,mBAAmB,KAAK;M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,eAAO,KAAK,SAAQ;MACxB;IACJ,CAAC;EACL;;",
|
|
6
6
|
"names": ["fs"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CLICommand, type CLICommandOptions } from './cliCommand.js';
|
|
2
2
|
/** Command ioBroker debug ... */
|
|
3
3
|
export declare class CLIDebug extends CLICommand {
|
|
4
|
+
/**
|
|
5
|
+
* @param options The command options including context and parameters
|
|
6
|
+
*/
|
|
4
7
|
constructor(options: CLICommandOptions);
|
|
5
8
|
/**
|
|
6
9
|
* Checks if the adapter instance is running
|
|
@@ -12,8 +15,8 @@ export declare class CLIDebug extends CLICommand {
|
|
|
12
15
|
/**
|
|
13
16
|
* Executes a command
|
|
14
17
|
*
|
|
15
|
-
* @param args
|
|
18
|
+
* @param args The command arguments (the first is the adapter name)
|
|
16
19
|
*/
|
|
17
|
-
execute(args:
|
|
20
|
+
execute(args: string[]): Promise<void>;
|
|
18
21
|
}
|
|
19
22
|
//# sourceMappingURL=cliDebug.d.ts.map
|
|
@@ -5,6 +5,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
9
|
var __export = (target, all) => {
|
|
9
10
|
for (var name in all)
|
|
10
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -37,6 +38,12 @@ var CLITools = __toESM(require("./cliTools.js"), 1);
|
|
|
37
38
|
var import_js_controller_common = require("@iobroker/js-controller-common");
|
|
38
39
|
var import_node_child_process = require("node:child_process");
|
|
39
40
|
class CLIDebug extends import_cliCommand.CLICommand {
|
|
41
|
+
static {
|
|
42
|
+
__name(this, "CLIDebug");
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @param options The command options including context and parameters
|
|
46
|
+
*/
|
|
40
47
|
constructor(options) {
|
|
41
48
|
super(options);
|
|
42
49
|
}
|
|
@@ -65,7 +72,7 @@ class CLIDebug extends import_cliCommand.CLICommand {
|
|
|
65
72
|
/**
|
|
66
73
|
* Executes a command
|
|
67
74
|
*
|
|
68
|
-
* @param args
|
|
75
|
+
* @param args The command arguments (the first is the adapter name)
|
|
69
76
|
*/
|
|
70
77
|
async execute(args) {
|
|
71
78
|
const { callback, ...params } = this.options;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/cli/cliDebug.ts"],
|
|
4
|
-
"sourcesContent": ["import * as CLI from './messages.js';\nimport { CLICommand, type CLICommandOptions } from './cliCommand.js';\nimport * as CLITools from './cliTools.js';\nimport { tools, EXIT_CODES } from '@iobroker/js-controller-common';\nimport { fork } from 'node:child_process';\n\n/** Command ioBroker debug ... */\nexport class CLIDebug extends CLICommand {\n constructor(options: CLICommandOptions) {\n super(options);\n }\n\n /**\n * Checks if the adapter instance is running\n *\n * @param adapter adapter name\n * @param instance instance id\n */\n private _isInstanceRunning(adapter: string, instance: string): Promise<boolean> {\n const { dbConnect } = this.options;\n return new Promise(resolve => {\n dbConnect(async ({ states }) => {\n try {\n const state = await states.getStateAsync(`system.adapter.${adapter}.${instance}.alive`);\n if (state?.val) {\n resolve(true);\n return;\n }\n } catch {\n // ignore\n }\n resolve(false);\n });\n });\n }\n\n /**\n * Executes a command\n *\n * @param args\n */\n async execute(args:
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import * as CLI from './messages.js';\nimport { CLICommand, type CLICommandOptions } from './cliCommand.js';\nimport * as CLITools from './cliTools.js';\nimport { tools, EXIT_CODES } from '@iobroker/js-controller-common';\nimport { fork } from 'node:child_process';\n\n/** Command ioBroker debug ... */\nexport class CLIDebug extends CLICommand {\n /**\n * @param options The command options including context and parameters\n */\n constructor(options: CLICommandOptions) {\n super(options);\n }\n\n /**\n * Checks if the adapter instance is running\n *\n * @param adapter adapter name\n * @param instance instance id\n */\n private _isInstanceRunning(adapter: string, instance: string): Promise<boolean> {\n const { dbConnect } = this.options;\n return new Promise(resolve => {\n dbConnect(async ({ states }) => {\n try {\n const state = await states.getStateAsync(`system.adapter.${adapter}.${instance}.alive`);\n if (state?.val) {\n resolve(true);\n return;\n }\n } catch {\n // ignore\n }\n resolve(false);\n });\n });\n }\n\n /**\n * Executes a command\n *\n * @param args The command arguments (the first is the adapter name)\n */\n async execute(args: string[]): Promise<void> {\n const { callback, ...params } = this.options;\n const adapter = args[0];\n if (!adapter) {\n CLI.error.requiredArgumentMissing('adaptername', 'debug <adaptername>');\n return void callback(34);\n }\n\n const { name, instance } = CLITools.splitAdapterOrInstanceIdentifierWithVersion(adapter)!;\n\n if (await this._isInstanceRunning(name, instance || '0')) {\n CLI.error.instanceAlreadyRunning(`${name}.${instance || '0'}`);\n return void callback(EXIT_CODES.ADAPTER_ALREADY_RUNNING);\n }\n\n const adapterDir = tools.getAdapterDir(adapter);\n if (!adapterDir) {\n CLI.error.adapterDirNotFound(adapter);\n return void callback(34);\n }\n\n let mainFile;\n try {\n mainFile = await tools.resolveAdapterMainFile(adapter);\n } catch {\n CLI.error.mainFileNotFound(adapter);\n return callback(1);\n }\n\n // Start the adapter with force and console logs\n const adapterArgs = [instance || '0', '--debug'];\n // Tell node to attach a debugger\n const nodeArgs = [\n ...tools.getDefaultNodeArgs(mainFile),\n // --inspect[-brk][=[ip]:[port]]\n `--inspect${params.wait ? '-brk' : ''}${!!params.ip || !!params.port ? '=' : ''}${params.ip || ''}${\n !!params.ip && !!params.port ? ':' : ''\n }${params.port || ''}`,\n ];\n // And wait until the sub process has finished\n const cp = fork(mainFile, adapterArgs, {\n cwd: adapterDir,\n execArgv: nodeArgs,\n });\n cp.on('exit', code => callback(code || 0));\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAGA,UAAM,cAAc,CAAC,YAAY,KAAK,SAAS;AAE/C,UAAM,WAAW;MACb,GAAG,kCAAM,mBAAmB,QAAQ;;MAEpC,YAAY,OAAO,OAAO,SAAS,EAAE,GAAG,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,OAAO,MAAM,EAAE,GAAG,OAAO,MAAM,EAAE,GAC7F,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,OAAO,MAAM,EACzC,GAAG,OAAO,QAAQ,EAAE;;AAGxB,UAAM,SAAK,gCAAK,UAAU,aAAa;MACnC,KAAK;MACL,UAAU;KACb;AACD,OAAG,GAAG,QAAQ,UAAQ,SAAS,QAAQ,CAAC,CAAC;EAC7C;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import { CLICommand, type CLICommandOptions } from './cliCommand.js';
|
|
2
2
|
/** Command iobroker host ... */
|
|
3
3
|
export declare class CLIHost extends CLICommand {
|
|
4
|
+
/**
|
|
5
|
+
* @param options The command options including context and parameters
|
|
6
|
+
*/
|
|
4
7
|
constructor(options: CLICommandOptions);
|
|
5
8
|
/**
|
|
6
9
|
* Executes a command
|
|
7
10
|
*
|
|
8
|
-
* @param args
|
|
11
|
+
* @param args The command arguments (the first is the sub-command)
|
|
9
12
|
*/
|
|
10
|
-
execute(args:
|
|
13
|
+
execute(args: string[]): void;
|
|
11
14
|
/**
|
|
12
15
|
* When in single-host mode, changes the hostname of the host and all instances to the current one
|
|
13
16
|
*
|
|
14
|
-
* @param _args
|
|
17
|
+
* @param _args The command arguments (unused)
|
|
15
18
|
*/
|
|
16
|
-
self(_args:
|
|
19
|
+
self(_args: string[]): void;
|
|
17
20
|
/**
|
|
18
21
|
* Changes the current host's hostname to the given one
|
|
19
22
|
*
|
|
20
|
-
* @param args
|
|
23
|
+
* @param args The command arguments (the second is the new hostname)
|
|
21
24
|
*/
|
|
22
|
-
set(args:
|
|
25
|
+
set(args: string[]): void;
|
|
23
26
|
/**
|
|
24
27
|
* Removes the host with the given name
|
|
25
28
|
*
|
|
26
|
-
* @param args
|
|
29
|
+
* @param args The command arguments (the second is the hostname to remove)
|
|
27
30
|
*/
|
|
28
|
-
remove(args:
|
|
31
|
+
remove(args: string[]): void;
|
|
29
32
|
/**
|
|
30
33
|
* Renames the host with the given name to the current one (opposite of `set()`)
|
|
31
34
|
*
|
|
32
|
-
* @param args
|
|
35
|
+
* @param args The command arguments (the second is the old hostname)
|
|
33
36
|
*/
|
|
34
|
-
rename(args:
|
|
37
|
+
rename(args: string[]): void;
|
|
35
38
|
/**
|
|
36
39
|
* Renames the host with the hostname `oldHostname` to the hostname `newHostname`
|
|
37
40
|
*
|