@iobroker/js-controller-adapter 7.2.3-alpha.8-20260709-8d8c9c5ed → 7.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +8 -5
  3. package/build/cjs/index.js.map +2 -2
  4. package/build/cjs/lib/_Types.d.ts +52 -374
  5. package/build/cjs/lib/adapter/adapter.d.ts +146 -1812
  6. package/build/cjs/lib/adapter/adapter.js +297 -446
  7. package/build/cjs/lib/adapter/adapter.js.map +2 -2
  8. package/build/cjs/lib/adapter/defaultObjs.d.ts +0 -5
  9. package/build/cjs/lib/adapter/defaultObjs.js +0 -2
  10. package/build/cjs/lib/adapter/defaultObjs.js.map +2 -2
  11. package/build/cjs/lib/adapter/log.d.ts +0 -25
  12. package/build/cjs/lib/adapter/log.js +0 -29
  13. package/build/cjs/lib/adapter/log.js.map +2 -2
  14. package/build/cjs/lib/adapter/userInterfaceMessagingController.d.ts +0 -10
  15. package/build/cjs/lib/adapter/userInterfaceMessagingController.js +2 -9
  16. package/build/cjs/lib/adapter/userInterfaceMessagingController.js.map +2 -2
  17. package/build/cjs/lib/adapter/utils.js +1 -15
  18. package/build/cjs/lib/adapter/utils.js.map +2 -2
  19. package/build/cjs/lib/adapter/validator.d.ts +5 -10
  20. package/build/cjs/lib/adapter/validator.js +5 -6
  21. package/build/cjs/lib/adapter/validator.js.map +2 -2
  22. package/build/esm/index.d.ts +1 -0
  23. package/build/esm/index.d.ts.map +1 -1
  24. package/build/esm/index.js +1 -0
  25. package/build/esm/index.js.map +1 -1
  26. package/build/esm/lib/_Types.d.ts +52 -374
  27. package/build/esm/lib/_Types.d.ts.map +1 -1
  28. package/build/esm/lib/adapter/adapter.d.ts +146 -1812
  29. package/build/esm/lib/adapter/adapter.d.ts.map +1 -1
  30. package/build/esm/lib/adapter/adapter.js +324 -525
  31. package/build/esm/lib/adapter/adapter.js.map +1 -1
  32. package/build/esm/lib/adapter/defaultObjs.d.ts +0 -5
  33. package/build/esm/lib/adapter/defaultObjs.d.ts.map +1 -1
  34. package/build/esm/lib/adapter/defaultObjs.js +0 -5
  35. package/build/esm/lib/adapter/defaultObjs.js.map +1 -1
  36. package/build/esm/lib/adapter/log.d.ts +0 -25
  37. package/build/esm/lib/adapter/log.d.ts.map +1 -1
  38. package/build/esm/lib/adapter/log.js +0 -25
  39. package/build/esm/lib/adapter/log.js.map +1 -1
  40. package/build/esm/lib/adapter/userInterfaceMessagingController.d.ts +0 -10
  41. package/build/esm/lib/adapter/userInterfaceMessagingController.d.ts.map +1 -1
  42. package/build/esm/lib/adapter/userInterfaceMessagingController.js +2 -8
  43. package/build/esm/lib/adapter/userInterfaceMessagingController.js.map +1 -1
  44. package/build/esm/lib/adapter/utils.d.ts.map +1 -1
  45. package/build/esm/lib/adapter/utils.js +1 -1
  46. package/build/esm/lib/adapter/utils.js.map +1 -1
  47. package/build/esm/lib/adapter/validator.d.ts +5 -10
  48. package/build/esm/lib/adapter/validator.d.ts.map +1 -1
  49. package/build/esm/lib/adapter/validator.js +5 -8
  50. package/build/esm/lib/adapter/validator.js.map +1 -1
  51. package/build/tsconfig.build.tsbuildinfo +1 -1
  52. package/package.json +20 -25
