iobroker.eusec 1.2.0 → 1.3.0
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/LICENSE +1 -1
- package/README.md +47 -114
- package/admin/i18n/de/translations.json +252 -1
- package/admin/i18n/en/translations.json +252 -1
- package/admin/i18n/es/translations.json +252 -1
- package/admin/i18n/fr/translations.json +252 -1
- package/admin/i18n/it/translations.json +252 -1
- package/admin/i18n/nl/translations.json +252 -1
- package/admin/i18n/pl/translations.json +252 -1
- package/admin/i18n/pt/translations.json +252 -1
- package/admin/i18n/ru/translations.json +252 -1
- package/admin/i18n/uk/translations.json +275 -24
- package/admin/i18n/zh-cn/translations.json +252 -1
- package/admin/jsonConfig.json +1015 -0
- package/admin/words.js +3297 -17
- package/build/lib/log.js +1 -0
- package/build/lib/log.js.map +1 -1
- package/build/lib/types.js +6 -5
- package/build/lib/types.js.map +2 -2
- package/build/lib/utils.js +51 -41
- package/build/lib/utils.js.map +2 -2
- package/build/lib/video.js +148 -20
- package/build/lib/video.js.map +3 -3
- package/build/main.js +550 -169
- package/build/main.js.map +3 -3
- package/io-package.json +51 -52
- package/package.json +40 -37
- package/build/lib/tools.js +0 -94
- package/build/lib/tools.js.map +0 -7
- package/build/lib/web.js +0 -64
- package/build/lib/web.js.map +0 -7
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "eusec",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.3.0": {
|
|
7
|
+
"en": "Requires ioBroker.js-controller version >= 6.0.0\nRequires ioBroker.admin version >= 7.0.12\nRequires node version >= 20\nAdded support for Floodlight Cam E340 (T8425; #428)\nAdded support for Solar Wall Light Cam S120 (T84A0; #406)\nAdded support for Indoor Cam S350 (T8416; #403)\nAdded support for eufyCam E330 (Professional; T8600; #391)\nAdded support for SoloCam S340 (T8170; #392, #399)\nImplemented sendTo functionality (#294)\nUpdated version of the package eufy-security-client (3.1.0)\nUpdated version of the package go2rtc-static (1.9.4)\nFixed issues #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
8
|
+
"uk": "Requires ioBroker.js-controller version >= 6.0.0\nRequires ioBroker.admin version >= 7.0.12\nRequires node version >= 20\nAdded support for Floodlight Cam E340 (T8425; #428)\nAdded support for Solar Wall Light Cam S120 (T84A0; #406)\nAdded support for Indoor Cam S350 (T8416; #403)\nAdded support for eufyCam E330 (Professional; T8600; #391)\nAdded support for SoloCam S340 (T8170; #392, #399)\nImplemented sendTo functionality (#294)\nUpdated version of the package eufy-security-client (3.1.0)\nUpdated version of the package go2rtc-static (1.9.4)\nFixed issues #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
9
|
+
"de": "Erfordert ioBroker.js-controller Version >= 6.0.0\nErfordert ioBroker.admin Version >= 7.0.12\nErfordert Node-Version >= 20\nUnterstützung für Floodlight Cam E340 (T8425; #428) hinzugefügt\nUnterstützung für Solar Wall Light Cam S120 (T84A0; #406) hinzugefügt\nUnterstützung für Indoor Cam S350 (T8416; #403) hinzugefügt\nUnterstützung für eufyCam E330 (Professional; T8600; #391) hinzugefügt\nUnterstützung für SoloCam S340 (T8170; #392, #399) hinzugefügt\nSendTo-Funktionalität implementiert (#294)\nVersion des Pakets eufy-security-client (3.1.0) aktualisiert\nAktualisierte Version des Pakets go2rtc-static (1.9.4)\nBehobene Probleme #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
10
|
+
"ru": "Требуется версия ioBroker.js-controller >= 6.0.0\nТребуется версия ioBroker.admin >= 7.0.12\nТребуется версия node >= 20\nДобавлена поддержка Floodlight Cam E340 (T8425; #428)\nДобавлена поддержка Solar Wall Light Cam S120 (T84A0; #406)\nДобавлена поддержка Indoor Cam S350 (T8416; #403)\nДобавлена поддержка eufyCam E330 (Professional; T8600; #391)\nДобавлена поддержка SoloCam S340 (T8170; #392, #399)\nРеализована функциональность sendTo (#294)\nОбновленная версия пакета eufy-security-client (3.1.0)\nОбновлена версия пакета go2rtc-static (1.9.4)\nИсправлены проблемы #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
11
|
+
"pt": "Requer ioBroker.js-controller versão >= 6.0.0\nRequer ioBroker.admin versão >= 7.0.12\nRequer node versão >= 20\nAdicionado suporte para Floodlight Cam E340 (T8425; #428)\nAdicionado suporte para Solar Wall Light Cam S120 (T84A0; #406)\nAdicionado suporte para Indoor Cam S350 (T8416; #403)\nAdicionado suporte para eufyCam E330 (Professional; T8600; #391)\nAdicionado suporte para SoloCam S340 (T8170; #392, #399)\nImplementada a funcionalidade sendTo (#294)\nVersão atualizada do pacote eufy-security-client (3.1.0)\nVersão atualizada do pacote go2rtc-static (1.9.4)\nProblemas corrigidos #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
12
|
+
"nl": "Vereist ioBroker.js-controller versie >= 6.0.0\nVereist ioBroker.admin versie >= 7.0.12\nVereist node versie >= 20\nOndersteuning toegevoegd voor Floodlight Cam E340 (T8425; #428)\nOndersteuning toegevoegd voor Solar Wall Light Cam S120 (T84A0; #406)\nOndersteuning toegevoegd voor Indoor Cam S350 (T8416; #403)\nOndersteuning toegevoegd voor eufyCam E330 (Professional; T8600; #391)\nOndersteuning toegevoegd voor SoloCam S340 (T8170; #392, #399)\nStuurTo functionaliteit geïmplementeerd (#294)\nBijgewerkte versie van het pakket eufy-security-client (3.1.0)\nBijgewerkte versie van het pakket go2rtc-static (1.9.4)\nProblemen opgelost #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
13
|
+
"fr": "Nécessite une version de ioBroker.js-controller >= 6.0.0\nNécessite une version de ioBroker.admin >= 7.0.12\nNécessite une version de node >= 20\nAjout de la prise en charge de la Floodlight Cam E340 (T8425; #428)\nAjout de la prise en charge de la Solar Wall Light Cam S120 (T84A0; #406)\nAjout de la prise en charge de la Indoor Cam S350 (T8416; #403)\nAjout de la prise en charge de la eufyCam E330 (Professional; T8600; #391)\nAjout de la prise en charge de la SoloCam S340 (T8170; #392, #399)\nImplémentation de la fonctionnalité sendTo (#294)\nVersion mise à jour du paquet eufy-security-client (3.1.0)\nVersion mise à jour du paquet go2rtc-static (1.9.4)\nCorrection des problèmes #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
14
|
+
"it": "Richiede la versione di ioBroker.js-controller >= 6.0.0\nRichiede la versione di ioBroker.admin >= 7.0.12\nRichiede la versione di node >= 20\nAggiunto il supporto per Floodlight Cam E340 (T8425; #428)\nAggiunto il supporto per Solar Wall Light Cam S120 (T84A0; #406)\nAggiunto il supporto per Indoor Cam S350 (T8416; #403)\nAggiunto il supporto per eufyCam E330 (Professional; T8600; #391)\nAggiunto il supporto per SoloCam S340 (T8170; #392, #399)\nImplementata la funzionalità sendTo (#294)\nAggiornata la versione del pacchetto eufy-security-client (3.1.0)\nVersione aggiornata del pacchetto go2rtc-static (1.9.4)\nRisolti i problemi #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
15
|
+
"es": "Requiere ioBroker.js-controller versión >= 6.0.0\nRequiere ioBroker.admin versión >= 7.0.12\nRequiere node versión >= 20\nAñadido soporte para Floodlight Cam E340 (T8425; #428)\nAñadido soporte para Solar Wall Light Cam S120 (T84A0; #406)\nAñadido soporte para Indoor Cam S350 (T8416; #403)\nAñadido soporte para eufyCam E330 (Professional; T8600; #391)\nAñadido soporte para SoloCam S340 (T8170; #392, #399)\nImplementada la funcionalidad sendTo (#294)\nVersión actualizada del paquete eufy-security-client (3.1.0)\nVersión actualizada del paquete go2rtc-static (1.9.4)\nSolucionados los problemas #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
16
|
+
"pl": "Wymaga ioBroker.js-controller w wersji >= 6.0.0\nWymaga ioBroker.admin w wersji >= 7.0.12\nWymaga node w wersji >= 20\nDodano obsługę Floodlight Cam E340 (T8425; #428).\nDodano obsługę Solar Wall Light Cam S120 (T84A0; #406).\nDodano obsługę Indoor Cam S350 (T8416; #403).\nDodano obsługę eufyCam E330 (Professional; T8600; #391).\nDodano obsługę SoloCam S340 (T8170; #392, #399).\nZaimplementowano funkcję sendTo (#294)\nZaktualizowana wersja pakietu eufy-security-client (3.1.0)\nZaktualizowano wersję pakietu go2rtc-static (1.9.4)\nNaprawiono błędy #371, #376, #379, #380, #387, #420, #422, #432\n",
|
|
17
|
+
"zh-cn": "要求 ioBroker.js-controller 版本 >= 6.0.0\n要求 ioBroker.admin 版本 >= 7.0.12\n要求 node 版本 >= 20\n已添加对 Floodlight Cam E340(T8425; #428)的支持\n已添加对 Solar Wall Light Cam S120(T84A0; #406)的支持\n已添加对 Indoor Cam S350(T8416; #403)的支持\n已添加对 eufyCam E330(Professional; T8600; #391)的支持\n已添加对 SoloCam S340(T8170; #392, #399)的支持\n執行 sendTo 功能 (#294)\n包 eufy-security-client (3.1.0) 的更新版本\n软件包 go2rtc-static 的更新版本 (1.9.4)\n修正問題 #371、#376、#379、#380、#387、#420、#422、#432\n"
|
|
18
|
+
},
|
|
19
|
+
"1.2.1": {
|
|
20
|
+
"en": "Updated version of the package eufy-security-client (2.9.1)\n",
|
|
21
|
+
"uk": "Updated version of the package eufy-security-client (2.9.1)\n",
|
|
22
|
+
"de": "Version des Pakets eufy-security-client (2.9.1) aktualisiert\n",
|
|
23
|
+
"ru": "Обновленная версия пакета eufy-security-client (2.9.1)\n",
|
|
24
|
+
"pt": "Versão atualizada do pacote eufy-security-client (2.9.1)\n",
|
|
25
|
+
"nl": "Bijgewerkte versie van het pakket eufy-security-client (2.9.1)\n",
|
|
26
|
+
"fr": "Version mise à jour du paquet eufy-security-client (2.9.1)\n",
|
|
27
|
+
"it": "Aggiornata la versione del pacchetto eufy-security-client (2.9.1)\n",
|
|
28
|
+
"es": "Versión actualizada del paquete eufy-security-client (2.9.1)\n",
|
|
29
|
+
"pl": "Zaktualizowana wersja pakietu eufy-security-client (2.9.1)\n",
|
|
30
|
+
"zh-cn": "包 eufy-security-client (2.9.1) 的更新版本\n"
|
|
31
|
+
},
|
|
6
32
|
"1.2.0": {
|
|
7
33
|
"en": "Requires node version >= 18\nAdded support for SmartTrack Link (T87B0) and SmartTrack Card (T87B2)\nAdded support for SoloCam S220 (T8134)\nUpdated version of the package go2rtc-static (1.8.1)\nUpdated version of the package eufy-security-client (2.9.0)\n",
|
|
8
34
|
"uk": "Requires node version >= 18\nAdded support for SmartTrack Link (T87B0) and SmartTrack Card (T87B2)\nAdded support for SoloCam S220 (T8134)\nUpdated version of the package go2rtc-static (1.8.1)\nUpdated version of the package eufy-security-client (2.9.0)\n",
|
|
@@ -15,45 +41,6 @@
|
|
|
15
41
|
"es": "Requiere node versión >= 18\nAgregado soporte para SmartTrack Link (T87B0) y SmartTrack Card (T87B2)\nAgregado soporte para SoloCam S220 (T8134)\nVersión actualizada del paquete go2rtc-static (1.8.1)\nVersión actualizada del paquete eufy-security-client (2.9.0)\n",
|
|
16
42
|
"pl": "Wymaga node w wersji >= 18\nDodano obsługę SmartTrack Link (T87B0) i SmartTrack Card (T87B2)\nDodano obsługę SoloCam S220 (T8134)\nZaktualizowano wersję pakietu go2rtc-static (1.8.1)\nZaktualizowano wersję pakietu eufy-security-client (2.9.0)\n",
|
|
17
43
|
"zh-cn": "要求 node 版本 >= 18\n添加了对智能跟踪链接(T87B0)和智能跟踪卡(T87B2)的支持\n添加了对 SoloCam S220 (T8134) 的支持\n软件包 go2rtc-static 的更新版本 (1.8.1)\n软件包 eufy-security-client 的更新版本 (2.9.0)\n"
|
|
18
|
-
},
|
|
19
|
-
"1.1.2": {
|
|
20
|
-
"en": "Updated version of the package eufy-security-client (2.8.1)\n",
|
|
21
|
-
"uk": "Updated version of the package eufy-security-client (2.8.1)\n",
|
|
22
|
-
"de": "Version des Pakets eufy-security-client (2.8.1) aktualisiert\n",
|
|
23
|
-
"ru": "Обновленная версия пакета eufy-security-client (2.8.1)\n",
|
|
24
|
-
"pt": "Versão atualizada do pacote eufy-security-client (2.8.1)\n",
|
|
25
|
-
"nl": "Bijgewerkte versie van het pakket eufy-security-client (2.8.1)\n",
|
|
26
|
-
"fr": "Version mise à jour du paquet eufy-security-client (2.8.1)\n",
|
|
27
|
-
"it": "Aggiornata la versione del pacchetto eufy-security-client (2.8.1)\n",
|
|
28
|
-
"es": "Versión actualizada del paquete eufy-security-client (2.8.1)\n",
|
|
29
|
-
"pl": "Zaktualizowana wersja pakietu eufy-security-client (2.8.1)\n",
|
|
30
|
-
"zh-cn": "包 eufy-security-client (2.8.1) 的更新版本\n"
|
|
31
|
-
},
|
|
32
|
-
"1.1.1": {
|
|
33
|
-
"en": "Fixed issues #365, #363\nUpdated version of the package ffmpeg-static (5.2.0)\nUpdated version of the package eufy-security-client (2.8.0)\n",
|
|
34
|
-
"uk": "Fixed issues #365, #363\nUpdated version of the package ffmpeg-static (5.2.0)\nUpdated version of the package eufy-security-client (2.8.0)\n",
|
|
35
|
-
"de": "Behobene Probleme #365, #363\nVersion des Pakets ffmpeg-static (5.2.0) aktualisiert\nVersion des Pakets eufy-security-client (2.8.0) aktualisiert\n",
|
|
36
|
-
"ru": "Исправлены проблемы #365, #363\nОбновленная версия пакета ffmpeg-static (5.2.0)\nОбновленная версия пакета eufy-security-client (2.8.0)\n",
|
|
37
|
-
"pt": "Problemas corrigidos #365, #363\nVersão atualizada do pacote ffmpeg-static (5.2.0)\nVersão atualizada do pacote eufy-security-client (2.8.0)\n",
|
|
38
|
-
"nl": "Problemen opgelost #365, #363\nBijgewerkte versie van het pakket ffmpeg-static (5.2.0)\nBijgewerkte versie van het pakket eufy-security-client (2.8.0)\n",
|
|
39
|
-
"fr": "Correction des problèmes #365, #363\nVersion mise à jour du paquet ffmpeg-static (5.2.0)\nVersion mise à jour du paquet eufy-security-client (2.8.0)\n",
|
|
40
|
-
"it": "Risolti i problemi #365, #363\nAggiornata la versione del pacchetto ffmpeg-static (5.2.0)\nAggiornata la versione del pacchetto eufy-security-client (2.8.0)\n",
|
|
41
|
-
"es": "Solucionados los problemas #365, #363\nVersión actualizada del paquete ffmpeg-static (5.2.0)\nVersión actualizada del paquete eufy-security-client (2.8.0)\n",
|
|
42
|
-
"pl": "Naprawiono błędy #365, #363\nZaktualizowana wersja pakietu ffmpeg-static (5.2.0)\nZaktualizowana wersja pakietu eufy-security-client (2.8.0)\n",
|
|
43
|
-
"zh-cn": "修复了 #365 和 #363 号问题\n包 ffmpeg-static (5.2.0) 的更新版本\n包 eufy-security-client (2.8.0) 的更新版本\n"
|
|
44
|
-
},
|
|
45
|
-
"1.1.0": {
|
|
46
|
-
"en": "Added support for Wired Wall Light Cam S100 (T84A1; #332)\nAdded support for Garage-Control Cam (T8452)\nFixed issues #316, #342, #347, #353\nUpdated version of the package go2rtc-static (1.6.2)\nUpdated version of the package eufy-security-client (2.7.1)\n",
|
|
47
|
-
"uk": "Added support for Wired Wall Light Cam S100 (T84A1; #332)\nAdded support for Garage-Control Cam (T8452)\nFixed issues #316, #342, #347, #353\nUpdated version of the package go2rtc-static (1.6.2)\nUpdated version of the package eufy-security-client (2.7.1)\n",
|
|
48
|
-
"de": "Unterstützung für Wired Wall Light Cam S100 (T84A1; #332) hinzugefügt\nUnterstützung für Garage-Control Cam hinzugefügt (T8452)\nBehobene Probleme #316, #342, #347, #353\nVersion des Pakets go2rtc-static (1.6.2) aktualisiert\nVersion des Pakets eufy-security-client (2.7.1) aktualisiert\n",
|
|
49
|
-
"ru": "Добавлена поддержка Wired Wall Light Cam S100 (T84A1; #332)\nДобавлена поддержка Garage-Control Cam (T8452)\nИсправлены проблемы #316, #342, #347, #353\nОбновленная версия пакета go2rtc-static (1.6.2)\nОбновленная версия пакета eufy-security-client (2.7.1)\n",
|
|
50
|
-
"pt": "Adicionado suporte para Wired Wall Light Cam S100 (T84A1; #332)\nAdicionado suporte para Garage-Control Cam (T8452)\nProblemas corrigidos #316, #342, #347, #353\nVersão atualizada do pacote go2rtc-static (1.6.2)\nVersão atualizada do pacote eufy-security-client (2.7.1)\n",
|
|
51
|
-
"nl": "Ondersteuning toegevoegd voor Wired Wall Light Cam S100 (T84A1; #332)\nOndersteuning toegevoegd voor Garage-Control Cam (T8452)\nProblemen opgelost #316, #342, #347, #353\nBijgewerkte versie van het pakket go2rtc-static (1.6.2)\nBijgewerkte versie van het pakket eufy-security-client (2.7.1)\n",
|
|
52
|
-
"fr": "Ajout de la prise en charge de la Wired Wall Light Cam S100 (T84A1 ; #332)\nAjout de la prise en charge de la Garage-Control Cam (T8452)\nCorrection des problèmes #316, #342, #347, #353\nVersion mise à jour du paquet go2rtc-static (1.6.2)\nVersion mise à jour du paquet eufy-security-client (2.7.1)\n",
|
|
53
|
-
"it": "Aggiunto il supporto per Wired Wall Light Cam S100 (T84A1; #332)\nAggiunto il supporto per Garage-Control Cam (T8452)\nRisolti i problemi #316, #342, #347, #353\nAggiornata la versione del pacchetto go2rtc-static (1.6.2)\nAggiornata la versione del pacchetto eufy-security-client (2.7.1)\n",
|
|
54
|
-
"es": "Añadido soporte para Wired Wall Light Cam S100 (T84A1; #332)\nAñadido soporte para Garage-Control Cam (T8452)\nSolucionados los problemas #316, #342, #347, #353\nVersión actualizada del paquete go2rtc-static (1.6.2)\nVersión actualizada del paquete eufy-security-client (2.7.1)\n",
|
|
55
|
-
"pl": "Dodano obsługę Wired Wall Light Cam S100 (T84A1; #332).\nDodano obsługę Garage-Control Cam (T8452)\nNaprawiono błędy #316, #342, #347, #353\nZaktualizowana wersja pakietu go2rtc-static (1.6.2)\nZaktualizowana wersja pakietu eufy-security-client (2.7.1)\n",
|
|
56
|
-
"zh-cn": "已添加对 Wired Wall Light Cam S100(T84A1;#332)的支持\n已添加对 Garage-Control Cam(T8452)的支持\n修复了 #316、#342、#347 和 #353 号问题\n包 go2rtc-static (1.6.2) 的更新版本\n包 eufy-security-client (2.7.1) 的更新版本\n"
|
|
57
44
|
}
|
|
58
45
|
},
|
|
59
46
|
"titleLang": {
|
|
@@ -94,9 +81,11 @@
|
|
|
94
81
|
"doorbell",
|
|
95
82
|
"eufy-security"
|
|
96
83
|
],
|
|
97
|
-
"
|
|
84
|
+
"licenseInformation": {
|
|
85
|
+
"license": "MIT",
|
|
86
|
+
"type": "free"
|
|
87
|
+
},
|
|
98
88
|
"platform": "Javascript/Node.js",
|
|
99
|
-
"main": "build/main.js",
|
|
100
89
|
"icon": "eusec.png",
|
|
101
90
|
"enabled": true,
|
|
102
91
|
"extIcon": "https://raw.githubusercontent.com/bropat/ioBroker.eusec/master/admin/eusec.png",
|
|
@@ -104,24 +93,22 @@
|
|
|
104
93
|
"loglevel": "info",
|
|
105
94
|
"mode": "daemon",
|
|
106
95
|
"type": "alarm",
|
|
107
|
-
"compact":
|
|
96
|
+
"compact": false,
|
|
108
97
|
"connectionType": "cloud",
|
|
109
98
|
"dataSource": "poll",
|
|
110
|
-
"
|
|
111
|
-
"
|
|
99
|
+
"tier": 2,
|
|
100
|
+
"messagebox": true,
|
|
112
101
|
"dependencies": [
|
|
113
102
|
{
|
|
114
|
-
"js-controller": ">=
|
|
115
|
-
"web": ">=4.0.0"
|
|
103
|
+
"js-controller": ">=6.0.0"
|
|
116
104
|
}
|
|
117
105
|
],
|
|
118
106
|
"globalDependencies": [
|
|
119
107
|
{
|
|
120
|
-
"admin": ">=
|
|
108
|
+
"admin": ">=7.0.12"
|
|
121
109
|
}
|
|
122
110
|
],
|
|
123
111
|
"dataFolder": "eusec.%INSTANCE%",
|
|
124
|
-
"jsonConfig": true,
|
|
125
112
|
"adminUI": {
|
|
126
113
|
"config": "json"
|
|
127
114
|
}
|
|
@@ -137,11 +124,11 @@
|
|
|
137
124
|
"native": {
|
|
138
125
|
"username": "",
|
|
139
126
|
"password": "",
|
|
127
|
+
"country": "iobroker",
|
|
140
128
|
"pollingInterval": 10,
|
|
141
129
|
"maxLivestreamDuration": 120,
|
|
142
130
|
"verificationMethod": 2,
|
|
143
131
|
"eventDuration": 15,
|
|
144
|
-
"webInstance": "*",
|
|
145
132
|
"p2pConnectionType": "quickest",
|
|
146
133
|
"acceptInvitations": true,
|
|
147
134
|
"alarmSoundDuration": 60,
|
|
@@ -160,8 +147,20 @@
|
|
|
160
147
|
"_id": "",
|
|
161
148
|
"type": "meta",
|
|
162
149
|
"common": {
|
|
163
|
-
|
|
164
|
-
|
|
150
|
+
"name": {
|
|
151
|
+
"en": "File storage for euSec",
|
|
152
|
+
"de": "Dateiablage für euSec",
|
|
153
|
+
"ru": "Файловое хранилище для euSec",
|
|
154
|
+
"pt": "Armazenamento de arquivos para a euSec",
|
|
155
|
+
"nl": "Bestandsopslag voor euSec",
|
|
156
|
+
"fr": "Stockage de fichiers",
|
|
157
|
+
"it": "Archiviazione dei file per euSec",
|
|
158
|
+
"es": "Almacenamiento de archivos para euSec",
|
|
159
|
+
"pl": "Przechowywanie plików dla euSec",
|
|
160
|
+
"uk": "Зберігання файлів для euSec",
|
|
161
|
+
"zh-cn": "euSec 的文件存储"
|
|
162
|
+
},
|
|
163
|
+
"type": "meta.user"
|
|
165
164
|
},
|
|
166
165
|
"native": {}
|
|
167
166
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.eusec",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "ioBroker adapter that integrates Eufy-Security cameras with stations",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "bropat",
|
|
@@ -13,56 +13,59 @@
|
|
|
13
13
|
"eufycam",
|
|
14
14
|
"cam",
|
|
15
15
|
"cameras",
|
|
16
|
-
"security"
|
|
16
|
+
"security",
|
|
17
|
+
"ioBroker"
|
|
17
18
|
],
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
20
21
|
"url": "https://github.com/bropat/ioBroker.eusec"
|
|
21
22
|
},
|
|
22
23
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
24
|
+
"node": ">=20.0.0"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
27
|
"@bropat/fluent-ffmpeg": "^2.1.3",
|
|
27
|
-
"@cospired/i18n-iso-languages": "^4.
|
|
28
|
-
"@iobroker/adapter-core": "^3.
|
|
29
|
-
"eufy-security-client": "^
|
|
30
|
-
"ffmpeg-
|
|
31
|
-
"fs-extra": "^11.
|
|
32
|
-
"go2rtc-static": "^1.
|
|
33
|
-
"got": "^
|
|
34
|
-
"i18n-iso-countries": "^7.
|
|
35
|
-
"mime": "^
|
|
28
|
+
"@cospired/i18n-iso-languages": "^4.2.0",
|
|
29
|
+
"@iobroker/adapter-core": "^3.1.6",
|
|
30
|
+
"eufy-security-client": "^3.1.0",
|
|
31
|
+
"ffmpeg-for-homebridge": "^2.1.1",
|
|
32
|
+
"fs-extra": "^11.2.0",
|
|
33
|
+
"go2rtc-static": "^1.9.4",
|
|
34
|
+
"got": "^14.4.2",
|
|
35
|
+
"i18n-iso-countries": "^7.11.3",
|
|
36
|
+
"mime": "^4.0.4",
|
|
36
37
|
"ts-log": "^2.2.5"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@iobroker/adapter-dev": "^1.
|
|
40
|
-
"@alcalzone/release-script": "^3.
|
|
41
|
-
"@iobroker
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@types/
|
|
45
|
-
"@types/
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"@types/
|
|
49
|
-
"@types/
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/
|
|
52
|
-
"@types/sinon
|
|
53
|
-
"@
|
|
54
|
-
"@typescript-eslint/
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
40
|
+
"@iobroker/adapter-dev": "^1.3.0",
|
|
41
|
+
"@alcalzone/release-script": "^3.8.0",
|
|
42
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
|
|
43
|
+
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
44
|
+
"@iobroker/testing": "^4.1.3",
|
|
45
|
+
"@types/chai": "^4.3.18",
|
|
46
|
+
"@types/chai-as-promised": "^7.1.8",
|
|
47
|
+
"@types/express": "^4.17.21",
|
|
48
|
+
"@types/ffmpeg-static": "^3.0.3",
|
|
49
|
+
"@types/fs-extra": "^11.0.4",
|
|
50
|
+
"@types/mocha": "^10.0.7",
|
|
51
|
+
"@types/node": "^20.16.1",
|
|
52
|
+
"@types/proxyquire": "^1.3.31",
|
|
53
|
+
"@types/sinon": "^17.0.3",
|
|
54
|
+
"@types/sinon-chai": "^3.2.12",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^8.3.0",
|
|
56
|
+
"@typescript-eslint/parser": "^8.3.0",
|
|
57
|
+
"@tsconfig/node20": "^20.1.4",
|
|
58
|
+
"chai": "^5.1.1",
|
|
59
|
+
"chai-as-promised": "^8.0.0",
|
|
60
|
+
"eslint": "^9.9.1",
|
|
61
|
+
"mocha": "^10.7.3",
|
|
59
62
|
"proxyquire": "^2.1.3",
|
|
60
|
-
"rimraf": "^
|
|
61
|
-
"sinon": "^
|
|
62
|
-
"sinon-chai": "^
|
|
63
|
+
"rimraf": "^6.0.1",
|
|
64
|
+
"sinon": "^18.0.0",
|
|
65
|
+
"sinon-chai": "^4.0.0",
|
|
63
66
|
"source-map-support": "^0.5.21",
|
|
64
|
-
"ts-node": "^10.9.
|
|
65
|
-
"typescript": "5.
|
|
67
|
+
"ts-node": "^10.9.2",
|
|
68
|
+
"typescript": "^5.5.4"
|
|
66
69
|
},
|
|
67
70
|
"main": "build/main.js",
|
|
68
71
|
"files": [
|
package/build/lib/tools.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var tools_exports = {};
|
|
26
|
-
__export(tools_exports, {
|
|
27
|
-
isArray: () => isArray,
|
|
28
|
-
isObject: () => isObject,
|
|
29
|
-
translateText: () => translateText
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(tools_exports);
|
|
32
|
-
var import_got = __toESM(require("got"));
|
|
33
|
-
function isObject(it) {
|
|
34
|
-
return Object.prototype.toString.call(it) === "[object Object]";
|
|
35
|
-
}
|
|
36
|
-
function isArray(it) {
|
|
37
|
-
if (Array.isArray != null)
|
|
38
|
-
return Array.isArray(it);
|
|
39
|
-
return Object.prototype.toString.call(it) === "[object Array]";
|
|
40
|
-
}
|
|
41
|
-
async function translateText(text, targetLang, yandexApiKey) {
|
|
42
|
-
if (targetLang === "en") {
|
|
43
|
-
return text;
|
|
44
|
-
} else if (!text) {
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
if (yandexApiKey) {
|
|
48
|
-
return translateYandex(text, targetLang, yandexApiKey);
|
|
49
|
-
} else {
|
|
50
|
-
return translateGoogle(text, targetLang);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async function translateYandex(text, targetLang, apiKey) {
|
|
54
|
-
var _a;
|
|
55
|
-
if (targetLang === "zh-cn") {
|
|
56
|
-
targetLang = "zh";
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
|
|
60
|
-
const response = await (0, import_got.default)({ url, timeout: 15e3 });
|
|
61
|
-
if (isArray((_a = response.body) == null ? void 0 : _a.text)) {
|
|
62
|
-
return response.body.text[0];
|
|
63
|
-
}
|
|
64
|
-
throw new Error("Invalid response for translate request");
|
|
65
|
-
} catch (e) {
|
|
66
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
async function translateGoogle(text, targetLang) {
|
|
70
|
-
var _a;
|
|
71
|
-
try {
|
|
72
|
-
const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
|
|
73
|
-
const response = await (0, import_got.default)({ url, timeout: 15e3 });
|
|
74
|
-
if (isArray(response.body)) {
|
|
75
|
-
return response.body[0][0][0];
|
|
76
|
-
}
|
|
77
|
-
throw new Error("Invalid response for translate request");
|
|
78
|
-
} catch (e) {
|
|
79
|
-
if (((_a = e.response) == null ? void 0 : _a.status) === 429) {
|
|
80
|
-
throw new Error(
|
|
81
|
-
`Could not translate to "${targetLang}": Rate-limited by Google Translate`
|
|
82
|
-
);
|
|
83
|
-
} else {
|
|
84
|
-
throw new Error(`Could not translate to "${targetLang}": ${e}`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
isArray,
|
|
91
|
-
isObject,
|
|
92
|
-
translateText
|
|
93
|
-
});
|
|
94
|
-
//# sourceMappingURL=tools.js.map
|
package/build/lib/tools.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/lib/tools.ts"],
|
|
4
|
-
"sourcesContent": ["import got from \"got\";\r\n\r\n/**\r\n * Tests whether the given variable is a real object and not an Array\r\n * @param it The variable to test\r\n */\r\nexport function isObject(it: unknown): it is Record<string, any> {\r\n // This is necessary because:\r\n // typeof null === 'object'\r\n // typeof [] === 'object'\r\n // [] instanceof Object === true\r\n return Object.prototype.toString.call(it) === \"[object Object]\";\r\n}\r\n\r\n/**\r\n * Tests whether the given variable is really an Array\r\n * @param it The variable to test\r\n */\r\nexport function isArray(it: unknown): it is any[] {\r\n if (Array.isArray != null) return Array.isArray(it);\r\n return Object.prototype.toString.call(it) === \"[object Array]\";\r\n}\r\n\r\n/**\r\n * Translates text using the Google Translate API\r\n * @param text The text to translate\r\n * @param targetLang The target languate\r\n * @param yandexApiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers\r\n */\r\nexport async function translateText(text: string, targetLang: string, yandexApiKey?: string): Promise<string> {\r\n if (targetLang === \"en\") {\r\n return text;\r\n } else if (!text) {\r\n return \"\";\r\n }\r\n if (yandexApiKey) {\r\n return translateYandex(text, targetLang, yandexApiKey);\r\n } else {\r\n return translateGoogle(text, targetLang);\r\n }\r\n}\r\n\r\n/**\r\n * Translates text with Yandex API\r\n * @param text The text to translate\r\n * @param targetLang The target languate\r\n * @param apiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers\r\n */\r\nasync function translateYandex(text: string, targetLang: string, apiKey: string): Promise<string> {\r\n if (targetLang === \"zh-cn\") {\r\n targetLang = \"zh\";\r\n }\r\n try {\r\n const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;\r\n const response = await got({url, timeout: 15000});\r\n if (isArray((response.body as any)?.text)) {\r\n return (response.body as any).text[0];\r\n }\r\n throw new Error(\"Invalid response for translate request\");\r\n } catch (e) {\r\n throw new Error(`Could not translate to \"${targetLang}\": ${e}`);\r\n }\r\n}\r\n\r\n/**\r\n * Translates text with Google API\r\n * @param text The text to translate\r\n * @param targetLang The target languate\r\n */\r\nasync function translateGoogle(text: string, targetLang: string): Promise<string> {\r\n try {\r\n const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;\r\n const response = await got({url, timeout: 15000});\r\n if (isArray(response.body)) {\r\n // we got a valid response\r\n return response.body[0][0][0];\r\n }\r\n throw new Error(\"Invalid response for translate request\");\r\n } catch (e: any) {\r\n if (e.response?.status === 429) {\r\n throw new Error(\r\n `Could not translate to \"${targetLang}\": Rate-limited by Google Translate`\r\n );\r\n } else {\r\n throw new Error(`Could not translate to \"${targetLang}\": ${e}`);\r\n }\r\n }\r\n}\r\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAgB;AAMT,SAAS,SAAS,IAAwC;AAK7D,SAAO,OAAO,UAAU,SAAS,KAAK,EAAE,MAAM;AAClD;AAMO,SAAS,QAAQ,IAA0B;AAC9C,MAAI,MAAM,WAAW;AAAM,WAAO,MAAM,QAAQ,EAAE;AAClD,SAAO,OAAO,UAAU,SAAS,KAAK,EAAE,MAAM;AAClD;AAQA,eAAsB,cAAc,MAAc,YAAoB,cAAwC;AAC1G,MAAI,eAAe,MAAM;AACrB,WAAO;AAAA,EACX,WAAW,CAAC,MAAM;AACd,WAAO;AAAA,EACX;AACA,MAAI,cAAc;AACd,WAAO,gBAAgB,MAAM,YAAY,YAAY;AAAA,EACzD,OAAO;AACH,WAAO,gBAAgB,MAAM,UAAU;AAAA,EAC3C;AACJ;AAQA,eAAe,gBAAgB,MAAc,YAAoB,QAAiC;AAhDlG;AAiDI,MAAI,eAAe,SAAS;AACxB,iBAAa;AAAA,EACjB;AACA,MAAI;AACA,UAAM,MAAM,+DAA+D,eAAe,mBAAmB,IAAI,aAAa;AAC9H,UAAM,WAAW,UAAM,WAAAA,SAAI,EAAC,KAAK,SAAS,KAAK,CAAC;AAChD,QAAI,SAAS,cAAS,SAAT,mBAAuB,IAAI,GAAG;AACvC,aAAQ,SAAS,KAAa,KAAK;AAAA,IACvC;AACA,UAAM,IAAI,MAAM,wCAAwC;AAAA,EAC5D,SAAS,GAAP;AACE,UAAM,IAAI,MAAM,2BAA2B,gBAAgB,GAAG;AAAA,EAClE;AACJ;AAOA,eAAe,gBAAgB,MAAc,YAAqC;AArElF;AAsEI,MAAI;AACA,UAAM,MAAM,0EAA0E,qBAAqB,mBAAmB,IAAI;AAClI,UAAM,WAAW,UAAM,WAAAA,SAAI,EAAC,KAAK,SAAS,KAAK,CAAC;AAChD,QAAI,QAAQ,SAAS,IAAI,GAAG;AAExB,aAAO,SAAS,KAAK,GAAG,GAAG;AAAA,IAC/B;AACA,UAAM,IAAI,MAAM,wCAAwC;AAAA,EAC5D,SAAS,GAAP;AACE,UAAI,OAAE,aAAF,mBAAY,YAAW,KAAK;AAC5B,YAAM,IAAI;AAAA,QACN,2BAA2B;AAAA,MAC/B;AAAA,IACJ,OAAO;AACH,YAAM,IAAI,MAAM,2BAA2B,gBAAgB,GAAG;AAAA,IAClE;AAAA,EACJ;AACJ;",
|
|
6
|
-
"names": ["got"]
|
|
7
|
-
}
|
package/build/lib/web.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
}
|
|
14
|
-
return to;
|
|
15
|
-
};
|
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
-
mod
|
|
19
|
-
));
|
|
20
|
-
var import_path = __toESM(require("path"));
|
|
21
|
-
var import_fs = __toESM(require("fs"));
|
|
22
|
-
var import_mime = __toESM(require("mime"));
|
|
23
|
-
var utils = __toESM(require("@iobroker/adapter-core"));
|
|
24
|
-
class ProxyEufySecurity {
|
|
25
|
-
constructor(server, webSettings, adapter, instanceSettings, app) {
|
|
26
|
-
this.app = app;
|
|
27
|
-
this.config = instanceSettings ? instanceSettings.native : {};
|
|
28
|
-
this.namespace = instanceSettings ? instanceSettings._id.substring("system.adapter.".length) : "eufy-security";
|
|
29
|
-
this.config.route = this.config.route || this.namespace + "/";
|
|
30
|
-
this.config.port = parseInt(this.config.port, 10) || 80;
|
|
31
|
-
if (this.config.route[0] === "/") {
|
|
32
|
-
this.config.route = this.config.route.substr(1);
|
|
33
|
-
}
|
|
34
|
-
const root_path = import_path.default.join(utils.getAbsoluteDefaultDataDir(), this.namespace);
|
|
35
|
-
this.app.use("/" + this.config.route, (req, res) => {
|
|
36
|
-
const fileName = import_path.default.join(root_path, req.url.substring(1));
|
|
37
|
-
const normalized_filename = import_path.default.resolve(fileName);
|
|
38
|
-
if (normalized_filename.startsWith(root_path)) {
|
|
39
|
-
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
40
|
-
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
|
|
41
|
-
if (import_fs.default.existsSync(normalized_filename)) {
|
|
42
|
-
const stat = import_fs.default.statSync(normalized_filename);
|
|
43
|
-
if (!stat.isDirectory()) {
|
|
44
|
-
let data;
|
|
45
|
-
try {
|
|
46
|
-
data = import_fs.default.readFileSync(normalized_filename);
|
|
47
|
-
} catch (e) {
|
|
48
|
-
res.status(500).send(`[eufy-security] Cannot read file: ${e}`);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
res.contentType(import_mime.default.getType(import_path.default.extname(normalized_filename).substring(1)) || "html");
|
|
52
|
-
res.status(200).send(data);
|
|
53
|
-
}
|
|
54
|
-
} else {
|
|
55
|
-
res.status(404).send('[eufy-security] File "' + normalized_filename + '" not found.');
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
res.status(403).send('[eufy-security] Access to file "' + normalized_filename + '" denied.');
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
module.exports = ProxyEufySecurity;
|
|
64
|
-
//# sourceMappingURL=web.js.map
|
package/build/lib/web.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/lib/web.ts"],
|
|
4
|
-
"sourcesContent": ["import express from \"express\";\r\nimport path from \"path\";\r\nimport fs from \"fs\";\r\nimport mime from \"mime\";\r\nimport * as utils from \"@iobroker/adapter-core\";\r\n\r\n/**\r\n * ProxyEufySecurity class\r\n *\r\n * Reads files from localhost server\r\n *\r\n * @class\r\n * @param {object} server http or https node.js object\r\n * @param {object} webSettings settings of the web server, like <pre><code>{secure: settings.secure, port: settings.port}</code></pre>\r\n * @param {object} adapter web adapter object\r\n * @param {object} instanceSettings instance object with common and native\r\n * @param {object} app express application\r\n * @return {object} object instance\r\n */\r\nclass ProxyEufySecurity {\r\n\r\n private app: express.Application;\r\n private config: any;\r\n private namespace: any;\r\n\r\n constructor(server: any, webSettings: any, adapter: ioBroker.Adapter, instanceSettings: any, app: express.Application) {\r\n this.app = app;\r\n this.config = instanceSettings ? instanceSettings.native : {};\r\n this.namespace = instanceSettings ? instanceSettings._id.substring(\"system.adapter.\".length) : \"eufy-security\";\r\n this.config.route = this.config.route || (this.namespace + \"/\");\r\n this.config.port = parseInt(this.config.port, 10) || 80;\r\n\r\n // remove leading slash\r\n if (this.config.route[0] === \"/\") {\r\n this.config.route = this.config.route.substr(1);\r\n }\r\n\r\n const root_path = path.join(utils.getAbsoluteDefaultDataDir(), this.namespace);\r\n this.app.use(\"/\" + this.config.route, (req: express.Request, res: express.Response) => {\r\n const fileName = path.join(root_path, req.url.substring(1));\r\n const normalized_filename = path.resolve(fileName);\r\n\r\n if (normalized_filename.startsWith(root_path)) {\r\n\r\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\r\n res.setHeader(\"Access-Control-Allow-Headers\", \"Origin, X-Requested-With, Content-Type, Accept\");\r\n\r\n if (fs.existsSync(normalized_filename)) {\r\n const stat = fs.statSync(normalized_filename);\r\n if (!stat.isDirectory()) {\r\n let data;\r\n try {\r\n data = fs.readFileSync(normalized_filename);\r\n } catch (e) {\r\n res.status(500).send(`[eufy-security] Cannot read file: ${e}`);\r\n return;\r\n }\r\n res.contentType(mime.getType(path.extname(normalized_filename).substring(1)) || \"html\");\r\n res.status(200).send(data);\r\n }\r\n } else {\r\n res.status(404).send('[eufy-security] File \"' + normalized_filename +'\" not found.');\r\n }\r\n } else {\r\n res.status(403).send('[eufy-security] Access to file \"' + normalized_filename +'\" denied.');\r\n }\r\n });\r\n }\r\n}\r\n\r\nmodule.exports = ProxyEufySecurity;"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AACA,kBAAiB;AACjB,gBAAe;AACf,kBAAiB;AACjB,YAAuB;AAevB,MAAM,kBAAkB;AAAA,EAMpB,YAAY,QAAa,aAAkB,SAA2B,kBAAuB,KAA0B;AACnH,SAAK,MAAc;AACnB,SAAK,SAAc,mBAAmB,iBAAiB,SAAS,CAAC;AACjE,SAAK,YAAc,mBAAmB,iBAAiB,IAAI,UAAU,kBAAkB,MAAM,IAAI;AACjG,SAAK,OAAO,QAAQ,KAAK,OAAO,SAAU,KAAK,YAAY;AAC3D,SAAK,OAAO,OAAO,SAAS,KAAK,OAAO,MAAM,EAAE,KAAK;AAGrD,QAAI,KAAK,OAAO,MAAM,OAAO,KAAK;AAC9B,WAAK,OAAO,QAAQ,KAAK,OAAO,MAAM,OAAO,CAAC;AAAA,IAClD;AAEA,UAAM,YAAY,YAAAA,QAAK,KAAK,MAAM,0BAA0B,GAAG,KAAK,SAAS;AAC7E,SAAK,IAAI,IAAI,MAAM,KAAK,OAAO,OAAO,CAAC,KAAsB,QAA0B;AACnF,YAAM,WAAW,YAAAA,QAAK,KAAK,WAAW,IAAI,IAAI,UAAU,CAAC,CAAC;AAC1D,YAAM,sBAAsB,YAAAA,QAAK,QAAQ,QAAQ;AAEjD,UAAI,oBAAoB,WAAW,SAAS,GAAG;AAE3C,YAAI,UAAU,+BAA+B,GAAG;AAChD,YAAI,UAAU,gCAAgC,gDAAgD;AAE9F,YAAI,UAAAC,QAAG,WAAW,mBAAmB,GAAG;AACpC,gBAAM,OAAO,UAAAA,QAAG,SAAS,mBAAmB;AAC5C,cAAI,CAAC,KAAK,YAAY,GAAG;AACrB,gBAAI;AACJ,gBAAI;AACA,qBAAO,UAAAA,QAAG,aAAa,mBAAmB;AAAA,YAC9C,SAAS,GAAP;AACE,kBAAI,OAAO,GAAG,EAAE,KAAK,qCAAqC,GAAG;AAC7D;AAAA,YACJ;AACA,gBAAI,YAAY,YAAAC,QAAK,QAAQ,YAAAF,QAAK,QAAQ,mBAAmB,EAAE,UAAU,CAAC,CAAC,KAAK,MAAM;AACtF,gBAAI,OAAO,GAAG,EAAE,KAAK,IAAI;AAAA,UAC7B;AAAA,QACJ,OAAO;AACH,cAAI,OAAO,GAAG,EAAE,KAAK,2BAA2B,sBAAqB,cAAc;AAAA,QACvF;AAAA,MACJ,OAAO;AACH,YAAI,OAAO,GAAG,EAAE,KAAK,qCAAqC,sBAAqB,WAAW;AAAA,MAC9F;AAAA,IACJ,CAAC;AAAA,EACL;AACJ;AAEA,OAAO,UAAU;",
|
|
6
|
-
"names": ["path", "fs", "mime"]
|
|
7
|
-
}
|