@operato/scene-integration 0.1.1 → 0.1.5

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +66 -96
  2. package/dist/client-api.d.ts +1 -0
  3. package/dist/client-api.js +22 -0
  4. package/dist/client-api.js.map +1 -0
  5. package/dist/connection-control.d.ts +2 -26
  6. package/dist/connection-control.js.map +1 -1
  7. package/dist/connection-state-subscription.d.ts +3 -15
  8. package/dist/connection-state-subscription.js.map +1 -1
  9. package/dist/data-subscription.d.ts +3 -13
  10. package/dist/data-subscription.js.map +1 -1
  11. package/dist/scenario-control.d.ts +3 -26
  12. package/dist/scenario-control.js +2 -17
  13. package/dist/scenario-control.js.map +1 -1
  14. package/dist/scenario-instance-subscription.d.ts +3 -20
  15. package/dist/scenario-instance-subscription.js +3 -18
  16. package/dist/scenario-instance-subscription.js.map +1 -1
  17. package/dist/scenario-queue-subscription.d.ts +3 -8
  18. package/dist/scenario-queue-subscription.js.map +1 -1
  19. package/dist/scenario-run.d.ts +3 -21
  20. package/dist/scenario-run.js +2 -17
  21. package/dist/scenario-run.js.map +1 -1
  22. package/dist/scenario-start.d.ts +3 -21
  23. package/dist/scenario-start.js +2 -17
  24. package/dist/scenario-start.js.map +1 -1
  25. package/dist/scenario-stop.d.ts +3 -21
  26. package/dist/scenario-stop.js +2 -17
  27. package/dist/scenario-stop.js.map +1 -1
  28. package/package.json +6 -6
  29. package/src/client-api.ts +25 -0
  30. package/src/connection-control.ts +2 -2
  31. package/src/connection-state-subscription.ts +2 -2
  32. package/src/data-subscription.ts +2 -2
  33. package/src/scenario-control.ts +4 -20
  34. package/src/scenario-instance-subscription.ts +5 -21
  35. package/src/scenario-queue-subscription.ts +2 -2
  36. package/src/scenario-run.ts +4 -20
  37. package/src/scenario-start.ts +4 -20
  38. package/src/scenario-stop.ts +4 -20
  39. package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -3,244 +3,214 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ### [0.1.1](https://github.com/things-scene/operato-scene/compare/v0.1.0...v0.1.1) (2022-01-03)
6
+ ### [0.1.5](https://github.com/things-scene/operato-scene/compare/v0.1.4...v0.1.5) (2022-02-10)
7
7
 
8
8
 
9
- ### :bug: Bug Fix
9
+ ### :rocket: New Features
10
10
 
