iobroker.javascript 8.9.2 → 9.0.0
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 +7 -3
- package/admin/assets/{createSvgIcon-BdRvDw53.js → createSvgIcon-BQT-7-GS.js} +1 -1
- package/admin/assets/{docs-6na4NFtj.js → docs-BrInh2Pn.js} +2 -2
- package/admin/assets/index-B0RKH_iG.js +1329 -0
- package/admin/assets/index-CfuHVX2B.js +193 -0
- package/admin/assets/index-CuCs5aLs.js +5 -0
- package/admin/assets/index-tExaxF69.js +930 -0
- package/admin/assets/inheritsLoose--KnFDOw1.js +36 -0
- package/admin/assets/{useTheme-Cl1QmYFL.js → useTheme-DF6qfrtI.js} +1 -1
- package/admin/custom/assets/{Components-ChpTW7sE.js → Components-D9kRsHNY.js} +1 -1
- package/admin/custom/assets/{DefaultPropsProvider-CHpMCMgA.js → DefaultPropsProvider-9qubdy-V.js} +2 -2
- package/admin/custom/assets/{FilledInput-CtcQVKyj.js → FilledInput-BpuM_GyB.js} +1 -1
- package/admin/custom/assets/Tabs-CvEv0KOT.js +138 -0
- package/admin/custom/assets/ThemeProvider-DZTpMR8n.js +29 -0
- package/admin/custom/assets/{createSvgIcon-C_vAELFU.js → createSvgIcon-BQThUM-f.js} +1 -1
- package/admin/custom/assets/hostInit-CrAs5YZS.js +1 -1
- package/admin/custom/assets/{index-DwsbskQy.js → index-DIWNdd4a.js} +1 -1
- package/admin/custom/assets/index-DZqbj5K4.js +55 -0
- package/admin/custom/assets/{index-D5apCzjJ.js → index-Dbe-II7_.js} +6 -6
- package/admin/custom/assets/index-az76fZMP.js +904 -0
- package/admin/custom/assets/index-sawv1cUe.js +1399 -0
- package/admin/custom/assets/{virtualExposes-BPncCdUy.js → virtualExposes-BMKIjWrE.js} +2 -2
- package/admin/custom/customComponents.js +2 -2
- package/admin/custom/i18n/de.json +29 -29
- package/admin/custom/i18n/es.json +29 -29
- package/admin/custom/i18n/fr.json +29 -29
- package/admin/custom/i18n/it.json +29 -29
- package/admin/custom/i18n/nl.json +29 -29
- package/admin/custom/i18n/pl.json +29 -29
- package/admin/custom/i18n/pt.json +29 -29
- package/admin/custom/i18n/ru.json +29 -29
- package/admin/custom/i18n/uk.json +29 -29
- package/admin/custom/i18n/zh-cn.json +29 -29
- package/admin/google-blockly/blockly_compressed.js +875 -887
- package/admin/google-blockly/blocks_compressed.js +38 -41
- package/admin/google-blockly/javascript_compressed.js +19 -54
- package/admin/google-blockly/media/delete-icon.svg +1 -0
- package/admin/google-blockly/media/foldout-icon.svg +1 -0
- package/admin/google-blockly/media/resize-handle.svg +3 -0
- package/admin/jsonConfig.json +2 -0
- package/admin/mf-manifest.json +1 -1
- package/admin/remoteEntry.js +2 -2
- package/admin/tab.html +4 -4
- package/admin/vsFont/README.md +1 -1
- package/admin/vsFont/createJson.js +1 -1
- package/build-backend/lib/consts.js +346 -0
- package/build-backend/lib/consts.js.map +1 -0
- package/build-backend/lib/convert.js +120 -0
- package/build-backend/lib/convert.js.map +1 -0
- package/build-backend/lib/debug.js +163 -0
- package/build-backend/lib/debug.js.map +1 -0
- package/{lib → build-backend/lib}/debugger.js +261 -232
- package/build-backend/lib/debugger.js.map +1 -0
- package/build-backend/lib/eventObj.js +177 -0
- package/build-backend/lib/eventObj.js.map +1 -0
- package/build-backend/lib/inspect.js +728 -0
- package/build-backend/lib/inspect.js.map +1 -0
- package/build-backend/lib/javascript.d.ts +1972 -0
- package/{lib → build-backend/lib}/mirror.js +185 -182
- package/build-backend/lib/mirror.js.map +1 -0
- package/build-backend/lib/nodeModulesManagement.js +25 -0
- package/build-backend/lib/nodeModulesManagement.js.map +1 -0
- package/build-backend/lib/patternCompareFunctions.js +321 -0
- package/build-backend/lib/patternCompareFunctions.js.map +1 -0
- package/build-backend/lib/protectFs.js +477 -0
- package/build-backend/lib/protectFs.js.map +1 -0
- package/build-backend/lib/request.js +89 -0
- package/build-backend/lib/request.js.map +1 -0
- package/{lib → build-backend/lib}/sandbox.js +2046 -1852
- package/build-backend/lib/sandbox.js.map +1 -0
- package/build-backend/lib/scheduler.js +553 -0
- package/build-backend/lib/scheduler.js.map +1 -0
- package/build-backend/lib/tools.js +183 -0
- package/build-backend/lib/tools.js.map +1 -0
- package/build-backend/lib/typescriptSettings.js +39 -0
- package/build-backend/lib/typescriptSettings.js.map +1 -0
- package/build-backend/lib/typescriptTools.js +435 -0
- package/build-backend/lib/typescriptTools.js.map +1 -0
- package/build-backend/lib/utils.js +66 -0
- package/build-backend/lib/utils.js.map +1 -0
- package/{lib → build-backend/lib}/words.js +23 -30
- package/build-backend/lib/words.js.map +1 -0
- package/build-backend/main.js +2671 -0
- package/build-backend/main.js.map +1 -0
- package/build-backend/types.d.ts +742 -0
- package/docs/de/README.md +1 -1
- package/docs/en/README.md +1 -1
- package/docs/en/javascript.md +10 -6
- package/docs/ru/README.md +1 -1
- package/install/installTypings.js +34 -47
- package/io-package.json +14 -14
- package/package.json +14 -14
- package/admin/assets/index-DCkkMRRa.js +0 -1335
- package/admin/assets/index-DJfSBoBB.js +0 -192
- package/admin/assets/index-DTiA4WdK.js +0 -930
- package/admin/assets/index-qABB1JVe.js +0 -5
- package/admin/assets/inheritsLoose-BW-3V39H.js +0 -36
- package/admin/custom/assets/Tabs-C1KOyWRi.js +0 -137
- package/admin/custom/assets/ThemeProvider-Buvx5nSd.js +0 -29
- package/admin/custom/assets/index-BGCRznKh.js +0 -904
- package/admin/custom/assets/index-DfBPYXqA.js +0 -55
- package/admin/custom/assets/index-jIr6kOLK.js +0 -1398
- package/lib/adapter-config.d.ts +0 -16
- package/lib/consts.js +0 -83
- package/lib/convert.js +0 -106
- package/lib/debug.js +0 -154
- package/lib/eventObj.js +0 -201
- package/lib/inspect.js +0 -688
- package/lib/javascript.d.ts +0 -1858
- package/lib/nodeModulesManagement.js +0 -26
- package/lib/patternCompareFunctions.js +0 -391
- package/lib/protectFs.js +0 -401
- package/lib/request.js +0 -72
- package/lib/scheduler.js +0 -447
- package/lib/tools.js +0 -192
- package/lib/typescriptSettings.js +0 -44
- package/lib/typescriptTools.js +0 -529
- package/lib/utils.js +0 -87
- package/main.js +0 -2653
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
import type { ExecOptions, ChildProcess } from 'node:child_process';
|
|
2
|
+
import type { Script } from 'node:vm';
|
|
3
|
+
import type { AxiosHeaderValue, ResponseType } from 'axios';
|
|
4
|
+
import type { Job } from 'node-schedule';
|
|
5
|
+
|
|
6
|
+
import type { Scheduler, SchedulerRule } from './lib/scheduler';
|
|
7
|
+
import type { EventObj } from './lib/eventObj';
|
|
8
|
+
import type { PatternEventCompareFunction } from './lib/patternCompareFunctions';
|
|
9
|
+
import type { AstroEvent } from './lib/consts';
|
|
10
|
+
|
|
11
|
+
export interface JavaScriptAdapterConfig {
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
enableSetObject: boolean;
|
|
15
|
+
enableSendToHost: boolean;
|
|
16
|
+
enableExec: boolean;
|
|
17
|
+
libraries: string;
|
|
18
|
+
libraryTypings: string;
|
|
19
|
+
subscribe: boolean;
|
|
20
|
+
useSystemGPS: true;
|
|
21
|
+
mirrorPath: string;
|
|
22
|
+
mirrorInstance: number;
|
|
23
|
+
allowSelfSignedCerts: boolean;
|
|
24
|
+
sunriseEvent: AstroEvent;
|
|
25
|
+
sunriseOffset: number;
|
|
26
|
+
sunriseLimitStart: string;
|
|
27
|
+
sunriseLimitEnd: string;
|
|
28
|
+
sunsetEvent: AstroEvent;
|
|
29
|
+
sunsetOffset: number;
|
|
30
|
+
sunsetLimitStart: string;
|
|
31
|
+
sunsetLimitEnd: string;
|
|
32
|
+
createAstroStates: boolean;
|
|
33
|
+
maxSetStatePerMinute: number;
|
|
34
|
+
maxTriggersPerScript: number;
|
|
35
|
+
gptKey: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type CommonAlias = {
|
|
39
|
+
/** The target state id */
|
|
40
|
+
id:
|
|
41
|
+
| string
|
|
42
|
+
| {
|
|
43
|
+
read: string;
|
|
44
|
+
write: string;
|
|
45
|
+
};
|
|
46
|
+
/** An optional conversion function when reading, e.g. `"(val − 32) * 5/9"` */
|
|
47
|
+
read?: string;
|
|
48
|
+
/** An optional conversion function when reading, e.g. `"(val * 9/5) + 32"` */
|
|
49
|
+
write?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type JavascriptTimer = {
|
|
53
|
+
t: NodeJS.Timeout;
|
|
54
|
+
id: number;
|
|
55
|
+
ts: number;
|
|
56
|
+
delay: number;
|
|
57
|
+
val: ioBroker.StateValue;
|
|
58
|
+
ack?: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type ScriptType = 'TypeScript/ts' | 'Blockly' | 'Rules' | 'JavaScript/js';
|
|
62
|
+
|
|
63
|
+
export type TimeRule = {
|
|
64
|
+
time: string | { hour: number; minute: number };
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type SubscribeObject = {
|
|
68
|
+
name: string;
|
|
69
|
+
pattern: string;
|
|
70
|
+
callback: (id: string, obj?: ioBroker.Object | null) => void;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type IobSchedule = Job & { _ioBroker: { type: 'cron'; pattern: string | Date; scriptName: string; id: string } };
|
|
74
|
+
|
|
75
|
+
export type PushoverOptions = {
|
|
76
|
+
message: string; // mandatory - your text message
|
|
77
|
+
title?: string; // optional - your message's title, otherwise your app's name is used
|
|
78
|
+
sound?:
|
|
79
|
+
| 'magic'
|
|
80
|
+
| 'pushover'
|
|
81
|
+
| 'bike'
|
|
82
|
+
| 'bugle'
|
|
83
|
+
| 'cashregister'
|
|
84
|
+
| 'classical'
|
|
85
|
+
| 'cosmic'
|
|
86
|
+
| 'falling'
|
|
87
|
+
| 'gamelan'
|
|
88
|
+
| 'incoming'
|
|
89
|
+
| 'intermission'
|
|
90
|
+
| 'mechanical'
|
|
91
|
+
| 'pianobar'
|
|
92
|
+
| 'siren'
|
|
93
|
+
| 'spacealarm'
|
|
94
|
+
| 'tugboat'
|
|
95
|
+
| 'alien'
|
|
96
|
+
| 'climb'
|
|
97
|
+
| 'persistent'
|
|
98
|
+
| 'echo'
|
|
99
|
+
| 'updown'
|
|
100
|
+
| 'none'; // optional - the name of one of the sounds supported by device clients to override the user's default sound choice
|
|
101
|
+
// pushover, bike, bugle, cashregister, classical, cosmic, falling,
|
|
102
|
+
// gamelan, incoming, intermission, magic, mechanical, pianobar, siren,
|
|
103
|
+
// spacealarm, tugboat, alien, climb, persistent, echo, updown, none
|
|
104
|
+
priority?: -1 | 0 | 1 | 2; // optional
|
|
105
|
+
// -1: always send it as a quiet notification,
|
|
106
|
+
// 1: to display as high-priority and bypass the user's quiet hours, or
|
|
107
|
+
// 2: to also require confirmation from the user
|
|
108
|
+
token?: string; // optional
|
|
109
|
+
// add other than configured token to the call
|
|
110
|
+
url?: string; // optional - a supplementary URL to show with your message
|
|
111
|
+
url_title?: string; // optional - a title for your supplementary URL, otherwise just the URL is shown
|
|
112
|
+
device?: string; // optional - your user's device name to send the message directly to that device, rather than all of the user's devices
|
|
113
|
+
timestamp?: number; // optional - a Unix timestamp of your message's date and time to display to the user, rather than the time your message is received by our API
|
|
114
|
+
html?: string; // optional - 1 to enable parsing of HTML formatting for bold, italic, underlined and font color
|
|
115
|
+
monospace?: 1; // optional - 1 to display the message in monospace font
|
|
116
|
+
// either HTML or monospace is allowed
|
|
117
|
+
file?: string | { name: string; data: Buffer }; // optional - attachment
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export interface JsScript {
|
|
121
|
+
script: Script;
|
|
122
|
+
onStopTimeout: number;
|
|
123
|
+
onStopCb: (cb: () => void) => void;
|
|
124
|
+
intervals: NodeJS.Timeout[];
|
|
125
|
+
timeouts: NodeJS.Timeout[];
|
|
126
|
+
schedules: IobSchedule[];
|
|
127
|
+
wizards: string[];
|
|
128
|
+
name: string;
|
|
129
|
+
engineType: ScriptType;
|
|
130
|
+
_id: number;
|
|
131
|
+
subscribes: { [pattern: string]: number };
|
|
132
|
+
subscribesFile: { [key: string]: number };
|
|
133
|
+
setStatePerMinuteCounter: number;
|
|
134
|
+
setStatePerMinuteProblemCounter: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type LogMessage = any;
|
|
138
|
+
|
|
139
|
+
export type AstroRule = {
|
|
140
|
+
astro: AstroEvent;
|
|
141
|
+
shift: number;
|
|
142
|
+
limitStart: string;
|
|
143
|
+
limitEnd: string;
|
|
144
|
+
event: string;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type SandboxType = {
|
|
148
|
+
mods: Record<string, any>;
|
|
149
|
+
_id: number;
|
|
150
|
+
name: string; // deprecated
|
|
151
|
+
scriptName: string;
|
|
152
|
+
instance: number;
|
|
153
|
+
defaultDataDir: string;
|
|
154
|
+
verbose: boolean | undefined;
|
|
155
|
+
exports: Record<string, any>;
|
|
156
|
+
require: (md: string) => any;
|
|
157
|
+
Buffer: typeof Buffer;
|
|
158
|
+
__engine: {
|
|
159
|
+
__deprecatedWarnings: string[];
|
|
160
|
+
__subscriptionsObject: number;
|
|
161
|
+
__subscriptions: number;
|
|
162
|
+
__subscriptionsMessage: number;
|
|
163
|
+
__subscriptionsFile: number;
|
|
164
|
+
__subscriptionsLog: number;
|
|
165
|
+
__schedules: number;
|
|
166
|
+
};
|
|
167
|
+
$: (selector: string) => any;
|
|
168
|
+
log: (msg: string, severity?: ioBroker.LogLevel) => void;
|
|
169
|
+
onLog: (severity: ioBroker.LogLevel, callback: (info: any) => void) => number;
|
|
170
|
+
onLogUnregister: (idOrCallbackOrSeverity: number | ((msg: string) => void)) => void;
|
|
171
|
+
exec: (
|
|
172
|
+
cmd: string,
|
|
173
|
+
options: ExecOptions | ((error: Error | null | string, stdout?: string, stderr?: string) => void),
|
|
174
|
+
callback?: (error: Error | null | string, stdout?: string, stderr?: string) => void,
|
|
175
|
+
) => void;
|
|
176
|
+
email: (msg: string) => void;
|
|
177
|
+
pushover: (msg: string) => void;
|
|
178
|
+
httpGet: (
|
|
179
|
+
url: string,
|
|
180
|
+
options:
|
|
181
|
+
| {
|
|
182
|
+
timeout?: number;
|
|
183
|
+
responseType?: ResponseType;
|
|
184
|
+
headers?: Record<string, string>;
|
|
185
|
+
basicAuth?: { user: string; password: string } | null;
|
|
186
|
+
bearerAuth?: string;
|
|
187
|
+
validateCertificate?: boolean;
|
|
188
|
+
}
|
|
189
|
+
| ((
|
|
190
|
+
error: Error | null,
|
|
191
|
+
result: {
|
|
192
|
+
statusCode: number | null;
|
|
193
|
+
data: any;
|
|
194
|
+
headers: Record<string, string>;
|
|
195
|
+
responseTime: number;
|
|
196
|
+
},
|
|
197
|
+
) => void),
|
|
198
|
+
callback?: (
|
|
199
|
+
error: Error | null,
|
|
200
|
+
result: {
|
|
201
|
+
statusCode: number | null;
|
|
202
|
+
data: any;
|
|
203
|
+
headers: Record<string, string>;
|
|
204
|
+
responseTime: number;
|
|
205
|
+
},
|
|
206
|
+
) => void,
|
|
207
|
+
) => void;
|
|
208
|
+
httpGetAsync: (
|
|
209
|
+
url: string,
|
|
210
|
+
options?: {
|
|
211
|
+
timeout?: number;
|
|
212
|
+
responseType?: ResponseType;
|
|
213
|
+
headers?: Record<string, string>;
|
|
214
|
+
basicAuth?: { user: string; password: string } | null;
|
|
215
|
+
bearerAuth?: string;
|
|
216
|
+
validateCertificate?: boolean;
|
|
217
|
+
},
|
|
218
|
+
) => Promise<{
|
|
219
|
+
statusCode: number | null;
|
|
220
|
+
data: any;
|
|
221
|
+
headers: Record<string, string>;
|
|
222
|
+
responseTime: number;
|
|
223
|
+
}>;
|
|
224
|
+
httpPost: (
|
|
225
|
+
url: string,
|
|
226
|
+
data: any,
|
|
227
|
+
options:
|
|
228
|
+
| {
|
|
229
|
+
timeout?: number;
|
|
230
|
+
responseType?: ResponseType;
|
|
231
|
+
headers?: Record<string, string>;
|
|
232
|
+
basicAuth?: { user: string; password: string } | null;
|
|
233
|
+
bearerAuth?: string;
|
|
234
|
+
validateCertificate?: boolean;
|
|
235
|
+
}
|
|
236
|
+
| ((
|
|
237
|
+
error: Error | null,
|
|
238
|
+
result: {
|
|
239
|
+
statusCode: number | null;
|
|
240
|
+
data: any;
|
|
241
|
+
headers: Record<string, AxiosHeaderValue | undefined>;
|
|
242
|
+
responseTime: number;
|
|
243
|
+
},
|
|
244
|
+
) => void),
|
|
245
|
+
callback?: (
|
|
246
|
+
error: Error | null,
|
|
247
|
+
result: {
|
|
248
|
+
statusCode: number | null;
|
|
249
|
+
data: any;
|
|
250
|
+
headers: Record<string, AxiosHeaderValue | undefined>;
|
|
251
|
+
responseTime: number;
|
|
252
|
+
},
|
|
253
|
+
) => void,
|
|
254
|
+
) => void;
|
|
255
|
+
httpPostAsync: (
|
|
256
|
+
url: string,
|
|
257
|
+
data: any,
|
|
258
|
+
options: {
|
|
259
|
+
timeout?: number;
|
|
260
|
+
responseType?: ResponseType;
|
|
261
|
+
headers?: Record<string, string>;
|
|
262
|
+
basicAuth?: { user: string; password: string } | null;
|
|
263
|
+
bearerAuth?: string;
|
|
264
|
+
validateCertificate?: boolean;
|
|
265
|
+
},
|
|
266
|
+
) => Promise<{
|
|
267
|
+
statusCode: number | null;
|
|
268
|
+
data: any;
|
|
269
|
+
headers: Record<string, AxiosHeaderValue | undefined>;
|
|
270
|
+
responseTime: number;
|
|
271
|
+
}>;
|
|
272
|
+
createTempFile: (fileName: string, data: Buffer | string) => string | undefined;
|
|
273
|
+
subscribe: (
|
|
274
|
+
pattern:
|
|
275
|
+
| TimeRule
|
|
276
|
+
| AstroRule
|
|
277
|
+
| Pattern
|
|
278
|
+
| SchedulerRule
|
|
279
|
+
| string
|
|
280
|
+
| (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
282
|
+
callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),
|
|
283
|
+
value?: any,
|
|
284
|
+
) =>
|
|
285
|
+
| SubscriptionResult
|
|
286
|
+
| IobSchedule
|
|
287
|
+
| string
|
|
288
|
+
| null
|
|
289
|
+
| undefined
|
|
290
|
+
| (SubscriptionResult | IobSchedule | string | null | undefined)[];
|
|
291
|
+
getSubscriptions: () => Record<string, { name: string; pattern: Pattern }[]>;
|
|
292
|
+
getFileSubscriptions: () => Record<string, { name: string; id: string; fileNamePattern: string }[]>;
|
|
293
|
+
adapterSubscribe: (id: string) => void;
|
|
294
|
+
adapterUnsubscribe: (
|
|
295
|
+
idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[],
|
|
296
|
+
) => boolean | boolean[];
|
|
297
|
+
unsubscribe: (idOrObject: string | SubscriptionResult | (string | SubscriptionResult)[]) => boolean | boolean[];
|
|
298
|
+
on: (
|
|
299
|
+
pattern:
|
|
300
|
+
| TimeRule
|
|
301
|
+
| AstroRule
|
|
302
|
+
| Pattern
|
|
303
|
+
| SchedulerRule
|
|
304
|
+
| string
|
|
305
|
+
| (TimeRule | AstroRule | Pattern | SchedulerRule | string)[],
|
|
306
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
307
|
+
callbackOrChangeTypeOrId: string | ChangeType | ((event?: EventObj) => void),
|
|
308
|
+
value?: any,
|
|
309
|
+
) =>
|
|
310
|
+
| SubscriptionResult
|
|
311
|
+
| IobSchedule
|
|
312
|
+
| string
|
|
313
|
+
| null
|
|
314
|
+
| undefined
|
|
315
|
+
| (SubscriptionResult | IobSchedule | string | null | undefined)[];
|
|
316
|
+
onEnumMembers: (enumId: string, callback: (event?: EventObj) => void) => void;
|
|
317
|
+
onFile: (
|
|
318
|
+
id: string,
|
|
319
|
+
fileNamePattern: string | string[],
|
|
320
|
+
withFileOrCallback:
|
|
321
|
+
| boolean
|
|
322
|
+
| ((id: string, fileName: string, size: number | null, file?: string | Buffer, mimeType?: string) => void),
|
|
323
|
+
callback?: (
|
|
324
|
+
id: string,
|
|
325
|
+
fileName: string,
|
|
326
|
+
size: number | null,
|
|
327
|
+
file?: string | Buffer,
|
|
328
|
+
mimeType?: string,
|
|
329
|
+
) => void,
|
|
330
|
+
) => undefined | FileSubscriptionResult | (undefined | FileSubscriptionResult)[];
|
|
331
|
+
offFile: (
|
|
332
|
+
idOrObject: FileSubscriptionResult | string | (FileSubscriptionResult | string)[],
|
|
333
|
+
fileNamePattern?: string | string[],
|
|
334
|
+
) => boolean | boolean[];
|
|
335
|
+
once: (pattern: string, callback: (data: any) => void) => void;
|
|
336
|
+
schedule: (
|
|
337
|
+
pattern: SchedulerRule | AstroRule | Date | string,
|
|
338
|
+
callback: () => void,
|
|
339
|
+
) => IobSchedule | string | null | undefined;
|
|
340
|
+
scheduleById: (id: string, ack: boolean | (() => void) | undefined, callback?: () => void) => void;
|
|
341
|
+
getAstroDate: (pattern: AstroEvent, date?: Date | number, offsetMinutes?: number) => Date | undefined;
|
|
342
|
+
isAstroDay: () => boolean | undefined;
|
|
343
|
+
clearSchedule: (schedule: any) => void;
|
|
344
|
+
getSchedules: (allScripts: boolean) => any[];
|
|
345
|
+
setState: (
|
|
346
|
+
id: string,
|
|
347
|
+
state: ioBroker.SettableState | ioBroker.StateValue,
|
|
348
|
+
isAck?: boolean | 'true' | 'false' | ((err?: Error | null) => void),
|
|
349
|
+
callback?: (err?: Error | null) => void,
|
|
350
|
+
) => void;
|
|
351
|
+
setStateChanged: (
|
|
352
|
+
id: string,
|
|
353
|
+
state: ioBroker.SettableState | ioBroker.StateValue,
|
|
354
|
+
isAck?: boolean | ((err?: Error | null) => void),
|
|
355
|
+
callback?: (err?: Error | null) => void,
|
|
356
|
+
) => void;
|
|
357
|
+
setStateDelayed: (
|
|
358
|
+
id: string,
|
|
359
|
+
state: ioBroker.SettableState | ioBroker.StateValue,
|
|
360
|
+
isAck: boolean | number | undefined,
|
|
361
|
+
delay?: number | boolean,
|
|
362
|
+
clearRunning?: boolean | ((err?: Error | null) => void),
|
|
363
|
+
callback?: (err?: Error | null) => void,
|
|
364
|
+
) => number | null;
|
|
365
|
+
clearStateDelayed: (id: string, timerId: number) => boolean;
|
|
366
|
+
getStateDelayed: (
|
|
367
|
+
id: string,
|
|
368
|
+
) =>
|
|
369
|
+
| null
|
|
370
|
+
| { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }
|
|
371
|
+
| { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]
|
|
372
|
+
| Record<string, { timerId: number; left: number; delay: number; val: ioBroker.StateValue; ack?: boolean }[]>;
|
|
373
|
+
getStateAsync: (id: string) => Promise<ioBroker.State | null | undefined>;
|
|
374
|
+
setStateAsync: (id: string, state: ioBroker.SettableState | ioBroker.StateValue, isAck?: boolean) => Promise<void>;
|
|
375
|
+
setStateChangedAsync: (
|
|
376
|
+
id: string,
|
|
377
|
+
state: ioBroker.SettableState | ioBroker.StateValue,
|
|
378
|
+
isAck?: boolean,
|
|
379
|
+
) => Promise<void>;
|
|
380
|
+
getState: (
|
|
381
|
+
id: string,
|
|
382
|
+
callback?: (err: Error | null | undefined, state?: ioBroker.State | null) => void,
|
|
383
|
+
) => undefined | void | (ioBroker.State & { notExist?: true }) | null;
|
|
384
|
+
existsState: (
|
|
385
|
+
id: string,
|
|
386
|
+
callback?: (err: Error | null | undefined, stateExists?: boolean) => void,
|
|
387
|
+
) => void | boolean;
|
|
388
|
+
existsStateAsync: (id: string) => Promise<boolean>;
|
|
389
|
+
existsObject: (
|
|
390
|
+
id: string,
|
|
391
|
+
callback?: (err: Error | null | undefined, objectExists?: boolean) => void,
|
|
392
|
+
) => void | boolean;
|
|
393
|
+
existsObjectAsync: (id: string) => Promise<boolean>;
|
|
394
|
+
getIdByName: (name: string, alwaysArray?: boolean) => string | string[] | null;
|
|
395
|
+
getObject: (
|
|
396
|
+
id: string,
|
|
397
|
+
enumName: null | string | ((err: Error | null | undefined, obj?: ioBroker.Object | null) => void),
|
|
398
|
+
cb: (err: Error | null | undefined, obj?: ioBroker.Object | null) => void,
|
|
399
|
+
) => void;
|
|
400
|
+
getObjectAsync: (id: string, enumName: null | string) => Promise<ioBroker.Object | null | undefined>;
|
|
401
|
+
setObject: (
|
|
402
|
+
id: string,
|
|
403
|
+
obj: ioBroker.Object,
|
|
404
|
+
callback?: (err?: Error | null | string, res?: { id: string }) => void,
|
|
405
|
+
) => void;
|
|
406
|
+
setObjectAsync: (id: string, obj: ioBroker.Object) => Promise<{ id: string }>;
|
|
407
|
+
extendObject: (
|
|
408
|
+
id: string,
|
|
409
|
+
obj: Partial<ioBroker.Object>,
|
|
410
|
+
callback?: (err?: Error | null | string, res?: { id: string }) => void,
|
|
411
|
+
) => void;
|
|
412
|
+
extendObjectAsync: (id: string, obj: Partial<ioBroker.Object>) => Promise<{ id: string }>;
|
|
413
|
+
deleteObject: (id: string, isRecursive?: boolean, callback?: ioBroker.ErrorCallback) => void;
|
|
414
|
+
deleteObjectAsync: (id: string, isRecursive?: boolean) => Promise<void>;
|
|
415
|
+
getEnums: (enumName: string) => { id: string; members: string[]; name: ioBroker.StringOrTranslated }[];
|
|
416
|
+
createAlias: (
|
|
417
|
+
name: string,
|
|
418
|
+
alias: string | CommonAlias,
|
|
419
|
+
forceCreation: boolean | Partial<ioBroker.StateCommon> | ((err: Error | null) => void) | undefined,
|
|
420
|
+
common?: Partial<ioBroker.StateCommon> | Record<string, any> | ((err: Error | null) => void),
|
|
421
|
+
native?: Record<string, any> | ((err: Error | null) => void),
|
|
422
|
+
callback?: (err: Error | null) => void,
|
|
423
|
+
) => void;
|
|
424
|
+
createAliasAsync: (
|
|
425
|
+
name: string,
|
|
426
|
+
alias: string | CommonAlias,
|
|
427
|
+
forceCreation: boolean | Partial<ioBroker.StateCommon> | undefined,
|
|
428
|
+
common?: Partial<ioBroker.StateCommon> | Record<string, any>,
|
|
429
|
+
native?: Record<string, any>,
|
|
430
|
+
) => Promise<void>;
|
|
431
|
+
createState: (
|
|
432
|
+
name: string,
|
|
433
|
+
initValue: undefined | ioBroker.StateValue | ioBroker.State,
|
|
434
|
+
forceCreation:
|
|
435
|
+
| boolean
|
|
436
|
+
| undefined
|
|
437
|
+
| Record<string, any>
|
|
438
|
+
| Partial<ioBroker.StateCommon>
|
|
439
|
+
| ((err: Error | null) => void),
|
|
440
|
+
common?: Partial<ioBroker.StateCommon> | ((err: Error | null) => void),
|
|
441
|
+
native?: Record<string, any> | ((err: Error | null) => void),
|
|
442
|
+
callback?: (error: Error | null | undefined, id?: string) => void,
|
|
443
|
+
) => void;
|
|
444
|
+
createStateAsync: (
|
|
445
|
+
name: string,
|
|
446
|
+
initValue: undefined | ioBroker.StateValue | ioBroker.State,
|
|
447
|
+
forceCreation:
|
|
448
|
+
| boolean
|
|
449
|
+
| undefined
|
|
450
|
+
| Record<string, any>
|
|
451
|
+
| Partial<ioBroker.StateCommon>
|
|
452
|
+
| ((err: Error | null) => void),
|
|
453
|
+
common?: Partial<ioBroker.StateCommon> | ((err: Error | null) => void),
|
|
454
|
+
native?: Record<string, any> | ((err: Error | null) => void),
|
|
455
|
+
) => Promise<string>;
|
|
456
|
+
deleteState: (id: string, callback: (err: Error | null | undefined, found?: boolean) => void) => void;
|
|
457
|
+
deleteStateAsync: (id: string) => Promise<boolean>;
|
|
458
|
+
sendTo: (
|
|
459
|
+
adapter: string,
|
|
460
|
+
cmd: string,
|
|
461
|
+
msg?: any,
|
|
462
|
+
options?: Record<string, any> | ((result: any, options: Record<string, any>, _adapter: string) => void),
|
|
463
|
+
callback?: (result: any, options: Record<string, any>, _adapter: string) => void,
|
|
464
|
+
) => void;
|
|
465
|
+
sendto: (
|
|
466
|
+
adapter: string,
|
|
467
|
+
cmd: string,
|
|
468
|
+
msg?: any,
|
|
469
|
+
callback?: (result: any, options: Record<string, any>, _adapter: string) => void,
|
|
470
|
+
) => void;
|
|
471
|
+
sendToAsync: (adapter: string, cmd: string, msg: any, options: any) => Promise<any>;
|
|
472
|
+
sendToHost: (host: string, cmd: string, msg?: any, callback?: (result: any) => void) => void;
|
|
473
|
+
sendToHostAsync: (host: string, cmd: string, msg?: any) => Promise<any>;
|
|
474
|
+
registerNotification: (msg: string, isAlert: boolean) => void;
|
|
475
|
+
setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timeout | null;
|
|
476
|
+
clearInterval: (id: NodeJS.Timeout) => void;
|
|
477
|
+
setTimeout: (callback: (args?: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timeout | null;
|
|
478
|
+
clearTimeout: (id: NodeJS.Timeout) => void;
|
|
479
|
+
setImmediate: (callback: (args: any[]) => void, ...args: any[]) => void;
|
|
480
|
+
cb: (callback: () => void) => void;
|
|
481
|
+
compareTime: (
|
|
482
|
+
startTime: iobJS.AstroDate | string | Date | number,
|
|
483
|
+
endTime: iobJS.AstroDate | string | Date | number | null,
|
|
484
|
+
operation: 'between' | 'not between' | '<' | '<=' | '>' | '>=' | '==' | '<>' | '!=',
|
|
485
|
+
time?: iobJS.AstroDate | string | Date | number,
|
|
486
|
+
) => boolean;
|
|
487
|
+
onStop: (cb: () => void, timeout?: number) => void;
|
|
488
|
+
formatValue: (value: number | string, decimals: number | string, format?: string) => string;
|
|
489
|
+
formatDate: (
|
|
490
|
+
date: Date | string | number | iobJS.AstroDate,
|
|
491
|
+
format?: string,
|
|
492
|
+
language?: ioBroker.Languages,
|
|
493
|
+
) => string;
|
|
494
|
+
formatTimeDiff: (diff: number, format?: string) => string;
|
|
495
|
+
getDateObject: (date: any) => Date;
|
|
496
|
+
writeFile: (
|
|
497
|
+
adapter: string,
|
|
498
|
+
fileName: string,
|
|
499
|
+
data: string | Buffer | ((err?: Error | null) => void),
|
|
500
|
+
callback?: (err?: Error | null) => void,
|
|
501
|
+
) => void;
|
|
502
|
+
writeFileAsync: (adapter: string, fileName: string | Buffer, data?: string | Buffer) => Promise<void>;
|
|
503
|
+
readFile: (
|
|
504
|
+
adapter: string,
|
|
505
|
+
fileName: string | ((err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void),
|
|
506
|
+
callback?: (err: Error | null | undefined, data?: Buffer | string, mimeType?: string) => void,
|
|
507
|
+
) => void;
|
|
508
|
+
readFileAsync: (adapter: string, fileName?: string) => Promise<Buffer | string>;
|
|
509
|
+
unlink: (adapter: string, fileName: string, callback?: (err?: Error | null) => void) => void;
|
|
510
|
+
unlinkAsync: (adapter: string, fileName?: string) => Promise<void>;
|
|
511
|
+
delFile: (adapter: string, fileName: string, callback?: (err?: Error | null) => void) => void;
|
|
512
|
+
delFileAsync: (adapter: string, fileName?: string) => Promise<void>;
|
|
513
|
+
rename: (adapter: string, oldName: string, newName: string, callback?: (err?: Error | null) => void) => void;
|
|
514
|
+
renameAsync: (adapter: string, oldName: string, newName?: string) => Promise<void>;
|
|
515
|
+
renameFile: (adapter: string, oldName: string, newName: string, callback?: (err?: Error | null) => void) => void;
|
|
516
|
+
renameFileAsync: (adapter: string, oldName: string, newName?: string) => Promise<void>;
|
|
517
|
+
getHistory: (
|
|
518
|
+
instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),
|
|
519
|
+
options:
|
|
520
|
+
| (ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string })
|
|
521
|
+
| ((
|
|
522
|
+
error: Error | null,
|
|
523
|
+
result?: ioBroker.GetHistoryResult | null,
|
|
524
|
+
options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },
|
|
525
|
+
instance?: string,
|
|
526
|
+
) => void),
|
|
527
|
+
callback?: (
|
|
528
|
+
error: Error | null,
|
|
529
|
+
result?: ioBroker.GetHistoryResult | null,
|
|
530
|
+
options?: ioBroker.GetHistoryOptions & { id: string; timeout?: number | string },
|
|
531
|
+
instance?: string,
|
|
532
|
+
) => void,
|
|
533
|
+
) => void;
|
|
534
|
+
getHistoryAsync: (
|
|
535
|
+
instance: string | (ioBroker.GetHistoryOptions & { id: string; timeout?: number | string }),
|
|
536
|
+
options?: ioBroker.GetHistoryOptions & { id?: string; timeout?: number | string },
|
|
537
|
+
) => Promise<ioBroker.GetHistoryResult>;
|
|
538
|
+
runScript: (scriptName: string, callback?: (err?: Error | null) => void) => boolean;
|
|
539
|
+
runScriptAsync: (scriptName: string) => Promise<void>;
|
|
540
|
+
startScript: (
|
|
541
|
+
scriptName: string,
|
|
542
|
+
ignoreIfStarted: boolean | ((err: Error | null | undefined, started: boolean) => void),
|
|
543
|
+
callback?: (err: Error | null | undefined, started: boolean) => void,
|
|
544
|
+
) => boolean;
|
|
545
|
+
startScriptAsync: (scriptName: string, ignoreIfStarted?: boolean) => Promise<boolean>;
|
|
546
|
+
stopScript: (scriptName: string, callback: (err: Error | null | undefined, stopped: boolean) => void) => boolean;
|
|
547
|
+
stopScriptAsync: (scriptName: string) => Promise<boolean>;
|
|
548
|
+
isScriptActive: (scriptName: string) => boolean;
|
|
549
|
+
startInstanceAsync: (instanceName: string) => Promise<boolean>;
|
|
550
|
+
restartInstanceAsync: (instanceName: string) => Promise<boolean>;
|
|
551
|
+
stopInstanceAsync: (instanceName: string) => Promise<boolean>;
|
|
552
|
+
toInt: (val: any) => number;
|
|
553
|
+
toFloat: (val: any) => number;
|
|
554
|
+
toBoolean: (val: any) => boolean;
|
|
555
|
+
getAttr: (obj: any, path: string | string[]) => any;
|
|
556
|
+
messageTo: (
|
|
557
|
+
target: string | { instance: string | null | number; script: string | null; message: string },
|
|
558
|
+
data: any,
|
|
559
|
+
options: any,
|
|
560
|
+
callback: (result: any, options: { timeout?: number | string }, instance: string | number | null) => void,
|
|
561
|
+
) => void;
|
|
562
|
+
messageToAsync: (
|
|
563
|
+
target: string | { instance: string | null | number; script: string | null; message: string },
|
|
564
|
+
data: any,
|
|
565
|
+
options?: { timeout?: number | string },
|
|
566
|
+
) => Promise<any>;
|
|
567
|
+
onMessage: (messageName: string, callback: (data: any, cb: (result: any) => void) => void) => null | number;
|
|
568
|
+
onMessageUnregister: (idOrName: string) => boolean;
|
|
569
|
+
console: {
|
|
570
|
+
log: (msg: string) => void;
|
|
571
|
+
error: (msg: string) => void;
|
|
572
|
+
warn: (msg: string) => void;
|
|
573
|
+
info: (msg: string) => void;
|
|
574
|
+
debug: (msg: string) => void;
|
|
575
|
+
};
|
|
576
|
+
jsonataExpression: (data: any, expression: string) => any;
|
|
577
|
+
wait: (ms: number) => Promise<void>;
|
|
578
|
+
sleep: (ms: number) => Promise<void>;
|
|
579
|
+
onObject: (
|
|
580
|
+
pattern: string | string[],
|
|
581
|
+
callback: (id: string, obj?: ioBroker.Object | null) => void,
|
|
582
|
+
) => SubscribeObject | SubscribeObject[] | null;
|
|
583
|
+
subscribeObject: (
|
|
584
|
+
pattern: string | string[],
|
|
585
|
+
callback: (id: string, obj?: ioBroker.Object | null) => void,
|
|
586
|
+
) => SubscribeObject | SubscribeObject[] | null;
|
|
587
|
+
unsubscribeObject: (idOrObject: SubscribeObject | SubscribeObject[]) => boolean | boolean[];
|
|
588
|
+
_sendToFrontEnd: (blockId: string, data: any) => void;
|
|
589
|
+
logHandler?: ioBroker.LogLevel | '*';
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
export type ChangeType = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'any' | '*';
|
|
593
|
+
|
|
594
|
+
export type Pattern = {
|
|
595
|
+
logic?: 'and' | 'or';
|
|
596
|
+
id?: RegExp | string | string[];
|
|
597
|
+
name?: RegExp | string | string[];
|
|
598
|
+
ack?: boolean | string;
|
|
599
|
+
oldAck?: boolean | string;
|
|
600
|
+
change?: ChangeType;
|
|
601
|
+
|
|
602
|
+
q?: '*' | number;
|
|
603
|
+
oldQ?: '*' | number;
|
|
604
|
+
|
|
605
|
+
val?: ioBroker.StateValue;
|
|
606
|
+
valGt?: string | number | boolean;
|
|
607
|
+
valGe?: string | number | boolean;
|
|
608
|
+
valLt?: string | number | boolean;
|
|
609
|
+
valLe?: string | number | boolean;
|
|
610
|
+
valNe?: string | number | boolean;
|
|
611
|
+
|
|
612
|
+
oldVal?: ioBroker.StateValue;
|
|
613
|
+
oldValGt?: string | number | boolean;
|
|
614
|
+
oldValGe?: string | number | boolean;
|
|
615
|
+
oldValLt?: string | number | boolean;
|
|
616
|
+
oldValLe?: string | number | boolean;
|
|
617
|
+
oldValNe?: string | number | boolean;
|
|
618
|
+
|
|
619
|
+
ts?: number;
|
|
620
|
+
tsGt?: number;
|
|
621
|
+
tsGe?: number;
|
|
622
|
+
tsLt?: number;
|
|
623
|
+
tsLe?: number;
|
|
624
|
+
|
|
625
|
+
oldTs?: number;
|
|
626
|
+
oldTsGt?: number;
|
|
627
|
+
oldTsGe?: number;
|
|
628
|
+
oldTsLt?: number;
|
|
629
|
+
oldTsLe?: number;
|
|
630
|
+
|
|
631
|
+
lc?: number;
|
|
632
|
+
lcGt?: number;
|
|
633
|
+
lcGe?: number;
|
|
634
|
+
lcLt?: number;
|
|
635
|
+
lcLe?: number;
|
|
636
|
+
|
|
637
|
+
oldLc?: number;
|
|
638
|
+
oldLcGt?: number;
|
|
639
|
+
oldLcGe?: number;
|
|
640
|
+
oldLcLt?: number;
|
|
641
|
+
oldLcLe?: number;
|
|
642
|
+
|
|
643
|
+
enumId?: RegExp | string | string[];
|
|
644
|
+
enumName?: RegExp | string | string[];
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
export type DebugState = {
|
|
648
|
+
scriptName: string;
|
|
649
|
+
child: null | ChildProcess;
|
|
650
|
+
promiseOnEnd: null | Promise<number>;
|
|
651
|
+
paused: boolean;
|
|
652
|
+
started: number;
|
|
653
|
+
endTimeout?: null | NodeJS.Timeout;
|
|
654
|
+
running: boolean;
|
|
655
|
+
adapterInstance?: string;
|
|
656
|
+
breakOnStart?: boolean;
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
export type Selector = {
|
|
660
|
+
attr: string;
|
|
661
|
+
value: string;
|
|
662
|
+
idRegExp?: RegExp;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
export type SubscriptionResult = {
|
|
666
|
+
name: string;
|
|
667
|
+
pattern: Pattern;
|
|
668
|
+
options?: Record<string, any>;
|
|
669
|
+
patternCompareFunctions?: PatternEventCompareFunction[] & { logic?: 'and' | 'or' };
|
|
670
|
+
callback: (obj: EventObj) => void;
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
export type FileSubscriptionResult = {
|
|
674
|
+
id: string;
|
|
675
|
+
name: string;
|
|
676
|
+
fileNamePattern: string;
|
|
677
|
+
idRegEx: RegExp | undefined;
|
|
678
|
+
fileRegEx: RegExp | undefined;
|
|
679
|
+
withFile: boolean;
|
|
680
|
+
callback: (id: string, fileName: string, size: number | null, withFile: boolean) => void;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
export interface JavascriptContext {
|
|
684
|
+
adapter: ioBroker.Adapter;
|
|
685
|
+
mods: Record<string, any>;
|
|
686
|
+
objects: Record<string, ioBroker.Object>;
|
|
687
|
+
states: Record<string, ioBroker.State>;
|
|
688
|
+
interimStateValues: Record<string, ioBroker.State>;
|
|
689
|
+
stateIds: string[];
|
|
690
|
+
errorLogFunction: {
|
|
691
|
+
info: (text: string, ...args: any[]) => void;
|
|
692
|
+
debug: (text: string, ...args: any[]) => void;
|
|
693
|
+
silly: (text: string, ...args: any[]) => void;
|
|
694
|
+
warn: (text: string, ...args: any[]) => void;
|
|
695
|
+
error: (text: string, ...args: any[]) => void;
|
|
696
|
+
};
|
|
697
|
+
subscriptions: SubscriptionResult[];
|
|
698
|
+
subscriptionsFile: FileSubscriptionResult[];
|
|
699
|
+
subscriptionsObject: SubscribeObject[];
|
|
700
|
+
subscribedPatterns: Record<string, number>;
|
|
701
|
+
subscribedPatternsFile: Record<string, number>;
|
|
702
|
+
adapterSubs: Record<string, string[]>;
|
|
703
|
+
cacheObjectEnums: Record<string, { enumIds: string[]; enumNames: string[] }>;
|
|
704
|
+
isEnums: boolean; // If some subscription wants enum
|
|
705
|
+
channels: Record<string, string[]> | null;
|
|
706
|
+
devices: Record<string, string[]> | null;
|
|
707
|
+
scheduler: Scheduler | null;
|
|
708
|
+
timers: { [scriptName: string]: JavascriptTimer[] };
|
|
709
|
+
enums: string[];
|
|
710
|
+
timerId: number;
|
|
711
|
+
names: { [name: string]: string | string[] }; // name: id
|
|
712
|
+
scripts: Record<string, JsScript>;
|
|
713
|
+
messageBusHandlers: Record<
|
|
714
|
+
string,
|
|
715
|
+
Record<string, { id: number; sandbox: SandboxType; cb: (data: any, result: any) => void }[]>
|
|
716
|
+
>;
|
|
717
|
+
logSubscriptions: Record<
|
|
718
|
+
string,
|
|
719
|
+
{
|
|
720
|
+
sandbox: SandboxType;
|
|
721
|
+
cb: (info: LogMessage) => void;
|
|
722
|
+
id: number;
|
|
723
|
+
severity: ioBroker.LogLevel | '*';
|
|
724
|
+
}[]
|
|
725
|
+
>;
|
|
726
|
+
tempDirectories: { [scriptName: string]: string }; // name: path
|
|
727
|
+
folderCreationVerifiedObjects: Record<string, boolean>;
|
|
728
|
+
updateLogSubscriptions: () => void;
|
|
729
|
+
convertBackStringifiedValues: (
|
|
730
|
+
id: string,
|
|
731
|
+
state: ioBroker.State | null | undefined,
|
|
732
|
+
) => ioBroker.State | null | undefined;
|
|
733
|
+
updateObjectContext: (id: string, obj: ioBroker.Object) => void;
|
|
734
|
+
prepareStateObject: (id: string, state: ioBroker.SettableState | null) => ioBroker.State;
|
|
735
|
+
debugMode: string | undefined;
|
|
736
|
+
rulesOpened: string | null; // opened rules
|
|
737
|
+
language: ioBroker.Languages;
|
|
738
|
+
getAbsoluteDefaultDataDir: () => string;
|
|
739
|
+
logError: (scriptName: string, msg: string, e: Error, offs?: number) => void;
|
|
740
|
+
logWithLineInfo: (message: string) => void;
|
|
741
|
+
schedules?: string[];
|
|
742
|
+
}
|