@@ -1,9 +1,6 @@
1
- /** Options passed to the adapter constructor */
2
1
  export interface AdapterOptions {
3
- /** Called with the current subscriptions whenever they change */
4
2
  subscribesChange?: (subs: Record<string, {
5
- /** String with regular expression of the subscription pattern */
6
- regex: string;
3
+ regex: RegExp;
7
4
  }>) => void;
8
5
  /** If the adapter collects logs from all adapters (experts only). Default: false */
9
6
  logTransporter?: boolean;
@@ -13,7 +10,7 @@ export interface AdapterOptions {
13
10
  subscribable?: boolean;
14
11
  /** compact group instance if running in compact mode */
15
12
  compactInstance?: number;
16
- /** if desired to have oStates. This is a list with all state values, and it will be updated automatically. */
13
+ /** if desired to have oStates. This is a list with all states values, and it will be updated automatically. */
17
14
  states?: boolean;
18
15
  /** if desired to have oObjects. This is a list with all states, channels and devices of this adapter, and it will be updated automatically.*/
19
16
  objects?: boolean;
@@ -23,19 +20,19 @@ export interface AdapterOptions {
23
20
  dirname?: string;
24
21
  /** flag which defaults to true - if true, adapter warns if states are set without a corresponding existing object */
25
22
  strictObjectChecks?: boolean;
26
- /** If true, runs in compact mode */
23
+ /** If true runs in compact mode */
27
24
  compact?: boolean;
28
25
  /** configuration of the connection to controller */
29
26
  config?: AdapterOptionsConfig;
30
- /** name of the adapter. Must be exactly the same as the directory name. */
27
+ /** name of the adapter. Must be exactly the same as directory name. */
31
28
  name: string;
32
29
  /** If true, the systemConfig (iobroker.json) will be available in this.systemConfig */
33
30
  systemConfig?: boolean;
34
31
  /** callback function (id, obj) that will be called if an object changed */
35
32
  objectChange?: ioBroker.ObjectChangeHandler;
36
- /** callback function (id, obj) that will be called if the state changed */
33
+ /** callback function (id, obj) that will be called if state changed */
37
34
  stateChange?: ioBroker.StateChangeHandler;
38
- /** callback function (id, file) that will be called if the file changed */
35
+ /** callback function (id, file) that will be called if file changed */
39
36
  fileChange?: ioBroker.FileChangeHandler;
40
37
  /** callback function that will be called when a new UI client subscribes */
41
38
  uiClientSubscribe?: UserInterfaceClientSubscribeHandler;
@@ -59,7 +56,6 @@ type MessageUnsubscribeReason = 'client' | 'disconnect';
59
56
  export type ClientUnsubscribeReason = MessageUnsubscribeReason | 'clientSubscribeError';
60
57
  type UserInterfaceClientUnsubscribeReason = ClientUnsubscribeReason | 'timeout';
61
58
  type Invoice = 'free' | (string & {});
62
- /** A license that may be suitable for use by an adapter */
63
59
  export interface SuitableLicense {
64
60
  /** Name of the license type, not necessarily matching adapter */
65
61
  product: string;
@@ -71,46 +67,36 @@ export interface SuitableLicense {
71
67
  json: string;
72
68
  /** If it is a free license or not */
73
69
  invoice: Invoice;
74
- /** The adapter instance that uses this license */
70
+ /** The adapter instance which uses this license */
75
71
  usedBy?: string;
76
72
  /** Version for which this license is valid */
77
73
  version: string;
78
- /** License is only valid for a given UUID */
74
+ /** License is only valid for given UUID */
79
75
  uuid?: string;
80
76
  /** License if valid until this date 0000-00-00 00:00:00 if unlimited */
81
77
  validTill: string;
82
78
  /** License is only valid for X number of datapoints */
83
79
  datapoints?: number;
84
- /** Decoded property from JWT verifies on JSON content with cloud cert */
80
+ /** Decoded property from jwt verify on json content with cloud cert */
85
81
  decoded: {
86
- /** E-Mail of a license owner */
82
+ /** E-Mail of license owner */
87
83
  email: string;
88
- /** Free text comment */
89
84
  comment: string;
90
- /** License type, e.g. private */
85
+ /** License type, eg private */
91
86
  type: string;
92
87
  /** Adapter name */
93
88
  name: string;
94
- /** Address of a license owner */
89
+ /** Address of license owner */
95
90
  address: {
96
- /** Country of the license owner */
97
91
  Country: string;
98
- /** Name of the license owner */
99
92
  Name: string;
100
- /** First address line */
101
93
  AddressLine1: string;
102
- /** Second address line */
103
94
  AddressLine2: string;
104
- /** ZIP / postal code */
105
95
  ZIP: string;
106
- /** City of the license owner */
107
96
  City: string;
108
97
  };
109
- /** License type identifier */
110
98
  ltype: string;
111
- /** Country code of the license owner */
112
99
  country: string;
113
- /** Whether the license owner is within the EU */
114
100
  eu: string;
115
101
  /** VAT in percent */
116
102
  vatP: 19;
@@ -120,21 +106,18 @@ export interface SuitableLicense {
120
106
  vat: number;
121
107
  /** Date when license expires */
122
108
  expires: number;
123
- /** How long a license is valid, always in the future if valid */
109
+ /** How long license is valid, always in future if valid */
124
110
  valid_till: string;
125
- /** Unique id of the license */
126
111
  id: string;
127
- /** Issued-at timestamp of the JWT */
128
112
  iat: number;
129
113
  /** Version for which this license is valid */
130
- version: string | number;
131
- /** License is only valid for a given UUID */
114
+ version: string;
115
+ /** License is only valid for given UUID */
132
116
  uuid?: string;
133
117
  /** If it is a free license or not */
134
118
  invoice: Invoice;
135
119
  };
136
120
  }
137
- /** Information about a UI client subscription */
138
121
  export interface UserInterfaceSubscribeInfo {
139
122
  /** The client id, which can be used to send information to clients */
140
123
  clientId: string;
@@ -142,7 +125,6 @@ export interface UserInterfaceSubscribeInfo {
142
125
  message: ioBroker.Message;
143
126
  }
144
127
  export type UserInterfaceClientSubscribeHandler = (subscribeInfo: UserInterfaceSubscribeInfo) => UserInterfaceClientSubscribeReturnType | Promise<UserInterfaceClientSubscribeReturnType>;
145
- /** Result returned by the adapter when a UI client subscribes */
146
128
  export interface UserInterfaceClientSubscribeReturnType {
147
129
  /** If the adapter has accepted the client subscription */
148
130
  accepted: boolean;
@@ -158,7 +140,6 @@ type UserInterfaceUnsubscribeInfoBaseObject = {
158
140
  export type UserInterfaceUnsubscribeInfo = UserInterfaceUnsubscribeInfoBaseObject & ({
159
141
  /** Reason for unsubscribing */
160
142
  reason: Exclude<UserInterfaceClientUnsubscribeReason, ClientUnsubscribeReason>;
161
- /** No message is present for this unsubscribe reason */
162
143
  message?: undefined;
163
144
  } | {
164
145
  /** Reason for unsubscribing */
@@ -168,195 +149,106 @@ export type UserInterfaceUnsubscribeInfo = UserInterfaceUnsubscribeInfoBaseObjec
168
149
  });
169
150
  export type UserInterfaceClientUnsubscribeHandler = (unsubscribeInfo: UserInterfaceUnsubscribeInfo) => void | Promise<void>;
170
151
  export type UserInterfaceClientRemoveMessage = (Omit<ioBroker.Message, 'message' | 'command'> & {
171
- /** Command identifying this as a client unsubscribe message */
172
152
  command: 'clientUnsubscribe';
173
- /** Details of the "unsubscribe" */
174
153
  message: {
175
- /** Reason for unsubscribing */
176
154
  reason: MessageUnsubscribeReason;
177
- /** The subscription types affected */
178
155
  type: string[];
179
156
  };
180
157
  }) | (Omit<ioBroker.Message, 'message' | 'command'> & {
181
- /** Command identifying this as a client subscribe error message */
182
158
  command: 'clientSubscribeError';
183
- /** Details of the subscribe error */
184
159
  message: {
185
- /** No reason is provided for a subscribe error */
186
160
  reason: undefined;
187
- /** The subscription types affected */
188
161
  type: string[];
189
162
  };
190
163
  });
191
164
  export type Pattern = string | string[];
192
- /** Subset of the adapter config relevant for the connection to the controller */
193
165
  export interface AdapterOptionsConfig {
194
- /** Logging configuration */
195
166
  log: {
196
- /** The log level to use */
197
167
  level: ioBroker.LogLevel;
198
168
  };
199
169
  }
200
- /** Internal options for formatting a date */
201
170
  export interface InternalFormatDateOptions {
202
- /** The date to format, as Date, timestamp or string */
203
171
  dateObj: string | Date | number;
204
- /** Whether the value represents a duration instead of a point in time */
205
172
  isDuration: boolean;
206
- /** Optional explicit format string */
207
173
  _format?: string;
208
174
  }
209
- /** Details about an alias and its targets */
210
175
  export interface AliasDetails {
211
- /** Source definition of the alias */
212
176
  source?: AliasDetailsSource;
213
- /** Target states the alias points to */
214
177
  targets: AliasTargetEntry[];
215
178
  }
216
- /** Source definition of an alias */
217
179
  export interface AliasDetailsSource {
218
- /** Minimum value of the source */
219
180
  min?: number;
220
- /** Maximum value of the source */
221
181
  max?: number;
222
- /** Common type of the source */
223
182
  type?: ioBroker.CommonType;
224
- /** Unit of the source value */
225
183
  unit?: string;
226
184
  }
227
- /** A single target of an alias */
228
185
  export interface AliasTargetEntry {
229
- /** Alias definition of the target's common section */
230
186
  alias: ioBroker.StateCommon['alias'];
231
- /** The id of the target state */
232
187
  id: string;
233
- /** The subscription pattern of the target */
234
188
  pattern: string;
235
- /** Common type of the target */
236
189
  type?: ioBroker.CommonType;
237
- /** Maximum value of the target */
238
190
  max?: number;
239
- /** Minimum value of the target */
240
191
  min?: number;
241
- /** Unit of the target value */
242
192
  unit?: string;
243
193
  }
244
- /** Result of checking a set of states */
245
194
  export interface CheckStatesResult {
246
- /** The matching state objects */
247
195
  objs: ioBroker.StateObject[];
248
- /** The matching state ids */
249
196
  ids: string[];
250
197
  }
251
- /** Result of setting a state only if it changed */
252
198
  export interface SetStateChangedResult {
253
- /** Whether the state value was unchanged */
254
199
  notChanged: boolean;
255
- /** The id of the state */
256
200
  id: string;
257
201
  }
258
- /** Options for resolving the groups of a user */
259
202
  export interface GetUserGroupsOptions {
260
- /** The user whose groups should be resolved */
261
- user: ioBroker.ObjectIDs.User;
262
- /** The groups already resolved for the user */
263
- groups?: ioBroker.ObjectIDs.Group[];
264
- /** Cache of state objects used while resolving */
265
- _objects?: (ioBroker.StateObject | null)[];
266
- /** Whether the groups have already been resolved */
267
- checked?: boolean;
268
- /** The permissions resolved for the user */
269
- acl: Omit<ioBroker.PermissionSet, 'user' | 'groups'>;
270
- /** Whether to limit the result to the rights of the owner */
271
- limitToOwnerRights?: boolean;
203
+ user: `system.user.${string}`;
204
+ [other: string]: any;
272
205
  }
273
206
  export type CheckStateCommand = 'getState' | 'setState' | 'delState';
274
207
  export type MaybePromise = Promise<void> | void;
275
- /** Options for storing a session */
276
208
  export interface InternalSetSessionOptions {
277
- /** The session id */
278
209
  id: string;
279
- /** Time to live in seconds */
280
210
  ttl: number;
281
- /** The session data to store */
282
- data: ioBroker.Session;
283
- /** Called once the session has been stored */
211
+ data: Record<string, any>;
284
212
  callback?: ioBroker.ErrorCallback;
285
213
  }
286
- /** Options for reading a session */
287
214
  export interface InternalGetSessionOptions {
288
- /** The session id */
289
215
  id: string;
290
- /** Called with the session data */
291
216
  callback: ioBroker.GetSessionCallback;
292
217
  }
293
- /** Options for destroying a session */
294
218
  export interface InternalDestroySessionOptions {
295
- /** The session id */
296
219
  id: string;
297
- /** Called once the session has been destroyed */
298
220
  callback?: ioBroker.ErrorCallback;
299
221
  }
300
- /** Options for finding a free port */
301
222
  export interface InternalGetPortOptions {
302
- /** The preferred port to start searching from */
303
223
  port: number;
304
- /** The host to bind to */
305
224
  host?: string;
306
- /** Called with the free port that was found */
307
225
  callback?: (port: number) => void;
308
226
  }
309
227
  export type CheckPasswordCallback = (success: boolean, user: string) => void;
310
- /** Options for checking a user's password */
311
228
  export interface InternalCheckPasswordOptions {
312
- /** The user to check */
313
229
  user: string;
314
- /** The password to verify */
315
230
  pw: string;
316
- /** Optional settings including the user context */
317
- options?: {
318
- user?: ioBroker.ObjectIDs.User;
319
- } | null;
320
- /** Called with the result of the check */
231
+ options?: Record<string, any> | null;
321
232
  callback: CheckPasswordCallback;
322
233
  }
323
- /** Options for resolving a user id */
324
234
  export interface InternalGetUserIDOptions {
325
- /** The user name to resolve */
326
235
  username: string;
327
236
  }
328
- /** Options for setting a user's password */
329
237
  export interface InternalSetPasswordOptions {
330
- /** The user whose password is set */
331
238
  user: string;
332
- /** The new password */
333
239
  pw: string;
334
- /** Optional settings including the user context */
335
- options?: {
336
- user?: ioBroker.ObjectIDs.User;
337
- } | null;
338
- /** Called once the password has been set */
240
+ options?: Record<string, any> | null;
339
241
  callback?: ioBroker.ErrorCallback;
340
242
  }
341
243
  export type CheckGroupCallback = (result: boolean) => void;
342
- /** Options for checking whether a user belongs to a group */
343
244
  export interface InternalCheckGroupOptions {
344
- /** The user to check */
345
245
  user: string;
346
- /** The group to check membership of */
347
246
  group: string;
348
- /** Optional settings including the user context */
349
- options?: {
350
- user?: ioBroker.ObjectIDs.User;
351
- } | null;
352
- /** Called with the result of the check */
247
+ options?: Record<string, any> | null;
353
248
  callback?: CheckGroupCallback;
354
249
  }
355
- /** A single command permission requirement */
356
250
  export type CommandsPermissionsEntry = {
357
- /** The object category the permission applies to */
358
251
  type: 'object' | 'state' | '' | 'other' | 'file';
359
- /** The operation requiring the permission */
360
252
  operation: string;
361
253
  };
362
254
  export type CommandsPermissionsObject = {
@@ -364,9 +256,8 @@ export type CommandsPermissionsObject = {
364
256
  };
365
257
  export type CommandsPermissions = CommandsPermissionsObject | CommandsPermissionsEntry[];
366
258
  export type CalculatePermissionsCallback = (result: ioBroker.PermissionSet) => void;
367
- /** Options for sending data to a UI client */
368
259
  export interface SendToUserInterfaceClientOptions {
369
- /** id of the UI client, if not given, send it to all active clients */
260
+ /** id of the UI client, if not given send to all active clients */
370
261
  clientId?: string;
371
262
  /** data to send to the client */
372
263
  data: unknown;
@@ -374,270 +265,135 @@ export interface SendToUserInterfaceClientOptions {
374
265
  export type AllPropsUnknown<T> = {
375
266
  [K in keyof T]: unknown;
376
267
  };
377
- /** Options for calculating the permissions of a user */
378
268
  export interface InternalCalculatePermissionsOptions {
379
- /** The user to calculate the permissions for */
380
- user: ioBroker.ObjectIDs.User;
381
- /** The permission requirements of the commands */
269
+ user: string;
382
270
  commandsPermissions: CommandsPermissions;
383
- /** Optional settings including the user context */
384
- options?: {
385
- user?: ioBroker.ObjectIDs.User;
386
- } | null;
387
- /** Called with the calculated permission set */
271
+ options?: Record<string, any> | null;
388
272
  callback?: CalculatePermissionsCallback;
389
273
  }
390
274
  export type GetCertificatesCallback = (err?: Error | null, certs?: ioBroker.Certificates, useLetsEncryptCert?: boolean) => void;
391
275
  export type GetCertificatesPromiseReturnType = [cert: ioBroker.Certificates, useLetsEncryptCert?: boolean];
392
- /** Options for reading the SSL certificates */
393
276
  export interface InternalGetCertificatesOptions {
394
- /** Name of the public certificate */
395
277
  publicName?: string;
396
- /** Name of the private key */
397
278
  privateName?: string;
398
- /** Name of the chained certificate */
399
279
  chainedName?: string;
400
- /** Called with the certificates */
401
280
  callback?: GetCertificatesCallback;
402
281
  }
403
- /** Options for updating the adapter config */
404
282
  export interface InternalUpdateConfigOptions {
405
- /** The new configuration values */
406
283
  newConfig: Record<string, any>;
407
284
  }
408
285
  export type GetEncryptedConfigCallback = (error: Error | null | undefined, result?: string | string[]) => void;
409
- /** Options for reading an encrypted config value */
410
286
  export interface InternalGetEncryptedConfigOptions {
411
- /** The config attribute to decrypt */
412
287
  attribute: string;
413
- /** Called with the decrypted value */
414
288
  callback?: GetEncryptedConfigCallback;
415
289
  }
416
290
  export type TimeoutCallback = (...args: any[]) => void;
417
- /** Options for setting an object */
418
291
  export interface InternalSetObjectOptions {
419
- /** The id of the object */
420
292
  id: string;
421
- /** Optional settings including the user context */
422
- options?: {
423
- user?: ioBroker.ObjectIDs.User;
424
- preserve?: {
425
- [key: string]: boolean;
426
- };
427
- } | null;
428
- /** The object to set */
293
+ options?: Record<string, any> | null;
429
294
  obj: ioBroker.SettableObject;
430
- /** Called once the object has been set */
431
295
  callback?: ioBroker.SetObjectCallback;
432
296
  }
433
- /** Options for deleting a state */
434
297
  export interface InternalDelStateOptions {
435
- /** The id of the state */
436
298
  id: string;
437
- /** Optional settings including the user context */
438
- options?: {
439
- user?: ioBroker.ObjectIDs.User;
440
- } | null;
441
- /** Called once the state has been deleted */
299
+ options?: Record<string, any> | null;
442
300
  callback?: ioBroker.ErrorCallback;
443
301
  }
444
- /** Options for reading an object */
445
- export interface InternalGetObjectOptions<T extends string = string> {
446
- /** The id of the object */
302
+ export interface InternalGetObjectOptions {
447
303
  id: string;
448
- /** Optional settings including the user context */
449
- options: {
450
- user?: ioBroker.ObjectIDs.User;
451
- } | null | undefined;
452
- /** Called with the object */
453
- callback?: ioBroker.GetObjectCallback<T>;
454
- }
455
- /** Options for reading the history of a state */
304
+ options: unknown;
305
+ callback?: ioBroker.GetObjectCallback<any>;
306
+ }
456
307
  export interface InternalGetHistoryOptions {
457
- /** The id of the state */
458
308
  id: string;
459
- /** Options controlling the history query */
460
309
  options?: ioBroker.GetHistoryOptions | null;
461
- /** Called with the history data */
462
310
  callback: ioBroker.GetHistoryCallback;
463
311
  }
464
- /** Options for reading multiple objects */
465
312
  export interface InternalGetObjectsOptions {
466
- /** The pattern to match object ids against */
467
313
  pattern: Pattern;
468
- /** Restrict the result to objects of this type */
469
314
  type?: string;
470
- /** Restrict the result to objects within these enums */
471
315
  enums?: ioBroker.EnumList;
472
- /** Optional settings including the user context */
473
- options?: {
474
- user?: ioBroker.ObjectIDs.User;
475
- } | null;
476
- /** Called with the matching objects */
316
+ options?: Record<string, any> | null;
477
317
  callback?: ioBroker.GetObjectsCallbackTyped<any>;
478
318
  }
479
- /** Options for reading the channels of a device */
480
319
  export interface InternalGetChannelsOfOptions {
481
- /** The parent device to read the channels of */
482
320
  parentDevice?: string;
483
- /** Called with the channels */
484
321
  callback?: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>;
485
- /** Optional settings including the user context */
486
- options?: {
487
- user?: ioBroker.ObjectIDs.User;
488
- } | null;
322
+ options?: Record<string, any> | null;
489
323
  }
490
- /** Options for reading all objects of the adapter */
491
324
  export interface InternalGetAdapterObjectsOptions {
492
- /** Called with the adapter's objects */
493
325
  callback?: (objects: Record<string, ioBroker.AdapterScopedObject>) => void;
494
326
  }
495
- /** Options for querying an object view */
496
327
  export interface InternalGetObjectViewOptions {
497
- /** The design document name */
498
328
  design: string;
499
- /** The view name within the design document */
500
329
  search: string;
501
- /** Query parameters such as startkey and endkey */
502
330
  params: ioBroker.GetObjectViewParams;
503
- /** Optional settings including the user context */
504
- options?: {
505
- user?: ioBroker.ObjectIDs.User;
506
- } | null;
507
- /** Called with the matching rows */
331
+ options?: Record<string, any> | null;
508
332
  callback?: ioBroker.GetObjectViewCallback<ioBroker.AnyObject>;
509
333
  }
510
- /** Options for reading a single enum */
511
334
  export interface InternalGetEnumOptions {
512
- /** The name of the enum to read */
513
335
  _enum: string;
514
- /** Optional settings including the user context */
515
- options?: {
516
- user?: ioBroker.ObjectIDs.User;
517
- } | null;
518
- /** Called with the enum */
336
+ options?: Record<string, any> | null;
519
337
  callback?: ioBroker.GetEnumCallback;
520
338
  }
521
- /** Options for reading multiple enums */
522
339
  export interface InternalGetEnumsOptions {
523
- /** The list of enums to read */
524
340
  _enumList?: ioBroker.EnumList;
525
- /** Optional settings including the user context */
526
- options?: {
527
- user?: ioBroker.ObjectIDs.User;
528
- } | null;
529
- /** Called with the enums */
341
+ options?: Record<string, any> | null;
530
342
  callback?: ioBroker.GetEnumsCallback;
531
343
  }
532
- /** Options for deleting an object */
533
344
  export interface InternalDelObjectOptions {
534
- /** The id of the object */
535
345
  id: string;
536
- /** Options controlling the deletion */
537
346
  options?: ioBroker.DelObjectOptions | null;
538
- /** Called once the object has been deleted */
539
347
  callback?: ioBroker.ErrorCallback;
540
348
  }
541
- /** Options for creating a device */
542
349
  export interface InternalCreateDeviceOptions {
543
- /** The name of the device */
544
350
  deviceName: string;
545
- /** The common section of the device object */
546
351
  common?: Partial<ioBroker.DeviceCommon>;
547
- /** The native section of the device object */
548
352
  _native?: Record<string, any> | null;
549
- /** Optional settings including the user context */
550
- options?: {
551
- user?: ioBroker.ObjectIDs.User;
552
- } | null;
553
- /** Called once the device has been created */
353
+ options: unknown;
554
354
  callback?: ioBroker.SetObjectCallback;
555
355
  }
556
- /** Options for setting a state */
557
356
  export interface InternalSetStateOptions {
558
- /** The id of the state, or an id object */
559
357
  id: string | ioBroker.IdObject;
560
- /** The value (or full state object) to set */
561
358
  state: ioBroker.StateValue | ioBroker.SettableState;
562
- /** Whether the state should be acknowledged */
563
359
  ack?: boolean;
564
- /** Optional settings including the user context */
565
- options?: {
566
- user?: ioBroker.ObjectIDs.User;
567
- } | null;
568
- /** Called once the state has been set */
360
+ options?: Partial<GetUserGroupsOptions> | null;
569
361
  callback?: ioBroker.SetStateCallback;
570
362
  }
571
- /** Options for setting a state only if it changed */
572
363
  export interface InternalSetStateChangedOptions extends InternalSetStateOptions {
573
- /** Called with whether the state was changed */
574
364
  callback?: ioBroker.SetStateChangedCallback;
575
365
  }
576
- /** Options for creating a state */
577
366
  export interface InternalCreateStateOptions {
578
- /** The parent device name */
579
367
  parentDevice: string;
580
- /** The parent channel name */
581
368
  parentChannel: string;
582
- /** The name of the state */
583
369
  stateName: string;
584
- /** The common section of the state object */
585
370
  common: Partial<ioBroker.StateCommon>;
586
- /** The native section of the state object */
587
371
  _native: Record<string, any>;
588
- /** Optional settings including the user context */
589
- options?: {
590
- user?: ioBroker.ObjectIDs.User;
591
- } | null;
592
- /** Called once the state has been created */
372
+ options?: Record<string, any> | null;
593
373
  callback?: ioBroker.SetObjectCallback;
594
374
  }
595
- /** Options for subscribing to states or objects */
596
375
  export interface InternalSubscribeOptions {
597
- /** The pattern to subscribe to */
598
376
  pattern: Pattern;
599
- /** Optional settings including the user context */
600
- options?: {
601
- user?: ioBroker.ObjectIDs.User;
602
- } | null;
603
- /** Called once the subscription is registered */
377
+ options?: Record<string, any> | null;
604
378
  callback?: ioBroker.ErrorCallback;
605
379
  }
606
- /** Options for adding a channel to an enum */
607
380
  export interface InternalAddChannelToEnumOptions {
608
- /** The category of the enum (e.g. rooms, functions) */
609
381
  enumName: string;
610
- /** The enum id to add the channel to */
611
382
  addTo: string;
612
- /** The parent device name */
613
383
  parentDevice: string;
614
- /** The name of the channel */
615
384
  channelName: string;
616
- /** Optional settings including the user context */
617
- options?: {
618
- user?: ioBroker.ObjectIDs.User;
619
- } | null;
620
- /** Called once the channel has been added */
385
+ options?: Record<string, any> | null;
621
386
  callback?: ioBroker.ErrorCallback;
622
387
  }
623
- /** Options controlling how a message is sent */
624
388
  export interface SendToOptions {
625
- /** Method throws or calls error cb if callback not called in time, works for single targets only */
389
+ /** Method throws or calls error cb, if callback not called in time, works for single targets only */
626
390
  timeout?: number;
627
- /** The user on whose behalf the message is sent */
628
- user?: ioBroker.ObjectIDs.User;
629
391
  }
630
- /** Options for sending a message to another instance */
631
392
  export interface InternalSendToOptions {
632
- /** The instance to send the message to */
633
393
  instanceName: string;
634
- /** The command to send */
635
394
  command: string;
636
- /** The message payload */
637
395
  message: any;
638
- /** Called with the response */
639
396
  callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo;
640
- /** Additional send options */
641
397
  options?: SendToOptions;
642
398
  }
643
399
  /** Message Callback used internally */
@@ -649,161 +405,85 @@ export interface MessageCallbackObject {
649
405
  /** An optional timer, if a timeout has been specified */
650
406
  timer?: NodeJS.Timeout;
651
407
  }
652
- /** Options for sending a message to a host */
653
408
  export interface InternalSendToHostOptions {
654
- /** if null, send it to all hosts */
409
+ /** if null, send to all hosts */
655
410
  hostName: string | null;
656
- /** The command to send */
657
411
  command: string;
658
- /** The message payload */
659
412
  message: any;
660
- /** Called with the response */
661
413
  callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo;
662
414
  }
663
- /** Options for reading a state */
664
415
  export interface InternalGetStateOptions {
665
- /** The id of the state */
666
416
  id: string;
667
- /** Optional settings including the user context */
668
- options?: {
669
- user?: ioBroker.ObjectIDs.User;
670
- } | null;
671
- /** Called with the state */
417
+ options?: Record<string, any> | null;
672
418
  callback?: ioBroker.GetStateCallback;
673
419
  }
674
- /** Options for reading multiple states */
675
420
  export interface InternalGetStatesOptions {
676
- /** The pattern to match state ids against */
677
421
  pattern: Pattern;
678
- /** Optional settings including the user context */
679
- options: {
680
- user?: ioBroker.ObjectIDs.User;
681
- _objects?: (ioBroker.StateObject | null)[];
682
- checked?: boolean;
683
- maintenance?: boolean;
684
- };
685
- /** Called with the matching states */
422
+ options: Record<string, any>;
686
423
  callback: ioBroker.GetStatesCallback;
687
424
  }
688
- /** Options for deleting a device */
689
425
  export interface InternalDeleteDeviceOptions {
690
- /** The name of the device */
691
426
  deviceName: string;
692
- /** Called once the device has been deleted */
693
427
  callback?: ioBroker.ErrorCallback;
694
428
  }
695
- /** Options for removing a channel from an enum */
696
429
  export interface InternalDeleteChannelFromEnumOptions {
697
- /** The category of the enum (e.g. rooms, functions) */
698
430
  enumName: string;
699
- /** The parent device name */
700
431
  parentDevice: string;
701
- /** The name of the channel */
702
432
  channelName: string;
703
- /** Optional settings including the user context */
704
- options?: {
705
- user?: ioBroker.ObjectIDs.User;
706
- } | null;
707
- /** Called once the channel has been removed */
433
+ options?: Record<string, any> | null;
708
434
  callback?: ioBroker.ErrorCallback;
709
435
  }
710
- /** Options for deleting a channel */
711
436
  export interface InternalDeleteChannelOptions {
712
- /** The parent device name */
713
437
  parentDevice: string;
714
- /** The name of the channel */
715
438
  channelName: string;
716
- /** Called once the channel has been deleted */
717
439
  callback?: ioBroker.ErrorCallback;
718
440
  }
719
- /** Options for deleting a state by device/channel/name */
720
441
  export interface InternalDeleteStateOptions {
721
- /** The parent device name */
722
442
  parentDevice: string;
723
- /** The parent channel name */
724
443
  parentChannel: string;
725
- /** The name of the state */
726
444
  stateName: string;
727
- /** Optional settings including the user context */
728
- options?: {
729
- user?: ioBroker.ObjectIDs.User;
730
- } | null;
731
- /** Called once the state has been deleted */
445
+ options?: Record<string, any> | null;
732
446
  callback?: ioBroker.ErrorCallback;
733
447
  }
734
- /** Options for reading all devices */
735
448
  export interface InternalGetDevicesOptions {
736
- /** Optional settings including the user context */
737
- options?: {
738
- user?: ioBroker.ObjectIDs.User;
739
- } | null;
740
- /** Called with the devices */
449
+ options?: Record<string, any> | null;
741
450
  callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>;
742
451
  }
743
- /** Options for reading the states of a device or channel */
744
452
  export interface InternalGetStatesOfOptions {
745
- /** The parent device name */
746
453
  parentDevice: string | null | undefined;
747
- /** The parent channel name */
748
454
  parentChannel: string | null | undefined;
749
- /** Optional settings including the user context */
750
- options?: {
751
- user?: ioBroker.ObjectIDs.User;
752
- } | null;
753
- /** Called with the states */
455
+ options?: Record<string, any> | null;
754
456
  callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>;
755
457
  }
756
- /** Options for adding a state to an enum */
757
458
  export interface InternalAddStateToEnumOptions {
758
- /** The category of the enum (e.g. rooms, functions) */
759
459
  enumName: string;
760
- /** The enum id to add the state to */
761
460
  addTo: string;
762
- /** The parent device name */
763
461
  parentDevice: string;
764
- /** The parent channel name */
765
462
  parentChannel: string;
766
- /** The name of the state */
767
463
  stateName: string;
768
- /** Optional settings including the user context */
769
- options?: {
770
- user?: ioBroker.ObjectIDs.User;
771
- } | null;
772
- /** Called once the state has been added */
464
+ options?: Record<string, any> | null;
773
465
  callback?: ioBroker.ErrorCallback;
774
466
  }
775
- /** Options for removing a state from an enum */
776
467
  export interface InternalDeleteStateFromEnumOptions {
777
- /** The category of the enum (e.g. rooms, functions) */
778
468
  enumName: string;
779
- /** The parent device name */
780
469
  parentDevice: string;
781
- /** The parent channel name */
782
470
  parentChannel: string;
783
- /** The name of the state */
784
471
  stateName: string;
785
- /** Optional settings including the user context */
786
- options?: {
787
- user?: ioBroker.ObjectIDs.User;
788
- } | null;
789
- /** Called once the state has been removed */
472
+ options?: Record<string, any> | null;
790
473
  callback?: ioBroker.ErrorCallback;
791
474
  }
792
- /** Options for reporting a deprecation warning */
793
475
  export interface InternalReportDeprecationOption {
794
476
  /** Version in which this warning will throw an error instead */
795
477
  version?: string;
796
478
  /** The log line to report */
797
479
  deprecationMessage: string;
798
480
  }
799
- /** Parameters controlling how the adapter stops */
800
481
  export interface StopParameters {
801
482
  /** Specify an optional exit code */
802
483
  exitCode?: number;
803
484
  /** Specify an optional reason for stoppage */
804
485
  reason?: string;
805
486
  }
806
- /** Internal parameters controlling how the adapter stops */
807
487
  export interface InternalStopParameters extends StopParameters {
808
488
  /** If mode is schedule or once */
809
489
  isPause?: boolean;
@@ -817,12 +497,10 @@ export interface InternalStopParameters extends StopParameters {
817
497
  * Only use it like `this.config as InternalAdapterConfig`
818
498
  */
819
499
  export type InternalAdapterConfig = Record<string, unknown>;
820
- /** Options for installing a node module */
821
500
  export interface InstallNodeModuleOptions {
822
- /** Version of the node module */
501
+ /** Version of node module */
823
502
  version: string;
824
503
  }
825
- /** Internal options for installing a node module */
826
504
  export interface InternalInstallNodeModuleOptions extends InstallNodeModuleOptions {
827
505
  /** Name of the npm module or an installable url ẁorking with `npm install` */
828
506
  moduleNameOrUrl: string;
@@ -832,7 +510,7 @@ export interface InternalInstallNodeModuleOptions extends InstallNodeModuleOptio
832
510
  */
833
511
  export interface NotificationOptions {
834
512
  /**
835
- * Additional context for the notification that can be used by notification-processing adapters
513
+ * Additional context for the notification which can be used by notification processing adapters
836
514
  */
837
515
  contextData: ioBroker.NotificationContextData;
838
516
  }