11
- * [@things-factory](https://github.com/things-factory) 4.0.27 for webpack 5 ([c1b8ce2](https://github.com/things-scene/operato-scene/commit/c1b8ce2a4f069a77b75c82ef8abe2b52974fa5a2))
12
- * @operato/board@0.3.4 ([9f7a868](https://github.com/things-scene/operato-scene/commit/9f7a86820280d24b08dabfd9c9b0f46b4c74feed))
11
+ * move news-ticker to here ([c5e565d](https://github.com/things-scene/operato-scene/commit/c5e565dff6016977766e54b3b74c4f80838f7cd2))
13
12
 
14
13
 
15
14
 
16
- ## [0.1.0](https://github.com/things-scene/operato-scene/compare/v0.0.26...v0.1.0) (2022-01-03)
15
+ ### [0.1.4](https://github.com/things-scene/operato-scene/compare/v0.1.3...v0.1.4) (2022-01-30)
17
16
 
18
17
 
19
18
  ### :rocket: New Features
20
19
 
21
- * applied import.meta.url for native web support ([fe65672](https://github.com/things-scene/operato-scene/commit/fe65672550b15276bd9fa79ab7ac886a8502f8b0))
20
+ * scene-label migrated from things-factory project ([3c9033c](https://github.com/things-scene/operato-scene/commit/3c9033c9af28bdd0377ac4a538ef7d4bfd38d488))
22
21
 
23
22
 
23
+ ### :bug: Bug Fix
24
24
 
25
- ### [0.0.26](https://github.com/things-scene/operato-scene/compare/v0.0.25...v0.0.26) (2022-01-01)
25
+ * applied [@operato](https://github.com/operato) 0.3.24 ([fb4fed0](https://github.com/things-scene/operato-scene/commit/fb4fed0d9fd44d6ae38db6359fdca15fc61f167c))
26
+ * applied [@things-factory](https://github.com/things-factory)@^4.0.40 ([3d4e6cb](https://github.com/things-scene/operato-scene/commit/3d4e6cbe167f605a68333fffe18949adb5247c1d))
27
+ * upgrade [@operato](https://github.com/operato) dependencies ([7d2478e](https://github.com/things-scene/operato-scene/commit/7d2478e72586b662e6c219f0720c78cde5dd7a2d))
28
+ * upgrade [@things-factory](https://github.com/things-factory) and [@operato](https://github.com/operato) ([4d97897](https://github.com/things-scene/operato-scene/commit/4d978970d3c8aba6ecae99e3fa98e431a647e8cb))
26
29
 
27
30
 
28
- ### :bug: Bug Fix
29
31
 
30
- * upgrade [@operato](https://github.com/operato) modules ([ddcb27f](https://github.com/things-scene/operato-scene/commit/ddcb27f7562243d9fc581fed3090c3be42ce1d28))
32
+ ### [0.1.3](https://github.com/things-scene/operato-scene/compare/v0.1.2...v0.1.3) (2022-01-28)
31
33
 
32
34
 
35
+ ### :rocket: New Features
33
36
 
34
- ### [0.0.25](https://github.com/things-scene/operato-scene/compare/v0.0.24...v0.0.25) (2021-12-28)
37
+ * add graphql, mqtt scene component ([e223063](https://github.com/things-scene/operato-scene/commit/e223063b562f6a6a7b6ff12f3e32df30aa920da8))
35
38
 
36
39
 
37
40
  ### :bug: Bug Fix
38
41
 
39
- * @hatiolab/things-scene@2.7.31 ([b0d1706](https://github.com/things-scene/operato-scene/commit/b0d17064bb42ed4a60008a15d48700a328711ab8))
40
- * upgrade [@things-factory](https://github.com/things-factory) dependencies ([0deff8d](https://github.com/things-scene/operato-scene/commit/0deff8dcaba7a7e81061246298b889f6165091d7))
42
+ * applied [@operato](https://github.com/operato)@^0.3.20 ([9a1dcbd](https://github.com/things-scene/operato-scene/commit/9a1dcbd2d1ca7f95b498503c87242b6d57ee3482))
43
+ * applied [@things-factory](https://github.com/things-factory)@^4.0.38 and [@operato](https://github.com/operato)@^0.3.18 ([d506c2d](https://github.com/things-scene/operato-scene/commit/d506c2d8a58341eee235079eff9b79bfa1fe350f))
41
44
 
42
45
 
43
46
 
44
- ### [0.0.24](https://github.com/things-scene/operato-scene/compare/v0.0.23...v0.0.24) (2021-12-21)
45
-
47
+ ### [0.1.2](https://github.com/things-scene/operato-scene/compare/v0.1.1...v0.1.2) (2022-01-13)
46
48
 
47
49
  ### :bug: Bug Fix
48
50
 
49
- * upgrade [@operato](https://github.com/operato) dependencies ([19adafd](https://github.com/things-scene/operato-scene/commit/19adafde63c6a819c905c8b325b8fca6a3ff9e70))
50
-
51
-
52
-
53
- ### [0.0.23](https://github.com/things-scene/operato-scene/compare/v0.0.22...v0.0.23) (2021-12-16)
51
+ - @operato/board upgrade to 0.3.18 ([4c5d232](https://github.com/things-scene/operato-scene/commit/4c5d232d185642624501a369449df21b322384ae))
52
+ - sort scenario name list on property editor ([af568e9](https://github.com/things-scene/operato-scene/commit/af568e9665eaa818cf6608f857466f497a9aa970))
54
53
 
54
+ ### [0.1.1](https://github.com/things-scene/operato-scene/compare/v0.1.0...v0.1.1) (2022-01-03)
55
55
 
56
56
  ### :bug: Bug Fix
57
57
 
58
- * upgrade dependencies ([3939f9f](https://github.com/things-scene/operato-scene/commit/3939f9f4069f97a5370b616375e3ecf36cf41704))
58
+ - [@things-factory](https://github.com/things-factory) 4.0.38 for webpack 5 ([c1b8ce2](https://github.com/things-scene/operato-scene/commit/c1b8ce2a4f069a77b75c82ef8abe2b52974fa5a2))
59
+ - @operato/board@0.3.4 ([9f7a868](https://github.com/things-scene/operato-scene/commit/9f7a86820280d24b08dabfd9c9b0f46b4c74feed))
59
60
 
61
+ ## [0.1.0](https://github.com/things-scene/operato-scene/compare/v0.0.26...v0.1.0) (2022-01-03)
60
62
 
63
+ ### :rocket: New Features
61
64
 
62
- ### [0.0.22](https://github.com/things-scene/operato-scene/compare/v0.0.21...v0.0.22) (2021-12-14)
65
+ - applied import.meta.url for native web support ([fe65672](https://github.com/things-scene/operato-scene/commit/fe65672550b15276bd9fa79ab7ac886a8502f8b0))
63
66
 
67
+ ### [0.0.26](https://github.com/things-scene/operato-scene/compare/v0.0.25...v0.0.26) (2022-01-01)
64
68
 
65
69
  ### :bug: Bug Fix
66
70
 
67
- * @hatiolab/things-scene upgrade ([7841684](https://github.com/things-scene/operato-scene/commit/78416849b0a336c55450e15f09d3cb58cc5e8e51))
71
+ - upgrade [@operato](https://github.com/operato) modules ([ddcb27f](https://github.com/things-scene/operato-scene/commit/ddcb27f7562243d9fc581fed3090c3be42ce1d28))
68
72
 
73
+ ### [0.0.25](https://github.com/things-scene/operato-scene/compare/v0.0.24...v0.0.25) (2021-12-28)
69
74
 
75
+ ### :bug: Bug Fix
70
76
 
71
- ### [0.0.21](https://github.com/things-scene/operato-scene/compare/v0.0.20...v0.0.21) (2021-12-14)
77
+ - @hatiolab/things-scene@2.7.31 ([b0d1706](https://github.com/things-scene/operato-scene/commit/b0d17064bb42ed4a60008a15d48700a328711ab8))
78
+ - upgrade [@things-factory](https://github.com/things-factory) dependencies ([0deff8d](https://github.com/things-scene/operato-scene/commit/0deff8dcaba7a7e81061246298b889f6165091d7))
72
79
 
80
+ ### [0.0.24](https://github.com/things-scene/operato-scene/compare/v0.0.23...v0.0.24) (2021-12-21)
73
81
 
74
82
  ### :bug: Bug Fix
75
83
 
76
- * @things-factory/operato-board@^4.0.17 ([713a319](https://github.com/things-scene/operato-scene/commit/713a319b55a9d27fca98a1b577898863cf89a765))
84
+ - upgrade [@operato](https://github.com/operato) dependencies ([19adafd](https://github.com/things-scene/operato-scene/commit/19adafde63c6a819c905c8b325b8fca6a3ff9e70))
77
85
 
86
+ ### [0.0.23](https://github.com/things-scene/operato-scene/compare/v0.0.22...v0.0.23) (2021-12-16)
78
87
 
88
+ ### :bug: Bug Fix
79
89
 
80
- ### [0.0.20](https://github.com/things-scene/operato-scene/compare/v0.0.19...v0.0.20) (2021-12-13)
90
+ - upgrade dependencies ([3939f9f](https://github.com/things-scene/operato-scene/commit/3939f9f4069f97a5370b616375e3ecf36cf41704))
81
91
 
92
+ ### [0.0.22](https://github.com/things-scene/operato-scene/compare/v0.0.21...v0.0.22) (2021-12-14)
82
93
 
83
94
  ### :bug: Bug Fix
84
95
 
85
- * upgrade [@operato](https://github.com/operato) version ([fbc79cf](https://github.com/things-scene/operato-scene/commit/fbc79cfcc60f92a5c6c510dc07a42bc92b810777))
96
+ - @hatiolab/things-scene upgrade ([7841684](https://github.com/things-scene/operato-scene/commit/78416849b0a336c55450e15f09d3cb58cc5e8e51))
86
97
 
98
+ ### [0.0.21](https://github.com/things-scene/operato-scene/compare/v0.0.20...v0.0.21) (2021-12-14)
87
99
 
100
+ ### :bug: Bug Fix
88
101
 
89
- ### [0.0.19](https://github.com/things-scene/operato-scene/compare/v0.0.18...v0.0.19) (2021-12-12)
102
+ - @things-factory/operato-board@^4.0.17 ([713a319](https://github.com/things-scene/operato-scene/commit/713a319b55a9d27fca98a1b577898863cf89a765))
90
103
 
104
+ ### [0.0.20](https://github.com/things-scene/operato-scene/compare/v0.0.19...v0.0.20) (2021-12-13)
91
105
 
92
106
  ### :bug: Bug Fix
93
107
 
94
- * upgrade @hatiolab/things-scene, @operato/board,property-editor,data-grist ([e6743bd](https://github.com/things-scene/operato-scene/commit/e6743bda29852fdae779b893a1e825a1cb73f0f9))
108
+ - upgrade [@operato](https://github.com/operato) version ([fbc79cf](https://github.com/things-scene/operato-scene/commit/fbc79cfcc60f92a5c6c510dc07a42bc92b810777))
95
109
 
110
+ ### [0.0.19](https://github.com/things-scene/operato-scene/compare/v0.0.18...v0.0.19) (2021-12-12)
96
111
 
112
+ ### :bug: Bug Fix
97
113
 
98
- ### [0.0.18](https://github.com/things-scene/operato-scene/compare/v0.0.17...v0.0.18) (2021-12-11)
114
+ - upgrade @hatiolab/things-scene, @operato/board,property-editor,data-grist ([e6743bd](https://github.com/things-scene/operato-scene/commit/e6743bda29852fdae779b893a1e825a1cb73f0f9))
99
115
 
116
+ ### [0.0.18](https://github.com/things-scene/operato-scene/compare/v0.0.17...v0.0.18) (2021-12-11)
100
117
 
101
118
  ### :bug: Bug Fix
102
119
 
103
- * upgrade things-factory version ([e7fc142](https://github.com/things-scene/operato-scene/commit/e7fc142a70d3d54b61fdd076522dede8a5908dcd))
104
-
105
-
120
+ - upgrade things-factory version ([e7fc142](https://github.com/things-scene/operato-scene/commit/e7fc142a70d3d54b61fdd076522dede8a5908dcd))
106
121
 
107
122
  ### [0.0.17](https://github.com/things-scene/operato-scene/compare/v0.0.16...v0.0.17) (2021-12-11)
108
123
 
109
-
110
124
  ### :bug: Bug Fix
111
125
 
112
- * upgrade operato to 0.2.45 ([0032bad](https://github.com/things-scene/operato-scene/commit/0032bad0914e7fd7eae5e8cc1574df20ce7cb851))
113
-
114
-
126
+ - upgrade operato to 0.2.45 ([0032bad](https://github.com/things-scene/operato-scene/commit/0032bad0914e7fd7eae5e8cc1574df20ce7cb851))
115
127
 
116
128
  ### [0.0.16](https://github.com/things-scene/operato-scene/compare/v0.0.15...v0.0.16) (2021-12-09)
117
129
 
118
-
119
130
  ### :rocket: New Features
120
131
 
121
- * add indoor-map and gauge component ([35d8a75](https://github.com/things-scene/operato-scene/commit/35d8a75f7d691dd23ea299fd772b79d19eec5d2f))
122
-
132
+ - add indoor-map and gauge component ([35d8a75](https://github.com/things-scene/operato-scene/commit/35d8a75f7d691dd23ea299fd772b79d19eec5d2f))
123
133
 
124
134
  ### :bug: Bug Fix
125
135
 
126
- * operato dependencies ([4309938](https://github.com/things-scene/operato-scene/commit/4309938e154e6638c22c4edd66b756ca2c0e6587))
127
- * upgrade [@operato](https://github.com/operato) dependencies ([92985c7](https://github.com/things-scene/operato-scene/commit/92985c76d2b7e6d3941c2c809a85b3676a579b0e))
128
-
129
-
136
+ - operato dependencies ([4309938](https://github.com/things-scene/operato-scene/commit/4309938e154e6638c22c4edd66b756ca2c0e6587))
137
+ - upgrade [@operato](https://github.com/operato) dependencies ([92985c7](https://github.com/things-scene/operato-scene/commit/92985c76d2b7e6d3941c2c809a85b3676a579b0e))
130
138
 
131
139
  ### [0.0.15](https://github.com/things-scene/operato-scene/compare/v0.0.14...v0.0.15) (2021-12-08)
132
140
 
133
-
134
141
  ### :bug: Bug Fix
135
142
 
136
- * upgrade operato dependencies ([0c26428](https://github.com/things-scene/operato-scene/commit/0c26428d0e3236851cd46c4f507c086d9d181ff4))
137
-
138
-
143
+ - upgrade operato dependencies ([0c26428](https://github.com/things-scene/operato-scene/commit/0c26428d0e3236851cd46c4f507c086d9d181ff4))
139
144
 
140
145
  ### [0.0.14](https://github.com/things-scene/operato-scene/compare/v0.0.13...v0.0.14) (2021-12-07)
141
146
 
142
147
  **Note:** Version bump only for package @operato/scene-integration
143
148
 
144
-
145
-
146
-
147
-
148
149
  ### [0.0.13](https://github.com/things-scene/operato-scene/compare/v0.0.12...v0.0.13) (2021-12-07)
149
150
 
150
-
151
151
  ### :rocket: New Features
152
152
 
153
- * scene-grist complete ([cf87cb7](https://github.com/things-scene/operato-scene/commit/cf87cb7df0ae276341b16dee5c2e0f949703ff02))
154
-
153
+ - scene-grist complete ([cf87cb7](https://github.com/things-scene/operato-scene/commit/cf87cb7df0ae276341b16dee5c2e0f949703ff02))
155
154
 
156
155
  ### :bug: Bug Fix
157
156
 
158
- * upgrade operato version ([e5ec388](https://github.com/things-scene/operato-scene/commit/e5ec38843b215be144a06ee65dfce22acff4ca1c))
159
-
160
-
157
+ - upgrade operato version ([e5ec388](https://github.com/things-scene/operato-scene/commit/e5ec38843b215be144a06ee65dfce22acff4ca1c))
161
158
 
162
159
  ### [0.0.12](https://github.com/things-scene/operato-scene/compare/v0.0.11...v0.0.12) (2021-12-06)
163
160
 
164
161
  **Note:** Version bump only for package @operato/scene-integration
165
162
 
166
-
167
-
168
-
169
-
170
163
  ### [0.0.11](https://github.com/things-scene/operato-scene/compare/v0.0.10...v0.0.11) (2021-12-06)
171
164
 
172
-
173
165
  ### :rocket: New Features
174
166
 
175
- * add wheel-sorter, legend, timer and compass ([dc90f73](https://github.com/things-scene/operato-scene/commit/dc90f73054424c0867a1c4a28d51da6e7fab8b85))
176
- * add wheel-sorter, legend, timer and compass ([518950c](https://github.com/things-scene/operato-scene/commit/518950cb5476048504a415a1dd0a1fd2d4359a77))
177
-
178
-
167
+ - add wheel-sorter, legend, timer and compass ([dc90f73](https://github.com/things-scene/operato-scene/commit/dc90f73054424c0867a1c4a28d51da6e7fab8b85))
168
+ - add wheel-sorter, legend, timer and compass ([518950c](https://github.com/things-scene/operato-scene/commit/518950cb5476048504a415a1dd0a1fd2d4359a77))
179
169
 
180
170
  ### [0.0.10](https://github.com/things-scene/operato-scene/compare/v0.0.9...v0.0.10) (2021-12-06)
181
171
 
182
-
183
172
  ### :bug: Bug Fix
184
173
 
185
- * module things-factory for test upgraded ([6a4a853](https://github.com/things-scene/operato-scene/commit/6a4a853f6beb80403c29bd8f423902f6e9ecdd81))
186
-
174
+ - module things-factory for test upgraded ([6a4a853](https://github.com/things-scene/operato-scene/commit/6a4a853f6beb80403c29bd8f423902f6e9ecdd81))
187
175
 
188
176
  ### :rocket: New Features
189
177
 
190
- * add @operato/scene-clock ([74da632](https://github.com/things-scene/operato-scene/commit/74da632211643f47f50a886ca7173bced0132b62))
191
- * add @operato/scene-clock ([8b0d55c](https://github.com/things-scene/operato-scene/commit/8b0d55ce3ce35f0b4e8aee02703370937a30275a))
192
-
193
-
178
+ - add @operato/scene-clock ([74da632](https://github.com/things-scene/operato-scene/commit/74da632211643f47f50a886ca7173bced0132b62))
179
+ - add @operato/scene-clock ([8b0d55c](https://github.com/things-scene/operato-scene/commit/8b0d55ce3ce35f0b4e8aee02703370937a30275a))
194
180
 
195
181
  ### [0.0.9](https://github.com/things-scene/operato-scene/compare/v0.0.8...v0.0.9) (2021-12-03)
196
182
 
197
-
198
183
  ### :rocket: New Features
199
184
 
200
- * operato/scene-grist added ([5dfb9ac](https://github.com/things-scene/operato-scene/commit/5dfb9ac35f46d0b101cbcb43dc7d90c937d8e2ff))
201
-
185
+ - operato/scene-grist added ([5dfb9ac](https://github.com/things-scene/operato-scene/commit/5dfb9ac35f46d0b101cbcb43dc7d90c937d8e2ff))
202
186
 
203
187
  ### :bug: Bug Fix
204
188
 
205
- * ready to operato/scene-grist ([0cc9cc0](https://github.com/things-scene/operato-scene/commit/0cc9cc02d608be80ba5e39c017b5c2080e959da9))
206
-
207
-
189
+ - ready to operato/scene-grist ([0cc9cc0](https://github.com/things-scene/operato-scene/commit/0cc9cc02d608be80ba5e39c017b5c2080e959da9))
208
190
 
209
191
  ### [0.0.8](https://github.com/things-scene/operato-scene/compare/v0.0.7...v0.0.8) (2021-12-03)
210
192
 
211
193
  **Note:** Version bump only for package @operato/scene-integration
212
194
 
213
-
214
-
215
-
216
-
217
195
  ### [0.0.7](https://github.com/things-scene/operato-scene/compare/v0.0.6...v0.0.7) (2021-12-03)
218
196
 
219
-
220
197
  ### :bug: Bug Fix
221
198
 
222
- * integration editors ([abb6968](https://github.com/things-scene/operato-scene/commit/abb696884ba751b1379477e7f9f7a4010c98eba1))
223
-
224
-
199
+ - integration editors ([abb6968](https://github.com/things-scene/operato-scene/commit/abb696884ba751b1379477e7f9f7a4010c98eba1))
225
200
 
226
201
  ### [0.0.6](https://github.com/things-scene/operato-scene/compare/v0.0.5...v0.0.6) (2021-12-03)
227
202
 
228
-
229
203
  ### :bug: Bug Fix
230
204
 
231
- * tsconfig ([a5ce449](https://github.com/things-scene/operato-scene/commit/a5ce449078e0b5371323984b78f1fb32526489bd))
232
-
233
-
205
+ - tsconfig ([a5ce449](https://github.com/things-scene/operato-scene/commit/a5ce449078e0b5371323984b78f1fb32526489bd))
234
206
 
235
207
  ### [0.0.5](https://github.com/things-scene/operato-scene/compare/v0.0.4...v0.0.5) (2021-12-03)
236
208
 
237
-
238
209
  ### :rocket: New Features
239
210
 
240
- * add chartjs ([6b3b67b](https://github.com/things-scene/operato-scene/commit/6b3b67be882eda21a702f4f13ed5e0c4606ac934))
241
- * added scene-half-roundrect and integration ([91092e6](https://github.com/things-scene/operato-scene/commit/91092e664dd0d962e981f4acae70252f4c2ac6da))
242
-
211
+ - add chartjs ([6b3b67b](https://github.com/things-scene/operato-scene/commit/6b3b67be882eda21a702f4f13ed5e0c4606ac934))
212
+ - added scene-half-roundrect and integration ([91092e6](https://github.com/things-scene/operato-scene/commit/91092e664dd0d962e981f4acae70252f4c2ac6da))
243
213
 
244
214
  ### :bug: Bug Fix
245
215
 
246
- * add chartjs, integration module ([24cd106](https://github.com/things-scene/operato-scene/commit/24cd1065d13314e7ca3927a0306fed766531b851))
216
+ - add chartjs, integration module ([24cd106](https://github.com/things-scene/operato-scene/commit/24cd1065d13314e7ca3927a0306fed766531b851))
@@ -0,0 +1 @@
1
+ export declare const scenarios: () => Promise<string[]>;
@@ -0,0 +1,22 @@
1
+ import gql from 'graphql-tag';
2
+ import { getClient } from './origin-client';
3
+ export const scenarios = async () => {
4
+ var response = await getClient().query({
5
+ query: gql `
6
+ query {
7
+ scenarios {
8
+ items {
9
+ name
10
+ }
11
+ }
12
+ }
13
+ `
14
+ });
15
+ if (response.errors) {
16
+ return [''];
17
+ }
18
+ const items = response.data.scenarios.items.map((item) => item.name);
19
+ const sorted = items.sort();
20
+ return [''].concat(sorted);
21
+ };
22
+ //# sourceMappingURL=client-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-api.js","sourceRoot":"","sources":["../src/client-api.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,IAAI,EAAE;IAClC,IAAI,QAAQ,GAAG,MAAM,SAAS,EAAE,CAAC,KAAK,CAAC;QACrC,KAAK,EAAE,GAAG,CAAA;;;;;;;;KAQT;KACF,CAAC,CAAA;IACF,IAAI,QAAQ,CAAC,MAAM,EAAE;QACnB,OAAO,CAAC,EAAE,CAAC,CAAA;KACZ;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzE,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAE3B,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { getClient } from './origin-client'\n\nexport const scenarios = async () => {\n var response = await getClient().query({\n query: gql`\n query {\n scenarios {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n const items = response.data.scenarios.items.map((item: any) => item.name)\n const sorted = items.sort()\n\n return [''].concat(sorted)\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { Shape } from '@hatiolab/things-scene';
1
+ import { ComponentNature, Shape } from '@hatiolab/things-scene';
2
2
  declare const ConnectionControl_base: typeof Shape;
3
3
  export default class ConnectionControl extends ConnectionControl_base {
4
4
  static _image: HTMLImageElement;
@@ -8,31 +8,7 @@ export default class ConnectionControl extends ConnectionControl_base {
8
8
  ready(): void;
9
9
  _init(): void;
10
10
  dispose(): void;
11
- get nature(): {
12
- mutable: boolean;
13
- resizable: boolean;
14
- rotatable: boolean;
15
- properties: ({
16
- type: string;
17
- label: string;
18
- name: string;
19
- property: {
20
- options: () => Promise<string[]>;
21
- };
22
- } | {
23
- type: string;
24
- label: string;
25
- name: string;
26
- property: {
27
- options: {
28
- display: string;
29
- value: string;
30
- }[];
31
- };
32
- })[];
33
- 'value-property': string;
34
- help: string;
35
- };
11
+ get nature(): ComponentNature;
36
12
  get client(): any;
37
13
  get controlType(): string;
38
14
  set controlType(controlType: string);
@@ -1 +1 @@
1
- {"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../src/connection-control.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,GAAG;IACb,OAAO,EAA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QACzC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEhD,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEnD,QAAQ,WAAW,EAAE;YACnB,KAAK,SAAS,CAAC;YACf,KAAK,IAAI,CAAC;YACV,KAAK,CAAC;gBACJ,WAAW,GAAG,SAAS,CAAA;gBACvB,MAAK;YACP;gBACE,WAAW,GAAG,YAAY,CAAA;SAC7B;QAED,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,IAAI,KAAK,GAAG,EAAE,CAAA;QAEd,KAAK,GAAG;QACJ,WAAW,qBAAqB,cAAc;;;MAGhD,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAChC,KAAK,EAAE,GAAG,CAAA;YACN,KAAK;SACR;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;SACrB;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { getClient } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n },\n {\n type: 'select',\n label: 'control-type',\n name: 'controlType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'connect',\n value: 'connect'\n },\n {\n display: 'disconnect',\n value: 'disconnect'\n }\n ]\n }\n }\n ],\n 'value-property': 'controlType',\n help: 'scene/component/connection-control'\n}\n\nexport default class ConnectionControl extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ConnectionControl._image) {\n ConnectionControl._image = new Image()\n ConnectionControl._image.src = new URL('../icons/symbol-connection-control.png', import.meta.url).href\n }\n return ConnectionControl._image\n }\n\n private _client: any\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ConnectionControl.image, left, top, width, height)\n }\n\n ready() {\n super.ready()\n this._init()\n }\n\n _init() {\n if (!this.app.isViewMode) return\n\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\n }\n\n get nature() {\n return NATURE\n }\n\n get client() {\n return this._client\n }\n\n get controlType() {\n return this.getState('controlType')\n }\n\n set controlType(controlType: string) {\n this.setState('controlType', controlType)\n this.controlConnect()\n }\n\n async controlConnect() {\n let { controlType, connectionName } = this.state\n\n if (!connectionName || !this.app.isViewMode) return\n\n switch (controlType) {\n case 'connect':\n case true:\n case 1:\n controlType = 'connect'\n break\n default:\n controlType = 'disconnect'\n }\n\n var client = this._client\n var query = ''\n\n query = `mutation{\n ${controlType}Connection(name: \"${connectionName}\") {\n status\n }\n }`\n\n if (client) {\n var response = await client.query({\n query: gql`\n ${query}\n `\n })\n\n this.data = response\n }\n }\n}\n\nComponent.register('connection-control', ConnectionControl)\n"]}
1
+ {"version":3,"file":"connection-control.js","sourceRoot":"","sources":["../src/connection-control.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEpF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAA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C,aAAa,EAAE,WAAW,CAAC,CAAA;QACzC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEhD,IAAI,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEnD,QAAQ,WAAW,EAAE;YACnB,KAAK,SAAS,CAAC;YACf,KAAK,IAAI,CAAC;YACV,KAAK,CAAC;gBACJ,WAAW,GAAG,SAAS,CAAA;gBACvB,MAAK;YACP;gBACE,WAAW,GAAG,YAAY,CAAA;SAC7B;QAED,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAA;QACzB,IAAI,KAAK,GAAG,EAAE,CAAA;QAEd,KAAK,GAAG;QACJ,WAAW,qBAAqB,cAAc;;;MAGhD,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAChC,KAAK,EAAE,GAAG,CAAA;YACN,KAAK;SACR;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA;SACrB;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { getClient } from './origin-client'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n },\n {\n type: 'select',\n label: 'control-type',\n name: 'controlType',\n property: {\n options: [\n {\n display: '',\n value: ''\n },\n {\n display: 'connect',\n value: 'connect'\n },\n {\n display: 'disconnect',\n value: 'disconnect'\n }\n ]\n }\n }\n ],\n 'value-property': 'controlType',\n help: 'scene/component/connection-control'\n}\n\nexport default class ConnectionControl extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n static get image() {\n if (!ConnectionControl._image) {\n ConnectionControl._image = new Image()\n ConnectionControl._image.src = new URL('../icons/symbol-connection-control.png', import.meta.url).href\n }\n return ConnectionControl._image\n }\n\n private _client: any\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n context.beginPath()\n this.drawImage(context, ConnectionControl.image, left, top, width, height)\n }\n\n ready() {\n super.ready()\n this._init()\n }\n\n _init() {\n if (!this.app.isViewMode) return\n\n this._client = getClient()\n }\n\n dispose() {\n super.dispose()\n\n try {\n if (this._client) {\n this._client.stop()\n }\n } catch (e) {\n console.error(e)\n }\n delete this._client\n }\n\n get nature() {\n return NATURE\n }\n\n get client() {\n return this._client\n }\n\n get controlType() {\n return this.getState('controlType')\n }\n\n set controlType(controlType: string) {\n this.setState('controlType', controlType)\n this.controlConnect()\n }\n\n async controlConnect() {\n let { controlType, connectionName } = this.state\n\n if (!connectionName || !this.app.isViewMode) return\n\n switch (controlType) {\n case 'connect':\n case true:\n case 1:\n controlType = 'connect'\n break\n default:\n controlType = 'disconnect'\n }\n\n var client = this._client\n var query = ''\n\n query = `mutation{\n ${controlType}Connection(name: \"${connectionName}\") {\n status\n }\n }`\n\n if (client) {\n var response = await client.query({\n query: gql`\n ${query}\n `\n })\n\n this.data = response\n }\n }\n}\n\nComponent.register('connection-control', ConnectionControl)\n"]}
@@ -1,6 +1,7 @@
1
- import { Shape } from '@hatiolab/things-scene';
1
+ import { ComponentNature, Shape } from '@hatiolab/things-scene';
2
2
  declare const ConnectionStateSubscription_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class ConnectionStateSubscription extends ConnectionStateSubscription_base {
6
7
  static _image: HTMLImageElement;
@@ -9,20 +10,7 @@ export default class ConnectionStateSubscription extends ConnectionStateSubscrip
9
10
  dispose(): void;
10
11
  render(context: CanvasRenderingContext2D): void;
11
12
  ready(): void;
12
- get nature(): {
13
- mutable: boolean;
14
- resizable: boolean;
15
- rotatable: boolean;
16
- properties: {
17
- type: string;
18
- label: string;
19
- name: string;
20
- property: {
21
- options: () => Promise<string[]>;
22
- };
23
- }[];
24
- help: string;
25
- };
13
+ get nature(): ComponentNature;
26
14
  _initConnectionStateSubscription(): void;
27
15
  startSubscribe(): Promise<void>;
28
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../src/connection-state-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE/E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,MAAM,GAAG;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,SAAS,EAAE,CAAC,KAAK,CAAC;wBACrC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE;wBACnB,OAAO,CAAC,EAAE,CAAC,CAAA;qBACZ;oBAED,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,C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UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEnC,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;mCACiB,cAAc;;;;;UAKvC;SACH,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAA;iBACjC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,2BAA2B,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { getClient, subscribe } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n }\n ],\n help: 'scene/component/connection-state-subscription'\n}\n\nexport default class ConnectionStateSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n static get image() {\n if (!ConnectionStateSubscription._image) {\n ConnectionStateSubscription._image = new Image()\n ConnectionStateSubscription._image.src = new URL(\n '../icons/symbol-connection-state-subscription.png',\n import.meta.url\n ).href\n }\n\n return ConnectionStateSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ConnectionStateSubscription.image, left, top, width, height)\n }\n\n ready() {\n if (!this.app.isViewMode) return\n this._initConnectionStateSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initConnectionStateSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { connectionName } = this.state\n\n this.subscription = await subscribe(\n {\n query: gql`subscription {\n connectionState(name: \"${connectionName}\") {\n name\n state\n timestamp\n }\n }`\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.connectionState\n }\n }\n }\n )\n }\n}\n\nComponent.register('connection-state-subscription', ConnectionStateSubscription)\n"]}
1
+ {"version":3,"file":"connection-state-subscription.js","sourceRoot":"","sources":["../src/connection-state-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEhG,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR,OAAO,EAAE,KAAK,IAAI,EAAE;oBAClB,IAAI,QAAQ,GAAG,MAAM,SAAS,EAAE,CAAC,KAAK,CAAC;wBACrC,KAAK,EAAE,GAAG,CAAA;;;;;;;;aAQT;qBACF,CAAC,CAAA;oBACF,IAAI,QAAQ,CAAC,MAAM,EAAE;wBACnB,OAAO,CAAC,EAAE,CAAC,CAAA;qBACZ;oBAED,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,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,UAAU;YAAE,OAAM;QAChC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAEnC,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;mCACiB,cAAc;;;;;UAKvC;SACH,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAA;iBACjC;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,2BAA2B,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { getClient, subscribe } from './origin-client'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'select',\n label: 'connection-name',\n name: 'connectionName',\n property: {\n options: async () => {\n var response = await getClient().query({\n query: gql`\n query {\n connections {\n items {\n name\n }\n }\n }\n `\n })\n if (response.errors) {\n return ['']\n }\n\n return [''].concat(response.data.connections.items.map((item: any) => item.name))\n }\n }\n }\n ],\n help: 'scene/component/connection-state-subscription'\n}\n\nexport default class ConnectionStateSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n static get image() {\n if (!ConnectionStateSubscription._image) {\n ConnectionStateSubscription._image = new Image()\n ConnectionStateSubscription._image.src = new URL(\n '../icons/symbol-connection-state-subscription.png',\n import.meta.url\n ).href\n }\n\n return ConnectionStateSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n super.dispose()\n\n this.subscription?.unsubscribe()\n delete this.subscription\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, ConnectionStateSubscription.image, left, top, width, height)\n }\n\n ready() {\n if (!this.app.isViewMode) return\n this._initConnectionStateSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n _initConnectionStateSubscription() {\n if (!this.app.isViewMode) return\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { connectionName } = this.state\n\n this.subscription = await subscribe(\n {\n query: gql`subscription {\n connectionState(name: \"${connectionName}\") {\n name\n state\n timestamp\n }\n }`\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.connectionState\n }\n }\n }\n )\n }\n}\n\nComponent.register('connection-state-subscription', ConnectionStateSubscription)\n"]}
@@ -1,6 +1,7 @@
1
- import { Shape } from '@hatiolab/things-scene';
1
+ import { ComponentNature, Shape } from '@hatiolab/things-scene';
2
2
  declare const DataSubscription_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class DataSubscription extends DataSubscription_base {
6
7
  static _image: HTMLImageElement;
@@ -9,18 +10,7 @@ export default class DataSubscription extends DataSubscription_base {
9
10
  dispose(): void;
10
11
  render(context: CanvasRenderingContext2D): void;
11
12
  ready(): void;
12
- get nature(): {
13
- mutable: boolean;
14
- resizable: boolean;
15
- rotatable: boolean;
16
- properties: {
17
- type: string;
18
- label: string;
19
- name: string;
20
- }[];
21
- 'value-property': string;
22
- help: string;
23
- };
13
+ get nature(): ComponentNature;
24
14
  get tag(): any;
25
15
  set tag(tag: any);
26
16
  _initDataSubscription(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../src/data-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE/E,OAAO,EAAE,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AM,CAAA;IACf,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAA;IACvB,CAAC;IAED,IAAI,GAAG,CAAC,GAAG;QACT,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAC3B,CAAC;IAED,qBAAqB;QACnB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU;YAAE,OAAM;QAEhC,IAAI,CAAC,cAAc,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,IAAI,CAAC,YAAY,GAAG,MAAM,SAAS,CACjC;YACE,KAAK,EAAE,GAAG,CAAA;;yBAEO,GAAG;;;;;SAKnB;SACF,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;iBAC3B;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { subscribe } from './origin-client'\n\nconst NATURE = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'tag',\n name: 'tag'\n }\n ],\n 'value-property': 'tag',\n help: 'scene/component/data-subscription'\n}\n\nexport default class DataSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n static get image() {\n if (!DataSubscription._image) {\n DataSubscription._image = new Image()\n DataSubscription._image.src = new URL('../icons/symbol-data-subscription.png', import.meta.url).href\n }\n\n return DataSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n this.subscription?.unsubscribe()\n delete this.subscription\n\n super.dispose()\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, DataSubscription.image, left, top, width, height)\n }\n\n ready() {\n this._initDataSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n get tag() {\n return this.state.tag\n }\n\n set tag(tag) {\n this.setState('tag', tag)\n }\n\n _initDataSubscription() {\n if (!this.app.isViewMode) return\n\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { tag } = this.state\n\n this.subscription = await subscribe(\n {\n query: gql`\n subscription {\n data(tag: \"${tag}\") {\n tag\n data\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.data.data\n }\n }\n }\n )\n }\n}\n\nComponent.register('data-subscription', DataSubscription)\n"]}
1
+ {"version":3,"file":"data-subscription.js","sourceRoot":"","sources":["../src/data-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEhG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,KAAK;SACZ;KACF;IACD,gBAAgB,EAAE,KAAK;IACvB,IAAI,EAAE,mCAAmC;CAC1C,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAC5B,gBAAgB,CAAC,MAAM,GAAG,IAAI,KAA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;;;;;SAKnB;SACF,EACD;YACE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAiB,EAAE,EAAE;gBACtC,IAAI,IAAI,EAAE;oBACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;iBAC3B;YACH,CAAC;SACF,CACF,CAAA;IACH,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAA","sourcesContent":["import gql from 'graphql-tag'\n\nimport { Component, ComponentNature, DataSource, RectPath, Shape } from '@hatiolab/things-scene'\n\nimport { subscribe } from './origin-client'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'string',\n label: 'tag',\n name: 'tag'\n }\n ],\n 'value-property': 'tag',\n help: 'scene/component/data-subscription'\n}\n\nexport default class DataSubscription extends DataSource(RectPath(Shape)) {\n static _image: HTMLImageElement\n static get image() {\n if (!DataSubscription._image) {\n DataSubscription._image = new Image()\n DataSubscription._image.src = new URL('../icons/symbol-data-subscription.png', import.meta.url).href\n }\n\n return DataSubscription._image\n }\n\n private subscription?: {\n unsubscribe(): void\n }\n\n dispose() {\n this.subscription?.unsubscribe()\n delete this.subscription\n\n super.dispose()\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, DataSubscription.image, left, top, width, height)\n }\n\n ready() {\n this._initDataSubscription()\n }\n\n get nature() {\n return NATURE\n }\n\n get tag() {\n return this.state.tag\n }\n\n set tag(tag) {\n this.setState('tag', tag)\n }\n\n _initDataSubscription() {\n if (!this.app.isViewMode) return\n\n this.startSubscribe()\n }\n\n async startSubscribe() {\n var { tag } = this.state\n\n this.subscription = await subscribe(\n {\n query: gql`\n subscription {\n data(tag: \"${tag}\") {\n tag\n data\n }\n }\n `\n },\n {\n next: async ({ data }: { data: any }) => {\n if (data) {\n this.data = data.data.data\n }\n }\n }\n )\n }\n}\n\nComponent.register('data-subscription', DataSubscription)\n"]}
@@ -1,6 +1,7 @@
1
- import { Properties, Shape } from '@hatiolab/things-scene';
1
+ import { ComponentNature, Properties, Shape } from '@hatiolab/things-scene';
2
2
  declare const ScenarioControl_base: (new (...args: any[]) => {
3
3
  isDataSource(): boolean;
4
+ _convertDataFormat(data: any, format: string): any;
4
5
  }) & typeof Shape;
5
6
  export default class ScenarioControl extends ScenarioControl_base {
6
7
  static _image: HTMLImageElement;
@@ -10,31 +11,7 @@ export default class ScenarioControl extends ScenarioControl_base {
10
11
  ready(): void;
11
12
  _initScenario(): void;
12
13
  dispose(): void;
13
- get nature(): {
14
- mutable: boolean;
15
- resizable: boolean;
16
- rotatable: boolean;
17
- properties: ({
18
- type: string;
19
- label: string;
20
- name: string;
21
- property: {
22
- options: () => Promise<string[]>;
23
- };
24
- } | {
25
- type: string;
26
- label: string;
27
- name: string;
28
- property: {
29
- options: {
30
- display: string;
31
- value: string;
32
- }[];
33
- };
34
- })[];
35
- 'value-property': string;
36
- help: string;
37
- };
14
+ get nature(): ComponentNature;
38
15
  onchange(after: Properties): void;
39
16
  get client(): any;
40
17
  get controlType(): any;
@@ -1,5 +1,6 @@
1
1
  import gql from 'graphql-tag';
2
2
  import { Component, DataSource, RectPath, Shape } from '@hatiolab/things-scene';
3
+ import { scenarios } from './client-api';
3
4
  import { getClient } from './origin-client';
4
5
  const NATURE = {
5
6
  mutable: false,
@@ -11,23 +12,7 @@ const NATURE = {
11
12
  label: 'scenario-name',
12
13
  name: 'scenarioName',
13
14
  property: {
14
- options: async () => {
15
- var response = await getClient().query({
16
- query: gql `
17
- query {
18
- scenarios {
19
- items {
20
- name
21
- }
22
- }
23
- }
24
- `
25
- });
26
- if (response.errors) {
27
- return [''];
28
- }
29
- return [''].concat(response.data.scenarios.items.map((item) => item.name));
30
- }
15
+ options: scenarios
31
16
  }
32
17
  },
33
18
  {