@camera.ui/server 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (652) hide show
  1. package/dist/interface/assets/@babel-l0sNRNKZ.js +1 -0
  2. package/dist/interface/assets/@camera.ui-2NVnv26v.js +8 -0
  3. package/dist/interface/assets/@intlify-Ck2ZoCVz.js +15 -0
  4. package/dist/interface/assets/@mdi-C-QA1nE3.js +1 -0
  5. package/dist/interface/assets/@popperjs-BQBsAJpH.js +1 -0
  6. package/dist/interface/assets/@react-dnd-CcwRs9xb.js +1 -0
  7. package/dist/interface/assets/@socket.io-Dkula2eQ.js +1 -0
  8. package/dist/interface/assets/@tanstack-BqH4GyO-.js +1 -0
  9. package/dist/interface/assets/@vee-validate-DCBdnGo-.js +5 -0
  10. package/dist/interface/assets/@vue-C7-KaDG4.js +17 -0
  11. package/dist/interface/assets/@vueform-arggO0eF.js +1 -0
  12. package/dist/interface/assets/@vueform-h7tNX9p6.css +1 -0
  13. package/dist/interface/assets/@vueuse-C3WMTDqL.js +1 -0
  14. package/dist/interface/assets/@xterm-B4Ga69iL.js +9 -0
  15. package/dist/interface/assets/@xterm-CGrrDQr5.css +32 -0
  16. package/dist/interface/assets/Account-B_tHnXoX.css +1 -0
  17. package/dist/interface/assets/Account-gJpkf0nE.js +1 -0
  18. package/dist/interface/assets/Adminpanel-B_SY1GJM.css +0 -0
  19. package/dist/interface/assets/Adminpanel-Bge9nu5N.js +1 -0
  20. package/dist/interface/assets/Appearance-D22q-X_I.js +1 -0
  21. package/dist/interface/assets/Backup-DBv9xFPh.css +1 -0
  22. package/dist/interface/assets/Backup-pJm6s10G.js +1 -0
  23. package/dist/interface/assets/Camera-BgO2yRjb.js +1 -0
  24. package/dist/interface/assets/Camera-CWiLco3W.css +1 -0
  25. package/dist/interface/assets/Cameras-BM3vSM_R.css +1 -0
  26. package/dist/interface/assets/Cameras-DjeKruR_.js +1 -0
  27. package/dist/interface/assets/Camview-DfzlprzN.js +1 -0
  28. package/dist/interface/assets/Camview-vUAs5YHU.css +1 -0
  29. package/dist/interface/assets/Config-BKIOIkjC.js +1 -0
  30. package/dist/interface/assets/Config-DAiKsG7W.css +1 -0
  31. package/dist/interface/assets/Console-BsyX2S3R.css +1 -0
  32. package/dist/interface/assets/Console-Caz7y-T0.js +4 -0
  33. package/dist/interface/assets/FirstSteps-DNHhyDSw.css +1 -0
  34. package/dist/interface/assets/FirstSteps-mQK4XFTs.js +1 -0
  35. package/dist/interface/assets/NewCamera-B9t-0NCc.js +448 -0
  36. package/dist/interface/assets/NewCamera-CHMgUDbC.css +1 -0
  37. package/dist/interface/assets/Plugin-BSHKKjrl.css +1 -0
  38. package/dist/interface/assets/Plugin-Di_bBsg-.js +1 -0
  39. package/dist/interface/assets/Plugins-BsMITags.css +1 -0
  40. package/dist/interface/assets/Plugins-DhmzMNuO.js +1 -0
  41. package/dist/interface/assets/Recordings-Bu53bSBp.js +1 -0
  42. package/dist/interface/assets/Recordings-XY20w8yp.js +1 -0
  43. package/dist/interface/assets/Settings-JES2wb8p.css +1 -0
  44. package/dist/interface/assets/Settings-gGRBRVST.js +1 -0
  45. package/dist/interface/assets/System-ZDrcLNk0.js +1 -0
  46. package/dist/interface/assets/User-BXColIbU.css +1 -0
  47. package/dist/interface/assets/User-D4vEhhzi.js +1 -0
  48. package/dist/interface/assets/VConfigEditor.vue_vue_type_script_setup_true_lang-CXFI-IeE.js +2 -0
  49. package/dist/interface/assets/VConsole-BHo3xprq.js +1 -0
  50. package/dist/interface/assets/VConsole-f-nUkOuD.css +1 -0
  51. package/dist/interface/assets/VPlayer-D3KhRfx-.css +1 -0
  52. package/dist/interface/assets/VPlayer-YdRn97Bs.js +1 -0
  53. package/dist/interface/assets/VPluginCard--3bx6UJb.js +4 -0
  54. package/dist/interface/assets/VPluginCard-BJYMuCLk.css +1 -0
  55. package/dist/interface/assets/ace-builds-CigWTak4.js +956 -0
  56. package/dist/interface/assets/axios--Jv2L996.js +6 -0
  57. package/dist/interface/assets/dijkstrajs-D_NXgYpA.js +1 -0
  58. package/dist/interface/assets/dnd-core-SnWOpY0X.js +1 -0
  59. package/dist/interface/assets/draggabilly-Arakw9Dk.js +6 -0
  60. package/dist/interface/assets/encode-utf8-Cn5aGd7v.js +1 -0
  61. package/dist/interface/assets/engine.io-client-DBBxzneW.js +1 -0
  62. package/dist/interface/assets/engine.io-parser-BiEtp6m2.js +1 -0
  63. package/dist/interface/assets/entities-C20TfXL6.js +1 -0
  64. package/dist/interface/assets/ev-emitter-CXYwG0eJ.js +1 -0
  65. package/dist/interface/assets/fast-deep-equal-5pvsDbwX.js +1 -0
  66. package/dist/interface/assets/get-size-D1dS-IaP.js +5 -0
  67. package/dist/interface/assets/highlight-DgoK_Xib.css +1 -0
  68. package/dist/interface/assets/highlight.js-TxRCSjhv.js +2 -0
  69. package/dist/interface/assets/linkify-it-DmNjr4Kv.js +1 -0
  70. package/dist/interface/assets/logo-256-BCQk9H1-.png +0 -0
  71. package/dist/interface/assets/logo-512-DLKVOU2S.png +0 -0
  72. package/dist/interface/assets/logo-DmEiRk0z.png +0 -0
  73. package/dist/interface/assets/main-B3IVLctZ.css +1 -0
  74. package/dist/interface/assets/main-C4rYiRNz.js +2 -0
  75. package/dist/interface/assets/markdown-it-DI8MEbma.js +15 -0
  76. package/dist/interface/assets/mdurl-k9Sl0PQj.js +2 -0
  77. package/dist/interface/assets/mode-json-Br7xisR1.js +275 -0
  78. package/dist/interface/assets/mode-yaml-CIYL8U3d.js +395 -0
  79. package/dist/interface/assets/nprogress-DSyAi0LF.js +2 -0
  80. package/dist/interface/assets/pinia-D8MtiGcH.js +5 -0
  81. package/dist/interface/assets/plugins-Bf03y242.js +1 -0
  82. package/dist/interface/assets/punycode.js-Dj65hjkv.js +1 -0
  83. package/dist/interface/assets/qrcode-CGiDONbL.js +8 -0
  84. package/dist/interface/assets/react-dnd-html5-backend-1HQjlkwI.js +2 -0
  85. package/dist/interface/assets/react-dnd-touch-backend-NgACaG8W.js +1 -0
  86. package/dist/interface/assets/redux-CuxFRhX_.js +1 -0
  87. package/dist/interface/assets/rxjs-B53o3e_J.js +3 -0
  88. package/dist/interface/assets/socket.io-client-Bq_SHkin.js +1 -0
  89. package/dist/interface/assets/socket.io-parser-BBkuslX-.js +1 -0
  90. package/dist/interface/assets/system-BONnDA4y.js +1 -0
  91. package/dist/interface/assets/tslib-9k7AwCpt.js +1 -0
  92. package/dist/interface/assets/uc.micro-kMc2yuuw.js +1 -0
  93. package/dist/interface/assets/ui-CNpIJotI.js +1 -0
  94. package/dist/interface/assets/unidragger-BYtqgAQ0.js +5 -0
  95. package/dist/interface/assets/utils-BvINh1mj.js +1 -0
  96. package/dist/interface/assets/uuid-DvF23Exx.js +1 -0
  97. package/dist/interface/assets/v-calendar-CtSuDYZU.css +1 -0
  98. package/dist/interface/assets/v-calendar-uh0aTGqP.js +1 -0
  99. package/dist/interface/assets/vee-validate-D3FqbChK.js +5 -0
  100. package/dist/interface/assets/vue-i18n-1AU8MPys.js +5 -0
  101. package/dist/interface/assets/vue-inline-svg-2DDwYW6V.js +1 -0
  102. package/dist/interface/assets/vue-l0sNRNKZ.js +1 -0
  103. package/dist/interface/assets/vue-router-DfeQ8s4I.js +5 -0
  104. package/dist/interface/assets/vue3-dnd-BwxcSU9Z.js +1 -0
  105. package/dist/interface/assets/vue3-toastify-DTY1DMRs.css +1 -0
  106. package/dist/interface/assets/vue3-toastify-Ul-rf53I.js +1 -0
  107. package/dist/interface/assets/vuetify-B__3Y-at.css +5 -0
  108. package/dist/interface/assets/vuetify-_-Oqac3B.js +5 -0
  109. package/dist/interface/assets/zod-BaF2dDCd.js +1 -0
  110. package/dist/interface/browserconfig.xml +11 -0
  111. package/dist/interface/fonts/Inter/Inter-Regular.ttf +0 -0
  112. package/dist/interface/index.html +377 -0
  113. package/dist/interface/manifest.webmanifest +1 -0
  114. package/dist/interface/pwa/apple-splash-landscape-dark-1136x640.png +0 -0
  115. package/dist/interface/pwa/apple-splash-landscape-dark-1334x750.png +0 -0
  116. package/dist/interface/pwa/apple-splash-landscape-dark-1792x828.png +0 -0
  117. package/dist/interface/pwa/apple-splash-landscape-dark-2048x1536.png +0 -0
  118. package/dist/interface/pwa/apple-splash-landscape-dark-2160x1620.png +0 -0
  119. package/dist/interface/pwa/apple-splash-landscape-dark-2208x1242.png +0 -0
  120. package/dist/interface/pwa/apple-splash-landscape-dark-2224x1668.png +0 -0
  121. package/dist/interface/pwa/apple-splash-landscape-dark-2388x1668.png +0 -0
  122. package/dist/interface/pwa/apple-splash-landscape-dark-2436x1125.png +0 -0
  123. package/dist/interface/pwa/apple-splash-landscape-dark-2532x1170.png +0 -0
  124. package/dist/interface/pwa/apple-splash-landscape-dark-2556x1179.png +0 -0
  125. package/dist/interface/pwa/apple-splash-landscape-dark-2688x1242.png +0 -0
  126. package/dist/interface/pwa/apple-splash-landscape-dark-2732x2048.png +0 -0
  127. package/dist/interface/pwa/apple-splash-landscape-dark-2778x1284.png +0 -0
  128. package/dist/interface/pwa/apple-splash-landscape-dark-2796x1290.png +0 -0
  129. package/dist/interface/pwa/apple-splash-landscape-light-1136x640.png +0 -0
  130. package/dist/interface/pwa/apple-splash-landscape-light-1334x750.png +0 -0
  131. package/dist/interface/pwa/apple-splash-landscape-light-1792x828.png +0 -0
  132. package/dist/interface/pwa/apple-splash-landscape-light-2048x1536.png +0 -0
  133. package/dist/interface/pwa/apple-splash-landscape-light-2160x1620.png +0 -0
  134. package/dist/interface/pwa/apple-splash-landscape-light-2208x1242.png +0 -0
  135. package/dist/interface/pwa/apple-splash-landscape-light-2224x1668.png +0 -0
  136. package/dist/interface/pwa/apple-splash-landscape-light-2388x1668.png +0 -0
  137. package/dist/interface/pwa/apple-splash-landscape-light-2436x1125.png +0 -0
  138. package/dist/interface/pwa/apple-splash-landscape-light-2532x1170.png +0 -0
  139. package/dist/interface/pwa/apple-splash-landscape-light-2556x1179.png +0 -0
  140. package/dist/interface/pwa/apple-splash-landscape-light-2688x1242.png +0 -0
  141. package/dist/interface/pwa/apple-splash-landscape-light-2732x2048.png +0 -0
  142. package/dist/interface/pwa/apple-splash-landscape-light-2778x1284.png +0 -0
  143. package/dist/interface/pwa/apple-splash-landscape-light-2796x1290.png +0 -0
  144. package/dist/interface/pwa/apple-splash-portrait-dark-1125x2436.png +0 -0
  145. package/dist/interface/pwa/apple-splash-portrait-dark-1170x2532.png +0 -0
  146. package/dist/interface/pwa/apple-splash-portrait-dark-1179x2556.png +0 -0
  147. package/dist/interface/pwa/apple-splash-portrait-dark-1242x2208.png +0 -0
  148. package/dist/interface/pwa/apple-splash-portrait-dark-1242x2688.png +0 -0
  149. package/dist/interface/pwa/apple-splash-portrait-dark-1284x2778.png +0 -0
  150. package/dist/interface/pwa/apple-splash-portrait-dark-1290x2796.png +0 -0
  151. package/dist/interface/pwa/apple-splash-portrait-dark-1536x2048.png +0 -0
  152. package/dist/interface/pwa/apple-splash-portrait-dark-1620x2160.png +0 -0
  153. package/dist/interface/pwa/apple-splash-portrait-dark-1668x2224.png +0 -0
  154. package/dist/interface/pwa/apple-splash-portrait-dark-1668x2388.png +0 -0
  155. package/dist/interface/pwa/apple-splash-portrait-dark-2048x2732.png +0 -0
  156. package/dist/interface/pwa/apple-splash-portrait-dark-640x1136.png +0 -0
  157. package/dist/interface/pwa/apple-splash-portrait-dark-750x1334.png +0 -0
  158. package/dist/interface/pwa/apple-splash-portrait-dark-828x1792.png +0 -0
  159. package/dist/interface/pwa/apple-splash-portrait-light-1125x2436.png +0 -0
  160. package/dist/interface/pwa/apple-splash-portrait-light-1170x2532.png +0 -0
  161. package/dist/interface/pwa/apple-splash-portrait-light-1179x2556.png +0 -0
  162. package/dist/interface/pwa/apple-splash-portrait-light-1242x2208.png +0 -0
  163. package/dist/interface/pwa/apple-splash-portrait-light-1242x2688.png +0 -0
  164. package/dist/interface/pwa/apple-splash-portrait-light-1284x2778.png +0 -0
  165. package/dist/interface/pwa/apple-splash-portrait-light-1290x2796.png +0 -0
  166. package/dist/interface/pwa/apple-splash-portrait-light-1536x2048.png +0 -0
  167. package/dist/interface/pwa/apple-splash-portrait-light-1620x2160.png +0 -0
  168. package/dist/interface/pwa/apple-splash-portrait-light-1668x2224.png +0 -0
  169. package/dist/interface/pwa/apple-splash-portrait-light-1668x2388.png +0 -0
  170. package/dist/interface/pwa/apple-splash-portrait-light-2048x2732.png +0 -0
  171. package/dist/interface/pwa/apple-splash-portrait-light-640x1136.png +0 -0
  172. package/dist/interface/pwa/apple-splash-portrait-light-750x1334.png +0 -0
  173. package/dist/interface/pwa/apple-splash-portrait-light-828x1792.png +0 -0
  174. package/dist/interface/pwa/apple-touch-icon-180x180.png +0 -0
  175. package/dist/interface/pwa/favicon-16.ico +0 -0
  176. package/dist/interface/pwa/favicon-32.ico +0 -0
  177. package/dist/interface/pwa/favicon-48.ico +0 -0
  178. package/dist/interface/pwa/favicon-64.ico +0 -0
  179. package/dist/interface/pwa/logo.svg +1 -0
  180. package/dist/interface/pwa/maskable-icon-1240x600.png +0 -0
  181. package/dist/interface/pwa/maskable-icon-512x512.png +0 -0
  182. package/dist/interface/pwa/maskable-icon-620x300.png +0 -0
  183. package/dist/interface/pwa/pwa-1024x1024.png +0 -0
  184. package/dist/interface/pwa/pwa-120x120.png +0 -0
  185. package/dist/interface/pwa/pwa-144x144.png +0 -0
  186. package/dist/interface/pwa/pwa-152x152.png +0 -0
  187. package/dist/interface/pwa/pwa-167x167.png +0 -0
  188. package/dist/interface/pwa/pwa-180x180.png +0 -0
  189. package/dist/interface/pwa/pwa-192x192.png +0 -0
  190. package/dist/interface/pwa/pwa-24x24.png +0 -0
  191. package/dist/interface/pwa/pwa-300x300.png +0 -0
  192. package/dist/interface/pwa/pwa-36x36.png +0 -0
  193. package/dist/interface/pwa/pwa-48x48.png +0 -0
  194. package/dist/interface/pwa/pwa-50x50.png +0 -0
  195. package/dist/interface/pwa/pwa-64x64.png +0 -0
  196. package/dist/interface/pwa/pwa-72x72.png +0 -0
  197. package/dist/interface/pwa/pwa-88x88.png +0 -0
  198. package/dist/interface/pwa/pwa-96x96.png +0 -0
  199. package/dist/interface/registerSW.js +1 -0
  200. package/dist/interface/robots.txt +2 -0
  201. package/dist/interface/sw.js +1 -0
  202. package/dist/interface/workbox-3e911b1d.js +1 -0
  203. package/dist/server/bin/cui-service.d.ts +43 -0
  204. package/dist/server/bin/cui-service.js +472 -0
  205. package/dist/server/bin/cui-service.js.map +1 -0
  206. package/dist/server/bin/cui.d.ts +2 -0
  207. package/dist/server/bin/cui.js +8 -0
  208. package/dist/server/bin/cui.js.map +1 -0
  209. package/dist/server/bin/installer/base.d.ts +16 -0
  210. package/dist/server/bin/installer/base.js +41 -0
  211. package/dist/server/bin/installer/base.js.map +1 -0
  212. package/dist/server/bin/installer/darwin.d.ts +49 -0
  213. package/dist/server/bin/installer/darwin.js +200 -0
  214. package/dist/server/bin/installer/darwin.js.map +1 -0
  215. package/dist/server/bin/installer/freebsd.d.ts +61 -0
  216. package/dist/server/bin/installer/freebsd.js +252 -0
  217. package/dist/server/bin/installer/freebsd.js.map +1 -0
  218. package/dist/server/bin/installer/linux.d.ts +92 -0
  219. package/dist/server/bin/installer/linux.js +386 -0
  220. package/dist/server/bin/installer/linux.js.map +1 -0
  221. package/dist/server/bin/installer/win32.d.ts +37 -0
  222. package/dist/server/bin/installer/win32.js +158 -0
  223. package/dist/server/bin/installer/win32.js.map +1 -0
  224. package/dist/server/package.json +142 -0
  225. package/dist/server/requirements.txt +13 -0
  226. package/dist/server/src/api/controllers/api.controller.d.ts +6 -0
  227. package/dist/server/src/api/controllers/api.controller.js +11 -0
  228. package/dist/server/src/api/controllers/api.controller.js.map +1 -0
  229. package/dist/server/src/api/controllers/auth.controller.d.ts +20 -0
  230. package/dist/server/src/api/controllers/auth.controller.js +263 -0
  231. package/dist/server/src/api/controllers/auth.controller.js.map +1 -0
  232. package/dist/server/src/api/controllers/backup.controller.d.ts +10 -0
  233. package/dist/server/src/api/controllers/backup.controller.js +52 -0
  234. package/dist/server/src/api/controllers/backup.controller.js.map +1 -0
  235. package/dist/server/src/api/controllers/cameras.controller.d.ts +34 -0
  236. package/dist/server/src/api/controllers/cameras.controller.js +522 -0
  237. package/dist/server/src/api/controllers/cameras.controller.js.map +1 -0
  238. package/dist/server/src/api/controllers/config.controller.d.ts +14 -0
  239. package/dist/server/src/api/controllers/config.controller.js +89 -0
  240. package/dist/server/src/api/controllers/config.controller.js.map +1 -0
  241. package/dist/server/src/api/controllers/files.controller.d.ts +8 -0
  242. package/dist/server/src/api/controllers/files.controller.js +28 -0
  243. package/dist/server/src/api/controllers/files.controller.js.map +1 -0
  244. package/dist/server/src/api/controllers/frameWorkers.controller.d.ts +16 -0
  245. package/dist/server/src/api/controllers/frameWorkers.controller.js +85 -0
  246. package/dist/server/src/api/controllers/frameWorkers.controller.js.map +1 -0
  247. package/dist/server/src/api/controllers/plugins.controller.d.ts +59 -0
  248. package/dist/server/src/api/controllers/plugins.controller.js +1178 -0
  249. package/dist/server/src/api/controllers/plugins.controller.js.map +1 -0
  250. package/dist/server/src/api/controllers/system.controller.d.ts +14 -0
  251. package/dist/server/src/api/controllers/system.controller.js +149 -0
  252. package/dist/server/src/api/controllers/system.controller.js.map +1 -0
  253. package/dist/server/src/api/controllers/users.controller.d.ts +28 -0
  254. package/dist/server/src/api/controllers/users.controller.js +463 -0
  255. package/dist/server/src/api/controllers/users.controller.js.map +1 -0
  256. package/dist/server/src/api/database/index.d.ts +34 -0
  257. package/dist/server/src/api/database/index.js +185 -0
  258. package/dist/server/src/api/database/index.js.map +1 -0
  259. package/dist/server/src/api/database/migration.d.ts +12 -0
  260. package/dist/server/src/api/database/migration.js +47 -0
  261. package/dist/server/src/api/database/migration.js.map +1 -0
  262. package/dist/server/src/api/database/types.d.ts +209 -0
  263. package/dist/server/src/api/database/types.js +2 -0
  264. package/dist/server/src/api/database/types.js.map +1 -0
  265. package/dist/server/src/api/go2rtc/api/application.d.ts +9 -0
  266. package/dist/server/src/api/go2rtc/api/application.js +38 -0
  267. package/dist/server/src/api/go2rtc/api/application.js.map +1 -0
  268. package/dist/server/src/api/go2rtc/api/config.d.ts +8 -0
  269. package/dist/server/src/api/go2rtc/api/config.js +44 -0
  270. package/dist/server/src/api/go2rtc/api/config.js.map +1 -0
  271. package/dist/server/src/api/go2rtc/api/index.d.ts +1 -0
  272. package/dist/server/src/api/go2rtc/api/index.js +28 -0
  273. package/dist/server/src/api/go2rtc/api/index.js.map +1 -0
  274. package/dist/server/src/api/go2rtc/api/snapshot.d.ts +8 -0
  275. package/dist/server/src/api/go2rtc/api/snapshot.js +34 -0
  276. package/dist/server/src/api/go2rtc/api/snapshot.js.map +1 -0
  277. package/dist/server/src/api/go2rtc/api/streams.d.ts +10 -0
  278. package/dist/server/src/api/go2rtc/api/streams.js +67 -0
  279. package/dist/server/src/api/go2rtc/api/streams.js.map +1 -0
  280. package/dist/server/src/api/go2rtc/index.d.ts +13 -0
  281. package/dist/server/src/api/go2rtc/index.js +25 -0
  282. package/dist/server/src/api/go2rtc/index.js.map +1 -0
  283. package/dist/server/src/api/go2rtc/queue.d.ts +10 -0
  284. package/dist/server/src/api/go2rtc/queue.js +38 -0
  285. package/dist/server/src/api/go2rtc/queue.js.map +1 -0
  286. package/dist/server/src/api/go2rtc/types.d.ts +60 -0
  287. package/dist/server/src/api/go2rtc/types.js +2 -0
  288. package/dist/server/src/api/go2rtc/types.js.map +1 -0
  289. package/dist/server/src/api/index.d.ts +20 -0
  290. package/dist/server/src/api/index.js +233 -0
  291. package/dist/server/src/api/index.js.map +1 -0
  292. package/dist/server/src/api/middlewares/authPermission.middleware.d.ts +5 -0
  293. package/dist/server/src/api/middlewares/authPermission.middleware.js +28 -0
  294. package/dist/server/src/api/middlewares/authPermission.middleware.js.map +1 -0
  295. package/dist/server/src/api/middlewares/authValidation.middleware.d.ts +4 -0
  296. package/dist/server/src/api/middlewares/authValidation.middleware.js +129 -0
  297. package/dist/server/src/api/middlewares/authValidation.middleware.js.map +1 -0
  298. package/dist/server/src/api/middlewares/pagination.middleware.d.ts +3 -0
  299. package/dist/server/src/api/middlewares/pagination.middleware.js +65 -0
  300. package/dist/server/src/api/middlewares/pagination.middleware.js.map +1 -0
  301. package/dist/server/src/api/middlewares/socketAuth.middleware.d.ts +41 -0
  302. package/dist/server/src/api/middlewares/socketAuth.middleware.js +81 -0
  303. package/dist/server/src/api/middlewares/socketAuth.middleware.js.map +1 -0
  304. package/dist/server/src/api/plugins/cameraui.plugin.d.ts +11 -0
  305. package/dist/server/src/api/plugins/cameraui.plugin.js +6 -0
  306. package/dist/server/src/api/plugins/cameraui.plugin.js.map +1 -0
  307. package/dist/server/src/api/plugins/database.plugin.d.ts +11 -0
  308. package/dist/server/src/api/plugins/database.plugin.js +12 -0
  309. package/dist/server/src/api/plugins/database.plugin.js.map +1 -0
  310. package/dist/server/src/api/plugins/go2rtc.plugin.d.ts +11 -0
  311. package/dist/server/src/api/plugins/go2rtc.plugin.js +11 -0
  312. package/dist/server/src/api/plugins/go2rtc.plugin.js.map +1 -0
  313. package/dist/server/src/api/plugins/logger.plugin.d.ts +7 -0
  314. package/dist/server/src/api/plugins/logger.plugin.js +29 -0
  315. package/dist/server/src/api/plugins/logger.plugin.js.map +1 -0
  316. package/dist/server/src/api/plugins/socket.plugin.d.ts +11 -0
  317. package/dist/server/src/api/plugins/socket.plugin.js +12 -0
  318. package/dist/server/src/api/plugins/socket.plugin.js.map +1 -0
  319. package/dist/server/src/api/plugins/system.plugin.d.ts +21 -0
  320. package/dist/server/src/api/plugins/system.plugin.js +33 -0
  321. package/dist/server/src/api/plugins/system.plugin.js.map +1 -0
  322. package/dist/server/src/api/plugins/useragent.plugin.d.ts +8 -0
  323. package/dist/server/src/api/plugins/useragent.plugin.js +10 -0
  324. package/dist/server/src/api/plugins/useragent.plugin.js.map +1 -0
  325. package/dist/server/src/api/routes/api.routes.d.ts +2 -0
  326. package/dist/server/src/api/routes/api.routes.js +6 -0
  327. package/dist/server/src/api/routes/api.routes.js.map +1 -0
  328. package/dist/server/src/api/routes/auth.routes.d.ts +2 -0
  329. package/dist/server/src/api/routes/auth.routes.js +47 -0
  330. package/dist/server/src/api/routes/auth.routes.js.map +1 -0
  331. package/dist/server/src/api/routes/backup.routes.d.ts +2 -0
  332. package/dist/server/src/api/routes/backup.routes.js +23 -0
  333. package/dist/server/src/api/routes/backup.routes.js.map +1 -0
  334. package/dist/server/src/api/routes/cameras.routes.d.ts +2 -0
  335. package/dist/server/src/api/routes/cameras.routes.js +181 -0
  336. package/dist/server/src/api/routes/cameras.routes.js.map +1 -0
  337. package/dist/server/src/api/routes/config.routes.d.ts +2 -0
  338. package/dist/server/src/api/routes/config.routes.js +55 -0
  339. package/dist/server/src/api/routes/config.routes.js.map +1 -0
  340. package/dist/server/src/api/routes/files.routes.d.ts +2 -0
  341. package/dist/server/src/api/routes/files.routes.js +12 -0
  342. package/dist/server/src/api/routes/files.routes.js.map +1 -0
  343. package/dist/server/src/api/routes/frameWorkers.routes.d.ts +2 -0
  344. package/dist/server/src/api/routes/frameWorkers.routes.js +33 -0
  345. package/dist/server/src/api/routes/frameWorkers.routes.js.map +1 -0
  346. package/dist/server/src/api/routes/index.d.ts +6 -0
  347. package/dist/server/src/api/routes/index.js +32 -0
  348. package/dist/server/src/api/routes/index.js.map +1 -0
  349. package/dist/server/src/api/routes/plugins.routes.d.ts +2 -0
  350. package/dist/server/src/api/routes/plugins.routes.js +339 -0
  351. package/dist/server/src/api/routes/plugins.routes.js.map +1 -0
  352. package/dist/server/src/api/routes/system.routes.d.ts +2 -0
  353. package/dist/server/src/api/routes/system.routes.js +43 -0
  354. package/dist/server/src/api/routes/system.routes.js.map +1 -0
  355. package/dist/server/src/api/routes/users.routes.d.ts +2 -0
  356. package/dist/server/src/api/routes/users.routes.js +139 -0
  357. package/dist/server/src/api/routes/users.routes.js.map +1 -0
  358. package/dist/server/src/api/schemas/backup.schema.d.ts +118 -0
  359. package/dist/server/src/api/schemas/backup.schema.js +75 -0
  360. package/dist/server/src/api/schemas/backup.schema.js.map +1 -0
  361. package/dist/server/src/api/schemas/cameras.schema.d.ts +932 -0
  362. package/dist/server/src/api/schemas/cameras.schema.js +271 -0
  363. package/dist/server/src/api/schemas/cameras.schema.js.map +1 -0
  364. package/dist/server/src/api/schemas/config.schema.d.ts +202 -0
  365. package/dist/server/src/api/schemas/config.schema.js +68 -0
  366. package/dist/server/src/api/schemas/config.schema.js.map +1 -0
  367. package/dist/server/src/api/schemas/go2rtc.schema.d.ts +703 -0
  368. package/dist/server/src/api/schemas/go2rtc.schema.js +188 -0
  369. package/dist/server/src/api/schemas/go2rtc.schema.js.map +1 -0
  370. package/dist/server/src/api/schemas/plugins.schema.d.ts +72 -0
  371. package/dist/server/src/api/schemas/plugins.schema.js +103 -0
  372. package/dist/server/src/api/schemas/plugins.schema.js.map +1 -0
  373. package/dist/server/src/api/schemas/users.schema.d.ts +1008 -0
  374. package/dist/server/src/api/schemas/users.schema.js +151 -0
  375. package/dist/server/src/api/schemas/users.schema.js.map +1 -0
  376. package/dist/server/src/api/services/auth.service.d.ts +19 -0
  377. package/dist/server/src/api/services/auth.service.js +115 -0
  378. package/dist/server/src/api/services/auth.service.js.map +1 -0
  379. package/dist/server/src/api/services/backup.service.d.ts +11 -0
  380. package/dist/server/src/api/services/backup.service.js +108 -0
  381. package/dist/server/src/api/services/backup.service.js.map +1 -0
  382. package/dist/server/src/api/services/cameras.service.d.ts +55 -0
  383. package/dist/server/src/api/services/cameras.service.js +700 -0
  384. package/dist/server/src/api/services/cameras.service.js.map +1 -0
  385. package/dist/server/src/api/services/plugins.service.d.ts +25 -0
  386. package/dist/server/src/api/services/plugins.service.js +145 -0
  387. package/dist/server/src/api/services/plugins.service.js.map +1 -0
  388. package/dist/server/src/api/services/users.service.d.ts +25 -0
  389. package/dist/server/src/api/services/users.service.js +197 -0
  390. package/dist/server/src/api/services/users.service.js.map +1 -0
  391. package/dist/server/src/api/types/index.d.ts +580 -0
  392. package/dist/server/src/api/types/index.js +9 -0
  393. package/dist/server/src/api/types/index.js.map +1 -0
  394. package/dist/server/src/api/utils/cert.d.ts +11 -0
  395. package/dist/server/src/api/utils/cert.js +411 -0
  396. package/dist/server/src/api/utils/cert.js.map +1 -0
  397. package/dist/server/src/api/utils/constants.d.ts +15 -0
  398. package/dist/server/src/api/utils/constants.js +17 -0
  399. package/dist/server/src/api/utils/constants.js.map +1 -0
  400. package/dist/server/src/api/utils/fetch.d.ts +2 -0
  401. package/dist/server/src/api/utils/fetch.js +24 -0
  402. package/dist/server/src/api/utils/fetch.js.map +1 -0
  403. package/dist/server/src/api/utils/moveFiles.d.ts +1 -0
  404. package/dist/server/src/api/utils/moveFiles.js +38 -0
  405. package/dist/server/src/api/utils/moveFiles.js.map +1 -0
  406. package/dist/server/src/api/utils/parse.d.ts +2 -0
  407. package/dist/server/src/api/utils/parse.js +12 -0
  408. package/dist/server/src/api/utils/parse.js.map +1 -0
  409. package/dist/server/src/api/websocket/index.d.ts +15 -0
  410. package/dist/server/src/api/websocket/index.js +69 -0
  411. package/dist/server/src/api/websocket/index.js.map +1 -0
  412. package/dist/server/src/api/websocket/nsp/frameWorker.d.ts +13 -0
  413. package/dist/server/src/api/websocket/nsp/frameWorker.js +29 -0
  414. package/dist/server/src/api/websocket/nsp/frameWorker.js.map +1 -0
  415. package/dist/server/src/api/websocket/nsp/logs.d.ts +11 -0
  416. package/dist/server/src/api/websocket/nsp/logs.js +113 -0
  417. package/dist/server/src/api/websocket/nsp/logs.js.map +1 -0
  418. package/dist/server/src/api/websocket/nsp/metrics.d.ts +38 -0
  419. package/dist/server/src/api/websocket/nsp/metrics.js +266 -0
  420. package/dist/server/src/api/websocket/nsp/metrics.js.map +1 -0
  421. package/dist/server/src/api/websocket/nsp/notifications.d.ts +11 -0
  422. package/dist/server/src/api/websocket/nsp/notifications.js +35 -0
  423. package/dist/server/src/api/websocket/nsp/notifications.js.map +1 -0
  424. package/dist/server/src/api/websocket/nsp/plugins.d.ts +13 -0
  425. package/dist/server/src/api/websocket/nsp/plugins.js +29 -0
  426. package/dist/server/src/api/websocket/nsp/plugins.js.map +1 -0
  427. package/dist/server/src/api/websocket/nsp/server.d.ts +9 -0
  428. package/dist/server/src/api/websocket/nsp/server.js +48 -0
  429. package/dist/server/src/api/websocket/nsp/server.js.map +1 -0
  430. package/dist/server/src/api/websocket/nsp/status.d.ts +26 -0
  431. package/dist/server/src/api/websocket/nsp/status.js +59 -0
  432. package/dist/server/src/api/websocket/nsp/status.js.map +1 -0
  433. package/dist/server/src/api/websocket/types.d.ts +86 -0
  434. package/dist/server/src/api/websocket/types.js +2 -0
  435. package/dist/server/src/api/websocket/types.js.map +1 -0
  436. package/dist/server/src/api.d.ts +43 -0
  437. package/dist/server/src/api.js +90 -0
  438. package/dist/server/src/api.js.map +1 -0
  439. package/dist/server/src/camera/controller.d.ts +41 -0
  440. package/dist/server/src/camera/controller.js +220 -0
  441. package/dist/server/src/camera/controller.js.map +1 -0
  442. package/dist/server/src/camera/device.d.ts +18 -0
  443. package/dist/server/src/camera/device.js +21 -0
  444. package/dist/server/src/camera/device.js.map +1 -0
  445. package/dist/server/src/camera/index.d.ts +121 -0
  446. package/dist/server/src/camera/index.js +643 -0
  447. package/dist/server/src/camera/index.js.map +1 -0
  448. package/dist/server/src/camera/interfaces/camera.d.ts +11 -0
  449. package/dist/server/src/camera/interfaces/camera.js +31 -0
  450. package/dist/server/src/camera/interfaces/camera.js.map +1 -0
  451. package/dist/server/src/camera/interfaces/prebuffer.d.ts +11 -0
  452. package/dist/server/src/camera/interfaces/prebuffer.js +26 -0
  453. package/dist/server/src/camera/interfaces/prebuffer.js.map +1 -0
  454. package/dist/server/src/camera/interfaces/ptz.d.ts +13 -0
  455. package/dist/server/src/camera/interfaces/ptz.js +47 -0
  456. package/dist/server/src/camera/interfaces/ptz.js.map +1 -0
  457. package/dist/server/src/camera/polygon.d.ts +6 -0
  458. package/dist/server/src/camera/polygon.js +151 -0
  459. package/dist/server/src/camera/polygon.js.map +1 -0
  460. package/dist/server/src/camera/streaming/peer-connection.d.ts +46 -0
  461. package/dist/server/src/camera/streaming/peer-connection.js +150 -0
  462. package/dist/server/src/camera/streaming/peer-connection.js.map +1 -0
  463. package/dist/server/src/camera/streaming/webrtc-connection.d.ts +34 -0
  464. package/dist/server/src/camera/streaming/webrtc-connection.js +152 -0
  465. package/dist/server/src/camera/streaming/webrtc-connection.js.map +1 -0
  466. package/dist/server/src/camera/streaming/werift-session.d.ts +31 -0
  467. package/dist/server/src/camera/streaming/werift-session.js +168 -0
  468. package/dist/server/src/camera/streaming/werift-session.js.map +1 -0
  469. package/dist/server/src/camera/types.d.ts +202 -0
  470. package/dist/server/src/camera/types.js +7 -0
  471. package/dist/server/src/camera/types.js.map +1 -0
  472. package/dist/server/src/camera/videoFrame.d.ts +24 -0
  473. package/dist/server/src/camera/videoFrame.js +105 -0
  474. package/dist/server/src/camera/videoFrame.js.map +1 -0
  475. package/dist/server/src/decoder/ffmpeg.d.ts +2 -0
  476. package/dist/server/src/decoder/ffmpeg.js +61 -0
  477. package/dist/server/src/decoder/ffmpeg.js.map +1 -0
  478. package/dist/server/src/decoder/index.d.ts +11 -0
  479. package/dist/server/src/decoder/index.js +32 -0
  480. package/dist/server/src/decoder/index.js.map +1 -0
  481. package/dist/server/src/decoder/types.d.ts +156 -0
  482. package/dist/server/src/decoder/types.js +2 -0
  483. package/dist/server/src/decoder/types.js.map +1 -0
  484. package/dist/server/src/decoder/worker.d.ts +42 -0
  485. package/dist/server/src/decoder/worker.js +273 -0
  486. package/dist/server/src/decoder/worker.js.map +1 -0
  487. package/dist/server/src/go2rtc/index.d.ts +25 -0
  488. package/dist/server/src/go2rtc/index.js +211 -0
  489. package/dist/server/src/go2rtc/index.js.map +1 -0
  490. package/dist/server/src/go2rtc/types.d.ts +14 -0
  491. package/dist/server/src/go2rtc/types.js +73 -0
  492. package/dist/server/src/go2rtc/types.js.map +1 -0
  493. package/dist/server/src/index.d.ts +16 -0
  494. package/dist/server/src/index.js +5 -0
  495. package/dist/server/src/index.js.map +1 -0
  496. package/dist/server/src/main.d.ts +18 -0
  497. package/dist/server/src/main.js +118 -0
  498. package/dist/server/src/main.js.map +1 -0
  499. package/dist/server/src/nats/constants.d.ts +1 -0
  500. package/dist/server/src/nats/constants.js +2 -0
  501. package/dist/server/src/nats/constants.js.map +1 -0
  502. package/dist/server/src/nats/index.d.ts +35 -0
  503. package/dist/server/src/nats/index.js +150 -0
  504. package/dist/server/src/nats/index.js.map +1 -0
  505. package/dist/server/src/nats/messageQueue.d.ts +17 -0
  506. package/dist/server/src/nats/messageQueue.js +148 -0
  507. package/dist/server/src/nats/messageQueue.js.map +1 -0
  508. package/dist/server/src/nats/proxy/cameraDevice.d.ts +30 -0
  509. package/dist/server/src/nats/proxy/cameraDevice.js +252 -0
  510. package/dist/server/src/nats/proxy/cameraDevice.js.map +1 -0
  511. package/dist/server/src/nats/proxy/deviceManager.d.ts +16 -0
  512. package/dist/server/src/nats/proxy/deviceManager.js +110 -0
  513. package/dist/server/src/nats/proxy/deviceManager.js.map +1 -0
  514. package/dist/server/src/nats/proxy/index.d.ts +2 -0
  515. package/dist/server/src/nats/proxy/index.js +3 -0
  516. package/dist/server/src/nats/proxy/index.js.map +1 -0
  517. package/dist/server/src/nats/server.d.ts +38 -0
  518. package/dist/server/src/nats/server.js +325 -0
  519. package/dist/server/src/nats/server.js.map +1 -0
  520. package/dist/server/src/nats/types.d.ts +125 -0
  521. package/dist/server/src/nats/types.js +11 -0
  522. package/dist/server/src/nats/types.js.map +1 -0
  523. package/dist/server/src/nats/utils.d.ts +4 -0
  524. package/dist/server/src/nats/utils.js +12 -0
  525. package/dist/server/src/nats/utils.js.map +1 -0
  526. package/dist/server/src/nats/websocket.d.ts +27 -0
  527. package/dist/server/src/nats/websocket.js +214 -0
  528. package/dist/server/src/nats/websocket.js.map +1 -0
  529. package/dist/server/src/plugins/index.d.ts +32 -0
  530. package/dist/server/src/plugins/index.js +326 -0
  531. package/dist/server/src/plugins/index.js.map +1 -0
  532. package/dist/server/src/plugins/interfaces/audioDetection.d.ts +7 -0
  533. package/dist/server/src/plugins/interfaces/audioDetection.js +4 -0
  534. package/dist/server/src/plugins/interfaces/audioDetection.js.map +1 -0
  535. package/dist/server/src/plugins/interfaces/base.d.ts +6 -0
  536. package/dist/server/src/plugins/interfaces/base.js +3 -0
  537. package/dist/server/src/plugins/interfaces/base.js.map +1 -0
  538. package/dist/server/src/plugins/interfaces/motionDetection.d.ts +6 -0
  539. package/dist/server/src/plugins/interfaces/motionDetection.js +4 -0
  540. package/dist/server/src/plugins/interfaces/motionDetection.js.map +1 -0
  541. package/dist/server/src/plugins/interfaces/objectDetection.d.ts +7 -0
  542. package/dist/server/src/plugins/interfaces/objectDetection.js +4 -0
  543. package/dist/server/src/plugins/interfaces/objectDetection.js.map +1 -0
  544. package/dist/server/src/plugins/plugin.d.ts +42 -0
  545. package/dist/server/src/plugins/plugin.js +207 -0
  546. package/dist/server/src/plugins/plugin.js.map +1 -0
  547. package/dist/server/src/plugins/types.d.ts +181 -0
  548. package/dist/server/src/plugins/types.js +18 -0
  549. package/dist/server/src/plugins/types.js.map +1 -0
  550. package/dist/server/src/plugins/worker.d.ts +35 -0
  551. package/dist/server/src/plugins/worker.js +309 -0
  552. package/dist/server/src/plugins/worker.js.map +1 -0
  553. package/dist/server/src/polyglot/node/decoder/child.d.ts +1 -0
  554. package/dist/server/src/polyglot/node/decoder/child.js +703 -0
  555. package/dist/server/src/polyglot/node/decoder/child.js.map +1 -0
  556. package/dist/server/src/polyglot/node/decoder/imageUtils.d.ts +24 -0
  557. package/dist/server/src/polyglot/node/decoder/imageUtils.js +203 -0
  558. package/dist/server/src/polyglot/node/decoder/imageUtils.js.map +1 -0
  559. package/dist/server/src/polyglot/node/decoder/reader.d.ts +5 -0
  560. package/dist/server/src/polyglot/node/decoder/reader.js +41 -0
  561. package/dist/server/src/polyglot/node/decoder/reader.js.map +1 -0
  562. package/dist/server/src/polyglot/node/decoder/wasm/build/decoder.d.ts +144 -0
  563. package/dist/server/src/polyglot/node/decoder/wasm/build/decoder.js +65 -0
  564. package/dist/server/src/polyglot/node/decoder/wasm/build/decoder.wasm +0 -0
  565. package/dist/server/src/polyglot/node/decoder/wasm/test/imageUtils.py +106 -0
  566. package/dist/server/src/polyglot/node/plugins/api.d.ts +37 -0
  567. package/dist/server/src/polyglot/node/plugins/api.js +34 -0
  568. package/dist/server/src/polyglot/node/plugins/api.js.map +1 -0
  569. package/dist/server/src/polyglot/node/plugins/cameraStorage.d.ts +108 -0
  570. package/dist/server/src/polyglot/node/plugins/cameraStorage.js +310 -0
  571. package/dist/server/src/polyglot/node/plugins/cameraStorage.js.map +1 -0
  572. package/dist/server/src/polyglot/node/plugins/child.d.ts +25 -0
  573. package/dist/server/src/polyglot/node/plugins/child.js +206 -0
  574. package/dist/server/src/polyglot/node/plugins/child.js.map +1 -0
  575. package/dist/server/src/polyglot/node/plugins/config.d.ts +104 -0
  576. package/dist/server/src/polyglot/node/plugins/config.js +213 -0
  577. package/dist/server/src/polyglot/node/plugins/config.js.map +1 -0
  578. package/dist/server/src/polyglot/node/plugins/logger.d.ts +16 -0
  579. package/dist/server/src/polyglot/node/plugins/logger.js +128 -0
  580. package/dist/server/src/polyglot/node/plugins/logger.js.map +1 -0
  581. package/dist/server/src/polyglot/node/plugins/proxy/cameraDevice.d.ts +75 -0
  582. package/dist/server/src/polyglot/node/plugins/proxy/cameraDevice.js +474 -0
  583. package/dist/server/src/polyglot/node/plugins/proxy/cameraDevice.js.map +1 -0
  584. package/dist/server/src/polyglot/node/plugins/proxy/deviceManager.d.ts +49 -0
  585. package/dist/server/src/polyglot/node/plugins/proxy/deviceManager.js +194 -0
  586. package/dist/server/src/polyglot/node/plugins/proxy/deviceManager.js.map +1 -0
  587. package/dist/server/src/polyglot/node/plugins/proxy/index.d.ts +2 -0
  588. package/dist/server/src/polyglot/node/plugins/proxy/index.js +3 -0
  589. package/dist/server/src/polyglot/node/plugins/proxy/index.js.map +1 -0
  590. package/dist/server/src/polyglot/node/plugins/proxy/messageQueue.d.ts +20 -0
  591. package/dist/server/src/polyglot/node/plugins/proxy/messageQueue.js +152 -0
  592. package/dist/server/src/polyglot/node/plugins/proxy/messageQueue.js.map +1 -0
  593. package/dist/server/src/polyglot/node/plugins/schema.d.ts +280 -0
  594. package/dist/server/src/polyglot/node/plugins/schema.js +719 -0
  595. package/dist/server/src/polyglot/node/plugins/schema.js.map +1 -0
  596. package/dist/server/src/polyglot/node/plugins/storageController.d.ts +28 -0
  597. package/dist/server/src/polyglot/node/plugins/storageController.js +38 -0
  598. package/dist/server/src/polyglot/node/plugins/storageController.js.map +1 -0
  599. package/dist/server/src/polyglot/python/camera/interfaces/camera.py +26 -0
  600. package/dist/server/src/polyglot/python/camera/interfaces/prebuffer.py +25 -0
  601. package/dist/server/src/polyglot/python/camera/interfaces/ptz.py +38 -0
  602. package/dist/server/src/polyglot/python/camera/polygon.py +173 -0
  603. package/dist/server/src/polyglot/python/camera/video_frame.py +196 -0
  604. package/dist/server/src/polyglot/python/camera_ui_types/__init__.py +1221 -0
  605. package/dist/server/src/polyglot/python/decoder/child.py +922 -0
  606. package/dist/server/src/polyglot/python/decoder/image_utils.py +149 -0
  607. package/dist/server/src/polyglot/python/decoder/typings.py +99 -0
  608. package/dist/server/src/polyglot/python/plugins/camera_storage.py +459 -0
  609. package/dist/server/src/polyglot/python/plugins/child.py +267 -0
  610. package/dist/server/src/polyglot/python/plugins/config_service.py +180 -0
  611. package/dist/server/src/polyglot/python/plugins/constants.py +2 -0
  612. package/dist/server/src/polyglot/python/plugins/logger.py +111 -0
  613. package/dist/server/src/polyglot/python/plugins/plugin_api.py +114 -0
  614. package/dist/server/src/polyglot/python/plugins/proxy/camera_device.py +1722 -0
  615. package/dist/server/src/polyglot/python/plugins/proxy/device_manager.py +265 -0
  616. package/dist/server/src/polyglot/python/plugins/proxy/message_queue.py +213 -0
  617. package/dist/server/src/polyglot/python/plugins/schema.py +392 -0
  618. package/dist/server/src/polyglot/python/plugins/storage_controller.py +57 -0
  619. package/dist/server/src/polyglot/python/plugins/typings.py +248 -0
  620. package/dist/server/src/polyglot/python/utilities/object_path.py +187 -0
  621. package/dist/server/src/polyglot/python/utilities/packer.py +11 -0
  622. package/dist/server/src/polyglot/python/utilities/task.py +25 -0
  623. package/dist/server/src/polyglot/python/utilities/thread.py +10 -0
  624. package/dist/server/src/polyglot/python/utilities/utils.py +48 -0
  625. package/dist/server/src/services/config/constants.d.ts +4 -0
  626. package/dist/server/src/services/config/constants.js +58 -0
  627. package/dist/server/src/services/config/constants.js.map +1 -0
  628. package/dist/server/src/services/config/index.d.ts +54 -0
  629. package/dist/server/src/services/config/index.js +288 -0
  630. package/dist/server/src/services/config/index.js.map +1 -0
  631. package/dist/server/src/services/config/types.d.ts +162 -0
  632. package/dist/server/src/services/config/types.js +11 -0
  633. package/dist/server/src/services/config/types.js.map +1 -0
  634. package/dist/server/src/services/logger/index.d.ts +30 -0
  635. package/dist/server/src/services/logger/index.js +179 -0
  636. package/dist/server/src/services/logger/index.js.map +1 -0
  637. package/dist/server/src/types.d.ts +4 -0
  638. package/dist/server/src/types.js +2 -0
  639. package/dist/server/src/types.js.map +1 -0
  640. package/dist/server/src/utils/packer.d.ts +2 -0
  641. package/dist/server/src/utils/packer.js +17 -0
  642. package/dist/server/src/utils/packer.js.map +1 -0
  643. package/dist/server/src/utils/pythonInstaller.d.ts +48 -0
  644. package/dist/server/src/utils/pythonInstaller.js +465 -0
  645. package/dist/server/src/utils/pythonInstaller.js.map +1 -0
  646. package/dist/server/src/utils/subscribed.d.ts +9 -0
  647. package/dist/server/src/utils/subscribed.js +17 -0
  648. package/dist/server/src/utils/subscribed.js.map +1 -0
  649. package/dist/server/src/utils/utils.d.ts +10 -0
  650. package/dist/server/src/utils/utils.js +165 -0
  651. package/dist/server/src/utils/utils.js.map +1 -0
  652. package/package.json +142 -0
