homebridge-config-ui-x 5.9.1-beta.1 → 5.9.1-beta.3

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 (362) hide show
  1. package/CHANGELOG.md +7 -3
  2. package/dist/app.controller.d.ts +1 -1
  3. package/dist/app.controller.js +14 -12
  4. package/dist/app.controller.js.map +1 -1
  5. package/dist/app.gateway.js +7 -10
  6. package/dist/app.gateway.js.map +1 -1
  7. package/dist/app.module.js +40 -43
  8. package/dist/app.module.js.map +1 -1
  9. package/dist/app.service.js +4 -7
  10. package/dist/app.service.js.map +1 -1
  11. package/dist/bin/base-platform.d.ts +1 -1
  12. package/dist/bin/base-platform.js +11 -17
  13. package/dist/bin/base-platform.js.map +1 -1
  14. package/dist/bin/fork.js +7 -45
  15. package/dist/bin/fork.js.map +1 -1
  16. package/dist/bin/hb-service.js +224 -243
  17. package/dist/bin/hb-service.js.map +1 -1
  18. package/dist/bin/platforms/darwin.d.ts +1 -1
  19. package/dist/bin/platforms/darwin.js +61 -65
  20. package/dist/bin/platforms/darwin.js.map +1 -1
  21. package/dist/bin/platforms/freebsd.d.ts +1 -1
  22. package/dist/bin/platforms/freebsd.js +42 -47
  23. package/dist/bin/platforms/freebsd.js.map +1 -1
  24. package/dist/bin/platforms/linux.d.ts +1 -1
  25. package/dist/bin/platforms/linux.js +127 -132
  26. package/dist/bin/platforms/linux.js.map +1 -1
  27. package/dist/bin/platforms/win32.d.ts +1 -1
  28. package/dist/bin/platforms/win32.js +30 -36
  29. package/dist/bin/platforms/win32.js.map +1 -1
  30. package/dist/bin/standalone.js +15 -53
  31. package/dist/bin/standalone.js.map +1 -1
  32. package/dist/core/auth/auth.controller.d.ts +3 -3
  33. package/dist/core/auth/auth.controller.js +40 -39
  34. package/dist/core/auth/auth.controller.js.map +1 -1
  35. package/dist/core/auth/auth.dto.js +17 -18
  36. package/dist/core/auth/auth.dto.js.map +1 -1
  37. package/dist/core/auth/auth.module.js +28 -31
  38. package/dist/core/auth/auth.module.js.map +1 -1
  39. package/dist/core/auth/auth.service.d.ts +3 -3
  40. package/dist/core/auth/auth.service.js +65 -62
  41. package/dist/core/auth/auth.service.js.map +1 -1
  42. package/dist/core/auth/guards/admin.guard.js +4 -7
  43. package/dist/core/auth/guards/admin.guard.js.map +1 -1
  44. package/dist/core/auth/guards/custom.guard.js +6 -9
  45. package/dist/core/auth/guards/custom.guard.js.map +1 -1
  46. package/dist/core/auth/guards/ws-admin-guard.d.ts +2 -2
  47. package/dist/core/auth/guards/ws-admin-guard.js +13 -11
  48. package/dist/core/auth/guards/ws-admin-guard.js.map +1 -1
  49. package/dist/core/auth/guards/ws.guard.d.ts +2 -2
  50. package/dist/core/auth/guards/ws.guard.js +13 -11
  51. package/dist/core/auth/guards/ws.guard.js.map +1 -1
  52. package/dist/core/auth/jwt.strategy.d.ts +3 -2
  53. package/dist/core/auth/jwt.strategy.js +21 -16
  54. package/dist/core/auth/jwt.strategy.js.map +1 -1
  55. package/dist/core/config/config.interfaces.js +1 -2
  56. package/dist/core/config/config.module.js +8 -10
  57. package/dist/core/config/config.module.js.map +1 -1
  58. package/dist/core/config/config.service.d.ts +2 -2
  59. package/dist/core/config/config.service.js +88 -82
  60. package/dist/core/config/config.service.js.map +1 -1
  61. package/dist/core/config/config.startup.d.ts +1 -1
  62. package/dist/core/config/config.startup.js +23 -28
  63. package/dist/core/config/config.startup.js.map +1 -1
  64. package/dist/core/feature-flags/feature-flags.registry.js +2 -5
  65. package/dist/core/feature-flags/feature-flags.registry.js.map +1 -1
  66. package/dist/core/homebridge-ipc/homebridge-ipc.module.js +11 -14
  67. package/dist/core/homebridge-ipc/homebridge-ipc.module.js.map +1 -1
  68. package/dist/core/homebridge-ipc/homebridge-ipc.service.d.ts +4 -4
  69. package/dist/core/homebridge-ipc/homebridge-ipc.service.js +25 -19
  70. package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
  71. package/dist/core/logger/logger.module.js +8 -10
  72. package/dist/core/logger/logger.module.js.map +1 -1
  73. package/dist/core/logger/logger.service.js +13 -23
  74. package/dist/core/logger/logger.service.js.map +1 -1
  75. package/dist/core/node-pty/node-pty.module.js +7 -10
  76. package/dist/core/node-pty/node-pty.module.js.map +1 -1
  77. package/dist/core/node-pty/node-pty.service.js +6 -11
  78. package/dist/core/node-pty/node-pty.service.js.map +1 -1
  79. package/dist/core/node-version.constants.js +4 -11
  80. package/dist/core/node-version.constants.js.map +1 -1
  81. package/dist/core/scheduler/scheduler.module.js +7 -10
  82. package/dist/core/scheduler/scheduler.module.js.map +1 -1
  83. package/dist/core/scheduler/scheduler.service.js +9 -14
  84. package/dist/core/scheduler/scheduler.service.js.map +1 -1
  85. package/dist/core/spa/spa-html.service.js +9 -15
  86. package/dist/core/spa/spa-html.service.js.map +1 -1
  87. package/dist/core/spa/spa.filter.d.ts +1 -1
  88. package/dist/core/spa/spa.filter.js +11 -16
  89. package/dist/core/spa/spa.filter.js.map +1 -1
  90. package/dist/core/ssl/ssl-cert-generator.service.js +34 -36
  91. package/dist/core/ssl/ssl-cert-generator.service.js.map +1 -1
  92. package/dist/env-setup.d.ts +1 -0
  93. package/dist/env-setup.js +7 -0
  94. package/dist/env-setup.js.map +1 -0
  95. package/dist/globalDefaults.d.ts +1 -0
  96. package/dist/globalDefaults.js +1 -0
  97. package/dist/index.d.ts +1 -1
  98. package/dist/index.js +16 -19
  99. package/dist/index.js.map +1 -1
  100. package/dist/main.d.ts +5 -3
  101. package/dist/main.js +44 -51
  102. package/dist/main.js.map +1 -1
  103. package/dist/modules/accessories/accessories.controller.d.ts +13 -3
  104. package/dist/modules/accessories/accessories.controller.js +47 -29
  105. package/dist/modules/accessories/accessories.controller.js.map +1 -1
  106. package/dist/modules/accessories/accessories.dto.js +11 -13
  107. package/dist/modules/accessories/accessories.dto.js.map +1 -1
  108. package/dist/modules/accessories/accessories.gateway.d.ts +2 -2
  109. package/dist/modules/accessories/accessories.gateway.js +18 -16
  110. package/dist/modules/accessories/accessories.gateway.js.map +1 -1
  111. package/dist/modules/accessories/accessories.interfaces.d.ts +94 -0
  112. package/dist/modules/accessories/accessories.interfaces.js +2 -0
  113. package/dist/modules/accessories/accessories.interfaces.js.map +1 -0
  114. package/dist/modules/accessories/accessories.module.js +19 -20
  115. package/dist/modules/accessories/accessories.module.js.map +1 -1
  116. package/dist/modules/accessories/accessories.service.d.ts +25 -5
  117. package/dist/modules/accessories/accessories.service.js +331 -52
  118. package/dist/modules/accessories/accessories.service.js.map +1 -1
  119. package/dist/modules/backup/backup.controller.d.ts +4 -4
  120. package/dist/modules/backup/backup.controller.js +68 -67
  121. package/dist/modules/backup/backup.controller.js.map +1 -1
  122. package/dist/modules/backup/backup.gateway.d.ts +4 -4
  123. package/dist/modules/backup/backup.gateway.js +25 -21
  124. package/dist/modules/backup/backup.gateway.js.map +1 -1
  125. package/dist/modules/backup/backup.module.js +22 -25
  126. package/dist/modules/backup/backup.module.js.map +1 -1
  127. package/dist/modules/backup/backup.service.d.ts +5 -5
  128. package/dist/modules/backup/backup.service.js +143 -133
  129. package/dist/modules/backup/backup.service.js.map +1 -1
  130. package/dist/modules/child-bridges/child-bridges.gateway.d.ts +3 -3
  131. package/dist/modules/child-bridges/child-bridges.gateway.js +23 -21
  132. package/dist/modules/child-bridges/child-bridges.gateway.js.map +1 -1
  133. package/dist/modules/child-bridges/child-bridges.interfaces.js +1 -2
  134. package/dist/modules/child-bridges/child-bridges.module.js +19 -22
  135. package/dist/modules/child-bridges/child-bridges.module.js.map +1 -1
  136. package/dist/modules/child-bridges/child-bridges.service.d.ts +3 -3
  137. package/dist/modules/child-bridges/child-bridges.service.js +15 -11
  138. package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
  139. package/dist/modules/config-editor/config-editor.controller.d.ts +7 -7
  140. package/dist/modules/config-editor/config-editor.controller.js +94 -95
  141. package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
  142. package/dist/modules/config-editor/config-editor.module.js +21 -24
  143. package/dist/modules/config-editor/config-editor.module.js.map +1 -1
  144. package/dist/modules/config-editor/config-editor.service.d.ts +6 -6
  145. package/dist/modules/config-editor/config-editor.service.js +65 -57
  146. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  147. package/dist/modules/custom-plugins/custom-plugins.module.js +10 -13
  148. package/dist/modules/custom-plugins/custom-plugins.module.js.map +1 -1
  149. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.d.ts +2 -2
  150. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js +21 -19
  151. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.controller.js.map +1 -1
  152. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js +14 -17
  153. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.module.js.map +1 -1
  154. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.d.ts +2 -2
  155. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js +18 -15
  156. package/dist/modules/custom-plugins/homebridge-deconz/homebridge-deconz.service.js.map +1 -1
  157. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.d.ts +2 -2
  158. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js +21 -19
  159. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.controller.js.map +1 -1
  160. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js +14 -17
  161. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.module.js.map +1 -1
  162. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.d.ts +2 -2
  163. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js +18 -15
  164. package/dist/modules/custom-plugins/homebridge-hue/homebridge-hue.service.js.map +1 -1
  165. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.d.ts +2 -2
  166. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js +18 -19
  167. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.controller.js.map +1 -1
  168. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.d.ts +2 -2
  169. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js +15 -13
  170. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.gateway.js.map +1 -1
  171. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js +18 -21
  172. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.module.js.map +1 -1
  173. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +8 -8
  174. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +47 -41
  175. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
  176. package/dist/modules/log/log.gateway.d.ts +3 -3
  177. package/dist/modules/log/log.gateway.js +15 -13
  178. package/dist/modules/log/log.gateway.js.map +1 -1
  179. package/dist/modules/log/log.interfaces.js +1 -2
  180. package/dist/modules/log/log.module.js +14 -17
  181. package/dist/modules/log/log.module.js.map +1 -1
  182. package/dist/modules/log/log.service.d.ts +5 -5
  183. package/dist/modules/log/log.service.js +47 -43
  184. package/dist/modules/log/log.service.js.map +1 -1
  185. package/dist/modules/platform-tools/docker/docker.controller.d.ts +1 -1
  186. package/dist/modules/platform-tools/docker/docker.controller.js +24 -25
  187. package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
  188. package/dist/modules/platform-tools/docker/docker.module.js +14 -17
  189. package/dist/modules/platform-tools/docker/docker.module.js.map +1 -1
  190. package/dist/modules/platform-tools/docker/docker.service.d.ts +2 -2
  191. package/dist/modules/platform-tools/docker/docker.service.js +20 -16
  192. package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
  193. package/dist/modules/platform-tools/hb-service/hb-service.controller.d.ts +2 -2
  194. package/dist/modules/platform-tools/hb-service/hb-service.controller.js +35 -36
  195. package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
  196. package/dist/modules/platform-tools/hb-service/hb-service.dto.js +20 -19
  197. package/dist/modules/platform-tools/hb-service/hb-service.dto.js.map +1 -1
  198. package/dist/modules/platform-tools/hb-service/hb-service.module.js +14 -17
  199. package/dist/modules/platform-tools/hb-service/hb-service.module.js.map +1 -1
  200. package/dist/modules/platform-tools/hb-service/hb-service.service.d.ts +3 -3
  201. package/dist/modules/platform-tools/hb-service/hb-service.service.js +37 -30
  202. package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
  203. package/dist/modules/platform-tools/linux/linux.controller.d.ts +1 -1
  204. package/dist/modules/platform-tools/linux/linux.controller.js +23 -21
  205. package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
  206. package/dist/modules/platform-tools/linux/linux.module.js +14 -17
  207. package/dist/modules/platform-tools/linux/linux.module.js.map +1 -1
  208. package/dist/modules/platform-tools/linux/linux.service.d.ts +2 -2
  209. package/dist/modules/platform-tools/linux/linux.service.js +18 -14
  210. package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
  211. package/dist/modules/platform-tools/platform-tools.module.js +12 -15
  212. package/dist/modules/platform-tools/platform-tools.module.js.map +1 -1
  213. package/dist/modules/platform-tools/terminal/terminal.controller.d.ts +1 -1
  214. package/dist/modules/platform-tools/terminal/terminal.controller.js +15 -13
  215. package/dist/modules/platform-tools/terminal/terminal.controller.js.map +1 -1
  216. package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -2
  217. package/dist/modules/platform-tools/terminal/terminal.gateway.js +17 -15
  218. package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
  219. package/dist/modules/platform-tools/terminal/terminal.interfaces.js +1 -2
  220. package/dist/modules/platform-tools/terminal/terminal.module.js +18 -21
  221. package/dist/modules/platform-tools/terminal/terminal.module.js.map +1 -1
  222. package/dist/modules/platform-tools/terminal/terminal.service.d.ts +7 -7
  223. package/dist/modules/platform-tools/terminal/terminal.service.js +33 -28
  224. package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
  225. package/dist/modules/plugins/plugins.controller.d.ts +7 -7
  226. package/dist/modules/plugins/plugins.controller.js +51 -52
  227. package/dist/modules/plugins/plugins.controller.js.map +1 -1
  228. package/dist/modules/plugins/plugins.dto.js +26 -24
  229. package/dist/modules/plugins/plugins.dto.js.map +1 -1
  230. package/dist/modules/plugins/plugins.gateway.d.ts +5 -5
  231. package/dist/modules/plugins/plugins.gateway.js +38 -34
  232. package/dist/modules/plugins/plugins.gateway.js.map +1 -1
  233. package/dist/modules/plugins/plugins.interfaces.js +1 -2
  234. package/dist/modules/plugins/plugins.module.js +23 -26
  235. package/dist/modules/plugins/plugins.module.js.map +1 -1
  236. package/dist/modules/plugins/plugins.service.d.ts +13 -11
  237. package/dist/modules/plugins/plugins.service.js +230 -202
  238. package/dist/modules/plugins/plugins.service.js.map +1 -1
  239. package/dist/modules/server/server.controller.d.ts +7 -7
  240. package/dist/modules/server/server.controller.js +208 -205
  241. package/dist/modules/server/server.controller.js.map +1 -1
  242. package/dist/modules/server/server.dto.js +13 -16
  243. package/dist/modules/server/server.dto.js.map +1 -1
  244. package/dist/modules/server/server.module.js +23 -26
  245. package/dist/modules/server/server.module.js.map +1 -1
  246. package/dist/modules/server/server.service.d.ts +6 -6
  247. package/dist/modules/server/server.service.js +202 -224
  248. package/dist/modules/server/server.service.js.map +1 -1
  249. package/dist/modules/setup-wizard/setup-wizard.controller.d.ts +3 -3
  250. package/dist/modules/setup-wizard/setup-wizard.controller.js +19 -20
  251. package/dist/modules/setup-wizard/setup-wizard.controller.js.map +1 -1
  252. package/dist/modules/setup-wizard/setup-wizard.gateway.d.ts +4 -4
  253. package/dist/modules/setup-wizard/setup-wizard.gateway.js +25 -21
  254. package/dist/modules/setup-wizard/setup-wizard.gateway.js.map +1 -1
  255. package/dist/modules/setup-wizard/setup-wizard.guard.d.ts +2 -2
  256. package/dist/modules/setup-wizard/setup-wizard.guard.js +11 -9
  257. package/dist/modules/setup-wizard/setup-wizard.guard.js.map +1 -1
  258. package/dist/modules/setup-wizard/setup-wizard.module.js +12 -15
  259. package/dist/modules/setup-wizard/setup-wizard.module.js.map +1 -1
  260. package/dist/modules/status/status.controller.d.ts +5 -5
  261. package/dist/modules/status/status.controller.js +40 -36
  262. package/dist/modules/status/status.controller.js.map +1 -1
  263. package/dist/modules/status/status.gateway.d.ts +11 -11
  264. package/dist/modules/status/status.gateway.js +51 -47
  265. package/dist/modules/status/status.gateway.js.map +1 -1
  266. package/dist/modules/status/status.interfaces.js +2 -5
  267. package/dist/modules/status/status.interfaces.js.map +1 -1
  268. package/dist/modules/status/status.module.js +26 -29
  269. package/dist/modules/status/status.module.js.map +1 -1
  270. package/dist/modules/status/status.service.d.ts +13 -13
  271. package/dist/modules/status/status.service.js +100 -88
  272. package/dist/modules/status/status.service.js.map +1 -1
  273. package/dist/modules/users/users.controller.d.ts +3 -3
  274. package/dist/modules/users/users.controller.js +59 -60
  275. package/dist/modules/users/users.controller.js.map +1 -1
  276. package/dist/modules/users/users.dto.js +51 -45
  277. package/dist/modules/users/users.dto.js.map +1 -1
  278. package/dist/modules/users/users.module.js +14 -17
  279. package/dist/modules/users/users.module.js.map +1 -1
  280. package/dist/self-check.js +25 -25
  281. package/dist/self-check.js.map +1 -1
  282. package/package.json +10 -11
  283. package/public/{chunk-Q2IS3QQY.js → chunk-2GNLGHLF.js} +1 -1
  284. package/public/{chunk-73TX7DHV.js → chunk-2HB77JUL.js} +1 -1
  285. package/public/{chunk-EVND2DL5.js → chunk-2KS3Z2IQ.js} +1 -1
  286. package/public/{chunk-NKNWXFAK.js → chunk-3MJTL7SQ.js} +1 -1
  287. package/public/chunk-3P242I3M.js +1 -0
  288. package/public/{chunk-WWSLIQVD.js → chunk-46GAMPZC.js} +1 -1
  289. package/public/{chunk-AI6E5JVH.js → chunk-46IO6OQW.js} +1 -1
  290. package/public/{chunk-EAGKQ5OJ.js → chunk-4A2GGTS4.js} +1 -1
  291. package/public/{chunk-2LXNPXT5.js → chunk-4YBRFABH.js} +1 -1
  292. package/public/{chunk-ZEI3HZ6P.js → chunk-5SJKGEVE.js} +1 -1
  293. package/public/{chunk-CYBDQV2B.js → chunk-5WBNDRQY.js} +1 -1
  294. package/public/{chunk-W3SNJ7TC.js → chunk-66WFX4Q7.js} +1 -1
  295. package/public/{chunk-5ETJWAIW.js → chunk-6EINUQIR.js} +1 -1
  296. package/public/chunk-6UJ7GY5J.js +1 -0
  297. package/public/{chunk-VYC5JLE6.js → chunk-77FE4N6E.js} +1 -1
  298. package/public/{chunk-4QXLJX7D.js → chunk-ALZYHHJS.js} +1 -1
  299. package/public/{chunk-SY4VNLXW.js → chunk-AYCYJZ5K.js} +1 -1
  300. package/public/chunk-BB37SSD3.js +50 -0
  301. package/public/chunk-BCEDAADS.js +1 -0
  302. package/public/{chunk-ONTEIYY3.js → chunk-BDNVTHRF.js} +1 -1
  303. package/public/{chunk-ADW6BF5G.js → chunk-CCHNU62C.js} +1 -1
  304. package/public/{chunk-BLT2YCDN.js → chunk-CWBKN6DK.js} +1 -1
  305. package/public/{chunk-3IJXQMYZ.js → chunk-DE3FEETC.js} +1 -1
  306. package/public/{chunk-TSFGO3MA.js → chunk-EGCKVLUA.js} +1 -1
  307. package/public/{chunk-L43N56JA.js → chunk-EGWCQPNN.js} +1 -1
  308. package/public/{chunk-OK5EJ7US.js → chunk-EKECA5VY.js} +1 -1
  309. package/public/{chunk-JJ7TVAIH.js → chunk-EQP5UP7Q.js} +4 -4
  310. package/public/{chunk-3XDYZNNE.js → chunk-FE2HKRWO.js} +1 -1
  311. package/public/chunk-FQFDF7NL.js +52 -0
  312. package/public/{chunk-2UOYBCTN.js → chunk-GXXBQUDX.js} +1 -1
  313. package/public/{chunk-3IZSIVEA.js → chunk-HADRZRRW.js} +1 -1
  314. package/public/{chunk-LZOHFRHN.js → chunk-HL3SPLOS.js} +1 -1
  315. package/public/{chunk-732XLY23.js → chunk-HYNETRJU.js} +1 -1
  316. package/public/{chunk-BTBGWLKK.js → chunk-IUQ7ORI6.js} +1 -1
  317. package/public/chunk-JAJWHRVE.js +1 -0
  318. package/public/{chunk-UF2IM5BE.js → chunk-JEJRRXX6.js} +1 -1
  319. package/public/chunk-KSPJ7LBC.js +1 -0
  320. package/public/{chunk-OAHDGV32.js → chunk-KWPPPGZJ.js} +1 -1
  321. package/public/{chunk-TOYVIOBH.js → chunk-M2ITW35G.js} +1 -1
  322. package/public/{chunk-5T4JHJYL.js → chunk-M4SSS7AE.js} +1 -1
  323. package/public/{chunk-Y5FP6C55.js → chunk-M5QYCMMI.js} +1 -1
  324. package/public/{chunk-ASKB5DLO.js → chunk-MR4KWEYX.js} +1 -1
  325. package/public/{chunk-YH6MRXGX.js → chunk-MYPS3TAE.js} +1 -1
  326. package/public/{chunk-LH2LMHIZ.js → chunk-OIVQXH76.js} +1 -1
  327. package/public/{chunk-RMZRXORR.js → chunk-P6WEUVOG.js} +1 -1
  328. package/public/{chunk-2KEG7SYT.js → chunk-PHWOE6AS.js} +1 -1
  329. package/public/{chunk-N2TWGDNX.js → chunk-PJNMYOLO.js} +1 -1
  330. package/public/{chunk-YNONXMOG.js → chunk-Q2JNFJIW.js} +1 -1
  331. package/public/{chunk-WLGXJQPD.js → chunk-QQ44GPGJ.js} +1 -1
  332. package/public/{chunk-LWAL5JUG.js → chunk-QUV4XDKI.js} +1 -1
  333. package/public/{chunk-3E2NZ5JW.js → chunk-QXD3PZRU.js} +1 -1
  334. package/public/{chunk-7IYTG6GP.js → chunk-REL5VGL4.js} +1 -1
  335. package/public/{chunk-U5JF2ZOK.js → chunk-SKPO4EWV.js} +1 -1
  336. package/public/{chunk-QK4V5DVW.js → chunk-TLUCE4J6.js} +1 -1
  337. package/public/{chunk-325LPX6W.js → chunk-UAQZWGFR.js} +1 -1
  338. package/public/{chunk-UNGEHXRN.js → chunk-UGGLMYE3.js} +1 -1
  339. package/public/{chunk-FM6ZYPKR.js → chunk-US2WKTPG.js} +4 -4
  340. package/public/{chunk-YYJG2ENF.js → chunk-VIZSJCWC.js} +1 -1
  341. package/public/{chunk-7UDDRMZZ.js → chunk-VOHBPEFW.js} +1 -1
  342. package/public/{chunk-6KT3BYU6.js → chunk-WTOIGZHP.js} +1 -1
  343. package/public/{chunk-57DUDNZJ.js → chunk-WZKMLQSX.js} +1 -1
  344. package/public/{chunk-2FNQEOXF.js → chunk-X5AVMTQO.js} +1 -1
  345. package/public/{chunk-D5RKKI2A.js → chunk-XFAARHWA.js} +1 -1
  346. package/public/{chunk-ZJJ3EOBP.js → chunk-YKEI23UT.js} +1 -1
  347. package/public/chunk-YNS6PU44.js +1 -0
  348. package/public/{chunk-OS2SEJZU.js → chunk-YSLCQT67.js} +1 -1
  349. package/public/{chunk-X5AKILHJ.js → chunk-YTHSUAFP.js} +1 -1
  350. package/public/{chunk-2CNQY2E7.js → chunk-ZCINSOSK.js} +1 -1
  351. package/public/index.html +2 -2
  352. package/public/{main-27RPBS22.js → main-RHTU6HFP.js} +1 -1
  353. package/public/{styles-CSF457UW.css → styles-WNHDEKE4.css} +1 -1
  354. package/scripts/extract-plugin-alias.js +8 -4
  355. package/public/chunk-L5I3DZ23.js +0 -1
  356. package/public/chunk-O4SS7KVP.js +0 -40
  357. package/public/chunk-P7TZIGJS.js +0 -50
  358. package/public/chunk-QQ5VZZQG.js +0 -1
  359. package/public/chunk-RYTGW6B7.js +0 -1
  360. package/public/chunk-SOT54YHI.js +0 -1
  361. package/public/chunk-TGZNYEGN.js +0 -1
  362. package/public/chunk-VEGMNMLG.js +0 -1
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -8,66 +7,92 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
7
  var __metadata = (this && this.__metadata) || function (k, v) {
9
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
9
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
11
+ return function (target, key) { decorator(target, key, paramIndex); }
13
12
  };
