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,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkConnections = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const getProcessName = (processes, pid) => {
|
|
8
|
+
let cmd = '';
|
|
9
|
+
processes.forEach((line) => {
|
|
10
|
+
const parts = line.split(' ');
|
|
11
|
+
const id = parseInt(parts[0], 10) || -1;
|
|
12
|
+
if (id === pid) {
|
|
13
|
+
parts.shift();
|
|
14
|
+
cmd = parts.join(' ').split(':')[0];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
cmd = cmd.split(' -')[0];
|
|
18
|
+
cmd = cmd.split(' /')[0];
|
|
19
|
+
return cmd;
|
|
20
|
+
};
|
|
21
|
+
const networkConnections = async () => {
|
|
22
|
+
await (0, common_1.nextTick)();
|
|
23
|
+
const result = [];
|
|
24
|
+
const cmd = 'netstat -natvln | head -n2; netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
|
|
25
|
+
const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN'.split('|');
|
|
26
|
+
let { stdout, stderr } = await (0, exec_1.execSave)(cmd, { maxBuffer: const_1.MAX_BUFFER_SIZE });
|
|
27
|
+
const netstat = stdout;
|
|
28
|
+
const neterr = stderr;
|
|
29
|
+
({ stdout, stderr } = await (0, exec_1.execSave)('ps -axo pid,command', {
|
|
30
|
+
maxBuffer: const_1.MAX_BUFFER_SIZE
|
|
31
|
+
}));
|
|
32
|
+
let processes = stdout.toString().split('\n');
|
|
33
|
+
processes = processes.map((line) => {
|
|
34
|
+
return line.trim().replace(/ +/g, ' ');
|
|
35
|
+
});
|
|
36
|
+
if (!neterr) {
|
|
37
|
+
const lines = netstat.split('\n');
|
|
38
|
+
lines.shift();
|
|
39
|
+
let pidPos = 8;
|
|
40
|
+
if (lines.length > 1 && lines[0].indexOf('pid') > 0) {
|
|
41
|
+
const header = (lines.shift() || '')
|
|
42
|
+
.replace(/ Address/g, '_Address')
|
|
43
|
+
.replace(/process:/g, '')
|
|
44
|
+
.replace(/ +/g, ' ')
|
|
45
|
+
.split(' ');
|
|
46
|
+
pidPos = header.indexOf('pid');
|
|
47
|
+
}
|
|
48
|
+
lines.forEach((line) => {
|
|
49
|
+
const lineParts = line.replace(/ +/g, ' ').split(' ');
|
|
50
|
+
if (lineParts.length >= 8) {
|
|
51
|
+
let localip = lineParts[3];
|
|
52
|
+
let localport = '';
|
|
53
|
+
const localaddress = lineParts[3].split('.');
|
|
54
|
+
if (localaddress.length > 1) {
|
|
55
|
+
localport = localaddress[localaddress.length - 1];
|
|
56
|
+
localaddress.pop();
|
|
57
|
+
localip = localaddress.join('.');
|
|
58
|
+
}
|
|
59
|
+
let peerip = lineParts[4];
|
|
60
|
+
let peerport = '';
|
|
61
|
+
const peeraddress = lineParts[4].split('.');
|
|
62
|
+
if (peeraddress.length > 1) {
|
|
63
|
+
peerport = peeraddress[peeraddress.length - 1];
|
|
64
|
+
peeraddress.pop();
|
|
65
|
+
peerip = peeraddress.join('.');
|
|
66
|
+
}
|
|
67
|
+
const hasState = states.indexOf(lineParts[5]) >= 0;
|
|
68
|
+
const connstate = hasState ? lineParts[5] : 'UNKNOWN';
|
|
69
|
+
let pidField = '';
|
|
70
|
+
if (lineParts[lineParts.length - 9] && lineParts[lineParts.length - 9].indexOf(':') >= 0) {
|
|
71
|
+
pidField = lineParts[lineParts.length - 9].split(':')[1];
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
pidField = lineParts[pidPos + (hasState ? 0 : -1)] || '';
|
|
75
|
+
if (pidField.indexOf(':') >= 0) {
|
|
76
|
+
pidField = pidField.split(':')[1];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const pid = parseInt(pidField, 10);
|
|
80
|
+
if (connstate) {
|
|
81
|
+
result.push({
|
|
82
|
+
protocol: lineParts[0],
|
|
83
|
+
localAddress: localip,
|
|
84
|
+
localPort: localport,
|
|
85
|
+
peerAddress: peerip,
|
|
86
|
+
peerPort: peerport,
|
|
87
|
+
state: connstate,
|
|
88
|
+
pid: pid,
|
|
89
|
+
process: getProcessName(processes, pid)
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
};
|
|
98
|
+
exports.networkConnections = networkConnections;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const networkGatewayDefault: () => Promise<string>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkGatewayDefault = void 0;
|
|
4
|
+
const exec_1 = require("../common/exec");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const networkGatewayDefault = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
let result = '';
|
|
10
|
+
const { stdout, stderr } = await (0, exec_1.execSave)('route -n get default', { maxBuffer: const_1.MAX_BUFFER_SIZE });
|
|
11
|
+
if (!stderr) {
|
|
12
|
+
const lines = stdout
|
|
13
|
+
.toString()
|
|
14
|
+
.split('\n')
|
|
15
|
+
.map((line) => line.trim());
|
|
16
|
+
result = (0, common_1.getValue)(lines, 'gateway');
|
|
17
|
+
}
|
|
18
|
+
if (!result) {
|
|
19
|
+
const { stdout } = await (0, exec_1.execSave)("netstat -rn | awk '/default/ {print $2}'", { maxBuffer: const_1.MAX_BUFFER_SIZE });
|
|
20
|
+
const lines = stdout.split('\n').map((line) => line.trim());
|
|
21
|
+
result =
|
|
22
|
+
lines.find((line) => /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(line)) || '';
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
exports.networkGatewayDefault = networkGatewayDefault;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkInterfaceDefault = exports.getFirstExternalNetworkInterface = 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 getFirstExternalNetworkInterface = (interfaces) => {
|
|
9
|
+
let ifacename = '';
|
|
10
|
+
let ifacenameFirst = '';
|
|
11
|
+
let scopeid = 9999;
|
|
12
|
+
for (const dev in interfaces) {
|
|
13
|
+
(interfaces[dev] || []).forEach((details) => {
|
|
14
|
+
if (details && details.internal === false) {
|
|
15
|
+
ifacenameFirst = ifacenameFirst || dev;
|
|
16
|
+
if (details.scopeid && details.scopeid < scopeid) {
|
|
17
|
+
ifacename = dev;
|
|
18
|
+
scopeid = details.scopeid;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return ifacename || ifacenameFirst || '';
|
|
24
|
+
};
|
|
25
|
+
exports.getFirstExternalNetworkInterface = getFirstExternalNetworkInterface;
|
|
26
|
+
const networkInterfaceDefault = async () => {
|
|
27
|
+
await (0, common_1.nextTick)();
|
|
28
|
+
const interfaces = (0, node_os_1.networkInterfaces)();
|
|
29
|
+
let ifacename = (0, exports.getFirstExternalNetworkInterface)(interfaces);
|
|
30
|
+
try {
|
|
31
|
+
const cmd = const_1.DARWIN ? "route -n get default 2>/dev/null | grep interface: | awk '{print $2}'" : 'route get 0.0.0.0 | grep interface:';
|
|
32
|
+
const { stdout } = await (0, exec_1.exec)(cmd);
|
|
33
|
+
ifacename = stdout.split('\n')[0];
|
|
34
|
+
if (ifacename.indexOf(':') > -1) {
|
|
35
|
+
ifacename = ifacename.split(':')[1].trim();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch { }
|
|
39
|
+
return ifacename;
|
|
40
|
+
};
|
|
41
|
+
exports.networkInterfaceDefault = networkInterfaceDefault;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkInterfaces = 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 index_1 = require("../common/index");
|
|
9
|
+
const network_1 = require("../common/network");
|
|
10
|
+
const security_1 = require("../common/security");
|
|
11
|
+
const network_interface_default_1 = require("./network-interface-default");
|
|
12
|
+
let _interfaces = {};
|
|
13
|
+
let _networkInterfaces = [];
|
|
14
|
+
const splitSectionsNics = (lines) => {
|
|
15
|
+
const result = [];
|
|
16
|
+
let section = [];
|
|
17
|
+
lines.forEach((line) => {
|
|
18
|
+
if (!line.startsWith('\t') && !line.startsWith(' ')) {
|
|
19
|
+
if (section.length) {
|
|
20
|
+
result.push(section);
|
|
21
|
+
section = [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
section.push(line);
|
|
25
|
+
});
|
|
26
|
+
if (section.length) {
|
|
27
|
+
result.push(section);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
const parseLinesDarwinNics = (sections) => {
|
|
32
|
+
const nics = [];
|
|
33
|
+
sections.forEach((section) => {
|
|
34
|
+
const nic = {
|
|
35
|
+
iface: '',
|
|
36
|
+
mtu: null,
|
|
37
|
+
mac: '',
|
|
38
|
+
ip6: '',
|
|
39
|
+
ip4: '',
|
|
40
|
+
speed: null,
|
|
41
|
+
type: '',
|
|
42
|
+
operstate: '',
|
|
43
|
+
duplex: '',
|
|
44
|
+
internal: false
|
|
45
|
+
};
|
|
46
|
+
const first = section[0];
|
|
47
|
+
nic.iface = first.split(':')[0].trim();
|
|
48
|
+
const parts = first.split('> mtu');
|
|
49
|
+
nic.mtu = parts.length > 1 ? (0, common_1.toInt)(parts[1]) : null;
|
|
50
|
+
if (isNaN(nic.mtu)) {
|
|
51
|
+
nic.mtu = null;
|
|
52
|
+
}
|
|
53
|
+
nic.internal = parts[0].toLowerCase().indexOf('loopback') > -1;
|
|
54
|
+
section.forEach((line) => {
|
|
55
|
+
if (line.trim().startsWith('ether ')) {
|
|
56
|
+
nic.mac = line.split('ether ')[1].toLowerCase().trim();
|
|
57
|
+
}
|
|
58
|
+
if (line.trim().startsWith('inet6 ') && !nic.ip6) {
|
|
59
|
+
nic.ip6 = line.split('inet6 ')[1].toLowerCase().split('%')[0].split(' ')[0];
|
|
60
|
+
}
|
|
61
|
+
if (line.trim().startsWith('inet ') && !nic.ip4) {
|
|
62
|
+
nic.ip4 = line.split('inet ')[1].toLowerCase().split(' ')[0];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
let speed = (0, common_1.getValue)(section, 'link rate');
|
|
66
|
+
nic.speed = speed ? parseFloat(speed) : null;
|
|
67
|
+
if (nic.speed === null) {
|
|
68
|
+
speed = (0, common_1.getValue)(section, 'uplink rate');
|
|
69
|
+
nic.speed = speed ? parseFloat(speed) : null;
|
|
70
|
+
if (nic.speed !== null && speed.toLowerCase().indexOf('gbps') >= 0) {
|
|
71
|
+
nic.speed = nic.speed * 1000;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (speed.toLowerCase().indexOf('gbps') >= 0) {
|
|
76
|
+
nic.speed = nic.speed * 1000;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
nic.type = (0, common_1.getValue)(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';
|
|
80
|
+
const operstate = (0, common_1.getValue)(section, 'status').toLowerCase();
|
|
81
|
+
nic.operstate = operstate === 'active' ? 'up' : operstate === 'inactive' ? 'down' : 'unknown';
|
|
82
|
+
nic.duplex = (0, common_1.getValue)(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';
|
|
83
|
+
if (nic.ip6 || nic.ip4 || nic.mac) {
|
|
84
|
+
nics.push(nic);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return nics;
|
|
88
|
+
};
|
|
89
|
+
const getBsdNics = async () => {
|
|
90
|
+
try {
|
|
91
|
+
const { stdout } = await (0, exec_1.exec)('/sbin/ifconfig -v', { maxBuffer: const_1.MAX_BUFFER_SIZE });
|
|
92
|
+
const lines = stdout.split('\n');
|
|
93
|
+
const nsections = splitSectionsNics(lines);
|
|
94
|
+
return parseLinesDarwinNics(nsections);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const getBsdIfaceDHCPstatus = async (iface) => {
|
|
101
|
+
let result = false;
|
|
102
|
+
try {
|
|
103
|
+
const { stdout } = await (0, exec_1.exec)(`ipconfig getpacket "${iface}" 2>/dev/null | grep lease_time;`);
|
|
104
|
+
const lines = stdout.split('\n');
|
|
105
|
+
if (lines.length && lines[0].startsWith('lease_time')) {
|
|
106
|
+
result = true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch { }
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
112
|
+
const networkInterfaces = async (defaultString = '', rescan = true) => {
|
|
113
|
+
await (0, common_1.nextTick)();
|
|
114
|
+
const interfaces = (0, node_os_1.networkInterfaces)();
|
|
115
|
+
if (JSON.stringify(interfaces) === JSON.stringify(_interfaces) && !rescan) {
|
|
116
|
+
return _networkInterfaces;
|
|
117
|
+
}
|
|
118
|
+
_interfaces = (0, index_1.cloneObj)(interfaces);
|
|
119
|
+
let result = [];
|
|
120
|
+
try {
|
|
121
|
+
const nics = await getBsdNics();
|
|
122
|
+
const defaultInterface = await (0, network_interface_default_1.networkInterfaceDefault)();
|
|
123
|
+
for (const nic of nics) {
|
|
124
|
+
let ip4link = '';
|
|
125
|
+
let ip4linksubnet = '';
|
|
126
|
+
let ip6link = '';
|
|
127
|
+
let ip6linksubnet = '';
|
|
128
|
+
nic.ip4 = '';
|
|
129
|
+
nic.ip6 = '';
|
|
130
|
+
(interfaces[nic.iface] || []).forEach((details) => {
|
|
131
|
+
if (details.family === 'IPv4' || details.family === 4) {
|
|
132
|
+
if (!nic.ip4 && !nic.ip4.match(/^169.254/i)) {
|
|
133
|
+
nic.ip4 = details.address;
|
|
134
|
+
nic.ip4subnet = details.netmask;
|
|
135
|
+
}
|
|
136
|
+
if (nic.ip4.match(/^169.254/i)) {
|
|
137
|
+
ip4link = details.address;
|
|
138
|
+
ip4linksubnet = details.netmask;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (details.family === 'IPv6' || details.family === 6) {
|
|
142
|
+
if (!nic.ip6 && !nic.ip6.match(/^fe80::/i)) {
|
|
143
|
+
nic.ip6 = details.address;
|
|
144
|
+
nic.ip6subnet = details.netmask;
|
|
145
|
+
}
|
|
146
|
+
if (nic.ip6.match(/^fe80::/i)) {
|
|
147
|
+
ip6link = details.address;
|
|
148
|
+
ip6linksubnet = details.netmask;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
if (!nic.ip4 && ip4link) {
|
|
153
|
+
nic.ip4 = ip4link;
|
|
154
|
+
nic.ip4subnet = ip4linksubnet;
|
|
155
|
+
}
|
|
156
|
+
if (!nic.ip6 && ip6link) {
|
|
157
|
+
nic.ip6 = ip6link;
|
|
158
|
+
nic.ip6subnet = ip6linksubnet;
|
|
159
|
+
}
|
|
160
|
+
let ifaceSanitized = '';
|
|
161
|
+
const s = (0, security_1.isPrototypePolluted)() ? '---' : (0, security_1.sanitizeShellString)(nic.iface);
|
|
162
|
+
const l = (0, security_1.mathMin)(s.length, 2000);
|
|
163
|
+
for (let i = 0; i <= l; i++) {
|
|
164
|
+
if (s[i] !== undefined) {
|
|
165
|
+
ifaceSanitized = ifaceSanitized + s[i];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
result.push({
|
|
169
|
+
iface: nic.iface,
|
|
170
|
+
ifaceName: nic.iface,
|
|
171
|
+
default: nic.iface === defaultInterface,
|
|
172
|
+
ip4: nic.ip4,
|
|
173
|
+
ip4subnet: nic.ip4subnet || '',
|
|
174
|
+
ip6: nic.ip6,
|
|
175
|
+
ip6subnet: nic.ip6subnet || '',
|
|
176
|
+
mac: nic.mac,
|
|
177
|
+
internal: nic.internal,
|
|
178
|
+
virtual: nic.internal ? false : (0, network_1.testVirtualNic)(nic.iface, nic.iface, nic.mac),
|
|
179
|
+
operstate: nic.operstate,
|
|
180
|
+
type: nic.type,
|
|
181
|
+
duplex: nic.duplex,
|
|
182
|
+
mtu: nic.mtu,
|
|
183
|
+
speed: nic.speed,
|
|
184
|
+
dhcp: await getBsdIfaceDHCPstatus(ifaceSanitized),
|
|
185
|
+
dnsSuffix: '',
|
|
186
|
+
ieee8021xAuth: '',
|
|
187
|
+
ieee8021xState: '',
|
|
188
|
+
carrierChanges: 0
|
|
189
|
+
});
|
|
190
|
+
_networkInterfaces = result;
|
|
191
|
+
if (defaultString.toLowerCase().indexOf('default') >= 0) {
|
|
192
|
+
result = result.filter((item) => item.default);
|
|
193
|
+
if (result.length > 0) {
|
|
194
|
+
return [result[0]];
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
result = [];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch { }
|
|
203
|
+
return result;
|
|
204
|
+
};
|
|
205
|
+
exports.networkInterfaces = networkInterfaces;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkStats = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const defaults_1 = require("../common/defaults");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const network_1 = require("../common/network");
|
|
8
|
+
const security_1 = require("../common/security");
|
|
9
|
+
const darwin_1 = require("../darwin");
|
|
10
|
+
const _network = {};
|
|
11
|
+
const networkStatsSingle = async (iface) => {
|
|
12
|
+
await (0, common_1.nextTick)();
|
|
13
|
+
const defaults = defaults_1.initNetworkSpeed;
|
|
14
|
+
if (!_network[iface] || (_network[iface] && !_network[iface].ms) || (_network[iface] && _network[iface].ms && Date.now() - _network[iface].ms >= 500)) {
|
|
15
|
+
let operstate = 'unknown';
|
|
16
|
+
let rx_bytes = 0;
|
|
17
|
+
let tx_bytes = 0;
|
|
18
|
+
let rx_dropped = 0;
|
|
19
|
+
let rx_errors = 0;
|
|
20
|
+
let tx_dropped = 0;
|
|
21
|
+
let tx_errors = 0;
|
|
22
|
+
let stdout = '';
|
|
23
|
+
({ stdout } = await (0, exec_1.execSave)(`ifconfig ${iface} | grep "status"`));
|
|
24
|
+
operstate = (stdout.split(':')[1] || '').trim().toLowerCase();
|
|
25
|
+
operstate = operstate === 'active' ? 'up' : operstate === 'inactive' ? 'down' : 'unknown';
|
|
26
|
+
({ stdout } = await (0, exec_1.execSave)(`netstat -bdnI ${iface}`));
|
|
27
|
+
if (stdout) {
|
|
28
|
+
const lines = stdout.toString().split('\n');
|
|
29
|
+
if (lines.length > 1 && lines[1].trim() !== '') {
|
|
30
|
+
const stats = lines[1].replace(/ +/g, ' ').split(' ');
|
|
31
|
+
const offset = stats.length > 11 ? 1 : 0;
|
|
32
|
+
rx_bytes = (0, common_1.toInt)(stats[offset + 5]);
|
|
33
|
+
rx_dropped = (0, common_1.toInt)(stats[offset + 10]);
|
|
34
|
+
rx_errors = (0, common_1.toInt)(stats[offset + 4]);
|
|
35
|
+
tx_bytes = (0, common_1.toInt)(stats[offset + 8]);
|
|
36
|
+
tx_dropped = (0, common_1.toInt)(stats[offset + 10]);
|
|
37
|
+
tx_errors = (0, common_1.toInt)(stats[offset + 7]);
|
|
38
|
+
return (0, network_1.calcNetworkSpeed)(iface, rx_bytes, tx_bytes, rx_dropped, rx_errors, tx_dropped, tx_errors, operstate, _network);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return defaults;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return {
|
|
45
|
+
...defaults,
|
|
46
|
+
rx_bytes: _network[iface].rx_bytes,
|
|
47
|
+
tx_bytes: _network[iface].tx_bytes,
|
|
48
|
+
rx_sec: _network[iface].rx_sec,
|
|
49
|
+
tx_sec: _network[iface].tx_sec,
|
|
50
|
+
rx_dropped: _network[iface].rx_dropped,
|
|
51
|
+
tx_dropped: _network[iface].tx_dropped,
|
|
52
|
+
rx_errors: _network[iface].rx_errors,
|
|
53
|
+
tx_errors: _network[iface].tx_errors,
|
|
54
|
+
ms: _network[iface].last_ms,
|
|
55
|
+
operstate: _network[iface].operstate
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const networkStats = async (interfaces) => {
|
|
60
|
+
const result = [];
|
|
61
|
+
let interfacesArray = [];
|
|
62
|
+
const interfacesSanitized = (0, security_1.sanitizeInterfacesString)(interfaces);
|
|
63
|
+
if (interfacesSanitized === '-') {
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
if (interfacesSanitized === '*') {
|
|
67
|
+
const allIFaces = await (0, darwin_1.networkInterfaces)('', false);
|
|
68
|
+
for (const iface of allIFaces || []) {
|
|
69
|
+
interfacesArray.push(iface.iface);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
interfacesArray = interfacesSanitized.split('|');
|
|
74
|
+
}
|
|
75
|
+
const workload = [];
|
|
76
|
+
for (const iface of interfacesArray) {
|
|
77
|
+
workload.push(networkStatsSingle(iface.trim()));
|
|
78
|
+
}
|
|
79
|
+
if (workload.length) {
|
|
80
|
+
return await Promise.all(workload);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.networkStats = networkStats;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { npm } from '../npm';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.npu = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const exec_1 = require("../common/exec");
|
|
6
|
+
const defaults_1 = require("../common/defaults");
|
|
7
|
+
const npu = async () => {
|
|
8
|
+
await (0, common_1.nextTick)();
|
|
9
|
+
try {
|
|
10
|
+
const { stdout } = await (0, exec_1.exec)('ioreg -rn ane0');
|
|
11
|
+
if (!stdout.includes('"name" = <"ane0">')) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
let model = '';
|
|
15
|
+
try {
|
|
16
|
+
model = (await (0, exec_1.exec)('sysctl -n machdep.cpu.brand_string')).stdout.trim();
|
|
17
|
+
}
|
|
18
|
+
catch { }
|
|
19
|
+
let cores = null;
|
|
20
|
+
try {
|
|
21
|
+
const match = (await (0, exec_1.exec)('ioreg -rc H11ANEIn')).stdout.match(/ANEDevicePropertyNumANECores"?=(\d+)/);
|
|
22
|
+
if (match) {
|
|
23
|
+
cores = parseInt(match[1], 10);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch { }
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
...(0, common_1.cloneObj)(defaults_1.initNpuData),
|
|
30
|
+
vendor: 'Apple',
|
|
31
|
+
name: 'Apple Neural Engine',
|
|
32
|
+
model,
|
|
33
|
+
cores
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.npu = npu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const osInfo: () => Promise<import("../common/types").OsData>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.osInfo = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const codepage_1 = require("../common/codepage");
|
|
6
|
+
const defaults_1 = require("../common/defaults");
|
|
7
|
+
const exec_1 = require("../common/exec");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const getInstallDate = async () => {
|
|
10
|
+
try {
|
|
11
|
+
const { stdout } = await (0, exec_1.exec)('stat -f "%SB" -t "%Y-%m-%dT%H:%M:%S" /var/db/.AppleSetupDone');
|
|
12
|
+
const date = new Date(stdout.toString().trim());
|
|
13
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const getDisplayServer = async () => {
|
|
20
|
+
const { stdout } = await (0, exec_1.execSave)('pgrep WindowServer 2>/dev/null');
|
|
21
|
+
return (stdout || '').trim() ? 'quartz' : '';
|
|
22
|
+
};
|
|
23
|
+
const getCodename = (release) => {
|
|
24
|
+
let codename = 'macOS';
|
|
25
|
+
switch (true) {
|
|
26
|
+
case release.indexOf('10.4') > -1:
|
|
27
|
+
codename = 'OS X Tiger';
|
|
28
|
+
break;
|
|
29
|
+
case release.indexOf('10.5') > -1:
|
|
30
|
+
codename = 'OS X Leopard';
|
|
31
|
+
break;
|
|
32
|
+
case release.indexOf('10.6') > -1:
|
|
33
|
+
codename = 'OS X Snow Leopard';
|
|
34
|
+
break;
|
|
35
|
+
case release.indexOf('10.7') > -1:
|
|
36
|
+
codename = 'OS X Lion';
|
|
37
|
+
break;
|
|
38
|
+
case release.indexOf('10.8') > -1:
|
|
39
|
+
codename = 'OS X Mountain Lion';
|
|
40
|
+
break;
|
|
41
|
+
case release.indexOf('10.9') > -1:
|
|
42
|
+
codename = 'OS X Mavericks';
|
|
43
|
+
break;
|
|
44
|
+
case release.indexOf('10.10') > -1:
|
|
45
|
+
codename = 'OS X Yosemite';
|
|
46
|
+
break;
|
|
47
|
+
case release.indexOf('10.11') > -1:
|
|
48
|
+
codename = 'OS X El Capitan';
|
|
49
|
+
break;
|
|
50
|
+
case release.indexOf('10.12') > -1:
|
|
51
|
+
codename = 'Sierra';
|
|
52
|
+
break;
|
|
53
|
+
case release.indexOf('10.13') > -1:
|
|
54
|
+
codename = 'High Sierra';
|
|
55
|
+
break;
|
|
56
|
+
case release.indexOf('10.14') > -1:
|
|
57
|
+
codename = 'Mojave';
|
|
58
|
+
break;
|
|
59
|
+
case release.indexOf('10.15') > -1:
|
|
60
|
+
codename = 'Catalina';
|
|
61
|
+
break;
|
|
62
|
+
case release.startsWith('11.'):
|
|
63
|
+
codename = 'Big Sur';
|
|
64
|
+
break;
|
|
65
|
+
case release.startsWith('12.'):
|
|
66
|
+
codename = 'Monterey';
|
|
67
|
+
break;
|
|
68
|
+
case release.startsWith('13.'):
|
|
69
|
+
codename = 'Ventura';
|
|
70
|
+
break;
|
|
71
|
+
case release.startsWith('14.'):
|
|
72
|
+
codename = 'Sonoma';
|
|
73
|
+
break;
|
|
74
|
+
case release.startsWith('15.'):
|
|
75
|
+
codename = 'Sequoia';
|
|
76
|
+
break;
|
|
77
|
+
case release.startsWith('26.'):
|
|
78
|
+
codename = 'Tahoe';
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
codename = 'macOS';
|
|
82
|
+
}
|
|
83
|
+
return codename;
|
|
84
|
+
};
|
|
85
|
+
const osInfo = async () => {
|
|
86
|
+
await (0, common_1.nextTick)();
|
|
87
|
+
const defaults = await (0, defaults_1.initOsInfo)();
|
|
88
|
+
try {
|
|
89
|
+
const { stdout } = await (0, exec_1.exec)('sw_vers; sysctl -i kern.ostype kern.osrelease kern.osrevision kern.uuid');
|
|
90
|
+
const lines = stdout.toString().split('\n');
|
|
91
|
+
const distro = (0, common_1.getValue)(lines, 'ProductName');
|
|
92
|
+
const release = ((0, common_1.getValue)(lines, 'ProductVersion', ':', true, true) + ' ' + (0, common_1.getValue)(lines, 'ProductVersionExtra', ':', true, true)).trim();
|
|
93
|
+
return {
|
|
94
|
+
...defaults,
|
|
95
|
+
serial: (0, common_1.getValue)(lines, 'kern.uuid'),
|
|
96
|
+
distro,
|
|
97
|
+
release,
|
|
98
|
+
build: (0, common_1.getValue)(lines, 'BuildVersion'),
|
|
99
|
+
logofile: (0, mappings_1.getLogoFile)(distro),
|
|
100
|
+
codename: getCodename(release),
|
|
101
|
+
uefi: true,
|
|
102
|
+
codepage: (0, codepage_1.getCodepage)(),
|
|
103
|
+
installDate: await getInstallDate(),
|
|
104
|
+
displayServer: await getDisplayServer()
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch { }
|
|
108
|
+
return defaults;
|
|
109
|
+
};
|
|
110
|
+
exports.osInfo = osInfo;
|