@@ -0,0 +1,1178 @@
1
+ import pty from '@scrypted/node-pty';
2
+ import fixPath from '@seydx/fix-path';
3
+ import { cyan, green, red, yellow } from 'ansicolor';
4
+ import fs from 'fs-extra';
5
+ import { LRUCache } from 'lru-cache';
6
+ import { spawn } from 'node:child_process';
7
+ import { platform, tmpdir, userInfo } from 'node:os';
8
+ import { basename, dirname, join, resolve, sep } from 'path';
9
+ import { gt, parse, satisfies } from 'semver';
10
+ import sharp from 'sharp';
11
+ import { container } from 'tsyringe';
12
+ import { PluginManager } from '../../plugins/index.js';
13
+ import { ConfigService } from '../../services/config/index.js';
14
+ import { orderBy } from '../../utils/utils.js';
15
+ import { CamerasService } from '../services/cameras.service.js';
16
+ import { PluginsService } from '../services/plugins.service.js';
17
+ import fetchInstance from '../utils/fetch.js';
18
+ const npmPluginCache = new LRUCache({ ttl: 300, max: 100, allowStale: false });
19
+ const searchResultBlacklist = new Set(['camera.ui', 'homebridge-camera-ui']);
20
+ const pluginLogoCache = new LRUCache({ max: 100, ttl: 1000 * 60 * 60 });
21
+ export class PluginsController {
22
+ app;
23
+ logger;
24
+ configService;
25
+ io;
26
+ pluginManager;
27
+ proxyServer;
28
+ service;
29
+ camerasService;
30
+ constructor(app) {
31
+ this.app = app;
32
+ this.io = app.io;
33
+ this.service = new PluginsService();
34
+ this.camerasService = new CamerasService();
35
+ this.logger = container.resolve('logger');
36
+ this.configService = container.resolve('configService');
37
+ this.pluginManager = container.resolve('pluginManager');
38
+ this.proxyServer = container.resolve('proxy');
39
+ }
40
+ async enableByName(req, reply) {
41
+ try {
42
+ const pluginName = this.resolvePluginName(req.params);
43
+ const plugin = this.service.getPluginByName(pluginName);
44
+ if (!plugin) {
45
+ return reply.code(404).send({
46
+ statusCode: 404,
47
+ message: 'Plugin not exists',
48
+ });
49
+ }
50
+ if (!plugin.disabled) {
51
+ return reply.code(400).send({
52
+ statusCode: 404,
53
+ message: 'Plugin already enabled',
54
+ });
55
+ }
56
+ plugin.disabled = false;
57
+ if (this.configService.config.plugins.disabledPlugins?.includes(pluginName)) {
58
+ const index = this.configService.config.plugins.disabledPlugins.indexOf(pluginName);
59
+ this.configService.config.plugins.disabledPlugins.splice(index, 1);
60
+ this.configService.writeConfig();
61
+ }
62
+ await this.pluginManager.startPluginChild(pluginName);
63
+ return reply.code(204).send();
64
+ }
65
+ catch (error) {
66
+ return reply.code(500).send({
67
+ statusCode: 500,
68
+ message: error.message,
69
+ });
70
+ }
71
+ }
72
+ async disableByName(req, reply) {
73
+ try {
74
+ const pluginName = this.resolvePluginName(req.params);
75
+ const plugin = this.service.getPluginByName(pluginName);
76
+ if (!plugin) {
77
+ return reply.code(404).send({
78
+ statusCode: 404,
79
+ message: 'Plugin not exists',
80
+ });
81
+ }
82
+ if (plugin.disabled) {
83
+ return reply.code(400).send({
84
+ statusCode: 404,
85
+ message: 'Plugin already disabled',
86
+ });
87
+ }
88
+ plugin.disabled = true;
89
+ if (!this.configService.config.plugins.disabledPlugins) {
90
+ this.configService.config.plugins.disabledPlugins = [];
91
+ }
92
+ this.configService.config.plugins.disabledPlugins.push(pluginName);
93
+ this.configService.writeConfig();
94
+ await this.pluginManager.stopPluginChild(pluginName);
95
+ return reply.code(204).send();
96
+ }
97
+ catch (error) {
98
+ return reply.code(500).send({
99
+ statusCode: 500,
100
+ message: error.message,
101
+ });
102
+ }
103
+ }
104
+ getByName(req, reply) {
105
+ try {
106
+ const pluginName = this.resolvePluginName(req.params);
107
+ const plugin = this.service.getPluginByName(pluginName);
108
+ if (!plugin) {
109
+ return reply.code(404).send({
110
+ statusCode: 404,
111
+ message: 'Plugin not exists',
112
+ });
113
+ }
114
+ return reply.code(200).send(plugin.info);
115
+ }
116
+ catch (error) {
117
+ return reply.code(500).send({
118
+ statusCode: 500,
119
+ message: error.message,
120
+ });
121
+ }
122
+ }
123
+ async getPluginUpdateByName(req, reply) {
124
+ try {
125
+ const pluginName = this.resolvePluginName(req.params);
126
+ const plugin = this.service.getPluginByName(pluginName);
127
+ if (!plugin) {
128
+ return reply.code(404).send({
129
+ statusCode: 404,
130
+ message: 'Plugin not exists',
131
+ });
132
+ }
133
+ const pluginUpdateState = await this.getPluginFromNpm(plugin.info);
134
+ return reply.code(200).send(pluginUpdateState);
135
+ }
136
+ catch (error) {
137
+ return reply.code(500).send({
138
+ statusCode: 500,
139
+ message: error.message,
140
+ });
141
+ }
142
+ }
143
+ async getVersionsByName(req, reply) {
144
+ try {
145
+ const pluginName = this.resolvePluginName(req.params);
146
+ const availableVersions = await this.getAvailablePluginVersions(pluginName);
147
+ return reply.code(200).send(availableVersions);
148
+ }
149
+ catch (error) {
150
+ return reply.code(500).send({
151
+ statusCode: 500,
152
+ message: error.message,
153
+ });
154
+ }
155
+ }
156
+ async getChangelogByName(req, reply) {
157
+ try {
158
+ const pluginName = this.resolvePluginName(req.params);
159
+ const plugin = this.service.getPluginByName(pluginName);
160
+ if (!plugin) {
161
+ return reply.code(404).send({
162
+ statusCode: 404,
163
+ message: 'Plugin not exists',
164
+ });
165
+ }
166
+ try {
167
+ const changelog = resolve(plugin.installPath, 'CHANGELOG.md');
168
+ if (await fs.pathExists(changelog)) {
169
+ const file = await fs.readFile(`${plugin.installPath}/CHANGELOG.md`, 'utf8');
170
+ reply.header('Content-Type', 'text/plain');
171
+ return reply.code(200).send(file);
172
+ }
173
+ }
174
+ catch {
175
+ //
176
+ }
177
+ const version = plugin.info.installedVersion || 'latest';
178
+ const response = await fetchInstance(`https://unpkg.com/${plugin.pluginName}@${version}/CHANGELOG.md`, {
179
+ method: 'GET',
180
+ });
181
+ const data = await response.text();
182
+ return reply.code(200).send(data);
183
+ }
184
+ catch (error) {
185
+ return reply.code(500).send({
186
+ statusCode: 500,
187
+ message: error.message,
188
+ });
189
+ }
190
+ }
191
+ async getConfigJsonByName(req, reply) {
192
+ try {
193
+ const pluginName = this.resolvePluginName(req.params);
194
+ const plugin = this.service.getPluginByName(pluginName);
195
+ const configFile = plugin?.configFile;
196
+ if (!plugin || !configFile) {
197
+ return reply.code(404).send({
198
+ statusCode: 404,
199
+ message: 'Plugin or Plugin Config not exists',
200
+ });
201
+ }
202
+ const config = (await fs.readJSON(configFile, { throws: false })) || {};
203
+ reply.header('Content-Type', 'application/json');
204
+ return reply.code(200).send(config);
205
+ }
206
+ catch (error) {
207
+ return reply.code(500).send({
208
+ statusCode: 500,
209
+ message: error.message,
210
+ });
211
+ }
212
+ }
213
+ async getPluginLogoByName(req, reply) {
214
+ try {
215
+ const pluginName = this.resolvePluginName(req.params);
216
+ const plugin = this.service.getPluginByName(pluginName);
217
+ if (!plugin) {
218
+ return reply.code(404).send({
219
+ statusCode: 404,
220
+ message: 'Plugin not exists',
221
+ });
222
+ }
223
+ const logoPath = resolve(plugin.installPath, 'logo.png');
224
+ if (!(await fs.pathExists(logoPath))) {
225
+ return reply.code(200).send(Buffer.from('').toString('base64'));
226
+ }
227
+ let base64Logo;
228
+ if (pluginLogoCache.has(pluginName)) {
229
+ base64Logo = pluginLogoCache.get(pluginName);
230
+ }
231
+ else {
232
+ const logo = await sharp(logoPath).resize({ width: 100, height: 100, fit: 'cover', kernel: 'nearest' }).toBuffer();
233
+ base64Logo = Buffer.from(logo).toString('base64');
234
+ pluginLogoCache.set(pluginName, base64Logo);
235
+ }
236
+ reply.header('Content-Type', 'image/png');
237
+ return reply.code(200).send(base64Logo);
238
+ }
239
+ catch (error) {
240
+ return reply.code(500).send({
241
+ statusCode: 500,
242
+ message: error.message,
243
+ });
244
+ }
245
+ }
246
+ async getPluginSchemaByName(req, reply) {
247
+ try {
248
+ const pluginName = this.resolvePluginName(req.params);
249
+ const plugin = this.service.getPluginByName(pluginName);
250
+ if (!plugin) {
251
+ return reply.code(404).send({
252
+ statusCode: 404,
253
+ message: 'Plugin not exists',
254
+ });
255
+ }
256
+ const schemaPath = resolve(plugin.installPath, 'config.schema.json');
257
+ if (!(await fs.pathExists(schemaPath))) {
258
+ return reply.code(200).send();
259
+ }
260
+ const schemaJson = await fs.readJson(schemaPath, { throws: false });
261
+ reply.header('Content-Type', 'application/json');
262
+ return reply.code(200).send(schemaJson);
263
+ }
264
+ catch (error) {
265
+ return reply.code(500).send({
266
+ statusCode: 500,
267
+ message: error.message,
268
+ });
269
+ }
270
+ }
271
+ async getPluginInterface(req, reply) {
272
+ try {
273
+ const pluginName = this.resolvePluginName(req.params);
274
+ const plugin = this.service.getPluginByName(pluginName);
275
+ if (!plugin) {
276
+ return reply.code(404).send({
277
+ statusCode: 404,
278
+ message: 'Plugin not exists',
279
+ });
280
+ }
281
+ const { type } = req.query.type;
282
+ const schemaJson = await this.proxyServer.requestPluginFn(type, plugin.id, 'interfaceSchema', []);
283
+ reply.header('Content-Type', 'application/json');
284
+ return reply.code(200).send(schemaJson);
285
+ }
286
+ catch (error) {
287
+ return reply.code(500).send({
288
+ statusCode: 500,
289
+ message: error.message,
290
+ });
291
+ }
292
+ }
293
+ async detectObjects(req, reply) {
294
+ try {
295
+ const pluginName = this.resolvePluginName(req.params);
296
+ const plugin = this.service.getPluginByName(pluginName);
297
+ if (!plugin) {
298
+ return reply.code(404).send({
299
+ statusCode: 404,
300
+ message: 'Plugin not exists',
301
+ });
302
+ }
303
+ if (!req.isMultipart()) {
304
+ throw new Error('No multipart request!');
305
+ }
306
+ const file = req.body.upload;
307
+ const tempDir = await fs.mkdtemp(join(tmpdir(), 'cameraui-object-detection-'));
308
+ const fileName = file.filename;
309
+ const tempFilePath = resolve(tempDir, fileName);
310
+ const fileBuffer = await file.toBuffer();
311
+ await fs.writeFile(tempFilePath, fileBuffer);
312
+ const response = await this.proxyServer.requestPluginFn('objectDetection', plugin.id, 'detectObjects', [tempFilePath, req.body.metadata, req.body.config], 15000);
313
+ try {
314
+ const promises = [];
315
+ if (tempFilePath) {
316
+ promises.push(fs.unlink(tempFilePath));
317
+ }
318
+ if (tempDir) {
319
+ promises.push(fs.rmdir(tempDir));
320
+ }
321
+ await Promise.allSettled(promises);
322
+ }
323
+ catch {
324
+ //
325
+ }
326
+ return reply.code(201).send(response.detections);
327
+ }
328
+ catch (error) {
329
+ return reply.code(500).send({
330
+ statusCode: 500,
331
+ message: error.message,
332
+ });
333
+ }
334
+ }
335
+ async detectAudio(req, reply) {
336
+ try {
337
+ const pluginName = this.resolvePluginName(req.params);
338
+ const plugin = this.service.getPluginByName(pluginName);
339
+ if (!plugin) {
340
+ return reply.code(404).send({
341
+ statusCode: 404,
342
+ message: 'Plugin not exists',
343
+ });
344
+ }
345
+ if (!req.isMultipart()) {
346
+ throw new Error('No multipart request!');
347
+ }
348
+ const file = req.body.upload;
349
+ const tempDir = await fs.mkdtemp(join(tmpdir(), 'cameraui-audio-detection-'));
350
+ const fileName = file.filename;
351
+ const tempFilePath = resolve(tempDir, fileName);
352
+ const fileBuffer = await file.toBuffer();
353
+ await fs.writeFile(tempFilePath, fileBuffer);
354
+ const response = await this.proxyServer.requestPluginFn('audioDetection', plugin.id, 'detectAudio', [tempFilePath, req.body.metadata, req.body.config], 15000);
355
+ try {
356
+ const promises = [];
357
+ if (tempFilePath) {
358
+ promises.push(fs.unlink(tempFilePath));
359
+ }
360
+ if (tempDir) {
361
+ promises.push(fs.rmdir(tempDir));
362
+ }
363
+ await Promise.allSettled(promises);
364
+ }
365
+ catch {
366
+ //
367
+ }
368
+ return reply.code(201).send(response.detected);
369
+ }
370
+ catch (error) {
371
+ return reply.code(500).send({
372
+ statusCode: 500,
373
+ message: error.message,
374
+ });
375
+ }
376
+ }
377
+ async detectMotion(req, reply) {
378
+ try {
379
+ const pluginName = this.resolvePluginName(req.params);
380
+ const plugin = this.service.getPluginByName(pluginName);
381
+ if (!plugin) {
382
+ return reply.code(404).send({
383
+ statusCode: 404,
384
+ message: 'Plugin not exists',
385
+ });
386
+ }
387
+ if (!req.isMultipart()) {
388
+ throw new Error('No multipart request!');
389
+ }
390
+ const file = req.body.upload;
391
+ const tempDir = await fs.mkdtemp(join(tmpdir(), 'cameraui-motion-detection-'));
392
+ const fileName = file.filename;
393
+ const tempFilePath = resolve(tempDir, fileName);
394
+ const fileBuffer = await file.toBuffer();
395
+ await fs.writeFile(tempFilePath, fileBuffer);
396
+ const response = await this.proxyServer.requestPluginFn('motionDetection', plugin.id, 'detectMotion', [tempFilePath, req.body.config], 60 * 1000);
397
+ fs.readFile(response.filePath, async (error, fileBuffer) => {
398
+ if (error) {
399
+ this.logger.error(error);
400
+ }
401
+ try {
402
+ const promises = [];
403
+ if (tempFilePath) {
404
+ promises.push(fs.unlink(tempFilePath));
405
+ }
406
+ if (response.filePath && response.filePath !== tempFilePath) {
407
+ promises.push(fs.unlink(response.filePath));
408
+ }
409
+ if (tempDir) {
410
+ promises.push(fs.rmdir(tempDir));
411
+ }
412
+ await Promise.allSettled(promises);
413
+ }
414
+ catch {
415
+ //
416
+ }
417
+ reply.send(error || fileBuffer);
418
+ });
419
+ reply.header('Content-Type', 'application/octet-stream');
420
+ reply.header('Content-Disposition', 'attachment; filename=video.mp4');
421
+ return reply;
422
+ }
423
+ catch (error) {
424
+ return reply.code(500).send({
425
+ statusCode: 500,
426
+ message: error.message,
427
+ });
428
+ }
429
+ }
430
+ async submitActionButtonByName(req, reply) {
431
+ try {
432
+ const pluginName = this.resolvePluginName(req.params);
433
+ const plugin = this.service.getPluginByName(pluginName);
434
+ const configFile = plugin?.configFile;
435
+ if (!plugin || !configFile) {
436
+ return reply.code(404).send({
437
+ statusCode: 404,
438
+ message: 'Plugin or Plugin Config not exists',
439
+ });
440
+ }
441
+ const toastMessage = await this.proxyServer.requestPluginFn('base', plugin.id, 'onFormSubmit', [req.body.actionId, req.body.payload]);
442
+ return reply.code(201).send(toastMessage);
443
+ }
444
+ catch (error) {
445
+ return reply.code(500).send({
446
+ statusCode: 500,
447
+ message: error.message,
448
+ });
449
+ }
450
+ }
451
+ getContractByName(req, reply) {
452
+ try {
453
+ const pluginName = this.resolvePluginName(req.params);
454
+ const plugin = this.service.getPluginByName(pluginName);
455
+ if (!plugin) {
456
+ return reply.code(404).send({
457
+ statusCode: 404,
458
+ message: 'Plugin not exists',
459
+ });
460
+ }
461
+ const contract = plugin.contract;
462
+ const camerasList = plugin.contract.extension || plugin.contract.supportAdditionalCameras ? this.camerasService.list() : this.camerasService.listByPluginId(plugin.id);
463
+ const cameras = camerasList?.map((camera) => {
464
+ return {
465
+ name: camera.name,
466
+ extensions: camera.extensions,
467
+ };
468
+ }) || [];
469
+ return reply.code(200).send({ contract, cameras });
470
+ }
471
+ catch (error) {
472
+ return reply.code(500).send({
473
+ statusCode: 500,
474
+ message: error.message,
475
+ });
476
+ }
477
+ }
478
+ async getReadmeByName(req, reply) {
479
+ try {
480
+ const pluginName = this.resolvePluginName(req.params);
481
+ const plugin = this.service.getPluginByName(pluginName);
482
+ if (!plugin) {
483
+ return reply.code(404).send({
484
+ statusCode: 404,
485
+ message: 'Plugin not exists',
486
+ });
487
+ }
488
+ try {
489
+ const readme = resolve(plugin.installPath, 'CHANGELOG.md');
490
+ if (await fs.pathExists(readme)) {
491
+ const file = await fs.readFile(`${plugin.installPath}/README.md`, 'utf8');
492
+ reply.header('Content-Type', 'text/plain');
493
+ return reply.code(200).send(file);
494
+ }
495
+ }
496
+ catch {
497
+ //
498
+ }
499
+ const version = plugin.info.installedVersion || 'latest';
500
+ const response = await fetchInstance(`https://unpkg.com/${plugin.pluginName}@${version}/README.md`, {
501
+ method: 'GET',
502
+ });
503
+ const data = await response.text();
504
+ return reply.code(200).send(data);
505
+ }
506
+ catch (error) {
507
+ return reply.code(500).send({
508
+ statusCode: 500,
509
+ message: error.message,
510
+ });
511
+ }
512
+ }
513
+ async getReleaseByName(req, reply) {
514
+ try {
515
+ const pluginName = this.resolvePluginName(req.params);
516
+ const plugin = this.service.getPluginByName(pluginName);
517
+ if (!plugin) {
518
+ return reply.code(404).send({
519
+ statusCode: 404,
520
+ message: 'Plugin not exists',
521
+ });
522
+ }
523
+ const repoMatch = plugin.info.links?.homepage?.match(/https:\/\/github.com\/([^/]+)\/([^/#]+)/);
524
+ if (!repoMatch) {
525
+ return reply.code(404).send({
526
+ statusCode: 404,
527
+ message: '"homepage" not exists in package.json or is not a github repo',
528
+ });
529
+ }
530
+ const response = await fetchInstance(`https://api.github.com/repos/${repoMatch[1]}/${repoMatch[2]}/releases/latest`, {
531
+ method: 'GET',
532
+ });
533
+ const data = await response.json();
534
+ return reply.code(200).send({
535
+ name: data.name,
536
+ changelog: data.body,
537
+ });
538
+ }
539
+ catch (error) {
540
+ return reply.code(500).send({
541
+ statusCode: 500,
542
+ message: error.message,
543
+ });
544
+ }
545
+ }
546
+ async installOrUpdate(req, reply) {
547
+ try {
548
+ let plugin = this.pluginManager.plugins.get(req.body.pluginname);
549
+ const installPath = await this.managePlugin('install', { pluginName: req.body.pluginname, version: req.body.pluginversion });
550
+ if (!plugin) {
551
+ plugin = await this.pluginManager.loadPlugin(`${installPath}/node_modules/${req.body.pluginname}`);
552
+ this.logger.log(`Plugin installed: ${plugin.pluginName}.${plugin.displayName} (${plugin.info.installedVersion})`);
553
+ this.logger.log(`Plugin Path: ${plugin.installPath}`);
554
+ await this.pluginManager.initializeInstalledPlugin(plugin);
555
+ await this.pluginManager.startPluginChild(plugin.pluginName);
556
+ }
557
+ else {
558
+ this.logger.log(`Plugin updated: ${plugin.pluginName}.${plugin.displayName} (${plugin.info.installedVersion}), restarting ...`);
559
+ const pluginProcess = this.service.getPluginProcessByName(req.body.pluginname);
560
+ if (pluginProcess) {
561
+ await pluginProcess.restart();
562
+ }
563
+ }
564
+ npmPluginCache.delete(plugin.pluginName);
565
+ plugin.reparsePackageJson();
566
+ return reply.code(201).send(plugin.info);
567
+ }
568
+ catch (error) {
569
+ return reply.code(500).send({
570
+ statusCode: 500,
571
+ message: error.message,
572
+ });
573
+ }
574
+ }
575
+ async managePlugin(action, pluginInfo) {
576
+ pluginInfo.version = pluginInfo.version || 'latest';
577
+ // convert 'latest' into a real version
578
+ if (action === 'install' && pluginInfo.version === 'latest') {
579
+ pluginInfo.version = await this.getNpmModuleLatestVersion(pluginInfo.pluginName);
580
+ }
581
+ // set default install path
582
+ let installPath = this.configService.PLUGINS_INSTALL_PATH;
583
+ // check if the plugin is currently installed
584
+ const existingPlugin = this.service.getPluginByName(pluginInfo.pluginName);
585
+ // if the plugin is already installed, match the installation path
586
+ if (existingPlugin) {
587
+ installPath = existingPlugin.installPath;
588
+ }
589
+ installPath = this.getLastNodeModulesPath(installPath) || installPath;
590
+ // prepare flags for npm command
591
+ const installOptions = [];
592
+ // check to see if custom plugin path is using a package.json file
593
+ if (installPath === this.configService.PLUGINS_INSTALL_PATH && (await fs.pathExists(resolve(installPath, '../package.json')))) {
594
+ installOptions.push('--save');
595
+ }
596
+ // install path is one level up
597
+ installPath = resolve(installPath, '../');
598
+ // set global flag
599
+ if (!this.configService.PLUGINS_INSTALL_PATH || platform() === 'win32' || existingPlugin?.info.globalInstall === true) {
600
+ installOptions.push('-g');
601
+ }
602
+ const npmPluginLabel = action === 'uninstall' || action === 'unlink' ? pluginInfo.pluginName : `${pluginInfo.pluginName}@${pluginInfo.version}`;
603
+ try {
604
+ await this.runNpmCommand([...this.getNpmPath(), action, ...installOptions, npmPluginLabel], installPath, pluginInfo);
605
+ // ensure the custom plugin dir was not deleted
606
+ await this.ensurePluginDirExists();
607
+ if (pluginInfo.id && (action === 'uninstall' || action === 'unlink')) {
608
+ await this.camerasService.removeByPluginId(pluginInfo.id);
609
+ }
610
+ return installPath;
611
+ }
612
+ catch (error) {
613
+ if (pluginInfo.pluginName === 'camera.ui') {
614
+ this.io.of('/logs').emit('stdout', yellow('\r\nCleaning up npm cache, please wait...\r\n'));
615
+ await this.cleanNpmCache();
616
+ this.io.of('/logs').emit('stdout', yellow('npm cache cleared, please try updating camera.ui again.\r\n'));
617
+ }
618
+ throw error;
619
+ }
620
+ }
621
+ list(req, reply) {
622
+ try {
623
+ const installedPlugins = this.service.installedPlugins();
624
+ const plugins = installedPlugins.map((plugin) => plugin.info);
625
+ return orderBy(plugins, ['displayName'], ['asc']);
626
+ // return orderBy(plugins, ['disabled', 'displayName'], ['asc', 'asc']);
627
+ }
628
+ catch (error) {
629
+ return reply.code(500).send({
630
+ statusCode: 500,
631
+ message: error.message,
632
+ });
633
+ }
634
+ }
635
+ listExtensions(req, reply) {
636
+ try {
637
+ const installedPlugins = this.service.installedPlugins();
638
+ const allExtensions = installedPlugins
639
+ .filter((plugin) => plugin.contract.extension || plugin.contract.supportAdditionalCameras)
640
+ .map((plugin) => ({
641
+ pluginName: plugin.pluginName,
642
+ displayName: plugin.displayName,
643
+ type: plugin.contract.extension ? [plugin.contract.extension] : plugin.contract.builtIns,
644
+ }));
645
+ return orderBy(allExtensions, ['displayName'], ['asc']);
646
+ }
647
+ catch (error) {
648
+ return reply.code(500).send({
649
+ statusCode: 500,
650
+ message: error.message,
651
+ });
652
+ }
653
+ }
654
+ async patchConfigJsonByName(req, reply) {
655
+ try {
656
+ const pluginName = this.resolvePluginName(req.params);
657
+ const plugin = this.service.getPluginByName(pluginName);
658
+ const configFile = plugin?.configFile;
659
+ if (!plugin || !configFile) {
660
+ return reply.code(404).send({
661
+ statusCode: 404,
662
+ message: 'Plugin or Plugin Config not exists',
663
+ });
664
+ }
665
+ let configData = req.body;
666
+ if (typeof req.body === 'string') {
667
+ try {
668
+ configData = JSON.parse(req.body);
669
+ }
670
+ catch {
671
+ //
672
+ }
673
+ }
674
+ await fs.writeJson(configFile, configData, { spaces: 2 });
675
+ return reply.code(201).send(configData);
676
+ }
677
+ catch (error) {
678
+ return reply.code(500).send({
679
+ statusCode: 500,
680
+ message: error.message,
681
+ });
682
+ }
683
+ }
684
+ async restartByName(req, reply) {
685
+ try {
686
+ const pluginName = this.resolvePluginName(req.params);
687
+ const plugin = this.service.getPluginByName(pluginName);
688
+ if (!plugin) {
689
+ return reply.code(404).send({
690
+ statusCode: 404,
691
+ message: 'Plugin not exists',
692
+ });
693
+ }
694
+ const pluginProcess = this.service.getPluginProcessByName(pluginName);
695
+ if (!pluginProcess) {
696
+ return reply.code(404).send({
697
+ statusCode: 404,
698
+ message: 'Plugin process not initialized',
699
+ });
700
+ }
701
+ await pluginProcess.restart();
702
+ return reply.code(204).send();
703
+ }
704
+ catch (error) {
705
+ return reply.code(500).send({
706
+ statusCode: 500,
707
+ message: error.message,
708
+ });
709
+ }
710
+ }
711
+ async search(req, reply) {
712
+ try {
713
+ const query = req.query.pluginname || '';
714
+ const q = (!query || !query.length ? '' : query + '+') + 'keywords:camera-ui-plugin+not:deprecated&size=30';
715
+ let searchResults;
716
+ try {
717
+ const response = await fetchInstance(`https://registry.npmjs.org/-/v1/search?text=${q}`, {
718
+ method: 'GET',
719
+ });
720
+ searchResults = await response.json();
721
+ }
722
+ catch (error) {
723
+ throw new Error(`Failed to search the npm registry - "${error.message}"`);
724
+ }
725
+ const result = searchResults.objects
726
+ .filter((x) => x.package.name.indexOf('camera-ui-') === 0 || this.isScopedPlugin(x.package.name))
727
+ .filter((x) => !searchResultBlacklist.has(x.package.name))
728
+ .map((pkg) => {
729
+ let plugin = {
730
+ id: '0',
731
+ pluginName: pkg.package.name,
732
+ displayName: PluginManager.transformDisplaName(pkg.package.name),
733
+ private: false,
734
+ isPython: false,
735
+ isNode: true,
736
+ };
737
+ const installedPlugins = this.service.installedPlugins();
738
+ const isInstalled = installedPlugins.find((installedPlugin) => installedPlugin.pluginName === plugin.pluginName);
739
+ if (isInstalled) {
740
+ plugin = isInstalled.info;
741
+ plugin.lastUpdated = pkg.package.date;
742
+ return plugin;
743
+ }
744
+ plugin.publicPackage = true;
745
+ plugin.installedVersion = undefined;
746
+ plugin.latestVersion = pkg.package.version;
747
+ plugin.lastUpdated = pkg.package.date;
748
+ plugin.description = pkg.package.description ? pkg.package.description.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '').trim() : pkg.package.name;
749
+ plugin.links = pkg.package.links;
750
+ plugin.author = pkg.package.publisher ? pkg.package.publisher.username : undefined;
751
+ return plugin;
752
+ });
753
+ if (!result.length && (query.indexOf('camera-ui-') === 0 || this.isScopedPlugin(query)) && !searchResultBlacklist.has(query.toLowerCase())) {
754
+ const singlePluginQuey = await this.searchNpmRegistrySingle(query.toLowerCase());
755
+ return singlePluginQuey;
756
+ }
757
+ return orderBy(result, ['displayName'], ['asc']);
758
+ }
759
+ catch (error) {
760
+ return reply.code(500).send({
761
+ statusCode: 500,
762
+ message: error.message,
763
+ });
764
+ }
765
+ }
766
+ async startByName(req, reply) {
767
+ try {
768
+ const pluginName = this.resolvePluginName(req.params);
769
+ const plugin = this.service.getPluginByName(pluginName);
770
+ if (!plugin) {
771
+ return reply.code(404).send({
772
+ statusCode: 404,
773
+ message: 'Plugin not exists',
774
+ });
775
+ }
776
+ const pluginProcess = this.service.getPluginProcessByName(pluginName);
777
+ if (!pluginProcess) {
778
+ return reply.code(404).send({
779
+ statusCode: 404,
780
+ message: 'Plugin process not initialized',
781
+ });
782
+ }
783
+ await pluginProcess.start();
784
+ return reply.code(204).send();
785
+ }
786
+ catch (error) {
787
+ return reply.code(500).send({
788
+ statusCode: 500,
789
+ message: error.message,
790
+ });
791
+ }
792
+ }
793
+ async stopByName(req, reply) {
794
+ try {
795
+ const pluginName = this.resolvePluginName(req.params);
796
+ const plugin = this.service.getPluginByName(pluginName);
797
+ if (!plugin) {
798
+ return reply.code(404).send({
799
+ statusCode: 404,
800
+ message: 'Plugin not exists',
801
+ });
802
+ }
803
+ const pluginProcess = this.service.getPluginProcessByName(pluginName);
804
+ if (!pluginProcess) {
805
+ return reply.code(404).send({
806
+ statusCode: 404,
807
+ message: 'Plugin process not initialized',
808
+ });
809
+ }
810
+ await pluginProcess.teardown();
811
+ return reply.code(204).send();
812
+ }
813
+ catch (error) {
814
+ return reply.code(500).send({
815
+ statusCode: 500,
816
+ message: error.message,
817
+ });
818
+ }
819
+ }
820
+ async uninstallByName(req, reply) {
821
+ try {
822
+ const pluginName = this.resolvePluginName(req.params);
823
+ const plugin = this.service.getPluginByName(pluginName);
824
+ if (!plugin) {
825
+ return reply.code(404).send({
826
+ statusCode: 404,
827
+ message: 'Plugin not exists',
828
+ });
829
+ }
830
+ await this.managePlugin(plugin.isSymLink ? 'unlink' : 'uninstall', { pluginName: plugin.pluginName, id: plugin.id });
831
+ await this.pluginManager.removePlugin(plugin, true, req.query.removeStorage);
832
+ npmPluginCache.delete(plugin.pluginName);
833
+ npmPluginCache.delete(`lookup-${plugin.pluginName}`);
834
+ return reply.code(204).send();
835
+ }
836
+ catch (error) {
837
+ return reply.code(500).send({
838
+ statusCode: 500,
839
+ message: error.message,
840
+ });
841
+ }
842
+ }
843
+ async uninstallAll(req, reply) {
844
+ try {
845
+ const plugins = this.service.installedPlugins();
846
+ const pluginNames = plugins.map((plugin) => plugin.pluginName);
847
+ await Promise.all(plugins.map((plugin) => this.managePlugin(plugin.isSymLink ? 'unlink' : 'uninstall', { pluginName: plugin.pluginName, id: plugin.id })));
848
+ for (const plugin of plugins) {
849
+ await this.pluginManager.removePlugin(plugin, true, req.query.removeStorage);
850
+ }
851
+ const pluginsToDelete = [...pluginNames, ...pluginNames.map((pluginName) => `lookup-${pluginName}`)];
852
+ pluginsToDelete.forEach((p) => npmPluginCache.delete(p));
853
+ return reply.code(204).send();
854
+ }
855
+ catch (error) {
856
+ return reply.code(500).send({
857
+ statusCode: 500,
858
+ message: error.message,
859
+ });
860
+ }
861
+ }
862
+ async cleanNpmCache() {
863
+ const command = [...this.getNpmPath(), 'cache', 'clean', '--force'];
864
+ if (this.configService.config.plugins.sudo) {
865
+ command.unshift('sudo', '-E', '-n');
866
+ }
867
+ return new Promise((_resolve) => {
868
+ const child = spawn(command.shift(), command);
869
+ child.on('exit', (code) => {
870
+ this.logger.log('npm cache clear command executed with exit code', code);
871
+ _resolve();
872
+ });
873
+ child.on('error', () => {
874
+ // do nothing
875
+ });
876
+ });
877
+ }
878
+ async ensurePluginDirExists() {
879
+ if (!this.configService.PLUGINS_INSTALL_PATH) {
880
+ return;
881
+ }
882
+ if (!(await fs.pathExists(this.configService.PLUGINS_INSTALL_PATH))) {
883
+ this.logger.warn(`Plugin directory was removed. Re-creating: ${this.configService.PLUGINS_INSTALL_PATH}`);
884
+ try {
885
+ await fs.ensureDir(this.configService.PLUGINS_INSTALL_PATH);
886
+ }
887
+ catch (error) {
888
+ this.logger.error('Failed to recreate plugin directory', error);
889
+ }
890
+ }
891
+ if (!(await fs.pathExists(this.configService.PLUGINS_PJSON_FILE))) {
892
+ this.logger.warn(`Plugin package.json was removed. Re-creating: ${this.configService.PLUGINS_INSTALL_PATH}`);
893
+ try {
894
+ await fs.ensureFile(this.configService.PLUGINS_PJSON_FILE);
895
+ await fs.writeJson(this.configService.PLUGINS_PJSON_FILE, this.pluginsPackageJson(), { spaces: 2 });
896
+ }
897
+ catch (error) {
898
+ this.logger.error('Failed to recreate plugin package.json file', error);
899
+ }
900
+ }
901
+ }
902
+ async getAvailablePluginVersions(pluginName) {
903
+ const fromCache = npmPluginCache.get(`lookup-${pluginName}`);
904
+ let pkg = fromCache;
905
+ if (!pkg) {
906
+ const response = await fetchInstance(`https://registry.npmjs.org/${encodeURIComponent(pluginName).replace(/%40/g, '@')}`, {
907
+ method: 'GET',
908
+ headers: {
909
+ accept: 'application/vnd.npm.install-v1+json', // only return minimal information
910
+ },
911
+ });
912
+ pkg = (await response.json());
913
+ }
914
+ if (!fromCache) {
915
+ npmPluginCache.set(`lookup-${pluginName}`, pkg, { ttl: 60 * 1000 });
916
+ }
917
+ return {
918
+ tags: pkg['dist-tags'],
919
+ versions: Object.keys(pkg.versions).reverse(),
920
+ };
921
+ }
922
+ getLastNodeModulesPath(fullPath) {
923
+ const segments = fullPath.split(sep);
924
+ const lastNodeModulesIndex = segments.lastIndexOf('node_modules');
925
+ if (lastNodeModulesIndex !== -1) {
926
+ return segments.slice(0, lastNodeModulesIndex + 1).join(sep);
927
+ }
928
+ else {
929
+ return null;
930
+ }
931
+ }
932
+ async getNpmModuleLatestVersion(npmModuleName) {
933
+ try {
934
+ const response = await fetchInstance(`https://registry.npmjs.org/${npmModuleName}/latest`, {
935
+ method: 'GET',
936
+ });
937
+ const data = await response.json();
938
+ return data.version;
939
+ }
940
+ catch {
941
+ return 'latest';
942
+ }
943
+ }
944
+ getNpmPath() {
945
+ fixPath();
946
+ if (platform() === 'win32') {
947
+ // if running on windows find the full path to npm
948
+ const windowsNpmPath = [
949
+ join(process.env.APPDATA, 'npm/npm.cmd'),
950
+ join(process.env.ProgramFiles, 'nodejs/npm.cmd'),
951
+ join(process.env.NVM_SYMLINK || process.env.ProgramFiles + '/nodejs', 'npm.cmd'),
952
+ ].filter(fs.existsSync);
953
+ if (windowsNpmPath.length) {
954
+ return [windowsNpmPath[0]];
955
+ }
956
+ else {
957
+ this.logger.error('ERROR: Cannot find npm binary. You will not be able to manage plugins or update camera.ui.');
958
+ this.logger.error('ERROR: You might be able to fix this problem by running: npm install -g npm');
959
+ }
960
+ }
961
+ // Linux and macOS don't require the full path to npm / pnpm
962
+ return ['npm'];
963
+ }
964
+ async getPluginFromNpm(plugin) {
965
+ const pluginState = {
966
+ updateAvailable: false,
967
+ betaUpdateAvailable: false,
968
+ };
969
+ try {
970
+ // attempt to load from cache
971
+ const fromCache = npmPluginCache.get(plugin.pluginName);
972
+ let pkg = fromCache;
973
+ if (!pkg) {
974
+ const response = await fetchInstance(`https://registry.npmjs.org/${encodeURIComponent(plugin.pluginName).replace(/%40/g, '@')}/latest`, {
975
+ method: 'GET',
976
+ });
977
+ pkg = (await response.json());
978
+ }
979
+ pluginState.latestVersion = pkg.version;
980
+ pluginState.updateAvailable = gt(pkg.version || '0.0.1', plugin.installedVersion);
981
+ // check for beta updates, if no latest version is available
982
+ if (!pluginState.updateAvailable) {
983
+ const pluginVersion = parse(plugin.installedVersion);
984
+ if (pluginVersion?.prerelease[0] === 'beta' && gt(plugin.installedVersion, pluginState.latestVersion || '0.0.1')) {
985
+ const versions = await this.getAvailablePluginVersions(plugin.pluginName);
986
+ if (versions.tags.beta && gt(versions.tags.beta, plugin.installedVersion)) {
987
+ pluginState.betaUpdateAvailable = true;
988
+ pluginState.latestVersion = versions.tags.beta;
989
+ }
990
+ }
991
+ }
992
+ // store in cache if it was not there already
993
+ if (!fromCache) {
994
+ npmPluginCache.set(plugin.pluginName, pkg);
995
+ }
996
+ }
997
+ catch (error) {
998
+ if (error.response?.status !== 404) {
999
+ this.logger.error(`[${plugin.pluginName}] Failed to check registry.npmjs.org for updates`, error);
1000
+ }
1001
+ pluginState.latestVersion = undefined;
1002
+ pluginState.updateAvailable = false;
1003
+ pluginState.betaUpdateAvailable = false;
1004
+ }
1005
+ return pluginState;
1006
+ }
1007
+ pluginsPackageJson() {
1008
+ return {
1009
+ private: true,
1010
+ name: 'plugins',
1011
+ version: '1.0.0',
1012
+ description: 'camera.ui plugins',
1013
+ dependencies: {},
1014
+ };
1015
+ }
1016
+ async removeSynologyMetadata() {
1017
+ if (!this.configService.PLUGINS_INSTALL_PATH) {
1018
+ return;
1019
+ }
1020
+ const offendingPath = resolve(this.configService.PLUGINS_INSTALL_PATH, '@eaDir');
1021
+ try {
1022
+ if (!(await fs.pathExists(offendingPath))) {
1023
+ await fs.remove(offendingPath);
1024
+ }
1025
+ }
1026
+ catch (error) {
1027
+ this.logger.error(`Failed to remove ${offendingPath}`, error);
1028
+ }
1029
+ }
1030
+ async runNpmCommand(command, cwd, pluginInfo) {
1031
+ // remove synology @eaDir folders from the node_modules
1032
+ await this.removeSynologyMetadata();
1033
+ let timeoutTimer;
1034
+ command = command.filter((x) => x.length);
1035
+ // sudo mode is requested in plugin config
1036
+ if (this.configService.config.plugins.sudo) {
1037
+ command.unshift('sudo', '-E', '-n');
1038
+ }
1039
+ else {
1040
+ // do a pre-check to test for write access when not using sudo mode
1041
+ try {
1042
+ await fs.access(resolve(cwd, 'node_modules'), fs.constants.W_OK);
1043
+ }
1044
+ catch {
1045
+ this.io
1046
+ .of('/logs')
1047
+ .emit(`stdout/${pluginInfo.pluginName}`, yellow(`The user "${userInfo().username}" does not have write access to the target directory:\n\r\n\r`));
1048
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, `${resolve(cwd, 'node_modules')}\n\r\n\r`);
1049
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, yellow('This may cause the operation to fail.\n\r'));
1050
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, yellow('See the docs for details on how to enable sudo mode:\n\r'));
1051
+ }
1052
+ }
1053
+ this.logger.log(`Running Command: ${command.join(' ')}`);
1054
+ if (!satisfies(process.version, `>=${ConfigService.MIN_NODE_VERSION}`)) {
1055
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, yellow(`Node.js v${ConfigService.MIN_NODE_VERSION} higher is required for camera.ui.\n\r`));
1056
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, yellow(`You may experience issues while running on Node.js ${process.version}.\n\r\n\r`));
1057
+ }
1058
+ // set up the environment for the call
1059
+ const env = {};
1060
+ Object.assign(env, process.env);
1061
+ Object.assign(env, {
1062
+ npm_config_global_style: 'true',
1063
+ npm_config_unsafe_perm: 'true',
1064
+ npm_config_update_notifier: 'false',
1065
+ npm_config_prefer_online: 'true',
1066
+ npm_config_foreground_scripts: 'true',
1067
+ npm_config_loglevel: 'error',
1068
+ });
1069
+ // set global prefix for unix based systems
1070
+ if (command.includes('-g') && basename(cwd) === 'lib') {
1071
+ cwd = dirname(cwd);
1072
+ Object.assign(env, {
1073
+ npm_config_prefix: cwd,
1074
+ });
1075
+ }
1076
+ // on windows, we want to ensure the global prefix is the same as the installation path
1077
+ if (platform() === 'win32') {
1078
+ Object.assign(env, {
1079
+ npm_config_prefix: cwd,
1080
+ });
1081
+ }
1082
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, cyan(`\n\rUSER: ${userInfo().username}\n\r`));
1083
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, cyan(`DIR: ${cwd}\n\r`));
1084
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, cyan(`CMD: ${command.join(' ')}\n\r\n\r`));
1085
+ await new Promise((_resolve, _reject) => {
1086
+ const term = pty.spawn(command.shift(), command, {
1087
+ name: 'xterm-color',
1088
+ cols: 80,
1089
+ rows: 30,
1090
+ cwd,
1091
+ env,
1092
+ });
1093
+ // send stdout data from the process to all clients
1094
+ term.onData((data) => {
1095
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, data);
1096
+ });
1097
+ // send an error message to the client if the command does not exit with code 0
1098
+ term.onExit((error) => {
1099
+ clearTimeout(timeoutTimer);
1100
+ if (error.exitCode === 0) {
1101
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, green('\n\rOperation succeeded!.\n\r\n\r'));
1102
+ _resolve(null);
1103
+ }
1104
+ else {
1105
+ this.io.of('/logs').emit(`stdout/${pluginInfo.pluginName}`, red('\n\rOperation failed!.\n\r\n\r'));
1106
+ _reject(new Error('Operation failed. Please review log for details.'));
1107
+ }
1108
+ });
1109
+ // if the command spends to long trying to execute kill it after 5 minutes
1110
+ timeoutTimer = setTimeout(() => {
1111
+ term.kill('SIGTERM');
1112
+ }, 300000);
1113
+ });
1114
+ }
1115
+ async searchNpmRegistrySingle(query) {
1116
+ try {
1117
+ const fromCache = npmPluginCache.get(`lookup-${query}`);
1118
+ let pkg = fromCache;
1119
+ if (!pkg) {
1120
+ const response = await fetchInstance(`https://registry.npmjs.org/${encodeURIComponent(query).replace(/%40/g, '@')}`, {
1121
+ method: 'GET',
1122
+ });
1123
+ pkg = (await response.json());
1124
+ }
1125
+ if (!fromCache) {
1126
+ npmPluginCache.set(`lookup-${query}`, pkg, { ttl: 60 * 1000 });
1127
+ }
1128
+ if (!pkg.keywords || !pkg.keywords.includes('camera-ui-plugin')) {
1129
+ return [];
1130
+ }
1131
+ let plugin;
1132
+ const installedPlugins = this.service.installedPlugins();
1133
+ const isInstalled = installedPlugins.find((installedPlugin) => installedPlugin.pluginName === pkg.name);
1134
+ if (isInstalled) {
1135
+ plugin = isInstalled.info;
1136
+ plugin.lastUpdated = pkg.time.modified;
1137
+ return [plugin];
1138
+ }
1139
+ plugin = {
1140
+ id: '0',
1141
+ pluginName: pkg.name,
1142
+ private: false,
1143
+ displayName: PluginManager.transformDisplaName(pkg.name),
1144
+ description: pkg.description ? pkg.description.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '').trim() : pkg.name,
1145
+ isPython: false,
1146
+ isNode: true,
1147
+ publicPackage: true,
1148
+ latestVersion: pkg['dist-tags'] ? pkg['dist-tags'].latest : undefined,
1149
+ lastUpdated: pkg.time.modified,
1150
+ links: {
1151
+ npm: `https://www.npmjs.com/package/${pkg.name}`,
1152
+ homepage: pkg.homepage,
1153
+ },
1154
+ author: pkg.maintainers[0]?.name,
1155
+ };
1156
+ return [plugin];
1157
+ }
1158
+ catch (error) {
1159
+ if (error.response?.status !== 404) {
1160
+ this.logger.error('Failed to search the npm registry', error);
1161
+ }
1162
+ return [];
1163
+ }
1164
+ }
1165
+ resolvePluginName(params) {
1166
+ if (params.scope) {
1167
+ const at = params.scope.startsWith('@') ? '' : '@';
1168
+ return `${at}${params.scope}/${params.pluginname}`;
1169
+ }
1170
+ else {
1171
+ return params.pluginname;
1172
+ }
1173
+ }
1174
+ isScopedPlugin(pluginName) {
1175
+ return pluginName.charAt(0) === '@' && pluginName.split('/').length > 0 && pluginName.split('/')[1]?.indexOf('camera-ui-') === 0;
1176
+ }
1177
+ }
1178
+ //# sourceMappingURL=plugins.controller.js.map