@camera.ui/server 0.0.50-internal.0 → 0.0.50-internal.2

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 (390) hide show
  1. package/dist/interface/index.html +44 -44
  2. package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.BAIU_p3r.0.0.50-internal.2.js} +1 -1
  3. package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.mdCorqzE.0.0.50-internal.2.js} +1 -1
  4. package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.D0vsSsly.0.0.50-internal.2.js} +1 -1
  5. package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.we5ZpWr2.0.0.50-internal.2.js} +1 -1
  6. package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.9AEBJ3H1.0.0.50-internal.2.js} +1 -1
  7. package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.CZcnEH0C.0.0.50-internal.2.js} +1 -1
  8. package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.DE0LkcGu.0.0.50-internal.2.js} +2 -2
  9. package/dist/interface/js/Cammesh.CVvmkelB.0.0.50-internal.2.js +1 -0
  10. package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.CUr4pGoU.0.0.50-internal.2.js} +1 -1
  11. package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.CaJhu4fF.0.0.50-internal.2.js} +2 -2
  12. package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.5VUmgryj.0.0.50-internal.2.js} +1 -1
  13. package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.iYmUxAR5.0.0.50-internal.2.js} +1 -1
  14. package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.DXPyE5mF.0.0.50-internal.2.js} +1 -1
  15. package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.BqtlOFnV.0.0.50-internal.2.js} +1 -1
  16. package/dist/interface/js/{FirstSteps.b-nvymgb.0.0.50-internal.0.js → FirstSteps.C_RI-SDQ.0.0.50-internal.2.js} +1 -1
  17. package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.Ch_v02eN.0.0.50-internal.2.js} +1 -1
  18. package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.BpXAYgSG.0.0.50-internal.2.js} +1 -1
  19. package/dist/interface/js/Recordings.CIKHJytH.0.0.50-internal.2.js +1 -0
  20. package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.BcLoGNEy.0.0.50-internal.2.js} +1 -1
  21. package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.DMROW8kx.0.0.50-internal.2.js} +1 -1
  22. package/dist/interface/js/SettingsAppearance.CUaHpihp.0.0.50-internal.2.js +1 -0
  23. package/dist/interface/js/{SettingsAppearance.vue_vue_type_script_setup_true_lang.CBQ6lL3T.0.0.50-internal.0.js → SettingsAppearance.vue_vue_type_script_setup_true_lang.BuKZ-Uco.0.0.50-internal.2.js} +1 -1
  24. package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.0QdwFSpv.0.0.50-internal.2.js} +1 -1
  25. package/dist/interface/js/SettingsRecordings.B-aj0U8_.0.0.50-internal.2.js +1 -0
  26. package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.Bi1YAJ76.0.0.50-internal.2.js} +1 -1
  27. package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.CAx66Iir.0.0.50-internal.2.js} +1 -1
  28. package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.CQcDtGy1.0.0.50-internal.2.js} +1 -1
  29. package/dist/interface/js/{VersionsHandler.vue_vue_type_script_setup_true_lang.xDishkkS.0.0.50-internal.0.js → VersionsHandler.vue_vue_type_script_setup_true_lang.BhXMzIhV.0.0.50-internal.2.js} +1 -1
  30. package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0sCXSu5.0.0.50-internal.2.js} +2 -2
  31. package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.DNqPWa0Q.0.0.50-internal.2.js} +1 -1
  32. package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.DAXgG3bP.0.0.50-internal.2.js} +1 -1
  33. package/dist/interface/js/{chart.js.CP_nMnnf.0.0.50-internal.0.js → chart.js.Bq3YocRX.0.0.50-internal.2.js} +1 -1
  34. package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.9rxyNw0z.0.0.50-internal.2.js} +1 -1
  35. package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.BuEvHAsS.0.0.50-internal.2.js} +1 -1
  36. package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.DUdE08x8.0.0.50-internal.2.js} +1 -1
  37. package/dist/interface/js/{engine.io-client.kITRnq-g.0.0.50-internal.0.js → engine.io-client.DWU6YI8o.0.0.50-internal.2.js} +1 -1
  38. package/dist/interface/js/{fast-deep-equal.Bpc9mIsj.0.0.50-internal.0.js → fast-deep-equal.BpPyC6E4.0.0.50-internal.2.js} +1 -1
  39. package/dist/interface/js/{highlight.js.BlSXU-Wb.0.0.50-internal.0.js → highlight.js.BoR2Rhdd.0.0.50-internal.2.js} +1 -1
  40. package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BXzPONHs.0.0.50-internal.2.js} +1 -1
  41. package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.DwcBYfWc.0.0.50-internal.2.js} +3 -3
  42. package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.BUDVOjPt.0.0.50-internal.2.js} +1 -1
  43. package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CsG-OBoI.0.0.50-internal.2.js} +1 -1
  44. package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CqEQao5R.0.0.50-internal.2.js} +1 -1
  45. package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.D91sslRx.0.0.50-internal.2.js} +1 -1
  46. package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.SdSTPzZO.0.0.50-internal.2.js} +1 -1
  47. package/dist/interface/js/{react-dnd-touch-backend.BA4WhUJo.0.0.50-internal.0.js → react-dnd-touch-backend.BwroebQ4.0.0.50-internal.2.js} +1 -1
  48. package/dist/interface/js/{refresh-rounded.D_SmhhUf.0.0.50-internal.0.js → refresh-rounded.DxM48YSv.0.0.50-internal.2.js} +1 -1
  49. package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.Cmpbnzo4.0.0.50-internal.2.js} +1 -1
  50. package/dist/interface/js/{socket.io-client.DKrRxgjP.0.0.50-internal.0.js → socket.io-client.DF2YgZo1.0.0.50-internal.2.js} +1 -1
  51. package/dist/interface/js/{socket.io-parser.EXj3YDH2.0.0.50-internal.0.js → socket.io-parser.BUs2ineY.0.0.50-internal.2.js} +1 -1
  52. package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.DmkT2LKx.0.0.50-internal.2.js} +1 -1
  53. package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.dPzyZDVa.0.0.50-internal.2.js} +1 -1
  54. package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.y2ZlFveS.0.0.50-internal.2.js} +1 -1
  55. package/dist/interface/js/{vee-validate.BeiObIH8.0.0.50-internal.0.js → vee-validate.Y-alCADW.0.0.50-internal.2.js} +1 -1
  56. package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.sRVFTqDf.0.0.50-internal.2.js} +1 -1
  57. package/dist/interface/js/{vue-i18n.BW2bx_6z.0.0.50-internal.0.js → vue-i18n.D5WrXOZa.0.0.50-internal.2.js} +1 -1
  58. package/dist/interface/js/{vue-inline-svg.BJkQGmKz.0.0.50-internal.0.js → vue-inline-svg.R0uz_abA.0.0.50-internal.2.js} +1 -1
  59. package/dist/interface/js/{vue-router.B2mOXHaC.0.0.50-internal.0.js → vue-router.65mnGy-o.0.0.50-internal.2.js} +1 -1
  60. package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.B1Qop6Uu.0.0.50-internal.2.js} +1 -1
  61. package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.CwmyAcir.0.0.50-internal.2.js} +1 -1
  62. package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.CMPALvRh.0.0.50-internal.2.js} +1 -1
  63. package/dist/interface/sw.js +1 -1
  64. package/dist/server/package.json +1 -1
  65. package/dist/server/src/rpc/server.js +4 -1
  66. package/dist/server/src/rpc/server.js.map +1 -1
  67. package/package.json +1 -1
  68. package/.prettierignore +0 -12
  69. package/.prettierrc.json +0 -12
  70. package/artillery.yaml +0 -29
  71. package/bin/cameraui-server.ts +0 -11
  72. package/dist/interface/js/Cammesh.D-6dAROQ.0.0.50-internal.0.js +0 -1
  73. package/dist/interface/js/Recordings.DhxjIW7e.0.0.50-internal.0.js +0 -1
  74. package/dist/interface/js/SettingsAppearance.DsTjKXk1.0.0.50-internal.0.js +0 -1
  75. package/dist/interface/js/SettingsRecordings.DgW7M0jj.0.0.50-internal.0.js +0 -1
  76. package/eslint.config.js +0 -103
  77. package/localdeps.txt +0 -10
  78. package/mypy.ini +0 -30
  79. package/requirements.txt +0 -15
  80. package/ruff.toml +0 -90
  81. package/src/__init__.py +0 -0
  82. package/src/_camera_ui_tools/__init__.py +0 -0
  83. package/src/_camera_ui_tools/__pycache__/__init__.cpython-311.pyc +0 -0
  84. package/src/api/controllers/api.controller.ts +0 -19
  85. package/src/api/controllers/auth.controller.ts +0 -294
  86. package/src/api/controllers/backup.controller.ts +0 -72
  87. package/src/api/controllers/cameras.controller.ts +0 -1029
  88. package/src/api/controllers/config.controller.ts +0 -102
  89. package/src/api/controllers/files.controller.ts +0 -35
  90. package/src/api/controllers/frameWorkers.controller.ts +0 -109
  91. package/src/api/controllers/plugins.controller.ts +0 -1206
  92. package/src/api/controllers/system.controller.ts +0 -273
  93. package/src/api/controllers/users.controller.ts +0 -648
  94. package/src/api/database/checks.ts +0 -268
  95. package/src/api/database/constants.ts +0 -8
  96. package/src/api/database/index.ts +0 -262
  97. package/src/api/database/migration.ts +0 -62
  98. package/src/api/database/selfcheck.ts +0 -492
  99. package/src/api/database/types.ts +0 -104
  100. package/src/api/go2rtc/api/application.ts +0 -48
  101. package/src/api/go2rtc/api/config.ts +0 -61
  102. package/src/api/go2rtc/api/discover.ts +0 -197
  103. package/src/api/go2rtc/api/index.ts +0 -49
  104. package/src/api/go2rtc/api/snapshot.ts +0 -44
  105. package/src/api/go2rtc/api/streams.ts +0 -168
  106. package/src/api/go2rtc/index.ts +0 -43
  107. package/src/api/go2rtc/queue.ts +0 -50
  108. package/src/api/go2rtc/types.ts +0 -174
  109. package/src/api/index.ts +0 -286
  110. package/src/api/middlewares/authPermission.middleware.ts +0 -46
  111. package/src/api/middlewares/authValidation.middleware.ts +0 -160
  112. package/src/api/middlewares/pagination.middleware.ts +0 -67
  113. package/src/api/middlewares/socketAuth.middleware.ts +0 -136
  114. package/src/api/plugins/header.plugin.ts +0 -15
  115. package/src/api/plugins/logger.plugin.ts +0 -44
  116. package/src/api/plugins/proxy.plugin.ts +0 -255
  117. package/src/api/plugins/socket.plugin.ts +0 -28
  118. package/src/api/plugins/system.plugin.ts +0 -48
  119. package/src/api/plugins/useragent.plugin.ts +0 -19
  120. package/src/api/routes/api.routes.ts +0 -10
  121. package/src/api/routes/auth.routes.ts +0 -56
  122. package/src/api/routes/backup.routes.ts +0 -28
  123. package/src/api/routes/cameras.routes.ts +0 -281
  124. package/src/api/routes/config.routes.ts +0 -66
  125. package/src/api/routes/files.routes.ts +0 -15
  126. package/src/api/routes/frameWorkers.routes.ts +0 -39
  127. package/src/api/routes/index.ts +0 -37
  128. package/src/api/routes/plugins.routes.ts +0 -420
  129. package/src/api/routes/system.routes.ts +0 -101
  130. package/src/api/routes/users.routes.ts +0 -167
  131. package/src/api/schemas/backup.schema.ts +0 -112
  132. package/src/api/schemas/cameras.schema.ts +0 -479
  133. package/src/api/schemas/config.schema.ts +0 -38
  134. package/src/api/schemas/go2rtc.schema.ts +0 -189
  135. package/src/api/schemas/plugins.schema.ts +0 -126
  136. package/src/api/schemas/storage.schema.ts +0 -11
  137. package/src/api/schemas/system.schema.ts +0 -45
  138. package/src/api/schemas/users.schema.ts +0 -185
  139. package/src/api/services/auth.service.ts +0 -210
  140. package/src/api/services/backup.service.ts +0 -144
  141. package/src/api/services/cameras.service.ts +0 -671
  142. package/src/api/services/plugins.service.ts +0 -470
  143. package/src/api/services/system.service.ts +0 -85
  144. package/src/api/services/users.service.ts +0 -276
  145. package/src/api/types/index.ts +0 -675
  146. package/src/api/utils/cert.ts +0 -254
  147. package/src/api/utils/constants.ts +0 -17
  148. package/src/api/utils/fetch.ts +0 -21
  149. package/src/api/utils/moveFiles.ts +0 -45
  150. package/src/api/utils/parse.ts +0 -17
  151. package/src/api/websocket/index.ts +0 -110
  152. package/src/api/websocket/nsp/logs.ts +0 -240
  153. package/src/api/websocket/nsp/main.ts +0 -27
  154. package/src/api/websocket/nsp/metrics.ts +0 -301
  155. package/src/api/websocket/nsp/notifications.ts +0 -43
  156. package/src/api/websocket/nsp/plugins.ts +0 -37
  157. package/src/api/websocket/nsp/server.ts +0 -220
  158. package/src/api/websocket/nsp/status.ts +0 -77
  159. package/src/api/websocket/types.ts +0 -55
  160. package/src/api.ts +0 -163
  161. package/src/camera/classes.ts +0 -32
  162. package/src/camera/controller.ts +0 -579
  163. package/src/camera/device.ts +0 -422
  164. package/src/camera/frameWorker.ts +0 -403
  165. package/src/camera/index.ts +0 -679
  166. package/src/camera/interfaces.ts +0 -95
  167. package/src/camera/iou.ts +0 -153
  168. package/src/camera/polygon.ts +0 -226
  169. package/src/camera/python/__init__.py +0 -0
  170. package/src/camera/python/__pycache__/__init__.cpython-311.pyc +0 -0
  171. package/src/camera/python/__pycache__/classes.cpython-311.pyc +0 -0
  172. package/src/camera/python/__pycache__/delegate_controller.cpython-311.pyc +0 -0
  173. package/src/camera/python/__pycache__/interfaces.cpython-311.pyc +0 -0
  174. package/src/camera/python/__pycache__/iou.cpython-310.pyc +0 -0
  175. package/src/camera/python/__pycache__/iou.cpython-311.pyc +0 -0
  176. package/src/camera/python/__pycache__/iou2.cpython-310.pyc +0 -0
  177. package/src/camera/python/__pycache__/polygon.cpython-311.pyc +0 -0
  178. package/src/camera/python/__pycache__/typings.cpython-311.pyc +0 -0
  179. package/src/camera/python/__pycache__/video_frame.cpython-311.pyc +0 -0
  180. package/src/camera/python/classes.py +0 -41
  181. package/src/camera/python/interfaces.py +0 -130
  182. package/src/camera/python/iou.py +0 -158
  183. package/src/camera/python/polygon.py +0 -230
  184. package/src/camera/python/test/__pycache__/polygon.cpython-310.pyc +0 -0
  185. package/src/camera/python/test/iou_test.py +0 -799
  186. package/src/camera/python/test/polygon.py +0 -238
  187. package/src/camera/python/test/polygon_test.py +0 -256
  188. package/src/camera/python/test/polygon_test2.py +0 -484
  189. package/src/camera/python/typings.py +0 -50
  190. package/src/camera/python/video_frame.py +0 -143
  191. package/src/camera/session.ts +0 -192
  192. package/src/camera/streaming/fmp4-session.ts +0 -390
  193. package/src/camera/streaming/peer-connection.ts +0 -273
  194. package/src/camera/streaming/rtsp-session.ts +0 -331
  195. package/src/camera/streaming/webrtc-connection.ts +0 -260
  196. package/src/camera/streaming/werift-session.ts +0 -317
  197. package/src/camera/test/iou_test.ts +0 -761
  198. package/src/camera/test/polygon.test.ts +0 -611
  199. package/src/camera/test/polygon_test.ts +0 -210
  200. package/src/camera/types.ts +0 -48
  201. package/src/camera/utils.ts +0 -489
  202. package/src/camera/videoFrame.ts +0 -123
  203. package/src/cloud/index.ts +0 -61
  204. package/src/cloud/remote/cloudflare.ts +0 -18
  205. package/src/cloud/remote/upnp.ts +0 -18
  206. package/src/cloud/remote/utils.ts +0 -24
  207. package/src/cloud/types.ts +0 -16
  208. package/src/decoder/child.ts +0 -883
  209. package/src/decoder/imageUtils.ts +0 -275
  210. package/src/decoder/manager.ts +0 -251
  211. package/src/decoder/python/__init__.py +0 -0
  212. package/src/decoder/python/__pycache__/__init__.cpython-311.pyc +0 -0
  213. package/src/decoder/python/__pycache__/image_utils.cpython-311.pyc +0 -0
  214. package/src/decoder/python/__pycache__/typings.cpython-311.pyc +0 -0
  215. package/src/decoder/python/__pycache__/utils.cpython-311.pyc +0 -0
  216. package/src/decoder/python/child.py +0 -903
  217. package/src/decoder/python/image_utils.py +0 -196
  218. package/src/decoder/python/pool.py +0 -45
  219. package/src/decoder/python/test/group.py +0 -62
  220. package/src/decoder/python/test/motion.mp4 +0 -0
  221. package/src/decoder/python/test/motion2.mp4 +0 -0
  222. package/src/decoder/python/test/opencl.cl +0 -70
  223. package/src/decoder/python/test/opencl2.cl +0 -130
  224. package/src/decoder/python/test/test.py +0 -427
  225. package/src/decoder/python/test/test1.jpg +0 -0
  226. package/src/decoder/python/test/test1_resized.jpg +0 -0
  227. package/src/decoder/python/test/test2.jpg +0 -0
  228. package/src/decoder/python/test/test2.py +0 -451
  229. package/src/decoder/python/test/test2_resized.jpg +0 -0
  230. package/src/decoder/python/test/test3.jpg +0 -0
  231. package/src/decoder/python/test/utils.py +0 -50
  232. package/src/decoder/python/typings.py +0 -57
  233. package/src/decoder/python/utils.py +0 -70
  234. package/src/decoder/test/child.ts +0 -117
  235. package/src/decoder/test/ffmpeg.ts +0 -371
  236. package/src/decoder/test/test.ts +0 -182
  237. package/src/decoder/types.ts +0 -27
  238. package/src/decoder/utils.ts +0 -64
  239. package/src/decoder/wasm/asconfig.json +0 -28
  240. package/src/decoder/wasm/assembly/console.ts +0 -1
  241. package/src/decoder/wasm/assembly/index.ts +0 -890
  242. package/src/decoder/wasm/build/decoder.d.ts +0 -43
  243. package/src/decoder/wasm/build/decoder.js +0 -108
  244. package/src/decoder/wasm/build/decoder.wasm +0 -0
  245. package/src/decoder/wasm/tsconfig.json +0 -5
  246. package/src/decoder/worker.ts +0 -113
  247. package/src/go2rtc/index.ts +0 -324
  248. package/src/go2rtc/types.ts +0 -88
  249. package/src/main.ts +0 -267
  250. package/src/manager/coreManager.ts +0 -78
  251. package/src/manager/deviceManager.ts +0 -132
  252. package/src/manager/types.ts +0 -17
  253. package/src/plugins/index.ts +0 -443
  254. package/src/plugins/plugin.ts +0 -177
  255. package/src/plugins/runtime/base.ts +0 -282
  256. package/src/plugins/runtime/index.ts +0 -15
  257. package/src/plugins/runtime/node/child.ts +0 -193
  258. package/src/plugins/runtime/node/index.ts +0 -67
  259. package/src/plugins/runtime/node/plugin.ts +0 -122
  260. package/src/plugins/runtime/node/pluginApi.ts +0 -27
  261. package/src/plugins/runtime/node/proxy/cameraDevice.ts +0 -299
  262. package/src/plugins/runtime/node/proxy/coreManager.ts +0 -128
  263. package/src/plugins/runtime/node/proxy/deviceManager.ts +0 -187
  264. package/src/plugins/runtime/node/storage.ts +0 -312
  265. package/src/plugins/runtime/node/storageController.ts +0 -91
  266. package/src/plugins/runtime/python/__init__.py +0 -0
  267. package/src/plugins/runtime/python/__pycache__/__init__.cpython-311.pyc +0 -0
  268. package/src/plugins/runtime/python/__pycache__/camera_storage.cpython-311.pyc +0 -0
  269. package/src/plugins/runtime/python/__pycache__/config_service.cpython-311.pyc +0 -0
  270. package/src/plugins/runtime/python/__pycache__/constants.cpython-311.pyc +0 -0
  271. package/src/plugins/runtime/python/__pycache__/ipc.cpython-311.pyc +0 -0
  272. package/src/plugins/runtime/python/__pycache__/logger.cpython-311.pyc +0 -0
  273. package/src/plugins/runtime/python/__pycache__/message_queue.cpython-311.pyc +0 -0
  274. package/src/plugins/runtime/python/__pycache__/namespaces.cpython-311.pyc +0 -0
  275. package/src/plugins/runtime/python/__pycache__/plugin.cpython-311.pyc +0 -0
  276. package/src/plugins/runtime/python/__pycache__/plugin_api.cpython-311.pyc +0 -0
  277. package/src/plugins/runtime/python/__pycache__/plugin_logger.cpython-311.pyc +0 -0
  278. package/src/plugins/runtime/python/__pycache__/proxy_utils.cpython-311.pyc +0 -0
  279. package/src/plugins/runtime/python/__pycache__/schema.cpython-311.pyc +0 -0
  280. package/src/plugins/runtime/python/__pycache__/storage.cpython-311.pyc +0 -0
  281. package/src/plugins/runtime/python/__pycache__/storage_controller.cpython-311.pyc +0 -0
  282. package/src/plugins/runtime/python/__pycache__/typings.cpython-311.pyc +0 -0
  283. package/src/plugins/runtime/python/child.py +0 -248
  284. package/src/plugins/runtime/python/index.ts +0 -73
  285. package/src/plugins/runtime/python/namespaces.py +0 -101
  286. package/src/plugins/runtime/python/plugin.py +0 -155
  287. package/src/plugins/runtime/python/plugin_api.py +0 -29
  288. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-310.pyc +0 -0
  289. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-311.pyc +0 -0
  290. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-38.pyc +0 -0
  291. package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-39.pyc +0 -0
  292. package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-311.pyc +0 -0
  293. package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-39.pyc +0 -0
  294. package/src/plugins/runtime/python/proxy/__pycache__/core_manager.cpython-311.pyc +0 -0
  295. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-310.pyc +0 -0
  296. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-311.pyc +0 -0
  297. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-38.pyc +0 -0
  298. package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-39.pyc +0 -0
  299. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-310.pyc +0 -0
  300. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-311.pyc +0 -0
  301. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-38.pyc +0 -0
  302. package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-39.pyc +0 -0
  303. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-310.pyc +0 -0
  304. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-311.pyc +0 -0
  305. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-38.pyc +0 -0
  306. package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-39.pyc +0 -0
  307. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-310.pyc +0 -0
  308. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-311.pyc +0 -0
  309. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-38.pyc +0 -0
  310. package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-39.pyc +0 -0
  311. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-310.pyc +0 -0
  312. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-311.pyc +0 -0
  313. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-38.pyc +0 -0
  314. package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-39.pyc +0 -0
  315. package/src/plugins/runtime/python/proxy/camera_device.py +0 -1732
  316. package/src/plugins/runtime/python/proxy/core_manager.py +0 -126
  317. package/src/plugins/runtime/python/proxy/device_manager.py +0 -197
  318. package/src/plugins/runtime/python/schema.py +0 -99
  319. package/src/plugins/runtime/python/storage.py +0 -353
  320. package/src/plugins/runtime/python/storage_controller.py +0 -102
  321. package/src/plugins/runtime/python/typings.py +0 -195
  322. package/src/plugins/schema.ts +0 -472
  323. package/src/plugins/types.ts +0 -60
  324. package/src/plugins/worker.ts +0 -250
  325. package/src/rpc/index.ts +0 -149
  326. package/src/rpc/namespaces.ts +0 -79
  327. package/src/rpc/server.ts +0 -422
  328. package/src/rpc/types.ts +0 -119
  329. package/src/rpc/utils.ts +0 -16
  330. package/src/services/config/constants.ts +0 -47
  331. package/src/services/config/defaults.ts +0 -57
  332. package/src/services/config/index.ts +0 -744
  333. package/src/services/config/types.ts +0 -211
  334. package/src/services/logger/index.ts +0 -96
  335. package/src/types.ts +0 -47
  336. package/src/utils/path.ts +0 -16
  337. package/src/utils/pythonInstaller.ts +0 -597
  338. package/tsconfig.json +0 -37
  339. package/types/fastify.d.ts +0 -14
  340. package/updates.config.js +0 -3
  341. /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.50-internal.0.css → @xterm.DYP7pi_n.0.0.50-internal.2.css} +0 -0
  342. /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.2.css} +0 -0
  343. /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.2.css} +0 -0
  344. /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.2.css} +0 -0
  345. /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.2.css} +0 -0
  346. /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.2.css} +0 -0
  347. /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.2.css} +0 -0
  348. /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.2.css} +0 -0
  349. /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.2.css} +0 -0
  350. /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.2.css} +0 -0
  351. /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.2.css} +0 -0
  352. /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.2.css} +0 -0
  353. /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.2.css} +0 -0
  354. /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.2.png} +0 -0
  355. /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.2.png} +0 -0
  356. /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.2.png} +0 -0
  357. /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.2.css} +0 -0
  358. /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.2.js} +0 -0
  359. /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.2.js} +0 -0
  360. /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.2.js} +0 -0
  361. /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.2.js} +0 -0
  362. /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.2.js} +0 -0
  363. /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  364. /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.2.js} +0 -0
  365. /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.2.js} +0 -0
  366. /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.2.js} +0 -0
  367. /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.2.js} +0 -0
  368. /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.2.js} +0 -0
  369. /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.2.js} +0 -0
  370. /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.C-5Lxnx_.0.0.50-internal.2.js} +0 -0
  371. /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.2.js} +0 -0
  372. /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  373. /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.2.js} +0 -0
  374. /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.2.js} +0 -0
  375. /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.50-internal.0.js → engine.io-parser.BiEtp6m2.0.0.50-internal.2.js} +0 -0
  376. /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.2.js} +0 -0
  377. /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.50-internal.0.js → ev-emitter.X5f1qa-c.0.0.50-internal.2.js} +0 -0
  378. /package/dist/interface/js/{get-size.D1dS-IaP.0.0.50-internal.0.js → get-size.D1dS-IaP.0.0.50-internal.2.js} +0 -0
  379. /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  380. /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.2.js} +0 -0
  381. /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  382. /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.2.js} +0 -0
  383. /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.2.js} +0 -0
  384. /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.0.js → react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.2.js} +0 -0
  385. /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.2.js} +0 -0
  386. /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.2.js} +0 -0
  387. /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.2.js} +0 -0
  388. /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.2.js} +0 -0
  389. /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.2.js} +0 -0
  390. /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.2.js} +0 -0
