@iobroker/js-controller-cli 4.0.0-alpha.65-20220130-5a5159cd → 4.0.0-alpha.66-20220131-413a0962
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/lib/cli/cliObjects.js +39 -1
- package/package.json +4 -4
package/lib/cli/cliObjects.js
CHANGED
|
@@ -6,7 +6,7 @@ const { tools } = require('@iobroker/js-controller-common');
|
|
|
6
6
|
|
|
7
7
|
/** Command iobroker object ... */
|
|
8
8
|
module.exports = class CLIObjects extends CLICommand {
|
|
9
|
-
/** @param {
|
|
9
|
+
/** @param {CLICommandOptions} options */
|
|
10
10
|
constructor(options) {
|
|
11
11
|
super(options);
|
|
12
12
|
}
|
|
@@ -40,6 +40,10 @@ module.exports = class CLIObjects extends CLICommand {
|
|
|
40
40
|
return this.getDBVersion(args);
|
|
41
41
|
case 'setDBVersion':
|
|
42
42
|
return this.setDBVersion();
|
|
43
|
+
case 'activateSets':
|
|
44
|
+
return this.activateSets();
|
|
45
|
+
case 'deactivateSets':
|
|
46
|
+
return this.deactivateSets();
|
|
43
47
|
default:
|
|
44
48
|
CLI.error.unknownCommand('object', command);
|
|
45
49
|
showHelp();
|
|
@@ -47,6 +51,40 @@ module.exports = class CLIObjects extends CLICommand {
|
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Activates the usage of Redis Sets
|
|
56
|
+
*/
|
|
57
|
+
activateSets() {
|
|
58
|
+
const { callback, dbConnect } = this.options;
|
|
59
|
+
dbConnect(async objects => {
|
|
60
|
+
if (!parseInt(await objects.getMeta('objects.features.useSets'))) {
|
|
61
|
+
await objects.activateSets();
|
|
62
|
+
console.log(
|
|
63
|
+
`Successfully activated the usage of Redis Sets. Please make sure to only use js-controller 4.0 or higher on all hosts!`
|
|
64
|
+
);
|
|
65
|
+
} else {
|
|
66
|
+
console.log('Redis Sets are already activated.');
|
|
67
|
+
}
|
|
68
|
+
return void callback();
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Deactivates the usage of Redis Sets
|
|
74
|
+
*/
|
|
75
|
+
deactivateSets() {
|
|
76
|
+
const { callback, dbConnect } = this.options;
|
|
77
|
+
dbConnect(async objects => {
|
|
78
|
+
if (parseInt(await objects.getMeta('objects.features.useSets'))) {
|
|
79
|
+
await objects.deactivateSets();
|
|
80
|
+
console.log(`Successfully deactivated the usage of Redis Sets.`);
|
|
81
|
+
} else {
|
|
82
|
+
console.log('Redis Sets are already deactivated.');
|
|
83
|
+
}
|
|
84
|
+
return void callback();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
50
88
|
/**
|
|
51
89
|
* Get the protocol version
|
|
52
90
|
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/js-controller-cli",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.66-20220131-413a0962",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@iobroker/js-controller-common": "4.0.0-alpha.
|
|
9
|
-
"@iobroker/js-controller-common-db": "4.0.0-alpha.
|
|
8
|
+
"@iobroker/js-controller-common": "4.0.0-alpha.66-20220131-413a0962",
|
|
9
|
+
"@iobroker/js-controller-common-db": "4.0.0-alpha.66-20220131-413a0962",
|
|
10
10
|
"chokidar": "^3.5.2",
|
|
11
11
|
"daemonize2": "^0.4.2",
|
|
12
12
|
"debug": "^4.3.3",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"lib/",
|
|
39
39
|
"index.js"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "cebc0ce797e0b301713de0c0a6584e155fa3ff9a"
|
|
42
42
|
}
|