@iobroker/types 7.2.5 → 8.0.0-alpha.11-20261103-58da667b3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/config.d.ts CHANGED
@@ -6,7 +6,7 @@ interface DatabaseBackupOptions {
6
6
  /** All backups older than configured hours will be deleted. But only if the number of files is greater than of backupNumber */
7
7
  hours: number;
8
8
  '// hours': string;
9
- /** By default backup every 2 hours. Time is in minutes. To disable backup set the value to 0 */
9
+ /** By default, backup every 2 hours. Time is in minutes. To disable backup set the value to 0 */
10
10
  period: number;
11
11
  '// period': string;
12
12
  /** Absolute path to back-up directory or empty to back-up in data directory */
@@ -46,41 +46,100 @@ interface JsonlOptions {
46
46
  };
47
47
  }
48
48
 
49
+ interface DatabaseConnectionOptions {
50
+ /** Password used to authenticate against the database */
51
+ auth_pass: string;
52
+ /** Maximum delay in milliseconds between reconnection attempts */
53
+ retry_max_delay?: number;
54
+ /** Maximum number of reconnection attempts */
55
+ retry_max_count: number;
56
+ /** As soon as the tls property is defined, redis will try to connect via tls (currently only for redis) */
57
+ tls?: {
58
+ /** Needs to be false with self-signed certs */
59
+ rejectUnauthorized?: boolean;
60
+ /** The certificate content */
61
+ ca?: string;
62
+ /** The key file content */
63
+ key?: string;
64
+ /** The cert file content */
65
+ cert?: string;
66
+ };
67
+
68
+ // Redis options
69
+ port?: number | number[];
70
+ host?: string | string[];
71
+ /**
72
+ * 4 (IPv4) or 6 (IPv6), Defaults to 4.
73
+ */
74
+ family?: number;
75
+ /**
76
+ * Local domain socket path. If set the port, host and family will be ignored.
77
+ */
78
+ path?: string;
79
+ connectionName?: string;
80
+ /**
81
+ * If set, client will send AUTH command with the value of this option when connected.
82
+ */
83
+ password?: string;
84
+ /**
85
+ * Database index to use.
86
+ */
87
+ db?: number;
88
+ /**
89
+ * When a connection is established to the Redis server, the server might still be loading
90
+ * the database from disk. While loading, the server not respond to any commands.
91
+ * To work around this, when this option is true, ioredis will check the status of the Redis server,
92
+ * and when the Redis server is able to process commands, a ready event will be emitted.
93
+ */
94
+ enableReadyCheck?: boolean;
95
+ /**
96
+ * When the return value isn't a number, ioredis will stop trying to reconnect.
97
+ * Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
98
+ */
99
+ retryStrategy?(times: number): number | Error;
100
+ /**
101
+ * After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels.
102
+ * default: true.
103
+ */
104
+ autoResubscribe?: boolean;
105
+ /**
106
+ * default: null.
107
+ */
108
+ name?: string;
109
+ sentinels?: Array<{ host: string; port: number }>;
110
+ }
111
+
112
+ /** Configuration of a database connection (objects or states) */
49
113
  export interface DatabaseOptions {
50
114
  /** Possible values: 'file' - [port 9001], 'jsonl' - [port 9001], 'redis' - [port 6379 or 26379 for sentinel]. */
51
115
  type: 'jsonl' | 'file' | 'redis';
116
+ /** Name of the sentinel master to connect to */
52
117
  sentinelName?: string;
118
+ /** Host name(s) or IP address(es) of the database server */
53
119
  host: string | string[];
120
+ /** Port(s) of the database server */
54
121
  port: number | number[];
122
+ /** Maximum time in milliseconds to wait for a connection to be established */
55
123
  connectTimeout: number;
124
+ /** Interval in milliseconds between flushing the in-memory database to file */
56
125
  writeFileInterval: number;
126
+ /** Directory where the database files are stored, relative to the controller dir */
57
127
  dataDir?: string;
58
- options: {
59
- auth_pass: string;
60
- retry_max_delay: number;
61
- retry_max_count: number;
62
- db: number;
63
- family: number;
64
- /** As soon as the tls property is defined, redis will try to connect via tls (currently only for redis) */
65
- tls?: {
66
- /** Needs to be false with self-signed certs */
67
- rejectUnauthorized?: boolean;
68
- /** The certificate content */
69
- ca?: string;
70
- /** The key file content */
71
- key?: string;
72
- /** The cert file content */
73
- cert?: string;
74
- };
75
- };
128
+ /** Low-level connection options passed to the database driver */
129
+ options: DatabaseConnectionOptions;
130
+ /** Backup configuration for the database */
76
131
  backup: DatabaseBackupOptions;
132
+ /** Options specific to the JSONL database backend */
77
133
  jsonlOptions: JsonlOptions;
78
134
  }
