UNPKG

9.15 kBMarkdownView Raw
1![Logo](admin-config/javascript.png)
2# Javascript Script Engine
3
4![Number of Installations](http://iobroker.live/badges/javascript-installed.svg) ![Number of Installations](http://iobroker.live/badges/javascript-stable.svg) [![NPM version](http://img.shields.io/npm/v/iobroker.javascript.svg)](https://www.npmjs.com/package/iobroker.javascript)
5[![Downloads](https://img.shields.io/npm/dm/iobroker.javascript.svg)](https://www.npmjs.com/package/iobroker.javascript)
6[![Tests](https://travis-ci.org/ioBroker/ioBroker.javascript.svg?branch=master)](https://travis-ci.org/ioBroker/ioBroker.javascript)
7
8[![NPM](https://nodei.co/npm/iobroker.javascript.png?downloads=true)](https://nodei.co/npm/iobroker.javascript/)
9
10Executes Javascript, Typescript and Coffescript Scripts.
11
12**Coffescript is deprecated**
13
14[Function documentation](docs/en/javascript.md)
15
16[Benutzung](docs/de/usage.md)
17
18Here you can find description of [blockly](docs/en/blockly.md).
19
20Hier kann man die Beschreibung von [Blockly](docs/de/blockly.md) finden.
21
22Описание по [blockly](docs/ru/blockly.md) можно найти [здесь](docs/ru/blockly.md).
23
24**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
25
26## How to build (only for developers)
27Just run "npm i" in the root and in the src folders.
28
29And then call "npm run build".
30
31## Todo
32- search in all files
33- new rule editor (future releases)
34- heating profile (future releases)
35- ...
36
37## Changelog
38### 4.6.13 (2020-05-19)
39* (bluefox) Fixed blockly blocks because of deprecated functions
40* (bluefox) Corrected schedule wizard
41
42### 4.6.4 (2020-05-15)
43* (bluefox) Corrected block: request, exec
44
45### 4.6.1 (2020-05-11)
46* (bluefox) Updated blockly to 3.20200402.1
47* (bluefox) Added to blockly the switch/case block.
48* (Mic-M) fix log crash
49* (Apollon77) Add new Sentry key and exclude user script exceptions
50* (Garfonso) Several fixes and optimizations for Mirroring functionality
51* (Apollon77) add support for 0_userdata.0 to createState and deleteState
52
53### 4.5.1 (2020-04-17)
54* (Apollon77) Nodejs 10 is new minimum Version!
55* (Apollon77) Add Sentry for use in js-controller 3.0 and React component
56* (Apollon77) prevent warnings with js-controller 3.0
57* (Garfonso) fix enum object cache handling
58* (bluefox/Apollon77) enhance existsState
59
60### 4.4.3 (2020-03-03)
61* (klein0r) Added JSONata for Object conversion
62
63### 4.4.2 (2020-02-10)
64* (Apollon77) Fix Astro functions and error message
65* (Apollon77) usage with all kinds of admin ports and reverse proxies optimized
66
67### 4.4.0 (2020-02-08)
68* (Apollon77) Add new socket.io client library to prevent errors
69
70### 4.3.8 (2020-02-07)
71* (bluefox) Fixed the authentication error detection
72
73### 4.3.7 (2020-01-26)
74* (bluefox) Made adapter compatible with js-controller >= 2.2.x
75
76### 4.3.5 (2020-01-26)
77* (bluefox) fixed the load of zip files if more than one host
78
79### 4.3.4 (2019-10-28)
80* (bluefox) Values are showed in select ID dialog
81* (bluefox) Allow select with $ the schedule objects
82
83### 4.3.3 (2019-10-28)
84* (bluefox) Search in scripts was corrected
85
86### 4.3.2 (2019-10-27)
87* (AlCalzone) Fix syntax help for Node.js runtime methods (#418)
88* (AlCalzone) Target ES 2017 in TypeScript (#419)
89* (AlCalzone) Automatically load declarations for 3rd party modules (#422)
90* (bluefox) Functions with non latin text are working now
91
92### 4.3.1 (2019-10-16)
93* (bluefox) Fixed login with non-admin user
94* (bluefox) fixed log
95* (bluefox) Some GUI fixes
96
97### 4.3.0 (2019-10-09)
98* (bluefox) log handlers were implemented
99* (bluefox) fixed the error with $ selector and with disabled subscribes
100
101### 4.2.1 (2019-10-07)
102* (bluefox) implement inter-script communication.
103* (bluefox) Implemented the mirroring on disk
104* (bluefox) Translation for other languages was added
105
106### 4.1.17 (2019-08-xx)
107* (bluefox) Optimization: do not make useless iterations
108* (bluefox) Allow to make requests to sites with self/signed certificates
109
110### 4.1.16 (2019-08-24)
111* (bluefox) Fixed the errors in editor
112
113### 4.1.15 (2019-08-24)
114* (bluefox) Added the polish language to CRON
115* (bluefox) Fixed the import of scripts
116
117### 4.1.14 (2019-07-14)
118* (bluefox) Fixed locale settings
119
120### 4.1.13 (2019-06-02)
121* (bluefox) fixed Monaco Loading
122* (bluefox) added missing blockly element
123* (AlCalzone) Improved the warning message when assigning a variable of wrong type to a state
124* (thewhobox) Added selector blockly, language strings, regexp
125* (thewhobox) Fixed Blockly bug
126* (paul53) fixed for suncalc.getTimes between middle night and nadir
127
128### 4.1.12 (2019-03-07)
129* (bluefox) Schedule was corrected
130
131### 4.1.8 (2019-02-03)
132* (jkuehner) Updated the blockly to the latest code
133* (bleufox) scriptEnabled variables not only for experts
134* (bleufox) fixed one error with "cannot extract blockly"
135* (bluefox) GUI fixes
136* (bluefox) show problem scripts as yellow pause icon
137
138### 4.0.12 (2019-01-20)
139* (Apollon77/AlCalzone) fixes unwanted changes in last version
140* (SchumyHao) Add Chinese support
141
142### 4.0.11 (2019-01-14)
143* (bluefox) add set/getBinaryState
144
145### 4.0.7 (2018-12-25) Breaking changes - no IE support anymore
146* (bluefox) Material UI
147* (AlCalzone) monaco javascript editor
148
149### 3.7.0 (2018-05-05)
150* (bluefox) Used VM2 as sandbox. The script errors will be caught.
151* (bluefox) refactoring: split into many modules
152* (AlCalzone) Change TypeScript version range to include TS 3.0+
153
154### 3.6.5 (2019-02-13)
155* (bluefox) Error with formatDate was fixed
156
157### 3.6.4 (2018-02-05)
158* (bluefox) Pattern error is fixed
159
160### 3.6.3 (2018-01-31)
161* (bluefox) Fixing the CSS for CRON dialog
162* (bluefox) Fixing the reorder of scripts
163
164### 3.6.1 (2018-01-23)
165* (bluefox) Pattern error is fixed
166
167### 3.6.0 (2017-12-28)
168* (bluefox) more translations are added
169* (bluefox) update blockly engine
170
171### 3.5.1 (2017-11-14)
172* (bluefox) fixed: sometimes MSG is not defined
173* (AlCalzone) TypeScript support (preparations)
174* (bluefox) add sendToHost call
175* (bluefox) protect exec call
176* (bluefox) add getStateDelayed function
177
178### 3.4.4 (2017-09-12)
179* (soef) typo error in line number correction fixed
180
181### 3.4.1 (2017-08-12)
182* (soef) patternMatching optimized
183
184### 3.4.0 (2017-08-06)
185* (bluefox) Support of new admin
186
187### 3.3.12 (2017-07-24)
188* (bluefox) file and line info added to log outputs
189
190### 3.3.11 (2017-07-18)
191* (bluefox) fix build CRON block
192
193### 3.3.9 (2017-06-18)
194* (bluefox) Add the toggle blockly block
195
196### 3.3.8 (2017-05-22)
197* (Apollon77/bluefox) Accept for subscribes arrays of IDs
198
199### 3.3.6 (2017-05-17)
200* (bluefox) add the genitive month for formatDate
201
202### 3.3.4 (2017-04-01)
203* (bluefox) Catch error by request if host unavailable
204* (bluefox) add "request" to script namespace
205
206### 3.3.3 (2017-03-27)
207* (bluefox)Fix stopScript
208
209### 3.3.2 (2017-03-18)
210* (bluefox) Support of system coordinates
211
212### 3.3.1 (2017-03-15)
213 * (bluefox) fix error if no scripts exists
214
215### 3.3.0 (2017-03-14)
216* (bluefox) all callbacks in try/catch
217
218### 3.2.8 (2017-03-08)
219* (bluefox) Translations
220
221### 3.2.7 (2017-03-03)
222* (bluefox) allow creation of states for other javascript instances
223
224### 3.2.6 (2017-02-14)
225* (bluefox) Fix import of scripts
226* (bluefox) Ask to save before start the script
227
228### 3.2.5 (2017-01-23)
229* (bluefox) Extend compareTime function with astro features
230
231### 3.2.4 (2017-01-13)
232* (bluefox) fix stopScript
233
234### 3.2.3 (2017-01-05)
235* (bluefox) Try to fix error with sayit
236
237### 3.2.2 (2016-12-17)
238* (bluefox) Allow with stopScript() to stop itself
239
240### 3.2.1 (2016-11-24)
241* (bluefox) Fix error with subscribe for only required states
242
243### 3.2.0 (2016-11-14)
244* (bluefox) Fix error with of blocks in adapters
245* (bluefox) Support of subscribe for only required states
246* (bluefox) add delFile
247* (bluefox) fix error with names
248
249### 3.1.0 (2016-10-12)
250* (bluefox) Support of blocks in adapters
251* (bluefox) Move sendTo blocks into adapters
252
253### 3.0.10 (2016-09-30)
254* (bluefox) New blocks: compare time, write state
255* (bluefox) Documentation
256
257### 3.0.9 (2016-09-20)
258* (bluefox) Bugfixing of blockly
259
260### 3.0.7 (2016-09-09)
261* (bluefox) add ack for trigger in blockly
262* (bluefox) add block to get info about trigger
263* (bluefox) start description of blockly
264* (bluefox) add runScript functions
265* (bluefox) disable zoom on wheel in blockly
266* (bluefox) fix block: time compare
267
268### 3.0.6 (2016-09-07)
269* (bluefox) add extendObject function
270* (bluefox) add custom sendTo block
271* (bluefox) add multiple trigger block
272
273### 3.0.5 (2016-09-03)
274* (bluefox) Fix sendTo blocks
275
276### 3.0.4 (2016-09-01)
277* (bluefox) Support of convert day of week into text in blockly
278
279### 3.0.3 (2016-08-29)
280* (bluefox) Fixed the convert date block
281
282### 3.0.2 (2016-08-28)
283* (bluefox) Change name of sandbox debug variable
284
285### 3.0.1 (2016-08-27)
286* (bluefox) Fix disabling of script
287
288### 3.0.0 (2016-08-27)
289* (bluefox) Beta Release with Blockly
290
291
292## License
293
294The MIT License (MIT)
295
296Copyright (c) 2014-2020 bluefox <dogafox@gmail.com>,
297
298Copyright (c) 2014 hobbyquaker