Update/040 types (#2845)

* small type changes and clear todos

* handle notifications and metrics

* wip

* fixes

* migration

* dedup all urls

* better handling of clearnet ips

* add rfkill dependency

---------

Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
Aiden McClelland
2025-03-06 20:36:19 -07:00
committed by GitHub
parent ac392dcb96
commit e830fade06
63 changed files with 800 additions and 480 deletions

View File

@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type UnsetPublicParams = { interface: string }
export type Celsius = number

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type GigaBytes = number

View File

@@ -2,6 +2,7 @@
import type { NetworkInterfaceType } from "./NetworkInterfaceType"
export type IpInfo = {
name: string
scopeId: number
deviceType: NetworkInterfaceType | null
subnets: string[]

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type MebiBytes = number

View File

@@ -0,0 +1,12 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { MetricsCpu } from "./MetricsCpu"
import type { MetricsDisk } from "./MetricsDisk"
import type { MetricsGeneral } from "./MetricsGeneral"
import type { MetricsMemory } from "./MetricsMemory"
export type Metrics = {
general: MetricsGeneral
memory: MetricsMemory
cpu: MetricsCpu
disk: MetricsDisk
}

View File

@@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Percentage } from "./Percentage"
export type MetricsCpu = {
percentageUsed: Percentage
idle: Percentage
userSpace: Percentage
kernelSpace: Percentage
wait: Percentage
}

View File

@@ -0,0 +1,10 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { GigaBytes } from "./GigaBytes"
import type { Percentage } from "./Percentage"
export type MetricsDisk = {
percentageUsed: Percentage
used: GigaBytes
available: GigaBytes
capacity: GigaBytes
}

View File

@@ -0,0 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { Celsius } from "./Celsius"
export type MetricsGeneral = { temperature: Celsius | null }

View File

@@ -0,0 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { MebiBytes } from "./MebiBytes"
import type { Percentage } from "./Percentage"
export type MetricsMemory = {
percentageUsed: Percentage
total: MebiBytes
available: MebiBytes
used: MebiBytes
zramTotal: MebiBytes
zramAvailable: MebiBytes
zramUsed: MebiBytes
}

View File

@@ -0,0 +1,13 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AcmeProvider } from "./AcmeProvider"
import type { AcmeSettings } from "./AcmeSettings"
import type { Host } from "./Host"
import type { NetworkInterfaceInfo } from "./NetworkInterfaceInfo"
import type { WifiInfo } from "./WifiInfo"
export type NetworkInfo = {
wifi: WifiInfo
host: Host
networkInterfaces: { [key: string]: NetworkInterfaceInfo }
acme: { [key: AcmeProvider]: AcmeSettings }
}

View File

@@ -2,6 +2,7 @@
import type { IpInfo } from "./IpInfo"
export type NetworkInterfaceInfo = {
public: boolean | null
inbound: boolean | null
outbound: boolean | null
ipInfo: IpInfo | null
}

View File

