systeminformation 5.33.5 → 6.0.0-beta.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/README.md +873 -958
- 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 +24 -0
- package/dist/bsd/os-info.js +47 -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/acceleration.d.ts +8 -0
- package/dist/common/acceleration.js +86 -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 +304 -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 +6 -0
- package/dist/common/internet.js +92 -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 +1024 -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 +2 -0
- package/dist/darwin/os-info.js +140 -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 +60 -0
- package/dist/index.js +132 -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/inet-public-ip.d.ts +2 -0
- package/dist/inet-public-ip.js +10 -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 +15 -0
- package/dist/linux/gpu.js +383 -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 +114 -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 +1150 -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 +3 -0
- package/dist/windows/block-devices.js +58 -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 +129 -0
- package/dist/windows/disks-io.d.ts +2 -0
- package/dist/windows/disks-io.js +46 -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 +70 -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 -1849
- 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 -1322
- 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 -2833
- package/lib/virtualbox.js +0 -116
- package/lib/wifi.js +0 -839
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuFlags = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const cpuFlags = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
let result = '';
|
|
10
|
+
try {
|
|
11
|
+
const { stdout } = await (0, exec_1.exec)('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet', const_1.execOptsWin);
|
|
12
|
+
const flag_hex = (stdout.split('0x').pop() || '').trim();
|
|
13
|
+
const flag_bin_unpadded = parseInt(flag_hex, 16).toString(2);
|
|
14
|
+
const flag_bin = '0'.repeat(32 - flag_bin_unpadded.length) + flag_bin_unpadded;
|
|
15
|
+
const all_flags = [
|
|
16
|
+
'fpu',
|
|
17
|
+
'vme',
|
|
18
|
+
'de',
|
|
19
|
+
'pse',
|
|
20
|
+
'tsc',
|
|
21
|
+
'msr',
|
|
22
|
+
'pae',
|
|
23
|
+
'mce',
|
|
24
|
+
'cx8',
|
|
25
|
+
'apic',
|
|
26
|
+
'',
|
|
27
|
+
'sep',
|
|
28
|
+
'mtrr',
|
|
29
|
+
'pge',
|
|
30
|
+
'mca',
|
|
31
|
+
'cmov',
|
|
32
|
+
'pat',
|
|
33
|
+
'pse-36',
|
|
34
|
+
'psn',
|
|
35
|
+
'clfsh',
|
|
36
|
+
'',
|
|
37
|
+
'ds',
|
|
38
|
+
'acpi',
|
|
39
|
+
'mmx',
|
|
40
|
+
'fxsr',
|
|
41
|
+
'sse',
|
|
42
|
+
'sse2',
|
|
43
|
+
'ss',
|
|
44
|
+
'htt',
|
|
45
|
+
'tm',
|
|
46
|
+
'ia64',
|
|
47
|
+
'pbe'
|
|
48
|
+
];
|
|
49
|
+
for (let f = 0; f < all_flags.length; f++) {
|
|
50
|
+
if (flag_bin[f] === '1' && all_flags[f] !== '') {
|
|
51
|
+
result += ` ${all_flags[f]}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
result = result.trim().toLowerCase();
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.cpuFlags = cpuFlags;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpuTemperature: () => Promise<any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuTemperature = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const windows_1 = require("../common/windows");
|
|
7
|
+
const cpuTemperature = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
const result = (0, common_1.cloneObj)(defaults_1.initCpuTemperature);
|
|
10
|
+
try {
|
|
11
|
+
const tempParts = (0, windows_1.psArray)(await windows_1.ps.exec('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature | ConvertTo-Json'));
|
|
12
|
+
let sum = 0;
|
|
13
|
+
tempParts.forEach((obj) => {
|
|
14
|
+
if (obj?.CurrentTemperature) {
|
|
15
|
+
const value = (obj.CurrentTemperature - 2732) / 10;
|
|
16
|
+
sum = sum + value;
|
|
17
|
+
if (!result.max || value > result.max) {
|
|
18
|
+
result.max = value;
|
|
19
|
+
}
|
|
20
|
+
result.cores.push(value);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
if (result.cores.length) {
|
|
24
|
+
result.main = sum / result.cores.length;
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.cpuTemperature = cpuTemperature;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpu: () => Promise<any>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpu = void 0;
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const cpu_1 = require("../common/cpu");
|
|
7
|
+
const defaults_1 = require("../common/defaults");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const windows_1 = require("../common/windows");
|
|
10
|
+
const cpu_cache_1 = require("./cpu-cache");
|
|
11
|
+
const cpu_flags_1 = require("./cpu-flags");
|
|
12
|
+
(0, cpu_1.setCpuSpeed)(0);
|
|
13
|
+
const cpu = async () => {
|
|
14
|
+
await (0, common_1.nextTick)();
|
|
15
|
+
const result = (0, common_1.cloneObj)(defaults_1.initCpuResult);
|
|
16
|
+
const flags = await (0, cpu_flags_1.cpuFlags)();
|
|
17
|
+
result.flags = flags;
|
|
18
|
+
result.virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1;
|
|
19
|
+
try {
|
|
20
|
+
const workload = [];
|
|
21
|
+
workload.push(windows_1.ps.exec('Get-CimInstance Win32_Processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | ConvertTo-Json'));
|
|
22
|
+
workload.push(windows_1.ps.exec('Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | ConvertTo-Json'));
|
|
23
|
+
workload.push(windows_1.ps.exec('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
|
24
|
+
const data = await Promise.all(workload);
|
|
25
|
+
const processors = (0, windows_1.psArray)(data[0]);
|
|
26
|
+
const cacheParts = (0, windows_1.psArray)(data[1]);
|
|
27
|
+
if (processors.length) {
|
|
28
|
+
const processorObj = processors[0];
|
|
29
|
+
const name = processorObj.Name != null ? String(processorObj.Name) : '';
|
|
30
|
+
if (name.indexOf('@') >= 0) {
|
|
31
|
+
result.brand = name.split('@')[0].trim();
|
|
32
|
+
result.speed = name.split('@')[1] ? parseFloat(name.split('@')[1].trim()) : 0;
|
|
33
|
+
(0, cpu_1.setCpuSpeed)(result.speed);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
result.brand = name.trim();
|
|
37
|
+
result.speed = 0;
|
|
38
|
+
}
|
|
39
|
+
const brandManufacturer = (0, mappings_1.cpuBrandManufacturer)(result.brand);
|
|
40
|
+
result.brand = brandManufacturer.brand;
|
|
41
|
+
result.manufacturer = brandManufacturer.manufacturer;
|
|
42
|
+
result.revision = processorObj.Revision != null ? String(processorObj.Revision) : '';
|
|
43
|
+
result.cache = (0, cpu_cache_1.parseWinCache)(processorObj, cacheParts);
|
|
44
|
+
result.vendor = processorObj.Manufacturer != null ? String(processorObj.Manufacturer) : '';
|
|
45
|
+
result.speedMax = Math.round(parseFloat(String(processorObj.MaxClockSpeed ?? '').replace(/,/g, '.')) / 10.0) / 100 || result.speedMax;
|
|
46
|
+
if (result.speed === 0 && (result.brand.indexOf('AMD') > -1 || result.brand.toLowerCase().indexOf('ryzen') > -1)) {
|
|
47
|
+
result.speed = (0, mappings_1.getAMDSpeed)(result.brand);
|
|
48
|
+
}
|
|
49
|
+
if (result.speed === 0) {
|
|
50
|
+
result.speed = result.speedMax;
|
|
51
|
+
}
|
|
52
|
+
result.speedMin = result.speed;
|
|
53
|
+
const description = String(processorObj.Description ?? '').split(' ');
|
|
54
|
+
for (let i = 0; i < description.length; i++) {
|
|
55
|
+
if (description[i].toLowerCase().startsWith('family') && i + 1 < description.length && description[i + 1]) {
|
|
56
|
+
result.family = description[i + 1];
|
|
57
|
+
}
|
|
58
|
+
if (description[i].toLowerCase().startsWith('model') && i + 1 < description.length && description[i + 1]) {
|
|
59
|
+
result.model = description[i + 1];
|
|
60
|
+
}
|
|
61
|
+
if (description[i].toLowerCase().startsWith('stepping') && i + 1 < description.length && description[i + 1]) {
|
|
62
|
+
result.stepping = description[i + 1];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const socketId = processorObj.UpgradeMethod != null ? String(processorObj.UpgradeMethod) : '';
|
|
66
|
+
if (mappings_1.socketTypes[socketId]) {
|
|
67
|
+
result.socket = mappings_1.socketTypes[socketId];
|
|
68
|
+
}
|
|
69
|
+
const socketByName = (0, mappings_1.getSocketTypesByName)(name);
|
|
70
|
+
if (socketByName) {
|
|
71
|
+
result.socket = socketByName;
|
|
72
|
+
}
|
|
73
|
+
const countProcessors = processors.length;
|
|
74
|
+
const countThreads = processorObj.NumberOfLogicalProcessors;
|
|
75
|
+
const countCores = processorObj.NumberOfCores;
|
|
76
|
+
if (countProcessors) {
|
|
77
|
+
result.processors = countProcessors || 1;
|
|
78
|
+
}
|
|
79
|
+
if (countCores && countThreads) {
|
|
80
|
+
result.cores = Number.parseInt(countThreads, 10) || (0, node_os_1.cpus)().length;
|
|
81
|
+
result.physicalCores = Number.parseInt(countCores, 10) || (0, node_os_1.cpus)().length;
|
|
82
|
+
}
|
|
83
|
+
if (countProcessors > 1) {
|
|
84
|
+
result.cores = result.cores * countProcessors;
|
|
85
|
+
result.physicalCores = result.physicalCores * countProcessors;
|
|
86
|
+
}
|
|
87
|
+
const hyperv = data[2] ? data[2].toString().toLowerCase() : '';
|
|
88
|
+
result.virtualization = hyperv.indexOf('true') !== -1;
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
exports.cpu = cpu;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diskLayout = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const filesys_1 = require("../common/filesys");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const windows_1 = require("../common/windows");
|
|
10
|
+
const hasControlCharacters = (str) => /\p{Cc}/u.test(str);
|
|
11
|
+
const diskSerialNum = (device) => {
|
|
12
|
+
const serialNum = String(device.SerialNumber || '').trim();
|
|
13
|
+
if (!hasControlCharacters(serialNum)) {
|
|
14
|
+
return serialNum;
|
|
15
|
+
}
|
|
16
|
+
const instanceId = String(device.PNPDeviceId || '')
|
|
17
|
+
.trim()
|
|
18
|
+
.split('\\')[2];
|
|
19
|
+
if (instanceId) {
|
|
20
|
+
const parts = instanceId.split('&');
|
|
21
|
+
if (parts.length === 2 && parts[1] === '0') {
|
|
22
|
+
return parts[0];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return serialNum;
|
|
26
|
+
};
|
|
27
|
+
const diskLayout = async () => {
|
|
28
|
+
await (0, common_1.nextTick)();
|
|
29
|
+
const result = [];
|
|
30
|
+
try {
|
|
31
|
+
const [diskDrives, physicalDisks] = await Promise.all([
|
|
32
|
+
windows_1.ps.exec('Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | ConvertTo-Json'),
|
|
33
|
+
windows_1.ps.exec('Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | ConvertTo-Json')
|
|
34
|
+
]);
|
|
35
|
+
(0, windows_1.psArray)(diskDrives).forEach((device) => {
|
|
36
|
+
const size = (0, common_1.toInt)(device.Size);
|
|
37
|
+
const status = String(device.Status || '')
|
|
38
|
+
.trim()
|
|
39
|
+
.toLowerCase();
|
|
40
|
+
if (size) {
|
|
41
|
+
result.push({
|
|
42
|
+
device: device.DeviceId || '',
|
|
43
|
+
type: JSON.stringify(device).indexOf('SSD') > -1 ? 'SSD' : 'HD',
|
|
44
|
+
name: device.Caption || '',
|
|
45
|
+
vendor: (0, mappings_1.diskVendorFromModel)(String(device.Caption || '').trim()),
|
|
46
|
+
size,
|
|
47
|
+
bytesPerSector: (0, common_1.toInt)(device.BytesPerSector),
|
|
48
|
+
totalCylinders: (0, common_1.toInt)(device.TotalCylinders),
|
|
49
|
+
totalHeads: (0, common_1.toInt)(device.TotalHeads),
|
|
50
|
+
totalSectors: (0, common_1.toInt)(device.TotalSectors),
|
|
51
|
+
totalTracks: (0, common_1.toInt)(device.TotalTracks),
|
|
52
|
+
tracksPerCylinder: (0, common_1.toInt)(device.TracksPerCylinder),
|
|
53
|
+
sectorsPerTrack: (0, common_1.toInt)(device.SectorsPerTrack),
|
|
54
|
+
firmwareRevision: String(device.FirmwareRevision || '').trim(),
|
|
55
|
+
serialNum: diskSerialNum(device),
|
|
56
|
+
interfaceType: String(device.InterfaceType || '').trim(),
|
|
57
|
+
smartStatus: status === 'ok' ? 'Ok' : status === 'degraded' ? 'Degraded' : status === 'pred fail' ? 'Predicted Failure' : 'Unknown',
|
|
58
|
+
temperature: null
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
(0, windows_1.psArray)(physicalDisks).forEach((device) => {
|
|
63
|
+
const serialNum = String(device.SerialNumber || '').trim();
|
|
64
|
+
const name = String(device.FriendlyName || '')
|
|
65
|
+
.trim()
|
|
66
|
+
.replace('Msft ', 'Microsoft');
|
|
67
|
+
const size = (0, common_1.toInt)(device.Size);
|
|
68
|
+
const model = String(device.Model || '')
|
|
69
|
+
.trim()
|
|
70
|
+
.toLowerCase();
|
|
71
|
+
const interfaceType = String(device.BusType || '').trim();
|
|
72
|
+
let mediaType = String(device.MediaType ?? '').trim();
|
|
73
|
+
if (mediaType === '3' || mediaType === 'HDD') {
|
|
74
|
+
mediaType = 'HD';
|
|
75
|
+
}
|
|
76
|
+
if (mediaType === '4') {
|
|
77
|
+
mediaType = 'SSD';
|
|
78
|
+
}
|
|
79
|
+
if (mediaType === '5') {
|
|
80
|
+
mediaType = 'SCM';
|
|
81
|
+
}
|
|
82
|
+
if (mediaType === 'Unspecified' && (model.indexOf('virtual') > -1 || model.indexOf('vbox') > -1)) {
|
|
83
|
+
mediaType = 'Virtual';
|
|
84
|
+
}
|
|
85
|
+
if (size) {
|
|
86
|
+
let i = (0, common_1.findObjectByKey)(result, 'serialNum', serialNum);
|
|
87
|
+
if (i === -1 || serialNum === '') {
|
|
88
|
+
i = (0, common_1.findObjectByKey)(result, 'name', name);
|
|
89
|
+
}
|
|
90
|
+
if (i !== -1) {
|
|
91
|
+
result[i].type = mediaType;
|
|
92
|
+
result[i].interfaceType = interfaceType;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
if (await (0, filesys_1.smartMonToolsInstalled)()) {
|
|
97
|
+
try {
|
|
98
|
+
const { stdout } = await (0, exec_1.execSave)('smartctl --scan -j', const_1.execOptsWin);
|
|
99
|
+
const smartDev = JSON.parse(stdout.trim());
|
|
100
|
+
if (smartDev?.devices && smartDev.devices.length > 0) {
|
|
101
|
+
for (const dev of smartDev.devices) {
|
|
102
|
+
try {
|
|
103
|
+
const { stdout: smartOut } = await (0, exec_1.execSave)(`smartctl -j -a ${dev.name}`, const_1.execOptsWin);
|
|
104
|
+
const smartData = JSON.parse(smartOut);
|
|
105
|
+
if (smartData.serial_number) {
|
|
106
|
+
const serialNum = smartData.serial_number;
|
|
107
|
+
const i = (0, common_1.findObjectByKey)(result, 'serialNum', serialNum);
|
|
108
|
+
if (i !== -1) {
|
|
109
|
+
result[i].smartStatus = smartData.smart_status?.passed ? 'Ok' : smartData.smart_status?.passed === false ? 'Predicted Failure' : 'unknown';
|
|
110
|
+
if (smartData.temperature?.current) {
|
|
111
|
+
result[i].temperature = smartData.temperature.current;
|
|
112
|
+
}
|
|
113
|
+
result[i].smartData = smartData;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch { }
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch { }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
return result;
|
|
128
|
+
};
|
|
129
|
+
exports.diskLayout = diskLayout;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disksIO = void 0;
|
|
4
|
+
const defaults_1 = require("../common/defaults");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const filesys_1 = require("../common/filesys");
|
|
7
|
+
const windows_1 = require("../common/windows");
|
|
8
|
+
const disksIO = async () => {
|
|
9
|
+
await (0, common_1.nextTick)();
|
|
10
|
+
if ((filesys_1._disk_io && !filesys_1._disk_io.ms) || (filesys_1._disk_io && filesys_1._disk_io.ms && Date.now() - filesys_1._disk_io.ms >= 500)) {
|
|
11
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initDiskIo);
|
|
12
|
+
try {
|
|
13
|
+
const data = await windows_1.ps.exec("Get-CimInstance Win32_PerfRawData_PerfDisk_PhysicalDisk -Filter \"Name='_Total'\" | Select-Object DiskReadsPersec,DiskWritesPersec,PercentDiskReadTime,PercentDiskWriteTime,PercentDiskTime | ConvertTo-Json");
|
|
14
|
+
if (!data) {
|
|
15
|
+
return defaults;
|
|
16
|
+
}
|
|
17
|
+
const rIO = (0, common_1.toInt)(data.DiskReadsPersec);
|
|
18
|
+
const wIO = (0, common_1.toInt)(data.DiskWritesPersec);
|
|
19
|
+
const rWaitTime = (0, common_1.toInt)(data.PercentDiskReadTime) / 10000;
|
|
20
|
+
const wWaitTime = (0, common_1.toInt)(data.PercentDiskWriteTime) / 10000;
|
|
21
|
+
const tWaitTime = (0, common_1.toInt)(data.PercentDiskTime) / 10000;
|
|
22
|
+
return (0, filesys_1.calcDiskIO)(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return defaults;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return {
|
|
30
|
+
rIO: filesys_1._disk_io.rIO,
|
|
31
|
+
wIO: filesys_1._disk_io.wIO,
|
|
32
|
+
tIO: filesys_1._disk_io.rIO + filesys_1._disk_io.wIO,
|
|
33
|
+
ms: filesys_1._disk_io.last_ms,
|
|
34
|
+
rIO_sec: filesys_1._disk_io.rIO_sec,
|
|
35
|
+
wIO_sec: filesys_1._disk_io.wIO_sec,
|
|
36
|
+
tIO_sec: filesys_1._disk_io.tIO_sec,
|
|
37
|
+
rWaitTime: filesys_1._disk_io.rWaitTime,
|
|
38
|
+
wWaitTime: filesys_1._disk_io.wWaitTime,
|
|
39
|
+
tWaitTime: filesys_1._disk_io.tWaitTime,
|
|
40
|
+
rWaitPercent: filesys_1._disk_io.rWaitPercent,
|
|
41
|
+
wWaitPercent: filesys_1._disk_io.wWaitPercent,
|
|
42
|
+
tWaitPercent: filesys_1._disk_io.tWaitPercent
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.disksIO = disksIO;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.displays = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const mappings_1 = require("../common/mappings");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const windows_1 = require("../common/windows");
|
|
8
|
+
const psCurrentModes = "Add-Type -AssemblyName System.Windows.Forms; if (-not ('SiDevMode' -as [Type])) { Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct SIDEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion;public short dmDriverVersion;public short dmSize;public short dmDriverExtra;public int dmFields;public int dmPositionX;public int dmPositionY;public int dmDisplayOrientation;public int dmDisplayFixedOutput;public short dmColor;public short dmDuplex;public short dmYResolution;public short dmTTOption;public short dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel;public int dmPelsWidth;public int dmPelsHeight;public int dmDisplayFlags;public int dmDisplayFrequency;public int dmICMMethod;public int dmICMIntent;public int dmMediaType;public int dmDitherType;public int dmReserved1;public int dmReserved2;public int dmPanningWidth;public int dmPanningHeight;}public class SiDevMode{[DllImport(\"user32.dll\",CharSet=CharSet.Ansi)]public static extern bool EnumDisplaySettings(string lpszDeviceName,int iModeNum,ref SIDEVMODE lpDevMode);}' }; [System.Windows.Forms.Screen]::AllScreens | ForEach-Object { $dm = New-Object SIDEVMODE; $dm.dmSize = [System.Runtime.InteropServices.Marshal]::SizeOf($dm); if ([SiDevMode]::EnumDisplaySettings($_.DeviceName, -1, [ref]$dm)) { $_.DeviceName + '|' + $dm.dmDisplayFrequency + '|' + $dm.dmBitsPerPel + '|' + $dm.dmPelsWidth + '|' + $dm.dmPelsHeight } }";
|
|
9
|
+
const parseLinesWindowsDisplaysPowershell = (ssections, monitors, dsections, connections, isections, currentModes) => {
|
|
10
|
+
const displays = [];
|
|
11
|
+
const desktopMonitors = (dsections || []).map((section) => {
|
|
12
|
+
const linesDisplay = section.split('\n');
|
|
13
|
+
return {
|
|
14
|
+
deviceId: (0, common_1.getValue)(linesDisplay, 'PNPDeviceID', ':').replace(/&/g, '&').toLowerCase(),
|
|
15
|
+
vendor: (0, common_1.getValue)(linesDisplay, 'MonitorManufacturer', ':'),
|
|
16
|
+
model: (0, common_1.getValue)(linesDisplay, 'Name', ':'),
|
|
17
|
+
resolutionX: (0, common_1.toInt)((0, common_1.getValue)(linesDisplay, 'ScreenWidth', ':')),
|
|
18
|
+
resolutionY: (0, common_1.toInt)((0, common_1.getValue)(linesDisplay, 'ScreenHeight', ':'))
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
const count = Math.max(ssections.length, monitors.length);
|
|
22
|
+
for (let i = 0; i < count; i++) {
|
|
23
|
+
const hasOwnScreen = i < ssections.length;
|
|
24
|
+
const ssection = hasOwnScreen ? ssections[i] : ssections[0];
|
|
25
|
+
if (ssection !== undefined && ssection.trim() !== '') {
|
|
26
|
+
const linesScreen = `BitsPerPixel ${ssection}`.split('\n');
|
|
27
|
+
const monitor = monitors[i];
|
|
28
|
+
const instanceName = monitor ? monitor.instanceName : '';
|
|
29
|
+
const bitsPerPixel = (0, common_1.toInt)((0, common_1.getValue)(linesScreen, 'BitsPerPixel'));
|
|
30
|
+
const bounds = (0, common_1.getValue)(linesScreen, 'Bounds').replace('{', '').replace('}', '').replace(/=/g, ':').split(',');
|
|
31
|
+
const primary = (0, common_1.getValue)(linesScreen, 'Primary');
|
|
32
|
+
const sizeX = monitor ? monitor.sizeX : '';
|
|
33
|
+
const sizeY = monitor ? monitor.sizeY : '';
|
|
34
|
+
const videoOutputTechnology = instanceName && connections[instanceName] !== undefined ? connections[instanceName] : '';
|
|
35
|
+
const deviceName = (0, common_1.getValue)(linesScreen, 'DeviceName');
|
|
36
|
+
const isection = instanceName ? isections.find((element) => element.instanceId.toLowerCase().startsWith(instanceName)) : undefined;
|
|
37
|
+
const dsection = instanceName ? desktopMonitors.find((element) => element.deviceId && instanceName.startsWith(element.deviceId)) : undefined;
|
|
38
|
+
displays.push({
|
|
39
|
+
vendor: (isection && isection.vendor) || (dsection ? dsection.vendor : ''),
|
|
40
|
+
vendorId: null,
|
|
41
|
+
model: (isection && isection.model) || (dsection ? dsection.model : ''),
|
|
42
|
+
productionYear: isection ? isection.productionYear : null,
|
|
43
|
+
serial: (isection && isection.serial) || null,
|
|
44
|
+
deviceName,
|
|
45
|
+
displayId: instanceName || null,
|
|
46
|
+
main: hasOwnScreen ? primary.toLowerCase() === 'true' : false,
|
|
47
|
+
builtin: videoOutputTechnology === '2147483648',
|
|
48
|
+
connection: videoOutputTechnology && mappings_1.graphicsVideoTypes[videoOutputTechnology] ? mappings_1.graphicsVideoTypes[videoOutputTechnology] : '',
|
|
49
|
+
resolutionX: (0, common_1.toInt)((0, common_1.getValue)(bounds, 'Width', ':')),
|
|
50
|
+
resolutionY: (0, common_1.toInt)((0, common_1.getValue)(bounds, 'Height', ':')),
|
|
51
|
+
sizeX: sizeX ? parseInt(sizeX, 10) : null,
|
|
52
|
+
sizeY: sizeY ? parseInt(sizeY, 10) : null,
|
|
53
|
+
pixelDepth: bitsPerPixel,
|
|
54
|
+
currentResX: (0, common_1.toInt)((0, common_1.getValue)(bounds, 'Width', ':')),
|
|
55
|
+
currentResY: (0, common_1.toInt)((0, common_1.getValue)(bounds, 'Height', ':')),
|
|
56
|
+
positionX: (0, common_1.toInt)((0, common_1.getValue)(bounds, 'X', ':')),
|
|
57
|
+
positionY: (0, common_1.toInt)((0, common_1.getValue)(bounds, 'Y', ':')),
|
|
58
|
+
currentRefreshRate: currentModes[deviceName.toLowerCase()] || null
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (ssections.length === 0) {
|
|
63
|
+
const first = desktopMonitors[0];
|
|
64
|
+
displays.push({
|
|
65
|
+
vendor: first ? first.vendor : '',
|
|
66
|
+
vendorId: null,
|
|
67
|
+
model: first ? first.model : '',
|
|
68
|
+
productionYear: null,
|
|
69
|
+
serial: null,
|
|
70
|
+
deviceName: '',
|
|
71
|
+
displayId: null,
|
|
72
|
+
main: true,
|
|
73
|
+
builtin: true,
|
|
74
|
+
sizeX: null,
|
|
75
|
+
sizeY: null,
|
|
76
|
+
connection: null,
|
|
77
|
+
resolutionX: first ? first.resolutionX : 0,
|
|
78
|
+
resolutionY: first ? first.resolutionY : 0,
|
|
79
|
+
pixelDepth: null,
|
|
80
|
+
currentResX: first ? first.resolutionX : 0,
|
|
81
|
+
currentResY: first ? first.resolutionY : 0,
|
|
82
|
+
positionX: 0,
|
|
83
|
+
positionY: 0,
|
|
84
|
+
currentRefreshRate: null
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return displays;
|
|
88
|
+
};
|
|
89
|
+
const displays = async () => {
|
|
90
|
+
await (0, common_1.nextTick)();
|
|
91
|
+
let result = [];
|
|
92
|
+
try {
|
|
93
|
+
const workload = [];
|
|
94
|
+
workload.push((0, exec_1.shareInflight)('win32_VideoController', () => windows_1.ps.exec('Get-CimInstance win32_VideoController | fl *')));
|
|
95
|
+
workload.push(windows_1.ps.exec('Get-CimInstance win32_desktopmonitor | fl *'));
|
|
96
|
+
workload.push(windows_1.ps.exec('Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl'));
|
|
97
|
+
workload.push(windows_1.ps.exec('Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens'));
|
|
98
|
+
workload.push(windows_1.ps.exec('Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl'));
|
|
99
|
+
workload.push(windows_1.ps.exec('gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.YearOfManufacture + "|" + $_.InstanceName}'));
|
|
100
|
+
workload.push(windows_1.ps.exec(psCurrentModes));
|
|
101
|
+
const data = await Promise.allSettled(workload).then((results) => results.map((result) => (result.status === 'fulfilled' ? result.value : '')));
|
|
102
|
+
let _resolutionX = 0;
|
|
103
|
+
let _resolutionY = 0;
|
|
104
|
+
let _pixelDepth = 0;
|
|
105
|
+
let _refreshRate = 0;
|
|
106
|
+
const csections = data[0]
|
|
107
|
+
.toString()
|
|
108
|
+
.replace(/\r/g, '')
|
|
109
|
+
.split(/\n\s*\n/);
|
|
110
|
+
csections.forEach((section) => {
|
|
111
|
+
if (section.trim() !== '') {
|
|
112
|
+
const lines = section.trim().split('\n');
|
|
113
|
+
_resolutionX = (0, common_1.toInt)((0, common_1.getValue)(lines, 'CurrentHorizontalResolution', ':')) || _resolutionX;
|
|
114
|
+
_resolutionY = (0, common_1.toInt)((0, common_1.getValue)(lines, 'CurrentVerticalResolution', ':')) || _resolutionY;
|
|
115
|
+
_refreshRate = (0, common_1.toInt)((0, common_1.getValue)(lines, 'CurrentRefreshRate', ':')) || _refreshRate;
|
|
116
|
+
_pixelDepth = (0, common_1.toInt)((0, common_1.getValue)(lines, 'CurrentBitsPerPixel', ':')) || _pixelDepth;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
let dsections = data[1]
|
|
120
|
+
.toString()
|
|
121
|
+
.replace(/\r/g, '')
|
|
122
|
+
.split(/\n\s*\n/);
|
|
123
|
+
if (dsections[0].trim() === '') {
|
|
124
|
+
dsections = dsections.splice(1);
|
|
125
|
+
}
|
|
126
|
+
if (dsections.length && dsections[dsections.length - 1].trim() === '') {
|
|
127
|
+
dsections.pop();
|
|
128
|
+
}
|
|
129
|
+
const monitors = data[2]
|
|
130
|
+
.toString()
|
|
131
|
+
.replace(/\r/g, '')
|
|
132
|
+
.split(/\n\s*\n/)
|
|
133
|
+
.map((section) => {
|
|
134
|
+
const lines = section.split('\n');
|
|
135
|
+
return {
|
|
136
|
+
instanceName: (0, common_1.getValue)(lines, 'InstanceName').toLowerCase(),
|
|
137
|
+
sizeX: (0, common_1.getValue)(lines, 'MaxHorizontalImageSize'),
|
|
138
|
+
sizeY: (0, common_1.getValue)(lines, 'MaxVerticalImageSize'),
|
|
139
|
+
active: (0, common_1.getValue)(lines, 'Active').toLowerCase() !== 'false'
|
|
140
|
+
};
|
|
141
|
+
})
|
|
142
|
+
.filter((monitor) => monitor.instanceName && monitor.active);
|
|
143
|
+
let ssections = data[3].toString().replace(/\r/g, '').split('BitsPerPixel ');
|
|
144
|
+
ssections = ssections.splice(1);
|
|
145
|
+
const connections = {};
|
|
146
|
+
data[4]
|
|
147
|
+
.toString()
|
|
148
|
+
.replace(/\r/g, '')
|
|
149
|
+
.split(/\n\s*\n/)
|
|
150
|
+
.forEach((section) => {
|
|
151
|
+
const lines = section.split('\n');
|
|
152
|
+
const instanceName = (0, common_1.getValue)(lines, 'InstanceName').toLowerCase();
|
|
153
|
+
if (instanceName) {
|
|
154
|
+
connections[instanceName] = (0, common_1.getValue)(lines, 'VideoOutputTechnology');
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
const res = String(data[5] ?? '')
|
|
158
|
+
.replace(/\r/g, '')
|
|
159
|
+
.split(/\n/);
|
|
160
|
+
const isections = [];
|
|
161
|
+
res.forEach((element) => {
|
|
162
|
+
const parts = element.split('|');
|
|
163
|
+
if (parts.length === 6) {
|
|
164
|
+
isections.push({
|
|
165
|
+
vendor: parts[0],
|
|
166
|
+
code: parts[1],
|
|
167
|
+
model: parts[2],
|
|
168
|
+
serial: parts[3],
|
|
169
|
+
productionYear: (0, common_1.toInt)(parts[4]) || null,
|
|
170
|
+
instanceId: parts[5]
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
const currentModes = {};
|
|
175
|
+
String(data[6] ?? '')
|
|
176
|
+
.replace(/\r/g, '')
|
|
177
|
+
.split(/\n/)
|
|
178
|
+
.forEach((element) => {
|
|
179
|
+
const parts = element.split('|');
|
|
180
|
+
const frequency = parts.length === 5 ? (0, common_1.toInt)(parts[1]) : 0;
|
|
181
|
+
if (frequency > 1 && parts[0]) {
|
|
182
|
+
currentModes[parts[0].trim().toLowerCase()] = frequency;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
result = parseLinesWindowsDisplaysPowershell(ssections, monitors, dsections, connections, isections, currentModes);
|
|
186
|
+
if (result.length === 1) {
|
|
187
|
+
if (_resolutionX) {
|
|
188
|
+
result[0].resolutionX = _resolutionX;
|
|
189
|
+
if (!result[0].currentResX) {
|
|
190
|
+
result[0].currentResX = _resolutionX;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (_resolutionY) {
|
|
194
|
+
result[0].resolutionY = _resolutionY;
|
|
195
|
+
if (result[0].currentResY === 0) {
|
|
196
|
+
result[0].currentResY = _resolutionY;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (_pixelDepth) {
|
|
200
|
+
result[0].pixelDepth = _pixelDepth;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
result = result.map((element) => {
|
|
204
|
+
if (_refreshRate && !element.currentRefreshRate) {
|
|
205
|
+
element.currentRefreshRate = _refreshRate;
|
|
206
|
+
}
|
|
207
|
+
return element;
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
catch { }
|
|
211
|
+
return result;
|
|
212
|
+
};
|
|
213
|
+
exports.displays = displays;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fsOpenFiles = void 0;
|
|
4
|
+
const defaults_1 = require("../common/defaults");
|
|
5
|
+
const common_1 = require("../common");
|
|
6
|
+
const windows_1 = require("../common/windows");
|
|
7
|
+
const fsOpenFiles = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initFsOpenFiles);
|
|
10
|
+
try {
|
|
11
|
+
const data = await windows_1.ps.exec("Get-CimInstance Win32_PerfRawData_PerfProc_Process -Filter \"Name='_Total'\" | Select-Object HandleCount | ConvertTo-Json");
|
|
12
|
+
if (data) {
|
|
13
|
+
return {
|
|
14
|
+
...defaults,
|
|
15
|
+
allocated: (0, common_1.toInt)(data.HandleCount)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch { }
|
|
20
|
+
return defaults;
|
|
21
|
+
};
|
|
22
|
+
exports.fsOpenFiles = fsOpenFiles;
|