@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 CHANGED
@@ -69,6 +69,9 @@ io.close();
69
69
  -->
70
70
 
71
71
  ## Changelog
72
+ ### 0.5.1 (2022-08-18)
73
+ * (bluefox) Added command `getCompactSystemRepositories`
74
+
72
75
  ### 0.5.0 (2022-07-20)
73
76
  * (bluefox) Buffer conversion errors caught and handled
74
77
 
@@ -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, obj);
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/socket-classes",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "ioBroker server-side web sockets",
5
5
  "author": {
6
6
  "name": "bluefox",