mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
clean up tech debt, bump dependencies
This commit is contained in:
@@ -77,7 +77,7 @@ export async function checkDependencies<
|
||||
}
|
||||
const tasksSatisfied = (packageId: DependencyId) =>
|
||||
Object.entries(infoFor(packageId).result.tasks).filter(
|
||||
([_, t]) => t.active && t.task.severity === "critical",
|
||||
([_, t]) => t?.active && t.task.severity === "critical",
|
||||
).length === 0
|
||||
const healthCheckSatisfied = (
|
||||
packageId: DependencyId,
|
||||
@@ -146,7 +146,7 @@ export async function checkDependencies<
|
||||
const throwIfTasksNotSatisfied = (packageId: DependencyId) => {
|
||||
const dep = infoFor(packageId)
|
||||
const reqs = Object.entries(dep.result.tasks)
|
||||
.filter(([_, t]) => t.active && t.task.severity === "critical")
|
||||
.filter(([_, t]) => t?.active && t.task.severity === "critical")
|
||||
.map(([id, _]) => id)
|
||||
if (reqs.length) {
|
||||
throw new Error(
|
||||
|
||||
@@ -2,7 +2,10 @@ import * as T from "../types"
|
||||
import { once } from "../util"
|
||||
|
||||
export type RequiredDependenciesOf<Manifest extends T.SDKManifest> = {
|
||||
[K in keyof Manifest["dependencies"]]: Manifest["dependencies"][K]["optional"] extends false
|
||||
[K in keyof Manifest["dependencies"]]: Exclude<
|
||||
Manifest["dependencies"][K],
|
||||
undefined
|
||||
>["optional"] extends false
|
||||
? K
|
||||
: never
|
||||
}[keyof Manifest["dependencies"]]
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
import type { PackageDataEntry } from "./PackageDataEntry"
|
||||
import type { PackageId } from "./PackageId"
|
||||
|
||||
export type AllPackageData = { [key: PackageId]: PackageDataEntry }
|
||||
export type AllPackageData = { [key in PackageId]?: PackageDataEntry }
|
||||
|
||||
@@ -12,6 +12,6 @@ export type CheckDependenciesResult = {
|
||||
installedVersion: Version | null
|
||||
satisfies: Array<Version>
|
||||
isRunning: boolean
|
||||
tasks: { [key: ReplayId]: TaskEntry }
|
||||
healthChecks: { [key: HealthCheckId]: NamedHealthCheckResult }
|
||||
tasks: { [key in ReplayId]?: TaskEntry }
|
||||
healthChecks: { [key in HealthCheckId]?: NamedHealthCheckResult }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
import type { CurrentDependencyInfo } from "./CurrentDependencyInfo"
|
||||
import type { PackageId } from "./PackageId"
|
||||
|
||||
export type CurrentDependencies = { [key: PackageId]: CurrentDependencyInfo }
|
||||
export type CurrentDependencies = { [key in PackageId]?: CurrentDependencyInfo }
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
import type { DepInfo } from "./DepInfo"
|
||||
import type { PackageId } from "./PackageId"
|
||||
|
||||
export type Dependencies = { [key: PackageId]: DepInfo }
|
||||
export type Dependencies = { [key in PackageId]?: DepInfo }
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type DnsSettings = { dhcp: Array<string>; static: Array<string> | null }
|
||||
export type DnsSettings = {
|
||||
dhcpServers: Array<string>
|
||||
staticServers: Array<string> | null
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { PublicDomainConfig } from "./PublicDomainConfig"
|
||||
|
||||
export type Domains = {
|
||||
public: { [key: string]: PublicDomainConfig }
|
||||
private: Array<string>
|
||||
}
|
||||
@@ -10,5 +10,5 @@ export type FullIndex = {
|
||||
icon: DataUrl | null
|
||||
package: PackageIndex
|
||||
os: OsIndex
|
||||
signers: { [key: Guid]: SignerInfo }
|
||||
signers: { [key in Guid]?: SignerInfo }
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ import type { Version } from "./Version"
|
||||
|
||||
export type GetPackageResponse = {
|
||||
categories: string[]
|
||||
best: { [key: Version]: PackageVersionInfo }
|
||||
otherVersions?: { [key: Version]: PackageInfoShort }
|
||||
best: { [key in Version]?: PackageVersionInfo }
|
||||
otherVersions?: { [key in Version]?: PackageInfoShort }
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ import type { Version } from "./Version"
|
||||
|
||||
export type GetPackageResponseFull = {
|
||||
categories: string[]
|
||||
best: { [key: Version]: PackageVersionInfo }
|
||||
otherVersions: { [key: Version]: PackageVersionInfo }
|
||||
best: { [key in Version]?: PackageVersionInfo }
|
||||
otherVersions: { [key in Version]?: PackageVersionInfo }
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { BindInfo } from "./BindInfo"
|
||||
import type { Domains } from "./Domains"
|
||||
import type { HostnameInfo } from "./HostnameInfo"
|
||||
import type { PublicDomainConfig } from "./PublicDomainConfig"
|
||||
|
||||
export type Host = {
|
||||
bindings: { [key: number]: BindInfo }
|
||||
bindings: { [key in number]?: BindInfo }
|
||||
onions: string[]
|
||||
domains: Domains
|
||||
publicDomains: { [key in string]?: PublicDomainConfig }
|
||||
privateDomains: Array<string>
|
||||
/**
|
||||
* COMPUTED: NetService::update
|
||||
*/
|
||||
hostnameInfo: { [key: number]: Array<HostnameInfo> }
|
||||
hostnameInfo: { [key in number]?: Array<HostnameInfo> }
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
import type { Host } from "./Host"
|
||||
import type { HostId } from "./HostId"
|
||||
|
||||
export type Hosts = { [key: HostId]: Host }
|
||||
export type Hosts = { [key in HostId]?: Host }
|
||||
|
||||
@@ -7,7 +7,7 @@ export type ImageSource =
|
||||
dockerBuild: {
|
||||
workdir?: string
|
||||
dockerfile?: string
|
||||
buildArgs?: { [key: string]: BuildArg }
|
||||
buildArgs?: { [key in string]?: BuildArg }
|
||||
}
|
||||
}
|
||||
| { dockerTag: string }
|
||||
|
||||
@@ -15,11 +15,11 @@ export type MainStatus =
|
||||
| { main: "stopping" }
|
||||
| {
|
||||
main: "starting"
|
||||
health: { [key: HealthCheckId]: NamedHealthCheckResult }
|
||||
health: { [key in HealthCheckId]?: NamedHealthCheckResult }
|
||||
}
|
||||
| {
|
||||
main: "running"
|
||||
started: string
|
||||
health: { [key: HealthCheckId]: NamedHealthCheckResult }
|
||||
health: { [key in HealthCheckId]?: NamedHealthCheckResult }
|
||||
}
|
||||
| { main: "backingUp"; onComplete: StartStop }
|
||||
|
||||
@@ -26,7 +26,7 @@ export type Manifest = {
|
||||
donationUrl: string | null
|
||||
docsUrl: string | null
|
||||
description: Description
|
||||
images: { [key: ImageId]: ImageConfig }
|
||||
images: { [key in ImageId]?: ImageConfig }
|
||||
volumes: Array<VolumeId>
|
||||
alerts: Alerts
|
||||
dependencies: Dependencies
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import type { AcmeProvider } from "./AcmeProvider"
|
||||
import type { AcmeSettings } from "./AcmeSettings"
|
||||
import type { DnsSettings } from "./DnsSettings"
|
||||
import type { DomainSettings } from "./DomainSettings"
|
||||
import type { GatewayId } from "./GatewayId"
|
||||
import type { Host } from "./Host"
|
||||
import type { NetworkInterfaceInfo } from "./NetworkInterfaceInfo"
|
||||
@@ -11,8 +10,7 @@ import type { WifiInfo } from "./WifiInfo"
|
||||
export type NetworkInfo = {
|
||||
wifi: WifiInfo
|
||||
host: Host
|
||||
gateways: { [key: GatewayId]: NetworkInterfaceInfo }
|
||||
acme: { [key: AcmeProvider]: AcmeSettings }
|
||||
domains: { [key: string]: DomainSettings }
|
||||
gateways: { [key in GatewayId]?: NetworkInterfaceInfo }
|
||||
acme: { [key in AcmeProvider]?: AcmeSettings }
|
||||
dns: DnsSettings
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export type OsVersionInfo = {
|
||||
releaseNotes: string
|
||||
sourceVersion: string
|
||||
authorized: Array<Guid>
|
||||
iso: { [key: string]: RegistryAsset<Blake3Commitment> }
|
||||
squashfs: { [key: string]: RegistryAsset<Blake3Commitment> }
|
||||
img: { [key: string]: RegistryAsset<Blake3Commitment> }
|
||||
iso: { [key in string]?: RegistryAsset<Blake3Commitment> }
|
||||
squashfs: { [key in string]?: RegistryAsset<Blake3Commitment> }
|
||||
img: { [key in string]?: RegistryAsset<Blake3Commitment> }
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { OsVersionInfo } from "./OsVersionInfo"
|
||||
|
||||
export type OsVersionInfoMap = { [key: string]: OsVersionInfo }
|
||||
export type OsVersionInfoMap = { [key in string]?: OsVersionInfo }
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { DataUrl } from "./DataUrl"
|
||||
import type { Hosts } from "./Hosts"
|
||||
import type { MainStatus } from "./MainStatus"
|
||||
import type { PackageState } from "./PackageState"
|
||||
import type { ReplayId } from "./ReplayId"
|
||||
import type { ServiceInterface } from "./ServiceInterface"
|
||||
import type { ServiceInterfaceId } from "./ServiceInterfaceId"
|
||||
import type { TaskEntry } from "./TaskEntry"
|
||||
@@ -19,9 +20,9 @@ export type PackageDataEntry = {
|
||||
icon: DataUrl
|
||||
lastBackup: string | null
|
||||
currentDependencies: CurrentDependencies
|
||||
actions: { [key: ActionId]: ActionMetadata }
|
||||
tasks: { [key: string]: TaskEntry }
|
||||
serviceInterfaces: { [key: ServiceInterfaceId]: ServiceInterface }
|
||||
actions: { [key in ActionId]?: ActionMetadata }
|
||||
tasks: { [key in ReplayId]?: TaskEntry }
|
||||
serviceInterfaces: { [key in ServiceInterfaceId]?: ServiceInterface }
|
||||
hosts: Hosts
|
||||
storeExposedDependents: string[]
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ import type { PackageId } from "./PackageId"
|
||||
import type { PackageInfo } from "./PackageInfo"
|
||||
|
||||
export type PackageIndex = {
|
||||
categories: { [key: string]: Category }
|
||||
packages: { [key: PackageId]: PackageInfo }
|
||||
categories: { [key in string]?: Category }
|
||||
packages: { [key in PackageId]?: PackageInfo }
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ import type { Version } from "./Version"
|
||||
|
||||
export type PackageInfo = {
|
||||
authorized: Array<Guid>
|
||||
versions: { [key: Version]: PackageVersionInfo }
|
||||
versions: { [key in Version]?: PackageVersionInfo }
|
||||
categories: string[]
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export type PackageVersionInfo = {
|
||||
donationUrl: string | null
|
||||
docsUrl: string | null
|
||||
alerts: Alerts
|
||||
dependencyMetadata: { [key: PackageId]: DependencyMetadata }
|
||||
dependencyMetadata: { [key in PackageId]?: DependencyMetadata }
|
||||
osVersion: string
|
||||
sdkVersion: string | null
|
||||
hardwareRequirements: HardwareRequirements
|
||||
|
||||
@@ -6,5 +6,5 @@ export type RegistryAsset<Commitment> = {
|
||||
publishedAt: string
|
||||
url: string
|
||||
commitment: Commitment
|
||||
signatures: { [key: AnyVerifyingKey]: AnySignature }
|
||||
signatures: { [key in AnyVerifyingKey]?: AnySignature }
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ import type { DataUrl } from "./DataUrl"
|
||||
export type RegistryInfo = {
|
||||
name: string | null
|
||||
icon: DataUrl | null
|
||||
categories: { [key: string]: Category }
|
||||
categories: { [key in string]?: Category }
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { FullProgress } from "./FullProgress"
|
||||
import type { PackageId } from "./PackageId"
|
||||
|
||||
export type ServerStatus = {
|
||||
backupProgress: { [key: PackageId]: BackupProgress } | null
|
||||
backupProgress: { [key in PackageId]?: BackupProgress } | null
|
||||
updated: boolean
|
||||
updateProgress: FullProgress | null
|
||||
shuttingDown: boolean
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
import type { Session } from "./Session"
|
||||
|
||||
export type Sessions = {
|
||||
[key: string]: {
|
||||
loggedIn: string
|
||||
lastActive: string
|
||||
userAgent: string | null
|
||||
}
|
||||
}
|
||||
export type Sessions = { [key in string]?: Session }
|
||||
|
||||
@@ -68,7 +68,6 @@ export { DestroySubcontainerFsParams } from "./DestroySubcontainerFsParams"
|
||||
export { DeviceFilter } from "./DeviceFilter"
|
||||
export { DnsSettings } from "./DnsSettings"
|
||||
export { DomainSettings } from "./DomainSettings"
|
||||
export { Domains } from "./Domains"
|
||||
export { Duration } from "./Duration"
|
||||
export { EchoParams } from "./EchoParams"
|
||||
export { EditSignerParams } from "./EditSignerParams"
|
||||
|
||||
@@ -101,18 +101,20 @@ export class S9pk {
|
||||
)
|
||||
}
|
||||
|
||||
async dependencyMetadata(): Promise<Record<PackageId, DependencyMetadata>> {
|
||||
async dependencyMetadata() {
|
||||
return Object.fromEntries(
|
||||
await Promise.all(
|
||||
Object.entries(this.manifest.dependencies).map(async ([id, info]) => [
|
||||
id,
|
||||
{
|
||||
...(await this.dependencyMetadataFor(id)),
|
||||
icon: await this.dependencyIconFor(id),
|
||||
description: info.description,
|
||||
optional: info.optional,
|
||||
},
|
||||
]),
|
||||
Object.entries(this.manifest.dependencies)
|
||||
.filter(([_, info]) => !!info)
|
||||
.map(async ([id, info]) => [
|
||||
id,
|
||||
{
|
||||
...(await this.dependencyMetadataFor(id)),
|
||||
icon: await this.dependencyIconFor(id),
|
||||
description: info!.description,
|
||||
optional: info!.optional,
|
||||
},
|
||||
]),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export const filledAddress = (
|
||||
addressInfo: AddressInfo,
|
||||
): FilledAddressInfo => {
|
||||
const toUrl = addressHostToUrl.bind(null, addressInfo)
|
||||
const hostnames = host.hostnameInfo[addressInfo.internalPort]
|
||||
const hostnames = host.hostnameInfo[addressInfo.internalPort] ?? []
|
||||
|
||||
return {
|
||||
...addressInfo,
|
||||
|
||||
Reference in New Issue
Block a user