14
13
  var PluginsService_1;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.PluginsService = void 0;
17
- const node_child_process_1 = require("node:child_process");
18
- const node_os_1 = require("node:os");
19
- const node_path_1 = require("node:path");
20
- const node_process_1 = __importDefault(require("node:process"));
21
- const axios_1 = require("@nestjs/axios");
22
- const common_1 = require("@nestjs/common");
23
- const axios_2 = __importDefault(require("axios"));
24
- const bash_color_1 = require("bash-color");
25
- const fs_extra_1 = require("fs-extra");
26
- const lodash_1 = require("lodash");
27
- const node_cache_1 = __importDefault(require("node-cache"));
28
- const p_limit_1 = __importDefault(require("p-limit"));
29
- const rxjs_1 = require("rxjs");
30
- const semver_1 = require("semver");
31
- const config_service_1 = require("../../core/config/config.service");
32
- const logger_service_1 = require("../../core/logger/logger.service");
33
- const node_pty_service_1 = require("../../core/node-pty/node-pty.service");
34
- let PluginsService = PluginsService_1 = class PluginsService {
14
+ import { execSync, fork, spawn } from 'node:child_process';
15
+ import { constants, existsSync } from 'node:fs';
16
+ import { access, readdir, readFile, realpath, stat } from 'node:fs/promises';
17
+ import { createRequire } from 'node:module';
18
+ import { arch, cpus, platform, userInfo } from 'node:os';
19
+ import { basename, delimiter, dirname, join, resolve, sep, } from 'node:path';
20
+ import process from 'node:process';
21
+ import { HttpService } from '@nestjs/axios';
22
+ import { BadRequestException, Inject, Injectable, InternalServerErrorException, NotFoundException } from '@nestjs/common';
23
+ import axios from 'axios';
24
+ import { cyan, green, red, yellow } from 'bash-color';
25
+ import { createFile, ensureDir, pathExists, pathExistsSync, readJson, remove } from 'fs-extra/esm';
26
+ import _ from 'lodash';
27
+ import NodeCache from 'node-cache';
28
+ import pLimit from 'p-limit';
29
+ import { firstValueFrom } from 'rxjs';
30
+ import { gt, lt, parse, satisfies } from 'semver';
31
+ import { ConfigService } from '../../core/config/config.service.js';
32
+ import { Logger } from '../../core/logger/logger.service.js';
33
+ import { NodePtyService } from '../../core/node-pty/node-pty.service.js';
34
+ const { orderBy, uniq } = _;
35
+ const require = createRequire(import.meta.url);
36
+ let PluginsService = class PluginsService {
37
+ static { PluginsService_1 = this; }
38
+ httpService;
39
+ nodePtyService;
40
+ logger;
41
+ configService;
42
+ static PLUGIN_IDENTIFIER_PATTERN = /^(@[\w-]+(\.[\w-]+)*\/)?homebridge-[\w-]+$/;
43
+ _npm;
44
+ _paths;
45
+ get npm() {
46
+ if (!this._npm) {
47
+ this._npm = this.getNpmPath();
48
+ }
49
+ return this._npm;
50
+ }
51
+ get paths() {
52
+ if (!this._paths) {
53
+ this._paths = this.getBasePaths();
54
+ }
55
+ return this._paths;
56
+ }
57
+ installedPlugins;
58
+ npmPackage;
59
+ pluginListUrl = 'https://raw.githubusercontent.com/homebridge/plugins/latest/';
60
+ pluginListFile = `${this.pluginListUrl}assets/plugins-v2.min.json`;
61
+ pluginListRetryTimeout;
62
+ hiddenPlugins = [];
63
+ maintainedPlugins = [];
64
+ pluginIcons = {};
65
+ pluginAuthors = {};
66
+ pluginNames = {};
67
+ pluginChangelogs = {};
68
+ newScopePlugins = {};
69
+ verifiedPlugins = [];
70
+ verifiedPlusPlugins = [];
71
+ npmPluginCache = new NodeCache({ stdTTL: 300 });
72
+ pluginAliasCache = new NodeCache({ stdTTL: 86400 });
73
+ installedPluginsCache = new NodeCache({ stdTTL: 60 });
74
+ pluginAliasHints = {
75
+ 'homebridge-broadlink-rm-pro': {
76
+ pluginAlias: 'BroadlinkRM',
77
+ pluginType: 'platform',
78
+ },
79
+ };
35
80
  constructor(httpService, nodePtyService, logger, configService) {
36
81
  this.httpService = httpService;
37
82
  this.nodePtyService = nodePtyService;
38
83
  this.logger = logger;
39
84
  this.configService = configService;
40
- this.npm = this.getNpmPath();
41
- this.paths = this.getBasePaths();
42
- this.pluginListUrl = 'https://raw.githubusercontent.com/homebridge/plugins/latest/';
43
- this.pluginListFile = `${this.pluginListUrl}assets/plugins-v2.min.json`;
44
- this.hiddenPlugins = [];
45
- this.maintainedPlugins = [];
46
- this.pluginIcons = {};
47
- this.pluginAuthors = {};
48
- this.pluginNames = {};
49
- this.pluginChangelogs = {};
50
- this.newScopePlugins = {};
51
- this.verifiedPlugins = [];
52
- this.verifiedPlusPlugins = [];
53
- this.npmPluginCache = new node_cache_1.default({ stdTTL: 300 });
54
- this.pluginAliasCache = new node_cache_1.default({ stdTTL: 86400 });
55
- this.installedPluginsCache = new node_cache_1.default({ stdTTL: 60 });
56
- this.pluginAliasHints = {
57
- 'homebridge-broadlink-rm-pro': {
58
- pluginAlias: 'BroadlinkRM',
59
- pluginType: 'platform',
60
- },
61
- };
62
85
  this.httpService.axiosRef.interceptors.request.use((config) => {
63
- const source = axios_2.default.CancelToken.source();
86
+ const source = axios.CancelToken.source();
64
87
  config.cancelToken = source.token;
65
88
  setTimeout(() => {
66
89
  source.cancel('Timeout: request took more than 15 seconds');
67
90
  }, 15000);
68
91
  return config;
69
92
  });
70
- this.loadPluginList();
93
+ this.loadPluginList().catch((err) => {
94
+ this.logger.error('Failed to load plugin list during initialization:', err);
95
+ });
71
96
  setInterval(this.loadPluginList.bind(this), 60000 * 60 * 12);
72
97
  }
73
98
  fixDisplayName(plugin) {
@@ -86,12 +111,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
86
111
  const modules = await this.getInstalledModules();
87
112
  const disabledPlugins = await this.getDisabledPlugins();
88
113
  const homebridgePlugins = modules.filter(module => ((module.name.indexOf('homebridge-') === 0) || this.isScopedPlugin(module.name))
89
- && (0, fs_extra_1.pathExistsSync)((0, node_path_1.join)(module.installPath, 'package.json')));
90
- const limit = (0, p_limit_1.default)((0, node_os_1.cpus)().length);
114
+ && pathExistsSync(join(module.installPath, 'package.json')));
115
+ const limit = pLimit(cpus().length);
91
116
  await Promise.all(homebridgePlugins.map(async (pkg) => {
92
117
  return limit(async () => {
93
118
  try {
94
- const pkgJson = await (0, fs_extra_1.readJson)((0, node_path_1.join)(pkg.installPath, 'package.json'));
119
+ const pkgJson = await readJson(join(pkg.installPath, 'package.json'));
95
120
  if (pkgJson.keywords && pkgJson.keywords.includes('homebridge-plugin')) {
96
121
  const plugin = await this.parsePackageJson(pkgJson, pkg.path);
97
122
  plugin.disabled = disabledPlugins.includes(plugin.name);
@@ -120,21 +145,21 @@ let PluginsService = PluginsService_1 = class PluginsService {
120
145
  }
121
146
  async lookupPlugin(pluginName) {
122
147
  if (!PluginsService_1.PLUGIN_IDENTIFIER_PATTERN.test(pluginName)) {
123
- throw new common_1.BadRequestException('Invalid plugin name.');
148
+ throw new BadRequestException('Invalid plugin name.');
124
149
  }
125
150
  const lookup = await this.searchNpmRegistrySingle(pluginName);
126
151
  if (!lookup.length) {
127
- throw new common_1.NotFoundException();
152
+ throw new NotFoundException();
128
153
  }
129
154
  return lookup[0];
130
155
  }
131
156
  async getAvailablePluginVersions(pluginName) {
132
157
  if (!PluginsService_1.PLUGIN_IDENTIFIER_PATTERN.test(pluginName) && pluginName !== 'homebridge') {
133
- throw new common_1.BadRequestException('Invalid plugin name.');
158
+ throw new BadRequestException('Invalid plugin name.');
134
159
  }
135
160
  try {
136
161
  const fromCache = this.npmPluginCache.get(`lookup-${pluginName}`);
137
- const pkg = fromCache || (await (0, rxjs_1.firstValueFrom)((this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(pluginName).replace(/%40/g, '@')}`, {
162
+ const pkg = fromCache || (await firstValueFrom((this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(pluginName).replace(/%40/g, '@')}`, {
138
163
  headers: {
139
164
  accept: 'application/vnd.npm.install-v1+json',
140
165
  },
@@ -156,7 +181,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
156
181
  };
157
182
  }
158
183
  catch (e) {
159
- throw new common_1.NotFoundException();
184
+ throw new NotFoundException();
160
185
  }
161
186
  }
162
187
  extractTerms(query, separator) {
@@ -210,11 +235,11 @@ let PluginsService = PluginsService_1 = class PluginsService {
210
235
  const q = `${normalizedQuery.substring(0, 15)}+keywords:homebridge-plugin+not:deprecated&size=99`;
211
236
  let searchResults;
212
237
  try {
213
- searchResults = (await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://registry.npmjs.org/-/v1/search?text=${q}`))).data;
238
+ searchResults = (await firstValueFrom(this.httpService.get(`https://registry.npmjs.org/-/v1/search?text=${q}`))).data;
214
239
  }
215
240
  catch (e) {
216
241
  this.logger.error(`Failed to search the npm registry (see https://homebridge.io/w/JJSz6 for help) as ${e.message}.`);
217
- throw new common_1.InternalServerErrorException(`Failed to search the npm registry as ${e.message}, see logs.`);
242
+ throw new InternalServerErrorException(`Failed to search the npm registry as ${e.message}, see logs.`);
218
243
  }
219
244
  const hiddenPluginsSet = new Set(this.hiddenPlugins);
220
245
  const plugins = searchResults.objects
@@ -260,7 +285,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
260
285
  matchGroups[matchType].push(plugin);
261
286
  }
262
287
  }
263
- const orderPlugins = (arr) => (0, lodash_1.orderBy)(arr, ['isHbScoped', 'verifiedPlusPlugin', 'verifiedPlugin', 'lastUpdated'], ['desc', 'desc', 'desc']);
288
+ const orderPlugins = (arr) => orderBy(arr, ['isHbScoped', 'verifiedPlusPlugin', 'verifiedPlugin', 'lastUpdated'], ['desc', 'desc', 'desc']);
264
289
  return [
265
290
  ...orderPlugins(matchGroups.exactName),
266
291
  ...orderPlugins(matchGroups.exactKeyword),
@@ -272,7 +297,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
272
297
  async searchNpmRegistrySingle(query) {
273
298
  try {
274
299
  const fromCache = this.npmPluginCache.get(`lookup-${query}`);
275
- const pkg = fromCache || (await (0, rxjs_1.firstValueFrom)((this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(query).replace(/%40/g, '@')}`)))).data;
300
+ const pkg = fromCache || (await firstValueFrom((this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(query).replace(/%40/g, '@')}`)))).data;
276
301
  if (!fromCache) {
277
302
  this.npmPluginCache.set(`lookup-${query}`, pkg, 60);
278
303
  }
@@ -343,8 +368,8 @@ let PluginsService = PluginsService_1 = class PluginsService {
343
368
  if (action === 'install' && pluginAction.version === 'latest') {
344
369
  pluginAction.version = await this.getNpmModuleLatestVersion(pluginAction.name);
345
370
  }
346
- const userPlatform = (0, node_os_1.platform)();
347
- if (this.configService.ui.webroot && (0, semver_1.lt)(pluginAction.version, '5.9.1-alpha.0')) {
371
+ const userPlatform = platform();
372
+ if (this.configService.ui.webroot && lt(pluginAction.version, '5.9.1-alpha.0')) {
348
373
  throw new Error(`Cannot install HB UI v${pluginAction.version} when a webroot is configured.\n\r`
349
374
  + 'Please either:\n\r'
350
375
  + ' - Remove the configured webroot, restart Homebridge, then try the install again, or\n\r'
@@ -365,20 +390,20 @@ let PluginsService = PluginsService_1 = class PluginsService {
365
390
  return true;
366
391
  }
367
392
  catch (e) {
368
- client.emit('stdout', (0, bash_color_1.yellow)('\r\nBundled update failed. Trying regular update using npm.\r\n\r\n'));
393
+ client.emit('stdout', yellow('\r\nBundled update failed. Trying regular update using npm.\r\n\r\n'));
369
394
  }
370
395
  }
371
- if ((0, node_os_1.cpus)().length === 1 && (0, node_os_1.arch)() === 'arm') {
372
- client.emit('stdout', (0, bash_color_1.yellow)('***************************************************************\r\n'));
373
- client.emit('stdout', (0, bash_color_1.yellow)(`Please be patient while ${this.configService.name} updates.\r\n`));
374
- client.emit('stdout', (0, bash_color_1.yellow)('This process may take 5-15 minutes to complete on your device.\r\n'));
375
- client.emit('stdout', (0, bash_color_1.yellow)('***************************************************************\r\n\r\n'));
396
+ if (cpus().length === 1 && arch() === 'arm') {
397
+ client.emit('stdout', yellow('***************************************************************\r\n'));
398
+ client.emit('stdout', yellow(`Please be patient while ${this.configService.name} updates.\r\n`));
399
+ client.emit('stdout', yellow('This process may take 5-15 minutes to complete on your device.\r\n'));
400
+ client.emit('stdout', yellow('***************************************************************\r\n\r\n'));
376
401
  }
377
402
  const installOptions = [];
378
- if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
403
+ if (installPath === this.configService.customPluginPath && await pathExists(resolve(installPath, '../package.json'))) {
379
404
  installOptions.push('--save');
380
405
  }
381
- installPath = (0, node_path_1.resolve)(installPath, '../');
406
+ installPath = resolve(installPath, '../');
382
407
  if (!this.configService.customPluginPath || userPlatform === 'win32' || existingPlugin?.globalInstall === true) {
383
408
  installOptions.push('-g');
384
409
  }
@@ -411,16 +436,16 @@ let PluginsService = PluginsService_1 = class PluginsService {
411
436
  return true;
412
437
  }
413
438
  catch (e) {
414
- client.emit('stdout', (0, bash_color_1.yellow)('\r\nBundled install / update could not complete. Trying regular install / update using npm.\r\n\r\n'));
439
+ client.emit('stdout', yellow('\r\nBundled install / update could not complete. Trying regular install / update using npm.\r\n\r\n'));
415
440
  }
416
441
  }
417
442
  const installOptions = [];
418
443
  let npmPluginLabel = pluginAction.name;
419
- if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
444
+ if (installPath === this.configService.customPluginPath && await pathExists(resolve(installPath, '../package.json'))) {
420
445
  installOptions.push('--save');
421
446
  }
422
- installPath = (0, node_path_1.resolve)(installPath, '../');
423
- if (!this.configService.customPluginPath || (0, node_os_1.platform)() === 'win32' || existingPlugin?.globalInstall === true) {
447
+ installPath = resolve(installPath, '../');
448
+ if (!this.configService.customPluginPath || platform() === 'win32' || existingPlugin?.globalInstall === true) {
424
449
  installOptions.push('-g');
425
450
  }
426
451
  if (action === 'install') {
@@ -434,9 +459,9 @@ let PluginsService = PluginsService_1 = class PluginsService {
434
459
  }
435
460
  async getHomebridgePackage() {
436
461
  if (this.configService.ui.homebridgePackagePath) {
437
- const pkgJsonPath = (0, node_path_1.join)(this.configService.ui.homebridgePackagePath, 'package.json');
438
- if (await (0, fs_extra_1.pathExists)(pkgJsonPath)) {
439
- return await this.parsePackageJson(await (0, fs_extra_1.readJson)(pkgJsonPath), this.configService.ui.homebridgePackagePath);
462
+ const pkgJsonPath = join(this.configService.ui.homebridgePackagePath, 'package.json');
463
+ if (await pathExists(pkgJsonPath)) {
464
+ return await this.parsePackageJson(await readJson(pkgJsonPath), this.configService.ui.homebridgePackagePath);
440
465
  }
441
466
  else {
442
467
  this.logger.error(`The Homebridge path ${this.configService.ui.homebridgePackagePath} does not exist.`);
@@ -456,20 +481,20 @@ let PluginsService = PluginsService_1 = class PluginsService {
456
481
  throw new Error('Unable To Find Homebridge Installation.');
457
482
  }
458
483
  const homebridgeModule = homebridgeInstalls[0];
459
- const pkgJson = await (0, fs_extra_1.readJson)((0, node_path_1.join)(homebridgeModule.installPath, 'package.json'));
484
+ const pkgJson = await readJson(join(homebridgeModule.installPath, 'package.json'));
460
485
  const homebridge = await this.parsePackageJson(pkgJson, homebridgeModule.path);
461
486
  if (!homebridge.latestVersion) {
462
487
  return homebridge;
463
488
  }
464
- const homebridgeVersion = (0, semver_1.parse)(homebridge.installedVersion);
489
+ const homebridgeVersion = parse(homebridge.installedVersion);
465
490
  const installedTag = homebridgeVersion.prerelease[0]?.toString();
466
491
  if (!homebridge.updateAvailable) {
467
- const shouldCheckBetas = (installedTag && ['alpha', 'beta', 'test'].includes(installedTag) && (0, semver_1.gt)(homebridge.installedVersion, homebridge.latestVersion))
492
+ const shouldCheckBetas = (installedTag && ['alpha', 'beta', 'test'].includes(installedTag) && gt(homebridge.installedVersion, homebridge.latestVersion))
468
493
  || this.configService.ui.plugins?.alwaysShowBetas;
469
494
  if (shouldCheckBetas) {
470
495
  const versions = await this.getAvailablePluginVersions('homebridge');
471
496
  const targetTag = this.configService.ui.plugins?.alwaysShowBetas && !installedTag ? 'beta' : installedTag;
472
- if (versions.tags[targetTag] && (0, semver_1.gt)(versions.tags[targetTag], homebridge.installedVersion)) {
497
+ if (versions.tags[targetTag] && gt(versions.tags[targetTag], homebridge.installedVersion)) {
473
498
  homebridge.latestVersion = versions.tags[targetTag];
474
499
  homebridge.updateAvailable = true;
475
500
  homebridge.updateEngines = versions.versions?.[homebridge.latestVersion]?.engines || null;
@@ -489,11 +514,11 @@ let PluginsService = PluginsService_1 = class PluginsService {
489
514
  let installPath = homebridge.installPath;
490
515
  const installOptions = [];
491
516
  installOptions.push('--omit=dev');
492
- if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
517
+ if (installPath === this.configService.customPluginPath && await pathExists(resolve(installPath, '../package.json'))) {
493
518
  installOptions.push('--save');
494
519
  }
495
- installPath = (0, node_path_1.resolve)(installPath, '../');
496
- if (homebridge.globalInstall || (0, node_os_1.platform)() === 'win32') {
520
+ installPath = resolve(installPath, '../');
521
+ if (homebridge.globalInstall || platform() === 'win32') {
497
522
  installOptions.push('-g');
498
523
  }
499
524
  await this.runNpmCommand([...this.npm, 'install', ...installOptions, `${homebridge.name}@${homebridgeUpdateAction.version}`], installPath, client, homebridgeUpdateAction.termCols, homebridgeUpdateAction.termRows);
@@ -513,9 +538,9 @@ let PluginsService = PluginsService_1 = class PluginsService {
513
538
  if (!npmPkg) {
514
539
  throw new Error('Could not find npm package');
515
540
  }
516
- const pkgJson = await (0, fs_extra_1.readJson)((0, node_path_1.join)(npmPkg.installPath, 'package.json'));
541
+ const pkgJson = await readJson(join(npmPkg.installPath, 'package.json'));
517
542
  const npm = await this.parsePackageJson(pkgJson, npmPkg.path);
518
- npm.showUpdateWarning = (0, semver_1.lt)(npm.installedVersion, '9.5.0');
543
+ npm.showUpdateWarning = lt(npm.installedVersion, '9.5.0');
519
544
  this.npmPackage = npm;
520
545
  return npm;
521
546
  }
@@ -528,7 +553,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
528
553
  && pluginAction.version !== 'latest') {
529
554
  try {
530
555
  const repoVersion = pluginAction.name.startsWith('@') ? 'v1.0.0-1' : 'v1.0.0';
531
- await (0, rxjs_1.firstValueFrom)(this.httpService.head(`https://github.com/homebridge/plugins/releases/download/${repoVersion}/${pluginAction.name.replace('/', '@')}-${pluginAction.version}.sha256`));
556
+ await firstValueFrom(this.httpService.head(`https://github.com/homebridge/plugins/releases/download/${repoVersion}/${pluginAction.name.replace('/', '@')}-${pluginAction.version}.sha256`));
532
557
  return true;
533
558
  }
534
559
  catch (e) {
@@ -540,7 +565,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
540
565
  }
541
566
  }
542
567
  async doPluginBundleUpdate(pluginAction, client) {
543
- const pluginUpgradeInstallScriptPath = (0, node_path_1.join)(node_process_1.default.env.UIX_BASE_PATH, 'scripts/upgrade-install-plugin.sh');
568
+ const pluginUpgradeInstallScriptPath = join(process.env.UIX_BASE_PATH, 'scripts/upgrade-install-plugin.sh');
544
569
  await this.runNpmCommand([pluginUpgradeInstallScriptPath, pluginAction.name, pluginAction.version, this.configService.customPluginPath], this.configService.storagePath, client, pluginAction.termCols, pluginAction.termRows);
545
570
  return true;
546
571
  }
@@ -550,18 +575,18 @@ let PluginsService = PluginsService_1 = class PluginsService {
550
575
  '/usr/lib/node_modules',
551
576
  '/opt/homebridge/lib/node_modules',
552
577
  '/var/packages/homebridge/target/app/lib/node_modules',
553
- ].includes((0, node_path_1.dirname)(node_process_1.default.env.UIX_BASE_PATH))
578
+ ].includes(dirname(process.env.UIX_BASE_PATH))
554
579
  && pluginAction.name === this.configService.name
555
580
  && !['latest', 'alpha', 'beta'].includes(pluginAction.version)) {
556
581
  try {
557
582
  try {
558
583
  const withV = `v${pluginAction.version}`;
559
- await (0, rxjs_1.firstValueFrom)(this.httpService.head(`https://github.com/homebridge/homebridge-config-ui-x/releases/download/${withV}/homebridge-config-ui-x-${pluginAction.version}.tar.gz`));
584
+ await firstValueFrom(this.httpService.head(`https://github.com/homebridge/homebridge-config-ui-x/releases/download/${withV}/homebridge-config-ui-x-${pluginAction.version}.tar.gz`));
560
585
  return withV;
561
586
  }
562
587
  catch (e2) {
563
588
  const withoutV = pluginAction.version;
564
- await (0, rxjs_1.firstValueFrom)(this.httpService.head(`https://github.com/homebridge/homebridge-config-ui-x/releases/download/${withoutV}/homebridge-config-ui-x-${pluginAction.version}.tar.gz`));
589
+ await firstValueFrom(this.httpService.head(`https://github.com/homebridge/homebridge-config-ui-x/releases/download/${withoutV}/homebridge-config-ui-x-${pluginAction.version}.tar.gz`));
565
590
  return withoutV;
566
591
  }
567
592
  }
@@ -575,21 +600,21 @@ let PluginsService = PluginsService_1 = class PluginsService {
575
600
  }
576
601
  }
577
602
  async doUiBundleUpdate(pluginAction, client, githubReleaseName) {
578
- const prefix = (0, node_path_1.dirname)((0, node_path_1.dirname)((0, node_path_1.dirname)(node_process_1.default.env.UIX_BASE_PATH)));
579
- const upgradeInstallScriptPath = (0, node_path_1.join)(node_process_1.default.env.UIX_BASE_PATH, 'scripts/upgrade-install.sh');
580
- await this.runNpmCommand(this.configService.ui.sudo ? ['npm', 'run', 'upgrade-install', '--', pluginAction.version, prefix, githubReleaseName] : [upgradeInstallScriptPath, pluginAction.version, prefix, githubReleaseName], node_process_1.default.env.UIX_BASE_PATH, client, pluginAction.termCols, pluginAction.termRows);
603
+ const prefix = dirname(dirname(dirname(process.env.UIX_BASE_PATH)));
604
+ const upgradeInstallScriptPath = join(process.env.UIX_BASE_PATH, 'scripts/upgrade-install.sh');
605
+ await this.runNpmCommand(this.configService.ui.sudo ? ['npm', 'run', 'upgrade-install', '--', pluginAction.version, prefix, githubReleaseName] : [upgradeInstallScriptPath, pluginAction.version, prefix, githubReleaseName], process.env.UIX_BASE_PATH, client, pluginAction.termCols, pluginAction.termRows);
581
606
  }
582
607
  async updateSelfOffline(client) {
583
- client.emit('stdout', (0, bash_color_1.yellow)(`${this.configService.name} has been scheduled to update on the next container restart.\n\r\n\r`));
608
+ client.emit('stdout', yellow(`${this.configService.name} has been scheduled to update on the next container restart.\n\r\n\r`));
584
609
  await new Promise(res => setTimeout(res, 800));
585
- client.emit('stdout', (0, bash_color_1.yellow)('The Docker container will now try and restart.\n\r\n\r'));
610
+ client.emit('stdout', yellow('The Docker container will now try and restart.\n\r\n\r'));
586
611
  await new Promise(res => setTimeout(res, 800));
587
- client.emit('stdout', (0, bash_color_1.yellow)('If you have not started the Docker container with ')
588
- + (0, bash_color_1.red)('--restart=always') + (0, bash_color_1.yellow)(' you may\n\rneed to manually start the container again.\n\r\n\r'));
612
+ client.emit('stdout', yellow('If you have not started the Docker container with ')
613
+ + red('--restart=always') + yellow(' you may\n\rneed to manually start the container again.\n\r\n\r'));
589
614
  await new Promise(res => setTimeout(res, 800));
590
- client.emit('stdout', (0, bash_color_1.yellow)('This process may take several minutes. Please be patient.\n\r'));
615
+ client.emit('stdout', yellow('This process may take several minutes. Please be patient.\n\r'));
591
616
  await new Promise(res => setTimeout(res, 10000));
592
- await (0, fs_extra_1.createFile)('/homebridge/.uix-upgrade-on-restart');
617
+ await createFile('/homebridge/.uix-upgrade-on-restart');
593
618
  }
594
619
  async getPluginConfigSchema(pluginName) {
595
620
  if (!this.installedPlugins) {
@@ -597,19 +622,19 @@ let PluginsService = PluginsService_1 = class PluginsService {
597
622
  }
598
623
  const plugin = this.installedPlugins.find(x => x.name === pluginName);
599
624
  if (!plugin) {
600
- throw new common_1.NotFoundException();
625
+ throw new NotFoundException();
601
626
  }
602
627
  if (!plugin.settingsSchema) {
603
- throw new common_1.NotFoundException();
628
+ throw new NotFoundException();
604
629
  }
605
- const schemaPath = (0, node_path_1.resolve)(plugin.installPath, pluginName, 'config.schema.json');
606
- let configSchema = await (0, fs_extra_1.readJson)(schemaPath);
630
+ const schemaPath = resolve(plugin.installPath, pluginName, 'config.schema.json');
631
+ let configSchema = await readJson(schemaPath);
607
632
  if (configSchema.dynamicSchemaVersion) {
608
- const dynamicSchemaPath = (0, node_path_1.resolve)(this.configService.storagePath, `.${pluginName}-v${configSchema.dynamicSchemaVersion}.schema.json`);
633
+ const dynamicSchemaPath = resolve(this.configService.storagePath, `.${pluginName}-v${configSchema.dynamicSchemaVersion}.schema.json`);
609
634
  this.logger.log(`[${pluginName}] dynamic schema path: ${dynamicSchemaPath}.`);
610
- if ((0, fs_extra_1.existsSync)(dynamicSchemaPath)) {
635
+ if (existsSync(dynamicSchemaPath)) {
611
636
  try {
612
- configSchema = await (0, fs_extra_1.readJson)(dynamicSchemaPath);
637
+ configSchema = await readJson(dynamicSchemaPath);
613
638
  this.logger.log(`[${pluginName}] dynamic schema loaded from ${dynamicSchemaPath}.`);
614
639
  }
615
640
  catch (e) {
@@ -695,34 +720,34 @@ let PluginsService = PluginsService_1 = class PluginsService {
695
720
  await this.getInstalledPlugins();
696
721
  const plugin = this.installedPlugins.find(x => x.name === pluginName);
697
722
  if (!plugin) {
698
- throw new common_1.NotFoundException();
723
+ throw new NotFoundException();
699
724
  }
700
- const changeLog = (0, node_path_1.resolve)(plugin.installPath, plugin.name, 'CHANGELOG.md');
701
- if (await (0, fs_extra_1.pathExists)(changeLog)) {
725
+ const changeLog = resolve(plugin.installPath, plugin.name, 'CHANGELOG.md');
726
+ if (await pathExists(changeLog)) {
702
727
  return {
703
- changelog: await (0, fs_extra_1.readFile)(changeLog, 'utf8'),
728
+ changelog: await readFile(changeLog, 'utf8'),
704
729
  };
705
730
  }
706
731
  else {
707
- throw new common_1.NotFoundException();
732
+ throw new NotFoundException();
708
733
  }
709
734
  }
710
735
  async getPluginRelease(pluginName) {
711
736
  let latestVersion = null;
712
737
  try {
713
- const pkg = (await (0, rxjs_1.firstValueFrom)((this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(pluginName).replace(/%40/g, '@')}`)))).data;
738
+ const pkg = (await firstValueFrom((this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(pluginName).replace(/%40/g, '@')}`)))).data;
714
739
  latestVersion = pkg['dist-tags'] ? pkg['dist-tags'].latest : null;
715
740
  }
716
741
  catch (e) {
717
- throw new common_1.NotFoundException();
742
+ throw new NotFoundException();
718
743
  }
719
744
  switch (pluginName) {
720
745
  case 'homebridge':
721
746
  case 'homebridge-config-ui-x': {
722
747
  try {
723
- const release = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://api.github.com/repos/homebridge/${pluginName}/releases/latest`));
724
- const tags = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://api.github.com/repos/homebridge/${pluginName}/tags`));
725
- const changelog = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://raw.githubusercontent.com/homebridge/${pluginName}/refs/tags/${tags.data[0].name}/CHANGELOG.md`));
748
+ const release = await firstValueFrom(this.httpService.get(`https://api.github.com/repos/homebridge/${pluginName}/releases/latest`));
749
+ const tags = await firstValueFrom(this.httpService.get(`https://api.github.com/repos/homebridge/${pluginName}/tags`));
750
+ const changelog = await firstValueFrom(this.httpService.get(`https://raw.githubusercontent.com/homebridge/${pluginName}/refs/tags/${tags.data[0].name}/CHANGELOG.md`));
726
751
  return {
727
752
  name: release.data.name,
728
753
  notes: release.data.body,
@@ -743,33 +768,33 @@ let PluginsService = PluginsService_1 = class PluginsService {
743
768
  await this.getInstalledPlugins();
744
769
  const plugin = this.installedPlugins.find(x => x.name === pluginName);
745
770
  if (!plugin) {
746
- throw new common_1.NotFoundException();
771
+ throw new NotFoundException();
747
772
  }
748
773
  if (!plugin.links.homepage && !plugin.links.bugs) {
749
- throw new common_1.NotFoundException();
774
+ throw new NotFoundException();
750
775
  }
751
776
  const repoMatch = plugin.links.homepage?.match(/https:\/\/github.com\/([^/]+)\/([^/#]+)/);
752
777
  const bugsMatch = plugin.links.bugs?.match(/https:\/\/github.com\/([^/]+)\/([^/#]+)/);
753
778
  let match = repoMatch;
754
779
  if (!repoMatch) {
755
780
  if (!bugsMatch) {
756
- throw new common_1.NotFoundException();
781
+ throw new NotFoundException();
757
782
  }
758
783
  match = bugsMatch;
759
784
  }
760
785
  try {
761
- const release = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://api.github.com/repos/${match[1]}/${match[2]}/releases/latest`));
786
+ const release = await firstValueFrom(this.httpService.get(`https://api.github.com/repos/${match[1]}/${match[2]}/releases/latest`));
762
787
  const latestTag = release.data.tag_name;
763
788
  const isReleaseMatch = latestVersion?.replace(/[^0-9.]/g, '').includes(release.data.tag_name?.replace(/[^0-9.]/g, ''));
764
789
  const changelogPath = this.pluginChangelogs[pluginName] || '';
765
790
  let changelogData = null;
766
791
  try {
767
- const changelog = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://raw.githubusercontent.com/${match[1]}/${match[2]}/refs/tags/${latestTag}/${changelogPath}CHANGELOG.md`));
792
+ const changelog = await firstValueFrom(this.httpService.get(`https://raw.githubusercontent.com/${match[1]}/${match[2]}/refs/tags/${latestTag}/${changelogPath}CHANGELOG.md`));
768
793
  changelogData = changelog.data;
769
794
  }
770
795
  catch {
771
796
  try {
772
- const changelog = (await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://raw.githubusercontent.com/${match[1]}/${match[2]}/refs/tags/${latestTag}/${changelogPath}changelog.md`))).data;
797
+ const changelog = (await firstValueFrom(this.httpService.get(`https://raw.githubusercontent.com/${match[1]}/${match[2]}/refs/tags/${latestTag}/${changelogPath}changelog.md`))).data;
773
798
  changelogData = changelog.data;
774
799
  }
775
800
  catch { }
@@ -782,7 +807,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
782
807
  };
783
808
  }
784
809
  catch (e) {
785
- throw new common_1.NotFoundException();
810
+ throw new NotFoundException();
786
811
  }
787
812
  }
788
813
  }
@@ -793,7 +818,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
793
818
  }
794
819
  const plugin = this.installedPlugins.find(x => x.name === pluginName);
795
820
  if (!plugin) {
796
- throw new common_1.NotFoundException();
821
+ throw new NotFoundException();
797
822
  }
798
823
  const fromCache = this.pluginAliasCache.get(pluginName);
799
824
  if (fromCache) {
@@ -811,9 +836,9 @@ let PluginsService = PluginsService_1 = class PluginsService {
811
836
  else {
812
837
  try {
813
838
  await new Promise((res, rej) => {
814
- const child = (0, node_child_process_1.fork)((0, node_path_1.resolve)(node_process_1.default.env.UIX_BASE_PATH, 'scripts/extract-plugin-alias.js'), {
839
+ const child = fork(resolve(process.env.UIX_BASE_PATH, 'scripts/extract-plugin-alias.js'), {
815
840
  env: {
816
- UIX_EXTRACT_PLUGIN_PATH: (0, node_path_1.resolve)(plugin.installPath, plugin.name),
841
+ UIX_EXTRACT_PLUGIN_PATH: resolve(plugin.installPath, plugin.name),
817
842
  },
818
843
  stdio: 'ignore',
819
844
  });
@@ -850,19 +875,19 @@ let PluginsService = PluginsService_1 = class PluginsService {
850
875
  await this.getInstalledPlugins();
851
876
  }
852
877
  const plugin = this.installedPlugins.find(x => x.name === pluginName);
853
- const fullPath = (0, node_path_1.resolve)(plugin.installPath, plugin.name);
854
- const schema = await (0, fs_extra_1.readJson)((0, node_path_1.resolve)(fullPath, 'config.schema.json'));
855
- const customUiPath = (0, node_path_1.resolve)(fullPath, schema.customUiPath || 'homebridge-ui');
856
- const publicPath = (0, node_path_1.resolve)(customUiPath, 'public');
857
- const serverPath = (0, node_path_1.resolve)(customUiPath, 'server.js');
878
+ const fullPath = resolve(plugin.installPath, plugin.name);
879
+ const schema = await readJson(resolve(fullPath, 'config.schema.json'));
880
+ const customUiPath = resolve(fullPath, schema.customUiPath || 'homebridge-ui');
881
+ const publicPath = resolve(customUiPath, 'public');
882
+ const serverPath = resolve(customUiPath, 'server.js');
858
883
  const devServer = plugin.private ? schema.customUiDevServer : null;
859
- if (!devServer && !await (0, fs_extra_1.pathExists)(customUiPath)) {
884
+ if (!devServer && !await pathExists(customUiPath)) {
860
885
  throw new Error(`Plugin does not provide a custom UI at expected location: ${customUiPath}`);
861
886
  }
862
- if (!devServer && !(await (0, fs_extra_1.realpath)(customUiPath)).startsWith(await (0, fs_extra_1.realpath)(fullPath))) {
863
- throw new Error(`Custom UI path is outside the plugin root: ${await (0, fs_extra_1.realpath)(customUiPath)}`);
887
+ if (!devServer && !(await realpath(customUiPath)).startsWith(await realpath(fullPath))) {
888
+ throw new Error(`Custom UI path is outside the plugin root: ${await realpath(customUiPath)}`);
864
889
  }
865
- if (await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(publicPath, 'index.html')) || devServer) {
890
+ if (await pathExists(resolve(publicPath, 'index.html')) || devServer) {
866
891
  return {
867
892
  devServer,
868
893
  serverPath,
@@ -874,7 +899,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
874
899
  }
875
900
  async getDisabledPlugins() {
876
901
  try {
877
- const config = await (0, fs_extra_1.readJson)(this.configService.configPath);
902
+ const config = await readJson(this.configService.configPath);
878
903
  if (Array.isArray(config.disabledPlugins)) {
879
904
  return config.disabledPlugins;
880
905
  }
@@ -888,14 +913,14 @@ let PluginsService = PluginsService_1 = class PluginsService {
888
913
  }
889
914
  async getInstalledScopedModules(requiredPath, scope) {
890
915
  try {
891
- if ((await (0, fs_extra_1.stat)((0, node_path_1.join)(requiredPath, scope))).isDirectory()) {
892
- const scopedModules = await (0, fs_extra_1.readdir)((0, node_path_1.join)(requiredPath, scope));
916
+ if ((await stat(join(requiredPath, scope))).isDirectory()) {
917
+ const scopedModules = await readdir(join(requiredPath, scope));
893
918
  return scopedModules
894
919
  .filter(x => x.startsWith('homebridge-'))
895
920
  .map((x) => {
896
921
  return {
897
- name: (0, node_path_1.join)(scope, x).split(node_path_1.sep).join('/'),
898
- installPath: (0, node_path_1.join)(requiredPath, scope, x),
922
+ name: join(scope, x).split(sep).join('/'),
923
+ installPath: join(requiredPath, scope, x),
899
924
  path: requiredPath,
900
925
  };
901
926
  });
@@ -912,7 +937,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
912
937
  async getInstalledModules() {
913
938
  const allModules = [];
914
939
  for (const requiredPath of this.paths) {
915
- const modules = await (0, fs_extra_1.readdir)(requiredPath);
940
+ const modules = await readdir(requiredPath);
916
941
  for (const module of modules) {
917
942
  try {
918
943
  if (module.charAt(0) === '@') {
@@ -921,7 +946,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
921
946
  else {
922
947
  allModules.push({
923
948
  name: module,
924
- installPath: (0, node_path_1.join)(requiredPath, module),
949
+ installPath: join(requiredPath, module),
925
950
  path: requiredPath,
926
951
  });
927
952
  }
@@ -934,16 +959,16 @@ let PluginsService = PluginsService_1 = class PluginsService {
934
959
  if (allModules.findIndex(x => x.name === 'homebridge-config-ui-x') === -1) {
935
960
  allModules.push({
936
961
  name: 'homebridge-config-ui-x',
937
- installPath: node_process_1.default.env.UIX_BASE_PATH,
938
- path: (0, node_path_1.dirname)(node_process_1.default.env.UIX_BASE_PATH),
962
+ installPath: process.env.UIX_BASE_PATH,
963
+ path: dirname(process.env.UIX_BASE_PATH),
939
964
  });
940
965
  }
941
966
  if (allModules.findIndex(x => x.name === 'homebridge') === -1) {
942
- if ((0, fs_extra_1.existsSync)((0, node_path_1.join)(node_process_1.default.env.UIX_BASE_PATH, '..', 'homebridge'))) {
967
+ if (existsSync(join(process.env.UIX_BASE_PATH, '..', 'homebridge'))) {
943
968
  allModules.push({
944
969
  name: 'homebridge',
945
- installPath: (0, node_path_1.join)(node_process_1.default.env.UIX_BASE_PATH, '..', 'homebridge'),
946
- path: (0, node_path_1.dirname)((0, node_path_1.join)(node_process_1.default.env.UIX_BASE_PATH, '..', 'homebridge')),
970
+ installPath: join(process.env.UIX_BASE_PATH, '..', 'homebridge'),
971
+ path: dirname(join(process.env.UIX_BASE_PATH, '..', 'homebridge')),
947
972
  });
948
973
  }
949
974
  }
@@ -953,12 +978,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
953
978
  return (name.charAt(0) === '@' && name.split('/').length > 0 && name.split('/')[1].indexOf('homebridge-') === 0);
954
979
  }
955
980
  getNpmPath() {
956
- if ((0, node_os_1.platform)() === 'win32') {
981
+ if (platform() === 'win32') {
957
982
  const windowsNpmPath = [
958
- (0, node_path_1.join)(node_process_1.default.env.APPDATA, 'npm/npm.cmd'),
959
- (0, node_path_1.join)(node_process_1.default.env.ProgramFiles, 'nodejs/npm.cmd'),
960
- (0, node_path_1.join)(node_process_1.default.env.NVM_SYMLINK || `${node_process_1.default.env.ProgramFiles}/nodejs`, 'npm.cmd'),
961
- ].filter(fs_extra_1.existsSync);
983
+ join(process.env.APPDATA, 'npm/npm.cmd'),
984
+ join(process.env.ProgramFiles, 'nodejs/npm.cmd'),
985
+ join(process.env.NVM_SYMLINK || `${process.env.ProgramFiles}/nodejs`, 'npm.cmd'),
986
+ ].filter(existsSync);
962
987
  if (windowsNpmPath.length) {
963
988
  return [windowsNpmPath[0]];
964
989
  }
@@ -981,33 +1006,33 @@ let PluginsService = PluginsService_1 = class PluginsService {
981
1006
  }
982
1007
  else {
983
1008
  paths = paths.concat(require.main?.paths || []);
984
- if (node_process_1.default.env.NODE_PATH) {
985
- paths = node_process_1.default.env.NODE_PATH.split(node_path_1.delimiter).filter(p => !!p).concat(paths);
1009
+ if (process.env.NODE_PATH) {
1010
+ paths = process.env.NODE_PATH.split(delimiter).filter(p => !!p).concat(paths);
986
1011
  }
987
1012
  else {
988
- if (((0, node_os_1.platform)() !== 'win32')) {
1013
+ if ((platform() !== 'win32')) {
989
1014
  paths.push('/usr/local/lib/node_modules');
990
1015
  paths.push('/usr/lib/node_modules');
991
1016
  }
992
1017
  paths.push(...this.getNpmPrefixToSearchPaths());
993
1018
  }
994
- paths = paths.filter(x => x !== (0, node_path_1.join)(node_process_1.default.env.UIX_BASE_PATH, 'node_modules'));
1019
+ paths = paths.filter(x => x !== join(process.env.UIX_BASE_PATH, 'node_modules'));
995
1020
  }
996
- return (0, lodash_1.uniq)(paths).filter((requiredPath) => {
997
- return (0, fs_extra_1.existsSync)(requiredPath);
1021
+ return uniq(paths).filter((requiredPath) => {
1022
+ return existsSync(requiredPath);
998
1023
  });
999
1024
  }
1000
1025
  getNpmPrefixToSearchPaths() {
1001
1026
  const paths = [];
1002
- if (((0, node_os_1.platform)() === 'win32')) {
1003
- paths.push((0, node_path_1.join)(node_process_1.default.env.APPDATA, 'npm/node_modules'));
1027
+ if ((platform() === 'win32')) {
1028
+ paths.push(join(process.env.APPDATA, 'npm/node_modules'));
1004
1029
  }
1005
1030
  else {
1006
- paths.push((0, node_child_process_1.execSync)('/bin/echo -n "$(npm -g prefix)/lib/node_modules"', {
1031
+ paths.push(execSync('/bin/echo -n "$(npm -g prefix)/lib/node_modules"', {
1007
1032
  env: Object.assign({
1008
1033
  npm_config_loglevel: 'silent',
1009
1034
  npm_update_notifier: 'false',
1010
- }, node_process_1.default.env),
1035
+ }, process.env),
1011
1036
  }).toString('utf8'));
1012
1037
  }
1013
1038
  return paths;
@@ -1030,7 +1055,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
1030
1055
  isHbMaintained: this.maintainedPlugins.includes(pkgJson.name),
1031
1056
  installedVersion: installPath ? (pkgJson.version || '0.0.1') : null,
1032
1057
  globalInstall: (installPath !== this.configService.customPluginPath),
1033
- settingsSchema: await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, pkgJson.name, 'config.schema.json')),
1058
+ settingsSchema: await pathExists(resolve(installPath, pkgJson.name, 'config.schema.json')),
1034
1059
  engines: pkgJson.engines,
1035
1060
  installPath,
1036
1061
  };
@@ -1049,20 +1074,20 @@ let PluginsService = PluginsService_1 = class PluginsService {
1049
1074
  const fromCache = this.npmPluginCache.get(plugin.name);
1050
1075
  plugin.updateAvailable = false;
1051
1076
  plugin.updateTag = null;
1052
- const pkg = fromCache || (await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(plugin.name).replace(/%40/g, '@')}/latest`))).data;
1077
+ const pkg = fromCache || (await firstValueFrom(this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(plugin.name).replace(/%40/g, '@')}/latest`))).data;
1053
1078
  plugin.latestVersion = pkg.version;
1054
- plugin.updateAvailable = (0, semver_1.gt)(pkg.version, plugin.installedVersion);
1079
+ plugin.updateAvailable = gt(pkg.version, plugin.installedVersion);
1055
1080
  plugin.updateEngines = plugin.updateAvailable ? pkg.engines : null;
1056
1081
  if (!plugin.updateAvailable) {
1057
- const pluginVersion = (0, semver_1.parse)(plugin.installedVersion);
1082
+ const pluginVersion = parse(plugin.installedVersion);
1058
1083
  const installedTag = pluginVersion.prerelease[0]?.toString();
1059
1084
  const shouldCheckBetas = (installedTag
1060
1085
  && ['alpha', 'beta', 'test'].includes(installedTag)
1061
- && (0, semver_1.gt)(plugin.installedVersion, plugin.latestVersion)) || this.configService.ui.plugins?.alwaysShowBetas;
1086
+ && gt(plugin.installedVersion, plugin.latestVersion)) || this.configService.ui.plugins?.alwaysShowBetas;
1062
1087
  if (shouldCheckBetas) {
1063
1088
  const versions = await this.getAvailablePluginVersions(plugin.name);
1064
1089
  const targetTag = this.configService.ui.plugins?.alwaysShowBetas && !installedTag ? 'beta' : installedTag;
1065
- if (versions.tags[targetTag] && (0, semver_1.gt)(versions.tags[targetTag], plugin.installedVersion)) {
1090
+ if (versions.tags[targetTag] && gt(versions.tags[targetTag], plugin.installedVersion)) {
1066
1091
  plugin.latestVersion = versions.tags[targetTag];
1067
1092
  plugin.updateAvailable = true;
1068
1093
  plugin.updateEngines = versions.versions?.[plugin.latestVersion]?.engines || null;
@@ -1096,7 +1121,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
1096
1121
  }
1097
1122
  async getNpmModuleLatestVersion(npmModuleName) {
1098
1123
  try {
1099
- const response = await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://registry.npmjs.org/${npmModuleName}/latest`));
1124
+ const response = await firstValueFrom(this.httpService.get(`https://registry.npmjs.org/${npmModuleName}/latest`));
1100
1125
  return response.data.version;
1101
1126
  }
1102
1127
  catch (e) {
@@ -1113,29 +1138,29 @@ let PluginsService = PluginsService_1 = class PluginsService {
1113
1138
  else {
1114
1139
  let npmInstallPath;
1115
1140
  try {
1116
- npmInstallPath = (0, node_child_process_1.execSync)('npm root -g').toString().trim();
1141
+ npmInstallPath = execSync('npm root -g').toString().trim();
1117
1142
  }
1118
1143
  catch (e) {
1119
- npmInstallPath = (0, node_path_1.resolve)(cwd, 'node_modules');
1144
+ npmInstallPath = resolve(cwd, 'node_modules');
1120
1145
  }
1121
1146
  try {
1122
- await (0, fs_extra_1.access)(npmInstallPath, fs_extra_1.constants.W_OK);
1147
+ await access(npmInstallPath, constants.W_OK);
1123
1148
  }
1124
1149
  catch (e) {
1125
- client.emit('stdout', (0, bash_color_1.yellow)(`The user "${(0, node_os_1.userInfo)().username}" does not have write access to the target directory:\n\r\n\r`));
1150
+ client.emit('stdout', yellow(`The user "${userInfo().username}" does not have write access to the target directory:\n\r\n\r`));
1126
1151
  client.emit('stdout', `${npmInstallPath}\n\r\n\r`);
1127
- client.emit('stdout', (0, bash_color_1.yellow)('This may cause the operation to fail.\n\r'));
1128
- client.emit('stdout', (0, bash_color_1.yellow)('See the docs for details on how to enable sudo mode:\n\r'));
1129
- client.emit('stdout', (0, bash_color_1.yellow)('https://github.com/homebridge/homebridge-config-ui-x/wiki/Manual-Configuration#sudo-mode\n\r\n\r'));
1152
+ client.emit('stdout', yellow('This may cause the operation to fail.\n\r'));
1153
+ client.emit('stdout', yellow('See the docs for details on how to enable sudo mode:\n\r'));
1154
+ client.emit('stdout', yellow('https://github.com/homebridge/homebridge-config-ui-x/wiki/Manual-Configuration#sudo-mode\n\r\n\r'));
1130
1155
  }
1131
1156
  }
1132
1157
  this.logger.log(`Running command ${command.join(' ')}.`);
1133
- if (!(0, semver_1.satisfies)(node_process_1.default.version, `>=${this.configService.minimumNodeVersion}`)) {
1134
- client.emit('stdout', (0, bash_color_1.yellow)(`Node.js v${this.configService.minimumNodeVersion} higher is required for ${this.configService.name}.\n\r`));
1135
- client.emit('stdout', (0, bash_color_1.yellow)(`You may experience issues while running on Node.js ${node_process_1.default.version}.\n\r\n\r`));
1158
+ if (!satisfies(process.version, `>=${this.configService.minimumNodeVersion}`)) {
1159
+ client.emit('stdout', yellow(`Node.js v${this.configService.minimumNodeVersion} higher is required for ${this.configService.name}.\n\r`));
1160
+ client.emit('stdout', yellow(`You may experience issues while running on Node.js ${process.version}.\n\r\n\r`));
1136
1161
  }
1137
1162
  const env = {};
1138
- Object.assign(env, node_process_1.default.env);
1163
+ Object.assign(env, process.env);
1139
1164
  Object.assign(env, {
1140
1165
  npm_config_global_style: 'true',
1141
1166
  npm_config_unsafe_perm: 'true',
@@ -1144,20 +1169,20 @@ let PluginsService = PluginsService_1 = class PluginsService {
1144
1169
  npm_config_foreground_scripts: 'true',
1145
1170
  npm_config_loglevel: 'error',
1146
1171
  });
1147
- if (command.includes('-g') && (0, node_path_1.basename)(cwd) === 'lib') {
1148
- cwd = (0, node_path_1.dirname)(cwd);
1172
+ if (command.includes('-g') && basename(cwd) === 'lib') {
1173
+ cwd = dirname(cwd);
1149
1174
  Object.assign(env, {
1150
1175
  npm_config_prefix: cwd,
1151
1176
  });
1152
1177
  }
1153
- if ((0, node_os_1.platform)() === 'win32') {
1178
+ if (platform() === 'win32') {
1154
1179
  Object.assign(env, {
1155
1180
  npm_config_prefix: cwd,
1156
1181
  });
1157
1182
  }
1158
- client.emit('stdout', (0, bash_color_1.cyan)(`USER: ${(0, node_os_1.userInfo)().username}\n\r`));
1159
- client.emit('stdout', (0, bash_color_1.cyan)(`DIR: ${cwd}\n\r`));
1160
- client.emit('stdout', (0, bash_color_1.cyan)(`CMD: ${command.join(' ')}\n\r\n\r`));
1183
+ client.emit('stdout', cyan(`USER: ${userInfo().username}\n\r`));
1184
+ client.emit('stdout', cyan(`DIR: ${cwd}\n\r`));
1185
+ client.emit('stdout', cyan(`CMD: ${command.join(' ')}\n\r\n\r`));
1161
1186
  this.installedPluginsCache.del('installed-plugins');
1162
1187
  await new Promise((res, rej) => {
1163
1188
  const term = this.nodePtyService.spawn(command.shift(), command, {
@@ -1173,7 +1198,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
1173
1198
  term.onExit(({ exitCode }) => {
1174
1199
  if (exitCode === 0) {
1175
1200
  clearTimeout(timeoutTimer);
1176
- client.emit('stdout', (0, bash_color_1.green)('\n\rOperation succeeded!.\n\r'));
1201
+ client.emit('stdout', green('\n\rOperation succeeded!.\n\r'));
1177
1202
  res(null);
1178
1203
  }
1179
1204
  else {
@@ -1190,10 +1215,10 @@ let PluginsService = PluginsService_1 = class PluginsService {
1190
1215
  if (!this.configService.customPluginPath) {
1191
1216
  return;
1192
1217
  }
1193
- if (!await (0, fs_extra_1.pathExists)(this.configService.customPluginPath)) {
1218
+ if (!await pathExists(this.configService.customPluginPath)) {
1194
1219
  this.logger.warn(`Custom plugin directory was removed, re-creating ${this.configService.customPluginPath}.`);
1195
1220
  try {
1196
- await (0, fs_extra_1.ensureDir)(this.configService.customPluginPath);
1221
+ await ensureDir(this.configService.customPluginPath);
1197
1222
  }
1198
1223
  catch (e) {
1199
1224
  this.logger.error(`Failed to re-create custom plugin directory as ${e.message}.`);
@@ -1204,10 +1229,10 @@ let PluginsService = PluginsService_1 = class PluginsService {
1204
1229
  if (!this.configService.customPluginPath) {
1205
1230
  return;
1206
1231
  }
1207
- const offendingPath = (0, node_path_1.resolve)(this.configService.customPluginPath, '@eaDir');
1232
+ const offendingPath = resolve(this.configService.customPluginPath, '@eaDir');
1208
1233
  try {
1209
- if (!await (0, fs_extra_1.pathExists)(offendingPath)) {
1210
- await (0, fs_extra_1.remove)(offendingPath);
1234
+ if (!await pathExists(offendingPath)) {
1235
+ await remove(offendingPath);
1211
1236
  }
1212
1237
  }
1213
1238
  catch (e) {
@@ -1221,7 +1246,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
1221
1246
  }
1222
1247
  return new Promise((res) => {
1223
1248
  const fullCommand = command.join(' ');
1224
- const child = (0, node_child_process_1.spawn)(fullCommand, { shell: true });
1249
+ const child = spawn(fullCommand, { shell: true });
1225
1250
  child.on('exit', (code) => {
1226
1251
  this.logger.log(`Executed npm cache clear command with exit code ${code}.`);
1227
1252
  res(null);
@@ -1233,7 +1258,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
1233
1258
  async loadPluginList() {
1234
1259
  clearTimeout(this.pluginListRetryTimeout);
1235
1260
  try {
1236
- const pluginList = (await (0, rxjs_1.firstValueFrom)(this.httpService.get(this.pluginListFile, {
1261
+ const pluginList = (await firstValueFrom(this.httpService.get(this.pluginListFile, {
1237
1262
  httpsAgent: null,
1238
1263
  })));
1239
1264
  const pluginListData = pluginList.data;
@@ -1283,13 +1308,16 @@ let PluginsService = PluginsService_1 = class PluginsService {
1283
1308
  }
1284
1309
  }
1285
1310
  };
1286
- exports.PluginsService = PluginsService;
1287
- PluginsService.PLUGIN_IDENTIFIER_PATTERN = /^(@[\w-]+(\.[\w-]+)*\/)?homebridge-[\w-]+$/;
1288
- exports.PluginsService = PluginsService = PluginsService_1 = __decorate([
1289
- (0, common_1.Injectable)(),
1290
- __metadata("design:paramtypes", [axios_1.HttpService,
1291
- node_pty_service_1.NodePtyService,
1292
- logger_service_1.Logger,
1293
- config_service_1.ConfigService])
1311
+ PluginsService = PluginsService_1 = __decorate([
1312
+ Injectable(),
1313
+ __param(0, Inject(HttpService)),
1314
+ __param(1, Inject(NodePtyService)),
1315
+ __param(2, Inject(Logger)),
1316
+ __param(3, Inject(ConfigService)),
1317
+ __metadata("design:paramtypes", [HttpService,
1318
+ NodePtyService,
1319
+ Logger,
1320
+ ConfigService])
1294
1321
  ], PluginsService);
1322
+ export { PluginsService };
1295
1323
  //# sourceMappingURL=plugins.service.js.map