@iobroker/socket-classes 0.1.8 → 0.2.0

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,7 +69,13 @@ io.close();
69
69
  -->
70
70
 
71
71
  ## Changelog
72
- ### 0.1.8 (2022-05-07)
72
+ ### 0.2.0 (2022-05-09)
73
+ * (bluefox) fixed `delObjects` command
74
+
75
+ ### 0.1.10 (2022-05-09)
76
+ * (bluefox) Added support for fileChanges
77
+
78
+ ### 0.1.9 (2022-05-07)
73
79
  * (bluefox) Corrected readLogs command and implement file subscriptions
74
80
 
75
81
  ### 0.1.7 (2022-05-05)
@@ -753,7 +753,7 @@ class SocketCommands {
753
753
 
754
754
  this.commands['deleteFile'] = (socket, _adapter, name, callback) => {
755
755
  if (this._checkPermissions(socket, 'unlink', callback, name)) {
756
- this.adapter._unlink(_adapter, name, {user: socket._acl.user}, (err, ...args) =>
756
+ this.adapter.unlink(_adapter, name, {user: socket._acl.user}, (err, ...args) =>
757
757
  SocketCommands._fixCallback(callback, err, ...args));
758
758
  }
759
759
  };
@@ -1,6 +1,7 @@
1
1
  const SocketCommands = require('./socketCommands');
2
2
  const axios = require('axios');
3
3
  const path = require('path');
4
+ const fs = require('fs');
4
5
 
5
6
  class SocketCommandsAdmin extends SocketCommands {
6
7
  static ALLOW_CACHE = [
@@ -1070,7 +1071,19 @@ class SocketCommandsAdmin extends SocketCommands {
1070
1071
  options = {};
1071
1072
  }
1072
1073
  options.user = socket._acl.user;
1073
- options.recursive = true;
1074
+ // options.recursive = true; // the only difference between delObject and delObjects is this line
1075
+ this.adapter.delForeignObject(id, options, (err, ...args) =>
1076
+ SocketCommands._fixCallback(callback, err, ...args));
1077
+ }
1078
+ };
1079
+
1080
+ this.commands['delObjects'] = (socket, id, options, callback) => {
1081
+ if (this._checkPermissions(socket, 'delObject', callback, id)) {
1082
+ if (!options || typeof options !== 'object') {
1083
+ options = {};
1084
+ }
1085
+ options.user = socket._acl.user;
1086
+ options.recursive = true; // the only difference between delObject and delObjects is this line
1074
1087
  this.adapter.delForeignObject(id, options, (err, ...args) =>
1075
1088
  SocketCommands._fixCallback(callback, err, ...args));
1076
1089
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/socket-classes",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "ioBroker server-side web sockets",
5
5
  "author": {
6
6
  "name": "bluefox",