@iobroker/socket-classes 0.5.3 → 1.0.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
@@ -63,12 +63,834 @@ io.start(server.server, ws, {userKey: 'connect.sid', checkUser, store, secret: a
63
63
  io.close();
64
64
  ```
65
65
 
66
+ ## Web Methods
67
+ <!-- WEB_METHODS_START -->
68
+ ### List of commands
69
+ * [authenticate](#authenticate_w)
70
+ * [error](#error_w)
71
+ * [log](#log_w)
72
+ * [getHistory](#gethistory_w)
73
+ * [httpGet](#httpget_w)
74
+ * [sendTo](#sendto_w)
75
+ * [sendToHost](#sendtohost_w)
76
+ * [authEnabled](#authenabled_w)
77
+ * [logout](#logout_w)
78
+ * [listPermissions](#listpermissions_w)
79
+ * [getUserPermissions](#getuserpermissions_w)
80
+ * [getVersion](#getversion_w)
81
+ * [getAdapterName](#getadaptername_w)
82
+ * [getObject](#getobject_w)
83
+ * [getObjects](#getobjects_w)
84
+ * [subscribeObjects](#subscribeobjects_w)
85
+ * [unsubscribeObjects](#unsubscribeobjects_w)
86
+ * [getObjectView](#getobjectview_w)
87
+ * [setObject](#setobject_w)
88
+ * [delObject](#delobject_w)
89
+ * [getStates](#getstates_w)
90
+ * [getState](#getstate_w)
91
+ * [setState](#setstate_w)
92
+ * [getBinaryState](#getbinarystate_w)
93
+ * [setBinaryState](#setbinarystate_w)
94
+ * [subscribe](#subscribe_w)
95
+ * [subscribeStates](#subscribestates_w)
96
+ * [unsubscribe](#unsubscribe_w)
97
+ * [unsubscribeStates](#unsubscribestates_w)
98
+ * [readFile](#readfile_w)
99
+ * [readFile64](#readfile64_w)
100
+ * [writeFile64](#writefile64_w)
101
+ * [writeFile](#writefile_w)
102
+ * [unlink](#unlink_w)
103
+ * [deleteFile](#deletefile_w)
104
+ * [deleteFolder](#deletefolder_w)
105
+ * [renameFile](#renamefile_w)
106
+ * [rename](#rename_w)
107
+ * [mkdir](#mkdir_w)
108
+ * [readDir](#readdir_w)
109
+ * [chmodFile](#chmodfile_w)
110
+ * [chownFile](#chownfile_w)
111
+ * [fileExists](#fileexists_w)
112
+ * [subscribeFiles](#subscribefiles_w)
113
+ * [unsubscribeFiles](#unsubscribefiles_w)
114
+ * [getAdapterInstances](#getadapterinstances_w)
115
+ ### <a name="authenticate_w"></a>authenticate(user, pass, callback)
116
+ Authenticate user by login and password
117
+ * user *(string)*: user name
118
+ * pass *(string)*: password
119
+ * callback *(function)*: `function (isUserAuthenticated, isAuthenticationUsed)`
120
+
121
+ ### <a name="error_w"></a>error(error)
122
+ Write error into ioBroker log
123
+ * error *(string)*: error text
124
+
125
+ ### <a name="log_w"></a>log(text, level)
126
+ Write log entry into ioBroker log
127
+ * text *(string)*: log text
128
+ * level *(string)*: one of `['silly', 'debug', 'info', 'warn', 'error']`. Default is 'debug'.
129
+
130
+ ### <a name="gethistory_w"></a>getHistory(id, options, callback)
131
+ Get history data from specific instance
132
+ * id *(string)*: object ID
133
+ * options *(object)*: See object description here: https://github.com/ioBroker/ioBroker.history/blob/master/docs/en/README.md#access-values-from-javascript-adapter
134
+ * callback *(function)*: `function (error, result)`
135
+
136
+ ### <a name="httpget_w"></a>httpGet(url, callback)
137
+ Read content of HTTP(S) page server-side (without CORS and stuff)
138
+ * url *(string)*: Page URL
139
+ * callback *(function)*: `function (error, {status, statusText}, body)`
140
+
141
+ ### <a name="sendto_w"></a>sendTo(adapterInstance, command, message, callback)
142
+ Send message to specific instance
143
+ * adapterInstance *(string)*: instance name, e.g. `history.0`
144
+ * command *(string)*: command name
145
+ * message *(object)*: message is instance dependent
146
+ * callback *(function)*: `function (result)`
147
+
148
+ ### <a name="sendtohost_w"></a>sendToHost(host, command, message, callback)
149
+ Send message to specific host.
150
+ Host can answer following commands: `cmdExec, getRepository, getInstalled, getInstalledAdapter, getVersion, getDiagData, getLocationOnDisk, getDevList, getLogs, getHostInfo, delLogs, readDirAsZip, writeDirAsZip, readObjectsAsZip, writeObjectsAsZip, checkLogging, updateMultihost`.
151
+ * host *(string)*: instance name, e.g. `history.0`
152
+ * command *(string)*: command name
153
+ * message *(object)*: message is command specific
154
+ * callback *(function)*: `function (result)`
155
+
156
+ ### <a name="authenabled_w"></a>authEnabled(callback)
157
+ Ask server is authentication enabled and if the user authenticated
158
+ * callback *(function)*: `function (isAuthenticationUsed, userName)`
159
+
160
+ ### <a name="logout_w"></a>logout(callback)
161
+ Logout user
162
+ * callback *(function)*: function (error)
163
+
164
+ ### <a name="listpermissions_w"></a>listPermissions(callback)
165
+ List commands and permissions
166
+ * callback *(function)*: `function (permissions)`
167
+
168
+ ### <a name="getuserpermissions_w"></a>getUserPermissions(callback)
169
+ Get user permissions
170
+ * callback *(function)*: `function (error, permissions)`
171
+
172
+ ### <a name="getversion_w"></a>getVersion(callback)
173
+ Get adapter version. Not the socket-classes version!
174
+ * callback *(function)*: `function (error, adapterVersion, adapterName)`
175
+
176
+ ### <a name="getadaptername_w"></a>getAdapterName(callback)
177
+ Get adapter name. Not the socket-classes version!
178
+ * callback *(function)*: `function (error, adapterVersion)`
179
+
180
+ ### <a name="getobject_w"></a>getObject(id, callback)
181
+ Get one object
182
+ * id *(string)*: object ID.
183
+ * callback *(function)*: `function (error, obj)`
184
+
185
+ ### <a name="getobjects_w"></a>getObjects(callback)
186
+ Get all objects that are relevant for web: all states and enums with rooms
187
+ * id *(string)*: object ID.
188
+ * callback *(function)*: `function (error, obj)`
189
+
190
+ ### <a name="subscribeobjects_w"></a>subscribeObjects(pattern, callback)
191
+ Subscribe on object changes by pattern. The events will come as 'objectChange' events to the socket.
192
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of IDs like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
193
+ * callback *(function)*: `function (error)`
194
+
195
+ ### <a name="unsubscribeobjects_w"></a>unsubscribeObjects(pattern, callback)
196
+ Unsubscribe on object changes by pattern.
197
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of IDs like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
198
+ * callback *(function)*: `function (error)`
199
+
200
+ ### <a name="getobjectview_w"></a>getObjectView(design, search, params, callback)
201
+ Make a query to the object database.
202
+ * design *(string)*: 'system' or other designs like `custom`, but it must exist object `_design/custom`. Too 99,9% use `system`.
203
+ * search *(string)*: object type, like `state`, `instance`, `adapter`, `host`, ...
204
+ * params *(string)*: parameters for the query in form `{startkey: 'system.adapter.', endkey: 'system.adapter.\u9999'}`
205
+ * callback *(function)*: `function (error)`
206
+
207
+ ### <a name="setobject_w"></a>setObject(id, obj, callback)
208
+ Set object.
209
+ * id *(string)*: object ID
210
+ * obj *(object)*: object itself
211
+ * callback *(function)*: `function (error)`
212
+
213
+ ### <a name="delobject_w"></a>delObject(id, options, callback)
214
+ Delete object. Only deletion of flot objects is allowed
215
+ * id *(string)*: Object ID like, 'flot.0.myChart'
216
+ * options *(string)*: ignored
217
+ * callback *(function)*: `function (error)`
218
+
219
+ ### <a name="getstates_w"></a>getStates(pattern, callback)
220
+ Read states by pattern
221
+ * pattern *(string)*: optional pattern, like `system.adapter.*` or array of state IDs
222
+ * callback *(function)*: `function (error, states)`, where `states` is an object like `{'system.adapter.history.0': {_id: 'system.adapter.history.0', common: {name: 'history', ...}, native: {...}, 'system.adapter.history.1': {...}}}`
223
+
224
+ ### <a name="getstate_w"></a>getState(id, callback)
225
+ Read one state.
226
+ * id *(string)*: State ID like, 'system.adapter.admin.0.memRss'
227
+ * callback *(function)*: `function (error, state)`, where `state` is an object like `{val: 123, ts: 1663915537418, ack: true, from: 'system.adapter.admin.0', q: 0, lc: 1663915537418, c: 'javascript.0'}`
228
+
229
+ ### <a name="setstate_w"></a>setState(id, state, callback)
230
+ Write one state.
231
+ * id *(string)*: State ID like, 'system.adapter.admin.0.memRss'
232
+ * state *(any)*: value or object like `{val: 123, ack: true}`
233
+ * callback *(function)*: `function (error, state)`, where `state` is an object like `{val: 123, ts: 1663915537418, ack: true, from: 'system.adapter.admin.0', q: 0, lc: 1663915537418, c: 'javascript.0'}`
234
+
235
+ ### <a name="getbinarystate_w"></a>getBinaryState(id, callback)
236
+ Read one binary state.
237
+ * id *(string)*: State ID like, 'javascript.0.binary'
238
+ * callback *(function)*: `function (error, base64)`
239
+
240
+ ### <a name="setbinarystate_w"></a>setBinaryState(id, base64, callback)
241
+ Write one binary state.
242
+ * id *(string)*: State ID like, 'javascript.0.binary'
243
+ * base64 *(string)*: State value as base64 string. Binary states has no acknowledge flag.
244
+ * callback *(function)*: `function (error)`
245
+
246
+ ### <a name="subscribe_w"></a>subscribe(pattern, callback)
247
+ Subscribe on state changes by pattern. The events will come as 'stateChange' events to the socket.
248
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
249
+ * callback *(function)*: `function (error)`
250
+
251
+ ### <a name="subscribestates_w"></a>subscribeStates(pattern, callback)
252
+ Subscribe on state changes by pattern. Same as `subscribe`. The events will come as 'stateChange' events to the socket.
253
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
254
+ * callback *(function)*: `function (error)`
255
+
256
+ ### <a name="unsubscribe_w"></a>unsubscribe(pattern, callback)
257
+ Unsubscribe from state changes by pattern.
258
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
259
+ * callback *(function)*: `function (error)`
260
+
261
+ ### <a name="unsubscribestates_w"></a>unsubscribeStates(pattern, callback)
262
+ Unsubscribe from state changes by pattern. Same as `unsubscribe`.
263
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
264
+ * callback *(function)*: `function (error)`
265
+
266
+ ### <a name="readfile_w"></a>readFile(_adapter, fileName, callback)
267
+ Read file from ioBroker DB
268
+ * _adapter *(string)*: instance name, e.g. `vis.0`
269
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
270
+ * callback *(function)*: `function (error, data, mimeType)`
271
+
272
+ ### <a name="readfile64_w"></a>readFile64(_adapter, fileName, callback)
273
+ Read file from ioBroker DB as base64 string
274
+ * _adapter *(string)*: instance name, e.g. `vis.0`
275
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
276
+ * callback *(function)*: `function (error, base64, mimeType)`
277
+
278
+ ### <a name="writefile64_w"></a>writeFile64(_adapter, fileName, data64, options, callback)
279
+ Write file into ioBroker DB as base64 string
280
+ * _adapter *(string)*: instance name, e.g. `vis.0`
281
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
282
+ * data64 *(string)*: file content as base64 string
283
+ * options *(object)*: optional `{mode: 0x0644}`
284
+ * callback *(function)*: `function (error)`
285
+
286
+ ### <a name="writefile_w"></a>writeFile(_adapter, fileName, data, options, callback)
287
+ Write file into ioBroker DB as text **DEPRECATED**
288
+ * _adapter *(string)*: instance name, e.g. `vis.0`
289
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
290
+ * data64 *(string)*: file content as base64 string
291
+ * options *(object)*: optional `{mode: 0x644}`
292
+ * callback *(function)*: `function (error)`
293
+
294
+ ### <a name="unlink_w"></a>unlink(_adapter, name, callback)
295
+ Delete file in ioBroker DB
296
+ * _adapter *(string)*: instance name, e.g. `vis.0`
297
+ * name *(string)*: file name, e.g `main/vis-views.json`
298
+ * callback *(function)*: `function (error)`
299
+
300
+ ### <a name="deletefile_w"></a>deleteFile(_adapter, name, callback)
301
+ Delete file in ioBroker DB (same as unlink, but only for files)
302
+ * _adapter *(string)*: instance name, e.g. `vis.0`
303
+ * name *(string)*: file name, e.g `main/vis-views.json`
304
+ * callback *(function)*: `function (error)`
305
+
306
+ ### <a name="deletefolder_w"></a>deleteFolder(_adapter, name, callback)
307
+ Delete file in ioBroker DB (same as unlink, but only for folders)
308
+ * _adapter *(string)*: instance name, e.g. `vis.0`
309
+ * name *(string)*: folder name, e.g `main`
310
+ * callback *(function)*: `function (error)`
311
+
312
+ ### <a name="renamefile_w"></a>renameFile(_adapter, oldName, newName, callback)
313
+ Rename file in ioBroker DB
314
+ * _adapter *(string)*: instance name, e.g. `vis.0`
315
+ * oldName *(string)*: current file name, e.g `main/vis-views.json`
316
+ * newName *(string)*: new file name, e.g `main/vis-views-new.json`
317
+ * callback *(function)*: `function (error)`
318
+
319
+ ### <a name="rename_w"></a>rename(_adapter, oldName, newName, callback)
320
+ Rename file or folder in ioBroker DB
321
+ * _adapter *(string)*: instance name, e.g. `vis.0`
322
+ * oldName *(string)*: current file name, e.g `main/vis-views.json`
323
+ * newName *(string)*: new file name, e.g `main/vis-views-new.json`
324
+ * callback *(function)*: `function (error)`
325
+
326
+ ### <a name="mkdir_w"></a>mkdir(_adapter, dirName, callback)
327
+ Create folder in ioBroker DB
328
+ * _adapter *(string)*: instance name, e.g. `vis.0`
329
+ * dirName *(string)*: desired folder name, e.g `main`
330
+ * callback *(function)*: `function (error)`
331
+
332
+ ### <a name="readdir_w"></a>readDir(_adapter, dirName, options, callback)
333
+ Read content of folder in ioBroker DB
334
+ * _adapter *(string)*: instance name, e.g. `vis.0`
335
+ * dirName *(string)*: folder name, e.g `main`
336
+ * options *(object)*: optional `{filter: '*'}` or `{filter: '*.json'}`
337
+ * callback *(function)*: `function (error, files)` where `files` is an array of objects, like `{file: 'vis-views.json', isDir: false, stats: {size: 123}, modifiedAt: 1661336290090, acl: {owner: 'system.user.admin', ownerGroup: 'system.group.administrator', permissions: 1632, read: true, write: true}`
338
+
339
+ ### <a name="chmodfile_w"></a>chmodFile(_adapter, fileName, options, callback)
340
+ Change file mode in ioBroker DB
341
+ * _adapter *(string)*: instance name, e.g. `vis.0`
342
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
343
+ * options *(object)*: `{mode: 0x644}` or 0x644. First digit is user, second group, third others. Bit 1 is `execute`, bit 2 is `write`, bit 3 is `read`
344
+ * callback *(function)*: `function (error)`
345
+
346
+ ### <a name="chownfile_w"></a>chownFile(_adapter, fileName, options, callback)
347
+ Change file owner in ioBroker DB
348
+ * _adapter *(string)*: instance name, e.g. `vis.0`
349
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
350
+ * options *(object)*: `{owner: 'system.user.user', ownerGroup: ''system.group.administrator'}` or 'system.user.user'. If ownerGroup is not defined, it will be taken from owner.
351
+ * callback *(function)*: `function (error)`
352
+
353
+ ### <a name="fileexists_w"></a>fileExists(_adapter, fileName, callback)
354
+ Checks if the file or folder exists in ioBroker DB
355
+ * _adapter *(string)*: instance name, e.g. `vis.0`
356
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
357
+ * callback *(function)*: `function (error, isExist)`
358
+
359
+ ### <a name="subscribefiles_w"></a>subscribeFiles(id, pattern, callback)
360
+ Subscribe on file changes in ioBroker DB
361
+ * id *(string)*: instance name, e.g. `vis.0` or any object ID of type `meta`. `id` could have wildcards `*` too.
362
+ * pattern *(string)*: file name pattern, e.g `main/*.json`
363
+ * callback *(function)*: `function (error)`
364
+
365
+ ### <a name="unsubscribefiles_w"></a>unsubscribeFiles(id, pattern, callback)
366
+ Unsubscribe on file changes in ioBroker DB
367
+ * id *(string)*: instance name, e.g. `vis.0` or any object ID of type `meta`. `id` could have wildcards `*` too.
368
+ * pattern *(string)*: file name pattern, e.g `main/*.json`
369
+ * callback *(function)*: `function (error)`
370
+
371
+ ### <a name="getadapterinstances_w"></a>getAdapterInstances(adapterName, callback)
372
+ Read all instances of the given adapter, or all instances of all adapters if adapterName is not defined
373
+ * adapterName *(string)*: optional adapter name, e.g `history`.
374
+ * callback *(function)*: `function (error, instanceList)`, where instanceList is an array of instance objects, e.g. `{_id: 'system.adapter.history.0', common: {name: 'history', ...}, native: {...}}`
375
+
376
+ <!-- WEB_METHODS_END -->
377
+
378
+ ## Admin Methods
379
+ <!-- ADMIN_METHODS_START -->
380
+ ### List of commands
381
+ * [authenticate](#authenticate_a)
382
+ * [error](#error_a)
383
+ * [log](#log_a)
384
+ * [getHistory](#gethistory_a)
385
+ * [httpGet](#httpget_a)
386
+ * [sendTo](#sendto_a)
387
+ * [sendToHost](#sendtohost_a)
388
+ * [authEnabled](#authenabled_a)
389
+ * [logout](#logout_a)
390
+ * [listPermissions](#listpermissions_a)
391
+ * [getUserPermissions](#getuserpermissions_a)
392
+ * [getVersion](#getversion_a)
393
+ * [getAdapterName](#getadaptername_a)
394
+ * [getHostByIp](#gethostbyip_a)
395
+ * [requireLog](#requirelog_a)
396
+ * [readLogs](#readlogs_a)
397
+ * [delState](#delstate_a)
398
+ * [cmdExec](#cmdexec_a)
399
+ * [eventsThreshold](#eventsthreshold_a)
400
+ * [getRatings](#getratings_a)
401
+ * [getCurrentInstance](#getcurrentinstance_a)
402
+ * [checkFeatureSupported](#checkfeaturesupported_a)
403
+ * [decrypt](#decrypt_a)
404
+ * [encrypt](#encrypt_a)
405
+ * [getIsEasyModeStrict](#getiseasymodestrict_a)
406
+ * [getEasyMode](#geteasymode_a)
407
+ * [getAdapters](#getadapters_a)
408
+ * [updateLicenses](#updatelicenses_a)
409
+ * [getCompactInstances](#getcompactinstances_a)
410
+ * [getCompactAdapters](#getcompactadapters_a)
411
+ * [getCompactInstalled](#getcompactinstalled_a)
412
+ * [getCompactSystemConfig](#getcompactsystemconfig_a)
413
+ * [getCompactSystemRepositories](#getcompactsystemrepositories_a)
414
+ * [getCompactRepository](#getcompactrepository_a)
415
+ * [getCompactHosts](#getcompacthosts_a)
416
+ * [addUser](#adduser_a)
417
+ * [delUser](#deluser_a)
418
+ * [addGroup](#addgroup_a)
419
+ * [delGroup](#delgroup_a)
420
+ * [changePassword](#changepassword_a)
421
+ * [getObject](#getobject_a)
422
+ * [getObjects](#getobjects_a)
423
+ * [subscribeObjects](#subscribeobjects_a)
424
+ * [unsubscribeObjects](#unsubscribeobjects_a)
425
+ * [getObjectView](#getobjectview_a)
426
+ * [setObject](#setobject_a)
427
+ * [delObject](#delobject_a)
428
+ * [getAllObjects](#getallobjects_a)
429
+ * [extendObject](#extendobject_a)
430
+ * [getForeignObjects](#getforeignobjects_a)
431
+ * [delObjects](#delobjects_a)
432
+ * [getStates](#getstates_a)
433
+ * [getState](#getstate_a)
434
+ * [setState](#setstate_a)
435
+ * [getBinaryState](#getbinarystate_a)
436
+ * [setBinaryState](#setbinarystate_a)
437
+ * [subscribe](#subscribe_a)
438
+ * [subscribeStates](#subscribestates_a)
439
+ * [unsubscribe](#unsubscribe_a)
440
+ * [unsubscribeStates](#unsubscribestates_a)
441
+ * [getForeignStates](#getforeignstates_a)
442
+ * [readFile](#readfile_a)
443
+ * [readFile64](#readfile64_a)
444
+ * [writeFile64](#writefile64_a)
445
+ * [writeFile](#writefile_a)
446
+ * [unlink](#unlink_a)
447
+ * [deleteFile](#deletefile_a)
448
+ * [deleteFolder](#deletefolder_a)
449
+ * [renameFile](#renamefile_a)
450
+ * [rename](#rename_a)
451
+ * [mkdir](#mkdir_a)
452
+ * [readDir](#readdir_a)
453
+ * [chmodFile](#chmodfile_a)
454
+ * [chownFile](#chownfile_a)
455
+ * [fileExists](#fileexists_a)
456
+ * [subscribeFiles](#subscribefiles_a)
457
+ * [unsubscribeFiles](#unsubscribefiles_a)
458
+ * [getAdapterInstances](#getadapterinstances_a)
459
+ ### <a name="authenticate_a"></a>authenticate(user, pass, callback)
460
+ Authenticate user by login and password
461
+ * user *(string)*: user name
462
+ * pass *(string)*: password
463
+ * callback *(function)*: `function (isUserAuthenticated, isAuthenticationUsed)`
464
+
465
+ ### <a name="error_a"></a>error(error)
466
+ Write error into ioBroker log
467
+ * error *(string)*: error text
468
+
469
+ ### <a name="log_a"></a>log(text, level)
470
+ Write log entry into ioBroker log
471
+ * text *(string)*: log text
472
+ * level *(string)*: one of `['silly', 'debug', 'info', 'warn', 'error']`. Default is 'debug'.
473
+
474
+ ### <a name="gethistory_a"></a>getHistory(id, options, callback)
475
+ Get history data from specific instance
476
+ * id *(string)*: object ID
477
+ * options *(object)*: See object description here: https://github.com/ioBroker/ioBroker.history/blob/master/docs/en/README.md#access-values-from-javascript-adapter
478
+ * callback *(function)*: `function (error, result)`
479
+
480
+ ### <a name="httpget_a"></a>httpGet(url, callback)
481
+ Read content of HTTP(S) page server-side (without CORS and stuff)
482
+ * url *(string)*: Page URL
483
+ * callback *(function)*: `function (error, {status, statusText}, body)`
484
+
485
+ ### <a name="sendto_a"></a>sendTo(adapterInstance, command, message, callback)
486
+ Send message to specific instance
487
+ * adapterInstance *(string)*: instance name, e.g. `history.0`
488
+ * command *(string)*: command name
489
+ * message *(object)*: message is instance dependent
490
+ * callback *(function)*: `function (result)`
491
+
492
+ ### <a name="sendtohost_a"></a>sendToHost(host, command, message, callback)
493
+ Send message to specific host.
494
+ Host can answer following commands: `cmdExec, getRepository, getInstalled, getInstalledAdapter, getVersion, getDiagData, getLocationOnDisk, getDevList, getLogs, getHostInfo, delLogs, readDirAsZip, writeDirAsZip, readObjectsAsZip, writeObjectsAsZip, checkLogging, updateMultihost`.
495
+ * host *(string)*: instance name, e.g. `history.0`
496
+ * command *(string)*: command name
497
+ * message *(object)*: message is command specific
498
+ * callback *(function)*: `function (result)`
499
+
500
+ ### <a name="authenabled_a"></a>authEnabled(callback)
501
+ Ask server is authentication enabled and if the user authenticated
502
+ * callback *(function)*: `function (isAuthenticationUsed, userName)`
503
+
504
+ ### <a name="logout_a"></a>logout(callback)
505
+ Logout user
506
+ * callback *(function)*: function (error)
507
+
508
+ ### <a name="listpermissions_a"></a>listPermissions(callback)
509
+ List commands and permissions
510
+ * callback *(function)*: `function (permissions)`
511
+
512
+ ### <a name="getuserpermissions_a"></a>getUserPermissions(callback)
513
+ Get user permissions
514
+ * callback *(function)*: `function (error, permissions)`
515
+
516
+ ### <a name="getversion_a"></a>getVersion(callback)
517
+ Get adapter version. Not the socket-classes version!
518
+ * callback *(function)*: `function (error, adapterVersion, adapterName)`
519
+
520
+ ### <a name="getadaptername_a"></a>getAdapterName(callback)
521
+ Get adapter name. Not the socket-classes version!
522
+ * callback *(function)*: `function (error, adapterVersion)`
523
+
524
+ ### <a name="gethostbyip_a"></a>getHostByIp(ip, callback)
525
+ Read host object by IP address
526
+ * ip *(string)*: ip address. IPv4 or IPv6
527
+ * callback *(function)*: `function (ip, obj)`. If host not found, obj is null
528
+
529
+ ### <a name="requirelog_a"></a>requireLog(isEnabled, callback)
530
+ Activate or deactivate logging events. Events will be sent to the socket as `log` event. Adapter must have `common.logTransporter = true`
531
+ * isEnabled *(boolean)*: is logging enabled
532
+ * callback *(function)*: `function (error)`
533
+
534
+ ### <a name="readlogs_a"></a>readLogs(host, callback)
535
+ Get logs file from given host
536
+ * host *(string)*: host id, like 'system.host.raspberrypi'
537
+ * callback *(function)*: `function (error, files)`, where `files` is array of `{fileName: `log/hostname/transport/file`, size: 123}`
538
+
539
+ ### <a name="delstate_a"></a>delState(id, callback)
540
+ Delete state. Corresponding object will be deleted too.
541
+ * id *(string)*: state ID
542
+ * callback *(function)*: `function (error)`
543
+
544
+ ### <a name="cmdexec_a"></a>cmdExec(host, id, cmd, callback)
545
+ Execute shell command on host/controller. Following response commands are expected: ´cmdStdout, cmdStderr, cmdExit´
546
+ * host *(string)*: host name, like 'system.host.raspberrypi'
547
+ * id *(string)*: session ID, like `Date.now()´. This session ID will come in events `cmdStdout, cmdStderr, cmdExit`
548
+ * cmd *(string)*: command
549
+ * callback *(function)*: `function (error)`
550
+
551
+ ### <a name="eventsthreshold_a"></a>eventsThreshold(isActive)
552
+ Used only for admin to limit number of events to front-end.
553
+ * isActive *(boolean)*: if true, then events will be limited
554
+
555
+ ### <a name="getratings_a"></a>getRatings(update, callback)
556
+ Read ratings of adapters
557
+ * update *(boolean)*: if true, the ratings will be read from central server, if false from local cache
558
+ * callback *(function)*: `function (error, ratings)`, where `ratings` is object like `{accuweather: {rating: {r: 3.33, c: 3}, 1.2.1: {r: 3, c: 1}},…}`
559
+
560
+ ### <a name="getcurrentinstance_a"></a>getCurrentInstance(callback)
561
+ Return current instance name like `admin.0`
562
+ * callback *(function)*: `function (error, namespace)`
563
+
564
+ ### <a name="checkfeaturesupported_a"></a>checkFeatureSupported(feature, callback)
565
+ Checks if same feature is supported by current js-controller
566
+ * feature *(string)*: feature name like `CONTROLLER_LICENSE_MANAGER`
567
+ * callback *(function)*: `function (error, isSupported)`
568
+
569
+ ### <a name="decrypt_a"></a>decrypt(encryptedText, callback)
570
+ Decrypts text with system secret key
571
+ * encryptedText *(string)*: encrypted text
572
+ * callback *(function)*: `function (error, decryptedText)`
573
+
574
+ ### <a name="encrypt_a"></a>encrypt(plainText, callback)
575
+ Encrypts text with system secret key
576
+ * plainText *(string)*: normal text
577
+ * callback *(function)*: `function (error, encryptedText)`
578
+
579
+ ### <a name="getiseasymodestrict_a"></a>getIsEasyModeStrict(callback)
580
+ Returns if admin has easy mode enabled
581
+ * callback *(function)*: `function (error, isEasyModeStrict)`
582
+
583
+ ### <a name="geteasymode_a"></a>getEasyMode(callback)
584
+ Get easy mode configuration
585
+ * callback *(function)*: `function (error, easyModeConfig)`, where `easyModeConfig` is object like `{strict: true, configs: [{_id: 'system.adapter.javascript.0', common: {...}}, {...}]}`
586
+
587
+ ### <a name="getadapters_a"></a>getAdapters(adapterName, callback)
588
+ Read all adapters objects
589
+ * adapterName *(string)*: optional adapter name
590
+ * callback *(function)*: `function (error, results)`, where `results` is array of objects like `{_id: 'system.adapter.javascript', common: {...}}`
591
+
592
+ ### <a name="updatelicenses_a"></a>updateLicenses(login, password, callback)
593
+ Read software licenses (vis, knx, ...) from ioBroker.net cloud for given user
594
+ * login *(string)*: cloud login
595
+ * password *(string)*: cloud password
596
+ * callback *(function)*: `function (error, results)`, where `results` is array of objects like `[{"json":"xxx","id":"ab","email":"dogafox@gmail.com","product":"iobroker.knx.year","version":"2","invoice":"Pxx","uuid":"uuid","time":"2021-11-16T19:53:02.000Z","validTill":"2022-11-16T22:59:59.000Z","datapoints":1000}]`
597
+
598
+ ### <a name="getcompactinstances_a"></a>getCompactInstances(callback)
599
+ Read all instances in short form to save bandwidth
600
+ * callback *(function)*: `function (error, results)`, where `results` is an object like `{'system.adapter.javascript.0': {adminTab, name, icon, enabled}}`
601
+
602
+ ### <a name="getcompactadapters_a"></a>getCompactAdapters(callback)
603
+ Read all adapters in short for to save bandwidth
604
+ * callback *(function)*: `function (error, results)`, where `results` is an object like `{'javascript': {icon, v: '1.0.1', iv: 'ignoredVersion}}`
605
+
606
+ ### <a name="getcompactinstalled_a"></a>getCompactInstalled(host, callback)
607
+ Read all installed adapters in short form to save bandwidth
608
+ * callback *(function)*: `function (error, results)`, where `results` is an object like `{'javascript': {version: '1.0.1'}}``
609
+
610
+ ### <a name="getcompactsystemconfig_a"></a>getCompactSystemConfig(callback)
611
+ Read system config in short form to save bandwidth
612
+ * callback *(function)*: `function (error, systemConfig)`, where `systemConfig` is an object like `{common: {...}, native: {secret: 'aaa'}}`
613
+
614
+ ### <a name="getcompactsystemrepositories_a"></a>getCompactSystemRepositories(callback)
615
+ Read repositories from cache in short form to save bandwidth
616
+ * callback *(function)*: `function (error, repositories)`, where `repositories` is an object like `{_id: 'system.repositories', common: {...}, native: {repositories: {default: {json: {_repoInfo: {...}}}}}}`
617
+
618
+ ### <a name="getcompactrepository_a"></a>getCompactRepository(host, callback)
619
+ Read current repository in short form to save bandwidth
620
+ * callback *(function)*: `function (error, repository)`, where `repository` is an object like `{'javascript': {version: '1.0.1', icon}, 'admin': {version: '1.0.1', icon}}`
621
+
622
+ ### <a name="getcompacthosts_a"></a>getCompactHosts(callback)
623
+ Read all hosts in short form to save bandwidth
624
+ * callback *(function)*: `function (error, hosts)`, where `hosts` is an array of objects like `[{_id:'system.host.raspi',common:{name:'raspi',icon:'icon',color:'blue',installedVersion:'2.1.0'},native:{hardware:{networkInterfaces:[...]}}}]`
625
+
626
+ ### <a name="adduser_a"></a>addUser(user, pass, callback)
627
+ Add new user
628
+ * user *(string)*: user name, like `benjamin`
629
+ * pass *(string)*: user password
630
+ * callback *(function)*: `function (error)`
631
+
632
+ ### <a name="deluser_a"></a>delUser(user, callback)
633
+ Delete existing user. Admin cannot be deleted.
634
+ * user *(string)*: user name, like 'benjamin
635
+ * callback *(function)*: `function (error)`
636
+
637
+ ### <a name="addgroup_a"></a>addGroup(group, desc, acl, callback)
638
+ Add new group.
639
+ * group *(string)*: user name, like 'benjamin
640
+ * desc *(string)*: optional description
641
+ * acl *(object)*: optional access control list object, like `{"object":{"list":true,"read":true,"write":false,"delete":false},"state":{"list":true,"read":true,"write":true,"create":true,"delete":false},"users":{"list":true,"read":true,"write":false,"create":false,"delete":false},"other":{"execute":false,"http":true,"sendto":false},"file":{"list":true,"read":true,"write":false,"create":false,"delete":false}}`
642
+ * callback *(function)*: `function (error)`
643
+
644
+ ### <a name="delgroup_a"></a>delGroup(group, callback)
645
+ Delete existing group. Administrator group cannot be deleted.
646
+ * group *(string)*: group name, like 'users`
647
+ * callback *(function)*: `function (error)`
648
+
649
+ ### <a name="changepassword_a"></a>changePassword(user, pass, callback)
650
+ Change user password
651
+ * user *(string)*: user name, like 'benjamin`
652
+ * pass *(string)*: new password
653
+ * callback *(function)*: `function (error)`
654
+
655
+ ### <a name="getobject_a"></a>getObject(id, callback)
656
+ Get one object
657
+ * id *(string)*: object ID.
658
+ * callback *(function)*: `function (error, obj)`
659
+
660
+ ### <a name="getobjects_a"></a>getObjects(callback)
661
+ Read absolutely all objects. Same as `getAllObjects`.
662
+ * callback *(function)*: `function (error, objects)`, where `objects` is an object like `{'system.adapter.admin.0': {...}, 'system.adapter.web.0': {...}}`
663
+
664
+ ### <a name="subscribeobjects_a"></a>subscribeObjects(pattern, callback)
665
+ Subscribe on object changes by pattern. The events will come as 'objectChange' events to the socket.
666
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of IDs like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
667
+ * callback *(function)*: `function (error)`
668
+
669
+ ### <a name="unsubscribeobjects_a"></a>unsubscribeObjects(pattern, callback)
670
+ Unsubscribe on object changes by pattern.
671
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of IDs like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
672
+ * callback *(function)*: `function (error)`
673
+
674
+ ### <a name="getobjectview_a"></a>getObjectView(design, search, params, callback)
675
+ Make a query to the object database.
676
+ * design *(string)*: 'system' or other designs like `custom`, but it must exist object `_design/custom`. Too 99,9% use `system`.
677
+ * search *(string)*: object type, like `state`, `instance`, `adapter`, `host`, ...
678
+ * params *(string)*: parameters for the query in form `{startkey: 'system.adapter.', endkey: 'system.adapter.\u9999'}`
679
+ * callback *(function)*: `function (error)`
680
+
681
+ ### <a name="setobject_a"></a>setObject(id, obj, callback)
682
+ Set object.
683
+ * id *(string)*: object ID
684
+ * obj *(object)*: object itself
685
+ * callback *(function)*: `function (error)`
686
+
687
+ ### <a name="delobject_a"></a>delObject(id, options, callback)
688
+ Delete object or objects recursively. Objects with `dontDelete` cannot be deleted.
689
+ * id *(string)*: Object ID like, 'adapterName.0.channel'
690
+ * options *(string)*: `{recursive: true}`
691
+ * callback *(function)*: `function (error)`
692
+
693
+ ### <a name="getallobjects_a"></a>getAllObjects(callback)
694
+ Read absolutely all objects
695
+ * callback *(function)*: `function (error, objects)`, where `objects` is an object like `{'system.adapter.admin.0': {...}, 'system.adapter.web.0': {...}}`
696
+
697
+ ### <a name="extendobject_a"></a>extendObject(id, obj, callback)
698
+ Extend existing object
699
+ * id *(string)*: object ID
700
+ * obj *(object)*: new parts of the object, like `{common: {name: 'new name'}}`
701
+ * callback *(function)*: `function (error)`
702
+
703
+ ### <a name="getforeignobjects_a"></a>getForeignObjects(pattern, type, callback)
704
+ Read objects by pattern
705
+ * pattern *(string)*: pattern like `system.adapter.admin.0.*`
706
+ * type *(string)*: type of objects to delete, like `state`, `channel`, `device`, `host`, `adapter`. Default - `state`
707
+ * callback *(function)*: `function (error, objects)`, where `objects` is an object like `{'system.adapter.admin.0': {...}, 'system.adapter.web.0': {...}}`
708
+
709
+ ### <a name="delobjects_a"></a>delObjects(id, options, callback)
710
+ Delete objects recursively. Objects with `dontDelete` cannot be deleted. Same as `delObject` but with `recursive: true`.
711
+ * id *(string)*: Object ID like, 'adapterName.0.channel'
712
+ * options *(string)*: optional
713
+ * callback *(function)*: `function (error)`
714
+
715
+ ### <a name="getstates_a"></a>getStates(pattern, callback)
716
+ Read states by pattern
717
+ * pattern *(string)*: optional pattern, like `system.adapter.*` or array of state IDs
718
+ * callback *(function)*: `function (error, states)`, where `states` is an object like `{'system.adapter.history.0': {_id: 'system.adapter.history.0', common: {name: 'history', ...}, native: {...}, 'system.adapter.history.1': {...}}}`
719
+
720
+ ### <a name="getstate_a"></a>getState(id, callback)
721
+ Read one state.
722
+ * id *(string)*: State ID like, 'system.adapter.admin.0.memRss'
723
+ * callback *(function)*: `function (error, state)`, where `state` is an object like `{val: 123, ts: 1663915537418, ack: true, from: 'system.adapter.admin.0', q: 0, lc: 1663915537418, c: 'javascript.0'}`
724
+
725
+ ### <a name="setstate_a"></a>setState(id, state, callback)
726
+ Write one state.
727
+ * id *(string)*: State ID like, 'system.adapter.admin.0.memRss'
728
+ * state *(any)*: value or object like `{val: 123, ack: true}`
729
+ * callback *(function)*: `function (error, state)`, where `state` is an object like `{val: 123, ts: 1663915537418, ack: true, from: 'system.adapter.admin.0', q: 0, lc: 1663915537418, c: 'javascript.0'}`
730
+
731
+ ### <a name="getbinarystate_a"></a>getBinaryState(id, callback)
732
+ Read one binary state.
733
+ * id *(string)*: State ID like, 'javascript.0.binary'
734
+ * callback *(function)*: `function (error, base64)`
735
+
736
+ ### <a name="setbinarystate_a"></a>setBinaryState(id, base64, callback)
737
+ Write one binary state.
738
+ * id *(string)*: State ID like, 'javascript.0.binary'
739
+ * base64 *(string)*: State value as base64 string. Binary states has no acknowledge flag.
740
+ * callback *(function)*: `function (error)`
741
+
742
+ ### <a name="subscribe_a"></a>subscribe(pattern, callback)
743
+ Subscribe on state changes by pattern. The events will come as 'stateChange' events to the socket.
744
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
745
+ * callback *(function)*: `function (error)`
746
+
747
+ ### <a name="subscribestates_a"></a>subscribeStates(pattern, callback)
748
+ Subscribe on state changes by pattern. Same as `subscribe`. The events will come as 'stateChange' events to the socket.
749
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
750
+ * callback *(function)*: `function (error)`
751
+
752
+ ### <a name="unsubscribe_a"></a>unsubscribe(pattern, callback)
753
+ Unsubscribe from state changes by pattern.
754
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
755
+ * callback *(function)*: `function (error)`
756
+
757
+ ### <a name="unsubscribestates_a"></a>unsubscribeStates(pattern, callback)
758
+ Unsubscribe from state changes by pattern. Same as `unsubscribe`.
759
+ * pattern *(string)*: pattern like 'system.adapter.*' or array of states like ['system.adapter.admin.0.memRss', 'system.adapter.admin.0.memHeapTotal']
760
+ * callback *(function)*: `function (error)`
761
+
762
+ ### <a name="getforeignstates_a"></a>getForeignStates(pattern, callback)
763
+ Read all states (which might not belong to this adapter) which match the given pattern
764
+ * pattern *(string)*: pattern like
765
+ * callback *(function)*: `function (error)`
766
+
767
+ ### <a name="readfile_a"></a>readFile(_adapter, fileName, callback)
768
+ Read file from ioBroker DB
769
+ * _adapter *(string)*: instance name, e.g. `vis.0`
770
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
771
+ * callback *(function)*: `function (error, data, mimeType)`
772
+
773
+ ### <a name="readfile64_a"></a>readFile64(_adapter, fileName, callback)
774
+ Read file from ioBroker DB as base64 string
775
+ * _adapter *(string)*: instance name, e.g. `vis.0`
776
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
777
+ * callback *(function)*: `function (error, base64, mimeType)`
778
+
779
+ ### <a name="writefile64_a"></a>writeFile64(_adapter, fileName, data64, options, callback)
780
+ Write file into ioBroker DB as base64 string
781
+ * _adapter *(string)*: instance name, e.g. `vis.0`
782
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
783
+ * data64 *(string)*: file content as base64 string
784
+ * options *(object)*: optional `{mode: 0x0644}`
785
+ * callback *(function)*: `function (error)`
786
+
787
+ ### <a name="writefile_a"></a>writeFile(_adapter, fileName, data64, options, callback)
788
+ Write file into ioBroker DB as base64 string
789
+ * _adapter *(string)*: instance name, e.g. `vis.0`
790
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
791
+ * data64 *(string)*: file content as base64 string
792
+ * options *(object)*: optional `{mode: 0x0644}`
793
+ * callback *(function)*: `function (error)`
794
+
795
+ ### <a name="unlink_a"></a>unlink(_adapter, name, callback)
796
+ Delete file in ioBroker DB
797
+ * _adapter *(string)*: instance name, e.g. `vis.0`
798
+ * name *(string)*: file name, e.g `main/vis-views.json`
799
+ * callback *(function)*: `function (error)`
800
+
801
+ ### <a name="deletefile_a"></a>deleteFile(_adapter, name, callback)
802
+ Delete file in ioBroker DB (same as unlink, but only for files)
803
+ * _adapter *(string)*: instance name, e.g. `vis.0`
804
+ * name *(string)*: file name, e.g `main/vis-views.json`
805
+ * callback *(function)*: `function (error)`
806
+
807
+ ### <a name="deletefolder_a"></a>deleteFolder(_adapter, name, callback)
808
+ Delete file in ioBroker DB (same as unlink, but only for folders)
809
+ * _adapter *(string)*: instance name, e.g. `vis.0`
810
+ * name *(string)*: folder name, e.g `main`
811
+ * callback *(function)*: `function (error)`
812
+
813
+ ### <a name="renamefile_a"></a>renameFile(_adapter, oldName, newName, callback)
814
+ Rename file in ioBroker DB
815
+ * _adapter *(string)*: instance name, e.g. `vis.0`
816
+ * oldName *(string)*: current file name, e.g `main/vis-views.json`
817
+ * newName *(string)*: new file name, e.g `main/vis-views-new.json`
818
+ * callback *(function)*: `function (error)`
819
+
820
+ ### <a name="rename_a"></a>rename(_adapter, oldName, newName, callback)
821
+ Rename file or folder in ioBroker DB
822
+ * _adapter *(string)*: instance name, e.g. `vis.0`
823
+ * oldName *(string)*: current file name, e.g `main/vis-views.json`
824
+ * newName *(string)*: new file name, e.g `main/vis-views-new.json`
825
+ * callback *(function)*: `function (error)`
826
+
827
+ ### <a name="mkdir_a"></a>mkdir(_adapter, dirName, callback)
828
+ Create folder in ioBroker DB
829
+ * _adapter *(string)*: instance name, e.g. `vis.0`
830
+ * dirName *(string)*: desired folder name, e.g `main`
831
+ * callback *(function)*: `function (error)`
832
+
833
+ ### <a name="readdir_a"></a>readDir(_adapter, dirName, options, callback)
834
+ Read content of folder in ioBroker DB
835
+ * _adapter *(string)*: instance name, e.g. `vis.0`
836
+ * dirName *(string)*: folder name, e.g `main`
837
+ * options *(object)*: optional `{filter: '*'}` or `{filter: '*.json'}`
838
+ * callback *(function)*: `function (error, files)` where `files` is an array of objects, like `{file: 'vis-views.json', isDir: false, stats: {size: 123}, modifiedAt: 1661336290090, acl: {owner: 'system.user.admin', ownerGroup: 'system.group.administrator', permissions: 1632, read: true, write: true}`
839
+
840
+ ### <a name="chmodfile_a"></a>chmodFile(_adapter, fileName, options, callback)
841
+ Change file mode in ioBroker DB
842
+ * _adapter *(string)*: instance name, e.g. `vis.0`
843
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
844
+ * options *(object)*: `{mode: 0x644}` or 0x644. First digit is user, second group, third others. Bit 1 is `execute`, bit 2 is `write`, bit 3 is `read`
845
+ * callback *(function)*: `function (error)`
846
+
847
+ ### <a name="chownfile_a"></a>chownFile(_adapter, fileName, options, callback)
848
+ Change file owner in ioBroker DB
849
+ * _adapter *(string)*: instance name, e.g. `vis.0`
850
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
851
+ * options *(object)*: `{owner: 'system.user.user', ownerGroup: ''system.group.administrator'}` or 'system.user.user'. If ownerGroup is not defined, it will be taken from owner.
852
+ * callback *(function)*: `function (error)`
853
+
854
+ ### <a name="fileexists_a"></a>fileExists(_adapter, fileName, callback)
855
+ Checks if the file or folder exists in ioBroker DB
856
+ * _adapter *(string)*: instance name, e.g. `vis.0`
857
+ * fileName *(string)*: file name, e.g `main/vis-views.json`
858
+ * callback *(function)*: `function (error, isExist)`
859
+
860
+ ### <a name="subscribefiles_a"></a>subscribeFiles(id, pattern, callback)
861
+ Subscribe on file changes in ioBroker DB
862
+ * id *(string)*: instance name, e.g. `vis.0` or any object ID of type `meta`. `id` could have wildcards `*` too.
863
+ * pattern *(string)*: file name pattern, e.g `main/*.json`
864
+ * callback *(function)*: `function (error)`
865
+
866
+ ### <a name="unsubscribefiles_a"></a>unsubscribeFiles(id, pattern, callback)
867
+ Unsubscribe on file changes in ioBroker DB
868
+ * id *(string)*: instance name, e.g. `vis.0` or any object ID of type `meta`. `id` could have wildcards `*` too.
869
+ * pattern *(string)*: file name pattern, e.g `main/*.json`
870
+ * callback *(function)*: `function (error)`
871
+
872
+ ### <a name="getadapterinstances_a"></a>getAdapterInstances(adapterName, callback)
873
+ Read all instances of the given adapter, or all instances of all adapters if adapterName is not defined
874
+ * adapterName *(string)*: optional adapter name, e.g `history`.
875
+ * callback *(function)*: `function (error, instanceList)`, where instanceList is an array of instance objects, e.g. `{_id: 'system.adapter.history.0', common: {name: 'history', ...}, native: {...}}`
876
+
877
+ <!-- ADMIN_METHODS_END -->
878
+
66
879
  <!--
67
880
  Placeholder for the next version (at the beginning of the line):
68
881
  ### **WORK IN PROGRESS**
69
882
  -->
70
883
 
71
884
  ## Changelog
885
+ ### 1.0.1 (2022-10-10)
886
+ * (bluefox) Fixed error with delObject
887
+
888
+ ### 0.5.5 (2022-10-09)
889
+ * (Apollon77) Prepare for future js-controller versions
890
+
891
+ ### 0.5.4 (2022-09-23)
892
+ * (bluefox) Fixed error in `delObjects` method
893
+
72
894
  ### 0.5.3 (2022-08-24)
73
895
  * (bluefox) Caught error by subscribe
74
896