homebridge-config-ui-x 5.0.0-beta.5 → 5.0.0-beta.51
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.
- package/CHANGELOG.md +317 -20
- package/CONTRIBUTING.md +5 -4
- package/LICENSE +1 -1
- package/config.schema.json +34 -144
- package/dist/bin/fork.js +17 -7
- package/dist/bin/fork.js.map +1 -1
- package/dist/bin/hb-service.d.ts +2 -2
- package/dist/bin/hb-service.js +68 -57
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/bin/platforms/win32.js +4 -2
- package/dist/bin/platforms/win32.js.map +1 -1
- package/dist/bin/standalone.js +18 -7
- package/dist/bin/standalone.js.map +1 -1
- package/dist/core/auth/auth.controller.d.ts +2 -2
- package/dist/core/auth/auth.controller.js.map +1 -1
- package/dist/core/auth/auth.module.js +1 -1
- package/dist/core/auth/auth.module.js.map +1 -1
- package/dist/core/auth/auth.service.js +10 -10
- package/dist/core/auth/auth.service.js.map +1 -1
- package/dist/core/auth/jwt.strategy.d.ts +3 -1
- package/dist/core/config/config.service.d.ts +4 -6
- package/dist/core/config/config.service.js +6 -9
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/core/config/config.startup.js +2 -2
- package/dist/core/config/config.startup.js.map +1 -1
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js +3 -3
- package/dist/core/homebridge-ipc/homebridge-ipc.service.js.map +1 -1
- package/dist/index.js +6 -67
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/modules/accessories/accessories.controller.js +5 -5
- package/dist/modules/accessories/accessories.controller.js.map +1 -1
- package/dist/modules/accessories/accessories.service.js +7 -6
- package/dist/modules/accessories/accessories.service.js.map +1 -1
- package/dist/modules/backup/backup.controller.js +7 -7
- package/dist/modules/backup/backup.controller.js.map +1 -1
- package/dist/modules/backup/backup.service.js +18 -78
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.service.js +0 -7
- package/dist/modules/child-bridges/child-bridges.service.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +1 -1
- package/dist/modules/config-editor/config-editor.controller.js +8 -8
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +1 -1
- package/dist/modules/config-editor/config-editor.service.js +6 -6
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +11 -9
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
- package/dist/modules/log/log.gateway.d.ts +2 -1
- package/dist/modules/log/log.gateway.js.map +1 -1
- package/dist/modules/log/log.service.js +3 -3
- package/dist/modules/log/log.service.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.controller.js +3 -3
- package/dist/modules/platform-tools/docker/docker.controller.js.map +1 -1
- package/dist/modules/platform-tools/docker/docker.service.js +1 -1
- package/dist/modules/platform-tools/docker/docker.service.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js +3 -3
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.service.js +6 -6
- package/dist/modules/platform-tools/hb-service/hb-service.service.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.controller.js +2 -2
- package/dist/modules/platform-tools/linux/linux.controller.js.map +1 -1
- package/dist/modules/platform-tools/linux/linux.service.js +2 -2
- package/dist/modules/platform-tools/linux/linux.service.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +2 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.service.js +2 -2
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/dist/modules/plugins/plugins.controller.js +4 -4
- package/dist/modules/plugins/plugins.controller.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +3 -1
- package/dist/modules/plugins/plugins.service.js +127 -83
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.controller.d.ts +22 -2
- package/dist/modules/server/server.controller.js +86 -18
- package/dist/modules/server/server.controller.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +24 -6
- package/dist/modules/server/server.service.js +165 -66
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.controller.d.ts +0 -1
- package/dist/modules/status/status.controller.js +3 -4
- package/dist/modules/status/status.controller.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +1 -1
- package/dist/modules/status/status.service.d.ts +1 -1
- package/dist/modules/status/status.service.js +17 -41
- package/dist/modules/status/status.service.js.map +1 -1
- package/dist/modules/users/users.controller.js +7 -7
- package/dist/modules/users/users.controller.js.map +1 -1
- package/dist/self-check.js +6 -6
- package/dist/self-check.js.map +1 -1
- package/package.json +42 -40
- package/public/3rdpartylicenses.txt +87 -61
- package/public/assets/hap-icons/airpurifier.svg +49 -16
- package/public/assets/hap-icons/airquality.svg +24 -13
- package/public/assets/hap-icons/contactsensor-closed.svg +35 -2
- package/public/assets/hap-icons/contactsensor-open.svg +80 -2
- package/public/assets/hap-icons/door-closed.svg +32 -2
- package/public/assets/hap-icons/door-open.svg +48 -2
- package/public/assets/hap-icons/fan-off.svg +24 -13
- package/public/assets/hap-icons/fan-on.svg +24 -13
- package/public/assets/hap-icons/garagedoor.svg +24 -13
- package/public/assets/hap-icons/humidity.svg +24 -13
- package/public/assets/hap-icons/irrigation-system.svg +47 -18
- package/public/assets/hap-icons/leaksensor.svg +52 -2
- package/public/assets/hap-icons/light.svg +47 -28
- package/public/assets/hap-icons/lightbulb.svg +24 -13
- package/public/assets/hap-icons/lock-locked.svg +24 -13
- package/public/assets/hap-icons/lock-unlocked.svg +24 -13
- package/public/assets/hap-icons/motionsensor.svg +100 -2
- package/public/assets/hap-icons/occupancysensor.svg +97 -2
- package/public/assets/hap-icons/outlet.svg +24 -13
- package/public/assets/hap-icons/securitysystem-active.svg +102 -2
- package/public/assets/hap-icons/securitysystem-off.svg +68 -2
- package/public/assets/hap-icons/smokesensor.svg +42 -9
- package/public/assets/hap-icons/speaker.svg +29 -13
- package/public/assets/hap-icons/statelessprogrammableswitch.svg +51 -2
- package/public/assets/hap-icons/switch.svg +24 -13
- package/public/assets/hap-icons/television.svg +15 -4
- package/public/assets/hap-icons/temperature.svg +24 -13
- package/public/assets/hap-icons/unknown.svg +24 -13
- package/public/assets/hap-icons/valve-generic.svg +27 -16
- package/public/assets/hap-icons/valve-irrigation.svg +37 -21
- package/public/assets/hap-icons/valve-showerhead.svg +52 -0
- package/public/assets/hap-icons/valve-waterfaucet.svg +21 -0
- package/public/assets/hap-icons/window-closed.svg +85 -2
- package/public/assets/hap-icons/window-open.svg +136 -2
- package/public/assets/hap-icons/windowcovering-closed.svg +45 -49
- package/public/assets/hap-icons/windowcovering-open.svg +40 -44
- package/public/assets/homebridge-color-round.svg +36 -1
- package/public/assets/homebridge-logo.svg +11 -1
- package/public/assets/mask-icon.svg +5 -1
- package/public/chunk-4ANMJJ3Y.js +1 -0
- package/public/chunk-4ASVYUZP.js +1 -0
- package/public/chunk-4GO2ER3F.js +1 -0
- package/public/chunk-4MDIQGUS.js +6 -0
- package/public/chunk-4ODGBS6J.js +1 -0
- package/public/chunk-5PONL6FC.js +1 -0
- package/public/chunk-5ZFJ4INX.js +1 -0
- package/public/chunk-6LV4FEWJ.js +1 -0
- package/public/chunk-7BDTDCEB.js +5 -0
- package/public/chunk-7PQEY6AT.js +1 -0
- package/public/chunk-7VOWKBC5.js +1 -0
- package/public/chunk-AJVPO262.js +1 -0
- package/public/chunk-ATKY7BPX.js +1 -0
- package/public/chunk-AWS7TJOY.js +1 -0
- package/public/chunk-AZRFXNOQ.js +1 -0
- package/public/chunk-CBCEQDGK.js +1 -0
- package/public/chunk-CF74UVXM.js +1 -0
- package/public/chunk-DMDPOVJW.js +1 -0
- package/public/chunk-E4TY3GD7.js +1 -0
- package/public/chunk-EC7UWAIJ.js +1 -0
- package/public/{chunk-JZZQRLNW.js → chunk-EDFYZGGZ.js} +1 -1
- package/public/chunk-EJHOKTHW.js +1 -0
- package/public/chunk-EMSBT2VW.js +1 -0
- package/public/chunk-F5HFYQPC.js +1 -0
- package/public/chunk-FGRVUXCU.js +1 -0
- package/public/{chunk-D6RX5SPU.js → chunk-FPILNIO7.js} +2 -2
- package/public/chunk-FXH7UJ5I.js +1 -0
- package/public/chunk-GKJDQJXY.js +32 -0
- package/public/chunk-GKS2WGAQ.js +1 -0
- package/public/chunk-H7QJNST5.js +1 -0
- package/public/chunk-HBOJTK3W.js +1 -0
- package/public/chunk-HSF575TE.js +1 -0
- package/public/chunk-I4RJOFJA.js +1 -0
- package/public/chunk-IBW35LGZ.js +1 -0
- package/public/chunk-IJOPQHDM.js +5 -0
- package/public/chunk-JZIPYGE6.js +1 -0
- package/public/chunk-KGJAZDYN.js +14 -0
- package/public/chunk-KN3QRU4A.js +1 -0
- package/public/chunk-L2R4XPOU.js +1 -0
- package/public/chunk-LHRPSEZP.js +1 -0
- package/public/chunk-LT62K2G6.js +1 -0
- package/public/{chunk-GETFKFI6.js → chunk-NHG4TUCE.js} +1 -1
- package/public/chunk-NQKVHBGX.js +1 -0
- package/public/chunk-NUX2WN3X.js +7 -0
- package/public/{chunk-WHJSVGC7.js → chunk-O6CWJLIA.js} +1 -1
- package/public/{chunk-7EUQWCP5.js → chunk-OH2VPUYU.js} +1 -1
- package/public/chunk-OIIFJ7L5.js +1 -0
- package/public/chunk-OZNUTRGZ.js +1 -0
- package/public/chunk-PPKGVJBE.js +23 -0
- package/public/{chunk-EA5J2VEJ.js → chunk-PWYRMEUF.js} +1 -1
- package/public/chunk-Q4TOTCFN.js +1 -0
- package/public/chunk-QYC6YOSS.js +1 -0
- package/public/chunk-QZOMUMX6.js +1 -0
- package/public/chunk-R2YGI2OS.js +1 -0
- package/public/chunk-R35OKBR7.js +1 -0
- package/public/chunk-RGZ4UMYA.js +1 -0
- package/public/chunk-RHAWMCG6.js +1 -0
- package/public/{chunk-CCUID66K.js → chunk-RJ6HXANU.js} +1 -1
- package/public/chunk-RLOJ4URV.js +1 -0
- package/public/chunk-RMQTDYIN.js +1 -0
- package/public/chunk-RVTJXBND.js +1 -0
- package/public/chunk-RZ7AYZQX.js +1 -0
- package/public/{chunk-SJHJKPSQ.js → chunk-S7LSMLK2.js} +1 -1
- package/public/chunk-TF3VIHQQ.js +1 -0
- package/public/chunk-TRKPIOD5.js +1 -0
- package/public/chunk-TXZ2N2XM.js +1 -0
- package/public/chunk-UCAC3YJL.js +20 -0
- package/public/{chunk-BKUGARB4.js → chunk-UY5XIM7B.js} +1 -1
- package/public/chunk-VIPLB6ON.js +2 -0
- package/public/chunk-XNFEKMGG.js +1 -0
- package/public/chunk-XR25UPXG.js +1 -0
- package/public/{chunk-NW6AFAD7.js → chunk-XRJZ7K7S.js} +1 -1
- package/public/chunk-XSKOJB4V.js +1 -0
- package/public/chunk-Y54VXXJK.js +1 -0
- package/public/{chunk-6TCHCTXZ.js → chunk-YKBVU6AV.js} +1 -1
- package/public/chunk-YUORH5KC.js +1 -0
- package/public/chunk-Z2STW2WN.js +1 -0
- package/public/{chunk-QE7DO6J3.js → chunk-Z4VQJOCM.js} +2 -2
- package/public/chunk-ZFCY3QWG.js +1 -0
- package/public/chunk-ZJLAMLYN.js +1 -0
- package/public/{chunk-5S4H26Y6.js → chunk-ZMPWO4WI.js} +1 -1
- package/public/chunk-ZTTWZU4Q.js +8 -0
- package/public/{chunk-WNWWUCCZ.js → chunk-ZV6IGHL6.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-MNVDWH2C.js +1 -0
- package/public/media/fa-brands-400-Q3XCMWHQ.woff2 +0 -0
- package/public/media/{fa-brands-400-KOKGDU7E.ttf → fa-brands-400-R2XQZCET.ttf} +0 -0
- package/public/media/fa-regular-400-QSNYFYRT.woff2 +0 -0
- package/public/media/{fa-regular-400-IPMAEX5Y.ttf → fa-regular-400-XUOPSR7E.ttf} +0 -0
- package/public/media/fa-solid-900-5ZUYHGA7.woff2 +0 -0
- package/public/media/{fa-solid-900-SRFFQLRM.ttf → fa-solid-900-PJNKLK6W.ttf} +0 -0
- package/public/styles-CJ5TSDXW.css +1 -0
- package/scripts/upgrade-install-plugin.sh +1 -1
- package/public/chunk-3IX3CLER.js +0 -1
- package/public/chunk-3YKYXC2T.js +0 -1
- package/public/chunk-4DLA2ICF.js +0 -1
- package/public/chunk-4WTXJHZA.js +0 -5
- package/public/chunk-5HCG4CER.js +0 -1
- package/public/chunk-5XU3C2P2.js +0 -1
- package/public/chunk-6I6PSM5Y.js +0 -1
- package/public/chunk-72QXF2GF.js +0 -1
- package/public/chunk-74VT5JYS.js +0 -1
- package/public/chunk-7DTAFWJ7.js +0 -1
- package/public/chunk-7JR63ERC.js +0 -14
- package/public/chunk-7K5J3AOO.js +0 -1
- package/public/chunk-A7YWFX6I.js +0 -1
- package/public/chunk-BIDQZJXT.js +0 -1
- package/public/chunk-BNVAYTYZ.js +0 -8
- package/public/chunk-BPMSJ2VF.js +0 -1
- package/public/chunk-BVDMEFSJ.js +0 -1
- package/public/chunk-BVK7NCGF.js +0 -1
- package/public/chunk-CNJMINEX.js +0 -1
- package/public/chunk-DNLDZVVB.js +0 -1
- package/public/chunk-F3EORWUJ.js +0 -1
- package/public/chunk-G4CGNDAD.js +0 -1
- package/public/chunk-G4TRVUCL.js +0 -1
- package/public/chunk-HSJSWZHD.js +0 -1
- package/public/chunk-I544XQGS.js +0 -1
- package/public/chunk-J26JMISE.js +0 -20
- package/public/chunk-J3XWQZ5N.js +0 -1
- package/public/chunk-JBM7KQHD.js +0 -1
- package/public/chunk-KJHDP3ZC.js +0 -1
- package/public/chunk-KPVA6CSL.js +0 -1
- package/public/chunk-KQJ7ONUG.js +0 -1
- package/public/chunk-LBTLF3MZ.js +0 -6
- package/public/chunk-LQ6YDB4A.js +0 -1
- package/public/chunk-M3N7PSSC.js +0 -1
- package/public/chunk-MP3LZHQU.js +0 -1
- package/public/chunk-MSXXP7RE.js +0 -1
- package/public/chunk-NZNNTHFQ.js +0 -1
- package/public/chunk-ORPWYWCL.js +0 -5
- package/public/chunk-OZ6IXX3E.js +0 -1
- package/public/chunk-QHPDGSZ6.js +0 -1
- package/public/chunk-QOKEWT7C.js +0 -1
- package/public/chunk-RD4QIA6H.js +0 -1
- package/public/chunk-RN75UMGP.js +0 -1
- package/public/chunk-S3XAJEVU.js +0 -1
- package/public/chunk-SIQ2FHQL.js +0 -1
- package/public/chunk-TCSXGQNF.js +0 -1
- package/public/chunk-TWQP6XJT.js +0 -1
- package/public/chunk-TXOB7R5K.js +0 -7
- package/public/chunk-UC2NMLJ6.js +0 -1
- package/public/chunk-UCB7UE24.js +0 -1
- package/public/chunk-UFDZ4SFB.js +0 -1
- package/public/chunk-UG5DK2RQ.js +0 -2
- package/public/chunk-W4MTVPF3.js +0 -23
- package/public/chunk-WHJOLAED.js +0 -1
- package/public/chunk-WJNSNBGE.js +0 -1
- package/public/chunk-WRDG5DTE.js +0 -1
- package/public/chunk-XDGJOFX2.js +0 -1
- package/public/chunk-XEVIOBJR.js +0 -1
- package/public/chunk-XNCOF5TV.js +0 -1
- package/public/chunk-XXJO3JY3.js +0 -1
- package/public/chunk-YJ7ICNKX.js +0 -1
- package/public/chunk-Z7AUXG5E.js +0 -1
- package/public/chunk-ZBNZILWV.js +0 -1
- package/public/chunk-ZHMC7KSZ.js +0 -1
- package/public/chunk-ZJ4LBIOD.js +0 -32
- package/public/chunk-ZT23DWNL.js +0 -1
- package/public/chunk-ZYZBMA5E.js +0 -1
- package/public/main-TQOXBTSD.js +0 -1
- package/public/media/01-RQ3S2L53.png +0 -0
- package/public/media/02-VNCG2I2A.png +0 -0
- package/public/media/03-HI42L4ZG.png +0 -0
- package/public/media/04-FJLL55LZ.png +0 -0
- package/public/media/05-V3EO6SPT.png +0 -0
- package/public/media/06-EOJZCQZN.png +0 -0
- package/public/media/07-KMKB5PBD.png +0 -0
- package/public/media/08-UQJRF6B2.png +0 -0
- package/public/media/09-2DJQFRHH.png +0 -0
- package/public/media/arrow_left-CQT7FZM7.svg +0 -4
- package/public/media/arrow_right-SBUDRR2G.svg +0 -4
- package/public/media/fa-brands-400-6PJPV6JM.woff2 +0 -0
- package/public/media/fa-regular-400-OHB6J4OK.woff2 +0 -0
- package/public/media/fa-solid-900-ABTK6BNK.woff2 +0 -0
- package/public/scripts-6GVLYD7F.js +0 -62
- package/public/styles-EG5MFQEM.css +0 -1
- /package/public/assets/{bootstrap-4 → bootstrap-5}/cssframework/assets.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linux.service.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/linux/linux.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAyC;AAEzC,2CAA2C;AAE3C,wEAAmE;AACnE,wEAA4D;AAGrD,IAAM,YAAY,GAAlB,MAAM,YAAY;IACvB,YACmB,aAA4B,EAC5B,MAAc;QADd,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAKJ,WAAW;QACT,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;gBAC/E,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO;gBACrC,CAAC,CAAC,yBAAyB,CAAC,CAAA;QAE9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"linux.service.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/linux/linux.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAyC;AAEzC,2CAA2C;AAE3C,wEAAmE;AACnE,wEAA4D;AAGrD,IAAM,YAAY,GAAlB,MAAM,YAAY;I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AAC,CAAA;QAE7E,UAAU,CAAC,GAAG,EAAE;YACd,IAAA,yBAAI,EAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC1B,IAAI,GAAG,EAAE,CAAC;oBACR,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBAChC,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,EAAE,GAAG,CAAC,CAAA;QAEP,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;IACnC,CAAC;CACF,CAAA;AA/CY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;qCAGuB,8BAAa;QACpB,uBAAM;GAHtB,YAAY,CA+CxB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TermSize, WsEventEmitter } from './terminal.service';
|
|
2
|
+
import { TerminalService } from './terminal.service';
|
|
2
3
|
export declare class TerminalGateway {
|
|
3
4
|
private readonly terminalService;
|
|
4
5
|
constructor(terminalService: TerminalService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.gateway.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/terminal/terminal.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"terminal.gateway.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/terminal/terminal.gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAA0C;AAC1C,mDAAuE;AAEvE,6EAAuE;AACvE,yDAAoD;AAW7C,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YACmB,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAChD,CAAC;IAGJ,oBAAoB,CAAC,MAAsB,EAAE,OAAiB;QAC5D,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC3D,CAAC;CACF,CAAA;AATY,0CAAe;AAM1B;IADC,IAAA,6BAAgB,EAAC,eAAe,CAAC;;;;2DAGjC;0BARU,eAAe;IAT3B,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,6BAAgB,EAAC;QAChB,SAAS,EAAE,yBAAyB;QACpC,SAAS,EAAE,IAAI;QACf,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;YAC1D,WAAW,EAAE,IAAI;SAClB;KACF,CAAC;qCAGoC,kCAAe;GAFxC,eAAe,CAS3B"}
|
|
@@ -29,11 +29,11 @@ let TerminalService = class TerminalService {
|
|
|
29
29
|
async startSession(client, size) {
|
|
30
30
|
this.ending = false;
|
|
31
31
|
if (!this.configService.enableTerminalAccess) {
|
|
32
|
-
this.logger.error('Terminal is not enabled
|
|
32
|
+
this.logger.error('Terminal is not enabled, disconnecting client...');
|
|
33
33
|
client.disconnect();
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
this.logger.log('Starting terminal session');
|
|
36
|
+
this.logger.log('Starting terminal session.');
|
|
37
37
|
const shell = await (0, fs_extra_1.pathExists)('/bin/bash') ? '/bin/bash' : '/bin/sh';
|
|
38
38
|
const term = this.nodePtyService.spawn(shell, [], {
|
|
39
39
|
name: 'xterm-color',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.service.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/terminal/terminal.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,gEAAkC;AAElC,2CAA2C;AAC3C,uCAAqC;AAErC,wEAAmE;AACnE,wEAA4D;AAC5D,8EAAwE;AAQjE,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B,YACU,aAA4B,EAC5B,MAAc,EACd,cAA8B;QAF9B,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAgB;QALhC,WAAM,GAAG,KAAK,CAAA;IAMnB,CAAC;IAOJ,KAAK,CAAC,YAAY,CAAC,MAAsB,EAAE,IAAc;QACvD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QAGnB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE,CAAC;YAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;YACrE,MAAM,CAAC,UAAU,EAAE,CAAA;YACnB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"terminal.service.js","sourceRoot":"","sources":["../../../../src/modules/platform-tools/terminal/terminal.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,gEAAkC;AAElC,2CAA2C;AAC3C,uCAAqC;AAErC,wEAAmE;AACnE,wEAA4D;AAC5D,8EAAwE;AAQjE,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B,YACU,aAA4B,EAC5B,MAAc,EACd,cAA8B;QAF9B,kBAAa,GAAb,aAAa,CAAe;QAC5B,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc,CAAgB;QALhC,WAAM,GAAG,KAAK,CAAA;IAMnB,CAAC;IAOJ,KAAK,CAAC,YAAY,CAAC,MAAsB,EAAE,IAAc;QACvD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QAGnB,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB,EAAE,CAAC;YAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAA;YACrE,MAAM,CAAC,UAAU,EAAE,CAAA;YACnB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;QAG7C,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAU,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW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AAC,CAAA;YAClC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;YACnC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;YAChC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAA;YAEvC,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;gBAC1C,IAAI,CAAC,IAAI,EAAE,CAAA;YACb,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;QAChB,CAAC,CAAA;QAED,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;QAClC,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3C,CAAC;CACF,CAAA;AApFY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAKc,8BAAa;QACpB,uBAAM;QACE,iCAAc;GAN7B,eAAe,CAoF3B"}
|
|
@@ -55,7 +55,7 @@ let PluginsController = class PluginsController {
|
|
|
55
55
|
exports.PluginsController = PluginsController;
|
|
56
56
|
__decorate([
|
|
57
57
|
(0, common_1.UseGuards)(admin_guard_1.AdminGuard),
|
|
58
|
-
(0, swagger_1.ApiOperation)({ summary: '
|
|
58
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get the list of currently installed Homebridge plugins.' }),
|
|
59
59
|
(0, common_1.Get)(),
|
|
60
60
|
__metadata("design:type", Function),
|
|
61
61
|
__metadata("design:paramtypes", []),
|
|
@@ -93,7 +93,7 @@ __decorate([
|
|
|
93
93
|
], PluginsController.prototype, "getAvailablePluginVersions", null);
|
|
94
94
|
__decorate([
|
|
95
95
|
(0, common_1.UseGuards)(admin_guard_1.AdminGuard),
|
|
96
|
-
(0, swagger_1.ApiOperation)({ summary: 'Get the config.schema.json for a plugin.' }),
|
|
96
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get the `config.schema.json` for a plugin.' }),
|
|
97
97
|
(0, swagger_1.ApiParam)({ name: 'pluginName', type: 'string' }),
|
|
98
98
|
(0, common_1.Get)('config-schema/:pluginName'),
|
|
99
99
|
__param(0, (0, common_1.Param)('pluginName')),
|
|
@@ -103,7 +103,7 @@ __decorate([
|
|
|
103
103
|
], PluginsController.prototype, "getPluginConfigSchema", null);
|
|
104
104
|
__decorate([
|
|
105
105
|
(0, common_1.UseGuards)(admin_guard_1.AdminGuard),
|
|
106
|
-
(0, swagger_1.ApiOperation)({ summary: 'Get the CHANGELOG.md (post install) for a plugin.' }),
|
|
106
|
+
(0, swagger_1.ApiOperation)({ summary: 'Get the `CHANGELOG.md` (post install) for a plugin.' }),
|
|
107
107
|
(0, swagger_1.ApiParam)({ name: 'pluginName', type: 'string' }),
|
|
108
108
|
(0, common_1.Get)('changelog/:pluginName'),
|
|
109
109
|
__param(0, (0, common_1.Param)('pluginName')),
|
|
@@ -125,7 +125,7 @@ __decorate([
|
|
|
125
125
|
(0, common_1.UseGuards)(admin_guard_1.AdminGuard),
|
|
126
126
|
(0, swagger_1.ApiOperation)({
|
|
127
127
|
summary: 'Attempt to resolve the type (platform or accessory) and alias for a plugin.',
|
|
128
|
-
description: '
|
|
128
|
+
description: 'NOTE: `pluginAlias` and `pluginType` will be `null` if the type or alias could not be resolved.',
|
|
129
129
|
}),
|
|
130
130
|
(0, swagger_1.ApiParam)({ name: 'pluginName', type: 'string' }),
|
|
131
131
|
(0, common_1.Get)('alias/:pluginName'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.controller.js","sourceRoot":"","sources":["../../../src/modules/plugins/plugins.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAkE;AAClE,+CAA4C;AAC5C,6CAAgF;AAEhF,oEAA+D;AAC/D,uDAAkD;AAM3C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YACU,cAA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
22
22
|
private maintainedPlugins;
|
|
23
23
|
private pluginIcons;
|
|
24
|
-
private
|
|
24
|
+
private pluginAuthors;
|
|
25
|
+
private pluginNames;
|
|
25
26
|
private newScopePlugins;
|
|
26
27
|
private verifiedPlugins;
|
|
27
28
|
private verifiedPlusPlugins;
|
|
@@ -29,6 +30,7 @@ export declare class PluginsService {
|
|
|
29
30
|
private pluginAliasCache;
|
|
30
31
|
private pluginAliasHints;
|
|
31
32
|
constructor(httpService: HttpService, nodePtyService: NodePtyService, logger: Logger, configService: ConfigService);
|
|
33
|
+
private fixDisplayName;
|
|
32
34
|
getInstalledPlugins(): Promise<HomebridgePlugin[]>;
|
|
33
35
|
getOutOfDatePlugins(): Promise<HomebridgePlugin[]>;
|
|
34
36
|
lookupPlugin(pluginName: string): Promise<HomebridgePlugin>;
|
|
@@ -40,11 +40,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
40
40
|
this.npm = this.getNpmPath();
|
|
41
41
|
this.paths = this.getBasePaths();
|
|
42
42
|
this.pluginListUrl = 'https://raw.githubusercontent.com/homebridge/plugins/latest/';
|
|
43
|
-
this.pluginListFile = `${this.pluginListUrl}assets/plugins.min.json`;
|
|
43
|
+
this.pluginListFile = `${this.pluginListUrl}assets/plugins-v2.min.json`;
|
|
44
44
|
this.hiddenPlugins = [];
|
|
45
45
|
this.maintainedPlugins = [];
|
|
46
46
|
this.pluginIcons = {};
|
|
47
|
-
this.
|
|
47
|
+
this.pluginAuthors = {};
|
|
48
|
+
this.pluginNames = {};
|
|
48
49
|
this.newScopePlugins = {};
|
|
49
50
|
this.verifiedPlugins = [];
|
|
50
51
|
this.verifiedPlusPlugins = [];
|
|
@@ -67,6 +68,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
67
68
|
this.loadPluginList();
|
|
68
69
|
setInterval(this.loadPluginList.bind(this), 60000 * 60 * 12);
|
|
69
70
|
}
|
|
71
|
+
fixDisplayName(plugin) {
|
|
72
|
+
plugin.displayName = plugin.displayName || (plugin.name.charAt(0) === '@' ? plugin.name.split('/')[1] : plugin.name)
|
|
73
|
+
.replace(/-/g, ' ')
|
|
74
|
+
.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substring(1).toLowerCase());
|
|
75
|
+
return plugin;
|
|
76
|
+
}
|
|
70
77
|
async getInstalledPlugins() {
|
|
71
78
|
const plugins = [];
|
|
72
79
|
const modules = await this.getInstalledModules();
|
|
@@ -92,12 +99,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
101
|
catch (e) {
|
|
95
|
-
this.logger.error(`Failed to parse plugin
|
|
102
|
+
this.logger.error(`Failed to parse plugin ${pkg.name} as ${e.message}.`);
|
|
96
103
|
}
|
|
97
104
|
});
|
|
98
105
|
}));
|
|
99
|
-
this.installedPlugins = plugins;
|
|
100
|
-
return
|
|
106
|
+
this.installedPlugins = plugins.map(plugin => this.fixDisplayName(plugin));
|
|
107
|
+
return this.installedPlugins;
|
|
101
108
|
}
|
|
102
109
|
async getOutOfDatePlugins() {
|
|
103
110
|
const plugins = await this.getInstalledPlugins();
|
|
@@ -146,14 +153,21 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
146
153
|
if (!this.installedPlugins) {
|
|
147
154
|
await this.getInstalledPlugins();
|
|
148
155
|
}
|
|
149
|
-
|
|
156
|
+
query = query.trim().toLowerCase();
|
|
157
|
+
if ((query.startsWith('homebridge-') || this.isScopedPlugin(query)) && !this.hiddenPlugins.includes(query)) {
|
|
158
|
+
if (!this.installedPlugins.find(x => x.name === query) && Object.keys(this.newScopePlugins).includes(query)) {
|
|
159
|
+
query = `@homebridge-plugins/${query}`;
|
|
160
|
+
}
|
|
161
|
+
return await this.searchNpmRegistrySingle(query);
|
|
162
|
+
}
|
|
163
|
+
const q = `${(!query || !query.length) ? '' : `${query.substring(0, 15)}+`}keywords:homebridge-plugin+not:deprecated&size=99`;
|
|
150
164
|
let searchResults;
|
|
151
165
|
try {
|
|
152
166
|
searchResults = (await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://registry.npmjs.org/-/v1/search?text=${q}`))).data;
|
|
153
167
|
}
|
|
154
168
|
catch (e) {
|
|
155
|
-
this.logger.error(`Failed to search the npm registry
|
|
156
|
-
throw new common_1.InternalServerErrorException(`Failed to search the npm registry
|
|
169
|
+
this.logger.error(`Failed to search the npm registry (see https://homebridge.io/w/JJSz6 for help) as ${e.message}.`);
|
|
170
|
+
throw new common_1.InternalServerErrorException(`Failed to search the npm registry as ${e.message}, see logs.`);
|
|
157
171
|
}
|
|
158
172
|
const result = searchResults.objects
|
|
159
173
|
.filter(x => x.package.name.indexOf('homebridge-') === 0 || this.isScopedPlugin(x.package.name))
|
|
@@ -161,12 +175,14 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
161
175
|
.map((pkg) => {
|
|
162
176
|
let plugin = {
|
|
163
177
|
name: pkg.package.name,
|
|
178
|
+
displayName: this.pluginNames[pkg.package.name],
|
|
164
179
|
private: false,
|
|
165
180
|
};
|
|
166
181
|
const isInstalled = this.installedPlugins.find(x => x.name === plugin.name);
|
|
167
182
|
if (isInstalled) {
|
|
168
183
|
plugin = isInstalled;
|
|
169
184
|
plugin.lastUpdated = pkg.package.date;
|
|
185
|
+
plugin.keywords = pkg.package.keywords;
|
|
170
186
|
return plugin;
|
|
171
187
|
}
|
|
172
188
|
plugin.publicPackage = true;
|
|
@@ -176,24 +192,45 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
176
192
|
plugin.description = (pkg.package.description)
|
|
177
193
|
? pkg.package.description.replace(/\(?(?:https?|ftp):\/\/[\n\S]+/g, '').trim()
|
|
178
194
|
: pkg.package.name;
|
|
195
|
+
plugin.keywords = pkg.package.keywords;
|
|
179
196
|
plugin.links = pkg.package.links;
|
|
180
|
-
plugin.author = this.
|
|
197
|
+
plugin.author = this.pluginAuthors[pkg.package.name] || ((pkg.package.publisher) ? pkg.package.publisher.username : null);
|
|
181
198
|
plugin.verifiedPlugin = this.verifiedPlugins.includes(pkg.package.name);
|
|
182
199
|
plugin.verifiedPlusPlugin = this.verifiedPlusPlugins.includes(pkg.package.name);
|
|
183
200
|
plugin.icon = this.pluginIcons[pkg.package.name]
|
|
184
201
|
? `${this.pluginListUrl}${this.pluginIcons[pkg.package.name]}`
|
|
185
202
|
: null;
|
|
186
|
-
plugin.isHbScoped =
|
|
203
|
+
plugin.isHbScoped = pkg.package.name.startsWith('@homebridge-plugins/');
|
|
187
204
|
plugin.newHbScope = this.newScopePlugins[pkg.package.name];
|
|
188
205
|
plugin.isHbMaintained = this.maintainedPlugins.includes(pkg.package.name);
|
|
189
206
|
return plugin;
|
|
190
207
|
});
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
208
|
+
const searchTerm = query
|
|
209
|
+
.replace(/[.,/#!$%^&*;:{}=\-_`~()]/g, '');
|
|
210
|
+
const searchTerms = searchTerm
|
|
211
|
+
.split(/\s+/)
|
|
212
|
+
.filter(term => term.length > 0);
|
|
213
|
+
const exactMatchPlugins = [];
|
|
214
|
+
const partialMatchPlugins = [];
|
|
215
|
+
result.forEach((plugin) => {
|
|
216
|
+
const pluginKeywords = plugin.keywords.map(keyword => keyword.toLowerCase());
|
|
217
|
+
const isExactMatch = pluginKeywords.includes(searchTerm);
|
|
218
|
+
if (isExactMatch) {
|
|
219
|
+
exactMatchPlugins.push(plugin);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const pluginName = plugin.name.toLowerCase();
|
|
223
|
+
const pluginDescription = plugin.description.toLowerCase();
|
|
224
|
+
const isPartialMatch = searchTerms.some(term => pluginName.includes(term))
|
|
225
|
+
|| searchTerms.some(term => pluginKeywords.some(keyword => keyword.includes(term)))
|
|
226
|
+
|| searchTerms.some(term => pluginDescription.includes(term));
|
|
227
|
+
if (isPartialMatch) {
|
|
228
|
+
partialMatchPlugins.push(plugin);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return (0, lodash_1.orderBy)([...exactMatchPlugins, ...partialMatchPlugins], ['verifiedPlusPlugin', 'verifiedPlugin'], ['desc', 'desc'])
|
|
232
|
+
.slice(0, 30)
|
|
233
|
+
.map(plugin => this.fixDisplayName(plugin));
|
|
197
234
|
}
|
|
198
235
|
async searchNpmRegistrySingle(query) {
|
|
199
236
|
try {
|
|
@@ -224,10 +261,11 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
224
261
|
verifiedPlugin: this.verifiedPlugins.includes(pkg.name),
|
|
225
262
|
verifiedPlusPlugin: this.verifiedPlusPlugins.includes(pkg.name),
|
|
226
263
|
icon: this.pluginIcons[pkg.name],
|
|
227
|
-
isHbScoped:
|
|
264
|
+
isHbScoped: pkg.name.startsWith('@homebridge-plugins/'),
|
|
228
265
|
newHbScope: this.newScopePlugins[pkg.name],
|
|
229
266
|
isHbMaintained: this.maintainedPlugins.includes(pkg.name),
|
|
230
267
|
};
|
|
268
|
+
plugin.displayName = this.pluginNames[pkg.name];
|
|
231
269
|
plugin.publicPackage = true;
|
|
232
270
|
plugin.latestVersion = pkg['dist-tags'] ? pkg['dist-tags'].latest : undefined;
|
|
233
271
|
plugin.lastUpdated = pkg.time.modified;
|
|
@@ -238,21 +276,21 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
238
276
|
homepage: pkg.homepage,
|
|
239
277
|
bugs: typeof pkg.bugs === 'object' && pkg.bugs?.url ? pkg.bugs.url : null,
|
|
240
278
|
};
|
|
241
|
-
plugin.author = this.
|
|
279
|
+
plugin.author = this.pluginAuthors[pkg.name]
|
|
242
280
|
|| ((pkg.maintainers && pkg.maintainers.length) ? pkg.maintainers[0].name : null);
|
|
243
281
|
plugin.verifiedPlugin = this.verifiedPlugins.includes(pkg.name);
|
|
244
282
|
plugin.verifiedPlusPlugin = this.verifiedPlusPlugins.includes(pkg.name);
|
|
245
283
|
plugin.icon = this.pluginIcons[pkg.name]
|
|
246
284
|
? `${this.pluginListUrl}${this.pluginIcons[pkg.name]}`
|
|
247
285
|
: null;
|
|
248
|
-
plugin.isHbScoped =
|
|
286
|
+
plugin.isHbScoped = pkg.name.startsWith('@homebridge-plugins/');
|
|
249
287
|
plugin.newHbScope = this.newScopePlugins[pkg.name];
|
|
250
288
|
plugin.isHbMaintained = this.maintainedPlugins.includes(pkg.name);
|
|
251
|
-
return [plugin];
|
|
289
|
+
return [this.fixDisplayName(plugin)];
|
|
252
290
|
}
|
|
253
291
|
catch (e) {
|
|
254
292
|
if (e.response?.status !== 404) {
|
|
255
|
-
this.logger.error(`Failed to search the npm registry
|
|
293
|
+
this.logger.error(`Failed to search the npm registry (see https://homebridge.io/w/JJSz6 for help) as ${e.message}.`);
|
|
256
294
|
}
|
|
257
295
|
return [];
|
|
258
296
|
}
|
|
@@ -269,6 +307,14 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
269
307
|
if (action === 'install' && pluginAction.version === 'latest') {
|
|
270
308
|
pluginAction.version = await this.getNpmModuleLatestVersion(pluginAction.name);
|
|
271
309
|
}
|
|
310
|
+
const userPlatform = (0, node_os_1.platform)();
|
|
311
|
+
if (pluginAction.name === this.configService.name && userPlatform === 'linux') {
|
|
312
|
+
const uname = (0, node_child_process_1.execSync)('uname -m').toString().trim();
|
|
313
|
+
const majorVersion = +pluginAction.version.split('.')[0];
|
|
314
|
+
if (uname === 'armv6l' && majorVersion > 4) {
|
|
315
|
+
throw new Error('Versions 5 and above of the Homebridge UI are not compatible with your armv6l device.');
|
|
316
|
+
}
|
|
317
|
+
}
|
|
272
318
|
let installPath = (this.configService.customPluginPath)
|
|
273
319
|
? this.configService.customPluginPath
|
|
274
320
|
: this.installedPlugins.find(x => x.name === this.configService.name).installPath;
|
|
@@ -305,27 +351,22 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
305
351
|
}
|
|
306
352
|
}
|
|
307
353
|
const installOptions = [];
|
|
354
|
+
let npmPluginLabel = pluginAction.name;
|
|
308
355
|
if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
|
|
309
356
|
installOptions.push('--save');
|
|
310
357
|
}
|
|
311
358
|
installPath = (0, node_path_1.resolve)(installPath, '../');
|
|
312
|
-
if (!this.configService.customPluginPath ||
|
|
359
|
+
if (!this.configService.customPluginPath || userPlatform === 'win32' || existingPlugin?.globalInstall === true) {
|
|
313
360
|
installOptions.push('-g');
|
|
314
361
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
await this.ensureCustomPluginDirExists();
|
|
319
|
-
return true;
|
|
320
|
-
}
|
|
321
|
-
catch (e) {
|
|
322
|
-
if (pluginAction.name === this.configService.name) {
|
|
323
|
-
client.emit('stdout', (0, bash_color_1.yellow)('\r\nCleaning up npm cache, please wait...\r\n'));
|
|
324
|
-
await this.cleanNpmCache();
|
|
325
|
-
client.emit('stdout', (0, bash_color_1.yellow)(`npm cache cleared, please try updating ${this.configService.name} again.\r\n`));
|
|
326
|
-
}
|
|
327
|
-
throw e;
|
|
362
|
+
if (action === 'install') {
|
|
363
|
+
installOptions.push('--omit=dev');
|
|
364
|
+
npmPluginLabel = `${pluginAction.name}@${pluginAction.version}`;
|
|
328
365
|
}
|
|
366
|
+
await this.cleanNpmCache();
|
|
367
|
+
await this.runNpmCommand([...this.npm, action, ...installOptions, npmPluginLabel], installPath, client, pluginAction.termCols, pluginAction.termRows);
|
|
368
|
+
await this.ensureCustomPluginDirExists();
|
|
369
|
+
return true;
|
|
329
370
|
}
|
|
330
371
|
async getHomebridgePackage() {
|
|
331
372
|
if (this.configService.ui.homebridgePackagePath) {
|
|
@@ -334,21 +375,21 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
334
375
|
return await this.parsePackageJson(await (0, fs_extra_1.readJson)(pkgJsonPath), this.configService.ui.homebridgePackagePath);
|
|
335
376
|
}
|
|
336
377
|
else {
|
|
337
|
-
this.logger.error(`
|
|
378
|
+
this.logger.error(`The Homebridge path ${this.configService.ui.homebridgePackagePath} does not exist.`);
|
|
338
379
|
}
|
|
339
380
|
}
|
|
340
381
|
const modules = await this.getInstalledModules();
|
|
341
382
|
const homebridgeInstalls = modules.filter(x => x.name === 'homebridge');
|
|
342
383
|
if (homebridgeInstalls.length > 1) {
|
|
343
|
-
this.logger.warn('Multiple
|
|
384
|
+
this.logger.warn('Multiple instances of Homebridge were found, see https://homebridge.io/w/JJSgm for help.');
|
|
344
385
|
homebridgeInstalls.forEach((instance) => {
|
|
345
386
|
this.logger.warn(instance.installPath);
|
|
346
387
|
});
|
|
347
388
|
}
|
|
348
389
|
if (!homebridgeInstalls.length) {
|
|
349
390
|
this.configService.hbServiceUiRestartRequired = true;
|
|
350
|
-
this.logger.error('Unable
|
|
351
|
-
throw new Error('Unable To Find Homebridge Installation');
|
|
391
|
+
this.logger.error('Unable to find Homebridge installation, see https://homebridge.io/w/JJSgZ for help.');
|
|
392
|
+
throw new Error('Unable To Find Homebridge Installation.');
|
|
352
393
|
}
|
|
353
394
|
const homebridgeModule = homebridgeInstalls[0];
|
|
354
395
|
const pkgJson = await (0, fs_extra_1.readJson)((0, node_path_1.join)(homebridgeModule.installPath, 'package.json'));
|
|
@@ -378,6 +419,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
378
419
|
}
|
|
379
420
|
let installPath = homebridge.installPath;
|
|
380
421
|
const installOptions = [];
|
|
422
|
+
installOptions.push('--omit=dev');
|
|
381
423
|
if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
|
|
382
424
|
installOptions.push('--save');
|
|
383
425
|
}
|
|
@@ -416,7 +458,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
416
458
|
&& pluginAction.name !== this.configService.name
|
|
417
459
|
&& pluginAction.version !== 'latest') {
|
|
418
460
|
try {
|
|
419
|
-
await (0, rxjs_1.firstValueFrom)(this.httpService.head(`https://github.com/homebridge/
|
|
461
|
+
await (0, rxjs_1.firstValueFrom)(this.httpService.head(`https://github.com/homebridge/plugins/releases/download/v1.0.0/${pluginAction.name.replace('/', '@')}-${pluginAction.version}.sha256`));
|
|
420
462
|
return true;
|
|
421
463
|
}
|
|
422
464
|
catch (e) {
|
|
@@ -440,7 +482,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
440
482
|
'/var/packages/homebridge/target/app/lib/node_modules',
|
|
441
483
|
].includes((0, node_path_1.dirname)(node_process_1.default.env.UIX_BASE_PATH))
|
|
442
484
|
&& pluginAction.name === this.configService.name
|
|
443
|
-
&&
|
|
485
|
+
&& !['latest', 'alpha', 'beta'].includes(pluginAction.version)) {
|
|
444
486
|
try {
|
|
445
487
|
try {
|
|
446
488
|
const withV = `v${pluginAction.version}`;
|
|
@@ -454,7 +496,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
454
496
|
}
|
|
455
497
|
}
|
|
456
498
|
catch (e) {
|
|
457
|
-
this.logger.error(`Failed to check for bundled update: ${e.message}
|
|
499
|
+
this.logger.error(`Failed to check for bundled update: ${e.message}.`);
|
|
458
500
|
return '';
|
|
459
501
|
}
|
|
460
502
|
}
|
|
@@ -494,27 +536,19 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
494
536
|
let configSchema = await (0, fs_extra_1.readJson)(schemaPath);
|
|
495
537
|
if (configSchema.dynamicSchemaVersion) {
|
|
496
538
|
const dynamicSchemaPath = (0, node_path_1.resolve)(this.configService.storagePath, `.${pluginName}-v${configSchema.dynamicSchemaVersion}.schema.json`);
|
|
497
|
-
this.logger.log(`[${pluginName}] dynamic schema path: ${dynamicSchemaPath}
|
|
539
|
+
this.logger.log(`[${pluginName}] dynamic schema path: ${dynamicSchemaPath}.`);
|
|
498
540
|
if ((0, fs_extra_1.existsSync)(dynamicSchemaPath)) {
|
|
499
541
|
try {
|
|
500
542
|
configSchema = await (0, fs_extra_1.readJson)(dynamicSchemaPath);
|
|
501
|
-
this.logger.log(`[${pluginName}] dynamic schema loaded from
|
|
543
|
+
this.logger.log(`[${pluginName}] dynamic schema loaded from ${dynamicSchemaPath}.`);
|
|
502
544
|
}
|
|
503
545
|
catch (e) {
|
|
504
|
-
this.logger.error(`[${pluginName}]
|
|
546
|
+
this.logger.error(`[${pluginName}] failed to load dynamic schema from ${dynamicSchemaPath} as ${e.message}.`);
|
|
505
547
|
}
|
|
506
548
|
}
|
|
507
549
|
}
|
|
508
550
|
if (pluginName === this.configService.name) {
|
|
509
551
|
configSchema.schema.properties.port.default = this.configService.ui.port;
|
|
510
|
-
if (this.configService.serviceMode) {
|
|
511
|
-
configSchema.layout = configSchema.layout.filter((x) => {
|
|
512
|
-
return x.ref !== 'log';
|
|
513
|
-
});
|
|
514
|
-
configSchema.layout = configSchema.layout.filter((x) => {
|
|
515
|
-
return !(x === 'sudo' || x.key === 'restart');
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
552
|
}
|
|
519
553
|
if (pluginName === 'homebridge-alexa') {
|
|
520
554
|
configSchema.schema.properties.pin.default = this.configService.homebridgeConfig.bridge.pin;
|
|
@@ -626,7 +660,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
626
660
|
?.name;
|
|
627
661
|
}
|
|
628
662
|
catch (e) {
|
|
629
|
-
this.logger.error(`Failed to get list of branches from GitHub
|
|
663
|
+
this.logger.error(`Failed to get list of branches from GitHub as ${e.message}.`);
|
|
630
664
|
}
|
|
631
665
|
}
|
|
632
666
|
return {
|
|
@@ -696,7 +730,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
696
730
|
});
|
|
697
731
|
}
|
|
698
732
|
catch (e) {
|
|
699
|
-
this.logger.debug(
|
|
733
|
+
this.logger.debug(`Failed to extract ${pluginName} plugin alias as ${e.message}.`);
|
|
700
734
|
if (this.pluginAliasHints[pluginName]) {
|
|
701
735
|
output.pluginAlias = this.pluginAliasHints[pluginName].pluginAlias;
|
|
702
736
|
output.pluginType = this.pluginAliasHints[pluginName].pluginType;
|
|
@@ -788,7 +822,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
788
822
|
}
|
|
789
823
|
}
|
|
790
824
|
catch (e) {
|
|
791
|
-
this.logger.log(`Failed to parse
|
|
825
|
+
this.logger.log(`Failed to parse ${module} in ${requiredPath} as ${e.message}.`);
|
|
792
826
|
}
|
|
793
827
|
}
|
|
794
828
|
}
|
|
@@ -824,8 +858,8 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
824
858
|
return [windowsNpmPath[0]];
|
|
825
859
|
}
|
|
826
860
|
else {
|
|
827
|
-
this.logger.error('
|
|
828
|
-
this.logger.error('
|
|
861
|
+
this.logger.error('Cannot find npm binary, you will not be able to manage plugins or update Homebridge. You might be able to fix this problem by running:');
|
|
862
|
+
this.logger.error('npm install -g npm');
|
|
829
863
|
}
|
|
830
864
|
}
|
|
831
865
|
return ['npm'];
|
|
@@ -876,8 +910,8 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
876
910
|
async parsePackageJson(pkgJson, installPath) {
|
|
877
911
|
const plugin = {
|
|
878
912
|
name: pkgJson.name,
|
|
913
|
+
displayName: pkgJson.displayName || this.pluginNames[pkgJson.name],
|
|
879
914
|
private: pkgJson.private || false,
|
|
880
|
-
displayName: pkgJson.displayName,
|
|
881
915
|
description: (pkgJson.description)
|
|
882
916
|
? pkgJson.description.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '').trim()
|
|
883
917
|
: pkgJson.name,
|
|
@@ -886,7 +920,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
886
920
|
icon: this.pluginIcons[pkgJson.name]
|
|
887
921
|
? `${this.pluginListUrl}${this.pluginIcons[pkgJson.name]}`
|
|
888
922
|
: null,
|
|
889
|
-
isHbScoped:
|
|
923
|
+
isHbScoped: pkgJson.name.startsWith('@homebridge-plugins/'),
|
|
890
924
|
newHbScope: this.newScopePlugins[pkgJson.name],
|
|
891
925
|
isHbMaintained: this.maintainedPlugins.includes(pkgJson.name),
|
|
892
926
|
installedVersion: installPath ? (pkgJson.version || '0.0.1') : null,
|
|
@@ -938,12 +972,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
938
972
|
homepage: pkg.homepage,
|
|
939
973
|
bugs: typeof pkg.bugs === 'object' && pkg.bugs?.url ? pkg.bugs.url : null,
|
|
940
974
|
};
|
|
941
|
-
plugin.author = this.
|
|
975
|
+
plugin.author = this.pluginAuthors[pkg.name]
|
|
942
976
|
|| ((pkg.maintainers && pkg.maintainers.length) ? pkg.maintainers[0].name : null);
|
|
943
977
|
}
|
|
944
978
|
catch (e) {
|
|
945
979
|
if (e.response?.status !== 404) {
|
|
946
|
-
this.logger.log(`[${plugin.name}]
|
|
980
|
+
this.logger.log(`[${plugin.name}] failed to check registry.npmjs.org for updates (see https://homebridge.io/w/JJSz6 for help) as ${e.message}.`);
|
|
947
981
|
}
|
|
948
982
|
plugin.publicPackage = false;
|
|
949
983
|
plugin.latestVersion = null;
|
|
@@ -970,18 +1004,25 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
970
1004
|
command.unshift('sudo', '-E', '-n');
|
|
971
1005
|
}
|
|
972
1006
|
else {
|
|
1007
|
+
let npmInstallPath;
|
|
1008
|
+
try {
|
|
1009
|
+
npmInstallPath = (0, node_child_process_1.execSync)('npm root -g').toString().trim();
|
|
1010
|
+
}
|
|
1011
|
+
catch (e) {
|
|
1012
|
+
npmInstallPath = (0, node_path_1.resolve)(cwd, 'node_modules');
|
|
1013
|
+
}
|
|
973
1014
|
try {
|
|
974
|
-
await (0, fs_extra_1.access)(
|
|
1015
|
+
await (0, fs_extra_1.access)(npmInstallPath, fs_extra_1.constants.W_OK);
|
|
975
1016
|
}
|
|
976
1017
|
catch (e) {
|
|
977
1018
|
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`));
|
|
978
|
-
client.emit('stdout', `${
|
|
1019
|
+
client.emit('stdout', `${npmInstallPath}\n\r\n\r`);
|
|
979
1020
|
client.emit('stdout', (0, bash_color_1.yellow)('This may cause the operation to fail.\n\r'));
|
|
980
1021
|
client.emit('stdout', (0, bash_color_1.yellow)('See the docs for details on how to enable sudo mode:\n\r'));
|
|
981
1022
|
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'));
|
|
982
1023
|
}
|
|
983
1024
|
}
|
|
984
|
-
this.logger.log(`Running
|
|
1025
|
+
this.logger.log(`Running command ${command.join(' ')}.`);
|
|
985
1026
|
if (!(0, semver_1.satisfies)(node_process_1.default.version, `>=${this.configService.minimumNodeVersion}`)) {
|
|
986
1027
|
client.emit('stdout', (0, bash_color_1.yellow)(`Node.js v${this.configService.minimumNodeVersion} higher is required for ${this.configService.name}.\n\r`));
|
|
987
1028
|
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`));
|
|
@@ -1042,13 +1083,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1042
1083
|
return;
|
|
1043
1084
|
}
|
|
1044
1085
|
if (!await (0, fs_extra_1.pathExists)(this.configService.customPluginPath)) {
|
|
1045
|
-
this.logger.warn(`Custom plugin directory was removed
|
|
1086
|
+
this.logger.warn(`Custom plugin directory was removed, re-creating ${this.configService.customPluginPath}.`);
|
|
1046
1087
|
try {
|
|
1047
1088
|
await (0, fs_extra_1.ensureDir)(this.configService.customPluginPath);
|
|
1048
1089
|
}
|
|
1049
1090
|
catch (e) {
|
|
1050
|
-
this.logger.error(
|
|
1051
|
-
this.logger.error(e.message);
|
|
1091
|
+
this.logger.error(`Failed to re-create custom plugin directory as ${e.message}.`);
|
|
1052
1092
|
}
|
|
1053
1093
|
}
|
|
1054
1094
|
}
|
|
@@ -1063,7 +1103,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1063
1103
|
}
|
|
1064
1104
|
}
|
|
1065
1105
|
catch (e) {
|
|
1066
|
-
this.logger.error(`Failed to remove ${offendingPath}
|
|
1106
|
+
this.logger.error(`Failed to remove ${offendingPath} as ${e.message}.`);
|
|
1067
1107
|
}
|
|
1068
1108
|
}
|
|
1069
1109
|
async cleanNpmCache() {
|
|
@@ -1072,9 +1112,9 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1072
1112
|
command.unshift('sudo', '-E', '-n');
|
|
1073
1113
|
}
|
|
1074
1114
|
return new Promise((res) => {
|
|
1075
|
-
const child = (0, node_child_process_1.spawn)(command.shift(), command);
|
|
1115
|
+
const child = (0, node_child_process_1.spawn)(command.shift(), command, { shell: true });
|
|
1076
1116
|
child.on('exit', (code) => {
|
|
1077
|
-
this.logger.log(
|
|
1117
|
+
this.logger.log(`Executed npm cache clear command with exit code ${code}.`);
|
|
1078
1118
|
res(null);
|
|
1079
1119
|
});
|
|
1080
1120
|
child.on('error', () => {
|
|
@@ -1093,36 +1133,40 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1093
1133
|
this.pluginIcons = {};
|
|
1094
1134
|
this.hiddenPlugins = [];
|
|
1095
1135
|
this.maintainedPlugins = [];
|
|
1096
|
-
this.
|
|
1136
|
+
this.pluginAuthors = {};
|
|
1137
|
+
this.pluginNames = {};
|
|
1097
1138
|
this.newScopePlugins = {};
|
|
1098
1139
|
Object.keys(pluginListData).forEach((key) => {
|
|
1099
1140
|
const plugin = pluginListData[key];
|
|
1100
|
-
if (plugin.
|
|
1101
|
-
this.pluginIcons[key] = `icons/${plugin.
|
|
1141
|
+
if (plugin.i) {
|
|
1142
|
+
this.pluginIcons[key] = `icons/${plugin.i}.png`;
|
|
1102
1143
|
}
|
|
1103
|
-
if (plugin.
|
|
1144
|
+
if (plugin.h) {
|
|
1104
1145
|
this.hiddenPlugins.push(key);
|
|
1105
1146
|
}
|
|
1106
|
-
if (plugin.
|
|
1147
|
+
if (plugin.m) {
|
|
1107
1148
|
this.maintainedPlugins.push(key);
|
|
1108
1149
|
}
|
|
1109
|
-
if (plugin.
|
|
1110
|
-
this.
|
|
1150
|
+
if (plugin.a) {
|
|
1151
|
+
this.pluginAuthors[key] = plugin.a;
|
|
1152
|
+
}
|
|
1153
|
+
if (plugin.n) {
|
|
1154
|
+
this.pluginNames[key] = plugin.n;
|
|
1111
1155
|
}
|
|
1112
|
-
if (plugin.
|
|
1113
|
-
this.newScopePlugins[key] = plugin.
|
|
1156
|
+
if (plugin.s) {
|
|
1157
|
+
this.newScopePlugins[key] = plugin.s;
|
|
1114
1158
|
}
|
|
1115
|
-
if (plugin.
|
|
1159
|
+
if (plugin.v) {
|
|
1116
1160
|
this.verifiedPlugins.push(key);
|
|
1117
1161
|
}
|
|
1118
|
-
if (plugin.
|
|
1162
|
+
if (plugin.p) {
|
|
1119
1163
|
this.verifiedPlusPlugins.push(key);
|
|
1120
1164
|
}
|
|
1121
1165
|
});
|
|
1122
1166
|
}
|
|
1123
1167
|
catch (e) {
|
|
1124
1168
|
this.pluginListRetryTimeout = setTimeout(() => this.loadPluginList(), 60000);
|
|
1125
|
-
this.logger.debug(
|
|
1169
|
+
this.logger.debug(`Could not obtain plugin list from plugins repo as ${e.message}.`);
|
|
1126
1170
|
}
|
|
1127
1171
|
}
|
|
1128
1172
|
};
|