@iobroker/dm-utils 0.5.0 → 0.6.1

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/README.md CHANGED
@@ -295,6 +295,15 @@ This method returns a promise that resolves to a `ProgressDialog` object.
295
295
  ### **WORK IN PROGRESS**
296
296
  -->
297
297
  ## Changelog
298
+ ### 0.6.1 (2024-11-18)
299
+
300
+ * (@GermanBluefox) Added configurable buttons for form
301
+
302
+ ### 0.6.0 (2024-11-17)
303
+
304
+ * (@GermanBluefox) used new ioBroker/eslint-config lib and changed prettifier settings
305
+ * (@GermanBluefox) updated JsonConfig types
306
+
298
307
  ### 0.5.0 (2024-08-30)
299
308
  * (bluefox) Migrated to eslint 9
300
309
 
@@ -1,11 +1,12 @@
1
- import { JsonFormData, JsonFormSchema } from ".";
2
- import { ProgressDialog } from "./ProgressDialog";
1
+ import type { ActionButton, JsonFormData, JsonFormSchema } from '.';
2
+ import type { ProgressDialog } from './ProgressDialog';
3
3
  export interface ActionContext {
4
4
  showMessage(text: ioBroker.StringOrTranslated): Promise<void>;
5
5
  showConfirmation(text: ioBroker.StringOrTranslated): Promise<boolean>;
6
6
  showForm(schema: JsonFormSchema, options?: {
7
7
  data?: JsonFormData;
8
8
  title?: ioBroker.StringOrTranslated;
9
+ buttons?: ActionButton[];
9
10
  }): Promise<JsonFormData | undefined>;
10
11
  openProgress(title: string, options?: {
11
12
  indeterminate?: boolean;
@@ -1,8 +1,8 @@
1
- import { AdapterInstance } from "@iobroker/adapter-core";
2
- import { ActionContext } from "./ActionContext";
3
- import { ProgressDialog } from "./ProgressDialog";
4
- import { DeviceDetails, DeviceInfo, ErrorResponse, InstanceDetails, JsonFormData, JsonFormSchema, RefreshResponse, RetVal } from "./types";
5
- import { ControlState } from "./types/base";
1
+ import type { AdapterInstance } from '@iobroker/adapter-core';
2
+ import type { ActionContext } from './ActionContext';
3
+ import type { ProgressDialog } from './ProgressDialog';
4
+ import { type DeviceDetails, type DeviceInfo, type ErrorResponse, type InstanceDetails, type JsonFormData, type JsonFormSchema, type RefreshResponse, type RetVal } from './types';
5
+ import type { ControlState } from './types/base';
6
6
  export declare abstract class DeviceManagement<T extends AdapterInstance = AdapterInstance> {
7
7
  protected readonly adapter: T;
8
8
  private instanceInfo?;
@@ -6,13 +6,13 @@ class DeviceManagement {
6
6
  constructor(adapter) {
7
7
  this.adapter = adapter;
8
8
  this.contexts = new Map();
9
- adapter.on("message", this.onMessage.bind(this));
9
+ adapter.on('message', this.onMessage.bind(this));
10
10
  }
11
11
  get log() {
12
12
  return this.adapter.log;
13
13
  }
14
14
  getInstanceInfo() {
15
- return { apiVersion: "v1" };
15
+ return { apiVersion: 'v1' };
16
16
  }
17
17
  getDeviceDetails(id) {
18
18
  return { id, schema: {} };
@@ -21,17 +21,30 @@ class DeviceManagement {
21
21
  var _a;
22
22
  if (!this.instanceInfo) {
23
23
  this.log.warn(`Instance action ${actionId} was called before getInstanceInfo()`);
24
- return { error: { code: types_1.ErrorCodes.E_INSTANCE_ACTION_NOT_INITIALIZED, message: `Instance action ${actionId} was called before getInstanceInfo()` } };
24
+ return {
25
+ error: {
26
+ code: types_1.ErrorCodes.E_INSTANCE_ACTION_NOT_INITIALIZED,
27
+ message: `Instance action ${actionId} was called before getInstanceInfo()`,
28
+ },
29
+ };
25
30
  }
26
- const action = (_a = this.instanceInfo.actions) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === actionId);
31
+ const action = (_a = this.instanceInfo.actions) === null || _a === void 0 ? void 0 : _a.find(a => a.id === actionId);
27
32
  if (!action) {
28
33
  this.log.warn(`Instance action ${actionId} is unknown`);
29
- return { error: { code: types_1.ErrorCodes.E_INSTANCE_ACTION_UNKNOWN, message: `Instance action ${actionId} is unknown` } };
34
+ return {
35
+ error: {
36
+ code: types_1.ErrorCodes.E_INSTANCE_ACTION_UNKNOWN,
37
+ message: `Instance action ${actionId} is unknown`,
38
+ },
39
+ };
30
40
  }
31
41
  if (!action.handler) {
32
42
  this.log.warn(`Instance action ${actionId} is disabled because it has no handler`);
33
43
  return {
34
- error: { code: types_1.ErrorCodes.E_INSTANCE_ACTION_NO_HANDLER, message: `Instance action ${actionId} is disabled because it has no handler` },
44
+ error: {
45
+ code: types_1.ErrorCodes.E_INSTANCE_ACTION_NO_HANDLER,
46
+ message: `Instance action ${actionId} is disabled because it has no handler`,
47
+ },
35
48
  };
36
49
  }
37
50
  return action.handler(context, options);
@@ -40,19 +53,32 @@ class DeviceManagement {
40
53
  var _a;
41
54
  if (!this.devices) {
42
55
  this.log.warn(`Device action ${actionId} was called before listDevices()`);
43
- return { error: { code: types_1.ErrorCodes.E_DEVICE_ACTION_NOT_INITIALIZED, message: `Device action ${actionId} was called before listDevices()` } };
56
+ return {
57
+ error: {
58
+ code: types_1.ErrorCodes.E_DEVICE_ACTION_NOT_INITIALIZED,
59
+ message: `Device action ${actionId} was called before listDevices()`,
60
+ },
61
+ };
44
62
  }
45
63
  const device = this.devices.get(deviceId);
46
64
  if (!device) {
47
65
  this.log.warn(`Device action ${actionId} was called on unknown device: ${deviceId}`);
48
66
  return {
49
- error: { code: types_1.ErrorCodes.E_DEVICE_ACTION_DEVICE_UNKNOWN, message: `Device action ${actionId} was called on unknown device: ${deviceId}` },
67
+ error: {
68
+ code: types_1.ErrorCodes.E_DEVICE_ACTION_DEVICE_UNKNOWN,
69
+ message: `Device action ${actionId} was called on unknown device: ${deviceId}`,
70
+ },
50
71
  };
51
72
  }
52
- const action = (_a = device.actions) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === actionId);
73
+ const action = (_a = device.actions) === null || _a === void 0 ? void 0 : _a.find(a => a.id === actionId);
53
74
  if (!action) {
54
75
  this.log.warn(`Device action ${actionId} doesn't exist on device ${deviceId}`);
55
- return { error: { code: types_1.ErrorCodes.E_DEVICE_ACTION_UNKNOWN, message: `Device action ${actionId} doesn't exist on device ${deviceId}` } };
76
+ return {
77
+ error: {
78
+ code: types_1.ErrorCodes.E_DEVICE_ACTION_UNKNOWN,
79
+ message: `Device action ${actionId} doesn't exist on device ${deviceId}`,
80
+ },
81
+ };
56
82
  }
57
83
  if (!action.handler) {
58
84
  this.log.warn(`Device action ${actionId} on ${deviceId} is disabled because it has no handler`);
@@ -69,19 +95,32 @@ class DeviceManagement {
69
95
  var _a;
70
96
  if (!this.devices) {
71
97
  this.log.warn(`Device control ${controlId} was called before listDevices()`);
72
- return { error: { code: types_1.ErrorCodes.E_DEVICE_CONTROL_NOT_INITIALIZED, message: `Device control ${controlId} was called before listDevices()` } };
98
+ return {
99
+ error: {
100
+ code: types_1.ErrorCodes.E_DEVICE_CONTROL_NOT_INITIALIZED,
101
+ message: `Device control ${controlId} was called before listDevices()`,
102
+ },
103
+ };
73
104
  }
74
105
  const device = this.devices.get(deviceId);
75
106
  if (!device) {
76
107
  this.log.warn(`Device control ${controlId} was called on unknown device: ${deviceId}`);
77
108
  return {
78
- error: { code: types_1.ErrorCodes.E_DEVICE_CONTROL_DEVICE_UNKNOWN, message: `Device control ${controlId} was called on unknown device: ${deviceId}` },
109
+ error: {
110
+ code: types_1.ErrorCodes.E_DEVICE_CONTROL_DEVICE_UNKNOWN,
111
+ message: `Device control ${controlId} was called on unknown device: ${deviceId}`,
112
+ },
79
113
  };
80
114
  }
81
- const control = (_a = device.controls) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === controlId);
115
+ const control = (_a = device.controls) === null || _a === void 0 ? void 0 : _a.find(a => a.id === controlId);
82
116
  if (!control) {
83
117
  this.log.warn(`Device control ${controlId} doesn't exist on device ${deviceId}`);
84
- return { error: { code: types_1.ErrorCodes.E_DEVICE_CONTROL_UNKNOWN, message: `Device control ${controlId} doesn't exist on device ${deviceId}` } };
118
+ return {
119
+ error: {
120
+ code: types_1.ErrorCodes.E_DEVICE_CONTROL_UNKNOWN,
121
+ message: `Device control ${controlId} doesn't exist on device ${deviceId}`,
122
+ },
123
+ };
85
124
  }
86
125
  if (!control.handler) {
87
126
  this.log.warn(`Device control ${controlId} on ${deviceId} is disabled because it has no handler`);
@@ -99,19 +138,32 @@ class DeviceManagement {
99
138
  var _a;
100
139
  if (!this.devices) {
101
140
  this.log.warn(`Device get state ${controlId} was called before listDevices()`);
102
- return { error: { code: types_1.ErrorCodes.E_DEVICE_GET_STATE_NOT_INITIALIZED, message: `Device control ${controlId} was called before listDevices()` } };
141
+ return {
142
+ error: {
143
+ code: types_1.ErrorCodes.E_DEVICE_GET_STATE_NOT_INITIALIZED,
144
+ message: `Device control ${controlId} was called before listDevices()`,
145
+ },
146
+ };
103
147
  }
104
148
  const device = this.devices.get(deviceId);
105
149
  if (!device) {
106
150
  this.log.warn(`Device get state ${controlId} was called on unknown device: ${deviceId}`);
107
151
  return {
108
- error: { code: types_1.ErrorCodes.E_DEVICE_GET_STATE_DEVICE_UNKNOWN, message: `Device control ${controlId} was called on unknown device: ${deviceId}` },
152
+ error: {
153
+ code: types_1.ErrorCodes.E_DEVICE_GET_STATE_DEVICE_UNKNOWN,
154
+ message: `Device control ${controlId} was called on unknown device: ${deviceId}`,
155
+ },
109
156
  };
110
157
  }
111
- const control = (_a = device.controls) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === controlId);
158
+ const control = (_a = device.controls) === null || _a === void 0 ? void 0 : _a.find(a => a.id === controlId);
112
159
  if (!control) {
113
160
  this.log.warn(`Device get state ${controlId} doesn't exist on device ${deviceId}`);
114
- return { error: { code: types_1.ErrorCodes.E_DEVICE_GET_STATE_UNKNOWN, message: `Device control ${controlId} doesn't exist on device ${deviceId}` } };
161
+ return {
162
+ error: {
163
+ code: types_1.ErrorCodes.E_DEVICE_GET_STATE_UNKNOWN,
164
+ message: `Device control ${controlId} doesn't exist on device ${deviceId}`,
165
+ },
166
+ };
115
167
  }
116
168
  if (!control.getStateHandler) {
117
169
  this.log.warn(`Device get state ${controlId} on ${deviceId} is disabled because it has no handler`);
@@ -125,20 +177,20 @@ class DeviceManagement {
125
177
  return control.getStateHandler(deviceId, controlId, context);
126
178
  }
127
179
  onMessage(obj) {
128
- if (!obj.command.startsWith("dm:")) {
180
+ if (!obj.command.startsWith('dm:')) {
129
181
  return;
130
182
  }
131
- this.handleMessage(obj).catch(this.log.error);
183
+ void this.handleMessage(obj).catch(this.log.error);
132
184
  }
133
185
  async handleMessage(msg) {
134
186
  this.log.debug(`DeviceManagement received: ${JSON.stringify(msg)}`);
135
187
  switch (msg.command) {
136
- case "dm:instanceInfo": {
188
+ case 'dm:instanceInfo': {
137
189
  this.instanceInfo = await this.getInstanceInfo();
138
190
  this.sendReply(Object.assign(Object.assign({}, this.instanceInfo), { actions: this.convertActions(this.instanceInfo.actions) }), msg);
139
191
  return;
140
192
  }
141
- case "dm:listDevices": {
193
+ case 'dm:listDevices': {
142
194
  const deviceList = await this.listDevices();
143
195
  this.devices = deviceList.reduce((map, value) => {
144
196
  if (map.has(value.id)) {
@@ -147,17 +199,17 @@ class DeviceManagement {
147
199
  map.set(value.id, value);
148
200
  return map;
149
201
  }, new Map());
150
- const apiDeviceList = deviceList.map((d) => (Object.assign(Object.assign({}, d), { actions: this.convertActions(d.actions), controls: this.convertControls(d.controls) })));
202
+ const apiDeviceList = deviceList.map(d => (Object.assign(Object.assign({}, d), { actions: this.convertActions(d.actions), controls: this.convertControls(d.controls) })));
151
203
  this.sendReply(apiDeviceList, msg);
152
204
  this.adapter.sendTo(msg.from, msg.command, this.devices, msg.callback);
153
205
  return;
154
206
  }
155
- case "dm:deviceDetails": {
207
+ case 'dm:deviceDetails': {
156
208
  const details = await this.getDeviceDetails(msg.message);
157
209
  this.adapter.sendTo(msg.from, msg.command, details, msg.callback);
158
210
  return;
159
211
  }
160
- case "dm:instanceAction": {
212
+ case 'dm:instanceAction': {
161
213
  const action = msg.message;
162
214
  const context = new MessageContext(msg, this.adapter);
163
215
  this.contexts.set(msg._id, context);
@@ -166,16 +218,18 @@ class DeviceManagement {
166
218
  context.sendFinalResult(result);
167
219
  return;
168
220
  }
169
- case "dm:deviceAction": {
221
+ case 'dm:deviceAction': {
170
222
  const action = msg.message;
171
223
  const context = new MessageContext(msg, this.adapter);
172
224
  this.contexts.set(msg._id, context);
173
- const result = await this.handleDeviceAction(action.deviceId, action.actionId, context, { value: action.value });
225
+ const result = await this.handleDeviceAction(action.deviceId, action.actionId, context, {
226
+ value: action.value,
227
+ });
174
228
  this.contexts.delete(msg._id);
175
229
  context.sendFinalResult(result);
176
230
  return;
177
231
  }
178
- case "dm:deviceControl": {
232
+ case 'dm:deviceControl': {
179
233
  const control = msg.message;
180
234
  const context = new MessageContext(msg, this.adapter);
181
235
  this.contexts.set(msg._id, context);
@@ -184,7 +238,7 @@ class DeviceManagement {
184
238
  context.sendControlResult(control.deviceId, control.controlId, result);
185
239
  return;
186
240
  }
187
- case "dm:deviceControlState": {
241
+ case 'dm:deviceControlState': {
188
242
  const control = msg.message;
189
243
  const context = new MessageContext(msg, this.adapter);
190
244
  this.contexts.set(msg._id, context);
@@ -193,12 +247,12 @@ class DeviceManagement {
193
247
  context.sendControlResult(control.deviceId, control.controlId, result);
194
248
  return;
195
249
  }
196
- case "dm:actionProgress": {
250
+ case 'dm:actionProgress': {
197
251
  const { origin } = msg.message;
198
252
  const context = this.contexts.get(origin);
199
253
  if (!context) {
200
254
  this.log.warn(`Unknown message origin: ${origin}`);
201
- this.sendReply({ error: "Unknown action origin" }, msg);
255
+ this.sendReply({ error: 'Unknown action origin' }, msg);
202
256
  return;
203
257
  }
204
258
  context.handleProgress(msg);
@@ -212,7 +266,7 @@ class DeviceManagement {
212
266
  }
213
267
  // detect duplicate IDs
214
268
  const ids = new Set();
215
- actions.forEach((a) => {
269
+ actions.forEach(a => {
216
270
  if (ids.has(a.id)) {
217
271
  throw new Error(`Action ID ${a.id} is used twice, this would lead to unexpected behavior`);
218
272
  }
@@ -227,7 +281,7 @@ class DeviceManagement {
227
281
  }
228
282
  // detect duplicate IDs
229
283
  const ids = new Set();
230
- controls.forEach((a) => {
284
+ controls.forEach(a => {
231
285
  if (ids.has(a.id)) {
232
286
  throw new Error(`Control ID ${a.id} is used twice, this would lead to unexpected behavior`);
233
287
  }
@@ -249,30 +303,30 @@ class MessageContext {
249
303
  }
250
304
  showMessage(text) {
251
305
  this.checkPreconditions();
252
- const promise = new Promise((resolve) => {
306
+ const promise = new Promise(resolve => {
253
307
  this.progressHandler = () => resolve();
254
308
  });
255
- this.send("message", {
309
+ this.send('message', {
256
310
  message: text,
257
311
  });
258
312
  return promise;
259
313
  }
260
314
  showConfirmation(text) {
261
315
  this.checkPreconditions();
262
- const promise = new Promise((resolve) => {
263
- this.progressHandler = (msg) => resolve(!!msg.confirm);
316
+ const promise = new Promise(resolve => {
317
+ this.progressHandler = msg => resolve(!!msg.confirm);
264
318
  });
265
- this.send("confirm", {
319
+ this.send('confirm', {
266
320
  confirm: text,
267
321
  });
268
322
  return promise;
269
323
  }
270
324
  showForm(schema, options) {
271
325
  this.checkPreconditions();
272
- const promise = new Promise((resolve) => {
273
- this.progressHandler = (msg) => resolve(msg.data);
326
+ const promise = new Promise(resolve => {
327
+ this.progressHandler = msg => resolve(msg.data);
274
328
  });
275
- this.send("form", {
329
+ this.send('form', {
276
330
  form: Object.assign({ schema }, options),
277
331
  });
278
332
  return promise;
@@ -282,43 +336,43 @@ class MessageContext {
282
336
  this.hasOpenProgressDialog = true;
283
337
  const dialog = {
284
338
  update: (update) => {
285
- const promise = new Promise((resolve) => {
339
+ const promise = new Promise(resolve => {
286
340
  this.progressHandler = () => resolve();
287
341
  });
288
- this.send("progress", {
342
+ this.send('progress', {
289
343
  progress: Object.assign(Object.assign(Object.assign({ title }, options), update), { open: true }),
290
344
  });
291
345
  return promise;
292
346
  },
293
347
  close: () => {
294
- const promise = new Promise((resolve) => {
348
+ const promise = new Promise(resolve => {
295
349
  this.progressHandler = () => {
296
350
  this.hasOpenProgressDialog = false;
297
351
  resolve();
298
352
  };
299
353
  });
300
- this.send("progress", {
354
+ this.send('progress', {
301
355
  progress: { open: false },
302
356
  });
303
357
  return promise;
304
358
  },
305
359
  };
306
- const promise = new Promise((resolve) => {
360
+ const promise = new Promise(resolve => {
307
361
  this.progressHandler = () => resolve(dialog);
308
362
  });
309
- this.send("progress", {
363
+ this.send('progress', {
310
364
  progress: Object.assign(Object.assign({ title }, options), { open: true }),
311
365
  });
312
366
  return promise;
313
367
  }
314
368
  sendFinalResult(result) {
315
- this.send("result", {
369
+ this.send('result', {
316
370
  result,
317
371
  });
318
372
  }
319
373
  sendControlResult(deviceId, controlId, result) {
320
- if (typeof result === "object" && "error" in result) {
321
- this.send("result", {
374
+ if (typeof result === 'object' && 'error' in result) {
375
+ this.send('result', {
322
376
  result: {
323
377
  error: result.error,
324
378
  deviceId,
@@ -327,7 +381,7 @@ class MessageContext {
327
381
  });
328
382
  }
329
383
  else {
330
- this.send("result", {
384
+ this.send('result', {
331
385
  result: {
332
386
  state: result,
333
387
  deviceId,
@@ -338,7 +392,7 @@ class MessageContext {
338
392
  }
339
393
  handleProgress(message) {
340
394
  const currentHandler = this.progressHandler;
341
- if (currentHandler && typeof message.message !== "string") {
395
+ if (currentHandler && typeof message.message !== 'string') {
342
396
  this.lastMessage = message;
343
397
  this.progressHandler = undefined;
344
398
  currentHandler(message.message);
package/build/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./ActionContext";
2
- export * from "./DeviceManagement";
3
- export * from "./types";
1
+ export type * from './ActionContext';
2
+ export * from './DeviceManagement';
3
+ export * from './types';
package/build/index.js CHANGED
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ActionContext"), exports);
18
17
  __exportStar(require("./DeviceManagement"), exports);
19
18
  // don't export * from "./MessageContext" as it is private
20
19
  __exportStar(require("./types"), exports);
@@ -1,7 +1,7 @@
1
- import * as base from "./base";
2
- export type ActionBase = base.ActionBase<"adapter">;
3
- export type InstanceAction = base.InstanceAction<"adapter">;
4
- export type DeviceAction = base.DeviceAction<"adapter">;
5
- export type InstanceDetails = base.InstanceDetails<"adapter">;
6
- export type DeviceInfo = base.DeviceInfo<"adapter">;
7
- export type DeviceControl = base.DeviceControl<"adapter">;
1
+ import type * as base from './base';
2
+ export type ActionBase = base.ActionBase<'adapter'>;
3
+ export type InstanceAction = base.InstanceAction<'adapter'>;
4
+ export type DeviceAction = base.DeviceAction<'adapter'>;
5
+ export type InstanceDetails = base.InstanceDetails<'adapter'>;
6
+ export type DeviceInfo = base.DeviceInfo<'adapter'>;
7
+ export type DeviceControl = base.DeviceControl<'adapter'>;
@@ -1,7 +1,7 @@
1
- import * as base from "./base";
2
- export type ActionBase = base.ActionBase<"api">;
3
- export type InstanceAction = base.InstanceAction<"api">;
4
- export type DeviceAction = base.DeviceAction<"api">;
5
- export type InstanceDetails = base.InstanceDetails<"api">;
6
- export type DeviceInfo = base.DeviceInfo<"api">;
7
- export type DeviceControl = base.DeviceControl<"api">;
1
+ import type * as base from './base';
2
+ export type ActionBase = base.ActionBase<'api'>;
3
+ export type InstanceAction = base.InstanceAction<'api'>;
4
+ export type DeviceAction = base.DeviceAction<'api'>;
5
+ export type InstanceDetails = base.InstanceDetails<'api'>;
6
+ export type DeviceInfo = base.DeviceInfo<'api'>;
7
+ export type DeviceControl = base.DeviceControl<'api'>;
@@ -1,16 +1,16 @@
1
- import { ActionContext, ErrorResponse, MessageContext } from "..";
2
- import { ApiVersion, DeviceRefresh, DeviceStatus, RetVal } from "./common";
3
- type ActionType = "api" | "adapter";
4
- export type Color = "primary" | "secondary" | string & {};
1
+ import type { ActionContext, ErrorResponse, MessageContext } from '..';
2
+ import type { ApiVersion, DeviceRefresh, DeviceStatus, RetVal } from './common';
3
+ type ActionType = 'api' | 'adapter';
4
+ export type Color = 'primary' | 'secondary' | (string & {});
5
5
  export type ControlState = string | number | boolean | null;
6
6
  export interface ActionBase<T extends ActionType> {
7
7
  id: string;
8
8
  /**
9
9
  * This can either be base64 or the URL to an icon.
10
10
  */
11
- icon?: "edit" | "rename" | "delete" | "refresh" | "newDevice" | "new" | "add" | "discover" | "search" | "unpairDevice" | "pairDevice" | "identify" | "play" | "stop" | "pause" | "forward" | "next" | "rewind" | "previous" | "lamp" | "light" | "backlight" | "dimmer" | "socket" | "settings" | "users" | "group" | "user" | string;
11
+ icon?: 'edit' | 'rename' | 'delete' | 'refresh' | 'newDevice' | 'new' | 'add' | 'discover' | 'search' | 'unpairDevice' | 'pairDevice' | 'identify' | 'play' | 'stop' | 'pause' | 'forward' | 'next' | 'rewind' | 'previous' | 'lamp' | 'light' | 'backlight' | 'dimmer' | 'socket' | 'settings' | 'users' | 'group' | 'user' | string;
12
12
  description?: ioBroker.StringOrTranslated;
13
- disabled?: T extends "api" ? boolean : never;
13
+ disabled?: T extends 'api' ? boolean : never;
14
14
  color?: Color;
15
15
  backgroundColor?: Color;
16
16
  /** If true, the user will be asked for confirmation before executing the action */
@@ -20,7 +20,7 @@ export interface ActionBase<T extends ActionType> {
20
20
  /** This label will be shown for the text input */
21
21
  label: ioBroker.StringOrTranslated;
22
22
  /** This type of input will be shown. Default is type */
23
- type?: "text" | "number" | "checkbox" | "select" | "slider" | "color";
23
+ type?: 'text' | 'number' | 'checkbox' | 'select' | 'slider' | 'color';
24
24
  /** If a type is "select", the options must be defined */
25
25
  options?: {
26
26
  label: ioBroker.StringOrTranslated;
@@ -48,7 +48,7 @@ export interface ChannelInfo {
48
48
  }
49
49
  export interface ControlBase {
50
50
  id: string;
51
- type: "button" | "switch" | "slider" | "select" | "icon" | "color" | "text" | "number" | "info";
51
+ type: 'button' | 'switch' | 'slider' | 'select' | 'icon' | 'color' | 'text' | 'number' | 'info';
52
52
  state?: ioBroker.State;
53
53
  stateId?: string;
54
54
  icon?: string;
@@ -70,26 +70,26 @@ export interface ControlBase {
70
70
  }[];
71
71
  channel?: ChannelInfo;
72
72
  }
73
- export interface DeviceControl<T extends ActionType = "api"> extends ControlBase {
74
- handler?: T extends "api" ? never : (deviceId: string, actionId: string, state: ControlState, context: MessageContext) => RetVal<ErrorResponse | ioBroker.State>;
75
- getStateHandler?: T extends "api" ? never : (deviceId: string, actionId: string, context: MessageContext) => RetVal<ErrorResponse | ioBroker.State>;
73
+ export interface DeviceControl<T extends ActionType = 'api'> extends ControlBase {
74
+ handler?: T extends 'api' ? never : (deviceId: string, actionId: string, state: ControlState, context: MessageContext) => RetVal<ErrorResponse | ioBroker.State>;
75
+ getStateHandler?: T extends 'api' ? never : (deviceId: string, actionId: string, context: MessageContext) => RetVal<ErrorResponse | ioBroker.State>;
76
76
  }
77
- export interface InstanceAction<T extends ActionType = "api"> extends ActionBase<T> {
78
- handler?: T extends "api" ? never : (context: ActionContext, options?: Record<string, any>) => RetVal<{
77
+ export interface InstanceAction<T extends ActionType = 'api'> extends ActionBase<T> {
78
+ handler?: T extends 'api' ? never : (context: ActionContext, options?: Record<string, any>) => RetVal<{
79
79
  refresh: boolean;
80
80
  }>;
81
81
  title: ioBroker.StringOrTranslated;
82
82
  }
83
- export interface DeviceAction<T extends ActionType = "api"> extends ActionBase<T> {
84
- handler?: T extends "api" ? never : (deviceId: string, context: ActionContext, options?: Record<string, any>) => RetVal<{
83
+ export interface DeviceAction<T extends ActionType = 'api'> extends ActionBase<T> {
84
+ handler?: T extends 'api' ? never : (deviceId: string, context: ActionContext, options?: Record<string, any>) => RetVal<{
85
85
  refresh: DeviceRefresh;
86
86
  }>;
87
87
  }
88
- export interface InstanceDetails<T extends ActionType = "api"> {
88
+ export interface InstanceDetails<T extends ActionType = 'api'> {
89
89
  apiVersion: ApiVersion;
90
90
  actions?: InstanceAction<T>[];
91
91
  }
92
- export interface DeviceInfo<T extends ActionType = "api"> {
92
+ export interface DeviceInfo<T extends ActionType = 'api'> {
93
93
  id: string;
94
94
  icon?: string;
95
95
  manufacturer?: ioBroker.StringOrTranslated;
@@ -1,15 +1,23 @@
1
- export type ApiVersion = "v1";
2
- export type DeviceStatus = "connected" | "disconnected" | {
1
+ export type ApiVersion = 'v1';
2
+ export type DeviceStatus = 'connected' | 'disconnected' | {
3
3
  /**
4
4
  * This can either be the name of a font awesome icon (e.g. "fa-signal") or the URL to an icon.
5
5
  */
6
6
  icon?: string;
7
- battery?: number | boolean | "charging" | string;
8
- connection?: "connected" | "disconnected";
7
+ battery?: number | boolean | 'charging';
8
+ connection?: 'connected' | 'disconnected';
9
9
  rssi?: number;
10
10
  warning?: ioBroker.StringOrTranslated | boolean;
11
11
  };
12
- export type DeviceRefresh = "device" | "instance" | false | true;
12
+ export type ActionButton = {
13
+ label: ioBroker.StringOrTranslated;
14
+ type: 'apply' | 'cancel';
15
+ icon?: string;
16
+ variant?: 'contained' | 'outlined' | 'text';
17
+ style?: Record<string, number | string>;
18
+ color: 'primary' | 'secondary';
19
+ } | 'ok' | 'cancel';
20
+ export type DeviceRefresh = 'device' | 'instance' | false | true;
13
21
  export type RefreshResponse = {
14
22
  refresh: DeviceRefresh;
15
23
  };
@@ -30,7 +38,7 @@ interface ObjectBrowserCustomFilter {
30
38
  };
31
39
  }
32
40
  export type ObjectBrowserType = 'state' | 'instance' | 'channel' | 'device' | 'chart';
33
- 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' | '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';
41
+ 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';
34
42
  type ConfigIconType = 'edit' | 'auth' | 'send' | 'web' | 'warning' | 'error' | 'info' | 'search' | 'book' | 'help' | 'upload' | 'user' | 'group' | 'delete' | 'refresh' | 'add' | 'unpair' | 'pair' | string;
35
43
  export interface ConfigItemConfirmData {
36
44
  condition: string;
@@ -42,19 +50,33 @@ export interface ConfigItemConfirmData {
42
50
  alsoDependsOn?: string[];
43
51
  }
44
52
  export interface ConfigItem {
53
+ /** Type of the JSON config item */
45
54
  type: ConfigItemType;
55
+ /** Width of the control on "extra small" displays */
56
+ xs?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
57
+ /** Width of the control on "small" displays */
46
58
  sm?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
59
+ /** Width of the control on "medium" displays */
47
60
  md?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
61
+ /** Width of the control on "large" displays */
48
62
  lg?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
49
- xs?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
63
+ /** Width of the control on "extra large" displays */
64
+ xl?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
65
+ /** If the control should be shown in a new line */
50
66
  newLine?: boolean;
67
+ /** Label of the control */
51
68
  label?: ioBroker.StringOrTranslated;
52
69
  /** @deprecated use label */
53
70
  text?: ioBroker.StringOrTranslated;
71
+ /** Formula or false to hide the control: "data.attr === 5" */
54
72
  hidden?: string | boolean;
73
+ /** If true and the control is hidden, the place of the control will be still reserved for it */
55
74
  hideOnlyControl?: boolean;
75
+ /** JS function to calculate if the control is disabled. You can write "true" too */
56
76
  disabled?: string | boolean;
77
+ /** Help text of the control */
57
78
  help?: ioBroker.StringOrTranslated;
79
+ /** Link that will be opened by clicking on the help text */
58
80
  helpLink?: string;
59
81
  style?: CustomCSSProperties;
60
82
  darkStyle?: CustomCSSProperties;
@@ -65,6 +87,8 @@ export interface ConfigItem {
65
87
  default?: boolean | number | string;
66
88
  defaultFunc?: string;
67
89
  defaultSendTo?: string;
90
+ /** Allow saving of configuration even with error */
91
+ allowSaveWithError?: boolean;
68
92
  data?: string | number | boolean;
69
93
  jsonData?: string;
70
94
  button?: ioBroker.StringOrTranslated;
@@ -162,6 +186,8 @@ export interface ConfigItemText extends ConfigItem {
162
186
  max?: number;
163
187
  /** read-only field */
164
188
  readOnly?: boolean;
189
+ /** show copy to clipboard button, but only if disabled or read-only */
190
+ copyToClipboard?: boolean;
165
191
  /** default is true. Set this attribute to `false` if trim is not desired. */
166
192
  trim?: boolean;
167
193
  /** default is 1. Set this attribute to `2` or more if you want to have a textarea with more than one row. */
@@ -184,6 +210,8 @@ export interface ConfigItemColor extends ConfigItem {
184
210
  }
185
211
  export interface ConfigItemCheckbox extends ConfigItem {
186
212
  type: 'checkbox';
213
+ /** Same as disabled */
214
+ readOnly?: boolean;
187
215
  }
188
216
  export interface ConfigItemNumber extends ConfigItem {
189
217
  type: 'number';
@@ -224,7 +252,8 @@ export interface ConfigItemObjectId extends ConfigItem {
224
252
  types?: ObjectBrowserType | ObjectBrowserType[];
225
253
  /** Show only this root object and its children */
226
254
  root?: string;
227
- /** Cannot be used together with `type` settings. It is an object and not a JSON string. Examples
255
+ /**
256
+ * Cannot be used together with `type` settings. It is an object and not a JSON string. Examples
228
257
  * - `{common: {custom: true}}` - show only objects with some custom settings
229
258
  * - `{common: {custom: 'sql.0'}}` - show only objects with sql.0 custom settings (only of the specific instance)
230
259
  * - `{common: {custom: '_dataSources'}}` - show only objects of adapters `influxdb` or `sql` or `history`
@@ -298,7 +327,7 @@ export interface ConfigItemStaticImage extends ConfigItem {
298
327
  export interface ConfigItemStaticText extends Omit<ConfigItem, 'button'> {
299
328
  type: 'staticText';
300
329
  /** multi-language text */
301
- text: string;
330
+ text: ioBroker.StringOrTranslated;
302
331
  /** @deprecated use text */
303
332
  label?: ioBroker.StringOrTranslated;
304
333
  /** link. Link could be dynamic like `#tab-objects/customs/${data.parentId} */
@@ -316,7 +345,34 @@ export interface ConfigItemStaticText extends Omit<ConfigItem, 'button'> {
316
345
  /** if icon should be shown: `auth`, `send`, `web`, `warning`, `error`, `info`, `search`, `book`, `help`, `upload`. You can use `base64` icons (it starts with `data:image/svg+xml;base64,...`) or `jpg/png` images (ends with `.png`) . (Request via issue if you need more icons) */
317
346
  icon?: ConfigIconType;
318
347
  /** styles for the button */
319
- controlStyle: CustomCSSProperties;
348
+ controlStyle?: CustomCSSProperties;
349
+ }
350
+ export interface ConfigItemStaticInfo extends Omit<ConfigItem, 'data'> {
351
+ type: 'staticInfo';
352
+ /** multi-language text or value */
353
+ data: ioBroker.StringOrTranslated | number | boolean;
354
+ /** Base64 icon */
355
+ labelIcon?: string;
356
+ /** Unit */
357
+ unit?: ioBroker.StringOrTranslated;
358
+ /** 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*/
359
+ narrow?: boolean;
360
+ /** Add to label the colon at the end if not exist in label */
361
+ addColon?: boolean;
362
+ /** Value should blink when updated (true or color) */
363
+ blinkOnUpdate?: boolean | string;
364
+ /** Value should blink continuously (true or color) */
365
+ blink?: boolean | string;
366
+ /** Show copy to clipboard button for value */
367
+ copyToClipboard?: boolean;
368
+ /** Label style */
369
+ styleLabel?: CustomCSSProperties;
370
+ /** Value style */
371
+ styleValue?: CustomCSSProperties;
372
+ /** Unit style */
373
+ styleUnit?: CustomCSSProperties;
374
+ /** Font size */
375
+ size?: number | 'small' | 'normal' | 'large';
320
376
  }
321
377
  export interface ConfigItemRoom extends ConfigItem {
322
378
  type: 'room';
@@ -330,8 +386,9 @@ export interface ConfigItemFunc extends ConfigItem {
330
386
  }
331
387
  export interface ConfigItemSelect extends ConfigItem {
332
388
  type: 'select';
333
- /** `[{label: {en: "option 1"}, value: 1}, ...]` or
334
- `[{"items": [{"label": "Val1", "value": 1}, {"label": "Val2", value: "2}], "name": "group1"}, {"items": [{"label": "Val3", "value": 3}, {"label": "Val4", value: "4}], "name": "group2"}, {"label": "Val5", "value": 5}]`
389
+ /**
390
+ * `[{label: {en: "option 1"}, value: 1}, ...]` or
391
+ * `[{"items": [{"label": "Val1", "value": 1}, {"label": "Val2", value: "2}], "name": "group1"}, {"items": [{"label": "Val3", "value": 3}, {"label": "Val4", value: "4}], "name": "group2"}, {"label": "Val5", "value": 5}]`
335
392
  */
336
393
  options: (ConfigItemSelectOption | {
337
394
  items: ConfigItemSelectOption[];
@@ -480,7 +537,7 @@ export interface ConfigItemSendTo extends Omit<ConfigItem, 'data'> {
480
537
  }
481
538
  export interface ConfigItemState extends ConfigItem {
482
539
  type: 'state';
483
- /** Which object ID should be taken for the controlling. The ID is without "adapter.X." prefix */
540
+ /** Describes, which object ID should be taken for the controlling. The ID is without "adapter.X." prefix */
484
541
  oid: string;
485
542
  /** If true, the state will be taken from system.adapter.XX.I. and not from XX.I */
486
543
  system?: boolean;
@@ -512,6 +569,8 @@ export interface ConfigItemState extends ConfigItem {
512
569
  controlDelay?: number;
513
570
  /** Variant of button */
514
571
  variant?: 'contained' | 'outlined' | 'text';
572
+ /** Defines if the control is read-only. Applied only to 'input', 'slider', 'select', 'button', 'switch', 'number' */
573
+ readOnly?: boolean;
515
574
  }
516
575
  export interface ConfigItemTextSendTo extends Omit<ConfigItem, 'data'> {
517
576
  type: 'textSendTo';
@@ -656,11 +715,11 @@ export interface ConfigItemInterface extends ConfigItem {
656
715
  }
657
716
  export interface ConfigItemImageUpload extends ConfigItem {
658
717
  type: 'image';
659
- /** name of file is structure name. In the below example `login-bg.png` is file name for `writeFile("myAdapter.INSTANCE", "login-bg.png")` */
718
+ /** name of a file is structure name. In the below example `login-bg.png` is file name for `writeFile("myAdapter.INSTANCE", "login-bg.png")` */
660
719
  filename?: string;
661
- /** html accept attribute, like `{ 'image/**': [], 'application/pdf': ['.pdf'] }`, default `{ 'image/*': [] }` */
720
+ /** HTML accept attribute, like `{ 'image/**': [], 'application/pdf': ['.pdf'] }`, default `{ 'image/*': [] }` */
662
721
  accept?: Record<string, string[]>;
663
- /** maximal size of file to upload */
722
+ /** maximal size of a file to upload */
664
723
  maxSize?: number;
665
724
  /** if true, the image will be saved as data-url in attribute, elsewise as binary in file storage */
666
725
  base64?: boolean;
@@ -734,8 +793,44 @@ export interface ConfigItemFileSelector extends ConfigItem {
734
793
  /** Do not show the size of files */
735
794
  noSize?: boolean;
736
795
  }
737
- 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 | ConfigItemStaticImage | ConfigItemStaticText | ConfigItemTopic | ConfigItemObjectId | ConfigItemQrCode;
738
- export type JsonFormSchema = ConfigItemPanel;
796
+ 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;
797
+ export type BackEndCommandType = 'nop' | 'refresh' | 'link' | 'message';
798
+ export interface BackEndCommandGeneric {
799
+ command: BackEndCommandType;
800
+ /** New GUI schema */
801
+ schema?: ConfigItemPanel;
802
+ /** New GUI data */
803
+ data?: Record<string, any>;
804
+ refresh?: boolean;
805
+ }
806
+ export interface BackEndCommandNoOperation extends BackEndCommandGeneric {
807
+ command: 'nop';
808
+ }
809
+ export interface BackEndCommandRefresh extends BackEndCommandGeneric {
810
+ command: 'refresh';
811
+ /** If refresh the GUI */
812
+ fullRefresh?: boolean;
813
+ }
814
+ export interface BackEndCommandOpenLink extends BackEndCommandGeneric {
815
+ command: 'link';
816
+ /** Link url. Could be relative ('#blabla') or absolute ('https://blabla') */
817
+ url: string;
818
+ /** Target of the link. Default is `_self` for relative and '_blank' for absolute links */
819
+ target?: '_self' | '_blank' | string;
820
+ /** If GUI should be closed after the link was opened (Only for target='_self') */
821
+ close?: boolean;
822
+ }
823
+ export interface BackEndCommandMessage extends BackEndCommandGeneric {
824
+ command: 'message';
825
+ /** Message text */
826
+ message: ioBroker.StringOrTranslated;
827
+ /** If GUI should be closed after the message shown */
828
+ close?: boolean;
829
+ /** Type of message. Default is 'popup' */
830
+ variant: 'popup' | 'dialog';
831
+ }
832
+ export type BackEndCommand = BackEndCommandMessage | BackEndCommandOpenLink | BackEndCommandRefresh;
833
+ export type JsonFormSchema = ConfigItemPanel | ConfigItemTabs;
739
834
  export type JsonFormData = Record<string, any>;
740
835
  export interface DeviceDetails {
741
836
  id: string;
@@ -1,4 +1,4 @@
1
- export * from "./adapter";
2
- export * from "./common";
3
- export * from "./errorCodes";
4
- export { ChannelInfo, Color, ControlState, ControlBase } from "./base";
1
+ export type * from './adapter';
2
+ export type * from './common';
3
+ export * from './errorCodes';
4
+ export type { ChannelInfo, Color, ControlState, ControlBase } from './base';
@@ -14,6 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./adapter"), exports);
18
- __exportStar(require("./common"), exports);
19
17
  __exportStar(require("./errorCodes"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/dm-utils",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "ioBroker Device Manager utilities for backend",
5
5
  "main": "build/index.js",
6
6
  "publishConfig": {
@@ -10,6 +10,7 @@
10
10
  "scripts": {
11
11
  "build": "tsc -p tsconfig.json",
12
12
  "lint": "eslint .",
13
+ "updateCommonTs": "node tasks.js",
13
14
  "prettier": "prettier -u -w examples src",
14
15
  "release": "release-script",
15
16
  "release-patch": "release-script patch --yes",
@@ -21,18 +22,15 @@
21
22
  "author": "UncleSamSwiss",
22
23
  "license": "MIT",
23
24
  "dependencies": {
24
- "@iobroker/adapter-core": "^3.1.6"
25
+ "@iobroker/adapter-core": "^3.2.2"
25
26
  },
26
27
  "devDependencies": {
27
28
  "@alcalzone/release-script": "^3.8.0",
28
29
  "@alcalzone/release-script-plugin-license": "^3.7.0",
29
- "@types/node": "^22.5.1",
30
- "@typescript-eslint/eslint-plugin": "^8.3.0",
31
- "@typescript-eslint/parser": "^8.3.0",
32
- "eslint": "^9.9.1",
33
- "eslint-config-prettier": "^9.1.0",
34
- "prettier": "^3.3.3",
35
- "typescript": "^5.5.4"
30
+ "@iobroker/eslint-config": "^1.0.0",
31
+ "@types/node": "^22.9.0",
32
+ "axios": "^1.7.7",
33
+ "typescript": "^5.6.3"
36
34
  },
37
35
  "files": [
38
36
  "LICENSE",