homematic-manager 3.0.0-beta.2 → 3.0.0-beta.21

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 (332) hide show
  1. package/README.md +2 -1
  2. package/data/easymode-time-selectors.json +285 -0
  3. package/data/icons/106_hm-lc-sw1-dr.webp +0 -0
  4. package/data/icons/108_hm-rc-dis-h-x-eu.webp +0 -0
  5. package/data/icons/109_hm-lc-sw1-pl-ct.webp +0 -0
  6. package/data/icons/110_hm-es-pmsw1-dr.webp +0 -0
  7. package/data/icons/112_hmip-wrc2.webp +0 -0
  8. package/data/icons/113_hmip-psm-ch.webp +0 -0
  9. package/data/icons/113_hmip-psm-it.webp +0 -0
  10. package/data/icons/113_hmip-psm-pe.webp +0 -0
  11. package/data/icons/113_hmip-psm-uk.webp +0 -0
  12. package/data/icons/113_hmip-psm.webp +0 -0
  13. package/data/icons/114_hm-lc-dim1t-fm-lf_3.webp +0 -0
  14. package/data/icons/116_hm-rc-4-3_brc-h3.webp +0 -0
  15. package/data/icons/118_hmip-swdo.webp +0 -0
  16. package/data/icons/119_hmip-rc8.webp +0 -0
  17. package/data/icons/120_hmip-etrv.webp +0 -0
  18. package/data/icons/121_hmip-wth.webp +0 -0
  19. package/data/icons/123_oligo.smart.ip.hm.webp +0 -0
  20. package/data/icons/125_hmip-smi.webp +0 -0
  21. package/data/icons/130_hmip-srh.webp +0 -0
  22. package/data/icons/131_hmip-wrc6.webp +0 -0
  23. package/data/icons/132_hmip-smo.webp +0 -0
  24. package/data/icons/133_hmip-asir.webp +0 -0
  25. package/data/icons/134_hmip-fsm.webp +0 -0
  26. package/data/icons/135_hmip-fsm16.webp +0 -0
  27. package/data/icons/136_hmip-miob.webp +0 -0
  28. package/data/icons/137_hmip-fal-c6.webp +0 -0
  29. package/data/icons/138_hmip-fal-c10.webp +0 -0
  30. package/data/icons/140_alpha-ip-rgb.webp +0 -0
  31. package/data/icons/141_alpha-ip-rgba.webp +0 -0
  32. package/data/icons/144_hmip-wgc.webp +0 -0
  33. package/data/icons/145_hmip-froll_hmip-fbl.webp +0 -0
  34. package/data/icons/146_hmip-sth.webp +0 -0
  35. package/data/icons/147_hmip-sthd.webp +0 -0
  36. package/data/icons/148_hmip-stho.webp +0 -0
  37. package/data/icons/149_hmip-sam.webp +0 -0
  38. package/data/icons/151_hmip-pcbs-bat.webp +0 -0
  39. package/data/icons/152_hmip-swdo-i.webp +0 -0
  40. package/data/icons/153_hmip-spi.webp +0 -0
  41. package/data/icons/154_hmip-spdr.webp +0 -0
  42. package/data/icons/155_hmip-whs2.webp +0 -0
  43. package/data/icons/156_hmip-mod-oc8.webp +0 -0
  44. package/data/icons/158_hmip-etrv-uk.webp +0 -0
  45. package/data/icons/159_hmip-mod-rc8.webp +0 -0
  46. package/data/icons/160_hmipw-drs4.webp +0 -0
  47. package/data/icons/161_hmipw-drs8.webp +0 -0
  48. package/data/icons/162_hmipw-drap.webp +0 -0
  49. package/data/icons/163_hmipw-drbl4.webp +0 -0
  50. package/data/icons/164_hmipw-dri16.webp +0 -0
  51. package/data/icons/165_hmipw-fio6.webp +0 -0
  52. package/data/icons/166_hmipw-drd3.webp +0 -0
  53. package/data/icons/167_hmipw-dri32.webp +0 -0
  54. package/data/icons/168_hmip-smi55.webp +0 -0
  55. package/data/icons/169_hmip-swo-pr.webp +0 -0
  56. package/data/icons/170_hmip-swo-pl.webp +0 -0
  57. package/data/icons/171_hmip-swo-b.webp +0 -0
  58. package/data/icons/172_hmip-swd.webp +0 -0
  59. package/data/icons/173_hmip-bsl.webp +0 -0
  60. package/data/icons/174_hmip-slo.webp +0 -0
  61. package/data/icons/175_hmip-group-heating.webp +0 -0
  62. package/data/icons/177_hmip-dbb.webp +0 -0
  63. package/data/icons/178_hmip-etrv-b1.webp +0 -0
  64. package/data/icons/179_hmip-swdm-b2.webp +0 -0
  65. package/data/icons/180_hmip-etrv-b.webp +0 -0
  66. package/data/icons/181_hmip-swdm.webp +0 -0
  67. package/data/icons/182_hmip-fci1.webp +0 -0
  68. package/data/icons/183_hmip-mod-tm.webp +0 -0
  69. package/data/icons/184_hmip-pcbs2.webp +0 -0
  70. package/data/icons/185_hmip-FCI6.webp +0 -0
  71. package/data/icons/186_hmip-mp3p.webp +0 -0
  72. package/data/icons/187_hmip-rcb1.webp +0 -0
  73. package/data/icons/188_hmip-etrv-c.webp +0 -0
  74. package/data/icons/190_hmip-sci.webp +0 -0
  75. package/data/icons/191_hmip-mod-ho.webp +0 -0
  76. package/data/icons/192_hmip-asir-o.webp +0 -0
  77. package/data/icons/193_hmip-wt.webp +0 -0
  78. package/data/icons/194_hmip-wrcd.webp +0 -0
  79. package/data/icons/195_hmipw-smi55.webp +0 -0
  80. package/data/icons/196_hmip-ASIR-2.webp +0 -0
  81. package/data/icons/197_hmip-swdo-pl.webp +0 -0
  82. package/data/icons/198_hmip-falmot-c12.webp +0 -0
  83. package/data/icons/199_hmip-mio16-pcb.webp +0 -0
  84. package/data/icons/200_hmip-wth-b.webp +0 -0
  85. package/data/icons/201_hmip-stv.webp +0 -0
  86. package/data/icons/202_hmip-wrcr.webp +0 -0
  87. package/data/icons/203_hmip-fsi16.webp +0 -0
  88. package/data/icons/204_hmip-drdi3.webp +0 -0
  89. package/data/icons/205_hmip-drsi4.webp +0 -0
  90. package/data/icons/206_hmip-drbli4.webp +0 -0
  91. package/data/icons/207_hmip-srdo.webp +0 -0
  92. package/data/icons/208_hmip-dsd-pcb.webp +0 -0
  93. package/data/icons/209_hmip-etrv-b-uk.webp +0 -0
  94. package/data/icons/210_hmip-ste2-pcb.webp +0 -0
  95. package/data/icons/211_hmip-drg-dali.webp +0 -0
  96. package/data/icons/211_hmip-drsi1.webp +0 -0
  97. package/data/icons/212_hmip-sfd.webp +0 -0
  98. package/data/icons/212_hmipw-scthd.webp +0 -0
  99. package/data/icons/213_hmip-smo230.webp +0 -0
  100. package/data/icons/213_hmip-wua.webp +0 -0
  101. package/data/icons/214_hmip-dld.webp +0 -0
  102. package/data/icons/215_hmip-psm-pe-2.webp +0 -0
  103. package/data/icons/215_hmip-scth230.webp +0 -0
  104. package/data/icons/216_hmip-etrv-e.webp +0 -0
  105. package/data/icons/216_hmip-psm-ch-2.webp +0 -0
  106. package/data/icons/217_hmip-usbsm.webp +0 -0
  107. package/data/icons/218_hmip-dls.webp +0 -0
  108. package/data/icons/219_hmip-fwi.webp +0 -0
  109. package/data/icons/220_hmip-wsc.webp +0 -0
  110. package/data/icons/221_hmip-sti.webp +0 -0
  111. package/data/icons/221_hmip-wkp.webp +0 -0
  112. package/data/icons/222_hmipw-wgd.webp +0 -0
  113. package/data/icons/223_hmip-mod-wd-vk.webp +0 -0
  114. package/data/icons/224_hmip-etrv-cl.webp +0 -0
  115. package/data/icons/225_hmip-rgbw.webp +0 -0
  116. package/data/icons/226_hmip-esi.webp +0 -0
  117. package/data/icons/227_hmip-lsc.webp +0 -0
  118. package/data/icons/228_elv-sh-sw1-bat.webp +0 -0
  119. package/data/icons/229_elv-sh-bm-s.webp +0 -0
  120. package/data/icons/230_hmip-etrv-f.webp +0 -0
  121. package/data/icons/231_elv-sh-cth.webp +0 -0
  122. package/data/icons/232_elv-sh-taco.webp +0 -0
  123. package/data/icons/233_hmip-flc.webp +0 -0
  124. package/data/icons/234_hmip-etrv-3.webp +0 -0
  125. package/data/icons/235_hmip-psmco.webp +0 -0
  126. package/data/icons/236_elv-sh-sb8.webp +0 -0
  127. package/data/icons/237_elv-sh-ctv.webp +0 -0
  128. package/data/icons/238_elv-sh-cap.webp +0 -0
  129. package/data/icons/239_hmip-wgs-f.webp +0 -0
  130. package/data/icons/240_hmip-wgtc-f.webp +0 -0
  131. package/data/icons/241_hmip-wgt-f.webp +0 -0
  132. package/data/icons/242_elv-sh-smsi.webp +0 -0
  133. package/data/icons/243_elv-sh-crc.webp +0 -0
  134. package/data/icons/244_elv-sh-krco.webp +0 -0
  135. package/data/icons/245_hmip-falmot-c8.webp +0 -0
  136. package/data/icons/246_elv-sh-wsm.webp +0 -0
  137. package/data/icons/247_hmip-hap-2.webp +0 -0
  138. package/data/icons/248_hmip-dlp.webp +0 -0
  139. package/data/icons/249_elv-sh-psmci.webp +0 -0
  140. package/data/icons/250_elv-sh-sps25.webp +0 -0
  141. package/data/icons/252_elv-sh-pti2.webp +0 -0
  142. package/data/icons/253_hmip-udi-smi55.webp +0 -0
  143. package/data/icons/254_hmip-udi-pb2.webp +0 -0
  144. package/data/icons/256_ELV-SH-SMS2.webp +0 -0
  145. package/data/icons/257_ELV-SH-FSI.webp +0 -0
  146. package/data/icons/258_hmip-m-td15.webp +0 -0
  147. package/data/icons/259_elv-sh-dusi.webp +0 -0
  148. package/data/icons/260_hmip-wss.webp +0 -0
  149. package/data/icons/54a_lc-ddc1-pcb.webp +0 -0
  150. package/data/icons/72_hm-rc-brc-h.webp +0 -0
  151. package/data/icons/73_hm-atent.webp +0 -0
  152. package/data/icons/79_hm-lc-dim1pwm-cv.webp +0 -0
  153. package/data/icons/84_hm-rc-4-3.webp +0 -0
  154. package/data/icons/85_hm-rc-sec4-3.webp +0 -0
  155. package/data/icons/86_hm-rc-key4-3.webp +0 -0
  156. package/data/icons/CCU3-1-50.webp +0 -0
  157. package/data/icons/CCU3.webp +0 -0
  158. package/data/icons/hm-coupling-dim.webp +0 -0
  159. package/data/icons/hm-coupling-group.webp +0 -0
  160. package/data/icons/hm-coupling-onoff.webp +0 -0
  161. package/data/icons/hm-coupling-rgb-dim.webp +0 -0
  162. package/data/icons/hm-coupling-rgb.webp +0 -0
  163. package/data/icons/hm-coupling-rgbw-dim.webp +0 -0
  164. package/data/icons/hm-coupling-rgbw.webp +0 -0
  165. package/data/icons/hm-coupling-white-dim.webp +0 -0
  166. package/data/icons/hm-coupling-white.webp +0 -0
  167. package/data/icons/hm-hue_gateway.webp +0 -0
  168. package/data/icons/hm-lightify_gateway.webp +0 -0
  169. package/data/icons/hm_resc-win-pcb-sc.webp +0 -0
  170. package/data/icons/unknown_device.webp +0 -0
  171. package/data/manifest.json +7 -1
  172. package/data/master-metadata.json +1997 -33
  173. package/data/profiles/ACCESS_RECEIVER.json +26 -13
  174. package/data/profiles/ACOUSTIC_SIGNAL_VIRTUAL_RECEIVER.json +3270 -76
  175. package/data/profiles/ACTOR_SECURITY.json +90 -10
  176. package/data/profiles/ACTOR_WINDOW.json +580 -43
  177. package/data/profiles/ALARMACTUATOR.json +564 -37
  178. package/data/profiles/ALARM_COND_SWITCH_RECEIVER.json +36 -4
  179. package/data/profiles/ALARM_SWITCH_VIRTUAL_RECEIVER.json +735 -33
  180. package/data/profiles/ARMING.json +115 -5
  181. package/data/profiles/BLIND.json +1038 -49
  182. package/data/profiles/BLIND_VIRTUAL_RECEIVER.json +4624 -124
  183. package/data/profiles/CLIMATECONTROL_FLOOR_PUMP_TRANSCEIVER.json +27 -1
  184. package/data/profiles/DIMMER.json +2233 -71
  185. package/data/profiles/DIMMER_VIRTUAL_RECEIVER.json +5773 -102
  186. package/data/profiles/DIMMER_woLongKeyPress.json +117 -4
  187. package/data/profiles/DOOR_RECEIVER.json +138 -10
  188. package/data/profiles/DUAL_WHITE_BRIGHTNESS.json +305 -11
  189. package/data/profiles/DUAL_WHITE_COLOR.json +730 -23
  190. package/data/profiles/HEATING_KEY_RECEIVER.json +127 -10
  191. package/data/profiles/HMW_BLIND.json +555 -20
  192. package/data/profiles/HMW_DIMMER.json +1337 -47
  193. package/data/profiles/HMW_INPUT_OUTPUT.json +375 -20
  194. package/data/profiles/HMW_SWITCH.json +375 -20
  195. package/data/profiles/JALOUSIE.json +1320 -52
  196. package/data/profiles/KEYMATIC.json +120 -12
  197. package/data/profiles/REMOTECONTROL_RECEIVER.json +10 -2
  198. package/data/profiles/RGBW_AUTOMATIC.json +46 -6
  199. package/data/profiles/RGBW_COLOR.json +14 -4
  200. package/data/profiles/SERVO_VIRTUAL_RECEIVER.json +117 -3
  201. package/data/profiles/SHUTTER_VIRTUAL_RECEIVER.json +4263 -128
  202. package/data/profiles/SIGNAL_CHIME.json +195 -14
  203. package/data/profiles/SIGNAL_CHIMEM.json +195 -14
  204. package/data/profiles/SIGNAL_LED.json +195 -14
  205. package/data/profiles/SIGNAL_LEDM.json +195 -14
  206. package/data/profiles/SIMPLE_SWITCH_RECEIVER.json +113 -9
  207. package/data/profiles/STATUS_INDICATOR.json +1073 -45
  208. package/data/profiles/SWITCH.json +1412 -60
  209. package/data/profiles/SWITCH_PANIC.json +315 -13
  210. package/data/profiles/SWITCH_SENSOR.json +243 -11
  211. package/data/profiles/SWITCH_VIRTUAL_RECEIVER.json +3963 -131
  212. package/data/profiles/UNIVERSAL_ACTOR.json +4319 -90
  213. package/data/profiles/UNIVERSAL_LIGHT_RECEIVER_LSC.json +6094 -196
  214. package/data/profiles/UNIVERSAL_LIGHT_RECEIVER_PWM.json +4920 -101
  215. package/data/profiles/UNIVERSAL_LIGHT_RECEIVER_RGB(W).json +2353 -80
  216. package/data/profiles/UNIVERSAL_LIGHT_RECEIVER_RGBW_DALI.json +6116 -176
  217. package/data/profiles/UNIVERSAL_LIGHT_RECEIVER_TW.json +3844 -104
  218. package/data/profiles/VIRTUAL_DIMMER.json +305 -11
  219. package/data/profiles/VIRTUAL_DUAL_WHITE_COLOR.json +730 -23
  220. package/data/profiles/WATER_SWITCH_VIRTUAL_RECEIVER.json +3903 -128
  221. package/data/profiles/WINDOW_DRIVE_RECEIVER.json +220 -8
  222. package/data/profiles/WINMATIC.json +505 -23
  223. package/dist/cli.js +24 -0
  224. package/dist/occulite.d.ts +86 -0
  225. package/dist/occulite.js +140 -0
  226. package/dist/options.d.ts +37 -6
  227. package/dist/options.js +49 -6
  228. package/dist/server.d.ts +47 -4
  229. package/dist/server.js +237 -27
  230. package/dist/sessions.d.ts +9 -1
  231. package/dist/sessions.js +8 -2
  232. package/dist/testSupport.js +9 -2
  233. package/node_modules/@homematic-manager/backend/dist/api/backend.d.ts +33 -0
  234. package/node_modules/@homematic-manager/backend/dist/api/backend.js +558 -46
  235. package/node_modules/@homematic-manager/backend/dist/cache/names.d.ts +9 -0
  236. package/node_modules/@homematic-manager/backend/dist/cache/names.js +21 -0
  237. package/node_modules/@homematic-manager/backend/dist/config/defaults.js +10 -1
  238. package/node_modules/@homematic-manager/backend/dist/config/store.d.ts +28 -1
  239. package/node_modules/@homematic-manager/backend/dist/config/store.js +59 -3
  240. package/node_modules/@homematic-manager/backend/dist/devices/installMode.js +9 -0
  241. package/node_modules/@homematic-manager/backend/dist/errors.d.ts +18 -0
  242. package/node_modules/@homematic-manager/backend/dist/errors.js +51 -2
  243. package/node_modules/@homematic-manager/backend/dist/images/deviceImages.d.ts +6 -0
  244. package/node_modules/@homematic-manager/backend/dist/images/deviceImages.js +38 -2
  245. package/node_modules/@homematic-manager/backend/dist/index.d.ts +3 -1
  246. package/node_modules/@homematic-manager/backend/dist/index.js +4 -1
  247. package/node_modules/@homematic-manager/backend/dist/interfaces/manager.d.ts +70 -8
  248. package/node_modules/@homematic-manager/backend/dist/interfaces/manager.js +333 -44
  249. package/node_modules/@homematic-manager/backend/dist/meta/client.d.ts +120 -0
  250. package/node_modules/@homematic-manager/backend/dist/meta/client.js +307 -0
  251. package/node_modules/@homematic-manager/backend/dist/meta/credentials.d.ts +38 -0
  252. package/node_modules/@homematic-manager/backend/dist/meta/credentials.js +53 -0
  253. package/node_modules/@homematic-manager/backend/dist/meta/index.d.ts +12 -0
  254. package/node_modules/@homematic-manager/backend/dist/meta/index.js +12 -0
  255. package/node_modules/@homematic-manager/backend/dist/meta/localProvider.d.ts +47 -0
  256. package/node_modules/@homematic-manager/backend/dist/meta/localProvider.js +119 -0
  257. package/node_modules/@homematic-manager/backend/dist/meta/occuliteProvider.d.ts +79 -0
  258. package/node_modules/@homematic-manager/backend/dist/meta/occuliteProvider.js +305 -0
  259. package/node_modules/@homematic-manager/backend/dist/meta/provider.d.ts +68 -0
  260. package/node_modules/@homematic-manager/backend/dist/meta/provider.js +19 -0
  261. package/node_modules/@homematic-manager/backend/dist/meta/regaProvider.d.ts +84 -0
  262. package/node_modules/@homematic-manager/backend/dist/meta/regaProvider.js +403 -0
  263. package/node_modules/@homematic-manager/backend/dist/meta/service.d.ts +137 -0
  264. package/node_modules/@homematic-manager/backend/dist/meta/service.js +412 -0
  265. package/node_modules/@homematic-manager/backend/dist/rega/client.d.ts +11 -0
  266. package/node_modules/@homematic-manager/backend/dist/rega/client.js +13 -0
  267. package/node_modules/@homematic-manager/backend/dist/rega/scripts.d.ts +51 -0
  268. package/node_modules/@homematic-manager/backend/dist/rega/scripts.js +171 -0
  269. package/node_modules/@homematic-manager/backend/dist/rpc/client.d.ts +18 -5
  270. package/node_modules/@homematic-manager/backend/dist/rpc/client.js +11 -5
  271. package/node_modules/@homematic-manager/backend/dist/rpc/log.d.ts +86 -0
  272. package/node_modules/@homematic-manager/backend/dist/rpc/log.js +241 -0
  273. package/node_modules/@homematic-manager/backend/dist/rpc/origin.d.ts +30 -0
  274. package/node_modules/@homematic-manager/backend/dist/rpc/origin.js +35 -0
  275. package/node_modules/@homematic-manager/backend/dist/rpc/server.d.ts +12 -0
  276. package/node_modules/@homematic-manager/backend/dist/rpc/server.js +37 -5
  277. package/node_modules/@homematic-manager/backend/dist/util/net.d.ts +86 -1
  278. package/node_modules/@homematic-manager/backend/dist/util/net.js +223 -9
  279. package/node_modules/@homematic-manager/backend/package.json +1 -1
  280. package/node_modules/@homematic-manager/core/dist/api/types.d.ts +397 -10
  281. package/node_modules/@homematic-manager/core/dist/api/types.js +23 -2
  282. package/node_modules/@homematic-manager/core/dist/data/memory.d.ts +3 -1
  283. package/node_modules/@homematic-manager/core/dist/data/memory.js +3 -0
  284. package/node_modules/@homematic-manager/core/dist/data/types.d.ts +60 -0
  285. package/node_modules/@homematic-manager/core/dist/data/types.js +2 -0
  286. package/node_modules/@homematic-manager/core/dist/devices/index.d.ts +19 -0
  287. package/node_modules/@homematic-manager/core/dist/devices/index.js +53 -0
  288. package/node_modules/@homematic-manager/core/dist/easymodes/engine.d.ts +3 -1
  289. package/node_modules/@homematic-manager/core/dist/easymodes/engine.js +1 -0
  290. package/node_modules/@homematic-manager/core/dist/easymodes/form.d.ts +43 -0
  291. package/node_modules/@homematic-manager/core/dist/easymodes/form.js +84 -0
  292. package/node_modules/@homematic-manager/core/dist/i18n/messages.js +61 -0
  293. package/node_modules/@homematic-manager/core/dist/index.d.ts +3 -0
  294. package/node_modules/@homematic-manager/core/dist/index.js +4 -0
  295. package/node_modules/@homematic-manager/core/dist/interfaces/table.d.ts +23 -2
  296. package/node_modules/@homematic-manager/core/dist/interfaces/table.js +18 -1
  297. package/node_modules/@homematic-manager/core/dist/meta/document.d.ts +71 -0
  298. package/node_modules/@homematic-manager/core/dist/meta/document.js +260 -0
  299. package/node_modules/@homematic-manager/core/dist/meta/follow.d.ts +27 -0
  300. package/node_modules/@homematic-manager/core/dist/meta/follow.js +180 -0
  301. package/node_modules/@homematic-manager/core/dist/meta/index.d.ts +16 -0
  302. package/node_modules/@homematic-manager/core/dist/meta/index.js +16 -0
  303. package/node_modules/@homematic-manager/core/dist/meta/paths.d.ts +96 -0
  304. package/node_modules/@homematic-manager/core/dist/meta/paths.js +182 -0
  305. package/node_modules/@homematic-manager/core/dist/meta/slug.d.ts +22 -0
  306. package/node_modules/@homematic-manager/core/dist/meta/slug.js +59 -0
  307. package/node_modules/@homematic-manager/core/dist/meta/store.d.ts +147 -0
  308. package/node_modules/@homematic-manager/core/dist/meta/store.js +537 -0
  309. package/node_modules/@homematic-manager/core/dist/meta/tree.d.ts +19 -0
  310. package/node_modules/@homematic-manager/core/dist/meta/tree.js +53 -0
  311. package/node_modules/@homematic-manager/core/dist/meta/types.d.ts +143 -0
  312. package/node_modules/@homematic-manager/core/dist/meta/types.js +63 -0
  313. package/node_modules/@homematic-manager/core/dist/meta/view.d.ts +50 -0
  314. package/node_modules/@homematic-manager/core/dist/meta/view.js +103 -0
  315. package/node_modules/@homematic-manager/core/dist/rpc/methods.d.ts +10 -0
  316. package/node_modules/@homematic-manager/core/dist/rpc/methods.js +51 -1
  317. package/node_modules/@homematic-manager/core/dist/rpc/text.d.ts +22 -0
  318. package/node_modules/@homematic-manager/core/dist/rpc/text.js +46 -0
  319. package/node_modules/@homematic-manager/core/dist/rssi/index.d.ts +125 -13
  320. package/node_modules/@homematic-manager/core/dist/rssi/index.js +146 -29
  321. package/node_modules/@homematic-manager/core/dist/serviceMessages/index.d.ts +28 -2
  322. package/node_modules/@homematic-manager/core/dist/serviceMessages/index.js +44 -6
  323. package/node_modules/@homematic-manager/core/package.json +1 -1
  324. package/package.json +3 -3
  325. package/ui/assets/index-D-NsbBVS.css +1 -0
  326. package/ui/assets/index-DNUNMBbb.js +16 -0
  327. package/ui/favicon.ico +0 -0
  328. package/ui/index.html +3 -2
  329. package/node_modules/@homematic-manager/backend/dist/write/log.d.ts +0 -51
  330. package/node_modules/@homematic-manager/backend/dist/write/log.js +0 -151
  331. package/ui/assets/index-lB-HxsKR.js +0 -13
  332. package/ui/assets/index-qbhgN2pA.css +0 -1
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Reading, validating and comparing a whole metadata document.
3
+ *
4
+ * A document arrives from three places - the box's `/snapshot`, a file this application wrote
5
+ * itself, and an import a user picked - and all three go through here. The rule of the format is
6
+ * that a document is validated **as a whole and rejected entirely** on the first error, because
7
+ * half an import is worse than none: the enums an object refers to have to exist, and that is not
8
+ * a property of any single entry.
9
+ *
10
+ * Every refusal is a {@link MetaError} with the code the specification names, so an import dialog
11
+ * can say "room/nowhere does not exist" rather than "invalid".
12
+ */
13
+ import { byteLength, enumPaths, isValidIcon, isValidId, normaliseName, parsePath, requireDepth, requireRef, } from './paths.js';
14
+ import { MAX_META_BYTES, META_FORMAT, MetaError, emptyDocument, } from './types.js';
15
+ function isRecord(value) {
16
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
17
+ }
18
+ /**
19
+ * One object, checked and brought into the shape the store keeps.
20
+ *
21
+ * `enums` and `meta` always exist afterwards; `orphaned` only when it is true, which is what
22
+ * `occulited` serialises and therefore what a byte comparison of two documents needs.
23
+ */
24
+ export function normaliseObject(raw) {
25
+ if (!isRecord(raw)) {
26
+ throw new MetaError('invalid-name', 'an object has to be an object');
27
+ }
28
+ const name = normaliseName(raw['name']);
29
+ const enums = normaliseEnumList(raw['enums']);
30
+ const meta = normaliseMeta(raw['meta']);
31
+ const orphaned = raw['orphaned'] === true;
32
+ return orphaned ? { name, enums, meta, orphaned: true } : { name, enums, meta };
33
+ }
34
+ /** The `enums` array: strings that look like paths, without duplicates. Existence is checked later. */
35
+ export function normaliseEnumList(raw) {
36
+ if (raw === undefined || raw === null) {
37
+ return [];
38
+ }
39
+ if (!Array.isArray(raw)) {
40
+ throw new MetaError('unknown-path', 'enums has to be an array of node paths');
41
+ }
42
+ const paths = [];
43
+ for (const entry of raw) {
44
+ if (typeof entry !== 'string' || parsePath(entry) === undefined) {
45
+ throw new MetaError('unknown-path', `${String(entry)} is not a node path`);
46
+ }
47
+ if (paths.includes(entry)) {
48
+ throw new MetaError('duplicate-path', `${entry} is listed twice`);
49
+ }
50
+ paths.push(entry);
51
+ }
52
+ return paths;
53
+ }
54
+ /**
55
+ * The `meta` block: one key per consumer namespace, any JSON below it.
56
+ *
57
+ * The store never interprets what is in there - that is the point of the namespace - so the only
58
+ * rules are the spelling of the key and the size of the whole block.
59
+ */
60
+ export function normaliseMeta(raw) {
61
+ if (raw === undefined || raw === null) {
62
+ return {};
63
+ }
64
+ if (!isRecord(raw)) {
65
+ throw new MetaError('invalid-id', 'meta has to be an object of namespaces');
66
+ }
67
+ for (const namespace of Object.keys(raw)) {
68
+ if (!isValidId(namespace)) {
69
+ throw new MetaError('invalid-id', `${namespace} is not a valid meta namespace`);
70
+ }
71
+ }
72
+ if (byteLength(JSON.stringify(raw)) > MAX_META_BYTES) {
73
+ throw new MetaError('invalid-id', `meta may not be larger than ${String(MAX_META_BYTES)} bytes`);
74
+ }
75
+ return raw;
76
+ }
77
+ /** One node and its subtree, checked. Sibling ids are unique; depth is checked by the caller. */
78
+ export function normaliseNode(raw) {
79
+ if (!isRecord(raw)) {
80
+ throw new MetaError('invalid-id', 'a node has to be an object');
81
+ }
82
+ const id = raw['id'];
83
+ if (typeof id !== 'string' || !isValidId(id)) {
84
+ throw new MetaError('invalid-id', `${String(id)} is not a valid node id`);
85
+ }
86
+ const name = normaliseName(raw['name']);
87
+ const icon = raw['icon'];
88
+ if (icon !== undefined && (typeof icon !== 'string' || !isValidIcon(icon))) {
89
+ // `JSON.stringify` and not `String()`: an icon that arrived as an object would otherwise be
90
+ // reported as "[object Object] is not a valid icon name", which is a message a user reads
91
+ throw new MetaError('invalid-id', `${JSON.stringify(icon)} is not a valid icon name`);
92
+ }
93
+ const children = normaliseNodes(raw['children']);
94
+ const node = {
95
+ id,
96
+ name,
97
+ ...(typeof icon === 'string' ? { icon } : {}),
98
+ ...(children.length > 0 ? { children } : {}),
99
+ };
100
+ return node;
101
+ }
102
+ /** A list of siblings: every one checked, no id twice. */
103
+ export function normaliseNodes(raw) {
104
+ if (raw === undefined || raw === null) {
105
+ return [];
106
+ }
107
+ if (!Array.isArray(raw)) {
108
+ throw new MetaError('invalid-id', 'children has to be an array of nodes');
109
+ }
110
+ const nodes = raw.map((entry) => normaliseNode(entry));
111
+ const seen = new Set();
112
+ for (const node of nodes) {
113
+ if (seen.has(node.id)) {
114
+ throw new MetaError('duplicate-id', `${node.id} is used twice among its siblings`);
115
+ }
116
+ seen.add(node.id);
117
+ }
118
+ return nodes;
119
+ }
120
+ /** One enum: a localised name with at least `en`, and its tree. */
121
+ export function normaliseEnum(id, raw) {
122
+ if (!isValidId(id)) {
123
+ throw new MetaError('invalid-id', `${id} is not a valid enum id`);
124
+ }
125
+ if (!isRecord(raw)) {
126
+ throw new MetaError('invalid-name', `enum ${id} has to be an object`);
127
+ }
128
+ const name = normaliseEnumName(raw['name']);
129
+ const tree = normaliseNodes(raw['tree']);
130
+ requireDepth(tree);
131
+ return { name, tree };
132
+ }
133
+ /**
134
+ * The localised name of an enum.
135
+ *
136
+ * `en` is required: it is the fallback every consumer falls back to, and an enum that has only a
137
+ * German name is unreadable in an English UI - the corpus refuses exactly that with `invalid-name`.
138
+ */
139
+ export function normaliseEnumName(raw) {
140
+ if (!isRecord(raw)) {
141
+ throw new MetaError('invalid-name', 'an enum name has to be an object of languages');
142
+ }
143
+ const name = {};
144
+ for (const [language, value] of Object.entries(raw)) {
145
+ if (typeof value !== 'string') {
146
+ throw new MetaError('invalid-name', `the ${language} name has to be a string`);
147
+ }
148
+ name[language] = normaliseName(value);
149
+ }
150
+ if (name['en'] === undefined) {
151
+ throw new MetaError('invalid-name', 'an enum needs at least an English name');
152
+ }
153
+ return name;
154
+ }
155
+ /**
156
+ * A whole document, validated and normalised - the one entry point for anything untrusted.
157
+ *
158
+ * The order of the checks is the order of the specification's error codes: the format version
159
+ * first (a newer store is not something to guess at), then the enums, then the objects against the
160
+ * paths the enums define.
161
+ */
162
+ export function parseDocument(raw) {
163
+ if (!isRecord(raw)) {
164
+ throw new MetaError('format-unsupported', 'a document has to be an object');
165
+ }
166
+ const format = raw['format'];
167
+ if (format !== META_FORMAT) {
168
+ throw new MetaError('format-unsupported', `format ${String(format)} is newer than this implementation reads (${String(META_FORMAT)})`);
169
+ }
170
+ const revision = raw['revision'];
171
+ if (typeof revision !== 'number' || !Number.isInteger(revision) || revision < 0) {
172
+ throw new MetaError('format-unsupported', 'revision has to be an integer of at least 0');
173
+ }
174
+ const enums = {};
175
+ const rawEnums = raw['enums'];
176
+ if (rawEnums !== undefined && rawEnums !== null) {
177
+ if (!isRecord(rawEnums)) {
178
+ throw new MetaError('unknown-enum', 'enums has to be an object');
179
+ }
180
+ for (const [id, definition] of Object.entries(rawEnums)) {
181
+ enums[id] = normaliseEnum(id, definition);
182
+ }
183
+ }
184
+ const known = knownPaths(enums);
185
+ const objects = {};
186
+ const rawObjects = raw['objects'];
187
+ if (rawObjects !== undefined && rawObjects !== null) {
188
+ if (!isRecord(rawObjects)) {
189
+ throw new MetaError('unknown-object', 'objects has to be an object');
190
+ }
191
+ for (const [ref, entry] of Object.entries(rawObjects)) {
192
+ requireRef(ref);
193
+ const object = normaliseObject(entry);
194
+ for (const path of object.enums) {
195
+ if (!known.has(path)) {
196
+ throw new MetaError('unknown-path', `${ref}: ${path} does not exist`, { ref, path });
197
+ }
198
+ }
199
+ objects[ref] = object;
200
+ }
201
+ }
202
+ return { format: META_FORMAT, revision, objects, enums };
203
+ }
204
+ /** Every node path of every enum - what an object's `enums` entries are checked against. */
205
+ export function knownPaths(enums) {
206
+ const known = new Set();
207
+ for (const [id, definition] of Object.entries(enums)) {
208
+ for (const path of enumPaths(id, definition)) {
209
+ known.add(path);
210
+ }
211
+ }
212
+ return known;
213
+ }
214
+ /**
215
+ * A document as JSON with its keys sorted, which is how two of them are compared.
216
+ *
217
+ * The format says key order is not significant and that a writer should sort for stable diffs, so
218
+ * sorting is both the comparison and the file this application writes. It is also the answer to
219
+ * "did this import change anything": an import whose result equals the document is not a revision.
220
+ */
221
+ export function documentJson(document, space) {
222
+ return JSON.stringify(sortKeys(document), undefined, space);
223
+ }
224
+ /** Do two documents hold the same data? `revision` is not part of the answer. */
225
+ export function documentEquals(a, b) {
226
+ return documentJson({ ...a, revision: 0 }) === documentJson({ ...b, revision: 0 });
227
+ }
228
+ function sortKeys(value) {
229
+ if (Array.isArray(value)) {
230
+ return value.map((entry) => sortKeys(entry));
231
+ }
232
+ if (isRecord(value)) {
233
+ const sorted = {};
234
+ for (const key of Object.keys(value).sort()) {
235
+ sorted[key] = sortKeys(value[key]);
236
+ }
237
+ return sorted;
238
+ }
239
+ return value;
240
+ }
241
+ /**
242
+ * A document out of anything, never throwing: a broken file becomes an empty store.
243
+ *
244
+ * The format says a reader that finds the document unparsable falls back to the `.bak` and reports
245
+ * that it did, never starts empty silently - so the caller gets the error and decides. This is the
246
+ * "and then what" for a caller that has already tried both files.
247
+ */
248
+ export function parseDocumentOrEmpty(raw, onError) {
249
+ try {
250
+ return parseDocument(raw);
251
+ }
252
+ catch (error) {
253
+ if (error instanceof MetaError) {
254
+ onError?.(error);
255
+ return emptyDocument();
256
+ }
257
+ throw error;
258
+ }
259
+ }
260
+ //# sourceMappingURL=document.js.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Following somebody else's store: one event of the change stream applied to a document.
3
+ *
4
+ * This is the other half of the metadata API. A consumer fetches `/snapshot` once and then keeps up
5
+ * from `/events/sse`; re-fetching the snapshot on every rename would work and would be wrong on a
6
+ * box with four hundred channels and a user dragging rooms around.
7
+ *
8
+ * The rule that makes it safe is the revision. Every event carries the one it produced, and a
9
+ * document only ever moves **forward by exactly one**: an event that skips a revision means one was
10
+ * missed, and the only honest answer to that is `'resync'` - fetch the snapshot again. Guessing
11
+ * would leave a consumer subtly out of step with the box, which is the failure nobody notices until
12
+ * a name is wrong in one application and right in the other.
13
+ */
14
+ import type { MetaDocument, MetaEvent } from './types.js';
15
+ /** What {@link applyEvent} answers: the next document, or "fetch the snapshot again". */
16
+ export type FollowResult = MetaDocument | 'resync';
17
+ /**
18
+ * One event applied.
19
+ *
20
+ * `'resync'` for an `import` (the whole store was replaced), an explicit `resync`, a revision that
21
+ * is not the next one, and any event this implementation cannot make sense of - a store that is
22
+ * unsure is a store that re-reads, never one that carries on.
23
+ */
24
+ export declare function applyEvent(document: MetaDocument, event: MetaEvent): FollowResult;
25
+ /** Every event of a replay, stopping at the first one that needs a snapshot. */
26
+ export declare function applyEvents(document: MetaDocument, events: readonly MetaEvent[]): FollowResult;
27
+ //# sourceMappingURL=follow.d.ts.map
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Following somebody else's store: one event of the change stream applied to a document.
3
+ *
4
+ * This is the other half of the metadata API. A consumer fetches `/snapshot` once and then keeps up
5
+ * from `/events/sse`; re-fetching the snapshot on every rename would work and would be wrong on a
6
+ * box with four hundred channels and a user dragging rooms around.
7
+ *
8
+ * The rule that makes it safe is the revision. Every event carries the one it produced, and a
9
+ * document only ever moves **forward by exactly one**: an event that skips a revision means one was
10
+ * missed, and the only honest answer to that is `'resync'` - fetch the snapshot again. Guessing
11
+ * would leave a consumer subtly out of step with the box, which is the failure nobody notices until
12
+ * a name is wrong in one application and right in the other.
13
+ */
14
+ import { findNode, parsePath, pathMatches } from './paths.js';
15
+ import { insertAt, removeAt } from './tree.js';
16
+ /**
17
+ * One event applied.
18
+ *
19
+ * `'resync'` for an `import` (the whole store was replaced), an explicit `resync`, a revision that
20
+ * is not the next one, and any event this implementation cannot make sense of - a store that is
21
+ * unsure is a store that re-reads, never one that carries on.
22
+ */
23
+ export function applyEvent(document, event) {
24
+ if (event.kind === 'resync' || event.kind === 'import') {
25
+ return 'resync';
26
+ }
27
+ if (event.revision <= document.revision) {
28
+ // an event we have already seen - a replay after a reconnect. Nothing to do, and certainly
29
+ // not a resync: `?since=` is allowed to hand us the same event twice.
30
+ return document;
31
+ }
32
+ if (event.revision !== document.revision + 1) {
33
+ return 'resync';
34
+ }
35
+ const next = applyChange(document, event);
36
+ return next === undefined ? 'resync' : { ...next, revision: event.revision };
37
+ }
38
+ /** Every event of a replay, stopping at the first one that needs a snapshot. */
39
+ export function applyEvents(document, events) {
40
+ let current = document;
41
+ for (const event of events) {
42
+ const next = applyEvent(current, event);
43
+ if (next === 'resync') {
44
+ return 'resync';
45
+ }
46
+ current = next;
47
+ }
48
+ return current;
49
+ }
50
+ function applyChange(document, event) {
51
+ switch (event.kind) {
52
+ case 'object.updated': {
53
+ if (event.ref === undefined || event.value === undefined) {
54
+ return undefined;
55
+ }
56
+ return { ...document, objects: { ...document.objects, [event.ref]: event.value } };
57
+ }
58
+ case 'object.deleted': {
59
+ if (event.ref === undefined) {
60
+ return undefined;
61
+ }
62
+ const objects = { ...document.objects };
63
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- the key is a ref
64
+ delete objects[event.ref];
65
+ return { ...document, objects };
66
+ }
67
+ case 'enum.created':
68
+ case 'enum.updated': {
69
+ if (event.enum === undefined || event.value === undefined) {
70
+ return undefined;
71
+ }
72
+ return { ...document, enums: { ...document.enums, [event.enum]: event.value } };
73
+ }
74
+ case 'enum.deleted': {
75
+ if (event.enum === undefined) {
76
+ return undefined;
77
+ }
78
+ const enums = { ...document.enums };
79
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete -- the key is an enum id
80
+ delete enums[event.enum];
81
+ return detach({ ...document, enums }, [event.enum]);
82
+ }
83
+ case 'node.created': {
84
+ const target = parsePath(event.path ?? '');
85
+ const definition = document.enums[target?.enumId ?? ''];
86
+ if (!target || !definition || event.value === undefined) {
87
+ return undefined;
88
+ }
89
+ const parentIds = target.ids.slice(0, -1);
90
+ if (parentIds.length > 0 && !findNode(definition.tree, parentIds)) {
91
+ // the parent is not in our copy of the tree, so this consumer is already out of
92
+ // step; inserting nowhere would leave it there silently
93
+ return undefined;
94
+ }
95
+ const tree = insertAt(definition.tree, parentIds, event.value);
96
+ return withEnum(document, target.enumId, { name: definition.name, tree });
97
+ }
98
+ case 'node.updated': {
99
+ const target = parsePath(event.path ?? '');
100
+ const definition = document.enums[target?.enumId ?? ''];
101
+ if (!target || !definition || event.value === undefined) {
102
+ return undefined;
103
+ }
104
+ const current = findNode(definition.tree, target.ids);
105
+ if (!current) {
106
+ // an update of a node we do not have: same story, and `'resync'` is the only honest
107
+ // answer to it
108
+ return undefined;
109
+ }
110
+ const updated = event.value;
111
+ // the event carries the node without its subtree; keeping the children we have is what
112
+ // makes a rename a rename and not a delete of everything below it
113
+ const node = {
114
+ ...updated,
115
+ ...(current.children === undefined ? {} : { children: current.children }),
116
+ };
117
+ const parentIds = target.ids.slice(0, -1);
118
+ const position = indexOf(definition.tree, target.ids);
119
+ const tree = insertAt(removeAt(definition.tree, target.ids), parentIds, node, position);
120
+ return withEnum(document, target.enumId, { name: definition.name, tree });
121
+ }
122
+ case 'node.deleted': {
123
+ const target = parsePath(event.path ?? '');
124
+ const definition = document.enums[target?.enumId ?? ''];
125
+ if (!target || !definition) {
126
+ return undefined;
127
+ }
128
+ if (!findNode(definition.tree, target.ids)) {
129
+ return undefined;
130
+ }
131
+ const tree = removeAt(definition.tree, target.ids);
132
+ return detach(withEnum(document, target.enumId, { name: definition.name, tree }), [event.path ?? '']);
133
+ }
134
+ case 'node.moved': {
135
+ const from = parsePath(event.from ?? '');
136
+ const to = parsePath(event.to ?? '');
137
+ const definition = document.enums[from?.enumId ?? ''];
138
+ if (!from || !to || !definition || from.enumId !== to.enumId) {
139
+ return undefined;
140
+ }
141
+ const node = findNode(definition.tree, from.ids);
142
+ if (!node) {
143
+ return undefined;
144
+ }
145
+ const tree = insertAt(removeAt(definition.tree, from.ids), to.ids.slice(0, -1), node);
146
+ return rewrite(withEnum(document, from.enumId, { name: definition.name, tree }), event.from ?? '', event.to ?? '');
147
+ }
148
+ default:
149
+ return undefined;
150
+ }
151
+ }
152
+ function indexOf(tree, ids) {
153
+ const parentIds = ids.slice(0, -1);
154
+ const id = ids[ids.length - 1];
155
+ const siblings = parentIds.length === 0 ? tree : (findNode(tree, parentIds)?.children ?? []);
156
+ const index = siblings.findIndex((node) => node.id === id);
157
+ return index === -1 ? undefined : index;
158
+ }
159
+ function withEnum(document, id, definition) {
160
+ return { ...document, enums: { ...document.enums, [id]: definition } };
161
+ }
162
+ /** Member paths of a subtree that is gone; the box removed them in the same revision. */
163
+ function detach(document, targets) {
164
+ const objects = {};
165
+ for (const [ref, object] of Object.entries(document.objects)) {
166
+ const enums = object.enums.filter((path) => !targets.some((target) => pathMatches(path, target)));
167
+ objects[ref] = enums.length === object.enums.length ? object : { ...object, enums };
168
+ }
169
+ return { ...document, objects };
170
+ }
171
+ /** Member paths of a subtree that moved; likewise part of the move's own revision. */
172
+ function rewrite(document, from, to) {
173
+ const objects = {};
174
+ for (const [ref, object] of Object.entries(document.objects)) {
175
+ const enums = object.enums.map((path) => (pathMatches(path, from) ? `${to}${path.slice(from.length)}` : path));
176
+ objects[ref] = { ...object, enums };
177
+ }
178
+ return { ...document, objects };
179
+ }
180
+ //# sourceMappingURL=follow.js.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The metadata model of openccu-lite (their D-16), in one place.
3
+ *
4
+ * `types` is the format, `paths` its small rules, `document` the validator, `store` every operation
5
+ * of the API with its revisions, and `view` the way from a tree to the arrays of names every
6
+ * consumer downstream has always been given.
7
+ */
8
+ export * from './types.js';
9
+ export * from './paths.js';
10
+ export * from './document.js';
11
+ export * from './store.js';
12
+ export * from './view.js';
13
+ export * from './tree.js';
14
+ export * from './slug.js';
15
+ export * from './follow.js';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The metadata model of openccu-lite (their D-16), in one place.
3
+ *
4
+ * `types` is the format, `paths` its small rules, `document` the validator, `store` every operation
5
+ * of the API with its revisions, and `view` the way from a tree to the arrays of names every
6
+ * consumer downstream has always been given.
7
+ */
8
+ export * from './types.js';
9
+ export * from './paths.js';
10
+ export * from './document.js';
11
+ export * from './store.js';
12
+ export * from './view.js';
13
+ export * from './tree.js';
14
+ export * from './slug.js';
15
+ export * from './follow.js';
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Refs, ids, names and node paths of the metadata store - the small rules the whole format rests on.
3
+ *
4
+ * They are separate from `store.ts` because both the store and the UI need them: the grid has to
5
+ * turn `room/eg/wohnzimmer` into "Wohnzimmer", and a dialog has to know that a node id may not
6
+ * contain a slash before it lets somebody type one.
7
+ */
8
+ import { type MetaEnum, type MetaNode } from './types.js';
9
+ /** A ref split into its two halves. */
10
+ export interface MetaRef {
11
+ readonly interfaceName: string;
12
+ readonly address: string;
13
+ }
14
+ /**
15
+ * `<interface>.<address>` split at the **first** dot, or `undefined`.
16
+ *
17
+ * The interface name never contains a dot; the address may (it does not today, but the rule is the
18
+ * separator, not the shape of what follows it). `BidCos-RF.JEQ0230153:1` is a channel,
19
+ * `BidCos-RF.JEQ0230153` the device it belongs to.
20
+ */
21
+ export declare function parseRef(ref: string): MetaRef | undefined;
22
+ /** The ref of an address on an interface. The inverse of {@link parseRef}. */
23
+ export declare function makeRef(interfaceName: string, address: string): string;
24
+ /** Is this a ref the store accepts? */
25
+ export declare function isValidRef(ref: string): boolean;
26
+ /** Throws `invalid-ref` when it is not. */
27
+ export declare function requireRef(ref: string): MetaRef;
28
+ /** Enum id, node id or `meta` namespace: `[a-z0-9][a-z0-9-]*`, at most 32 characters. */
29
+ export declare function isValidId(id: string): boolean;
30
+ /** Throws `invalid-id` when it is not. */
31
+ export declare function requireId(id: string): string;
32
+ /** Icons are optional and lax; an unknown name is ignored by the UI, not an error. */
33
+ export declare function isValidIcon(icon: string): boolean;
34
+ /**
35
+ * The name as it will be stored: trimmed.
36
+ *
37
+ * Empty after trimming, longer than 255 bytes or carrying a line break is `invalid-name`. The trim
38
+ * is why `" Heizung Bad "` written over `"Heizung Bad"` is not a change and does not bump the
39
+ * revision - the corpus checks exactly that.
40
+ */
41
+ export declare function normaliseName(name: unknown): string;
42
+ /**
43
+ * Bytes of UTF-8 in a string.
44
+ *
45
+ * `TextEncoder` rather than `Buffer.byteLength`: this package runs in the browser as well as in
46
+ * Node, and the byte limits of the format are a rule about UTF-8, not about a Node API.
47
+ */
48
+ export declare function byteLength(value: string): number;
49
+ /** A node path split into the enum it belongs to and the ids below it. */
50
+ export interface MetaPath {
51
+ readonly enumId: string;
52
+ readonly ids: readonly string[];
53
+ }
54
+ /**
55
+ * `room/eg/wohnzimmer` → `{enumId: 'room', ids: ['eg', 'wohnzimmer']}`.
56
+ *
57
+ * `room` alone is a valid *query* target (everything in any room) but never a membership target -
58
+ * an object belongs to nodes, not to enums. The caller decides which of the two it wants; this
59
+ * only splits.
60
+ */
61
+ export declare function parsePath(path: string): MetaPath | undefined;
62
+ /** The path of a node under a parent path. */
63
+ export declare function childPath(parent: string, id: string): string;
64
+ /**
65
+ * The path without its last segment, or `undefined` when there is nothing to strip.
66
+ *
67
+ * For a root node (`room/eg`) that is the enum id (`room`), which is not a node path - the caller
68
+ * that moves a node treats "the parent is the bare enum id" as "move to the root".
69
+ */
70
+ export declare function parentPath(path: string): string | undefined;
71
+ /** Is `path` the node `target` or anything below it? The subtree rule of a membership query. */
72
+ export declare function pathMatches(path: string, target: string): boolean;
73
+ /** The node a path addresses inside one enum's tree, or `undefined`. */
74
+ export declare function findNode(tree: readonly MetaNode[], ids: readonly string[]): MetaNode | undefined;
75
+ /** One entry of a flattened tree: the path, the node and how deep it sits. */
76
+ export interface FlatNode {
77
+ readonly path: string;
78
+ readonly node: MetaNode;
79
+ readonly depth: number;
80
+ /** The names from the root down to and including this node. */
81
+ readonly trail: readonly string[];
82
+ }
83
+ /**
84
+ * Every node of one enum, depth first, in display order.
85
+ *
86
+ * This is what turns a tree into the flat things a UI needs: a select with indented entries, the
87
+ * "all rooms" list, and the check that a path exists at all.
88
+ */
89
+ export declare function flattenEnum(enumId: string, definition: MetaEnum): FlatNode[];
90
+ /** Every path of one enum, as a set - the cheap way to check membership targets in bulk. */
91
+ export declare function enumPaths(enumId: string, definition: MetaEnum): Set<string>;
92
+ /** The deepest level any node of this tree sits at; `0` for an empty tree. */
93
+ export declare function treeDepth(tree: readonly MetaNode[]): number;
94
+ /** Throws `too-deep` when a tree is deeper than the eight levels the format allows. */
95
+ export declare function requireDepth(tree: readonly MetaNode[]): void;
96
+ //# sourceMappingURL=paths.d.ts.map