@@ -1,6 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type NetworkInterfaceSetPublicParams = {
export type NetworkInterfaceSetInboundParams = {
interface: string
public: boolean | null
inbound: boolean | null
}

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type Percentage = number

View File

@@ -1,28 +1,21 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { AcmeProvider } from "./AcmeProvider"
import type { AcmeSettings } from "./AcmeSettings"
import type { Governor } from "./Governor"
import type { Host } from "./Host"
import type { LshwDevice } from "./LshwDevice"
import type { NetworkInterfaceInfo } from "./NetworkInterfaceInfo"
import type { NetworkInfo } from "./NetworkInfo"
import type { ServerStatus } from "./ServerStatus"
import type { SmtpValue } from "./SmtpValue"
import type { WifiInfo } from "./WifiInfo"
export type ServerInfo = {
arch: string
platform: string
id: string
hostname: string
host: Host
version: string
packageVersionCompat: string
postInitMigrationTodos: string[]
lastBackup: string | null
networkInterfaces: { [key: string]: NetworkInterfaceInfo }
acme: { [key: AcmeProvider]: AcmeSettings }
network: NetworkInfo
statusInfo: ServerStatus
wifi: WifiInfo
unreadNotificationCount: number
passwordHash: string
pubkey: string

View File

@@ -0,0 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type UnsetInboundParams = { interface: string }

View File

@@ -1,6 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type WifiInfo = {
enabled: boolean
interface: string | null
ssids: Array<string>
selected: string | null

View File

@@ -46,6 +46,7 @@ export { BlockDev } from "./BlockDev"
export { BuildArg } from "./BuildArg"
export { CallbackId } from "./CallbackId"
export { Category } from "./Category"
export { Celsius } from "./Celsius"
export { CheckDependenciesParam } from "./CheckDependenciesParam"
export { CheckDependenciesResult } from "./CheckDependenciesResult"
export { Cifs } from "./Cifs"
@@ -93,6 +94,7 @@ export { GetSslKeyParams } from "./GetSslKeyParams"
export { GetStatusParams } from "./GetStatusParams"
export { GetStoreParams } from "./GetStoreParams"
export { GetSystemSmtpParams } from "./GetSystemSmtpParams"
export { GigaBytes } from "./GigaBytes"
export { GitHash } from "./GitHash"
export { Governor } from "./Governor"
export { Guid } from "./Guid"
@@ -125,14 +127,21 @@ export { LshwProcessor } from "./LshwProcessor"
export { MainStatus } from "./MainStatus"
export { Manifest } from "./Manifest"
export { MaybeUtf8String } from "./MaybeUtf8String"
export { MebiBytes } from "./MebiBytes"
export { MerkleArchiveCommitment } from "./MerkleArchiveCommitment"
export { MetricsCpu } from "./MetricsCpu"
export { MetricsDisk } from "./MetricsDisk"
export { MetricsGeneral } from "./MetricsGeneral"
export { MetricsMemory } from "./MetricsMemory"
export { Metrics } from "./Metrics"
export { MountParams } from "./MountParams"
export { MountTarget } from "./MountTarget"
export { NamedHealthCheckResult } from "./NamedHealthCheckResult"
export { NamedProgress } from "./NamedProgress"
export { NetInfo } from "./NetInfo"
export { NetworkInfo } from "./NetworkInfo"
export { NetworkInterfaceInfo } from "./NetworkInterfaceInfo"
export { NetworkInterfaceSetPublicParams } from "./NetworkInterfaceSetPublicParams"
export { NetworkInterfaceSetInboundParams } from "./NetworkInterfaceSetInboundParams"
export { NetworkInterfaceType } from "./NetworkInterfaceType"
export { OnionHostname } from "./OnionHostname"
export { OsIndex } from "./OsIndex"
@@ -149,6 +158,7 @@ export { PackageState } from "./PackageState"
export { PackageVersionInfo } from "./PackageVersionInfo"
export { PasswordType } from "./PasswordType"
export { PathOrUrl } from "./PathOrUrl"
export { Percentage } from "./Percentage"
export { ProcedureId } from "./ProcedureId"
export { Progress } from "./Progress"
export { Public } from "./Public"
@@ -188,7 +198,7 @@ export { SignerInfo } from "./SignerInfo"
export { SmtpValue } from "./SmtpValue"
export { StartStop } from "./StartStop"
export { TestSmtpParams } from "./TestSmtpParams"
export { UnsetPublicParams } from "./UnsetPublicParams"
export { UnsetInboundParams } from "./UnsetInboundParams"
export { UpdatingState } from "./UpdatingState"
export { VerifyCifsParams } from "./VerifyCifsParams"
export { VersionSignerParams } from "./VersionSignerParams"

View File

@@ -73,7 +73,7 @@ import * as actions from "../../base/lib/actions"
import { setupInit } from "./inits/setupInit"
import * as fs from "node:fs/promises"
export const OSVersion = testTypeVersion("0.3.6-alpha.15")
export const OSVersion = testTypeVersion("0.4.0-alpha.0")
// prettier-ignore
type AnyNeverCond<T extends any[], Then, Else> =