@iobroker/adapter-react-v5 4.1.2 → 4.2.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.
Files changed (97) hide show
  1. package/Components/JsonConfigComponent/ChipInput.d.ts +1 -1
  2. package/Components/JsonConfigComponent/ChipInput.js +6 -6
  3. package/Components/JsonConfigComponent/ChipInput.js.map +1 -1
  4. package/Components/JsonConfigComponent/ConfigAccordion.d.ts +14 -0
  5. package/Components/JsonConfigComponent/ConfigAccordion.js +352 -0
  6. package/Components/JsonConfigComponent/ConfigAccordion.js.map +1 -0
  7. package/Components/JsonConfigComponent/ConfigAlive.js.map +1 -1
  8. package/Components/JsonConfigComponent/ConfigAutocomplete.js.map +1 -1
  9. package/Components/JsonConfigComponent/ConfigAutocompleteSendTo.js.map +1 -1
  10. package/Components/JsonConfigComponent/ConfigCRON.js +3 -2
  11. package/Components/JsonConfigComponent/ConfigCRON.js.map +1 -1
  12. package/Components/JsonConfigComponent/ConfigCertCollection.js +2 -2
  13. package/Components/JsonConfigComponent/ConfigCertCollection.js.map +1 -1
  14. package/Components/JsonConfigComponent/ConfigCertificates.js +2 -2
  15. package/Components/JsonConfigComponent/ConfigCertificates.js.map +1 -1
  16. package/Components/JsonConfigComponent/ConfigCheckLicense.js +8 -8
  17. package/Components/JsonConfigComponent/ConfigCheckLicense.js.map +1 -1
  18. package/Components/JsonConfigComponent/ConfigCheckbox.js.map +1 -1
  19. package/Components/JsonConfigComponent/ConfigChip.js.map +1 -1
  20. package/Components/JsonConfigComponent/ConfigColor.js.map +1 -1
  21. package/Components/JsonConfigComponent/ConfigCoordinates.js +54 -12
  22. package/Components/JsonConfigComponent/ConfigCoordinates.js.map +1 -1
  23. package/Components/JsonConfigComponent/ConfigCustom.js.map +1 -1
  24. package/Components/JsonConfigComponent/ConfigDatePicker.js.map +1 -1
  25. package/Components/JsonConfigComponent/ConfigFile.js.map +1 -1
  26. package/Components/JsonConfigComponent/ConfigGeneric.d.ts +18 -3
  27. package/Components/JsonConfigComponent/ConfigGeneric.js +76 -36
  28. package/Components/JsonConfigComponent/ConfigGeneric.js.map +1 -1
  29. package/Components/JsonConfigComponent/ConfigIP.js.map +1 -1
  30. package/Components/JsonConfigComponent/ConfigImageUpload.js.map +1 -1
  31. package/Components/JsonConfigComponent/ConfigInstanceSelect.js.map +1 -1
  32. package/Components/JsonConfigComponent/ConfigJsonEditor.js +1 -1
  33. package/Components/JsonConfigComponent/ConfigJsonEditor.js.map +1 -1
  34. package/Components/JsonConfigComponent/ConfigLanguage.js +3 -0
  35. package/Components/JsonConfigComponent/ConfigLanguage.js.map +1 -1
  36. package/Components/JsonConfigComponent/ConfigLicense.d.ts +23 -0
  37. package/Components/JsonConfigComponent/ConfigLicense.js +183 -0
  38. package/Components/JsonConfigComponent/ConfigLicense.js.map +1 -0
  39. package/Components/JsonConfigComponent/ConfigNumber.js +2 -48
  40. package/Components/JsonConfigComponent/ConfigNumber.js.map +1 -1
  41. package/Components/JsonConfigComponent/ConfigObjectId.js +3 -1
  42. package/Components/JsonConfigComponent/ConfigObjectId.js.map +1 -1
  43. package/Components/JsonConfigComponent/ConfigPanel.js +4 -0
  44. package/Components/JsonConfigComponent/ConfigPanel.js.map +1 -1
  45. package/Components/JsonConfigComponent/ConfigPassword.js.map +1 -1
  46. package/Components/JsonConfigComponent/ConfigPattern.d.ts +19 -13
  47. package/Components/JsonConfigComponent/ConfigPattern.js +1 -5
  48. package/Components/JsonConfigComponent/ConfigPattern.js.map +1 -1
  49. package/Components/JsonConfigComponent/ConfigPort.js +1 -1
  50. package/Components/JsonConfigComponent/ConfigPort.js.map +1 -1
  51. package/Components/JsonConfigComponent/ConfigRoom.js.map +1 -1
  52. package/Components/JsonConfigComponent/ConfigSelect.js.map +1 -1
  53. package/Components/JsonConfigComponent/ConfigSelectSendTo.js.map +1 -1
  54. package/Components/JsonConfigComponent/ConfigSendto.js +2 -2
  55. package/Components/JsonConfigComponent/ConfigSendto.js.map +1 -1
  56. package/Components/JsonConfigComponent/ConfigSetState.js +3 -3
  57. package/Components/JsonConfigComponent/ConfigSetState.js.map +1 -1
  58. package/Components/JsonConfigComponent/ConfigSlider.js +3 -1
  59. package/Components/JsonConfigComponent/ConfigSlider.js.map +1 -1
  60. package/Components/JsonConfigComponent/ConfigStaticDivider.js.map +1 -1
  61. package/Components/JsonConfigComponent/ConfigStaticImage.js.map +1 -1
  62. package/Components/JsonConfigComponent/ConfigStaticText.js +9 -0
  63. package/Components/JsonConfigComponent/ConfigStaticText.js.map +1 -1
  64. package/Components/JsonConfigComponent/ConfigTable.js +3 -3
  65. package/Components/JsonConfigComponent/ConfigTable.js.map +1 -1
  66. package/Components/JsonConfigComponent/ConfigTabs.js.map +1 -1
  67. package/Components/JsonConfigComponent/ConfigText.js.map +1 -1
  68. package/Components/JsonConfigComponent/ConfigTimePicker.js.map +1 -1
  69. package/Components/JsonConfigComponent/ConfigTopic.js +1 -1
  70. package/Components/JsonConfigComponent/ConfigTopic.js.map +1 -1
  71. package/Components/JsonConfigComponent/ConfigUUID.js +1 -1
  72. package/Components/JsonConfigComponent/ConfigUUID.js.map +1 -1
  73. package/Components/JsonConfigComponent/index.js.map +1 -1
  74. package/Components/ObjectBrowser.js +22 -25
  75. package/Components/ObjectBrowser.js.map +1 -1
  76. package/Components/UploadImage.js +2 -2
  77. package/Components/UploadImage.js.map +1 -1
  78. package/Components/Utils.js +1 -1
  79. package/Components/Utils.js.map +1 -1
  80. package/Dialogs/Confirm.js +1 -1
  81. package/Dialogs/Confirm.js.map +1 -1
  82. package/LegacyConnection.d.ts +6 -0
  83. package/LegacyConnection.js +181 -161
  84. package/LegacyConnection.js.map +1 -1
  85. package/README.md +11 -3
  86. package/i18n/de.json +3 -1
  87. package/i18n/en.json +3 -1
  88. package/i18n/es.json +3 -1
  89. package/i18n/fr.json +3 -1
  90. package/i18n/it.json +3 -1
  91. package/i18n/nl.json +3 -1
  92. package/i18n/pl.json +3 -1
  93. package/i18n/pt.json +3 -1
  94. package/i18n/ru.json +3 -1
  95. package/i18n/uk.json +3 -1
  96. package/i18n/zh-cn.json +3 -1
  97. package/package.json +9 -9
@@ -1037,6 +1037,26 @@ var Connection = /*#__PURE__*/function () {
1037
1037
  }
1038
1038
  }
1039
1039
 
