homebridge-config-ui-x 5.0.0-beta.4 → 5.0.0-beta.41
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 +226 -20
- package/CONTRIBUTING.md +5 -4
- package/LICENSE +1 -1
- package/config.schema.json +38 -18
- 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 -0
- 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 +3 -0
- package/dist/core/config/config.service.js +2 -1
- 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 +25 -14
- 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 +17 -17
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/child-bridges/child-bridges.service.js +3 -3
- 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.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 +2 -2
- 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.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 +122 -66
- 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 +96 -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 +186 -59
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.controller.js +3 -3
- package/dist/modules/status/status.controller.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +1 -0
- package/dist/modules/status/status.service.d.ts +1 -0
- package/dist/modules/status/status.service.js +5 -4
- 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 +38 -37
- 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-22LXR72U.js +1 -0
- package/public/chunk-24YYWTRL.js +1 -0
- package/public/{chunk-WHJOLAED.js → chunk-2ARSC6O4.js} +1 -1
- package/public/{chunk-WNWWUCCZ.js → chunk-2BBAYFXG.js} +1 -1
- package/public/chunk-2C47ZQVM.js +1 -0
- package/public/{chunk-WHJSVGC7.js → chunk-2MYACURS.js} +1 -1
- package/public/chunk-2YUMZBL4.js +1 -0
- package/public/chunk-3NKJ3SC7.js +1 -0
- package/public/chunk-43L3TNTW.js +1 -0
- package/public/chunk-53FTBKZ2.js +1 -0
- package/public/{chunk-JZZQRLNW.js → chunk-5CH326YZ.js} +1 -1
- package/public/chunk-5GFLORE5.js +1 -0
- package/public/chunk-5OAVLMJB.js +1 -0
- package/public/chunk-5WUQGBGI.js +1 -0
- package/public/chunk-6JTL5YGX.js +1 -0
- package/public/chunk-7J7D4RFK.js +1 -0
- package/public/chunk-APMJGFUJ.js +20 -0
- package/public/chunk-ATVAKJWD.js +5 -0
- package/public/chunk-BFQLKNRB.js +1 -0
- package/public/chunk-CDK2Y3HN.js +1 -0
- package/public/chunk-DMUYZZHA.js +1 -0
- package/public/chunk-EIVXZQQB.js +1 -0
- package/public/chunk-F2OXJSVI.js +1 -0
- package/public/chunk-FDTEDMBO.js +1 -0
- package/public/{chunk-NW6AFAD7.js → chunk-FFBZNIV4.js} +1 -1
- package/public/{chunk-QE7DO6J3.js → chunk-FLTVAPLJ.js} +2 -2
- package/public/chunk-FTWFQIC5.js +6 -0
- package/public/chunk-GIEK6ZPY.js +1 -0
- package/public/chunk-GMTWFNWL.js +1 -0
- package/public/{chunk-BKUGARB4.js → chunk-GOHZ4DC4.js} +1 -1
- package/public/{chunk-EA5J2VEJ.js → chunk-GQS3624Y.js} +1 -1
- package/public/chunk-GVN26UPS.js +14 -0
- package/public/chunk-HDTFYFAK.js +1 -0
- package/public/chunk-HTW35OKT.js +1 -0
- package/public/chunk-HW5YYVEW.js +8 -0
- package/public/chunk-I7ZMPJ2B.js +1 -0
- package/public/chunk-IGMEVBSL.js +1 -0
- package/public/chunk-IMLHPIUY.js +1 -0
- package/public/chunk-JB6YXEOR.js +1 -0
- package/public/chunk-JBCLW2TT.js +1 -0
- package/public/chunk-JD2QWCRM.js +1 -0
- package/public/{chunk-MK5BZOUV.js → chunk-JR5AGWSF.js} +2 -2
- package/public/chunk-JZMQ5FID.js +1 -0
- package/public/{chunk-76SU4XMO.js → chunk-K2NHKGRS.js} +1 -1
- package/public/chunk-K6CN42MS.js +32 -0
- package/public/chunk-KDDAEYUJ.js +1 -0
- package/public/chunk-LIHH33QD.js +1 -0
- package/public/chunk-LUDY7ZDU.js +1 -0
- package/public/chunk-M7C65DLI.js +1 -0
- package/public/chunk-N4DQEZFE.js +1 -0
- package/public/chunk-N4QHVBNS.js +1 -0
- package/public/chunk-NQOQC6SC.js +1 -0
- package/public/{chunk-VAW3X7MD.js → chunk-NSH2TVLK.js} +5 -5
- package/public/chunk-NSL7MXSS.js +1 -0
- package/public/chunk-NZL2QIFO.js +2 -0
- package/public/chunk-O22A7NB6.js +1 -0
- package/public/chunk-OSTOAYDG.js +1 -0
- package/public/chunk-PYUYYML6.js +1 -0
- package/public/chunk-QAQJWSYT.js +1 -0
- package/public/chunk-R4PTSPJZ.js +1 -0
- package/public/chunk-SBXSQEJF.js +1 -0
- package/public/chunk-SHXXYX7C.js +1 -0
- package/public/chunk-SM4YBIEF.js +1 -0
- package/public/chunk-SSMNJVEP.js +1 -0
- package/public/chunk-T7TLJFTD.js +1 -0
- package/public/chunk-T7WHHJXM.js +1 -0
- package/public/chunk-TCXBW2AO.js +1 -0
- package/public/chunk-TFB2BTYE.js +1 -0
- package/public/{chunk-7EUQWCP5.js → chunk-UFFY2L3W.js} +1 -1
- package/public/chunk-UG2IE2BJ.js +1 -0
- package/public/{chunk-6TCHCTXZ.js → chunk-V5R6RQCC.js} +1 -1
- package/public/chunk-VF3FSEOJ.js +1 -0
- package/public/chunk-VFNCXSYS.js +1 -0
- package/public/chunk-VHPBI74N.js +1 -0
- package/public/chunk-VRNVEPFN.js +7 -0
- package/public/chunk-VVVHE3PT.js +1 -0
- package/public/chunk-W2YFOD35.js +1 -0
- package/public/{chunk-OE6MK722.js → chunk-WAHBXBRJ.js} +1 -1
- package/public/chunk-WBTQONWJ.js +5 -0
- package/public/chunk-WGDOZLDI.js +1 -0
- package/public/chunk-X22DW5U5.js +1 -0
- package/public/{chunk-CCUID66K.js → chunk-ZDFTIT3A.js} +1 -1
- package/public/{chunk-CGQI6VDR.js → chunk-ZPJGN6MQ.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-QWL6TNWH.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-5ZGAUY5X.css +1 -0
- package/scripts/upgrade-install-plugin.sh +1 -1
- package/public/chunk-2FJGS2P4.js +0 -1
- package/public/chunk-2PVYUZMG.js +0 -1
- package/public/chunk-2VTFU3NZ.js +0 -6
- package/public/chunk-3FUV2YFB.js +0 -1
- package/public/chunk-3IX3CLER.js +0 -1
- package/public/chunk-43QJK3CH.js +0 -1
- package/public/chunk-4AYTHKYE.js +0 -1
- package/public/chunk-4JQFZGIU.js +0 -1
- package/public/chunk-5L7KCDO7.js +0 -1
- package/public/chunk-5SGGTYVP.js +0 -1
- package/public/chunk-64I555F6.js +0 -1
- package/public/chunk-6F552PS2.js +0 -14
- package/public/chunk-6GDRRHLT.js +0 -1
- package/public/chunk-7C3EOONK.js +0 -1
- package/public/chunk-7I2U653A.js +0 -1
- package/public/chunk-A6RDT6EE.js +0 -32
- package/public/chunk-ACHJ26XR.js +0 -1
- package/public/chunk-AMGSXBKP.js +0 -1
- package/public/chunk-AX2NKG76.js +0 -1
- package/public/chunk-BPMSJ2VF.js +0 -1
- package/public/chunk-CDC5JJGR.js +0 -5
- package/public/chunk-CNIFYHFS.js +0 -1
- package/public/chunk-DPHWZNEL.js +0 -1
- package/public/chunk-DXCU4YH5.js +0 -1
- package/public/chunk-ENTRCZRC.js +0 -1
- package/public/chunk-F3LCRXOB.js +0 -1
- package/public/chunk-FUOZMXIE.js +0 -1
- package/public/chunk-GNMMNSKZ.js +0 -1
- package/public/chunk-GONTC5RL.js +0 -1
- package/public/chunk-HC4ULUF5.js +0 -1
- package/public/chunk-HSJSWZHD.js +0 -1
- package/public/chunk-JAM2DL6O.js +0 -1
- package/public/chunk-JLUPHWBK.js +0 -1
- package/public/chunk-KQJ7ONUG.js +0 -1
- package/public/chunk-LAAC3HKW.js +0 -1
- package/public/chunk-MOTRKWPN.js +0 -1
- package/public/chunk-N3JMUDBI.js +0 -1
- package/public/chunk-NZNNTHFQ.js +0 -1
- package/public/chunk-ODPNK7TG.js +0 -1
- package/public/chunk-ORPWYWCL.js +0 -5
- package/public/chunk-OURFK6JB.js +0 -1
- package/public/chunk-PEPJOU6R.js +0 -1
- package/public/chunk-PWJLSQWP.js +0 -8
- package/public/chunk-QHPDGSZ6.js +0 -1
- package/public/chunk-RFBKWUOP.js +0 -20
- package/public/chunk-S22XAG5G.js +0 -1
- package/public/chunk-S23B67SO.js +0 -1
- package/public/chunk-S3ABXPGO.js +0 -1
- package/public/chunk-SUCUQYZ3.js +0 -1
- package/public/chunk-TCSXGQNF.js +0 -1
- package/public/chunk-TXOB7R5K.js +0 -7
- package/public/chunk-U4TY4QYN.js +0 -1
- package/public/chunk-UG5DK2RQ.js +0 -2
- package/public/chunk-UNXETFMR.js +0 -1
- package/public/chunk-VF4E7Q42.js +0 -1
- package/public/chunk-VOPS522V.js +0 -1
- package/public/chunk-VVFRD7PI.js +0 -1
- package/public/chunk-WWTMEHKF.js +0 -1
- package/public/chunk-X6HR3FKR.js +0 -1
- package/public/chunk-Y6NAMXTD.js +0 -1
- package/public/chunk-YAOIYDRH.js +0 -1
- package/public/chunk-ZOOTYXXF.js +0 -1
- package/public/chunk-ZT23DWNL.js +0 -1
- package/public/chunk-ZTCVXHR7.js +0 -1
- package/public/chunk-ZUBSOVIF.js +0 -1
- package/public/main-XXZ7MAPQ.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
|
@@ -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,35 +261,35 @@ 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;
|
|
234
272
|
plugin.updateAvailable = false;
|
|
235
|
-
plugin.updateTag = null;
|
|
236
273
|
plugin.links = {
|
|
237
274
|
npm: `https://www.npmjs.com/package/${plugin.name}`,
|
|
238
275
|
homepage: pkg.homepage,
|
|
239
276
|
bugs: typeof pkg.bugs === 'object' && pkg.bugs?.url ? pkg.bugs.url : null,
|
|
240
277
|
};
|
|
241
|
-
plugin.author = this.
|
|
278
|
+
plugin.author = this.pluginAuthors[pkg.name]
|
|
242
279
|
|| ((pkg.maintainers && pkg.maintainers.length) ? pkg.maintainers[0].name : null);
|
|
243
280
|
plugin.verifiedPlugin = this.verifiedPlugins.includes(pkg.name);
|
|
244
281
|
plugin.verifiedPlusPlugin = this.verifiedPlusPlugins.includes(pkg.name);
|
|
245
282
|
plugin.icon = this.pluginIcons[pkg.name]
|
|
246
283
|
? `${this.pluginListUrl}${this.pluginIcons[pkg.name]}`
|
|
247
284
|
: null;
|
|
248
|
-
plugin.isHbScoped =
|
|
285
|
+
plugin.isHbScoped = pkg.name.startsWith('@homebridge-plugins/');
|
|
249
286
|
plugin.newHbScope = this.newScopePlugins[pkg.name];
|
|
250
287
|
plugin.isHbMaintained = this.maintainedPlugins.includes(pkg.name);
|
|
251
|
-
return [plugin];
|
|
288
|
+
return [this.fixDisplayName(plugin)];
|
|
252
289
|
}
|
|
253
290
|
catch (e) {
|
|
254
291
|
if (e.response?.status !== 404) {
|
|
255
|
-
this.logger.error(`Failed to search the npm registry
|
|
292
|
+
this.logger.error(`Failed to search the npm registry (see https://homebridge.io/w/JJSz6 for help) as ${e.message}.`);
|
|
256
293
|
}
|
|
257
294
|
return [];
|
|
258
295
|
}
|
|
@@ -269,6 +306,14 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
269
306
|
if (action === 'install' && pluginAction.version === 'latest') {
|
|
270
307
|
pluginAction.version = await this.getNpmModuleLatestVersion(pluginAction.name);
|
|
271
308
|
}
|
|
309
|
+
const userPlatform = (0, node_os_1.platform)();
|
|
310
|
+
if (pluginAction.name === this.configService.name && userPlatform === 'linux') {
|
|
311
|
+
const uname = (0, node_child_process_1.execSync)('uname -m').toString().trim();
|
|
312
|
+
const majorVersion = +pluginAction.version.split('.')[0];
|
|
313
|
+
if (uname === 'armv6l' && majorVersion > 4) {
|
|
314
|
+
throw new Error('Versions 5 and above of the Homebridge UI are not compatible with your armv6l device.');
|
|
315
|
+
}
|
|
316
|
+
}
|
|
272
317
|
let installPath = (this.configService.customPluginPath)
|
|
273
318
|
? this.configService.customPluginPath
|
|
274
319
|
: this.installedPlugins.find(x => x.name === this.configService.name).installPath;
|
|
@@ -305,14 +350,18 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
305
350
|
}
|
|
306
351
|
}
|
|
307
352
|
const installOptions = [];
|
|
353
|
+
let npmPluginLabel = pluginAction.name;
|
|
308
354
|
if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
|
|
309
355
|
installOptions.push('--save');
|
|
310
356
|
}
|
|
311
357
|
installPath = (0, node_path_1.resolve)(installPath, '../');
|
|
312
|
-
if (!this.configService.customPluginPath ||
|
|
358
|
+
if (!this.configService.customPluginPath || userPlatform === 'win32' || existingPlugin?.globalInstall === true) {
|
|
313
359
|
installOptions.push('-g');
|
|
314
360
|
}
|
|
315
|
-
|
|
361
|
+
if (action === 'install') {
|
|
362
|
+
installOptions.push('--omit=dev');
|
|
363
|
+
npmPluginLabel = `${pluginAction.name}@${pluginAction.version}`;
|
|
364
|
+
}
|
|
316
365
|
try {
|
|
317
366
|
await this.runNpmCommand([...this.npm, action, ...installOptions, npmPluginLabel], installPath, client, pluginAction.termCols, pluginAction.termRows);
|
|
318
367
|
await this.ensureCustomPluginDirExists();
|
|
@@ -334,21 +383,21 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
334
383
|
return await this.parsePackageJson(await (0, fs_extra_1.readJson)(pkgJsonPath), this.configService.ui.homebridgePackagePath);
|
|
335
384
|
}
|
|
336
385
|
else {
|
|
337
|
-
this.logger.error(`
|
|
386
|
+
this.logger.error(`The Homebridge path ${this.configService.ui.homebridgePackagePath} does not exist.`);
|
|
338
387
|
}
|
|
339
388
|
}
|
|
340
389
|
const modules = await this.getInstalledModules();
|
|
341
390
|
const homebridgeInstalls = modules.filter(x => x.name === 'homebridge');
|
|
342
391
|
if (homebridgeInstalls.length > 1) {
|
|
343
|
-
this.logger.warn('Multiple
|
|
392
|
+
this.logger.warn('Multiple instances of Homebridge were found, see https://homebridge.io/w/JJSgm for help.');
|
|
344
393
|
homebridgeInstalls.forEach((instance) => {
|
|
345
394
|
this.logger.warn(instance.installPath);
|
|
346
395
|
});
|
|
347
396
|
}
|
|
348
397
|
if (!homebridgeInstalls.length) {
|
|
349
398
|
this.configService.hbServiceUiRestartRequired = true;
|
|
350
|
-
this.logger.error('Unable
|
|
351
|
-
throw new Error('Unable To Find Homebridge Installation');
|
|
399
|
+
this.logger.error('Unable to find Homebridge installation, see https://homebridge.io/w/JJSgZ for help.');
|
|
400
|
+
throw new Error('Unable To Find Homebridge Installation.');
|
|
352
401
|
}
|
|
353
402
|
const homebridgeModule = homebridgeInstalls[0];
|
|
354
403
|
const pkgJson = await (0, fs_extra_1.readJson)((0, node_path_1.join)(homebridgeModule.installPath, 'package.json'));
|
|
@@ -364,7 +413,6 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
364
413
|
homebridge.latestVersion = versions.tags[installedTag];
|
|
365
414
|
homebridge.updateAvailable = true;
|
|
366
415
|
homebridge.updateEngines = versions.versions?.[homebridge.latestVersion]?.engines || null;
|
|
367
|
-
homebridge.updateTag = installedTag;
|
|
368
416
|
}
|
|
369
417
|
}
|
|
370
418
|
this.configService.homebridgeVersion = homebridge.installedVersion;
|
|
@@ -378,6 +426,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
378
426
|
}
|
|
379
427
|
let installPath = homebridge.installPath;
|
|
380
428
|
const installOptions = [];
|
|
429
|
+
installOptions.push('--omit=dev');
|
|
381
430
|
if (installPath === this.configService.customPluginPath && await (0, fs_extra_1.pathExists)((0, node_path_1.resolve)(installPath, '../package.json'))) {
|
|
382
431
|
installOptions.push('--save');
|
|
383
432
|
}
|
|
@@ -416,7 +465,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
416
465
|
&& pluginAction.name !== this.configService.name
|
|
417
466
|
&& pluginAction.version !== 'latest') {
|
|
418
467
|
try {
|
|
419
|
-
await (0, rxjs_1.firstValueFrom)(this.httpService.head(`https://github.com/homebridge/
|
|
468
|
+
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
469
|
return true;
|
|
421
470
|
}
|
|
422
471
|
catch (e) {
|
|
@@ -454,7 +503,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
454
503
|
}
|
|
455
504
|
}
|
|
456
505
|
catch (e) {
|
|
457
|
-
this.logger.error(`Failed to check for bundled update
|
|
506
|
+
this.logger.error(`Failed to check for bundled update as ${e.message}.`);
|
|
458
507
|
return '';
|
|
459
508
|
}
|
|
460
509
|
}
|
|
@@ -494,14 +543,14 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
494
543
|
let configSchema = await (0, fs_extra_1.readJson)(schemaPath);
|
|
495
544
|
if (configSchema.dynamicSchemaVersion) {
|
|
496
545
|
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}
|
|
546
|
+
this.logger.log(`[${pluginName}] dynamic schema path: ${dynamicSchemaPath}.`);
|
|
498
547
|
if ((0, fs_extra_1.existsSync)(dynamicSchemaPath)) {
|
|
499
548
|
try {
|
|
500
549
|
configSchema = await (0, fs_extra_1.readJson)(dynamicSchemaPath);
|
|
501
|
-
this.logger.log(`[${pluginName}] dynamic schema loaded from
|
|
550
|
+
this.logger.log(`[${pluginName}] dynamic schema loaded from ${dynamicSchemaPath}.`);
|
|
502
551
|
}
|
|
503
552
|
catch (e) {
|
|
504
|
-
this.logger.error(`[${pluginName}]
|
|
553
|
+
this.logger.error(`[${pluginName}] failed to load dynamic schema from ${dynamicSchemaPath} as ${e.message}.`);
|
|
505
554
|
}
|
|
506
555
|
}
|
|
507
556
|
}
|
|
@@ -626,7 +675,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
626
675
|
?.name;
|
|
627
676
|
}
|
|
628
677
|
catch (e) {
|
|
629
|
-
this.logger.error(`Failed to get list of branches from GitHub
|
|
678
|
+
this.logger.error(`Failed to get list of branches from GitHub as ${e.message}.`);
|
|
630
679
|
}
|
|
631
680
|
}
|
|
632
681
|
return {
|
|
@@ -696,7 +745,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
696
745
|
});
|
|
697
746
|
}
|
|
698
747
|
catch (e) {
|
|
699
|
-
this.logger.debug(
|
|
748
|
+
this.logger.debug(`Failed to extract ${pluginName} plugin alias as ${e.message}.`);
|
|
700
749
|
if (this.pluginAliasHints[pluginName]) {
|
|
701
750
|
output.pluginAlias = this.pluginAliasHints[pluginName].pluginAlias;
|
|
702
751
|
output.pluginType = this.pluginAliasHints[pluginName].pluginType;
|
|
@@ -788,7 +837,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
788
837
|
}
|
|
789
838
|
}
|
|
790
839
|
catch (e) {
|
|
791
|
-
this.logger.log(`Failed to parse
|
|
840
|
+
this.logger.log(`Failed to parse ${module} in ${requiredPath} as ${e.message}.`);
|
|
792
841
|
}
|
|
793
842
|
}
|
|
794
843
|
}
|
|
@@ -824,8 +873,8 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
824
873
|
return [windowsNpmPath[0]];
|
|
825
874
|
}
|
|
826
875
|
else {
|
|
827
|
-
this.logger.error('
|
|
828
|
-
this.logger.error('
|
|
876
|
+
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:');
|
|
877
|
+
this.logger.error('npm install -g npm');
|
|
829
878
|
}
|
|
830
879
|
}
|
|
831
880
|
return ['npm'];
|
|
@@ -876,8 +925,8 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
876
925
|
async parsePackageJson(pkgJson, installPath) {
|
|
877
926
|
const plugin = {
|
|
878
927
|
name: pkgJson.name,
|
|
928
|
+
displayName: pkgJson.displayName || this.pluginNames[pkgJson.name],
|
|
879
929
|
private: pkgJson.private || false,
|
|
880
|
-
displayName: pkgJson.displayName,
|
|
881
930
|
description: (pkgJson.description)
|
|
882
931
|
? pkgJson.description.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '').trim()
|
|
883
932
|
: pkgJson.name,
|
|
@@ -886,7 +935,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
886
935
|
icon: this.pluginIcons[pkgJson.name]
|
|
887
936
|
? `${this.pluginListUrl}${this.pluginIcons[pkgJson.name]}`
|
|
888
937
|
: null,
|
|
889
|
-
isHbScoped:
|
|
938
|
+
isHbScoped: pkgJson.name.startsWith('@homebridge-plugins/'),
|
|
890
939
|
newHbScope: this.newScopePlugins[pkgJson.name],
|
|
891
940
|
isHbMaintained: this.maintainedPlugins.includes(pkgJson.name),
|
|
892
941
|
installedVersion: installPath ? (pkgJson.version || '0.0.1') : null,
|
|
@@ -909,7 +958,6 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
909
958
|
try {
|
|
910
959
|
const fromCache = this.npmPluginCache.get(plugin.name);
|
|
911
960
|
plugin.updateAvailable = false;
|
|
912
|
-
plugin.updateTag = null;
|
|
913
961
|
const pkg = fromCache || (await (0, rxjs_1.firstValueFrom)(this.httpService.get(`https://registry.npmjs.org/${encodeURIComponent(plugin.name).replace(/%40/g, '@')}/latest`))).data;
|
|
914
962
|
plugin.latestVersion = pkg.version;
|
|
915
963
|
plugin.updateAvailable = (0, semver_1.gt)(pkg.version, plugin.installedVersion);
|
|
@@ -925,7 +973,6 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
925
973
|
plugin.latestVersion = versions.tags[installedTag];
|
|
926
974
|
plugin.updateAvailable = true;
|
|
927
975
|
plugin.updateEngines = versions.versions?.[plugin.latestVersion]?.engines || null;
|
|
928
|
-
plugin.updateTag = installedTag;
|
|
929
976
|
}
|
|
930
977
|
}
|
|
931
978
|
}
|
|
@@ -938,17 +985,16 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
938
985
|
homepage: pkg.homepage,
|
|
939
986
|
bugs: typeof pkg.bugs === 'object' && pkg.bugs?.url ? pkg.bugs.url : null,
|
|
940
987
|
};
|
|
941
|
-
plugin.author = this.
|
|
988
|
+
plugin.author = this.pluginAuthors[pkg.name]
|
|
942
989
|
|| ((pkg.maintainers && pkg.maintainers.length) ? pkg.maintainers[0].name : null);
|
|
943
990
|
}
|
|
944
991
|
catch (e) {
|
|
945
992
|
if (e.response?.status !== 404) {
|
|
946
|
-
this.logger.log(`[${plugin.name}]
|
|
993
|
+
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
994
|
}
|
|
948
995
|
plugin.publicPackage = false;
|
|
949
996
|
plugin.latestVersion = null;
|
|
950
997
|
plugin.updateAvailable = false;
|
|
951
|
-
plugin.updateTag = null;
|
|
952
998
|
plugin.links = {};
|
|
953
999
|
}
|
|
954
1000
|
return plugin;
|
|
@@ -970,18 +1016,25 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
970
1016
|
command.unshift('sudo', '-E', '-n');
|
|
971
1017
|
}
|
|
972
1018
|
else {
|
|
1019
|
+
let npmInstallPath;
|
|
1020
|
+
try {
|
|
1021
|
+
npmInstallPath = (0, node_child_process_1.execSync)('npm root -g').toString().trim();
|
|
1022
|
+
}
|
|
1023
|
+
catch (e) {
|
|
1024
|
+
npmInstallPath = (0, node_path_1.resolve)(cwd, 'node_modules');
|
|
1025
|
+
}
|
|
973
1026
|
try {
|
|
974
|
-
await (0, fs_extra_1.access)(
|
|
1027
|
+
await (0, fs_extra_1.access)(npmInstallPath, fs_extra_1.constants.W_OK);
|
|
975
1028
|
}
|
|
976
1029
|
catch (e) {
|
|
977
1030
|
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', `${
|
|
1031
|
+
client.emit('stdout', `${npmInstallPath}\n\r\n\r`);
|
|
979
1032
|
client.emit('stdout', (0, bash_color_1.yellow)('This may cause the operation to fail.\n\r'));
|
|
980
1033
|
client.emit('stdout', (0, bash_color_1.yellow)('See the docs for details on how to enable sudo mode:\n\r'));
|
|
981
1034
|
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
1035
|
}
|
|
983
1036
|
}
|
|
984
|
-
this.logger.log(`Running
|
|
1037
|
+
this.logger.log(`Running command ${command.join(' ')}.`);
|
|
985
1038
|
if (!(0, semver_1.satisfies)(node_process_1.default.version, `>=${this.configService.minimumNodeVersion}`)) {
|
|
986
1039
|
client.emit('stdout', (0, bash_color_1.yellow)(`Node.js v${this.configService.minimumNodeVersion} higher is required for ${this.configService.name}.\n\r`));
|
|
987
1040
|
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 +1095,12 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1042
1095
|
return;
|
|
1043
1096
|
}
|
|
1044
1097
|
if (!await (0, fs_extra_1.pathExists)(this.configService.customPluginPath)) {
|
|
1045
|
-
this.logger.warn(`Custom plugin directory was removed
|
|
1098
|
+
this.logger.warn(`Custom plugin directory was removed, re-creating ${this.configService.customPluginPath}.`);
|
|
1046
1099
|
try {
|
|
1047
1100
|
await (0, fs_extra_1.ensureDir)(this.configService.customPluginPath);
|
|
1048
1101
|
}
|
|
1049
1102
|
catch (e) {
|
|
1050
|
-
this.logger.error(
|
|
1051
|
-
this.logger.error(e.message);
|
|
1103
|
+
this.logger.error(`Failed to re-create custom plugin directory as ${e.message}.`);
|
|
1052
1104
|
}
|
|
1053
1105
|
}
|
|
1054
1106
|
}
|
|
@@ -1063,7 +1115,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1063
1115
|
}
|
|
1064
1116
|
}
|
|
1065
1117
|
catch (e) {
|
|
1066
|
-
this.logger.error(`Failed to remove ${offendingPath}
|
|
1118
|
+
this.logger.error(`Failed to remove ${offendingPath} as ${e.message}.`);
|
|
1067
1119
|
}
|
|
1068
1120
|
}
|
|
1069
1121
|
async cleanNpmCache() {
|
|
@@ -1074,7 +1126,7 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1074
1126
|
return new Promise((res) => {
|
|
1075
1127
|
const child = (0, node_child_process_1.spawn)(command.shift(), command);
|
|
1076
1128
|
child.on('exit', (code) => {
|
|
1077
|
-
this.logger.log(
|
|
1129
|
+
this.logger.log(`Executed npm cache clear command with exit code ${code}.`);
|
|
1078
1130
|
res(null);
|
|
1079
1131
|
});
|
|
1080
1132
|
child.on('error', () => {
|
|
@@ -1093,36 +1145,40 @@ let PluginsService = PluginsService_1 = class PluginsService {
|
|
|
1093
1145
|
this.pluginIcons = {};
|
|
1094
1146
|
this.hiddenPlugins = [];
|
|
1095
1147
|
this.maintainedPlugins = [];
|
|
1096
|
-
this.
|
|
1148
|
+
this.pluginAuthors = {};
|
|
1149
|
+
this.pluginNames = {};
|
|
1097
1150
|
this.newScopePlugins = {};
|
|
1098
1151
|
Object.keys(pluginListData).forEach((key) => {
|
|
1099
1152
|
const plugin = pluginListData[key];
|
|
1100
|
-
if (plugin.
|
|
1101
|
-
this.pluginIcons[key] = `icons/${plugin.
|
|
1153
|
+
if (plugin.i) {
|
|
1154
|
+
this.pluginIcons[key] = `icons/${plugin.i}.png`;
|
|
1102
1155
|
}
|
|
1103
|
-
if (plugin.
|
|
1156
|
+
if (plugin.h) {
|
|
1104
1157
|
this.hiddenPlugins.push(key);
|
|
1105
1158
|
}
|
|
1106
|
-
if (plugin.
|
|
1159
|
+
if (plugin.m) {
|
|
1107
1160
|
this.maintainedPlugins.push(key);
|
|
1108
1161
|
}
|
|
1109
|
-
if (plugin.
|
|
1110
|
-
this.
|
|
1162
|
+
if (plugin.a) {
|
|
1163
|
+
this.pluginAuthors[key] = plugin.a;
|
|
1164
|
+
}
|
|
1165
|
+
if (plugin.n) {
|
|
1166
|
+
this.pluginNames[key] = plugin.n;
|
|
1111
1167
|
}
|
|
1112
|
-
if (plugin.
|
|
1113
|
-
this.newScopePlugins[key] = plugin.
|
|
1168
|
+
if (plugin.s) {
|
|
1169
|
+
this.newScopePlugins[key] = plugin.s;
|
|
1114
1170
|
}
|
|
1115
|
-
if (plugin.
|
|
1171
|
+
if (plugin.v) {
|
|
1116
1172
|
this.verifiedPlugins.push(key);
|
|
1117
1173
|
}
|
|
1118
|
-
if (plugin.
|
|
1174
|
+
if (plugin.p) {
|
|
1119
1175
|
this.verifiedPlusPlugins.push(key);
|
|
1120
1176
|
}
|
|
1121
1177
|
});
|
|
1122
1178
|
}
|
|
1123
1179
|
catch (e) {
|
|
1124
1180
|
this.pluginListRetryTimeout = setTimeout(() => this.loadPluginList(), 60000);
|
|
1125
|
-
this.logger.debug(
|
|
1181
|
+
this.logger.debug(`Could not obtain plugin list from plugins repo as ${e.message}.`);
|
|
1126
1182
|
}
|
|
1127
1183
|
}
|
|
1128
1184
|
};
|