79
135
 
136
+ /** Configuration of the objects database connection */
80
137
  export interface ObjectsDatabaseOptions extends DatabaseOptions {
138
+ /** Disable the in-memory file cache for objects */
81
139
  noFileCache: boolean;
82
140
  }
83
141
 
142
+ /** Configuration of the states database connection */
84
143
  export interface StatesDatabaseOptions extends DatabaseOptions {
85
144
  /** Limit maximum number of log entries in the list (only read by adapter.ts from the config file) */
86
145
  maxQueue: number;
@@ -90,6 +149,7 @@ export interface StatesDatabaseOptions extends DatabaseOptions {
90
149
  * The ioBroker global config
91
150
  */
92
151
  export interface IoBJson {
152
+ /** System-wide controller settings */
93
153
  system: {
94
154
  /** Do not use more than memory limit mb by ioB process (0 to deactivate) */
95
155
  memoryLimitMB: number;
@@ -116,14 +176,18 @@ export interface IoBJson {
116
176
  memLimitError: number;
117
177
  '// memLimitError': string;
118
178
  };
179
+ /** Configuration of the multihost service used to connect several ioBroker hosts */
119
180
  multihostService: {
120
181
  enabled: boolean;
121
182
  secure: boolean;
122
183
  password: string;
123
184
  persist: boolean;
124
185
  };
186
+ /** Configuration of the objects database */
125
187
  objects: ObjectsDatabaseOptions;
188
+ /** Configuration of the states database */
126
189
  states: StatesDatabaseOptions;
190
+ /** Logging configuration */
127
191
  log: {
128
192
  level: ioBroker.LogLevel;
129
193
  maxDays: number;
@@ -132,13 +196,16 @@ export interface IoBJson {
132
196
  };
133
197
  /** Always relative to iobroker.js-controller/ */
134
198
  dataDir: string;
199
+ /** Comment/hint shown next to the dataDir setting in the JSON config */
135
200
  '// dataDir': string;
201
+ /** Controller plugins configuration keyed by plugin name */
136
202
  plugins: {
137
203
  [pluginName: string]: {
138
204
  enabled: boolean;
139
205
  [other: string]: unknown;
140
206
  };
141
207
  };
208
+ /** Comment/hint shown next to the dnsResolution setting in the JSON config */
142
209
  '// dnsResolution': string;
143
210
  /** Use 'verbatim' for ipv6 first, else use 'ipv4first' */
144
211
  dnsResolution: 'verbatim' | 'ipv4first';
@@ -6,9 +6,9 @@ declare global {
6
6
  /** Defines access rights for a single file */
7
7
  interface FileACL {
8
8
  /** Full name of the user who owns this file, e.g. "system.user.admin" */
9
- owner: string;
9
+ owner: ioBroker.ObjectIDs.User;
10
10
  /** Full name of the group who owns this file, e.g. "system.group.administrator" */
11
- ownerGroup: string;
11
+ ownerGroup: ioBroker.ObjectIDs.Group;
12
12
  /** Linux-type permissions defining access to this file */
13
13
  permissions: number;
14
14
  }
@@ -24,9 +24,9 @@ declare global {
24
24
  /** Defines access rights for a single object */
25
25
  interface ObjectACL {
26
26
  /** Full name of the user who owns this object, e.g. "system.user.admin" */
27
- owner: string;
27
+ owner: ioBroker.ObjectIDs.User;
28
28
  /** Full name of the group who owns this object, e.g. "system.group.administrator" */
29
- ownerGroup: string;
29
+ ownerGroup: ioBroker.ObjectIDs.Group;
30
30
  /** Linux-type permissions defining access to this object */
31
31
  object: number;
32
32
  }
@@ -528,6 +528,12 @@ declare global {
528
528
  bundlerType?: 'module';
529
529
  /** The vis widget does not support the listed major versions of vis */
530
530
  ignoreInVersions?: number[];
531
+ /**
532
+ * Background components of the set, exposed by its module federation like the `components`. vis-2 renders each of them once
533
+ * in the runtime, next to the views and whichever view is shown, with the widgets of the set in all views of the project that
534
+ * the user may see. For what must not stop with its view, e.g. a phone that has to stay registered to ring.
535
+ */
536
+ services?: string[];
531
537
  }
532
538
 
533
539
  /**
@@ -536,6 +542,16 @@ declare global {
536
542
  export interface DevicesWidgets {
537
543
  /** Link to the file with components relatively to `admin/dm-widgets` in admin or `${adapterName}` in web. Default is customDevices.js */
538
544
  url?: string;
545
+ /**
546
+ * Link to the file (icons.json) with specific icons in form
547
+ * ```ts
548
+ * type IconDescription = {
549
+ * name: ioBroker.Translated,
550
+ * icons: [{id: string, label: ioBroker.Translated, category: string, icon: 'data:image/svg+xml;base64,...'}]
551
+ * };
552
+ * ```
553
+ */
554
+ iconsManifest?: string;
539
555
  /** Description of the components (widgets). It could be multiple widgets in one adapter */
540
556
  components: {
541
557
  /** Name of the class */
@@ -547,6 +563,12 @@ declare global {
547
563
  /** Icon as a link to picture imageName.png relative to the admin folder or base64 */
548
564
  icon: string;
549
565
  }[];
566
+ /**
567
+ * Background components, exported by the `Components` module of the plugin like the widgets. The devices app renders each of
568
+ * them once, next to the category and whichever category is shown, with the widgets of this adapter in all categories that the
569
+ * user may see. For what must not stop with its category, e.g. a phone that has to stay registered to ring.
570
+ */
571
+ services?: string[];
550
572
  }
551
573
 
552
574
  interface VisIconSet {
@@ -658,6 +680,12 @@ declare global {
658
680
  link?: string;
659
681
  /** If true, only one instance of this tab will be created for all instances */
660
682
  singleton?: boolean;
683
+ /**
684
+ * Show the tab through the proxy of admin (`/proxy/<instance>/`) instead of opening the own port of the instance directly.
685
+ * The target is `native.bind`, `native.port` and `native.secure` of the instance. The tab is then reachable on the
686
+ * address of admin, protected by its login, and only for members of `system.group.administrator`.
687
+ */
688
+ proxy?: boolean;
661
689
  /** Position in the admin menu: the built-in tabs use 1 to 120, a tab without order gets 200. 0 counts as not set. Once the user has sorted the menu, the stored order wins */
662
690
  order?: number;
663
691
  /**
@@ -686,13 +714,13 @@ declare global {
686
714
  blockedVersions?: string[];
687
715
  /** Whether this adapter includes custom blocks for Blockly. If true, `admin/blockly.js` must exist. */
688
716
  blockly?: boolean;
689
- /** Where the adapter will get its data from. Set this together with @see dataSource */
717
+ /** Where the adapter will get its data from. Set this together with {@link dataSource} */
690
718
  connectionType?: ConnectionType;
691
719
  /** If true, this adapter can be started in compact mode (in the same process as other adapters) */
692
720
  compact?: boolean;
693
721
  /** The directory relative to iobroker-data where the adapter stores the data. Supports the placeholder `%INSTANCE%`. This folder will be backed up and restored automatically. */
694
722
  dataFolder?: string;
695
- /** How the adapter will mainly receive its data. Set this together with @see connectionType */
723
+ /** How the adapter will mainly receive its data. Set this together with {@link connectionType} */
696
724
  dataSource?: 'poll' | 'push' | 'assumption';
697
725
  /** A record of ioBroker adapters (including "js-controller") and version ranges which are required for this adapter on the same host. */
698
726
  dependencies?: Dependencies;
@@ -724,7 +752,7 @@ declare global {
724
752
  keywords?: string[];
725
753
  /** A dictionary of links to web services this adapter provides */
726
754
  localLinks?: Record<string, string | LocalLink>;
727
- /** @deprecated Use @see localLinks */
755
+ /** @deprecated Use {@link localLinks} */
728
756
  localLink?: string;
729
757
  /** Default log level for this adapter. It can be changed for every instance separately */
730
758
  loglevel?: LogLevel;
@@ -735,9 +763,9 @@ declare global {
735
763
  /** Whether the admin tab is written in a materialized style. Required for Admin 3+ */
736
764
  materializeTab?: boolean;
737
765
  /** Whether the admin configuration dialog is written in a materialized style. Required for Admin 3+ */
738
- /** @deprectaed Use adminUI with config = "materialize". But better use jsonConfig.json */
766
+ /** @deprecated Use adminUI with config = "materialize". But better use jsonConfig.json */
739
767
  materialize: boolean;
740
- /** @deprecated Use @see supportedMessages up from controller v5 */
768
+ /** @deprecated Use {@link supportedMessages} up from controller v5 */
741
769
  messagebox?: true;
742
770
  /** Messages which are supported by the adapter, supportedMessages.custom: true is the equivalent to messagebox: true */
743
771
  supportedMessages?: SupportedMessages;
@@ -770,8 +798,13 @@ declare global {
770
798
  };
771
799
  /** Which OSes this adapter supports */
772
800
  os?: 'linux' | 'darwin' | 'win32' | Array<'linux' | 'darwin' | 'win32'>;
773
- /** Constant */
774
- platform: 'Javascript/Node.js';
801
+ /**
802
+ * Language the adapter is written in. `Javascript/Node.js` is the default and covers
803
+ * every existing adapter. `Python` makes the controller start the adapter from the
804
+ * virtual environment maintained by the `py-controller` adapter instead of with
805
+ * Node.js; `common.main` then points at the package's `__main__.py`.
806
+ */
807
+ platform: 'Javascript/Node.js' | 'Python';
775
808
  /** The keys of common attributes (e.g. `history`) which are not deleted in a `setObject` call even if they are not present. Deletion must be done explicitly by setting them to `null`. */
776
809
  preserveSettings?: string | string[];
777
810
  /** Url of the ReadMe file */
@@ -794,11 +827,11 @@ declare global {
794
827
  subscribable?: boolean;
795
828
  /** If `true`, this adapter provides custom per-state settings. Requires a `custom_m.html` file in the `admin` directory. */
796
829
  supportCustoms?: boolean;
797
- /** @deprecated Use @see supportedMessages up from controller v5 */
830
+ /** @deprecated Use {@link supportedMessages} up from controller v5 */
798
831
  supportStopInstance?: boolean;
799
832
  /** The translated names of this adapter to be shown in the admin UI */
800
833
  titleLang?: StringOrTranslated;
801
- /** @deprecated The name of this adapter to be shown in the admin UI. Use @see titleLang instead. */
834
+ /** @deprecated The name of this adapter to be shown in the admin UI. Use {@link titleLang} instead. */
802
835
  title?: string;
803
836
  /** The type of this adapter */
804
837
  type?:
@@ -832,6 +865,19 @@ declare global {
832
865
  | 'weather';
833
866
  /** If `true`, the `npm` package must be installed with the `--unsafe-perm` flag */
834
867
  unsafePerm?: true;
868
+ /**
869
+ * If `true`, the adapter declares the exclusive resources it occupies (serial ports, TCP/UDP ports, ...)
870
+ * itself via `adapter.registerUsedResource(...)`. Set this when the occupied resources are not simply
871
+ * the configured `native.port`.
872
+ *
873
+ * If not set, js-controller maintains the registry for this adapter and derives the entries from the
874
+ * instance's `native.port` / `native.bind`.
875
+ *
876
+ * If `false`, the adapter does not declare any resources and js-controller does not derive any either,
877
+ * so its instances have no entries in the registry. Use this when `native.port` is not a port the
878
+ * adapter listens on, e.g. the port of the device it connects to.
879
+ */
880
+ declareUsedResources?: boolean;
835
881
  /** The available version in the ioBroker repo. */
836
882
  version: string;
837
883
  /** Definition of the vis-2 widgets */
@@ -842,7 +888,7 @@ declare global {
842
888
  webByVersion?: boolean;
843
889
  /** Whether the web server in this adapter can be extended with plugin/extensions */
844
890
  webExtendable?: boolean;
845
- /** Relative path to a module that contains an extension for the web adapter. Use together with @see native.webInstance to configure which instances this affects */
891
+ /** Relative path to a module that contains an extension for the web adapter. Use together with {@link native.webInstance} to configure which instances this affects */
846
892
  webExtension?: string;
847
893
  /** List of parameters that must be included in info.js by webServer adapter. (Example material: `"webPreSettings": { "materialBackground": "native.loadingBackground" }`). Web adapter uses this setting to create a customized info.js file to provide some essential settings for the index.html file before the socket connection is established to provide e.g., background color of the loading screen. */
848
894
  webPreSettings?: Record<string, any>;
@@ -996,7 +1042,7 @@ declare global {
996
1042
  acl?: ObjectACL;
997
1043
  from?: string;
998
1044
  /** The user who created or updated this object */
999
- user?: string;
1045
+ user?: ioBroker.ObjectIDs.User;
1000
1046
  ts?: number;
1001
1047
  /** These properties can only be edited if the correct password is provided */
1002
1048
  nonEdit?: NonEditable;
@@ -1090,7 +1136,25 @@ declare global {
1090
1136
  unsafePerm?: boolean;
1091
1137
  /** If given, the packet name differs from the adapter name, e.g. because it is a scoped package */
1092
1138
  packetName?: string;
1093
-
1139
+ /** Link to package */
1140
+ meta: string;
1141
+ /** List of licenses */
1142
+ licenses?: { type: string; url: string }[];
1143
+ /** Normally by admin is a ISO string with published date */
1144
+ published?: string;
1145
+
1146
+ /** Link to adapter repo */
1147
+ url?: string;
1148
+ /** Adapter icon */
1149
+ icon?: string;
1150
+ /** Internally used flag */
1151
+ processed?: boolean;
1152
+ /** History */
1153
+ news: { [version: string]: ioBroker.Translated };
1154
+ /** A record of ioBroker adapters (including "js-controller") and version ranges which are required for this adapter on the same host. */
1155
+ dependencies: Dependencies;
1156
+ /** A record of ioBroker adapters (including "js-controller") and version ranges which are required for this adapter in the whole system. */
1157
+ globalDependencies: Dependencies;
1094
1158
  /** Other Adapter related properties, not important for this implementation */
1095
1159
  [other: string]: unknown;
1096
1160
  }
@@ -1422,12 +1486,11 @@ declare global {
1422
1486
  : View extends 'schedule'
1423
1487
  ? ScheduleObject
1424
1488
  : View extends 'config'
1425
- ?
1426
- | RepositoryObject
1427
- | SystemConfigObject
1428
- | (OtherObject & {
1429
- type: 'config';
1430
- })
1489
+ ? | RepositoryObject
1490
+ | SystemConfigObject
1491
+ | (OtherObject & {
1492
+ type: 'config';
1493
+ })
1431
1494
  : View extends 'custom'
1432
1495
  ? NonNullable<StateObject['common']['custom']>
1433
1496
  : ioBroker.Object