@iobroker/db-objects-redis 7.2.2 → 7.2.3-alpha.1-20260621-61726ea22
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/build/cjs/lib/objects/objectsInRedisClient.d.ts +654 -10
- package/build/cjs/lib/objects/objectsInRedisClient.js +467 -13
- package/build/cjs/lib/objects/objectsInRedisClient.js.map +2 -2
- package/build/cjs/lib/objects/objectsUtils.d.ts +63 -0
- package/build/cjs/lib/objects/objectsUtils.js.map +2 -2
- package/build/esm/lib/objects/objectsInRedisClient.d.ts +654 -10
- package/build/esm/lib/objects/objectsInRedisClient.d.ts.map +1 -1
- package/build/esm/lib/objects/objectsInRedisClient.js +470 -13
- package/build/esm/lib/objects/objectsInRedisClient.js.map +1 -1
- package/build/esm/lib/objects/objectsUtils.d.ts +63 -0
- package/build/esm/lib/objects/objectsUtils.d.ts.map +1 -1
- package/build/esm/lib/objects/objectsUtils.js +48 -0
- package/build/esm/lib/objects/objectsUtils.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -6,21 +6,37 @@ type GetUserGroupCallbackNoError = (user: string, groups: string[], acl: ioBroke
|
|
|
6
6
|
interface RedisConnectionOptions extends ConnectionOptions {
|
|
7
7
|
redisNamespace?: string;
|
|
8
8
|
}
|
|
9
|
+
/** Settings for the objects database client */
|
|
9
10
|
export interface ObjectsSettings {
|
|
11
|
+
/** Called once the client is connected */
|
|
10
12
|
connected: () => void;
|
|
13
|
+
/** Whether this client runs inside the controller */
|
|
11
14
|
controller?: boolean;
|
|
15
|
+
/** Called when the connection to the primary host is lost */
|
|
12
16
|
primaryHostLost?: () => void;
|
|
17
|
+
/** Called when the client gets disconnected */
|
|
13
18
|
disconnected?: () => void;
|
|
19
|
+
/** Handler for system-level object changes */
|
|
14
20
|
change?: ChangeFunction;
|
|
21
|
+
/** Handler for user-level object changes */
|
|
15
22
|
changeUser?: ChangeFunction;
|
|
23
|
+
/** Handler for user-level file changes */
|
|
16
24
|
changeFileUser?: ioBroker.FileChangeHandler;
|
|
25
|
+
/** Whether to connect to the database immediately (default true) */
|
|
17
26
|
autoConnect?: boolean;
|
|
27
|
+
/** Logger instance to use */
|
|
18
28
|
logger: InternalLogger;
|
|
29
|
+
/** Name of this host */
|
|
19
30
|
hostname?: string;
|
|
31
|
+
/** Namespace of this client */
|
|
20
32
|
namespace?: string;
|
|
33
|
+
/** Default ACL applied to newly created objects */
|
|
21
34
|
defaultNewAcl?: ACLObject;
|
|
35
|
+
/** Namespace used for meta information */
|
|
22
36
|
metaNamespace?: string;
|
|
37
|
+
/** Redis key prefix (defaults to "cfg") */
|
|
23
38
|
redisNamespace?: string;
|
|
39
|
+
/** Connection options for the redis server */
|
|
24
40
|
connection: RedisConnectionOptions;
|
|
25
41
|
}
|
|
26
42
|
interface CallOptions {
|
|
@@ -43,6 +59,9 @@ interface Options {
|
|
|
43
59
|
type CheckFileCallback = (checkFailed: boolean, options?: CallOptions, fileOptions?: {
|
|
44
60
|
notExists: boolean;
|
|
45
61
|
}) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Client for the objects database backed by Redis (or the in-memory redis-protocol server)
|
|
64
|
+
*/
|
|
46
65
|
export declare class ObjectsInRedisClient {
|
|
47
66
|
private client;
|
|
48
67
|
private readonly fileNamespace;
|
|
@@ -69,12 +88,21 @@ export declare class ObjectsInRedisClient {
|
|
|
69
88
|
private noLegacyMultihost?;
|
|
70
89
|
private readonly userSubscriptions;
|
|
71
90
|
private readonly systemSubscriptions;
|
|
91
|
+
/**
|
|
92
|
+
* @param settings Settings for the objects client including connection and namespaces
|
|
93
|
+
*/
|
|
72
94
|
constructor(settings: ObjectsSettings);
|
|
73
95
|
/**
|
|
74
96
|
* Checks if we are allowed to start and sets the protocol version accordingly
|
|
75
97
|
*/
|
|
76
98
|
private _determineProtocolVersion;
|
|
99
|
+
/**
|
|
100
|
+
* Connect to the objects database and set up the change and file subscriptions
|
|
101
|
+
*/
|
|
77
102
|
connectDb(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Get the current status of the database
|
|
105
|
+
*/
|
|
78
106
|
getStatus(): DbStatus;
|
|
79
107
|
/**
|
|
80
108
|
* Checks if given ID is a meta-object, else throws error
|
|
@@ -83,6 +111,11 @@ export declare class ObjectsInRedisClient {
|
|
|
83
111
|
* @throws Error if id is invalid
|
|
84
112
|
*/
|
|
85
113
|
validateMetaObject(id: string): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Normalize a file name by collapsing slashes and backslashes into a single forward slash
|
|
116
|
+
*
|
|
117
|
+
* @param name The file name to normalize
|
|
118
|
+
*/
|
|
86
119
|
normalizeFilename(name: string): string;
|
|
87
120
|
/**
|
|
88
121
|
* Sets a buffer to the Redis DB
|
|
@@ -103,18 +136,94 @@ export declare class ObjectsInRedisClient {
|
|
|
103
136
|
* @param id - id to delete, with namespace prefix
|
|
104
137
|
*/
|
|
105
138
|
private _delBinaryState;
|
|
139
|
+
/**
|
|
140
|
+
* Build the internal redis key for a file
|
|
141
|
+
*
|
|
142
|
+
* @param id The id of the object owning the file
|
|
143
|
+
* @param name The file name
|
|
144
|
+
* @param isMeta Whether to return the key of the meta entry (true) or the data entry (false)
|
|
145
|
+
*/
|
|
106
146
|
getFileId(id: string, name: string, isMeta?: boolean): string;
|
|
147
|
+
/**
|
|
148
|
+
* Check whether the current options have the required rights on a file
|
|
149
|
+
*
|
|
150
|
+
* @param id The id of the object owning the file
|
|
151
|
+
* @param name The file name
|
|
152
|
+
* @param options The current request options including the user
|
|
153
|
+
* @param flag The access flag(s) to check for
|
|
154
|
+
* @param callback Called with whether the check failed and the effective options
|
|
155
|
+
*/
|
|
107
156
|
checkFile(id: string, name: string, options: CallOptions, flag: any, callback?: CheckFileCallback): Promise<ioBroker.CallbackReturnTypeOf<CheckFileCallback> | void>;
|
|
157
|
+
/**
|
|
158
|
+
* Check whether the current user is allowed to access a file
|
|
159
|
+
*
|
|
160
|
+
* @param id The id of the object owning the file
|
|
161
|
+
* @param name The file name, or null for the whole namespace
|
|
162
|
+
* @param options The current request options including the user
|
|
163
|
+
* @param flag The access flag(s) to check for
|
|
164
|
+
* @param callback Called with the effective options once the rights have been checked
|
|
165
|
+
*/
|
|
108
166
|
checkFileRights(id: string, name: string | null, options?: CallOptions | null, flag?: any, callback?: CheckFileRightsCallback): void;
|
|
109
167
|
private _setDefaultAcl;
|
|
168
|
+
/**
|
|
169
|
+
* Set the default ACL applied to new objects and apply it to all existing objects without an ACL
|
|
170
|
+
*
|
|
171
|
+
* @param defaultNewAcl The default ACL to use, or null to use the built-in default
|
|
172
|
+
*/
|
|
110
173
|
setDefaultAcl(defaultNewAcl: ACLObject | null): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Determine the groups and effective ACL of the given user
|
|
176
|
+
*
|
|
177
|
+
* @param user The id of the user to look up
|
|
178
|
+
* @param callback Called with the user, its groups and the effective ACL
|
|
179
|
+
*/
|
|
111
180
|
getUserGroup(user: ioBroker.ObjectIDs.User, callback: GetUserGroupCallbackNoError): Promise<GetUserGroupPromiseReturn> | void;
|
|
112
181
|
private _writeFile;
|
|
182
|
+
/**
|
|
183
|
+
* Write data into a file of an object
|
|
184
|
+
*
|
|
185
|
+
* @param id The id of the object owning the file
|
|
186
|
+
* @param name The file name
|
|
187
|
+
* @param data The data to write
|
|
188
|
+
* @param callback Called once the file has been written
|
|
189
|
+
*/
|
|
113
190
|
writeFile(id: string, name: string, data: any, callback?: ioBroker.ErrorCallback): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Write data into a file of an object
|
|
193
|
+
*
|
|
194
|
+
* @param id The id of the object owning the file
|
|
195
|
+
* @param name The file name
|
|
196
|
+
* @param data The data to write
|
|
197
|
+
* @param options The current request options including the user
|
|
198
|
+
* @param callback Called once the file has been written
|
|
199
|
+
*/
|
|
114
200
|
writeFile(id: string, name: string, data: any, options?: WriteFileOptions | null, callback?: ioBroker.ErrorCallback): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Promise-version of writeFile
|
|
203
|
+
*
|
|
204
|
+
* @param id The id of the object owning the file
|
|
205
|
+
* @param name The file name
|
|
206
|
+
* @param data The data to write
|
|
207
|
+
* @param options The current request options including the user
|
|
208
|
+
*/
|
|
115
209
|
writeFileAsync(id: string, name: string, data: any, options?: WriteFileOptions | null): Promise<void>;
|
|
116
210
|
private _readFile;
|
|
211
|
+
/**
|
|
212
|
+
* Read a file of an object
|
|
213
|
+
*
|
|
214
|
+
* @param id The id of the object owning the file
|
|
215
|
+
* @param name The file name
|
|
216
|
+
* @param options The current request options including the user
|
|
217
|
+
*/
|
|
117
218
|
readFile(id: string, name: string, options?: CallOptions | null): ioBroker.ReadFilePromise;
|
|
219
|
+
/**
|
|
220
|
+
* Read a file of an object
|
|
221
|
+
*
|
|
222
|
+
* @param id The id of the object owning the file
|
|
223
|
+
* @param name The file name
|
|
224
|
+
* @param options The current request options including the user
|
|
225
|
+
* @param callback Called with the file content and mime type
|
|
226
|
+
*/
|
|
118
227
|
readFile(id: string, name: string, options: CallOptions | null | undefined, callback: ioBroker.ReadFileCallback): void;
|
|
119
228
|
/**
|
|
120
229
|
* Check if given object exists
|
|
@@ -132,29 +241,151 @@ export declare class ObjectsInRedisClient {
|
|
|
132
241
|
*/
|
|
133
242
|
fileExists(id: string, name: string, options?: CallOptions | null): Promise<boolean>;
|
|
134
243
|
private _unlink;
|
|
244
|
+
/**
|
|
245
|
+
* Delete a file or directory of an object
|
|
246
|
+
*
|
|
247
|
+
* @param id The id of the object owning the file
|
|
248
|
+
* @param name The file or directory name to delete
|
|
249
|
+
* @param options The current request options including the user, or the callback
|
|
250
|
+
* @param callback Called with the list of removed files
|
|
251
|
+
*/
|
|
135
252
|
unlink(id: string, name: string, options: CallOptions | null | undefined, callback?: ioBroker.RmCallback): void;
|
|
253
|
+
/**
|
|
254
|
+
* Promise-version of unlink
|
|
255
|
+
*
|
|
256
|
+
* @param id The id of the object owning the file
|
|
257
|
+
* @param name The file or directory name to delete
|
|
258
|
+
* @param options The current request options including the user
|
|
259
|
+
*/
|
|
136
260
|
unlinkAsync(id: string, name: string, options?: CallOptions): Promise<void>;
|
|
261
|
+
/**
|
|
262
|
+
* Delete a file of an object (alias for unlink)
|
|
263
|
+
*
|
|
264
|
+
* @param id The id of the object owning the file
|
|
265
|
+
* @param name The file name to delete
|
|
266
|
+
* @param options The current request options including the user
|
|
267
|
+
* @param callback Called once the file has been deleted
|
|
268
|
+
*/
|
|
137
269
|
delFile(id: string, name: string, options: CallOptions, callback: ioBroker.ErrorCallback): void;
|
|
270
|
+
/**
|
|
271
|
+
* Promise-version of delFile
|
|
272
|
+
*
|
|
273
|
+
* @param id The id of the object owning the file
|
|
274
|
+
* @param name The file name to delete
|
|
275
|
+
* @param options The current request options including the user
|
|
276
|
+
*/
|
|
138
277
|
delFileAsync(id: string, name: string, options: CallOptions): Promise<void>;
|
|
139
278
|
private _readDir;
|
|
279
|
+
/**
|
|
280
|
+
* List the contents of a directory of an object
|
|
281
|
+
*
|
|
282
|
+
* @param id The id of the object owning the files
|
|
283
|
+
* @param name The directory name to list
|
|
284
|
+
* @param options The current request options including the user, or the callback
|
|
285
|
+
* @param callback Called with the directory entries
|
|
286
|
+
*/
|
|
140
287
|
readDir(id: string, name: string, options: CallOptions | null | undefined, callback: ioBroker.ReadDirCallback): void;
|
|
288
|
+
/**
|
|
289
|
+
* Promise-version of readDir
|
|
290
|
+
*
|
|
291
|
+
* @param id The id of the object owning the files
|
|
292
|
+
* @param name The directory name to list
|
|
293
|
+
* @param options The current request options including the user
|
|
294
|
+
*/
|
|
141
295
|
readDirAsync(id: string, name: string, options?: CallOptions): ioBroker.ReadDirPromise;
|
|
142
296
|
private _renameHelper;
|
|
143
297
|
private _rename;
|
|
298
|
+
/**
|
|
299
|
+
* Rename a file or directory of an object
|
|
300
|
+
*
|
|
301
|
+
* @param id The id of the object owning the file
|
|
302
|
+
* @param oldName The current file or directory name
|
|
303
|
+
* @param newName The new file or directory name
|
|
304
|
+
* @param options The current request options including the user, or the callback
|
|
305
|
+
* @param callback Called once the file has been renamed
|
|
306
|
+
*/
|
|
144
307
|
rename(id: string, oldName: string, newName: string, options?: CallOptions | null, callback?: ioBroker.ErrorCallback): void | Promise<void>;
|
|
308
|
+
/**
|
|
309
|
+
* Promise-version of rename
|
|
310
|
+
*
|
|
311
|
+
* @param id The id of the object owning the file
|
|
312
|
+
* @param oldName The current file or directory name
|
|
313
|
+
* @param newName The new file or directory name
|
|
314
|
+
* @param options The current request options including the user
|
|
315
|
+
*/
|
|
145
316
|
renameAsync(id: string, oldName: string, newName: string, options: CallOptions): Promise<void>;
|
|
146
317
|
private _touch;
|
|
318
|
+
/**
|
|
319
|
+
* Update the modification time of a file
|
|
320
|
+
*
|
|
321
|
+
* @param id The id of the object owning the file
|
|
322
|
+
* @param name The file name
|
|
323
|
+
* @param options The current request options including the user, or the callback
|
|
324
|
+
* @param callback Called once the file has been touched
|
|
325
|
+
*/
|
|
147
326
|
touch(id: string, name: string, options: CallOptions | null, callback: ioBroker.ErrorCallback): void;
|
|
327
|
+
/**
|
|
328
|
+
* Promise-version of touch
|
|
329
|
+
*
|
|
330
|
+
* @param id The id of the object owning the file
|
|
331
|
+
* @param name The file name
|
|
332
|
+
* @param options The current request options including the user
|
|
333
|
+
*/
|
|
148
334
|
touchAsync(id: string, name: string, options: CallOptions): Promise<void>;
|
|
149
335
|
private _rmHelper;
|
|
150
336
|
private _rm;
|
|
337
|
+
/**
|
|
338
|
+
* Delete a file or directory of an object
|
|
339
|
+
*
|
|
340
|
+
* @param id The id of the object owning the file
|
|
341
|
+
* @param name The file or directory name to delete
|
|
342
|
+
* @param options The current request options including the user, or the callback
|
|
343
|
+
* @param callback Called with the list of removed files
|
|
344
|
+
*/
|
|
151
345
|
rm(id: string, name: string, options: CallOptions | null, callback: ioBroker.RmCallback): void;
|
|
346
|
+
/**
|
|
347
|
+
* Promise-version of rm
|
|
348
|
+
*
|
|
349
|
+
* @param id The id of the object owning the file
|
|
350
|
+
* @param name The file or directory name to delete
|
|
351
|
+
* @param options The current request options including the user
|
|
352
|
+
*/
|
|
152
353
|
rmAsync(id: string, name: string, options: CallOptions): Promise<void | ioBroker.RmResult[]>;
|
|
354
|
+
/**
|
|
355
|
+
* Create a directory for an object's files (simulated, as redis has no real directories)
|
|
356
|
+
*
|
|
357
|
+
* @param id The id of the object owning the files
|
|
358
|
+
* @param dirName The directory name to create
|
|
359
|
+
* @param options The current request options including the user, or the callback
|
|
360
|
+
* @param callback Called once the directory has been created
|
|
361
|
+
*/
|
|
153
362
|
mkdir(id: string, dirName?: string, options?: CallOptions | null, callback?: ioBroker.ErrorCallback): void;
|
|
363
|
+
/**
|
|
364
|
+
* Promise-version of mkdir
|
|
365
|
+
*
|
|
366
|
+
* @param id The id of the object owning the files
|
|
367
|
+
* @param dirName The directory name to create
|
|
368
|
+
* @param options The current request options including the user
|
|
369
|
+
*/
|
|
154
370
|
mkdirAsync(id: string, dirName?: string, options?: CallOptions): Promise<void>;
|
|
155
371
|
private _chownFileHelper;
|
|
156
372
|
private _chownFile;
|
|
373
|
+
/**
|
|
374
|
+
* Change the owner and owner group of a file
|
|
375
|
+
*
|
|
376
|
+
* @param id The id of the object owning the file
|
|
377
|
+
* @param name The file name
|
|
378
|
+
* @param options The current request options including the new owner and the user
|
|
379
|
+
* @param callback Called with the processed file(s)
|
|
380
|
+
*/
|
|
157
381
|
chownFile(id: string, name: string, options: CallOptions, callback: ioBroker.ChownFileCallback): void;
|
|
382
|
+
/**
|
|
383
|
+
* Promise-version of chownFile
|
|
384
|
+
*
|
|
385
|
+
* @param id The id of the object owning the file
|
|
386
|
+
* @param name The file name
|
|
387
|
+
* @param options The current request options including the new owner and the user
|
|
388
|
+
*/
|
|
158
389
|
chownFileAsync(id: string, name: string, options: CallOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ChownFileCallback>>;
|
|
159
390
|
/**
|
|
160
391
|
*
|
|
@@ -165,78 +396,362 @@ export declare class ObjectsInRedisClient {
|
|
|
165
396
|
*/
|
|
166
397
|
private _chmodFileHelper;
|
|
167
398
|
private _chmodFile;
|
|
399
|
+
/**
|
|
400
|
+
* Change the file mode (permissions) of a single file
|
|
401
|
+
*
|
|
402
|
+
* @param id The id of the object owning the file
|
|
403
|
+
* @param name The file name
|
|
404
|
+
* @param options The current request options including the new mode and the user, or the callback
|
|
405
|
+
* @param callback Called with the processed file
|
|
406
|
+
*/
|
|
168
407
|
chmodFile(id: string, name: string, options: CallOptions | null, callback: ioBroker.ChownFileCallback): void;
|
|
408
|
+
/**
|
|
409
|
+
* Promise-version of chmodFile
|
|
410
|
+
*
|
|
411
|
+
* @param id The id of the object owning the file
|
|
412
|
+
* @param name The file name
|
|
413
|
+
* @param options The current request options including the new mode and the user
|
|
414
|
+
*/
|
|
169
415
|
chmodFileAsync(id: string, name: string, options: CallOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ChownFileCallback>>;
|
|
416
|
+
/**
|
|
417
|
+
* Enable or disable the file cache
|
|
418
|
+
*
|
|
419
|
+
* @param enabled Whether the file cache should be enabled
|
|
420
|
+
* @param callback Called with the resulting cache state
|
|
421
|
+
*/
|
|
170
422
|
enableFileCache(enabled: boolean, callback?: (err: Error | null | undefined, res: boolean) => void): void;
|
|
423
|
+
/**
|
|
424
|
+
* Enable or disable the file cache
|
|
425
|
+
*
|
|
426
|
+
* @param enabled Whether the file cache should be enabled
|
|
427
|
+
* @param options The current request options including the user
|
|
428
|
+
* @param callback Called with the resulting cache state
|
|
429
|
+
*/
|
|
171
430
|
enableFileCache(enabled: boolean, options?: CallOptions, callback?: (err: Error | null | undefined, res: boolean) => void): void;
|
|
431
|
+
/**
|
|
432
|
+
* Promise-version of enableFileCache
|
|
433
|
+
*
|
|
434
|
+
* @param enabled Whether the file cache should be enabled
|
|
435
|
+
* @param options The current request options including the user
|
|
436
|
+
*/
|
|
172
437
|
enableFileCacheAsync(enabled: boolean, options?: CallOptions): Promise<boolean>;
|
|
173
438
|
private _subscribeFile;
|
|
174
439
|
private _unsubscribeFile;
|
|
440
|
+
/**
|
|
441
|
+
* Subscribe a user to file changes of an object
|
|
442
|
+
*
|
|
443
|
+
* @param id The id of the object owning the files
|
|
444
|
+
* @param pattern One or more file name patterns to subscribe to
|
|
445
|
+
* @param options The current request options including the user
|
|
446
|
+
*/
|
|
175
447
|
subscribeUserFile(id: string, pattern: string | string[], options?: CallOptions | null): Promise<void>;
|
|
448
|
+
/**
|
|
449
|
+
* Unsubscribe a user from file changes of an object
|
|
450
|
+
*
|
|
451
|
+
* @param id The id of the object owning the files
|
|
452
|
+
* @param pattern One or more file name patterns to unsubscribe from
|
|
453
|
+
* @param options The current request options including the user
|
|
454
|
+
*/
|
|
176
455
|
unsubscribeUserFile(id: string, pattern: string | string[], options?: CallOptions | null): Promise<void>;
|
|
177
456
|
private _subscribe;
|
|
178
457
|
private subscribeConfig;
|
|
458
|
+
/**
|
|
459
|
+
* Subscribe to object changes matching the given pattern
|
|
460
|
+
*
|
|
461
|
+
* @param pattern One or more patterns to subscribe to
|
|
462
|
+
* @param callback Called once the subscription is registered
|
|
463
|
+
*/
|
|
179
464
|
subscribe(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
|
|
465
|
+
/**
|
|
466
|
+
* Subscribe to object changes matching the given pattern
|
|
467
|
+
*
|
|
468
|
+
* @param pattern One or more patterns to subscribe to
|
|
469
|
+
* @param options The current request options including the user
|
|
470
|
+
* @param callback Called once the subscription is registered
|
|
471
|
+
*/
|
|
180
472
|
subscribe(pattern: string | string[], options?: CallOptions, callback?: ioBroker.ErrorCallback): void;
|
|
473
|
+
/**
|
|
474
|
+
* Promise-version of subscribe
|
|
475
|
+
*
|
|
476
|
+
* @param pattern One or more patterns to subscribe to
|
|
477
|
+
* @param options The current request options including the user
|
|
478
|
+
*/
|
|
181
479
|
subscribeAsync(pattern: string | string[], options?: CallOptions): Promise<void>;
|
|
480
|
+
/**
|
|
481
|
+
* Subscribe a user to object changes matching the given pattern
|
|
482
|
+
*
|
|
483
|
+
* @param pattern One or more patterns to subscribe to
|
|
484
|
+
* @param callback Called once the subscription is registered
|
|
485
|
+
*/
|
|
182
486
|
subscribeUser(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
|
|
487
|
+
/**
|
|
488
|
+
* Subscribe a user to object changes matching the given pattern
|
|
489
|
+
*
|
|
490
|
+
* @param pattern One or more patterns to subscribe to
|
|
491
|
+
* @param options The current request options including the user
|
|
492
|
+
* @param callback Called once the subscription is registered
|
|
493
|
+
*/
|
|
183
494
|
subscribeUser(pattern: string | string[], options?: CallOptions | null, callback?: ioBroker.ErrorCallback): void;
|
|
495
|
+
/**
|
|
496
|
+
* Promise-version of subscribeUser
|
|
497
|
+
*
|
|
498
|
+
* @param pattern One or more patterns to subscribe to
|
|
499
|
+
* @param options The current request options including the user
|
|
500
|
+
*/
|
|
184
501
|
subscribeUserAsync(pattern: string | string[], options: CallOptions): Promise<void>;
|
|
185
502
|
private _unsubscribe;
|
|
186
503
|
private unsubscribeConfig;
|
|
504
|
+
/**
|
|
505
|
+
* Unsubscribe from object changes matching the given pattern
|
|
506
|
+
*
|
|
507
|
+
* @param pattern One or more patterns to unsubscribe from
|
|
508
|
+
* @param callback Called once the subscription is removed
|
|
509
|
+
*/
|
|
187
510
|
unsubscribe(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
|
|
511
|
+
/**
|
|
512
|
+
* Unsubscribe from object changes matching the given pattern
|
|
513
|
+
*
|
|
514
|
+
* @param pattern One or more patterns to unsubscribe from
|
|
515
|
+
* @param options The current request options including the user
|
|
516
|
+
* @param callback Called once the subscription is removed
|
|
517
|
+
*/
|
|
188
518
|
unsubscribe(pattern: string | string[], options?: CallOptions | null, callback?: ioBroker.ErrorCallback): void;
|
|
519
|
+
/**
|
|
520
|
+
* Promise-version of unsubscribe
|
|
521
|
+
*
|
|
522
|
+
* @param pattern One or more patterns to unsubscribe from
|
|
523
|
+
* @param options The current request options including the user
|
|
524
|
+
*/
|
|
189
525
|
unsubscribeAsync(pattern: string | string[], options: CallOptions): Promise<void>;
|
|
526
|
+
/**
|
|
527
|
+
* Unsubscribe a user from object changes matching the given pattern
|
|
528
|
+
*
|
|
529
|
+
* @param pattern One or more patterns to unsubscribe from
|
|
530
|
+
* @param options The current request options including the user, or the callback
|
|
531
|
+
* @param callback Called once the subscription is removed
|
|
532
|
+
*/
|
|
190
533
|
unsubscribeUser(pattern: string | string[], options?: CallOptions | null, callback?: ioBroker.ErrorCallback): void;
|
|
534
|
+
/**
|
|
535
|
+
* Promise-version of unsubscribeUser
|
|
536
|
+
*
|
|
537
|
+
* @param pattern One or more patterns to unsubscribe from
|
|
538
|
+
* @param options The current request options including the user
|
|
539
|
+
*/
|
|
191
540
|
unsubscribeUserAsync(pattern: string | string[], options: CallOptions): Promise<void>;
|
|
192
541
|
private _objectHelper;
|
|
193
542
|
private _chownObject;
|
|
543
|
+
/**
|
|
544
|
+
* Change the owner and owner group of all objects matching the given pattern
|
|
545
|
+
*
|
|
546
|
+
* @param pattern The pattern of object ids whose owner should be changed
|
|
547
|
+
* @param options The current request options including the new owner and the user, or the callback
|
|
548
|
+
* @param callback Called with the list of changed objects
|
|
549
|
+
*/
|
|
194
550
|
chownObject(pattern: string, options: CallOptions, callback?: ioBroker.ChownObjectCallback): void | Promise<void>;
|
|
551
|
+
/**
|
|
552
|
+
* Promise-version of chownObject
|
|
553
|
+
*
|
|
554
|
+
* @param pattern The pattern of object ids whose owner should be changed
|
|
555
|
+
* @param options The current request options including the new owner and the user
|
|
556
|
+
*/
|
|
195
557
|
chownObjectAsync(pattern: string, options: CallOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ChownObjectCallback>>;
|
|
196
558
|
private _chmodObject;
|
|
559
|
+
/**
|
|
560
|
+
* Change the file mode (permissions) of all files matching the given pattern
|
|
561
|
+
*
|
|
562
|
+
* @param pattern The pattern of object ids whose files should be changed
|
|
563
|
+
* @param options The current request options including the new mode and the user, or the callback
|
|
564
|
+
* @param callback Called with the list of changed objects
|
|
565
|
+
*/
|
|
197
566
|
chmodObject(pattern: string, options: CallOptions | null, callback?: ioBroker.ChownObjectCallback): void | Promise<void>;
|
|
567
|
+
/**
|
|
568
|
+
* Promise-version of chmodObject
|
|
569
|
+
*
|
|
570
|
+
* @param pattern The pattern of object ids whose files should be changed
|
|
571
|
+
* @param options The current request options including the new mode and the user
|
|
572
|
+
*/
|
|
198
573
|
chmodObjectAsync(pattern: string, options: CallOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ChownObjectCallback>>;
|
|
199
574
|
private _getObject;
|
|
575
|
+
/**
|
|
576
|
+
* Get a single object by its id
|
|
577
|
+
*
|
|
578
|
+
* @param id The id of the object to read
|
|
579
|
+
* @param options The current request options including the user
|
|
580
|
+
* @param callback Called with the read object
|
|
581
|
+
*/
|
|
200
582
|
getObject<T extends string>(id: T, options: Options | undefined | null, callback: ioBroker.GetObjectCallback<T>): void;
|
|
583
|
+
/**
|
|
584
|
+
* Get a single object by its id
|
|
585
|
+
*
|
|
586
|
+
* @param id The id of the object to read
|
|
587
|
+
* @param options The current request options including the user
|
|
588
|
+
*/
|
|
201
589
|
getObject<T extends string>(id: T, options?: Options | null): ioBroker.GetObjectPromise<T>;
|
|
590
|
+
/**
|
|
591
|
+
* Get a single object by its id
|
|
592
|
+
*
|
|
593
|
+
* @param id The id of the object to read
|
|
594
|
+
* @param callback Called with the read object
|
|
595
|
+
*/
|
|
202
596
|
getObject<T extends string>(id: T, callback: ioBroker.GetObjectCallback<T>): void;
|
|
203
597
|
/**
|
|
598
|
+
* Promise-version of getObject
|
|
204
599
|
*
|
|
205
|
-
* @param id
|
|
206
|
-
* @param options
|
|
600
|
+
* @param id The id of the object to read
|
|
601
|
+
* @param options The current request options including the user
|
|
207
602
|
* @deprecated use `getObject` without callback instead
|
|
208
603
|
*/
|
|
209
604
|
getObjectAsync<T extends string>(id: T, options?: Record<string, any> | null): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.GetObjectCallback<T>>>;
|
|
210
605
|
private _getKeys;
|
|
606
|
+
/**
|
|
607
|
+
* Get all object ids matching the given pattern
|
|
608
|
+
*
|
|
609
|
+
* @param pattern The pattern to match object ids against
|
|
610
|
+
* @param options The current request options including the user
|
|
611
|
+
* @param callback Called with the matching keys
|
|
612
|
+
* @param dontModify If true, the returned keys are not stripped of the namespace
|
|
613
|
+
*/
|
|
211
614
|
getKeys(pattern: string, options: CallOptions | null | undefined, callback: ioBroker.GetKeysCallback, dontModify?: boolean): void;
|
|
615
|
+
/**
|
|
616
|
+
* Get all object ids matching the given pattern
|
|
617
|
+
*
|
|
618
|
+
* @param pattern The pattern to match object ids against
|
|
619
|
+
* @param callback Called with the matching keys
|
|
620
|
+
*/
|
|
212
621
|
getKeys(pattern: string, callback: ioBroker.GetKeysCallback): void;
|
|
622
|
+
/**
|
|
623
|
+
* Get all object ids matching the given pattern
|
|
624
|
+
*
|
|
625
|
+
* @param pattern The pattern to match object ids against
|
|
626
|
+
* @param options The current request options including the user
|
|
627
|
+
* @param callback Must be undefined for the promise variant
|
|
628
|
+
* @param dontModify If true, the returned keys are not stripped of the namespace
|
|
629
|
+
*/
|
|
213
630
|
getKeys(pattern: string, options?: CallOptions | null, callback?: undefined, dontModify?: boolean): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.GetKeysCallback>>;
|
|
214
|
-
|
|
631
|
+
/**
|
|
632
|
+
* Promise-version of getKeys
|
|
633
|
+
*
|
|
634
|
+
* @param pattern The pattern to match object ids against
|
|
635
|
+
* @param options The current request options including the user
|
|
636
|
+
*/
|
|
637
|
+
getKeysAsync(pattern: string, options?: CallOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.GetKeysCallback>>;
|
|
215
638
|
private _getObjects;
|
|
639
|
+
/**
|
|
640
|
+
* Get multiple objects by their ids
|
|
641
|
+
*
|
|
642
|
+
* @param keys The ids of the objects to read
|
|
643
|
+
* @param options The current request options including the user
|
|
644
|
+
*/
|
|
216
645
|
getObjects(keys: string[], options?: CallOptions | null): Promise<ioBroker.AnyObject[]>;
|
|
646
|
+
/**
|
|
647
|
+
* Get multiple objects by their ids
|
|
648
|
+
*
|
|
649
|
+
* @param keys The ids of the objects to read
|
|
650
|
+
* @param callback Called with the read objects
|
|
651
|
+
*/
|
|
217
652
|
getObjects(keys: string[], callback: (err?: Error | null, objs?: ioBroker.AnyObject[]) => void): void;
|
|
653
|
+
/**
|
|
654
|
+
* Get multiple objects by their ids
|
|
655
|
+
*
|
|
656
|
+
* @param keys The ids of the objects to read
|
|
657
|
+
* @param options The current request options including the user
|
|
658
|
+
* @param callback Called with the read objects
|
|
659
|
+
* @param dontModify If true, the returned objects are not cloned/modified
|
|
660
|
+
*/
|
|
218
661
|
getObjects(keys: string[], options: CallOptions | null, callback: (err?: Error | null, objs?: ioBroker.AnyObject[]) => void, dontModify?: boolean): void;
|
|
662
|
+
/**
|
|
663
|
+
* Promise-version of getObjects
|
|
664
|
+
*
|
|
665
|
+
* @param keys The ids of the objects to read
|
|
666
|
+
* @param options The current request options including the user
|
|
667
|
+
*/
|
|
219
668
|
getObjectsAsync(keys: string[], options?: CallOptions | null): Promise<ioBroker.AnyObject[]>;
|
|
220
669
|
private _getObjectsByPattern;
|
|
670
|
+
/**
|
|
671
|
+
* Get all objects whose id matches the given pattern
|
|
672
|
+
*
|
|
673
|
+
* @param pattern The pattern to match object ids against
|
|
674
|
+
* @param options The current request options including the user
|
|
675
|
+
*/
|
|
221
676
|
getObjectsByPattern(pattern: string, options: CallOptions | null): Promise<ioBroker.AnyObject[] | void>;
|
|
677
|
+
/**
|
|
678
|
+
* Get all objects whose id matches the given pattern
|
|
679
|
+
*
|
|
680
|
+
* @param pattern The pattern to match object ids against
|
|
681
|
+
* @param options The current request options including the user
|
|
682
|
+
* @param callback Called with the matching objects
|
|
683
|
+
*/
|
|
222
684
|
getObjectsByPattern(pattern: string, options: CallOptions | null, callback: (err?: Error | null, objs?: ioBroker.AnyObject[]) => void): void;
|
|
685
|
+
/**
|
|
686
|
+
* Promise-version of getObjectsByPattern
|
|
687
|
+
*
|
|
688
|
+
* @param pattern The pattern to match object ids against
|
|
689
|
+
* @param options The current request options including the user
|
|
690
|
+
*/
|
|
223
691
|
getObjectsByPatternAsync(pattern: string, options: CallOptions): Promise<ioBroker.AnyObject[] | void>;
|
|
224
692
|
private _setObject;
|
|
693
|
+
/**
|
|
694
|
+
* Set anew or update an object
|
|
695
|
+
*
|
|
696
|
+
* @param id ID of the object
|
|
697
|
+
* @param obj The object to write
|
|
698
|
+
*/
|
|
225
699
|
setObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T>>): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
700
|
+
/**
|
|
701
|
+
* Set anew or update an object
|
|
702
|
+
*
|
|
703
|
+
* @param id ID of the object
|
|
704
|
+
* @param obj The object to write
|
|
705
|
+
* @param callback return function
|
|
706
|
+
*/
|
|
226
707
|
setObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T>>, callback?: ioBroker.SetObjectCallback): void | Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
708
|
+
/**
|
|
709
|
+
* Set anew or update an object
|
|
710
|
+
*
|
|
711
|
+
* @param id ID of the object
|
|
712
|
+
* @param obj The object to write
|
|
713
|
+
* @param options options for access control are optional
|
|
714
|
+
* @param callback return function
|
|
715
|
+
*/
|
|
227
716
|
setObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T>>, options?: CallOptions | null, callback?: ioBroker.SetObjectCallback): void | Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
228
717
|
/**
|
|
718
|
+
* Promise-version of setObject
|
|
229
719
|
*
|
|
230
|
-
* @param id
|
|
231
|
-
* @param obj
|
|
232
|
-
* @param options
|
|
720
|
+
* @param id ID of the object
|
|
721
|
+
* @param obj The object to write
|
|
722
|
+
* @param options options for access control are optional
|
|
233
723
|
* @deprecated use `setObject` without callback instead
|
|
234
724
|
*/
|
|
235
725
|
setObjectAsync(id: string, obj: ioBroker.SettableObject, options?: CallOptions | null): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
|
|
236
726
|
private _delObject;
|
|
727
|
+
/**
|
|
728
|
+
* Delete an object
|
|
729
|
+
*
|
|
730
|
+
* @param id The id of the object to delete
|
|
731
|
+
* @param callback Called once the object has been deleted
|
|
732
|
+
*/
|
|
237
733
|
delObject(id: string, callback: ioBroker.ErrorCallback): void;
|
|
734
|
+
/**
|
|
735
|
+
* Delete an object
|
|
736
|
+
*
|
|
737
|
+
* @param id The id of the object to delete
|
|
738
|
+
* @param options The current request options including the user
|
|
739
|
+
* @param callback Called once the object has been deleted
|
|
740
|
+
*/
|
|
238
741
|
delObject(id: string, options: CallOptions | null, callback: ioBroker.ErrorCallback): void;
|
|
742
|
+
/**
|
|
743
|
+
* Delete an object
|
|
744
|
+
*
|
|
745
|
+
* @param id The id of the object to delete
|
|
746
|
+
* @param options The current request options including the user
|
|
747
|
+
*/
|
|
239
748
|
delObject(id: string, options?: CallOptions | null): Promise<void>;
|
|
749
|
+
/**
|
|
750
|
+
* Promise-version of delObject
|
|
751
|
+
*
|
|
752
|
+
* @param id The id of the object to delete
|
|
753
|
+
* @param options The current request options including the user
|
|
754
|
+
*/
|
|
240
755
|
delObjectAsync(id: string, options?: CallOptions): Promise<void>;
|
|
241
756
|
/**
|
|
242
757
|
* Function to checks if comparisons will work according to the configured Locale
|
|
@@ -244,42 +759,171 @@ export declare class ObjectsInRedisClient {
|
|
|
244
759
|
isSystemLocaleSupported(): Promise<boolean>;
|
|
245
760
|
private _applyViewFunc;
|
|
246
761
|
private _getObjectView;
|
|
762
|
+
/**
|
|
763
|
+
* Run a predefined object view (design document) and return the matching rows
|
|
764
|
+
*
|
|
765
|
+
* @param design The design document name
|
|
766
|
+
* @param search The view name within the design document
|
|
767
|
+
* @param params Query parameters such as startkey and endkey
|
|
768
|
+
* @param options The current request options including the user
|
|
769
|
+
*/
|
|
247
770
|
getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params?: ioBroker.GetObjectViewParams, options?: CallOptions | null): ioBroker.GetObjectViewPromise<ioBroker.InferGetObjectViewItemType<Design, Search>>;
|
|
771
|
+
/**
|
|
772
|
+
* Run a predefined object view (design document) and return the matching rows
|
|
773
|
+
*
|
|
774
|
+
* @param design The design document name
|
|
775
|
+
* @param search The view name within the design document
|
|
776
|
+
* @param params Query parameters such as startkey and endkey
|
|
777
|
+
* @param options The current request options including the user
|
|
778
|
+
* @param callback Called with the matching rows
|
|
779
|
+
*/
|
|
248
780
|
getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | undefined, options: CallOptions | undefined | null, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
|
|
781
|
+
/**
|
|
782
|
+
* Run a predefined object view (design document) and return the matching rows
|
|
783
|
+
*
|
|
784
|
+
* @param design The design document name
|
|
785
|
+
* @param search The view name within the design document
|
|
786
|
+
* @param params Query parameters such as startkey and endkey
|
|
787
|
+
* @param callback Called with the matching rows
|
|
788
|
+
*/
|
|
249
789
|
getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
|
|
790
|
+
/**
|
|
791
|
+
* Promise-version of getObjectView
|
|
792
|
+
*
|
|
793
|
+
* @param design The design document name
|
|
794
|
+
* @param search The view name within the design document
|
|
795
|
+
* @param params Query parameters such as startkey and endkey
|
|
796
|
+
* @param options The current request options including the user
|
|
797
|
+
*/
|
|
250
798
|
getObjectViewAsync<Design extends string = string, Search extends string = string>(design: Design, search: Search, params?: ioBroker.GetObjectViewParams, options?: CallOptions): ioBroker.GetObjectViewPromise<ioBroker.InferGetObjectViewItemType<Design, Search>>;
|
|
251
799
|
private _getObjectList;
|
|
800
|
+
/**
|
|
801
|
+
* Get the list of objects matching the given parameters
|
|
802
|
+
*
|
|
803
|
+
* @param params Query parameters such as startkey and endkey
|
|
804
|
+
*/
|
|
252
805
|
getObjectList(params: ioBroker.GetObjectListParams): ioBroker.GetObjectListPromise;
|
|
806
|
+
/**
|
|
807
|
+
* Get the list of objects matching the given parameters
|
|
808
|
+
*
|
|
809
|
+
* @param params Query parameters such as startkey and endkey
|
|
810
|
+
* @param options The current request options including the user
|
|
811
|
+
*/
|
|
253
812
|
getObjectList(params: ioBroker.GetObjectListParams, options?: CallOptions | null): ioBroker.GetObjectListPromise;
|
|
813
|
+
/**
|
|
814
|
+
* Get the list of objects matching the given parameters
|
|
815
|
+
*
|
|
816
|
+
* @param params Query parameters such as startkey and endkey
|
|
817
|
+
* @param callback Called with the matching objects
|
|
818
|
+
*/
|
|
254
819
|
getObjectList(params: ioBroker.GetObjectListParams, callback: ioBroker.GetObjectListCallback<ioBroker.Object>): void;
|
|
820
|
+
/**
|
|
821
|
+
* Get the list of objects matching the given parameters
|
|
822
|
+
*
|
|
823
|
+
* @param params Query parameters such as startkey and endkey
|
|
824
|
+
* @param options The current request options including the user
|
|
825
|
+
* @param callback Called with the matching objects
|
|
826
|
+
*/
|
|
255
827
|
getObjectList<T extends ioBroker.GetObjectListCallback<ioBroker.Object>>(params: ioBroker.GetObjectListParams, options?: CallOptions | null, callback?: T): T extends ioBroker.GetObjectListCallback<ioBroker.Object> ? void : ioBroker.GetObjectListPromise;
|
|
828
|
+
/**
|
|
829
|
+
* Promise-version of getObjectList
|
|
830
|
+
*
|
|
831
|
+
* @param params Query parameters such as startkey and endkey
|
|
832
|
+
* @param options The current request options including the user
|
|
833
|
+
*/
|
|
256
834
|
getObjectListAsync(params: ioBroker.GetObjectListParams, options?: CallOptions): ioBroker.GetObjectListPromise;
|
|
257
835
|
private _extendObject;
|
|
836
|
+
/**
|
|
837
|
+
* Extend an existing object with the given partial object, creating it if it does not exist
|
|
838
|
+
*
|
|
839
|
+
* @param id The id of the object to extend
|
|
840
|
+
* @param obj The partial object to merge into the existing object
|
|
841
|
+
* @param options The current request options including the user
|
|
842
|
+
*/
|
|
258
843
|
extendObject<T extends string>(id: T, obj: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: ioBroker.ExtendObjectOptions | null): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ExtendObjectCallback>>;
|
|
844
|
+
/**
|
|
845
|
+
* Extend an existing object with the given partial object, creating it if it does not exist
|
|
846
|
+
*
|
|
847
|
+
* @param id The id of the object to extend
|
|
848
|
+
* @param obj The partial object to merge into the existing object
|
|
849
|
+
* @param options The current request options including the user
|
|
850
|
+
* @param callback Called with the resulting object and its id
|
|
851
|
+
*/
|
|
259
852
|
extendObject<T extends string>(id: T, obj: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: ioBroker.ExtendObjectOptions | null, callback?: ioBroker.ExtendObjectCallback): void | Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ExtendObjectCallback>>;
|
|
853
|
+
/**
|
|
854
|
+
* Promise-version of extendObject
|
|
855
|
+
*
|
|
856
|
+
* @param id The id of the object to extend
|
|
857
|
+
* @param obj The partial object to merge into the existing object
|
|
858
|
+
* @param options The current request options including the user
|
|
859
|
+
*/
|
|
260
860
|
extendObjectAsync(id: string, obj: Partial<ioBroker.AnyObject>, options?: ioBroker.ExtendObjectOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.ExtendObjectCallback>>;
|
|
261
861
|
/**
|
|
262
862
|
* Returns the object id if found
|
|
263
863
|
*
|
|
264
|
-
* @param idOrName
|
|
265
|
-
* @param type
|
|
266
|
-
* @param options
|
|
267
|
-
* @param callback
|
|
864
|
+
* @param idOrName The id or name to search for
|
|
865
|
+
* @param type The expected common type, or null for any
|
|
866
|
+
* @param options The current request options (may include a language)
|
|
867
|
+
* @param callback Called with the found id and the original id/name
|
|
268
868
|
*/
|
|
269
869
|
private _findObject;
|
|
870
|
+
/**
|
|
871
|
+
* Find an object by its id or name
|
|
872
|
+
*
|
|
873
|
+
* @param idOrName The id or name to search for
|
|
874
|
+
* @param type The expected common type, or null for any
|
|
875
|
+
* @param options The current request options (may include a language)
|
|
876
|
+
* @param callback Called with the found id and the original id/name
|
|
877
|
+
*/
|
|
270
878
|
findObject(idOrName: string, type: ioBroker.CommonType | null, options: (CallOptions & {
|
|
271
879
|
language?: ioBroker.Languages;
|
|
272
880
|
}) | null, callback: ioBroker.FindObjectCallback): void;
|
|
881
|
+
/**
|
|
882
|
+
* Find an object by its id or name
|
|
883
|
+
*
|
|
884
|
+
* @param idOrName The id or name to search for
|
|
885
|
+
* @param type The expected common type, or null for any
|
|
886
|
+
* @param callback Called with the found id and the original id/name
|
|
887
|
+
*/
|
|
273
888
|
findObject(idOrName: string, type: ioBroker.CommonType | null, callback: ioBroker.FindObjectCallback): void;
|
|
889
|
+
/**
|
|
890
|
+
* Find an object by its id or name
|
|
891
|
+
*
|
|
892
|
+
* @param idOrName The id or name to search for
|
|
893
|
+
* @param type The expected common type, or null for any
|
|
894
|
+
* @param options The current request options (may include a language)
|
|
895
|
+
*/
|
|
274
896
|
findObject(idOrName: string, type?: ioBroker.CommonType | null, options?: (CallOptions & {
|
|
275
897
|
language?: ioBroker.Languages;
|
|
276
898
|
}) | null): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.FindObjectCallback>>;
|
|
899
|
+
/**
|
|
900
|
+
* Add object property paths that should be preserved when an object is overwritten (controller only)
|
|
901
|
+
*
|
|
902
|
+
* @param settings One or more property paths to preserve
|
|
903
|
+
*/
|
|
277
904
|
addPreserveSettings(settings: string[] | string): void;
|
|
278
905
|
private _destroyDBHelper;
|
|
279
906
|
private _destroyDB;
|
|
907
|
+
/**
|
|
908
|
+
* Delete the whole objects database (requires admin rights)
|
|
909
|
+
*
|
|
910
|
+
* @param options The current request options including the user, or the callback
|
|
911
|
+
* @param callback Called once the database has been destroyed
|
|
912
|
+
*/
|
|
280
913
|
destroyDB(options: CallOptions | null | undefined, callback: ioBroker.ErrorCallback): void;
|
|
914
|
+
/**
|
|
915
|
+
* Promise-version of destroyDB
|
|
916
|
+
*
|
|
917
|
+
* @param options The current request options including the user
|
|
918
|
+
*/
|
|
281
919
|
destroyDBAsync(options?: CallOptions): Promise<void>;
|
|
920
|
+
/**
|
|
921
|
+
* Destructor of the class. Called when shutting down to close the redis connections.
|
|
922
|
+
*/
|
|
282
923
|
destroy(): Promise<void>;
|
|
924
|
+
/**
|
|
925
|
+
* Load and register the Lua scripts used for atomic operations on the redis server
|
|
926
|
+
*/
|
|
283
927
|
loadLuaScripts(): Promise<void>;
|
|
284
928
|
/**
|
|
285
929
|
* Get all keys matching a pattern using redis SCAN command, duplicates are filtered out
|