@iobroker/socket-classes 0.5.0 → 0.5.1
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/README.md +3 -0
- package/lib/socketCommandsAdmin.js +16 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -996,12 +996,25 @@ class SocketCommandsAdmin extends SocketCommands {
|
|
|
996
996
|
if (this._checkPermissions(socket, 'getObject', callback)) {
|
|
997
997
|
this.adapter.getForeignObject('system.config', (error, obj) => {
|
|
998
998
|
obj = obj || {};
|
|
999
|
-
const secret = obj.native && obj.native.secret;
|
|
999
|
+
const secret = obj && obj.native && obj.native.secret;
|
|
1000
1000
|
delete obj.native;
|
|
1001
1001
|
if (secret) {
|
|
1002
1002
|
obj.native = {secret};
|
|
1003
1003
|
}
|
|
1004
|
-
callback(error,
|
|
1004
|
+
callback(error, obj);
|
|
1005
|
+
});
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
|
|
1009
|
+
this.commands['getCompactSystemRepositories'] = (socket, callback) => {
|
|
1010
|
+
if (this._checkPermissions(socket, 'getObject', callback)) {
|
|
1011
|
+
this.adapter.getForeignObject('system.repositories', (error, obj) => {
|
|
1012
|
+
obj && obj.native && obj.native.repositories && Object.keys(obj.native.repositories).forEach(name => {
|
|
1013
|
+
if (obj.native.repositories[name].json) {
|
|
1014
|
+
obj.native.repositories[name].json = null;
|
|
1015
|
+
}
|
|
1016
|
+
});
|
|
1017
|
+
callback(error, obj);
|
|
1005
1018
|
});
|
|
1006
1019
|
}
|
|
1007
1020
|
};
|
|
@@ -1013,7 +1026,7 @@ class SocketCommandsAdmin extends SocketCommands {
|
|
|
1013
1026
|
const result = {};
|
|
1014
1027
|
data && Object.keys(data).forEach(name => result[name] = {
|
|
1015
1028
|
version: data[name].version,
|
|
1016
|
-
icon: data[name].extIcon
|
|
1029
|
+
icon: data[name].extIcon,
|
|
1017
1030
|
});
|
|
1018
1031
|
callback(result);
|
|
1019
1032
|
});
|