@iobroker/dm-utils 1.0.10 → 1.0.15

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023-2025 ioBroker Community Developers
3
+ Copyright (c) 2023-2026 ioBroker Community Developers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -301,6 +301,12 @@ This method returns a promise that resolves to a `ProgressDialog` object.
301
301
  ### **WORK IN PROGRESS**
302
302
  -->
303
303
  ## Changelog
304
+ ### 1.0.15 (2026-01-02)
305
+ * (@GermanBluefox) Added `ignoreApplyDisabled` flag
306
+
307
+ ### 1.0.13 (2025-10-21)
308
+ * (@GermanBluefox) Updated packages
309
+
304
310
  ### 1.0.10 (2025-05-05)
305
311
 
306
312
  * (@GermanBluefox) Added timeout property to actions
@@ -398,7 +404,7 @@ This method returns a promise that resolves to a `ProgressDialog` object.
398
404
  ## License
399
405
  MIT License
400
406
 
401
- Copyright (c) 2023-2025 ioBroker Community Developers
407
+ Copyright (c) 2023-2026 ioBroker Community Developers
402
408
 
403
409
  Permission is hereby granted, free of charge, to any person obtaining a copy
404
410
  of this software and associated documentation files (the "Software"), to deal
@@ -1,25 +1,11 @@
1
1
  export type ApiVersion = 'v1';
2
2
  export type ConfigConnectionType = 'lan' | 'wifi' | 'bluetooth' | 'thread' | 'z-wave' | 'zigbee' | 'other';
3
- export type ConfigIconType = 'add' | 'backlight' | 'delete' | 'dimmer' | 'edit' | 'group' | 'identify' | 'info' | 'light' | 'lines' | 'next' | 'pair' | 'pause' | 'play' | 'previous' | 'qrcode' | 'refresh' | 'search' | 'settings' | 'socket' | 'stop' | 'unpair' | 'user' | string;
4
3
  export type DeviceStatus = 'connected' | 'disconnected' | {
5
4
  battery?: number | boolean | 'charging' | string;
6
5
  connection?: 'connected' | 'disconnected';
7
6
  rssi?: number;
8
7
  warning?: ioBroker.StringOrTranslated | boolean;
9
8
  };
10
- export type ActionButton = {
11
- label: ioBroker.StringOrTranslated;
12
- type: 'apply' | 'cancel' | 'copyToClipboard';
13
- noTranslation?: boolean;
14
- /** base64 or icon name */
15
- icon?: ConfigIconType;
16
- variant?: 'contained' | 'outlined' | 'text';
17
- style?: Record<string, number | string>;
18
- /** Name of the attribute in data that should be copied to clipboard */
19
- color?: 'primary' | 'secondary';
20
- /** Name of the attribute in data that should be copied to clipboard */
21
- copyToClipboardAttr?: string;
22
- };
23
9
  export type DeviceRefresh = 'device' | 'instance' | false | true;
24
10
  export type RefreshResponse = {
25
11
  refresh: DeviceRefresh;
@@ -41,7 +27,8 @@ interface ObjectBrowserCustomFilter {
41
27
  };
42
28
  }
43
29
  export type ObjectBrowserType = 'state' | 'instance' | 'channel' | 'device' | 'chart';
