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