1040
+ /**
1041
+ * Gets objects by list of IDs.
1042
+ * @param {string[]} list Array of object IDs to retrieve.
1043
+ * @returns {void}
1044
+ */
1045
+ }, {
1046
+ key: "getObjectsById",
1047
+ value: function getObjectsById(list) {
1048
+ var _this12 = this;
1049
+ if (!this.connected) {
1050
+ return Promise.reject(NOT_CONNECTED);
1051
+ } else {
1052
+ return new Promise(function (resolve, reject) {
1053
+ return _this12._socket.emit('getObjects', list, function (err, res) {
1054
+ return err ? reject(err) : resolve(res);
1055
+ });
1056
+ });
1057
+ }
1058
+ }
1059
+
1040
1060
  /**
1041
1061
  * Called internally.
1042
1062
  * @private
@@ -1045,37 +1065,37 @@ var Connection = /*#__PURE__*/function () {
1045
1065
  }, {
1046
1066
  key: "_subscribe",
1047
1067
  value: function _subscribe(isEnable) {
1048
- var _this12 = this;
1068
+ var _this13 = this;
1049
1069
  if (isEnable && !this.subscribed) {
1050
1070
  this.subscribed = true;
1051
1071
  this.autoSubscribes.forEach(function (id) {
1052
- return _this12._socket.emit('subscribeObjects', id);
1072
+ return _this13._socket.emit('subscribeObjects', id);
1053
1073
  });
1054
1074
  // re subscribe objects
1055
1075
  Object.keys(this.objectsSubscribes).forEach(function (id) {
1056
- return _this12._socket.emit('subscribeObjects', id);
1076
+ return _this13._socket.emit('subscribeObjects', id);
1057
1077
  });
1058
1078
  // re-subscribe logs
1059
1079
  this.autoSubscribeLog && this._socket.emit('requireLog', true);
1060
1080
  // re subscribe states
1061
1081
  Object.keys(this.statesSubscribes).forEach(function (id) {
1062
- return _this12._socket.emit('subscribe', id);
1082
+ return _this13._socket.emit('subscribe', id);
1063
1083
  });
1064
1084
  } else if (!isEnable && this.subscribed) {
1065
1085
  this.subscribed = false;
1066
1086
  // un-subscribe objects
1067
1087
  this.autoSubscribes.forEach(function (id) {
1068
- return _this12._socket.emit('unsubscribeObjects', id);
1088
+ return _this13._socket.emit('unsubscribeObjects', id);
1069
1089
  });
1070
1090
  Object.keys(this.objectsSubscribes).forEach(function (id) {
1071
- return _this12._socket.emit('unsubscribeObjects', id);
1091
+ return _this13._socket.emit('unsubscribeObjects', id);
1072
1092
  });
1073
1093
  // un-subscribe logs
1074
1094
  this.autoSubscribeLog && this._socket.emit('requireLog', false);
1075
1095
 
1076
1096
  // un-subscribe states
1077
1097
  Object.keys(this.statesSubscribes).forEach(function (id) {
1078
- return _this12._socket.emit('unsubscribe', id);
1098
+ return _this13._socket.emit('unsubscribe', id);
1079
1099
  });
1080
1100
  }
1081
1101
  }
@@ -1088,12 +1108,12 @@ var Connection = /*#__PURE__*/function () {
1088
1108
  }, {
1089
1109
  key: "requireLog",
1090
1110
  value: function requireLog(isEnabled) {
1091
- var _this13 = this;
1111
+ var _this14 = this;
1092
1112
  if (!this.connected) {
1093
1113
  return Promise.reject(NOT_CONNECTED);
1094
1114
  }
1095
1115
  return new Promise(function (resolve, reject) {
1096
- return _this13._socket.emit('requireLog', isEnabled, function (err) {
1116
+ return _this14._socket.emit('requireLog', isEnabled, function (err) {
1097
1117
  return err ? reject(err) : resolve();
1098
1118
  });
1099
1119
  });
@@ -1108,12 +1128,12 @@ var Connection = /*#__PURE__*/function () {
1108
1128
  }, {
1109
1129
  key: "delObject",
1110
1130
  value: function delObject(id, maintenance) {
1111
- var _this14 = this;
1131
+ var _this15 = this;
1112
1132
  if (!this.connected) {
1113
1133
  return Promise.reject(NOT_CONNECTED);
1114
1134
  }
1115
1135
  return new Promise(function (resolve, reject) {
1116
- return _this14._socket.emit('delObject', id, {
1136
+ return _this15._socket.emit('delObject', id, {
1117
1137
  maintenance: !!maintenance
1118
1138
  }, function (err) {
1119
1139
  return err ? reject(err) : resolve();
@@ -1130,12 +1150,12 @@ var Connection = /*#__PURE__*/function () {
1130
1150
  }, {
1131
1151
  key: "delObjects",
1132
1152
  value: function delObjects(id, maintenance) {
1133
- var _this15 = this;
1153
+ var _this16 = this;
1134
1154
  if (!this.connected) {
1135
1155
  return Promise.reject(NOT_CONNECTED);
1136
1156
  }
1137
1157
  return new Promise(function (resolve, reject) {
1138
- return _this15._socket.emit('delObjects', id, {
1158
+ return _this16._socket.emit('delObjects', id, {
1139
1159
  maintenance: !!maintenance
1140
1160
  }, function (err) {
1141
1161
  return err ? reject(err) : resolve();
@@ -1152,7 +1172,7 @@ var Connection = /*#__PURE__*/function () {
1152
1172
  }, {
1153
1173
  key: "setObject",
1154
1174
  value: function setObject(id, obj) {
1155
- var _this16 = this;
1175
+ var _this17 = this;
1156
1176
  if (!this.connected) {
1157
1177
  return Promise.reject(NOT_CONNECTED);
1158
1178
  }
@@ -1170,7 +1190,7 @@ var Connection = /*#__PURE__*/function () {
1170
1190
  delete obj.ts;
1171
1191
  }
1172
1192
  return new Promise(function (resolve, reject) {
1173
- return _this16._socket.emit('setObject', id, obj, function (err) {
1193
+ return _this17._socket.emit('setObject', id, obj, function (err) {
1174
1194
  return err ? reject(err) : resolve();
1175
1195
  });
1176
1196
  });
@@ -1184,7 +1204,7 @@ var Connection = /*#__PURE__*/function () {
1184
1204
  }, {
1185
1205
  key: "getObject",
1186
1206
  value: function getObject(id) {
1187
- var _this17 = this;
1207
+ var _this18 = this;
1188
1208
  if (!this.connected) {
1189
1209
  return Promise.reject(NOT_CONNECTED);
1190
1210
  }
@@ -1199,7 +1219,7 @@ var Connection = /*#__PURE__*/function () {
1199
1219
  });
1200
1220
  }
1201
1221
  return new Promise(function (resolve, reject) {
1202
- return _this17._socket.emit('getObject', id, function (err, obj) {
1222
+ return _this18._socket.emit('getObject', id, function (err, obj) {
1203
1223
  return err ? reject(err) : resolve(obj);
1204
1224
  });
1205
1225
  });
@@ -1219,7 +1239,7 @@ var Connection = /*#__PURE__*/function () {
1219
1239
  }, {
1220
1240
  key: "getAdapterInstances",
1221
1241
  value: function getAdapterInstances(adapter, update) {
1222
- var _this18 = this;
1242
+ var _this19 = this;
1223
1243
  if (typeof adapter === 'boolean') {
1224
1244
  update = adapter;
1225
1245
  adapter = '';
@@ -1234,7 +1254,7 @@ var Connection = /*#__PURE__*/function () {
1234
1254
  this._promises["instances_".concat(adapter)] = new Promise(function (resolve, reject) {
1235
1255
  var timeout = setTimeout(function () {
1236
1256
  timeout = null;
1237
- _this18.getObjectView("system.adapter.".concat(adapter ? "".concat(adapter, ".") : ''), "system.adapter.".concat(adapter ? "".concat(adapter, ".") : '', "\u9999"), 'instance').then(function (items) {
1257
+ _this19.getObjectView("system.adapter.".concat(adapter ? "".concat(adapter, ".") : ''), "system.adapter.".concat(adapter ? "".concat(adapter, ".") : '', "\u9999"), 'instance').then(function (items) {
1238
1258
  return resolve(Object.keys(items).map(function (id) {
1239
1259
  return fixAdminUI(items[id]);
1240
1260
  }));
@@ -1242,7 +1262,7 @@ var Connection = /*#__PURE__*/function () {
1242
1262
  return reject(e);
1243
1263
  });
1244
1264
  }, TIMEOUT_FOR_ADMIN4);
1245
- _this18._socket.emit('getAdapterInstances', adapter, function (err, instances) {
1265
+ _this19._socket.emit('getAdapterInstances', adapter, function (err, instances) {
1246
1266
  if (timeout) {
1247
1267
  clearTimeout(timeout);
1248
1268
  timeout = null;
@@ -1267,7 +1287,7 @@ var Connection = /*#__PURE__*/function () {
1267
1287
  }, {
1268
1288
  key: "getAdapters",
1269
1289
  value: function getAdapters(adapter, update) {
1270
- var _this19 = this;
1290
+ var _this20 = this;
1271
1291
  if (Connection.isWeb()) {
1272
1292
  return Promise.reject('Allowed only in admin');
1273
1293
  }
@@ -1285,7 +1305,7 @@ var Connection = /*#__PURE__*/function () {
1285
1305
  this._promises["adapter_".concat(adapter)] = new Promise(function (resolve, reject) {
1286
1306
  var timeout = setTimeout(function () {
1287
1307
  timeout = null;
1288
- _this19.getObjectView("system.adapter.".concat(adapter, "."), "system.adapter.".concat(adapter, ".\u9999"), 'adapter').then(function (items) {
1308
+ _this20.getObjectView("system.adapter.".concat(adapter, "."), "system.adapter.".concat(adapter, ".\u9999"), 'adapter').then(function (items) {
1289
1309
  return resolve(Object.keys(items).map(function (id) {
1290
1310
  return fixAdminUI(items[id]);
1291
1311
  }));
@@ -1293,7 +1313,7 @@ var Connection = /*#__PURE__*/function () {
1293
1313
  return reject(e);
1294
1314
  });
1295
1315
  }, TIMEOUT_FOR_ADMIN4);
1296
- _this19._socket.emit('getAdapters', adapter, function (err, adapters) {
1316
+ _this20._socket.emit('getAdapters', adapter, function (err, adapters) {
1297
1317
  if (timeout) {
1298
1318
  clearTimeout(timeout);
1299
1319
  timeout = null;
@@ -1313,7 +1333,7 @@ var Connection = /*#__PURE__*/function () {
1313
1333
  }, {
1314
1334
  key: "_renameGroups",
1315
1335
  value: function _renameGroups(objs, cb) {
1316
- var _this20 = this;
1336
+ var _this21 = this;
1317
1337
  if (!objs || !objs.length) {
1318
1338
  cb && cb();
1319
1339
  } else {
@@ -1322,10 +1342,10 @@ var Connection = /*#__PURE__*/function () {
1322
1342
  obj._id = obj.newId;
1323
1343
  delete obj.newId;
1324
1344
  this.setObject(obj._id, obj).then(function () {
1325
- return _this20.delObject(oldId);
1345
+ return _this21.delObject(oldId);
1326
1346
  }).then(function () {
1327
1347
  return setTimeout(function () {
1328
- return _this20._renameGroups(objs, cb);
1348
+ return _this21._renameGroups(objs, cb);
1329
1349
  }, 0);
1330
1350
  })["catch"](function (err) {
1331
1351
  return cb && cb(err);
@@ -1342,7 +1362,7 @@ var Connection = /*#__PURE__*/function () {
1342
1362
  }, {
1343
1363
  key: "renameGroup",
1344
1364
  value: function renameGroup(id, newId, newName) {
1345
- var _this21 = this;
1365
+ var _this22 = this;
1346
1366
  if (Connection.isWeb()) {
1347
1367
  return Promise.reject('Allowed only in admin');
1348
1368
  }
@@ -1356,7 +1376,7 @@ var Connection = /*#__PURE__*/function () {
1356
1376
  return group.newId = newId + group._id.substring(id.length);
1357
1377
  });
1358
1378
  return new Promise(function (resolve, reject) {
1359
- return _this21._renameGroups(groupsToRename, function (err) {
1379
+ return _this22._renameGroups(groupsToRename, function (err) {
1360
1380
  return err ? reject(err) : resolve();
1361
1381
  });
1362
1382
  }).then(function () {
@@ -1369,8 +1389,8 @@ var Connection = /*#__PURE__*/function () {
1369
1389
  obj.common = obj.common || {};
1370
1390
  obj.common.name = newName;
1371
1391
  }
1372
- return _this21.setObject(obj._id, obj).then(function () {
1373
- return _this21.delObject(id);
1392
+ return _this22.setObject(obj._id, obj).then(function () {
1393
+ return _this22.delObject(id);
1374
1394
  });
1375
1395
  }
1376
1396
  });
@@ -1388,12 +1408,12 @@ var Connection = /*#__PURE__*/function () {
1388
1408
  }, {
1389
1409
  key: "sendTo",
1390
1410
  value: function sendTo(instance, command, data) {
1391
- var _this22 = this;
1411
+ var _this23 = this;
1392
1412
  if (!this.connected) {
1393
1413
  return Promise.reject(NOT_CONNECTED);
1394
1414
  }
1395
1415
  return new Promise(function (resolve) {
1396
- return _this22._socket.emit('sendTo', instance, command, data, function (result) {
1416
+ return _this23._socket.emit('sendTo', instance, command, data, function (result) {
1397
1417
  return resolve(result);
1398
1418
  });
1399
1419
  });
@@ -1407,7 +1427,7 @@ var Connection = /*#__PURE__*/function () {
1407
1427
  }, {
1408
1428
  key: "extendObject",
1409
1429
  value: function extendObject(id, obj) {
1410
- var _this23 = this;
1430
+ var _this24 = this;
1411
1431
  if (!this.connected) {
1412
1432
  return Promise.reject(NOT_CONNECTED);
1413
1433
  }
@@ -1422,7 +1442,7 @@ var Connection = /*#__PURE__*/function () {
1422
1442
  delete obj.ts;
1423
1443
  }
1424
1444
  return new Promise(function (resolve, reject) {
1425
- return _this23._socket.emit('extendObject', id, obj, function (err) {
1445
+ return _this24._socket.emit('extendObject', id, obj, function (err) {
1426
1446
  return err ? reject(err) : resolve();
1427
1447
  });
1428
1448
  });
@@ -1539,7 +1559,7 @@ var Connection = /*#__PURE__*/function () {
1539
1559
  }, {
1540
1560
  key: "getEnums",
1541
1561
  value: function getEnums(_enum, update) {
1542
- var _this24 = this;
1562
+ var _this25 = this;
1543
1563
  if (!update && this._promises["enums_".concat(_enum || 'all')]) {
1544
1564
  return this._promises["enums_".concat(_enum || 'all')];
1545
1565
  }
@@ -1547,7 +1567,7 @@ var Connection = /*#__PURE__*/function () {
1547
1567
  return Promise.reject(NOT_CONNECTED);
1548
1568
  }
1549
1569
  this._promises["enums_".concat(_enum || 'all')] = new Promise(function (resolve, reject) {
1550
- _this24._socket.emit('getObjectView', 'system', 'enum', {
1570
+ _this25._socket.emit('getObjectView', 'system', 'enum', {
1551
1571
  startkey: "enum.".concat(_enum || ''),
1552
1572
  endkey: "enum.".concat(_enum ? _enum + '.' : '', "\u9999")
1553
1573
  }, function (err, res) {
@@ -1578,9 +1598,9 @@ var Connection = /*#__PURE__*/function () {
1578
1598
  }, {
1579
1599
  key: "getObjectViewCustom",
1580
1600
  value: function getObjectViewCustom(design, type, start, end) {
1581
- var _this25 = this;
1601
+ var _this26 = this;
1582
1602
  return new Promise(function (resolve, reject) {
1583
- _this25._socket.emit('getObjectView', design, type, {
1603
+ _this26._socket.emit('getObjectView', design, type, {
1584
1604
  startkey: start,
1585
1605
  endkey: end
1586
1606
  }, function (err, res) {
@@ -1698,7 +1718,7 @@ var Connection = /*#__PURE__*/function () {
1698
1718
  }, {
1699
1719
  key: "getLogs",
1700
1720
  value: function getLogs(host, linesNumber) {
1701
- var _this26 = this;
1721
+ var _this27 = this;
1702
1722
  if (Connection.isWeb()) {
1703
1723
  return Promise.reject('Allowed only in admin');
1704
1724
  }
@@ -1706,7 +1726,7 @@ var Connection = /*#__PURE__*/function () {
1706
1726
  return Promise.reject(NOT_CONNECTED);
1707
1727
  }
1708
1728
  return new Promise(function (resolve) {
1709
- return _this26._socket.emit('sendToHost', host, 'getLogs', linesNumber || 200, function (lines) {
1729
+ return _this27._socket.emit('sendToHost', host, 'getLogs', linesNumber || 200, function (lines) {
1710
1730
  return resolve(lines);
1711
1731
  });
1712
1732
  });
@@ -1719,7 +1739,7 @@ var Connection = /*#__PURE__*/function () {
1719
1739
  }, {
1720
1740
  key: "getLogsFiles",
1721
1741
  value: function getLogsFiles(host) {
1722
- var _this27 = this;
1742
+ var _this28 = this;
1723
1743
  if (Connection.isWeb()) {
1724
1744
  return Promise.reject('Allowed only in admin');
1725
1745
  }
@@ -1727,7 +1747,7 @@ var Connection = /*#__PURE__*/function () {
1727
1747
  return Promise.reject(NOT_CONNECTED);
1728
1748
  }
1729
1749
  return new Promise(function (resolve, reject) {
1730
- return _this27._socket.emit('readLogs', host, function (err, files) {
1750
+ return _this28._socket.emit('readLogs', host, function (err, files) {
1731
1751
  return err ? reject(err) : resolve(files);
1732
1752
  });
1733
1753
  });
@@ -1741,7 +1761,7 @@ var Connection = /*#__PURE__*/function () {
1741
1761
  }, {
1742
1762
  key: "delLogs",
1743
1763
  value: function delLogs(host) {
1744
- var _this28 = this;
1764
+ var _this29 = this;
1745
1765
  if (Connection.isWeb()) {
1746
1766
  return Promise.reject('Allowed only in admin');
1747
1767
  }
@@ -1749,7 +1769,7 @@ var Connection = /*#__PURE__*/function () {
1749
1769
  return Promise.reject(NOT_CONNECTED);
1750
1770
  }
1751
1771
  return new Promise(function (resolve, reject) {
1752
- return _this28._socket.emit('sendToHost', host, 'delLogs', null, function (error) {
1772
+ return _this29._socket.emit('sendToHost', host, 'delLogs', null, function (error) {
1753
1773
  return error ? reject(error) : resolve();
1754
1774
  });
1755
1775
  });
@@ -1762,12 +1782,12 @@ var Connection = /*#__PURE__*/function () {
1762
1782
  }, {
1763
1783
  key: "readMetaItems",
1764
1784
  value: function readMetaItems() {
1765
- var _this29 = this;
1785
+ var _this30 = this;
1766
1786
  if (!this.connected) {
1767
1787
  return Promise.reject(NOT_CONNECTED);
1768
1788
  }
1769
1789
  return new Promise(function (resolve, reject) {
1770
- return _this29._socket.emit('getObjectView', 'system', 'meta', {
1790
+ return _this30._socket.emit('getObjectView', 'system', 'meta', {
1771
1791
  startkey: '',
1772
1792
  endkey: "\u9999"
1773
1793
  }, function (err, objs) {
@@ -1787,12 +1807,12 @@ var Connection = /*#__PURE__*/function () {
1787
1807
  }, {
1788
1808
  key: "readDir",
1789
1809
  value: function readDir(adapter, fileName) {
1790
- var _this30 = this;
1810
+ var _this31 = this;
1791
1811
  if (!this.connected) {
1792
1812
  return Promise.reject(NOT_CONNECTED);
1793
1813
  }
1794
1814
  return new Promise(function (resolve, reject) {
1795
- return _this30._socket.emit('readDir', adapter, fileName, function (err, files) {
1815
+ return _this31._socket.emit('readDir', adapter, fileName, function (err, files) {
1796
1816
  return err ? reject(err) : resolve(files);
1797
1817
  });
1798
1818
  });
@@ -1808,13 +1828,13 @@ var Connection = /*#__PURE__*/function () {
1808
1828
  }, {
1809
1829
  key: "readFile",
1810
1830
  value: function readFile(adapter, fileName, base64) {
1811
- var _this31 = this;
1831
+ var _this32 = this;
1812
1832
  if (!this.connected) {
1813
1833
  return Promise.reject(NOT_CONNECTED);
1814
1834
  }
1815
1835
  return new Promise(function (resolve, reject) {
1816
1836
  if (!base64) {
1817
- _this31._socket.emit('readFile', adapter, fileName, function (err, data, type) {
1837
+ _this32._socket.emit('readFile', adapter, fileName, function (err, data, type) {
1818
1838
  //@ts-ignore
1819
1839
  err ? reject(err) : resolve({
1820
1840
  data: data,
@@ -1822,7 +1842,7 @@ var Connection = /*#__PURE__*/function () {
1822
1842
  });
1823
1843
  });
1824
1844
  } else {
1825
- _this31._socket.emit('readFile64', adapter, fileName, base64, function (err, data) {
1845
+ _this32._socket.emit('readFile64', adapter, fileName, base64, function (err, data) {
1826
1846
  return err ? reject(err) : resolve(data);
1827
1847
  });
1828
1848
  }
@@ -1839,20 +1859,20 @@ var Connection = /*#__PURE__*/function () {
1839
1859
  }, {
1840
1860
  key: "writeFile64",
1841
1861
  value: function writeFile64(adapter, fileName, data) {
1842
- var _this32 = this;
1862
+ var _this33 = this;
1843
1863
  if (!this.connected) {
1844
1864
  return Promise.reject(NOT_CONNECTED);
1845
1865
  }
1846
1866
  return new Promise(function (resolve, reject) {
1847
1867
  if (typeof data === 'string') {
1848
- _this32._socket.emit('writeFile', adapter, fileName, data, function (err) {
1868
+ _this33._socket.emit('writeFile', adapter, fileName, data, function (err) {
1849
1869
  return err ? reject(err) : resolve();
1850
1870
  });
1851
1871
  } else {
1852
1872
  var base64 = btoa(new Uint8Array(data).reduce(function (data, _byte) {
1853
1873
  return data + String.fromCharCode(_byte);
1854
1874
  }, ''));
1855
- _this32._socket.emit('writeFile64', adapter, fileName, base64, function (err) {
1875
+ _this33._socket.emit('writeFile64', adapter, fileName, base64, function (err) {
1856
1876
  return err ? reject(err) : resolve();
1857
1877
  });
1858
1878
  }
@@ -1868,12 +1888,12 @@ var Connection = /*#__PURE__*/function () {
1868
1888
  }, {
1869
1889
  key: "deleteFile",
1870
1890
  value: function deleteFile(adapter, fileName) {
1871
- var _this33 = this;
1891
+ var _this34 = this;
1872
1892
  if (!this.connected) {
1873
1893
  return Promise.reject(NOT_CONNECTED);
1874
1894
  }
1875
1895
  return new Promise(function (resolve, reject) {
1876
- return _this33._socket.emit('unlink', adapter, fileName, function (err) {
1896
+ return _this34._socket.emit('unlink', adapter, fileName, function (err) {
1877
1897
  return err ? reject(err) : resolve();
1878
1898
  });
1879
1899
  });
@@ -1889,12 +1909,12 @@ var Connection = /*#__PURE__*/function () {
1889
1909
  }, {
1890
1910
  key: "deleteFolder",
1891
1911
  value: function deleteFolder(adapter, folderName) {
1892
- var _this34 = this;
1912
+ var _this35 = this;
1893
1913
  if (!this.connected) {
1894
1914
  return Promise.reject(NOT_CONNECTED);
1895
1915
  }
1896
1916
  return new Promise(function (resolve, reject) {
1897
- return _this34._socket.emit('deleteFolder', adapter, folderName, function (err) {
1917
+ return _this35._socket.emit('deleteFolder', adapter, folderName, function (err) {
1898
1918
  return err ? reject(err) : resolve();
1899
1919
  });
1900
1920
  });
@@ -1908,7 +1928,7 @@ var Connection = /*#__PURE__*/function () {
1908
1928
  }, {
1909
1929
  key: "getHosts",
1910
1930
  value: function getHosts(update) {
1911
- var _this35 = this;
1931
+ var _this36 = this;
1912
1932
  if (Connection.isWeb()) {
1913
1933
  return Promise.reject('Allowed only in admin');
1914
1934
  }
@@ -1919,7 +1939,7 @@ var Connection = /*#__PURE__*/function () {
1919
1939
  return Promise.reject(NOT_CONNECTED);
1920
1940
  }
1921
1941
  this._promises.hosts = new Promise(function (resolve, reject) {
1922
- return _this35._socket.emit('getObjectView', 'system', 'host', {
1942
+ return _this36._socket.emit('getObjectView', 'system', 'host', {
1923
1943
  startkey: 'system.host.',
1924
1944
  endkey: "system.host.\u9999"
1925
1945
  }, function (err, doc) {
@@ -1943,7 +1963,7 @@ var Connection = /*#__PURE__*/function () {
1943
1963
  }, {
1944
1964
  key: "getUsers",
1945
1965
  value: function getUsers(update) {
1946
- var _this36 = this;
1966
+ var _this37 = this;
1947
1967
  if (Connection.isWeb()) {
1948
1968
  return Promise.reject('Allowed only in admin');
1949
1969
  }
@@ -1954,7 +1974,7 @@ var Connection = /*#__PURE__*/function () {
1954
1974
  return Promise.reject(NOT_CONNECTED);
1955
1975
  }
1956
1976
  this._promises.users = new Promise(function (resolve, reject) {
1957
- return _this36._socket.emit('getObjectView', 'system', 'user', {
1977
+ return _this37._socket.emit('getObjectView', 'system', 'user', {
1958
1978
  startkey: 'system.user.',
1959
1979
  endkey: "system.user.\u9999"
1960
1980
  }, function (err, doc) {
@@ -1978,7 +1998,7 @@ var Connection = /*#__PURE__*/function () {
1978
1998
  }, {
1979
1999
  key: "getGroups",
1980
2000
  value: function getGroups(update) {
1981
- var _this37 = this;
2001
+ var _this38 = this;
1982
2002
  if (!update && this._promises.groups) {
1983
2003
  return this._promises.groups;
1984
2004
  }
@@ -1986,7 +2006,7 @@ var Connection = /*#__PURE__*/function () {
1986
2006
  return Promise.reject(NOT_CONNECTED);
1987
2007
  }
1988
2008
  this._promises.groups = new Promise(function (resolve, reject) {
1989
- return _this37._socket.emit('getObjectView', 'system', 'group', {
2009
+ return _this38._socket.emit('getObjectView', 'system', 'group', {
1990
2010
  startkey: 'system.group.',
1991
2011
  endkey: "system.group.\u9999"
1992
2012
  }, function (err, doc) {
@@ -2012,7 +2032,7 @@ var Connection = /*#__PURE__*/function () {
2012
2032
  }, {
2013
2033
  key: "getHostInfo",
2014
2034
  value: function getHostInfo(host, update, timeoutMs) {
2015
- var _this38 = this;
2035
+ var _this39 = this;
2016
2036
  if (Connection.isWeb()) {
2017
2037
  return Promise.reject('Allowed only in admin');
2018
2038
  }
@@ -2032,8 +2052,8 @@ var Connection = /*#__PURE__*/function () {
2032
2052
  timeout = null;
2033
2053
  reject('getHostInfo timeout');
2034
2054
  }
2035
- }, timeoutMs || _this38.props.cmdTimeout);
2036
- _this38._socket.emit('sendToHost', host, 'getHostInfo', null, function (data) {
2055
+ }, timeoutMs || _this39.props.cmdTimeout);
2056
+ _this39._socket.emit('sendToHost', host, 'getHostInfo', null, function (data) {
2037
2057
  if (timeout) {
2038
2058
  clearTimeout(timeout);
2039
2059
  timeout = null;
@@ -2060,7 +2080,7 @@ var Connection = /*#__PURE__*/function () {
2060
2080
  }, {
2061
2081
  key: "getHostInfoShort",
2062
2082
  value: function getHostInfoShort(host, update, timeoutMs) {
2063
- var _this39 = this;
2083
+ var _this40 = this;
2064
2084
  if (Connection.isWeb()) {
2065
2085
  return Promise.reject('Allowed only in admin');
2066
2086
  }
@@ -2080,8 +2100,8 @@ var Connection = /*#__PURE__*/function () {
2080
2100
  timeout = null;
2081
2101
  reject('hostInfoShort timeout');
2082
2102
  }
2083
- }, timeoutMs || _this39.props.cmdTimeout);
2084
- _this39._socket.emit('sendToHost', host, 'getHostInfoShort', null, function (data) {
2103
+ }, timeoutMs || _this40.props.cmdTimeout);
2104
+ _this40._socket.emit('sendToHost', host, 'getHostInfoShort', null, function (data) {
2085
2105
  if (timeout) {
2086
2106
  clearTimeout(timeout);
2087
2107
  timeout = null;
@@ -2109,7 +2129,7 @@ var Connection = /*#__PURE__*/function () {
2109
2129
  }, {
2110
2130
  key: "getRepository",
2111
2131
  value: function getRepository(host, args, update, timeoutMs) {
2112
- var _this40 = this;
2132
+ var _this41 = this;
2113
2133
  if (Connection.isWeb()) {
2114
2134
  return Promise.reject('Allowed only in admin');
2115
2135
  }
@@ -2128,8 +2148,8 @@ var Connection = /*#__PURE__*/function () {
2128
2148
  timeout = null;
2129
2149
  reject('getRepository timeout');
2130
2150
  }
2131
- }, timeoutMs || _this40.props.cmdTimeout);
2132
- _this40._socket.emit('sendToHost', host, 'getRepository', args, function (data) {
2151
+ }, timeoutMs || _this41.props.cmdTimeout);
2152
+ _this41._socket.emit('sendToHost', host, 'getRepository', args, function (data) {
2133
2153
  if (timeout) {
2134
2154
  clearTimeout(timeout);
2135
2155
  timeout = null;
@@ -2156,7 +2176,7 @@ var Connection = /*#__PURE__*/function () {
2156
2176
  }, {
2157
2177
  key: "getInstalled",
2158
2178
  value: function getInstalled(host, update, cmdTimeout) {
2159
- var _this41 = this;
2179
+ var _this42 = this;
2160
2180
  if (Connection.isWeb()) {
2161
2181
  return Promise.reject('Allowed only in admin');
2162
2182
  }
@@ -2176,8 +2196,8 @@ var Connection = /*#__PURE__*/function () {
2176
2196
  timeout = null;
2177
2197
  reject('getInstalled timeout');
2178
2198
  }
2179
- }, cmdTimeout || _this41.props.cmdTimeout);
2180
- _this41._socket.emit('sendToHost', host, 'getInstalled', null, function (data) {
2199
+ }, cmdTimeout || _this42.props.cmdTimeout);
2200
+ _this42._socket.emit('sendToHost', host, 'getInstalled', null, function (data) {
2181
2201
  if (timeout) {
2182
2202
  clearTimeout(timeout);
2183
2203
  timeout = null;
@@ -2203,12 +2223,12 @@ var Connection = /*#__PURE__*/function () {
2203
2223
  }, {
2204
2224
  key: "rename",
2205
2225
  value: function rename(adapter, oldName, newName) {
2206
- var _this42 = this;
2226
+ var _this43 = this;
2207
2227
  if (!this.connected) {
2208
2228
  return Promise.reject(NOT_CONNECTED);
2209
2229
  }
2210
2230
  return new Promise(function (resolve, reject) {
2211
- return _this42._socket.emit('rename', adapter, oldName, newName, function (err) {
2231
+ return _this43._socket.emit('rename', adapter, oldName, newName, function (err) {
2212
2232
  return err ? reject(err) : resolve();
2213
2233
  });
2214
2234
  });
@@ -2223,12 +2243,12 @@ var Connection = /*#__PURE__*/function () {
2223
2243
  }, {
2224
2244
  key: "renameFile",
2225
2245
  value: function renameFile(adapter, oldName, newName) {
2226
- var _this43 = this;
2246
+ var _this44 = this;
2227
2247
  if (!this.connected) {
2228
2248
  return Promise.reject(NOT_CONNECTED);
2229
2249
  }
2230
2250
  return new Promise(function (resolve, reject) {
2231
- return _this43._socket.emit('renameFile', adapter, oldName, newName, function (err) {
2251
+ return _this44._socket.emit('renameFile', adapter, oldName, newName, function (err) {
2232
2252
  return err ? reject(err) : resolve();
2233
2253
  });
2234
2254
  });
@@ -2245,7 +2265,7 @@ var Connection = /*#__PURE__*/function () {
2245
2265
  }, {
2246
2266
  key: "cmdExec",
2247
2267
  value: function cmdExec(host, cmd, cmdId, cmdTimeout) {
2248
- var _this44 = this;
2268
+ var _this45 = this;
2249
2269
  if (Connection.isWeb()) {
2250
2270
  return Promise.reject('Allowed only in admin');
2251
2271
  }
@@ -2262,7 +2282,7 @@ var Connection = /*#__PURE__*/function () {
2262
2282
  reject('cmdExec timeout');
2263
2283
  }
2264
2284
  }, cmdTimeout);
2265
- _this44._socket.emit('cmdExec', host, cmdId, cmd, null, function (err) {
2285
+ _this45._socket.emit('cmdExec', host, cmdId, cmd, null, function (err) {
2266
2286
  if (!cmdTimeout || timeout) {
2267
2287
  timeout && clearTimeout(timeout);
2268
2288
  timeout = null;
@@ -2285,7 +2305,7 @@ var Connection = /*#__PURE__*/function () {
2285
2305
  }, {
2286
2306
  key: "checkFeatureSupported",
2287
2307
  value: function checkFeatureSupported(feature, update) {
2288
- var _this45 = this;
2308
+ var _this46 = this;
2289
2309
  var cache = "supportedFeatures_".concat(feature);
2290
2310
  if (!update && this._promises[cache]) {
2291
2311
  return this._promises[cache];
@@ -2294,7 +2314,7 @@ var Connection = /*#__PURE__*/function () {
2294
2314
  return Promise.reject(NOT_CONNECTED);
2295
2315
  }
2296
2316
  this._promises[cache] = new Promise(function (resolve, reject) {
2297
- return _this45._socket.emit('checkFeatureSupported', feature, function (err, features) {
2317
+ return _this46._socket.emit('checkFeatureSupported', feature, function (err, features) {
2298
2318
  err ? reject(err) : resolve(features);
2299
2319
  });
2300
2320
  });
@@ -2309,13 +2329,13 @@ var Connection = /*#__PURE__*/function () {
2309
2329
  }, {
2310
2330
  key: "readBaseSettings",
2311
2331
  value: function readBaseSettings(host) {
2312
- var _this46 = this;
2332
+ var _this47 = this;
2313
2333
  if (Connection.isWeb()) {
2314
2334
  return Promise.reject('Allowed only in admin');
2315
2335
  }
2316
2336
  return this.checkFeatureSupported('CONTROLLER_READWRITE_BASE_SETTINGS').then(function (result) {
2317
2337
  if (result) {
2318
- if (!_this46.connected) {
2338
+ if (!_this47.connected) {
2319
2339
  return Promise.reject(NOT_CONNECTED);
2320
2340
  }
2321
2341
  return new Promise(function (resolve, reject) {
@@ -2324,11 +2344,11 @@ var Connection = /*#__PURE__*/function () {
2324
2344
  timeout = null;
2325
2345
  reject('readBaseSettings timeout');
2326
2346
  }
2327
- }, _this46.props.cmdTimeout);
2347
+ }, _this47.props.cmdTimeout);
2328
2348
  if (host.startsWith('system.host.')) {
2329
2349
  host = host.replace(/^system\.host\./, '');
2330
2350
  }
2331
- _this46._socket.emit('sendToHost', host, 'readBaseSettings', null, function (data) {
2351
+ _this47._socket.emit('sendToHost', host, 'readBaseSettings', null, function (data) {
2332
2352
  if (timeout) {
2333
2353
  clearTimeout(timeout);
2334
2354
  timeout = null;
@@ -2357,13 +2377,13 @@ var Connection = /*#__PURE__*/function () {
2357
2377
  }, {
2358
2378
  key: "writeBaseSettings",
2359
2379
  value: function writeBaseSettings(host, config) {
2360
- var _this47 = this;
2380
+ var _this48 = this;
2361
2381
  if (Connection.isWeb()) {
2362
2382
  return Promise.reject('Allowed only in admin');
2363
2383
  }
2364
2384
  return this.checkFeatureSupported('CONTROLLER_READWRITE_BASE_SETTINGS').then(function (result) {
2365
2385
  if (result) {
2366
- if (!_this47.connected) {
2386
+ if (!_this48.connected) {
2367
2387
  return Promise.reject(NOT_CONNECTED);
2368
2388
  }
2369
2389
  return new Promise(function (resolve, reject) {
@@ -2372,8 +2392,8 @@ var Connection = /*#__PURE__*/function () {
2372
2392
  timeout = null;
2373
2393
  reject('writeBaseSettings timeout');
2374
2394
  }
2375
- }, _this47.props.cmdTimeout);
2376
- _this47._socket.emit('sendToHost', host, 'writeBaseSettings', config, function (data) {
2395
+ }, _this48.props.cmdTimeout);
2396
+ _this48._socket.emit('sendToHost', host, 'writeBaseSettings', config, function (data) {
2377
2397
  if (timeout) {
2378
2398
  clearTimeout(timeout);
2379
2399
  timeout = null;
@@ -2401,12 +2421,12 @@ var Connection = /*#__PURE__*/function () {
2401
2421
  }, {
2402
2422
  key: "restartController",
2403
2423
  value: function restartController(host) {
2404
- var _this48 = this;
2424
+ var _this49 = this;
2405
2425
  if (Connection.isWeb()) {
2406
2426
  return Promise.reject('Allowed only in admin');
2407
2427
  }
2408
2428
  return new Promise(function (resolve, reject) {
2409
- _this48._socket.emit('sendToHost', host, 'restartController', null, function (error) {
2429
+ _this49._socket.emit('sendToHost', host, 'restartController', null, function (error) {
2410
2430
  error ? reject(error) : resolve(true);
2411
2431
  });
2412
2432
  });
@@ -2421,12 +2441,12 @@ var Connection = /*#__PURE__*/function () {
2421
2441
  }, {
2422
2442
  key: "getDiagData",
2423
2443
  value: function getDiagData(host, typeOfDiag) {
2424
- var _this49 = this;
2444
+ var _this50 = this;
2425
2445
  if (Connection.isWeb()) {
2426
2446
  return Promise.reject('Allowed only in admin');
2427
2447
  }
2428
2448
  return new Promise(function (resolve) {
2429
- _this49._socket.emit('sendToHost', host, 'getDiagData', typeOfDiag, function (result) {
2449
+ _this50._socket.emit('sendToHost', host, 'getDiagData', typeOfDiag, function (result) {
2430
2450
  return resolve(result);
2431
2451
  });
2432
2452
  });
@@ -2440,19 +2460,19 @@ var Connection = /*#__PURE__*/function () {
2440
2460
  }, {
2441
2461
  key: "getForeignStates",
2442
2462
  value: function getForeignStates(pattern) {
2443
- var _this50 = this;
2463
+ var _this51 = this;
2444
2464
  if (!this.connected) {
2445
2465
  return Promise.reject(NOT_CONNECTED);
2446
2466
  }
2447
2467
  if (Connection.isWeb()) {
2448
2468
  return new Promise(function (resolve, reject) {
2449
- return _this50._socket.emit('getStates', pattern || '*', function (err, states) {
2469
+ return _this51._socket.emit('getStates', pattern || '*', function (err, states) {
2450
2470
  return err ? reject(err) : resolve(states);
2451
2471
  });
2452
2472
  });
2453
2473
  } else {
2454
2474
  return new Promise(function (resolve, reject) {
2455
- return _this50._socket.emit('getForeignStates', pattern || '*', function (err, states) {
2475
+ return _this51._socket.emit('getForeignStates', pattern || '*', function (err, states) {
2456
2476
  return err ? reject(err) : resolve(states);
2457
2477
  });
2458
2478
  });
@@ -2468,12 +2488,12 @@ var Connection = /*#__PURE__*/function () {
2468
2488
  }, {
2469
2489
  key: "getForeignObjects",
2470
2490
  value: function getForeignObjects(pattern, type) {
2471
- var _this51 = this;
2491
+ var _this52 = this;
2472
2492
  if (!this.connected) {
2473
2493
  return Promise.reject(NOT_CONNECTED);
2474
2494
  }
2475
2495
  return new Promise(function (resolve, reject) {
2476
- return _this51._socket.emit('getForeignObjects', pattern || '*', type, function (err, states) {
2496
+ return _this52._socket.emit('getForeignObjects', pattern || '*', type, function (err, states) {
2477
2497
  return err ? reject(err) : resolve(states);
2478
2498
  });
2479
2499
  });
@@ -2513,9 +2533,9 @@ var Connection = /*#__PURE__*/function () {
2513
2533
  }, {
2514
2534
  key: "setSystemConfig",
2515
2535
  value: function setSystemConfig(obj) {
2516
- var _this52 = this;
2536
+ var _this53 = this;
2517
2537
  return this.setObject('system.config', obj).then(function () {
2518
- return _this52._promises.systemConfig = Promise.resolve(obj);
2538
+ return _this53._promises.systemConfig = Promise.resolve(obj);
2519
2539
  });
2520
2540
  }
2521
2541
 
@@ -2538,12 +2558,12 @@ var Connection = /*#__PURE__*/function () {
2538
2558
  }, {
2539
2559
  key: "getHistory",
2540
2560
  value: function getHistory(id, options) {
2541
- var _this53 = this;
2561
+ var _this54 = this;
2542
2562
  if (!this.connected) {
2543
2563
  return Promise.reject(NOT_CONNECTED);
2544
2564
  }
2545
2565
  return new Promise(function (resolve, reject) {
2546
- return _this53._socket.emit('getHistory', id, options, function (err, values) {
2566
+ return _this54._socket.emit('getHistory', id, options, function (err, values) {
2547
2567
  return err ? reject(err) : resolve(values);
2548
2568
  });
2549
2569
  });
@@ -2558,12 +2578,12 @@ var Connection = /*#__PURE__*/function () {
2558
2578
  }, {
2559
2579
  key: "getHistoryEx",
2560
2580
  value: function getHistoryEx(id, options) {
2561
- var _this54 = this;
2581
+ var _this55 = this;
2562
2582
  if (!this.connected) {
2563
2583
  return Promise.reject(NOT_CONNECTED);
2564
2584
  }
2565
2585
  return new Promise(function (resolve, reject) {
2566
- return _this54._socket.emit('getHistory', id, options, function (err, values, stepIgnore, sessionId) {
2586
+ return _this55._socket.emit('getHistory', id, options, function (err, values, stepIgnore, sessionId) {
2567
2587
  return err ? reject(err) : resolve({
2568
2588
  values: values,
2569
2589
  sessionId: sessionId,
@@ -2582,12 +2602,12 @@ var Connection = /*#__PURE__*/function () {
2582
2602
  }, {
2583
2603
  key: "changePassword",
2584
2604
  value: function changePassword(user, password) {
2585
- var _this55 = this;
2605
+ var _this56 = this;
2586
2606
  if (Connection.isWeb()) {
2587
2607
  return Promise.reject('Allowed only in admin');
2588
2608
  }
2589
2609
  return new Promise(function (resolve, reject) {
2590
- return _this55._socket.emit('changePassword', user, password, function (err) {
2610
+ return _this56._socket.emit('changePassword', user, password, function (err) {
2591
2611
  return err ? reject(err) : resolve();
2592
2612
  });
2593
2613
  });
@@ -2626,7 +2646,7 @@ var Connection = /*#__PURE__*/function () {
2626
2646
  }, {
2627
2647
  key: "getHostByIp",
2628
2648
  value: function getHostByIp(ipOrHostName, update) {
2629
- var _this56 = this;
2649
+ var _this57 = this;
2630
2650
  if (Connection.isWeb()) {
2631
2651
  return Promise.reject('Allowed only in admin');
2632
2652
  }
@@ -2638,8 +2658,8 @@ var Connection = /*#__PURE__*/function () {
2638
2658
  return this._promises[cache];
2639
2659
  }
2640
2660
  this._promises[cache] = new Promise(function (resolve) {
2641
- return _this56._socket.emit('getHostByIp', ipOrHostName, function (ip, host) {
2642
- var _host$native, _host$native$hardware;
2661
+ return _this57._socket.emit('getHostByIp', ipOrHostName, function (ip, host) {
2662
+ var _host$native;
2643
2663
  var IPs4 = [{
2644
2664
  name: '[IPv4] 0.0.0.0 - Listen on all IPs',
2645
2665
  address: '0.0.0.0',
@@ -2650,7 +2670,7 @@ var Connection = /*#__PURE__*/function () {
2650
2670
  address: '::',
2651
2671
  family: 'ipv6'
2652
2672
  }];
2653
- if (host !== null && host !== void 0 && (_host$native = host["native"]) !== null && _host$native !== void 0 && (_host$native$hardware = _host$native.hardware) !== null && _host$native$hardware !== void 0 && _host$native$hardware.networkInterfaces) {
2673
+ if (host !== null && host !== void 0 && (_host$native = host["native"]) !== null && _host$native !== void 0 && (_host$native = _host$native.hardware) !== null && _host$native !== void 0 && _host$native.networkInterfaces) {
2654
2674
  for (var eth in host["native"].hardware.networkInterfaces) {
2655
2675
  if (!host["native"].hardware.networkInterfaces.hasOwnProperty(eth)) {
2656
2676
  continue;
@@ -2689,12 +2709,12 @@ var Connection = /*#__PURE__*/function () {
2689
2709
  }, {
2690
2710
  key: "encrypt",
2691
2711
  value: function encrypt(text) {
2692
- var _this57 = this;
2712
+ var _this58 = this;
2693
2713
  if (Connection.isWeb()) {
2694
2714
  return Promise.reject('Allowed only in admin');
2695
2715
  }
2696
2716
  return new Promise(function (resolve, reject) {
2697
- return _this57._socket.emit('encrypt', text, function (err, text) {
2717
+ return _this58._socket.emit('encrypt', text, function (err, text) {
2698
2718
  return err ? reject(err) : resolve(text);
2699
2719
  });
2700
2720
  });
@@ -2708,12 +2728,12 @@ var Connection = /*#__PURE__*/function () {
2708
2728
  }, {
2709
2729
  key: "decrypt",
2710
2730
  value: function decrypt(encryptedText) {
2711
- var _this58 = this;
2731
+ var _this59 = this;
2712
2732
  if (Connection.isWeb()) {
2713
2733
  return Promise.reject('Allowed only in admin');
2714
2734
  }
2715
2735
  return new Promise(function (resolve, reject) {
2716
- return _this58._socket.emit('decrypt', encryptedText, function (err, text) {
2736
+ return _this59._socket.emit('decrypt', encryptedText, function (err, text) {
2717
2737
  return err ? reject(err) : resolve(text);
2718
2738
  });
2719
2739
  });
@@ -2726,12 +2746,12 @@ var Connection = /*#__PURE__*/function () {
2726
2746
  }, {
2727
2747
  key: "getVersion",
2728
2748
  value: function getVersion(update) {
2729
- var _this59 = this;
2749
+ var _this60 = this;
2730
2750
  if (update && this._promises.version) {
2731
2751
  this._promises.version = null;
2732
2752
  }
2733
2753
  this._promises.version = this._promises.version || new Promise(function (resolve, reject) {
2734
- return _this59._socket.emit('getVersion', function (err, version, serverName) {
2754
+ return _this60._socket.emit('getVersion', function (err, version, serverName) {
2735
2755
  // support of old socket.io
2736
2756
  if (err && !version && typeof err === 'string' && err.match(/\d+\.\d+\.\d+/)) {
2737
2757
  resolve({
@@ -2756,9 +2776,9 @@ var Connection = /*#__PURE__*/function () {
2756
2776
  }, {
2757
2777
  key: "getWebServerName",
2758
2778
  value: function getWebServerName() {
2759
- var _this60 = this;
2779
+ var _this61 = this;
2760
2780
  this._promises.webName = this._promises.webName || new Promise(function (resolve, reject) {
2761
- return _this60._socket.emit('getAdapterName', function (err, name) {
2781
+ return _this61._socket.emit('getAdapterName', function (err, name) {
2762
2782
  return err ? reject(err) : resolve(name);
2763
2783
  });
2764
2784
  });
@@ -2787,7 +2807,7 @@ var Connection = /*#__PURE__*/function () {
2787
2807
  }, {
2788
2808
  key: "chmodFile",
2789
2809
  value: function chmodFile(adapter, filename, options) {
2790
- var _this61 = this;
2810
+ var _this62 = this;
2791
2811
  if (Connection.isWeb()) {
2792
2812
  return Promise.reject('Allowed only in admin');
2793
2813
  }
@@ -2795,7 +2815,7 @@ var Connection = /*#__PURE__*/function () {
2795
2815
  return Promise.reject(NOT_CONNECTED);
2796
2816
  }
2797
2817
  return new Promise(function (resolve, reject) {
2798
- return _this61._socket.emit('chmodFile', adapter, filename, options, function (err, entries, id) {
2818
+ return _this62._socket.emit('chmodFile', adapter, filename, options, function (err, entries, id) {
2799
2819
  return err ? reject(err) : resolve({
2800
2820
  entries: entries,
2801
2821
  id: id
@@ -2814,7 +2834,7 @@ var Connection = /*#__PURE__*/function () {
2814
2834
  }, {
2815
2835
  key: "chownFile",
2816
2836
  value: function chownFile(adapter, filename, options) {
2817
- var _this62 = this;
2837
+ var _this63 = this;
2818
2838
  if (Connection.isWeb()) {
2819
2839
  return Promise.reject('Allowed only in admin');
2820
2840
  }
@@ -2822,7 +2842,7 @@ var Connection = /*#__PURE__*/function () {
2822
2842
  return Promise.reject(NOT_CONNECTED);
2823
2843
  }
2824
2844
  return new Promise(function (resolve, reject) {
2825
- return _this62._socket.emit('chownFile', adapter, filename, options, function (err, entries, id) {
2845
+ return _this63._socket.emit('chownFile', adapter, filename, options, function (err, entries, id) {
2826
2846
  return err ? reject(err) : resolve({
2827
2847
  entries: entries,
2828
2848
  id: id
@@ -2840,12 +2860,12 @@ var Connection = /*#__PURE__*/function () {
2840
2860
  }, {
2841
2861
  key: "fileExists",
2842
2862
  value: function fileExists(adapter, filename) {
2843
- var _this63 = this;
2863
+ var _this64 = this;
2844
2864
  if (!this.connected) {
2845
2865
  return Promise.reject(NOT_CONNECTED);
2846
2866
  }
2847
2867
  return new Promise(function (resolve, reject) {
2848
- return _this63._socket.emit('fileExists', adapter, filename, function (err, exists) {
2868
+ return _this64._socket.emit('fileExists', adapter, filename, function (err, exists) {
2849
2869
  return err ? reject(err) : resolve(exists);
2850
2870
  });
2851
2871
  });
@@ -2860,7 +2880,7 @@ var Connection = /*#__PURE__*/function () {
2860
2880
  }, {
2861
2881
  key: "getNotifications",
2862
2882
  value: function getNotifications(host, category) {
2863
- var _this64 = this;
2883
+ var _this65 = this;
2864
2884
  if (Connection.isWeb()) {
2865
2885
  return Promise.reject('Allowed only in admin');
2866
2886
  }
@@ -2868,7 +2888,7 @@ var Connection = /*#__PURE__*/function () {
2868
2888
  return Promise.reject(NOT_CONNECTED);
2869
2889
  }
2870
2890
  return new Promise(function (resolve) {
2871
- return _this64._socket.emit('sendToHost', host, 'getNotifications', {
2891
+ return _this65._socket.emit('sendToHost', host, 'getNotifications', {
2872
2892
  category: category
2873
2893
  }, function (notifications) {
2874
2894
  return resolve(notifications);
@@ -2885,7 +2905,7 @@ var Connection = /*#__PURE__*/function () {
2885
2905
  }, {
2886
2906
  key: "clearNotifications",
2887
2907
  value: function clearNotifications(host, category) {
2888
- var _this65 = this;
2908
+ var _this66 = this;
2889
2909
  if (Connection.isWeb()) {
2890
2910
  return Promise.reject('Allowed only in admin');
2891
2911
  }
@@ -2893,7 +2913,7 @@ var Connection = /*#__PURE__*/function () {
2893
2913
  return Promise.reject(NOT_CONNECTED);
2894
2914
  }
2895
2915
  return new Promise(function (resolve) {
2896
- return _this65._socket.emit('sendToHost', host, 'clearNotifications', {
2916
+ return _this66._socket.emit('sendToHost', host, 'clearNotifications', {
2897
2917
  category: category
2898
2918
  }, function (notifications) {
2899
2919
  return resolve(notifications);
@@ -2908,7 +2928,7 @@ var Connection = /*#__PURE__*/function () {
2908
2928
  }, {
2909
2929
  key: "getIsEasyModeStrict",
2910
2930
  value: function getIsEasyModeStrict() {
2911
- var _this66 = this;
2931
+ var _this67 = this;
2912
2932
  if (Connection.isWeb()) {
2913
2933
  return Promise.reject('Allowed only in admin');
2914
2934
  }
@@ -2916,7 +2936,7 @@ var Connection = /*#__PURE__*/function () {
2916
2936
  return Promise.reject(NOT_CONNECTED);
2917
2937
  }
2918
2938
  return new Promise(function (resolve, reject) {
2919
- return _this66._socket.emit('getIsEasyModeStrict', function (error, isStrict) {
2939
+ return _this67._socket.emit('getIsEasyModeStrict', function (error, isStrict) {
2920
2940
  return error ? reject(error) : resolve(isStrict);
2921
2941
  });
2922
2942
  });
@@ -2929,7 +2949,7 @@ var Connection = /*#__PURE__*/function () {
2929
2949
  }, {
2930
2950
  key: "getEasyMode",
2931
2951
  value: function getEasyMode() {
2932
- var _this67 = this;
2952
+ var _this68 = this;
2933
2953
  if (Connection.isWeb()) {
2934
2954
  return Promise.reject('Allowed only in admin');
2935
2955
  }
@@ -2937,7 +2957,7 @@ var Connection = /*#__PURE__*/function () {
2937
2957
  return Promise.reject(NOT_CONNECTED);
2938
2958
  }
2939
2959
  return new Promise(function (resolve, reject) {
2940
- return _this67._socket.emit('getEasyMode', function (error, config) {
2960
+ return _this68._socket.emit('getEasyMode', function (error, config) {
2941
2961
  return error ? reject(error) : resolve(config);
2942
2962
  });
2943
2963
  });
@@ -2950,12 +2970,12 @@ var Connection = /*#__PURE__*/function () {
2950
2970
  }, {
2951
2971
  key: "getCurrentUser",
2952
2972
  value: function getCurrentUser() {
2953
- var _this68 = this;
2973
+ var _this69 = this;
2954
2974
  if (!this.connected) {
2955
2975
  return Promise.reject(NOT_CONNECTED);
2956
2976
  }
2957
2977
  return new Promise(function (resolve) {
2958
- return _this68._socket.emit('authEnabled', function (isSecure, user) {
2978
+ return _this69._socket.emit('authEnabled', function (isSecure, user) {
2959
2979
  return resolve(user);
2960
2980
  });
2961
2981
  });
@@ -2998,7 +3018,7 @@ var Connection = /*#__PURE__*/function () {
2998
3018
  }, {
2999
3019
  key: "getRatings",
3000
3020
  value: function getRatings(update) {
3001
- var _this69 = this;
3021
+ var _this70 = this;
3002
3022
  if (Connection.isWeb()) {
3003
3023
  return Promise.reject('Allowed only in admin');
3004
3024
  }
@@ -3006,7 +3026,7 @@ var Connection = /*#__PURE__*/function () {
3006
3026
  return Promise.reject(NOT_CONNECTED);
3007
3027
  }
3008
3028
  return new Promise(function (resolve, reject) {
3009
- return _this69._socket.emit('getRatings', update, function (err, ratings) {
3029
+ return _this70._socket.emit('getRatings', update, function (err, ratings) {
3010
3030
  return err ? reject(err) : resolve(ratings);
3011
3031
  });
3012
3032
  });
@@ -3019,12 +3039,12 @@ var Connection = /*#__PURE__*/function () {
3019
3039
  }, {
3020
3040
  key: "getCurrentInstance",
3021
3041
  value: function getCurrentInstance() {
3022
- var _this70 = this;
3042
+ var _this71 = this;
3023
3043
  if (!this.connected) {
3024
3044
  return Promise.reject(NOT_CONNECTED);
3025
3045
  }
3026
3046
  this._promises.currentInstance = this._promises.currentInstance || new Promise(function (resolve, reject) {
3027
- return _this70._socket.emit('getCurrentInstance', function (err, namespace) {
3047
+ return _this71._socket.emit('getCurrentInstance', function (err, namespace) {
3028
3048
  return err ? reject(err) : resolve(namespace);
3029
3049
  });
3030
3050
  });
@@ -3035,7 +3055,7 @@ var Connection = /*#__PURE__*/function () {
3035
3055
  }, {
3036
3056
  key: "getCompactAdapters",
3037
3057
  value: function getCompactAdapters(update) {
3038
- var _this71 = this;
3058
+ var _this72 = this;
3039
3059
  if (Connection.isWeb()) {
3040
3060
  return Promise.reject('Allowed only in admin');
3041
3061
  }
@@ -3046,7 +3066,7 @@ var Connection = /*#__PURE__*/function () {
3046
3066
  return Promise.reject(NOT_CONNECTED);
3047
3067
  }
3048
3068
  this._promises.compactAdapters = new Promise(function (resolve, reject) {
3049
- return _this71._socket.emit('getCompactAdapters', function (err, adapters) {
3069
+ return _this72._socket.emit('getCompactAdapters', function (err, adapters) {
3050
3070
  return err ? reject(err) : resolve(adapters);
3051
3071
  });
3052
3072
  });
@@ -3064,7 +3084,7 @@ var Connection = /*#__PURE__*/function () {
3064
3084
  }, {
3065
3085
  key: "getCompactInstances",
3066
3086
  value: function getCompactInstances(update) {
3067
- var _this72 = this;
3087
+ var _this73 = this;
3068
3088
  if (Connection.isWeb()) {
3069
3089
  return Promise.reject('Allowed only in admin');
3070
3090
  }
@@ -3075,7 +3095,7 @@ var Connection = /*#__PURE__*/function () {
3075
3095
  return Promise.reject(NOT_CONNECTED);
3076
3096
  }
3077
3097
  this._promises.compactInstances = new Promise(function (resolve, reject) {
3078
- return _this72._socket.emit('getCompactInstances', function (err, instances) {
3098
+ return _this73._socket.emit('getCompactInstances', function (err, instances) {
3079
3099
  return err ? reject(err) : resolve(instances);
3080
3100
  });
3081
3101
  });
@@ -3094,7 +3114,7 @@ var Connection = /*#__PURE__*/function () {
3094
3114
  }, {
3095
3115
  key: "getCompactInstalled",
3096
3116
  value: function getCompactInstalled(host, update, cmdTimeout) {
3097
- var _this73 = this;
3117
+ var _this74 = this;
3098
3118
  if (Connection.isWeb()) {
3099
3119
  return Promise.reject('Allowed only in admin');
3100
3120
  }
@@ -3114,8 +3134,8 @@ var Connection = /*#__PURE__*/function () {
3114
3134
  timeout = null;
3115
3135
  reject('getCompactInstalled timeout');
3116
3136
  }
3117
- }, cmdTimeout || _this73.props.cmdTimeout);
3118
- _this73._socket.emit('getCompactInstalled', host, function (data) {
3137
+ }, cmdTimeout || _this74.props.cmdTimeout);
3138
+ _this74._socket.emit('getCompactInstalled', host, function (data) {
3119
3139
  if (timeout) {
3120
3140
  clearTimeout(timeout);
3121
3141
  timeout = null;
@@ -3137,7 +3157,7 @@ var Connection = /*#__PURE__*/function () {
3137
3157
  }, {
3138
3158
  key: "getCompactSystemRepositories",
3139
3159
  value: function getCompactSystemRepositories(update, cmdTimeout) {
3140
- var _this74 = this;
3160
+ var _this75 = this;
3141
3161
  if (Connection.isWeb()) {
3142
3162
  return Promise.reject('Allowed only in admin');
3143
3163
  }
@@ -3151,8 +3171,8 @@ var Connection = /*#__PURE__*/function () {
3151
3171
  timeout = null;
3152
3172
  reject('getCompactSystemRepositories timeout');
3153
3173
  }
3154
- }, cmdTimeout || _this74.props.cmdTimeout);
3155
- _this74._socket.emit('getCompactSystemRepositories', function (data) {
3174
+ }, cmdTimeout || _this75.props.cmdTimeout);
3175
+ _this75._socket.emit('getCompactSystemRepositories', function (data) {
3156
3176
  if (timeout) {
3157
3177
  clearTimeout(timeout);
3158
3178
  timeout = null;
@@ -3185,7 +3205,7 @@ var Connection = /*#__PURE__*/function () {
3185
3205
  value:
3186
3206
  // returns very optimized information for adapters to minimize connection load
3187
3207
  function getCompactSystemConfig(update) {
3188
- var _this75 = this;
3208
+ var _this76 = this;
3189
3209
  if (!update && this._promises.systemConfigCommon) {
3190
3210
  return this._promises.systemConfigCommon;
3191
3211
  }
@@ -3193,7 +3213,7 @@ var Connection = /*#__PURE__*/function () {
3193
3213
  return Promise.reject(NOT_CONNECTED);
3194
3214
  }
3195
3215
  this._promises.systemConfigCommon = new Promise(function (resolve, reject) {
3196
- return _this75._socket.emit('getCompactSystemConfig', function (err, systemConfig) {
3216
+ return _this76._socket.emit('getCompactSystemConfig', function (err, systemConfig) {
3197
3217
  return err ? reject(err) : resolve(systemConfig);
3198
3218
  });
3199
3219
  });
@@ -3210,7 +3230,7 @@ var Connection = /*#__PURE__*/function () {
3210
3230
  }, {
3211
3231
  key: "getCompactRepository",
3212
3232
  value: function getCompactRepository(host, update, timeoutMs) {
3213
- var _this76 = this;
3233
+ var _this77 = this;
3214
3234
  if (Connection.isWeb()) {
3215
3235
  return Promise.reject('Allowed only in admin');
3216
3236
  }
@@ -3229,8 +3249,8 @@ var Connection = /*#__PURE__*/function () {
3229
3249
  timeout = null;
3230
3250
  reject('getCompactRepository timeout');
3231
3251
  }
3232
- }, timeoutMs || _this76.props.cmdTimeout);
3233
- _this76._socket.emit('getCompactRepository', host, function (data) {
3252
+ }, timeoutMs || _this77.props.cmdTimeout);
3253
+ _this77._socket.emit('getCompactRepository', host, function (data) {
3234
3254
  if (timeout) {
3235
3255
  clearTimeout(timeout);
3236
3256
  timeout = null;
@@ -3249,7 +3269,7 @@ var Connection = /*#__PURE__*/function () {
3249
3269
  }, {
3250
3270
  key: "getCompactHosts",
3251
3271
  value: function getCompactHosts(update) {
3252
- var _this77 = this;
3272
+ var _this78 = this;
3253
3273
  if (Connection.isWeb()) {
3254
3274
  return Promise.reject('Allowed only in admin');
3255
3275
  }
@@ -3260,7 +3280,7 @@ var Connection = /*#__PURE__*/function () {
3260
3280
  return Promise.reject(NOT_CONNECTED);
3261
3281
  }
3262
3282
  this._promises.hostsCompact = new Promise(function (resolve, reject) {
3263
- return _this77._socket.emit('getCompactHosts', function (err, hosts) {
3283
+ return _this78._socket.emit('getCompactHosts', function (err, hosts) {
3264
3284
  return err ? reject(err) : resolve(hosts);
3265
3285
  });
3266
3286
  });
@@ -3284,7 +3304,7 @@ var Connection = /*#__PURE__*/function () {
3284
3304
  //@ts-ignore
3285
3305
  .then(function (obj) {
3286
3306
  var _obj$native;
3287
- return obj === null || obj === void 0 ? void 0 : (_obj$native = obj["native"]) === null || _obj$native === void 0 ? void 0 : _obj$native.uuid;
3307
+ return obj === null || obj === void 0 || (_obj$native = obj["native"]) === null || _obj$native === void 0 ? void 0 : _obj$native.uuid;
3288
3308
  });
3289
3309
  return this._promises.uuid;
3290
3310
  }
@@ -3308,12 +3328,12 @@ var Connection = /*#__PURE__*/function () {
3308
3328
  }, {
3309
3329
  key: "logout",
3310
3330
  value: function logout() {
3311
- var _this78 = this;
3331
+ var _this79 = this;
3312
3332
  if (!this.connected) {
3313
3333
  return Promise.reject(NOT_CONNECTED);
3314
3334
  }
3315
3335
  return new Promise(function (resolve, reject) {
3316
- return _this78._socket.emit('logout', function (err) {
3336
+ return _this79._socket.emit('logout', function (err) {
3317
3337
  return err ? reject(err) : resolve(null);
3318
3338
  });
3319
3339
  });