package/eslint.config.js DELETED
@@ -1,103 +0,0 @@
1
- import jsLint from '@eslint/js';
2
- import stylistic from '@stylistic/eslint-plugin';
3
- import tsParser from '@typescript-eslint/parser';
4
- import globals from 'globals';
5
- import tsLint from 'typescript-eslint';
6
-
7
- export default [
8
- {
9
- files: ['**/*.{js,mjs,cjs,ts,mts}'],
10
- },
11
- {
12
- ignores: ['**/dist/**', '**/node_modules/**', '**/public/**', '**/build/**', '**/bundle/**', '**/test/**', '**/wasm/**', '**/example/**'],
13
- },
14
- jsLint.configs.recommended,
15
- // ...tsLint.configs.recommended,
16
- ...tsLint.configs.recommendedTypeChecked,
17
- ...tsLint.configs.stylisticTypeChecked,
18
- stylistic.configs['disable-legacy'],
19
- stylistic.configs.customize({
20
- indent: 2,
21
- quotes: 'single',
22
- semi: true,
23
- commaDangle: 'always-multiline',
24
- jsx: false,
25
- arrowParens: true,
26
- braceStyle: '1tbs',
27
- blockSpacing: true,
28
- quoteProps: 'as-needed',
29
- }),
30
- {
31
- languageOptions: {
32
- globals: { ...globals.node },
33
- parser: tsParser,
34
- parserOptions: {
35
- projectService: true,
36
- tsconfigRootDir: import.meta.dirname,
37
- },
38
- },
39
-
40
- rules: {
41
- // TypeScript specific rules
42
- '@typescript-eslint/consistent-type-imports': 'error',
43
- '@typescript-eslint/await-thenable': 'error',
44
- '@typescript-eslint/no-explicit-any': 'off',
45
- '@typescript-eslint/no-unused-vars': ['error'],
46
- '@typescript-eslint/no-unsafe-assignment': 'off',
47
- '@typescript-eslint/no-unsafe-member-access': 'off',
48
- '@typescript-eslint/no-unsafe-argument': 'off',
49
- '@typescript-eslint/no-unsafe-return': 'off',
50
- '@typescript-eslint/require-await': 'off',
51
- '@typescript-eslint/no-floating-promises': 'off',
52
- '@typescript-eslint/prefer-promise-reject-errors': 'off',
53
- '@typescript-eslint/no-misused-promises': 'off',
54
- '@typescript-eslint/ban-ts-comment': 'off',
55
- '@typescript-eslint/no-empty-function': 'off',
56
- '@typescript-eslint/restrict-template-expressions': 'off',
57
- '@typescript-eslint/no-unsafe-call': 'off',
58
- '@typescript-eslint/no-empty-object-type': 'off',
59
- '@typescript-eslint/no-unsafe-function-type': 'off',
60
- '@typescript-eslint/no-unsafe-declaration-merging': 'off',
61
- '@typescript-eslint/prefer-for-of': 'off',
62
- '@typescript-eslint/prefer-find': 'off',
63
- '@typescript-eslint/no-require-imports': 'off',
64
- '@typescript-eslint/no-redundant-type-constituents': 'off',
65
- '@typescript-eslint/no-namespace': 'off',
66
- '@stylistic/generator-star-spacing': ['error', { before: true, after: false }],
67
-
68
- // Stylistic specific rules
69
- '@stylistic/max-len': ['error', { code: 170, tabWidth: 2 }],
70
- '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
71
- '@stylistic/operator-linebreak': 'off',
72
- '@stylistic/comma-dangle': [
73
- 'error',
74
- {
75
- arrays: 'always-multiline',
76
- objects: 'always-multiline',
77
- imports: 'always-multiline',
78
- exports: 'only-multiline',
79
- functions: 'always-multiline',
80
- enums: 'always-multiline',
81
- generics: 'always-multiline',
82
- tuples: 'always-multiline',
83
- },
84
- ],
85
-
86
- semi: [1, 'always'],
87
- // quotes: ['error', 'single'],
88
- 'comma-dangle': ['error', 'only-multiline'],
89
- 'no-multiple-empty-lines': ['warn', { max: 1, maxEOF: 0 }],
90
- 'eol-last': ['error', 'always'],
91
- 'space-before-function-paren': ['error', { named: 'never' }],
92
-
93
- 'no-unused-vars': 'off',
94
- 'no-case-declarations': 'off',
95
- 'no-async-promise-executor': 'off',
96
- 'no-control-regex': 'off',
97
- },
98
- },
99
- {
100
- files: ['**/*.js', '**/*.cjs', '**/*.mjs', '*.d.ts', '*.config.ts'],
101
- ...tsLint.configs.disableTypeChecked,
102
- },
103
- ];
package/localdeps.txt DELETED
@@ -1,10 +0,0 @@
1
- ../packages/common
2
- ../packages/ffmpeg
3
- ../packages/go2rtc
4
- ../packages/nats
5
- ../packages/rpc/client/node
6
- ../packages/rpc/common
7
- ../packages/rpc/server
8
- ../packages/rtsp
9
- ../packages/rust-decoder
10
- ../packages/types
package/mypy.ini DELETED
@@ -1,30 +0,0 @@
1
- [mypy]
2
- ; Ensure full coverage
3
- disallow_untyped_calls = True
4
- disallow_untyped_defs = True
5
- disallow_incomplete_defs = True
6
- disallow_untyped_decorators = True
7
- check_untyped_defs = True
8
-
9
- ; Restrict dynamic typing
10
- disallow_any_generics = True
11
- disallow_subclassing_any = False
12
- warn_return_any = True
13
-
14
- ; Know exactly what you're doing
15
- warn_redundant_casts = True
16
- warn_unused_ignores = False
17
- warn_unused_configs = True
18
- warn_unreachable = True
19
- show_error_codes = True
20
-
21
- ; Explicit is better than implicit
22
- no_implicit_optional = True
23
-
24
- # Allows Type[T] to refer to abstract classes, which is not otherwise supported.
25
- # See https://github.com/python/mypy/issues/4717
26
- disable_error_code = import-untyped,unused-ignore,no-any-return,redundant-cast,typeddict-item,type-abstract
27
- exclude = test
28
- mypy_path = $MYPY_CONFIG_FILE_DIR/src
29
- explicit_package_bases = True
30
- namespace_packages = True
package/requirements.txt DELETED
@@ -1,15 +0,0 @@
1
- camera-ui-python-types==2.0.3
2
- camera-ui-python-common==2.0.2
3
- nats-py==2.10.0
4
- deepdiff==8.4.2
5
- pyeecui==12.1.4
6
- reactivex==4.0.4
7
- numpy==1.26.4
8
- lmdbm==0.0.6
9
- lmdb==1.6.2
10
- msgpack==1.1.0
11
- cachetools==5.5.2
12
- aiohttp==3.11.18
13
- Pillow==11.2.1
14
- virtualenv==20.30.0
15
- setproctitle==1.3.6
package/ruff.toml DELETED
@@ -1,90 +0,0 @@
1
- # Exclude a variety of commonly ignored directories.
2
- exclude = [
3
- ".bzr",
4
- ".direnv",
5
- ".eggs",
6
- ".git",
7
- ".git-rewrite",
8
- ".hg",
9
- ".ipynb_checkpoints",
10
- ".mypy_cache",
11
- ".nox",
12
- ".pants.d",
13
- ".pyenv",
14
- ".pytest_cache",
15
- ".pytype",
16
- ".ruff_cache",
17
- ".svn",
18
- ".tox",
19
- ".venv",
20
- ".vscode",
21
- "__pypackages__",
22
- "_build",
23
- "buck-out",
24
- "build",
25
- "dist",
26
- "node_modules",
27
- "site-packages",
28
- "venv",
29
- ]
30
-
31
- # Same as Black.
32
- line-length = 110
33
- indent-width = 4
34
-
35
- # Assume Python 3.8
36
- target-version = "py39"
37
-
38
- [lint]
39
- # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
40
- # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
41
- # McCabe complexity (`C901`) by default.
42
- select = [
43
- # pycodestyle
44
- "E",
45
- # Pyflakes
46
- "F",
47
- # pyupgrade
48
- "UP",
49
- # flake8-bugbear
50
- "B",
51
- # flake8-simplify
52
- "SIM",
53
- # isort
54
- "I",
55
- ]
56
- ignore = ["E501", "B023", "B006"]
57
-
58
- # Allow fix for all enabled rules (when `--fix`) is provided.
59
- fixable = ["ALL"]
60
- unfixable = []
61
-
62
- # Allow unused variables when underscore-prefixed.
63
- dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
64
-
65
- [format]
66
- # Like Black, use double quotes for strings.
67
- quote-style = "double"
68
-
69
- # Like Black, indent with spaces, rather than tabs.
70
- indent-style = "space"
71
-
72
- # Like Black, respect magic trailing commas.
73
- skip-magic-trailing-comma = false
74
-
75
- # Like Black, automatically detect the appropriate line ending.
76
- line-ending = "auto"
77
-
78
- # Enable auto-formatting of code examples in docstrings. Markdown,
79
- # reStructuredText code/literal blocks and doctests are all supported.
80
- #
81
- # This is currently disabled by default, but it is planned for this
82
- # to be opt-out in the future.
83
- docstring-code-format = true
84
-
85
- # Set the line length limit used when formatting code snippets in
86
- # docstrings.
87
- #
88
- # This only has an effect when the `docstring-code-format` setting is
89
- # enabled.
90
- docstring-code-line-length = "dynamic"
package/src/__init__.py DELETED
File without changes
File without changes
@@ -1,19 +0,0 @@
1
- import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
2
-
3
- import { ConfigService } from '../../services/config/index.js';
4
-
5
- export class ApiController {
6
- private app: FastifyInstance;
7
-
8
- constructor(app: FastifyInstance) {
9
- this.app = app;
10
- }
11
-
12
- public welcome(req: FastifyRequest, reply: FastifyReply): FastifyReply {
13
- return reply.code(200).send({ message: 'Welcome to camera.ui API', version: ConfigService.VERSION });
14
- }
15
-
16
- public async health(req: FastifyRequest, reply: FastifyReply): Promise<FastifyReply> {
17
- return reply.code(200).send({ status: 'ok' });
18
- }
19
- }
@@ -1,294 +0,0 @@
1
- import jwt from 'jsonwebtoken';
2
- import { container } from 'tsyringe';
3
-
4
- import { AuthService } from '../services/auth.service.js';
5
- import { UsersService } from '../services/users.service.js';
6
- import { REFRESH_TOKEN } from '../types/index.js';
7
- import { parseJwt } from '../utils/parse.js';
8
-
9
- import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
10
- import type { ConfigService } from '../../services/config/index.js';
11
- import type {
12
- AuthLoginRequest,
13
- AuthNewLoginRequest,
14
- AuthParamsRequest,
15
- AuthRefreshRequest,
16
- ClientData,
17
- JwtPayload,
18
- JwtRefreshPayload,
19
- JwtRefreshTokenDecoded,
20
- JwtTokenClientData,
21
- JwtTokenEncoded,
22
- JwtTokenResponse,
23
- PaginationRequest,
24
- UserData,
25
- } from '../types/index.js';
26
-
27
- export class AuthController {
28
- private app: FastifyInstance;
29
- private configService: ConfigService;
30
- private service: AuthService;
31
- private userService: UsersService;
32
-
33
- constructor(app: FastifyInstance) {
34
- this.app = app;
35
- this.configService = container.resolve<ConfigService>('configService');
36
- this.service = new AuthService();
37
- this.userService = new UsersService();
38
- }
39
-
40
- public check(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): FastifyReply {
41
- try {
42
- return reply.code(200).send({
43
- status: 'OK',
44
- });
45
- } catch (error: any) {
46
- return reply.code(500).send({
47
- statusCode: 500,
48
- message: error.message,
49
- });
50
- }
51
- }
52
-
53
- public list(req: FastifyRequest<AuthLoginRequest & PaginationRequest>, reply: FastifyReply): FastifyReply | JwtTokenClientData[] {
54
- try {
55
- const tokens = this.service.listTokens();
56
- const clients = this.service.listClientData();
57
-
58
- const tokensAndClientData: JwtTokenClientData[] = tokens.map((token) => {
59
- return {
60
- token: token,
61
- clientData: clients.find((client) => client.access_token === token.access_token),
62
- };
63
- });
64
-
65
- return tokensAndClientData;
66
- } catch (error: any) {
67
- return reply.code(500).send({
68
- statusCode: 500,
69
- message: error.message,
70
- });
71
- }
72
- }
73
-
74
- public async login(req: FastifyRequest<AuthNewLoginRequest>, reply: FastifyReply): Promise<FastifyReply | void> {
75
- try {
76
- const user = req.locals.user!;
77
-
78
- const payload: JwtPayload = {
79
- _id: user._id,
80
- // avatar: user.avatar,
81
- username: user.username,
82
- // role: user.role,
83
- rememberMe: user.rememberMe,
84
- // firstLogin: user.firstLogin,
85
- // singleSession: user.singleSession,
86
- sessionTimer: user.sessionTimer,
87
- };
88
-
89
- const payloadRefresh: JwtRefreshPayload = {
90
- _id: user._id,
91
- };
92
-
93
- const access_token = jwt.sign(payload, this.configService.SECRETS.jwtAccessKey, { expiresIn: user.rememberMe ? '100y' : user.sessionTimer });
94
- const refresh_token = jwt.sign(payloadRefresh, this.configService.SECRETS.jwtRefreshKey, {
95
- expiresIn: user.rememberMe ? '100y' : REFRESH_TOKEN.EXPIRES_IN,
96
- });
97
-
98
- if (!user.rememberMe && user.sessionTimer > 0) {
99
- this.service.addSessionTimer(access_token, user.sessionTimer);
100
- }
101
-
102
- const token: JwtTokenEncoded = {
103
- _id: user._id,
104
- access_token: access_token,
105
- refresh_token: refresh_token,
106
- token_type: 'Bearer',
107
- expires_in: user.rememberMe ? 100 * 365 * 24 * 60 * 60 : user.sessionTimer,
108
- expires_at: user.rememberMe ? new Date((Date.now() / 1000 + 100 * 365 * 24 * 60 * 60) * 1000) : new Date((Date.now() / 1000 + user.sessionTimer) * 1000),
109
- };
110
-
111
- const clientData: ClientData = {
112
- _id: user._id,
113
- access_token: access_token,
114
- address: req.ip,
115
- device: `${req.useragent?.platform} (${req.useragent?.source.includes('Electron') ? 'camera.ui App' : req.useragent?.browser})`,
116
- };
117
-
118
- const userData: UserData = {
119
- ...token,
120
- username: user.username,
121
- avatar: user.avatar,
122
- role: user.role,
123
- rememberMe: user.rememberMe,
124
- firstLogin: user.firstLogin,
125
- singleSession: user.singleSession,
126
- sessionTimer: user.sessionTimer,
127
- };
128
-
129
- if (user.singleSession) {
130
- await this.service.invalidateById(user._id);
131
- }
132
-
133
- await this.service.insert(userData, clientData);
134
-
135
- return reply.code(201).send(userData);
136
- } catch (error: any) {
137
- return reply.code(500).send({
138
- statusCode: 500,
139
- message: error.message,
140
- });
141
- }
142
- }
143
-
144
- public async logout(req: FastifyRequest, reply: FastifyReply): Promise<FastifyReply> {
145
- try {
146
- const authorization = req.headers.authorization?.split(/\s+/);
147
- const token = authorization && authorization[0] === 'Bearer' ? authorization[1] : false;
148
-
149
- if (token) {
150
- await this.service.invalidateByToken(token);
151
- this.service.clearSessionTimer(token);
152
-
153
- this.app.io.of('/camera.ui').emit('invalidToken', token);
154
- }
155
-
156
- return reply.code(204).send();
157
- } catch (error: any) {
158
- return reply.code(500).send({
159
- statusCode: 500,
160
- message: error.message,
161
- });
162
- }
163
- }
164
-
165
- public async logoutByToken(req: FastifyRequest<AuthLoginRequest & AuthParamsRequest>, reply: FastifyReply): Promise<FastifyReply> {
166
- try {
167
- let token: JwtTokenEncoded | undefined;
168
-
169
- if (req.query.token) {
170
- token = this.service.findByToken(req.query.token);
171
- } else {
172
- token = this.service.findById(req.params.id);
173
- }
174
-
175
- if (!token) {
176
- return reply.code(404).send({
177
- statusCode: 404,
178
- message: 'Token not exists',
179
- });
180
- }
181
-
182
- await this.service.invalidateByToken(token.access_token);
183
- this.service.clearSessionTimer(token.access_token);
184
-
185
- this.app.io.of('/camera.ui').emit('invalidToken', token.access_token);
186
-
187
- return reply.code(204).send();
188
- } catch (error: any) {
189
- return reply.code(500).send({
190
- statusCode: 500,
191
- message: error.message,
192
- });
193
- }
194
- }
195
-
196
- public async logoutAll(req: FastifyRequest<AuthLoginRequest>, reply: FastifyReply): Promise<FastifyReply> {
197
- try {
198
- const tokens = this.service.listTokens();
199
-
200
- await this.service.invalidateAll();
201
- this.service.clearSessionTimer();
202
-
203
- tokens.forEach((token) => {
204
- this.app.io.of('/camera.ui').emit('invalidToken', token.access_token);
205
- });
206
-
207
- return reply.code(204).send();
208
- } catch (error: any) {
209
- return reply.code(500).send({
210
- statusCode: 500,
211
- message: error.message,
212
- });
213
- }
214
- }
215
-
216
- public async refresh(req: FastifyRequest<AuthRefreshRequest>, reply: FastifyReply): Promise<FastifyReply> {
217
- if (!req.body.refresh_token) {
218
- return reply.code(403).send({
219
- statusCode: 403,
220
- message: 'Refresh Token is required!',
221
- });
222
- }
223
-
224
- try {
225
- const token = this.service.findByRefreshToken(req.body.refresh_token);
226
-
227
- if (!token) {
228
- return reply.code(403).send({
229
- statusCode: 403,
230
- message: 'Refresh token is not in database!',
231
- });
232
- }
233
-
234
- const user = this.userService.findById(token._id);
235
-
236
- // todo: need this?
237
- if (!user) {
238
- return reply.code(403).send({
239
- statusCode: 403,
240
- message: 'User is not in database!',
241
- });
242
- }
243
-
244
- const refreshToken = parseJwt(req.body.refresh_token) as unknown as JwtRefreshTokenDecoded;
245
-
246
- if (new Date(refreshToken.expires_at).getTime() < new Date().getTime()) {
247
- await this.service.invalidateByRefreshToken(token.refresh_token);
248
- this.service.clearSessionTimer(token.access_token);
249
-
250
- return reply.code(403).send({
251
- statusCode: 403,
252
- message: 'Refresh token was expired. Please make a new signin request',
253
- });
254
- }
255
-
256
- const payload: JwtPayload = {
257
- _id: user._id,
258
- username: user.username,
259
- // avatar: user.avatar,
260
- // role: user.role,
261
- rememberMe: user.rememberMe,
262
- // firstLogin: user.firstLogin,
263
- // singleSession: user.singleSession,
264
- sessionTimer: user.sessionTimer,
265
- };
266
-
267
- const access_token = jwt.sign(payload, this.configService.SECRETS.jwtAccessKey, { expiresIn: user.rememberMe ? '100y' : user.sessionTimer });
268
-
269
- const jwtToken: JwtTokenEncoded = {
270
- _id: user._id,
271
- access_token: access_token,
272
- refresh_token: token.refresh_token,
273
- token_type: 'Bearer',
274
- expires_in: user.rememberMe ? 100 * 365 * 24 * 60 * 60 : user.sessionTimer,
275
- expires_at: user.rememberMe ? new Date((Date.now() / 1000 + 100 * 365 * 24 * 60 * 60) * 1000) : new Date((Date.now() / 1000 + user.sessionTimer) * 1000),
276
- };
277
-
278
- const jwtTokenResponse: JwtTokenResponse = {
279
- access_token: access_token,
280
- refresh_token: token.refresh_token,
281
- };
282
-
283
- await this.service.patchTokenByRefreshToken(token.refresh_token, jwtToken);
284
- this.service.refreshSessionTimer(token.access_token, access_token, user.sessionTimer);
285
-
286
- return reply.code(200).send(jwtTokenResponse);
287
- } catch (error: any) {
288
- return reply.code(500).send({
289
- statusCode: 500,
290
- message: error.message,
291
- });
292
- }
293
- }
294
- }
@@ -1,72 +0,0 @@
1
- import { readFile } from 'node:fs';
2
- import { container } from 'tsyringe';
3
- import { BackupService } from '../services/backup.service.js';
4
-
5
- import type { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify';
6
- import type { LoggerService } from '../../services/logger/index.js';
7
- import type { AuthLoginRequest, BackupCreateRequest, BackupRestoreRequest } from '../types/index.js';
8
-
9
- export class BackupController {
10
- private app: FastifyInstance;
11
- private logger: LoggerService;
12
- private service: BackupService;
13
-
14
- constructor(app: FastifyInstance) {
15
- this.app = app;
16
- this.logger = container.resolve<LoggerService>('logger');
17
- this.service = new BackupService();
18
- }
19
-
20
- public async download(req: FastifyRequest<AuthLoginRequest & BackupCreateRequest>, reply: FastifyReply): Promise<FastifyReply | void> {
21
- try {
22
- const backup = await this.service.createBackup(req.body.localStorage);
23
-
24
- readFile(backup.backupFile, (error, fileBuffer) => {
25
- if (error) {
26
- this.logger.error(error);
27
- }
28
-
29
- this.service.removeBackup(backup);
30
- reply.send(error ?? fileBuffer);
31
- });
32
-
33
- reply.header('Content-Type', 'application/octet-stream');
34
- reply.header('Content-Disposition', `attachment; filename=${backup.backupFileName}`);
35
-
36
- return reply;
37
- } catch (error: any) {
38
- return reply.code(500).send({
39
- statusCode: 500,
40
- message: error.message,
41
- });
42
- }
43
- }
44
-
45
- public async restore(req: FastifyRequest<AuthLoginRequest & BackupRestoreRequest>, reply: FastifyReply): Promise<FastifyReply | void> {
46
- try {
47
- if (!req.isMultipart()) {
48
- throw new Error('No multipart request!');
49
- }
50
-
51
- const file = req.body.upload;
52
- if (!file) {
53
- return reply.code(400).send({
54
- statusCode: 400,
55
- message: 'No file uploaded',
56
- });
57
- }
58
-
59
- const localStorage = await this.service.restoreBackup(file);
60
-
61
- // inform main process
62
- process.send?.('restored');
63
-
64
- return reply.code(201).send(localStorage);
65
- } catch (error: any) {
66
- return reply.code(500).send({
67
- statusCode: 500,
68
- message: error.message,
69
- });
70
- }
71
- }
72
- }