@camera.ui/server 0.0.50-internal.0 → 0.0.50-internal.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.
- package/dist/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.OhxoO3MD.0.0.50-internal.0.js → @primevue.CiB2EGly.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@tanstack.D1IL6eOv.0.0.50-internal.0.js → @tanstack.DxMw_rJn.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@vee-validate.BGPyWWTh.0.0.50-internal.0.js → @vee-validate.RxZ3hn6V.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{@vueuse.BsKtqdiG.0.0.50-internal.0.js → @vueuse.C-k73ACm.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Adminpanel.D93Kvbwp.0.0.50-internal.0.js → Adminpanel.DumNu6GD.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Camera.DF2l3OMA.0.0.50-internal.0.js → Camera.BuosoqFl.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Cameras.YzvZccdv.0.0.50-internal.0.js → Cameras.A7NJflGG.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/Cammesh.Dv3C0UiR.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{Camview.CB7_HnoQ.0.0.50-internal.0.js → Camview.GgjJp7JR.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Config.BwflsWTm.0.0.50-internal.0.js → Config.BL3L-BFE.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/{Console.DZM8pN8Q.0.0.50-internal.0.js → Console.CxwRmUVF.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiConsole.BXXU7Gth.0.0.50-internal.0.js → CuiConsole.D16kkT6R.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiPluginCard.YFOrpbVD.0.0.50-internal.0.js → CuiPluginCard.Bkp__d8n.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{CuiTimeline.VV5KSJd5.0.0.50-internal.0.js → CuiTimeline.C9HKvo0G.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{FirstSteps.b-nvymgb.0.0.50-internal.0.js → FirstSteps.QuJjtAtF.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Plugin.BOMpVEwM.0.0.50-internal.0.js → Plugin.BLUUbEej.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{Plugins.DdPwaUDA.0.0.50-internal.0.js → Plugins.DviCIk7w.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/Recordings.Dsp07cHs.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{Settings.D24ttaPu.0.0.50-internal.0.js → Settings.Clx4y9gP.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsAccount.ms3aqz4E.0.0.50-internal.0.js → SettingsAccount.cfY4-PYd.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/SettingsAppearance.CBGZAazb.0.0.50-internal.1.js +1 -0
- 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.kxAPXcBy.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsBackup.BPEc4Rjg.0.0.50-internal.0.js → SettingsBackup.DOaJA4pp.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/SettingsRecordings.BGcwL6tk.0.0.50-internal.1.js +1 -0
- package/dist/interface/js/{SettingsRemote.BL5nXbUT.0.0.50-internal.0.js → SettingsRemote.BVU_w1Jm.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsSystem.D7T0AIpm.0.0.50-internal.0.js → SettingsSystem.P0vy90vA.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{SettingsUsers.1u0vCOVG.0.0.50-internal.0.js → SettingsUsers.DaP5m7eo.0.0.50-internal.1.js} +1 -1
- 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.MmrWYW3K.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{ace-builds.D1nmvCwb.0.0.50-internal.0.js → ace-builds.C0aqA_3x.0.0.50-internal.1.js} +2 -2
- package/dist/interface/js/{ace.config.G96T2z54.0.0.50-internal.0.js → ace.config.C9wgzklI.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{backup.B_Gzxtp_.0.0.50-internal.0.js → backup.BeH6lJ5t.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{chart.js.CP_nMnnf.0.0.50-internal.0.js → chart.js.BQHSWV_g.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{close-circle.DYLuVIOg.0.0.50-internal.0.js → close-circle.DDKMxauw.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{dnd-core.T9OeW7mu.0.0.50-internal.0.js → dnd-core.dWz9rJqH.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{draggabilly.D3zGcBb3.0.0.50-internal.0.js → draggabilly.D-iZIS1n.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{engine.io-client.kITRnq-g.0.0.50-internal.0.js → engine.io-client.BwxOddB_.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{fast-deep-equal.Bpc9mIsj.0.0.50-internal.0.js → fast-deep-equal.Dz96RC_N.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{highlight.js.BlSXU-Wb.0.0.50-internal.0.js → highlight.js.CmcM8OM6.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{linkify-it.C3N1lWsJ.0.0.50-internal.0.js → linkify-it.BgLcBzlw.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{main.D0YR3Jat.0.0.50-internal.0.js → main.6bOgRV7D.0.0.50-internal.1.js} +3 -3
- package/dist/interface/js/{markdown-it.Dj0dt5s2.0.0.50-internal.0.js → markdown-it.CTgfs-3p.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{nprogress.BwQWDcGj.0.0.50-internal.0.js → nprogress.CMhnq8jS.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{pinia.DRh7plEC.0.0.50-internal.0.js → pinia.CuC5ZfNs.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{primevue.Cl58krXf.0.0.50-internal.0.js → primevue.DmwjJ4xV.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{qrcode.C1sDj6P8.0.0.50-internal.0.js → qrcode.DGZO3j1c.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{react-dnd-touch-backend.BA4WhUJo.0.0.50-internal.0.js → react-dnd-touch-backend.CEGHlD-T.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{refresh-rounded.D_SmhhUf.0.0.50-internal.0.js → refresh-rounded.D0keXzBc.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{rxjs.C-fTBwEO.0.0.50-internal.0.js → rxjs.CiDbFOB0.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{socket.io-client.DKrRxgjP.0.0.50-internal.0.js → socket.io-client.BPcXPAHG.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{socket.io-parser.EXj3YDH2.0.0.50-internal.0.js → socket.io-parser.DSGzrW_l.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{system.CY8rGd-Q.0.0.50-internal.0.js → system.BKlEObmx.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{trash-fill.CMnCN3Oy.0.0.50-internal.0.js → trash-fill.BDFILs86.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{unidragger.D0w6Tqtt.0.0.50-internal.0.js → unidragger.DcxsxHCS.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vee-validate.BeiObIH8.0.0.50-internal.0.js → vee-validate.BGRg3oQ8.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-chartjs.DtdZdiYw.0.0.50-internal.0.js → vue-chartjs.B9yk2de7.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-i18n.BW2bx_6z.0.0.50-internal.0.js → vue-i18n.DXDZITpf.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-inline-svg.BJkQGmKz.0.0.50-internal.0.js → vue-inline-svg.BDYaTfbi.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-router.B2mOXHaC.0.0.50-internal.0.js → vue-router.CFEDA008.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue-zoomable.BKDyCJE7.0.0.50-internal.0.js → vue-zoomable.zqTafMgD.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{vue3-dnd.DRK24CBp.0.0.50-internal.0.js → vue3-dnd.BxM3dbYs.0.0.50-internal.1.js} +1 -1
- package/dist/interface/js/{zoom-out.DxvzgVEo.0.0.50-internal.0.js → zoom-out.B6SY9IIj.0.0.50-internal.1.js} +1 -1
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +1 -1
- package/package.json +1 -1
- package/.prettierignore +0 -12
- package/.prettierrc.json +0 -12
- package/artillery.yaml +0 -29
- package/bin/cameraui-server.ts +0 -11
- package/dist/interface/js/Cammesh.D-6dAROQ.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/Recordings.DhxjIW7e.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsAppearance.DsTjKXk1.0.0.50-internal.0.js +0 -1
- package/dist/interface/js/SettingsRecordings.DgW7M0jj.0.0.50-internal.0.js +0 -1
- package/eslint.config.js +0 -103
- package/localdeps.txt +0 -10
- package/mypy.ini +0 -30
- package/requirements.txt +0 -15
- package/ruff.toml +0 -90
- package/src/__init__.py +0 -0
- package/src/_camera_ui_tools/__init__.py +0 -0
- package/src/_camera_ui_tools/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/api/controllers/api.controller.ts +0 -19
- package/src/api/controllers/auth.controller.ts +0 -294
- package/src/api/controllers/backup.controller.ts +0 -72
- package/src/api/controllers/cameras.controller.ts +0 -1029
- package/src/api/controllers/config.controller.ts +0 -102
- package/src/api/controllers/files.controller.ts +0 -35
- package/src/api/controllers/frameWorkers.controller.ts +0 -109
- package/src/api/controllers/plugins.controller.ts +0 -1206
- package/src/api/controllers/system.controller.ts +0 -273
- package/src/api/controllers/users.controller.ts +0 -648
- package/src/api/database/checks.ts +0 -268
- package/src/api/database/constants.ts +0 -8
- package/src/api/database/index.ts +0 -262
- package/src/api/database/migration.ts +0 -62
- package/src/api/database/selfcheck.ts +0 -492
- package/src/api/database/types.ts +0 -104
- package/src/api/go2rtc/api/application.ts +0 -48
- package/src/api/go2rtc/api/config.ts +0 -61
- package/src/api/go2rtc/api/discover.ts +0 -197
- package/src/api/go2rtc/api/index.ts +0 -49
- package/src/api/go2rtc/api/snapshot.ts +0 -44
- package/src/api/go2rtc/api/streams.ts +0 -168
- package/src/api/go2rtc/index.ts +0 -43
- package/src/api/go2rtc/queue.ts +0 -50
- package/src/api/go2rtc/types.ts +0 -174
- package/src/api/index.ts +0 -286
- package/src/api/middlewares/authPermission.middleware.ts +0 -46
- package/src/api/middlewares/authValidation.middleware.ts +0 -160
- package/src/api/middlewares/pagination.middleware.ts +0 -67
- package/src/api/middlewares/socketAuth.middleware.ts +0 -136
- package/src/api/plugins/header.plugin.ts +0 -15
- package/src/api/plugins/logger.plugin.ts +0 -44
- package/src/api/plugins/proxy.plugin.ts +0 -255
- package/src/api/plugins/socket.plugin.ts +0 -28
- package/src/api/plugins/system.plugin.ts +0 -48
- package/src/api/plugins/useragent.plugin.ts +0 -19
- package/src/api/routes/api.routes.ts +0 -10
- package/src/api/routes/auth.routes.ts +0 -56
- package/src/api/routes/backup.routes.ts +0 -28
- package/src/api/routes/cameras.routes.ts +0 -281
- package/src/api/routes/config.routes.ts +0 -66
- package/src/api/routes/files.routes.ts +0 -15
- package/src/api/routes/frameWorkers.routes.ts +0 -39
- package/src/api/routes/index.ts +0 -37
- package/src/api/routes/plugins.routes.ts +0 -420
- package/src/api/routes/system.routes.ts +0 -101
- package/src/api/routes/users.routes.ts +0 -167
- package/src/api/schemas/backup.schema.ts +0 -112
- package/src/api/schemas/cameras.schema.ts +0 -479
- package/src/api/schemas/config.schema.ts +0 -38
- package/src/api/schemas/go2rtc.schema.ts +0 -189
- package/src/api/schemas/plugins.schema.ts +0 -126
- package/src/api/schemas/storage.schema.ts +0 -11
- package/src/api/schemas/system.schema.ts +0 -45
- package/src/api/schemas/users.schema.ts +0 -185
- package/src/api/services/auth.service.ts +0 -210
- package/src/api/services/backup.service.ts +0 -144
- package/src/api/services/cameras.service.ts +0 -671
- package/src/api/services/plugins.service.ts +0 -470
- package/src/api/services/system.service.ts +0 -85
- package/src/api/services/users.service.ts +0 -276
- package/src/api/types/index.ts +0 -675
- package/src/api/utils/cert.ts +0 -254
- package/src/api/utils/constants.ts +0 -17
- package/src/api/utils/fetch.ts +0 -21
- package/src/api/utils/moveFiles.ts +0 -45
- package/src/api/utils/parse.ts +0 -17
- package/src/api/websocket/index.ts +0 -110
- package/src/api/websocket/nsp/logs.ts +0 -240
- package/src/api/websocket/nsp/main.ts +0 -27
- package/src/api/websocket/nsp/metrics.ts +0 -301
- package/src/api/websocket/nsp/notifications.ts +0 -43
- package/src/api/websocket/nsp/plugins.ts +0 -37
- package/src/api/websocket/nsp/server.ts +0 -220
- package/src/api/websocket/nsp/status.ts +0 -77
- package/src/api/websocket/types.ts +0 -55
- package/src/api.ts +0 -163
- package/src/camera/classes.ts +0 -32
- package/src/camera/controller.ts +0 -579
- package/src/camera/device.ts +0 -422
- package/src/camera/frameWorker.ts +0 -403
- package/src/camera/index.ts +0 -679
- package/src/camera/interfaces.ts +0 -95
- package/src/camera/iou.ts +0 -153
- package/src/camera/polygon.ts +0 -226
- package/src/camera/python/__init__.py +0 -0
- package/src/camera/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/classes.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/delegate_controller.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/interfaces.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/iou.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/iou2.cpython-310.pyc +0 -0
- package/src/camera/python/__pycache__/polygon.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/camera/python/__pycache__/video_frame.cpython-311.pyc +0 -0
- package/src/camera/python/classes.py +0 -41
- package/src/camera/python/interfaces.py +0 -130
- package/src/camera/python/iou.py +0 -158
- package/src/camera/python/polygon.py +0 -230
- package/src/camera/python/test/__pycache__/polygon.cpython-310.pyc +0 -0
- package/src/camera/python/test/iou_test.py +0 -799
- package/src/camera/python/test/polygon.py +0 -238
- package/src/camera/python/test/polygon_test.py +0 -256
- package/src/camera/python/test/polygon_test2.py +0 -484
- package/src/camera/python/typings.py +0 -50
- package/src/camera/python/video_frame.py +0 -143
- package/src/camera/session.ts +0 -192
- package/src/camera/streaming/fmp4-session.ts +0 -390
- package/src/camera/streaming/peer-connection.ts +0 -273
- package/src/camera/streaming/rtsp-session.ts +0 -331
- package/src/camera/streaming/webrtc-connection.ts +0 -260
- package/src/camera/streaming/werift-session.ts +0 -317
- package/src/camera/test/iou_test.ts +0 -761
- package/src/camera/test/polygon.test.ts +0 -611
- package/src/camera/test/polygon_test.ts +0 -210
- package/src/camera/types.ts +0 -48
- package/src/camera/utils.ts +0 -489
- package/src/camera/videoFrame.ts +0 -123
- package/src/cloud/index.ts +0 -61
- package/src/cloud/remote/cloudflare.ts +0 -18
- package/src/cloud/remote/upnp.ts +0 -18
- package/src/cloud/remote/utils.ts +0 -24
- package/src/cloud/types.ts +0 -16
- package/src/decoder/child.ts +0 -883
- package/src/decoder/imageUtils.ts +0 -275
- package/src/decoder/manager.ts +0 -251
- package/src/decoder/python/__init__.py +0 -0
- package/src/decoder/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/image_utils.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/decoder/python/__pycache__/utils.cpython-311.pyc +0 -0
- package/src/decoder/python/child.py +0 -903
- package/src/decoder/python/image_utils.py +0 -196
- package/src/decoder/python/pool.py +0 -45
- package/src/decoder/python/test/group.py +0 -62
- package/src/decoder/python/test/motion.mp4 +0 -0
- package/src/decoder/python/test/motion2.mp4 +0 -0
- package/src/decoder/python/test/opencl.cl +0 -70
- package/src/decoder/python/test/opencl2.cl +0 -130
- package/src/decoder/python/test/test.py +0 -427
- package/src/decoder/python/test/test1.jpg +0 -0
- package/src/decoder/python/test/test1_resized.jpg +0 -0
- package/src/decoder/python/test/test2.jpg +0 -0
- package/src/decoder/python/test/test2.py +0 -451
- package/src/decoder/python/test/test2_resized.jpg +0 -0
- package/src/decoder/python/test/test3.jpg +0 -0
- package/src/decoder/python/test/utils.py +0 -50
- package/src/decoder/python/typings.py +0 -57
- package/src/decoder/python/utils.py +0 -70
- package/src/decoder/test/child.ts +0 -117
- package/src/decoder/test/ffmpeg.ts +0 -371
- package/src/decoder/test/test.ts +0 -182
- package/src/decoder/types.ts +0 -27
- package/src/decoder/utils.ts +0 -64
- package/src/decoder/wasm/asconfig.json +0 -28
- package/src/decoder/wasm/assembly/console.ts +0 -1
- package/src/decoder/wasm/assembly/index.ts +0 -890
- package/src/decoder/wasm/build/decoder.d.ts +0 -43
- package/src/decoder/wasm/build/decoder.js +0 -108
- package/src/decoder/wasm/build/decoder.wasm +0 -0
- package/src/decoder/wasm/tsconfig.json +0 -5
- package/src/decoder/worker.ts +0 -113
- package/src/go2rtc/index.ts +0 -324
- package/src/go2rtc/types.ts +0 -88
- package/src/main.ts +0 -267
- package/src/manager/coreManager.ts +0 -78
- package/src/manager/deviceManager.ts +0 -132
- package/src/manager/types.ts +0 -17
- package/src/plugins/index.ts +0 -443
- package/src/plugins/plugin.ts +0 -177
- package/src/plugins/runtime/base.ts +0 -282
- package/src/plugins/runtime/index.ts +0 -15
- package/src/plugins/runtime/node/child.ts +0 -193
- package/src/plugins/runtime/node/index.ts +0 -67
- package/src/plugins/runtime/node/plugin.ts +0 -122
- package/src/plugins/runtime/node/pluginApi.ts +0 -27
- package/src/plugins/runtime/node/proxy/cameraDevice.ts +0 -299
- package/src/plugins/runtime/node/proxy/coreManager.ts +0 -128
- package/src/plugins/runtime/node/proxy/deviceManager.ts +0 -187
- package/src/plugins/runtime/node/storage.ts +0 -312
- package/src/plugins/runtime/node/storageController.ts +0 -91
- package/src/plugins/runtime/python/__init__.py +0 -0
- package/src/plugins/runtime/python/__pycache__/__init__.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/camera_storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/config_service.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/ipc.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/namespaces.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_api.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/plugin_logger.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/proxy_utils.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/schema.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/storage_controller.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/__pycache__/typings.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/child.py +0 -248
- package/src/plugins/runtime/python/index.ts +0 -73
- package/src/plugins/runtime/python/namespaces.py +0 -101
- package/src/plugins/runtime/python/plugin.py +0 -155
- package/src/plugins/runtime/python/plugin_api.py +0 -29
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/camera_device.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/constants.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/core_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/device_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/generate_keys.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/message_queue.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/plugins_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-310.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-311.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-38.pyc +0 -0
- package/src/plugins/runtime/python/proxy/__pycache__/system_manager.cpython-39.pyc +0 -0
- package/src/plugins/runtime/python/proxy/camera_device.py +0 -1732
- package/src/plugins/runtime/python/proxy/core_manager.py +0 -126
- package/src/plugins/runtime/python/proxy/device_manager.py +0 -197
- package/src/plugins/runtime/python/schema.py +0 -99
- package/src/plugins/runtime/python/storage.py +0 -353
- package/src/plugins/runtime/python/storage_controller.py +0 -102
- package/src/plugins/runtime/python/typings.py +0 -195
- package/src/plugins/schema.ts +0 -472
- package/src/plugins/types.ts +0 -60
- package/src/plugins/worker.ts +0 -250
- package/src/rpc/index.ts +0 -149
- package/src/rpc/namespaces.ts +0 -79
- package/src/rpc/server.ts +0 -422
- package/src/rpc/types.ts +0 -119
- package/src/rpc/utils.ts +0 -16
- package/src/services/config/constants.ts +0 -47
- package/src/services/config/defaults.ts +0 -57
- package/src/services/config/index.ts +0 -744
- package/src/services/config/types.ts +0 -211
- package/src/services/logger/index.ts +0 -96
- package/src/types.ts +0 -47
- package/src/utils/path.ts +0 -16
- package/src/utils/pythonInstaller.ts +0 -597
- package/tsconfig.json +0 -37
- package/updates.config.js +0 -3
- /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.50-internal.0.css → @xterm.DYP7pi_n.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.50-internal.0.css → Adminpanel.BKek2EMH.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.50-internal.0.css → Cameras.BDWZJqPN.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Camview.BFUFMoNX.0.0.50-internal.0.css → Camview.BFUFMoNX.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.50-internal.0.css → CuiConsole.DCYyxdVg.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.50-internal.0.css → CuiPluginCard.yF8V0SZY.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.50-internal.0.css → CuiTimeline.BkIwlYtw.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.50-internal.0.css → Plugin.DJElsAn5.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Plugins.0h77qnmN.0.0.50-internal.0.css → Plugins.0h77qnmN.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.50-internal.0.css → Settings.CkgfRkQr.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.DeFul3eQ.0.0.50-internal.0.css → SettingsAccount.DeFul3eQ.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.50-internal.0.css → SettingsBackup.CX0rT0QJ.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.50-internal.0.css → highlight.Ch2EwETz.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.50-internal.0.png → logo-256.BCQk9H1-.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.50-internal.0.png → logo-512.DLKVOU2S.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.50-internal.0.png → logo.DmEiRk0z.0.0.50-internal.1.png} +0 -0
- /package/dist/interface/assets/{main.Cip9LkS3.0.0.50-internal.0.css → main.Cip9LkS3.0.0.50-internal.1.css} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.50-internal.0.js → mode-json.Br7xisR1.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.50-internal.0.js → mode-yaml.CIYL8U3d.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.50-internal.0.js → worker-base.jEXLGV2h.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.50-internal.0.js → worker-json.DgwNIOck.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.50-internal.0.js → worker-yaml.B3uUYINB.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.50-internal.0.js → @babel.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.50-internal.0.js → @intlify.BkGPX90O.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.50-internal.0.js → @kurkle.D8fDXNIl.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@primeuix.BFAY2Bk9.0.0.50-internal.0.js → @primeuix.BFAY2Bk9.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.50-internal.0.js → @react-dnd.CcwRs9xb.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.50-internal.0.js → @socket.io.Dkula2eQ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@vue.B5vqhCp2.0.0.50-internal.0.js → @vue.B5vqhCp2.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{@xterm.CAa7rpjv.0.0.50-internal.0.js → @xterm.DIUBesyz.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.50-internal.0.js → axios.DHr9lByg.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.50-internal.0.js → birpc.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.50-internal.0.js → compare-versions.DqEOhma6.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.50-internal.0.js → dijkstrajs.C00ieaqj.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.50-internal.0.js → engine.io-parser.BiEtp6m2.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.50-internal.0.js → entities.C20TfXL6.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.50-internal.0.js → ev-emitter.X5f1qa-c.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{get-size.D1dS-IaP.0.0.50-internal.0.js → get-size.D1dS-IaP.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.50-internal.0.js → hookable.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.50-internal.0.js → mdurl.k9Sl0PQj.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.50-internal.0.js → perfect-debounce.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.50-internal.0.js → primelocale.Bga3dOQu.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.50-internal.0.js → punycode.js.Dj65hjkv.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.0.js → react-dnd-html5-backend.1HQjlkwI.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.50-internal.0.js → redux.BFxtlG_c.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.50-internal.0.js → tslib.9k7AwCpt.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.50-internal.0.js → uc.micro.kMc2yuuw.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.50-internal.0.js → uuid.C6aID195.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.50-internal.0.js → vue.l0sNRNKZ.0.0.50-internal.1.js} +0 -0
- /package/dist/interface/js/{zod.SKKegNRO.0.0.50-internal.0.js → zod.SKKegNRO.0.0.50-internal.1.js} +0 -0
|
@@ -1,597 +0,0 @@
|
|
|
1
|
-
import { PortablePython } from '@bjia56/portable-python';
|
|
2
|
-
import { compareVersions } from 'compare-versions';
|
|
3
|
-
import { copy, ensureDir, remove } from 'fs-extra/esm';
|
|
4
|
-
import { exec } from 'node:child_process';
|
|
5
|
-
import { existsSync } from 'node:fs';
|
|
6
|
-
import { readdir, readFile, rm, writeFile } from 'node:fs/promises';
|
|
7
|
-
import { platform } from 'node:os';
|
|
8
|
-
import { dirname, join, resolve } from 'node:path';
|
|
9
|
-
import { createInterface } from 'readline';
|
|
10
|
-
|
|
11
|
-
import { IS_ELECTRON } from '@camera.ui/common';
|
|
12
|
-
|
|
13
|
-
import type { Logger } from '@camera.ui/common';
|
|
14
|
-
|
|
15
|
-
export const DEFAULT_PY_VERSION = '3.11';
|
|
16
|
-
|
|
17
|
-
export class PythonInstaller {
|
|
18
|
-
static readonly versions = ['3.12', '3.11', '3.10', '3.9'];
|
|
19
|
-
|
|
20
|
-
public logger: Logger;
|
|
21
|
-
|
|
22
|
-
readonly python: PortablePython;
|
|
23
|
-
readonly venvPath?: string;
|
|
24
|
-
readonly installPath: string;
|
|
25
|
-
|
|
26
|
-
private needsUpdate = false;
|
|
27
|
-
|
|
28
|
-
get isInstalled(): boolean {
|
|
29
|
-
return this.python.isInstalled();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
get pluginPythonPath(): string {
|
|
33
|
-
if (!this.venvPath) {
|
|
34
|
-
throw new Error('Venv path is not defined');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const binPath = platform() === 'win32' ? 'Scripts' : 'bin';
|
|
38
|
-
return join(this.venvPath, binPath, 'python');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get serverPythonPath(): string {
|
|
42
|
-
return this.python.executablePath;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
get pluginPackagesPath(): string {
|
|
46
|
-
if (!this.venvPath) {
|
|
47
|
-
throw new Error('Venv path is not defined');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (platform() === 'win32') {
|
|
51
|
-
return join(this.venvPath, 'Lib', 'site-packages');
|
|
52
|
-
} else {
|
|
53
|
-
return join(this.venvPath, 'lib', `python${this.getMajorMinorVersion(this.version)}`, 'site-packages');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
get serverPackagesPath(): string {
|
|
58
|
-
if (platform() === 'win32') {
|
|
59
|
-
return join(this.python.extractPath, 'Lib', 'site-packages');
|
|
60
|
-
} else {
|
|
61
|
-
return join(this.python.extractPath, 'lib', `python${this.getMajorMinorVersion(this.version)}`, 'site-packages');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
get version(): string {
|
|
66
|
-
return this.python.version;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
constructor(homePath: string, logger: Logger, venvDir?: string, version: string = DEFAULT_PY_VERSION) {
|
|
70
|
-
this.logger = logger;
|
|
71
|
-
|
|
72
|
-
if (!PythonInstaller.versions.includes(version)) {
|
|
73
|
-
version = DEFAULT_PY_VERSION;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const pythonDir = IS_ELECTRON ? 'python-electron' : 'python';
|
|
77
|
-
this.installPath = `${homePath}/${pythonDir}`;
|
|
78
|
-
this.python = new PortablePython(version, this.installPath);
|
|
79
|
-
|
|
80
|
-
if (venvDir) {
|
|
81
|
-
this.venvPath = join(venvDir, `${pythonDir}-${this.getMajorMinorVersion(this.version)}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public async install(type: 'plugin' | 'server', requirementsPath?: string): Promise<void> {
|
|
86
|
-
if (!this.isInstalled) {
|
|
87
|
-
this.logger.trace(`Installing Python v${this.version} to ${this.installPath}...`);
|
|
88
|
-
|
|
89
|
-
await ensureDir(this.installPath);
|
|
90
|
-
await this.removeOldVersions();
|
|
91
|
-
await this.python.install();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (type === 'server') {
|
|
95
|
-
if (!requirementsPath) {
|
|
96
|
-
throw new Error('Requirements path is not defined');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
await this.updateServerDependencies(requirementsPath);
|
|
100
|
-
|
|
101
|
-
if (platform() === 'win32') {
|
|
102
|
-
const binPath = dirname(this.serverPythonPath);
|
|
103
|
-
const pythonwPath = join(binPath, 'pythonw.exe');
|
|
104
|
-
|
|
105
|
-
if (!existsSync(pythonwPath)) {
|
|
106
|
-
await copy(this.serverPythonPath, pythonwPath);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
public async installPluginPython(): Promise<void> {
|
|
113
|
-
await this.install('plugin');
|
|
114
|
-
await this.createVenv();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public async uninstall(): Promise<void> {
|
|
118
|
-
if (this.isInstalled) {
|
|
119
|
-
await this.python.uninstall();
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
await this.removeVenv();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
public async updatePluginDependencies(requirementsPath: string): Promise<void> {
|
|
126
|
-
await this.ensureVenv();
|
|
127
|
-
|
|
128
|
-
const { needsUpdate, requirementsLockPath, requirementsContent, lockContent, updatedLockContent } = await this.updateRequirements(requirementsPath);
|
|
129
|
-
const { reInstall, uninstall } = await this.analyzeDependencies(requirementsContent, lockContent, needsUpdate);
|
|
130
|
-
|
|
131
|
-
await this.updateDependencies('plugin', requirementsPath, requirementsContent, reInstall, uninstall);
|
|
132
|
-
|
|
133
|
-
if (updatedLockContent) {
|
|
134
|
-
await writeFile(requirementsLockPath, updatedLockContent);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
public async updateServerDependencies(requirementsPath: string): Promise<void> {
|
|
139
|
-
const requirementsLockPath = resolve(join(this.installPath, `requirements-lock-${this.version}.txt`));
|
|
140
|
-
|
|
141
|
-
const { needsUpdate, requirementsContent, lockContent, updatedLockContent } = await this.updateRequirements(requirementsPath, requirementsLockPath);
|
|
142
|
-
const { reInstall, uninstall } = await this.analyzeDependencies(requirementsContent, lockContent, needsUpdate);
|
|
143
|
-
|
|
144
|
-
await this.updateDependencies('server', requirementsPath, requirementsContent, reInstall, uninstall);
|
|
145
|
-
|
|
146
|
-
if (updatedLockContent) {
|
|
147
|
-
await writeFile(requirementsLockPath, updatedLockContent);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public async installPluginPackages(pkgs: string[]): Promise<string> {
|
|
152
|
-
await this.ensureVenv();
|
|
153
|
-
return this.installPackages(this.pluginPythonPath, pkgs);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
public async installServerPackages(pkgs: string[]): Promise<string> {
|
|
157
|
-
return this.installPackages(this.serverPythonPath, pkgs);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
public async reinstallPluginPackes(pkgs: string[]): Promise<string> {
|
|
161
|
-
await this.ensureVenv();
|
|
162
|
-
return this.reinstallPackages(this.pluginPythonPath, pkgs);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
public async reinstallServerPackages(pkgs: string[]): Promise<string> {
|
|
166
|
-
return this.reinstallPackages(this.serverPythonPath, pkgs);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
public async uninstallPluginPackages(pkgs: string[]): Promise<string> {
|
|
170
|
-
await this.ensureVenv();
|
|
171
|
-
return this.uninstallPackages(this.pluginPythonPath, pkgs);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
public async uninstallServerPackages(pkgs: string[]): Promise<string> {
|
|
175
|
-
return this.uninstallPackages(this.serverPythonPath, pkgs);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
private async installPluginRequirements(requirementsPath: string): Promise<string> {
|
|
179
|
-
return this.installRequirements(this.pluginPythonPath, requirementsPath);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
private async installServerRequirements(requirementsPath: string): Promise<string> {
|
|
183
|
-
return this.installRequirements(this.serverPythonPath, requirementsPath);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
private async updateRequirements(
|
|
187
|
-
requirementsPath: string,
|
|
188
|
-
requirementsLockPath?: string,
|
|
189
|
-
): Promise<{ needsUpdate: boolean; requirementsLockPath: string; requirementsContent: string; lockContent?: string; updatedLockContent?: string }> {
|
|
190
|
-
requirementsLockPath = requirementsLockPath ?? join(dirname(requirementsPath), 'requirements-lock.txt');
|
|
191
|
-
const requirementsContent = await readFile(requirementsPath, 'utf8');
|
|
192
|
-
|
|
193
|
-
let lockContent: string | undefined;
|
|
194
|
-
let updatedLockContent: string | undefined;
|
|
195
|
-
|
|
196
|
-
let requirementsLockContent = '';
|
|
197
|
-
let lockPythonVersion = '';
|
|
198
|
-
|
|
199
|
-
try {
|
|
200
|
-
lockContent = await readFile(requirementsLockPath, 'utf8');
|
|
201
|
-
const lockLines = lockContent.split('\n');
|
|
202
|
-
lockPythonVersion = lockLines[0].replace('# Python version: ', '').trim();
|
|
203
|
-
requirementsLockContent = lockLines.slice(1).join('\n');
|
|
204
|
-
} catch {
|
|
205
|
-
//
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
const currentPythonVersion = this.version;
|
|
209
|
-
|
|
210
|
-
const needsUpdate = requirementsContent !== requirementsLockContent || currentPythonVersion !== lockPythonVersion;
|
|
211
|
-
|
|
212
|
-
if (needsUpdate) {
|
|
213
|
-
updatedLockContent = `# Python version: ${currentPythonVersion}\n${requirementsContent}`;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return { needsUpdate, requirementsLockPath, requirementsContent, lockContent, updatedLockContent };
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
private async analyzeDependencies(reqContent: string, reqLockContent?: string, needsUpdate?: boolean): Promise<{ reInstall: string[]; uninstall: string[] }> {
|
|
220
|
-
const requiredPackages = new Set<string>(
|
|
221
|
-
reqContent
|
|
222
|
-
.split('\n')
|
|
223
|
-
.filter((line) => /^[a-zA-Z]/.test(line))
|
|
224
|
-
.map((line) => this.cleanPackageName(line))
|
|
225
|
-
.filter((line) => line !== ''),
|
|
226
|
-
);
|
|
227
|
-
|
|
228
|
-
let oldPackeges = new Set<string>();
|
|
229
|
-
if (reqLockContent) {
|
|
230
|
-
oldPackeges = new Set<string>(
|
|
231
|
-
reqLockContent
|
|
232
|
-
.split('\n')
|
|
233
|
-
.filter((line) => /^[a-zA-Z]/.test(line))
|
|
234
|
-
.map((line) => this.cleanPackageName(line))
|
|
235
|
-
.filter((line) => line !== ''),
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const toReinstall: string[] = [];
|
|
240
|
-
const toUninstall: string[] = [...this.difference(oldPackeges, requiredPackages)];
|
|
241
|
-
|
|
242
|
-
if (needsUpdate || this.needsUpdate) {
|
|
243
|
-
toReinstall.push(...requiredPackages);
|
|
244
|
-
} else {
|
|
245
|
-
toReinstall.push(...this.difference(requiredPackages, oldPackeges));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return { reInstall: toReinstall, uninstall: toUninstall };
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
private async updateDependencies(
|
|
252
|
-
type: 'server' | 'plugin',
|
|
253
|
-
requirementsPath: string,
|
|
254
|
-
requirementsContent: string,
|
|
255
|
-
reInstall: string[] = [],
|
|
256
|
-
uninstall: string[] = [],
|
|
257
|
-
): Promise<void> {
|
|
258
|
-
if (uninstall.length > 0) {
|
|
259
|
-
this.logger.trace(`Uninstalling ${type} packages: ${uninstall.join(', ')}`);
|
|
260
|
-
|
|
261
|
-
if (type === 'plugin') {
|
|
262
|
-
await this.uninstallPluginPackages(uninstall);
|
|
263
|
-
} else {
|
|
264
|
-
await this.uninstallServerPackages(uninstall);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
if (reInstall.length > 0) {
|
|
269
|
-
this.logger.trace(`Installing ${type} requirements...`);
|
|
270
|
-
|
|
271
|
-
if (type === 'plugin') {
|
|
272
|
-
await this.installPluginRequirements(requirementsPath);
|
|
273
|
-
} else {
|
|
274
|
-
await this.installServerRequirements(requirementsPath);
|
|
275
|
-
}
|
|
276
|
-
} else {
|
|
277
|
-
this.logger.trace(`Dependencies for ${type} are up to date`);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
private async installRequirements(pythonPath: string, requirementsPath: string): Promise<string> {
|
|
282
|
-
const args = [this.quotePath(pythonPath), '-m', 'pip', 'install', '--upgrade', 'pip', '-r', this.quotePath(requirementsPath)];
|
|
283
|
-
|
|
284
|
-
if ((process.env.SUDO_UID && process.env.SUDO_GID) || process.getuid?.() === 0) {
|
|
285
|
-
args.push('--root-user-action=ignore');
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
args.push('--use-pep517');
|
|
289
|
-
|
|
290
|
-
const command = args.join(' ');
|
|
291
|
-
this.logger.trace(`Installing requirements command: ${command}`);
|
|
292
|
-
|
|
293
|
-
const child = exec(command, { env: { ...process.env, PIP_DISABLE_PIP_VERSION_CHECK: '1' } });
|
|
294
|
-
|
|
295
|
-
const stdoutLine = createInterface({
|
|
296
|
-
input: child.stdout!,
|
|
297
|
-
terminal: false,
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
const stderrLine = createInterface({
|
|
301
|
-
input: child.stderr!,
|
|
302
|
-
terminal: false,
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
stdoutLine.on('line', (line: string) => {
|
|
306
|
-
this.logger.trace(line);
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
stderrLine.on('line', (line: string) => {
|
|
310
|
-
this.logger.error(line);
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
return new Promise((_resolve, _reject) => {
|
|
314
|
-
child.on('close', (code) => {
|
|
315
|
-
stdoutLine.close();
|
|
316
|
-
stderrLine.close();
|
|
317
|
-
|
|
318
|
-
if (code === 0) {
|
|
319
|
-
_resolve('Requirements installed');
|
|
320
|
-
} else {
|
|
321
|
-
_reject(new Error(`Installation process exited with code ${code}`));
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
private async installPackages(pythonPath: string, pkgs: string[]): Promise<string> {
|
|
328
|
-
if (pkgs.length === 0) return Promise.resolve('');
|
|
329
|
-
|
|
330
|
-
const args = [this.quotePath(pythonPath), '-m', 'pip', 'install', '--upgrade', 'pip'];
|
|
331
|
-
args.push(...pkgs.map((pkg) => (pkg.includes(' ') ? this.quotePath(pkg) : pkg)));
|
|
332
|
-
|
|
333
|
-
if ((process.env.SUDO_UID && process.env.SUDO_GID) || process.getuid?.() === 0) {
|
|
334
|
-
args.push('--root-user-action=ignore');
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
args.push('--use-pep517');
|
|
338
|
-
|
|
339
|
-
const command = args.join(' ');
|
|
340
|
-
this.logger.trace(`Installing packages command: ${command}`);
|
|
341
|
-
|
|
342
|
-
const child = exec(command, { env: { ...process.env, PIP_DISABLE_PIP_VERSION_CHECK: '1' } });
|
|
343
|
-
|
|
344
|
-
const stdoutLine = createInterface({
|
|
345
|
-
input: child.stdout!,
|
|
346
|
-
terminal: false,
|
|
347
|
-
});
|
|
348
|
-
|
|
349
|
-
const stderrLine = createInterface({
|
|
350
|
-
input: child.stderr!,
|
|
351
|
-
terminal: false,
|
|
352
|
-
});
|
|
353
|
-
|
|
354
|
-
stdoutLine.on('line', (line: string) => {
|
|
355
|
-
this.logger.trace(line);
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
stderrLine.on('line', (line: string) => {
|
|
359
|
-
this.logger.error(line);
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
return new Promise((_resolve, _reject) => {
|
|
363
|
-
child.on('close', (code) => {
|
|
364
|
-
stdoutLine.close();
|
|
365
|
-
stderrLine.close();
|
|
366
|
-
|
|
367
|
-
if (code === 0) {
|
|
368
|
-
_resolve('Packages installed');
|
|
369
|
-
} else {
|
|
370
|
-
_reject(new Error(`Installation process exited with code ${code}`));
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
private async uninstallPackages(pythonPath: string, pkgs: string[]): Promise<string> {
|
|
377
|
-
if (pkgs.length === 0) return Promise.resolve('');
|
|
378
|
-
|
|
379
|
-
const args = [this.quotePath(pythonPath), '-m', 'pip', 'uninstall', '-y'];
|
|
380
|
-
args.push(...pkgs.map((pkg) => (pkg.includes(' ') ? this.quotePath(pkg) : pkg)));
|
|
381
|
-
|
|
382
|
-
if ((process.env.SUDO_UID && process.env.SUDO_GID) || process.getuid?.() === 0) {
|
|
383
|
-
args.unshift('sudo', '-H');
|
|
384
|
-
args.push('--root-user-action=ignore');
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
const command = args.join(' ');
|
|
388
|
-
this.logger.trace(`Uninstalling packages command: ${command}`);
|
|
389
|
-
|
|
390
|
-
const child = exec(command, { env: { ...process.env, PIP_DISABLE_PIP_VERSION_CHECK: '1' } });
|
|
391
|
-
|
|
392
|
-
const stdoutLine = createInterface({
|
|
393
|
-
input: child.stdout!,
|
|
394
|
-
terminal: false,
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
const stderrLine = createInterface({
|
|
398
|
-
input: child.stderr!,
|
|
399
|
-
terminal: false,
|
|
400
|
-
});
|
|
401
|
-
|
|
402
|
-
stdoutLine.on('line', (line: string) => {
|
|
403
|
-
this.logger.trace(line);
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
stderrLine.on('line', (line: string) => {
|
|
407
|
-
this.logger.error(line);
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
return new Promise((_resolve, _reject) => {
|
|
411
|
-
child.on('close', (code) => {
|
|
412
|
-
stdoutLine.close();
|
|
413
|
-
stderrLine.close();
|
|
414
|
-
|
|
415
|
-
if (code === 0) {
|
|
416
|
-
_resolve('Packages uninstalled');
|
|
417
|
-
} else {
|
|
418
|
-
_reject(new Error(`Installation process exited with code ${code}`));
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
private async reinstallPackages(pythonPath: string, pkgs: string[]): Promise<string> {
|
|
425
|
-
if (pkgs.length === 0) return Promise.resolve('');
|
|
426
|
-
|
|
427
|
-
const args = [this.quotePath(pythonPath), '-m', 'pip', 'install', '--force-reinstall'];
|
|
428
|
-
args.push(...pkgs.map((pkg) => (pkg.includes(' ') ? this.quotePath(pkg) : pkg)));
|
|
429
|
-
|
|
430
|
-
if ((process.env.SUDO_UID && process.env.SUDO_GID) || process.getuid?.() === 0) {
|
|
431
|
-
args.push('--root-user-action=ignore');
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
args.push('--use-pep517');
|
|
435
|
-
|
|
436
|
-
const command = args.join(' ');
|
|
437
|
-
this.logger.trace(`Reinstalling packages command: ${command}`);
|
|
438
|
-
|
|
439
|
-
const child = exec(command, { env: { ...process.env, PIP_DISABLE_PIP_VERSION_CHECK: '1' } });
|
|
440
|
-
|
|
441
|
-
const stdoutLine = createInterface({
|
|
442
|
-
input: child.stdout!,
|
|
443
|
-
terminal: false,
|
|
444
|
-
});
|
|
445
|
-
|
|
446
|
-
const stderrLine = createInterface({
|
|
447
|
-
input: child.stderr!,
|
|
448
|
-
terminal: false,
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
stdoutLine.on('line', (line: string) => {
|
|
452
|
-
this.logger.trace(line);
|
|
453
|
-
});
|
|
454
|
-
|
|
455
|
-
stderrLine.on('line', (line: string) => {
|
|
456
|
-
this.logger.error(line);
|
|
457
|
-
});
|
|
458
|
-
|
|
459
|
-
return new Promise((_resolve, _reject) => {
|
|
460
|
-
child.on('close', (code) => {
|
|
461
|
-
stdoutLine.close();
|
|
462
|
-
stderrLine.close();
|
|
463
|
-
|
|
464
|
-
if (code === 0) {
|
|
465
|
-
_resolve('Packages reinstalled');
|
|
466
|
-
} else {
|
|
467
|
-
_reject(new Error(`Installation process exited with code ${code}`));
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
private async ensureVenv(): Promise<void> {
|
|
474
|
-
if (!this.venvPath) {
|
|
475
|
-
throw new Error('Venv path is not defined');
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if (!existsSync(this.venvPath)) {
|
|
479
|
-
await this.createVenv();
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
private async createVenv(): Promise<void> {
|
|
484
|
-
if (!this.venvPath) {
|
|
485
|
-
throw new Error('Venv path is not defined');
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (existsSync(this.venvPath)) {
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
this.needsUpdate = true;
|
|
493
|
-
|
|
494
|
-
const args = [this.quotePath(this.serverPythonPath), '-m', 'virtualenv', this.quotePath(this.venvPath)];
|
|
495
|
-
|
|
496
|
-
const command = args.join(' ');
|
|
497
|
-
this.logger.trace(`Creating venv using virtualenv: ${command}`);
|
|
498
|
-
|
|
499
|
-
const child = exec(command, { env: { ...process.env, VIRTUALENV_PYTHON: this.serverPythonPath } });
|
|
500
|
-
|
|
501
|
-
const stdoutLine = createInterface({
|
|
502
|
-
input: child.stdout!,
|
|
503
|
-
terminal: false,
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
const stderrLine = createInterface({
|
|
507
|
-
input: child.stderr!,
|
|
508
|
-
terminal: false,
|
|
509
|
-
});
|
|
510
|
-
|
|
511
|
-
stdoutLine.on('line', (line: string) => {
|
|
512
|
-
this.logger.trace(line);
|
|
513
|
-
});
|
|
514
|
-
|
|
515
|
-
stderrLine.on('line', (line: string) => {
|
|
516
|
-
this.logger.error(line);
|
|
517
|
-
});
|
|
518
|
-
|
|
519
|
-
return new Promise((_resolve, _reject) => {
|
|
520
|
-
child.on('close', (code) => {
|
|
521
|
-
stdoutLine.close();
|
|
522
|
-
stderrLine.close();
|
|
523
|
-
|
|
524
|
-
if (code === 0) {
|
|
525
|
-
_resolve();
|
|
526
|
-
} else {
|
|
527
|
-
_reject(new Error(`Virtualenv creation process exited with code ${code}`));
|
|
528
|
-
}
|
|
529
|
-
});
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
private async removeVenv(): Promise<void> {
|
|
534
|
-
if (!this.venvPath) {
|
|
535
|
-
throw new Error('Venv path is not defined');
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
await rm(this.venvPath, { recursive: true, force: true });
|
|
539
|
-
|
|
540
|
-
const parentDirectory = dirname(this.venvPath);
|
|
541
|
-
const directories = await readdir(parentDirectory, { withFileTypes: true });
|
|
542
|
-
|
|
543
|
-
const pythonDirs = directories.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith('python-')).map((dirent) => join(parentDirectory, dirent.name));
|
|
544
|
-
|
|
545
|
-
for (const dir of pythonDirs) {
|
|
546
|
-
await rm(dir, { recursive: true, force: true });
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
private async removeOldVersions(): Promise<void> {
|
|
551
|
-
const currentVersion = this.version;
|
|
552
|
-
const pythonDirs = await readdir(this.installPath);
|
|
553
|
-
|
|
554
|
-
for (const dir of pythonDirs) {
|
|
555
|
-
const match = /^python-(\d+\.\d+(?:\.\d+)?)(.*)$/.exec(dir);
|
|
556
|
-
|
|
557
|
-
if (match) {
|
|
558
|
-
const version = match[1];
|
|
559
|
-
const platformSuffix = match[2];
|
|
560
|
-
|
|
561
|
-
if (compareVersions(version, currentVersion) === -1) {
|
|
562
|
-
const fullPath = join(this.installPath, `python-${version}${platformSuffix}`);
|
|
563
|
-
const requirementsLockPath = join(this.installPath, `requirements-lock-${version}.txt`);
|
|
564
|
-
|
|
565
|
-
this.logger.trace(`Removing old Python version: ${version}`);
|
|
566
|
-
|
|
567
|
-
await remove(fullPath);
|
|
568
|
-
await remove(requirementsLockPath);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
private getMajorMinorVersion(version: string): string {
|
|
575
|
-
const match = /^(\d+)(?:\.(\d+))?/.exec(version);
|
|
576
|
-
if (match) {
|
|
577
|
-
const major = match[1];
|
|
578
|
-
const minor = match[2] || '';
|
|
579
|
-
return minor ? `${major}.${minor}` : major;
|
|
580
|
-
}
|
|
581
|
-
return '';
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
private cleanPackageName(line: string): string {
|
|
585
|
-
const regex = /^([a-zA-Z0-9_-]+)/;
|
|
586
|
-
const match = regex.exec(line);
|
|
587
|
-
return match ? match[1] : '';
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
private difference(setA: Set<string>, setB: Set<string>): Set<string> {
|
|
591
|
-
return new Set([...setA].filter((x) => !setB.has(x)));
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
private quotePath(path: string): string {
|
|
595
|
-
return platform() === 'win32' ? `"${path.replace(/"/g, '\\"')}"` : `'${path.replace(/'/g, "\\'")}'`;
|
|
596
|
-
}
|
|
597
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist/server",
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"module": "NodeNext",
|
|
6
|
-
"moduleResolution": "NodeNext",
|
|
7
|
-
"lib": [
|
|
8
|
-
"ES2022",
|
|
9
|
-
"DOM"
|
|
10
|
-
],
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"sourceMap": true,
|
|
13
|
-
"strict": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"preserveConstEnums": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"useUnknownInCatchVariables": false,
|
|
18
|
-
"allowSyntheticDefaultImports": true,
|
|
19
|
-
"resolveJsonModule": true,
|
|
20
|
-
"experimentalDecorators": true,
|
|
21
|
-
"emitDecoratorMetadata": true,
|
|
22
|
-
"verbatimModuleSyntax": true,
|
|
23
|
-
"noImplicitAny": true,
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"*.d.ts",
|
|
27
|
-
"src",
|
|
28
|
-
"bin",
|
|
29
|
-
"types",
|
|
30
|
-
"install"
|
|
31
|
-
],
|
|
32
|
-
"exclude": [
|
|
33
|
-
"node_modules",
|
|
34
|
-
"**/test/**",
|
|
35
|
-
"**/wasm/**"
|
|
36
|
-
]
|
|
37
|
-
}
|
package/updates.config.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|