diff --git a/core/Cargo.lock b/core/Cargo.lock index 24a641819..602c16ae3 100644 --- a/core/Cargo.lock +++ b/core/Cargo.lock @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "arrayref" @@ -224,18 +224,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -247,16 +247,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "atomic-write-file" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8204db279bf648d64fe845bd8840f78b39c8132ed4d6a4194c3b10d4b4cfb0b" -dependencies = [ - "nix 0.28.0", - "rand 0.8.5", -] - [[package]] name = "atty" version = "0.2.14" @@ -270,9 +260,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" @@ -296,7 +286,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower", "tower-layer", "tower-service", @@ -304,9 +294,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1236b4b292f6c4d6dc34604bb5120d85c3fe1d1aa596bd5cc52ca054d13e7b9e" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core 0.4.3", @@ -330,7 +320,7 @@ dependencies = [ "serde_path_to_error", "serde_urlencoded", "sha1", - "sync_wrapper", + "sync_wrapper 1.0.0", "tokio", "tokio-tungstenite", "tower", @@ -371,7 +361,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", "tracing", @@ -398,9 +388,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -478,9 +468,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -516,9 +506,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" dependencies = [ "arrayref", "arrayvec", @@ -547,9 +537,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -580,9 +570,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" @@ -596,17 +586,11 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" dependencies = [ "android-tzdata", "iana-time-zone", @@ -689,9 +673,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.2" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -711,14 +695,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -738,9 +722,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "color-eyre" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" dependencies = [ "backtrace", "color-spantrace", @@ -888,9 +872,9 @@ dependencies = [ [[package]] name = "cookie" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" dependencies = [ "time", "version_check", @@ -992,7 +976,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "crossterm_winapi", "futures-core", "libc", @@ -1114,7 +1098,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -1138,7 +1122,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -1149,7 +1133,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -1401,10 +1385,10 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -1452,9 +1436,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "fd-lock-rs" @@ -1477,9 +1461,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" [[package]] name = "filetime" @@ -1638,7 +1622,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -1716,7 +1700,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8283e7331b8c93b9756e0cfdbcfb90312852f953c6faf9bf741e684cc3b6ad69" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "crc", "log", "uuid", @@ -1735,9 +1719,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" dependencies = [ "bytes", "fnv", @@ -1745,7 +1729,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.5", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1754,9 +1738,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" +checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4" dependencies = [ "bytes", "fnv", @@ -1764,7 +1748,7 @@ dependencies = [ "futures-sink", "futures-util", "http 1.1.0", - "indexmap 2.2.5", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1843,6 +1827,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "helpers" version = "0.1.0" @@ -1883,9 +1873,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hifijson" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ef6b41c333e6dd2a4aaa59125a19b633cd17e7aaf372b2260809777bcdef4a" +checksum = "18ae468bcb4dfecf0e4949ee28abbc99076b6a0077f51ddbc94dbfff8e6a870c" [[package]] name = "hkdf" @@ -1959,12 +1949,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" dependencies = [ "bytes", - "futures-util", + "futures-core", "http 1.1.0", "http-body 1.0.0", "pin-project-lite", @@ -1998,7 +1988,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.3.24", + "h2 0.3.25", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2021,7 +2011,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.2", + "h2 0.4.3", "http 1.1.0", "http-body 1.0.0", "httparse", @@ -2214,9 +2204,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -2343,9 +2333,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jaq-core" @@ -2387,9 +2377,9 @@ dependencies = [ [[package]] name = "josekit" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd20997283339a19226445db97d632c8dc7adb6b8172537fe0e9e540fb141df2" +checksum = "0953340cf63354cec4a385f1fbcb3f409a5823778cae236078892f6030ed4565" dependencies = [ "anyhow", "base64", @@ -2466,7 +2456,7 @@ dependencies = [ "petgraph", "pico-args", "regex", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", "string_cache", "term", "tiny-keccak", @@ -2526,7 +2516,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", "redox_syscall 0.4.1", ] @@ -2685,7 +2675,7 @@ dependencies = [ "tokio", "torut", "tracing", - "ts-rs 7.1.1", + "ts-rs", "yasi", ] @@ -2709,9 +2699,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "new_mime_guess" @@ -2754,23 +2744,11 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "libc", ] -[[package]] -name = "nix" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" -dependencies = [ - "bitflags 2.4.2", - "cfg-if", - "cfg_aliases", - "libc", -] - [[package]] name = "nom" version = "7.1.3" @@ -2918,7 +2896,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -2967,7 +2945,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -2984,7 +2962,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -3135,7 +3113,7 @@ dependencies = [ name = "patch-db-macro-internals" version = "0.1.0" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 1.0.109", @@ -3173,7 +3151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.5", + "indexmap 2.2.6", ] [[package]] @@ -3208,7 +3186,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -3252,9 +3230,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "portable-atomic" @@ -3314,9 +3292,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -3329,13 +3307,13 @@ checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.2", + "bitflags 2.5.0", "lazy_static", "num-traits", "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", "rusty-fork", "tempfile", "unarray", @@ -3372,7 +3350,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -3547,14 +3525,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", "regex-automata 0.4.6", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -3574,7 +3552,7 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -3585,15 +3563,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.25" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -3602,7 +3580,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.3.24", + "h2 0.3.25", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", @@ -3619,7 +3597,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -3711,8 +3689,8 @@ source = "git+https://github.com/Start9Labs/rpc-toolkit.git?branch=refactor/trai dependencies = [ "async-stream", "async-trait", - "axum 0.7.4", - "clap 4.5.2", + "axum 0.7.5", + "clap 4.5.4", "futures", "http 1.1.0", "http-body-util", @@ -3835,11 +3813,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -3859,9 +3837,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" dependencies = [ "log", "ring", @@ -3882,9 +3860,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" [[package]] name = "rustls-webpki" @@ -4071,16 +4049,16 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4088,9 +4066,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -4119,15 +4097,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.5", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -4137,23 +4115,23 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] name = "serde_yaml" -version = "0.9.32" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -4294,9 +4272,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -4346,9 +4324,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" dependencies = [ "sqlx-core", "sqlx-macros", @@ -4359,9 +4337,9 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" dependencies = [ "ahash 0.8.11", "atoi", @@ -4370,7 +4348,6 @@ dependencies = [ "chrono", "crc", "crossbeam-queue", - "dotenvy", "either", "event-listener", "futures-channel", @@ -4380,7 +4357,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.5", + "indexmap 2.2.6", "log", "memchr", "once_cell", @@ -4403,9 +4380,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" dependencies = [ "proc-macro2", "quote", @@ -4416,14 +4393,13 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" dependencies = [ - "atomic-write-file", "dotenvy", "either", - "heck", + "heck 0.4.1", "hex", "once_cell", "proc-macro2", @@ -4443,13 +4419,13 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "bytes", "chrono", @@ -4486,13 +4462,13 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "byteorder", "chrono", "crc", @@ -4514,7 +4490,6 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "sha1", "sha2 0.10.8", "smallvec", "sqlx-core", @@ -4526,9 +4501,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" dependencies = [ "atoi", "chrono", @@ -4571,7 +4546,7 @@ dependencies = [ "quote", "regex-syntax 0.6.29", "strsim 0.10.0", - "syn 2.0.52", + "syn 2.0.55", "unicode-width", ] @@ -4598,9 +4573,9 @@ dependencies = [ [[package]] name = "ssh-key" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f8f4ea73476c0aa5d5e6a75ce1e8634e2c3f82005ef3bbed21547ac57f2bf7" +checksum = "3b71299a724c8d84956caaf8fc3b3ea57c3587fe2d0b800cd0dc1f3599905d7e" dependencies = [ "ed25519-dalek 2.1.1", "p256", @@ -4625,7 +4600,7 @@ dependencies = [ "async-compression", "async-stream", "async-trait", - "axum 0.7.4", + "axum 0.7.5", "axum-server", "base32", "base64", @@ -4635,11 +4610,11 @@ dependencies = [ "bytes", "chrono", "ciborium", - "clap 4.5.2", + "clap 4.5.4", "color-eyre", "console", "console-subscriber", - "cookie 0.18.0", + "cookie 0.18.1", "cookie_store", "current_platform", "digest 0.10.7", @@ -4659,7 +4634,7 @@ dependencies = [ "imbl", "imbl-value", "include_dir", - "indexmap 2.2.5", + "indexmap 2.2.6", "indicatif", "integer-encoding", "ipnet", @@ -4722,7 +4697,7 @@ dependencies = [ "tokio-tar", "tokio-tungstenite", "tokio-util", - "toml 0.8.10", + "toml 0.8.12", "torut", "tracing", "tracing-error", @@ -4730,7 +4705,7 @@ dependencies = [ "tracing-journald", "tracing-subscriber", "trust-dns-server", - "ts-rs 8.1.0", + "ts-rs", "typed-builder", "url", "urlencoding", @@ -4806,9 +4781,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -4822,21 +4797,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "system-configuration" -version = "0.6.0" +name = "sync_wrapper" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -4909,22 +4890,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -5041,7 +5022,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -5060,7 +5041,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.2", + "rustls 0.22.3", "rustls-pki-types", "tokio", ] @@ -5079,9 +5060,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -5145,14 +5126,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.22.9", ] [[package]] @@ -5170,7 +5151,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -5183,18 +5164,18 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -5212,7 +5193,7 @@ dependencies = [ "axum 0.6.20", "base64", "bytes", - "h2 0.3.24", + "h2 0.3.25", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", @@ -5299,7 +5280,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -5434,49 +5415,24 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "ts-rs" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2cae1fc5d05d47aa24b64f9a4f7cba24cdc9187a2084dd97ac57bef5eccae6" -dependencies = [ - "thiserror", - "ts-rs-macros 7.1.1", -] - [[package]] name = "ts-rs" version = "8.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d3fa4606cdab1e9b668cc65ce2545941d01f52bc27536a195c66c55b91cb84" +source = "git+https://github.com/dr-bonez/ts-rs.git?branch=feature/top-level-type-override#f37e51abbf3b4afc6dc2fdea72100ed0ee463a06" dependencies = [ "thiserror", - "ts-rs-macros 8.1.0", -] - -[[package]] -name = "ts-rs-macros" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f7f9b821696963053a89a7bd8b292dc34420aea8294d7b225274d488f3ec92" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 2.0.52", - "termcolor", + "ts-rs-macros", ] [[package]] name = "ts-rs-macros" version = "8.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86ae36cbb2d58b86677ad413054feeb0712e382e822131cf9a4a1e580c419b5" +source = "git+https://github.com/dr-bonez/ts-rs.git?branch=feature/top-level-type-override#f37e51abbf3b4afc6dc2fdea72100ed0ee463a06" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "termcolor", ] @@ -5517,7 +5473,7 @@ checksum = "563b3b88238ec95680aef36bdece66896eaa7ce3c0f1b4f39d38fb2435261352" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -5588,9 +5544,9 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" @@ -5630,9 +5586,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom 0.2.12", ] @@ -5722,7 +5678,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "wasm-bindgen-shared", ] @@ -5756,7 +5712,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5798,9 +5754,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "whoami" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fec781d48b41f8163426ed18e8fc2864c12937df9ce54c88ede7bd47270893e" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ "redox_syscall 0.4.1", "wasite", @@ -6076,7 +6032,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] [[package]] @@ -6096,5 +6052,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.55", ] diff --git a/core/models/Cargo.toml b/core/models/Cargo.toml index 9f6a53443..b6a506774 100644 --- a/core/models/Cargo.toml +++ b/core/models/Cargo.toml @@ -32,7 +32,7 @@ sqlx = { version = "0.7.2", features = [ "postgres", ] } ssh-key = "0.6.2" -ts-rs = "7" +ts-rs = { git = "https://github.com/dr-bonez/ts-rs.git", branch = "feature/top-level-type-override" } # "8" thiserror = "1.0" tokio = { version = "1", features = ["full"] } torut = { git = "https://github.com/Start9Labs/torut.git", branch = "update/dependencies" } diff --git a/core/models/src/data_url.rs b/core/models/src/data_url.rs index e2141b15a..9757d7f6a 100644 --- a/core/models/src/data_url.rs +++ b/core/models/src/data_url.rs @@ -6,11 +6,13 @@ use color_eyre::eyre::eyre; use reqwest::header::CONTENT_TYPE; use serde::{Deserialize, Serialize}; use tokio::io::{AsyncRead, AsyncReadExt}; +use ts_rs::TS; use yasi::InternedString; use crate::{mime, Error, ErrorKind, ResultExt}; -#[derive(Clone)] +#[derive(Clone, TS)] +#[ts(type = "string")] pub struct DataUrl<'a> { mime: InternedString, data: Cow<'a, [u8]>, diff --git a/core/models/src/id/action.rs b/core/models/src/id/action.rs index 992c995f7..3f17048e2 100644 --- a/core/models/src/id/action.rs +++ b/core/models/src/id/action.rs @@ -2,10 +2,12 @@ use std::path::Path; use std::str::FromStr; use serde::{Deserialize, Serialize}; +use ts_rs::TS; use crate::{Id, InvalidId}; -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, ts_rs::TS)] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, TS)] +#[ts(type = "string")] pub struct ActionId(Id); impl FromStr for ActionId { type Err = InvalidId; diff --git a/core/models/src/id/health_check.rs b/core/models/src/id/health_check.rs index c416ab1e6..937f31aa3 100644 --- a/core/models/src/id/health_check.rs +++ b/core/models/src/id/health_check.rs @@ -2,10 +2,12 @@ use std::path::Path; use std::str::FromStr; use serde::{Deserialize, Deserializer, Serialize}; +use ts_rs::TS; use crate::{Id, InvalidId}; -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, ts_rs::TS)] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, TS)] +#[ts(type = "string")] pub struct HealthCheckId(Id); impl std::fmt::Display for HealthCheckId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/core/models/src/id/host.rs b/core/models/src/id/host.rs index 6bca7d0ff..2a1595bd8 100644 --- a/core/models/src/id/host.rs +++ b/core/models/src/id/host.rs @@ -2,11 +2,13 @@ use std::path::Path; use std::str::FromStr; use serde::{Deserialize, Deserializer, Serialize}; +use ts_rs::TS; use yasi::InternedString; use crate::{Id, InvalidId}; -#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)] +#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, TS)] +#[ts(type = "string")] pub struct HostId(Id); impl FromStr for HostId { type Err = InvalidId; diff --git a/core/models/src/id/image.rs b/core/models/src/id/image.rs index 5fd91a5a1..bbb0a601e 100644 --- a/core/models/src/id/image.rs +++ b/core/models/src/id/image.rs @@ -3,10 +3,12 @@ use std::path::Path; use std::str::FromStr; use serde::{Deserialize, Deserializer, Serialize}; +use ts_rs::TS; use crate::{Id, InvalidId, PackageId, Version}; -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, ts_rs::TS)] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, TS)] +#[ts(type = "string")] pub struct ImageId(Id); impl AsRef for ImageId { fn as_ref(&self) -> &Path { diff --git a/core/models/src/id/mod.rs b/core/models/src/id/mod.rs index 29825f628..239479ed7 100644 --- a/core/models/src/id/mod.rs +++ b/core/models/src/id/mod.rs @@ -28,8 +28,8 @@ lazy_static::lazy_static! { pub static ref SYSTEM_ID: Id = Id(InternedString::intern("x_system")); } -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, ts_rs::TS)] -pub struct Id(#[ts(type = "string")] InternedString); +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +pub struct Id(InternedString); impl TryFrom for Id { type Error = InvalidId; fn try_from(value: InternedString) -> Result { diff --git a/core/models/src/id/package.rs b/core/models/src/id/package.rs index 8f71285c6..d2665e59a 100644 --- a/core/models/src/id/package.rs +++ b/core/models/src/id/package.rs @@ -12,6 +12,7 @@ lazy_static::lazy_static! { pub static ref SYSTEM_PACKAGE_ID: PackageId = PackageId(SYSTEM_ID.clone()); } #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, TS)] +#[ts(type = "string")] pub struct PackageId(Id); impl FromStr for PackageId { type Err = InvalidId; diff --git a/core/models/src/id/volume.rs b/core/models/src/id/volume.rs index 16821a3cf..7425c79c6 100644 --- a/core/models/src/id/volume.rs +++ b/core/models/src/id/volume.rs @@ -2,10 +2,12 @@ use std::borrow::Borrow; use std::path::Path; use serde::{Deserialize, Deserializer, Serialize}; +use ts_rs::TS; use crate::Id; -#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, TS)] +#[ts(type = "string")] pub enum VolumeId { Backup, Custom(Id), diff --git a/core/startos/Cargo.toml b/core/startos/Cargo.toml index 8106c800b..ec4e978bf 100644 --- a/core/startos/Cargo.toml +++ b/core/startos/Cargo.toml @@ -175,7 +175,7 @@ tracing-futures = "0.2.5" tracing-journald = "0.3.0" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } trust-dns-server = "0.23.1" -ts-rs = "8.1.0" +ts-rs = { git = "https://github.com/dr-bonez/ts-rs.git", branch = "feature/top-level-type-override" } # "8.1.0" typed-builder = "0.18.0" url = { version = "2.4.1", features = ["serde"] } urlencoding = "2.1.3" diff --git a/core/startos/bindings/AddSslOptions.ts b/core/startos/bindings/AddSslOptions.ts index f0f74fe03..97035853d 100644 --- a/core/startos/bindings/AddSslOptions.ts +++ b/core/startos/bindings/AddSslOptions.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 { AlpnInfo } from "./AlpnInfo"; -export type AddSslOptions = { scheme: string | null, preferredExternalPort: number, addXForwardedHeaders: boolean | null, }; \ No newline at end of file +export type AddSslOptions = { scheme: string, preferredExternalPort: number, alpn: AlpnInfo, }; \ No newline at end of file diff --git a/core/startos/bindings/Alerts.ts b/core/startos/bindings/Alerts.ts new file mode 100644 index 000000000..4956bfa95 --- /dev/null +++ b/core/startos/bindings/Alerts.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 Alerts = { install: string | null, uninstall: string | null, restore: string | null, start: string | null, stop: string | null, }; \ No newline at end of file diff --git a/core/startos/bindings/AllPackageData.ts b/core/startos/bindings/AllPackageData.ts new file mode 100644 index 000000000..74827426a --- /dev/null +++ b/core/startos/bindings/AllPackageData.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 { PackageDataEntry } from "./PackageDataEntry"; +import type { PackageId } from "./PackageId"; + +export type AllPackageData = { [key: PackageId]: PackageDataEntry }; \ No newline at end of file diff --git a/core/startos/bindings/AlpnInfo.ts b/core/startos/bindings/AlpnInfo.ts new file mode 100644 index 000000000..2a760d235 --- /dev/null +++ b/core/startos/bindings/AlpnInfo.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 { MaybeUtf8String } from "./MaybeUtf8String"; + +export type AlpnInfo = "reflect" | { "specified": Array }; \ No newline at end of file diff --git a/core/startos/bindings/BackupProgress.ts b/core/startos/bindings/BackupProgress.ts new file mode 100644 index 000000000..4a480dc93 --- /dev/null +++ b/core/startos/bindings/BackupProgress.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 BackupProgress = { complete: boolean, }; \ No newline at end of file diff --git a/core/startos/bindings/BindInfo.ts b/core/startos/bindings/BindInfo.ts new file mode 100644 index 000000000..d42ed2d25 --- /dev/null +++ b/core/startos/bindings/BindInfo.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 { BindOptions } from "./BindOptions"; + +export type BindInfo = { options: BindOptions, assignedLanPort: number | null, }; \ No newline at end of file diff --git a/core/startos/bindings/BindOptions.ts b/core/startos/bindings/BindOptions.ts index 997f2bd8b..dc8b1e5b5 100644 --- a/core/startos/bindings/BindOptions.ts +++ b/core/startos/bindings/BindOptions.ts @@ -1,5 +1,4 @@ // 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 { BindOptionsSecure } from "./BindOptionsSecure"; -export type BindOptions = { scheme: string | null, preferredExternalPort: number, addSsl: AddSslOptions | null, secure: BindOptionsSecure | null, }; \ No newline at end of file +export type BindOptions = { scheme: string, preferredExternalPort: number, addSsl: AddSslOptions | null, secure: boolean, ssl: boolean, }; \ No newline at end of file diff --git a/core/startos/bindings/ConnectionAddresses.ts b/core/startos/bindings/ConnectionAddresses.ts new file mode 100644 index 000000000..503bfb418 --- /dev/null +++ b/core/startos/bindings/ConnectionAddresses.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 ConnectionAddresses = { tor: Array, clearnet: Array, }; \ No newline at end of file diff --git a/core/startos/bindings/CurrentDependencies.ts b/core/startos/bindings/CurrentDependencies.ts new file mode 100644 index 000000000..55fb68501 --- /dev/null +++ b/core/startos/bindings/CurrentDependencies.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 { CurrentDependencyInfo } from "./CurrentDependencyInfo"; +import type { PackageId } from "./PackageId"; + +export type CurrentDependencies = { [key: PackageId]: CurrentDependencyInfo }; \ No newline at end of file diff --git a/core/startos/bindings/CurrentDependencyInfo.ts b/core/startos/bindings/CurrentDependencyInfo.ts new file mode 100644 index 000000000..ad8d3cf36 --- /dev/null +++ b/core/startos/bindings/CurrentDependencyInfo.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 { DataUrl } from "./DataUrl"; + +export type CurrentDependencyInfo = { title: string, icon: DataUrl, registry: string, versionSpec: string, } & ({ "kind": "exists" } | { "kind": "running", healthChecks: string[], }); \ No newline at end of file diff --git a/core/startos/bindings/DataUrl.ts b/core/startos/bindings/DataUrl.ts new file mode 100644 index 000000000..835512711 --- /dev/null +++ b/core/startos/bindings/DataUrl.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 DataUrl = string; \ No newline at end of file diff --git a/core/startos/bindings/DepInfo.ts b/core/startos/bindings/DepInfo.ts new file mode 100644 index 000000000..8320d83eb --- /dev/null +++ b/core/startos/bindings/DepInfo.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 DepInfo = { description: string | null, optional: boolean, }; \ No newline at end of file diff --git a/core/startos/bindings/Dependencies.ts b/core/startos/bindings/Dependencies.ts new file mode 100644 index 000000000..a84adec24 --- /dev/null +++ b/core/startos/bindings/Dependencies.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 { DepInfo } from "./DepInfo"; +import type { PackageId } from "./PackageId"; + +export type Dependencies = { [key: PackageId]: DepInfo }; \ No newline at end of file diff --git a/core/startos/bindings/DependencyConfigErrors.ts b/core/startos/bindings/DependencyConfigErrors.ts new file mode 100644 index 000000000..23281aa89 --- /dev/null +++ b/core/startos/bindings/DependencyConfigErrors.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 { PackageId } from "./PackageId"; + +export type DependencyConfigErrors = { [key: PackageId]: string }; \ No newline at end of file diff --git a/core/startos/bindings/DependencyRequirement.ts b/core/startos/bindings/DependencyRequirement.ts index 52bc25cd9..f6ff4aa54 100644 --- a/core/startos/bindings/DependencyRequirement.ts +++ b/core/startos/bindings/DependencyRequirement.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 DependencyRequirement = { "kind": "running", id: string, healthChecks: string[], versionSpec: string, url: string, } | { "kind": "exists", id: string, versionSpec: string, url: string, }; \ No newline at end of file +export type DependencyRequirement = { "kind": "running", id: string, healthChecks: string[], versionSpec: string, registry: string, } | { "kind": "exists", id: string, versionSpec: string, registry: string, }; \ No newline at end of file diff --git a/core/startos/bindings/Description.ts b/core/startos/bindings/Description.ts new file mode 100644 index 000000000..da4b0d1bf --- /dev/null +++ b/core/startos/bindings/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, }; \ No newline at end of file diff --git a/core/startos/bindings/Duration.ts b/core/startos/bindings/Duration.ts new file mode 100644 index 000000000..ac44b7c87 --- /dev/null +++ b/core/startos/bindings/Duration.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 Duration = string; \ No newline at end of file diff --git a/core/startos/bindings/ExposeUiParams.ts b/core/startos/bindings/ExposeUiParams.ts deleted file mode 100644 index 3c2230060..000000000 --- a/core/startos/bindings/ExposeUiParams.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 ExposeUiParams = { "type": "object", value: {[key: string]: ExposeUiParams}, } | { "type": "string", path: string, description: string | null, masked: boolean, copyable: boolean | null, qr: boolean | null, }; \ No newline at end of file diff --git a/core/startos/bindings/ExposedUI.ts b/core/startos/bindings/ExposedUI.ts deleted file mode 100644 index bef4c8214..000000000 --- a/core/startos/bindings/ExposedUI.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 ExposedUI = { "type": "object", value: {[key: string]: ExposedUI}, description: string | null, } | { "type": "string", path: string, description: string | null, masked: boolean, copyable: boolean | null, qr: boolean | null, }; \ No newline at end of file diff --git a/core/startos/bindings/FullProgress.ts b/core/startos/bindings/FullProgress.ts new file mode 100644 index 000000000..0c6a96832 --- /dev/null +++ b/core/startos/bindings/FullProgress.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 { NamedProgress } from "./NamedProgress"; +import type { Progress } from "./Progress"; + +export type FullProgress = { overall: Progress, phases: Array, }; \ No newline at end of file diff --git a/core/startos/bindings/Governor.ts b/core/startos/bindings/Governor.ts new file mode 100644 index 000000000..9e0bb14e2 --- /dev/null +++ b/core/startos/bindings/Governor.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 Governor = string; \ No newline at end of file diff --git a/core/startos/bindings/HardwareRequirements.ts b/core/startos/bindings/HardwareRequirements.ts new file mode 100644 index 000000000..5a28d0cbc --- /dev/null +++ b/core/startos/bindings/HardwareRequirements.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 HardwareRequirements = { device: { [key: string]: string }, ram: bigint | null, arch: Array | null, }; \ No newline at end of file diff --git a/core/startos/bindings/HealthCheckId.ts b/core/startos/bindings/HealthCheckId.ts new file mode 100644 index 000000000..d9b6b7ca8 --- /dev/null +++ b/core/startos/bindings/HealthCheckId.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 HealthCheckId = string; \ No newline at end of file diff --git a/core/startos/bindings/HealthCheckResult.ts b/core/startos/bindings/HealthCheckResult.ts new file mode 100644 index 000000000..eaba169f1 --- /dev/null +++ b/core/startos/bindings/HealthCheckResult.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 HealthCheckResult = { "result": "success" } | { "result": "disabled" } | { "result": "starting" } | { "result": "loading", message: string, } | { "result": "failure", error: string, }; \ No newline at end of file diff --git a/core/startos/bindings/Host.ts b/core/startos/bindings/Host.ts new file mode 100644 index 000000000..a08704ad2 --- /dev/null +++ b/core/startos/bindings/Host.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { BindInfo } from "./BindInfo"; +import type { HostAddress } from "./HostAddress"; +import type { HostKind } from "./HostKind"; + +export type Host = { kind: HostKind, bindings: { [key: number]: BindInfo }, addresses: Array, primary: HostAddress | null, }; \ No newline at end of file diff --git a/core/startos/bindings/HostAddress.ts b/core/startos/bindings/HostAddress.ts new file mode 100644 index 000000000..f013cb540 --- /dev/null +++ b/core/startos/bindings/HostAddress.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 HostAddress = { "kind": "onion", address: string, }; \ No newline at end of file diff --git a/core/startos/bindings/HostId.ts b/core/startos/bindings/HostId.ts new file mode 100644 index 000000000..1aef70f2a --- /dev/null +++ b/core/startos/bindings/HostId.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 HostId = string; \ No newline at end of file diff --git a/core/startos/bindings/HostInfo.ts b/core/startos/bindings/HostInfo.ts new file mode 100644 index 000000000..3d2a34f14 --- /dev/null +++ b/core/startos/bindings/HostInfo.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 { Host } from "./Host"; +import type { HostId } from "./HostId"; + +export type HostInfo = { [key: HostId]: Host }; \ No newline at end of file diff --git a/core/startos/bindings/HostKind.ts b/core/startos/bindings/HostKind.ts new file mode 100644 index 000000000..1ad1bd95e --- /dev/null +++ b/core/startos/bindings/HostKind.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 HostKind = "multi"; \ No newline at end of file diff --git a/core/startos/bindings/ImageId.ts b/core/startos/bindings/ImageId.ts new file mode 100644 index 000000000..9adb82d7a --- /dev/null +++ b/core/startos/bindings/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; \ No newline at end of file diff --git a/core/startos/bindings/InstalledState.ts b/core/startos/bindings/InstalledState.ts new file mode 100644 index 000000000..3608a5ba0 --- /dev/null +++ b/core/startos/bindings/InstalledState.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 { Manifest } from "./Manifest"; + +export type InstalledState = { manifest: Manifest, }; \ No newline at end of file diff --git a/core/startos/bindings/InstallingInfo.ts b/core/startos/bindings/InstallingInfo.ts new file mode 100644 index 000000000..c3d13c984 --- /dev/null +++ b/core/startos/bindings/InstallingInfo.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 { FullProgress } from "./FullProgress"; +import type { Manifest } from "./Manifest"; + +export type InstallingInfo = { newManifest: Manifest, progress: FullProgress, }; \ No newline at end of file diff --git a/core/startos/bindings/InstallingState.ts b/core/startos/bindings/InstallingState.ts new file mode 100644 index 000000000..b7cfea14c --- /dev/null +++ b/core/startos/bindings/InstallingState.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 { InstallingInfo } from "./InstallingInfo"; + +export type InstallingState = { installingInfo: InstallingInfo, }; \ No newline at end of file diff --git a/core/startos/bindings/IpInfo.ts b/core/startos/bindings/IpInfo.ts new file mode 100644 index 000000000..756d87219 --- /dev/null +++ b/core/startos/bindings/IpInfo.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 IpInfo = { ipv4Range: string | null, ipv4: string | null, ipv6Range: string | null, ipv6: string | null, }; \ No newline at end of file diff --git a/core/startos/bindings/MainStatus.ts b/core/startos/bindings/MainStatus.ts new file mode 100644 index 000000000..25482e113 --- /dev/null +++ b/core/startos/bindings/MainStatus.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Duration } from "./Duration"; +import type { HealthCheckId } from "./HealthCheckId"; +import type { HealthCheckResult } from "./HealthCheckResult"; + +export type MainStatus = { "status": "stopped" } | { "status": "restarting" } | { "status": "stopping", timeout: Duration, } | { "status": "starting" } | { "status": "running", started: string, health: { [key: HealthCheckId]: HealthCheckResult }, } | { "status": "backingUp", started: string | null, health: { [key: HealthCheckId]: HealthCheckResult }, }; \ No newline at end of file diff --git a/core/startos/bindings/Manifest.ts b/core/startos/bindings/Manifest.ts new file mode 100644 index 000000000..0eb91251b --- /dev/null +++ b/core/startos/bindings/Manifest.ts @@ -0,0 +1,10 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Alerts } from "./Alerts"; +import type { Dependencies } from "./Dependencies"; +import type { Description } from "./Description"; +import type { HardwareRequirements } from "./HardwareRequirements"; +import type { ImageId } from "./ImageId"; +import type { PackageId } from "./PackageId"; +import type { VolumeId } from "./VolumeId"; + +export type Manifest = { id: PackageId, title: string, version: string, releaseNotes: string, license: string, replaces: Array, wrapperRepo: string, upstreamRepo: string, supportSite: string, marketingSite: string, donationUrl: string | null, description: Description, images: Array, assets: Array, volumes: Array, alerts: Alerts, dependencies: Dependencies, hardwareRequirements: HardwareRequirements, gitHash: string | null, osVersion: string, hasConfig: boolean, }; \ No newline at end of file diff --git a/core/startos/bindings/MaybeUtf8String.ts b/core/startos/bindings/MaybeUtf8String.ts new file mode 100644 index 000000000..6674a135b --- /dev/null +++ b/core/startos/bindings/MaybeUtf8String.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 MaybeUtf8String = string | number[]; \ No newline at end of file diff --git a/core/startos/bindings/NamedProgress.ts b/core/startos/bindings/NamedProgress.ts new file mode 100644 index 000000000..1e4c45093 --- /dev/null +++ b/core/startos/bindings/NamedProgress.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 { Progress } from "./Progress"; + +export type NamedProgress = { name: string, progress: Progress, }; \ No newline at end of file diff --git a/core/startos/bindings/PackageDataEntry.ts b/core/startos/bindings/PackageDataEntry.ts new file mode 100644 index 000000000..100e38ba7 --- /dev/null +++ b/core/startos/bindings/PackageDataEntry.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 { CurrentDependencies } from "./CurrentDependencies"; +import type { DataUrl } from "./DataUrl"; +import type { HostInfo } from "./HostInfo"; +import type { PackageState } from "./PackageState"; +import type { Status } from "./Status"; + +export type PackageDataEntry = { stateInfo: PackageState, status: Status, marketplaceUrl: string | null, developerKey: string, icon: DataUrl, lastBackup: string | null, currentDependencies: CurrentDependencies, hosts: HostInfo, storeExposedDependents: string[], }; \ No newline at end of file diff --git a/core/startos/bindings/PackageId.ts b/core/startos/bindings/PackageId.ts new file mode 100644 index 000000000..fcf62f5e2 --- /dev/null +++ b/core/startos/bindings/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; \ No newline at end of file diff --git a/core/startos/bindings/PackageState.ts b/core/startos/bindings/PackageState.ts new file mode 100644 index 000000000..4aa0c1d97 --- /dev/null +++ b/core/startos/bindings/PackageState.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { InstalledState } from "./InstalledState"; +import type { InstallingState } from "./InstallingState"; +import type { UpdatingState } from "./UpdatingState"; + +export type PackageState = { "state": "installing" } & InstallingState | { "state": "restoring" } & InstallingState | { "state": "updating" } & UpdatingState | { "state": "installed" } & InstalledState | { "state": "removing" } & InstalledState; \ No newline at end of file diff --git a/core/startos/bindings/Progress.ts b/core/startos/bindings/Progress.ts new file mode 100644 index 000000000..d522dee5a --- /dev/null +++ b/core/startos/bindings/Progress.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 Progress = boolean | { done: bigint, total: bigint | null, }; \ No newline at end of file diff --git a/core/startos/bindings/Public.ts b/core/startos/bindings/Public.ts new file mode 100644 index 000000000..c913d8493 --- /dev/null +++ b/core/startos/bindings/Public.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 { AllPackageData } from "./AllPackageData"; +import type { ServerInfo } from "./ServerInfo"; + +export type Public = { serverInfo: ServerInfo, packageData: AllPackageData, ui: any, }; \ No newline at end of file diff --git a/core/startos/bindings/ServerInfo.ts b/core/startos/bindings/ServerInfo.ts new file mode 100644 index 000000000..ee8e55157 --- /dev/null +++ b/core/startos/bindings/ServerInfo.ts @@ -0,0 +1,16 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ConnectionAddresses } from "./ConnectionAddresses"; +import type { Governor } from "./Governor"; +import type { IpInfo } from "./IpInfo"; +import type { ServerStatus } from "./ServerStatus"; +import type { WifiInfo } from "./WifiInfo"; + +export type ServerInfo = { arch: string, platform: string, id: string, hostname: string, version: string, lastBackup: string | null, +/** + * Used in the wifi to determine the region to set the system to + */ +lastWifiRegion: string | null, eosVersionCompat: string, lanAddress: string, onionAddress: string, +/** + * for backwards compatibility + */ +torAddress: string, ipInfo: { [key: string]: IpInfo }, statusInfo: ServerStatus, wifi: WifiInfo, unreadNotificationCount: bigint, connectionAddresses: ConnectionAddresses, passwordHash: string, pubkey: string, caFingerprint: string, ntpSynced: boolean, zram: boolean, governor: Governor | null, }; \ No newline at end of file diff --git a/core/startos/bindings/ServerSpecs.ts b/core/startos/bindings/ServerSpecs.ts new file mode 100644 index 000000000..ec464c8df --- /dev/null +++ b/core/startos/bindings/ServerSpecs.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 ServerSpecs = { cpu: string, disk: string, memory: string, }; \ No newline at end of file diff --git a/core/startos/bindings/ServerStatus.ts b/core/startos/bindings/ServerStatus.ts new file mode 100644 index 000000000..0d31f74ea --- /dev/null +++ b/core/startos/bindings/ServerStatus.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { BackupProgress } from "./BackupProgress"; +import type { PackageId } from "./PackageId"; +import type { UpdateProgress } from "./UpdateProgress"; + +export type ServerStatus = { backupProgress: { [key: PackageId]: BackupProgress } | null, updated: boolean, updateProgress: UpdateProgress | null, shuttingDown: boolean, restarting: boolean, }; \ No newline at end of file diff --git a/core/startos/bindings/Status.ts b/core/startos/bindings/Status.ts index fdfaea244..73894287a 100644 --- a/core/startos/bindings/Status.ts +++ b/core/startos/bindings/Status.ts @@ -1,3 +1,5 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { DependencyConfigErrors } from "./DependencyConfigErrors"; +import type { MainStatus } from "./MainStatus"; -export type Status = "running" | "stopped"; \ No newline at end of file +export type Status = { configured: boolean, main: MainStatus, dependencyConfigErrors: DependencyConfigErrors, }; \ No newline at end of file diff --git a/core/startos/bindings/UpdateProgress.ts b/core/startos/bindings/UpdateProgress.ts new file mode 100644 index 000000000..ad9750196 --- /dev/null +++ b/core/startos/bindings/UpdateProgress.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 UpdateProgress = { size: bigint | null, downloaded: bigint, }; \ No newline at end of file diff --git a/core/startos/bindings/UpdatingState.ts b/core/startos/bindings/UpdatingState.ts new file mode 100644 index 000000000..ce994ce33 --- /dev/null +++ b/core/startos/bindings/UpdatingState.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 { InstallingInfo } from "./InstallingInfo"; +import type { Manifest } from "./Manifest"; + +export type UpdatingState = { manifest: Manifest, installingInfo: InstallingInfo, }; \ No newline at end of file diff --git a/core/startos/bindings/VolumeId.ts b/core/startos/bindings/VolumeId.ts new file mode 100644 index 000000000..b5e798c8b --- /dev/null +++ b/core/startos/bindings/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; \ No newline at end of file diff --git a/core/startos/bindings/WifiInfo.ts b/core/startos/bindings/WifiInfo.ts new file mode 100644 index 000000000..e1debf26b --- /dev/null +++ b/core/startos/bindings/WifiInfo.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 WifiInfo = { ssids: Array, selected: string | null, connected: string | null, }; \ No newline at end of file diff --git a/core/startos/src/db/model/mod.rs b/core/startos/src/db/model/mod.rs index cae1bfe51..9be0f8b68 100644 --- a/core/startos/src/db/model/mod.rs +++ b/core/startos/src/db/model/mod.rs @@ -2,6 +2,7 @@ use std::collections::BTreeMap; use patch_db::HasModel; use serde::{Deserialize, Serialize}; +use ts_rs::TS; use crate::account::AccountInfo; use crate::auth::Sessions; diff --git a/core/startos/src/db/model/package.rs b/core/startos/src/db/model/package.rs index fc3c2751c..641b0b56d 100644 --- a/core/startos/src/db/model/package.rs +++ b/core/startos/src/db/model/package.rs @@ -10,13 +10,15 @@ use reqwest::Url; use serde::{Deserialize, Serialize}; use ts_rs::TS; +use crate::net::host::HostInfo; use crate::prelude::*; use crate::progress::FullProgress; use crate::s9pk::manifest::Manifest; use crate::status::Status; -use crate::{net::host::HostInfo, util::serde::Pem}; +use crate::util::serde::Pem; -#[derive(Debug, Default, Deserialize, Serialize)] +#[derive(Debug, Default, Deserialize, Serialize, TS)] +#[ts(export)] pub struct AllPackageData(pub BTreeMap); impl Map for AllPackageData { type Key = PackageId; @@ -35,10 +37,11 @@ pub enum ManifestPreference { New, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[serde(tag = "state")] #[model = "Model"] +#[ts(export)] pub enum PackageState { Installing(InstallingState), Restoring(InstallingState), @@ -257,51 +260,57 @@ impl Model { } } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct InstallingState { pub installing_info: InstallingInfo, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct UpdatingState { pub manifest: Manifest, pub installing_info: InstallingInfo, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct InstalledState { pub manifest: Manifest, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[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, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct PackageDataEntry { pub state_info: PackageState, pub status: Status, + #[ts(type = "string | null")] pub marketplace_url: Option, + #[ts(type = "string")] pub developer_key: Pem, pub icon: DataUrl<'static>, + #[ts(type = "string | null")] pub last_backup: Option>, - pub dependency_info: BTreeMap, pub current_dependencies: CurrentDependencies, - pub interface_addresses: InterfaceAddressMap, pub hosts: HostInfo, - pub store_exposed_ui: StoreExposedUI, + #[ts(type = "string[]")] pub store_exposed_dependents: Vec, } impl AsRef for PackageDataEntry { @@ -310,52 +319,8 @@ impl AsRef for PackageDataEntry { } } -#[derive(Debug, Deserialize, Serialize, HasModel)] -#[model = "Model"] -pub struct ExposedDependent { - path: String, - title: String, - description: Option, - masked: Option, - copyable: Option, - qr: Option, -} -#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct StoreExposedUI(pub BTreeMap); - -#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, TS)] -#[serde(rename_all = "camelCase")] -#[serde(tag = "type")] +#[derive(Debug, Clone, Default, Deserialize, Serialize, TS)] #[ts(export)] -pub enum ExposedUI { - Object { - #[ts(type = "{[key: string]: ExposedUI}")] - value: BTreeMap, - #[serde(default)] - #[ts(type = "string | null")] - description: String, - }, - String { - #[ts(type = "string")] - path: JsonPointer, - description: Option, - masked: bool, - copyable: Option, - qr: Option, - }, -} - -impl Default for ExposedUI { - fn default() -> Self { - ExposedUI::Object { - value: BTreeMap::new(), - description: "".to_string(), - } - } -} - -#[derive(Debug, Clone, Default, Deserialize, Serialize)] pub struct CurrentDependencies(pub BTreeMap); impl CurrentDependencies { pub fn map( @@ -379,31 +344,26 @@ impl Map for CurrentDependencies { } } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] -#[model = "Model"] -pub struct StaticDependencyInfo { +pub struct CurrentDependencyInfo { + #[serde(flatten)] + pub kind: CurrentDependencyKind, pub title: String, pub icon: DataUrl<'static>, + #[ts(type = "string")] + pub registry: Url, + #[ts(type = "string")] + pub version_spec: VersionRange, } #[derive(Clone, Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] #[serde(tag = "kind")] -pub enum CurrentDependencyInfo { - #[serde(rename_all = "camelCase")] - Exists { - #[ts(type = "string")] - url: Url, - #[ts(type = "string")] - version_spec: VersionRange, - }, +pub enum CurrentDependencyKind { + Exists, #[serde(rename_all = "camelCase")] Running { - #[ts(type = "string")] - url: Url, - #[ts(type = "string")] - version_spec: VersionRange, #[serde(default)] #[ts(type = "string[]")] health_checks: BTreeSet, diff --git a/core/startos/src/db/model/public.rs b/core/startos/src/db/model/public.rs index d618f8d33..ea8a3ac3d 100644 --- a/core/startos/src/db/model/public.rs +++ b/core/startos/src/db/model/public.rs @@ -13,6 +13,7 @@ use patch_db::{HasModel, Value}; use reqwest::Url; use serde::{Deserialize, Serialize}; use torut::onion::OnionAddressV3; +use ts_rs::TS; use crate::account::AccountInfo; use crate::db::model::package::AllPackageData; @@ -23,13 +24,14 @@ use crate::util::Version; use crate::version::{Current, VersionT}; use crate::{ARCH, PLATFORM}; -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] -// #[macro_debug] +#[ts(export)] pub struct Public { pub server_info: ServerInfo, pub package_data: AllPackageData, + #[ts(type = "any")] pub ui: Value, } impl Public { @@ -101,24 +103,34 @@ fn get_platform() -> InternedString { (&*PLATFORM).into() } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct ServerInfo { #[serde(default = "get_arch")] + #[ts(type = "string")] pub arch: InternedString, #[serde(default = "get_platform")] + #[ts(type = "string")] pub platform: InternedString, pub id: String, pub hostname: String, + #[ts(type = "string")] pub version: Version, + #[ts(type = "string | null")] pub last_backup: Option>, /// Used in the wifi to determine the region to set the system to + #[ts(type = "string | null")] pub last_wifi_region: Option, + #[ts(type = "string")] pub eos_version_compat: VersionRange, + #[ts(type = "string")] pub lan_address: Url, + #[ts(type = "string")] pub onion_address: OnionAddressV3, /// for backwards compatibility + #[ts(type = "string")] pub tor_address: Url, pub ip_info: BTreeMap, #[serde(default)] @@ -136,12 +148,15 @@ pub struct ServerInfo { pub governor: Option, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct IpInfo { + #[ts(type = "string | null")] pub ipv4_range: Option, pub ipv4: Option, + #[ts(type = "string | null")] pub ipv6_range: Option, pub ipv6: Option, } @@ -158,15 +173,17 @@ impl IpInfo { } } -#[derive(Debug, Default, Deserialize, Serialize, HasModel)] +#[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[model = "Model"] +#[ts(export)] pub struct BackupProgress { pub complete: bool, } -#[derive(Debug, Default, Deserialize, Serialize, HasModel)] +#[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, @@ -177,33 +194,37 @@ pub struct ServerStatus { pub restarting: bool, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct UpdateProgress { pub size: Option, pub downloaded: u64, } -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct WifiInfo { pub ssids: Vec, pub selected: Option, pub connected: Option, } -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub struct ServerSpecs { pub cpu: String, pub disk: String, pub memory: String, } -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub struct ConnectionAddresses { pub tor: Vec, pub clearnet: Vec, diff --git a/core/startos/src/dependencies.rs b/core/startos/src/dependencies.rs index ca40bf432..d973688e9 100644 --- a/core/startos/src/dependencies.rs +++ b/core/startos/src/dependencies.rs @@ -2,18 +2,16 @@ use std::collections::BTreeMap; use std::time::Duration; use clap::Parser; -use emver::VersionRange; -use models::{OptionExt, PackageId}; +use models::PackageId; use rpc_toolkit::{command, from_fn_async, Empty, HandlerExt, ParentHandler}; use serde::{Deserialize, Serialize}; use tracing::instrument; +use ts_rs::TS; use crate::config::{Config, ConfigSpec, ConfigureContext}; use crate::context::RpcContext; use crate::db::model::package::CurrentDependencies; -use crate::db::model::Database; use crate::prelude::*; -use crate::s9pk::manifest::Manifest; use crate::status::DependencyConfigErrors; use crate::Error; @@ -21,8 +19,9 @@ pub fn dependency() -> ParentHandler { ParentHandler::new().subcommand("configure", configure()) } -#[derive(Clone, Debug, Default, Deserialize, Serialize, HasModel)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, HasModel, TS)] #[model = "Model"] +#[ts(export)] pub struct Dependencies(pub BTreeMap); impl Map for Dependencies { type Key = PackageId; @@ -35,27 +34,13 @@ impl Map for Dependencies { } } -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "camelCase")] -#[serde(tag = "type")] -pub enum DependencyRequirement { - OptIn { how: String }, - OptOut { how: String }, - Required, -} -impl DependencyRequirement { - pub fn required(&self) -> bool { - matches!(self, &DependencyRequirement::Required) - } -} - -#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] +#[derive(Clone, Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct DepInfo { - pub version: VersionRange, - pub requirement: DependencyRequirement, pub description: Option, + pub optional: bool, } #[derive(Deserialize, Serialize, Parser)] diff --git a/core/startos/src/net/host/address.rs b/core/startos/src/net/host/address.rs index 6f3ff6df2..cb3b485f6 100644 --- a/core/startos/src/net/host/address.rs +++ b/core/startos/src/net/host/address.rs @@ -1,9 +1,14 @@ use serde::{Deserialize, Serialize}; use torut::onion::OnionAddressV3; +use ts_rs::TS; -#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord, TS)] #[serde(rename_all = "camelCase")] #[serde(tag = "kind")] +#[ts(export)] pub enum HostAddress { - Onion { address: OnionAddressV3 }, + Onion { + #[ts(type = "string")] + address: OnionAddressV3, + }, } diff --git a/core/startos/src/net/host/binding.rs b/core/startos/src/net/host/binding.rs index 0584b517b..aa689b717 100644 --- a/core/startos/src/net/host/binding.rs +++ b/core/startos/src/net/host/binding.rs @@ -1,12 +1,14 @@ use imbl_value::InternedString; use serde::{Deserialize, Serialize}; +use ts_rs::TS; use crate::net::forward::AvailablePorts; use crate::net::vhost::AlpnInfo; use crate::prelude::*; -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub struct BindInfo { pub options: BindOptions, pub assigned_lan_port: Option, @@ -49,9 +51,11 @@ impl BindInfo { } } -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub struct BindOptions { + #[ts(type = "string")] pub scheme: InternedString, pub preferred_external_port: u16, pub add_ssl: Option, @@ -59,9 +63,11 @@ pub struct BindOptions { pub ssl: bool, } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub struct AddSslOptions { + #[ts(type = "string")] pub scheme: InternedString, pub preferred_external_port: u16, // #[serde(default)] diff --git a/core/startos/src/net/host/mod.rs b/core/startos/src/net/host/mod.rs index 18b86ba0e..086840bd8 100644 --- a/core/startos/src/net/host/mod.rs +++ b/core/startos/src/net/host/mod.rs @@ -3,6 +3,7 @@ use std::collections::{BTreeMap, BTreeSet}; use imbl_value::InternedString; use models::HostId; use serde::{Deserialize, Serialize}; +use ts_rs::TS; use crate::net::forward::AvailablePorts; use crate::net::host::address::HostAddress; @@ -12,9 +13,10 @@ use crate::prelude::*; pub mod address; pub mod binding; -#[derive(Debug, Deserialize, Serialize, HasModel)] +#[derive(Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct Host { pub kind: HostKind, pub bindings: BTreeMap, @@ -37,16 +39,18 @@ impl Host { } } -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub enum HostKind { Multi, // Single, // Static, } -#[derive(Debug, Default, Deserialize, Serialize, HasModel)] +#[derive(Debug, Default, Deserialize, Serialize, HasModel, TS)] #[model = "Model"] +#[ts(export)] pub struct HostInfo(BTreeMap); impl Map for HostInfo { diff --git a/core/startos/src/net/vhost.rs b/core/startos/src/net/vhost.rs index 88cb759a0..46838ed51 100644 --- a/core/startos/src/net/vhost.rs +++ b/core/startos/src/net/vhost.rs @@ -17,6 +17,7 @@ use tokio_rustls::rustls::server::Acceptor; use tokio_rustls::rustls::{RootCertStore, ServerConfig}; use tokio_rustls::{LazyConfigAcceptor, TlsConnector}; use tracing::instrument; +use ts_rs::TS; use crate::prelude::*; use crate::util::io::{BackTrackingReader, TimeoutStream}; @@ -80,8 +81,9 @@ struct TargetInfo { connect_ssl: Result<(), AlpnInfo>, } -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)] +#[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 38e66a419..0acdca111 100644 --- a/core/startos/src/progress.rs +++ b/core/startos/src/progress.rs @@ -9,6 +9,7 @@ use itertools::Itertools; use serde::{Deserialize, Serialize}; use tokio::io::{AsyncSeek, AsyncWrite}; use tokio::sync::{mpsc, watch}; +use ts_rs::TS; use crate::db::model::DatabaseModel; use crate::prelude::*; @@ -19,7 +20,7 @@ lazy_static::lazy_static! { static ref BYTES: ProgressStyle = ProgressStyle::with_template("{spinner} {wide_msg} [{bytes}/?] [{binary_bytes_per_sec} {elapsed}]").unwrap(); } -#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord, TS)] #[serde(untagged)] pub enum Progress { Complete(bool), @@ -126,13 +127,16 @@ impl std::ops::AddAssign for Progress { } } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Debug, Clone, Deserialize, Serialize, TS)] +#[ts(export)] pub struct NamedProgress { + #[ts(type = "string")] pub name: InternedString, pub progress: Progress, } -#[derive(Debug, Clone, Deserialize, Serialize)] +#[derive(Debug, Clone, Deserialize, Serialize, TS)] +#[ts(export)] pub struct FullProgress { pub overall: Progress, pub phases: Vec, diff --git a/core/startos/src/properties.rs b/core/startos/src/properties.rs index 5482bdb58..5aa8a01d4 100644 --- a/core/startos/src/properties.rs +++ b/core/startos/src/properties.rs @@ -1,13 +1,10 @@ -use std::{borrow::Borrow, collections::BTreeMap}; - use clap::Parser; -use imbl_value::{json, InOMap, InternedString, Value}; +use imbl_value::Value; use models::PackageId; use rpc_toolkit::command; use serde::{Deserialize, Serialize}; use crate::context::RpcContext; -use crate::db::model::package::{ExposedUI, StoreExposedUI}; use crate::prelude::*; use crate::Error; diff --git a/core/startos/src/s9pk/v1/manifest.rs b/core/startos/src/s9pk/v1/manifest.rs index 813ad11a6..ef346ad2b 100644 --- a/core/startos/src/s9pk/v1/manifest.rs +++ b/core/startos/src/s9pk/v1/manifest.rs @@ -1,6 +1,7 @@ use std::collections::BTreeMap; use std::path::{Path, PathBuf}; +use emver::VersionRange; use imbl_value::InOMap; pub use models::PackageId; use models::VolumeId; @@ -8,7 +9,6 @@ use serde::{Deserialize, Serialize}; use url::Url; use super::git_hash::GitHash; -use crate::dependencies::Dependencies; use crate::prelude::*; use crate::s9pk::manifest::{Alerts, Description, HardwareRequirements}; use crate::util::Version; @@ -43,7 +43,7 @@ pub struct Manifest { pub alerts: Alerts, pub volumes: BTreeMap, #[serde(default)] - pub dependencies: Dependencies, + pub dependencies: BTreeMap, pub config: Option>, #[serde(default)] @@ -53,6 +53,29 @@ pub struct Manifest { pub hardware_requirements: HardwareRequirements, } +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(rename_all = "camelCase")] +#[serde(tag = "type")] +pub enum DependencyRequirement { + OptIn { how: String }, + OptOut { how: String }, + Required, +} +impl DependencyRequirement { + pub fn required(&self) -> bool { + matches!(self, &DependencyRequirement::Required) + } +} + +#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] +#[serde(rename_all = "camelCase")] +#[model = "Model"] +pub struct DepInfo { + pub version: VersionRange, + pub requirement: DependencyRequirement, + pub description: Option, +} + #[derive(Clone, Debug, Default, Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct Assets { diff --git a/core/startos/src/s9pk/v2/compat.rs b/core/startos/src/s9pk/v2/compat.rs index 423491e7a..5a98538dc 100644 --- a/core/startos/src/s9pk/v2/compat.rs +++ b/core/startos/src/s9pk/v2/compat.rs @@ -7,6 +7,7 @@ use tokio::fs::File; use tokio::io::{AsyncRead, AsyncSeek, AsyncWriteExt}; use tokio::process::Command; +use crate::dependencies::{DepInfo, Dependencies}; use crate::prelude::*; use crate::s9pk::manifest::Manifest; use crate::s9pk::merkle_archive::directory_contents::DirectoryContents; @@ -347,7 +348,21 @@ impl From for Manifest { .map(|(id, _)| id.clone()) .collect(), alerts: value.alerts, - dependencies: value.dependencies, + dependencies: Dependencies( + value + .dependencies + .into_iter() + .map(|(id, value)| { + ( + id, + DepInfo { + description: value.description, + optional: !value.requirement.required(), + }, + ) + }) + .collect(), + ), hardware_requirements: value.hardware_requirements, git_hash: value.git_hash, os_version: value.eos_version, diff --git a/core/startos/src/s9pk/v2/manifest.rs b/core/startos/src/s9pk/v2/manifest.rs index 119bbb466..ea4524400 100644 --- a/core/startos/src/s9pk/v2/manifest.rs +++ b/core/startos/src/s9pk/v2/manifest.rs @@ -5,6 +5,7 @@ use helpers::const_true; pub use models::PackageId; use models::{ImageId, VolumeId}; use serde::{Deserialize, Serialize}; +use ts_rs::TS; use url::Url; use crate::dependencies::Dependencies; @@ -18,21 +19,28 @@ fn current_version() -> Version { Current::new().semver().into() } -#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] +#[derive(Clone, Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct Manifest { pub id: PackageId, pub title: String, + #[ts(type = "string")] pub version: Version, pub release_notes: String, pub license: String, // type of license #[serde(default)] pub replaces: Vec, + #[ts(type = "string")] pub wrapper_repo: Url, + #[ts(type = "string")] pub upstream_repo: Url, + #[ts(type = "string")] pub support_site: Url, + #[ts(type = "string")] pub marketing_site: Url, + #[ts(type = "string | null")] pub donation_url: Option, pub description: Description, pub images: Vec, @@ -45,23 +53,28 @@ pub struct Manifest { #[serde(default)] pub hardware_requirements: HardwareRequirements, #[serde(default)] + #[ts(type = "string | null")] pub git_hash: Option, #[serde(default = "current_version")] + #[ts(type = "string")] pub os_version: Version, #[serde(default = "const_true")] pub has_config: bool, } -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, Deserialize, Serialize, TS)] #[serde(rename_all = "camelCase")] +#[ts(export)] pub struct HardwareRequirements { #[serde(default)] + #[ts(type = "{ [key: string]: string }")] device: BTreeMap, ram: Option, pub arch: Option>, } -#[derive(Clone, Debug, Deserialize, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize, TS)] +#[ts(export)] pub struct Description { pub short: String, pub long: String, @@ -84,8 +97,9 @@ impl Description { } } -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[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/service/service_effect_handler.rs b/core/startos/src/service/service_effect_handler.rs index b3eaf365c..ed82138b1 100644 --- a/core/startos/src/service/service_effect_handler.rs +++ b/core/startos/src/service/service_effect_handler.rs @@ -20,7 +20,7 @@ use ts_rs::TS; use url::Url; use crate::db::model::package::{ - CurrentDependencies, CurrentDependencyInfo, ExposedUI, StoreExposedUI, + CurrentDependencies, CurrentDependencyInfo, CurrentDependencyKind, }; use crate::disk::mount::filesystem::idmapped::IdMapped; use crate::disk::mount::filesystem::loop_dev::LoopDev; @@ -114,7 +114,6 @@ pub fn service_effect_handler() -> ParentHandler { "exposeForDependents", from_fn_async(expose_for_dependents).no_cli(), ) - .subcommand("exposeUi", from_fn_async(expose_ui).no_cli()) .subcommand( "createOverlayedImage", from_fn_async(create_overlayed_image) @@ -699,23 +698,6 @@ async fn expose_for_dependents( Ok(()) } -async fn expose_ui(context: EffectContext, params: StoreExposedUI) -> Result<(), Error> { - let context = context.deref()?; - let package_id = context.id.clone(); - context - .ctx - .db - .mutate(|db| { - db.as_public_mut() - .as_package_data_mut() - .as_idx_mut(&package_id) - .or_not_found(&package_id)? - .as_store_exposed_ui_mut() - .ser(¶ms) - }) - .await?; - Ok(()) -} #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, TS)] #[ts(export)] #[serde(rename_all = "camelCase")] @@ -1101,7 +1083,7 @@ enum DependencyRequirement { #[ts(type = "string")] version_spec: VersionRange, #[ts(type = "string")] - url: Url, + registry: Url, }, #[serde(rename_all = "camelCase")] Exists { @@ -1110,7 +1092,7 @@ enum DependencyRequirement { #[ts(type = "string")] version_spec: VersionRange, #[ts(type = "string")] - url: Url, + registry: Url, }, } // filebrowser:exists,bitcoind:running:foo+bar+baz @@ -1120,7 +1102,7 @@ impl FromStr for DependencyRequirement { match s.split_once(':') { Some((id, "e")) | Some((id, "exists")) => Ok(Self::Exists { id: id.parse()?, - url: "".parse()?, // TODO + registry: "".parse()?, // TODO version_spec: "*".parse()?, // TODO }), Some((id, rest)) => { @@ -1144,14 +1126,14 @@ impl FromStr for DependencyRequirement { Ok(Self::Running { id: id.parse()?, health_checks, - url: "".parse()?, // TODO + registry: "".parse()?, // TODO version_spec: "*".parse()?, // TODO }) } None => Ok(Self::Running { id: s.parse()?, health_checks: BTreeSet::new(), - url: "".parse()?, // TODO + registry: "".parse()?, // TODO version_spec: "*".parse()?, // TODO }), } @@ -1187,20 +1169,31 @@ async fn set_dependencies( .map(|dependency| match dependency { DependencyRequirement::Exists { id, - url, - version_spec, - } => (id, CurrentDependencyInfo::Exists { url, version_spec }), - DependencyRequirement::Running { - id, - health_checks, - url, + registry, version_spec, } => ( id, - CurrentDependencyInfo::Running { - url, + CurrentDependencyInfo { + kind: CurrentDependencyKind::Exists, + registry, version_spec, - health_checks, + icon: todo!(), + title: todo!(), + }, + ), + DependencyRequirement::Running { + id, + health_checks, + registry, + version_spec, + } => ( + id, + CurrentDependencyInfo { + kind: CurrentDependencyKind::Running { health_checks }, + registry, + version_spec, + icon: todo!(), + title: todo!(), }, ), }) diff --git a/core/startos/src/service/service_map.rs b/core/startos/src/service/service_map.rs index e56b1d7dd..1eebfced6 100644 --- a/core/startos/src/service/service_map.rs +++ b/core/startos/src/service/service_map.rs @@ -10,6 +10,7 @@ use imbl_value::InternedString; use tokio::sync::{Mutex, OwnedRwLockReadGuard, OwnedRwLockWriteGuard, RwLock}; use tracing::instrument; +use crate::context::RpcContext; use crate::db::model::package::{ InstallingInfo, InstallingState, PackageDataEntry, PackageState, UpdatingState, }; @@ -26,7 +27,7 @@ use crate::s9pk::merkle_archive::source::FileSource; use crate::s9pk::S9pk; use crate::service::{LoadDisposition, Service}; use crate::status::{MainStatus, Status}; -use crate::{context::RpcContext, util::serde::Pem}; +use crate::util::serde::Pem; pub type DownloadInstallFuture = BoxFuture<'static, Result>; pub type InstallFuture = BoxFuture<'static, Result<(), Error>>; @@ -170,11 +171,8 @@ impl ServiceMap { developer_key: Pem::new(developer_key), icon, last_backup: None, - dependency_info: Default::default(), current_dependencies: Default::default(), - interface_addresses: Default::default(), hosts: Default::default(), - store_exposed_ui: Default::default(), store_exposed_dependents: Default::default(), }, )?; diff --git a/core/startos/src/status/health_check.rs b/core/startos/src/status/health_check.rs index 7a6cb0430..c2af46490 100644 --- a/core/startos/src/status/health_check.rs +++ b/core/startos/src/status/health_check.rs @@ -1,7 +1,8 @@ pub use models::HealthCheckId; use serde::{Deserialize, Serialize}; +use ts_rs::TS; -#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, TS)] #[serde(rename_all = "camelCase")] #[serde(tag = "result")] pub enum HealthCheckResult { diff --git a/core/startos/src/status/mod.rs b/core/startos/src/status/mod.rs index 13b0568e2..2faa90e79 100644 --- a/core/startos/src/status/mod.rs +++ b/core/startos/src/status/mod.rs @@ -4,15 +4,17 @@ use chrono::{DateTime, Utc}; use imbl::OrdMap; use models::PackageId; use serde::{Deserialize, Serialize}; +use ts_rs::TS; use self::health_check::HealthCheckId; use crate::prelude::*; use crate::status::health_check::HealthCheckResult; pub mod health_check; -#[derive(Clone, Debug, Deserialize, Serialize, HasModel)] +#[derive(Clone, Debug, Deserialize, Serialize, HasModel, TS)] #[serde(rename_all = "camelCase")] #[model = "Model"] +#[ts(export)] pub struct Status { pub configured: bool, pub main: MainStatus, @@ -20,9 +22,9 @@ pub struct Status { pub dependency_config_errors: DependencyConfigErrors, } -#[derive(Clone, Debug, Deserialize, Serialize, HasModel, Default)] -#[serde(rename_all = "camelCase")] +#[derive(Clone, Debug, Deserialize, Serialize, HasModel, Default, TS)] #[model = "Model"] +#[ts(export)] pub struct DependencyConfigErrors(pub BTreeMap); impl Map for DependencyConfigErrors { type Key = PackageId; @@ -35,22 +37,29 @@ impl Map for DependencyConfigErrors { } } -#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, TS)] #[serde(tag = "status")] #[serde(rename_all = "camelCase")] pub enum MainStatus { Stopped, Restarting, + #[serde(rename_all = "camelCase")] Stopping { timeout: crate::util::serde::Duration, }, Starting, + #[serde(rename_all = "camelCase")] Running { + #[ts(type = "string")] started: DateTime, + #[ts(as = "BTreeMap")] health: OrdMap, }, + #[serde(rename_all = "camelCase")] BackingUp { + #[ts(type = "string | null")] started: Option>, + #[ts(as = "BTreeMap")] health: OrdMap, }, } diff --git a/core/startos/src/util/cpupower.rs b/core/startos/src/util/cpupower.rs index cc4ac5ef4..db625f90e 100644 --- a/core/startos/src/util/cpupower.rs +++ b/core/startos/src/util/cpupower.rs @@ -3,6 +3,7 @@ use std::collections::BTreeSet; use imbl::OrdMap; use tokio::process::Command; +use ts_rs::TS; use crate::prelude::*; use crate::util::Invoke; @@ -13,7 +14,10 @@ pub const GOVERNOR_HEIRARCHY: &[Governor] = &[ Governor(Cow::Borrowed("conservative")), ]; -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize)] +#[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/serde.rs b/core/startos/src/util/serde.rs index cd414f66e..2fa992abd 100644 --- a/core/startos/src/util/serde.rs +++ b/core/startos/src/util/serde.rs @@ -15,6 +15,7 @@ use serde::de::DeserializeOwned; use serde::ser::{SerializeMap, SerializeSeq}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_json::Value; +use ts_rs::TS; use super::IntoDoubleEndedIterator; use crate::util::clap::FromStrParser; @@ -633,7 +634,8 @@ where } } -#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, TS)] +#[ts(export, type = "string")] pub struct Duration(std::time::Duration); impl Deref for Duration { type Target = std::time::Duration; @@ -1175,7 +1177,8 @@ impl Pem { } } -#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)] +#[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 {