matterbridge 3.4.0 → 3.4.1-dev-20251127-826b2bf

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/CHANGELOG.md +128 -112
  2. package/README-DEV.md +2 -2
  3. package/README-DOCKER.md +1 -1
  4. package/README-MACOS-PLIST.md +1 -1
  5. package/README-NGINX.md +1 -1
  6. package/README-PODMAN.md +1 -1
  7. package/README-SERVICE-LOCAL.md +1 -1
  8. package/README-SERVICE-OPT.md +6 -1
  9. package/README-SERVICE.md +1 -1
  10. package/README.md +57 -49
  11. package/dist/broadcastServer.js +1 -93
  12. package/dist/broadcastServerTypes.js +0 -24
  13. package/dist/cli.js +1 -97
  14. package/dist/cliEmitter.js +0 -37
  15. package/dist/cliHistory.js +0 -38
  16. package/dist/clusters/export.js +0 -2
  17. package/dist/defaultConfigSchema.js +0 -24
  18. package/dist/deviceManager.js +1 -113
  19. package/dist/devices/airConditioner.js +0 -57
  20. package/dist/devices/batteryStorage.js +1 -48
  21. package/dist/devices/cooktop.js +0 -56
  22. package/dist/devices/dishwasher.js +0 -57
  23. package/dist/devices/evse.js +10 -74
  24. package/dist/devices/export.js +0 -5
  25. package/dist/devices/extractorHood.js +0 -43
  26. package/dist/devices/heatPump.js +2 -50
  27. package/dist/devices/laundryDryer.js +3 -62
  28. package/dist/devices/laundryWasher.js +4 -70
  29. package/dist/devices/microwaveOven.js +5 -88
  30. package/dist/devices/oven.js +0 -85
  31. package/dist/devices/refrigerator.js +0 -102
  32. package/dist/devices/roboticVacuumCleaner.js +9 -100
  33. package/dist/devices/solarPower.js +0 -38
  34. package/dist/devices/speaker.js +0 -84
  35. package/dist/devices/temperatureControl.js +3 -24
  36. package/dist/devices/waterHeater.js +2 -82
  37. package/dist/dgram/coap.js +13 -126
  38. package/dist/dgram/dgram.js +2 -114
  39. package/dist/dgram/mb_coap.js +3 -41
  40. package/dist/dgram/mb_mdns.js +15 -80
  41. package/dist/dgram/mdns.js +137 -299
  42. package/dist/dgram/multicast.js +1 -62
  43. package/dist/dgram/unicast.js +0 -54
  44. package/dist/frontend.js +35 -455
  45. package/dist/frontendTypes.js +0 -45
  46. package/dist/helpers.js +0 -53
  47. package/dist/index.js +0 -25
  48. package/dist/jestutils/export.js +0 -1
  49. package/dist/jestutils/jestHelpers.js +13 -352
  50. package/dist/logger/export.js +0 -1
  51. package/dist/matter/behaviors.js +0 -2
  52. package/dist/matter/clusters.js +0 -2
  53. package/dist/matter/devices.js +0 -2
  54. package/dist/matter/endpoints.js +0 -2
  55. package/dist/matter/export.js +0 -3
  56. package/dist/matter/types.js +0 -3
  57. package/dist/matterNode.js +8 -369
  58. package/dist/matterbridge.js +74 -788
  59. package/dist/matterbridgeAccessoryPlatform.js +0 -38
  60. package/dist/matterbridgeBehaviors.js +5 -68
  61. package/dist/matterbridgeDeviceTypes.js +14 -635
  62. package/dist/matterbridgeDynamicPlatform.js +0 -38
  63. package/dist/matterbridgeEndpoint.js +53 -1444
  64. package/dist/matterbridgeEndpointHelpers.js +20 -483
  65. package/dist/matterbridgeEndpointTypes.js +0 -25
  66. package/dist/matterbridgePlatform.js +2 -460
  67. package/dist/matterbridgeTypes.js +0 -26
  68. package/dist/pluginManager.js +5 -340
  69. package/dist/shelly.js +7 -168
  70. package/dist/storage/export.js +0 -1
  71. package/dist/update.js +0 -69
  72. package/dist/utils/colorUtils.js +2 -97
  73. package/dist/utils/commandLine.js +0 -60
  74. package/dist/utils/copyDirectory.js +0 -37
  75. package/dist/utils/createDirectory.js +0 -33
  76. package/dist/utils/createZip.js +2 -47
  77. package/dist/utils/deepCopy.js +0 -39
  78. package/dist/utils/deepEqual.js +1 -72
  79. package/dist/utils/error.js +0 -41
  80. package/dist/utils/export.js +0 -1
  81. package/dist/utils/format.js +0 -49
  82. package/dist/utils/hex.js +0 -124
  83. package/dist/utils/inspector.js +1 -69
  84. package/dist/utils/isvalid.js +0 -101
  85. package/dist/utils/network.js +5 -96
  86. package/dist/utils/spawn.js +1 -71
  87. package/dist/utils/tracker.js +1 -64
  88. package/dist/utils/wait.js +8 -60
  89. package/frontend/build/assets/index.js +4 -4
  90. package/frontend/build/assets/vendor_mui.js +1 -1
  91. package/frontend/build/assets/vendor_node_modules.js +19 -83
  92. package/frontend/build/assets/vendor_qrcode.js +1 -9
  93. package/frontend/build/assets/vendor_rjsf.js +1 -9
  94. package/frontend/package-lock.json +229 -439
  95. package/frontend/package.json +15 -15
  96. package/marked.ps1 +15 -0
  97. package/npm-shrinkwrap.json +165 -231
  98. package/package.json +2 -3
  99. package/dist/broadcastServer.d.ts +0 -115
  100. package/dist/broadcastServer.d.ts.map +0 -1
  101. package/dist/broadcastServer.js.map +0 -1
  102. package/dist/broadcastServerTypes.d.ts +0 -838
  103. package/dist/broadcastServerTypes.d.ts.map +0 -1
  104. package/dist/broadcastServerTypes.js.map +0 -1
  105. package/dist/cli.d.ts +0 -30
  106. package/dist/cli.d.ts.map +0 -1
  107. package/dist/cli.js.map +0 -1
  108. package/dist/cliEmitter.d.ts +0 -50
  109. package/dist/cliEmitter.d.ts.map +0 -1
  110. package/dist/cliEmitter.js.map +0 -1
  111. package/dist/cliHistory.d.ts +0 -48
  112. package/dist/cliHistory.d.ts.map +0 -1
  113. package/dist/cliHistory.js.map +0 -1
  114. package/dist/clusters/export.d.ts +0 -2
  115. package/dist/clusters/export.d.ts.map +0 -1
  116. package/dist/clusters/export.js.map +0 -1
  117. package/dist/defaultConfigSchema.d.ts +0 -28
  118. package/dist/defaultConfigSchema.d.ts.map +0 -1
  119. package/dist/defaultConfigSchema.js.map +0 -1
  120. package/dist/deviceManager.d.ts +0 -135
  121. package/dist/deviceManager.d.ts.map +0 -1
  122. package/dist/deviceManager.js.map +0 -1
  123. package/dist/devices/airConditioner.d.ts +0 -98
  124. package/dist/devices/airConditioner.d.ts.map +0 -1
  125. package/dist/devices/airConditioner.js.map +0 -1
  126. package/dist/devices/batteryStorage.d.ts +0 -48
  127. package/dist/devices/batteryStorage.d.ts.map +0 -1
  128. package/dist/devices/batteryStorage.js.map +0 -1
  129. package/dist/devices/cooktop.d.ts +0 -61
  130. package/dist/devices/cooktop.d.ts.map +0 -1
  131. package/dist/devices/cooktop.js.map +0 -1
  132. package/dist/devices/dishwasher.d.ts +0 -71
  133. package/dist/devices/dishwasher.d.ts.map +0 -1
  134. package/dist/devices/dishwasher.js.map +0 -1
  135. package/dist/devices/evse.d.ts +0 -76
  136. package/dist/devices/evse.d.ts.map +0 -1
  137. package/dist/devices/evse.js.map +0 -1
  138. package/dist/devices/export.d.ts +0 -17
  139. package/dist/devices/export.d.ts.map +0 -1
  140. package/dist/devices/export.js.map +0 -1
  141. package/dist/devices/extractorHood.d.ts +0 -46
  142. package/dist/devices/extractorHood.d.ts.map +0 -1
  143. package/dist/devices/extractorHood.js.map +0 -1
  144. package/dist/devices/heatPump.d.ts +0 -47
  145. package/dist/devices/heatPump.d.ts.map +0 -1
  146. package/dist/devices/heatPump.js.map +0 -1
  147. package/dist/devices/laundryDryer.d.ts +0 -67
  148. package/dist/devices/laundryDryer.d.ts.map +0 -1
  149. package/dist/devices/laundryDryer.js.map +0 -1
  150. package/dist/devices/laundryWasher.d.ts +0 -81
  151. package/dist/devices/laundryWasher.d.ts.map +0 -1
  152. package/dist/devices/laundryWasher.js.map +0 -1
  153. package/dist/devices/microwaveOven.d.ts +0 -168
  154. package/dist/devices/microwaveOven.d.ts.map +0 -1
  155. package/dist/devices/microwaveOven.js.map +0 -1
  156. package/dist/devices/oven.d.ts +0 -105
  157. package/dist/devices/oven.d.ts.map +0 -1
  158. package/dist/devices/oven.js.map +0 -1
  159. package/dist/devices/refrigerator.d.ts +0 -118
  160. package/dist/devices/refrigerator.d.ts.map +0 -1
  161. package/dist/devices/refrigerator.js.map +0 -1
  162. package/dist/devices/roboticVacuumCleaner.d.ts +0 -112
  163. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  164. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  165. package/dist/devices/solarPower.d.ts +0 -40
  166. package/dist/devices/solarPower.d.ts.map +0 -1
  167. package/dist/devices/solarPower.js.map +0 -1
  168. package/dist/devices/speaker.d.ts +0 -87
  169. package/dist/devices/speaker.d.ts.map +0 -1
  170. package/dist/devices/speaker.js.map +0 -1
  171. package/dist/devices/temperatureControl.d.ts +0 -166
  172. package/dist/devices/temperatureControl.d.ts.map +0 -1
  173. package/dist/devices/temperatureControl.js.map +0 -1
  174. package/dist/devices/waterHeater.d.ts +0 -111
  175. package/dist/devices/waterHeater.d.ts.map +0 -1
  176. package/dist/devices/waterHeater.js.map +0 -1
  177. package/dist/dgram/coap.d.ts +0 -205
  178. package/dist/dgram/coap.d.ts.map +0 -1
  179. package/dist/dgram/coap.js.map +0 -1
  180. package/dist/dgram/dgram.d.ts +0 -141
  181. package/dist/dgram/dgram.d.ts.map +0 -1
  182. package/dist/dgram/dgram.js.map +0 -1
  183. package/dist/dgram/mb_coap.d.ts +0 -24
  184. package/dist/dgram/mb_coap.d.ts.map +0 -1
  185. package/dist/dgram/mb_coap.js.map +0 -1
  186. package/dist/dgram/mb_mdns.d.ts +0 -24
  187. package/dist/dgram/mb_mdns.d.ts.map +0 -1
  188. package/dist/dgram/mb_mdns.js.map +0 -1
  189. package/dist/dgram/mdns.d.ts +0 -290
  190. package/dist/dgram/mdns.d.ts.map +0 -1
  191. package/dist/dgram/mdns.js.map +0 -1
  192. package/dist/dgram/multicast.d.ts +0 -67
  193. package/dist/dgram/multicast.d.ts.map +0 -1
  194. package/dist/dgram/multicast.js.map +0 -1
  195. package/dist/dgram/unicast.d.ts +0 -56
  196. package/dist/dgram/unicast.d.ts.map +0 -1
  197. package/dist/dgram/unicast.js.map +0 -1
  198. package/dist/frontend.d.ts +0 -238
  199. package/dist/frontend.d.ts.map +0 -1
  200. package/dist/frontend.js.map +0 -1
  201. package/dist/frontendTypes.d.ts +0 -529
  202. package/dist/frontendTypes.d.ts.map +0 -1
  203. package/dist/frontendTypes.js.map +0 -1
  204. package/dist/helpers.d.ts +0 -48
  205. package/dist/helpers.d.ts.map +0 -1
  206. package/dist/helpers.js.map +0 -1
  207. package/dist/index.d.ts +0 -34
  208. package/dist/index.d.ts.map +0 -1
  209. package/dist/index.js.map +0 -1
  210. package/dist/jestutils/export.d.ts +0 -2
  211. package/dist/jestutils/export.d.ts.map +0 -1
  212. package/dist/jestutils/export.js.map +0 -1
  213. package/dist/jestutils/jestHelpers.d.ts +0 -303
  214. package/dist/jestutils/jestHelpers.d.ts.map +0 -1
  215. package/dist/jestutils/jestHelpers.js.map +0 -1
  216. package/dist/logger/export.d.ts +0 -2
  217. package/dist/logger/export.d.ts.map +0 -1
  218. package/dist/logger/export.js.map +0 -1
  219. package/dist/matter/behaviors.d.ts +0 -2
  220. package/dist/matter/behaviors.d.ts.map +0 -1
  221. package/dist/matter/behaviors.js.map +0 -1
  222. package/dist/matter/clusters.d.ts +0 -2
  223. package/dist/matter/clusters.d.ts.map +0 -1
  224. package/dist/matter/clusters.js.map +0 -1
  225. package/dist/matter/devices.d.ts +0 -2
  226. package/dist/matter/devices.d.ts.map +0 -1
  227. package/dist/matter/devices.js.map +0 -1
  228. package/dist/matter/endpoints.d.ts +0 -2
  229. package/dist/matter/endpoints.d.ts.map +0 -1
  230. package/dist/matter/endpoints.js.map +0 -1
  231. package/dist/matter/export.d.ts +0 -5
  232. package/dist/matter/export.d.ts.map +0 -1
  233. package/dist/matter/export.js.map +0 -1
  234. package/dist/matter/types.d.ts +0 -3
  235. package/dist/matter/types.d.ts.map +0 -1
  236. package/dist/matter/types.js.map +0 -1
  237. package/dist/matterNode.d.ts +0 -342
  238. package/dist/matterNode.d.ts.map +0 -1
  239. package/dist/matterNode.js.map +0 -1
  240. package/dist/matterbridge.d.ts +0 -473
  241. package/dist/matterbridge.d.ts.map +0 -1
  242. package/dist/matterbridge.js.map +0 -1
  243. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -41
  244. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  245. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  246. package/dist/matterbridgeBehaviors.d.ts +0 -2404
  247. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  248. package/dist/matterbridgeBehaviors.js.map +0 -1
  249. package/dist/matterbridgeDeviceTypes.d.ts +0 -698
  250. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  251. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  252. package/dist/matterbridgeDynamicPlatform.d.ts +0 -41
  253. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  254. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  255. package/dist/matterbridgeEndpoint.d.ts +0 -1507
  256. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  257. package/dist/matterbridgeEndpoint.js.map +0 -1
  258. package/dist/matterbridgeEndpointHelpers.d.ts +0 -787
  259. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  260. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  261. package/dist/matterbridgeEndpointTypes.d.ts +0 -166
  262. package/dist/matterbridgeEndpointTypes.d.ts.map +0 -1
  263. package/dist/matterbridgeEndpointTypes.js.map +0 -1
  264. package/dist/matterbridgePlatform.d.ts +0 -524
  265. package/dist/matterbridgePlatform.d.ts.map +0 -1
  266. package/dist/matterbridgePlatform.js.map +0 -1
  267. package/dist/matterbridgeTypes.d.ts +0 -251
  268. package/dist/matterbridgeTypes.d.ts.map +0 -1
  269. package/dist/matterbridgeTypes.js.map +0 -1
  270. package/dist/pluginManager.d.ts +0 -371
  271. package/dist/pluginManager.d.ts.map +0 -1
  272. package/dist/pluginManager.js.map +0 -1
  273. package/dist/shelly.d.ts +0 -174
  274. package/dist/shelly.d.ts.map +0 -1
  275. package/dist/shelly.js.map +0 -1
  276. package/dist/storage/export.d.ts +0 -2
  277. package/dist/storage/export.d.ts.map +0 -1
  278. package/dist/storage/export.js.map +0 -1
  279. package/dist/update.d.ts +0 -75
  280. package/dist/update.d.ts.map +0 -1
  281. package/dist/update.js.map +0 -1
  282. package/dist/utils/colorUtils.d.ts +0 -101
  283. package/dist/utils/colorUtils.d.ts.map +0 -1
  284. package/dist/utils/colorUtils.js.map +0 -1
  285. package/dist/utils/commandLine.d.ts +0 -66
  286. package/dist/utils/commandLine.d.ts.map +0 -1
  287. package/dist/utils/commandLine.js.map +0 -1
  288. package/dist/utils/copyDirectory.d.ts +0 -35
  289. package/dist/utils/copyDirectory.d.ts.map +0 -1
  290. package/dist/utils/copyDirectory.js.map +0 -1
  291. package/dist/utils/createDirectory.d.ts +0 -34
  292. package/dist/utils/createDirectory.d.ts.map +0 -1
  293. package/dist/utils/createDirectory.js.map +0 -1
  294. package/dist/utils/createZip.d.ts +0 -39
  295. package/dist/utils/createZip.d.ts.map +0 -1
  296. package/dist/utils/createZip.js.map +0 -1
  297. package/dist/utils/deepCopy.d.ts +0 -32
  298. package/dist/utils/deepCopy.d.ts.map +0 -1
  299. package/dist/utils/deepCopy.js.map +0 -1
  300. package/dist/utils/deepEqual.d.ts +0 -54
  301. package/dist/utils/deepEqual.d.ts.map +0 -1
  302. package/dist/utils/deepEqual.js.map +0 -1
  303. package/dist/utils/error.d.ts +0 -44
  304. package/dist/utils/error.d.ts.map +0 -1
  305. package/dist/utils/error.js.map +0 -1
  306. package/dist/utils/export.d.ts +0 -13
  307. package/dist/utils/export.d.ts.map +0 -1
  308. package/dist/utils/export.js.map +0 -1
  309. package/dist/utils/format.d.ts +0 -53
  310. package/dist/utils/format.d.ts.map +0 -1
  311. package/dist/utils/format.js.map +0 -1
  312. package/dist/utils/hex.d.ts +0 -89
  313. package/dist/utils/hex.d.ts.map +0 -1
  314. package/dist/utils/hex.js.map +0 -1
  315. package/dist/utils/inspector.d.ts +0 -87
  316. package/dist/utils/inspector.d.ts.map +0 -1
  317. package/dist/utils/inspector.js.map +0 -1
  318. package/dist/utils/isvalid.d.ts +0 -103
  319. package/dist/utils/isvalid.d.ts.map +0 -1
  320. package/dist/utils/isvalid.js.map +0 -1
  321. package/dist/utils/network.d.ts +0 -111
  322. package/dist/utils/network.d.ts.map +0 -1
  323. package/dist/utils/network.js.map +0 -1
  324. package/dist/utils/spawn.d.ts +0 -33
  325. package/dist/utils/spawn.d.ts.map +0 -1
  326. package/dist/utils/spawn.js.map +0 -1
  327. package/dist/utils/tracker.d.ts +0 -108
  328. package/dist/utils/tracker.d.ts.map +0 -1
  329. package/dist/utils/tracker.js.map +0 -1
  330. package/dist/utils/wait.d.ts +0 -54
  331. package/dist/utils/wait.d.ts.map +0 -1
  332. package/dist/utils/wait.js.map +0 -1
