systeminformation 5.33.2 → 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +882 -931
- package/dist/audio.d.ts +1 -0
- package/dist/audio.js +18 -0
- package/dist/baseboard.d.ts +1 -0
- package/dist/baseboard.js +17 -0
- package/dist/battery.d.ts +1 -0
- package/dist/battery.js +19 -0
- package/dist/bios.d.ts +1 -0
- package/dist/bios.js +17 -0
- package/dist/block-devices.d.ts +1 -0
- package/dist/block-devices.js +17 -0
- package/dist/bluetooth.d.ts +1 -0
- package/dist/bluetooth.js +17 -0
- package/dist/bsd/battery.d.ts +2 -0
- package/dist/bsd/battery.js +27 -0
- package/dist/bsd/cpu-cache.d.ts +1 -0
- package/dist/bsd/cpu-cache.js +37 -0
- package/dist/bsd/cpu-flags.d.ts +1 -0
- package/dist/bsd/cpu-flags.js +28 -0
- package/dist/bsd/cpu-temperature.d.ts +1 -0
- package/dist/bsd/cpu-temperature.js +29 -0
- package/dist/bsd/cpu.d.ts +1 -0
- package/dist/bsd/cpu.js +98 -0
- package/dist/bsd/index.d.ts +38 -0
- package/dist/bsd/index.js +85 -0
- package/dist/bsd/mem.d.ts +1 -0
- package/dist/bsd/mem.js +37 -0
- package/dist/bsd/network-stats.d.ts +2 -0
- package/dist/bsd/network-stats.js +92 -0
- package/dist/bsd/os-info.d.ts +21 -0
- package/dist/bsd/os-info.js +38 -0
- package/dist/bsd/uuid.d.ts +2 -0
- package/dist/bsd/uuid.js +30 -0
- package/dist/camera.d.ts +1 -0
- package/dist/camera.js +17 -0
- package/dist/chassis.d.ts +1 -0
- package/dist/chassis.js +17 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +107 -0
- package/dist/common/codepage.d.ts +1 -0
- package/dist/common/codepage.js +43 -0
- package/dist/common/const.d.ts +25 -0
- package/dist/common/const.js +26 -0
- package/dist/common/cpu.d.ts +2 -0
- package/dist/common/cpu.js +12 -0
- package/dist/common/darwin.d.ts +6 -0
- package/dist/common/darwin.js +266 -0
- package/dist/common/datetime.d.ts +9 -0
- package/dist/common/datetime.js +161 -0
- package/dist/common/defaults.d.ts +25 -0
- package/dist/common/defaults.js +299 -0
- package/dist/common/exec.d.ts +10 -0
- package/dist/common/exec.js +69 -0
- package/dist/common/files.d.ts +2 -0
- package/dist/common/files.js +39 -0
- package/dist/common/filesys.d.ts +11 -0
- package/dist/common/filesys.js +282 -0
- package/dist/common/host.d.ts +2 -0
- package/dist/common/host.js +67 -0
- package/dist/common/index.d.ts +12 -0
- package/dist/common/index.js +146 -0
- package/dist/common/internet.d.ts +1 -0
- package/dist/common/internet.js +47 -0
- package/dist/common/mappings.d.ts +55 -0
- package/dist/common/mappings.js +4133 -0
- package/dist/common/network.d.ts +8 -0
- package/dist/common/network.js +162 -0
- package/dist/common/nvidia.d.ts +22 -0
- package/dist/common/nvidia.js +159 -0
- package/dist/common/parse.d.ts +13 -0
- package/dist/common/parse.js +157 -0
- package/dist/common/raspberry.d.ts +5 -0
- package/dist/common/raspberry.js +277 -0
- package/dist/common/security.d.ts +31 -0
- package/dist/common/security.js +241 -0
- package/dist/common/types.d.ts +992 -0
- package/dist/common/types.js +2 -0
- package/dist/common/windows.d.ts +58 -0
- package/dist/common/windows.js +292 -0
- package/dist/cpu-cache.d.ts +1 -0
- package/dist/cpu-cache.js +19 -0
- package/dist/cpu-current-load.d.ts +2 -0
- package/dist/cpu-current-load.js +249 -0
- package/dist/cpu-current-speed.d.ts +3 -0
- package/dist/cpu-current-speed.js +84 -0
- package/dist/cpu-flags.d.ts +1 -0
- package/dist/cpu-flags.js +19 -0
- package/dist/cpu-full-load.d.ts +1 -0
- package/dist/cpu-full-load.js +30 -0
- package/dist/cpu-temperature.d.ts +1 -0
- package/dist/cpu-temperature.js +19 -0
- package/dist/cpu.d.ts +1 -0
- package/dist/cpu.js +19 -0
- package/dist/darwin/audio.d.ts +2 -0
- package/dist/darwin/audio.js +46 -0
- package/dist/darwin/baseboard.d.ts +1 -0
- package/dist/darwin/baseboard.js +48 -0
- package/dist/darwin/battery.d.ts +2 -0
- package/dist/darwin/battery.js +65 -0
- package/dist/darwin/bios.d.ts +1 -0
- package/dist/darwin/bios.js +45 -0
- package/dist/darwin/block-devices.d.ts +2 -0
- package/dist/darwin/block-devices.js +101 -0
- package/dist/darwin/bluetooth.d.ts +3 -0
- package/dist/darwin/bluetooth.js +84 -0
- package/dist/darwin/camera.d.ts +2 -0
- package/dist/darwin/camera.js +55 -0
- package/dist/darwin/chassis.d.ts +2 -0
- package/dist/darwin/chassis.js +32 -0
- package/dist/darwin/cpu-cache.d.ts +2 -0
- package/dist/darwin/cpu-cache.js +29 -0
- package/dist/darwin/cpu-flags.d.ts +1 -0
- package/dist/darwin/cpu-flags.js +16 -0
- package/dist/darwin/cpu-temperature.d.ts +1 -0
- package/dist/darwin/cpu-temperature.js +44 -0
- package/dist/darwin/cpu.d.ts +1 -0
- package/dist/darwin/cpu.js +69 -0
- package/dist/darwin/disk-layout.d.ts +2 -0
- package/dist/darwin/disk-layout.js +231 -0
- package/dist/darwin/disks-io.d.ts +2 -0
- package/dist/darwin/disks-io.js +56 -0
- package/dist/darwin/displays.d.ts +2 -0
- package/dist/darwin/displays.js +98 -0
- package/dist/darwin/fs-open-files.d.ts +2 -0
- package/dist/darwin/fs-open-files.js +27 -0
- package/dist/darwin/fs-stats.d.ts +2 -0
- package/dist/darwin/fs-stats.js +47 -0
- package/dist/darwin/gpu.d.ts +2 -0
- package/dist/darwin/gpu.js +55 -0
- package/dist/darwin/index.d.ts +56 -0
- package/dist/darwin/index.js +122 -0
- package/dist/darwin/keyboard.d.ts +2 -0
- package/dist/darwin/keyboard.js +73 -0
- package/dist/darwin/mem-layout.d.ts +2 -0
- package/dist/darwin/mem-layout.js +60 -0
- package/dist/darwin/mem.d.ts +2 -0
- package/dist/darwin/mem.js +50 -0
- package/dist/darwin/mouse.d.ts +2 -0
- package/dist/darwin/mouse.js +78 -0
- package/dist/darwin/network-connections.d.ts +2 -0
- package/dist/darwin/network-connections.js +98 -0
- package/dist/darwin/network-gateway-default.d.ts +1 -0
- package/dist/darwin/network-gateway-default.js +26 -0
- package/dist/darwin/network-interface-default.d.ts +2 -0
- package/dist/darwin/network-interface-default.js +41 -0
- package/dist/darwin/network-interfaces.d.ts +2 -0
- package/dist/darwin/network-interfaces.js +205 -0
- package/dist/darwin/network-stats.d.ts +2 -0
- package/dist/darwin/network-stats.js +86 -0
- package/dist/darwin/npm.d.ts +1 -0
- package/dist/darwin/npm.js +5 -0
- package/dist/darwin/npu.d.ts +2 -0
- package/dist/darwin/npu.js +41 -0
- package/dist/darwin/os-info.d.ts +1 -0
- package/dist/darwin/os-info.js +110 -0
- package/dist/darwin/pci.d.ts +2 -0
- package/dist/darwin/pci.js +37 -0
- package/dist/darwin/printer.d.ts +2 -0
- package/dist/darwin/printer.js +45 -0
- package/dist/darwin/software.d.ts +2 -0
- package/dist/darwin/software.js +39 -0
- package/dist/darwin/system.d.ts +1 -0
- package/dist/darwin/system.js +29 -0
- package/dist/darwin/thunderbolt.d.ts +1 -0
- package/dist/darwin/thunderbolt.js +53 -0
- package/dist/darwin/usb.d.ts +3 -0
- package/dist/darwin/usb.js +69 -0
- package/dist/darwin/users.d.ts +2 -0
- package/dist/darwin/users.js +13 -0
- package/dist/darwin/uuid.d.ts +2 -0
- package/dist/darwin/uuid.js +39 -0
- package/dist/darwin/wifi-connections.d.ts +2 -0
- package/dist/darwin/wifi-connections.js +60 -0
- package/dist/darwin/wifi-interfaces.d.ts +2 -0
- package/dist/darwin/wifi-interfaces.js +27 -0
- package/dist/darwin/wifi-networks.d.ts +2 -0
- package/dist/darwin/wifi-networks.js +61 -0
- package/dist/disk-layout.d.ts +1 -0
- package/dist/disk-layout.js +17 -0
- package/dist/disks-io.d.ts +1 -0
- package/dist/disks-io.js +17 -0
- package/dist/displays.d.ts +1 -0
- package/dist/displays.js +17 -0
- package/dist/docker-socket.d.ts +11 -0
- package/dist/docker-socket.js +113 -0
- package/dist/docker.d.ts +102 -0
- package/dist/docker.js +532 -0
- package/dist/fs-open-files.d.ts +1 -0
- package/dist/fs-open-files.js +17 -0
- package/dist/fs-size.d.ts +1 -0
- package/dist/fs-size.js +23 -0
- package/dist/fs-stats.d.ts +1 -0
- package/dist/fs-stats.js +17 -0
- package/dist/get-data.d.ts +110 -0
- package/dist/get-data.js +151 -0
- package/dist/get.d.ts +5 -0
- package/dist/get.js +117 -0
- package/dist/gpu.d.ts +1 -0
- package/dist/gpu.js +17 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +130 -0
- package/dist/inet-checksite.d.ts +1 -0
- package/dist/inet-checksite.js +11 -0
- package/dist/inet-latency.d.ts +1 -0
- package/dist/inet-latency.js +17 -0
- package/dist/keyboard.d.ts +1 -0
- package/dist/keyboard.js +17 -0
- package/dist/linux/audio.d.ts +2 -0
- package/dist/linux/audio.js +67 -0
- package/dist/linux/baseboard.d.ts +1 -0
- package/dist/linux/baseboard.js +81 -0
- package/dist/linux/battery.d.ts +2 -0
- package/dist/linux/battery.js +88 -0
- package/dist/linux/bios.d.ts +2 -0
- package/dist/linux/bios.js +55 -0
- package/dist/linux/block-devices.d.ts +2 -0
- package/dist/linux/block-devices.js +30 -0
- package/dist/linux/bluetooth.d.ts +2 -0
- package/dist/linux/bluetooth.js +86 -0
- package/dist/linux/camera.d.ts +2 -0
- package/dist/linux/camera.js +63 -0
- package/dist/linux/chassis.d.ts +1 -0
- package/dist/linux/chassis.js +41 -0
- package/dist/linux/cpu-cache.d.ts +1 -0
- package/dist/linux/cpu-cache.js +35 -0
- package/dist/linux/cpu-flags.d.ts +1 -0
- package/dist/linux/cpu-flags.js +33 -0
- package/dist/linux/cpu-temperature.d.ts +1 -0
- package/dist/linux/cpu-temperature.js +179 -0
- package/dist/linux/cpu.d.ts +1 -0
- package/dist/linux/cpu.js +135 -0
- package/dist/linux/disk-layout.d.ts +2 -0
- package/dist/linux/disk-layout.js +151 -0
- package/dist/linux/disks-io.d.ts +2 -0
- package/dist/linux/disks-io.js +58 -0
- package/dist/linux/displays.d.ts +2 -0
- package/dist/linux/displays.js +193 -0
- package/dist/linux/fs-open-files.d.ts +2 -0
- package/dist/linux/fs-open-files.js +44 -0
- package/dist/linux/fs-size.d.ts +2 -0
- package/dist/linux/fs-size.js +157 -0
- package/dist/linux/fs-stats.d.ts +2 -0
- package/dist/linux/fs-stats.js +65 -0
- package/dist/linux/gpu.d.ts +2 -0
- package/dist/linux/gpu.js +273 -0
- package/dist/linux/index.d.ts +56 -0
- package/dist/linux/index.js +122 -0
- package/dist/linux/inet-latency.d.ts +1 -0
- package/dist/linux/inet-latency.js +39 -0
- package/dist/linux/keyboard.d.ts +2 -0
- package/dist/linux/keyboard.js +61 -0
- package/dist/linux/mem-layout.d.ts +2 -0
- package/dist/linux/mem-layout.js +112 -0
- package/dist/linux/mem.d.ts +2 -0
- package/dist/linux/mem.js +61 -0
- package/dist/linux/mouse.d.ts +2 -0
- package/dist/linux/mouse.js +73 -0
- package/dist/linux/network-connections.d.ts +2 -0
- package/dist/linux/network-connections.js +114 -0
- package/dist/linux/network-gateway-default.d.ts +1 -0
- package/dist/linux/network-gateway-default.js +22 -0
- package/dist/linux/network-interface-default.d.ts +2 -0
- package/dist/linux/network-interface-default.js +46 -0
- package/dist/linux/network-interfaces.d.ts +3 -0
- package/dist/linux/network-interfaces.js +353 -0
- package/dist/linux/network-stats.d.ts +2 -0
- package/dist/linux/network-stats.js +99 -0
- package/dist/linux/npm.d.ts +1 -0
- package/dist/linux/npm.js +5 -0
- package/dist/linux/npu.d.ts +2 -0
- package/dist/linux/npu.js +77 -0
- package/dist/linux/os-info.d.ts +1 -0
- package/dist/linux/os-info.js +104 -0
- package/dist/linux/pci.d.ts +2 -0
- package/dist/linux/pci.js +56 -0
- package/dist/linux/printer.d.ts +2 -0
- package/dist/linux/printer.js +80 -0
- package/dist/linux/process-load.d.ts +2 -0
- package/dist/linux/process-load.js +164 -0
- package/dist/linux/processes.d.ts +2 -0
- package/dist/linux/processes.js +358 -0
- package/dist/linux/services.d.ts +2 -0
- package/dist/linux/services.js +222 -0
- package/dist/linux/software.d.ts +2 -0
- package/dist/linux/software.js +110 -0
- package/dist/linux/system.d.ts +1 -0
- package/dist/linux/system.js +186 -0
- package/dist/linux/thunderbolt.d.ts +2 -0
- package/dist/linux/thunderbolt.js +51 -0
- package/dist/linux/time.d.ts +6 -0
- package/dist/linux/time.js +28 -0
- package/dist/linux/usb.d.ts +2 -0
- package/dist/linux/usb.js +62 -0
- package/dist/linux/users.d.ts +2 -0
- package/dist/linux/users.js +102 -0
- package/dist/linux/uuid.d.ts +2 -0
- package/dist/linux/uuid.js +44 -0
- package/dist/linux/wifi-connections.d.ts +2 -0
- package/dist/linux/wifi-connections.js +196 -0
- package/dist/linux/wifi-interfaces.d.ts +2 -0
- package/dist/linux/wifi-interfaces.js +96 -0
- package/dist/linux/wifi-networks.d.ts +2 -0
- package/dist/linux/wifi-networks.js +176 -0
- package/dist/mem-layout.d.ts +1 -0
- package/dist/mem-layout.js +17 -0
- package/dist/mem.d.ts +1 -0
- package/dist/mem.js +19 -0
- package/dist/mouse.d.ts +1 -0
- package/dist/mouse.js +17 -0
- package/dist/network-connections.d.ts +1 -0
- package/dist/network-connections.js +17 -0
- package/dist/network-gateway-default.d.ts +1 -0
- package/dist/network-gateway-default.js +17 -0
- package/dist/network-interface-default.d.ts +1 -0
- package/dist/network-interface-default.js +17 -0
- package/dist/network-interfaces.d.ts +1 -0
- package/dist/network-interfaces.js +18 -0
- package/dist/network-stats.d.ts +1 -0
- package/dist/network-stats.js +19 -0
- package/dist/npm.d.ts +2 -0
- package/dist/npm.js +22 -0
- package/dist/npu.d.ts +1 -0
- package/dist/npu.js +17 -0
- package/dist/observe.d.ts +5 -0
- package/dist/observe.js +16 -0
- package/dist/os-info.d.ts +1 -0
- package/dist/os-info.js +21 -0
- package/dist/pci.d.ts +1 -0
- package/dist/pci.js +17 -0
- package/dist/printer.d.ts +1 -0
- package/dist/printer.js +17 -0
- package/dist/process-load.d.ts +1 -0
- package/dist/process-load.js +15 -0
- package/dist/processes.d.ts +1 -0
- package/dist/processes.js +15 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +15 -0
- package/dist/shell.d.ts +1 -0
- package/dist/shell.js +16 -0
- package/dist/software.d.ts +1 -0
- package/dist/software.js +17 -0
- package/dist/sun/index.d.ts +17 -0
- package/dist/sun/index.js +43 -0
- package/dist/sun/inet-latency.d.ts +1 -0
- package/dist/sun/inet-latency.js +30 -0
- package/dist/sun/os-info.d.ts +1 -0
- package/dist/sun/os-info.js +26 -0
- package/dist/sun/users.d.ts +2 -0
- package/dist/sun/users.js +13 -0
- package/dist/system.d.ts +1 -0
- package/dist/system.js +17 -0
- package/dist/thunderbolt.d.ts +1 -0
- package/dist/thunderbolt.js +17 -0
- package/dist/time.d.ts +6 -0
- package/dist/time.js +28 -0
- package/dist/usb.d.ts +1 -0
- package/dist/usb.js +17 -0
- package/dist/users.d.ts +1 -0
- package/dist/users.js +21 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +19 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +16 -0
- package/dist/versions.d.ts +2 -0
- package/dist/versions.js +1122 -0
- package/dist/virtualbox.d.ts +2 -0
- package/dist/virtualbox.js +89 -0
- package/dist/wifi-connections.d.ts +1 -0
- package/dist/wifi-connections.js +17 -0
- package/dist/wifi-interfaces.d.ts +1 -0
- package/dist/wifi-interfaces.js +17 -0
- package/dist/wifi-networks.d.ts +1 -0
- package/dist/wifi-networks.js +17 -0
- package/dist/windows/audio.d.ts +2 -0
- package/dist/windows/audio.js +23 -0
- package/dist/windows/baseboard.d.ts +1 -0
- package/dist/windows/baseboard.js +35 -0
- package/dist/windows/battery.d.ts +1 -0
- package/dist/windows/battery.js +81 -0
- package/dist/windows/bios.d.ts +1 -0
- package/dist/windows/bios.js +37 -0
- package/dist/windows/block-devices.d.ts +2 -0
- package/dist/windows/block-devices.js +48 -0
- package/dist/windows/bluetooth.d.ts +2 -0
- package/dist/windows/bluetooth.js +31 -0
- package/dist/windows/camera.d.ts +2 -0
- package/dist/windows/camera.js +47 -0
- package/dist/windows/chassis.d.ts +1 -0
- package/dist/windows/chassis.js +29 -0
- package/dist/windows/cpu-cache.d.ts +2 -0
- package/dist/windows/cpu-cache.js +59 -0
- package/dist/windows/cpu-flags.d.ts +1 -0
- package/dist/windows/cpu-flags.js +61 -0
- package/dist/windows/cpu-temperature.d.ts +1 -0
- package/dist/windows/cpu-temperature.js +32 -0
- package/dist/windows/cpu.d.ts +1 -0
- package/dist/windows/cpu.js +96 -0
- package/dist/windows/disk-layout.d.ts +2 -0
- package/dist/windows/disk-layout.js +112 -0
- package/dist/windows/disks-io.d.ts +2 -0
- package/dist/windows/disks-io.js +43 -0
- package/dist/windows/displays.d.ts +2 -0
- package/dist/windows/displays.js +213 -0
- package/dist/windows/fs-open-files.d.ts +2 -0
- package/dist/windows/fs-open-files.js +22 -0
- package/dist/windows/fs-size.d.ts +2 -0
- package/dist/windows/fs-size.js +47 -0
- package/dist/windows/fs-stats.d.ts +2 -0
- package/dist/windows/fs-stats.js +37 -0
- package/dist/windows/gpu.d.ts +2 -0
- package/dist/windows/gpu.js +128 -0
- package/dist/windows/index.d.ts +56 -0
- package/dist/windows/index.js +122 -0
- package/dist/windows/inet-latency.d.ts +1 -0
- package/dist/windows/inet-latency.js +34 -0
- package/dist/windows/keyboard.d.ts +2 -0
- package/dist/windows/keyboard.js +47 -0
- package/dist/windows/mem-layout.d.ts +2 -0
- package/dist/windows/mem-layout.js +39 -0
- package/dist/windows/mem.d.ts +2 -0
- package/dist/windows/mem.js +33 -0
- package/dist/windows/mouse.d.ts +2 -0
- package/dist/windows/mouse.js +64 -0
- package/dist/windows/network-connections.d.ts +2 -0
- package/dist/windows/network-connections.js +93 -0
- package/dist/windows/network-gateway-default.d.ts +1 -0
- package/dist/windows/network-gateway-default.js +36 -0
- package/dist/windows/network-interface-default.d.ts +2 -0
- package/dist/windows/network-interface-default.js +56 -0
- package/dist/windows/network-interfaces.d.ts +2 -0
- package/dist/windows/network-interfaces.js +346 -0
- package/dist/windows/network-stats.d.ts +2 -0
- package/dist/windows/network-stats.js +135 -0
- package/dist/windows/npm.d.ts +1 -0
- package/dist/windows/npm.js +5 -0
- package/dist/windows/npu.d.ts +2 -0
- package/dist/windows/npu.js +29 -0
- package/dist/windows/os-info.d.ts +1 -0
- package/dist/windows/os-info.js +65 -0
- package/dist/windows/pci.d.ts +2 -0
- package/dist/windows/pci.js +33 -0
- package/dist/windows/printer.d.ts +2 -0
- package/dist/windows/printer.js +36 -0
- package/dist/windows/process-load.d.ts +2 -0
- package/dist/windows/process-load.js +121 -0
- package/dist/windows/processes.d.ts +9 -0
- package/dist/windows/processes.js +139 -0
- package/dist/windows/services.d.ts +2 -0
- package/dist/windows/services.js +83 -0
- package/dist/windows/shell.d.ts +1 -0
- package/dist/windows/shell.js +19 -0
- package/dist/windows/software.d.ts +2 -0
- package/dist/windows/software.js +53 -0
- package/dist/windows/system.d.ts +1 -0
- package/dist/windows/system.js +98 -0
- package/dist/windows/thunderbolt.d.ts +2 -0
- package/dist/windows/thunderbolt.js +34 -0
- package/dist/windows/usb.d.ts +2 -0
- package/dist/windows/usb.js +37 -0
- package/dist/windows/users.d.ts +2 -0
- package/dist/windows/users.js +151 -0
- package/dist/windows/uuid.d.ts +2 -0
- package/dist/windows/uuid.js +28 -0
- package/dist/windows/wifi-connections.d.ts +2 -0
- package/dist/windows/wifi-connections.js +56 -0
- package/dist/windows/wifi-interfaces.d.ts +2 -0
- package/dist/windows/wifi-interfaces.js +45 -0
- package/dist/windows/wifi-networks.d.ts +2 -0
- package/dist/windows/wifi-networks.js +50 -0
- package/package.json +78 -12
- package/lib/audio.js +0 -277
- package/lib/battery.js +0 -334
- package/lib/bluetooth.js +0 -315
- package/lib/bluetoothVendors.js +0 -1138
- package/lib/cli.js +0 -100
- package/lib/cpu.js +0 -2285
- package/lib/docker.js +0 -791
- package/lib/dockerSocket.js +0 -117
- package/lib/filesystem.js +0 -1832
- package/lib/graphics.js +0 -1321
- package/lib/index.d.ts +0 -1051
- package/lib/index.js +0 -520
- package/lib/internet.js +0 -259
- package/lib/memory.js +0 -622
- package/lib/network.js +0 -2008
- package/lib/osinfo.js +0 -1321
- package/lib/printer.js +0 -209
- package/lib/processes.js +0 -1459
- package/lib/system.js +0 -855
- package/lib/usb.js +0 -309
- package/lib/users.js +0 -412
- package/lib/util.js +0 -2824
- package/lib/virtualbox.js +0 -116
- package/lib/wifi.js +0 -839
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.audio = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const const_1 = require("../common/const");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const getAudioPci = async () => {
|
|
10
|
+
const result = [];
|
|
11
|
+
try {
|
|
12
|
+
const { stdout } = await (0, exec_1.exec)('lspci -v 2>/dev/null', const_1.execOptsLinux);
|
|
13
|
+
const parts = stdout.split(`${node_os_1.EOL}${node_os_1.EOL}`);
|
|
14
|
+
parts.forEach((part) => {
|
|
15
|
+
const lines = part.split(node_os_1.EOL);
|
|
16
|
+
if (lines?.length && lines[0].toLowerCase().indexOf('audio') >= 0) {
|
|
17
|
+
result.push({
|
|
18
|
+
slotId: lines[0].split(' ')[0],
|
|
19
|
+
driver: (0, common_1.getValue)(lines, 'Kernel driver in use', ':', true) || (0, common_1.getValue)(lines, 'Kernel modules', ':', true)
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const parseAudioPci = (lines, audioPCI) => {
|
|
30
|
+
const slotId = (0, common_1.getValue)(lines, 'Slot');
|
|
31
|
+
const pciMatch = audioPCI.filter((item) => {
|
|
32
|
+
return item.slotId === slotId;
|
|
33
|
+
});
|
|
34
|
+
const name = (0, common_1.getValue)(lines, 'SDevice');
|
|
35
|
+
return {
|
|
36
|
+
id: slotId,
|
|
37
|
+
name,
|
|
38
|
+
manufacturer: (0, common_1.getValue)(lines, 'SVendor'),
|
|
39
|
+
revision: (0, common_1.getValue)(lines, 'Rev'),
|
|
40
|
+
driver: pciMatch && pciMatch.length === 1 && pciMatch[0].driver ? pciMatch[0].driver : '',
|
|
41
|
+
default: null,
|
|
42
|
+
channel: 'PCIe',
|
|
43
|
+
type: (0, mappings_1.audioTypeLabel)(name),
|
|
44
|
+
in: null,
|
|
45
|
+
out: null,
|
|
46
|
+
status: 'online'
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const audio = async () => {
|
|
50
|
+
await (0, common_1.nextTick)();
|
|
51
|
+
const result = [];
|
|
52
|
+
try {
|
|
53
|
+
const { stdout } = await (0, exec_1.exec)('lspci -vmm 2>/dev/null', const_1.execOptsLinux);
|
|
54
|
+
const audioPCI = await getAudioPci();
|
|
55
|
+
const parts = stdout.toString().split(`${node_os_1.EOL}${node_os_1.EOL}`);
|
|
56
|
+
parts.forEach((part) => {
|
|
57
|
+
const lines = part.split('\n');
|
|
58
|
+
if ((0, common_1.getValue)(lines, 'class', ':', true).toLowerCase().indexOf('audio') >= 0) {
|
|
59
|
+
const audio = parseAudioPci(lines, audioPCI);
|
|
60
|
+
result.push(audio);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch { }
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
exports.audio = audio;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const baseboard: () => Promise<any>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseboard = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const const_1 = require("../common/const");
|
|
8
|
+
const defaults_1 = require("../common/defaults");
|
|
9
|
+
const exec_1 = require("../common/exec");
|
|
10
|
+
const parse_1 = require("../common/parse");
|
|
11
|
+
const raspberry_1 = require("../common/raspberry");
|
|
12
|
+
const baseboard = async () => {
|
|
13
|
+
await (0, common_1.nextTick)();
|
|
14
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initBaseboard);
|
|
15
|
+
let cmd = '';
|
|
16
|
+
if (process.arch === 'arm') {
|
|
17
|
+
cmd = 'cat /proc/cpuinfo | grep Serial';
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
cmd = 'export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL';
|
|
21
|
+
}
|
|
22
|
+
const workload = [];
|
|
23
|
+
workload.push((0, exec_1.exec)(cmd, const_1.execOptsLinux));
|
|
24
|
+
workload.push((0, exec_1.exec)('export LC_ALL=C; dmidecode -t memory 2>/dev/null', const_1.execOptsLinux));
|
|
25
|
+
const data = await Promise.allSettled(workload).then((results) => results.map((result) => (result.status === 'fulfilled' ? result.value : null)));
|
|
26
|
+
let lines = data[0] ? data[0].stdout.split('\n') : [''];
|
|
27
|
+
let manufacturer = (0, common_1.getValue)(lines, 'Manufacturer');
|
|
28
|
+
let model = (0, common_1.getValue)(lines, 'Product Name');
|
|
29
|
+
let version = (0, common_1.getValue)(lines, 'Version');
|
|
30
|
+
let serial = (0, common_1.getValue)(lines, 'Serial Number');
|
|
31
|
+
let assetTag = (0, common_1.getValue)(lines, 'Asset Tag');
|
|
32
|
+
cmd = `echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;
|
|
33
|
+
echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;
|
|
34
|
+
echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;
|
|
35
|
+
echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;
|
|
36
|
+
echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;
|
|
37
|
+
try {
|
|
38
|
+
const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
|
|
39
|
+
lines = stdout.split('\n');
|
|
40
|
+
manufacturer = !manufacturer ? (0, common_1.getValue)(lines, 'board_vendor') : manufacturer;
|
|
41
|
+
model = !model ? (0, common_1.getValue)(lines, 'board_name') : model;
|
|
42
|
+
version = !version ? (0, common_1.getValue)(lines, 'board_version') : version;
|
|
43
|
+
serial = !serial ? (0, common_1.getValue)(lines, 'board_serial') : serial;
|
|
44
|
+
assetTag = !assetTag ? (0, common_1.getValue)(lines, 'board_asset_tag') : assetTag;
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
serial = (0, parse_1.cleanDefaults)(serial);
|
|
48
|
+
assetTag = (0, parse_1.cleanDefaults)(assetTag);
|
|
49
|
+
model = (0, parse_1.cleanDefaults)(model);
|
|
50
|
+
version = (0, parse_1.cleanDefaults)(version);
|
|
51
|
+
manufacturer = (0, parse_1.cleanDefaults)(manufacturer);
|
|
52
|
+
lines = data[1] ? data[1].stdout.split('\n') : [''];
|
|
53
|
+
let memMax = (0, common_1.toInt)((0, common_1.getValue)(lines, 'Maximum Capacity')) * 1024 * 1024 * 1024 || null;
|
|
54
|
+
let memSlots = (0, common_1.toInt)((0, common_1.getValue)(lines, 'Number Of Devices')) || null;
|
|
55
|
+
let linesRpi = [];
|
|
56
|
+
try {
|
|
57
|
+
linesRpi = (await (0, promises_1.readFile)('/proc/cpuinfo')).toString().split('\n');
|
|
58
|
+
}
|
|
59
|
+
catch { }
|
|
60
|
+
const hardware = (0, common_1.getValue)(linesRpi, 'hardware');
|
|
61
|
+
if (hardware.startsWith('BCM')) {
|
|
62
|
+
const rpi = (0, raspberry_1.decodePiCpuinfo)(linesRpi);
|
|
63
|
+
manufacturer = rpi.manufacturer;
|
|
64
|
+
model = 'Raspberry Pi';
|
|
65
|
+
serial = rpi.serial;
|
|
66
|
+
version = rpi.type + ' - ' + rpi.revision;
|
|
67
|
+
memMax = (0, node_os_1.totalmem)();
|
|
68
|
+
memSlots = 0;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
...defaults,
|
|
72
|
+
manufacturer,
|
|
73
|
+
model,
|
|
74
|
+
serial,
|
|
75
|
+
version,
|
|
76
|
+
assetTag,
|
|
77
|
+
memMax,
|
|
78
|
+
memSlots
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
exports.baseboard = baseboard;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.battery = void 0;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const files_1 = require("../common/files");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const defaults_1 = require("../common/defaults");
|
|
8
|
+
const battery = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initBatteryResult);
|
|
11
|
+
let acConnected = false;
|
|
12
|
+
let timeRemaining = defaults.timeRemaining;
|
|
13
|
+
const bat1 = '/sys/class/power_supply/BAT1/uevent';
|
|
14
|
+
const bat0 = '/sys/class/power_supply/BAT0/uevent';
|
|
15
|
+
const ac = '/sys/class/power_supply/AC/online';
|
|
16
|
+
const ac0 = '/sys/class/power_supply/AC0/online';
|
|
17
|
+
const battery_path = (await (0, files_1.fileExists)(bat1)) ? bat1 : (await (0, files_1.fileExists)(bat0)) ? bat0 : '';
|
|
18
|
+
const acPath = (await (0, files_1.fileExists)(ac)) ? ac : (await (0, files_1.fileExists)(ac0)) ? ac0 : '';
|
|
19
|
+
if (acPath) {
|
|
20
|
+
try {
|
|
21
|
+
const file = await (0, promises_1.readFile)(acPath);
|
|
22
|
+
acConnected = file.toString().trim() === '1';
|
|
23
|
+
}
|
|
24
|
+
catch { }
|
|
25
|
+
}
|
|
26
|
+
if (battery_path) {
|
|
27
|
+
const stdout = await (0, promises_1.readFile)(battery_path);
|
|
28
|
+
const lines = stdout.toString().split('\n');
|
|
29
|
+
const isCharging = (0, common_1.getValue)(lines, 'POWER_SUPPLY_STATUS', '=').toLowerCase() === 'charging';
|
|
30
|
+
acConnected = acConnected || isCharging;
|
|
31
|
+
const voltage = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_VOLTAGE_NOW', '=')) / 1000000.0;
|
|
32
|
+
const capacityUnit = voltage ? 'mWh' : 'mAh';
|
|
33
|
+
const cycleCount = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CYCLE_COUNT', '='));
|
|
34
|
+
let maxCapacity = Math.round(((0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CHARGE_FULL', '=', true, true)) / 1000.0) * (voltage || 1));
|
|
35
|
+
const desingedMinVoltage = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN', '=')) / 1000000.0;
|
|
36
|
+
let designedCapacity = Math.round(((0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CHARGE_FULL_DESIGN', '=', true, true)) / 1000.0) * (desingedMinVoltage || voltage || 1));
|
|
37
|
+
let currentCapacity = Math.round(((0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CHARGE_NOW', '=')) / 1000.0) * (voltage || 1));
|
|
38
|
+
if (!maxCapacity) {
|
|
39
|
+
maxCapacity = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_ENERGY_FULL', '=', true, true)) / 1000.0;
|
|
40
|
+
designedCapacity = ((0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_ENERGY_FULL_DESIGN', '=', true, true)) / 1000.0) | maxCapacity;
|
|
41
|
+
currentCapacity = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_ENERGY_NOW', '=')) / 1000.0;
|
|
42
|
+
}
|
|
43
|
+
let percent = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CAPACITY', '='));
|
|
44
|
+
const energy = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_ENERGY_NOW', '='));
|
|
45
|
+
const power = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_POWER_NOW', '='));
|
|
46
|
+
const current = (0, common_1.toInt)('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CURRENT_NOW', '='));
|
|
47
|
+
const charge = parseInt('0' + (0, common_1.getValue)(lines, 'POWER_SUPPLY_CHARGE_NOW', '='), 10);
|
|
48
|
+
if (maxCapacity && currentCapacity) {
|
|
49
|
+
if (!percent) {
|
|
50
|
+
percent = (100.0 * currentCapacity) / maxCapacity;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (energy && power) {
|
|
54
|
+
timeRemaining = Math.floor((energy / power) * 60);
|
|
55
|
+
}
|
|
56
|
+
else if (current && charge) {
|
|
57
|
+
timeRemaining = Math.floor((charge / current) * 60);
|
|
58
|
+
}
|
|
59
|
+
else if (current && currentCapacity) {
|
|
60
|
+
timeRemaining = Math.floor((currentCapacity / current) * 60);
|
|
61
|
+
}
|
|
62
|
+
const type = (0, common_1.getValue)(lines, 'POWER_SUPPLY_TECHNOLOGY', '=');
|
|
63
|
+
const model = (0, common_1.getValue)(lines, 'POWER_SUPPLY_MODEL_NAME', '=');
|
|
64
|
+
const manufacturer = (0, common_1.getValue)(lines, 'POWER_SUPPLY_MANUFACTURER', '=');
|
|
65
|
+
const serial = (0, common_1.getValue)(lines, 'POWER_SUPPLY_SERIAL_NUMBER', '=');
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
...defaults,
|
|
69
|
+
cycleCount,
|
|
70
|
+
isCharging,
|
|
71
|
+
designedCapacity,
|
|
72
|
+
maxCapacity,
|
|
73
|
+
currentCapacity,
|
|
74
|
+
voltage,
|
|
75
|
+
capacityUnit,
|
|
76
|
+
percent,
|
|
77
|
+
timeRemaining,
|
|
78
|
+
acConnected,
|
|
79
|
+
type,
|
|
80
|
+
model,
|
|
81
|
+
manufacturer,
|
|
82
|
+
serial
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
};
|
|
88
|
+
exports.battery = battery;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bios = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const datetime_1 = require("../common/datetime");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const const_1 = require("../common/const");
|
|
9
|
+
const bios = async () => {
|
|
10
|
+
await (0, common_1.nextTick)();
|
|
11
|
+
const result = (0, common_1.cloneObj)(defaults_1.initBios);
|
|
12
|
+
let cmd = '';
|
|
13
|
+
if (process.arch === 'arm') {
|
|
14
|
+
cmd = 'cat /proc/cpuinfo | grep Serial';
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
cmd = 'export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL';
|
|
18
|
+
}
|
|
19
|
+
const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
|
|
20
|
+
let lines = stdout.toString().split('\n');
|
|
21
|
+
result.vendor = (0, common_1.getValue)(lines, 'Vendor');
|
|
22
|
+
result.version = (0, common_1.getValue)(lines, 'Version');
|
|
23
|
+
let datetime = (0, common_1.getValue)(lines, 'Release Date');
|
|
24
|
+
result.releaseDate = (0, datetime_1.parseDateTime)(datetime).date;
|
|
25
|
+
result.revision = (0, common_1.getValue)(lines, 'BIOS Revision');
|
|
26
|
+
result.serial = (0, common_1.getValue)(lines, 'SerialNumber');
|
|
27
|
+
const language = (0, common_1.getValue)(lines, 'Currently Installed Language').split('|')[0];
|
|
28
|
+
if (language) {
|
|
29
|
+
result.language = language;
|
|
30
|
+
}
|
|
31
|
+
if (lines.length && stdout.toString().indexOf('Characteristics:') >= 0) {
|
|
32
|
+
const features = [];
|
|
33
|
+
lines.forEach((line) => {
|
|
34
|
+
if (line.indexOf(' is supported') >= 0) {
|
|
35
|
+
const feature = line.split(' is supported')[0].trim();
|
|
36
|
+
features.push(feature);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
result.features = features;
|
|
40
|
+
}
|
|
41
|
+
cmd = `echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;
|
|
42
|
+
echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;
|
|
43
|
+
echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;
|
|
44
|
+
try {
|
|
45
|
+
const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
|
|
46
|
+
lines = stdout.split('\n');
|
|
47
|
+
result.vendor = !result.vendor ? (0, common_1.getValue)(lines, 'bios_vendor') : result.vendor;
|
|
48
|
+
result.version = !result.version ? (0, common_1.getValue)(lines, 'bios_version') : result.version;
|
|
49
|
+
datetime = (0, common_1.getValue)(lines, 'bios_date');
|
|
50
|
+
result.releaseDate = !result.releaseDate ? (0, datetime_1.parseDateTime)(datetime).date : result.releaseDate;
|
|
51
|
+
}
|
|
52
|
+
catch { }
|
|
53
|
+
return result;
|
|
54
|
+
};
|
|
55
|
+
exports.bios = bios;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blockDevices = void 0;
|
|
4
|
+
const exec_1 = require("../common/exec");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const filesys_1 = require("../common/filesys");
|
|
7
|
+
const const_1 = require("../common/const");
|
|
8
|
+
const blockDevices = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
let stdout = '';
|
|
11
|
+
try {
|
|
12
|
+
({ stdout } = await (0, exec_1.exec)('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null', const_1.execOptsLinux));
|
|
13
|
+
const lines = (0, filesys_1.blkStdoutToObject)(stdout).split('\n');
|
|
14
|
+
let data = (0, filesys_1.parseLinuxBlk)(lines);
|
|
15
|
+
data = await (0, filesys_1.raidMatchLinux)(data);
|
|
16
|
+
return (0, filesys_1.matchDevicesLinux)(data);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
try {
|
|
20
|
+
({ stdout } = await (0, exec_1.exec)('lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null', const_1.execOptsLinux));
|
|
21
|
+
const lines = (0, filesys_1.blkStdoutToObject)(stdout).split('\n');
|
|
22
|
+
const data = (0, filesys_1.parseLinuxBlk)(lines);
|
|
23
|
+
return await (0, filesys_1.raidMatchLinux)(data);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
exports.blockDevices = blockDevices;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.bluetoothDevices = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const promises_1 = require("fs/promises");
|
|
39
|
+
const common_1 = require("../common");
|
|
40
|
+
const files_1 = require("../common/files");
|
|
41
|
+
const mappings_1 = require("../common/mappings");
|
|
42
|
+
const exec_1 = require("../common/exec");
|
|
43
|
+
const const_1 = require("../common/const");
|
|
44
|
+
const parseBluetoothInfo = (lines, macAddr1, macAddr2) => {
|
|
45
|
+
const name = (0, common_1.getValue)(lines, 'name', '=');
|
|
46
|
+
return {
|
|
47
|
+
device: null,
|
|
48
|
+
name: (0, common_1.getValue)(lines, 'name', '='),
|
|
49
|
+
manufacturer: null,
|
|
50
|
+
macDevice: macAddr1,
|
|
51
|
+
macHost: macAddr2,
|
|
52
|
+
batteryPercent: null,
|
|
53
|
+
type: (0, mappings_1.bluetoothTypeLabel)(name.toLowerCase()),
|
|
54
|
+
connected: false
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const bluetoothDevices = async () => {
|
|
58
|
+
await (0, common_1.nextTick)();
|
|
59
|
+
const result = [];
|
|
60
|
+
const btFiles = await (0, files_1.getFilesInPath)('/var/lib/bluetooth/');
|
|
61
|
+
for (const element of btFiles) {
|
|
62
|
+
const filename = path.basename(element);
|
|
63
|
+
const pathParts = element.split('/');
|
|
64
|
+
const macAddr1 = pathParts.length >= 6 ? pathParts[pathParts.length - 2] : null;
|
|
65
|
+
const macAddr2 = pathParts.length >= 7 ? pathParts[pathParts.length - 3] : null;
|
|
66
|
+
if (filename === 'info') {
|
|
67
|
+
try {
|
|
68
|
+
const infoFile = await (0, promises_1.readFile)(element, { encoding: 'utf8' });
|
|
69
|
+
result.push(parseBluetoothInfo(infoFile.split('\n'), macAddr1, macAddr2));
|
|
70
|
+
}
|
|
71
|
+
catch { }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const { stdout } = await (0, exec_1.exec)('hcitool con', const_1.execOptsLinux);
|
|
76
|
+
const hdicon = stdout.toLowerCase();
|
|
77
|
+
for (const element of result) {
|
|
78
|
+
if (element.macDevice && String(element.macDevice).length > 10 && hdicon.indexOf(String(element.macDevice).toLowerCase()) >= 0) {
|
|
79
|
+
element.connected = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch { }
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
86
|
+
exports.bluetoothDevices = bluetoothDevices;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camera = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const V4L_PATH = '/sys/class/video4linux';
|
|
7
|
+
const readAttr = async (path) => {
|
|
8
|
+
try {
|
|
9
|
+
return (await (0, promises_1.readFile)(path)).toString().trim();
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return '';
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const camera = async () => {
|
|
16
|
+
await (0, common_1.nextTick)();
|
|
17
|
+
const result = [];
|
|
18
|
+
const seen = new Set();
|
|
19
|
+
try {
|
|
20
|
+
const nodes = (await (0, promises_1.readdir)(V4L_PATH)).filter((node) => node.startsWith('video')).sort();
|
|
21
|
+
for (const node of nodes) {
|
|
22
|
+
const base = `${V4L_PATH}/${node}`;
|
|
23
|
+
const name = await readAttr(`${base}/name`);
|
|
24
|
+
let iface;
|
|
25
|
+
try {
|
|
26
|
+
iface = await (0, promises_1.realpath)(`${base}/device`);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const interfaceClass = await readAttr(`${iface}/bInterfaceClass`);
|
|
32
|
+
if (interfaceClass !== '0e' && !/camera|webcam/i.test(name)) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (seen.has(iface)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
seen.add(iface);
|
|
39
|
+
let dev = iface;
|
|
40
|
+
for (let i = 0; i < 6; i++) {
|
|
41
|
+
if (await readAttr(`${dev}/idVendor`)) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
const parent = dev.substring(0, dev.lastIndexOf('/'));
|
|
45
|
+
if (!parent || parent === dev) {
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
dev = parent;
|
|
49
|
+
}
|
|
50
|
+
const idVendor = await readAttr(`${dev}/idVendor`);
|
|
51
|
+
result.push({
|
|
52
|
+
name,
|
|
53
|
+
vendor: (await readAttr(`${dev}/manufacturer`)) || idVendor || '',
|
|
54
|
+
model: (await readAttr(`${dev}/product`)) || (await readAttr(`${dev}/idProduct`)) || '',
|
|
55
|
+
serial: await readAttr(`${dev}/serial`),
|
|
56
|
+
connection: idVendor ? 'usb' : iface.includes('/pci') ? 'pci' : ''
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch { }
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
exports.camera = camera;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const chassis: () => Promise<any>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.chassis = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const exec_1 = require("../common/exec");
|
|
6
|
+
const defaults_1 = require("../common/defaults");
|
|
7
|
+
const mappings_1 = require("../common/mappings");
|
|
8
|
+
const parse_1 = require("../common/parse");
|
|
9
|
+
const parseChassis = (stdout, defaults) => {
|
|
10
|
+
const lines = stdout.toString().split('\n');
|
|
11
|
+
const manufacturer = (0, parse_1.cleanDefaults)((0, common_1.getValue)(lines, 'chassis_vendor'));
|
|
12
|
+
const ctype = parseInt((0, common_1.getValue)(lines, 'chassis_type').replace(/\D/g, ''));
|
|
13
|
+
const chassisType = ctype && !isNaN(ctype) && ctype <= mappings_1.chassisTypes.length ? mappings_1.chassisTypes[ctype - 1] : '';
|
|
14
|
+
const version = (0, parse_1.cleanDefaults)((0, common_1.getValue)(lines, 'chassis_version'));
|
|
15
|
+
const serial = (0, parse_1.cleanDefaults)((0, common_1.getValue)(lines, 'chassis_serial'));
|
|
16
|
+
const assetTag = (0, parse_1.cleanDefaults)((0, common_1.getValue)(lines, 'chassis_asset_tag'));
|
|
17
|
+
return {
|
|
18
|
+
...defaults,
|
|
19
|
+
manufacturer,
|
|
20
|
+
type: chassisType,
|
|
21
|
+
version,
|
|
22
|
+
serial,
|
|
23
|
+
assetTag
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const chassis = async () => {
|
|
27
|
+
await (0, common_1.nextTick)();
|
|
28
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initChassis);
|
|
29
|
+
const cmd = `echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
|
|
30
|
+
echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;
|
|
31
|
+
echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;
|
|
32
|
+
echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;
|
|
33
|
+
echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`;
|
|
34
|
+
try {
|
|
35
|
+
const { stdout } = await (0, exec_1.execSave)(cmd);
|
|
36
|
+
return parseChassis(stdout, defaults);
|
|
37
|
+
}
|
|
38
|
+
catch { }
|
|
39
|
+
return defaults;
|
|
40
|
+
};
|
|
41
|
+
exports.chassis = chassis;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpuCache: () => Promise<any>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuCache = void 0;
|
|
4
|
+
const exec_1 = require("../common/exec");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const const_1 = require("../common/const");
|
|
8
|
+
const cpuCache = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
const result = (0, common_1.cloneObj)(defaults_1.initCpuCacheResult);
|
|
11
|
+
try {
|
|
12
|
+
const { stdout } = await (0, exec_1.exec)('export LC_ALL=C; lscpu; unset LC_ALL', const_1.execOptsLinux);
|
|
13
|
+
const lines = stdout.toString().split('\n');
|
|
14
|
+
lines.forEach((line) => {
|
|
15
|
+
const parts = line.split(':');
|
|
16
|
+
if (parts[0].toUpperCase().indexOf('L1D CACHE') !== -1) {
|
|
17
|
+
result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : parts[1].indexOf('K') !== -1 ? 1024 : 1);
|
|
18
|
+
}
|
|
19
|
+
if (parts[0].toUpperCase().indexOf('L1I CACHE') !== -1) {
|
|
20
|
+
result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : parts[1].indexOf('K') !== -1 ? 1024 : 1);
|
|
21
|
+
}
|
|
22
|
+
if (parts[0].toUpperCase().indexOf('L2 CACHE') !== -1) {
|
|
23
|
+
result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : parts[1].indexOf('K') !== -1 ? 1024 : 1);
|
|
24
|
+
}
|
|
25
|
+
if (parts[0].toUpperCase().indexOf('L3 CACHE') !== -1) {
|
|
26
|
+
result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : parts[1].indexOf('K') !== -1 ? 1024 : 1);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.cpuCache = cpuCache;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpuFlags: () => Promise<string>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuFlags = void 0;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const exec_1 = require("../common/exec");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const const_1 = require("../common/const");
|
|
8
|
+
const cpuFlags = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
let result = '';
|
|
11
|
+
try {
|
|
12
|
+
let { stdout } = await (0, exec_1.exec)('export LC_ALL=C; lscpu; unset LC_ALL', const_1.execOptsLinux);
|
|
13
|
+
const lines = stdout.toString().split('\n');
|
|
14
|
+
lines.forEach((line) => {
|
|
15
|
+
if (line.split(':')[0].toUpperCase().indexOf('FLAGS') !== -1) {
|
|
16
|
+
result = line.split(':')[1].trim().toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
if (!result) {
|
|
20
|
+
stdout = (await (0, promises_1.readFile)('/proc/cpuinfo')).toString();
|
|
21
|
+
const lines = stdout.toString().split('\n');
|
|
22
|
+
result = (0, common_1.getValue)(lines, 'features', ':', true).toLowerCase();
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.cpuFlags = cpuFlags;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpuTemperature: () => Promise<any>;
|