44
- export type ConfigItemType = 'tabs' | 'panel' | 'text' | 'number' | 'color' | 'checkbox' | 'slider' | 'ip' | 'user' | 'room' | 'func' | 'select' | 'autocomplete' | 'image' | 'objectId' | 'password' | 'instance' | 'chips' | 'alive' | 'pattern' | 'sendto' | 'setState' | 'staticInfo' | 'staticText' | 'staticLink' | 'staticImage' | 'table' | 'accordion' | 'jsonEditor' | 'language' | 'certificate' | 'certificates' | 'certCollection' | 'custom' | 'datePicker' | 'timePicker' | 'divider' | 'header' | 'cron' | 'fileSelector' | 'file' | 'imageSendTo' | 'selectSendTo' | 'autocompleteSendTo' | 'textSendTo' | 'coordinates' | 'interface' | 'license' | 'checkLicense' | 'uuid' | 'port' | 'deviceManager' | 'topic' | 'qrCode' | 'state';
30
+ export type ConfigItemType = 'accordion' | 'alive' | 'autocomplete' | 'autocompleteSendTo' | 'certCollection' | 'certificate' | 'certificates' | 'checkDocker' | 'checkLicense' | 'checkbox' | 'chips' | 'color' | 'coordinates' | 'cron' | 'custom' | 'datePicker' | 'deviceManager' | 'divider' | 'file' | 'fileSelector' | 'func' | 'header' | 'image' | 'imageSendTo' | 'infoBox' | 'instance' | 'interface' | 'ip' | 'jsonEditor' | 'language' | 'license' | 'number' | 'oauth2' | 'objectId' | 'panel' | 'password' | 'pattern' | 'port' | 'qrCode' | 'room' | 'select' | 'selectSendTo' | 'sendto' | 'setState' | 'slider' | 'state' | 'staticImage' | 'staticInfo' | 'staticLink' | 'staticText' | 'table' | 'tabs' | 'text' | 'textSendTo' | 'timePicker' | 'topic' | 'user' | 'uuid';
31
+ export type ConfigIconType = 'add' | 'backlight' | 'book' | 'delete' | 'dimmer' | 'edit' | 'error' | 'group' | 'help' | 'identify' | 'info' | 'light' | 'lines' | 'next' | 'pair' | 'pause' | 'play' | 'previous' | 'qrcode' | 'refresh' | 'search' | 'send' | 'settings' | 'socket' | 'stop' | 'unpair' | 'upload' | 'user' | 'warning' | 'web' | string;
45
32
  export interface ConfigItemConfirmData {
46
33
  condition: string;
47
34
  text?: ioBroker.StringOrTranslated;
@@ -142,6 +129,8 @@ export interface ConfigItemSelectOption {
142
129
  label: ioBroker.StringOrTranslated;
143
130
  /** Value of option */
144
131
  value: number | string;
132
+ /** Color of value */
133
+ color?: string;
145
134
  /** Formula or boolean value to show or hide the option */
146
135
  hidden?: string | boolean;
147
136
  }
@@ -158,6 +147,7 @@ export interface ConfigItemPanel extends ConfigItem {
158
147
  innerStyle?: CustomCSSProperties;
159
148
  /** i18n definitions: true - load from a file, string - name of subdirectory, object - translations */
160
149
  i18n?: boolean | string | Record<string, Record<ioBroker.Languages, string>>;
150
+ command?: string;
161
151
  }
162
152
  export interface ConfigItemPattern extends ConfigItem {
163
153
  type: 'pattern';
@@ -181,6 +171,7 @@ export interface ConfigItemTabs extends ConfigItem {
181
171
  tabsStyle?: CustomCSSProperties;
182
172
  /** i18n definitions: true - load from a file, string - name of subdirectory, object - translations */
183
173
  i18n?: boolean | string | Record<string, Record<ioBroker.Languages, string>>;
174
+ command?: string;
184
175
  }
185
176
  export interface ConfigItemText extends ConfigItem {
186
177
  type: 'text';
@@ -223,6 +214,15 @@ export interface ConfigItemNumber extends ConfigItem {
223
214
  max?: number;
224
215
  step?: number;
225
216
  readOnly?: boolean;
217
+ /** Unit */
218
+ unit?: string;
219
+ }
220
+ export interface ConfigItemOAuth2 extends ConfigItem {
221
+ type: 'oauth2';
222
+ saveTokenIn?: string;
223
+ identifier: 'spotify' | 'google' | 'dropbox' | 'microsoft' | string;
224
+ scope?: string;
225
+ refreshLabel?: ioBroker.StringOrTranslated;
226
226
  }
227
227
  export interface ConfigItemQrCode extends ConfigItem {
228
228
  type: 'qrCode';
@@ -274,11 +274,11 @@ export interface ConfigItemObjectId extends ConfigItem {
274
274
  filters?: {
275
275
  id?: string;
276
276
  name?: string;
277
- room?: string;
278
- func?: string;
279
- role?: string;
280
- type?: string;
281
- custom?: string;
277
+ room?: string[];
278
+ func?: string[];
279
+ role?: string[];
280
+ type?: string[];
281
+ custom?: string[];
282
282
  };
283
283
  /** Cannot be used together with `type` settings. It is a function that will be called for every object and must return true or false. Example: `obj.common.type === 'number'` */
284
284
  filterFunc?: (obj: ioBroker.Object) => boolean;
@@ -384,6 +384,21 @@ export interface ConfigItemStaticInfo extends Omit<ConfigItem, 'data'> {
384
384
  /** Show string values as HTML */
385
385
  html?: boolean;
386
386
  }
387
+ export interface ConfigItemInfoBox extends ConfigItem {
388
+ type: 'infoBox';
389
+ /** multi-language text */
390
+ text: ioBroker.StringOrTranslated;
391
+ /** multi-language title */
392
+ title?: ioBroker.StringOrTranslated;
393
+ /** The type determines the color and symbol */
394
+ boxType?: 'warning' | 'info' | 'error' | 'ok';
395
+ /** If the box is closeable */
396
+ closeable?: boolean;
397
+ /** Use together with `closeable: true`. If the box is closed or not. In this case, it will be controlled from outside */
398
+ closed?: boolean;
399
+ /** Icon position */
400
+ iconPosition?: 'top' | 'middle';
401
+ }
387
402
  export interface ConfigItemRoom extends ConfigItem {
388
403
  type: 'room';
389
404
  short?: boolean;
@@ -404,9 +419,14 @@ export interface ConfigItemSelect extends ConfigItem {
404
419
  items: ConfigItemSelectOption[];
405
420
  label: ioBroker.StringOrTranslated;
406
421
  value?: number | string;
422
+ color?: string;
407
423
  hidden?: string | boolean;
408
424
  })[];
409
425
  attr?: string;
426
+ /** If multiple selection is possible. In this case, the value will be an array */
427
+ multiple?: boolean;
428
+ /** show item even if no label was found for it (by multiple), default=`true` */
429
+ showAllValues?: boolean;
410
430
  }
411
431
  export interface ConfigItemAutocomplete extends ConfigItem {
412
432
  type: 'autocomplete';
@@ -485,12 +505,16 @@ export interface ConfigItemCustom extends ConfigItem {
485
505
  type: 'custom';
486
506
  /** location of Widget, like "custom/customComponents.js" */
487
507
  url: string;
508
+ /** New format for components written in TypeScript */
509
+ bundlerType?: 'module';
488
510
  /** Component name, like "ConfigCustomBackItUpSet/Components/AdapterExist" */
489
511
  name: string;
490
512
  /** i18n */
491
513
  i18n: boolean | Record<string, string>;
492
514
  /** custom properties */
493
- [prop: string]: any;
515
+ custom?: {
516
+ [prop: string]: any;
517
+ };
494
518
  }
495
519
  export interface ConfigItemDatePicker extends ConfigItem {
496
520
  type: 'datePicker';
@@ -585,7 +609,7 @@ export interface ConfigItemState extends ConfigItem {
585
609
  readOnly?: boolean;
586
610
  /** Base64 icon */
587
611
  labelIcon?: string;
588
- /** Normally the title and value are shown on the left and right of the line. With this flag, the value will appear just after the label*/
612
+ /** Normally, the title and value are shown on the left and right of the line. With this flag, the value will appear just after the label*/
589
613
  narrow?: boolean;
590
614
  /** Add to label the colon at the end if not exist in label */
591
615
  addColon?: boolean;
@@ -593,6 +617,14 @@ export interface ConfigItemState extends ConfigItem {
593
617
  blinkOnUpdate?: boolean | string;
594
618
  /** Font size */
595
619
  size?: number | 'small' | 'normal' | 'large';
620
+ /** Optional value, that will be sent for button */
621
+ buttonValue?: ioBroker.StateValue;
622
+ /** Show SET button. The value in this case will be sent only when the button is pressed. You can define the text of the button. Default text is "Set" */
623
+ showEnterButton?: boolean | ioBroker.StringOrTranslated;
624
+ /** The value in this case will be sent only when the "Enter" button is pressed. It can be combined with `showEnterButton` */
625
+ setOnEnterKey?: boolean;
626
+ /** Options for `select`. If not defiled, the `common.states` in the object must exist. */
627
+ options?: (string | ConfigItemSelectOption)[];
596
628
  }
597
629
  export interface ConfigItemTextSendTo extends Omit<ConfigItem, 'data'> {
598
630
  type: 'textSendTo';
@@ -654,6 +686,8 @@ export interface ConfigItemTable extends ConfigItem {
654
686
  uniqueColumns?: string[];
655
687
  /** These items will be encrypted before saving with simple (not SHA) encryption method */
656
688
  encryptedAttributes?: string[];
689
+ /** Breakpoint that will be rendered as cards */
690
+ useCardFor?: ('xs' | 'sm' | 'md' | 'lg' | 'xl')[];
657
691
  }
658
692
  export interface ConfigItemTimePicker extends ConfigItem {
659
693
  type: 'timePicker';
@@ -718,6 +752,11 @@ export interface ConfigItemCheckLicense extends ConfigItem {
718
752
  variant?: 'text' | 'outlined' | 'contained';
719
753
  color?: 'primary' | 'secondary';
720
754
  }
755
+ export interface ConfigItemCheckDocker extends ConfigItem {
756
+ type: 'checkDocker';
757
+ /** Hide the version of docker */
758
+ hideVersion?: boolean;
759
+ }
721
760
  export interface ConfigItemUUID extends ConfigItem {
722
761
  type: 'uuid';
723
762
  }
@@ -727,6 +766,12 @@ export interface ConfigItemJsonEditor extends ConfigItem {
727
766
  validateJson?: boolean;
728
767
  /** if true, the JSON will be validated only if the value is not empty */
729
768
  allowEmpty?: boolean;
769
+ /** Allow JSON5 format. Default is disabled */
770
+ json5?: boolean;
771
+ /** Do not allow to save the value if error in JSON or JSON5 */
772
+ doNotApplyWithError?: boolean;
773
+ /** Open the editor in read-only mode - editor can be opened but content cannot be modified */
774
+ readOnly?: boolean;
730
775
  }
731
776
  export interface ConfigItemInterface extends ConfigItem {
732
777
  type: 'interface';
@@ -815,7 +860,7 @@ export interface ConfigItemFileSelector extends ConfigItem {
815
860
  /** Do not show the size of files */
816
861
  noSize?: boolean;
817
862
  }
818
- export type ConfigItemAny = ConfigItemAlive | ConfigItemAutocomplete | ConfigItemAutocompleteSendTo | ConfigItemPanel | ConfigItemTabs | ConfigItemText | ConfigItemNumber | ConfigItemColor | ConfigItemCheckbox | ConfigItemSlider | ConfigItemIP | ConfigItemUser | ConfigItemRoom | ConfigItemFunc | ConfigItemSelect | ConfigItemAccordion | ConfigItemCoordinates | ConfigItemDivider | ConfigItemHeader | ConfigItemCustom | ConfigItemDatePicker | ConfigItemDeviceManager | ConfigItemLanguage | ConfigItemPort | ConfigItemSendTo | ConfigItemState | ConfigItemTable | ConfigItemTimePicker | ConfigItemTextSendTo | ConfigItemSelectSendTo | ConfigItemCertCollection | ConfigItemCertificateSelect | ConfigItemCertificates | ConfigItemUUID | ConfigItemCheckLicense | ConfigItemPattern | ConfigItemChip | ConfigItemCRON | ConfigItemFile | ConfigItemFileSelector | ConfigItemImageSendTo | ConfigItemInstanceSelect | ConfigItemImageUpload | ConfigItemInterface | ConfigItemJsonEditor | ConfigItemLicense | ConfigItemPassword | ConfigItemSetState | ConfigItemStaticDivider | ConfigItemStaticHeader | ConfigItemStaticInfo | ConfigItemStaticImage | ConfigItemStaticText | ConfigItemTopic | ConfigItemObjectId | ConfigItemQrCode;
863
+ export type ConfigItemAny = ConfigItemAlive | ConfigItemAutocomplete | ConfigItemAutocompleteSendTo | ConfigItemPanel | ConfigItemTabs | ConfigItemText | ConfigItemNumber | ConfigItemOAuth2 | ConfigItemColor | ConfigItemCheckbox | ConfigItemSlider | ConfigItemIP | ConfigItemInfoBox | ConfigItemUser | ConfigItemRoom | ConfigItemFunc | ConfigItemSelect | ConfigItemAccordion | ConfigItemCoordinates | ConfigItemDivider | ConfigItemHeader | ConfigItemCustom | ConfigItemDatePicker | ConfigItemDeviceManager | ConfigItemLanguage | ConfigItemPort | ConfigItemSendTo | ConfigItemState | ConfigItemTable | ConfigItemTimePicker | ConfigItemTextSendTo | ConfigItemSelectSendTo | ConfigItemCertCollection | ConfigItemCertificateSelect | ConfigItemCertificates | ConfigItemUUID | ConfigItemCheckDocker | ConfigItemCheckLicense | ConfigItemPattern | ConfigItemChip | ConfigItemCRON | ConfigItemFile | ConfigItemFileSelector | ConfigItemImageSendTo | ConfigItemInstanceSelect | ConfigItemImageUpload | ConfigItemInterface | ConfigItemJsonEditor | ConfigItemLicense | ConfigItemPassword | ConfigItemSetState | ConfigItemStaticDivider | ConfigItemStaticHeader | ConfigItemStaticInfo | ConfigItemStaticImage | ConfigItemStaticText | ConfigItemTopic | ConfigItemObjectId | ConfigItemQrCode;
819
864
  export type BackEndCommandType = 'nop' | 'refresh' | 'link' | 'message';
820
865
  export interface BackEndCommandGeneric {
821
866
  command: BackEndCommandType;
@@ -852,14 +897,34 @@ export interface BackEndCommandMessage extends BackEndCommandGeneric {
852
897
  variant: 'popup' | 'dialog';
853
898
  }
854
899
  export type BackEndCommand = BackEndCommandMessage | BackEndCommandOpenLink | BackEndCommandRefresh;
900
+ export type ActionButton = {
901
+ label: ioBroker.StringOrTranslated;
902
+ type: 'apply' | 'cancel' | 'copyToClipboard';
903
+ noTranslation?: boolean;
904
+ /** base64 or icon name */
905
+ icon?: ConfigIconType;
906
+ variant?: 'contained' | 'outlined' | 'text';
907
+ style?: Record<string, number | string>;
908
+ /** Name of the attribute in data that should be copied to clipboard */
909
+ color?: 'primary' | 'secondary';
910
+ /** Name of the attribute in data that should be copied to clipboard */
911
+ copyToClipboardAttr?: string;
912
+ };
855
913
  export type BackEndCommandJsonFormOptions = {
914
+ /** Data for the form */
856
915
  data?: JsonFormData;
916
+ /** Form title */
857
917
  title?: ioBroker.StringOrTranslated;
918
+ /** Buttons that will be shown on the bottom of the form */
858
919
  buttons?: (ActionButton | 'apply' | 'cancel' | 'close')[];
920
+ /** Maximal form width */
859
921
  maxWidth?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
860
922
  /** Minimal width of the dialog */
861
923
  minWidth?: number;
924
+ /** Do not translate title */
862
925
  noTranslation?: boolean;
926
+ /** Always allow the apply button. Even when nothing was changed */
927
+ ignoreApplyDisabled?: boolean;
863
928
  };
864
929
  export type JsonFormSchema = ConfigItemPanel | ConfigItemTabs;
865
930
  export type JsonFormData = Record<string, any>;
package/package.json CHANGED
@@ -1,15 +1,20 @@
1
1
  {
2
2
  "name": "@iobroker/dm-utils",
3
- "version": "1.0.10",
3
+ "version": "1.0.15",
4
4
  "description": "ioBroker Device Manager utilities for backend",
5
5
  "main": "build/index.js",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ioBroker/dm-utils.git"
12
+ },
9
13
  "types": "build/index.d.ts",
10
14
  "scripts": {
11
15
  "build": "tsc -p tsconfig.json",
12
- "lint": "eslint .",
16
+ "test:package": "node -e \"process.exit(0)\"",
17
+ "lint": "eslint -c eslint.config.mjs src",
13
18
  "updateCommonTs": "node tasks.js",
14
19
  "prettier": "prettier -u -w examples src",
15
20
  "release": "release-script",
@@ -22,15 +27,15 @@
22
27
  "author": "UncleSamSwiss",
23
28
  "license": "MIT",
24
29
  "dependencies": {
25
- "@iobroker/adapter-core": "^3.2.3"
30
+ "@iobroker/adapter-core": "^3.3.2"
26
31
  },
27
32
  "devDependencies": {
28
- "@alcalzone/release-script": "^3.8.0",
29
- "@alcalzone/release-script-plugin-license": "^3.7.0",
30
- "@iobroker/eslint-config": "^2.0.1",
31
- "@types/node": "^22.15.3",
32
- "axios": "^1.9.0",
33
- "typescript": "^5.8.3"
33
+ "@alcalzone/release-script": "^5.0.0",
34
+ "@alcalzone/release-script-plugin-license": "^4.0.0",
35
+ "@iobroker/eslint-config": "^2.2.0",
36
+ "@types/node": "^25.0.3",
37
+ "axios": "^1.13.2",
38
+ "typescript": "~5.9.3"
34
39
  },
35
40
  "files": [
36
41
  "LICENSE",