package/README-DEV.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge development
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge development
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
@@ -22,7 +22,7 @@ The easiest way is to clone the [Matterbridge Plugin Template](https://github.co
22
22
 
23
23
  After you clone it locally, change the name (keep always matterbridge- at the beginning of the name), version, description, author, homepage, repository, bugs and funding in the package.json.
24
24
 
25
- It is also possible to add two custom properties to the package.json: **help** and **changelog** with a url that will be used in the frontend instead of the default (/blob/main/README.md and /blob/main/CHANGELOG.md).
25
+ It is also possible to add two custom properties to the package.json: **help** and **changelog** with a url that will be used in the frontend instead of the default (/blob/main/README and /blob/main/CHANGELOG).
26
26
 
27
27
  Add your plugin logic in module.ts.
28
28
 
package/README-DOCKER.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge docker configuration
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge docker configuration
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge launchctl configuration (macOS)
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge launchctl configuration (macOS)
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
package/README-NGINX.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge NGINX configuration
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge NGINX configuration
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
package/README-PODMAN.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge Podman configuration
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge Podman configuration
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge systemd configuration with local global node_modules
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge systemd configuration with local global node_modules
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge systemd configuration with private global node_modules
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge systemd configuration with private global node_modules
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
@@ -22,8 +22,12 @@ The advantage of this setup is that the global node_modules are private for matt
22
22
 
23
23
  The service runs with group and user matterbridge and the system has full protection.
24
24
 
25
+ ### Important
26
+
25
27
  The storage position is **not compatible** with the traditional setup (~/Matterbridge ~/.matterbridge ~/.mattercert).
26
28
 
29
+ Also various script don't work if you choose this configuration.
30
+
27
31
  ### 1 - Create the matterbridge user and group
28
32
 
29
33
  ```bash
@@ -72,6 +76,7 @@ matterbridge --version
72
76
  The storage position is **not compatible** with the traditional setup (~/Matterbridge ~/.matterbridge ~/.mattercert).
73
77
 
74
78
  If you are migrating from the traditional service setup, before removing the old diretories, you may want to copy the contents of ~/Matterbridge ~/.matterbridge ~/.mattercert to the new directories /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert.
79
+ This will save all the plugin configs and the fabrics but you need to remove all plugins and readd them cause the path will be different.
75
80
 
76
81
  Copy the old diretories content
77
82
 
package/README-SERVICE.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge systemd configuration
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge systemd configuration
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="frontend/public/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge
1
+ # <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge Logo" width="64px" height="64px">&nbsp;&nbsp;&nbsp;Matterbridge
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
4
4
  [![npm downloads](https://img.shields.io/npm/dt/matterbridge.svg)](https://www.npmjs.com/package/matterbridge)
@@ -36,21 +36,21 @@ Matterbridge is lightweight and also runs on slow Linux machines with as little
36
36
 
37
37
  It runs perfectly on Linux, macOS and Windows.
38
38
 
39
- If you like this project and find it useful, please consider giving it a star on GitHub at https://github.com/Luligu/matterbridge and sponsoring it.
39
+ If you like this project and find it useful, please consider giving it a star on [GitHub](https://github.com/Luligu/matterbridge) and sponsoring it.
40
40
 
41
41
  <a href="https://www.buymeacoffee.com/luligugithub">
42
- <img src="bmc-button.svg" alt="Buy me a coffee" width="120">
42
+ <img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="120">
43
43
  </a>
44
44
 
45
45
  ## Acknowledgements
46
46
 
47
- The project is build on top of https://github.com/project-chip/matter.js.
47
+ The project is build on top of [matter.js](https://github.com/project-chip/matter.js).
48
48
 
49
49
  A special thanks to Apollon77 for his incredible work.
50
50
 
51
51
  ## Discord
52
52
 
53
- Join us in the Matterbridge Discord group https://discord.gg/QX58CDe6hd created by Tamer (https://github.com/tammeryousef1006).
53
+ Join us in the Matterbridge [Discord group](https://discord.gg/QX58CDe6hd) created by [Tamer](https://github.com/tammeryousef1006).
54
54
 
55
55
  ## Videos
56
56
 
@@ -75,7 +75,7 @@ The supported versions of node are 20 and 22. Please install Node.js 22 LTS. Don
75
75
  Node.js 23, like all odd-numbered versions, is not supported.
76
76
  Nvm is not a good choice and should not be used for production.
77
77
 
78
- If you don't have Docker already install, please use this method to install it on a debian device: https://docs.docker.com/desktop/setup/install/linux/debian/.
78
+ If you don't have Docker already install, please use this method to install it on a debian device: https://docs.docker.com/engine/install.
79
79
  After follow the guidelines for the [Docker configurations](README-DOCKER.md).
80
80
 
81
81
  I suggest using Docker for its simplicity.
@@ -108,7 +108,7 @@ Test the installation with:
108
108
  matterbridge
109
109
  ```
110
110
 
111
- Now it is possible to open the frontend at the link provided in the log (e.g. http://MATTERBRIDGE-IPV4-ADDRESS:8283).
111
+ Now it is possible to open the frontend at the link provided in the log (e.g. `http://MATTERBRIDGE-IPV4-ADDRESS:8283`).
112
112
 
113
113
  You can then change the bridge mode and other parameters from the frontend.
114
114
 
@@ -117,7 +117,7 @@ You can then change the bridge mode and other parameters from the frontend.
117
117
  ### mode bridge
118
118
 
119
119
  ```bash
120
- matterbridge -bridge
120
+ matterbridge --bridge
121
121
  ```
122
122
 
123
123
  This force Matterbridge to load in bridge mode.
@@ -127,46 +127,50 @@ Matterbridge only exposes itself, and you have to pair it scanning the QR code s
127
127
  ### mode childbridge
128
128
 
129
129
  ```bash
130
- matterbridge -childbridge
130
+ matterbridge --childbridge
131
131
  ```
132
132
 
133
133
  This force Matterbridge to load in childbridge mode.
134
134
 
135
135
  Matterbridge exposes each registered plugins, and you have to pair each one by scanning the QR code shown in the frontend or in the console.
136
136
 
137
- ### Use matterbridge -help to see the command line syntax
137
+ ### Use matterbridge --help to see the command line syntax
138
138
 
139
139
  ```bash
140
- matterbridge -help
140
+ matterbridge --help
141
+ ```
142
+
143
+ ### Use matterbridge --version to see the current version
144
+
145
+ ```bash
146
+ matterbridge --version
141
147
  ```
142
148
 
143
149
  ## Frontend
144
150
 
145
- Matterbridge has a frontend available on http://MATTERBIDGE-IPV4-ADDRESS:8283 and http://[MATTERBIDGE-IPV6-ADDRESS]:8283
151
+ Matterbridge has a frontend available on IPv4 `http://localhost:8283` or `http://MATTERBIDGE-IPV4-ADDRESS:8283` and IPv6 `http://[::1]:8283` or `http://[MATTERBIDGE-IPV6-ADDRESS]:8283`.
146
152
 
147
153
  You can change the default port by adding the frontend parameter when you run it.
148
154
 
149
155
  Here's how to specify a different port number:
150
156
 
151
157
  ```bash
152
- matterbridge -frontend [port number]
158
+ matterbridge --frontend [port number]
153
159
  ```
154
160
 
155
161
  To use the frontend with ssl see below.
156
162
 
157
163
  From the frontend you can do all operations in an easy way.
158
164
 
159
- Home page:
160
- ![See the screenshot here](screenshot/Screenshot%20home.jpg)
165
+ Home page
161
166
 
162
- Devices page:
163
- [See the screenshot here](screenshot/Screenshot%20devices.jpg)
167
+ ![Home page](./screenshot/Screenshot%20home.jpg)
164
168
 
165
- Logs page:
166
- [See the screenshot here](screenshot/Screenshot%20logs.jpg)
169
+ [Devices page](./screenshot/Screenshot%20devices.jpg)
167
170
 
168
- Config editor:
169
- [See the screenshot here](screenshot/Screenshot%20config%20editor.jpg)
171
+ [Logs page](./screenshot/Screenshot%20logs.jpg)
172
+
173
+ [Config editor](./screenshot/Screenshot%20config%20editor.jpg)
170
174
 
171
175
  ## Advanced configurations
172
176
 
@@ -180,6 +184,10 @@ or with local global node_modules (no sudo required)
180
184
 
181
185
  [Service configurations with local global node_modules](README-SERVICE-LOCAL.md)
182
186
 
187
+ or with user matterbridge and with private global node_modules (no sudo required)
188
+
189
+ [Service configurations with user matterbridge and private global node_modules](README-SERVICE-OPT.md)
190
+
183
191
  ### Run matterbridge as a system service with launchctl (macOS only)
184
192
 
185
193
  [Launchctl configurations](README-MACOS-PLIST.md)
@@ -213,7 +221,7 @@ The other Home Assistant Community Add-ons and plugins are not verified to work
213
221
  ### Shelly
214
222
 
215
223
  <a href="https://github.com/Luligu/matterbridge-shelly">
216
- <img src="screenshot/Shelly.svg" alt="Shelly plugin logo" width="100" />
224
+ <img src="./screenshot/Shelly.svg" alt="Shelly plugin logo" width="100" />
217
225
  </a>
218
226
 
219
227
  Matterbridge shelly plugin allows you to expose all Shelly Gen 1, Gen 2, Gen 3 and Gen 4 and BLU devices to Matter.
@@ -242,7 +250,7 @@ Features:
242
250
  ### Zigbee2MQTT
243
251
 
244
252
  <a href="https://github.com/Luligu/matterbridge-zigbee2mqtt">
245
- <img src="screenshot/Zigbee2MQTT.svg" alt="Zigbee2MQTT plugin logo" width="100" />
253
+ <img src="./screenshot/Zigbee2MQTT.svg" alt="Zigbee2MQTT plugin logo" width="100" />
246
254
  </a>
247
255
 
248
256
  Matterbridge zigbee2mqtt is a matterbridge production-level plugin that expose all zigbee2mqtt devices and groups to Matter.
@@ -252,7 +260,7 @@ No hub or dedicated hardware needed.
252
260
  ### Somfy tahoma
253
261
 
254
262
  <a href="https://github.com/Luligu/matterbridge-somfy-tahoma">
255
- <img src="screenshot/Somfy.svg" alt="Somfy plugin logo" width="100" />
263
+ <img src="./screenshot/Somfy.svg" alt="Somfy plugin logo" width="100" />
256
264
  </a>
257
265
 
258
266
  Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose the Somfy Tahoma screen devices to Matter.
@@ -260,17 +268,17 @@ Matterbridge Somfy Tahoma is a matterbridge production-level plugin that expose
260
268
  ### Home Assistant
261
269
 
262
270
  <a href="https://github.com/Luligu/matterbridge-hass">
263
- <img src="screenshot/HomeAssistant.svg" alt="Hass logo" width="100" />
271
+ <img src="./screenshot/HomeAssistant.svg" alt="Hass logo" width="100" />
264
272
  </a>
265
273
 
266
274
  Matterbridge Home Assistant plugin allows you to expose the Home Assistant devices and entities to Matter.
267
275
 
268
- It is the ideal companion of the official [Matterbridge Home Assistant Add-on](https://github.com/Luligu/matterbridge-home-assistant-addon/blob/main/README.md).
276
+ It is the ideal companion of the official [Matterbridge Home Assistant Add-on](https://github.com/Luligu/matterbridge-home-assistant-addon).
269
277
 
270
278
  ### Webhooks
271
279
 
272
280
  <a href="https://github.com/Luligu/matterbridge-webhooks">
273
- <img src="frontend/public/matterbridge.svg" alt="Matterbridge logo" width="100" />
281
+ <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge logo" width="100" />
274
282
  </a>
275
283
 
276
284
  Matterbridge Webhooks plugin allows you to expose any webhooks to Matter.
@@ -278,7 +286,7 @@ Matterbridge Webhooks plugin allows you to expose any webhooks to Matter.
278
286
  ### BTHome
279
287
 
280
288
  <a href="https://github.com/Luligu/matterbridge-webhooks">
281
- <img src="frontend/public/matterbridge.svg" alt="Matterbridge logo" width="100" />
289
+ <img src="https://matterbridge.io/matterbridge.svg" alt="Matterbridge logo" width="100" />
282
290
  </a>
283
291
 
284
292
  Matterbridge BTHome allows you to expose any BTHome device to Matter using the native bluetooth of the host machine.
@@ -370,58 +378,58 @@ On windows:
370
378
 
371
379
  ```powershell
372
380
  cd $HOME\Matterbridge
373
- npm install -g matterbridge-zigbee2mqtt
374
- matterbridge -add matterbridge-zigbee2mqtt
381
+ npm install -g matterbridge-zigbee2mqtt --omit=dev
382
+ matterbridge --add matterbridge-zigbee2mqtt
375
383
  ```
376
384
 
377
385
  On linux or macOS:
378
386
 
379
387
  ```bash
380
388
  cd ~/Matterbridge
381
- sudo npm install -g matterbridge-zigbee2mqtt
382
- matterbridge -add matterbridge-zigbee2mqtt
389
+ sudo npm install -g matterbridge-zigbee2mqtt --omit=dev
390
+ matterbridge --add matterbridge-zigbee2mqtt
383
391
  ```
384
392
 
385
393
  ## How to add a plugin to Matterbridge from a terminal
386
394
 
387
395
  ```bash
388
- matterbridge -add [plugin path or plugin name]
396
+ matterbridge --add [plugin path or plugin name]
389
397
  ```
390
398
 
391
399
  ## How to remove a plugin from Matterbridge from a terminal
392
400
 
393
401
  ```bash
394
- matterbridge -remove [plugin path or plugin name]
402
+ matterbridge --remove [plugin path or plugin name]
395
403
  ```
396
404
 
397
405
  ## How to disable a registered plugin from a terminal
398
406
 
399
407
  ```bash
400
- matterbridge -disable [plugin path or plugin name]
408
+ matterbridge --disable [plugin path or plugin name]
401
409
  ```
402
410
 
403
411
  ## How to enable a registered plugin from a terminal
404
412
 
405
413
  ```bash
406
- matterbridge -enable [plugin path or plugin name]
414
+ matterbridge --enable [plugin path or plugin name]
407
415
  ```
408
416
 
409
417
  ## How to remove the commissioning information for Matterbridge so you can pair it again (bridge mode). Shutdown Matterbridge before!
410
418
 
411
419
  ```bash
412
- matterbridge -reset
420
+ matterbridge --reset
413
421
  ```
414
422
 
415
423
  ## How to remove the commissioning information for a registered plugin so you can pair it again (childbridge mode). Shutdown Matterbridge before!
416
424
 
417
425
  ```bash
418
- matterbridge -reset [plugin path or plugin name]
426
+ matterbridge --reset [plugin path or plugin name]
419
427
  ```
420
428
 
421
429
  ## How to factory reset Matterbridge. Shutdown Matterbridge before!
422
430
 
423
431
  ```bash
424
- matterbridge -factoryreset
432
+ matterbridge --factoryreset
425
433
  ```
426
434
 
427
435
  This will reset the internal storages. All commissioning informations will be lost. All plugins will be unregistered.
@@ -438,7 +446,7 @@ Place your own certificates in the `.matterbridge/cert` directory:
438
446
  - `key.pem`
439
447
  - `ca.pem` (optional)
440
448
 
441
- ![image](screenshot/Screenshot%20Certificates.png)
449
+ ![image](./screenshot/Screenshot%20Certificates.png)
442
450
 
443
451
  Matterbridge looks first for .p12 certificate and if it is not found it looks for cert.pem and key.pem.
444
452
 
@@ -453,27 +461,27 @@ Matterbridge looks first for .p12 certificate and if it is not found it looks fo
453
461
 
454
462
  ### Change the command line
455
463
 
456
- Add the **-ssl** parameter to the command line.
464
+ Add the **--ssl** parameter to the command line.
457
465
 
458
466
  If desired, you can also change the frontend port with **-frontend 443**.
459
467
 
460
468
  ```bash
461
- matterbridge -ssl -frontend 443
469
+ matterbridge --ssl --frontend 443
462
470
  ```
463
471
 
464
- Add the **-mtls** parameter to the command line if you want Matterbridge to request the client (your browser) to authenticate itself (this is the most secure connection possible).
472
+ Add the **--mtls** parameter to the command line if you want Matterbridge to request the client (your browser) to authenticate itself (this is the most secure connection possible).
465
473
 
466
474
  The browser must provide the client certificate: on Windows you need to import it in Current User → Personal → Certificates with certmgr.msc.
467
475
 
468
476
  ```bash
469
- matterbridge -ssl -mtls -frontend 443
477
+ matterbridge --ssl --mtls --frontend 443
470
478
  ```
471
479
 
472
480
  ### Restart
473
481
 
474
482
  If the certificate are correctly configured, you will be able to connect with https to the frontend.
475
483
 
476
- ![image](screenshot/Screenshot%20Browser%20Secured.png)
484
+ ![image](./screenshot/Screenshot%20Browser%20Secured.png)
477
485
 
478
486
  ## How to send the debug log files
479
487
 
@@ -481,9 +489,9 @@ If the certificate are correctly configured, you will be able to connect with ht
481
489
 
482
490
  In the frontend, go to settings and enable debug mode as shown below:
483
491
 
484
- ![Debug Matterbridge Settings](screenshot/Screenshot%20Matterbridge%20Logger%20Debug.png)
492
+ ![Debug Matterbridge Settings](./screenshot/Screenshot%20Matterbridge%20Logger%20Debug.png)
485
493
 
486
- ![Debug Matter Settings](screenshot/Screenshot%20Matter%20Logger%20Debug.png)
494
+ ![Debug Matter Settings](./screenshot/Screenshot%20Matter%20Logger%20Debug.png)
487
495
 
488
496
  ### Restart
489
497
 
@@ -491,7 +499,7 @@ Wait a few minutes to allow the logs to to accumulate.
491
499
 
492
500
  Then, from the dots menu in the frontend, download the `matterbridge.log` and `matter.log` files.
493
501
 
494
- ![image](screenshot/Screenshot%20Debug%20Download%20Logs.png)
502
+ ![image](./screenshot/Screenshot%20Debug%20Download%20Logs.png)
495
503
 
496
504
  Don't forget to unselect the debug mode when is no more needed. The network traffic and cpu usage is very high in debug mode.
497
505
 
@@ -586,7 +594,7 @@ On my side I sponsor the packages that I use in this project. It would be nice t
586
594
  Click on the badge below to get started:
587
595
 
588
596
  <a href="https://www.buymeacoffee.com/luligugithub">
589
- <img src="bmc-button.svg" alt="Buy me a coffee" width="120">
597
+ <img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="120">
590
598
  </a>
591
599
 
592
600
  Thank you for your support!
@@ -1,36 +1,9 @@
1
- /**
2
- * This file contains the BroadcastServer class.
3
- *
4
- * @file broadcastServer.ts
5
- * @author Luca Liguori
6
- * @created 2025-10-05
7
- * @version 1.0.3
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2024, 2025, 2026 Luca Liguori.
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- // eslint-disable-next-line no-console
25
1
  if (process.argv.includes('--loader') || process.argv.includes('-loader'))
26
2
  console.log('\u001B[32mBroadcastServer loaded.\u001B[40;0m');
27
3
  import { EventEmitter } from 'node:events';
28
4
  import { BroadcastChannel } from 'node:worker_threads';
29
5
  import { CYAN, db, debugStringify } from 'node-ansi-logger';
30
6
  import { hasParameter } from './utils/commandLine.js';
31
- /**
32
- * BroadcastServer class to handle broadcast messages between workers with BroadcastChannel.
33
- */
34
7
  export class BroadcastServer extends EventEmitter {
35
8
  name;
36
9
  log;
@@ -38,13 +11,6 @@ export class BroadcastServer extends EventEmitter {
38
11
  broadcastChannel;
39
12
  debug = hasParameter('debug') || hasParameter('verbose');
40
13
  verbose = hasParameter('verbose');
41
- /**
42
- * Creates an instance of BroadcastServer.
43
- *
44
- * @param {string} name - The name of the broadcast server.
45
- * @param {AnsiLogger} log - The logger instance to use for logging.
46
- * @param {string} channel - The channel name for the broadcast. Default is 'broadcast-channel'.
47
- */
48
14
  constructor(name, log, channel = 'broadcast-channel') {
49
15
  super();
50
16
  this.name = name;
@@ -53,72 +19,30 @@ export class BroadcastServer extends EventEmitter {
53
19
  this.broadcastChannel = new BroadcastChannel(this.channel);
54
20
  this.broadcastChannel.onmessage = this.broadcastMessageHandler.bind(this);
55
21
  }
56
- /**
57
- * Closes the broadcast channel.
58
- *
59
- * @returns {void}
60
- */
61
22
  close() {
62
- // @ts-expect-error: wrong type definition in node.d.ts
63
23
  this.broadcastChannel.onmessage = null;
64
24
  this.broadcastChannel.close();
65
25
  }
66
- /**
67
- * Generates a unique ID with range 100000-999999.
68
- *
69
- * @returns {number} - A unique ID between 100000 and 999999
70
- */
71
26
  getUniqueId() {
72
- return Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000; // random int between 100000 and 999999
27
+ return Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000;
73
28
  }
74
- /**
75
- * Type guard to check if a message is a request of a specific type.
76
- *
77
- * @param {unknown} msg - The message to check.
78
- * @param {T} type - The type to check against.
79
- * @returns {msg is WorkerRequest<T>} True if the message is a request of the specified type.
80
- */
81
29
  isWorkerRequest(msg, type) {
82
30
  return typeof msg === 'object' && msg !== null && 'id' in msg && 'timestamp' in msg && 'type' in msg && msg.type === type && !('response' in msg) && 'src' in msg && 'dst' in msg;
83
31
  }
84
- /**
85
- * Type guard to check if a message is a response of a specific type.
86
- *
87
- * @param {unknown} msg - The message to check.
88
- * @param {T} type - The type to check against.
89
- * @returns {msg is WorkerResponse<T>} True if the message is a response of the specified type.
90
- */
91
32
  isWorkerResponse(msg, type) {
92
33
  return typeof msg === 'object' && msg !== null && 'id' in msg && 'timestamp' in msg && 'type' in msg && msg.type === type && 'response' in msg && 'src' in msg && 'dst' in msg;
93
34
  }
94
- /**
95
- * Handles incoming broadcast messages.
96
- *
97
- * @param {MessageEvent} event - The message event containing the broadcast message.
98
- * @returns {void}
99
- */
100
35
  broadcastMessageHandler(event) {
101
36
  const data = event.data;
102
37
  if (this.verbose && (data.dst === this.name || data.dst === 'all'))
103
38
  this.log.debug(`Server ${CYAN}${this.name}${db} received broadcast message: ${debugStringify(data)}`);
104
39
  this.emit('broadcast_message', data);
105
40
  }
106
- /**
107
- * Broadcast a message to all workers.
108
- *
109
- * @param {WorkerMessage} message - The message to broadcast.
110
- */
111
41
  broadcast(message) {
112
42
  if (this.verbose)
113
43
  this.log.debug(`Broadcasting message: ${debugStringify(message)}`);
114
44
  this.broadcastChannel.postMessage(message);
115
45
  }
116
- /**
117
- * Broadcast a request message to all workers.
118
- *
119
- * @param {WorkerRequest<T>} message - The typed request message to broadcast.
120
- * @returns {void}
121
- */
122
46
  request(message) {
123
47
  if (message.id === undefined) {
124
48
  message.id = this.getUniqueId();
@@ -134,12 +58,6 @@ export class BroadcastServer extends EventEmitter {
134
58
  this.log.debug(`Broadcasting request message: ${debugStringify(message)}`);
135
59
  this.broadcastChannel.postMessage(message);
136
60
  }
137
- /**
138
- * Broadcast a response message to all workers.
139
- *
140
- * @param {WorkerResponse<T>} message - The typed response message to broadcast.
141
- * @returns {void}
142
- */
143
61
  respond(message) {
144
62
  if (message.timestamp === undefined) {
145
63
  message.timestamp = Date.now();
@@ -152,15 +70,6 @@ export class BroadcastServer extends EventEmitter {
152
70
  this.log.debug(`Broadcasting response message: ${debugStringify(message)}`);
153
71
  this.broadcastChannel.postMessage(message);
154
72
  }
155
- /**
156
- * Fetch data from a worker.
157
- * It broadcasts a request message and waits for a response with the same id.
158
- *
159
- * @param {WorkerRequest<T>} message - The typed request message to broadcast.
160
- * @param {number} timeout - The timeout in milliseconds to wait for a response. Default is 250ms.
161
- * @returns {Promise<WorkerResponse<T>>} A promise that resolves with the response from the worker or rejects on timeout.
162
- * @throws {Error} If the fetch operation times out after 250ms.
163
- */
164
73
  async fetch(message, timeout = 250) {
165
74
  if (message.id === undefined) {
166
75
  message.id = this.getUniqueId();
@@ -193,4 +102,3 @@ export class BroadcastServer extends EventEmitter {
193
102
  });
194
103
  }
195
104
  }
196
- //# sourceMappingURL=broadcastServer.js.map
@@ -1,25 +1 @@
1
- /**
2
- * This file contains the BroadcastServer types.
3
- *
4
- * @file broadcastServerTypes.ts
5
- * @author Luca Liguori
6
- * @created 2025-10-05
7
- * @version 1.0.0
8
- * @license Apache-2.0
9
- *
10
- * Copyright 2025, 2026, 2027 Luca Liguori.
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
1
  export {};
25
- //# sourceMappingURL=broadcastServerTypes.js.map