You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[types]: Added types for Notifications on Adapter/Instances (#2874)
* Extend types
* Update objects.d.ts
* Fixed tests
* Fixed linter
* correctly infer getObjectView id
- unwrap callback on touched code
- simplify types where possible
- remove types were not needed and not yet correct
* reuse type and do not force type casting where it would be cheating
---------
Co-authored-by: foxriver76 <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -424,7 +424,7 @@ The definition also contains localized names and descriptions that can be used t
424
424
Registered notifications are stored per host and can be requested via messages to the host. They are also stored when the controller stops and loaded on next start.
425
425
Additionally, a summary of the stored categories per scope with a number of stored notifications and the last added timestamp is available in the state `system.host.hostname.notifications.scopeid` as a JSON.
426
426
427
-
The js-controller defines in its io-package the system scope together with all details. You can use this as an example and the JSON schema will help you validate your notifications.
427
+
The js-controller defines in its io-package the system scope together with all details. You can use this as an example, and the JSON schema will help you validate your notifications.
428
428
429
429
```json
430
430
{
@@ -534,7 +534,7 @@ The message needs to take the following parameters in the message object:
534
534
* categoryFilter - category of notifications
535
535
* instanceFilter - instance of notifications
536
536
537
-
All three are optional and can be a string or null/undefined if ommited.
537
+
All three are optional and can be a string or null/undefined if omitted.
538
538
539
539
### Disk space warnings
540
540
**Feature status:** New in 6.0.0
@@ -546,7 +546,7 @@ By default, this threshold is 5 % of disk space. Via the state `system.host.<hos
546
546
#### Log levels
547
547
**Feature status:** stable
548
548
549
-
The js-controller and each adapter has defined its own log level. By default, `info` is used. The following log levels can be used:
549
+
The js-controller and each adapter can define their own log level. By default, `info` is used. The following log levels can be used:
/** Whether new instances should be enabled by default. *Should* be `false`! */
@@ -822,6 +825,8 @@ declare global {
822
825
defaultLogLevel?: LogLevel;
823
826
/** Used date format for formatting */
824
827
dateFormat: string;
828
+
/** This name will be shown in admin's header. Just to identify the whole installation */
829
+
siteName?: string;
825
830
/** Default acl for new objects */
826
831
defaultNewAcl: {
827
832
object: number;
@@ -865,9 +870,9 @@ declare global {
865
870
}
866
871
867
872
/**
868
-
* ioBroker has built-in protection for specific attributes of objects. If this protection is installed in the object, then the protected attributes of object cannot be changed by the user without valid password.
873
+
* ioBroker has built-in protection for specific attributes of objects. If this protection is installed in the object, then the protected attributes of an object cannot be changed by the user without a valid password.
869
874
* To protect the properties from change, the special attribute "nonEdit" must be added to the object. This attribute contains the password, which is required to change the object.
870
-
* If object does not have "nonEdit" attribute, so the hash will be saved into "nonEdit.passHash". After that if someone will change the object, he must provide the password in "nonEdit.password".
875
+
* If an object does not have "nonEdit" attribute, so the hash will be saved into "nonEdit.passHash". After that, if someone changes the object, he must provide the password in "nonEdit.password".
871
876
* If the password is correct, the object attributes will be updated. If the password is wrong, the object will not be changed.
872
877
* Note, that all properties outside "nonEdit" can be updated without providing the password. Furthermore, do not confuse e.g. "nonEdit.common" with "obj.common" they are not linked in any way.
873
878
*/
@@ -1012,6 +1017,8 @@ declare global {
1012
1017
json: RepositoryJson|null;
1013
1018
hash?: string;
1014
1019
time?: string;
1020
+
/** If this repository stable */
1021
+
stable?: boolean;
1015
1022
}
1016
1023
1017
1024
interfaceRepositoryObjectextendsBaseObject{
@@ -1048,13 +1055,47 @@ declare global {
1048
1055
common?: Partial<InstanceCommon>;
1049
1056
}
1050
1057
1051
-
/** TODO: To be defined */
1052
-
typeNotificationCategory=any;
1058
+
// it is defined in notificationHandler.ts
1059
+
typeNotificationCategory={
1060
+
/** The unique category identifier */
1061
+
category:
1062
+
|'memIssues'
1063
+
|'fsIoErrors'
1064
+
|'noDiskSpace'
1065
+
|'accessErrors'
1066
+
|'nonExistingFileErrors'
1067
+
|'remoteHostErrors'
1068
+
|'restartLoop'
1069
+
|'fileToJsonl'
1070
+
|'automaticAdapterUpgradeFailed'
1071
+
|'automaticAdapterUpgradeSuccessful'
1072
+
|'blockedVersions'
1073
+
|'databaseErrors'
1074
+
|'securityIssues'
1075
+
|'packageUpdates'
1076
+
|'systemRebootRequired'
1077
+
|'diskSpaceIssues'
1078
+
|string;
1079
+
/** The human-readable category name */
1080
+
name: Translated;
1081
+
/** The human-readable category description */
1082
+
description: Translated;
1083
+
/** Allows to define the severity of the notification with `info` being the lowest `notify` representing middle priority, `alert` representing high priority and often containing critical information */
1084
+
severity: 'info'|'notify'|'alert';
1085
+
/** If a regex is specified, the js-controller will check error messages on adapter crashes against this regex and will generate a notification of this category */
1086
+
regex: string[];
1087
+
/** Deletes older messages if more than the specified amount is present for this category */
1088
+
limit: number;
1089
+
};
1053
1090
1054
1091
interfaceNotification{
1092
+
/** Each adapter can define its own "scopes" for own notifications with its own categories which then will be available in the system. Adapters should only register one scope which matches the name of the adapter. */
1055
1093
scope: string;
1094
+
/** The human-readable name of this scope */
1056
1095
name: Translated;
1096
+
/** The human-readable description of this scope */
0 commit comments