@iobroker/js-controller-adapter 7.2.3 → 8.0.0-alpha.1-20260921-e5941ca8a

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