diff --git a/Makefile b/Makefile index b437810a9..ff0b0b0cb 100644 --- a/Makefile +++ b/Makefile @@ -283,10 +283,7 @@ sdk/base/lib/osBindings/index.ts: $(shell if [ "$(REBUILD_TYPES)" -ne 0 ]; then touch sdk/base/lib/osBindings/index.ts core/startos/bindings/index.ts: $(call ls-files, core) $(ENVIRONMENT_FILE) - rm -rf core/startos/bindings ./core/build-ts.sh - ls core/startos/bindings/*.ts | sed 's/core\/startos\/bindings\/\([^.]*\)\.ts/export { \1 } from ".\/\1";/g' | grep -v '"./index"' | tee core/startos/bindings/index.ts - npm --prefix sdk exec -- prettier --config ./sdk/base/package.json -w ./core/startos/bindings/*.ts touch core/startos/bindings/index.ts sdk/dist/package.json sdk/baseDist/package.json: $(call ls-files, sdk) sdk/base/lib/osBindings/index.ts diff --git a/core/Cargo.lock b/core/Cargo.lock index 2ffbca243..11e818076 100644 --- a/core/Cargo.lock +++ b/core/Cargo.lock @@ -367,7 +367,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -379,7 +379,7 @@ checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -391,7 +391,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -459,9 +459,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a89bce6054c720275ac2432fbba080a66a2106a44a1b804553930ca6909f4e0" +checksum = "93c1f86859c1af3d514fa19e8323147ff10ea98684e6c7b307912509f50e67b2" dependencies = [ "compression-codecs", "compression-core", @@ -567,7 +567,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -634,7 +634,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -651,7 +651,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -989,7 +989,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1107,7 +1107,7 @@ checksum = "e0b121a9fe0df916e362fb3271088d071159cdf11db0e4182d02152850756eff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1404,7 +1404,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -1497,9 +1497,9 @@ dependencies = [ [[package]] name = "compression-codecs" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8a506ec4b81c460798f572caead636d57d3d7e940f998160f52bd254bf2d23" +checksum = "680dc087785c5230f8e8843e2e57ac7c1c90488b6a91b88caa265410568f441b" dependencies = [ "brotli", "compression-core", @@ -1512,9 +1512,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47641d3deaf41fb1538ac1f54735925e275eaf3bf4d55c81b137fba797e5cbb" +checksum = "3a9b614a5787ef0c8802a55766480563cb3a93b435898c422ed2a359cf811582" [[package]] name = "concurrent-queue" @@ -2011,7 +2011,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2059,7 +2059,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2081,7 +2081,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2138,7 +2138,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2175,7 +2175,7 @@ dependencies = [ "quote", "sha3 0.10.8", "strum", - "syn 2.0.109", + "syn 2.0.110", "void", ] @@ -2187,7 +2187,7 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2231,7 +2231,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2252,7 +2252,7 @@ dependencies = [ "convert_case 0.7.1", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "unicode-xid", ] @@ -2342,7 +2342,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2423,7 +2423,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2617,7 +2617,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2630,7 +2630,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -2651,7 +2651,7 @@ checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3085,7 +3085,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -3851,9 +3851,9 @@ dependencies = [ [[package]] name = "iddqd" -version = "0.3.14" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac5efd33e0c5eb0ac45cbd210541a214dac576896ca97ba08e16e3b1079cdd8" +checksum = "dda610d939ea51890ca6c827c8365acf0a44b4b53d2ed6f371e8e7e47bc75d25" dependencies = [ "allocator-api2", "equivalent", @@ -4739,7 +4739,7 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5122,7 +5122,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5306,7 +5306,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5581,7 +5581,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5655,7 +5655,7 @@ dependencies = [ "phf_shared 0.11.3", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5668,7 +5668,7 @@ dependencies = [ "phf_shared 0.13.1", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5712,7 +5712,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5919,7 +5919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -5984,7 +5984,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6048,7 +6048,7 @@ checksum = "4ee1c9ac207483d5e7db4940700de86a9aae46ef90c48b57f99fe7edb8345e49" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6071,7 +6071,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6549,7 +6549,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -6691,7 +6691,7 @@ dependencies = [ [[package]] name = "rpc-toolkit" version = "0.3.2" -source = "git+https://github.com/Start9Labs/rpc-toolkit.git?branch=master#eb64c1f422d21b4fbba87994d2aadd269e641c97" +source = "git+https://github.com/Start9Labs/rpc-toolkit.git?branch=master#2dd2832e043eb5380c91cf80f3e78a700d204be3" dependencies = [ "async-stream", "async-trait", @@ -7175,7 +7175,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -7232,7 +7232,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -7293,7 +7293,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -7711,7 +7711,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -7732,7 +7732,7 @@ dependencies = [ "sha2 0.10.9", "sqlx-core", "sqlx-postgres", - "syn 2.0.109", + "syn 2.0.110", "tokio", "url", ] @@ -7797,7 +7797,7 @@ dependencies = [ "quote", "regex-syntax 0.6.29", "strsim 0.11.1", - "syn 2.0.109", + "syn 2.0.110", "unicode-width 0.1.14", ] @@ -8098,7 +8098,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8141,9 +8141,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.109" +version = "2.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f17c7e013e88258aa9543dcbe81aca68a667a9ac37cd69c9fbc07858bfe0e2f" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" dependencies = [ "proc-macro2", "quote", @@ -8167,7 +8167,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8335,7 +8335,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8346,7 +8346,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -8471,7 +8471,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9795,7 +9795,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9886,7 +9886,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04659ddb06c87d233c566112c1c9c5b9e98256d9af50ec3bc9c8327f873a7568" dependencies = [ "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -9914,7 +9914,7 @@ checksum = "c88cc88fd23b5a04528f3a8436024f20010a16ec18eb23c164b1242f65860130" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "termcolor", ] @@ -9971,7 +9971,7 @@ checksum = "1ecb9ecf7799210407c14a8cfdfe0173365780968dc57973ed082211958e0b18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10199,7 +10199,7 @@ checksum = "d674d135b4a8c1d7e813e2f8d1c9a58308aee4a680323066025e53132218bd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10222,7 +10222,7 @@ checksum = "de41688745bbd6ed24e2f4923026911b523f0c057e10f86f44652a20e65555ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10349,7 +10349,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "wasm-bindgen-shared", ] @@ -10630,7 +10630,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -10641,7 +10641,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -11230,7 +11230,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -11277,7 +11277,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "zbus_names", "zvariant", "zvariant_utils", @@ -11312,7 +11312,7 @@ checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -11332,7 +11332,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "synstructure", ] @@ -11353,7 +11353,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -11387,7 +11387,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", ] [[package]] @@ -11441,7 +11441,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.109", + "syn 2.0.110", "zvariant_utils", ] @@ -11454,6 +11454,6 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.109", + "syn 2.0.110", "winnow", ] diff --git a/core/Cross.toml b/core/Cross.toml index 744c12471..1d03c8532 100644 --- a/core/Cross.toml +++ b/core/Cross.toml @@ -1,2 +1,5 @@ [build] pre-build = ["apt-get update && apt-get install -y rsync"] + +[build.env] +passthrough = ["RUST_BACKTRACE"] diff --git a/core/build-ts.sh b/core/build-ts.sh index e29a43a66..7ec588532 100755 --- a/core/build-ts.sh +++ b/core/build-ts.sh @@ -24,6 +24,9 @@ if [ "$ARCH" = "riscv64" ]; then fi cd .. + +rm -rf core/startos/bindings/ + FEATURES="$(echo $ENVIRONMENT | sed 's/-/,/g')" RUSTFLAGS="" if [[ "${ENVIRONMENT}" =~ (^|-)console($|-) ]]; then @@ -32,3 +35,15 @@ fi echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" cross test --manifest-path=./core/Cargo.toml $BUILD_FLAGS --no-default-features --features test,$FEATURES --locked 'export_bindings_' + +cd core/startos/bindings + +for folder in $(find . -type d); do + ( + cd $folder + find . -name '*.ts' -maxdepth 1 | sed 's/\.\/\([^.]*\)\.ts/export * from ".\/\1";/g' | grep -v '"./index"' | tee ./index.ts + find . -mindepth 1 -maxdepth 1 -type d | sed 's/\.\/\([^.]*\)/export * as \1 from ".\/\1";/g' | grep -v '"./index"' | tee -a ./index.ts + ) +done + +find . -name '*.ts' | xargs -P $(nproc) -I % npm --prefix ../../../sdk exec -- prettier --config ../../../sdk/base/package.json -w % diff --git a/core/models/src/id/service_interface.rs b/core/models/src/id/service_interface.rs index f398eef78..7a79680b0 100644 --- a/core/models/src/id/service_interface.rs +++ b/core/models/src/id/service_interface.rs @@ -8,7 +8,7 @@ use ts_rs::TS; use crate::{FromStrParser, Id}; #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, TS)] -#[ts(export, type = "string")] +#[ts(type = "string")] pub struct ServiceInterfaceId(Id); impl From for ServiceInterfaceId { fn from(id: Id) -> Self { diff --git a/core/startos/src/action.rs b/core/startos/src/action.rs index aac044bb9..81919aa60 100644 --- a/core/startos/src/action.rs +++ b/core/startos/src/action.rs @@ -4,7 +4,7 @@ use clap::{CommandFactory, FromArgMatches, Parser}; pub use models::ActionId; use models::{PackageId, ReplayId}; use qrcode::QrCode; -use rpc_toolkit::{Context, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use tracing::instrument; use ts_rs::TS; @@ -14,9 +14,22 @@ use crate::db::model::package::TaskSeverity; use crate::prelude::*; use crate::rpc_continuations::Guid; use crate::util::serde::{ - HandlerExtSerde, StdinDeserializable, WithIoFormat, display_serializable, + display_serializable, HandlerExtSerde, StdinDeserializable, WithIoFormat, }; +#[test] +fn export_bindings_action() { + use crate::db::model::package::{ActionMetadata, Task}; + + const OUT_DIR: &str = "./bindings/action"; + + ActionId::export_all_to(OUT_DIR).unwrap(); + ActionInput::export_all_to(OUT_DIR).unwrap(); + ActionResult::export_all_to(OUT_DIR).unwrap(); + ActionMetadata::export_all_to(OUT_DIR).unwrap(); + Task::export_all_to(OUT_DIR).unwrap(); +} + pub fn action_api() -> ParentHandler { ParentHandler::new() .subcommand( @@ -49,7 +62,6 @@ pub fn action_api() -> ParentHandler { } #[derive(Debug, Clone, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ActionInput { #[serde(default)] @@ -86,7 +98,6 @@ pub async fn get_action_input( #[derive(Debug, Serialize, Deserialize, TS)] #[serde(tag = "version")] -#[ts(export)] pub enum ActionResult { #[serde(rename = "0")] V0(ActionResultV0), diff --git a/core/startos/src/auth.rs b/core/startos/src/auth.rs index ad05b3d37..8572ce589 100644 --- a/core/startos/src/auth.rs +++ b/core/startos/src/auth.rs @@ -70,7 +70,6 @@ pub async fn write_shadow(password: &str) -> Result<(), Error> { #[derive(Clone, Serialize, Deserialize, TS)] #[serde(untagged)] -#[ts(export)] pub enum PasswordType { EncryptedWire(EncryptedWire), String(String), @@ -208,7 +207,6 @@ pub fn check_password(hash: &str, password: &str) -> Result<(), Error> { #[derive(Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct LoginParams { password: String, #[ts(skip)] @@ -286,7 +284,6 @@ pub async fn logout( #[derive(Debug, Clone, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct Session { #[ts(type = "string")] pub logged_in: DateTime, @@ -297,7 +294,6 @@ pub struct Session { #[derive(Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SessionList { #[ts(type = "string | null")] current: Option, diff --git a/core/startos/src/context/setup.rs b/core/startos/src/context/setup.rs index a00b092ed..d9cbc6846 100644 --- a/core/startos/src/context/setup.rs +++ b/core/startos/src/context/setup.rs @@ -40,7 +40,6 @@ lazy_static::lazy_static! { #[derive(Debug, Clone, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetupResult { pub tor_addresses: Vec, #[ts(type = "string")] diff --git a/core/startos/src/db/mod.rs b/core/startos/src/db/mod.rs index 1c78d30fb..67fcb3ac5 100644 --- a/core/startos/src/db/mod.rs +++ b/core/startos/src/db/mod.rs @@ -62,7 +62,7 @@ pub fn db() -> ParentHandler { "dump", from_fn_async(dump) .custom_ts( - DumpParams::inline(), + DumpParams::inline_flattened(), format!("{{ id: number; value: unknown }}"), ) .no_cli(), diff --git a/core/startos/src/db/model/package.rs b/core/startos/src/db/model/package.rs index 2a2abe2b6..c71ebd06f 100644 --- a/core/startos/src/db/model/package.rs +++ b/core/startos/src/db/model/package.rs @@ -20,7 +20,6 @@ use crate::status::MainStatus; use crate::util::serde::{Pem, is_partial_of}; #[derive(Debug, Default, Deserialize, Serialize, TS)] -#[ts(export)] pub struct AllPackageData(pub BTreeMap); impl Map for AllPackageData { type Key = PackageId; @@ -43,7 +42,6 @@ pub enum ManifestPreference { #[serde(rename_all = "camelCase")] #[serde(tag = "state")] #[model = "Model"] -#[ts(export)] pub enum PackageState { Installing(InstallingState), Restoring(InstallingState), @@ -277,7 +275,6 @@ impl Model { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct InstallingState { pub installing_info: InstallingInfo, } @@ -285,7 +282,6 @@ pub struct InstallingState { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct UpdatingState { pub manifest: Manifest, pub s9pk: PathBuf, @@ -295,7 +291,6 @@ pub struct UpdatingState { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct InstalledState { pub manifest: Manifest, } @@ -303,13 +298,11 @@ pub struct InstalledState { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct InstallingInfo { pub new_manifest: Manifest, pub progress: FullProgress, } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "kebab-case")] pub enum AllowedStatuses { OnlyRunning, @@ -344,7 +337,6 @@ pub struct ActionMetadata { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "kebab-case")] #[serde(rename_all_fields = "camelCase")] pub enum ActionVisibility { @@ -361,7 +353,6 @@ impl Default for ActionVisibility { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct PackageDataEntry { pub state_info: PackageState, pub s9pk: PathBuf, @@ -388,7 +379,6 @@ impl AsRef for PackageDataEntry { } #[derive(Debug, Clone, Default, Deserialize, Serialize, TS)] -#[ts(export)] pub struct CurrentDependencies(pub BTreeMap); impl CurrentDependencies { pub fn map( @@ -440,7 +430,6 @@ pub enum CurrentDependencyKind { #[derive(Clone, Debug, Deserialize, Serialize, TS, HasModel)] #[serde(rename_all = "camelCase")] -#[ts(export)] #[model = "Model"] pub struct TaskEntry { pub task: Task, @@ -449,7 +438,6 @@ pub struct TaskEntry { #[derive(Clone, Debug, Deserialize, Serialize, TS, HasModel)] #[serde(rename_all = "camelCase")] -#[ts(export)] #[model = "Model"] pub struct Task { pub package_id: PackageId, @@ -466,7 +454,6 @@ pub struct Task { #[derive(Clone, Debug, Deserialize, Serialize, TS, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "kebab-case")] -#[ts(export)] pub enum TaskSeverity { Optional, Important, @@ -480,7 +467,6 @@ impl Default for TaskSeverity { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct TaskTrigger { #[serde(default)] pub once: bool, @@ -489,7 +475,6 @@ pub struct TaskTrigger { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "kebab-case")] -#[ts(export)] pub enum TaskCondition { InputNotMatches, } diff --git a/core/startos/src/db/model/public.rs b/core/startos/src/db/model/public.rs index f16125ae9..e92b1f59a 100644 --- a/core/startos/src/db/model/public.rs +++ b/core/startos/src/db/model/public.rs @@ -16,12 +16,12 @@ use serde::{Deserialize, Serialize}; use ts_rs::TS; use crate::account::AccountInfo; -use crate::db::DbAccessByKey; -use crate::db::model::Database; use crate::db::model::package::AllPackageData; +use crate::db::model::Database; +use crate::db::DbAccessByKey; use crate::net::acme::AcmeProvider; -use crate::net::host::Host; use crate::net::host::binding::{AddSslOptions, BindInfo, BindOptions, NetInfo}; +use crate::net::host::Host; use crate::net::utils::ipv6_is_local; use crate::net::vhost::AlpnInfo; use crate::prelude::*; @@ -33,10 +33,14 @@ use crate::util::serde::MaybeUtf8String; use crate::version::{Current, VersionT}; use crate::{ARCH, PLATFORM}; +#[test] +fn export_bindings_database() { + Public::export_all_to("./bindings/database/startos").unwrap(); +} + #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct Public { pub server_info: ServerInfo, pub package_data: AllPackageData, @@ -152,7 +156,6 @@ fn get_platform() -> InternedString { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct ServerInfo { #[serde(default = "get_arch")] #[ts(type = "string")] @@ -194,7 +197,6 @@ pub struct ServerInfo { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct NetworkInfo { pub wifi: WifiInfo, pub host: Host, @@ -210,7 +212,6 @@ pub struct NetworkInfo { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct DnsSettings { #[ts(type = "string[]")] pub dhcp_servers: VecDeque, @@ -221,7 +222,6 @@ pub struct DnsSettings { #[derive(Clone, Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct NetworkInterfaceInfo { pub name: Option, pub public: Option, @@ -269,7 +269,6 @@ impl NetworkInterfaceInfo { } #[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize, TS, HasModel)] -#[ts(export)] #[serde(rename_all = "camelCase")] #[model = "Model"] pub struct IpInfo { @@ -289,7 +288,6 @@ pub struct IpInfo { } #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "kebab-case")] pub enum NetworkInterfaceType { Ethernet, @@ -302,7 +300,6 @@ pub enum NetworkInterfaceType { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct AcmeSettings { pub contact: Vec, } @@ -323,14 +320,12 @@ impl DbAccessByKey for Database { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct DomainSettings { pub gateway: GatewayId, } #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[model = "Model"] -#[ts(export)] pub struct BackupProgress { pub complete: bool, } @@ -338,7 +333,6 @@ pub struct BackupProgress { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct ServerStatus { pub backup_progress: Option>, pub updated: bool, @@ -352,7 +346,6 @@ pub struct ServerStatus { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct WifiInfo { pub enabled: bool, pub interface: Option, @@ -364,7 +357,6 @@ pub struct WifiInfo { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct ServerSpecs { pub cpu: String, pub disk: String, diff --git a/core/startos/src/dependencies.rs b/core/startos/src/dependencies.rs index 375b6c67d..87659fa31 100644 --- a/core/startos/src/dependencies.rs +++ b/core/startos/src/dependencies.rs @@ -6,13 +6,23 @@ use models::PackageId; use serde::{Deserialize, Serialize}; use ts_rs::TS; -use crate::Error; use crate::prelude::*; use crate::util::PathOrUrl; +use crate::Error; + +#[test] +fn export_bindings_dependencies() { + use crate::service::effects::dependency::{CheckDependenciesResult, DependencyRequirement}; + + const OUT_DIR: &str = "./bindings/dependencies"; + + PackageId::export_all_to(OUT_DIR).unwrap(); + DependencyRequirement::export_all_to(OUT_DIR).unwrap(); + CheckDependenciesResult::export_all_to(OUT_DIR).unwrap(); +} #[derive(Clone, Debug, Default, Deserialize, Serialize, HasModel, TS)] #[model = "Model"] -#[ts(export)] pub struct Dependencies(pub BTreeMap); impl Map for Dependencies { type Key = PackageId; @@ -37,7 +47,7 @@ pub struct DepInfo { impl TS for DepInfo { type WithoutGenerics = Self; fn decl() -> String { - format!("type {} = {}", Self::name(), Self::inline()) + format!("type {} = {}", Self::name(), Self::inline_flattened()) } fn decl_concrete() -> String { Self::decl() @@ -64,7 +74,6 @@ impl TS for DepInfo { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum MetadataSrc { Metadata(Metadata), S9pk(Option), // backwards compatibility @@ -72,7 +81,6 @@ pub enum MetadataSrc { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct Metadata { pub title: InternedString, pub icon: PathOrUrl, diff --git a/core/startos/src/diagnostic.rs b/core/startos/src/diagnostic.rs index 5071043e7..5a75b6861 100644 --- a/core/startos/src/diagnostic.rs +++ b/core/startos/src/diagnostic.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use rpc_toolkit::yajrc::RpcError; use rpc_toolkit::{ - CallRemoteHandler, Context, Empty, HandlerExt, ParentHandler, from_fn, from_fn_async, + from_fn, from_fn_async, CallRemoteHandler, Context, Empty, HandlerExt, ParentHandler, }; use crate::context::{CliContext, DiagnosticContext, RpcContext}; @@ -17,6 +17,7 @@ pub fn diagnostic() -> ParentHandler { .subcommand( "error", from_fn(error) + .unknown_ts() // TODO: TS .with_about("Display diagnostic error") .with_call_remote::(), ) diff --git a/core/startos/src/disk/mount/filesystem/bind.rs b/core/startos/src/disk/mount/filesystem/bind.rs index f005e47cf..50b1453d4 100644 --- a/core/startos/src/disk/mount/filesystem/bind.rs +++ b/core/startos/src/disk/mount/filesystem/bind.rs @@ -12,7 +12,6 @@ use crate::prelude::*; use crate::util::io::create_file; #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "kebab-case")] pub enum FileType { File, diff --git a/core/startos/src/init.rs b/core/startos/src/init.rs index 5736c3b17..c35bb10b6 100644 --- a/core/startos/src/init.rs +++ b/core/startos/src/init.rs @@ -8,7 +8,7 @@ use const_format::formatcp; use futures::{StreamExt, TryStreamExt}; use itertools::Itertools; use models::ResultExt; -use rpc_toolkit::{Context, Empty, HandlerArgs, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, Empty, HandlerArgs, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use tokio::process::Command; use tracing::instrument; @@ -17,8 +17,8 @@ use ts_rs::TS; use crate::account::AccountInfo; use crate::context::config::ServerConfig; use crate::context::{CliContext, InitContext, RpcContext}; -use crate::db::model::Database; use crate::db::model::public::ServerStatus; +use crate::db::model::Database; use crate::developer::OS_DEVELOPER_KEY_PATH; use crate::hostname::Hostname; use crate::middleware::auth::AuthContext; @@ -35,10 +35,10 @@ use crate::rpc_continuations::{Guid, RpcContinuation}; use crate::s9pk::v2::pack::{CONTAINER_DATADIR, CONTAINER_TOOL}; use crate::ssh::SSH_DIR; use crate::system::{get_mem_info, sync_kiosk}; -use crate::util::io::{IOHook, open_file}; +use crate::util::io::{open_file, IOHook}; use crate::util::lshw::lshw; use crate::util::net::WebSocketExt; -use crate::util::{Invoke, cpupower}; +use crate::util::{cpupower, Invoke}; use crate::{Error, MAIN_DATA, PACKAGE_DATA}; pub const SYSTEM_REBUILD_PATH: &str = "/media/startos/config/system-rebuild"; @@ -450,7 +450,6 @@ pub fn init_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct InitProgressRes { pub progress: FullProgress, pub guid: Guid, diff --git a/core/startos/src/install/mod.rs b/core/startos/src/install/mod.rs index 5a13204f5..a0baa0b9f 100644 --- a/core/startos/src/install/mod.rs +++ b/core/startos/src/install/mod.rs @@ -112,7 +112,6 @@ impl std::fmt::Display for MinMax { #[derive(Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct InstallParams { #[ts(type = "string")] registry: Url, @@ -354,7 +353,6 @@ impl FromArgMatches for CliInstallParams { } #[derive(Deserialize, Serialize, Parser, TS)] -#[ts(export)] pub struct InstalledVersionParams { id: PackageId, } diff --git a/core/startos/src/lib.rs b/core/startos/src/lib.rs index ec7fb46f0..33f8a6e34 100644 --- a/core/startos/src/lib.rs +++ b/core/startos/src/lib.rs @@ -79,8 +79,8 @@ pub use error::{Error, ErrorKind, ResultExt}; use imbl_value::Value; use rpc_toolkit::yajrc::RpcError; use rpc_toolkit::{ - CallRemoteHandler, Context, Empty, HandlerExt, ParentHandler, from_fn, from_fn_async, - from_fn_async_local, from_fn_blocking, + from_fn, from_fn_async, from_fn_async_local, from_fn_blocking, CallRemoteHandler, Context, + Empty, HandlerExt, ParentHandler, }; use serde::{Deserialize, Serialize}; use ts_rs::TS; @@ -90,12 +90,11 @@ use crate::disk::fsck::RequiresReboot; use crate::registry::context::{RegistryContext, RegistryUrlParams}; use crate::system::kiosk; use crate::tunnel::context::TunnelUrlParams; -use crate::util::serde::{HandlerExtSerde, WithIoFormat, display_serializable}; +use crate::util::serde::{display_serializable, HandlerExtSerde, WithIoFormat}; #[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] #[command(rename_all = "kebab-case")] -#[ts(export)] pub struct EchoParams { message: String, } @@ -106,7 +105,6 @@ pub fn echo(_: C, EchoParams { message }: EchoParams) -> Result().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); + std::fs::write( + "./bindings/init-api.ts", + format!( + "export type InitApi = {}", + main_api::().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); + std::fs::write( + "./bindings/diagnostic-api.ts", + format!( + "export type DiagnosticApi = {}", + main_api::().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); + std::fs::write( + "./bindings/setup-api.ts", + format!( + "export type SetupApi = {}", + main_api::().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); + std::fs::write( + "./bindings/os-install-api.ts", + format!( + "export type OsInstallApi = {}", + main_api::().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); +} + pub fn main_api() -> ParentHandler { let mut api = ParentHandler::new() .subcommand( diff --git a/core/startos/src/logs.rs b/core/startos/src/logs.rs index 73a3e2936..298bf421f 100644 --- a/core/startos/src/logs.rs +++ b/core/startos/src/logs.rs @@ -15,7 +15,8 @@ use itertools::Itertools; use models::{FromStrParser, PackageId}; use rpc_toolkit::yajrc::RpcError; use rpc_toolkit::{ - CallRemote, Context, Empty, HandlerArgs, HandlerExt, HandlerFor, ParentHandler, from_fn_async, + from_fn_async, CallRemote, Context, Empty, HandlerArgs, HandlerExt, HandlerFor, LeafHandler, + ParentHandler, UnknownTS, }; use serde::de::{self, DeserializeOwned}; use serde::{Deserialize, Serialize}; @@ -31,9 +32,9 @@ use crate::error::ResultExt; use crate::lxc::ContainerId; use crate::prelude::*; use crate::rpc_continuations::{Guid, RpcContinuation, RpcContinuations}; -use crate::util::Invoke; use crate::util::net::WebSocketExt; use crate::util::serde::Reversible; +use crate::util::Invoke; #[pin_project::pin_project] pub struct LogStream { @@ -322,10 +323,10 @@ impl From for String { } } -#[derive(Deserialize, Serialize, Parser, TS)] +#[derive(Deserialize, Serialize, Parser)] #[serde(rename_all = "camelCase")] #[command(rename_all = "kebab-case")] -pub struct LogsParams { +pub struct LogsParams { #[command(flatten)] #[serde(flatten)] extra: Extra, @@ -340,6 +341,11 @@ pub struct LogsParams { #[serde(default)] before: bool, } +impl LogsParams { + pub fn inline_ty() -> String { + format!("{} & {{ limit: number | null; cursor: string | null; boot: string | number | null; before: boolean }}", Extra::inline_flattened()) + } +} #[derive(Deserialize, Serialize, Parser)] #[serde(rename_all = "camelCase")] @@ -359,15 +365,27 @@ pub fn logs< Extra: FromArgMatches + Serialize + DeserializeOwned + Args + TS + Send + Sync + 'static, >( source: impl for<'a> LogSourceFn<'a, C, Extra>, -) -> ParentHandler> { +) -> UnknownTS>> { ParentHandler::new() - .root_handler(logs_nofollow::(source.clone()).no_cli()) + .root_handler( + logs_nofollow::(source.clone()) + .no_cli() + .custom_ts( + LogsParams::::inline_ty(), + LogResponse::inline_flattened(), + ), + ) .subcommand( "follow", logs_follow::(source) .with_inherited(|params, _| params) - .no_cli(), + .no_cli() + .custom_ts( + LogsParams::::inline_ty(), + LogFollowResponse::inline_flattened(), + ), ) + .unknown_ts() } pub async fn cli_logs( @@ -433,7 +451,13 @@ where fn logs_nofollow( f: impl for<'a> LogSourceFn<'a, C, Extra>, -) -> impl HandlerFor, InheritedParams = Empty, Ok = LogResponse, Err = Error> +) -> impl HandlerFor< + C, + Params = LogsParams, + InheritedParams = Empty, + Ok = LogResponse, + Err = Error, +> + LeafHandler where C: Context, Extra: FromArgMatches + Args + TS + Send + Sync + 'static, @@ -477,7 +501,7 @@ fn logs_follow< InheritedParams = LogsParams, Ok = LogFollowResponse, Err = Error, -> { +> + LeafHandler { from_fn_async( move |HandlerArgs { context, @@ -519,7 +543,7 @@ async fn get_package_id( Ok(LogSource::Container(container_id)) } -pub fn package_logs() -> ParentHandler> { +pub fn package_logs() -> UnknownTS>> { logs::(get_package_id) } diff --git a/core/startos/src/net/host/binding.rs b/core/startos/src/net/host/binding.rs index 59939b689..bab3469c7 100644 --- a/core/startos/src/net/host/binding.rs +++ b/core/startos/src/net/host/binding.rs @@ -19,7 +19,6 @@ use crate::prelude::*; use crate::util::serde::{HandlerExtSerde, display_serializable}; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct BindId { pub id: HostId, @@ -46,7 +45,6 @@ impl FromStr for BindId { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct BindInfo { pub enabled: bool, pub options: BindOptions, @@ -55,7 +53,6 @@ pub struct BindInfo { #[derive(Clone, Debug, Deserialize, Serialize, TS, PartialEq, Eq, PartialOrd, Ord)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct NetInfo { #[ts(as = "BTreeSet::")] #[serde(default)] @@ -145,7 +142,6 @@ impl InterfaceFilter for NetInfo { } #[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct Security { pub ssl: bool, @@ -153,7 +149,6 @@ pub struct Security { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct BindOptions { pub preferred_external_port: u16, pub add_ssl: Option, @@ -162,7 +157,6 @@ pub struct BindOptions { #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AddSslOptions { pub preferred_external_port: u16, // #[serde(default)] @@ -234,7 +228,6 @@ pub async fn list_bindings( #[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct BindingGatewaySetEnabledParams { internal_port: u16, gateway: GatewayId, diff --git a/core/startos/src/net/host/mod.rs b/core/startos/src/net/host/mod.rs index d2c21d0bd..44d845b7d 100644 --- a/core/startos/src/net/host/mod.rs +++ b/core/startos/src/net/host/mod.rs @@ -25,7 +25,6 @@ pub mod binding; #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct Host { pub bindings: BTreeMap, #[ts(type = "string[]")] @@ -74,7 +73,6 @@ impl Host { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[model = "Model"] -#[ts(export)] pub struct Hosts(pub BTreeMap); impl Map for Hosts { diff --git a/core/startos/src/net/service_interface.rs b/core/startos/src/net/service_interface.rs index 0d1a193ad..e6e626200 100644 --- a/core/startos/src/net/service_interface.rs +++ b/core/startos/src/net/service_interface.rs @@ -6,7 +6,6 @@ use serde::{Deserialize, Serialize}; use ts_rs::TS; #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] #[serde(rename_all_fields = "camelCase")] #[serde(tag = "kind")] @@ -30,7 +29,6 @@ impl HostnameInfo { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct GatewayInfo { pub id: GatewayId, @@ -39,7 +37,6 @@ pub struct GatewayInfo { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct OnionHostname { #[ts(type = "string")] @@ -54,7 +51,6 @@ impl OnionHostname { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] #[serde(rename_all_fields = "camelCase")] #[serde(tag = "kind")] @@ -96,7 +92,6 @@ impl IpHostname { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ServiceInterface { pub id: ServiceInterfaceId, @@ -109,7 +104,6 @@ pub struct ServiceInterface { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub enum ServiceInterfaceType { Ui, @@ -118,7 +112,6 @@ pub enum ServiceInterfaceType { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct AddressInfo { pub username: Option, diff --git a/core/startos/src/net/tor/ctor.rs b/core/startos/src/net/tor/ctor.rs index 6456f8422..51c14502a 100644 --- a/core/startos/src/net/tor/ctor.rs +++ b/core/startos/src/net/tor/ctor.rs @@ -15,7 +15,7 @@ use imbl::OrdMap; use imbl_value::InternedString; use lazy_static::lazy_static; use regex::Regex; -use rpc_toolkit::{Context, Empty, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, Empty, HandlerExt, ParentHandler, UnknownTS}; use serde::{Deserialize, Serialize}; use tokio::net::TcpStream; use tokio::process::Command; @@ -27,16 +27,16 @@ use tracing::instrument; use ts_rs::TS; use crate::context::{CliContext, RpcContext}; -use crate::logs::{LogSource, LogsParams, journalctl}; +use crate::logs::{journalctl, LogSource, LogsParams}; use crate::prelude::*; -use crate::util::Invoke; use crate::util::collections::ordmap_retain; -use crate::util::io::{ReadWriter, write_file_atomic}; +use crate::util::io::{write_file_atomic, ReadWriter}; use crate::util::serde::{ - BASE64, Base64, HandlerExtSerde, WithIoFormat, deserialize_from_str, display_serializable, - serialize_display, + deserialize_from_str, display_serializable, serialize_display, Base64, HandlerExtSerde, + WithIoFormat, BASE64, }; use crate::util::sync::Watch; +use crate::util::Invoke; pub const SYSTEMD_UNIT: &str = "tor@default"; const STARTING_HEALTH_TIMEOUT: u64 = 120; // 2min @@ -388,7 +388,7 @@ pub async fn list_services(ctx: RpcContext, _: Empty) -> Result ParentHandler { +pub fn logs() -> UnknownTS> { crate::logs::logs::(|_: &RpcContext, _| async { Ok(LogSource::Unit(SYSTEMD_UNIT)) }) diff --git a/core/startos/src/net/tunnel.rs b/core/startos/src/net/tunnel.rs index b4b89783d..0b61e381a 100644 --- a/core/startos/src/net/tunnel.rs +++ b/core/startos/src/net/tunnel.rs @@ -32,7 +32,6 @@ pub fn tunnel_api() -> ParentHandler { } #[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)] -#[ts(export)] pub struct AddTunnelParams { name: InternedString, config: String, @@ -104,7 +103,6 @@ pub async fn add_tunnel( } #[derive(Debug, Clone, Deserialize, Serialize, Parser, TS)] -#[ts(export)] pub struct RemoveTunnelParams { id: GatewayId, } diff --git a/core/startos/src/net/vhost.rs b/core/startos/src/net/vhost.rs index 58308296b..7b77fb0e7 100644 --- a/core/startos/src/net/vhost.rs +++ b/core/startos/src/net/vhost.rs @@ -351,7 +351,6 @@ where #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum AlpnInfo { Reflect, Specified(Vec), diff --git a/core/startos/src/progress.rs b/core/startos/src/progress.rs index d570e8a90..c423319ad 100644 --- a/core/startos/src/progress.rs +++ b/core/startos/src/progress.rs @@ -196,7 +196,6 @@ impl std::ops::AddAssign for Progress { } #[derive(Debug, Clone, Deserialize, Serialize, TS)] -#[ts(export)] pub struct NamedProgress { #[ts(type = "string")] pub name: InternedString, @@ -204,7 +203,6 @@ pub struct NamedProgress { } #[derive(Debug, Clone, Deserialize, Serialize, TS)] -#[ts(export)] pub struct FullProgress { pub overall: Progress, pub phases: Vec, diff --git a/core/startos/src/registry/admin.rs b/core/startos/src/registry/admin.rs index 38a141e09..3b0e5838c 100644 --- a/core/startos/src/registry/admin.rs +++ b/core/startos/src/registry/admin.rs @@ -173,7 +173,6 @@ pub async fn add_signer(ctx: RegistryContext, signer: SignerInfo) -> Result { #[ts(type = "string")] pub published_at: DateTime, diff --git a/core/startos/src/registry/db.rs b/core/startos/src/registry/db.rs index 316adfaef..0c51edb15 100644 --- a/core/startos/src/registry/db.rs +++ b/core/startos/src/registry/db.rs @@ -31,7 +31,7 @@ pub fn db_api() -> ParentHandler { .with_metadata("admin", Value::Bool(true)) .no_cli() .custom_ts( - DumpParams::inline(), + DumpParams::inline_flattened(), format!("{{ id: number; value: unknown }}"), ), ) diff --git a/core/startos/src/registry/info.rs b/core/startos/src/registry/info.rs index 2793180a1..97bd3fad0 100644 --- a/core/startos/src/registry/info.rs +++ b/core/startos/src/registry/info.rs @@ -47,7 +47,6 @@ pub fn info_api() -> ParentHandler> { #[derive(Debug, Default, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RegistryInfo { pub name: Option, pub icon: Option>, @@ -66,7 +65,6 @@ pub async fn get_info(ctx: RegistryContext) -> Result { #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetNameParams { pub name: String, } @@ -83,7 +81,6 @@ pub async fn set_name( #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetIconParams { pub icon: DataUrl<'static>, } @@ -101,7 +98,6 @@ pub async fn set_icon( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct CliSetIconParams { pub icon: PathBuf, } diff --git a/core/startos/src/registry/mod.rs b/core/startos/src/registry/mod.rs index 4bae32d14..dcd9354ca 100644 --- a/core/startos/src/registry/mod.rs +++ b/core/startos/src/registry/mod.rs @@ -42,7 +42,6 @@ impl RegistryDatabase {} #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct FullIndex { pub name: Option, pub icon: Option>, diff --git a/core/startos/src/registry/os/asset/add.rs b/core/startos/src/registry/os/asset/add.rs index 915fb882f..f8581259d 100644 --- a/core/startos/src/registry/os/asset/add.rs +++ b/core/startos/src/registry/os/asset/add.rs @@ -75,7 +75,6 @@ pub fn remove_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AddAssetParams { #[ts(type = "string")] pub version: Version, @@ -283,7 +282,6 @@ pub async fn cli_add_asset( #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RemoveAssetParams { #[ts(type = "string")] pub version: Version, diff --git a/core/startos/src/registry/os/asset/get.rs b/core/startos/src/registry/os/asset/get.rs index dfa656511..7f30bbda9 100644 --- a/core/startos/src/registry/os/asset/get.rs +++ b/core/startos/src/registry/os/asset/get.rs @@ -53,7 +53,6 @@ pub fn get_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetOsAssetParams { #[ts(type = "string")] pub version: Version, diff --git a/core/startos/src/registry/os/asset/sign.rs b/core/startos/src/registry/os/asset/sign.rs index 68c0f571c..bc8ea6214 100644 --- a/core/startos/src/registry/os/asset/sign.rs +++ b/core/startos/src/registry/os/asset/sign.rs @@ -49,7 +49,6 @@ pub fn sign_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SignAssetParams { #[ts(type = "string")] version: Version, diff --git a/core/startos/src/registry/os/index.rs b/core/startos/src/registry/os/index.rs index 9d02bcad8..aa70135ae 100644 --- a/core/startos/src/registry/os/index.rs +++ b/core/startos/src/registry/os/index.rs @@ -14,7 +14,6 @@ use crate::sign::commitment::blake3::Blake3Commitment; #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct OsIndex { pub versions: OsVersionInfoMap, } @@ -37,7 +36,6 @@ impl Map for OsVersionInfoMap { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct OsVersionInfo { pub headline: String, pub release_notes: String, diff --git a/core/startos/src/registry/os/version/mod.rs b/core/startos/src/registry/os/version/mod.rs index 99a552af5..f7e4a46db 100644 --- a/core/startos/src/registry/os/version/mod.rs +++ b/core/startos/src/registry/os/version/mod.rs @@ -47,8 +47,8 @@ pub fn version_api() -> ParentHandler { from_fn_async(get_version) .with_metadata("get_device_info", Value::Bool(true)) .custom_ts( - GetOsVersionParams::inline(), - BTreeMap::::inline(), + GetOsVersionParams::inline_flattened(), + BTreeMap::::inline_flattened(), ) .with_display_serializable() .with_custom_display_fn(|handle, result| { @@ -62,7 +62,6 @@ pub fn version_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AddVersionParams { #[ts(type = "string")] pub version: Version, @@ -110,7 +109,6 @@ pub async fn add_version( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RemoveVersionParams { #[ts(type = "string")] pub version: Version, @@ -135,7 +133,6 @@ pub async fn remove_version( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetOsVersionParams { #[ts(type = "string | null")] #[arg(long = "src")] diff --git a/core/startos/src/registry/os/version/signer.rs b/core/startos/src/registry/os/version/signer.rs index eab8215a3..537ae5ba1 100644 --- a/core/startos/src/registry/os/version/signer.rs +++ b/core/startos/src/registry/os/version/signer.rs @@ -45,7 +45,6 @@ pub fn signer_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct VersionSignerParams { #[ts(type = "string")] pub version: Version, @@ -108,7 +107,6 @@ pub async fn remove_version_signer( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct ListVersionSignersParams { #[ts(type = "string")] pub version: Version, diff --git a/core/startos/src/registry/package/add.rs b/core/startos/src/registry/package/add.rs index baf1703cc..ae5ed8426 100644 --- a/core/startos/src/registry/package/add.rs +++ b/core/startos/src/registry/package/add.rs @@ -26,7 +26,6 @@ use crate::util::io::TrackingIO; #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AddPackageParams { #[ts(type = "string")] pub url: Url, @@ -163,7 +162,6 @@ pub async fn cli_add_package( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RemovePackageParams { pub id: PackageId, pub version: VersionString, diff --git a/core/startos/src/registry/package/category.rs b/core/startos/src/registry/package/category.rs index 92e7d0df7..7f2a0d939 100644 --- a/core/startos/src/registry/package/category.rs +++ b/core/startos/src/registry/package/category.rs @@ -61,7 +61,6 @@ pub fn category_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AddCategoryParams { #[ts(type = "string")] pub id: InternedString, @@ -87,7 +86,6 @@ pub async fn add_category( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RemoveCategoryParams { #[ts(type = "string")] pub id: InternedString, @@ -112,7 +110,6 @@ pub async fn remove_category( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AddPackageToCategoryParams { #[ts(type = "string")] pub id: InternedString, @@ -141,7 +138,6 @@ pub async fn add_package( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RemovePackageFromCategoryParams { #[ts(type = "string")] pub id: InternedString, diff --git a/core/startos/src/registry/package/get.rs b/core/startos/src/registry/package/get.rs index 8f61e51ef..86a268bdf 100644 --- a/core/startos/src/registry/package/get.rs +++ b/core/startos/src/registry/package/get.rs @@ -19,7 +19,6 @@ use crate::util::serde::{WithIoFormat, display_serializable}; Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize, TS, ValueEnum, )] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum PackageDetailLevel { None, Short, @@ -33,7 +32,6 @@ impl Default for PackageDetailLevel { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct PackageInfoShort { pub release_notes: String, } @@ -41,7 +39,6 @@ pub struct PackageInfoShort { #[derive(Debug, Deserialize, Serialize, TS, Parser)] #[serde(rename_all = "camelCase")] #[command(rename_all = "kebab-case")] -#[ts(export)] pub struct GetPackageParams { pub id: Option, #[ts(type = "string | null")] @@ -60,7 +57,6 @@ pub struct GetPackageParams { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetPackageResponse { #[ts(type = "string[]")] pub categories: BTreeSet, @@ -103,7 +99,6 @@ impl GetPackageResponse { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetPackageResponseFull { #[ts(type = "string[]")] pub categories: BTreeSet, diff --git a/core/startos/src/registry/package/index.rs b/core/startos/src/registry/package/index.rs index 22357d8ef..86a681ee8 100644 --- a/core/startos/src/registry/package/index.rs +++ b/core/startos/src/registry/package/index.rs @@ -23,7 +23,6 @@ use crate::sign::{AnySignature, AnyVerifyingKey}; #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct PackageIndex { pub categories: BTreeMap, pub packages: BTreeMap, @@ -32,7 +31,6 @@ pub struct PackageIndex { #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct PackageInfo { pub authorized: BTreeSet, pub versions: BTreeMap, @@ -43,7 +41,6 @@ pub struct PackageInfo { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct Category { pub name: String, } @@ -51,7 +48,6 @@ pub struct Category { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct DependencyMetadata { #[ts(type = "string | null")] pub title: Option, @@ -63,7 +59,6 @@ pub struct DependencyMetadata { #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct PackageVersionInfo { #[ts(type = "string")] pub title: InternedString, diff --git a/core/startos/src/registry/package/signer.rs b/core/startos/src/registry/package/signer.rs index 09ed2f1c2..f366e3e20 100644 --- a/core/startos/src/registry/package/signer.rs +++ b/core/startos/src/registry/package/signer.rs @@ -45,7 +45,6 @@ pub fn signer_api() -> ParentHandler { #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct PackageSignerParams { pub id: PackageId, pub signer: Guid, @@ -107,7 +106,6 @@ pub async fn remove_package_signer( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[command(rename_all = "kebab-case")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct ListPackageSignersParams { pub id: PackageId, } diff --git a/core/startos/src/registry/signer.rs b/core/startos/src/registry/signer.rs index f38ff81a8..a01825aff 100644 --- a/core/startos/src/registry/signer.rs +++ b/core/startos/src/registry/signer.rs @@ -15,7 +15,6 @@ use crate::sign::{AnySignature, AnyVerifyingKey, SignatureScheme}; #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct SignerInfo { pub name: String, pub contact: Vec, @@ -24,7 +23,6 @@ pub struct SignerInfo { #[derive(Clone, Debug, Deserialize, Serialize, TS, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -#[ts(export)] // TODO: better types pub enum ContactInfo { Email(String), @@ -61,7 +59,6 @@ impl ValueParserFactory for ContactInfo { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum AcceptSigners { #[serde(skip)] Accepted, diff --git a/core/startos/src/s9pk/v2/manifest.rs b/core/startos/src/s9pk/v2/manifest.rs index 6dd3adf03..3bcf8514e 100644 --- a/core/startos/src/s9pk/v2/manifest.rs +++ b/core/startos/src/s9pk/v2/manifest.rs @@ -5,7 +5,7 @@ use color_eyre::eyre::eyre; use exver::{Version, VersionRange}; use imbl_value::InternedString; pub use models::PackageId; -use models::{ImageId, VolumeId, mime}; +use models::{mime, ImageId, VolumeId}; use serde::{Deserialize, Serialize}; use ts_rs::TS; use url::Url; @@ -16,10 +16,15 @@ use crate::s9pk::git_hash::GitHash; use crate::s9pk::merkle_archive::directory_contents::DirectoryContents; use crate::s9pk::merkle_archive::expected::{Expected, Filter}; use crate::s9pk::v2::pack::ImageConfig; -use crate::util::VersionString; use crate::util::serde::Regex; +use crate::util::VersionString; use crate::version::{Current, VersionT}; +#[test] +fn export_bindings_manifest() { + Manifest::export_all_to("./bindings/manifest").unwrap(); +} + fn current_version() -> Version { Current::default().semver() } @@ -27,7 +32,6 @@ fn current_version() -> Version { #[derive(Clone, Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct Manifest { pub id: PackageId, #[ts(type = "string")] @@ -167,7 +171,6 @@ impl Manifest { #[derive(Clone, Debug, Default, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct HardwareRequirements { #[serde(default)] pub device: Vec, @@ -179,7 +182,6 @@ pub struct HardwareRequirements { #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct DeviceFilter { #[ts(type = "\"processor\" | \"display\"")] pub class: InternedString, @@ -189,7 +191,6 @@ pub struct DeviceFilter { } #[derive(Clone, Debug, Deserialize, Serialize, TS)] -#[ts(export)] pub struct Description { pub short: String, pub long: String, @@ -214,7 +215,6 @@ impl Description { #[derive(Clone, Debug, Default, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct Alerts { pub install: Option, pub uninstall: Option, diff --git a/core/startos/src/s9pk/v2/pack.rs b/core/startos/src/s9pk/v2/pack.rs index 058ee32a8..a1154378b 100644 --- a/core/startos/src/s9pk/v2/pack.rs +++ b/core/startos/src/s9pk/v2/pack.rs @@ -248,7 +248,6 @@ impl PackParams { #[derive(Debug, Clone, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct ImageConfig { pub source: ImageSource, #[ts(type = "string[]")] @@ -336,7 +335,6 @@ impl clap::FromArgMatches for ImageConfig { #[derive(Debug, Clone, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] #[serde(untagged)] -#[ts(export)] pub enum BuildArg { String(String), EnvVar { env: String }, @@ -344,7 +342,6 @@ pub enum BuildArg { #[derive(Debug, Clone, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum ImageSource { Packed, #[serde(rename_all = "camelCase")] @@ -626,7 +623,6 @@ fn tar2sqfs(dest: impl AsRef) -> Result { #[derive(Debug, Clone, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct ImageMetadata { pub workdir: PathBuf, #[ts(type = "string")] diff --git a/core/startos/src/service/effects/action.rs b/core/startos/src/service/effects/action.rs index f4f030bd0..3499f8277 100644 --- a/core/startos/src/service/effects/action.rs +++ b/core/startos/src/service/effects/action.rs @@ -1,9 +1,9 @@ use std::collections::BTreeSet; use models::{ActionId, PackageId, ReplayId}; -use rpc_toolkit::{Context, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, HandlerExt, ParentHandler}; -use crate::action::{ActionInput, ActionResult, display_action_result}; +use crate::action::{display_action_result, ActionInput, ActionResult}; use crate::db::model::package::{ ActionMetadata, Task, TaskCondition, TaskEntry, TaskSeverity, TaskTrigger, }; @@ -44,7 +44,6 @@ pub fn action_api() -> ParentHandler { } #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ExportActionParams { id: ActionId, @@ -77,7 +76,6 @@ pub async fn export_action( } #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ClearActionsParams { #[arg(long)] @@ -110,7 +108,6 @@ async fn clear_actions( #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetActionInputParams { #[serde(default)] #[ts(skip)] @@ -148,7 +145,6 @@ async fn get_action_input( #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct RunActionParams { #[serde(default)] #[ts(skip)] @@ -157,8 +153,8 @@ pub struct RunActionParams { #[ts(optional)] package_id: Option, action_id: ActionId, - #[ts(type = "any")] - input: Value, + #[ts(optional, type = "unknown")] + input: Option, } async fn run_action( context: EffectContext, @@ -171,6 +167,8 @@ async fn run_action( ) -> Result, Error> { let context = context.deref()?; + let input = input.unwrap_or_default(); + let package_id = package_id.as_ref().unwrap_or(&context.seed.id); if package_id != &context.seed.id { @@ -195,7 +193,6 @@ async fn run_action( #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct CreateTaskParams { #[serde(default)] #[ts(skip)] @@ -283,7 +280,6 @@ async fn create_task( #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] #[ts(type = "{ only: string[] } | { except: string[] }")] -#[ts(export)] pub struct ClearTasksParams { #[arg(long, conflicts_with = "except")] pub only: Option>, diff --git a/core/startos/src/service/effects/callbacks.rs b/core/startos/src/service/effects/callbacks.rs index dea736aeb..8fd681095 100644 --- a/core/startos/src/service/effects/callbacks.rs +++ b/core/startos/src/service/effects/callbacks.rs @@ -293,7 +293,6 @@ impl CallbackHandlers { #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] #[ts(type = "{ only: number[] } | { except: number[] }")] -#[ts(export)] pub struct ClearCallbacksParams { #[arg(long, conflicts_with = "except")] pub only: Option>, diff --git a/core/startos/src/service/effects/control.rs b/core/startos/src/service/effects/control.rs index ff4ed5f27..877a44e1f 100644 --- a/core/startos/src/service/effects/control.rs +++ b/core/startos/src/service/effects/control.rs @@ -35,7 +35,6 @@ pub async fn shutdown(context: EffectContext, EventId { event_id }: EventId) -> #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetStatusParams { #[ts(optional)] pub package_id: Option, @@ -76,7 +75,6 @@ pub async fn get_status( #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum SetMainStatusStatus { Running, Stopped, @@ -100,7 +98,6 @@ impl ValueParserFactory for SetMainStatusStatus { #[derive(Debug, Clone, Serialize, Deserialize, Parser, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetMainStatus { status: SetMainStatusStatus, } diff --git a/core/startos/src/service/effects/dependency.rs b/core/startos/src/service/effects/dependency.rs index 38feeb90f..1ae0dffc2 100644 --- a/core/startos/src/service/effects/dependency.rs +++ b/core/startos/src/service/effects/dependency.rs @@ -22,7 +22,6 @@ use crate::status::health_check::NamedHealthCheckResult; use crate::volume::data_dir; #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct MountTarget { package_id: PackageId, @@ -32,7 +31,6 @@ pub struct MountTarget { filetype: FileType, } #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct MountParams { location: PathBuf, @@ -98,7 +96,6 @@ pub async fn get_installed_packages(context: EffectContext) -> Result, } @@ -271,14 +266,12 @@ pub async fn get_dependencies(context: EffectContext) -> Result>, } #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct CheckDependenciesResult { package_id: PackageId, #[ts(type = "string | null")] diff --git a/core/startos/src/service/effects/health.rs b/core/startos/src/service/effects/health.rs index 013172a92..06d91217f 100644 --- a/core/startos/src/service/effects/health.rs +++ b/core/startos/src/service/effects/health.rs @@ -6,7 +6,6 @@ use crate::status::health_check::NamedHealthCheckResult; #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetHealth { id: HealthCheckId, #[serde(flatten)] diff --git a/core/startos/src/service/effects/mod.rs b/core/startos/src/service/effects/mod.rs index f4caaf167..05456404f 100644 --- a/core/startos/src/service/effects/mod.rs +++ b/core/startos/src/service/effects/mod.rs @@ -1,17 +1,18 @@ use std::net::Ipv4Addr; -use rpc_toolkit::{Context, HandlerExt, ParentHandler, from_fn, from_fn_async, from_fn_blocking}; +use rpc_toolkit::{from_fn, from_fn_async, from_fn_blocking, Context, HandlerExt, ParentHandler}; +use ts_rs::TS; use crate::prelude::*; use crate::service::cli::ContainerCliContext; use crate::service::effects::context::EffectContext; -use crate::{HOST_IP, echo}; +use crate::{echo, HOST_IP}; mod action; pub mod callbacks; pub mod context; mod control; -mod dependency; +pub mod dependency; mod health; mod net; mod prelude; @@ -19,6 +20,22 @@ mod subcontainer; mod system; mod version; +#[test] +fn export_bindings_service_effects_api() { + use rpc_toolkit::HandlerTS; + + std::fs::create_dir_all("./bindings").unwrap(); + std::fs::write( + "./bindings/service-effects-api.ts", + format!( + "export type ServiceEffectsApi = {}", + handler::().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); +} + pub fn handler() -> ParentHandler { ParentHandler::new() .subcommand("git-info", from_fn(|_: C| crate::version::git_info())) @@ -117,6 +134,10 @@ pub fn handler() -> ParentHandler { .subcommand( "create-fs", from_fn_async(subcontainer::create_subcontainer_fs) + .custom_ts( + subcontainer::CreateSubcontainerFsParams::inline_flattened(), + "[string, string]".into(), + ) .with_custom_display_fn(|_, (path, _)| Ok(println!("{}", path.display()))) .with_call_remote::(), ) diff --git a/core/startos/src/service/effects/net/bind.rs b/core/startos/src/service/effects/net/bind.rs index 732249d74..b94ec44bd 100644 --- a/core/startos/src/service/effects/net/bind.rs +++ b/core/startos/src/service/effects/net/bind.rs @@ -5,7 +5,6 @@ use crate::service::effects::prelude::*; #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct BindParams { id: HostId, internal_port: u16, @@ -30,7 +29,6 @@ pub async fn bind( } #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ClearBindingsParams { #[serde(default)] @@ -52,7 +50,6 @@ pub async fn clear_bindings( } #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct GetServicePortForwardParams { #[ts(optional)] diff --git a/core/startos/src/service/effects/net/host.rs b/core/startos/src/service/effects/net/host.rs index 7039942d7..41a6c1961 100644 --- a/core/startos/src/service/effects/net/host.rs +++ b/core/startos/src/service/effects/net/host.rs @@ -7,7 +7,6 @@ use crate::service::rpc::CallbackId; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetHostInfoParams { host_id: HostId, #[ts(optional)] diff --git a/core/startos/src/service/effects/net/info.rs b/core/startos/src/service/effects/net/info.rs index 90d3ef223..a17ff8d5b 100644 --- a/core/startos/src/service/effects/net/info.rs +++ b/core/startos/src/service/effects/net/info.rs @@ -8,7 +8,6 @@ use crate::service::rpc::CallbackId; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetContainerIpParams { #[ts(optional)] package_id: Option, diff --git a/core/startos/src/service/effects/net/interface.rs b/core/startos/src/service/effects/net/interface.rs index 6cb327fff..d2d487cfb 100644 --- a/core/startos/src/service/effects/net/interface.rs +++ b/core/startos/src/service/effects/net/interface.rs @@ -9,7 +9,6 @@ use crate::service::effects::prelude::*; use crate::service::rpc::CallbackId; #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ExportServiceInterfaceParams { id: ServiceInterfaceId, @@ -83,7 +82,6 @@ pub async fn export_service_interface( #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetServiceInterfaceParams { #[ts(optional)] package_id: Option, @@ -124,7 +122,6 @@ pub async fn get_service_interface( } #[derive(Debug, Clone, Serialize, Deserialize, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ListServiceInterfacesParams { #[ts(optional)] @@ -167,7 +164,6 @@ pub async fn list_service_interfaces( } #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct ClearServiceInterfacesParams { pub except: Vec, diff --git a/core/startos/src/service/effects/net/ssl.rs b/core/startos/src/service/effects/net/ssl.rs index fcd1dac9d..2cb1c5616 100644 --- a/core/startos/src/service/effects/net/ssl.rs +++ b/core/startos/src/service/effects/net/ssl.rs @@ -14,7 +14,6 @@ use crate::util::serde::Pem; #[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize, TS, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum Algorithm { Ecdsa, Ed25519, @@ -22,7 +21,6 @@ pub enum Algorithm { #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetSslCertificateParams { #[ts(type = "string[]")] hostnames: BTreeSet, @@ -144,7 +142,6 @@ pub async fn get_ssl_certificate( #[derive(Debug, Clone, Serialize, Deserialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct GetSslKeyParams { #[ts(type = "string[]")] hostnames: BTreeSet, diff --git a/core/startos/src/service/effects/prelude.rs b/core/startos/src/service/effects/prelude.rs index 74a3ce476..f8c0e5247 100644 --- a/core/startos/src/service/effects/prelude.rs +++ b/core/startos/src/service/effects/prelude.rs @@ -8,7 +8,6 @@ pub(super) use crate::service::effects::context::EffectContext; #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct EventId { #[serde(default)] #[arg(default_value_t, long)] diff --git a/core/startos/src/service/effects/subcontainer/mod.rs b/core/startos/src/service/effects/subcontainer/mod.rs index 395f5fcd1..a8cfdbeed 100644 --- a/core/startos/src/service/effects/subcontainer/mod.rs +++ b/core/startos/src/service/effects/subcontainer/mod.rs @@ -23,7 +23,6 @@ use sync_dummy as sync; #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct DestroySubcontainerFsParams { guid: Guid, } @@ -70,7 +69,6 @@ pub async fn destroy_subcontainer_fs( #[derive(Debug, Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct CreateSubcontainerFsParams { image_id: ImageId, #[ts(type = "string | null")] diff --git a/core/startos/src/service/effects/system.rs b/core/startos/src/service/effects/system.rs index abf6f36ad..f0f872257 100644 --- a/core/startos/src/service/effects/system.rs +++ b/core/startos/src/service/effects/system.rs @@ -4,7 +4,6 @@ use crate::service::rpc::CallbackId; use crate::system::SmtpValue; #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct GetSystemSmtpParams { #[arg(skip)] diff --git a/core/startos/src/service/effects/version.rs b/core/startos/src/service/effects/version.rs index 185e1f629..ac02dc5f3 100644 --- a/core/startos/src/service/effects/version.rs +++ b/core/startos/src/service/effects/version.rs @@ -7,7 +7,6 @@ use crate::volume::PKG_VOLUME_DIR; #[derive(Debug, Clone, Serialize, Deserialize, TS, Parser)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetDataVersionParams { #[ts(type = "string")] version: Option, diff --git a/core/startos/src/setup.rs b/core/startos/src/setup.rs index 1c67a8958..bee07531e 100644 --- a/core/startos/src/setup.rs +++ b/core/startos/src/setup.rs @@ -8,7 +8,7 @@ use const_format::formatcp; use josekit::jwk::Jwk; use patch_db::json_ptr::ROOT; use rpc_toolkit::yajrc::RpcError; -use rpc_toolkit::{Context, Empty, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, Empty, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use tokio::io::AsyncWriteExt; use tokio::process::Command; @@ -24,24 +24,24 @@ use crate::context::rpc::InitRpcContextPhases; use crate::context::setup::SetupResult; use crate::context::{RpcContext, SetupContext}; use crate::db::model::Database; -use crate::disk::REPAIR_DISK_PATH; use crate::disk::fsck::RepairStrategy; use crate::disk::main::DEFAULT_PASSWORD; -use crate::disk::mount::filesystem::ReadWrite; use crate::disk::mount::filesystem::cifs::Cifs; +use crate::disk::mount::filesystem::ReadWrite; use crate::disk::mount::guard::{GenericMountGuard, TmpMountGuard}; -use crate::disk::util::{DiskInfo, StartOsRecoveryInfo, pvscan, recovery_info}; -use crate::init::{InitPhases, InitResult, init}; +use crate::disk::util::{pvscan, recovery_info, DiskInfo, StartOsRecoveryInfo}; +use crate::disk::REPAIR_DISK_PATH; +use crate::init::{init, InitPhases, InitResult}; use crate::net::ssl::root_ca_start_time; use crate::prelude::*; use crate::progress::{FullProgress, PhaseProgressTrackerHandle, ProgressUnits}; use crate::rpc_continuations::Guid; use crate::shutdown::Shutdown; use crate::system::sync_kiosk; -use crate::util::Invoke; use crate::util::crypto::EncryptedWire; -use crate::util::io::{Counter, create_file, dir_copy, dir_size}; -use crate::{DATA_DIR, Error, ErrorKind, MAIN_DATA, PACKAGE_DATA, PLATFORM, ResultExt}; +use crate::util::io::{create_file, dir_copy, dir_size, Counter}; +use crate::util::Invoke; +use crate::{Error, ErrorKind, ResultExt, DATA_DIR, MAIN_DATA, PACKAGE_DATA, PLATFORM}; pub fn setup() -> ParentHandler { ParentHandler::new() @@ -67,7 +67,9 @@ pub fn setup() -> ParentHandler { .subcommand("logs", crate::system::logs::().no_ts()) .subcommand( "logs", - from_fn_async(crate::logs::cli_logs::).no_display().no_ts(), + from_fn_async(crate::logs::cli_logs::) + .no_display() + .no_ts(), ) .subcommand("restart", from_fn_async(restart).no_cli()) } @@ -125,7 +127,6 @@ async fn setup_init( #[derive(Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct AttachParams { #[serde(rename = "startOsPassword")] password: Option, @@ -204,7 +205,6 @@ pub async fn attach( #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] #[serde(tag = "status")] pub enum SetupStatusRes { Complete(SetupResult), @@ -213,7 +213,6 @@ pub enum SetupStatusRes { #[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetupProgress { pub progress: FullProgress, pub guid: Guid, @@ -250,7 +249,6 @@ pub fn cifs() -> ParentHandler { #[derive(Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct VerifyCifsParams { hostname: String, path: PathBuf, @@ -307,7 +305,6 @@ pub enum RecoverySource { #[derive(Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct SetupExecuteParams { start_os_logicalname: PathBuf, start_os_password: EncryptedWire, diff --git a/core/startos/src/sign/commitment/blake3.rs b/core/startos/src/sign/commitment/blake3.rs index d16acaed3..fde6180f4 100644 --- a/core/startos/src/sign/commitment/blake3.rs +++ b/core/startos/src/sign/commitment/blake3.rs @@ -15,7 +15,6 @@ use crate::util::serde::Base64; #[derive(Clone, Debug, Deserialize, Serialize, HasModel, PartialEq, Eq, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct Blake3Commitment { pub hash: Base64<[u8; 32]>, #[ts(type = "number")] diff --git a/core/startos/src/sign/commitment/merkle_archive.rs b/core/startos/src/sign/commitment/merkle_archive.rs index 111923aef..1613b7e5d 100644 --- a/core/startos/src/sign/commitment/merkle_archive.rs +++ b/core/startos/src/sign/commitment/merkle_archive.rs @@ -14,7 +14,6 @@ use crate::util::serde::Base64; #[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct MerkleArchiveCommitment { pub root_sighash: Base64<[u8; 32]>, #[ts(type = "number")] diff --git a/core/startos/src/sign/commitment/request.rs b/core/startos/src/sign/commitment/request.rs index 4d9109d69..59969831d 100644 --- a/core/startos/src/sign/commitment/request.rs +++ b/core/startos/src/sign/commitment/request.rs @@ -20,7 +20,6 @@ use crate::util::serde::Base64; #[derive(Clone, Debug, Deserialize, Serialize, HasModel, PartialEq, Eq, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct RequestCommitment { #[ts(type = "number")] pub timestamp: i64, diff --git a/core/startos/src/sign/mod.rs b/core/startos/src/sign/mod.rs index 2c8c1289c..d76267464 100644 --- a/core/startos/src/sign/mod.rs +++ b/core/startos/src/sign/mod.rs @@ -119,7 +119,7 @@ impl SignatureScheme for AnyScheme { } #[derive(Clone, Debug, PartialEq, Eq, TS)] -#[ts(export, type = "string")] +#[ts(type = "string")] #[non_exhaustive] pub enum AnySigningKey { Ed25519(::SigningKey), @@ -191,7 +191,7 @@ impl Serialize for AnySigningKey { } #[derive(Clone, Debug, PartialEq, Eq, Hash, TS)] -#[ts(export, type = "string")] +#[ts(type = "string")] #[non_exhaustive] pub enum AnyVerifyingKey { Ed25519(::VerifyingKey), @@ -278,7 +278,7 @@ impl digest::Update for AnyDigest { } #[derive(Clone, Debug, PartialEq, Eq, TS)] -#[ts(export, type = "string")] +#[ts(type = "string")] pub enum AnySignature { Ed25519(::Signature), } diff --git a/core/startos/src/system.rs b/core/startos/src/system.rs index 45339b537..28ba56f7c 100644 --- a/core/startos/src/system.rs +++ b/core/startos/src/system.rs @@ -8,7 +8,7 @@ use color_eyre::eyre::eyre; use futures::{FutureExt, TryStreamExt}; use imbl::vector; use imbl_value::InternedString; -use rpc_toolkit::{Context, Empty, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, Empty, HandlerExt, ParentHandler, UnknownTS}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use tokio::process::Command; use tokio::sync::broadcast::Receiver; @@ -21,12 +21,12 @@ use crate::logs::{LogSource, LogsParams, SYSTEM_UNIT}; use crate::prelude::*; use crate::rpc_continuations::{Guid, RpcContinuation, RpcContinuations}; use crate::shutdown::Shutdown; -use crate::util::Invoke; -use crate::util::cpupower::{Governor, get_available_governors, set_governor}; +use crate::util::cpupower::{get_available_governors, set_governor, Governor}; use crate::util::io::open_file; use crate::util::net::WebSocketExt; -use crate::util::serde::{HandlerExtSerde, WithIoFormat, display_serializable}; +use crate::util::serde::{display_serializable, HandlerExtSerde, WithIoFormat}; use crate::util::sync::Watch; +use crate::util::Invoke; use crate::{MAIN_DATA, PACKAGE_DATA}; pub fn experimental() -> ParentHandler { @@ -116,7 +116,7 @@ pub async fn zram(ctx: RpcContext, ZramParams { enable }: ZramParams) -> Result< Ok(()) } -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, TS)] pub struct GovernorInfo { current: Option, available: BTreeSet, @@ -242,11 +242,12 @@ pub async fn time(ctx: RpcContext, _: Empty) -> Result { }) } -pub fn logs>() -> ParentHandler { +pub fn logs>() -> UnknownTS> { crate::logs::logs(|_: &C, _| async { Ok(LogSource::Unit(SYSTEM_UNIT)) }) } -pub fn kernel_logs>() -> ParentHandler { +pub fn kernel_logs>() -> UnknownTS> +{ crate::logs::logs(|_: &C, _| async { Ok(LogSource::Kernel) }) } @@ -470,7 +471,6 @@ pub struct MetricsDisk { #[derive(Deserialize, Serialize, Clone, Debug, TS)] #[serde(rename_all = "camelCase")] -#[ts(export)] pub struct Metrics { general: MetricsGeneral, memory: MetricsMemory, @@ -961,7 +961,6 @@ async fn get_disk_info() -> Result { } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct SmtpValue { #[arg(long)] @@ -1007,7 +1006,6 @@ pub async fn clear_system_smtp(ctx: RpcContext) -> Result<(), Error> { Ok(()) } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, TS)] -#[ts(export)] #[serde(rename_all = "camelCase")] pub struct TestSmtpParams { #[arg(long)] diff --git a/core/startos/src/tunnel/api.rs b/core/startos/src/tunnel/api.rs index 1e1fa507c..b5fc62424 100644 --- a/core/startos/src/tunnel/api.rs +++ b/core/startos/src/tunnel/api.rs @@ -3,7 +3,7 @@ use std::net::{IpAddr, Ipv4Addr, SocketAddr, SocketAddrV4}; use clap::Parser; use imbl_value::InternedString; use ipnet::Ipv4Net; -use rpc_toolkit::{Context, Empty, HandlerArgs, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, Empty, HandlerArgs, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use ts_rs::TS; @@ -11,7 +11,23 @@ use crate::context::CliContext; use crate::prelude::*; use crate::tunnel::context::TunnelContext; use crate::tunnel::wg::{WgConfig, WgSubnetClients, WgSubnetConfig}; -use crate::util::serde::{HandlerExtSerde, display_serializable}; +use crate::util::serde::{display_serializable, HandlerExtSerde}; + +#[test] +fn export_bindings_tunnel_api() { + use rpc_toolkit::HandlerTS; + + std::fs::create_dir_all("./bindings").unwrap(); + std::fs::write( + "./bindings/tunnel-api.ts", + format!( + "export type TunnelApi = {}", + tunnel_api::().type_info().unwrap() + ) + .as_bytes(), + ) + .unwrap(); +} pub fn tunnel_api() -> ParentHandler { ParentHandler::new() @@ -134,7 +150,7 @@ pub fn device_api() -> ParentHandler { ) } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct AddSubnetParams { name: InternedString, @@ -188,9 +204,10 @@ pub async fn remove_subnet( server.sync().await } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct AddDeviceParams { + #[ts(type = "string")] subnet: Ipv4Net, name: InternedString, ip: Option, @@ -249,9 +266,10 @@ pub async fn add_device( server.sync().await } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct RemoveDeviceParams { + #[ts(type = "string")] subnet: Ipv4Net, ip: Ipv4Addr, } @@ -277,9 +295,10 @@ pub async fn remove_device( server.sync().await } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct ListDevicesParams { + #[ts(type = "string")] subnet: Ipv4Net, } @@ -297,13 +316,15 @@ pub async fn list_devices( .de() } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct ShowConfigParams { + #[ts(type = "string")] subnet: Ipv4Net, ip: Ipv4Addr, wan_addr: Option, #[serde(rename = "__ConnectInfo_local_addr")] + #[ts(skip)] #[arg(skip)] local_addr: Option, } @@ -361,7 +382,7 @@ pub async fn show_config( .to_string()) } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct AddPortForwardParams { source: SocketAddrV4, @@ -385,7 +406,7 @@ pub async fn add_forward( Ok(()) } -#[derive(Deserialize, Serialize, Parser)] +#[derive(Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct RemovePortForwardParams { source: SocketAddrV4, diff --git a/core/startos/src/tunnel/auth.rs b/core/startos/src/tunnel/auth.rs index 16979c03a..7e2199e90 100644 --- a/core/startos/src/tunnel/auth.rs +++ b/core/startos/src/tunnel/auth.rs @@ -3,11 +3,11 @@ use imbl::HashMap; use imbl_value::InternedString; use itertools::Itertools; use patch_db::HasModel; -use rpc_toolkit::{Context, HandlerArgs, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, Empty, HandlerArgs, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use ts_rs::TS; -use crate::auth::{Sessions, check_password}; +use crate::auth::{check_password, Sessions}; use crate::context::CliContext; use crate::middleware::auth::AuthContext; use crate::middleware::signature::SignatureAuthContext; @@ -16,7 +16,7 @@ use crate::rpc_continuations::OpenAuthedContinuations; use crate::sign::AnyVerifyingKey; use crate::tunnel::context::TunnelContext; use crate::tunnel::db::TunnelDatabase; -use crate::util::serde::{HandlerExtSerde, display_serializable}; +use crate::util::serde::{display_serializable, HandlerExtSerde}; use crate::util::sync::SyncMutex; impl SignatureAuthContext for TunnelContext { @@ -113,27 +113,12 @@ impl AuthContext for TunnelContext { #[derive(Clone, Debug, Deserialize, Serialize, HasModel, TS, Parser)] #[serde(rename_all = "camelCase")] #[model = "Model"] -#[ts(export)] pub struct SignerInfo { pub name: InternedString, } pub fn auth_api() -> ParentHandler { - ParentHandler::new() - .subcommand( - "login", - from_fn_async(crate::auth::login_impl::) - .with_metadata("login", Value::Bool(true)) - .no_cli(), - ) - .subcommand( - "logout", - from_fn_async(crate::auth::logout::) - .with_metadata("get_session", Value::Bool(true)) - .no_display() - .with_about("Log out of current auth session") - .with_call_remote::(), - ) + crate::auth::auth::() .subcommand("set-password", from_fn_async(set_password_rpc).no_cli()) .subcommand( "set-password", @@ -170,22 +155,22 @@ pub fn auth_api() -> ParentHandler { "list", from_fn_async(list_keys) .with_metadata("sync_db", Value::Bool(true)) + .custom_ts( + Empty::inline_flattened(), + std::collections::HashMap::::inline_flattened(), + ) .with_display_serializable() .with_custom_display_fn(|HandlerArgs { params, .. }, res| { use prettytable::*; - if let Some(format) = params.format { return display_serializable(format, res); } - let mut table = Table::new(); table.add_row(row![bc => "NAME", "KEY"]); for (key, info) in res { table.add_row(row![info.name, key]); } - table.print_tty(false)?; - Ok(()) }) .with_about("List authorized keys") @@ -194,7 +179,7 @@ pub fn auth_api() -> ParentHandler { ) } -#[derive(Debug, Deserialize, Serialize, Parser)] +#[derive(Debug, Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct AddKeyParams { pub name: InternedString, @@ -216,7 +201,7 @@ pub async fn add_key( .result } -#[derive(Debug, Deserialize, Serialize, Parser)] +#[derive(Debug, Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct RemoveKeyParams { pub key: AnyVerifyingKey, diff --git a/core/startos/src/tunnel/context.rs b/core/startos/src/tunnel/context.rs index 421e8e2e6..13d91b580 100644 --- a/core/startos/src/tunnel/context.rs +++ b/core/startos/src/tunnel/context.rs @@ -9,7 +9,6 @@ use cookie::{Cookie, Expiration, SameSite}; use http::HeaderMap; use imbl::OrdMap; use imbl_value::InternedString; -use include_dir::Dir; use models::GatewayId; use patch_db::PatchDb; use rpc_toolkit::yajrc::RpcError; @@ -34,7 +33,7 @@ use crate::rpc_continuations::{OpenAuthedContinuations, RpcContinuations}; use crate::tunnel::TUNNEL_DEFAULT_LISTEN; use crate::tunnel::api::tunnel_api; use crate::tunnel::db::TunnelDatabase; -use crate::tunnel::wg::WIREGUARD_INTERFACE_NAME; +use crate::tunnel::wg::{WIREGUARD_INTERFACE_NAME, WgSubnetConfig}; use crate::util::Invoke; use crate::util::collections::OrdMapIterMut; use crate::util::io::read_file_to_string; @@ -101,7 +100,17 @@ impl TunnelContext { let db_path = datadir.join("tunnel.db"); let db = TypedPatchDb::::load_or_init( PatchDb::open(&db_path).await?, - || async { Ok(Default::default()) }, + || async { + let mut db = TunnelDatabase::default(); + db.wg.subnets.0.insert( + "10.59.0.1/24".parse()?, + WgSubnetConfig { + name: "Default Subnet".into(), + ..Default::default() + }, + ); + Ok(db) + }, ) .await?; let listen = config.tunnel_listen.unwrap_or(TUNNEL_DEFAULT_LISTEN); diff --git a/core/startos/src/tunnel/db.rs b/core/startos/src/tunnel/db.rs index 2e3addd94..3c1ef5fbf 100644 --- a/core/startos/src/tunnel/db.rs +++ b/core/startos/src/tunnel/db.rs @@ -9,10 +9,10 @@ use imbl::{HashMap, OrdMap}; use imbl_value::InternedString; use itertools::Itertools; use models::GatewayId; -use patch_db::Dump; use patch_db::json_ptr::{JsonPointer, ROOT}; +use patch_db::Dump; use rpc_toolkit::yajrc::RpcError; -use rpc_toolkit::{Context, HandlerArgs, HandlerExt, ParentHandler, from_fn_async}; +use rpc_toolkit::{from_fn_async, Context, HandlerArgs, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use tracing::instrument; use ts_rs::TS; @@ -28,7 +28,7 @@ use crate::tunnel::context::TunnelContext; use crate::tunnel::web::WebserverInfo; use crate::tunnel::wg::WgServer; use crate::util::net::WebSocketExt; -use crate::util::serde::{HandlerExtSerde, apply_expr}; +use crate::util::serde::{apply_expr, HandlerExtSerde}; #[derive(Default, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] @@ -47,7 +47,7 @@ pub struct TunnelDatabase { #[test] fn export_bindings_tunnel_db() { - TunnelDatabase::export_all_to("bindings/tunnel").unwrap(); + TunnelDatabase::export_all_to("bindings/database/tunnel").unwrap(); } #[derive(Clone, Debug, Default, Deserialize, Serialize, TS)] @@ -78,7 +78,7 @@ pub fn db_api() -> ParentHandler { .with_metadata("admin", Value::Bool(true)) .no_cli() .custom_ts( - DumpParams::inline(), + DumpParams::inline_flattened(), format!("{{ id: number; value: unknown }}"), ), ) diff --git a/core/startos/src/tunnel/web.rs b/core/startos/src/tunnel/web.rs index 121b36a3e..a9c530aa3 100644 --- a/core/startos/src/tunnel/web.rs +++ b/core/startos/src/tunnel/web.rs @@ -3,30 +3,30 @@ use std::net::{IpAddr, SocketAddr}; use std::sync::Arc; use clap::Parser; -use imbl_value::{InternedString, json}; +use imbl_value::{json, InternedString}; use itertools::Itertools; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; use rpc_toolkit::{ - Context, Empty, HandlerArgs, HandlerExt, ParentHandler, from_fn_async, from_fn_async_local, + from_fn_async, from_fn_async_local, Context, Empty, HandlerArgs, HandlerExt, ParentHandler, }; use serde::{Deserialize, Serialize}; -use tokio_rustls::rustls::ServerConfig; use tokio_rustls::rustls::crypto::CryptoProvider; use tokio_rustls::rustls::pki_types::{CertificateDer, PrivateKeyDer, PrivatePkcs8KeyDer}; use tokio_rustls::rustls::server::ClientHello; +use tokio_rustls::rustls::ServerConfig; use ts_rs::TS; use crate::context::CliContext; use crate::hostname::Hostname; -use crate::net::ssl::{SANInfo, root_ca_start_time}; +use crate::net::ssl::{root_ca_start_time, SANInfo}; use crate::net::tls::TlsHandler; use crate::net::web_server::Accept; use crate::prelude::*; use crate::tunnel::auth::SetPasswordParams; use crate::tunnel::context::TunnelContext; use crate::tunnel::db::TunnelDatabase; -use crate::util::serde::{HandlerExtSerde, Pem, display_serializable}; +use crate::util::serde::{display_serializable, HandlerExtSerde, Pem}; use crate::util::tui::{choose, choose_custom_display, parse_as, prompt, prompt_multiline}; #[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] @@ -255,7 +255,11 @@ pub async fn import_certificate_cli( chain.push(cert.0); - if is_root { Ok(Some(())) } else { Ok(None) } + if is_root { + Ok(Some(())) + } else { + Ok(None) + } } else { Ok(None) } @@ -276,7 +280,7 @@ pub async fn import_certificate_cli( Ok(()) } -#[derive(Debug, Deserialize, Serialize, Parser)] +#[derive(Debug, Deserialize, Serialize, Parser, TS)] pub struct GenerateCertParams { #[arg(help = "Subject Alternative Name(s)")] pub subject: Vec, @@ -327,7 +331,7 @@ pub async fn get_certificate(ctx: TunnelContext) -> Result> .transpose() } -#[derive(Debug, Deserialize, Serialize, Parser)] +#[derive(Debug, Deserialize, Serialize, Parser, TS)] #[serde(rename_all = "camelCase")] pub struct SetListenParams { pub listen: SocketAddr, diff --git a/core/startos/src/util/cpupower.rs b/core/startos/src/util/cpupower.rs index db625f90e..8527b8c32 100644 --- a/core/startos/src/util/cpupower.rs +++ b/core/startos/src/util/cpupower.rs @@ -17,7 +17,6 @@ pub const GOVERNOR_HEIRARCHY: &[Governor] = &[ #[derive( Debug, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize, TS, )] -#[ts(export, type = "string")] pub struct Governor(Cow<'static, str>); impl std::str::FromStr for Governor { type Err = std::convert::Infallible; diff --git a/core/startos/src/util/crypto.rs b/core/startos/src/util/crypto.rs index a99e4593a..f3a1caab9 100644 --- a/core/startos/src/util/crypto.rs +++ b/core/startos/src/util/crypto.rs @@ -57,7 +57,6 @@ pub fn decrypt_slice(input: impl AsRef<[u8]>, password: impl AsRef<[u8]>) -> Vec } #[derive(Debug, Clone, Deserialize, Serialize, TS)] -#[ts(export)] pub struct EncryptedWire { #[ts(type = "any")] encrypted: Value, diff --git a/core/startos/src/util/lshw.rs b/core/startos/src/util/lshw.rs index df5fff5f8..eb5293d89 100644 --- a/core/startos/src/util/lshw.rs +++ b/core/startos/src/util/lshw.rs @@ -10,7 +10,6 @@ const KNOWN_CLASSES: &[&str] = &["processor", "display"]; #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(tag = "class")] #[serde(rename_all = "camelCase")] -#[ts(export)] pub enum LshwDevice { Processor(LshwProcessor), Display(LshwDisplay), diff --git a/core/startos/src/util/serde.rs b/core/startos/src/util/serde.rs index 4f7636d96..505fcf69a 100644 --- a/core/startos/src/util/serde.rs +++ b/core/startos/src/util/serde.rs @@ -13,7 +13,7 @@ use openssl::pkey::{PKey, Private}; use openssl::x509::X509; use rpc_toolkit::{ CliBindings, Context, HandlerArgs, HandlerArgsFor, HandlerFor, HandlerTS, HandlerTypes, - PrintCliResult, + LeafHandler, PrintCliResult, }; use serde::de::DeserializeOwned; use serde::ser::{SerializeMap, SerializeSeq}; @@ -500,6 +500,7 @@ impl HandlerTypes for DisplaySerializable { type Ok = T::Ok; type Err = T::Err; } +impl LeafHandler for DisplaySerializable {} impl HandlerTS for DisplaySerializable { fn type_info(&self) -> Option { self.0.type_info() @@ -663,7 +664,7 @@ where } #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, TS)] -#[ts(export, type = "string")] +#[ts(type = "string")] pub struct Duration(std::time::Duration); impl Deref for Duration { type Target = std::time::Duration; @@ -1027,7 +1028,11 @@ impl TS for KeyVal { format!("{{ [T in {}]: {} }}", K::inline(), V::inline()) } fn inline_flattened() -> String { - Self::inline() + format!( + "{{ [T in {}]: {} }}", + K::inline_flattened(), + V::inline_flattened() + ) } fn visit_dependencies(v: &mut impl ts_rs::TypeVisitor) where @@ -1467,7 +1472,6 @@ impl ValueParserFactory for Pem { } #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, TS)] -#[ts(export, type = "string | number[]")] pub struct MaybeUtf8String(pub Vec); impl std::fmt::Debug for MaybeUtf8String { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/core/startos/src/version/v0_4_0_alpha_12.rs b/core/startos/src/version/v0_4_0_alpha_12.rs index 95b210ce9..5ff6cd4d2 100644 --- a/core/startos/src/version/v0_4_0_alpha_12.rs +++ b/core/startos/src/version/v0_4_0_alpha_12.rs @@ -4,7 +4,7 @@ use exver::{PreReleaseSegment, VersionRange}; use imbl_value::InternedString; use super::v0_3_5::V0_3_0_COMPAT; -use super::{VersionT, v0_4_0_alpha_11}; +use super::{v0_4_0_alpha_11, VersionT}; use crate::net::tor::TorSecretKey; use crate::prelude::*; @@ -75,7 +75,10 @@ impl VersionT for Version { } fix_host(&mut db["public"]["serverInfo"]["network"]["host"])?; - db["private"]["keyStore"]["localCerts"] = db["private"]["keyStore"]["local_certs"].clone(); + if db["private"]["keyStore"]["localCerts"].is_null() { + db["private"]["keyStore"]["localCerts"] = + db["private"]["keyStore"]["local_certs"].clone(); + } Ok(Value::Null) } diff --git a/sdk/base/lib/Effects.ts b/sdk/base/lib/Effects.ts index 24aafd310..714e1b97f 100644 --- a/sdk/base/lib/Effects.ts +++ b/sdk/base/lib/Effects.ts @@ -1,28 +1,14 @@ -import { - ActionId, - ActionInput, - ActionMetadata, - SetMainStatus, - DependencyRequirement, - CheckDependenciesResult, - SetHealth, - BindParams, - HostId, - NetInfo, - Host, - ExportServiceInterfaceParams, - ServiceInterface, - CreateTaskParams, - MainStatus, - MountParams, -} from "./osBindings" -import { - PackageId, - Dependencies, - ServiceInterfaceId, - SmtpValue, - ActionResult, -} from "./types" +import { ServiceEffectsApi } from "./osBindings/service-effects-api" +import { RpcParamType, RpcReturnType } from "./osBindings/api-helpers" + +type Expand = { [K in keyof T]: T[K] } +type ReqTy = RpcParamType +type ResTy = Promise< + Expand> +> +type FnTy = keyof ReqTy extends never + ? () => ResTy + : (options: ReqTy) => ResTy /** Used to reach out from the pure js runtime */ @@ -39,131 +25,85 @@ export type Effects = { // action action: { /** Define an action that can be invoked by a user or service */ - export(options: { id: ActionId; metadata: ActionMetadata }): Promise + export: FnTy<"action.export"> /** Remove all exported actions */ - clear(options: { except: ActionId[] }): Promise - getInput(options: { - packageId?: PackageId - actionId: ActionId - }): Promise - run>(options: { - packageId?: PackageId - actionId: ActionId - input?: Input - }): Promise - createTask(options: CreateTaskParams): Promise - clearTasks( - options: { only: string[] } | { except: string[] }, - ): Promise + clear: FnTy<"action.clear"> + getInput: FnTy<"action.get-input"> + run: FnTy<"action.run"> + createTask: FnTy<"action.create-task"> + clearTasks: FnTy<"action.clear-tasks"> } // control /** restart this service's main function */ - restart(): Promise + restart: FnTy<"restart"> /** stop this service's main function */ - shutdown(): Promise + shutdown: FnTy<"shutdown"> /** ask the host os what the service's current status is */ - getStatus(options: { - packageId?: PackageId - callback?: () => void - }): Promise + getStatus: FnTy<"get-status"> /** indicate to the host os what runstate the service is in */ - setMainStatus(options: SetMainStatus): Promise + setMainStatus: FnTy<"set-main-status"> // dependency /** Set the dependencies of what the service needs, usually run during the inputSpec action as a best practice */ - setDependencies(options: { dependencies: Dependencies }): Promise + setDependencies: FnTy<"set-dependencies"> /** Get the list of the dependencies, both the dynamic set by the effect of setDependencies and the end result any required in the manifest */ - getDependencies(): Promise + getDependencies: FnTy<"get-dependencies"> /** Test whether current dependency requirements are satisfied */ - checkDependencies(options: { - packageIds?: PackageId[] - }): Promise + checkDependencies: FnTy<"check-dependencies"> /** mount a volume of a dependency */ - mount(options: MountParams): Promise + mount: FnTy<"mount"> /** Returns a list of the ids of all installed packages */ - getInstalledPackages(): Promise + getInstalledPackages: FnTy<"get-installed-packages"> // health /** sets the result of a health check */ - setHealth(o: SetHealth): Promise + setHealth: FnTy<"set-health"> // subcontainer subcontainer: { /** A low level api used by SubContainer */ - createFs(options: { - imageId: string - name: string | null - }): Promise<[string, string]> + createFs: FnTy<"subcontainer.create-fs"> /** A low level api used by SubContainer */ - destroyFs(options: { guid: string }): Promise + destroyFs: FnTy<"subcontainer.destroy-fs"> } // net // bind /** Creates a host connected to the specified port with the provided options */ - bind(options: BindParams): Promise + bind: FnTy<"bind"> /** Get the port address for a service */ - getServicePortForward(options: { - packageId?: PackageId - hostId: HostId - internalPort: number - }): Promise + getServicePortForward: FnTy<"get-service-port-forward"> /** Removes all network bindings, called in the setupInputSpec */ - clearBindings(options: { - except: { id: HostId; internalPort: number }[] - }): Promise + clearBindings: FnTy<"clear-bindings"> // host /** Returns information about the specified host, if it exists */ - getHostInfo(options: { - packageId?: PackageId - hostId: HostId - callback?: () => void - }): Promise + getHostInfo: FnTy<"get-host-info"> /** Returns the IP address of the container */ - getContainerIp(options: { - packageId?: PackageId - callback?: () => void - }): Promise + getContainerIp: FnTy<"get-container-ip"> /** Returns the IP address of StartOS */ - getOsIp(): Promise + getOsIp: FnTy<"get-os-ip"> // interface /** Creates an interface bound to a specific host and port to show to the user */ - exportServiceInterface(options: ExportServiceInterfaceParams): Promise + exportServiceInterface: FnTy<"export-service-interface"> /** Returns an exported service interface */ - getServiceInterface(options: { - packageId?: PackageId - serviceInterfaceId: ServiceInterfaceId - callback?: () => void - }): Promise + getServiceInterface: FnTy<"get-service-interface"> /** Returns all exported service interfaces for a package */ - listServiceInterfaces(options: { - packageId?: PackageId - callback?: () => void - }): Promise> + listServiceInterfaces: FnTy<"list-service-interfaces"> /** Removes all service interfaces */ - clearServiceInterfaces(options: { - except: ServiceInterfaceId[] - }): Promise + clearServiceInterfaces: FnTy<"clear-service-interfaces"> // ssl /** Returns a PEM encoded fullchain for the hostnames specified */ - getSslCertificate: (options: { - hostnames: string[] - algorithm?: "ecdsa" | "ed25519" - callback?: () => void - }) => Promise<[string, string, string]> + getSslCertificate: FnTy<"get-ssl-certificate"> /** Returns a PEM encoded private key corresponding to the certificate for the hostnames specified */ - getSslKey: (options: { - hostnames: string[] - algorithm?: "ecdsa" | "ed25519" - }) => Promise + getSslKey: FnTy<"get-ssl-key"> /** sets the version that this service's data has been migrated to */ - setDataVersion(options: { version: string | null }): Promise + setDataVersion: FnTy<"set-data-version"> /** returns the version that this service's data has been migrated to */ - getDataVersion(): Promise + getDataVersion: FnTy<"get-data-version"> // system /** Returns globally configured SMTP settings, if they exist */ - getSystemSmtp(options: { callback?: () => void }): Promise + getSystemSmtp: FnTy<"get-system-smtp"> } diff --git a/sdk/base/lib/dependencies/dependencies.ts b/sdk/base/lib/dependencies/dependencies.ts index 23bd1f1c8..c0f880f03 100644 --- a/sdk/base/lib/dependencies/dependencies.ts +++ b/sdk/base/lib/dependencies/dependencies.ts @@ -39,7 +39,10 @@ export async function checkDependencies< effects: Effects, packageIds?: DependencyId[], ): Promise> { - let [dependencies, results] = await Promise.all([ + let [dependencies, results]: [ + DependencyRequirement[], + CheckDependenciesResult[], + ] = await Promise.all([ effects.getDependencies(), effects.checkDependencies({ packageIds, diff --git a/sdk/base/lib/osBindings/AcceptSigners.ts b/sdk/base/lib/osBindings/AcceptSigners.ts deleted file mode 100644 index 1ef417623..000000000 --- a/sdk/base/lib/osBindings/AcceptSigners.ts +++ /dev/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 { AnyVerifyingKey } from "./AnyVerifyingKey" - -export type AcceptSigners = - | { signer: AnyVerifyingKey } - | { any: Array } - | { all: Array } diff --git a/sdk/base/lib/osBindings/AddAssetParams.ts b/sdk/base/lib/osBindings/AddAssetParams.ts deleted file mode 100644 index 7522a1cb4..000000000 --- a/sdk/base/lib/osBindings/AddAssetParams.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AnySignature } from "./AnySignature" -import type { Blake3Commitment } from "./Blake3Commitment" - -export type AddAssetParams = { - version: string - platform: string - url: string - signature: AnySignature - commitment: Blake3Commitment -} diff --git a/sdk/base/lib/osBindings/AddPackageParams.ts b/sdk/base/lib/osBindings/AddPackageParams.ts deleted file mode 100644 index 4395b9b8a..000000000 --- a/sdk/base/lib/osBindings/AddPackageParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AnySignature } from "./AnySignature" -import type { MerkleArchiveCommitment } from "./MerkleArchiveCommitment" - -export type AddPackageParams = { - url: string - commitment: MerkleArchiveCommitment - signature: AnySignature -} diff --git a/sdk/base/lib/osBindings/AddPackageToCategoryParams.ts b/sdk/base/lib/osBindings/AddPackageToCategoryParams.ts deleted file mode 100644 index 2ac9c2ff3..000000000 --- a/sdk/base/lib/osBindings/AddPackageToCategoryParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageId } from "./PackageId" - -export type AddPackageToCategoryParams = { id: string; package: PackageId } diff --git a/sdk/base/lib/osBindings/AddVersionParams.ts b/sdk/base/lib/osBindings/AddVersionParams.ts deleted file mode 100644 index 9fc281a6f..000000000 --- a/sdk/base/lib/osBindings/AddVersionParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type AddVersionParams = { - version: string - headline: string - releaseNotes: string - sourceVersion: string -} diff --git a/sdk/base/lib/osBindings/ApiState.ts b/sdk/base/lib/osBindings/ApiState.ts deleted file mode 100644 index c3a43828a..000000000 --- a/sdk/base/lib/osBindings/ApiState.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ApiState = "error" | "initializing" | "running" diff --git a/sdk/base/lib/osBindings/AttachParams.ts b/sdk/base/lib/osBindings/AttachParams.ts deleted file mode 100644 index e1de943a5..000000000 --- a/sdk/base/lib/osBindings/AttachParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EncryptedWire } from "./EncryptedWire" - -export type AttachParams = { - startOsPassword: EncryptedWire | null - guid: string - kiosk?: boolean -} diff --git a/sdk/base/lib/osBindings/BackupTargetFS.ts b/sdk/base/lib/osBindings/BackupTargetFS.ts deleted file mode 100644 index 0cff2cc4e..000000000 --- a/sdk/base/lib/osBindings/BackupTargetFS.ts +++ /dev/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 { BlockDev } from "./BlockDev" -import type { Cifs } from "./Cifs" - -export type BackupTargetFS = - | ({ type: "disk" } & BlockDev) - | ({ type: "cifs" } & Cifs) diff --git a/sdk/base/lib/osBindings/BindId.ts b/sdk/base/lib/osBindings/BindId.ts deleted file mode 100644 index 778d95346..000000000 --- a/sdk/base/lib/osBindings/BindId.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { HostId } from "./HostId" - -export type BindId = { id: HostId; internalPort: number } diff --git a/sdk/base/lib/osBindings/BindParams.ts b/sdk/base/lib/osBindings/BindParams.ts deleted file mode 100644 index 9064a33b1..000000000 --- a/sdk/base/lib/osBindings/BindParams.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AddSslOptions } from "./AddSslOptions" -import type { HostId } from "./HostId" -import type { Security } from "./Security" - -export type BindParams = { - id: HostId - internalPort: number - preferredExternalPort: number - addSsl: AddSslOptions | null - secure: Security | null -} diff --git a/sdk/base/lib/osBindings/BindingGatewaySetEnabledParams.ts b/sdk/base/lib/osBindings/BindingGatewaySetEnabledParams.ts deleted file mode 100644 index f38b5d095..000000000 --- a/sdk/base/lib/osBindings/BindingGatewaySetEnabledParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { GatewayId } from "./GatewayId" - -export type BindingGatewaySetEnabledParams = { - internalPort: number - gateway: GatewayId - enabled: boolean | null -} diff --git a/sdk/base/lib/osBindings/Blake3Commitment.ts b/sdk/base/lib/osBindings/Blake3Commitment.ts deleted file mode 100644 index 690559122..000000000 --- a/sdk/base/lib/osBindings/Blake3Commitment.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Base64 } from "./Base64" - -export type Blake3Commitment = { hash: Base64; size: number } diff --git a/sdk/base/lib/osBindings/BlockDev.ts b/sdk/base/lib/osBindings/BlockDev.ts deleted file mode 100644 index 46db81011..000000000 --- a/sdk/base/lib/osBindings/BlockDev.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type BlockDev = { logicalname: string } diff --git a/sdk/base/lib/osBindings/CallbackId.ts b/sdk/base/lib/osBindings/CallbackId.ts deleted file mode 100644 index 0ac5d7ce2..000000000 --- a/sdk/base/lib/osBindings/CallbackId.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type CallbackId = number diff --git a/sdk/base/lib/osBindings/Category.ts b/sdk/base/lib/osBindings/Category.ts deleted file mode 100644 index 615094527..000000000 --- a/sdk/base/lib/osBindings/Category.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type Category = { name: string } diff --git a/sdk/base/lib/osBindings/ClearActionsParams.ts b/sdk/base/lib/osBindings/ClearActionsParams.ts deleted file mode 100644 index 68cff676a..000000000 --- a/sdk/base/lib/osBindings/ClearActionsParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ActionId } from "./ActionId" - -export type ClearActionsParams = { except: Array } diff --git a/sdk/base/lib/osBindings/ClearBindingsParams.ts b/sdk/base/lib/osBindings/ClearBindingsParams.ts deleted file mode 100644 index 41f1d5741..000000000 --- a/sdk/base/lib/osBindings/ClearBindingsParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BindId } from "./BindId" - -export type ClearBindingsParams = { except: Array } diff --git a/sdk/base/lib/osBindings/ClearCallbacksParams.ts b/sdk/base/lib/osBindings/ClearCallbacksParams.ts deleted file mode 100644 index 095a27f5e..000000000 --- a/sdk/base/lib/osBindings/ClearCallbacksParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ClearCallbacksParams = { only: number[] } | { except: number[] } diff --git a/sdk/base/lib/osBindings/ClearServiceInterfacesParams.ts b/sdk/base/lib/osBindings/ClearServiceInterfacesParams.ts deleted file mode 100644 index 02c177978..000000000 --- a/sdk/base/lib/osBindings/ClearServiceInterfacesParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ServiceInterfaceId } from "./ServiceInterfaceId" - -export type ClearServiceInterfacesParams = { except: Array } diff --git a/sdk/base/lib/osBindings/ClearTasksParams.ts b/sdk/base/lib/osBindings/ClearTasksParams.ts deleted file mode 100644 index 56cd1612c..000000000 --- a/sdk/base/lib/osBindings/ClearTasksParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ClearTasksParams = { only: string[] } | { except: string[] } diff --git a/sdk/base/lib/osBindings/CliSetIconParams.ts b/sdk/base/lib/osBindings/CliSetIconParams.ts deleted file mode 100644 index 4e47362b6..000000000 --- a/sdk/base/lib/osBindings/CliSetIconParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type CliSetIconParams = { icon: string } diff --git a/sdk/base/lib/osBindings/ContactInfo.ts b/sdk/base/lib/osBindings/ContactInfo.ts deleted file mode 100644 index e6d4c13b2..000000000 --- a/sdk/base/lib/osBindings/ContactInfo.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ContactInfo = - | { email: string } - | { matrix: string } - | { website: string } diff --git a/sdk/base/lib/osBindings/CreateSubcontainerFsParams.ts b/sdk/base/lib/osBindings/CreateSubcontainerFsParams.ts deleted file mode 100644 index 32d301e4a..000000000 --- a/sdk/base/lib/osBindings/CreateSubcontainerFsParams.ts +++ /dev/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 { ImageId } from "./ImageId" - -export type CreateSubcontainerFsParams = { - imageId: ImageId - name: string | null -} diff --git a/sdk/base/lib/osBindings/DependencyKind.ts b/sdk/base/lib/osBindings/DependencyKind.ts deleted file mode 100644 index e7021ba16..000000000 --- a/sdk/base/lib/osBindings/DependencyKind.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type DependencyKind = "exists" | "running" diff --git a/sdk/base/lib/osBindings/DestroySubcontainerFsParams.ts b/sdk/base/lib/osBindings/DestroySubcontainerFsParams.ts deleted file mode 100644 index 3f85d2217..000000000 --- a/sdk/base/lib/osBindings/DestroySubcontainerFsParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Guid } from "./Guid" - -export type DestroySubcontainerFsParams = { guid: Guid } diff --git a/sdk/base/lib/osBindings/DomainSettings.ts b/sdk/base/lib/osBindings/DomainSettings.ts deleted file mode 100644 index 276135926..000000000 --- a/sdk/base/lib/osBindings/DomainSettings.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { GatewayId } from "./GatewayId" - -export type DomainSettings = { gateway: GatewayId } diff --git a/sdk/base/lib/osBindings/EchoParams.ts b/sdk/base/lib/osBindings/EchoParams.ts deleted file mode 100644 index 232dfb8ab..000000000 --- a/sdk/base/lib/osBindings/EchoParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type EchoParams = { message: string } diff --git a/sdk/base/lib/osBindings/EditSignerParams.ts b/sdk/base/lib/osBindings/EditSignerParams.ts deleted file mode 100644 index 9532709a6..000000000 --- a/sdk/base/lib/osBindings/EditSignerParams.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AnyVerifyingKey } from "./AnyVerifyingKey" -import type { ContactInfo } from "./ContactInfo" -import type { Guid } from "./Guid" - -export type EditSignerParams = { - id: Guid - setName: string | null - addContact: Array - addKey: Array - removeContact: Array - removeKey: Array -} diff --git a/sdk/base/lib/osBindings/EncryptedWire.ts b/sdk/base/lib/osBindings/EncryptedWire.ts deleted file mode 100644 index 16a2f95b8..000000000 --- a/sdk/base/lib/osBindings/EncryptedWire.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type EncryptedWire = { encrypted: any } diff --git a/sdk/base/lib/osBindings/EventId.ts b/sdk/base/lib/osBindings/EventId.ts deleted file mode 100644 index 4449fb8a3..000000000 --- a/sdk/base/lib/osBindings/EventId.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Guid } from "./Guid" - -export type EventId = { eventId: Guid } diff --git a/sdk/base/lib/osBindings/ExportActionParams.ts b/sdk/base/lib/osBindings/ExportActionParams.ts deleted file mode 100644 index d4aa33102..000000000 --- a/sdk/base/lib/osBindings/ExportActionParams.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ActionId } from "./ActionId" -import type { ActionMetadata } from "./ActionMetadata" - -export type ExportActionParams = { id: ActionId; metadata: ActionMetadata } diff --git a/sdk/base/lib/osBindings/ExportServiceInterfaceParams.ts b/sdk/base/lib/osBindings/ExportServiceInterfaceParams.ts deleted file mode 100644 index 675c3e06d..000000000 --- a/sdk/base/lib/osBindings/ExportServiceInterfaceParams.ts +++ /dev/null @@ -1,13 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AddressInfo } from "./AddressInfo" -import type { ServiceInterfaceId } from "./ServiceInterfaceId" -import type { ServiceInterfaceType } from "./ServiceInterfaceType" - -export type ExportServiceInterfaceParams = { - id: ServiceInterfaceId - name: string - description: string - masked: boolean - addressInfo: AddressInfo - type: ServiceInterfaceType -} diff --git a/sdk/base/lib/osBindings/FileType.ts b/sdk/base/lib/osBindings/FileType.ts deleted file mode 100644 index 85eb97ad6..000000000 --- a/sdk/base/lib/osBindings/FileType.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type FileType = "file" | "directory" | "infer" diff --git a/sdk/base/lib/osBindings/ForgetGatewayParams.ts b/sdk/base/lib/osBindings/ForgetGatewayParams.ts deleted file mode 100644 index 8d43c3a3b..000000000 --- a/sdk/base/lib/osBindings/ForgetGatewayParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { GatewayId } from "./GatewayId" - -export type ForgetGatewayParams = { gateway: GatewayId } diff --git a/sdk/base/lib/osBindings/FullIndex.ts b/sdk/base/lib/osBindings/FullIndex.ts deleted file mode 100644 index c7889760a..000000000 --- a/sdk/base/lib/osBindings/FullIndex.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DataUrl } from "./DataUrl" -import type { Guid } from "./Guid" -import type { OsIndex } from "./OsIndex" -import type { PackageIndex } from "./PackageIndex" -import type { SignerInfo } from "./SignerInfo" - -export type FullIndex = { - name: string | null - icon: DataUrl | null - package: PackageIndex - os: OsIndex - signers: { [key: Guid]: SignerInfo } -} diff --git a/sdk/base/lib/osBindings/GetActionInputParams.ts b/sdk/base/lib/osBindings/GetActionInputParams.ts deleted file mode 100644 index 568ceb907..000000000 --- a/sdk/base/lib/osBindings/GetActionInputParams.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ActionId } from "./ActionId" -import type { PackageId } from "./PackageId" - -export type GetActionInputParams = { packageId?: PackageId; actionId: ActionId } diff --git a/sdk/base/lib/osBindings/GetContainerIpParams.ts b/sdk/base/lib/osBindings/GetContainerIpParams.ts deleted file mode 100644 index 2c84b4960..000000000 --- a/sdk/base/lib/osBindings/GetContainerIpParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CallbackId } from "./CallbackId" -import type { PackageId } from "./PackageId" - -export type GetContainerIpParams = { - packageId?: PackageId - callback?: CallbackId -} diff --git a/sdk/base/lib/osBindings/GetHostInfoParams.ts b/sdk/base/lib/osBindings/GetHostInfoParams.ts deleted file mode 100644 index ff6d9d709..000000000 --- a/sdk/base/lib/osBindings/GetHostInfoParams.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CallbackId } from "./CallbackId" -import type { HostId } from "./HostId" -import type { PackageId } from "./PackageId" - -export type GetHostInfoParams = { - hostId: HostId - packageId?: PackageId - callback?: CallbackId -} diff --git a/sdk/base/lib/osBindings/GetOsAssetParams.ts b/sdk/base/lib/osBindings/GetOsAssetParams.ts deleted file mode 100644 index 100f711c7..000000000 --- a/sdk/base/lib/osBindings/GetOsAssetParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type GetOsAssetParams = { version: string; platform: string } diff --git a/sdk/base/lib/osBindings/GetOsVersionParams.ts b/sdk/base/lib/osBindings/GetOsVersionParams.ts deleted file mode 100644 index 65796eb6c..000000000 --- a/sdk/base/lib/osBindings/GetOsVersionParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type GetOsVersionParams = { - sourceVersion: string | null - targetVersion: string | null - serverId: string | null - platform: string | null -} diff --git a/sdk/base/lib/osBindings/GetPackageParams.ts b/sdk/base/lib/osBindings/GetPackageParams.ts deleted file mode 100644 index 22046d8e9..000000000 --- a/sdk/base/lib/osBindings/GetPackageParams.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageDetailLevel } from "./PackageDetailLevel" -import type { PackageId } from "./PackageId" -import type { Version } from "./Version" - -export type GetPackageParams = { - id: PackageId | null - targetVersion: string | null - sourceVersion: Version | null - otherVersions: PackageDetailLevel -} diff --git a/sdk/base/lib/osBindings/GetPackageResponse.ts b/sdk/base/lib/osBindings/GetPackageResponse.ts deleted file mode 100644 index 3e1dd4e9d..000000000 --- a/sdk/base/lib/osBindings/GetPackageResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageInfoShort } from "./PackageInfoShort" -import type { PackageVersionInfo } from "./PackageVersionInfo" -import type { Version } from "./Version" - -export type GetPackageResponse = { - categories: string[] - best: { [key: Version]: PackageVersionInfo } - otherVersions?: { [key: Version]: PackageInfoShort } -} diff --git a/sdk/base/lib/osBindings/GetPackageResponseFull.ts b/sdk/base/lib/osBindings/GetPackageResponseFull.ts deleted file mode 100644 index e375dd489..000000000 --- a/sdk/base/lib/osBindings/GetPackageResponseFull.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageVersionInfo } from "./PackageVersionInfo" -import type { Version } from "./Version" - -export type GetPackageResponseFull = { - categories: string[] - best: { [key: Version]: PackageVersionInfo } - otherVersions: { [key: Version]: PackageVersionInfo } -} diff --git a/sdk/base/lib/osBindings/GetServiceInterfaceParams.ts b/sdk/base/lib/osBindings/GetServiceInterfaceParams.ts deleted file mode 100644 index b71591e17..000000000 --- a/sdk/base/lib/osBindings/GetServiceInterfaceParams.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CallbackId } from "./CallbackId" -import type { PackageId } from "./PackageId" -import type { ServiceInterfaceId } from "./ServiceInterfaceId" - -export type GetServiceInterfaceParams = { - packageId?: PackageId - serviceInterfaceId: ServiceInterfaceId - callback?: CallbackId -} diff --git a/sdk/base/lib/osBindings/GetServicePortForwardParams.ts b/sdk/base/lib/osBindings/GetServicePortForwardParams.ts deleted file mode 100644 index 63236328e..000000000 --- a/sdk/base/lib/osBindings/GetServicePortForwardParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { HostId } from "./HostId" -import type { PackageId } from "./PackageId" - -export type GetServicePortForwardParams = { - packageId?: PackageId - hostId: HostId - internalPort: number -} diff --git a/sdk/base/lib/osBindings/GetSslCertificateParams.ts b/sdk/base/lib/osBindings/GetSslCertificateParams.ts deleted file mode 100644 index 85c677540..000000000 --- a/sdk/base/lib/osBindings/GetSslCertificateParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Algorithm } from "./Algorithm" -import type { CallbackId } from "./CallbackId" - -export type GetSslCertificateParams = { - hostnames: string[] - algorithm?: Algorithm - callback?: CallbackId -} diff --git a/sdk/base/lib/osBindings/GetSslKeyParams.ts b/sdk/base/lib/osBindings/GetSslKeyParams.ts deleted file mode 100644 index 2ca3076c8..000000000 --- a/sdk/base/lib/osBindings/GetSslKeyParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Algorithm } from "./Algorithm" - -export type GetSslKeyParams = { hostnames: string[]; algorithm?: Algorithm } diff --git a/sdk/base/lib/osBindings/GetStatusParams.ts b/sdk/base/lib/osBindings/GetStatusParams.ts deleted file mode 100644 index a0fbe3bfc..000000000 --- a/sdk/base/lib/osBindings/GetStatusParams.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CallbackId } from "./CallbackId" -import type { PackageId } from "./PackageId" - -export type GetStatusParams = { packageId?: PackageId; callback?: CallbackId } diff --git a/sdk/base/lib/osBindings/GetSystemSmtpParams.ts b/sdk/base/lib/osBindings/GetSystemSmtpParams.ts deleted file mode 100644 index 73b91057c..000000000 --- a/sdk/base/lib/osBindings/GetSystemSmtpParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CallbackId } from "./CallbackId" - -export type GetSystemSmtpParams = { callback: CallbackId | null } diff --git a/sdk/base/lib/osBindings/ImageMetadata.ts b/sdk/base/lib/osBindings/ImageMetadata.ts deleted file mode 100644 index 2222d56e9..000000000 --- a/sdk/base/lib/osBindings/ImageMetadata.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ImageMetadata = { - workdir: string - user: string - entrypoint: Array | null - cmd: Array | null -} diff --git a/sdk/base/lib/osBindings/InitProgressRes.ts b/sdk/base/lib/osBindings/InitProgressRes.ts deleted file mode 100644 index 38caf7bdb..000000000 --- a/sdk/base/lib/osBindings/InitProgressRes.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FullProgress } from "./FullProgress" -import type { Guid } from "./Guid" - -export type InitProgressRes = { progress: FullProgress; guid: Guid } diff --git a/sdk/base/lib/osBindings/InstallParams.ts b/sdk/base/lib/osBindings/InstallParams.ts deleted file mode 100644 index 2b70ad593..000000000 --- a/sdk/base/lib/osBindings/InstallParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageId } from "./PackageId" -import type { Version } from "./Version" - -export type InstallParams = { - registry: string - id: PackageId - version: Version -} diff --git a/sdk/base/lib/osBindings/InstalledVersionParams.ts b/sdk/base/lib/osBindings/InstalledVersionParams.ts deleted file mode 100644 index 637f9b6ce..000000000 --- a/sdk/base/lib/osBindings/InstalledVersionParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageId } from "./PackageId" - -export type InstalledVersionParams = { id: PackageId } diff --git a/sdk/base/lib/osBindings/ListPackageSignersParams.ts b/sdk/base/lib/osBindings/ListPackageSignersParams.ts deleted file mode 100644 index 73cd6a745..000000000 --- a/sdk/base/lib/osBindings/ListPackageSignersParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageId } from "./PackageId" - -export type ListPackageSignersParams = { id: PackageId } diff --git a/sdk/base/lib/osBindings/ListServiceInterfacesParams.ts b/sdk/base/lib/osBindings/ListServiceInterfacesParams.ts deleted file mode 100644 index fd27ace2b..000000000 --- a/sdk/base/lib/osBindings/ListServiceInterfacesParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { CallbackId } from "./CallbackId" -import type { PackageId } from "./PackageId" - -export type ListServiceInterfacesParams = { - packageId?: PackageId - callback?: CallbackId -} diff --git a/sdk/base/lib/osBindings/ListVersionSignersParams.ts b/sdk/base/lib/osBindings/ListVersionSignersParams.ts deleted file mode 100644 index baf516bf2..000000000 --- a/sdk/base/lib/osBindings/ListVersionSignersParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ListVersionSignersParams = { version: string } diff --git a/sdk/base/lib/osBindings/LoginParams.ts b/sdk/base/lib/osBindings/LoginParams.ts deleted file mode 100644 index 2a907ad6f..000000000 --- a/sdk/base/lib/osBindings/LoginParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type LoginParams = { password: string; ephemeral: boolean } diff --git a/sdk/base/lib/osBindings/MaybeUtf8String.ts b/sdk/base/lib/osBindings/MaybeUtf8String.ts deleted file mode 100644 index 9532e9b97..000000000 --- a/sdk/base/lib/osBindings/MaybeUtf8String.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type MaybeUtf8String = string | number[] diff --git a/sdk/base/lib/osBindings/MerkleArchiveCommitment.ts b/sdk/base/lib/osBindings/MerkleArchiveCommitment.ts deleted file mode 100644 index 5dcaa0aa3..000000000 --- a/sdk/base/lib/osBindings/MerkleArchiveCommitment.ts +++ /dev/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 { Base64 } from "./Base64" - -export type MerkleArchiveCommitment = { - rootSighash: Base64 - rootMaxsize: number -} diff --git a/sdk/base/lib/osBindings/Metrics.ts b/sdk/base/lib/osBindings/Metrics.ts deleted file mode 100644 index 7a4be1648..000000000 --- a/sdk/base/lib/osBindings/Metrics.ts +++ /dev/null @@ -1,12 +0,0 @@ -// 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 -} diff --git a/sdk/base/lib/osBindings/MetricsCpu.ts b/sdk/base/lib/osBindings/MetricsCpu.ts deleted file mode 100644 index 3576bd8c0..000000000 --- a/sdk/base/lib/osBindings/MetricsCpu.ts +++ /dev/null @@ -1,10 +0,0 @@ -// 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 -} diff --git a/sdk/base/lib/osBindings/MetricsDisk.ts b/sdk/base/lib/osBindings/MetricsDisk.ts deleted file mode 100644 index 2085b780d..000000000 --- a/sdk/base/lib/osBindings/MetricsDisk.ts +++ /dev/null @@ -1,10 +0,0 @@ -// 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 -} diff --git a/sdk/base/lib/osBindings/MetricsGeneral.ts b/sdk/base/lib/osBindings/MetricsGeneral.ts deleted file mode 100644 index 9376e12ee..000000000 --- a/sdk/base/lib/osBindings/MetricsGeneral.ts +++ /dev/null @@ -1,4 +0,0 @@ -// 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 } diff --git a/sdk/base/lib/osBindings/MetricsMemory.ts b/sdk/base/lib/osBindings/MetricsMemory.ts deleted file mode 100644 index 36c576757..000000000 --- a/sdk/base/lib/osBindings/MetricsMemory.ts +++ /dev/null @@ -1,13 +0,0 @@ -// 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 -} diff --git a/sdk/base/lib/osBindings/MountParams.ts b/sdk/base/lib/osBindings/MountParams.ts deleted file mode 100644 index 778983fd6..000000000 --- a/sdk/base/lib/osBindings/MountParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { MountTarget } from "./MountTarget" - -export type MountParams = { location: string; target: MountTarget } diff --git a/sdk/base/lib/osBindings/MountTarget.ts b/sdk/base/lib/osBindings/MountTarget.ts deleted file mode 100644 index 456f17052..000000000 --- a/sdk/base/lib/osBindings/MountTarget.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FileType } from "./FileType" -import type { PackageId } from "./PackageId" -import type { VolumeId } from "./VolumeId" - -export type MountTarget = { - packageId: PackageId - volumeId: VolumeId - subpath: string | null - readonly: boolean - filetype: FileType -} diff --git a/sdk/base/lib/osBindings/NetworkInterfaceSetPublicParams.ts b/sdk/base/lib/osBindings/NetworkInterfaceSetPublicParams.ts deleted file mode 100644 index c81719031..000000000 --- a/sdk/base/lib/osBindings/NetworkInterfaceSetPublicParams.ts +++ /dev/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 { GatewayId } from "./GatewayId" - -export type NetworkInterfaceSetPublicParams = { - gateway: GatewayId - public: boolean | null -} diff --git a/sdk/base/lib/osBindings/OsIndex.ts b/sdk/base/lib/osBindings/OsIndex.ts deleted file mode 100644 index fe9a4e395..000000000 --- a/sdk/base/lib/osBindings/OsIndex.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { OsVersionInfoMap } from "./OsVersionInfoMap" - -export type OsIndex = { versions: OsVersionInfoMap } diff --git a/sdk/base/lib/osBindings/OsVersionInfo.ts b/sdk/base/lib/osBindings/OsVersionInfo.ts deleted file mode 100644 index a88115350..000000000 --- a/sdk/base/lib/osBindings/OsVersionInfo.ts +++ /dev/null @@ -1,14 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Blake3Commitment } from "./Blake3Commitment" -import type { Guid } from "./Guid" -import type { RegistryAsset } from "./RegistryAsset" - -export type OsVersionInfo = { - headline: string - releaseNotes: string - sourceVersion: string - authorized: Array - iso: { [key: string]: RegistryAsset } - squashfs: { [key: string]: RegistryAsset } - img: { [key: string]: RegistryAsset } -} diff --git a/sdk/base/lib/osBindings/OsVersionInfoMap.ts b/sdk/base/lib/osBindings/OsVersionInfoMap.ts deleted file mode 100644 index 6f333f1fb..000000000 --- a/sdk/base/lib/osBindings/OsVersionInfoMap.ts +++ /dev/null @@ -1,4 +0,0 @@ -// 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 } diff --git a/sdk/base/lib/osBindings/PackageDetailLevel.ts b/sdk/base/lib/osBindings/PackageDetailLevel.ts deleted file mode 100644 index f2016f632..000000000 --- a/sdk/base/lib/osBindings/PackageDetailLevel.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type PackageDetailLevel = "none" | "short" | "full" diff --git a/sdk/base/lib/osBindings/PackageIndex.ts b/sdk/base/lib/osBindings/PackageIndex.ts deleted file mode 100644 index 5e8c94945..000000000 --- a/sdk/base/lib/osBindings/PackageIndex.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Category } from "./Category" -import type { PackageId } from "./PackageId" -import type { PackageInfo } from "./PackageInfo" - -export type PackageIndex = { - categories: { [key: string]: Category } - packages: { [key: PackageId]: PackageInfo } -} diff --git a/sdk/base/lib/osBindings/PackageInfo.ts b/sdk/base/lib/osBindings/PackageInfo.ts deleted file mode 100644 index 6d07cd43e..000000000 --- a/sdk/base/lib/osBindings/PackageInfo.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Guid } from "./Guid" -import type { PackageVersionInfo } from "./PackageVersionInfo" -import type { Version } from "./Version" - -export type PackageInfo = { - authorized: Array - versions: { [key: Version]: PackageVersionInfo } - categories: string[] -} diff --git a/sdk/base/lib/osBindings/PackageInfoShort.ts b/sdk/base/lib/osBindings/PackageInfoShort.ts deleted file mode 100644 index 22c7fbea4..000000000 --- a/sdk/base/lib/osBindings/PackageInfoShort.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type PackageInfoShort = { releaseNotes: string } diff --git a/sdk/base/lib/osBindings/PackageSignerParams.ts b/sdk/base/lib/osBindings/PackageSignerParams.ts deleted file mode 100644 index b131e3e23..000000000 --- a/sdk/base/lib/osBindings/PackageSignerParams.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Guid } from "./Guid" -import type { PackageId } from "./PackageId" - -export type PackageSignerParams = { id: PackageId; signer: Guid } diff --git a/sdk/base/lib/osBindings/PasswordType.ts b/sdk/base/lib/osBindings/PasswordType.ts deleted file mode 100644 index 7fdcc0f5d..000000000 --- a/sdk/base/lib/osBindings/PasswordType.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EncryptedWire } from "./EncryptedWire" - -export type PasswordType = EncryptedWire | string diff --git a/sdk/base/lib/osBindings/Percentage.ts b/sdk/base/lib/osBindings/Percentage.ts deleted file mode 100644 index aff21db40..000000000 --- a/sdk/base/lib/osBindings/Percentage.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type Percentage = number diff --git a/sdk/base/lib/osBindings/RecoverySource.ts b/sdk/base/lib/osBindings/RecoverySource.ts deleted file mode 100644 index 40061f215..000000000 --- a/sdk/base/lib/osBindings/RecoverySource.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { BackupTargetFS } from "./BackupTargetFS" - -export type RecoverySource = - | { type: "migrate"; guid: string } - | { - type: "backup" - target: BackupTargetFS - password: Password - serverId: string - } diff --git a/sdk/base/lib/osBindings/RegistryAsset.ts b/sdk/base/lib/osBindings/RegistryAsset.ts deleted file mode 100644 index 41f09431f..000000000 --- a/sdk/base/lib/osBindings/RegistryAsset.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AnySignature } from "./AnySignature" -import type { AnyVerifyingKey } from "./AnyVerifyingKey" - -export type RegistryAsset = { - publishedAt: string - url: string - commitment: Commitment - signatures: { [key: AnyVerifyingKey]: AnySignature } -} diff --git a/sdk/base/lib/osBindings/RegistryInfo.ts b/sdk/base/lib/osBindings/RegistryInfo.ts deleted file mode 100644 index f9265fdec..000000000 --- a/sdk/base/lib/osBindings/RegistryInfo.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Category } from "./Category" -import type { DataUrl } from "./DataUrl" - -export type RegistryInfo = { - name: string | null - icon: DataUrl | null - categories: { [key: string]: Category } -} diff --git a/sdk/base/lib/osBindings/RemoveAdminParams.ts b/sdk/base/lib/osBindings/RemoveAdminParams.ts deleted file mode 100644 index 80ca0e823..000000000 --- a/sdk/base/lib/osBindings/RemoveAdminParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Guid } from "./Guid" - -export type RemoveAdminParams = { signer: Guid } diff --git a/sdk/base/lib/osBindings/RemoveAssetParams.ts b/sdk/base/lib/osBindings/RemoveAssetParams.ts deleted file mode 100644 index 220c2f3b0..000000000 --- a/sdk/base/lib/osBindings/RemoveAssetParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type RemoveAssetParams = { version: string; platform: string } diff --git a/sdk/base/lib/osBindings/RemoveCategoryParams.ts b/sdk/base/lib/osBindings/RemoveCategoryParams.ts deleted file mode 100644 index 4f468fee7..000000000 --- a/sdk/base/lib/osBindings/RemoveCategoryParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type RemoveCategoryParams = { id: string } diff --git a/sdk/base/lib/osBindings/RemovePackageFromCategoryParams.ts b/sdk/base/lib/osBindings/RemovePackageFromCategoryParams.ts deleted file mode 100644 index c12dc6002..000000000 --- a/sdk/base/lib/osBindings/RemovePackageFromCategoryParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageId } from "./PackageId" - -export type RemovePackageFromCategoryParams = { id: string; package: PackageId } diff --git a/sdk/base/lib/osBindings/RemovePackageParams.ts b/sdk/base/lib/osBindings/RemovePackageParams.ts deleted file mode 100644 index aee8d50f2..000000000 --- a/sdk/base/lib/osBindings/RemovePackageParams.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { PackageId } from "./PackageId" -import type { Version } from "./Version" - -export type RemovePackageParams = { id: PackageId; version: Version } diff --git a/sdk/base/lib/osBindings/RemoveTunnelParams.ts b/sdk/base/lib/osBindings/RemoveTunnelParams.ts deleted file mode 100644 index 67c7b08c5..000000000 --- a/sdk/base/lib/osBindings/RemoveTunnelParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { GatewayId } from "./GatewayId" - -export type RemoveTunnelParams = { id: GatewayId } diff --git a/sdk/base/lib/osBindings/RemoveVersionParams.ts b/sdk/base/lib/osBindings/RemoveVersionParams.ts deleted file mode 100644 index 2c974de56..000000000 --- a/sdk/base/lib/osBindings/RemoveVersionParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type RemoveVersionParams = { version: string } diff --git a/sdk/base/lib/osBindings/RenameGatewayParams.ts b/sdk/base/lib/osBindings/RenameGatewayParams.ts deleted file mode 100644 index 5c282e683..000000000 --- a/sdk/base/lib/osBindings/RenameGatewayParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { GatewayId } from "./GatewayId" - -export type RenameGatewayParams = { id: GatewayId; name: string } diff --git a/sdk/base/lib/osBindings/RequestCommitment.ts b/sdk/base/lib/osBindings/RequestCommitment.ts deleted file mode 100644 index 89df04e4a..000000000 --- a/sdk/base/lib/osBindings/RequestCommitment.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Base64 } from "./Base64" - -export type RequestCommitment = { - timestamp: number - nonce: number - size: number - blake3: Base64 -} diff --git a/sdk/base/lib/osBindings/RunActionParams.ts b/sdk/base/lib/osBindings/RunActionParams.ts deleted file mode 100644 index 33864d1e6..000000000 --- a/sdk/base/lib/osBindings/RunActionParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ActionId } from "./ActionId" -import type { PackageId } from "./PackageId" - -export type RunActionParams = { - packageId?: PackageId - actionId: ActionId - input: any -} diff --git a/sdk/base/lib/osBindings/ServerSpecs.ts b/sdk/base/lib/osBindings/ServerSpecs.ts deleted file mode 100644 index c736ca5c8..000000000 --- a/sdk/base/lib/osBindings/ServerSpecs.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type ServerSpecs = { cpu: string; disk: string; memory: string } diff --git a/sdk/base/lib/osBindings/SessionList.ts b/sdk/base/lib/osBindings/SessionList.ts deleted file mode 100644 index af36aaa8a..000000000 --- a/sdk/base/lib/osBindings/SessionList.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Sessions } from "./Sessions" - -export type SessionList = { current: string | null; sessions: Sessions } diff --git a/sdk/base/lib/osBindings/SetDataVersionParams.ts b/sdk/base/lib/osBindings/SetDataVersionParams.ts deleted file mode 100644 index 3b577d2b1..000000000 --- a/sdk/base/lib/osBindings/SetDataVersionParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type SetDataVersionParams = { version: string } diff --git a/sdk/base/lib/osBindings/SetDependenciesParams.ts b/sdk/base/lib/osBindings/SetDependenciesParams.ts deleted file mode 100644 index 7b34b50c9..000000000 --- a/sdk/base/lib/osBindings/SetDependenciesParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DependencyRequirement } from "./DependencyRequirement" - -export type SetDependenciesParams = { - dependencies: Array -} diff --git a/sdk/base/lib/osBindings/SetIconParams.ts b/sdk/base/lib/osBindings/SetIconParams.ts deleted file mode 100644 index f10eaa50b..000000000 --- a/sdk/base/lib/osBindings/SetIconParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DataUrl } from "./DataUrl" - -export type SetIconParams = { icon: DataUrl } diff --git a/sdk/base/lib/osBindings/SetMainStatus.ts b/sdk/base/lib/osBindings/SetMainStatus.ts deleted file mode 100644 index 6dcca73e9..000000000 --- a/sdk/base/lib/osBindings/SetMainStatus.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { SetMainStatusStatus } from "./SetMainStatusStatus" - -export type SetMainStatus = { status: SetMainStatusStatus } diff --git a/sdk/base/lib/osBindings/SetMainStatusStatus.ts b/sdk/base/lib/osBindings/SetMainStatusStatus.ts deleted file mode 100644 index 03bb4a119..000000000 --- a/sdk/base/lib/osBindings/SetMainStatusStatus.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type SetMainStatusStatus = "running" | "stopped" diff --git a/sdk/base/lib/osBindings/SetNameParams.ts b/sdk/base/lib/osBindings/SetNameParams.ts deleted file mode 100644 index df49d7be5..000000000 --- a/sdk/base/lib/osBindings/SetNameParams.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type SetNameParams = { name: string } diff --git a/sdk/base/lib/osBindings/SetupExecuteParams.ts b/sdk/base/lib/osBindings/SetupExecuteParams.ts deleted file mode 100644 index 289836d78..000000000 --- a/sdk/base/lib/osBindings/SetupExecuteParams.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EncryptedWire } from "./EncryptedWire" -import type { RecoverySource } from "./RecoverySource" - -export type SetupExecuteParams = { - startOsLogicalname: string - startOsPassword: EncryptedWire - recoverySource: RecoverySource | null - kiosk?: boolean -} diff --git a/sdk/base/lib/osBindings/SetupProgress.ts b/sdk/base/lib/osBindings/SetupProgress.ts deleted file mode 100644 index 845636da3..000000000 --- a/sdk/base/lib/osBindings/SetupProgress.ts +++ /dev/null @@ -1,5 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { FullProgress } from "./FullProgress" -import type { Guid } from "./Guid" - -export type SetupProgress = { progress: FullProgress; guid: Guid } diff --git a/sdk/base/lib/osBindings/SetupResult.ts b/sdk/base/lib/osBindings/SetupResult.ts deleted file mode 100644 index 3147187c1..000000000 --- a/sdk/base/lib/osBindings/SetupResult.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type SetupResult = { - torAddresses: Array - hostname: string - lanAddress: string - rootCa: string -} diff --git a/sdk/base/lib/osBindings/SetupStatusRes.ts b/sdk/base/lib/osBindings/SetupStatusRes.ts deleted file mode 100644 index 93d10c59b..000000000 --- a/sdk/base/lib/osBindings/SetupStatusRes.ts +++ /dev/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 { SetupProgress } from "./SetupProgress" -import type { SetupResult } from "./SetupResult" - -export type SetupStatusRes = - | ({ status: "complete" } & SetupResult) - | ({ status: "running" } & SetupProgress) diff --git a/sdk/base/lib/osBindings/SignAssetParams.ts b/sdk/base/lib/osBindings/SignAssetParams.ts deleted file mode 100644 index 39f54ad69..000000000 --- a/sdk/base/lib/osBindings/SignAssetParams.ts +++ /dev/null @@ -1,8 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { AnySignature } from "./AnySignature" - -export type SignAssetParams = { - version: string - platform: string - signature: AnySignature -} diff --git a/sdk/base/lib/osBindings/TestSmtpParams.ts b/sdk/base/lib/osBindings/TestSmtpParams.ts deleted file mode 100644 index e2d175f36..000000000 --- a/sdk/base/lib/osBindings/TestSmtpParams.ts +++ /dev/null @@ -1,10 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type TestSmtpParams = { - server: string - port: number - from: string - to: string - login: string - password: string -} diff --git a/sdk/base/lib/osBindings/UnsetPublicParams.ts b/sdk/base/lib/osBindings/UnsetPublicParams.ts deleted file mode 100644 index 1e0673fd4..000000000 --- a/sdk/base/lib/osBindings/UnsetPublicParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { GatewayId } from "./GatewayId" - -export type UnsetPublicParams = { gateway: GatewayId } diff --git a/sdk/base/lib/osBindings/VerifyCifsParams.ts b/sdk/base/lib/osBindings/VerifyCifsParams.ts deleted file mode 100644 index 407e6caaa..000000000 --- a/sdk/base/lib/osBindings/VerifyCifsParams.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { EncryptedWire } from "./EncryptedWire" - -export type VerifyCifsParams = { - hostname: string - path: string - username: string - password: EncryptedWire | null -} diff --git a/sdk/base/lib/osBindings/VersionSignerParams.ts b/sdk/base/lib/osBindings/VersionSignerParams.ts deleted file mode 100644 index 781e2a4df..000000000 --- a/sdk/base/lib/osBindings/VersionSignerParams.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { Guid } from "./Guid" - -export type VersionSignerParams = { version: string; signer: Guid } diff --git a/sdk/base/lib/osBindings/ActionId.ts b/sdk/base/lib/osBindings/action/ActionId.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionId.ts rename to sdk/base/lib/osBindings/action/ActionId.ts diff --git a/sdk/base/lib/osBindings/ActionInput.ts b/sdk/base/lib/osBindings/action/ActionInput.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionInput.ts rename to sdk/base/lib/osBindings/action/ActionInput.ts diff --git a/sdk/base/lib/osBindings/ActionMetadata.ts b/sdk/base/lib/osBindings/action/ActionMetadata.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionMetadata.ts rename to sdk/base/lib/osBindings/action/ActionMetadata.ts diff --git a/sdk/base/lib/osBindings/ActionResult.ts b/sdk/base/lib/osBindings/action/ActionResult.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionResult.ts rename to sdk/base/lib/osBindings/action/ActionResult.ts diff --git a/sdk/base/lib/osBindings/ActionResultMember.ts b/sdk/base/lib/osBindings/action/ActionResultMember.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionResultMember.ts rename to sdk/base/lib/osBindings/action/ActionResultMember.ts diff --git a/sdk/base/lib/osBindings/ActionResultV0.ts b/sdk/base/lib/osBindings/action/ActionResultV0.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionResultV0.ts rename to sdk/base/lib/osBindings/action/ActionResultV0.ts diff --git a/sdk/base/lib/osBindings/ActionResultV1.ts b/sdk/base/lib/osBindings/action/ActionResultV1.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionResultV1.ts rename to sdk/base/lib/osBindings/action/ActionResultV1.ts diff --git a/sdk/base/lib/osBindings/ActionResultValue.ts b/sdk/base/lib/osBindings/action/ActionResultValue.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionResultValue.ts rename to sdk/base/lib/osBindings/action/ActionResultValue.ts diff --git a/sdk/base/lib/osBindings/ActionVisibility.ts b/sdk/base/lib/osBindings/action/ActionVisibility.ts similarity index 100% rename from sdk/base/lib/osBindings/ActionVisibility.ts rename to sdk/base/lib/osBindings/action/ActionVisibility.ts diff --git a/sdk/base/lib/osBindings/AllowedStatuses.ts b/sdk/base/lib/osBindings/action/AllowedStatuses.ts similarity index 100% rename from sdk/base/lib/osBindings/AllowedStatuses.ts rename to sdk/base/lib/osBindings/action/AllowedStatuses.ts diff --git a/sdk/base/lib/osBindings/Guid.ts b/sdk/base/lib/osBindings/action/Guid.ts similarity index 100% rename from sdk/base/lib/osBindings/Guid.ts rename to sdk/base/lib/osBindings/action/Guid.ts diff --git a/sdk/base/lib/osBindings/PackageId.ts b/sdk/base/lib/osBindings/action/PackageId.ts similarity index 100% rename from sdk/base/lib/osBindings/PackageId.ts rename to sdk/base/lib/osBindings/action/PackageId.ts diff --git a/sdk/base/lib/osBindings/Task.ts b/sdk/base/lib/osBindings/action/Task.ts similarity index 100% rename from sdk/base/lib/osBindings/Task.ts rename to sdk/base/lib/osBindings/action/Task.ts diff --git a/sdk/base/lib/osBindings/TaskCondition.ts b/sdk/base/lib/osBindings/action/TaskCondition.ts similarity index 100% rename from sdk/base/lib/osBindings/TaskCondition.ts rename to sdk/base/lib/osBindings/action/TaskCondition.ts diff --git a/sdk/base/lib/osBindings/TaskInput.ts b/sdk/base/lib/osBindings/action/TaskInput.ts similarity index 100% rename from sdk/base/lib/osBindings/TaskInput.ts rename to sdk/base/lib/osBindings/action/TaskInput.ts diff --git a/sdk/base/lib/osBindings/TaskSeverity.ts b/sdk/base/lib/osBindings/action/TaskSeverity.ts similarity index 100% rename from sdk/base/lib/osBindings/TaskSeverity.ts rename to sdk/base/lib/osBindings/action/TaskSeverity.ts diff --git a/sdk/base/lib/osBindings/TaskTrigger.ts b/sdk/base/lib/osBindings/action/TaskTrigger.ts similarity index 100% rename from sdk/base/lib/osBindings/TaskTrigger.ts rename to sdk/base/lib/osBindings/action/TaskTrigger.ts diff --git a/sdk/base/lib/osBindings/action/index.ts b/sdk/base/lib/osBindings/action/index.ts new file mode 100644 index 000000000..f58f9aa5b --- /dev/null +++ b/sdk/base/lib/osBindings/action/index.ts @@ -0,0 +1,17 @@ +export * from "./ActionId" +export * from "./ActionInput" +export * from "./Guid" +export * from "./ActionResult" +export * from "./ActionResultV1" +export * from "./ActionResultValue" +export * from "./ActionResultMember" +export * from "./ActionResultV0" +export * from "./ActionMetadata" +export * from "./ActionVisibility" +export * from "./AllowedStatuses" +export * from "./Task" +export * from "./TaskSeverity" +export * from "./TaskTrigger" +export * from "./TaskCondition" +export * from "./TaskInput" +export * from "./PackageId" diff --git a/sdk/base/lib/osBindings/api-helpers.ts b/sdk/base/lib/osBindings/api-helpers.ts new file mode 100644 index 000000000..3d0ca8f49 --- /dev/null +++ b/sdk/base/lib/osBindings/api-helpers.ts @@ -0,0 +1,41 @@ +export type RpcHandler = ParentHandler | LeafHandler + +export type ParentHandler = { + _CHILDREN: { + [name: string]: RpcHandler + } + _PARAMS: unknown + _RETURN?: unknown +} + +export type LeafHandler = { + _PARAMS: unknown + _RETURN: unknown +} + +export type RpcParamType< + Root extends RpcHandler, + Method extends string, +> = Root["_PARAMS"] & + (Root extends ParentHandler + ? Method extends `${infer A}.${infer B}` + ? RpcParamType + : Root["_CHILDREN"] extends { + [m in Method]: LeafHandler + } + ? Root["_CHILDREN"][Method]["_PARAMS"] + : never + : never) + +export type RpcReturnType< + Root extends RpcHandler, + Method extends string, +> = Root extends ParentHandler + ? Method extends `${infer A}.${infer B}` + ? RpcReturnType + : Root["_CHILDREN"] extends { + [m in Method]: LeafHandler + } + ? Root["_CHILDREN"][Method]["_RETURN"] + : never + : never diff --git a/sdk/base/lib/osBindings/database/index.ts b/sdk/base/lib/osBindings/database/index.ts new file mode 100644 index 000000000..1bd1d3ad8 --- /dev/null +++ b/sdk/base/lib/osBindings/database/index.ts @@ -0,0 +1,2 @@ +export * as startos from "./startos" +export * as tunnel from "./tunnel" diff --git a/sdk/base/lib/osBindings/AcmeProvider.ts b/sdk/base/lib/osBindings/database/startos/AcmeProvider.ts similarity index 100% rename from sdk/base/lib/osBindings/AcmeProvider.ts rename to sdk/base/lib/osBindings/database/startos/AcmeProvider.ts diff --git a/sdk/base/lib/osBindings/AcmeSettings.ts b/sdk/base/lib/osBindings/database/startos/AcmeSettings.ts similarity index 100% rename from sdk/base/lib/osBindings/AcmeSettings.ts rename to sdk/base/lib/osBindings/database/startos/AcmeSettings.ts diff --git a/sdk/base/lib/osBindings/Duration.ts b/sdk/base/lib/osBindings/database/startos/ActionId.ts similarity index 78% rename from sdk/base/lib/osBindings/Duration.ts rename to sdk/base/lib/osBindings/database/startos/ActionId.ts index b44758a28..ebfaba49e 100644 --- a/sdk/base/lib/osBindings/Duration.ts +++ b/sdk/base/lib/osBindings/database/startos/ActionId.ts @@ -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 Duration = string +export type ActionId = string diff --git a/sdk/base/lib/osBindings/database/startos/ActionMetadata.ts b/sdk/base/lib/osBindings/database/startos/ActionMetadata.ts new file mode 100644 index 000000000..01809ab57 --- /dev/null +++ b/sdk/base/lib/osBindings/database/startos/ActionMetadata.ts @@ -0,0 +1,37 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ActionVisibility } from "./ActionVisibility" +import type { AllowedStatuses } from "./AllowedStatuses" + +export type ActionMetadata = { + /** + * A human-readable name + */ + name: string + /** + * A detailed description of what the action will do + */ + description: string + /** + * Presents as an alert prior to executing the action. Should be used sparingly but important if the action could have harmful, unintended consequences + */ + warning: string | null + /** + * One of: "enabled", "hidden", or { disabled: "" } + * - "enabled" - the action is available be run + * - "hidden" - the action cannot be seen or run + * - { disabled: "example explanation" } means the action is visible but cannot be run. Replace "example explanation" with a reason why the action is disable to prevent user confusion. + */ + visibility: ActionVisibility + /** + * One of: "only-stopped", "only-running", "all" + * - "only-stopped" - the action can only be run when the service is stopped + * - "only-running" - the action can only be run when the service is running + * - "any" - the action can only be run regardless of the service's status + */ + allowedStatuses: AllowedStatuses + hasInput: boolean + /** + * If provided, this action will be nested under a header of this value, along with other actions of the same group + */ + group: string | null +} diff --git a/sdk/base/lib/osBindings/database/startos/ActionVisibility.ts b/sdk/base/lib/osBindings/database/startos/ActionVisibility.ts new file mode 100644 index 000000000..ab1e6e1b9 --- /dev/null +++ b/sdk/base/lib/osBindings/database/startos/ActionVisibility.ts @@ -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 ActionVisibility = "hidden" | { disabled: string } | "enabled" diff --git a/sdk/base/lib/osBindings/AddSslOptions.ts b/sdk/base/lib/osBindings/database/startos/AddSslOptions.ts similarity index 100% rename from sdk/base/lib/osBindings/AddSslOptions.ts rename to sdk/base/lib/osBindings/database/startos/AddSslOptions.ts diff --git a/sdk/base/lib/osBindings/AddressInfo.ts b/sdk/base/lib/osBindings/database/startos/AddressInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/AddressInfo.ts rename to sdk/base/lib/osBindings/database/startos/AddressInfo.ts diff --git a/sdk/base/lib/osBindings/Alerts.ts b/sdk/base/lib/osBindings/database/startos/Alerts.ts similarity index 100% rename from sdk/base/lib/osBindings/Alerts.ts rename to sdk/base/lib/osBindings/database/startos/Alerts.ts diff --git a/sdk/base/lib/osBindings/AllPackageData.ts b/sdk/base/lib/osBindings/database/startos/AllPackageData.ts similarity index 100% rename from sdk/base/lib/osBindings/AllPackageData.ts rename to sdk/base/lib/osBindings/database/startos/AllPackageData.ts diff --git a/sdk/base/lib/osBindings/database/startos/AllowedStatuses.ts b/sdk/base/lib/osBindings/database/startos/AllowedStatuses.ts new file mode 100644 index 000000000..ed5851495 --- /dev/null +++ b/sdk/base/lib/osBindings/database/startos/AllowedStatuses.ts @@ -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 AllowedStatuses = "only-running" | "only-stopped" | "any" diff --git a/sdk/base/lib/osBindings/AlpnInfo.ts b/sdk/base/lib/osBindings/database/startos/AlpnInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/AlpnInfo.ts rename to sdk/base/lib/osBindings/database/startos/AlpnInfo.ts diff --git a/sdk/base/lib/osBindings/BackupProgress.ts b/sdk/base/lib/osBindings/database/startos/BackupProgress.ts similarity index 100% rename from sdk/base/lib/osBindings/BackupProgress.ts rename to sdk/base/lib/osBindings/database/startos/BackupProgress.ts diff --git a/sdk/base/lib/osBindings/BindInfo.ts b/sdk/base/lib/osBindings/database/startos/BindInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/BindInfo.ts rename to sdk/base/lib/osBindings/database/startos/BindInfo.ts diff --git a/sdk/base/lib/osBindings/BindOptions.ts b/sdk/base/lib/osBindings/database/startos/BindOptions.ts similarity index 100% rename from sdk/base/lib/osBindings/BindOptions.ts rename to sdk/base/lib/osBindings/database/startos/BindOptions.ts diff --git a/sdk/base/lib/osBindings/BuildArg.ts b/sdk/base/lib/osBindings/database/startos/BuildArg.ts similarity index 100% rename from sdk/base/lib/osBindings/BuildArg.ts rename to sdk/base/lib/osBindings/database/startos/BuildArg.ts diff --git a/sdk/base/lib/osBindings/CurrentDependencies.ts b/sdk/base/lib/osBindings/database/startos/CurrentDependencies.ts similarity index 100% rename from sdk/base/lib/osBindings/CurrentDependencies.ts rename to sdk/base/lib/osBindings/database/startos/CurrentDependencies.ts diff --git a/sdk/base/lib/osBindings/CurrentDependencyInfo.ts b/sdk/base/lib/osBindings/database/startos/CurrentDependencyInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/CurrentDependencyInfo.ts rename to sdk/base/lib/osBindings/database/startos/CurrentDependencyInfo.ts diff --git a/sdk/base/lib/osBindings/DataUrl.ts b/sdk/base/lib/osBindings/database/startos/DataUrl.ts similarity index 100% rename from sdk/base/lib/osBindings/DataUrl.ts rename to sdk/base/lib/osBindings/database/startos/DataUrl.ts diff --git a/sdk/base/lib/osBindings/DepInfo.ts b/sdk/base/lib/osBindings/database/startos/DepInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/DepInfo.ts rename to sdk/base/lib/osBindings/database/startos/DepInfo.ts diff --git a/sdk/base/lib/osBindings/Dependencies.ts b/sdk/base/lib/osBindings/database/startos/Dependencies.ts similarity index 100% rename from sdk/base/lib/osBindings/Dependencies.ts rename to sdk/base/lib/osBindings/database/startos/Dependencies.ts diff --git a/sdk/base/lib/osBindings/Description.ts b/sdk/base/lib/osBindings/database/startos/Description.ts similarity index 100% rename from sdk/base/lib/osBindings/Description.ts rename to sdk/base/lib/osBindings/database/startos/Description.ts diff --git a/sdk/base/lib/osBindings/DeviceFilter.ts b/sdk/base/lib/osBindings/database/startos/DeviceFilter.ts similarity index 100% rename from sdk/base/lib/osBindings/DeviceFilter.ts rename to sdk/base/lib/osBindings/database/startos/DeviceFilter.ts diff --git a/sdk/base/lib/osBindings/DnsSettings.ts b/sdk/base/lib/osBindings/database/startos/DnsSettings.ts similarity index 100% rename from sdk/base/lib/osBindings/DnsSettings.ts rename to sdk/base/lib/osBindings/database/startos/DnsSettings.ts diff --git a/sdk/base/lib/osBindings/FullProgress.ts b/sdk/base/lib/osBindings/database/startos/FullProgress.ts similarity index 100% rename from sdk/base/lib/osBindings/FullProgress.ts rename to sdk/base/lib/osBindings/database/startos/FullProgress.ts diff --git a/sdk/base/lib/osBindings/GatewayId.ts b/sdk/base/lib/osBindings/database/startos/GatewayId.ts similarity index 100% rename from sdk/base/lib/osBindings/GatewayId.ts rename to sdk/base/lib/osBindings/database/startos/GatewayId.ts diff --git a/sdk/base/lib/osBindings/GatewayInfo.ts b/sdk/base/lib/osBindings/database/startos/GatewayInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/GatewayInfo.ts rename to sdk/base/lib/osBindings/database/startos/GatewayInfo.ts diff --git a/sdk/base/lib/osBindings/GitHash.ts b/sdk/base/lib/osBindings/database/startos/GitHash.ts similarity index 100% rename from sdk/base/lib/osBindings/GitHash.ts rename to sdk/base/lib/osBindings/database/startos/GitHash.ts diff --git a/sdk/base/lib/osBindings/Governor.ts b/sdk/base/lib/osBindings/database/startos/Governor.ts similarity index 100% rename from sdk/base/lib/osBindings/Governor.ts rename to sdk/base/lib/osBindings/database/startos/Governor.ts diff --git a/sdk/base/lib/osBindings/HardwareRequirements.ts b/sdk/base/lib/osBindings/database/startos/HardwareRequirements.ts similarity index 100% rename from sdk/base/lib/osBindings/HardwareRequirements.ts rename to sdk/base/lib/osBindings/database/startos/HardwareRequirements.ts diff --git a/sdk/base/lib/osBindings/HealthCheckId.ts b/sdk/base/lib/osBindings/database/startos/HealthCheckId.ts similarity index 100% rename from sdk/base/lib/osBindings/HealthCheckId.ts rename to sdk/base/lib/osBindings/database/startos/HealthCheckId.ts diff --git a/sdk/base/lib/osBindings/Host.ts b/sdk/base/lib/osBindings/database/startos/Host.ts similarity index 100% rename from sdk/base/lib/osBindings/Host.ts rename to sdk/base/lib/osBindings/database/startos/Host.ts diff --git a/sdk/base/lib/osBindings/HostId.ts b/sdk/base/lib/osBindings/database/startos/HostId.ts similarity index 100% rename from sdk/base/lib/osBindings/HostId.ts rename to sdk/base/lib/osBindings/database/startos/HostId.ts diff --git a/sdk/base/lib/osBindings/HostnameInfo.ts b/sdk/base/lib/osBindings/database/startos/HostnameInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/HostnameInfo.ts rename to sdk/base/lib/osBindings/database/startos/HostnameInfo.ts diff --git a/sdk/base/lib/osBindings/Hosts.ts b/sdk/base/lib/osBindings/database/startos/Hosts.ts similarity index 100% rename from sdk/base/lib/osBindings/Hosts.ts rename to sdk/base/lib/osBindings/database/startos/Hosts.ts diff --git a/sdk/base/lib/osBindings/ImageConfig.ts b/sdk/base/lib/osBindings/database/startos/ImageConfig.ts similarity index 100% rename from sdk/base/lib/osBindings/ImageConfig.ts rename to sdk/base/lib/osBindings/database/startos/ImageConfig.ts diff --git a/sdk/base/lib/osBindings/ImageId.ts b/sdk/base/lib/osBindings/database/startos/ImageId.ts similarity index 100% rename from sdk/base/lib/osBindings/ImageId.ts rename to sdk/base/lib/osBindings/database/startos/ImageId.ts diff --git a/sdk/base/lib/osBindings/ImageSource.ts b/sdk/base/lib/osBindings/database/startos/ImageSource.ts similarity index 100% rename from sdk/base/lib/osBindings/ImageSource.ts rename to sdk/base/lib/osBindings/database/startos/ImageSource.ts diff --git a/sdk/base/lib/osBindings/InstalledState.ts b/sdk/base/lib/osBindings/database/startos/InstalledState.ts similarity index 100% rename from sdk/base/lib/osBindings/InstalledState.ts rename to sdk/base/lib/osBindings/database/startos/InstalledState.ts diff --git a/sdk/base/lib/osBindings/InstallingInfo.ts b/sdk/base/lib/osBindings/database/startos/InstallingInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/InstallingInfo.ts rename to sdk/base/lib/osBindings/database/startos/InstallingInfo.ts diff --git a/sdk/base/lib/osBindings/InstallingState.ts b/sdk/base/lib/osBindings/database/startos/InstallingState.ts similarity index 100% rename from sdk/base/lib/osBindings/InstallingState.ts rename to sdk/base/lib/osBindings/database/startos/InstallingState.ts diff --git a/sdk/base/lib/osBindings/IpHostname.ts b/sdk/base/lib/osBindings/database/startos/IpHostname.ts similarity index 100% rename from sdk/base/lib/osBindings/IpHostname.ts rename to sdk/base/lib/osBindings/database/startos/IpHostname.ts diff --git a/sdk/base/lib/osBindings/IpInfo.ts b/sdk/base/lib/osBindings/database/startos/IpInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/IpInfo.ts rename to sdk/base/lib/osBindings/database/startos/IpInfo.ts diff --git a/sdk/base/lib/osBindings/LshwDevice.ts b/sdk/base/lib/osBindings/database/startos/LshwDevice.ts similarity index 100% rename from sdk/base/lib/osBindings/LshwDevice.ts rename to sdk/base/lib/osBindings/database/startos/LshwDevice.ts diff --git a/sdk/base/lib/osBindings/LshwDisplay.ts b/sdk/base/lib/osBindings/database/startos/LshwDisplay.ts similarity index 100% rename from sdk/base/lib/osBindings/LshwDisplay.ts rename to sdk/base/lib/osBindings/database/startos/LshwDisplay.ts diff --git a/sdk/base/lib/osBindings/LshwProcessor.ts b/sdk/base/lib/osBindings/database/startos/LshwProcessor.ts similarity index 100% rename from sdk/base/lib/osBindings/LshwProcessor.ts rename to sdk/base/lib/osBindings/database/startos/LshwProcessor.ts diff --git a/sdk/base/lib/osBindings/MainStatus.ts b/sdk/base/lib/osBindings/database/startos/MainStatus.ts similarity index 100% rename from sdk/base/lib/osBindings/MainStatus.ts rename to sdk/base/lib/osBindings/database/startos/MainStatus.ts diff --git a/sdk/base/lib/osBindings/Manifest.ts b/sdk/base/lib/osBindings/database/startos/Manifest.ts similarity index 100% rename from sdk/base/lib/osBindings/Manifest.ts rename to sdk/base/lib/osBindings/database/startos/Manifest.ts diff --git a/core/models/bindings/ServiceInterfaceId.ts b/sdk/base/lib/osBindings/database/startos/MaybeUtf8String.ts similarity index 71% rename from core/models/bindings/ServiceInterfaceId.ts rename to sdk/base/lib/osBindings/database/startos/MaybeUtf8String.ts index 55315ab60..a09d790bb 100644 --- a/core/models/bindings/ServiceInterfaceId.ts +++ b/sdk/base/lib/osBindings/database/startos/MaybeUtf8String.ts @@ -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 ServiceInterfaceId = string; +export type MaybeUtf8String = Array diff --git a/sdk/base/lib/osBindings/Metadata.ts b/sdk/base/lib/osBindings/database/startos/Metadata.ts similarity index 100% rename from sdk/base/lib/osBindings/Metadata.ts rename to sdk/base/lib/osBindings/database/startos/Metadata.ts diff --git a/sdk/base/lib/osBindings/MetadataSrc.ts b/sdk/base/lib/osBindings/database/startos/MetadataSrc.ts similarity index 100% rename from sdk/base/lib/osBindings/MetadataSrc.ts rename to sdk/base/lib/osBindings/database/startos/MetadataSrc.ts diff --git a/sdk/base/lib/osBindings/NamedHealthCheckResult.ts b/sdk/base/lib/osBindings/database/startos/NamedHealthCheckResult.ts similarity index 100% rename from sdk/base/lib/osBindings/NamedHealthCheckResult.ts rename to sdk/base/lib/osBindings/database/startos/NamedHealthCheckResult.ts diff --git a/sdk/base/lib/osBindings/NamedProgress.ts b/sdk/base/lib/osBindings/database/startos/NamedProgress.ts similarity index 100% rename from sdk/base/lib/osBindings/NamedProgress.ts rename to sdk/base/lib/osBindings/database/startos/NamedProgress.ts diff --git a/sdk/base/lib/osBindings/NetInfo.ts b/sdk/base/lib/osBindings/database/startos/NetInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/NetInfo.ts rename to sdk/base/lib/osBindings/database/startos/NetInfo.ts diff --git a/sdk/base/lib/osBindings/NetworkInfo.ts b/sdk/base/lib/osBindings/database/startos/NetworkInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/NetworkInfo.ts rename to sdk/base/lib/osBindings/database/startos/NetworkInfo.ts diff --git a/sdk/base/lib/osBindings/NetworkInterfaceInfo.ts b/sdk/base/lib/osBindings/database/startos/NetworkInterfaceInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/NetworkInterfaceInfo.ts rename to sdk/base/lib/osBindings/database/startos/NetworkInterfaceInfo.ts diff --git a/sdk/base/lib/osBindings/NetworkInterfaceType.ts b/sdk/base/lib/osBindings/database/startos/NetworkInterfaceType.ts similarity index 100% rename from sdk/base/lib/osBindings/NetworkInterfaceType.ts rename to sdk/base/lib/osBindings/database/startos/NetworkInterfaceType.ts diff --git a/sdk/base/lib/osBindings/OnionHostname.ts b/sdk/base/lib/osBindings/database/startos/OnionHostname.ts similarity index 100% rename from sdk/base/lib/osBindings/OnionHostname.ts rename to sdk/base/lib/osBindings/database/startos/OnionHostname.ts diff --git a/sdk/base/lib/osBindings/PackageDataEntry.ts b/sdk/base/lib/osBindings/database/startos/PackageDataEntry.ts similarity index 100% rename from sdk/base/lib/osBindings/PackageDataEntry.ts rename to sdk/base/lib/osBindings/database/startos/PackageDataEntry.ts diff --git a/sdk/base/lib/osBindings/MebiBytes.ts b/sdk/base/lib/osBindings/database/startos/PackageId.ts similarity index 78% rename from sdk/base/lib/osBindings/MebiBytes.ts rename to sdk/base/lib/osBindings/database/startos/PackageId.ts index c10760d23..9e3403303 100644 --- a/sdk/base/lib/osBindings/MebiBytes.ts +++ b/sdk/base/lib/osBindings/database/startos/PackageId.ts @@ -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 MebiBytes = number +export type PackageId = string diff --git a/sdk/base/lib/osBindings/PackageState.ts b/sdk/base/lib/osBindings/database/startos/PackageState.ts similarity index 100% rename from sdk/base/lib/osBindings/PackageState.ts rename to sdk/base/lib/osBindings/database/startos/PackageState.ts diff --git a/sdk/base/lib/osBindings/PathOrUrl.ts b/sdk/base/lib/osBindings/database/startos/PathOrUrl.ts similarity index 100% rename from sdk/base/lib/osBindings/PathOrUrl.ts rename to sdk/base/lib/osBindings/database/startos/PathOrUrl.ts diff --git a/sdk/base/lib/osBindings/Progress.ts b/sdk/base/lib/osBindings/database/startos/Progress.ts similarity index 100% rename from sdk/base/lib/osBindings/Progress.ts rename to sdk/base/lib/osBindings/database/startos/Progress.ts diff --git a/sdk/base/lib/osBindings/ProgressUnits.ts b/sdk/base/lib/osBindings/database/startos/ProgressUnits.ts similarity index 100% rename from sdk/base/lib/osBindings/ProgressUnits.ts rename to sdk/base/lib/osBindings/database/startos/ProgressUnits.ts diff --git a/sdk/base/lib/osBindings/Public.ts b/sdk/base/lib/osBindings/database/startos/Public.ts similarity index 100% rename from sdk/base/lib/osBindings/Public.ts rename to sdk/base/lib/osBindings/database/startos/Public.ts diff --git a/sdk/base/lib/osBindings/PublicDomainConfig.ts b/sdk/base/lib/osBindings/database/startos/PublicDomainConfig.ts similarity index 100% rename from sdk/base/lib/osBindings/PublicDomainConfig.ts rename to sdk/base/lib/osBindings/database/startos/PublicDomainConfig.ts diff --git a/sdk/base/lib/osBindings/ReplayId.ts b/sdk/base/lib/osBindings/database/startos/ReplayId.ts similarity index 100% rename from sdk/base/lib/osBindings/ReplayId.ts rename to sdk/base/lib/osBindings/database/startos/ReplayId.ts diff --git a/sdk/base/lib/osBindings/Security.ts b/sdk/base/lib/osBindings/database/startos/Security.ts similarity index 100% rename from sdk/base/lib/osBindings/Security.ts rename to sdk/base/lib/osBindings/database/startos/Security.ts diff --git a/sdk/base/lib/osBindings/ServerInfo.ts b/sdk/base/lib/osBindings/database/startos/ServerInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/ServerInfo.ts rename to sdk/base/lib/osBindings/database/startos/ServerInfo.ts diff --git a/sdk/base/lib/osBindings/ServerStatus.ts b/sdk/base/lib/osBindings/database/startos/ServerStatus.ts similarity index 100% rename from sdk/base/lib/osBindings/ServerStatus.ts rename to sdk/base/lib/osBindings/database/startos/ServerStatus.ts diff --git a/sdk/base/lib/osBindings/ServiceInterface.ts b/sdk/base/lib/osBindings/database/startos/ServiceInterface.ts similarity index 100% rename from sdk/base/lib/osBindings/ServiceInterface.ts rename to sdk/base/lib/osBindings/database/startos/ServiceInterface.ts diff --git a/sdk/base/lib/osBindings/ServiceInterfaceId.ts b/sdk/base/lib/osBindings/database/startos/ServiceInterfaceId.ts similarity index 100% rename from sdk/base/lib/osBindings/ServiceInterfaceId.ts rename to sdk/base/lib/osBindings/database/startos/ServiceInterfaceId.ts diff --git a/sdk/base/lib/osBindings/ServiceInterfaceType.ts b/sdk/base/lib/osBindings/database/startos/ServiceInterfaceType.ts similarity index 100% rename from sdk/base/lib/osBindings/ServiceInterfaceType.ts rename to sdk/base/lib/osBindings/database/startos/ServiceInterfaceType.ts diff --git a/sdk/base/lib/osBindings/SmtpValue.ts b/sdk/base/lib/osBindings/database/startos/SmtpValue.ts similarity index 100% rename from sdk/base/lib/osBindings/SmtpValue.ts rename to sdk/base/lib/osBindings/database/startos/SmtpValue.ts diff --git a/sdk/base/lib/osBindings/StartStop.ts b/sdk/base/lib/osBindings/database/startos/StartStop.ts similarity index 100% rename from sdk/base/lib/osBindings/StartStop.ts rename to sdk/base/lib/osBindings/database/startos/StartStop.ts diff --git a/sdk/base/lib/osBindings/CreateTaskParams.ts b/sdk/base/lib/osBindings/database/startos/Task.ts similarity index 82% rename from sdk/base/lib/osBindings/CreateTaskParams.ts rename to sdk/base/lib/osBindings/database/startos/Task.ts index 0abb70f3b..8b781a5d3 100644 --- a/sdk/base/lib/osBindings/CreateTaskParams.ts +++ b/sdk/base/lib/osBindings/database/startos/Task.ts @@ -1,13 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { ActionId } from "./ActionId" import type { PackageId } from "./PackageId" -import type { ReplayId } from "./ReplayId" import type { TaskInput } from "./TaskInput" import type { TaskSeverity } from "./TaskSeverity" import type { TaskTrigger } from "./TaskTrigger" -export type CreateTaskParams = { - replayId: ReplayId +export type Task = { packageId: PackageId actionId: ActionId severity: TaskSeverity diff --git a/sdk/base/lib/osBindings/AnySignature.ts b/sdk/base/lib/osBindings/database/startos/TaskCondition.ts similarity index 69% rename from sdk/base/lib/osBindings/AnySignature.ts rename to sdk/base/lib/osBindings/database/startos/TaskCondition.ts index 32b68b911..9e48cdae8 100644 --- a/sdk/base/lib/osBindings/AnySignature.ts +++ b/sdk/base/lib/osBindings/database/startos/TaskCondition.ts @@ -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 AnySignature = string +export type TaskCondition = "input-not-matches" diff --git a/sdk/base/lib/osBindings/TaskEntry.ts b/sdk/base/lib/osBindings/database/startos/TaskEntry.ts similarity index 100% rename from sdk/base/lib/osBindings/TaskEntry.ts rename to sdk/base/lib/osBindings/database/startos/TaskEntry.ts diff --git a/sdk/base/lib/osBindings/database/startos/TaskInput.ts b/sdk/base/lib/osBindings/database/startos/TaskInput.ts new file mode 100644 index 000000000..3415105bf --- /dev/null +++ b/sdk/base/lib/osBindings/database/startos/TaskInput.ts @@ -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 TaskInput = { kind: "partial"; value: Record } diff --git a/sdk/base/lib/osBindings/AddCategoryParams.ts b/sdk/base/lib/osBindings/database/startos/TaskSeverity.ts similarity index 62% rename from sdk/base/lib/osBindings/AddCategoryParams.ts rename to sdk/base/lib/osBindings/database/startos/TaskSeverity.ts index 62b04e6e2..a80540fe4 100644 --- a/sdk/base/lib/osBindings/AddCategoryParams.ts +++ b/sdk/base/lib/osBindings/database/startos/TaskSeverity.ts @@ -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 AddCategoryParams = { id: string; name: string } +export type TaskSeverity = "optional" | "important" | "critical" diff --git a/sdk/base/lib/osBindings/database/startos/TaskTrigger.ts b/sdk/base/lib/osBindings/database/startos/TaskTrigger.ts new file mode 100644 index 000000000..ac46f2774 --- /dev/null +++ b/sdk/base/lib/osBindings/database/startos/TaskTrigger.ts @@ -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 { TaskCondition } from "./TaskCondition" + +export type TaskTrigger = { once: boolean; condition: TaskCondition } diff --git a/sdk/base/lib/osBindings/UpdatingState.ts b/sdk/base/lib/osBindings/database/startos/UpdatingState.ts similarity index 100% rename from sdk/base/lib/osBindings/UpdatingState.ts rename to sdk/base/lib/osBindings/database/startos/UpdatingState.ts diff --git a/sdk/base/lib/osBindings/Version.ts b/sdk/base/lib/osBindings/database/startos/Version.ts similarity index 100% rename from sdk/base/lib/osBindings/Version.ts rename to sdk/base/lib/osBindings/database/startos/Version.ts diff --git a/sdk/base/lib/osBindings/VolumeId.ts b/sdk/base/lib/osBindings/database/startos/VolumeId.ts similarity index 100% rename from sdk/base/lib/osBindings/VolumeId.ts rename to sdk/base/lib/osBindings/database/startos/VolumeId.ts diff --git a/sdk/base/lib/osBindings/WifiInfo.ts b/sdk/base/lib/osBindings/database/startos/WifiInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/WifiInfo.ts rename to sdk/base/lib/osBindings/database/startos/WifiInfo.ts diff --git a/sdk/base/lib/osBindings/database/startos/index.ts b/sdk/base/lib/osBindings/database/startos/index.ts new file mode 100644 index 000000000..2c626a794 --- /dev/null +++ b/sdk/base/lib/osBindings/database/startos/index.ts @@ -0,0 +1,84 @@ +export * from "./Public" +export * from "./ServerInfo" +export * from "./ServerStatus" +export * from "./PackageId" +export * from "./BackupProgress" +export * from "./FullProgress" +export * from "./NamedProgress" +export * from "./Progress" +export * from "./ProgressUnits" +export * from "./LshwDevice" +export * from "./LshwProcessor" +export * from "./LshwDisplay" +export * from "./NetworkInfo" +export * from "./WifiInfo" +export * from "./Host" +export * from "./HostnameInfo" +export * from "./GatewayInfo" +export * from "./GatewayId" +export * from "./OnionHostname" +export * from "./IpHostname" +export * from "./BindInfo" +export * from "./BindOptions" +export * from "./AddSslOptions" +export * from "./AlpnInfo" +export * from "./MaybeUtf8String" +export * from "./Security" +export * from "./NetInfo" +export * from "./PublicDomainConfig" +export * from "./AcmeProvider" +export * from "./NetworkInterfaceInfo" +export * from "./IpInfo" +export * from "./NetworkInterfaceType" +export * from "./DnsSettings" +export * from "./AcmeSettings" +export * from "./Governor" +export * from "./SmtpValue" +export * from "./AllPackageData" +export * from "./PackageDataEntry" +export * from "./CurrentDependencies" +export * from "./CurrentDependencyInfo" +export * from "./DataUrl" +export * from "./MainStatus" +export * from "./StartStop" +export * from "./HealthCheckId" +export * from "./NamedHealthCheckResult" +export * from "./ServiceInterfaceId" +export * from "./ServiceInterface" +export * from "./ServiceInterfaceType" +export * from "./AddressInfo" +export * from "./HostId" +export * from "./ReplayId" +export * from "./TaskEntry" +export * from "./Task" +export * from "./TaskSeverity" +export * from "./ActionId" +export * from "./TaskTrigger" +export * from "./TaskCondition" +export * from "./TaskInput" +export * from "./ActionMetadata" +export * from "./ActionVisibility" +export * from "./AllowedStatuses" +export * from "./Hosts" +export * from "./PackageState" +export * from "./InstallingState" +export * from "./InstallingInfo" +export * from "./Manifest" +export * from "./Description" +export * from "./Alerts" +export * from "./ImageId" +export * from "./ImageConfig" +export * from "./ImageSource" +export * from "./BuildArg" +export * from "./HardwareRequirements" +export * from "./DeviceFilter" +export * from "./Dependencies" +export * from "./DepInfo" +export * from "./MetadataSrc" +export * from "./PathOrUrl" +export * from "./Metadata" +export * from "./GitHash" +export * from "./VolumeId" +export * from "./Version" +export * from "./UpdatingState" +export * from "./InstalledState" diff --git a/sdk/base/lib/osBindings/AnyVerifyingKey.ts b/sdk/base/lib/osBindings/database/tunnel/AnyVerifyingKey.ts similarity index 100% rename from sdk/base/lib/osBindings/AnyVerifyingKey.ts rename to sdk/base/lib/osBindings/database/tunnel/AnyVerifyingKey.ts diff --git a/sdk/base/lib/osBindings/Base64.ts b/sdk/base/lib/osBindings/database/tunnel/Base64.ts similarity index 100% rename from sdk/base/lib/osBindings/Base64.ts rename to sdk/base/lib/osBindings/database/tunnel/Base64.ts diff --git a/sdk/base/lib/osBindings/tunnel/Pem.ts b/sdk/base/lib/osBindings/database/tunnel/Pem.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/Pem.ts rename to sdk/base/lib/osBindings/database/tunnel/Pem.ts diff --git a/sdk/base/lib/osBindings/tunnel/PortForwards.ts b/sdk/base/lib/osBindings/database/tunnel/PortForwards.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/PortForwards.ts rename to sdk/base/lib/osBindings/database/tunnel/PortForwards.ts diff --git a/sdk/base/lib/osBindings/Session.ts b/sdk/base/lib/osBindings/database/tunnel/Session.ts similarity index 100% rename from sdk/base/lib/osBindings/Session.ts rename to sdk/base/lib/osBindings/database/tunnel/Session.ts diff --git a/sdk/base/lib/osBindings/Sessions.ts b/sdk/base/lib/osBindings/database/tunnel/Sessions.ts similarity index 100% rename from sdk/base/lib/osBindings/Sessions.ts rename to sdk/base/lib/osBindings/database/tunnel/Sessions.ts diff --git a/sdk/base/lib/osBindings/SignerInfo.ts b/sdk/base/lib/osBindings/database/tunnel/SignerInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/SignerInfo.ts rename to sdk/base/lib/osBindings/database/tunnel/SignerInfo.ts diff --git a/sdk/base/lib/osBindings/tunnel/TunnelCertData.ts b/sdk/base/lib/osBindings/database/tunnel/TunnelCertData.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/TunnelCertData.ts rename to sdk/base/lib/osBindings/database/tunnel/TunnelCertData.ts diff --git a/sdk/base/lib/osBindings/tunnel/TunnelDatabase.ts b/sdk/base/lib/osBindings/database/tunnel/TunnelDatabase.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/TunnelDatabase.ts rename to sdk/base/lib/osBindings/database/tunnel/TunnelDatabase.ts diff --git a/sdk/base/lib/osBindings/tunnel/WebserverInfo.ts b/sdk/base/lib/osBindings/database/tunnel/WebserverInfo.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/WebserverInfo.ts rename to sdk/base/lib/osBindings/database/tunnel/WebserverInfo.ts diff --git a/sdk/base/lib/osBindings/tunnel/WgConfig.ts b/sdk/base/lib/osBindings/database/tunnel/WgConfig.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/WgConfig.ts rename to sdk/base/lib/osBindings/database/tunnel/WgConfig.ts diff --git a/sdk/base/lib/osBindings/tunnel/WgServer.ts b/sdk/base/lib/osBindings/database/tunnel/WgServer.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/WgServer.ts rename to sdk/base/lib/osBindings/database/tunnel/WgServer.ts diff --git a/sdk/base/lib/osBindings/tunnel/WgSubnetClients.ts b/sdk/base/lib/osBindings/database/tunnel/WgSubnetClients.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/WgSubnetClients.ts rename to sdk/base/lib/osBindings/database/tunnel/WgSubnetClients.ts diff --git a/sdk/base/lib/osBindings/tunnel/WgSubnetConfig.ts b/sdk/base/lib/osBindings/database/tunnel/WgSubnetConfig.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/WgSubnetConfig.ts rename to sdk/base/lib/osBindings/database/tunnel/WgSubnetConfig.ts diff --git a/sdk/base/lib/osBindings/tunnel/WgSubnetMap.ts b/sdk/base/lib/osBindings/database/tunnel/WgSubnetMap.ts similarity index 100% rename from sdk/base/lib/osBindings/tunnel/WgSubnetMap.ts rename to sdk/base/lib/osBindings/database/tunnel/WgSubnetMap.ts diff --git a/sdk/base/lib/osBindings/database/tunnel/index.ts b/sdk/base/lib/osBindings/database/tunnel/index.ts new file mode 100644 index 000000000..259bd5d8b --- /dev/null +++ b/sdk/base/lib/osBindings/database/tunnel/index.ts @@ -0,0 +1,15 @@ +export * from "./TunnelDatabase" +export * from "./Sessions" +export * from "./Session" +export * from "./AnyVerifyingKey" +export * from "./SignerInfo" +export * from "./WebserverInfo" +export * from "./TunnelCertData" +export * from "./Pem" +export * from "./WgServer" +export * from "./Base64" +export * from "./WgSubnetMap" +export * from "./WgSubnetConfig" +export * from "./WgSubnetClients" +export * from "./WgConfig" +export * from "./PortForwards" diff --git a/sdk/base/lib/osBindings/GigaBytes.ts b/sdk/base/lib/osBindings/dependencies/ActionId.ts similarity index 78% rename from sdk/base/lib/osBindings/GigaBytes.ts rename to sdk/base/lib/osBindings/dependencies/ActionId.ts index 9e5e4ed7b..ebfaba49e 100644 --- a/sdk/base/lib/osBindings/GigaBytes.ts +++ b/sdk/base/lib/osBindings/dependencies/ActionId.ts @@ -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 GigaBytes = number +export type ActionId = string diff --git a/sdk/base/lib/osBindings/CheckDependenciesResult.ts b/sdk/base/lib/osBindings/dependencies/CheckDependenciesResult.ts similarity index 100% rename from sdk/base/lib/osBindings/CheckDependenciesResult.ts rename to sdk/base/lib/osBindings/dependencies/CheckDependenciesResult.ts diff --git a/sdk/base/lib/osBindings/DependencyRequirement.ts b/sdk/base/lib/osBindings/dependencies/DependencyRequirement.ts similarity index 100% rename from sdk/base/lib/osBindings/DependencyRequirement.ts rename to sdk/base/lib/osBindings/dependencies/DependencyRequirement.ts diff --git a/sdk/base/lib/osBindings/AnySigningKey.ts b/sdk/base/lib/osBindings/dependencies/HealthCheckId.ts similarity index 75% rename from sdk/base/lib/osBindings/AnySigningKey.ts rename to sdk/base/lib/osBindings/dependencies/HealthCheckId.ts index 4933251e8..bc5300473 100644 --- a/sdk/base/lib/osBindings/AnySigningKey.ts +++ b/sdk/base/lib/osBindings/dependencies/HealthCheckId.ts @@ -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 AnySigningKey = string +export type HealthCheckId = string diff --git a/sdk/base/lib/osBindings/SetHealth.ts b/sdk/base/lib/osBindings/dependencies/NamedHealthCheckResult.ts similarity index 74% rename from sdk/base/lib/osBindings/SetHealth.ts rename to sdk/base/lib/osBindings/dependencies/NamedHealthCheckResult.ts index 47f67886a..c967e9b34 100644 --- a/sdk/base/lib/osBindings/SetHealth.ts +++ b/sdk/base/lib/osBindings/dependencies/NamedHealthCheckResult.ts @@ -1,7 +1,6 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { HealthCheckId } from "./HealthCheckId" -export type SetHealth = { id: HealthCheckId; name: string } & ( +export type NamedHealthCheckResult = { name: string } & ( | { result: "success"; message: string | null } | { result: "disabled"; message: string | null } | { result: "starting"; message: string | null } diff --git a/sdk/base/lib/osBindings/dependencies/PackageId.ts b/sdk/base/lib/osBindings/dependencies/PackageId.ts new file mode 100644 index 000000000..9e3403303 --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/PackageId.ts @@ -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 PackageId = string diff --git a/sdk/base/lib/osBindings/dependencies/ReplayId.ts b/sdk/base/lib/osBindings/dependencies/ReplayId.ts new file mode 100644 index 000000000..048ef183a --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/ReplayId.ts @@ -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 ReplayId = string diff --git a/sdk/base/lib/osBindings/dependencies/Task.ts b/sdk/base/lib/osBindings/dependencies/Task.ts new file mode 100644 index 000000000..8b781a5d3 --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/Task.ts @@ -0,0 +1,15 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ActionId } from "./ActionId" +import type { PackageId } from "./PackageId" +import type { TaskInput } from "./TaskInput" +import type { TaskSeverity } from "./TaskSeverity" +import type { TaskTrigger } from "./TaskTrigger" + +export type Task = { + packageId: PackageId + actionId: ActionId + severity: TaskSeverity + reason?: string + when?: TaskTrigger + input?: TaskInput +} diff --git a/sdk/base/lib/osBindings/Algorithm.ts b/sdk/base/lib/osBindings/dependencies/TaskCondition.ts similarity index 69% rename from sdk/base/lib/osBindings/Algorithm.ts rename to sdk/base/lib/osBindings/dependencies/TaskCondition.ts index 94f2040e1..9e48cdae8 100644 --- a/sdk/base/lib/osBindings/Algorithm.ts +++ b/sdk/base/lib/osBindings/dependencies/TaskCondition.ts @@ -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 Algorithm = "ecdsa" | "ed25519" +export type TaskCondition = "input-not-matches" diff --git a/sdk/base/lib/osBindings/AddTunnelParams.ts b/sdk/base/lib/osBindings/dependencies/TaskEntry.ts similarity index 54% rename from sdk/base/lib/osBindings/AddTunnelParams.ts rename to sdk/base/lib/osBindings/dependencies/TaskEntry.ts index 018b22bb5..3607176bf 100644 --- a/sdk/base/lib/osBindings/AddTunnelParams.ts +++ b/sdk/base/lib/osBindings/dependencies/TaskEntry.ts @@ -1,3 +1,4 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Task } from "./Task" -export type AddTunnelParams = { name: string; config: string; public: boolean } +export type TaskEntry = { task: Task; active: boolean } diff --git a/sdk/base/lib/osBindings/dependencies/TaskInput.ts b/sdk/base/lib/osBindings/dependencies/TaskInput.ts new file mode 100644 index 000000000..3415105bf --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/TaskInput.ts @@ -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 TaskInput = { kind: "partial"; value: Record } diff --git a/sdk/base/lib/osBindings/dependencies/TaskSeverity.ts b/sdk/base/lib/osBindings/dependencies/TaskSeverity.ts new file mode 100644 index 000000000..a80540fe4 --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/TaskSeverity.ts @@ -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 TaskSeverity = "optional" | "important" | "critical" diff --git a/sdk/base/lib/osBindings/dependencies/TaskTrigger.ts b/sdk/base/lib/osBindings/dependencies/TaskTrigger.ts new file mode 100644 index 000000000..ac46f2774 --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/TaskTrigger.ts @@ -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 { TaskCondition } from "./TaskCondition" + +export type TaskTrigger = { once: boolean; condition: TaskCondition } diff --git a/sdk/base/lib/osBindings/Celsius.ts b/sdk/base/lib/osBindings/dependencies/Version.ts similarity index 79% rename from sdk/base/lib/osBindings/Celsius.ts rename to sdk/base/lib/osBindings/dependencies/Version.ts index 298f97f5e..b49b6e887 100644 --- a/sdk/base/lib/osBindings/Celsius.ts +++ b/sdk/base/lib/osBindings/dependencies/Version.ts @@ -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 Celsius = number +export type Version = string diff --git a/sdk/base/lib/osBindings/dependencies/index.ts b/sdk/base/lib/osBindings/dependencies/index.ts new file mode 100644 index 000000000..ba39cd167 --- /dev/null +++ b/sdk/base/lib/osBindings/dependencies/index.ts @@ -0,0 +1,14 @@ +export * from "./PackageId" +export * from "./DependencyRequirement" +export * from "./HealthCheckId" +export * from "./CheckDependenciesResult" +export * from "./Version" +export * from "./ReplayId" +export * from "./TaskEntry" +export * from "./Task" +export * from "./TaskSeverity" +export * from "./ActionId" +export * from "./TaskTrigger" +export * from "./TaskCondition" +export * from "./TaskInput" +export * from "./NamedHealthCheckResult" diff --git a/sdk/base/lib/osBindings/diagnostic-api.ts b/sdk/base/lib/osBindings/diagnostic-api.ts new file mode 100644 index 000000000..eddbd81da --- /dev/null +++ b/sdk/base/lib/osBindings/diagnostic-api.ts @@ -0,0 +1,166 @@ +export type DiagnosticApi = { + _CHILDREN: { + auth: { _CHILDREN: { session: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + backup: { + _CHILDREN: { + target: { _CHILDREN: { cifs: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + } + } & { _PARAMS: {} } + db: { _CHILDREN: { put: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + diagnostic: { + _CHILDREN: { + disk: { + _CHILDREN: { + forget: { _PARAMS: {}; _RETURN: null } + repair: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + error: { _PARAMS: unknown; _RETURN: unknown } + "kernel-logs": { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + logs: { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + rebuild: { _PARAMS: {}; _RETURN: null } + restart: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + disk: { _CHILDREN: { repair: { _PARAMS: {}; _RETURN: null } } } & { + _PARAMS: {} + } + "git-info": { _PARAMS: {}; _RETURN: string } + init: { _CHILDREN: {} } & { _PARAMS: {} } + install: { _CHILDREN: { disk: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + kiosk: { _CHILDREN: {} } & { _PARAMS: {} } + net: { + _CHILDREN: { + acme: { _CHILDREN: {} } & { _PARAMS: {} } + dns: { + _CHILDREN: { + query: { _PARAMS: { fqdn: string }; _RETURN: string | null } + } + } & { _PARAMS: {} } + forward: { _CHILDREN: {} } & { _PARAMS: {} } + gateway: { _CHILDREN: {} } & { _PARAMS: {} } + tor: { _CHILDREN: { key: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + tunnel: { _CHILDREN: {} } & { _PARAMS: {} } + vhost: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + notification: { _CHILDREN: {} } & { _PARAMS: {} } + package: { + _CHILDREN: { + action: { _CHILDREN: {} } & { _PARAMS: {} } + backup: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: { host: HostId } } + binding: { _CHILDREN: {} } & { _PARAMS: { host: HostId } } + } + } & { _PARAMS: { package: PackageId } } + } + } & { _PARAMS: {} } + server: { + _CHILDREN: { + experimental: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + binding: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + metrics: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + setup: { + _CHILDREN: { + cifs: { _CHILDREN: {} } & { _PARAMS: {} } + disk: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + ssh: { _CHILDREN: {} } & { _PARAMS: {} } + state: { _PARAMS: {}; _RETURN: "error" | "initializing" | "running" } + util: { _CHILDREN: {} } & { _PARAMS: {} } + wifi: { + _CHILDREN: { + available: { _CHILDREN: {} } & { _PARAMS: {} } + country: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/index.ts b/sdk/base/lib/osBindings/index.ts index 502bd992f..dc1a25e0f 100644 --- a/sdk/base/lib/osBindings/index.ts +++ b/sdk/base/lib/osBindings/index.ts @@ -1,220 +1,12 @@ -export { AcceptSigners } from "./AcceptSigners" -export { AcmeProvider } from "./AcmeProvider" -export { AcmeSettings } from "./AcmeSettings" -export { ActionId } from "./ActionId" -export { ActionInput } from "./ActionInput" -export { ActionMetadata } from "./ActionMetadata" -export { ActionResultMember } from "./ActionResultMember" -export { ActionResult } from "./ActionResult" -export { ActionResultV0 } from "./ActionResultV0" -export { ActionResultV1 } from "./ActionResultV1" -export { ActionResultValue } from "./ActionResultValue" -export { ActionVisibility } from "./ActionVisibility" -export { AddAdminParams } from "./AddAdminParams" -export { AddAssetParams } from "./AddAssetParams" -export { AddCategoryParams } from "./AddCategoryParams" -export { AddPackageParams } from "./AddPackageParams" -export { AddPackageToCategoryParams } from "./AddPackageToCategoryParams" -export { AddressInfo } from "./AddressInfo" -export { AddSslOptions } from "./AddSslOptions" -export { AddTunnelParams } from "./AddTunnelParams" -export { AddVersionParams } from "./AddVersionParams" -export { Alerts } from "./Alerts" -export { Algorithm } from "./Algorithm" -export { AllowedStatuses } from "./AllowedStatuses" -export { AllPackageData } from "./AllPackageData" -export { AlpnInfo } from "./AlpnInfo" -export { AnySignature } from "./AnySignature" -export { AnySigningKey } from "./AnySigningKey" -export { AnyVerifyingKey } from "./AnyVerifyingKey" -export { ApiState } from "./ApiState" -export { AttachParams } from "./AttachParams" -export { BackupProgress } from "./BackupProgress" -export { BackupTargetFS } from "./BackupTargetFS" -export { Base64 } from "./Base64" -export { BindId } from "./BindId" -export { BindInfo } from "./BindInfo" -export { BindingGatewaySetEnabledParams } from "./BindingGatewaySetEnabledParams" -export { BindOptions } from "./BindOptions" -export { BindParams } from "./BindParams" -export { Blake3Commitment } from "./Blake3Commitment" -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" -export { ClearActionsParams } from "./ClearActionsParams" -export { ClearBindingsParams } from "./ClearBindingsParams" -export { ClearCallbacksParams } from "./ClearCallbacksParams" -export { ClearServiceInterfacesParams } from "./ClearServiceInterfacesParams" -export { ClearTasksParams } from "./ClearTasksParams" -export { CliSetIconParams } from "./CliSetIconParams" -export { ContactInfo } from "./ContactInfo" -export { CreateSubcontainerFsParams } from "./CreateSubcontainerFsParams" -export { CreateTaskParams } from "./CreateTaskParams" -export { CurrentDependencies } from "./CurrentDependencies" -export { CurrentDependencyInfo } from "./CurrentDependencyInfo" -export { DataUrl } from "./DataUrl" -export { Dependencies } from "./Dependencies" -export { DependencyKind } from "./DependencyKind" -export { DependencyMetadata } from "./DependencyMetadata" -export { DependencyRequirement } from "./DependencyRequirement" -export { DepInfo } from "./DepInfo" -export { Description } from "./Description" -export { DestroySubcontainerFsParams } from "./DestroySubcontainerFsParams" -export { DeviceFilter } from "./DeviceFilter" -export { DnsSettings } from "./DnsSettings" -export { DomainSettings } from "./DomainSettings" -export { Duration } from "./Duration" -export { EchoParams } from "./EchoParams" -export { EditSignerParams } from "./EditSignerParams" -export { EncryptedWire } from "./EncryptedWire" -export { EventId } from "./EventId" -export { ExportActionParams } from "./ExportActionParams" -export { ExportServiceInterfaceParams } from "./ExportServiceInterfaceParams" -export { FileType } from "./FileType" -export { ForgetGatewayParams } from "./ForgetGatewayParams" -export { FullIndex } from "./FullIndex" -export { FullProgress } from "./FullProgress" -export { GatewayId } from "./GatewayId" -export { GatewayInfo } from "./GatewayInfo" -export { GetActionInputParams } from "./GetActionInputParams" -export { GetContainerIpParams } from "./GetContainerIpParams" -export { GetHostInfoParams } from "./GetHostInfoParams" -export { GetOsAssetParams } from "./GetOsAssetParams" -export { GetOsVersionParams } from "./GetOsVersionParams" -export { GetPackageParams } from "./GetPackageParams" -export { GetPackageResponseFull } from "./GetPackageResponseFull" -export { GetPackageResponse } from "./GetPackageResponse" -export { GetServiceInterfaceParams } from "./GetServiceInterfaceParams" -export { GetServicePortForwardParams } from "./GetServicePortForwardParams" -export { GetSslCertificateParams } from "./GetSslCertificateParams" -export { GetSslKeyParams } from "./GetSslKeyParams" -export { GetStatusParams } from "./GetStatusParams" -export { GetSystemSmtpParams } from "./GetSystemSmtpParams" -export { GigaBytes } from "./GigaBytes" -export { GitHash } from "./GitHash" -export { Governor } from "./Governor" -export { Guid } from "./Guid" -export { HardwareRequirements } from "./HardwareRequirements" -export { HealthCheckId } from "./HealthCheckId" -export { HostId } from "./HostId" -export { HostnameInfo } from "./HostnameInfo" -export { Hosts } from "./Hosts" -export { Host } from "./Host" -export { ImageConfig } from "./ImageConfig" -export { ImageId } from "./ImageId" -export { ImageMetadata } from "./ImageMetadata" -export { ImageSource } from "./ImageSource" -export { InitProgressRes } from "./InitProgressRes" -export { InstalledState } from "./InstalledState" -export { InstalledVersionParams } from "./InstalledVersionParams" -export { InstallingInfo } from "./InstallingInfo" -export { InstallingState } from "./InstallingState" -export { InstallParams } from "./InstallParams" -export { IpHostname } from "./IpHostname" -export { IpInfo } from "./IpInfo" -export { ListPackageSignersParams } from "./ListPackageSignersParams" -export { ListServiceInterfacesParams } from "./ListServiceInterfacesParams" -export { ListVersionSignersParams } from "./ListVersionSignersParams" -export { LoginParams } from "./LoginParams" -export { LshwDevice } from "./LshwDevice" -export { LshwDisplay } from "./LshwDisplay" -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 { MetadataSrc } from "./MetadataSrc" -export { Metadata } from "./Metadata" -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 { NetworkInterfaceType } from "./NetworkInterfaceType" -export { OnionHostname } from "./OnionHostname" -export { OsIndex } from "./OsIndex" -export { OsVersionInfoMap } from "./OsVersionInfoMap" -export { OsVersionInfo } from "./OsVersionInfo" -export { PackageDataEntry } from "./PackageDataEntry" -export { PackageDetailLevel } from "./PackageDetailLevel" -export { PackageId } from "./PackageId" -export { PackageIndex } from "./PackageIndex" -export { PackageInfoShort } from "./PackageInfoShort" -export { PackageInfo } from "./PackageInfo" -export { PackageSignerParams } from "./PackageSignerParams" -export { PackageState } from "./PackageState" -export { PackageVersionInfo } from "./PackageVersionInfo" -export { PasswordType } from "./PasswordType" -export { PathOrUrl } from "./PathOrUrl" -export { Percentage } from "./Percentage" -export { Progress } from "./Progress" -export { ProgressUnits } from "./ProgressUnits" -export { PublicDomainConfig } from "./PublicDomainConfig" -export { Public } from "./Public" -export { RecoverySource } from "./RecoverySource" -export { RegistryAsset } from "./RegistryAsset" -export { RegistryInfo } from "./RegistryInfo" -export { RemoveAdminParams } from "./RemoveAdminParams" -export { RemoveAssetParams } from "./RemoveAssetParams" -export { RemoveCategoryParams } from "./RemoveCategoryParams" -export { RemovePackageFromCategoryParams } from "./RemovePackageFromCategoryParams" -export { RemovePackageParams } from "./RemovePackageParams" -export { RemoveTunnelParams } from "./RemoveTunnelParams" -export { RemoveVersionParams } from "./RemoveVersionParams" -export { RenameGatewayParams } from "./RenameGatewayParams" -export { ReplayId } from "./ReplayId" -export { RequestCommitment } from "./RequestCommitment" -export { RunActionParams } from "./RunActionParams" -export { Security } from "./Security" -export { ServerInfo } from "./ServerInfo" -export { ServerSpecs } from "./ServerSpecs" -export { ServerStatus } from "./ServerStatus" -export { ServiceInterfaceId } from "./ServiceInterfaceId" -export { ServiceInterface } from "./ServiceInterface" -export { ServiceInterfaceType } from "./ServiceInterfaceType" -export { SessionList } from "./SessionList" -export { Sessions } from "./Sessions" -export { Session } from "./Session" -export { SetDataVersionParams } from "./SetDataVersionParams" -export { SetDependenciesParams } from "./SetDependenciesParams" -export { SetHealth } from "./SetHealth" -export { SetIconParams } from "./SetIconParams" -export { SetMainStatusStatus } from "./SetMainStatusStatus" -export { SetMainStatus } from "./SetMainStatus" -export { SetNameParams } from "./SetNameParams" -export { SetupExecuteParams } from "./SetupExecuteParams" -export { SetupProgress } from "./SetupProgress" -export { SetupResult } from "./SetupResult" -export { SetupStatusRes } from "./SetupStatusRes" -export { SignAssetParams } from "./SignAssetParams" -export { SignerInfo } from "./SignerInfo" -export { SmtpValue } from "./SmtpValue" -export { StartStop } from "./StartStop" -export { TaskCondition } from "./TaskCondition" -export { TaskEntry } from "./TaskEntry" -export { TaskInput } from "./TaskInput" -export { TaskSeverity } from "./TaskSeverity" -export { TaskTrigger } from "./TaskTrigger" -export { Task } from "./Task" -export { TestSmtpParams } from "./TestSmtpParams" -export { UnsetPublicParams } from "./UnsetPublicParams" -export { UpdatingState } from "./UpdatingState" -export { VerifyCifsParams } from "./VerifyCifsParams" -export { VersionSignerParams } from "./VersionSignerParams" -export { Version } from "./Version" -export { VolumeId } from "./VolumeId" -export { WifiInfo } from "./WifiInfo" +export * from "./api-helpers" +export * from "./tunnel-api" +export * from "./service-effects-api" +export * from "./main-api" +export * from "./init-api" +export * from "./diagnostic-api" +export * from "./setup-api" +export * from "./os-install-api" +export * as dependencies from "./dependencies" +export * as action from "./action" +export * as manifest from "./manifest" +export * as database from "./database" diff --git a/sdk/base/lib/osBindings/init-api.ts b/sdk/base/lib/osBindings/init-api.ts new file mode 100644 index 000000000..6f761d2fb --- /dev/null +++ b/sdk/base/lib/osBindings/init-api.ts @@ -0,0 +1,170 @@ +export type InitApi = { + _CHILDREN: { + auth: { _CHILDREN: { session: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + backup: { + _CHILDREN: { + target: { _CHILDREN: { cifs: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + } + } & { _PARAMS: {} } + db: { _CHILDREN: { put: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + diagnostic: { + _CHILDREN: { + disk: { + _CHILDREN: { + forget: { _PARAMS: {}; _RETURN: null } + repair: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + disk: { _CHILDREN: { repair: { _PARAMS: {}; _RETURN: null } } } & { + _PARAMS: {} + } + "git-info": { _PARAMS: {}; _RETURN: string } + init: { + _CHILDREN: { + "kernel-logs": { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + logs: { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + subscribe: { + _PARAMS: {} + _RETURN: { progress: FullProgress; guid: Guid } + } + } + } & { _PARAMS: {} } + install: { _CHILDREN: { disk: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + kiosk: { _CHILDREN: {} } & { _PARAMS: {} } + net: { + _CHILDREN: { + acme: { _CHILDREN: {} } & { _PARAMS: {} } + dns: { + _CHILDREN: { + query: { _PARAMS: { fqdn: string }; _RETURN: string | null } + } + } & { _PARAMS: {} } + forward: { _CHILDREN: {} } & { _PARAMS: {} } + gateway: { _CHILDREN: {} } & { _PARAMS: {} } + tor: { _CHILDREN: { key: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + tunnel: { _CHILDREN: {} } & { _PARAMS: {} } + vhost: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + notification: { _CHILDREN: {} } & { _PARAMS: {} } + package: { + _CHILDREN: { + action: { _CHILDREN: {} } & { _PARAMS: {} } + backup: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: { host: HostId } } + binding: { _CHILDREN: {} } & { _PARAMS: { host: HostId } } + } + } & { _PARAMS: { package: PackageId } } + } + } & { _PARAMS: {} } + server: { + _CHILDREN: { + experimental: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + binding: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + metrics: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + setup: { + _CHILDREN: { + cifs: { _CHILDREN: {} } & { _PARAMS: {} } + disk: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + ssh: { _CHILDREN: {} } & { _PARAMS: {} } + state: { _PARAMS: {}; _RETURN: "error" | "initializing" | "running" } + util: { _CHILDREN: {} } & { _PARAMS: {} } + wifi: { + _CHILDREN: { + available: { _CHILDREN: {} } & { _PARAMS: {} } + country: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/main-api.ts b/sdk/base/lib/osBindings/main-api.ts new file mode 100644 index 000000000..f1bfdbac0 --- /dev/null +++ b/sdk/base/lib/osBindings/main-api.ts @@ -0,0 +1,1208 @@ +export type MainApi = { + _CHILDREN: { + auth: { + _CHILDREN: { + login: { + _PARAMS: { password: string; ephemeral: boolean } + _RETURN: { session: string } + } + logout: { _PARAMS: {}; _RETURN: null | null } + "reset-password": { + _PARAMS: { + oldPassword: PasswordType | null + newPassword: PasswordType | null + } + _RETURN: null + } + session: { + _CHILDREN: { + kill: { _PARAMS: { ids: Array }; _RETURN: null } + list: { + _PARAMS: {} + _RETURN: { current: string | null; sessions: Sessions } + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + backup: { + _CHILDREN: { + create: { + _PARAMS: { + targetId: BackupTargetId + oldPassword: PasswordType | null + packageIds: Array | null + password: PasswordType + } + _RETURN: null + } + target: { + _CHILDREN: { + cifs: { + _CHILDREN: { + add: { + _PARAMS: { + hostname: string + path: string + username: string + password: string | null + } + _RETURN: { + [T in string]: + | { + type: "disk" + vendor: string | null + model: string | null + logicalname: string + label: string | null + capacity: bigint + used: bigint | null + startOs: { [key: string]: StartOsRecoveryInfo } + guid: string | null + } + | ({ type: "cifs" } & CifsBackupTarget) + } + } + remove: { _PARAMS: { id: BackupTargetId }; _RETURN: null } + update: { + _PARAMS: { + id: BackupTargetId + hostname: string + path: string + username: string + password: string | null + } + _RETURN: { + [T in string]: + | { + type: "disk" + vendor: string | null + model: string | null + logicalname: string + label: string | null + capacity: bigint + used: bigint | null + startOs: { [key: string]: StartOsRecoveryInfo } + guid: string | null + } + | ({ type: "cifs" } & CifsBackupTarget) + } + } + } + } & { _PARAMS: {} } + info: { + _PARAMS: { + targetId: BackupTargetId + serverId: string + password: string + } + _RETURN: { + version: string + timestamp: string | null + packageBackups: { [key: PackageId]: PackageBackupInfo } + } + } + list: { + _PARAMS: {} + _RETURN: { + [key: string]: + | { + type: "disk" + vendor: string | null + model: string | null + logicalname: string + label: string | null + capacity: bigint + used: bigint | null + startOs: { [key: string]: StartOsRecoveryInfo } + guid: string | null + } + | ({ type: "cifs" } & CifsBackupTarget) + } + } + mount: { + _PARAMS: { + targetId: BackupTargetId + serverId: string | null + password: string + allowPartial: boolean + } + _RETURN: string + } + umount: { + _PARAMS: { targetId: BackupTargetId | null } + _RETURN: null + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + db: { + _CHILDREN: { + apply: { _PARAMS: { expr: string }; _RETURN: null } + dump: { + _PARAMS: { pointer: string | null } + _RETURN: { id: number; value: unknown } + } + put: { + _CHILDREN: { + ui: { _PARAMS: { pointer: string; value: any }; _RETURN: null } + } + } & { _PARAMS: {} } + subscribe: { + _PARAMS: { pointer: string | null } + _RETURN: { dump: { id: number; value: unknown }; guid: Guid } + } + } + } & { _PARAMS: {} } + diagnostic: { + _CHILDREN: { + disk: { + _CHILDREN: { + forget: { _PARAMS: {}; _RETURN: null } + repair: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + disk: { + _CHILDREN: { + list: { + _PARAMS: {} + _RETURN: Array<{ + logicalname: string + partitionTable: PartitionTable | null + vendor: string | null + model: string | null + partitions: Array + capacity: bigint + guid: string | null + }> + } + repair: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + echo: { _PARAMS: { message: string }; _RETURN: string } + "git-info": { _PARAMS: {}; _RETURN: string } + init: { _CHILDREN: {} } & { _PARAMS: {} } + install: { _CHILDREN: { disk: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + kiosk: { + _CHILDREN: { + disable: { _PARAMS: {}; _RETURN: null } + enable: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + net: { + _CHILDREN: { + acme: { + _CHILDREN: { + init: { + _PARAMS: { provider: AcmeProvider; contact: Array } + _RETURN: null + } + remove: { _PARAMS: { provider: AcmeProvider }; _RETURN: null } + } + } & { _PARAMS: {} } + dns: { + _CHILDREN: { + "dump-table": { + _PARAMS: {} + _RETURN: { [key: string]: string | null } + } + query: { _PARAMS: { fqdn: string }; _RETURN: string | null } + "set-static": { + _PARAMS: { servers: Array | null } + _RETURN: null + } + } + } & { _PARAMS: {} } + forward: { + _CHILDREN: { + "dump-table": { + _PARAMS: {} + _RETURN: { [key: number]: ForwardTarget } + } + } + } & { _PARAMS: {} } + gateway: { + _CHILDREN: { + forget: { _PARAMS: { gateway: GatewayId }; _RETURN: null } + list: { + _PARAMS: {} + _RETURN: { + [key: string]: { + name: string | null + public: boolean | null + secure: boolean | null + ipInfo: IpInfo | null + } + } + } + "set-name": { + _PARAMS: { id: GatewayId; name: string } + _RETURN: null + } + "set-public": { + _PARAMS: { gateway: GatewayId; public: boolean | null } + _RETURN: null + } + "unset-public": { _PARAMS: { gateway: GatewayId }; _RETURN: null } + } + } & { _PARAMS: {} } + tor: { + _CHILDREN: { + key: { + _CHILDREN: { + add: { _PARAMS: { key: Base64 }; _RETURN: string } + generate: { _PARAMS: {}; _RETURN: string } + list: { _PARAMS: {}; _RETURN: Array } + } + } & { _PARAMS: {} } + "list-services": { _PARAMS: {}; _RETURN: Array } + logs: { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + reset: { + _PARAMS: { wipeState: boolean; reason: string } + _RETURN: null + } + } + } & { _PARAMS: {} } + tunnel: { + _CHILDREN: { + add: { + _PARAMS: { name: string; config: string; public: boolean } + _RETURN: string + } + remove: { _PARAMS: { id: GatewayId }; _RETURN: null } + } + } & { _PARAMS: {} } + vhost: { + _CHILDREN: { + "dump-table": { + _PARAMS: {} + _RETURN: { [key: string]: { [key: string]: Array } } + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + notification: { + _CHILDREN: { + create: { + _PARAMS: { + package: PackageId | null + level: NotificationLevel + title: string + message: string + } + _RETURN: null + } + list: { + _PARAMS: { before: number | null; limit: number | null } + _RETURN: Array<{ + id: number + packageId: PackageId | null + createdAt: string + code: number + level: NotificationLevel + title: string + message: string + data: unknown + seen: boolean + }> + } + "mark-seen": { _PARAMS: { ids: number[] }; _RETURN: null } + "mark-seen-before": { _PARAMS: { before: number }; _RETURN: null } + "mark-unseen": { _PARAMS: { ids: number[] }; _RETURN: null } + remove: { _PARAMS: { ids: number[] }; _RETURN: null } + "remove-before": { _PARAMS: { before: number }; _RETURN: null } + } + } & { _PARAMS: {} } + package: { + _CHILDREN: { + action: { + _CHILDREN: { + "clear-task": { + _PARAMS: { + packageId: PackageId + replayId: ReplayId + force: boolean + } + _RETURN: null + } + "get-input": { + _PARAMS: { packageId: PackageId; actionId: ActionId } + _RETURN: { + eventId: Guid + spec: Record + value: Record | null + } | null + } + run: { + _PARAMS: { + packageId: PackageId + eventId: Guid | null + actionId: ActionId + input?: any + } + _RETURN: + | ({ version: "0" } & ActionResultV0) + | ({ version: "1" } & ActionResultV1) + | null + } + } + } & { _PARAMS: {} } + attach: { + _PARAMS: { + id: PackageId + command: string[] + tty: boolean + stderrTty: boolean + ptySize: TermSize | null + subcontainer: string | null + name: string | null + imageId: string | null + user: string | null + } + _RETURN: string + } + backup: { + _CHILDREN: { + restore: { + _PARAMS: { + ids: Array + targetId: BackupTargetId + password: string + } + _RETURN: null + } + } + } & { _PARAMS: {} } + "cancel-install": { _PARAMS: { id: PackageId }; _RETURN: null } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { + _CHILDREN: { + add: { _PARAMS: { fqdn: string }; _RETURN: null } + remove: { _PARAMS: { fqdn: string }; _RETURN: null } + } + } & { _PARAMS: {} } + public: { + _CHILDREN: { + add: { + _PARAMS: { + fqdn: string + acme: AcmeProvider | null + gateway: GatewayId + } + _RETURN: string | null + } + remove: { _PARAMS: { fqdn: string }; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + list: { + _PARAMS: {} + _RETURN: Array< + | { kind: "onion"; address: OnionAddress } + | { + kind: "domain" + address: string + public: PublicDomainConfig | null + private: boolean + } + > + } + onion: { + _CHILDREN: { + add: { _PARAMS: { onion: string }; _RETURN: null } + remove: { _PARAMS: { onion: string }; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: { host: HostId } } + binding: { + _CHILDREN: { + list: { + _PARAMS: {} + _RETURN: { + [key: number]: { + enabled: boolean + options: BindOptions + net: NetInfo + } + } + } + "set-gateway-enabled": { + _PARAMS: { + internalPort: number + gateway: GatewayId + enabled: boolean | null + } + _RETURN: null + } + } + } & { _PARAMS: { host: HostId } } + list: { _PARAMS: {}; _RETURN: Array } + } + } & { _PARAMS: { package: PackageId } } + install: { + _PARAMS: { registry: string; id: PackageId; version: Version } + _RETURN: null + } + "installed-version": { + _PARAMS: { id: PackageId } + _RETURN: string | null + } + list: { _PARAMS: {}; _RETURN: Array } + "list-subcontainers": { + _PARAMS: { id: PackageId } + _RETURN: { [key: string]: { name: string; imageId: ImageId } } + } + logs: { + _CHILDREN: { + follow: { + _PARAMS: { id: PackageId } & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: { id: PackageId } & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + rebuild: { _PARAMS: { id: PackageId }; _RETURN: null } + restart: { _PARAMS: { id: PackageId }; _RETURN: null } + sideload: { _PARAMS: {}; _RETURN: { upload: Guid; progress: Guid } } + start: { _PARAMS: { id: PackageId }; _RETURN: null } + stats: { + _PARAMS: {} + _RETURN: { + [key: string]: { + container_id: ContainerId + memory_usage: MiB + memory_limit: MiB + } | null + } + } + stop: { _PARAMS: { id: PackageId }; _RETURN: null } + uninstall: { + _PARAMS: { id: PackageId; soft: boolean; force: boolean } + _RETURN: null + } + } + } & { _PARAMS: {} } + registry: { + _CHILDREN: { + admin: { + _CHILDREN: { + add: { _PARAMS: { signer: Guid }; _RETURN: null } + list: { + _PARAMS: {} + _RETURN: { + [key: string]: { + name: string + contact: Array + keys: Array + } + } + } + remove: { _PARAMS: { signer: Guid }; _RETURN: null } + signer: { + _CHILDREN: { + add: { + _PARAMS: { + name: string + contact: Array + keys: Array + } + _RETURN: string + } + edit: { + _PARAMS: { + id: Guid + setName: string | null + addContact: Array + addKey: Array + removeContact: Array + removeKey: Array + } + _RETURN: null + } + list: { + _PARAMS: {} + _RETURN: { + [key: string]: { + name: string + contact: Array + keys: Array + } + } + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + db: { + _CHILDREN: { + apply: { + _PARAMS: { expr: string; path: string | null } + _RETURN: null + } + dump: { + _PARAMS: { pointer: string | null } + _RETURN: { id: number; value: unknown } + } + } + } & { _PARAMS: {} } + index: { + _PARAMS: {} + _RETURN: { + name: string | null + icon: DataUrl | null + package: PackageIndex + os: OsIndex + signers: { [key: Guid]: SignerInfo } + } + } + info: { + _CHILDREN: { + "set-icon": { _PARAMS: { icon: DataUrl }; _RETURN: null } + "set-name": { _PARAMS: { name: string }; _RETURN: null } + } + } & { + _PARAMS: {} + _RETURN: { + name: string | null + icon: DataUrl | null + categories: { [key: string]: Category } + } + } + os: { + _CHILDREN: { + asset: { + _CHILDREN: { + add: { + _CHILDREN: { + img: { + _PARAMS: { + version: string + platform: string + url: string + signature: AnySignature + commitment: Blake3Commitment + } + _RETURN: null + } + iso: { + _PARAMS: { + version: string + platform: string + url: string + signature: AnySignature + commitment: Blake3Commitment + } + _RETURN: null + } + squashfs: { + _PARAMS: { + version: string + platform: string + url: string + signature: AnySignature + commitment: Blake3Commitment + } + _RETURN: null + } + } + } & { _PARAMS: {} } + get: { + _CHILDREN: { + img: { + _PARAMS: { version: string; platform: string } + _RETURN: { + publishedAt: string + url: string + commitment: Blake3Commitment + signatures: { [key: AnyVerifyingKey]: AnySignature } + } + } + iso: { + _PARAMS: { version: string; platform: string } + _RETURN: { + publishedAt: string + url: string + commitment: Blake3Commitment + signatures: { [key: AnyVerifyingKey]: AnySignature } + } + } + squashfs: { + _PARAMS: { version: string; platform: string } + _RETURN: { + publishedAt: string + url: string + commitment: Blake3Commitment + signatures: { [key: AnyVerifyingKey]: AnySignature } + } + } + } + } & { _PARAMS: {} } + remove: { + _CHILDREN: { + img: { + _PARAMS: { version: string; platform: string } + _RETURN: null + } + iso: { + _PARAMS: { version: string; platform: string } + _RETURN: null + } + squashfs: { + _PARAMS: { version: string; platform: string } + _RETURN: null + } + } + } & { _PARAMS: {} } + sign: { + _CHILDREN: { + img: { + _PARAMS: { + version: string + platform: string + signature: AnySignature + } + _RETURN: null + } + iso: { + _PARAMS: { + version: string + platform: string + signature: AnySignature + } + _RETURN: null + } + squashfs: { + _PARAMS: { + version: string + platform: string + signature: AnySignature + } + _RETURN: null + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + index: { _PARAMS: {}; _RETURN: { versions: OsVersionInfoMap } } + version: { + _CHILDREN: { + add: { + _PARAMS: { + version: string + headline: string + releaseNotes: string + sourceVersion: string + } + _RETURN: null + } + get: { + _PARAMS: { + sourceVersion: string | null + targetVersion: string | null + serverId: string | null + platform: string | null + } + _RETURN: { + [key: string]: { + headline: string + releaseNotes: string + sourceVersion: string + authorized: Array + iso: { [key: string]: RegistryAsset } + squashfs: { + [key: string]: RegistryAsset + } + img: { [key: string]: RegistryAsset } + } + } + } + remove: { _PARAMS: { version: string }; _RETURN: null } + signer: { + _CHILDREN: { + add: { + _PARAMS: { version: string; signer: Guid } + _RETURN: null + } + list: { + _PARAMS: { version: string } + _RETURN: { + [key: string]: { + name: string + contact: Array + keys: Array + } + } + } + remove: { + _PARAMS: { version: string; signer: Guid } + _RETURN: null + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + package: { + _CHILDREN: { + add: { + _PARAMS: { + url: string + commitment: MerkleArchiveCommitment + signature: AnySignature + } + _RETURN: null + } + category: { + _CHILDREN: { + add: { _PARAMS: { id: string; name: string }; _RETURN: null } + "add-package": { + _PARAMS: { id: string; package: PackageId } + _RETURN: null + } + list: { + _PARAMS: {} + _RETURN: { [key: string]: { name: string } } + } + remove: { _PARAMS: { id: string }; _RETURN: null } + "remove-package": { + _PARAMS: { id: string; package: PackageId } + _RETURN: null + } + } + } & { _PARAMS: {} } + get: { + _PARAMS: { + id: PackageId | null + targetVersion: string | null + sourceVersion: Version | null + otherVersions: PackageDetailLevel + } + _RETURN: unknown + } + index: { + _PARAMS: {} + _RETURN: { + categories: { [key: string]: Category } + packages: { [key: PackageId]: PackageInfo } + } + } + remove: { + _PARAMS: { id: PackageId; version: Version } + _RETURN: null + } + signer: { + _CHILDREN: { + add: { _PARAMS: { id: PackageId; signer: Guid }; _RETURN: null } + list: { + _PARAMS: { id: PackageId } + _RETURN: { + [key: string]: { + name: string + contact: Array + keys: Array + } + } + } + remove: { + _PARAMS: { id: PackageId; signer: Guid } + _RETURN: null + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + server: { + _CHILDREN: { + "clear-smtp": { _PARAMS: {}; _RETURN: null } + experimental: { + _CHILDREN: { + governor: { + _PARAMS: { set: Governor | null } + _RETURN: { current: Governor | null; available: Array } + } + zram: { _PARAMS: { enable: boolean }; _RETURN: null } + } + } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { + _CHILDREN: { + add: { _PARAMS: { fqdn: string }; _RETURN: null } + remove: { _PARAMS: { fqdn: string }; _RETURN: null } + } + } & { _PARAMS: {} } + public: { + _CHILDREN: { + add: { + _PARAMS: { + fqdn: string + acme: AcmeProvider | null + gateway: GatewayId + } + _RETURN: string | null + } + remove: { _PARAMS: { fqdn: string }; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + list: { + _PARAMS: {} + _RETURN: Array< + | { kind: "onion"; address: OnionAddress } + | { + kind: "domain" + address: string + public: PublicDomainConfig | null + private: boolean + } + > + } + onion: { + _CHILDREN: { + add: { _PARAMS: { onion: string }; _RETURN: null } + remove: { _PARAMS: { onion: string }; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + binding: { + _CHILDREN: { + list: { + _PARAMS: {} + _RETURN: { + [key: number]: { + enabled: boolean + options: BindOptions + net: NetInfo + } + } + } + "set-gateway-enabled": { + _PARAMS: { + internalPort: number + gateway: GatewayId + enabled: boolean | null + } + _RETURN: null + } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + "kernel-logs": { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + logs: { + _CHILDREN: { + follow: { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { startCursor: string | null; guid: Guid } + } + } + } & { + _PARAMS: {} & { + limit: number | null + cursor: string | null + boot: string | number | null + before: boolean + } + _RETURN: { + entries: Array + startCursor: string | null + endCursor: string | null + } + } + metrics: { + _CHILDREN: { + follow: { _PARAMS: {}; _RETURN: { guid: Guid; metrics: Metrics } } + } + } & { + _PARAMS: {} + _RETURN: { + general: MetricsGeneral + memory: MetricsMemory + cpu: MetricsCpu + disk: MetricsDisk + } + } + rebuild: { _PARAMS: {}; _RETURN: null } + restart: { _PARAMS: {}; _RETURN: null } + "set-smtp": { + _PARAMS: { + server: string + port: number + from: string + login: string + password: string | null + } + _RETURN: null + } + shutdown: { _PARAMS: {}; _RETURN: null } + "test-smtp": { + _PARAMS: { + server: string + port: number + from: string + to: string + login: string + password: string + } + _RETURN: null + } + time: { _PARAMS: {}; _RETURN: { now: string; uptime: bigint } } + update: { + _PARAMS: { + registry: string + target: string | null + progress: boolean + } + _RETURN: { target: string | null; progress: string | null } + } + "update-firmware": { _PARAMS: {}; _RETURN: boolean } + } + } & { _PARAMS: {} } + setup: { + _CHILDREN: { + cifs: { _CHILDREN: {} } & { _PARAMS: {} } + disk: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + ssh: { + _CHILDREN: { + add: { + _PARAMS: { key: SshPubKey } + _RETURN: { + alg: string + fingerprint: string + hostname: string + createdAt: string + } + } + list: { + _PARAMS: {} + _RETURN: Array<{ + alg: string + fingerprint: string + hostname: string + createdAt: string + }> + } + remove: { _PARAMS: { fingerprint: string }; _RETURN: null } + } + } & { _PARAMS: {} } + state: { _PARAMS: {}; _RETURN: "error" | "initializing" | "running" } + tunnel: { + _CHILDREN: { + auth: { + _CHILDREN: { + key: { + _CHILDREN: { + add: { + _PARAMS: { name: string; key: AnyVerifyingKey } + _RETURN: null + } + list: { + _PARAMS: {} + _RETURN: { [key: string]: { name: string } } + } + remove: { _PARAMS: { key: AnyVerifyingKey }; _RETURN: null } + } + } & { _PARAMS: {} } + login: { + _PARAMS: { password: string; ephemeral: boolean } + _RETURN: { session: string } + } + logout: { _PARAMS: {}; _RETURN: null | null } + "set-password": { _PARAMS: { password: string }; _RETURN: null } + } + } & { _PARAMS: {} } + db: { + _CHILDREN: { + apply: { + _PARAMS: { expr: string; path: string | null } + _RETURN: null + } + dump: { + _PARAMS: { pointer: string | null } + _RETURN: { id: number; value: unknown } + } + subscribe: { + _PARAMS: { pointer: string | null } + _RETURN: { dump: { id: number; value: unknown }; guid: Guid } + } + } + } & { _PARAMS: {} } + device: { + _CHILDREN: { + add: { + _PARAMS: { subnet: string; name: string; ip: string | null } + _RETURN: null + } + list: { + _PARAMS: { subnet: string } + _RETURN: { name: string; clients: WgSubnetClients } + } + remove: { _PARAMS: { subnet: string; ip: string }; _RETURN: null } + "show-config": { + _PARAMS: { subnet: string; ip: string; wanAddr: string | null } + _RETURN: string + } + } + } & { _PARAMS: {} } + "port-forward": { + _CHILDREN: { + add: { _PARAMS: { source: string; target: string }; _RETURN: null } + remove: { _PARAMS: { source: string }; _RETURN: null } + } + } & { _PARAMS: {} } + subnet: { + _CHILDREN: { + add: { _PARAMS: { name: string }; _RETURN: null } + remove: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: { subnet: string } } + web: { + _CHILDREN: { + disable: { _PARAMS: {}; _RETURN: null } + enable: { _PARAMS: {}; _RETURN: null } + "generate-certificate": { + _PARAMS: { subject: Array } + _RETURN: string + } + "get-available-ips": { _PARAMS: {}; _RETURN: Array } + "get-certificate": { _PARAMS: {}; _RETURN: string | null } + "get-listen": { _PARAMS: {}; _RETURN: string | null } + "import-certificate": { + _PARAMS: { key: Pem; cert: Pem } + _RETURN: null + } + reset: { _PARAMS: {}; _RETURN: null } + "set-listen": { _PARAMS: { listen: string }; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + util: { _CHILDREN: {} } & { _PARAMS: {} } + wifi: { + _CHILDREN: { + add: { _PARAMS: { ssid: string; password: string }; _RETURN: null } + available: { + _CHILDREN: { + get: { + _PARAMS: {} + _RETURN: Array<{ + ssid: Ssid + strength: SignalStrength + security: Array + }> + } + } + } & { _PARAMS: {} } + connect: { _PARAMS: { ssid: string }; _RETURN: null } + country: { + _CHILDREN: { set: { _PARAMS: { country: string }; _RETURN: null } } + } & { _PARAMS: {} } + get: { + _PARAMS: {} + _RETURN: { + ssids: { [key: Ssid]: SignalStrength } + connected: Ssid | null + country: sttring | null + ethernet: boolean + availableWifi: Array + } + } + remove: { _PARAMS: { ssid: string }; _RETURN: null } + "set-enabled": { _PARAMS: { enabled: boolean }; _RETURN: null } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/manifest/Alerts.ts b/sdk/base/lib/osBindings/manifest/Alerts.ts new file mode 100644 index 000000000..819d1c407 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/Alerts.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Alerts = { + install: string | null + uninstall: string | null + restore: string | null + start: string | null + stop: string | null +} diff --git a/sdk/base/lib/osBindings/manifest/BuildArg.ts b/sdk/base/lib/osBindings/manifest/BuildArg.ts new file mode 100644 index 000000000..1157828f5 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/BuildArg.ts @@ -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 BuildArg = string | { env: string } diff --git a/sdk/base/lib/osBindings/DependencyMetadata.ts b/sdk/base/lib/osBindings/manifest/DepInfo.ts similarity index 56% rename from sdk/base/lib/osBindings/DependencyMetadata.ts rename to sdk/base/lib/osBindings/manifest/DepInfo.ts index 3d56ef052..47e2c9b2e 100644 --- a/sdk/base/lib/osBindings/DependencyMetadata.ts +++ b/sdk/base/lib/osBindings/manifest/DepInfo.ts @@ -1,9 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { DataUrl } from "./DataUrl" +import type { MetadataSrc } from "./MetadataSrc" -export type DependencyMetadata = { - title: string | null - icon: DataUrl | null +export type DepInfo = { description: string | null optional: boolean -} +} & MetadataSrc diff --git a/sdk/base/lib/osBindings/CheckDependenciesParam.ts b/sdk/base/lib/osBindings/manifest/Dependencies.ts similarity index 61% rename from sdk/base/lib/osBindings/CheckDependenciesParam.ts rename to sdk/base/lib/osBindings/manifest/Dependencies.ts index 3a00faf4f..ad4c9b745 100644 --- a/sdk/base/lib/osBindings/CheckDependenciesParam.ts +++ b/sdk/base/lib/osBindings/manifest/Dependencies.ts @@ -1,4 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DepInfo } from "./DepInfo" import type { PackageId } from "./PackageId" -export type CheckDependenciesParam = { packageIds?: Array } +export type Dependencies = { [key: PackageId]: DepInfo } diff --git a/sdk/base/lib/osBindings/manifest/Description.ts b/sdk/base/lib/osBindings/manifest/Description.ts new file mode 100644 index 000000000..bcb92071f --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/Description.ts @@ -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 Description = { short: string; long: string } diff --git a/sdk/base/lib/osBindings/Cifs.ts b/sdk/base/lib/osBindings/manifest/DeviceFilter.ts similarity index 50% rename from sdk/base/lib/osBindings/Cifs.ts rename to sdk/base/lib/osBindings/manifest/DeviceFilter.ts index f7099bd7f..6e6f5810c 100644 --- a/sdk/base/lib/osBindings/Cifs.ts +++ b/sdk/base/lib/osBindings/manifest/DeviceFilter.ts @@ -1,8 +1,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -export type Cifs = { - hostname: string - path: string - username: string - password: string | null +export type DeviceFilter = { + class: "processor" | "display" + pattern: string + patternDescription: string } diff --git a/sdk/base/lib/osBindings/tunnel/Base64.ts b/sdk/base/lib/osBindings/manifest/GitHash.ts similarity index 79% rename from sdk/base/lib/osBindings/tunnel/Base64.ts rename to sdk/base/lib/osBindings/manifest/GitHash.ts index 597227fc9..43f6adde3 100644 --- a/sdk/base/lib/osBindings/tunnel/Base64.ts +++ b/sdk/base/lib/osBindings/manifest/GitHash.ts @@ -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 Base64 = string +export type GitHash = string diff --git a/sdk/base/lib/osBindings/manifest/HardwareRequirements.ts b/sdk/base/lib/osBindings/manifest/HardwareRequirements.ts new file mode 100644 index 000000000..d420f846b --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/HardwareRequirements.ts @@ -0,0 +1,8 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DeviceFilter } from "./DeviceFilter" + +export type HardwareRequirements = { + device: Array + ram: number | null + arch: string[] | null +} diff --git a/sdk/base/lib/osBindings/manifest/ImageConfig.ts b/sdk/base/lib/osBindings/manifest/ImageConfig.ts new file mode 100644 index 000000000..2b1033b83 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/ImageConfig.ts @@ -0,0 +1,8 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ImageSource } from "./ImageSource" + +export type ImageConfig = { + source: ImageSource + arch: string[] + emulateMissingAs: string | null +} diff --git a/sdk/base/lib/osBindings/manifest/ImageId.ts b/sdk/base/lib/osBindings/manifest/ImageId.ts new file mode 100644 index 000000000..330b812b9 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/ImageId.ts @@ -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 ImageId = string diff --git a/sdk/base/lib/osBindings/manifest/ImageSource.ts b/sdk/base/lib/osBindings/manifest/ImageSource.ts new file mode 100644 index 000000000..d8f876aef --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/ImageSource.ts @@ -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 { BuildArg } from "./BuildArg" + +export type ImageSource = + | "packed" + | { + dockerBuild: { + workdir?: string + dockerfile?: string + buildArgs?: { [key: string]: BuildArg } + } + } + | { dockerTag: string } diff --git a/sdk/base/lib/osBindings/PackageVersionInfo.ts b/sdk/base/lib/osBindings/manifest/Manifest.ts similarity index 61% rename from sdk/base/lib/osBindings/PackageVersionInfo.ts rename to sdk/base/lib/osBindings/manifest/Manifest.ts index f131dedae..8e44e2056 100644 --- a/sdk/base/lib/osBindings/PackageVersionInfo.ts +++ b/sdk/base/lib/osBindings/manifest/Manifest.ts @@ -1,20 +1,23 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { Alerts } from "./Alerts" -import type { DataUrl } from "./DataUrl" -import type { DependencyMetadata } from "./DependencyMetadata" +import type { Dependencies } from "./Dependencies" import type { Description } from "./Description" import type { GitHash } from "./GitHash" import type { HardwareRequirements } from "./HardwareRequirements" -import type { MerkleArchiveCommitment } from "./MerkleArchiveCommitment" +import type { ImageConfig } from "./ImageConfig" +import type { ImageId } from "./ImageId" import type { PackageId } from "./PackageId" -import type { RegistryAsset } from "./RegistryAsset" +import type { Version } from "./Version" +import type { VolumeId } from "./VolumeId" -export type PackageVersionInfo = { +export type Manifest = { + id: PackageId title: string - icon: DataUrl - description: Description + version: Version + satisfies: Array releaseNotes: string - gitHash: GitHash | null + canMigrateTo: string + canMigrateFrom: string license: string wrapperRepo: string upstreamRepo: string @@ -22,11 +25,13 @@ export type PackageVersionInfo = { marketingSite: string donationUrl: string | null docsUrl: string | null + description: Description + images: { [key: ImageId]: ImageConfig } + volumes: Array alerts: Alerts - dependencyMetadata: { [key: PackageId]: DependencyMetadata } + dependencies: Dependencies + hardwareRequirements: HardwareRequirements + gitHash: GitHash | null osVersion: string sdkVersion: string | null - hardwareRequirements: HardwareRequirements - sourceVersion: string | null - s9pk: RegistryAsset } diff --git a/sdk/base/lib/osBindings/AddAdminParams.ts b/sdk/base/lib/osBindings/manifest/Metadata.ts similarity index 51% rename from sdk/base/lib/osBindings/AddAdminParams.ts rename to sdk/base/lib/osBindings/manifest/Metadata.ts index 9da08b54b..0ea43923e 100644 --- a/sdk/base/lib/osBindings/AddAdminParams.ts +++ b/sdk/base/lib/osBindings/manifest/Metadata.ts @@ -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 { Guid } from "./Guid" +import type { PathOrUrl } from "./PathOrUrl" -export type AddAdminParams = { signer: Guid } +export type Metadata = { title: string; icon: PathOrUrl } diff --git a/sdk/base/lib/osBindings/manifest/MetadataSrc.ts b/sdk/base/lib/osBindings/manifest/MetadataSrc.ts new file mode 100644 index 000000000..7a386636d --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/MetadataSrc.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Metadata } from "./Metadata" +import type { PathOrUrl } from "./PathOrUrl" + +export type MetadataSrc = { metadata: Metadata } | { s9pk: PathOrUrl | null } diff --git a/sdk/base/lib/osBindings/manifest/PackageId.ts b/sdk/base/lib/osBindings/manifest/PackageId.ts new file mode 100644 index 000000000..9e3403303 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/PackageId.ts @@ -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 PackageId = string diff --git a/sdk/base/lib/osBindings/manifest/PathOrUrl.ts b/sdk/base/lib/osBindings/manifest/PathOrUrl.ts new file mode 100644 index 000000000..9c4ff1e28 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/PathOrUrl.ts @@ -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 PathOrUrl = string diff --git a/sdk/base/lib/osBindings/manifest/Version.ts b/sdk/base/lib/osBindings/manifest/Version.ts new file mode 100644 index 000000000..b49b6e887 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/Version.ts @@ -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 Version = string diff --git a/sdk/base/lib/osBindings/manifest/VolumeId.ts b/sdk/base/lib/osBindings/manifest/VolumeId.ts new file mode 100644 index 000000000..b4657af4c --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/VolumeId.ts @@ -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 VolumeId = string diff --git a/sdk/base/lib/osBindings/manifest/index.ts b/sdk/base/lib/osBindings/manifest/index.ts new file mode 100644 index 000000000..8e4f9ffa4 --- /dev/null +++ b/sdk/base/lib/osBindings/manifest/index.ts @@ -0,0 +1,18 @@ +export * from "./Manifest" +export * from "./Description" +export * from "./Alerts" +export * from "./ImageId" +export * from "./ImageConfig" +export * from "./ImageSource" +export * from "./BuildArg" +export * from "./PackageId" +export * from "./HardwareRequirements" +export * from "./DeviceFilter" +export * from "./Dependencies" +export * from "./DepInfo" +export * from "./MetadataSrc" +export * from "./PathOrUrl" +export * from "./Metadata" +export * from "./GitHash" +export * from "./VolumeId" +export * from "./Version" diff --git a/sdk/base/lib/osBindings/os-install-api.ts b/sdk/base/lib/osBindings/os-install-api.ts new file mode 100644 index 000000000..2b589214c --- /dev/null +++ b/sdk/base/lib/osBindings/os-install-api.ts @@ -0,0 +1,134 @@ +export type OsInstallApi = { + _CHILDREN: { + auth: { _CHILDREN: { session: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + backup: { + _CHILDREN: { + target: { _CHILDREN: { cifs: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + } + } & { _PARAMS: {} } + db: { _CHILDREN: { put: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + diagnostic: { + _CHILDREN: { + disk: { + _CHILDREN: { + forget: { _PARAMS: {}; _RETURN: null } + repair: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + disk: { _CHILDREN: { repair: { _PARAMS: {}; _RETURN: null } } } & { + _PARAMS: {} + } + "git-info": { _PARAMS: {}; _RETURN: string } + init: { _CHILDREN: {} } & { _PARAMS: {} } + install: { + _CHILDREN: { + disk: { + _CHILDREN: { + list: { + _PARAMS: {} + _RETURN: Array<{ + logicalname: string + partitionTable: PartitionTable | null + vendor: string | null + model: string | null + partitions: Array + capacity: bigint + guid: string | null + }> + } + } + } & { _PARAMS: {} } + execute: { + _PARAMS: { logicalname: string; overwrite: boolean } + _RETURN: null + } + reboot: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + kiosk: { _CHILDREN: {} } & { _PARAMS: {} } + net: { + _CHILDREN: { + acme: { _CHILDREN: {} } & { _PARAMS: {} } + dns: { + _CHILDREN: { + query: { _PARAMS: { fqdn: string }; _RETURN: string | null } + } + } & { _PARAMS: {} } + forward: { _CHILDREN: {} } & { _PARAMS: {} } + gateway: { _CHILDREN: {} } & { _PARAMS: {} } + tor: { _CHILDREN: { key: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + tunnel: { _CHILDREN: {} } & { _PARAMS: {} } + vhost: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + notification: { _CHILDREN: {} } & { _PARAMS: {} } + package: { + _CHILDREN: { + action: { _CHILDREN: {} } & { _PARAMS: {} } + backup: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: { host: HostId } } + binding: { _CHILDREN: {} } & { _PARAMS: { host: HostId } } + } + } & { _PARAMS: { package: PackageId } } + } + } & { _PARAMS: {} } + server: { + _CHILDREN: { + experimental: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + binding: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + metrics: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + setup: { + _CHILDREN: { + cifs: { _CHILDREN: {} } & { _PARAMS: {} } + disk: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + ssh: { _CHILDREN: {} } & { _PARAMS: {} } + util: { _CHILDREN: {} } & { _PARAMS: {} } + wifi: { + _CHILDREN: { + available: { _CHILDREN: {} } & { _PARAMS: {} } + country: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/service-effects-api.ts b/sdk/base/lib/osBindings/service-effects-api.ts new file mode 100644 index 000000000..4452d5ebc --- /dev/null +++ b/sdk/base/lib/osBindings/service-effects-api.ts @@ -0,0 +1,238 @@ +export type ServiceEffectsApi = { + _CHILDREN: { + action: { + _CHILDREN: { + clear: { _PARAMS: { except: Array }; _RETURN: null } + "clear-tasks": { + _PARAMS: { only: string[] } | { except: string[] } + _RETURN: null + } + "create-task": { + _PARAMS: { + replayId: ReplayId + packageId: PackageId + actionId: ActionId + severity: TaskSeverity + reason?: string + when?: TaskTrigger + input?: TaskInput + } + _RETURN: null + } + export: { + _PARAMS: { id: ActionId; metadata: ActionMetadata } + _RETURN: null + } + "get-input": { + _PARAMS: { packageId?: PackageId; actionId: ActionId } + _RETURN: { + eventId: Guid + spec: Record + value: Record | null + } | null + } + run: { + _PARAMS: { + packageId?: PackageId + actionId: ActionId + input?: unknown + } + _RETURN: + | ({ version: "0" } & ActionResultV0) + | ({ version: "1" } & ActionResultV1) + | null + } + } + } & { _PARAMS: {} } + bind: { + _PARAMS: { + id: HostId + internalPort: number + preferredExternalPort: number + addSsl: AddSslOptions | null + secure: Security | null + } + _RETURN: null + } + "check-dependencies": { + _PARAMS: { packageIds?: Array } + _RETURN: Array<{ + packageId: PackageId + title: string | null + installedVersion: Version | null + satisfies: Array + isRunning: boolean + tasks: { [key: ReplayId]: TaskEntry } + healthChecks: { [key: HealthCheckId]: NamedHealthCheckResult } + }> + } + "clear-bindings": { _PARAMS: { except: Array }; _RETURN: null } + "clear-callbacks": { + _PARAMS: { only: number[] } | { except: number[] } + _RETURN: null + } + "clear-service-interfaces": { + _PARAMS: { except: Array } + _RETURN: null + } + echo: { _PARAMS: { message: string }; _RETURN: string } + "export-service-interface": { + _PARAMS: { + id: ServiceInterfaceId + name: string + description: string + masked: boolean + addressInfo: AddressInfo + type: ServiceInterfaceType + } + _RETURN: null + } + "get-container-ip": { + _PARAMS: { packageId?: PackageId; callback?: CallbackId } + _RETURN: string | null + } + "get-data-version": { _PARAMS: {}; _RETURN: string | null } + "get-dependencies": { + _PARAMS: {} + _RETURN: Array< + | { + kind: "running" + id: PackageId + healthChecks: Array + versionRange: string + } + | { kind: "exists"; id: PackageId; versionRange: string } + > + } + "get-host-info": { + _PARAMS: { hostId: HostId; packageId?: PackageId; callback?: CallbackId } + _RETURN: { + bindings: { [key: number]: BindInfo } + onions: string[] + publicDomains: { [key: string]: PublicDomainConfig } + privateDomains: Array + /** + * COMPUTED: NetService::update + */ + hostnameInfo: { [key: number]: Array } + } | null + } + "get-installed-packages": { _PARAMS: {}; _RETURN: Array } + "get-os-ip": { _PARAMS: {}; _RETURN: string } + "get-service-interface": { + _PARAMS: { + packageId?: PackageId + serviceInterfaceId: ServiceInterfaceId + callback?: CallbackId + } + _RETURN: { + id: ServiceInterfaceId + name: string + description: string + masked: boolean + addressInfo: AddressInfo + type: ServiceInterfaceType + } | null + } + "get-service-port-forward": { + _PARAMS: { packageId?: PackageId; hostId: HostId; internalPort: number } + _RETURN: { + privateDisabled: Array + publicEnabled: Array + assignedPort: number | null + assignedSslPort: number | null + } + } + "get-ssl-certificate": { + _PARAMS: { + hostnames: string[] + algorithm?: Algorithm + callback?: CallbackId + } + _RETURN: Array + } + "get-ssl-key": { + _PARAMS: { hostnames: string[]; algorithm?: Algorithm } + _RETURN: string + } + "get-status": { + _PARAMS: { packageId?: PackageId; callback?: CallbackId } + _RETURN: + | { + main: "error" + onRebuild: StartStop + message: string + debug: string | null + } + | { main: "stopped" } + | { main: "restarting" } + | { main: "stopping" } + | { + main: "starting" + health: { [key: HealthCheckId]: NamedHealthCheckResult } + } + | { + main: "running" + started: string + health: { [key: HealthCheckId]: NamedHealthCheckResult } + } + | { main: "backingUp"; onComplete: StartStop } + } + "get-system-smtp": { + _PARAMS: { callback: CallbackId | null } + _RETURN: { + server: string + port: number + from: string + login: string + password: string | null + } | null + } + "git-info": { _PARAMS: {}; _RETURN: string } + "list-service-interfaces": { + _PARAMS: { packageId?: PackageId; callback?: CallbackId } + _RETURN: { + [key: string]: { + id: ServiceInterfaceId + name: string + description: string + masked: boolean + addressInfo: AddressInfo + type: ServiceInterfaceType + } + } + } + mount: { _PARAMS: { location: string; target: MountTarget }; _RETURN: null } + rebuild: { _PARAMS: {}; _RETURN: null } + restart: { _PARAMS: { eventId: Guid }; _RETURN: null } + "set-data-version": { _PARAMS: { version: string }; _RETURN: null } + "set-dependencies": { + _PARAMS: { dependencies: Array } + _RETURN: null + } + "set-health": { + _PARAMS: { id: HealthCheckId; name: string } & ( + | { result: "success"; message: string | null } + | { result: "disabled"; message: string | null } + | { result: "starting"; message: string | null } + | { result: "loading"; message: string } + | { result: "failure"; message: string } + ) + _RETURN: null + } + "set-main-status": { + _PARAMS: { status: SetMainStatusStatus } + _RETURN: null + } + shutdown: { _PARAMS: { eventId: Guid }; _RETURN: null } + subcontainer: { + _CHILDREN: { + "create-fs": { + _PARAMS: { imageId: ImageId; name: string | null } + _RETURN: [string, string] + } + "destroy-fs": { _PARAMS: { guid: Guid }; _RETURN: null } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/setup-api.ts b/sdk/base/lib/osBindings/setup-api.ts new file mode 100644 index 000000000..847304d1c --- /dev/null +++ b/sdk/base/lib/osBindings/setup-api.ts @@ -0,0 +1,183 @@ +export type SetupApi = { + _CHILDREN: { + auth: { _CHILDREN: { session: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + backup: { + _CHILDREN: { + target: { _CHILDREN: { cifs: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + } + } & { _PARAMS: {} } + db: { _CHILDREN: { put: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + diagnostic: { + _CHILDREN: { + disk: { + _CHILDREN: { + forget: { _PARAMS: {}; _RETURN: null } + repair: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + disk: { _CHILDREN: { repair: { _PARAMS: {}; _RETURN: null } } } & { + _PARAMS: {} + } + "git-info": { _PARAMS: {}; _RETURN: string } + init: { _CHILDREN: {} } & { _PARAMS: {} } + install: { _CHILDREN: { disk: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + kiosk: { _CHILDREN: {} } & { _PARAMS: {} } + net: { + _CHILDREN: { + acme: { _CHILDREN: {} } & { _PARAMS: {} } + dns: { + _CHILDREN: { + query: { _PARAMS: { fqdn: string }; _RETURN: string | null } + } + } & { _PARAMS: {} } + forward: { _CHILDREN: {} } & { _PARAMS: {} } + gateway: { _CHILDREN: {} } & { _PARAMS: {} } + tor: { _CHILDREN: { key: { _CHILDREN: {} } & { _PARAMS: {} } } } & { + _PARAMS: {} + } + tunnel: { _CHILDREN: {} } & { _PARAMS: {} } + vhost: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + notification: { _CHILDREN: {} } & { _PARAMS: {} } + package: { + _CHILDREN: { + action: { _CHILDREN: {} } & { _PARAMS: {} } + backup: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: { host: HostId } } + binding: { _CHILDREN: {} } & { _PARAMS: { host: HostId } } + } + } & { _PARAMS: { package: PackageId } } + } + } & { _PARAMS: {} } + server: { + _CHILDREN: { + experimental: { _CHILDREN: {} } & { _PARAMS: {} } + host: { + _CHILDREN: { + address: { + _CHILDREN: { + domain: { + _CHILDREN: { + private: { _CHILDREN: {} } & { _PARAMS: {} } + public: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + onion: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + binding: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + metrics: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + setup: { + _CHILDREN: { + attach: { + _PARAMS: { + startOsPassword: EncryptedWire | null + guid: string + kiosk?: boolean + } + _RETURN: { progress: FullProgress; guid: Guid } + } + cifs: { + _CHILDREN: { + verify: { + _PARAMS: { + hostname: string + path: string + username: string + password: EncryptedWire | null + } + _RETURN: { + [key: string]: { + hostname: Hostname + version: string + timestamp: string + passwordHash: string | null + wrappedKey: string | null + } + } + } + } + } & { _PARAMS: {} } + complete: { + _PARAMS: {} + _RETURN: { + torAddresses: Array + hostname: string + lanAddress: string + rootCa: string + } + } + disk: { + _CHILDREN: { + list: { + _PARAMS: {} + _RETURN: Array<{ + logicalname: string + partitionTable: PartitionTable | null + vendor: string | null + model: string | null + partitions: Array + capacity: bigint + guid: string | null + }> + } + } + } & { _PARAMS: {} } + execute: { + _PARAMS: { + startOsLogicalname: string + startOsPassword: EncryptedWire + recoverySource: RecoverySource | null + kiosk?: boolean + } + _RETURN: { progress: FullProgress; guid: Guid } + } + exit: { _PARAMS: {}; _RETURN: null } + "get-pubkey": { _PARAMS: {}; _RETURN: unknown } + restart: { _PARAMS: {}; _RETURN: null } + status: { + _PARAMS: {} + _RETURN: + | ({ status: "complete" } & SetupResult) + | ({ status: "running" } & SetupProgress) + | null + } + } + } & { _PARAMS: {} } + ssh: { _CHILDREN: {} } & { _PARAMS: {} } + util: { _CHILDREN: {} } & { _PARAMS: {} } + wifi: { + _CHILDREN: { + available: { _CHILDREN: {} } & { _PARAMS: {} } + country: { _CHILDREN: {} } & { _PARAMS: {} } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/tunnel-api.ts b/sdk/base/lib/osBindings/tunnel-api.ts new file mode 100644 index 000000000..9137538f6 --- /dev/null +++ b/sdk/base/lib/osBindings/tunnel-api.ts @@ -0,0 +1,85 @@ +export type TunnelApi = { + _CHILDREN: { + auth: { + _CHILDREN: { + key: { + _CHILDREN: { + add: { + _PARAMS: { name: string; key: AnyVerifyingKey } + _RETURN: null + } + list: { _PARAMS: {}; _RETURN: { [key: string]: { name: string } } } + remove: { _PARAMS: { key: AnyVerifyingKey }; _RETURN: null } + } + } & { _PARAMS: {} } + login: { + _PARAMS: { password: string; ephemeral: boolean } + _RETURN: { session: string } + } + logout: { _PARAMS: {}; _RETURN: null | null } + "set-password": { _PARAMS: { password: string }; _RETURN: null } + } + } & { _PARAMS: {} } + db: { + _CHILDREN: { + apply: { _PARAMS: { expr: string; path: string | null }; _RETURN: null } + dump: { + _PARAMS: { pointer: string | null } + _RETURN: { id: number; value: unknown } + } + subscribe: { + _PARAMS: { pointer: string | null } + _RETURN: { dump: { id: number; value: unknown }; guid: Guid } + } + } + } & { _PARAMS: {} } + device: { + _CHILDREN: { + add: { + _PARAMS: { subnet: string; name: string; ip: string | null } + _RETURN: null + } + list: { + _PARAMS: { subnet: string } + _RETURN: { name: string; clients: WgSubnetClients } + } + remove: { _PARAMS: { subnet: string; ip: string }; _RETURN: null } + "show-config": { + _PARAMS: { subnet: string; ip: string; wanAddr: string | null } + _RETURN: string + } + } + } & { _PARAMS: {} } + "port-forward": { + _CHILDREN: { + add: { _PARAMS: { source: string; target: string }; _RETURN: null } + remove: { _PARAMS: { source: string }; _RETURN: null } + } + } & { _PARAMS: {} } + subnet: { + _CHILDREN: { + add: { _PARAMS: { name: string }; _RETURN: null } + remove: { _PARAMS: {}; _RETURN: null } + } + } & { _PARAMS: { subnet: string } } + web: { + _CHILDREN: { + disable: { _PARAMS: {}; _RETURN: null } + enable: { _PARAMS: {}; _RETURN: null } + "generate-certificate": { + _PARAMS: { subject: Array } + _RETURN: string + } + "get-available-ips": { _PARAMS: {}; _RETURN: Array } + "get-certificate": { _PARAMS: {}; _RETURN: string | null } + "get-listen": { _PARAMS: {}; _RETURN: string | null } + "import-certificate": { + _PARAMS: { key: Pem; cert: Pem } + _RETURN: null + } + reset: { _PARAMS: {}; _RETURN: null } + "set-listen": { _PARAMS: { listen: string }; _RETURN: null } + } + } & { _PARAMS: {} } + } +} & { _PARAMS: {} } diff --git a/sdk/base/lib/osBindings/tunnel/AnyVerifyingKey.ts b/sdk/base/lib/osBindings/tunnel/AnyVerifyingKey.ts deleted file mode 100644 index 58a45aaa7..000000000 --- a/sdk/base/lib/osBindings/tunnel/AnyVerifyingKey.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type AnyVerifyingKey = string diff --git a/sdk/base/lib/osBindings/tunnel/Session.ts b/sdk/base/lib/osBindings/tunnel/Session.ts deleted file mode 100644 index 36ebd2766..000000000 --- a/sdk/base/lib/osBindings/tunnel/Session.ts +++ /dev/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. - -export type Session = { - loggedIn: string - lastActive: string - userAgent: string | null -} diff --git a/sdk/base/lib/osBindings/tunnel/Sessions.ts b/sdk/base/lib/osBindings/tunnel/Sessions.ts deleted file mode 100644 index 6a15449e2..000000000 --- a/sdk/base/lib/osBindings/tunnel/Sessions.ts +++ /dev/null @@ -1,4 +0,0 @@ -// 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]: Session } diff --git a/sdk/base/lib/osBindings/tunnel/SignerInfo.ts b/sdk/base/lib/osBindings/tunnel/SignerInfo.ts deleted file mode 100644 index 76cbdafce..000000000 --- a/sdk/base/lib/osBindings/tunnel/SignerInfo.ts +++ /dev/null @@ -1,3 +0,0 @@ -// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. - -export type SignerInfo = { name: string } diff --git a/sdk/base/lib/types.ts b/sdk/base/lib/types.ts index 87bc3f11a..ea63d8582 100644 --- a/sdk/base/lib/types.ts +++ b/sdk/base/lib/types.ts @@ -1,18 +1,20 @@ export * as inputSpecTypes from "./actions/input/inputSpecTypes" -import { - DependencyRequirement, - NamedHealthCheckResult, - Manifest, - ServiceInterface, - ActionId, -} from "./osBindings" -import { Affine, StringObject, ToKebab } from "./util" +import { StringObject, ToKebab } from "./util" import { Action, Actions } from "./actions/setupActions" import { Effects } from "./Effects" import { ExtendedVersion, VersionRange } from "./exver" export { Effects } +import * as bindings from "./osBindings" export * from "./osBindings" +export * from "./osBindings/action" +export * from "./osBindings/manifest" +export { + CheckDependenciesResult, + NamedHealthCheckResult, + HealthCheckId, + DependencyRequirement, +} from "./osBindings/dependencies" export { SDKManifest } from "./types/ManifestTypes" export { RequiredDependenciesOf as RequiredDependencies, @@ -65,9 +67,11 @@ export namespace ExpectedExports { target: ExtendedVersion | VersionRange | null }) => Promise - export type manifest = Manifest + export type manifest = bindings.manifest.Manifest - export type actions = Actions>> + export type actions = Actions< + Record> + > } export type ABI = { createBackup: ExpectedExports.createBackup @@ -90,7 +94,8 @@ export type Daemon = { [DaemonProof]: never } -export type HealthStatus = NamedHealthCheckResult["result"] +export type HealthStatus = + bindings.dependencies.NamedHealthCheckResult["result"] export type SmtpValue = { server: string port: number @@ -120,10 +125,6 @@ export declare const hostName: unique symbol // asdflkjadsf.onion | 1.2.3.4 export type Hostname = string & { [hostName]: never } -export type ServiceInterfaceId = string - -export { ServiceInterface } - export type EffectMethod = { [K in keyof T]-?: K extends string ? T[K] extends Function @@ -178,7 +179,7 @@ export type KnownError = errorCode: [number, string] | readonly [number, string] } -export type Dependencies = Array +export type Dependencies = Array export type DeepPartial = T extends [infer A, ...infer Rest] ? [DeepPartial, ...DeepPartial]