Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. // Type definitions for systeminformation
  2. // Project: https://github.com/sebhildebrandt/systeminformation
  3. // Definitions by: sebhildebrandt <https://github.com/sebhildebrandt>
  4. export namespace Systeminformation {
  5. // 1. General
  6. interface TimeData {
  7. current: string;
  8. uptime: string;
  9. timezone: string;
  10. timezoneName: string;
  11. }
  12. // 2. System (HW)
  13. interface SystemData {
  14. manufacturer: string;
  15. model: string;
  16. version: string;
  17. serial: string;
  18. uuid: string;
  19. sku: string;
  20. }
  21. interface BiosData {
  22. vendor: string;
  23. version: string;
  24. releaseDate: string;
  25. revision: string;
  26. }
  27. interface BaseboardData {
  28. manufacturer: string;
  29. model: string;
  30. version: string;
  31. serial: string;
  32. assetTag: string;
  33. }
  34. interface ChassisData {
  35. manufacturer: string;
  36. model: string;
  37. type: string;
  38. version: string;
  39. serial: string;
  40. assetTag: string;
  41. sku: string;
  42. }
  43. // 3. CPU, Memory, Disks, Battery, Graphics
  44. interface CpuData {
  45. manufacturer: string;
  46. brand: string;
  47. vendor: string;
  48. family: string;
  49. model: string;
  50. stepping: string;
  51. revision: string;
  52. voltage: string;
  53. speed: string;
  54. speedmin: string;
  55. speedmax: string;
  56. governor: string;
  57. cores: number;
  58. physicalCores: number;
  59. processors: number;
  60. socket: string;
  61. cache: CpuCacheData;
  62. }
  63. interface CpuWithFlagsData extends CpuData {
  64. flags: string;
  65. }
  66. interface CpuCacheData {
  67. l1d: number;
  68. l1i: number;
  69. l2: number;
  70. l3: number;
  71. }
  72. interface CpuCurrentSpeedData {
  73. min: number;
  74. max: number;
  75. avg: number;
  76. cores: number[];
  77. }
  78. interface CpuTemperatureData {
  79. main: number;
  80. cores: number[];
  81. max: number;
  82. }
  83. interface MemData {
  84. total: number;
  85. free: number;
  86. used: number;
  87. active: number;
  88. available: number;
  89. buffcache: number;
  90. buffers: number;
  91. cached: number;
  92. slab: number;
  93. swaptotal: number;
  94. swapused: number;
  95. swapfree: number;
  96. }
  97. interface MemLayoutData {
  98. size: number;
  99. bank: string;
  100. type: string;
  101. clockSpeed: number;
  102. formFactor: string;
  103. partNum: string;
  104. serialNum: string;
  105. voltageConfigured: number;
  106. voltageMin: number;
  107. voltageMax: number;
  108. }
  109. interface SmartData {
  110. smartctl: {
  111. version: number[];
  112. platform_info: string;
  113. build_info: string;
  114. argv: string[];
  115. exit_status: number;
  116. };
  117. json_format_version: number[];
  118. device: {
  119. name: string;
  120. info_name: string;
  121. type: string;
  122. protocol: string;
  123. }
  124. smart_status: {
  125. passed: boolean;
  126. }
  127. ata_smart_attributes: {
  128. revision: number;
  129. table: {
  130. id: number;
  131. name: string;
  132. value: number;
  133. worst: number;
  134. thresh: number;
  135. when_failed: string;
  136. flags: {
  137. value: number;
  138. string: string;
  139. prefailure: boolean;
  140. updated_online: boolean;
  141. performance: boolean;
  142. error_rate: boolean;
  143. event_count: boolean;
  144. auto_keep: boolean;
  145. };
  146. raw: { value: number; string: string }
  147. }[];
  148. };
  149. power_on_time: {
  150. hours: number;
  151. };
  152. power_cycle_count: number;
  153. temperature: {
  154. current: number;
  155. };
  156. ata_smart_error_log: {
  157. summary: {
  158. revision: number;
  159. count: number;
  160. };
  161. };
  162. ata_smart_self_test_log: {
  163. standard: {
  164. revision: number;
  165. table: {
  166. type: {
  167. value: number;
  168. string: string;
  169. },
  170. status: {
  171. value: number;
  172. string: string;
  173. passed: boolean;
  174. },
  175. lifetime_hours: number;
  176. }[];
  177. count: number;
  178. error_count_total: number;
  179. error_count_outdated: number;
  180. };
  181. }
  182. }
  183. interface DiskLayoutData {
  184. device: string;
  185. type: string;
  186. name: string;
  187. vendor: string;
  188. size: number;
  189. bytesPerSector: number;
  190. totalCylinders: number;
  191. totalHeads: number;
  192. totalSectors: number;
  193. totalTracks: number;
  194. tracksPerCylinder: number;
  195. sectorsPerTrack: number;
  196. firmwareRevision: string;
  197. serialNum: string;
  198. interfaceType: string;
  199. smartStatus: string;
  200. smartData?: SmartData;
  201. }
  202. interface BatteryData {
  203. hasbattery: boolean;
  204. cyclecount: number;
  205. ischarging: boolean;
  206. voltage: number;
  207. designedcapacity: number;
  208. maxcapacity: number;
  209. currentcapacity: number;
  210. capacityUnit: string;
  211. percent: number;
  212. timeremaining: number,
  213. acconnected: boolean;
  214. type: string;
  215. model: string;
  216. manufacturer: string;
  217. serial: string;
  218. }
  219. interface GraphicsData {
  220. controllers: GraphicsControllerData[];
  221. displays: GraphicsDisplayData[];
  222. }
  223. interface GraphicsControllerData {
  224. vendor: string;
  225. model: string;
  226. bus: string;
  227. vram: number;
  228. vramDynamic: boolean;
  229. }
  230. interface GraphicsDisplayData {
  231. vendor: string;
  232. model: string;
  233. main: boolean;
  234. builtin: boolean;
  235. connection: string;
  236. sizex: number;
  237. sizey: number;
  238. pixeldepth: number;
  239. resolutionx: number;
  240. resolutiony: number;
  241. currentResX: number;
  242. currentResY: number;
  243. positionX: number;
  244. positionY: number;
  245. currentRefreshRate: number;
  246. }
  247. // 4. Operating System
  248. interface OsData {
  249. platform: string;
  250. distro: string;
  251. release: string;
  252. codename: string;
  253. kernel: string;
  254. arch: string;
  255. hostname: string;
  256. codepage: string;
  257. logofile: string;
  258. serial: string;
  259. build: string;
  260. servicepack: string;
  261. uefi: boolean;
  262. }
  263. interface UuidData {
  264. os: string;
  265. }
  266. interface VersionData {
  267. kernel?: string;
  268. openssl?: string;
  269. systemOpenssl?: string;
  270. systemOpensslLib?: string;
  271. node?: string;
  272. v8?: string;
  273. npm?: string;
  274. yarn?: string;
  275. pm2?: string;
  276. gulp?: string;
  277. grunt?: string;
  278. git?: string;
  279. tsc?: string;
  280. mysql?: string;
  281. redis?: string;
  282. mongodb?: string;
  283. nginx?: string;
  284. php?: string;
  285. docker?: string;
  286. postfix?: string;
  287. postgresql?: string;
  288. perl?: string;
  289. python?: string;
  290. python3?: string;
  291. pip?: string;
  292. pip3?: string;
  293. java?: string;
  294. gcc?: string;
  295. virtualbox?: string;
  296. dotnet?: string;
  297. }
  298. interface UserData {
  299. user: string;
  300. tty: string;
  301. date: string;
  302. time: string;
  303. ip: string;
  304. command: string;
  305. }
  306. // 5. File System
  307. interface FsSizeData {
  308. fs: string;
  309. type: string;
  310. size: number;
  311. used: number;
  312. use: number;
  313. mount: string;
  314. }
  315. interface FsOpenFilesData {
  316. max: number;
  317. allocated: number;
  318. available: number;
  319. }
  320. interface BlockDevicesData {
  321. name: string;
  322. identifier: string;
  323. type: string;
  324. fstype: string;
  325. mount: string;
  326. size: number;
  327. physical: string;
  328. uuid: string;
  329. label: string;
  330. model: string;
  331. serial: string;
  332. removable: boolean;
  333. protocol: string;
  334. }
  335. interface FsStatsData {
  336. rx_bytes: number;
  337. wx_bytes: number;
  338. tx_bytes: number;
  339. rx_sec: number;
  340. wx_sec: number;
  341. tx_sec: number;
  342. ms: number;
  343. }
  344. interface DisksIoData {
  345. rIO: number;
  346. wIO: number;
  347. tIO: number;
  348. rIO_sec: number;
  349. wIO_sec: number;
  350. tIO_sec: number;
  351. ms: number;
  352. }
  353. // 6. Network related functions
  354. interface NetworkInterfacesData {
  355. iface: string;
  356. ifaceName: string;
  357. ip4: string;
  358. ip4subnet: string;
  359. ip6: string;
  360. ip6subnet: string;
  361. mac: string;
  362. internal: boolean;
  363. virtual: boolean;
  364. operstate: string;
  365. type: string;
  366. duplex: string;
  367. mtu: number;
  368. speed: number;
  369. dhcp: boolean;
  370. dnsSuffix: string;
  371. ieee8021xAuth: string;
  372. ieee8021xState: string;
  373. carrier_changes: number;
  374. }
  375. interface NetworkStatsData {
  376. iface: string;
  377. operstate: string;
  378. rx_bytes: number;
  379. rx_dropped: number;
  380. rx_errors: number;
  381. tx_bytes: number;
  382. tx_dropped: number;
  383. tx_errors: number;
  384. rx_sec: number;
  385. tx_sec: number;
  386. ms: number;
  387. }
  388. interface NetworkConnectionsData {
  389. protocol: string;
  390. localaddress: string;
  391. localport: string;
  392. peeraddress: string;
  393. peerport: string;
  394. state: string;
  395. pid: number;
  396. process: string;
  397. }
  398. interface InetChecksiteData {
  399. url: string;
  400. ok: boolean;
  401. status: number;
  402. ms: number;
  403. }
  404. interface WifiNetworkData {
  405. ssid: string;
  406. bssid: string;
  407. mode: string;
  408. channel: number;
  409. frequency: number;
  410. signalLevel: number;
  411. quality: number;
  412. security: string[];
  413. wpaFlags: string[];
  414. rsnFlags: string[];
  415. }
  416. // 7. Current Load, Processes & Services
  417. interface CurrentLoadData {
  418. avgload: number;
  419. currentload: number;
  420. currentload_user: number;
  421. currentload_system: number;
  422. currentload_nice: number;
  423. currentload_idle: number;
  424. currentload_irq: number;
  425. raw_currentload: number;
  426. raw_currentload_user: number;
  427. raw_currentload_system: number;
  428. raw_currentload_nice: number;
  429. raw_currentload_idle: number;
  430. raw_currentload_irq: number;
  431. cpus: CurrentLoadCpuData[];
  432. }
  433. interface CurrentLoadCpuData {
  434. load: number;
  435. load_user: number;
  436. load_system: number;
  437. load_nice: number;
  438. load_idle: number;
  439. load_irq: number;
  440. raw_load: number;
  441. raw_load_user: number;
  442. raw_load_system: number;
  443. raw_load_nice: number;
  444. raw_load_idle: number;
  445. raw_load_irq: number;
  446. }
  447. interface ProcessesData {
  448. all: number;
  449. running: number;
  450. blocked: number;
  451. sleeping: number;
  452. unknown: number;
  453. list: ProcessesProcessData[];
  454. }
  455. interface ProcessesProcessData {
  456. pid: number;
  457. parentPid: number;
  458. name: string,
  459. pcpu: number;
  460. pcpuu: number;
  461. pcpus: number;
  462. pmem: number;
  463. priority: number;
  464. mem_vsz: number;
  465. mem_rss: number;
  466. nice: number;
  467. started: string,
  468. state: string;
  469. tty: string;
  470. user: string;
  471. command: string;
  472. params: string;
  473. path: string;
  474. }
  475. interface ProcessesProcessLoadData {
  476. proc: string;
  477. pid: number;
  478. pids: number[];
  479. cpu: number;
  480. mem: number;
  481. }
  482. interface ServicesData {
  483. name: string;
  484. running: boolean;
  485. startmode: string;
  486. pids: number[];
  487. pcpu: number;
  488. pmem: number;
  489. }
  490. // 8. Docker
  491. interface DockerInfoData {
  492. id: string;
  493. containers: number;
  494. containersRunning: number;
  495. containersPaused: number;
  496. containersStopped: number;
  497. images: number;
  498. driver: string;
  499. memoryLimit: boolean;
  500. swapLimit: boolean;
  501. kernelMemory: boolean;
  502. cpuCfsPeriod: boolean;
  503. cpuCfsQuota: boolean;
  504. cpuShares: boolean;
  505. cpuSet: boolean;
  506. ipv4Forwarding: boolean;
  507. bridgeNfIptables: boolean;
  508. bridgeNfIp6tables: boolean;
  509. debug: boolean;
  510. mfd: number;
  511. oomKillDisable: boolean;
  512. ngoroutines: number;
  513. systemTime: string;
  514. loggingDriver: string;
  515. cgroupDriver: string;
  516. nEventsListener: number;
  517. kernelVersion: string;
  518. operatingSystem: string;
  519. osType: string;
  520. architecture: string;
  521. ncpu: number;
  522. memTotal: number;
  523. dockerRootDir: string;
  524. httpProxy: string;
  525. httpsProxy: string;
  526. noProxy: string;
  527. name: string;
  528. labels: string[];
  529. experimentalBuild: boolean;
  530. serverVersion: string;
  531. clusterStore: string;
  532. clusterAdvertise: string;
  533. defaultRuntime: string;
  534. liveRestoreEnabled: boolean;
  535. isolation: string;
  536. initBinary: string;
  537. productLicense: string;
  538. }
  539. interface DockerContainerData {
  540. id: string;
  541. name: string;
  542. image: string;
  543. imageID: string;
  544. command: string;
  545. created: number;
  546. started: number;
  547. finished: number;
  548. createdAt: string;
  549. startedAt: string;
  550. finishedAt: string;
  551. state: string;
  552. restartCount: number;
  553. platform: string;
  554. driver: string;
  555. ports: number[];
  556. mounts: DockerContainerMountData[];
  557. }
  558. interface DockerContainerMountData {
  559. Type: string;
  560. Source: string;
  561. Destination: string;
  562. Mode: string;
  563. RW: boolean;
  564. Propagation: string;
  565. }
  566. interface DockerContainerStatsData {
  567. id: string;
  568. mem_usage: number;
  569. mem_limit: number;
  570. mem_percent: number;
  571. cpu_percent: number;
  572. netIO: {
  573. rx: number;
  574. wx: number;
  575. };
  576. blockIO: {
  577. r: number;
  578. w: number;
  579. };
  580. restartCount: number;
  581. cpu_stats: any;
  582. precpu_stats: any;
  583. memory_stats: any,
  584. networks: any;
  585. }
  586. // 9. Virtual Box
  587. interface VboxInfoData {
  588. id: string;
  589. name: string;
  590. running: boolean;
  591. started: string;
  592. runningSince: number;
  593. stopped: string;
  594. stoppedSince: number;
  595. guestOS: string;
  596. hardwareUUID: string;
  597. memory: number;
  598. vram: number;
  599. cpus: number;
  600. cpuExepCap: string;
  601. cpuProfile: string;
  602. chipset: string;
  603. firmware: string;
  604. pageFusion: boolean;
  605. configFile: string;
  606. snapshotFolder: string;
  607. logFolder: string;
  608. HPET: boolean;
  609. PAE: boolean;
  610. longMode: boolean;
  611. tripleFaultReset: boolean;
  612. APIC: boolean;
  613. X2APIC: boolean;
  614. ACPI: boolean;
  615. IOAPIC: boolean;
  616. biosAPICmode: string;
  617. bootMenuMode: string;
  618. bootDevice1: string;
  619. bootDevice2: string;
  620. bootDevice3: string;
  621. bootDevice4: string;
  622. timeOffset: string;
  623. RTC: string;
  624. }
  625. // 10. "Get All at once" - functions
  626. interface StaticData {
  627. version: string;
  628. system: SystemData;
  629. bios: BiosData;
  630. baseboard: BaseboardData;
  631. chassis: ChassisData;
  632. os: OsData;
  633. uuid: UuidData;
  634. versions: VersionData;
  635. cpu: CpuWithFlagsData;
  636. graphics: GraphicsData;
  637. net: NetworkInterfacesData[];
  638. memLayout: MemLayoutData[];
  639. diskLayout: DiskLayoutData[];
  640. }
  641. }
  642. export function version(): string;
  643. export function system(cb?: (data: Systeminformation.SystemData) => any): Promise<Systeminformation.SystemData>;
  644. export function bios(cb?: (data: Systeminformation.BiosData) => any): Promise<Systeminformation.BiosData>;
  645. export function baseboard(cb?: (data: Systeminformation.BaseboardData) => any): Promise<Systeminformation.BaseboardData>;
  646. export function chassis(cb?: (data: Systeminformation.ChassisData) => any): Promise<Systeminformation.ChassisData>;
  647. export function time(): Systeminformation.TimeData;
  648. export function osInfo(cb?: (data: Systeminformation.OsData) => any): Promise<Systeminformation.OsData>;
  649. export function versions(apps?: string, cb?: (data: Systeminformation.VersionData) => any): Promise<Systeminformation.VersionData>;
  650. export function shell(cb?: (data: string) => any): Promise<string>;
  651. export function uuid(cb?: (data: Systeminformation.UuidData) => any): Promise<Systeminformation.UuidData>;
  652. export function cpu(cb?: (data: Systeminformation.CpuData) => any): Promise<Systeminformation.CpuData>;
  653. export function cpuFlags(cb?: (data: string) => any): Promise<string>;
  654. export function cpuCache(cb?: (data: Systeminformation.CpuCacheData) => any): Promise<Systeminformation.CpuCacheData>;
  655. export function cpuCurrentspeed(cb?: (data: Systeminformation.CpuCurrentSpeedData) => any): Promise<Systeminformation.CpuCurrentSpeedData>;
  656. export function cpuTemperature(cb?: (data: Systeminformation.CpuTemperatureData) => any): Promise<Systeminformation.CpuTemperatureData>;
  657. export function currentLoad(cb?: (data: Systeminformation.CurrentLoadData) => any): Promise<Systeminformation.CurrentLoadData>;
  658. export function fullLoad(cb?: (data: number) => any): Promise<number>;
  659. export function mem(cb?: (data: Systeminformation.MemData) => any): Promise<Systeminformation.MemData>;
  660. export function memLayout(cb?: (data: Systeminformation.MemLayoutData[]) => any): Promise<Systeminformation.MemLayoutData[]>;
  661. export function battery(cb?: (data: Systeminformation.BatteryData) => any): Promise<Systeminformation.BatteryData>;
  662. export function graphics(cb?: (data: Systeminformation.GraphicsData) => any): Promise<Systeminformation.GraphicsData>;
  663. export function fsSize(cb?: (data: Systeminformation.FsSizeData[]) => any): Promise<Systeminformation.FsSizeData[]>;
  664. export function fsOpenFiles(cb?: (data: Systeminformation.FsOpenFilesData[]) => any): Promise<Systeminformation.FsOpenFilesData[]>;
  665. export function blockDevices(cb?: (data: Systeminformation.BlockDevicesData[]) => any): Promise<Systeminformation.BlockDevicesData[]>;
  666. export function fsStats(cb?: (data: Systeminformation.FsStatsData) => any): Promise<Systeminformation.FsStatsData>;
  667. export function disksIO(cb?: (data: Systeminformation.DisksIoData) => any): Promise<Systeminformation.DisksIoData>;
  668. export function diskLayout(cb?: (data: Systeminformation.DiskLayoutData[]) => any): Promise<Systeminformation.DiskLayoutData[]>;
  669. export function networkInterfaceDefault(cb?: (data: string) => any): Promise<string>;
  670. export function networkGatewayDefault(cb?: (data: string) => any): Promise<string>;
  671. export function networkInterfaces(cb?: (data: Systeminformation.NetworkInterfacesData[]) => any): Promise<Systeminformation.NetworkInterfacesData[]>;
  672. export function networkStats(ifaces?: string, cb?: (data: Systeminformation.NetworkStatsData[]) => any): Promise<Systeminformation.NetworkStatsData[]>;
  673. export function networkConnections(cb?: (data: Systeminformation.NetworkConnectionsData[]) => any): Promise<Systeminformation.NetworkConnectionsData[]>;
  674. export function inetChecksite(url: string, cb?: (data: Systeminformation.InetChecksiteData) => any): Promise<Systeminformation.InetChecksiteData>;
  675. export function inetLatency(host?: string, cb?: (data: number) => any): Promise<number>;
  676. export function wifiNetworks(cb?: (data: Systeminformation.WifiNetworkData[]) => any): Promise<Systeminformation.WifiNetworkData[]>;
  677. export function users(cb?: (data: Systeminformation.UserData[]) => any): Promise<Systeminformation.UserData[]>;
  678. export function processes(cb?: (data: Systeminformation.ProcessesData) => any): Promise<Systeminformation.ProcessesData>;
  679. export function processLoad(processName: string, cb?: (data: Systeminformation.ProcessesProcessLoadData) => any): Promise<Systeminformation.ProcessesProcessLoadData>;
  680. export function services(serviceName: string, cb?: (data: Systeminformation.ServicesData[]) => any): Promise<Systeminformation.ServicesData[]>;
  681. export function dockerInfo(cb?: (data: Systeminformation.DockerInfoData) => any): Promise<Systeminformation.DockerInfoData>;
  682. export function dockerContainers(all?: boolean, cb?: (data: Systeminformation.DockerContainerData[]) => any): Promise<Systeminformation.DockerContainerData[]>;
  683. export function dockerContainerStats(id?: string, cb?: (data: Systeminformation.DockerContainerStatsData[]) => any): Promise<Systeminformation.DockerContainerStatsData[]>;
  684. export function dockerContainerProcesses(id?: string, cb?: (data: any) => any): Promise<any>;
  685. export function dockerAll(cb?: (data: any) => any): Promise<any>;
  686. export function vboxInfo(cb?: (data: Systeminformation.VboxInfoData[]) => any): Promise<Systeminformation.VboxInfoData[]>;
  687. export function getStaticData(cb?: (data: Systeminformation.StaticData) => any): Promise<Systeminformation.StaticData>;
  688. export function getDynamicData(srv?: string, iface?: string, cb?: (data: any) => any): Promise<any>;
  689. export function getAllData(srv?: string, iface?: string, cb?: (data: any) => any): Promise<any>;
  690. export function get(valuesObject: any, cb?: (data: any) => any): Promise<any>;
  691. export function observe(valuesObject: any, interval: number, cb?: (data: any) => any): number;