diff --git a/Cargo.lock b/Cargo.lock index a425d179e..0f0e92e31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" @@ -41,7 +41,7 @@ dependencies = [ [[package]] name = "alerter" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "axum", @@ -120,9 +120,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" [[package]] name = "arc-swap" @@ -138,14 +138,14 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -154,24 +154,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -195,9 +195,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" @@ -268,9 +268,9 @@ dependencies = [ [[package]] name = "aws-sdk-ec2" -version = "1.77.0" +version = "1.79.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6f841697b994ec3a020c560b52693bc9fcb7b9c69210088ab56e03df23b5e" +checksum = "95559916ae9d6ef69b104546098a4b4c57082db5d11571917916e9a69234c6ea" dependencies = [ "aws-credential-types", "aws-runtime", @@ -292,9 +292,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.45.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33ae899566f3d395cbf42858e433930682cc9c1889fa89318896082fef45efb" +checksum = "0dc2faec3205d496c7e57eff685dd944203df7ce16a4116d0281c44021788a7b" dependencies = [ "aws-credential-types", "aws-runtime", @@ -314,9 +314,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.46.0" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f39c09e199ebd96b9f860b0fce4b6625f211e064ad7c8693b72ecf7ef03881e0" +checksum = "c93c241f52bc5e0476e259c953234dab7e2a35ee207ee202e86c0095ec4951dc" dependencies = [ "aws-credential-types", "aws-runtime", @@ -336,9 +336,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.45.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d95f93a98130389eb6233b9d615249e543f6c24a68ca1f109af9ca5164a8765" +checksum = "b259429be94a3459fa1b00c5684faee118d74f9577cc50aebadc36e507c63b5f" dependencies = [ "aws-credential-types", "aws-runtime", @@ -432,9 +432,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -447,7 +447,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -538,7 +538,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "itoa", "matchit", @@ -613,7 +613,7 @@ checksum = "57d123550fa8d071b7255cb0cc04dc302baa6c8c4a79f55701552684d8399bce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -628,7 +628,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "openssl", "pin-project-lite", @@ -640,17 +640,17 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -763,7 +763,7 @@ dependencies = [ "hex", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-named-pipe", "hyper-util", "hyperlocal", @@ -803,7 +803,7 @@ dependencies = [ "base64 0.13.1", "bitvec", "hex", - "indexmap 2.5.0", + "indexmap 2.6.0", "js-sys", "once_cell", "rand", @@ -828,9 +828,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", ] @@ -847,9 +847,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -913,10 +913,10 @@ version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -943,7 +943,7 @@ dependencies = [ [[package]] name = "command" -version = "1.15.12" +version = "1.16.0" dependencies = [ "komodo_client", "run_command", @@ -979,9 +979,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1057,7 +1057,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1081,7 +1081,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1092,7 +1092,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1165,7 +1165,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1175,7 +1175,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1195,7 +1195,7 @@ checksum = "9e520b61247a9470ec86a98baf2aebae5c6dd0f25f02b1c87cafe45b06c160e7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1206,7 +1206,7 @@ checksum = "12c90da6aa09bad94e4411461560183be70bb33bc30efb2ce941492f22ed6850" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1219,7 +1219,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1240,7 +1240,7 @@ checksum = "1bceb8b4ad480f8cf02ae4efb42c95add230544b4239d543cbd9f9141d838581" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1343,19 +1343,19 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "environment_file" -version = "1.15.12" +version = "1.16.0" dependencies = [ "thiserror", ] @@ -1439,7 +1439,7 @@ dependencies = [ [[package]] name = "formatting" -version = "1.15.12" +version = "1.16.0" dependencies = [ "serror", ] @@ -1506,7 +1506,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -1565,13 +1565,13 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "command", @@ -1612,7 +1612,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1631,7 +1631,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1659,6 +1659,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "headers" version = "0.4.0" @@ -1683,12 +1689,6 @@ dependencies = [ "http 1.1.0", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -1845,9 +1845,9 @@ checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1857,9 +1857,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -1881,9 +1881,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1907,7 +1907,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -1923,7 +1923,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs", @@ -1933,15 +1933,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.15", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -1954,7 +1954,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -1969,7 +1969,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "native-tls", "tokio", @@ -1979,20 +1979,19 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", - "tower 0.4.13", "tower-service", "tracing", ] @@ -2005,7 +2004,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" dependencies = [ "hex", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -2014,9 +2013,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2074,12 +2073,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -2118,9 +2117,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" @@ -2154,9 +2153,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2192,7 +2191,7 @@ dependencies = [ [[package]] name = "komodo_cli" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "clap", @@ -2208,7 +2207,7 @@ dependencies = [ [[package]] name = "komodo_client" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "async_timing_util", @@ -2239,7 +2238,7 @@ dependencies = [ [[package]] name = "komodo_core" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "async_timing_util", @@ -2250,6 +2249,7 @@ dependencies = [ "axum-server", "base64 0.22.1", "bcrypt", + "command", "dashmap", "derive_variants", "dotenvy", @@ -2296,7 +2296,7 @@ dependencies = [ [[package]] name = "komodo_periphery" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "async_timing_util", @@ -2340,9 +2340,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libm" @@ -2383,7 +2383,7 @@ dependencies = [ [[package]] name = "logger" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "komodo_client", @@ -2463,11 +2463,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -2501,7 +2501,7 @@ checksum = "d4f3a4215a0cb95aea5fe33a77d38f0e0f7e7b9bf315bede04e0ea0c46fb704a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2560,7 +2560,7 @@ checksum = "3a6dbc533e93429a71c44a14c04547ac783b56d3f22e6c4f12b1b994cf93844e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2727,9 +2727,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] @@ -2769,9 +2769,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openidconnect" @@ -2807,9 +2807,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -2828,7 +2828,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -2839,9 +2839,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -3018,7 +3018,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.7", "smallvec", "windows-targets 0.52.6", ] @@ -3051,7 +3051,7 @@ checksum = "3a506f66d52e40b2385d7b9f776fd5243d6cff16ba79147f859aa4e27d2d27cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3089,7 +3089,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "periphery_client" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "komodo_client", @@ -3103,22 +3103,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3156,9 +3156,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "powerfmt" @@ -3186,18 +3186,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -3205,15 +3205,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3298,9 +3298,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -3354,7 +3354,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "ipnet", "js-sys", @@ -3397,8 +3397,8 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper 1.5.0", + "hyper-rustls 0.27.3", "hyper-tls", "hyper-util", "ipnet", @@ -3409,7 +3409,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", @@ -3464,7 +3464,7 @@ dependencies = [ "futures", "getrandom", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "parking_lot 0.11.2", "reqwest 0.11.27", "reqwest-middleware", @@ -3522,7 +3522,7 @@ checksum = "e35ef0d79735ffcdf944895605c107b7f04ea097ce5a39d3191f9b2d82f73f7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3632,9 +3632,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -3657,13 +3657,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "once_cell", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -3691,19 +3691,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -3717,9 +3716,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -3728,9 +3727,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -3740,11 +3739,11 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3772,7 +3771,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3820,9 +3819,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -3870,7 +3869,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3881,16 +3880,16 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "memchr", "ryu", @@ -3924,14 +3923,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -3950,15 +3949,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -3968,14 +3967,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -3984,7 +3983,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -4176,11 +4175,11 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4211,9 +4210,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -4314,9 +4313,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -4342,7 +4341,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4428,7 +4427,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4468,16 +4467,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -4533,11 +4532,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4558,9 +4557,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", @@ -4571,7 +4570,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-timeout", "hyper-util", "percent-encoding", @@ -4679,7 +4678,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -4808,44 +4807,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a615d6c2764852a2e88a4f16e9ce1ea49bb776b5872956309e170d63a042a34f" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check 0.9.5", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-properties" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" [[package]] name = "unsafe-libyaml" @@ -4867,7 +4863,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "update_logger" -version = "1.15.12" +version = "1.16.0" dependencies = [ "anyhow", "komodo_client", @@ -4908,9 +4904,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", "rand", @@ -4964,9 +4960,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4975,24 +4971,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -5002,9 +4998,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5012,22 +5008,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-timer" @@ -5046,9 +5042,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -5137,7 +5133,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5148,7 +5144,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] @@ -5340,9 +5336,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -5390,7 +5386,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.79", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a1f530f20..a89514517 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ ] [workspace.package] -version = "1.15.12" +version = "1.16.0" edition = "2021" authors = ["mbecker20 "] license = "GPL-3.0-or-later" @@ -64,12 +64,12 @@ tokio-tungstenite = "0.24.0" ordered_hash_map = { version = "0.4.0", features = ["serde"] } serde = { version = "1.0.210", features = ["derive"] } strum = { version = "0.26.3", features = ["derive"] } -serde_json = "1.0.128" +serde_json = "1.0.132" serde_yaml = "0.9.34" toml = "0.8.19" # ERROR -anyhow = "1.0.89" +anyhow = "1.0.90" thiserror = "1.0.64" # LOGGING diff --git a/bin/cli/src/exec.rs b/bin/cli/src/exec.rs index 2caf67be4..284596f6f 100644 --- a/bin/cli/src/exec.rs +++ b/bin/cli/src/exec.rs @@ -21,6 +21,9 @@ pub async fn run(execution: Execution) -> anyhow::Result<()> { Execution::None(data) => { println!("{}: {data:?}", "Data".dimmed()) } + Execution::RunAction(data) => { + println!("{}: {data:?}", "Data".dimmed()) + } Execution::RunProcedure(data) => { println!("{}: {data:?}", "Data".dimmed()) } @@ -168,6 +171,9 @@ pub async fn run(execution: Execution) -> anyhow::Result<()> { info!("Running Execution..."); let res = match execution { + Execution::RunAction(request) => { + komodo_client().execute(request).await + } Execution::RunProcedure(request) => { komodo_client().execute(request).await } diff --git a/bin/core/Cargo.toml b/bin/core/Cargo.toml index 919609fd6..14617fd62 100644 --- a/bin/core/Cargo.toml +++ b/bin/core/Cargo.toml @@ -19,6 +19,7 @@ komodo_client = { workspace = true, features = ["mongo"] } periphery_client.workspace = true environment_file.workspace = true formatting.workspace = true +command.workspace = true logger.workspace = true git.workspace = true # mogh diff --git a/bin/core/alpine.Dockerfile b/bin/core/alpine.Dockerfile index 5826bdd32..04bd08195 100644 --- a/bin/core/alpine.Dockerfile +++ b/bin/core/alpine.Dockerfile @@ -4,7 +4,7 @@ ## and may negatively affect runtime performance. # Build Core -FROM rust:1.81.0-alpine AS core-builder +FROM rust:1.82.0-alpine AS core-builder WORKDIR /builder RUN apk update && apk --no-cache add musl-dev openssl-dev openssl-libs-static COPY . . @@ -23,7 +23,7 @@ FROM alpine:3.20 # Install Deps RUN apk update && apk add --no-cache --virtual .build-deps \ - openssl ca-certificates git git-lfs + openssl ca-certificates git git-lfs curl # Setup an application directory WORKDIR /app @@ -32,6 +32,7 @@ WORKDIR /app COPY ./config/core.config.toml /config/config.toml COPY --from=core-builder /builder/target/release/core /app COPY --from=frontend-builder /builder/frontend/dist /app/frontend +COPY --from=denoland/deno:bin /deno /usr/local/bin/deno # Hint at the port EXPOSE 9120 diff --git a/bin/core/debian.Dockerfile b/bin/core/debian.Dockerfile index c0c66a625..bdab2feac 100644 --- a/bin/core/debian.Dockerfile +++ b/bin/core/debian.Dockerfile @@ -1,5 +1,5 @@ # Build Core -FROM rust:1.81.0-bullseye AS core-builder +FROM rust:1.82.0-bullseye AS core-builder WORKDIR /builder COPY . . RUN cargo build -p komodo_core --release @@ -27,6 +27,7 @@ WORKDIR /app COPY ./config/core.config.toml /config/config.toml COPY --from=core-builder /builder/target/release/core /app COPY --from=frontend-builder /builder/frontend/dist /app/frontend +COPY --from=denoland/deno:bin /deno /usr/local/bin/deno # Hint at the port EXPOSE 9120 diff --git a/bin/core/src/alert/mod.rs b/bin/core/src/alert/mod.rs index 9b9295953..aa64d69e5 100644 --- a/bin/core/src/alert/mod.rs +++ b/bin/core/src/alert/mod.rs @@ -201,6 +201,9 @@ fn resource_link( ResourceTargetVariant::Procedure => { format!("/procedures/{id}") } + ResourceTargetVariant::Action => { + format!("/actions/{id}") + } ResourceTargetVariant::ServerTemplate => { format!("/server-templates/{id}") } diff --git a/bin/core/src/api/execute/action.rs b/bin/core/src/api/execute/action.rs new file mode 100644 index 000000000..f5cb46eb5 --- /dev/null +++ b/bin/core/src/api/execute/action.rs @@ -0,0 +1,206 @@ +use std::collections::HashSet; + +use anyhow::Context; +use command::run_komodo_command; +use komodo_client::{ + api::{ + execute::RunAction, + user::{CreateApiKey, CreateApiKeyResponse, DeleteApiKey}, + }, + entities::{ + action::Action, + config::core::CoreConfig, + permission::PermissionLevel, + update::Update, + user::{action_user, User}, + }, +}; +use mungos::{by_id::update_one_by_id, mongodb::bson::to_document}; +use resolver_api::Resolve; +use tokio::fs; + +use crate::{ + config::core_config, + helpers::{ + interpolate::{ + add_interp_update_log, + interpolate_variables_secrets_into_string, + }, + query::get_variables_and_secrets, + random_string, + update::update_update, + }, + resource::{self, refresh_action_state_cache}, + state::{action_states, db_client, State}, +}; + +impl Resolve for State { + async fn resolve( + &self, + RunAction { action }: RunAction, + (user, mut update): (User, Update), + ) -> anyhow::Result { + let mut action = resource::get_check_permissions::( + &action, + &user, + PermissionLevel::Execute, + ) + .await?; + + // get the action state for the action (or insert default). + let action_state = action_states() + .action + .get_or_insert_default(&action.id) + .await; + + // This will set action state back to default when dropped. + // Will also check to ensure action not already busy before updating. + let _action_guard = + action_state.update(|state| state.running = true)?; + + update_update(update.clone()).await?; + + let CreateApiKeyResponse { key, secret } = State + .resolve( + CreateApiKey { + name: update.id.clone(), + expires: 0, + }, + action_user().to_owned(), + ) + .await?; + + let contents = &mut action.config.file_contents; + + // Wrap the file contents in the execution context. + *contents = full_contents(contents, &key, &secret); + + let replacers = + interpolate(contents, &mut update, key.clone(), secret.clone()) + .await? + .into_iter() + .collect::>(); + + let path = core_config() + .action_directory + .join(format!("{}.ts", random_string(10))); + + if let Some(parent) = path.parent() { + let _ = fs::create_dir_all(parent).await; + } + + fs::write(&path, contents).await.with_context(|| { + format!("Faild to write action file to {path:?}") + })?; + + let mut res = run_komodo_command( + // Keep this stage name as is, the UI will find the latest update log by matching the stage name + "Execute Action", + None, + format!("deno run --allow-read --allow-net --allow-import {}", path.display()), + false, + ) + .await; + + res.stdout = svi::replace_in_string(&res.stdout, &replacers) + .replace(&key, ""); + res.stderr = svi::replace_in_string(&res.stderr, &replacers) + .replace(&secret, ""); + + if let Err(e) = fs::remove_file(path).await { + warn!( + "Failed to delete action file after action execution | {e:#}" + ); + } + + if let Err(e) = State + .resolve(DeleteApiKey { key }, action_user().to_owned()) + .await + { + warn!( + "Failed to delete API key after action execution | {e:#}" + ); + }; + + update.logs.push(res); + update.finalize(); + + // Need to manually update the update before cache refresh, + // and before broadcast with update_update. + // The Err case of to_document should be unreachable, + // but will fail to update cache in that case. + if let Ok(update_doc) = to_document(&update) { + let _ = update_one_by_id( + &db_client().updates, + &update.id, + mungos::update::Update::Set(update_doc), + None, + ) + .await; + refresh_action_state_cache().await; + } + + update_update(update.clone()).await?; + + Ok(update) + } +} + +async fn interpolate( + contents: &mut String, + update: &mut Update, + key: String, + secret: String, +) -> anyhow::Result> { + let mut vars_and_secrets = get_variables_and_secrets().await?; + + vars_and_secrets + .secrets + .insert(String::from("ACTION_API_KEY"), key); + vars_and_secrets + .secrets + .insert(String::from("ACTION_API_SECRET"), secret); + + let mut global_replacers = HashSet::new(); + let mut secret_replacers = HashSet::new(); + + interpolate_variables_secrets_into_string( + &vars_and_secrets, + contents, + &mut global_replacers, + &mut secret_replacers, + )?; + + add_interp_update_log(update, &global_replacers, &secret_replacers); + + Ok(secret_replacers) +} + +fn full_contents(contents: &str, key: &str, secret: &str) -> String { + let CoreConfig { + port, ssl_enabled, .. + } = core_config(); + let protocol = if *ssl_enabled { "https" } else { "http" }; + let base_url = format!("{protocol}://localhost:{port}"); + format!( + "import {{ KomodoClient }} from '{base_url}/client/lib.js'; + +const komodo = KomodoClient('{base_url}', {{ + type: 'api-key', + params: {{ key: '{key}', secret: '{secret}' }} +}}); + +async function main() {{{contents}}} + +main().catch(error => {{ + console.error('🚨 Action exited early with errors 🚨') + if (error.status !== undefined && error.result !== undefined) {{ + console.error('Status:', error.status); + console.error(JSON.stringify(error.result, null, 2)); + }} else {{ + console.error(JSON.stringify(error, null, 2)); + }} + Deno.exit(1) +}}).then(() => console.log('🦎 Action completed successfully 🦎'));" + ) +} diff --git a/bin/core/src/api/execute/mod.rs b/bin/core/src/api/execute/mod.rs index 893b3e51c..3b146e7e2 100644 --- a/bin/core/src/api/execute/mod.rs +++ b/bin/core/src/api/execute/mod.rs @@ -24,6 +24,7 @@ use crate::{ state::{db_client, State}, }; +mod action; mod build; mod deployment; mod procedure; @@ -97,6 +98,9 @@ pub enum ExecuteRequest { // ==== PROCEDURE ==== RunProcedure(RunProcedure), + // ==== ACTION ==== + RunAction(RunAction), + // ==== SERVER TEMPLATE ==== LaunchServer(LaunchServer), diff --git a/bin/core/src/api/execute/sync.rs b/bin/core/src/api/execute/sync.rs index 890c959ea..60f6176f2 100644 --- a/bin/core/src/api/execute/sync.rs +++ b/bin/core/src/api/execute/sync.rs @@ -6,6 +6,7 @@ use komodo_client::{ api::{execute::RunSync, write::RefreshResourceSyncPending}, entities::{ self, + action::Action, alerter::Alerter, build::Build, builder::Builder, @@ -126,6 +127,10 @@ impl Resolve for State { .procedures .get(&name_or_id) .map(|p| p.name.clone()), + ResourceTargetVariant::Action => all_resources + .actions + .get(&name_or_id) + .map(|p| p.name.clone()), ResourceTargetVariant::Repo => all_resources .repos .get(&name_or_id) @@ -270,6 +275,17 @@ impl Resolve for State { &sync.config.match_tags, ) .await?; + let (actions_to_create, actions_to_update, actions_to_delete) = + get_updates_for_execution::( + resources.actions, + delete, + &all_resources, + match_resource_type, + match_resources.as_deref(), + &id_to_tags, + &sync.config.match_tags, + ) + .await?; let (builders_to_create, builders_to_update, builders_to_delete) = get_updates_for_execution::( resources.builders, @@ -388,6 +404,9 @@ impl Resolve for State { && procedures_to_create.is_empty() && procedures_to_update.is_empty() && procedures_to_delete.is_empty() + && actions_to_create.is_empty() + && actions_to_update.is_empty() + && actions_to_delete.is_empty() && user_groups_to_create.is_empty() && user_groups_to_update.is_empty() && user_groups_to_delete.is_empty() @@ -464,6 +483,15 @@ impl Resolve for State { ) .await, ); + maybe_extend( + &mut update.logs, + Action::execute_sync_updates( + actions_to_create, + actions_to_update, + actions_to_delete, + ) + .await, + ); // Dependent on server maybe_extend( diff --git a/bin/core/src/api/read/action.rs b/bin/core/src/api/read/action.rs new file mode 100644 index 000000000..3501333a3 --- /dev/null +++ b/bin/core/src/api/read/action.rs @@ -0,0 +1,132 @@ +use anyhow::Context; +use komodo_client::{ + api::read::*, + entities::{ + action::{ + Action, ActionActionState, ActionListItem, ActionState, + }, + permission::PermissionLevel, + user::User, + }, +}; +use resolver_api::Resolve; + +use crate::{ + helpers::query::get_all_tags, + resource, + state::{action_state_cache, action_states, State}, +}; + +impl Resolve for State { + async fn resolve( + &self, + GetAction { action }: GetAction, + user: User, + ) -> anyhow::Result { + resource::get_check_permissions::( + &action, + &user, + PermissionLevel::Read, + ) + .await + } +} + +impl Resolve for State { + async fn resolve( + &self, + ListActions { query }: ListActions, + user: User, + ) -> anyhow::Result> { + let all_tags = if query.tags.is_empty() { + vec![] + } else { + get_all_tags(None).await? + }; + resource::list_for_user::(query, &user, &all_tags).await + } +} + +impl Resolve for State { + async fn resolve( + &self, + ListFullActions { query }: ListFullActions, + user: User, + ) -> anyhow::Result { + let all_tags = if query.tags.is_empty() { + vec![] + } else { + get_all_tags(None).await? + }; + resource::list_full_for_user::(query, &user, &all_tags) + .await + } +} + +impl Resolve for State { + async fn resolve( + &self, + GetActionActionState { action }: GetActionActionState, + user: User, + ) -> anyhow::Result { + let action = resource::get_check_permissions::( + &action, + &user, + PermissionLevel::Read, + ) + .await?; + let action_state = action_states() + .action + .get(&action.id) + .await + .unwrap_or_default() + .get()?; + Ok(action_state) + } +} + +impl Resolve for State { + async fn resolve( + &self, + GetActionsSummary {}: GetActionsSummary, + user: User, + ) -> anyhow::Result { + let actions = resource::list_full_for_user::( + Default::default(), + &user, + &[], + ) + .await + .context("failed to get actions from db")?; + + let mut res = GetActionsSummaryResponse::default(); + + let cache = action_state_cache(); + let action_states = action_states(); + + for action in actions { + res.total += 1; + + match ( + cache.get(&action.id).await.unwrap_or_default(), + action_states + .action + .get(&action.id) + .await + .unwrap_or_default() + .get()?, + ) { + (_, action_states) if action_states.running => { + res.running += 1; + } + (ActionState::Ok, _) => res.ok += 1, + (ActionState::Failed, _) => res.failed += 1, + (ActionState::Unknown, _) => res.unknown += 1, + // will never come off the cache in the running state, since that comes from action states + (ActionState::Running, _) => unreachable!(), + } + } + + Ok(res) + } +} diff --git a/bin/core/src/api/read/mod.rs b/bin/core/src/api/read/mod.rs index dea802a1c..d281621f1 100644 --- a/bin/core/src/api/read/mod.rs +++ b/bin/core/src/api/read/mod.rs @@ -29,6 +29,7 @@ use crate::{ resource, state::State, }; +mod action; mod alert; mod alerter; mod build; @@ -88,6 +89,13 @@ enum ReadRequest { ListProcedures(ListProcedures), ListFullProcedures(ListFullProcedures), + // ==== ACTION ==== + GetActionsSummary(GetActionsSummary), + GetAction(GetAction), + GetActionActionState(GetActionActionState), + ListActions(ListActions), + ListFullActions(ListFullActions), + // ==== SERVER TEMPLATE ==== GetServerTemplate(GetServerTemplate), GetServerTemplatesSummary(GetServerTemplatesSummary), diff --git a/bin/core/src/api/read/toml.rs b/bin/core/src/api/read/toml.rs index eeb702c97..5186e6196 100644 --- a/bin/core/src/api/read/toml.rs +++ b/bin/core/src/api/read/toml.rs @@ -6,7 +6,7 @@ use komodo_client::{ ListUserGroups, }, entities::{ - alerter::Alerter, build::Build, builder::Builder, + action::Action, alerter::Alerter, build::Build, builder::Builder, deployment::Deployment, permission::PermissionLevel, procedure::Procedure, repo::Repo, resource::ResourceQuery, server::Server, server_template::ServerTemplate, stack::Stack, @@ -124,6 +124,16 @@ impl Resolve for State { .into_iter() .map(|resource| ResourceTarget::Procedure(resource.id)), ); + targets.extend( + resource::list_for_user::( + ResourceQuery::builder().tags(tags.clone()).build(), + &user, + &all_tags, + ) + .await? + .into_iter() + .map(|resource| ResourceTarget::Action(resource.id)), + ); targets.extend( resource::list_for_user::( ResourceQuery::builder().tags(tags.clone()).build(), @@ -339,6 +349,21 @@ impl Resolve for State { &id_to_tags, )); } + ResourceTarget::Action(id) => { + let mut action = resource::get_check_permissions::( + &id, + &user, + PermissionLevel::Read, + ) + .await?; + Action::replace_ids(&mut action, &all); + res.actions.push(convert_resource::( + action, + false, + vec![], + &id_to_tags, + )); + } ResourceTarget::System(_) => continue, }; } @@ -442,6 +467,14 @@ fn serialize_resources_toml( Procedure::push_to_toml_string(procedure, &mut toml)?; } + for action in resources.actions { + if !toml.is_empty() { + toml.push_str("\n\n##\n\n"); + } + toml.push_str("[[action]]\n"); + Action::push_to_toml_string(action, &mut toml)?; + } + for alerter in resources.alerters { if !toml.is_empty() { toml.push_str("\n\n##\n\n"); diff --git a/bin/core/src/api/read/update.rs b/bin/core/src/api/read/update.rs index 9b214ce6c..89d59440d 100644 --- a/bin/core/src/api/read/update.rs +++ b/bin/core/src/api/read/update.rs @@ -4,6 +4,7 @@ use anyhow::{anyhow, Context}; use komodo_client::{ api::read::{GetUpdate, ListUpdates, ListUpdatesResponse}, entities::{ + action::Action, alerter::Alerter, build::Build, builder::Builder, @@ -104,15 +105,15 @@ impl Resolve for State { }) .unwrap_or_else(|| doc! { "target.type": "Procedure" }); - // let action_query = - // resource::get_resource_ids_for_user::(&user) - // .await? - // .map(|ids| { - // doc! { - // "target.type": "Action", "target.id": { "$in": ids } - // } - // }) - // .unwrap_or_else(|| doc! { "target.type": "Action" }); + let action_query = + resource::get_resource_ids_for_user::(&user) + .await? + .map(|ids| { + doc! { + "target.type": "Action", "target.id": { "$in": ids } + } + }) + .unwrap_or_else(|| doc! { "target.type": "Action" }); let builder_query = resource::get_resource_ids_for_user::(&user) @@ -165,7 +166,7 @@ impl Resolve for State { build_query, repo_query, procedure_query, - // action_query, + action_query, alerter_query, builder_query, server_template_query, @@ -303,6 +304,14 @@ impl Resolve for State { ) .await?; } + ResourceTarget::Action(id) => { + resource::get_check_permissions::( + id, + &user, + PermissionLevel::Read, + ) + .await?; + } ResourceTarget::ServerTemplate(id) => { resource::get_check_permissions::( id, diff --git a/bin/core/src/api/write/action.rs b/bin/core/src/api/write/action.rs new file mode 100644 index 000000000..1924580d7 --- /dev/null +++ b/bin/core/src/api/write/action.rs @@ -0,0 +1,59 @@ +use komodo_client::{ + api::write::*, + entities::{ + action::Action, permission::PermissionLevel, user::User, + }, +}; +use resolver_api::Resolve; + +use crate::{resource, state::State}; + +impl Resolve for State { + #[instrument(name = "CreateAction", skip(self, user))] + async fn resolve( + &self, + CreateAction { name, config }: CreateAction, + user: User, + ) -> anyhow::Result { + resource::create::(&name, config, &user).await + } +} + +impl Resolve for State { + #[instrument(name = "CopyAction", skip(self, user))] + async fn resolve( + &self, + CopyAction { name, id }: CopyAction, + user: User, + ) -> anyhow::Result { + let Action { config, .. } = resource::get_check_permissions::< + Action, + >( + &id, &user, PermissionLevel::Write + ) + .await?; + resource::create::(&name, config.into(), &user).await + } +} + +impl Resolve for State { + #[instrument(name = "UpdateAction", skip(self, user))] + async fn resolve( + &self, + UpdateAction { id, config }: UpdateAction, + user: User, + ) -> anyhow::Result { + resource::update::(&id, config, &user).await + } +} + +impl Resolve for State { + #[instrument(name = "DeleteAction", skip(self, user))] + async fn resolve( + &self, + DeleteAction { id }: DeleteAction, + user: User, + ) -> anyhow::Result { + resource::delete::(&id, &user).await + } +} diff --git a/bin/core/src/api/write/description.rs b/bin/core/src/api/write/description.rs index fd777c2fe..2740e722b 100644 --- a/bin/core/src/api/write/description.rs +++ b/bin/core/src/api/write/description.rs @@ -2,7 +2,7 @@ use anyhow::anyhow; use komodo_client::{ api::write::{UpdateDescription, UpdateDescriptionResponse}, entities::{ - alerter::Alerter, build::Build, builder::Builder, + action::Action, alerter::Alerter, build::Build, builder::Builder, deployment::Deployment, procedure::Procedure, repo::Repo, server::Server, server_template::ServerTemplate, stack::Stack, sync::ResourceSync, user::User, ResourceTarget, @@ -84,6 +84,14 @@ impl Resolve for State { ) .await?; } + ResourceTarget::Action(id) => { + resource::update_description::( + &id, + &description, + &user, + ) + .await?; + } ResourceTarget::ServerTemplate(id) => { resource::update_description::( &id, diff --git a/bin/core/src/api/write/mod.rs b/bin/core/src/api/write/mod.rs index c7b60c5c6..835cf55d6 100644 --- a/bin/core/src/api/write/mod.rs +++ b/bin/core/src/api/write/mod.rs @@ -13,6 +13,7 @@ use uuid::Uuid; use crate::{auth::auth_request, state::State}; +mod action; mod alerter; mod build; mod builder; @@ -125,6 +126,12 @@ pub enum WriteRequest { DeleteProcedure(DeleteProcedure), UpdateProcedure(UpdateProcedure), + // ==== ACTION ==== + CreateAction(CreateAction), + CopyAction(CopyAction), + DeleteAction(DeleteAction), + UpdateAction(UpdateAction), + // ==== SYNC ==== CreateResourceSync(CreateResourceSync), CopyResourceSync(CopyResourceSync), diff --git a/bin/core/src/api/write/permissions.rs b/bin/core/src/api/write/permissions.rs index 466adcc29..65e96655b 100644 --- a/bin/core/src/api/write/permissions.rs +++ b/bin/core/src/api/write/permissions.rs @@ -387,6 +387,20 @@ async fn extract_resource_target_with_validation( .id; Ok((ResourceTargetVariant::Procedure, id)) } + ResourceTarget::Action(ident) => { + let filter = match ObjectId::from_str(ident) { + Ok(id) => doc! { "_id": id }, + Err(_) => doc! { "name": ident }, + }; + let id = db_client() + .actions + .find_one(filter) + .await + .context("failed to query db for actions")? + .context("no matching action found")? + .id; + Ok((ResourceTargetVariant::Action, id)) + } ResourceTarget::ServerTemplate(ident) => { let filter = match ObjectId::from_str(ident) { Ok(id) => doc! { "_id": id }, diff --git a/bin/core/src/api/write/sync.rs b/bin/core/src/api/write/sync.rs index 9be0ece05..6c4293ed1 100644 --- a/bin/core/src/api/write/sync.rs +++ b/bin/core/src/api/write/sync.rs @@ -5,28 +5,9 @@ use formatting::format_serror; use komodo_client::{ api::{read::ExportAllResourcesToToml, write::*}, entities::{ - self, - alert::{Alert, AlertData, SeverityLevel}, - alerter::Alerter, - all_logs_success, - build::Build, - builder::Builder, - config::core::CoreConfig, - deployment::Deployment, - komodo_timestamp, - permission::PermissionLevel, - procedure::Procedure, - repo::Repo, - server::Server, - server_template::ServerTemplate, - stack::Stack, - sync::{ + self, action::Action, alert::{Alert, AlertData, SeverityLevel}, alerter::Alerter, all_logs_success, build::Build, builder::Builder, config::core::CoreConfig, deployment::Deployment, komodo_timestamp, permission::PermissionLevel, procedure::Procedure, repo::Repo, server::Server, server_template::ServerTemplate, stack::Stack, sync::{ PartialResourceSyncConfig, ResourceSync, ResourceSyncInfo, - }, - to_komodo_name, - update::{Log, Update}, - user::{sync_user, User}, - CloneArgs, NoData, Operation, ResourceTarget, + }, to_komodo_name, update::{Log, Update}, user::{sync_user, User}, CloneArgs, NoData, Operation, ResourceTarget }, }; use mungos::{ @@ -535,6 +516,17 @@ impl Resolve for State { &mut diffs, ) .await?; + push_updates_for_view::( + resources.actions, + delete, + &all_resources, + None, + None, + &id_to_tags, + &sync.config.match_tags, + &mut diffs, + ) + .await?; push_updates_for_view::( resources.builders, delete, diff --git a/bin/core/src/api/write/tag.rs b/bin/core/src/api/write/tag.rs index 071884e36..a45b37850 100644 --- a/bin/core/src/api/write/tag.rs +++ b/bin/core/src/api/write/tag.rs @@ -7,7 +7,7 @@ use komodo_client::{ UpdateTagsOnResourceResponse, }, entities::{ - alerter::Alerter, build::Build, builder::Builder, + action::Action, alerter::Alerter, build::Build, builder::Builder, deployment::Deployment, permission::PermissionLevel, procedure::Procedure, repo::Repo, server::Server, server_template::ServerTemplate, stack::Stack, @@ -182,6 +182,15 @@ impl Resolve for State { .await?; resource::update_tags::(&id, tags, user).await? } + ResourceTarget::Action(id) => { + resource::get_check_permissions::( + &id, + &user, + PermissionLevel::Write, + ) + .await?; + resource::update_tags::(&id, tags, user).await? + } ResourceTarget::ServerTemplate(id) => { resource::get_check_permissions::( &id, diff --git a/bin/core/src/api/write/variable.rs b/bin/core/src/api/write/variable.rs index fa47404fc..aef49517c 100644 --- a/bin/core/src/api/write/variable.rs +++ b/bin/core/src/api/write/variable.rs @@ -81,7 +81,7 @@ impl Resolve for State { let variable = get_variable(&name).await?; if value == variable.value { - return Err(anyhow!("no change")); + return Ok(variable); } db_client() diff --git a/bin/core/src/config.rs b/bin/core/src/config.rs index 624de99d3..0860b52da 100644 --- a/bin/core/src/config.rs +++ b/bin/core/src/config.rs @@ -150,6 +150,9 @@ pub fn core_config() -> &'static CoreConfig { repo_directory: env .komodo_repo_directory .unwrap_or(config.repo_directory), + action_directory: env + .komodo_action_directory + .unwrap_or(config.action_directory), resource_poll_interval: env .komodo_resource_poll_interval .unwrap_or(config.resource_poll_interval), diff --git a/bin/core/src/db.rs b/bin/core/src/db.rs index 43ff70f3b..d372ed3c7 100644 --- a/bin/core/src/db.rs +++ b/bin/core/src/db.rs @@ -1,4 +1,5 @@ use komodo_client::entities::{ + action::Action, alert::Alert, alerter::Alerter, api_key::ApiKey, @@ -47,6 +48,7 @@ pub struct DbClient { pub builders: Collection, pub repos: Collection, pub procedures: Collection, + pub actions: Collection, pub alerters: Collection, pub server_templates: Collection, pub resource_syncs: Collection, @@ -115,6 +117,7 @@ impl DbClient { repos: resource_collection(&db, "Repo").await?, alerters: resource_collection(&db, "Alerter").await?, procedures: resource_collection(&db, "Procedure").await?, + actions: resource_collection(&db, "Action").await?, server_templates: resource_collection(&db, "ServerTemplate") .await?, resource_syncs: resource_collection(&db, "ResourceSync") diff --git a/bin/core/src/helpers/action_state.rs b/bin/core/src/helpers/action_state.rs index e27afb8ef..4582bc319 100644 --- a/bin/core/src/helpers/action_state.rs +++ b/bin/core/src/helpers/action_state.rs @@ -4,7 +4,8 @@ use anyhow::anyhow; use komodo_client::{ busy::Busy, entities::{ - build::BuildActionState, deployment::DeploymentActionState, + action::ActionActionState, build::BuildActionState, + deployment::DeploymentActionState, procedure::ProcedureActionState, repo::RepoActionState, server::ServerActionState, stack::StackActionState, sync::ResourceSyncActionState, @@ -22,6 +23,7 @@ pub struct ActionStates { pub repo: Cache>>, pub procedure: Cache>>, + pub action: Cache>>, pub resource_sync: Cache>>, pub stack: Cache>>, diff --git a/bin/core/src/helpers/procedure.rs b/bin/core/src/helpers/procedure.rs index f0863cde1..e71eba1a4 100644 --- a/bin/core/src/helpers/procedure.rs +++ b/bin/core/src/helpers/procedure.rs @@ -146,6 +146,22 @@ async fn execute_execution( ) .await? } + Execution::RunAction(req) => { + let req = ExecuteRequest::RunAction(req); + let update = init_execution_update(&req, &user).await?; + let ExecuteRequest::RunAction(req) = req else { + unreachable!() + }; + let update_id = update.id.clone(); + handle_resolve_result( + State + .resolve(req, (user, update)) + .await + .context("Failed at RunAction"), + &update_id, + ) + .await? + } Execution::RunBuild(req) => { let req = ExecuteRequest::RunBuild(req); let update = init_execution_update(&req, &user).await?; diff --git a/bin/core/src/helpers/query.rs b/bin/core/src/helpers/query.rs index f3632d3a9..2e2c562b3 100644 --- a/bin/core/src/helpers/query.rs +++ b/bin/core/src/helpers/query.rs @@ -2,6 +2,7 @@ use std::{collections::HashMap, str::FromStr}; use anyhow::{anyhow, Context}; use komodo_client::entities::{ + action::Action, alerter::Alerter, build::Build, builder::Builder, @@ -291,6 +292,9 @@ pub async fn get_user_permission_on_target( ResourceTarget::Procedure(id) => { get_user_permission_on_resource::(user, id).await } + ResourceTarget::Action(id) => { + get_user_permission_on_resource::(user, id).await + } ResourceTarget::ServerTemplate(id) => { get_user_permission_on_resource::(user, id) .await diff --git a/bin/core/src/helpers/update.rs b/bin/core/src/helpers/update.rs index 2512964a0..3dd910957 100644 --- a/bin/core/src/helpers/update.rs +++ b/bin/core/src/helpers/update.rs @@ -1,5 +1,6 @@ use anyhow::Context; use komodo_client::entities::{ + action::Action, build::Build, deployment::Deployment, komodo_timestamp, @@ -345,6 +346,14 @@ pub async fn init_execution_update( ), ), + // Action + ExecuteRequest::RunAction(data) => ( + Operation::RunAction, + ResourceTarget::Action( + resource::get::(&data.action).await?.id, + ), + ), + // Server template ExecuteRequest::LaunchServer(data) => ( Operation::LaunchServer, diff --git a/bin/core/src/main.rs b/bin/core/src/main.rs index e7f39fe36..bd3346590 100644 --- a/bin/core/src/main.rs +++ b/bin/core/src/main.rs @@ -57,6 +57,7 @@ async fn app() -> anyhow::Result<()> { resource::spawn_build_state_refresh_loop(); resource::spawn_repo_state_refresh_loop(); resource::spawn_procedure_state_refresh_loop(); + resource::spawn_action_state_refresh_loop(); resource::spawn_resource_sync_state_refresh_loop(); helpers::prune::spawn_prune_loop(); diff --git a/bin/core/src/resource/action.rs b/bin/core/src/resource/action.rs new file mode 100644 index 000000000..22c0ca202 --- /dev/null +++ b/bin/core/src/resource/action.rs @@ -0,0 +1,214 @@ +use std::time::Duration; + +use anyhow::Context; +use komodo_client::entities::{ + action::{ + Action, ActionConfig, ActionConfigDiff, ActionInfo, + ActionListItem, ActionListItemInfo, ActionQuerySpecifics, + ActionState, PartialActionConfig, + }, + resource::Resource, + update::Update, + user::User, + Operation, ResourceTargetVariant, +}; +use mungos::{ + find::find_collect, + mongodb::{bson::doc, options::FindOneOptions, Collection}, +}; + +use crate::state::{action_state_cache, action_states, db_client}; + +impl super::KomodoResource for Action { + type Config = ActionConfig; + type PartialConfig = PartialActionConfig; + type ConfigDiff = ActionConfigDiff; + type Info = ActionInfo; + type ListItem = ActionListItem; + type QuerySpecifics = ActionQuerySpecifics; + + fn resource_type() -> ResourceTargetVariant { + ResourceTargetVariant::Action + } + + async fn coll( + ) -> &'static Collection> { + &db_client().actions + } + + async fn to_list_item( + action: Resource, + ) -> Self::ListItem { + let state = get_action_state(&action.id).await; + ActionListItem { + name: action.name, + id: action.id, + tags: action.tags, + resource_type: ResourceTargetVariant::Action, + info: ActionListItemInfo { + state, + last_run_at: action.info.last_run_at, + }, + } + } + + async fn busy(id: &String) -> anyhow::Result { + action_states() + .action + .get(id) + .await + .unwrap_or_default() + .busy() + } + + // CREATE + + fn create_operation() -> Operation { + Operation::CreateAction + } + + fn user_can_create(user: &User) -> bool { + user.admin + } + + async fn validate_create_config( + config: &mut Self::PartialConfig, + _user: &User, + ) -> anyhow::Result<()> { + if config.file_contents.is_none() { + config.file_contents = + Some(DEFAULT_ACTION_FILE_CONTENTS.to_string()); + } + Ok(()) + } + + async fn post_create( + _created: &Resource, + _update: &mut Update, + ) -> anyhow::Result<()> { + refresh_action_state_cache().await; + Ok(()) + } + + // UPDATE + + fn update_operation() -> Operation { + Operation::UpdateAction + } + + async fn validate_update_config( + _id: &str, + _config: &mut Self::PartialConfig, + _user: &User, + ) -> anyhow::Result<()> { + Ok(()) + } + + async fn post_update( + _updated: &Self, + _update: &mut Update, + ) -> anyhow::Result<()> { + refresh_action_state_cache().await; + Ok(()) + } + + // DELETE + + fn delete_operation() -> Operation { + Operation::DeleteAction + } + + async fn pre_delete( + _resource: &Resource, + _update: &mut Update, + ) -> anyhow::Result<()> { + Ok(()) + } + + async fn post_delete( + _resource: &Resource, + _update: &mut Update, + ) -> anyhow::Result<()> { + Ok(()) + } +} + +pub fn spawn_action_state_refresh_loop() { + tokio::spawn(async move { + loop { + refresh_action_state_cache().await; + tokio::time::sleep(Duration::from_secs(60)).await; + } + }); +} + +pub async fn refresh_action_state_cache() { + let _ = async { + let actions = find_collect(&db_client().actions, None, None) + .await + .context("Failed to get Actions from db")?; + let cache = action_state_cache(); + for action in actions { + let state = get_action_state_from_db(&action.id).await; + cache.insert(action.id, state).await; + } + anyhow::Ok(()) + } + .await + .inspect_err(|e| { + error!("Failed to refresh Action state cache | {e:#}") + }); +} + +async fn get_action_state(id: &String) -> ActionState { + if action_states() + .action + .get(id) + .await + .map(|s| s.get().map(|s| s.running)) + .transpose() + .ok() + .flatten() + .unwrap_or_default() + { + return ActionState::Running; + } + action_state_cache().get(id).await.unwrap_or_default() +} + +async fn get_action_state_from_db(id: &str) -> ActionState { + async { + let state = db_client() + .updates + .find_one(doc! { + "target.type": "Action", + "target.id": id, + "operation": "RunAction" + }) + .with_options( + FindOneOptions::builder() + .sort(doc! { "start_ts": -1 }) + .build(), + ) + .await? + .map(|u| { + if u.success { + ActionState::Ok + } else { + ActionState::Failed + } + }) + .unwrap_or(ActionState::Ok); + anyhow::Ok(state) + } + .await + .inspect_err(|e| { + warn!("Failed to get Action state for {id} | {e:#}") + }) + .unwrap_or(ActionState::Unknown) +} + +const DEFAULT_ACTION_FILE_CONTENTS: &str = + "// Run actions using the pre initialized 'komodo' client. +const version: Types.GetVersionResponse = await komodo.read('GetVersion', {}); +console.log('🦎 Komodo version:', version.version, '🦎\\n');"; diff --git a/bin/core/src/resource/mod.rs b/bin/core/src/resource/mod.rs index 1144b5225..e30b97260 100644 --- a/bin/core/src/resource/mod.rs +++ b/bin/core/src/resource/mod.rs @@ -45,6 +45,7 @@ use crate::{ state::{db_client, State}, }; +mod action; mod alerter; mod build; mod builder; @@ -57,6 +58,9 @@ mod server_template; mod stack; mod sync; +pub use action::{ + refresh_action_state_cache, spawn_action_state_refresh_loop, +}; pub use build::{ refresh_build_state_cache, spawn_build_state_refresh_loop, }; @@ -619,7 +623,7 @@ pub async fn update( let diff = resource.config.partial_diff(config); if diff.is_none() { - return Err(anyhow!("update has no changes")); + return Ok(resource); } let mut diff_log = String::from("diff"); @@ -687,6 +691,7 @@ fn resource_target(id: String) -> ResourceTarget { ResourceTarget::ResourceSync(id) } ResourceTargetVariant::Stack => ResourceTarget::Stack(id), + ResourceTargetVariant::Action => ResourceTarget::Action(id), } } @@ -860,6 +865,7 @@ where ResourceTarget::Build(id) => ("recents.Build", id), ResourceTarget::Repo(id) => ("recents.Repo", id), ResourceTarget::Procedure(id) => ("recents.Procedure", id), + ResourceTarget::Action(id) => ("recents.Action", id), ResourceTarget::Stack(id) => ("recents.Stack", id), ResourceTarget::Builder(id) => ("recents.Builder", id), ResourceTarget::Alerter(id) => ("recents.Alerter", id), diff --git a/bin/core/src/resource/procedure.rs b/bin/core/src/resource/procedure.rs index 5584db8d8..dd409b7e7 100644 --- a/bin/core/src/resource/procedure.rs +++ b/bin/core/src/resource/procedure.rs @@ -4,6 +4,7 @@ use anyhow::{anyhow, Context}; use komodo_client::{ api::execute::Execution, entities::{ + action::Action, build::Build, deployment::Deployment, permission::PermissionLevel, @@ -172,6 +173,15 @@ async fn validate_config( } params.procedure = procedure.id; } + Execution::RunAction(params) => { + let action = super::get_check_permissions::( + ¶ms.action, + user, + PermissionLevel::Execute, + ) + .await?; + params.action = action.id; + } Execution::RunBuild(params) => { let build = super::get_check_permissions::( ¶ms.build, @@ -598,7 +608,7 @@ pub async fn refresh_procedure_state_cache() { let procedures = find_collect(&db_client().procedures, None, None) .await - .context("failed to get procedures from db")?; + .context("Failed to get Procedures from db")?; let cache = procedure_state_cache(); for procedure in procedures { let state = get_procedure_state_from_db(&procedure.id).await; @@ -608,7 +618,7 @@ pub async fn refresh_procedure_state_cache() { } .await .inspect_err(|e| { - error!("failed to refresh build state cache | {e:#}") + error!("Failed to refresh Procedure state cache | {e:#}") }); } @@ -655,7 +665,7 @@ async fn get_procedure_state_from_db(id: &str) -> ProcedureState { } .await .inspect_err(|e| { - warn!("failed to get procedure state for {id} | {e:#}") + warn!("Failed to get Procedure state for {id} | {e:#}") }) .unwrap_or(ProcedureState::Unknown) } diff --git a/bin/core/src/state.rs b/bin/core/src/state.rs index 39bdeee9c..df9eefd19 100644 --- a/bin/core/src/state.rs +++ b/bin/core/src/state.rs @@ -5,6 +5,7 @@ use std::{ use anyhow::Context; use komodo_client::entities::{ + action::ActionState, build::BuildState, config::core::{CoreConfig, GithubWebhookAppConfig}, deployment::DeploymentState, @@ -191,6 +192,14 @@ pub fn procedure_state_cache() -> &'static ProcedureStateCache { PROCEDURE_STATE_CACHE.get_or_init(Default::default) } +pub type ActionStateCache = Cache; + +pub fn action_state_cache() -> &'static ActionStateCache { + static ACTION_STATE_CACHE: OnceLock = + OnceLock::new(); + ACTION_STATE_CACHE.get_or_init(Default::default) +} + pub type ResourceSyncStateCache = Cache; pub fn resource_sync_state_cache() -> &'static ResourceSyncStateCache diff --git a/bin/core/src/sync/file.rs b/bin/core/src/sync/file.rs index cc7105b7c..4f3691705 100644 --- a/bin/core/src/sync/file.rs +++ b/bin/core/src/sync/file.rs @@ -262,6 +262,9 @@ pub fn extend_resources( resources .procedures .extend(filter_by_tag(more.procedures, match_tags)); + resources + .actions + .extend(filter_by_tag(more.actions, match_tags)); resources .alerters .extend(filter_by_tag(more.alerters, match_tags)); diff --git a/bin/core/src/sync/mod.rs b/bin/core/src/sync/mod.rs index b945be183..63bda2e49 100644 --- a/bin/core/src/sync/mod.rs +++ b/bin/core/src/sync/mod.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, str::FromStr}; use komodo_client::entities::{ - alerter::Alerter, build::Build, builder::Builder, + action::Action, alerter::Alerter, build::Build, builder::Builder, deployment::Deployment, procedure::Procedure, repo::Repo, server::Server, server_template::ServerTemplate, stack::Stack, sync::ResourceSync, tag::Tag, toml::ResourceToml, ResourceTarget, @@ -147,6 +147,7 @@ pub struct AllResourcesById { pub builds: HashMap, pub repos: HashMap, pub procedures: HashMap, + pub actions: HashMap, pub builders: HashMap, pub alerters: HashMap, pub templates: HashMap, @@ -181,6 +182,11 @@ impl AllResourcesById { id_to_tags, match_tags, ) .await?, + actions: + crate::resource::get_id_to_resource_map::( + id_to_tags, match_tags, + ) + .await?, builders: crate::resource::get_id_to_resource_map::( id_to_tags, match_tags, ) diff --git a/bin/core/src/sync/resources.rs b/bin/core/src/sync/resources.rs index 949da3831..df9ff5ffc 100644 --- a/bin/core/src/sync/resources.rs +++ b/bin/core/src/sync/resources.rs @@ -4,6 +4,7 @@ use formatting::{bold, colored, muted, Color}; use komodo_client::{ api::execute::Execution, entities::{ + action::Action, alerter::Alerter, build::Build, builder::{Builder, BuilderConfig}, @@ -233,6 +234,22 @@ impl ResourceSyncTrait for ServerTemplate { impl ExecuteResourceSync for ServerTemplate {} +impl ResourceSyncTrait for Action { + fn resource_target(id: String) -> ResourceTarget { + ResourceTarget::Action(id) + } + + fn get_diff( + original: Self::Config, + update: Self::PartialConfig, + _resources: &AllResourcesById, + ) -> anyhow::Result { + Ok(original.partial_diff(update)) + } +} + +impl ExecuteResourceSync for Action {} + impl ResourceSyncTrait for ResourceSync { fn resource_target(id: String) -> ResourceTarget { ResourceTarget::ResourceSync(id) @@ -343,6 +360,13 @@ impl ResourceSyncTrait for Procedure { .map(|p| p.name.clone()) .unwrap_or_default(); } + Execution::RunAction(config) => { + config.action = resources + .actions + .get(&config.action) + .map(|p| p.name.clone()) + .unwrap_or_default(); + } Execution::RunBuild(config) => { config.build = resources .builds diff --git a/bin/core/src/sync/toml.rs b/bin/core/src/sync/toml.rs index 80d1635f6..633b4cdba 100644 --- a/bin/core/src/sync/toml.rs +++ b/bin/core/src/sync/toml.rs @@ -4,6 +4,7 @@ use anyhow::Context; use komodo_client::{ api::execute::Execution, entities::{ + action::Action, alerter::Alerter, build::Build, builder::{Builder, BuilderConfig, PartialBuilderConfig}, @@ -164,6 +165,7 @@ pub fn convert_resource( impl ToToml for Alerter {} impl ToToml for Server {} impl ToToml for ResourceSync {} +impl ToToml for Action {} impl ToToml for Stack { fn replace_ids( @@ -412,6 +414,13 @@ impl ToToml for Procedure { .map(|r| &r.name) .unwrap_or(&String::new()), ), + Execution::RunAction(exec) => exec.action.clone_from( + all + .actions + .get(&exec.action) + .map(|r| &r.name) + .unwrap_or(&String::new()), + ), Execution::RunBuild(exec) => exec.build.clone_from( all .builds diff --git a/bin/core/src/sync/user_groups.rs b/bin/core/src/sync/user_groups.rs index 554cc956c..7a00bd82a 100644 --- a/bin/core/src/sync/user_groups.rs +++ b/bin/core/src/sync/user_groups.rs @@ -275,6 +275,13 @@ pub async fn get_updates_for_execution( .map(|b| b.name.clone()) .unwrap_or_default() } + ResourceTarget::Action(id) => { + *id = all_resources + .actions + .get(id) + .map(|b| b.name.clone()) + .unwrap_or_default() + } ResourceTarget::ServerTemplate(id) => { *id = all_resources .templates @@ -716,6 +723,17 @@ async fn expand_user_group_permissions( }); expanded.extend(permissions); } + ResourceTargetVariant::Action => { + let permissions = all_resources + .actions + .values() + .filter(|resource| regex.is_match(&resource.name)) + .map(|resource| PermissionToml { + target: ResourceTarget::Action(resource.name.clone()), + level: permission.level, + }); + expanded.extend(permissions); + } ResourceTargetVariant::ServerTemplate => { let permissions = all_resources .templates @@ -875,6 +893,13 @@ pub async fn convert_user_groups( .map(|r| r.name.clone()) .unwrap_or_default() } + ResourceTarget::Action(id) => { + *id = all + .actions + .get(id) + .map(|r| r.name.clone()) + .unwrap_or_default() + } ResourceTarget::ServerTemplate(id) => { *id = all .templates diff --git a/bin/core/src/ws.rs b/bin/core/src/ws.rs index 667cb430a..cc3998f3f 100644 --- a/bin/core/src/ws.rs +++ b/bin/core/src/ws.rs @@ -1,4 +1,4 @@ -use anyhow::{anyhow, Context}; +use anyhow::anyhow; use axum::{ extract::{ ws::{Message, WebSocket}, @@ -15,7 +15,6 @@ use komodo_client::{ }, ws::WsLoginMessage, }; -use mungos::by_id::find_one_by_id; use serde_json::json; use serror::serialize_error; use tokio::select; @@ -23,11 +22,10 @@ use tokio_util::sync::CancellationToken; use crate::{ auth::{auth_api_key_check_enabled, auth_jwt_check_enabled}, - db::DbClient, helpers::{ - channel::update_channel, query::get_user_permission_on_target, + channel::update_channel, + query::{get_user, get_user_permission_on_target}, }, - state::db_client, }; pub fn router() -> Router { @@ -51,7 +49,6 @@ async fn ws_handler(ws: WebSocketUpgrade) -> impl IntoResponse { let cancel_clone = cancel.clone(); tokio::spawn(async move { - let db_client = db_client(); loop { // poll for updates off the receiver / await cancel. let update = select! { @@ -61,7 +58,7 @@ async fn ws_handler(ws: WebSocketUpgrade) -> impl IntoResponse { // before sending every update, verify user is still valid. // kill the connection is user if found to be invalid. - let user = check_user_valid(db_client, &user.id).await; + let user = check_user_valid(&user.id).await; let user = match user { Err(e) => { let _ = ws_sender @@ -183,15 +180,9 @@ enum LoginMessage { Err(String), } -#[instrument(level = "debug", skip(db_client))] -async fn check_user_valid( - db_client: &DbClient, - user_id: &str, -) -> anyhow::Result { - let user = find_one_by_id(&db_client.users, user_id) - .await - .context("failed to query mongo for users")? - .context("user not found")?; +#[instrument(level = "debug")] +async fn check_user_valid(user_id: &str) -> anyhow::Result { + let user = get_user(user_id).await?; if !user.enabled { return Err(anyhow!("user not enabled")); } diff --git a/bin/periphery/alpine.Dockerfile b/bin/periphery/alpine.Dockerfile index 6123c92fd..90c1629a5 100644 --- a/bin/periphery/alpine.Dockerfile +++ b/bin/periphery/alpine.Dockerfile @@ -4,7 +4,7 @@ ## and may negatively affect runtime performance. # Build Periphery -FROM rust:1.81.0-alpine AS builder +FROM rust:1.82.0-alpine AS builder WORKDIR /builder COPY . . RUN apk update && apk --no-cache add musl-dev openssl-dev openssl-libs-static diff --git a/bin/periphery/debian.Dockerfile b/bin/periphery/debian.Dockerfile index a097de929..17a1e8888 100644 --- a/bin/periphery/debian.Dockerfile +++ b/bin/periphery/debian.Dockerfile @@ -1,5 +1,5 @@ # Build Periphery -FROM rust:1.81.0-bullseye AS builder +FROM rust:1.82.0-bullseye AS builder WORKDIR /builder COPY . . RUN cargo build -p komodo_periphery --release diff --git a/bin/periphery/src/api/build.rs b/bin/periphery/src/api/build.rs index 7f0b292a2..d41fde6b4 100644 --- a/bin/periphery/src/api/build.rs +++ b/bin/periphery/src/api/build.rs @@ -126,6 +126,7 @@ impl Resolve for State { "docker build", build_dir.as_ref(), command, + false, ) .await; logs.push(build_log); @@ -146,6 +147,7 @@ impl Resolve for State { "docker build", build_dir.as_ref(), command, + false, ) .await; build_log.command = @@ -244,7 +246,10 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker builder prune -a -f"); - Ok(run_komodo_command("prune builders", None, command).await) + Ok( + run_komodo_command("prune builders", None, command, false) + .await, + ) } } @@ -258,6 +263,6 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker buildx prune -a -f"); - Ok(run_komodo_command("prune buildx", None, command).await) + Ok(run_komodo_command("prune buildx", None, command, false).await) } } diff --git a/bin/periphery/src/api/compose.rs b/bin/periphery/src/api/compose.rs index 4615008f0..467d4df57 100644 --- a/bin/periphery/src/api/compose.rs +++ b/bin/periphery/src/api/compose.rs @@ -35,6 +35,7 @@ impl Resolve for State { "list projects", None, format!("{docker_compose} ls --all --format json"), + false, ) .await; @@ -104,7 +105,9 @@ impl Resolve for State { let command = format!( "{docker_compose} -p {project} logs {service} --tail {tail}{timestamps}" ); - Ok(run_komodo_command("get stack log", None, command).await) + Ok( + run_komodo_command("get stack log", None, command, false).await, + ) } } @@ -131,7 +134,10 @@ impl Resolve for State { let timestamps = timestamps.then_some(" --timestamps").unwrap_or_default(); let command = format!("{docker_compose} -p {project} logs {service} --tail 5000{timestamps} 2>&1 | {grep}"); - Ok(run_komodo_command("get stack log grep", None, command).await) + Ok( + run_komodo_command("get stack log grep", None, command, false) + .await, + ) } } @@ -378,6 +384,7 @@ impl Resolve for State { "compose command", None, format!("{docker_compose} -p {project} {command}"), + false, ) .await; Ok(log) diff --git a/bin/periphery/src/api/container.rs b/bin/periphery/src/api/container.rs index 91dd38cbc..8ad785e67 100644 --- a/bin/periphery/src/api/container.rs +++ b/bin/periphery/src/api/container.rs @@ -53,7 +53,10 @@ impl Resolve for State { timestamps.then_some(" --timestamps").unwrap_or_default(); let command = format!("docker logs {name} --tail {tail}{timestamps}"); - Ok(run_komodo_command("get container log", None, command).await) + Ok( + run_komodo_command("get container log", None, command, false) + .await, + ) } } @@ -83,8 +86,13 @@ impl Resolve for State { "docker logs {name} --tail 5000{timestamps} 2>&1 | {grep}" ); Ok( - run_komodo_command("get container log grep", None, command) - .await, + run_komodo_command( + "get container log grep", + None, + command, + false, + ) + .await, ) } } @@ -142,6 +150,7 @@ impl Resolve for State { "docker start", None, format!("docker start {name}"), + false, ) .await, ) @@ -162,6 +171,7 @@ impl Resolve for State { "docker restart", None, format!("docker restart {name}"), + false, ) .await, ) @@ -182,6 +192,7 @@ impl Resolve for State { "docker pause", None, format!("docker pause {name}"), + false, ) .await, ) @@ -200,6 +211,7 @@ impl Resolve for State { "docker unpause", None, format!("docker unpause {name}"), + false, ) .await, ) @@ -216,11 +228,12 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = stop_container_command(&name, signal, time); - let log = run_komodo_command("docker stop", None, command).await; + let log = + run_komodo_command("docker stop", None, command, false).await; if log.stderr.contains("unknown flag: --signal") { let command = stop_container_command(&name, None, time); let mut log = - run_komodo_command("docker stop", None, command).await; + run_komodo_command("docker stop", None, command, false).await; log.stderr = format!( "old docker version: unable to use --signal flag{}", if !log.stderr.is_empty() { @@ -248,15 +261,19 @@ impl Resolve for State { let stop_command = stop_container_command(&name, signal, time); let command = format!("{stop_command} && docker container rm {name}"); - let log = - run_komodo_command("docker stop and remove", None, command) - .await; + let log = run_komodo_command( + "docker stop and remove", + None, + command, + false, + ) + .await; if log.stderr.contains("unknown flag: --signal") { let stop_command = stop_container_command(&name, None, time); let command = format!("{stop_command} && docker container rm {name}"); let mut log = - run_komodo_command("docker stop", None, command).await; + run_komodo_command("docker stop", None, command, false).await; log.stderr = format!( "old docker version: unable to use --signal flag{}", if !log.stderr.is_empty() { @@ -286,7 +303,9 @@ impl Resolve for State { ) -> anyhow::Result { let new = to_komodo_name(&new_name); let command = format!("docker rename {curr_name} {new}"); - Ok(run_komodo_command("docker rename", None, command).await) + Ok( + run_komodo_command("docker rename", None, command, false).await, + ) } } @@ -300,7 +319,10 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker container prune -f"); - Ok(run_komodo_command("prune containers", None, command).await) + Ok( + run_komodo_command("prune containers", None, command, false) + .await, + ) } } @@ -324,7 +346,8 @@ impl Resolve for State { } let command = format!("docker start {name}"); Some(async move { - run_komodo_command(&command.clone(), None, command).await + run_komodo_command(&command.clone(), None, command, false) + .await }) }, ); @@ -352,7 +375,8 @@ impl Resolve for State { } let command = format!("docker restart {name}"); Some(async move { - run_komodo_command(&command.clone(), None, command).await + run_komodo_command(&command.clone(), None, command, false) + .await }) }, ); @@ -380,7 +404,8 @@ impl Resolve for State { } let command = format!("docker pause {name}"); Some(async move { - run_komodo_command(&command.clone(), None, command).await + run_komodo_command(&command.clone(), None, command, false) + .await }) }, ); @@ -408,7 +433,8 @@ impl Resolve for State { } let command = format!("docker unpause {name}"); Some(async move { - run_komodo_command(&command.clone(), None, command).await + run_komodo_command(&command.clone(), None, command, false) + .await }) }, ); @@ -439,6 +465,7 @@ impl Resolve for State { &format!("docker stop {name}"), None, stop_container_command(name, None, None), + false, ) .await }) diff --git a/bin/periphery/src/api/deploy.rs b/bin/periphery/src/api/deploy.rs index 63d98f639..e5928bcca 100644 --- a/bin/periphery/src/api/deploy.rs +++ b/bin/periphery/src/api/deploy.rs @@ -87,7 +87,7 @@ impl Resolve for State { debug!("docker run command: {command}"); if deployment.config.skip_secret_interp { - Ok(run_komodo_command("docker run", None, command).await) + Ok(run_komodo_command("docker run", None, command, false).await) } else { let command = svi::interpolate_variables( &command, @@ -108,7 +108,7 @@ impl Resolve for State { replacers.extend(core_replacers); let mut log = - run_komodo_command("docker run", None, command).await; + run_komodo_command("docker run", None, command, false).await; log.command = svi::replace_in_string(&log.command, &replacers); log.stdout = svi::replace_in_string(&log.stdout, &replacers); log.stderr = svi::replace_in_string(&log.stderr, &replacers); diff --git a/bin/periphery/src/api/image.rs b/bin/periphery/src/api/image.rs index e7b0ba3b6..0fc8212e4 100644 --- a/bin/periphery/src/api/image.rs +++ b/bin/periphery/src/api/image.rs @@ -44,7 +44,7 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = format!("docker image rm {name}"); - Ok(run_komodo_command("delete image", None, command).await) + Ok(run_komodo_command("delete image", None, command, false).await) } } @@ -58,6 +58,6 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker image prune -a -f"); - Ok(run_komodo_command("prune images", None, command).await) + Ok(run_komodo_command("prune images", None, command, false).await) } } diff --git a/bin/periphery/src/api/mod.rs b/bin/periphery/src/api/mod.rs index ff334837c..8ef26f894 100644 --- a/bin/periphery/src/api/mod.rs +++ b/bin/periphery/src/api/mod.rs @@ -256,7 +256,7 @@ impl Resolve for State { } else { format!("cd {path} && {command}") }; - run_komodo_command("run command", None, command).await + run_komodo_command("run command", None, command, false).await }) .await .context("failure in spawned task") @@ -271,6 +271,6 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker system prune -a -f --volumes"); - Ok(run_komodo_command("prune system", None, command).await) + Ok(run_komodo_command("prune system", None, command, false).await) } } diff --git a/bin/periphery/src/api/network.rs b/bin/periphery/src/api/network.rs index b8419fd04..f13edcf43 100644 --- a/bin/periphery/src/api/network.rs +++ b/bin/periphery/src/api/network.rs @@ -34,7 +34,10 @@ impl Resolve for State { None => String::new(), }; let command = format!("docker network create{driver} {name}"); - Ok(run_komodo_command("create network", None, command).await) + Ok( + run_komodo_command("create network", None, command, false) + .await, + ) } } @@ -48,7 +51,10 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = format!("docker network rm {name}"); - Ok(run_komodo_command("delete network", None, command).await) + Ok( + run_komodo_command("delete network", None, command, false) + .await, + ) } } @@ -62,6 +68,9 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker network prune -f"); - Ok(run_komodo_command("prune networks", None, command).await) + Ok( + run_komodo_command("prune networks", None, command, false) + .await, + ) } } diff --git a/bin/periphery/src/api/volume.rs b/bin/periphery/src/api/volume.rs index da79177c5..622fe6f4b 100644 --- a/bin/periphery/src/api/volume.rs +++ b/bin/periphery/src/api/volume.rs @@ -28,7 +28,9 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = format!("docker volume rm {name}"); - Ok(run_komodo_command("delete volume", None, command).await) + Ok( + run_komodo_command("delete volume", None, command, false).await, + ) } } @@ -42,6 +44,8 @@ impl Resolve for State { _: (), ) -> anyhow::Result { let command = String::from("docker volume prune -a -f"); - Ok(run_komodo_command("prune volumes", None, command).await) + Ok( + run_komodo_command("prune volumes", None, command, false).await, + ) } } diff --git a/bin/periphery/src/compose.rs b/bin/periphery/src/compose.rs index cb81c84b7..cfb9bc24d 100644 --- a/bin/periphery/src/compose.rs +++ b/bin/periphery/src/compose.rs @@ -141,19 +141,27 @@ pub async fn compose_up( .map(|path| format!(" --env-file {path}")) .unwrap_or_default(); + let additional_env_files = stack + .config + .additional_env_files + .iter() + .map(|file| format!(" --env-file {file}")) + .collect::(); + // Build images before destroying to minimize downtime. // If this fails, do not continue. if stack.config.run_build { let build_extra_args = parse_extra_args(&stack.config.build_extra_args); let command = format!( - "{docker_compose} -p {project_name} -f {file_args}{env_file} build{build_extra_args}{service_arg}", + "{docker_compose} -p {project_name} -f {file_args}{env_file}{additional_env_files} build{build_extra_args}{service_arg}", ); if stack.config.skip_secret_interp { let log = run_komodo_command( "compose build", run_directory.as_ref(), command, + false, ) .await; res.logs.push(log); @@ -170,6 +178,7 @@ pub async fn compose_up( "compose build", run_directory.as_ref(), command, + false, ) .await; @@ -197,6 +206,7 @@ pub async fn compose_up( format!( "{docker_compose} -p {project_name} -f {file_args}{env_file} pull{service_arg}", ), + false, ) .await; @@ -223,6 +233,7 @@ pub async fn compose_up( "pre deploy", pre_deploy_path.as_ref(), &full_command, + true, ) .await; @@ -245,6 +256,7 @@ pub async fn compose_up( "pre deploy", pre_deploy_path.as_ref(), &stack.config.pre_deploy.command, + true, ) .await; tracing::debug!( @@ -279,8 +291,13 @@ pub async fn compose_up( ); let log = if stack.config.skip_secret_interp { - run_komodo_command("compose up", run_directory.as_ref(), command) - .await + run_komodo_command( + "compose up", + run_directory.as_ref(), + command, + false, + ) + .await } else { let (command, mut replacers) = svi::interpolate_variables( &command, @@ -294,6 +311,7 @@ pub async fn compose_up( "compose up", run_directory.as_ref(), command, + false, ) .await; @@ -545,6 +563,7 @@ async fn compose_down( "compose down", None, format!("{docker_compose} -p {project} down{service_arg}"), + false, ) .await; let success = log.success; diff --git a/bin/periphery/src/docker.rs b/bin/periphery/src/docker.rs index 34036f063..f483a675f 100644 --- a/bin/periphery/src/docker.rs +++ b/bin/periphery/src/docker.rs @@ -937,7 +937,7 @@ pub async fn docker_login( #[instrument] pub async fn pull_image(image: &str) -> Log { let command = format!("docker pull {image}"); - run_komodo_command("docker pull", None, command).await + run_komodo_command("docker pull", None, command, false).await } pub fn stop_container_command( diff --git a/client/core/rs/src/api/execute/action.rs b/client/core/rs/src/api/execute/action.rs new file mode 100644 index 000000000..01ca6ae03 --- /dev/null +++ b/client/core/rs/src/api/execute/action.rs @@ -0,0 +1,28 @@ +use clap::Parser; +use derive_empty_traits::EmptyTraits; +use resolver_api::derive::Request; +use serde::{Deserialize, Serialize}; +use typeshare::typeshare; + +use crate::entities::update::Update; + +use super::KomodoExecuteRequest; + +/// Runs the target Action. Response: [Update] +#[typeshare] +#[derive( + Debug, + Clone, + PartialEq, + Serialize, + Deserialize, + Request, + EmptyTraits, + Parser, +)] +#[empty_traits(KomodoExecuteRequest)] +#[response(Update)] +pub struct RunAction { + /// Id or name + pub action: String, +} diff --git a/client/core/rs/src/api/execute/mod.rs b/client/core/rs/src/api/execute/mod.rs index bd710e166..3a2c8483c 100644 --- a/client/core/rs/src/api/execute/mod.rs +++ b/client/core/rs/src/api/execute/mod.rs @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize}; use strum::{Display, EnumString}; use typeshare::typeshare; +mod action; mod build; mod deployment; mod procedure; @@ -14,6 +15,7 @@ mod server_template; mod stack; mod sync; +pub use action::*; pub use build::*; pub use deployment::*; pub use procedure::*; @@ -55,6 +57,9 @@ pub enum Execution { /// The "null" execution. Does nothing. None(NoData), + // ACTION + RunAction(RunAction), + // PROCEDURE RunProcedure(RunProcedure), diff --git a/client/core/rs/src/api/execute/procedure.rs b/client/core/rs/src/api/execute/procedure.rs index 76144ef9c..1557d41b2 100644 --- a/client/core/rs/src/api/execute/procedure.rs +++ b/client/core/rs/src/api/execute/procedure.rs @@ -8,7 +8,7 @@ use crate::entities::update::Update; use super::KomodoExecuteRequest; -/// Runs the target procedure. Response: [Update] +/// Runs the target Procedure. Response: [Update] #[typeshare] #[derive( Debug, diff --git a/client/core/rs/src/api/mod.rs b/client/core/rs/src/api/mod.rs index 1ad0d88d8..e5bf39718 100644 --- a/client/core/rs/src/api/mod.rs +++ b/client/core/rs/src/api/mod.rs @@ -38,10 +38,10 @@ //! //! ```text //! curl --header "Content-Type: application/json" \ -//! --header "X-Api-Key: your_api_key" \ -//! --header "X-Api-Secret: your_api_secret" \ -//! --data '{ "type": "UpdateBuild", "params": { "id": "67076689ed600cfdd52ac637", "config": { "version": "1.15.9" } } }' \ -//! https://komodo.example.com/write +//! --header "X-Api-Key: your_api_key" \ +//! --header "X-Api-Secret: your_api_secret" \ +//! --data '{ "type": "UpdateBuild", "params": { "id": "67076689ed600cfdd52ac637", "config": { "version": "1.15.9" } } }' \ +//! https://komodo.example.com/write //! ``` //! //! ## Modules diff --git a/client/core/rs/src/api/read/action.rs b/client/core/rs/src/api/read/action.rs new file mode 100644 index 000000000..0f8aa8c46 --- /dev/null +++ b/client/core/rs/src/api/read/action.rs @@ -0,0 +1,110 @@ +use derive_empty_traits::EmptyTraits; +use resolver_api::derive::Request; +use serde::{Deserialize, Serialize}; +use typeshare::typeshare; + +use crate::entities::action::{ + Action, ActionActionState, ActionListItem, ActionQuery, +}; + +use super::KomodoReadRequest; + +// + +/// Get a specific action. Response: [Action]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoReadRequest)] +#[response(GetActionResponse)] +pub struct GetAction { + /// Id or name + #[serde(alias = "id", alias = "name")] + pub action: String, +} + +#[typeshare] +pub type GetActionResponse = Action; + +// + +/// List actions matching optional query. Response: [ListActionsResponse]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Default, Request, EmptyTraits, +)] +#[empty_traits(KomodoReadRequest)] +#[response(ListActionsResponse)] +pub struct ListActions { + /// optional structured query to filter actions. + #[serde(default)] + pub query: ActionQuery, +} + +#[typeshare] +pub type ListActionsResponse = Vec; + +// + +/// List actions matching optional query. Response: [ListFullActionsResponse]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Default, Request, EmptyTraits, +)] +#[empty_traits(KomodoReadRequest)] +#[response(ListFullActionsResponse)] +pub struct ListFullActions { + /// optional structured query to filter actions. + #[serde(default)] + pub query: ActionQuery, +} + +#[typeshare] +pub type ListFullActionsResponse = Vec; + +// + +/// Get current action state for the action. Response: [ActionActionState]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoReadRequest)] +#[response(GetActionActionStateResponse)] +pub struct GetActionActionState { + /// Id or name + #[serde(alias = "id", alias = "name")] + pub action: String, +} + +#[typeshare] +pub type GetActionActionStateResponse = ActionActionState; + +// + +/// Gets a summary of data relating to all actions. +/// Response: [GetActionsSummaryResponse]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoReadRequest)] +#[response(GetActionsSummaryResponse)] +pub struct GetActionsSummary {} + +/// Response for [GetActionsSummary]. +#[typeshare] +#[derive(Serialize, Deserialize, Debug, Clone, Default)] +pub struct GetActionsSummaryResponse { + /// The total number of actions. + pub total: u32, + /// The number of actions with Ok state. + pub ok: u32, + /// The number of actions currently running. + pub running: u32, + /// The number of actions with failed state. + pub failed: u32, + /// The number of actions with unknown state. + pub unknown: u32, +} diff --git a/client/core/rs/src/api/read/mod.rs b/client/core/rs/src/api/read/mod.rs index a77bd2cab..409dc43d2 100644 --- a/client/core/rs/src/api/read/mod.rs +++ b/client/core/rs/src/api/read/mod.rs @@ -3,6 +3,7 @@ use resolver_api::{derive::Request, HasResponse}; use serde::{Deserialize, Serialize}; use typeshare::typeshare; +mod action; mod alert; mod alerter; mod build; @@ -24,6 +25,7 @@ mod user; mod user_group; mod variable; +pub use action::*; pub use alert::*; pub use alerter::*; pub use build::*; diff --git a/client/core/rs/src/api/write/action.rs b/client/core/rs/src/api/write/action.rs new file mode 100644 index 000000000..fc876734d --- /dev/null +++ b/client/core/rs/src/api/write/action.rs @@ -0,0 +1,118 @@ +use derive_empty_traits::EmptyTraits; +use resolver_api::derive::Request; +use serde::{Deserialize, Serialize}; +use typeshare::typeshare; + +use crate::entities::{ + action::{Action, _PartialActionConfig}, + NoData, +}; + +use super::KomodoWriteRequest; + +// + +/// Create a action. Response: [Action]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoWriteRequest)] +#[response(Action)] +pub struct CreateAction { + /// The name given to newly created action. + pub name: String, + /// Optional partial config to initialize the action with. + pub config: _PartialActionConfig, +} + +// + +/// Creates a new action with given `name` and the configuration +/// of the action at the given `id`. Response: [Action]. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoWriteRequest)] +#[response(Action)] +pub struct CopyAction { + /// The name of the new action. + pub name: String, + /// The id of the action to copy. + pub id: String, +} + +// + +/// Deletes the action at the given id, and returns the deleted action. +/// Response: [Action] +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoWriteRequest)] +#[response(Action)] +pub struct DeleteAction { + /// The id or name of the action to delete. + pub id: String, +} + +// + +/// Update the action at the given id, and return the updated action. +/// Response: [Action]. +/// +/// Note. This method updates only the fields which are set in the [_PartialActionConfig], +/// effectively merging diffs into the final document. +/// This is helpful when multiple users are using +/// the same resources concurrently by ensuring no unintentional +/// field changes occur from out of date local state. +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoWriteRequest)] +#[response(Action)] +pub struct UpdateAction { + /// The id of the action to update. + pub id: String, + /// The partial config update to apply. + pub config: _PartialActionConfig, +} + +/// Create a webhook on the github action attached to the Action resource. +/// passed in request. Response: [CreateActionWebhookResponse] +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoWriteRequest)] +#[response(CreateActionWebhookResponse)] +pub struct CreateActionWebhook { + /// Id or name + #[serde(alias = "id", alias = "name")] + pub action: String, +} + +#[typeshare] +pub type CreateActionWebhookResponse = NoData; + +// + +/// Delete the webhook on the github action attached to the Action resource. +/// passed in request. Response: [DeleteActionWebhookResponse] +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Request, EmptyTraits, +)] +#[empty_traits(KomodoWriteRequest)] +#[response(DeleteActionWebhookResponse)] +pub struct DeleteActionWebhook { + /// Id or name + #[serde(alias = "id", alias = "name")] + pub action: String, +} + +#[typeshare] +pub type DeleteActionWebhookResponse = NoData; diff --git a/client/core/rs/src/api/write/mod.rs b/client/core/rs/src/api/write/mod.rs index a093f0925..73b602b17 100644 --- a/client/core/rs/src/api/write/mod.rs +++ b/client/core/rs/src/api/write/mod.rs @@ -1,3 +1,4 @@ +mod action; mod alerter; mod api_key; mod build; @@ -17,6 +18,7 @@ mod user; mod user_group; mod variable; +pub use action::*; pub use alerter::*; pub use api_key::*; pub use build::*; diff --git a/client/core/rs/src/api/write/repo.rs b/client/core/rs/src/api/write/repo.rs index 7e71d9369..d3bcfd2aa 100644 --- a/client/core/rs/src/api/write/repo.rs +++ b/client/core/rs/src/api/write/repo.rs @@ -121,7 +121,7 @@ pub struct CreateRepoWebhook { /// Id or name #[serde(alias = "id", alias = "name")] pub repo: String, - /// "Clone" or "Pull" + /// "Clone" or "Pull" or "Build" pub action: RepoWebhookAction, } @@ -142,7 +142,7 @@ pub struct DeleteRepoWebhook { /// Id or name #[serde(alias = "id", alias = "name")] pub repo: String, - /// "Clone" or "Pull" + /// "Clone" or "Pull" or "Build" pub action: RepoWebhookAction, } diff --git a/client/core/rs/src/busy.rs b/client/core/rs/src/busy.rs index 277cf4d96..8b4eaa24e 100644 --- a/client/core/rs/src/busy.rs +++ b/client/core/rs/src/busy.rs @@ -1,8 +1,8 @@ use crate::entities::{ - build::BuildActionState, deployment::DeploymentActionState, - procedure::ProcedureActionState, repo::RepoActionState, - server::ServerActionState, stack::StackActionState, - sync::ResourceSyncActionState, + action::ActionActionState, build::BuildActionState, + deployment::DeploymentActionState, procedure::ProcedureActionState, + repo::RepoActionState, server::ServerActionState, + stack::StackActionState, sync::ResourceSyncActionState, }; pub trait Busy { @@ -66,6 +66,12 @@ impl Busy for ProcedureActionState { } } +impl Busy for ActionActionState { + fn busy(&self) -> bool { + self.running + } +} + impl Busy for ResourceSyncActionState { fn busy(&self) -> bool { self.syncing diff --git a/client/core/rs/src/deserializers/conversion.rs b/client/core/rs/src/deserializers/conversion.rs new file mode 100644 index 000000000..b5629a809 --- /dev/null +++ b/client/core/rs/src/deserializers/conversion.rs @@ -0,0 +1,108 @@ +use serde::{ + de::{value::SeqAccessDeserializer, Visitor}, + Deserialize, Deserializer, +}; + +use crate::entities::deployment::Conversion; + +pub fn conversions_deserializer<'de, D>( + deserializer: D, +) -> Result +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(ConversionVisitor) +} + +pub fn option_conversions_deserializer<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(OptionConversionVisitor) +} + +struct ConversionVisitor; + +impl<'de> Visitor<'de> for ConversionVisitor { + type Value = String; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + let out = v.to_string(); + if out.is_empty() || out.ends_with('\n') { + Ok(out) + } else { + Ok(out + "\n") + } + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let res = Vec::::deserialize( + SeqAccessDeserializer::new(seq), + )?; + let res = res + .iter() + .map(|Conversion { local, container }| { + format!(" {local}: {container}") + }) + .collect::>() + .join("\n"); + let extra = if res.is_empty() { "" } else { "\n" }; + Ok(res + extra) + } +} + +struct OptionConversionVisitor; + +impl<'de> Visitor<'de> for OptionConversionVisitor { + type Value = Option; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "null or string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + ConversionVisitor.visit_str(v).map(Some) + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + ConversionVisitor.visit_seq(seq).map(Some) + } + + fn visit_none(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } + + fn visit_unit(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } +} diff --git a/client/core/rs/src/deserializers/environment.rs b/client/core/rs/src/deserializers/environment.rs new file mode 100644 index 000000000..606c7009d --- /dev/null +++ b/client/core/rs/src/deserializers/environment.rs @@ -0,0 +1,108 @@ +use serde::{ + de::{value::SeqAccessDeserializer, Visitor}, + Deserialize, Deserializer, +}; + +use crate::entities::EnvironmentVar; + +pub fn env_vars_deserializer<'de, D>( + deserializer: D, +) -> Result +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(EnvironmentVarVisitor) +} + +pub fn option_env_vars_deserializer<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(OptionEnvVarVisitor) +} + +struct EnvironmentVarVisitor; + +impl<'de> Visitor<'de> for EnvironmentVarVisitor { + type Value = String; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + let out = v.to_string(); + if out.is_empty() || out.ends_with('\n') { + Ok(out) + } else { + Ok(out + "\n") + } + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let vars = Vec::::deserialize( + SeqAccessDeserializer::new(seq), + )?; + let vars = vars + .iter() + .map(|EnvironmentVar { variable, value }| { + format!(" {variable} = {value}") + }) + .collect::>() + .join("\n"); + let extra = if vars.is_empty() { "" } else { "\n" }; + Ok(vars + extra) + } +} + +struct OptionEnvVarVisitor; + +impl<'de> Visitor<'de> for OptionEnvVarVisitor { + type Value = Option; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "null or string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + EnvironmentVarVisitor.visit_str(v).map(Some) + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + EnvironmentVarVisitor.visit_seq(seq).map(Some) + } + + fn visit_none(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } + + fn visit_unit(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } +} diff --git a/client/core/rs/src/deserializers/file_contents.rs b/client/core/rs/src/deserializers/file_contents.rs new file mode 100644 index 000000000..61995566a --- /dev/null +++ b/client/core/rs/src/deserializers/file_contents.rs @@ -0,0 +1,80 @@ +use serde::{de::Visitor, Deserializer}; + +/// Using this ensures the file contents end with trailing '\n' +pub fn file_contents_deserializer<'de, D>( + deserializer: D, +) -> Result +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(FileContentsVisitor) +} + +/// Using this ensures the file contents end with trailing '\n' +pub fn option_file_contents_deserializer<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(OptionFileContentsVisitor) +} + +struct FileContentsVisitor; + +impl<'de> Visitor<'de> for FileContentsVisitor { + type Value = String; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "string") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + let out = v.trim_end().to_string(); + if out.is_empty() { + Ok(out) + } else { + Ok(out + "\n") + } + } +} + +struct OptionFileContentsVisitor; + +impl<'de> Visitor<'de> for OptionFileContentsVisitor { + type Value = Option; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "null or string") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + FileContentsVisitor.visit_str(v).map(Some) + } + + fn visit_none(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } + + fn visit_unit(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } +} diff --git a/client/core/rs/src/deserializers/labels.rs b/client/core/rs/src/deserializers/labels.rs new file mode 100644 index 000000000..f8620d12b --- /dev/null +++ b/client/core/rs/src/deserializers/labels.rs @@ -0,0 +1,108 @@ +use serde::{ + de::{value::SeqAccessDeserializer, Visitor}, + Deserialize, Deserializer, +}; + +use crate::entities::EnvironmentVar; + +pub fn labels_deserializer<'de, D>( + deserializer: D, +) -> Result +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(LabelVisitor) +} + +pub fn option_labels_deserializer<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(OptionLabelVisitor) +} + +struct LabelVisitor; + +impl<'de> Visitor<'de> for LabelVisitor { + type Value = String; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + let out = v.to_string(); + if out.is_empty() || out.ends_with('\n') { + Ok(out) + } else { + Ok(out + "\n") + } + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let vars = Vec::::deserialize( + SeqAccessDeserializer::new(seq), + )?; + let vars = vars + .iter() + .map(|EnvironmentVar { variable, value }| { + format!(" {variable}: {value}") + }) + .collect::>() + .join("\n"); + let extra = if vars.is_empty() { "" } else { "\n" }; + Ok(vars + extra) + } +} + +struct OptionLabelVisitor; + +impl<'de> Visitor<'de> for OptionLabelVisitor { + type Value = Option; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "null or string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + LabelVisitor.visit_str(v).map(Some) + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + LabelVisitor.visit_seq(seq).map(Some) + } + + fn visit_none(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } + + fn visit_unit(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } +} diff --git a/client/core/rs/src/deserializers/mod.rs b/client/core/rs/src/deserializers/mod.rs new file mode 100644 index 000000000..8081ca3d6 --- /dev/null +++ b/client/core/rs/src/deserializers/mod.rs @@ -0,0 +1,15 @@ +//! Deserializers for custom behavior and backward compatibility. + +mod conversion; +mod environment; +mod file_contents; +mod labels; +mod string_list; +mod term_signal_labels; + +pub use conversion::*; +pub use environment::*; +pub use file_contents::*; +pub use labels::*; +pub use string_list::*; +pub use term_signal_labels::*; diff --git a/client/core/rs/src/deserializers/string_list.rs b/client/core/rs/src/deserializers/string_list.rs new file mode 100644 index 000000000..9611fa393 --- /dev/null +++ b/client/core/rs/src/deserializers/string_list.rs @@ -0,0 +1,92 @@ +use serde::{ + de::{value::SeqAccessDeserializer, SeqAccess, Visitor}, + Deserialize, Deserializer, +}; + +use crate::parsers::parse_string_list; + +pub fn string_list_deserializer<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(StringListVisitor) +} + +pub fn option_string_list_deserializer<'de, D>( + deserializer: D, +) -> Result>, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(OptionStringListVisitor) +} + +struct StringListVisitor; + +impl<'de> Visitor<'de> for StringListVisitor { + type Value = Vec; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + Ok(parse_string_list(v)) + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + Vec::::deserialize(SeqAccessDeserializer::new(seq)) + } +} + +struct OptionStringListVisitor; + +impl<'de> Visitor<'de> for OptionStringListVisitor { + type Value = Option>; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "null or string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + StringListVisitor.visit_str(v).map(Some) + } + + fn visit_seq(self, seq: A) -> Result + where + A: SeqAccess<'de>, + { + StringListVisitor.visit_seq(seq).map(Some) + } + + fn visit_none(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } + + fn visit_unit(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } +} diff --git a/client/core/rs/src/deserializers/term_signal_labels.rs b/client/core/rs/src/deserializers/term_signal_labels.rs new file mode 100644 index 000000000..8c5d8936b --- /dev/null +++ b/client/core/rs/src/deserializers/term_signal_labels.rs @@ -0,0 +1,107 @@ +use serde::{ + de::{value::SeqAccessDeserializer, Visitor}, + Deserialize, Deserializer, +}; + +use crate::entities::deployment::TerminationSignalLabel; + +pub fn term_labels_deserializer<'de, D>( + deserializer: D, +) -> Result +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(TermSignalLabelVisitor) +} + +pub fn option_term_labels_deserializer<'de, D>( + deserializer: D, +) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_any(OptionTermSignalLabelVisitor) +} + +struct TermSignalLabelVisitor; + +impl<'de> Visitor<'de> for TermSignalLabelVisitor { + type Value = String; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + let out = v.to_string(); + if out.is_empty() || out.ends_with('\n') { + Ok(out) + } else { + Ok(out + "\n") + } + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + let res = Vec::::deserialize( + SeqAccessDeserializer::new(seq), + )? + .into_iter() + .map(|TerminationSignalLabel { signal, label }| { + format!(" {signal}: {label}") + }) + .collect::>() + .join("\n"); + let extra = if res.is_empty() { "" } else { "\n" }; + Ok(res + extra) + } +} + +struct OptionTermSignalLabelVisitor; + +impl<'de> Visitor<'de> for OptionTermSignalLabelVisitor { + type Value = Option; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter, + ) -> std::fmt::Result { + write!(formatter, "null or string or Vec") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + TermSignalLabelVisitor.visit_str(v).map(Some) + } + + fn visit_seq(self, seq: A) -> Result + where + A: serde::de::SeqAccess<'de>, + { + TermSignalLabelVisitor.visit_seq(seq).map(Some) + } + + fn visit_none(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } + + fn visit_unit(self) -> Result + where + E: serde::de::Error, + { + Ok(None) + } +} diff --git a/client/core/rs/src/entities/action.rs b/client/core/rs/src/entities/action.rs new file mode 100644 index 000000000..ca7a38b2d --- /dev/null +++ b/client/core/rs/src/entities/action.rs @@ -0,0 +1,107 @@ +use bson::{doc, Document}; +use derive_builder::Builder; +use derive_default_builder::DefaultBuilder; +use partial_derive2::Partial; +use serde::{Deserialize, Serialize}; +use strum::Display; +use typeshare::typeshare; + +use crate::{ + deserializers::{ + file_contents_deserializer, option_file_contents_deserializer, + }, + entities::I64, +}; + +use super::resource::{Resource, ResourceListItem, ResourceQuery}; + +#[typeshare] +pub type ActionListItem = ResourceListItem; + +#[typeshare] +#[derive(Serialize, Deserialize, Debug, Clone, Default)] +pub struct ActionListItemInfo { + /// Action last run timestamp in ms. + pub last_run_at: I64, + /// Whether last action run successful + pub state: ActionState, +} + +#[typeshare] +#[derive( + Debug, Clone, Copy, Default, Serialize, Deserialize, Display, +)] +pub enum ActionState { + /// Unknown case + #[default] + Unknown, + /// Last clone / pull successful (or never cloned) + Ok, + /// Last clone / pull failed + Failed, + /// Currently running + Running, +} + +#[typeshare] +pub type Action = Resource; + +#[typeshare] +#[derive(Serialize, Deserialize, Debug, Clone, Default)] +pub struct ActionInfo { + /// When action was last run + #[serde(default)] + pub last_run_at: I64, +} + +#[typeshare(serialized_as = "Partial")] +pub type _PartialActionConfig = PartialActionConfig; + +#[typeshare] +#[derive(Serialize, Deserialize, Debug, Clone, Builder, Partial)] +#[partial_derive(Serialize, Deserialize, Debug, Clone, Default)] +#[partial(skip_serializing_none, from, diff)] +pub struct ActionConfig { + /// Typescript file contents using pre-initialized `komodo` client. + #[serde(default, deserialize_with = "file_contents_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_file_contents_deserializer" + ))] + #[builder(default)] + pub file_contents: String, +} + +impl ActionConfig { + pub fn builder() -> ActionConfigBuilder { + ActionConfigBuilder::default() + } +} + +impl Default for ActionConfig { + fn default() -> Self { + Self { + file_contents: Default::default(), + } + } +} + +#[typeshare] +#[derive(Serialize, Deserialize, Debug, Clone, Copy, Default)] +pub struct ActionActionState { + /// Whether the action is currently running. + pub running: bool, +} + +#[typeshare] +pub type ActionQuery = ResourceQuery; + +#[typeshare] +#[derive( + Serialize, Deserialize, Debug, Clone, Default, DefaultBuilder, +)] +pub struct ActionQuerySpecifics {} + +impl super::resource::AddFilters for ActionQuerySpecifics { + fn add_filters(&self, _filters: &mut Document) {} +} diff --git a/client/core/rs/src/entities/build.rs b/client/core/rs/src/entities/build.rs index 57baa31b6..5ff8ce8ee 100644 --- a/client/core/rs/src/entities/build.rs +++ b/client/core/rs/src/entities/build.rs @@ -9,7 +9,14 @@ use serde::{ use strum::Display; use typeshare::typeshare; -use crate::entities::I64; +use crate::{ + deserializers::{ + env_vars_deserializer, labels_deserializer, + option_env_vars_deserializer, option_labels_deserializer, + option_string_list_deserializer, string_list_deserializer, + }, + entities::I64, +}; use super::{ resource::{Resource, ResourceListItem, ResourceQuery}, @@ -126,7 +133,11 @@ pub struct BuildConfig { pub image_tag: String, /// Configure quick links that are displayed in the resource header - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub links: Vec, @@ -219,20 +230,21 @@ pub struct BuildConfig { pub use_buildx: bool, /// Any extra docker cli arguments to be included in the build command - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub extra_args: Vec, /// Docker build arguments. /// /// These values are visible in the final image by running `docker inspect`. - #[serde( - default, - deserialize_with = "super::env_vars_deserializer" - )] + #[serde(default, deserialize_with = "env_vars_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_env_vars_deserializer" + deserialize_with = "option_env_vars_deserializer" ))] #[builder(default)] pub build_args: String, @@ -247,22 +259,19 @@ pub struct BuildConfig { /// RUN --mount=type=secret,id=SECRET_KEY \ /// SECRET_KEY=$(cat /run/secrets/SECRET_KEY) ... /// ``` - #[serde( - default, - deserialize_with = "super::env_vars_deserializer" - )] + #[serde(default, deserialize_with = "env_vars_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_env_vars_deserializer" + deserialize_with = "option_env_vars_deserializer" ))] #[builder(default)] pub secret_args: String, /// Docker labels - #[serde(default, deserialize_with = "super::labels_deserializer")] + #[serde(default, deserialize_with = "labels_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_labels_deserializer" + deserialize_with = "option_labels_deserializer" ))] #[builder(default)] pub labels: String, diff --git a/client/core/rs/src/entities/builder.rs b/client/core/rs/src/entities/builder.rs index 21d38e95f..1b9f205af 100644 --- a/client/core/rs/src/entities/builder.rs +++ b/client/core/rs/src/entities/builder.rs @@ -5,6 +5,10 @@ use serde::{Deserialize, Serialize}; use strum::{Display, EnumString}; use typeshare::typeshare; +use crate::deserializers::{ + option_string_list_deserializer, string_list_deserializer, +}; + use super::{ config::{DockerRegistry, GitProvider}, resource::{AddFilters, Resource, ResourceListItem, ResourceQuery}, @@ -330,7 +334,11 @@ pub struct AwsBuilderConfig { pub use_public_ip: bool, /// The security group ids to attach to the instance. /// This should include a security group to allow core inbound access to the periphery port. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub security_group_ids: Vec, /// The user data to deploy the instance with. @@ -347,7 +355,11 @@ pub struct AwsBuilderConfig { #[builder(default)] pub docker_registries: Vec, /// Which secrets are available on the AMI. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub secrets: Vec, } diff --git a/client/core/rs/src/entities/config/core.rs b/client/core/rs/src/entities/config/core.rs index c430b5fe1..6066e7b72 100644 --- a/client/core/rs/src/entities/config/core.rs +++ b/client/core/rs/src/entities/config/core.rs @@ -62,6 +62,8 @@ pub struct Env { pub komodo_sync_directory: Option, /// Override `repo_directory` pub komodo_repo_directory: Option, + /// Override `action_directory` + pub komodo_action_directory: Option, /// Override `resource_poll_interval` pub komodo_resource_poll_interval: Option, /// Override `monitoring_interval` @@ -491,6 +493,11 @@ pub struct CoreConfig { /// Default: `/repo-cache` #[serde(default = "default_repo_directory")] pub repo_directory: PathBuf, + + /// Specify the directory used to temporarily write typescript files used with actions. + /// Default: `/action-cache` + #[serde(default = "default_action_directory")] + pub action_directory: PathBuf, } fn default_title() -> String { @@ -509,14 +516,19 @@ fn default_jwt_ttl() -> Timelength { Timelength::OneDay } +fn default_sync_directory() -> PathBuf { + // unwrap ok: `/syncs` will always be valid path + PathBuf::from_str("/syncs").unwrap() +} + fn default_repo_directory() -> PathBuf { // unwrap ok: `/repo-cache` will always be valid path PathBuf::from_str("/repo-cache").unwrap() } -fn default_sync_directory() -> PathBuf { - // unwrap ok: `/syncs` will always be valid path - PathBuf::from_str("/syncs").unwrap() +fn default_action_directory() -> PathBuf { + // unwrap ok: `/action-cache` will always be valid path + PathBuf::from_str("/action-cache").unwrap() } fn default_prune_days() -> u64 { @@ -552,6 +564,7 @@ impl CoreConfig { jwt_secret: empty_or_redacted(&config.jwt_secret), jwt_ttl: config.jwt_ttl, repo_directory: config.repo_directory, + action_directory: config.action_directory, sync_directory: config.sync_directory, resource_poll_interval: config.resource_poll_interval, monitoring_interval: config.monitoring_interval, diff --git a/client/core/rs/src/entities/deployment.rs b/client/core/rs/src/entities/deployment.rs index 164f0b60a..df60988e9 100644 --- a/client/core/rs/src/entities/deployment.rs +++ b/client/core/rs/src/entities/deployment.rs @@ -4,14 +4,20 @@ use derive_builder::Builder; use derive_default_builder::DefaultBuilder; use derive_variants::EnumVariants; use partial_derive2::Partial; -use serde::{ - de::{value::SeqAccessDeserializer, Visitor}, - Deserialize, Deserializer, Serialize, -}; +use serde::{Deserialize, Serialize}; use strum::{Display, EnumString}; use typeshare::typeshare; -use crate::parser::parse_key_value_list; +use crate::{ + deserializers::{ + conversions_deserializer, env_vars_deserializer, + labels_deserializer, option_conversions_deserializer, + option_env_vars_deserializer, option_labels_deserializer, + option_string_list_deserializer, option_term_labels_deserializer, + string_list_deserializer, term_labels_deserializer, + }, + parsers::parse_key_value_list, +}; use super::{ docker::container::ContainerStateStatusEnum, @@ -125,7 +131,11 @@ pub struct DeploymentConfig { /// Extra args which are interpolated into the `docker run` command, /// and affect the container configuration. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub extra_args: Vec, @@ -161,25 +171,19 @@ pub struct DeploymentConfig { pub volumes: String, /// The environment variables passed to the container. - #[serde( - default, - deserialize_with = "super::env_vars_deserializer" - )] + #[serde(default, deserialize_with = "env_vars_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_env_vars_deserializer" + deserialize_with = "option_env_vars_deserializer" ))] #[builder(default)] pub environment: String, /// The docker labels given to the container. - #[serde( - default, - deserialize_with = "super::labels_deserializer" - )] + #[serde(default, deserialize_with = "labels_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_labels_deserializer" + deserialize_with = "option_labels_deserializer" ))] #[builder(default)] pub labels: String, @@ -294,108 +298,6 @@ pub fn conversions_from_str( }) } -pub fn conversions_deserializer<'de, D>( - deserializer: D, -) -> Result -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(ConversionVisitor) -} - -pub fn option_conversions_deserializer<'de, D>( - deserializer: D, -) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(OptionConversionVisitor) -} - -struct ConversionVisitor; - -impl<'de> Visitor<'de> for ConversionVisitor { - type Value = String; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - let out = v.to_string(); - if out.is_empty() || out.ends_with('\n') { - Ok(out) - } else { - Ok(out + "\n") - } - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - let res = Vec::::deserialize( - SeqAccessDeserializer::new(seq), - )?; - let res = res - .iter() - .map(|Conversion { local, container }| { - format!(" {local}: {container}") - }) - .collect::>() - .join("\n"); - let extra = if res.is_empty() { "" } else { "\n" }; - Ok(res + extra) - } -} - -struct OptionConversionVisitor; - -impl<'de> Visitor<'de> for OptionConversionVisitor { - type Value = Option; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "null or string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - ConversionVisitor.visit_str(v).map(Some) - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - ConversionVisitor.visit_seq(seq).map(Some) - } - - fn visit_none(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } - - fn visit_unit(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } -} - /// Variants de/serialized from/to snake_case. /// /// Eg. @@ -512,107 +414,6 @@ pub fn term_signal_labels_from_str( }) } -pub fn term_labels_deserializer<'de, D>( - deserializer: D, -) -> Result -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(TermSignalLabelVisitor) -} - -pub fn option_term_labels_deserializer<'de, D>( - deserializer: D, -) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(OptionTermSignalLabelVisitor) -} - -struct TermSignalLabelVisitor; - -impl<'de> Visitor<'de> for TermSignalLabelVisitor { - type Value = String; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - let out = v.to_string(); - if out.is_empty() || out.ends_with('\n') { - Ok(out) - } else { - Ok(out + "\n") - } - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - let res = Vec::::deserialize( - SeqAccessDeserializer::new(seq), - )? - .into_iter() - .map(|TerminationSignalLabel { signal, label }| { - format!(" {signal}: {label}") - }) - .collect::>() - .join("\n"); - let extra = if res.is_empty() { "" } else { "\n" }; - Ok(res + extra) - } -} - -struct OptionTermSignalLabelVisitor; - -impl<'de> Visitor<'de> for OptionTermSignalLabelVisitor { - type Value = Option; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "null or string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - TermSignalLabelVisitor.visit_str(v).map(Some) - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - TermSignalLabelVisitor.visit_seq(seq).map(Some) - } - - fn visit_none(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } - - fn visit_unit(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } -} - #[typeshare] #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] pub struct DeploymentActionState { diff --git a/client/core/rs/src/entities/mod.rs b/client/core/rs/src/entities/mod.rs index 1228d8797..734b8c32f 100644 --- a/client/core/rs/src/entities/mod.rs +++ b/client/core/rs/src/entities/mod.rs @@ -10,18 +10,20 @@ use clap::Parser; use derive_empty_traits::EmptyTraits; use derive_variants::{EnumVariants, ExtractVariant}; use serde::{ - de::{ - value::{MapAccessDeserializer, SeqAccessDeserializer}, - Visitor, - }, - Deserialize, Deserializer, Serialize, + de::{value::MapAccessDeserializer, Visitor}, + Deserialize, Serialize, }; use serror::Serror; use strum::{AsRefStr, Display, EnumString}; use typeshare::typeshare; -use crate::parser::parse_key_value_list; +use crate::{ + deserializers::file_contents_deserializer, + parsers::parse_key_value_list, +}; +/// Subtypes of [Action][action::Action]. +pub mod action; /// Subtypes of [Alert][alert::Alert]. pub mod alert; /// Subtypes of [Alerter][alerter::Alerter]. @@ -365,210 +367,6 @@ pub fn environment_vars_from_str( }) } -pub fn env_vars_deserializer<'de, D>( - deserializer: D, -) -> Result -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(EnvironmentVarVisitor) -} - -pub fn option_env_vars_deserializer<'de, D>( - deserializer: D, -) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(OptionEnvVarVisitor) -} - -struct EnvironmentVarVisitor; - -impl<'de> Visitor<'de> for EnvironmentVarVisitor { - type Value = String; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - let out = v.to_string(); - if out.is_empty() || out.ends_with('\n') { - Ok(out) - } else { - Ok(out + "\n") - } - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - let vars = Vec::::deserialize( - SeqAccessDeserializer::new(seq), - )?; - let vars = vars - .iter() - .map(|EnvironmentVar { variable, value }| { - format!(" {variable} = {value}") - }) - .collect::>() - .join("\n"); - let extra = if vars.is_empty() { "" } else { "\n" }; - Ok(vars + extra) - } -} - -struct OptionEnvVarVisitor; - -impl<'de> Visitor<'de> for OptionEnvVarVisitor { - type Value = Option; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "null or string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - EnvironmentVarVisitor.visit_str(v).map(Some) - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - EnvironmentVarVisitor.visit_seq(seq).map(Some) - } - - fn visit_none(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } - - fn visit_unit(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } -} - -pub fn labels_deserializer<'de, D>( - deserializer: D, -) -> Result -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(LabelVisitor) -} - -pub fn option_labels_deserializer<'de, D>( - deserializer: D, -) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(OptionLabelVisitor) -} - -struct LabelVisitor; - -impl<'de> Visitor<'de> for LabelVisitor { - type Value = String; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - let out = v.to_string(); - if out.is_empty() || out.ends_with('\n') { - Ok(out) - } else { - Ok(out + "\n") - } - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - let vars = Vec::::deserialize( - SeqAccessDeserializer::new(seq), - )?; - let vars = vars - .iter() - .map(|EnvironmentVar { variable, value }| { - format!(" {variable}: {value}") - }) - .collect::>() - .join("\n"); - let extra = if vars.is_empty() { "" } else { "\n" }; - Ok(vars + extra) - } -} - -struct OptionLabelVisitor; - -impl<'de> Visitor<'de> for OptionLabelVisitor { - type Value = Option; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "null or string or Vec") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - LabelVisitor.visit_str(v).map(Some) - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - LabelVisitor.visit_seq(seq).map(Some) - } - - fn visit_none(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } - - fn visit_unit(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } -} - #[typeshare] #[derive(Debug, Clone, Serialize, Deserialize)] pub struct LatestCommit { @@ -929,6 +727,12 @@ pub enum Operation { DeleteProcedure, RunProcedure, + // action + CreateAction, + UpdateAction, + DeleteAction, + RunAction, + // builder CreateBuilder, UpdateBuilder, @@ -1053,6 +857,7 @@ pub enum ResourceTarget { Build(String), Repo(String), Procedure(String), + Action(String), Builder(String), Alerter(String), ServerTemplate(String), @@ -1073,6 +878,7 @@ impl ResourceTarget { ResourceTarget::Repo(id) => id, ResourceTarget::Alerter(id) => id, ResourceTarget::Procedure(id) => id, + ResourceTarget::Action(id) => id, ResourceTarget::ServerTemplate(id) => id, ResourceTarget::ResourceSync(id) => id, }; @@ -1145,8 +951,14 @@ impl From<&sync::ResourceSync> for ResourceTarget { } impl From<&stack::Stack> for ResourceTarget { - fn from(resource_sync: &stack::Stack) -> Self { - Self::Stack(resource_sync.id.clone()) + fn from(stack: &stack::Stack) -> Self { + Self::Stack(stack.id.clone()) + } +} + +impl From<&action::Action> for ResourceTarget { + fn from(action: &action::Action) -> Self { + Self::Action(action.id.clone()) } } @@ -1165,85 +977,7 @@ impl ResourceTargetVariant { ResourceTargetVariant::ServerTemplate => "server_template", ResourceTargetVariant::ResourceSync => "resource_sync", ResourceTargetVariant::Stack => "stack", + ResourceTargetVariant::Action => "action", } } } - -/// Using this ensures the file contents end with trailing '\n' -pub fn file_contents_deserializer<'de, D>( - deserializer: D, -) -> Result -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(FileContentsVisitor) -} - -/// Using this ensures the file contents end with trailing '\n' -pub fn option_file_contents_deserializer<'de, D>( - deserializer: D, -) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(OptionFileContentsVisitor) -} - -struct FileContentsVisitor; - -impl<'de> Visitor<'de> for FileContentsVisitor { - type Value = String; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "string") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - let out = v.trim_end().to_string(); - if out.is_empty() { - Ok(out) - } else { - Ok(out + "\n") - } - } -} - -struct OptionFileContentsVisitor; - -impl<'de> Visitor<'de> for OptionFileContentsVisitor { - type Value = Option; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "null or string") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - FileContentsVisitor.visit_str(v).map(Some) - } - - fn visit_none(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } - - fn visit_unit(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } -} diff --git a/client/core/rs/src/entities/repo.rs b/client/core/rs/src/entities/repo.rs index 865ca4b11..3cbb0cc9b 100644 --- a/client/core/rs/src/entities/repo.rs +++ b/client/core/rs/src/entities/repo.rs @@ -7,7 +7,13 @@ use serde::{Deserialize, Serialize}; use strum::Display; use typeshare::typeshare; -use crate::entities::I64; +use crate::{ + deserializers::{ + env_vars_deserializer, option_env_vars_deserializer, + option_string_list_deserializer, string_list_deserializer, + }, + entities::I64, +}; use super::{ environment_vars_from_str, @@ -178,7 +184,11 @@ pub struct RepoConfig { pub on_pull: SystemCommand, /// Configure quick links that are displayed in the resource header - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub links: Vec, @@ -187,13 +197,10 @@ pub struct RepoConfig { /// which is given relative to the run directory. /// /// If it is empty, no file will be written. - #[serde( - default, - deserialize_with = "super::env_vars_deserializer" - )] + #[serde(default, deserialize_with = "env_vars_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_env_vars_deserializer" + deserialize_with = "option_env_vars_deserializer" ))] #[builder(default)] pub environment: String, diff --git a/client/core/rs/src/entities/resource.rs b/client/core/rs/src/entities/resource.rs index 8bdbc9bde..5c1c4bc92 100644 --- a/client/core/rs/src/entities/resource.rs +++ b/client/core/rs/src/entities/resource.rs @@ -4,7 +4,10 @@ use derive_default_builder::DefaultBuilder; use serde::{Deserialize, Serialize}; use typeshare::typeshare; -use crate::entities::{MongoId, I64}; +use crate::{ + deserializers::string_list_deserializer, + entities::{MongoId, I64}, +}; use super::{permission::PermissionLevel, ResourceTargetVariant}; @@ -38,7 +41,7 @@ pub struct Resource { pub updated_at: I64, /// Tag Ids - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] #[builder(default)] pub tags: Vec, @@ -84,7 +87,7 @@ pub struct ResourceQuery { #[serde(default)] pub names: Vec, /// Pass Vec of tag ids or tag names - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] pub tags: Vec, #[serde(default)] pub tag_behavior: TagBehavior, diff --git a/client/core/rs/src/entities/server.rs b/client/core/rs/src/entities/server.rs index 75ac9e26d..c1e8e1f99 100644 --- a/client/core/rs/src/entities/server.rs +++ b/client/core/rs/src/entities/server.rs @@ -5,6 +5,10 @@ use partial_derive2::Partial; use serde::{Deserialize, Serialize}; use typeshare::typeshare; +use crate::deserializers::{ + option_string_list_deserializer, string_list_deserializer, +}; + use super::{ alert::SeverityLevel, resource::{AddFilters, Resource, ResourceListItem, ResourceQuery}, @@ -65,7 +69,11 @@ pub struct ServerConfig { /// Sometimes the system stats reports a mount path that is not desired. /// Use this field to filter it out from the report. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub ignore_mounts: Vec, @@ -84,7 +92,11 @@ pub struct ServerConfig { pub auto_prune: bool, /// Configure quick links that are displayed in the resource header - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub links: Vec, diff --git a/client/core/rs/src/entities/server_template/aws.rs b/client/core/rs/src/entities/server_template/aws.rs index e74452aba..26e0a561d 100644 --- a/client/core/rs/src/entities/server_template/aws.rs +++ b/client/core/rs/src/entities/server_template/aws.rs @@ -4,7 +4,12 @@ use serde::{Deserialize, Serialize}; use strum::{AsRefStr, Display}; use typeshare::typeshare; -use crate::entities::builder::AwsBuilderConfig; +use crate::{ + deserializers::{ + option_string_list_deserializer, string_list_deserializer, + }, + entities::builder::AwsBuilderConfig, +}; #[typeshare(serialized_as = "Partial")] pub type _PartialAwsServerTemplateConfig = @@ -56,7 +61,11 @@ pub struct AwsServerTemplateConfig { #[partial_default(default_use_https())] pub use_https: bool, /// The security groups to give to the instance. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub security_group_ids: Vec, /// Specify the EBS volumes to attach. diff --git a/client/core/rs/src/entities/server_template/hetzner.rs b/client/core/rs/src/entities/server_template/hetzner.rs index 92ce22dee..fa08be20f 100644 --- a/client/core/rs/src/entities/server_template/hetzner.rs +++ b/client/core/rs/src/entities/server_template/hetzner.rs @@ -6,7 +6,12 @@ use serde::{Deserialize, Serialize}; use strum::AsRefStr; use typeshare::typeshare; -use crate::entities::I64; +use crate::{ + deserializers::{ + option_string_list_deserializer, string_list_deserializer, + }, + entities::I64, +}; #[typeshare(serialized_as = "Partial")] pub type _PartialHetznerServerTemplateConfig = @@ -37,7 +42,11 @@ pub struct HetznerServerTemplateConfig { #[builder(default)] pub server_type: HetznerServerType, /// SSH key IDs ( integer ) or names ( string ) which should be injected into the Server at creation time - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub ssh_keys: Vec, /// Network IDs which should be attached to the Server private network interface at the creation time diff --git a/client/core/rs/src/entities/stack.rs b/client/core/rs/src/entities/stack.rs index f9f4adea1..91559a2f1 100644 --- a/client/core/rs/src/entities/stack.rs +++ b/client/core/rs/src/entities/stack.rs @@ -8,6 +8,12 @@ use serde::{Deserialize, Serialize}; use strum::Display; use typeshare::typeshare; +use crate::deserializers::{ + env_vars_deserializer, file_contents_deserializer, + option_env_vars_deserializer, option_file_contents_deserializer, + option_string_list_deserializer, string_list_deserializer, +}; + use super::{ docker::container::ContainerListItem, resource::{Resource, ResourceListItem, ResourceQuery}, @@ -186,7 +192,11 @@ pub struct StackConfig { pub server_id: String, /// Configure quick links that are displayed in the resource header - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub links: Vec, @@ -238,18 +248,32 @@ pub struct StackConfig { /// Add paths to compose files, relative to the run path. /// If this is empty, will use file `compose.yaml`. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub file_paths: Vec, /// The name of the written environment file before `docker compose up`. - /// Relative to the repo root. + /// Relative to the run directory root. /// Default: .env #[serde(default = "default_env_file_path")] #[builder(default = "default_env_file_path()")] #[partial_default(default_env_file_path())] pub env_file_path: String, + /// Add additional env files to attach with `--env-file`. + /// Relative to the run directory root. + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] + #[builder(default)] + pub additional_env_files: Vec, + /// The git provider domain. Default: github.com #[serde(default = "default_git_provider")] #[builder(default = "default_git_provider()")] @@ -336,34 +360,43 @@ pub struct StackConfig { /// The extra arguments to pass after `docker compose up -d`. /// If empty, no extra arguments will be passed. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub extra_args: Vec, /// The extra arguments to pass after `docker compose build`. /// If empty, no extra build arguments will be passed. /// Only used if `run_build: true` - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub build_extra_args: Vec, /// Ignore certain services declared in the compose file when checking /// the stack status. For example, an init service might be exited, but the /// stack should be healthy. This init service should be in `ignore_services` - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub ignore_services: Vec, /// The contents of the file directly, for management in the UI. /// If this is empty, it will fall back to checking git config for /// repo based compose file. - #[serde( - default, - deserialize_with = "super::file_contents_deserializer" - )] + #[serde(default, deserialize_with = "file_contents_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_file_contents_deserializer" + deserialize_with = "option_file_contents_deserializer" ))] #[builder(default)] pub file_contents: String, @@ -373,13 +406,10 @@ pub struct StackConfig { /// which is given relative to the run directory. /// /// If it is empty, no file will be written. - #[serde( - default, - deserialize_with = "super::env_vars_deserializer" - )] + #[serde(default, deserialize_with = "env_vars_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_env_vars_deserializer" + deserialize_with = "option_env_vars_deserializer" ))] #[builder(default)] pub environment: String, @@ -436,6 +466,7 @@ impl Default for StackConfig { extra_args: Default::default(), environment: Default::default(), env_file_path: default_env_file_path(), + additional_env_files: Default::default(), run_build: Default::default(), destroy_before_deploy: Default::default(), build_extra_args: Default::default(), diff --git a/client/core/rs/src/entities/sync.rs b/client/core/rs/src/entities/sync.rs index ab9c4e785..4475e0826 100644 --- a/client/core/rs/src/entities/sync.rs +++ b/client/core/rs/src/entities/sync.rs @@ -2,13 +2,15 @@ use bson::{doc, Document}; use derive_builder::Builder; use derive_default_builder::DefaultBuilder; use partial_derive2::Partial; -use serde::{ - de::{value::SeqAccessDeserializer, Visitor}, - Deserialize, Deserializer, Serialize, -}; +use serde::{Deserialize, Serialize}; use strum::Display; use typeshare::typeshare; +use crate::deserializers::{ + file_contents_deserializer, option_file_contents_deserializer, + option_string_list_deserializer, string_list_deserializer, +}; + use super::{ resource::{Resource, ResourceListItem, ResourceQuery}, ResourceTarget, I64, @@ -219,10 +221,10 @@ pub struct ResourceSyncConfig { /// - If Git Repo based, this is relative to the root of the repo. /// Can be a specific file, or a directory containing multiple files / folders. /// See [https://komo.do/docs/sync-resources](https://komo.do/docs/sync-resources) for more information. - #[serde(default, deserialize_with = "resource_path_deserializer")] + #[serde(default, deserialize_with = "string_list_deserializer")] #[partial_attr(serde( default, - deserialize_with = "option_resource_path_deserializer" + deserialize_with = "option_string_list_deserializer" ))] #[builder(default)] pub resource_path: Vec, @@ -244,18 +246,19 @@ pub struct ResourceSyncConfig { /// When using `managed` resource sync, will only export resources /// matching all of the given tags. If none, will match all resources. - #[serde(default)] + #[serde(default, deserialize_with = "string_list_deserializer")] + #[partial_attr(serde( + default, + deserialize_with = "option_string_list_deserializer" + ))] #[builder(default)] pub match_tags: Vec, /// Manage the file contents in the UI. - #[serde( - default, - deserialize_with = "super::file_contents_deserializer" - )] + #[serde(default, deserialize_with = "file_contents_deserializer")] #[partial_attr(serde( default, - deserialize_with = "super::option_file_contents_deserializer" + deserialize_with = "option_file_contents_deserializer" ))] #[builder(default)] pub file_contents: String, @@ -327,94 +330,6 @@ pub struct SyncFileContents { pub contents: String, } -/// Using this ensures the resource path deserialized to Vec -pub fn resource_path_deserializer<'de, D>( - deserializer: D, -) -> Result, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(ResourcePathVisitor) -} - -/// Using this ensures the resource path deserialized to Vec -pub fn option_resource_path_deserializer<'de, D>( - deserializer: D, -) -> Result>, D::Error> -where - D: Deserializer<'de>, -{ - deserializer.deserialize_any(OptionResourcePathVisitor) -} - -struct ResourcePathVisitor; - -impl<'de> Visitor<'de> for ResourcePathVisitor { - type Value = Vec; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "string") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - Ok(vec![v.to_string()]) - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - Vec::deserialize(SeqAccessDeserializer::new(seq)) - } -} - -struct OptionResourcePathVisitor; - -impl<'de> Visitor<'de> for OptionResourcePathVisitor { - type Value = Option>; - - fn expecting( - &self, - formatter: &mut std::fmt::Formatter, - ) -> std::fmt::Result { - write!(formatter, "null or string") - } - - fn visit_str(self, v: &str) -> Result - where - E: serde::de::Error, - { - ResourcePathVisitor.visit_str(v).map(Some) - } - - fn visit_seq(self, seq: A) -> Result - where - A: serde::de::SeqAccess<'de>, - { - ResourcePathVisitor.visit_seq(seq).map(Some) - } - - fn visit_none(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } - - fn visit_unit(self) -> Result - where - E: serde::de::Error, - { - Ok(None) - } -} - #[typeshare] #[derive(Serialize, Deserialize, Debug, Clone, Copy, Default)] pub struct ResourceSyncActionState { diff --git a/client/core/rs/src/entities/toml.rs b/client/core/rs/src/entities/toml.rs index 27f66721c..5e391299c 100644 --- a/client/core/rs/src/entities/toml.rs +++ b/client/core/rs/src/entities/toml.rs @@ -3,10 +3,11 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use super::{ - alerter::PartialAlerterConfig, build::PartialBuildConfig, - builder::PartialBuilderConfig, deployment::PartialDeploymentConfig, - permission::PermissionLevel, procedure::PartialProcedureConfig, - repo::PartialRepoConfig, server::PartialServerConfig, + action::PartialActionConfig, alerter::PartialAlerterConfig, + build::PartialBuildConfig, builder::PartialBuilderConfig, + deployment::PartialDeploymentConfig, permission::PermissionLevel, + procedure::PartialProcedureConfig, repo::PartialRepoConfig, + server::PartialServerConfig, server_template::PartialServerTemplateConfig, stack::PartialStackConfig, sync::PartialResourceSyncConfig, variable::Variable, ResourceTarget, ResourceTargetVariant, @@ -57,6 +58,13 @@ pub struct ResourcesToml { )] pub procedures: Vec>, + #[serde( + default, + rename = "action", + skip_serializing_if = "Vec::is_empty" + )] + pub actions: Vec>, + #[serde( default, rename = "alerter", diff --git a/client/core/rs/src/entities/user.rs b/client/core/rs/src/entities/user.rs index 08d8e936d..2cf539496 100644 --- a/client/core/rs/src/entities/user.rs +++ b/client/core/rs/src/entities/user.rs @@ -87,30 +87,56 @@ impl User { matches!( user_id, "System" + | "000000000000000000000000" | "Procedure" - | "Github" // Github can be removed later, just keeping for backward compat. + | "000000000000000000000001" + | "Action" + | "000000000000000000000002" | "Git Webhook" + | "000000000000000000000003" | "Auto Redeploy" + | "000000000000000000000004" | "Resource Sync" + | "000000000000000000000005" | "Stack Wizard" + | "000000000000000000000006" | "Build Manager" + | "000000000000000000000007" | "Repo Manager" + | "000000000000000000000008" ) } } pub fn admin_service_user(user_id: &str) -> Option { match user_id { - "System" => system_user().to_owned().into(), - "Procedure" => procedure_user().to_owned().into(), - // Github should be removed later, replaced by Git Webhook, just keeping for backward compat. - "Github" => git_webhook_user().to_owned().into(), - "Git Webhook" => git_webhook_user().to_owned().into(), - "Auto Redeploy" => auto_redeploy_user().to_owned().into(), - "Resource Sync" => sync_user().to_owned().into(), - "Stack Wizard" => stack_user().to_owned().into(), - "Build Manager" => build_user().to_owned().into(), - "Repo Manager" => repo_user().to_owned().into(), + "000000000000000000000000" | "System" => { + system_user().to_owned().into() + } + "000000000000000000000001" | "Procedure" => { + procedure_user().to_owned().into() + } + "000000000000000000000002" | "Action" => { + action_user().to_owned().into() + } + "000000000000000000000003" | "Git Webhook" => { + git_webhook_user().to_owned().into() + } + "000000000000000000000004" | "Auto Redeploy" => { + auto_redeploy_user().to_owned().into() + } + "000000000000000000000005" | "Resource Sync" => { + sync_user().to_owned().into() + } + "000000000000000000000006" | "Stack Wizard" => { + stack_user().to_owned().into() + } + "000000000000000000000007" | "Build Manager" => { + build_user().to_owned().into() + } + "000000000000000000000008" | "Repo Manager" => { + repo_user().to_owned().into() + } _ => None, } } @@ -120,8 +146,9 @@ pub fn system_user() -> &'static User { SYSTEM_USER.get_or_init(|| { let id_name = String::from("System"); User { - id: id_name.clone(), + id: "000000000000000000000000".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -133,8 +160,23 @@ pub fn procedure_user() -> &'static User { PROCEDURE_USER.get_or_init(|| { let id_name = String::from("Procedure"); User { - id: id_name.clone(), + id: "000000000000000000000001".to_string(), username: id_name, + enabled: true, + admin: true, + ..Default::default() + } + }) +} + +pub fn action_user() -> &'static User { + static ACTION_USER: OnceLock = OnceLock::new(); + ACTION_USER.get_or_init(|| { + let id_name = String::from("Action"); + User { + id: "000000000000000000000002".to_string(), + username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -146,8 +188,9 @@ pub fn git_webhook_user() -> &'static User { GIT_WEBHOOK_USER.get_or_init(|| { let id_name = String::from("Git Webhook"); User { - id: id_name.clone(), + id: "000000000000000000000003".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -159,8 +202,9 @@ pub fn auto_redeploy_user() -> &'static User { AUTO_REDEPLOY_USER.get_or_init(|| { let id_name = String::from("Auto Redeploy"); User { - id: id_name.clone(), + id: "000000000000000000000004".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -172,8 +216,9 @@ pub fn sync_user() -> &'static User { SYNC_USER.get_or_init(|| { let id_name = String::from("Resource Sync"); User { - id: id_name.clone(), + id: "000000000000000000000005".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -185,8 +230,9 @@ pub fn stack_user() -> &'static User { STACK_USER.get_or_init(|| { let id_name = String::from("Stack Wizard"); User { - id: id_name.clone(), + id: "000000000000000000000006".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -198,8 +244,9 @@ pub fn build_user() -> &'static User { BUILD_USER.get_or_init(|| { let id_name = String::from("Build Manager"); User { - id: id_name.clone(), + id: "000000000000000000000007".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } @@ -211,8 +258,9 @@ pub fn repo_user() -> &'static User { REPO_USER.get_or_init(|| { let id_name = String::from("Repo Manager"); User { - id: id_name.clone(), + id: "000000000000000000000008".to_string(), username: id_name, + enabled: true, admin: true, ..Default::default() } diff --git a/client/core/rs/src/entities/user_group.rs b/client/core/rs/src/entities/user_group.rs index 8f6c6832e..3c01a80d5 100644 --- a/client/core/rs/src/entities/user_group.rs +++ b/client/core/rs/src/entities/user_group.rs @@ -3,6 +3,8 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use typeshare::typeshare; +use crate::deserializers::string_list_deserializer; + use super::{ permission::PermissionLevel, MongoId, ResourceTargetVariant, I64, }; @@ -37,6 +39,7 @@ pub struct UserGroup { /// User ids of group members #[cfg_attr(feature = "mongo", index)] + #[serde(default, deserialize_with = "string_list_deserializer")] pub users: Vec, /// Give the user group elevated permissions on all resources of a certain type diff --git a/client/core/rs/src/lib.rs b/client/core/rs/src/lib.rs index a1281ad51..76562b8e1 100644 --- a/client/core/rs/src/lib.rs +++ b/client/core/rs/src/lib.rs @@ -35,8 +35,9 @@ use serde::Deserialize; pub mod api; pub mod busy; pub mod entities; -pub mod parser; +pub mod parsers; pub mod ws; +pub mod deserializers; mod request; diff --git a/client/core/rs/src/parser.rs b/client/core/rs/src/parsers.rs similarity index 69% rename from client/core/rs/src/parser.rs rename to client/core/rs/src/parsers.rs index 0f582f466..06f1fa848 100644 --- a/client/core/rs/src/parser.rs +++ b/client/core/rs/src/parsers.rs @@ -1,5 +1,25 @@ use anyhow::Context; +/// Parses a list of key value pairs from a multiline string +/// +/// Example source: +/// ```text +/// # Supports comments +/// KEY_1 = value_1 # end of line comments +/// +/// # Supports string wrapped values +/// KEY_2="value_2" +/// 'KEY_3 = value_3' +/// +/// # Also supports yaml list formats +/// - KEY_4: 'value_4' +/// - "KEY_5=value_5" +/// ``` +/// +/// Returns: +/// ```text +/// [("KEY_1", "value_1"), ("KEY_2", "value_2"), ("KEY_3", "value_3"), ("KEY_4", "value_4"), ("KEY_5", "value_5")] +/// ``` pub fn parse_key_value_list( input: &str, ) -> anyhow::Result> { @@ -103,3 +123,33 @@ pub fn parse_multiline_command(command: impl AsRef) -> String { .collect::>() .join(" && ") } + +/// Parses a list of strings from a comment seperated and multiline string +/// +/// Example source: +/// ```text +/// # supports comments +/// path/to/file1 # comment1 +/// path/to/file2 +/// +/// # also supports comma seperated values +/// path/to/file3,path/to/file4 +/// ``` +/// +/// Returns: +/// ```text +/// ["path/to/file1", "path/to/file2", "path/to/file3", "path/to/file4"] +/// ``` +pub fn parse_string_list(source: impl AsRef) -> Vec { + source + .as_ref() + .split('\n') + .map(str::trim) + .filter(|line| !line.is_empty() && !line.starts_with('#')) + .filter_map(|line| line.split(" #").next()) + .flat_map(|line| line.split(',')) + .map(str::trim) + .filter(|entry| !entry.is_empty()) + .map(str::to_string) + .collect() +} diff --git a/client/core/ts/README.md b/client/core/ts/README.md index 71cd12151..da6be4d2f 100644 --- a/client/core/ts/README.md +++ b/client/core/ts/README.md @@ -24,14 +24,14 @@ const komodo = KomodoClient("https://demo.komo.do", { }); const stacks: Types.StackListItem[] = await komodo.read({ - type: "ListStacks", - params: {}, + type: "ListStacks", + params: {}, }); const stack: Types.Stack = await komodo.read({ - type: "GetStack", - params: { - stack: stacks[0].name, - } + type: "GetStack", + params: { + stack: stacks[0].name, + } }); ``` diff --git a/client/core/ts/package.json b/client/core/ts/package.json index 288886960..1c62e93a5 100644 --- a/client/core/ts/package.json +++ b/client/core/ts/package.json @@ -1,6 +1,6 @@ { "name": "komodo_client", - "version": "1.15.9", + "version": "1.15.15", "description": "Komodo client package", "homepage": "https://komo.do", "main": "dist/lib.js", @@ -11,9 +11,7 @@ "scripts": { "build": "tsc" }, - "dependencies": { - "axios": "^1.7.7" - }, + "dependencies": {}, "devDependencies": { "typescript": "^5.6.3" }, diff --git a/client/core/ts/src/lib.ts b/client/core/ts/src/lib.ts index 108919149..10cfc32ee 100644 --- a/client/core/ts/src/lib.ts +++ b/client/core/ts/src/lib.ts @@ -1,4 +1,3 @@ -import axios from "axios"; import { AuthResponses, ExecuteResponses, @@ -20,6 +19,7 @@ type InitOptions = | { type: "jwt"; params: { jwt: string } } | { type: "api-key"; params: { key: string; secret: string } }; +/** Initialize a new client for Komodo */ export function KomodoClient(url: string, options: InitOptions) { const state = { jwt: options.type === "jwt" ? options.params.jwt : undefined, @@ -27,31 +27,190 @@ export function KomodoClient(url: string, options: InitOptions) { secret: options.type === "api-key" ? options.params.secret : undefined, }; - const request = async (path: string, request: Req) => - await axios - .post(url + path, request, { - headers: { - Authorization: state.jwt, - "X-API-KEY": state.key, - "X-API-SECRET": state.secret, - }, - }) - .then(({ data }) => data); + const request = async ( + path: "/auth" | "/user" | "/read" | "/execute" | "/write", + request: Req + ): Promise => + new Promise(async (res, rej) => { + try { + let response = await fetch(url + path, { + method: "POST", + body: JSON.stringify(request), + headers: { + ...(state.jwt + ? { + authorization: state.jwt, + } + : state.key && state.secret + ? { + "x-api-key": state.key, + "x-api-secret": state.secret, + } + : {}), + "content-type": "application/json", + }, + }); + if (response.status === 200) { + const body: Res = await response.json(); + res(body); + } else { + try { + const result = await response.json(); + rej({ status: response.status, result }); + } catch (error) { + rej({ + status: response.status, + result: { + error: "Failed to get response body", + trace: [JSON.stringify(error)], + }, + error, + }); + } + } + } catch (error) { + rej({ + status: 1, + result: { + error: "Request failed with error", + trace: [JSON.stringify(error)], + }, + error, + }); + } + }); - const auth = async (req: Req) => - await request("/auth", req); + const auth = async < + T extends AuthRequest["type"], + Req extends Extract + >( + type: T, + params: Req["params"] + ) => + await request< + { type: T; params: Req["params"] }, + AuthResponses[Req["type"]] + >("/auth", { + type, + params, + }); - const user = async (req: Req) => - await request("/user", req); + const user = async < + T extends UserRequest["type"], + Req extends Extract + >( + type: T, + params: Req["params"] + ) => + await request< + { type: T; params: Req["params"] }, + UserResponses[Req["type"]] + >("/user", { type, params }); - const read = async (req: Req) => - await request("/read", req); + + const read = async < + T extends ReadRequest["type"], + Req extends Extract + >( + type: T, + params: Req["params"] + ) => + await request< + { type: T; params: Req["params"] }, + ReadResponses[Req["type"]] + >("/read", { type, params }); - const write = async (req: Req) => - await request("/write", req); + + const write = async < + T extends WriteRequest["type"], + Req extends Extract + >( + type: T, + params: Req["params"] + ) => + await request< + { type: T; params: Req["params"] }, + WriteResponses[Req["type"]] + >("/write", { type, params }); - const execute = async (req: Req) => - await request("/execute", req); + + const execute = async < + T extends ExecuteRequest["type"], + Req extends Extract + >( + type: T, + params: Req["params"] + ) => + await request< + { type: T; params: Req["params"] }, + ExecuteResponses[Req["type"]] + >("/execute", { type, params }); - return { request, auth, user, read, write, execute }; + const core_version = () => read("GetVersion", {}).then((res) => res.version); + + return { + /** + * Call the `/auth` api. + * + * ``` + * const login_options = await komodo.auth("GetLoginOptions", {}); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/auth/index.html + */ + auth, + /** + * Call the `/user` api. + * + * ``` + * const { key, secret } = await komodo.user("CreateApiKey", { + * name: "my-api-key" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/user/index.html + */ + user, + /** + * Call the `/read` api. + * + * ``` + * const stack = await komodo.read("GetStack", { + * stack: "my-stack" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/read/index.html + */ + read, + /** + * Call the `/write` api. + * + * ``` + * const build = await komodo.write("UpdateBuild", { + * id: "my-build", + * config: { + * version: "1.0.4" + * } + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/write/index.html + */ + write, + /** + * Call the `/execute` api. + * + * ``` + * const update = await komodo.execute("DeployStack", { + * stack: "my-stack" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/execute/index.html + */ + execute, + /** Returns the version of Komodo Core the client is calling to. */ + core_version, + }; } diff --git a/client/core/ts/src/responses.ts b/client/core/ts/src/responses.ts index 9b838a93a..ba215b100 100644 --- a/client/core/ts/src/responses.ts +++ b/client/core/ts/src/responses.ts @@ -46,6 +46,13 @@ export type ReadResponses = { ListProcedures: Types.ListProceduresResponse; ListFullProcedures: Types.ListFullProceduresResponse; + // ==== ACTION ==== + GetActionsSummary: Types.GetActionsSummaryResponse; + GetAction: Types.GetActionResponse; + GetActionActionState: Types.GetActionActionStateResponse; + ListActions: Types.ListActionsResponse; + ListFullActions: Types.ListFullActionsResponse; + // ==== SERVER TEMPLATE ==== GetServerTemplate: Types.GetServerTemplateResponse; GetServerTemplatesSummary: Types.GetServerTemplatesSummaryResponse; @@ -258,6 +265,12 @@ export type WriteResponses = { DeleteProcedure: Types.Procedure; UpdateProcedure: Types.Procedure; + // ==== ACTION ==== + CreateAction: Types.Action; + CopyAction: Types.Action; + DeleteAction: Types.Action; + UpdateAction: Types.Action; + // ==== SYNC ==== CreateResourceSync: Types.ResourceSync; CopyResourceSync: Types.ResourceSync; @@ -347,6 +360,9 @@ export type ExecuteResponses = { // ==== PROCEDURE ==== RunProcedure: Types.Update; + + // ==== ACTION ==== + RunAction: Types.Update; // ==== SERVER TEMPLATE ==== LaunchServer: Types.Update; diff --git a/client/core/ts/src/types.ts b/client/core/ts/src/types.ts index fbf39229c..203b0b26f 100644 --- a/client/core/ts/src/types.ts +++ b/client/core/ts/src/types.ts @@ -1,53 +1,13 @@ /* - Generated by typeshare 1.9.2 + Generated by typeshare 1.11.0 */ -/** JSON containing an authentication token. */ -export interface JwtResponse { - /** A token the user can use to authenticate their requests. */ - jwt: string; -} - -/** Response for [CreateLocalUser]. */ -export type CreateLocalUserResponse = JwtResponse; - -/** The response for [LoginLocalUser] */ -export type LoginLocalUserResponse = JwtResponse; - -/** Response for [ExchangeForJwt]. */ -export type ExchangeForJwtResponse = JwtResponse; - export interface MongoIdObj { $oid: string; } export type MongoId = MongoIdObj; -export type UserConfig = - /** User that logs in with username / password */ - | { type: "Local", data: { - password: string; -}} - /** User that logs in via Google Oauth */ - | { type: "Google", data: { - google_id: string; - avatar: string; -}} - /** User that logs in via Github Oauth */ - | { type: "Github", data: { - github_id: string; - avatar: string; -}} - /** User that logs in via Oidc provider */ - | { type: "Oidc", data: { - provider: string; - user_id: string; -}} - /** Non-human managed user, can have it's own permissions / api keys */ - | { type: "Service", data: { - description: string; -}}; - export type I64 = number; /** The levels of permission that a User or UserGroup can have on a resource. */ @@ -62,202 +22,6 @@ export enum PermissionLevel { Write = "Write", } -export interface User { - /** - * The Mongo ID of the User. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of User schema) }` - */ - _id?: MongoId; - /** The globally unique username for the user. */ - username: string; - /** Whether user is enabled / able to access the api. */ - enabled?: boolean; - /** Can give / take other users admin priviledges. */ - super_admin?: boolean; - /** Whether the user has global admin permissions. */ - admin?: boolean; - /** Whether the user has permission to create servers. */ - create_server_permissions?: boolean; - /** Whether the user has permission to create builds */ - create_build_permissions?: boolean; - /** The user-type specific config. */ - config: UserConfig; - /** When the user last opened updates dropdown. */ - last_update_view?: I64; - /** Recently viewed ids */ - recents?: Record; - /** Give the user elevated permissions on all resources of a certain type */ - all?: Record; - updated_at?: I64; -} - -export type GetUserResponse = User; - -/** Severity level of problem. */ -export enum SeverityLevel { - /** No problem. */ - Ok = "OK", - /** Problem is imminent. */ - Warning = "WARNING", - /** Problem fully realized. */ - Critical = "CRITICAL", -} - -/** Used to reference a specific resource across all resource types */ -export type ResourceTarget = - | { type: "System", id: string } - | { type: "Server", id: string } - | { type: "Stack", id: string } - | { type: "Deployment", id: string } - | { type: "Build", id: string } - | { type: "Repo", id: string } - | { type: "Procedure", id: string } - | { type: "Builder", id: string } - | { type: "Alerter", id: string } - | { type: "ServerTemplate", id: string } - | { type: "ResourceSync", id: string }; - -/** The variants of data related to the alert. */ -export type AlertData = - /** A null alert */ - | { type: "None", data: { -}} - /** A server could not be reached. */ - | { type: "ServerUnreachable", data: { - /** The id of the server */ - id: string; - /** The name of the server */ - name: string; - /** The region of the server */ - region?: string; - /** The error data */ - err?: _Serror; -}} - /** A server has high CPU usage. */ - | { type: "ServerCpu", data: { - /** The id of the server */ - id: string; - /** The name of the server */ - name: string; - /** The region of the server */ - region?: string; - /** The cpu usage percentage */ - percentage: number; -}} - /** A server has high memory usage. */ - | { type: "ServerMem", data: { - /** The id of the server */ - id: string; - /** The name of the server */ - name: string; - /** The region of the server */ - region?: string; - /** The used memory */ - used_gb: number; - /** The total memory */ - total_gb: number; -}} - /** A server has high disk usage. */ - | { type: "ServerDisk", data: { - /** The id of the server */ - id: string; - /** The name of the server */ - name: string; - /** The region of the server */ - region?: string; - /** The mount path of the disk */ - path: string; - /** The used portion of the disk in GB */ - used_gb: number; - /** The total size of the disk in GB */ - total_gb: number; -}} - /** A container's state has changed unexpectedly. */ - | { type: "ContainerStateChange", data: { - /** The id of the deployment */ - id: string; - /** The name of the deployment */ - name: string; - /** The server id of server that the deployment is on */ - server_id: string; - /** The server name */ - server_name: string; - /** The previous container state */ - from: DeploymentState; - /** The current container state */ - to: DeploymentState; -}} - /** A stack's state has changed unexpectedly. */ - | { type: "StackStateChange", data: { - /** The id of the stack */ - id: string; - /** The name of the stack */ - name: string; - /** The server id of server that the stack is on */ - server_id: string; - /** The server name */ - server_name: string; - /** The previous stack state */ - from: StackState; - /** The current stack state */ - to: StackState; -}} - /** An AWS builder failed to terminate. */ - | { type: "AwsBuilderTerminationFailed", data: { - /** The id of the aws instance which failed to terminate */ - instance_id: string; - /** A reason for the failure */ - message: string; -}} - /** A resource sync has pending updates */ - | { type: "ResourceSyncPendingUpdates", data: { - /** The id of the resource sync */ - id: string; - /** The name of the resource sync */ - name: string; -}} - /** A build has failed */ - | { type: "BuildFailed", data: { - /** The id of the build */ - id: string; - /** The name of the build */ - name: string; - /** The version that failed to build */ - version: Version; -}} - /** A repo has failed */ - | { type: "RepoBuildFailed", data: { - /** The id of the repo */ - id: string; - /** The name of the repo */ - name: string; -}}; - -/** Representation of an alert in the system. */ -export interface Alert { - /** - * The Mongo ID of the alert. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of serialized Alert) }` - */ - _id?: MongoId; - /** Unix timestamp in milliseconds the alert was opened */ - ts: I64; - /** Whether the alert is already resolved */ - resolved: boolean; - /** The severity of the alert */ - level: SeverityLevel; - /** The target of the alert */ - target: ResourceTarget; - /** The data attached to the alert */ - data: AlertData; - /** The timestamp of alert resolution */ - resolved_ts?: I64; -} - -export type GetAlertResponse = Alert; - export interface Resource { /** * The Mongo ID of the resource. @@ -287,6 +51,72 @@ export interface Resource { base_permission?: PermissionLevel; } +export interface ActionConfig { + /** Typescript file contents using pre-initialized `komodo` client. */ + file_contents?: string; +} + +export interface ActionInfo { + /** When action was last run */ + last_run_at?: I64; +} + +export type Action = Resource; + +export interface ResourceListItem { + /** The resource id */ + id: string; + /** The resource type, ie `Server` or `Deployment` */ + type: ResourceTarget["type"]; + /** The resource name */ + name: string; + /** Tag Ids */ + tags: string[]; + /** Resource specific info */ + info: Info; +} + +export enum ActionState { + /** Unknown case */ + Unknown = "Unknown", + /** Last clone / pull successful (or never cloned) */ + Ok = "Ok", + /** Last clone / pull failed */ + Failed = "Failed", + /** Currently running */ + Running = "Running", +} + +export interface ActionListItemInfo { + /** Action last run timestamp in ms. */ + last_run_at: I64; + /** Whether last action run successful */ + state: ActionState; +} + +export type ActionListItem = ResourceListItem; + +export enum TagBehavior { + /** Returns resources which have strictly all the tags */ + All = "All", + /** Returns resources which have one or more of the tags */ + Any = "Any", +} + +/** Passing empty Vec is the same as not filtering by that field */ +export interface ResourceQuery { + names?: string[]; + /** Pass Vec of tag ids or tag names */ + tags?: string[]; + tag_behavior?: TagBehavior; + specific?: T; +} + +export interface ActionQuerySpecifics { +} + +export type ActionQuery = ResourceQuery; + export type AlerterEndpoint = /** Send alert serialized to JSON to an http endpoint. */ | { type: "Custom", params: CustomAlerterEndpoint } @@ -295,6 +125,21 @@ export type AlerterEndpoint = /** Send alert to a Discord app */ | { type: "Discord", params: DiscordAlerterEndpoint }; +/** Used to reference a specific resource across all resource types */ +export type ResourceTarget = + | { type: "System", id: string } + | { type: "Server", id: string } + | { type: "Stack", id: string } + | { type: "Deployment", id: string } + | { type: "Build", id: string } + | { type: "Repo", id: string } + | { type: "Procedure", id: string } + | { type: "Action", id: string } + | { type: "Builder", id: string } + | { type: "Alerter", id: string } + | { type: "ServerTemplate", id: string } + | { type: "ResourceSync", id: string }; + export interface AlerterConfig { /** Whether the alerter is enabled */ enabled?: boolean; @@ -320,21 +165,6 @@ export interface AlerterConfig { export type Alerter = Resource; -export type GetAlerterResponse = Alerter; - -export interface ResourceListItem { - /** The resource id */ - id: string; - /** The resource type, ie `Server` or `Deployment` */ - type: ResourceTarget["type"]; - /** The resource name */ - name: string; - /** Tag Ids */ - tags: string[]; - /** Resource specific info */ - info: Info; -} - export interface AlerterListItemInfo { /** Whether alerter is enabled for sending alerts */ enabled: boolean; @@ -344,9 +174,22 @@ export interface AlerterListItemInfo { export type AlerterListItem = ResourceListItem; -export type ListAlertersResponse = AlerterListItem[]; +export interface AlerterQuerySpecifics { + /** + * Filter alerters by enabled. + * - `None`: Don't filter by enabled + * - `Some(true)`: Only include alerts with `enabled: true` + * - `Some(false)`: Only include alerts with `enabled: false` + */ + enabled?: boolean; + /** + * Only include alerters with these endpoint types. + * If empty, don't filter by enpoint type. + */ + types: AlerterEndpoint["type"][]; +} -export type ListFullAlertersResponse = Alerter[]; +export type AlerterQuery = ResourceQuery; export interface Version { major: number; @@ -490,8 +333,6 @@ export interface BuildInfo { export type Build = Resource; -export type GetBuildResponse = Build; - export enum BuildState { /** Last build successful (or never built) */ Ok = "Ok", @@ -528,24 +369,17 @@ export interface BuildListItemInfo { export type BuildListItem = ResourceListItem; -export type ListBuildsResponse = BuildListItem[]; - -export type ListFullBuildsResponse = Build[]; - -export interface BuildActionState { - building: boolean; +export interface BuildQuerySpecifics { + builder_ids?: string[]; + repos?: string[]; + /** + * query for builds last built more recently than this timestamp + * defaults to 0 which is a no op + */ + built_since?: I64; } -export type GetBuildActionStateResponse = BuildActionState; - -export interface BuildVersionResponseItem { - version: Version; - ts: I64; -} - -export type ListBuildVersionsResponse = BuildVersionResponseItem[]; - -export type ListCommonBuildExtraArgsResponse = string[]; +export type BuildQuery = ResourceQuery; export type BuilderConfig = /** Use a connected server an image builder. */ @@ -555,8 +389,6 @@ export type BuilderConfig = export type Builder = Resource; -export type GetBuilderResponse = Builder; - export interface BuilderListItemInfo { /** 'Server' or 'Aws' */ builder_type: string; @@ -569,9 +401,307 @@ export interface BuilderListItemInfo { export type BuilderListItem = ResourceListItem; -export type ListBuildersResponse = BuilderListItem[]; +export interface BuilderQuerySpecifics { +} -export type ListFullBuildersResponse = Builder[]; +export type BuilderQuery = ResourceQuery; + +/** A wrapper for all Komodo exections. */ +export type Execution = + /** The "null" execution. Does nothing. */ + | { type: "None", params: NoData } + | { type: "RunAction", params: RunAction } + | { type: "RunProcedure", params: RunProcedure } + | { type: "RunBuild", params: RunBuild } + | { type: "CancelBuild", params: CancelBuild } + | { type: "Deploy", params: Deploy } + | { type: "StartDeployment", params: StartDeployment } + | { type: "RestartDeployment", params: RestartDeployment } + | { type: "PauseDeployment", params: PauseDeployment } + | { type: "UnpauseDeployment", params: UnpauseDeployment } + | { type: "StopDeployment", params: StopDeployment } + | { type: "DestroyDeployment", params: DestroyDeployment } + | { type: "CloneRepo", params: CloneRepo } + | { type: "PullRepo", params: PullRepo } + | { type: "BuildRepo", params: BuildRepo } + | { type: "CancelRepoBuild", params: CancelRepoBuild } + | { type: "StartContainer", params: StartContainer } + | { type: "RestartContainer", params: RestartContainer } + | { type: "PauseContainer", params: PauseContainer } + | { type: "UnpauseContainer", params: UnpauseContainer } + | { type: "StopContainer", params: StopContainer } + | { type: "DestroyContainer", params: DestroyContainer } + | { type: "StartAllContainers", params: StartAllContainers } + | { type: "RestartAllContainers", params: RestartAllContainers } + | { type: "PauseAllContainers", params: PauseAllContainers } + | { type: "UnpauseAllContainers", params: UnpauseAllContainers } + | { type: "StopAllContainers", params: StopAllContainers } + | { type: "PruneContainers", params: PruneContainers } + | { type: "DeleteNetwork", params: DeleteNetwork } + | { type: "PruneNetworks", params: PruneNetworks } + | { type: "DeleteImage", params: DeleteImage } + | { type: "PruneImages", params: PruneImages } + | { type: "DeleteVolume", params: DeleteVolume } + | { type: "PruneVolumes", params: PruneVolumes } + | { type: "PruneDockerBuilders", params: PruneDockerBuilders } + | { type: "PruneBuildx", params: PruneBuildx } + | { type: "PruneSystem", params: PruneSystem } + | { type: "RunSync", params: RunSync } + | { type: "CommitSync", params: CommitSync } + | { type: "DeployStack", params: DeployStack } + | { type: "DeployStackIfChanged", params: DeployStackIfChanged } + | { type: "StartStack", params: StartStack } + | { type: "RestartStack", params: RestartStack } + | { type: "PauseStack", params: PauseStack } + | { type: "UnpauseStack", params: UnpauseStack } + | { type: "StopStack", params: StopStack } + | { type: "DestroyStack", params: DestroyStack } + | { type: "Sleep", params: Sleep }; + +/** Allows to enable / disabled procedures in the sequence / parallel vec on the fly */ +export interface EnabledExecution { + /** The execution request to run. */ + execution: Execution; + /** Whether the execution is enabled to run in the procedure. */ + enabled: boolean; +} + +/** A single stage of a procedure. Runs a list of executions in parallel. */ +export interface ProcedureStage { + /** A name for the procedure */ + name: string; + /** Whether the stage should be run as part of the procedure. */ + enabled: boolean; + /** The executions in the stage */ + executions?: EnabledExecution[]; +} + +/** Config for the [Procedure] */ +export interface ProcedureConfig { + /** The stages to be run by the procedure. */ + stages?: ProcedureStage[]; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this procedure. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; +} + +/** + * Procedures run a series of stages sequentially, where + * each stage runs executions in parallel. + */ +export type Procedure = Resource; + +export type CopyProcedureResponse = Procedure; + +/** Represents an empty json object: `{}` */ +export interface NoData { +} + +export type CreateActionWebhookResponse = NoData; + +/** Response for [CreateApiKey]. */ +export interface CreateApiKeyResponse { + /** X-API-KEY */ + key: string; + /** + * X-API-SECRET + * + * Note. + * There is no way to get the secret again after it is distributed in this message + */ + secret: string; +} + +export type CreateApiKeyForServiceUserResponse = CreateApiKeyResponse; + +export type CreateBuildWebhookResponse = NoData; + +/** Configuration to access private image repositories on various registries. */ +export interface DockerRegistryAccount { + /** + * The Mongo ID of the docker registry account. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of DockerRegistryAccount) }` + */ + _id?: MongoId; + /** + * The domain of the provider. + * + * For docker registry, this can include 'http://...', + * however this is not recommended and won't work unless "insecure registries" are enabled + * on your hosts. See [https://docs.docker.com/reference/cli/dockerd/#insecure-registries]. + */ + domain: string; + /** The account username */ + username?: string; + /** + * The token in plain text on the db. + * If the database / host can be accessed this is insecure. + */ + token?: string; +} + +export type CreateDockerRegistryAccountResponse = DockerRegistryAccount; + +/** + * Configuration to access private git repos from various git providers. + * Note. Cannot create two accounts with the same domain and username. + */ +export interface GitProviderAccount { + /** + * The Mongo ID of the git provider account. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized User) }` + */ + _id?: MongoId; + /** + * The domain of the provider. + * + * For git, this cannot include the protocol eg 'http://', + * which is controlled with 'https' field. + */ + domain: string; + /** Whether git provider is accessed over http or https. */ + https: boolean; + /** The account username */ + username?: string; + /** + * The token in plain text on the db. + * If the database / host can be accessed this is insecure. + */ + token?: string; +} + +export type CreateGitProviderAccountResponse = GitProviderAccount; + +/** JSON containing an authentication token. */ +export interface JwtResponse { + /** A token the user can use to authenticate their requests. */ + jwt: string; +} + +/** Response for [CreateLocalUser]. */ +export type CreateLocalUserResponse = JwtResponse; + +export type CreateProcedureResponse = Procedure; + +export type CreateRepoWebhookResponse = NoData; + +export type UserConfig = + /** User that logs in with username / password */ + | { type: "Local", data: { + password: string; +}} + /** User that logs in via Google Oauth */ + | { type: "Google", data: { + google_id: string; + avatar: string; +}} + /** User that logs in via Github Oauth */ + | { type: "Github", data: { + github_id: string; + avatar: string; +}} + /** User that logs in via Oidc provider */ + | { type: "Oidc", data: { + provider: string; + user_id: string; +}} + /** Non-human managed user, can have it's own permissions / api keys */ + | { type: "Service", data: { + description: string; +}}; + +export interface User { + /** + * The Mongo ID of the User. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of User schema) }` + */ + _id?: MongoId; + /** The globally unique username for the user. */ + username: string; + /** Whether user is enabled / able to access the api. */ + enabled?: boolean; + /** Can give / take other users admin priviledges. */ + super_admin?: boolean; + /** Whether the user has global admin permissions. */ + admin?: boolean; + /** Whether the user has permission to create servers. */ + create_server_permissions?: boolean; + /** Whether the user has permission to create builds */ + create_build_permissions?: boolean; + /** The user-type specific config. */ + config: UserConfig; + /** When the user last opened updates dropdown. */ + last_update_view?: I64; + /** Recently viewed ids */ + recents?: Record; + /** Give the user elevated permissions on all resources of a certain type */ + all?: Record; + updated_at?: I64; +} + +export type CreateServiceUserResponse = User; + +export type CreateStackWebhookResponse = NoData; + +export type CreateSyncWebhookResponse = NoData; + +/** + * A non-secret global variable which can be interpolated into deployment + * environment variable values and build argument values. + */ +export interface Variable { + /** + * Unique name associated with the variable. + * Instances of '[[variable.name]]' in value will be replaced with 'variable.value'. + */ + name: string; + /** A description for the variable. */ + description?: string; + /** The value associated with the variable. */ + value?: string; + /** + * If marked as secret, the variable value will be hidden in updates / logs. + * Additionally the value will not be served in read requests by non admin users. + * + * Note that the value is NOT encrypted in the database, and will likely show up in database logs. + * The security of these variables comes down to the security + * of the database (system level encryption, network isolation, etc.) + */ + is_secret?: boolean; +} + +export type CreateVariableResponse = Variable; + +export type DeleteActionWebhookResponse = NoData; + +export type DeleteApiKeyForServiceUserResponse = NoData; + +export type DeleteApiKeyResponse = NoData; + +export type DeleteBuildWebhookResponse = NoData; + +export type DeleteDockerRegistryAccountResponse = DockerRegistryAccount; + +export type DeleteGitProviderAccountResponse = GitProviderAccount; + +export type DeleteProcedureResponse = Procedure; + +export type DeleteRepoWebhookResponse = NoData; + +export type DeleteStackWebhookResponse = NoData; + +export type DeleteSyncWebhookResponse = NoData; + +export type DeleteUserResponse = User; + +export type DeleteVariableResponse = Variable; export type DeploymentImage = /** Deploy any external image. */ @@ -676,8 +806,6 @@ export interface DeploymentConfig { export type Deployment = Resource; -export type GetDeploymentResponse = Deployment; - /** * Variants de/serialized from/to snake_case. * @@ -713,9 +841,197 @@ export interface DeploymentListItemInfo { export type DeploymentListItem = ResourceListItem; -export type ListDeploymentsResponse = DeploymentListItem[]; +export interface DeploymentQuerySpecifics { + server_ids?: string[]; + build_ids?: string[]; +} -export type ListFullDeploymentsResponse = Deployment[]; +export type DeploymentQuery = ResourceQuery; + +/** Response for [ExchangeForJwt]. */ +export type ExchangeForJwtResponse = JwtResponse; + +/** Response containing pretty formatted toml contents. */ +export interface TomlResponse { + toml: string; +} + +export type ExportAllResourcesToTomlResponse = TomlResponse; + +export type ExportResourcesToTomlResponse = TomlResponse; + +export type FindUserResponse = User; + +export interface ActionActionState { + /** Whether the action is currently running. */ + running: boolean; +} + +export type GetActionActionStateResponse = ActionActionState; + +export type GetActionResponse = Action; + +/** Severity level of problem. */ +export enum SeverityLevel { + /** No problem. */ + Ok = "OK", + /** Problem is imminent. */ + Warning = "WARNING", + /** Problem fully realized. */ + Critical = "CRITICAL", +} + +/** The variants of data related to the alert. */ +export type AlertData = + /** A null alert */ + | { type: "None", data: { +}} + /** A server could not be reached. */ + | { type: "ServerUnreachable", data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The error data */ + err?: _Serror; +}} + /** A server has high CPU usage. */ + | { type: "ServerCpu", data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The cpu usage percentage */ + percentage: number; +}} + /** A server has high memory usage. */ + | { type: "ServerMem", data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The used memory */ + used_gb: number; + /** The total memory */ + total_gb: number; +}} + /** A server has high disk usage. */ + | { type: "ServerDisk", data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The mount path of the disk */ + path: string; + /** The used portion of the disk in GB */ + used_gb: number; + /** The total size of the disk in GB */ + total_gb: number; +}} + /** A container's state has changed unexpectedly. */ + | { type: "ContainerStateChange", data: { + /** The id of the deployment */ + id: string; + /** The name of the deployment */ + name: string; + /** The server id of server that the deployment is on */ + server_id: string; + /** The server name */ + server_name: string; + /** The previous container state */ + from: DeploymentState; + /** The current container state */ + to: DeploymentState; +}} + /** A stack's state has changed unexpectedly. */ + | { type: "StackStateChange", data: { + /** The id of the stack */ + id: string; + /** The name of the stack */ + name: string; + /** The server id of server that the stack is on */ + server_id: string; + /** The server name */ + server_name: string; + /** The previous stack state */ + from: StackState; + /** The current stack state */ + to: StackState; +}} + /** An AWS builder failed to terminate. */ + | { type: "AwsBuilderTerminationFailed", data: { + /** The id of the aws instance which failed to terminate */ + instance_id: string; + /** A reason for the failure */ + message: string; +}} + /** A resource sync has pending updates */ + | { type: "ResourceSyncPendingUpdates", data: { + /** The id of the resource sync */ + id: string; + /** The name of the resource sync */ + name: string; +}} + /** A build has failed */ + | { type: "BuildFailed", data: { + /** The id of the build */ + id: string; + /** The name of the build */ + name: string; + /** The version that failed to build */ + version: Version; +}} + /** A repo has failed */ + | { type: "RepoBuildFailed", data: { + /** The id of the repo */ + id: string; + /** The name of the repo */ + name: string; +}}; + +/** Representation of an alert in the system. */ +export interface Alert { + /** + * The Mongo ID of the alert. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Alert) }` + */ + _id?: MongoId; + /** Unix timestamp in milliseconds the alert was opened */ + ts: I64; + /** Whether the alert is already resolved */ + resolved: boolean; + /** The severity of the alert */ + level: SeverityLevel; + /** The target of the alert */ + target: ResourceTarget; + /** The data attached to the alert */ + data: AlertData; + /** The timestamp of alert resolution */ + resolved_ts?: I64; +} + +export type GetAlertResponse = Alert; + +export type GetAlerterResponse = Alerter; + +export interface BuildActionState { + building: boolean; +} + +export type GetBuildActionStateResponse = BuildActionState; + +export type GetBuildResponse = Build; + +export type GetBuilderResponse = Builder; /** Represents the output of some command being run */ export interface Log { @@ -735,21 +1051,7 @@ export interface Log { end_ts: I64; } -export type GetDeploymentLogResponse = Log; - -export type SearchDeploymentLogResponse = Log; - -export interface ContainerStats { - name: string; - cpu_perc: string; - mem_perc: string; - mem_usage: string; - net_io: string; - block_io: string; - pids: string; -} - -export type GetDeploymentStatsResponse = ContainerStats; +export type GetContainerLogResponse = Log; export interface DeploymentActionState { deploying: boolean; @@ -764,247 +1066,46 @@ export interface DeploymentActionState { export type GetDeploymentActionStateResponse = DeploymentActionState; -export type ListCommonDeploymentExtraArgsResponse = string[]; +export type GetDeploymentLogResponse = Log; -export interface ProviderAccount { - /** The account username. Required. */ - username: string; - /** The account access token. Required. */ - token?: string; +export type GetDeploymentResponse = Deployment; + +export interface ContainerStats { + name: string; + cpu_perc: string; + mem_perc: string; + mem_usage: string; + net_io: string; + block_io: string; + pids: string; } -export interface GitProvider { - /** The git provider domain. Default: `github.com`. */ - domain: string; - /** Whether to use https. Default: true. */ - https: boolean; - /** The account username. Required. */ - accounts: ProviderAccount[]; -} +export type GetDeploymentStatsResponse = ContainerStats; -export type ListGitProvidersFromConfigResponse = GitProvider[]; +export type GetDockerRegistryAccountResponse = DockerRegistryAccount; -export interface DockerRegistry { - /** The docker provider domain. Default: `docker.io`. */ - domain: string; - /** The account username. Required. */ - accounts?: ProviderAccount[]; - /** - * Available organizations on the registry provider. - * Used to push an image under an organization's repo rather than an account's repo. - */ - organizations?: string[]; -} - -export type ListDockerRegistriesFromConfigResponse = DockerRegistry[]; - -export type ListSecretsResponse = string[]; - -export type UserTarget = - /** User Id */ - | { type: "User", id: string } - /** UserGroup Id */ - | { type: "UserGroup", id: string }; - -/** Representation of a User or UserGroups permission on a resource. */ -export interface Permission { - /** The id of the permission document */ - _id?: MongoId; - /** The target User / UserGroup */ - user_target: UserTarget; - /** The target resource */ - resource_target: ResourceTarget; - /** The permission level */ - level?: PermissionLevel; -} - -export type ListPermissionsResponse = Permission[]; +export type GetGitProviderAccountResponse = GitProviderAccount; export type GetPermissionLevelResponse = PermissionLevel; -export type ListUserTargetPermissionsResponse = Permission[]; - -/** A wrapper for all Komodo exections. */ -export type Execution = - /** The "null" execution. Does nothing. */ - | { type: "None", params: NoData } - | { type: "RunProcedure", params: RunProcedure } - | { type: "RunBuild", params: RunBuild } - | { type: "CancelBuild", params: CancelBuild } - | { type: "Deploy", params: Deploy } - | { type: "StartDeployment", params: StartDeployment } - | { type: "RestartDeployment", params: RestartDeployment } - | { type: "PauseDeployment", params: PauseDeployment } - | { type: "UnpauseDeployment", params: UnpauseDeployment } - | { type: "StopDeployment", params: StopDeployment } - | { type: "DestroyDeployment", params: DestroyDeployment } - | { type: "CloneRepo", params: CloneRepo } - | { type: "PullRepo", params: PullRepo } - | { type: "BuildRepo", params: BuildRepo } - | { type: "CancelRepoBuild", params: CancelRepoBuild } - | { type: "StartContainer", params: StartContainer } - | { type: "RestartContainer", params: RestartContainer } - | { type: "PauseContainer", params: PauseContainer } - | { type: "UnpauseContainer", params: UnpauseContainer } - | { type: "StopContainer", params: StopContainer } - | { type: "DestroyContainer", params: DestroyContainer } - | { type: "StartAllContainers", params: StartAllContainers } - | { type: "RestartAllContainers", params: RestartAllContainers } - | { type: "PauseAllContainers", params: PauseAllContainers } - | { type: "UnpauseAllContainers", params: UnpauseAllContainers } - | { type: "StopAllContainers", params: StopAllContainers } - | { type: "PruneContainers", params: PruneContainers } - | { type: "DeleteNetwork", params: DeleteNetwork } - | { type: "PruneNetworks", params: PruneNetworks } - | { type: "DeleteImage", params: DeleteImage } - | { type: "PruneImages", params: PruneImages } - | { type: "DeleteVolume", params: DeleteVolume } - | { type: "PruneVolumes", params: PruneVolumes } - | { type: "PruneDockerBuilders", params: PruneDockerBuilders } - | { type: "PruneBuildx", params: PruneBuildx } - | { type: "PruneSystem", params: PruneSystem } - | { type: "RunSync", params: RunSync } - | { type: "CommitSync", params: CommitSync } - | { type: "DeployStack", params: DeployStack } - | { type: "DeployStackIfChanged", params: DeployStackIfChanged } - | { type: "StartStack", params: StartStack } - | { type: "RestartStack", params: RestartStack } - | { type: "PauseStack", params: PauseStack } - | { type: "UnpauseStack", params: UnpauseStack } - | { type: "StopStack", params: StopStack } - | { type: "DestroyStack", params: DestroyStack } - | { type: "Sleep", params: Sleep }; - -/** Allows to enable / disabled procedures in the sequence / parallel vec on the fly */ -export interface EnabledExecution { - /** The execution request to run. */ - execution: Execution; - /** Whether the execution is enabled to run in the procedure. */ - enabled: boolean; -} - -/** A single stage of a procedure. Runs a list of executions in parallel. */ -export interface ProcedureStage { - /** A name for the procedure */ - name: string; - /** Whether the stage should be run as part of the procedure. */ - enabled: boolean; - /** The executions in the stage */ - executions?: EnabledExecution[]; -} - -/** Config for the [Procedure] */ -export interface ProcedureConfig { - /** The stages to be run by the procedure. */ - stages?: ProcedureStage[]; - /** Whether incoming webhooks actually trigger action. */ - webhook_enabled: boolean; - /** - * Optionally provide an alternate webhook secret for this procedure. - * If its an empty string, use the default secret from the config. - */ - webhook_secret?: string; -} - -/** - * Procedures run a series of stages sequentially, where - * each stage runs executions in parallel. - */ -export type Procedure = Resource; - -export type GetProcedureResponse = Procedure; - -export enum ProcedureState { - /** Last run successful */ - Ok = "Ok", - /** Last run failed */ - Failed = "Failed", - /** Currently running */ - Running = "Running", - /** Other case (never run) */ - Unknown = "Unknown", -} - -export interface ProcedureListItemInfo { - /** Number of stages procedure has. */ - stages: I64; - /** Reflect whether last run successful / currently running. */ - state: ProcedureState; -} - -export type ProcedureListItem = ResourceListItem; - -export type ListProceduresResponse = ProcedureListItem[]; - -export type ListFullProceduresResponse = Procedure[]; - export interface ProcedureActionState { running: boolean; } export type GetProcedureActionStateResponse = ProcedureActionState; -/** - * Configuration to access private git repos from various git providers. - * Note. Cannot create two accounts with the same domain and username. - */ -export interface GitProviderAccount { - /** - * The Mongo ID of the git provider account. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of serialized User) }` - */ - _id?: MongoId; - /** - * The domain of the provider. - * - * For git, this cannot include the protocol eg 'http://', - * which is controlled with 'https' field. - */ - domain: string; - /** Whether git provider is accessed over http or https. */ - https: boolean; - /** The account username */ - username?: string; - /** - * The token in plain text on the db. - * If the database / host can be accessed this is insecure. - */ - token?: string; +export type GetProcedureResponse = Procedure; + +export interface RepoActionState { + /** Whether repo currently cloning */ + cloning: boolean; + /** Whether repo currently pulling */ + pulling: boolean; + /** Whether repo currently building, using the attached builder. */ + building: boolean; } -export type GetGitProviderAccountResponse = GitProviderAccount; - -export type ListGitProviderAccountsResponse = GitProviderAccount[]; - -/** Configuration to access private image repositories on various registries. */ -export interface DockerRegistryAccount { - /** - * The Mongo ID of the docker registry account. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of DockerRegistryAccount) }` - */ - _id?: MongoId; - /** - * The domain of the provider. - * - * For docker registry, this can include 'http://...', - * however this is not recommended and won't work unless "insecure registries" are enabled - * on your hosts. See [https://docs.docker.com/reference/cli/dockerd/#insecure-registries]. - */ - domain: string; - /** The account username */ - username?: string; - /** - * The token in plain text on the db. - * If the database / host can be accessed this is insecure. - */ - token?: string; -} - -export type GetDockerRegistryAccountResponse = DockerRegistryAccount; - -export type ListDockerRegistryAccountsResponse = DockerRegistryAccount[]; +export type GetRepoActionStateResponse = RepoActionState; export interface RepoConfig { /** The server to clone the repo on. */ @@ -1091,64 +1192,184 @@ export type Repo = Resource; export type GetRepoResponse = Repo; -export enum RepoState { - /** Unknown case */ - Unknown = "Unknown", - /** Last clone / pull successful (or never cloned) */ - Ok = "Ok", - /** Last clone / pull failed */ - Failed = "Failed", - /** Currently cloning */ - Cloning = "Cloning", - /** Currently pulling */ - Pulling = "Pulling", - /** Currently building */ - Building = "Building", +export interface ResourceSyncActionState { + /** Whether sync currently syncing */ + syncing: boolean; } -export interface RepoListItemInfo { - /** The server that repo sits on. */ - server_id: string; - /** The builder that builds the repo. */ - builder_id: string; - /** Repo last cloned / pulled timestamp in ms. */ - last_pulled_at: I64; - /** Repo last built timestamp in ms. */ - last_built_at: I64; - /** The git provider domain */ +export type GetResourceSyncActionStateResponse = ResourceSyncActionState; + +/** The sync configuration. */ +export interface ResourceSyncConfig { + /** The git provider domain. Default: github.com */ git_provider: string; - /** The configured repo */ - repo: string; - /** The configured branch */ + /** + * Whether to use https to clone the repo (versus http). Default: true + * + * Note. Komodo does not currently support cloning repos via ssh. + */ + git_https: boolean; + /** The Github repo used as the source of the build. */ + repo?: string; + /** The branch of the repo. */ branch: string; - /** The repo state */ - state: RepoState; - /** If the repo is cloned, will be the cloned short commit hash. */ - cloned_hash?: string; - /** If the repo is cloned, will be the cloned commit message. */ - cloned_message?: string; - /** If the repo is built, will be the latest built short commit hash. */ - built_hash?: string; - /** Will be the latest remote short commit hash. */ - latest_hash?: string; + /** Optionally set a specific commit hash. */ + commit?: string; + /** + * The git account used to access private repos. + * Passing empty string can only clone public repos. + * + * Note. A token for the account must be available in the core config or the builder server's periphery config + * for the configured git provider. + */ + git_account?: string; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this sync. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; + /** + * Files are available on the Komodo Core host. + * Specify the file / folder with [ResourceSyncConfig::resource_path]. + */ + files_on_host?: boolean; + /** + * The path of the resource file(s) to sync. + * - If Files on Host, this is relative to the configured `sync_directory` in core config. + * - If Git Repo based, this is relative to the root of the repo. + * Can be a specific file, or a directory containing multiple files / folders. + * See [https://komo.do/docs/sync-resources](https://komo.do/docs/sync-resources) for more information. + */ + resource_path?: string[]; + /** + * Enable "pushes" to the file, + * which exports resources matching tags to single file. + * - If using `files_on_host`, it is stored in the file_contents, which must point to a .toml file path (it will be created if it doesn't exist). + * - If using `file_contents`, it is stored in the database. + * When using this, "delete" mode is always enabled. + */ + managed?: boolean; + /** + * Whether sync should delete resources + * not declared in the resource files + */ + delete?: boolean; + /** + * When using `managed` resource sync, will only export resources + * matching all of the given tags. If none, will match all resources. + */ + match_tags?: string[]; + /** Manage the file contents in the UI. */ + file_contents?: string; } -export type RepoListItem = ResourceListItem; +export type DiffData = + /** Resource will be created */ + | { type: "Create", data: { + /** The name of resource to create */ + name?: string; + /** The proposed resource to create in TOML */ + proposed: string; +}} + | { type: "Update", data: { + /** The proposed TOML */ + proposed: string; + /** The current TOML */ + current: string; +}} + | { type: "Delete", data: { + /** The current TOML of the resource to delete */ + current: string; +}}; -export type ListReposResponse = RepoListItem[]; - -export type ListFullReposResponse = Repo[]; - -export interface RepoActionState { - /** Whether repo currently cloning */ - cloning: boolean; - /** Whether repo currently pulling */ - pulling: boolean; - /** Whether repo currently building, using the attached builder. */ - building: boolean; +export interface ResourceDiff { + /** + * The resource target. + * The target id will be empty if "Create" ResourceDiffType. + */ + target: ResourceTarget; + /** The data associated with the diff. */ + data: DiffData; } -export type GetRepoActionStateResponse = RepoActionState; +export interface SyncDeployUpdate { + /** Resources to deploy */ + to_deploy: number; + /** A readable log of all the changes to be applied */ + log: string; +} + +export interface SyncFileContents { + /** The base resource path. */ + resource_path?: string; + /** The path of the file / error path relative to the resource path. */ + path: string; + /** The contents of the file */ + contents: string; +} + +export interface ResourceSyncInfo { + /** Unix timestamp of last applied sync */ + last_sync_ts?: I64; + /** Short commit hash of last applied sync */ + last_sync_hash?: string; + /** Commit message of last applied sync */ + last_sync_message?: string; + /** The list of pending updates to resources */ + resource_updates?: ResourceDiff[]; + /** The list of pending updates to variables */ + variable_updates?: DiffData[]; + /** The list of pending updates to user groups */ + user_group_updates?: DiffData[]; + /** The list of pending deploys to resources. */ + pending_deploy?: SyncDeployUpdate; + /** If there is an error, it will be stored here */ + pending_error?: string; + /** The commit hash which produced these pending updates. */ + pending_hash?: string; + /** The commit message which produced these pending updates. */ + pending_message?: string; + /** The current sync files */ + remote_contents?: SyncFileContents[]; + /** Any read errors in files by path */ + remote_errors?: SyncFileContents[]; +} + +export type ResourceSync = Resource; + +export type GetResourceSyncResponse = ResourceSync; + +/** Current pending actions on the server. */ +export interface ServerActionState { + /** Server currently pruning networks */ + pruning_networks: boolean; + /** Server currently pruning containers */ + pruning_containers: boolean; + /** Server currently pruning images */ + pruning_images: boolean; + /** Server currently pruning volumes */ + pruning_volumes: boolean; + /** Server currently pruning docker builders */ + pruning_builders: boolean; + /** Server currently pruning builx cache */ + pruning_buildx: boolean; + /** Server currently pruning system */ + pruning_system: boolean; + /** Server currently starting containers. */ + starting_containers: boolean; + /** Server currently restarting containers. */ + restarting_containers: boolean; + /** Server currently pausing containers. */ + pausing_containers: boolean; + /** Server currently unpausing containers. */ + unpausing_containers: boolean; + /** Server currently stopping containers. */ + stopping_containers: boolean; +} + +export type GetServerActionStateResponse = ServerActionState; /** Server configuration. */ export interface ServerConfig { @@ -1209,284 +1430,526 @@ export type Server = Resource; export type GetServerResponse = Server; -export enum ServerState { - /** Server is unreachable. */ - NotOk = "NotOk", - /** Server health check passing. */ - Ok = "Ok", - /** Server is disabled. */ - Disabled = "Disabled", +export type ServerTemplateConfig = + /** Template to launch an AWS EC2 instance */ + | { type: "Aws", params: AwsServerTemplateConfig } + /** Template to launch a Hetzner server */ + | { type: "Hetzner", params: HetznerServerTemplateConfig }; + +export type ServerTemplate = Resource; + +export type GetServerTemplateResponse = ServerTemplate; + +export interface StackActionState { + deploying: boolean; + starting: boolean; + restarting: boolean; + pausing: boolean; + unpausing: boolean; + stopping: boolean; + destroying: boolean; } -export interface ServerListItemInfo { - /** The server's state. */ - state: ServerState; - /** Region of the server. */ - region: string; - /** Whether server is configured to send unreachable alerts. */ - send_unreachable_alerts: boolean; - /** Whether server is configured to send cpu alerts. */ - send_cpu_alerts: boolean; - /** Whether server is configured to send mem alerts. */ - send_mem_alerts: boolean; - /** Whether server is configured to send disk alerts. */ - send_disk_alerts: boolean; +export type GetStackActionStateResponse = StackActionState; + +/** The compose file configuration. */ +export interface StackConfig { + /** The server to deploy the stack on. */ + server_id?: string; + /** Configure quick links that are displayed in the resource header */ + links?: string[]; + /** + * Optionally specify a custom project name for the stack. + * If this is empty string, it will default to the stack name. + * Used with `docker compose -p {project_name}`. + * + * Note. Can be used to import pre-existing stacks. + */ + project_name?: string; + /** + * Whether to automatically `compose pull` before redeploying stack. + * Ensured latest images are deployed. + * Will fail if the compose file specifies a locally build image. + */ + auto_pull: boolean; + /** + * Whether to `docker compose build` before `compose down` / `compose up`. + * Combine with build_extra_args for custom behaviors. + */ + run_build?: boolean; + /** Whether to run `docker compose down` before `compose up`. */ + destroy_before_deploy?: boolean; + /** Whether to skip secret interpolation into the stack environment variables. */ + skip_secret_interp?: boolean; + /** + * If this is checked, the stack will source the files on the host. + * Use `run_directory` and `file_paths` to specify the path on the host. + * This is useful for those who wish to setup their files on the host using SSH or similar, + * rather than defining the contents in UI or in a git repo. + */ + files_on_host?: boolean; + /** Directory to change to (`cd`) before running `docker compose up -d`. */ + run_directory?: string; + /** + * Add paths to compose files, relative to the run path. + * If this is empty, will use file `compose.yaml`. + */ + file_paths?: string[]; + /** + * The name of the written environment file before `docker compose up`. + * Relative to the run directory root. + * Default: .env + */ + env_file_path: string; + /** + * Add additional env files to attach with `--env-file`. + * Relative to the run directory root. + */ + additional_env_files?: string[]; + /** The git provider domain. Default: github.com */ + git_provider: string; + /** + * Whether to use https to clone the repo (versus http). Default: true + * + * Note. Komodo does not currently support cloning repos via ssh. + */ + git_https: boolean; + /** + * The git account used to access private repos. + * Passing empty string can only clone public repos. + * + * Note. A token for the account must be available in the core config or the builder server's periphery config + * for the configured git provider. + */ + git_account?: string; + /** The Github repo used as the source of the build. */ + repo?: string; + /** The branch of the repo. */ + branch: string; + /** Optionally set a specific commit hash. */ + commit?: string; + /** + * By default, the Stack will `git pull` the repo after it is first cloned. + * If this option is enabled, the repo folder will be deleted and recloned instead. + */ + reclone?: boolean; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this stack. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; + /** + * By default, the Stack will `DeployStackIfChanged`. + * If this option is enabled, will always run `DeployStack` without diffing. + */ + webhook_force_deploy?: boolean; + /** Whether to send StackStateChange alerts for this stack. */ + send_alerts: boolean; + /** Used with `registry_account` to login to a registry before docker compose up. */ + registry_provider?: string; + /** Used with `registry_provider` to login to a registry before docker compose up. */ + registry_account?: string; + /** The optional command to run before the Stack is deployed. */ + pre_deploy?: SystemCommand; + /** + * The extra arguments to pass after `docker compose up -d`. + * If empty, no extra arguments will be passed. + */ + extra_args?: string[]; + /** + * The extra arguments to pass after `docker compose build`. + * If empty, no extra build arguments will be passed. + * Only used if `run_build: true` + */ + build_extra_args?: string[]; + /** + * Ignore certain services declared in the compose file when checking + * the stack status. For example, an init service might be exited, but the + * stack should be healthy. This init service should be in `ignore_services` + */ + ignore_services?: string[]; + /** + * The contents of the file directly, for management in the UI. + * If this is empty, it will fall back to checking git config for + * repo based compose file. + */ + file_contents?: string; + /** + * The environment variables passed to the compose file. + * They will be written to path defined in env_file_path, + * which is given relative to the run directory. + * + * If it is empty, no file will be written. + */ + environment?: string; } -export type ServerListItem = ResourceListItem; - -export type ListServersResponse = ServerListItem[]; - -export type ListFullServersResponse = Server[]; - -/** Current pending actions on the server. */ -export interface ServerActionState { - /** Server currently pruning networks */ - pruning_networks: boolean; - /** Server currently pruning containers */ - pruning_containers: boolean; - /** Server currently pruning images */ - pruning_images: boolean; - /** Server currently pruning volumes */ - pruning_volumes: boolean; - /** Server currently pruning docker builders */ - pruning_builders: boolean; - /** Server currently pruning builx cache */ - pruning_buildx: boolean; - /** Server currently pruning system */ - pruning_system: boolean; - /** Server currently starting containers. */ - starting_containers: boolean; - /** Server currently restarting containers. */ - restarting_containers: boolean; - /** Server currently pausing containers. */ - pausing_containers: boolean; - /** Server currently unpausing containers. */ - unpausing_containers: boolean; - /** Server currently stopping containers. */ - stopping_containers: boolean; +export interface FileContents { + /** The path of the file on the host */ + path: string; + /** The contents of the file */ + contents: string; } -export type GetServerActionStateResponse = ServerActionState; +export interface StackServiceNames { + /** The name of the service */ + service_name: string; + /** + * Will either be the declared container_name in the compose file, + * or a pattern to match auto named containers. + * + * Auto named containers are composed of three parts: + * + * 1. The name of the compose project (top level name field of compose file). + * This defaults to the name of the parent folder of the compose file. + * Komodo will always set it to be the name of the stack, but imported stacks + * will have a different name. + * 2. The service name + * 3. The replica number + * + * Example: stacko-mongo-1. + * + * This stores only 1. and 2., ie stacko-mongo. + * Containers will be matched via regex like `^container_name-?[0-9]*$`` + */ + container_name: string; +} -export interface NetworkListItem { +export interface StackInfo { + /** + * If any of the expected files are missing in the repo, + * they will be stored here. + */ + missing_files?: string[]; + /** + * The deployed project name. + * This is updated whenever Komodo successfully deploys the stack. + * If it is present, Komodo will use it for actions over other options, + * to ensure control is maintained after changing the project name (there is no rename compose project api). + */ + deployed_project_name?: string; + /** Deployed short commit hash, or null. Only for repo based stacks. */ + deployed_hash?: string; + /** Deployed commit message, or null. Only for repo based stacks */ + deployed_message?: string; + /** The deployed compose file contents. This is updated whenever Komodo successfully deploys the stack. */ + deployed_contents?: FileContents[]; + /** + * The deployed service names. + * This is updated whenever it is empty, or deployed contents is updated. + */ + deployed_services?: StackServiceNames[]; + /** + * The latest service names. + * This is updated whenever the stack cache refreshes, using the latest file contents (either db defined or remote). + */ + latest_services?: StackServiceNames[]; + /** + * The remote compose file contents, whether on host or in repo. + * This is updated whenever Komodo refreshes the stack cache. + * It will be empty if the file is defined directly in the stack config. + */ + remote_contents?: FileContents[]; + /** If there was an error in getting the remote contents, it will be here. */ + remote_errors?: FileContents[]; + /** Latest commit hash, or null */ + latest_hash?: string; + /** Latest commit message, or null */ + latest_message?: string; +} + +export type Stack = Resource; + +export type GetStackResponse = Stack; + +export type GetStackServiceLogResponse = Log; + +/** System information of a server */ +export interface SystemInformation { + /** The system name */ name?: string; - id?: string; - created?: string; - scope?: string; - driver?: string; - enable_ipv6?: boolean; - ipam_driver?: string; - ipam_subnet?: string; - ipam_gateway?: string; - internal?: boolean; - attachable?: boolean; - ingress?: boolean; - /** Whether the network is attached to one or more containers */ - in_use: boolean; + /** The system long os version */ + os?: string; + /** System's kernel version */ + kernel?: string; + /** Physical core count */ + core_count?: number; + /** System hostname based off DNS */ + host_name?: string; + /** The CPU's brand */ + cpu_brand: string; } -export type ListDockerNetworksResponse = NetworkListItem[]; +export type GetSystemInformationResponse = SystemInformation; -export interface IpamConfig { - Subnet?: string; - IPRange?: string; - Gateway?: string; - AuxiliaryAddresses: Record; +/** Info for a single disk mounted on the system. */ +export interface SingleDiskUsage { + /** The mount point of the disk */ + mount: string; + /** Detected file system */ + file_system: string; + /** Used portion of the disk in GB */ + used_gb: number; + /** Total size of the disk in GB */ + total_gb: number; } -export interface Ipam { - /** Name of the IPAM driver to use. */ - Driver?: string; - /** List of IPAM configuration options, specified as a map: ``` {\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": } ``` */ - Config: IpamConfig[]; - /** Driver-specific options, specified as a map. */ - Options: Record; +export enum Timelength { + OneSecond = "1-sec", + FiveSeconds = "5-sec", + TenSeconds = "10-sec", + FifteenSeconds = "15-sec", + ThirtySeconds = "30-sec", + OneMinute = "1-min", + TwoMinutes = "2-min", + FiveMinutes = "5-min", + TenMinutes = "10-min", + FifteenMinutes = "15-min", + ThirtyMinutes = "30-min", + OneHour = "1-hr", + TwoHours = "2-hr", + SixHours = "6-hr", + EightHours = "8-hr", + TwelveHours = "12-hr", + OneDay = "1-day", + ThreeDay = "3-day", + OneWeek = "1-wk", + TwoWeeks = "2-wk", + ThirtyDays = "30-day", } -export interface NetworkContainer { - /** This is the key on the incoming map of NetworkContainer */ - ContainerID?: string; - Name?: string; - EndpointID?: string; - MacAddress?: string; - IPv4Address?: string; - IPv6Address?: string; +/** Realtime system stats data. */ +export interface SystemStats { + /** Cpu usage percentage */ + cpu_perc: number; + /** + * [1.15.9+] + * Free memory in GB. + * This is really the 'Free' memory, not the 'Available' memory. + * It may be different than mem_total_gb - mem_used_gb. + */ + mem_free_gb?: number; + /** Used memory in GB. 'Total' - 'Available' (not free) memory. */ + mem_used_gb: number; + /** Total memory in GB */ + mem_total_gb: number; + /** Breakdown of individual disks, ie their usages, sizes, and mount points */ + disks: SingleDiskUsage[]; + /** The rate the system stats are being polled from the system */ + polling_rate: Timelength; + /** Unix timestamp in milliseconds when stats were last polled */ + refresh_ts: I64; + /** Unix timestamp in milliseconds when disk list was last refreshed */ + refresh_list_ts: I64; } -export interface Network { - Name?: string; - Id?: string; - Created?: string; - Scope?: string; - Driver?: string; - EnableIPv6?: boolean; - IPAM?: Ipam; - Internal?: boolean; - Attachable?: boolean; - Ingress?: boolean; - /** This field is turned from map into array for easier usability. */ - Containers: NetworkContainer[]; - Options?: Record; - Labels?: Record; -} +export type GetSystemStatsResponse = SystemStats; -export type InspectDockerNetworkResponse = Network; - -export interface ImageListItem { - /** The first tag in `repo_tags`, or Id if no tags. */ +export interface Tag { + /** + * The Mongo ID of the tag. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Tag) }` + */ + _id?: MongoId; name: string; - /** ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. */ - id: string; - /** ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. */ - parent_id: string; - /** Date and time at which the image was created as a Unix timestamp (number of seconds sinds EPOCH). */ - created: I64; - /** Total size of the image including all layers it is composed of. */ - size: I64; - /** Whether the image is in use by any container */ - in_use: boolean; + owner?: string; } -export type ListDockerImagesResponse = ImageListItem[]; +export type GetTagResponse = Tag; -/** A test to perform to check that the container is healthy. */ -export interface HealthConfig { - /** The test to perform. Possible values are: - `[]` inherit healthcheck from image or parent image - `[\"NONE\"]` disable healthcheck - `[\"CMD\", args...]` exec arguments directly - `[\"CMD-SHELL\", command]` run command with system's default shell */ - Test?: string[]; - /** The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ - Interval?: I64; - /** The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ - Timeout?: I64; - /** The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. */ - Retries?: I64; - /** Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ - StartPeriod?: I64; - /** The time to wait between checks in nanoseconds during the start period. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ - StartInterval?: I64; +export enum Operation { + None = "None", + CreateServer = "CreateServer", + UpdateServer = "UpdateServer", + DeleteServer = "DeleteServer", + RenameServer = "RenameServer", + StartContainer = "StartContainer", + RestartContainer = "RestartContainer", + PauseContainer = "PauseContainer", + UnpauseContainer = "UnpauseContainer", + StopContainer = "StopContainer", + DestroyContainer = "DestroyContainer", + StartAllContainers = "StartAllContainers", + RestartAllContainers = "RestartAllContainers", + PauseAllContainers = "PauseAllContainers", + UnpauseAllContainers = "UnpauseAllContainers", + StopAllContainers = "StopAllContainers", + PruneContainers = "PruneContainers", + CreateNetwork = "CreateNetwork", + DeleteNetwork = "DeleteNetwork", + PruneNetworks = "PruneNetworks", + DeleteImage = "DeleteImage", + PruneImages = "PruneImages", + DeleteVolume = "DeleteVolume", + PruneVolumes = "PruneVolumes", + PruneDockerBuilders = "PruneDockerBuilders", + PruneBuildx = "PruneBuildx", + PruneSystem = "PruneSystem", + CreateStack = "CreateStack", + UpdateStack = "UpdateStack", + RenameStack = "RenameStack", + DeleteStack = "DeleteStack", + WriteStackContents = "WriteStackContents", + RefreshStackCache = "RefreshStackCache", + DeployStack = "DeployStack", + StartStack = "StartStack", + RestartStack = "RestartStack", + PauseStack = "PauseStack", + UnpauseStack = "UnpauseStack", + StopStack = "StopStack", + DestroyStack = "DestroyStack", + StartStackService = "StartStackService", + RestartStackService = "RestartStackService", + PauseStackService = "PauseStackService", + UnpauseStackService = "UnpauseStackService", + StopStackService = "StopStackService", + CreateDeployment = "CreateDeployment", + UpdateDeployment = "UpdateDeployment", + DeleteDeployment = "DeleteDeployment", + Deploy = "Deploy", + StartDeployment = "StartDeployment", + RestartDeployment = "RestartDeployment", + PauseDeployment = "PauseDeployment", + UnpauseDeployment = "UnpauseDeployment", + StopDeployment = "StopDeployment", + DestroyDeployment = "DestroyDeployment", + RenameDeployment = "RenameDeployment", + CreateBuild = "CreateBuild", + UpdateBuild = "UpdateBuild", + DeleteBuild = "DeleteBuild", + RunBuild = "RunBuild", + CancelBuild = "CancelBuild", + CreateRepo = "CreateRepo", + UpdateRepo = "UpdateRepo", + DeleteRepo = "DeleteRepo", + CloneRepo = "CloneRepo", + PullRepo = "PullRepo", + BuildRepo = "BuildRepo", + CancelRepoBuild = "CancelRepoBuild", + CreateProcedure = "CreateProcedure", + UpdateProcedure = "UpdateProcedure", + DeleteProcedure = "DeleteProcedure", + RunProcedure = "RunProcedure", + CreateAction = "CreateAction", + UpdateAction = "UpdateAction", + DeleteAction = "DeleteAction", + RunAction = "RunAction", + CreateBuilder = "CreateBuilder", + UpdateBuilder = "UpdateBuilder", + DeleteBuilder = "DeleteBuilder", + CreateAlerter = "CreateAlerter", + UpdateAlerter = "UpdateAlerter", + DeleteAlerter = "DeleteAlerter", + CreateServerTemplate = "CreateServerTemplate", + UpdateServerTemplate = "UpdateServerTemplate", + DeleteServerTemplate = "DeleteServerTemplate", + LaunchServer = "LaunchServer", + CreateResourceSync = "CreateResourceSync", + UpdateResourceSync = "UpdateResourceSync", + DeleteResourceSync = "DeleteResourceSync", + WriteSyncContents = "WriteSyncContents", + CommitSync = "CommitSync", + RunSync = "RunSync", + CreateVariable = "CreateVariable", + UpdateVariableValue = "UpdateVariableValue", + DeleteVariable = "DeleteVariable", + CreateGitProviderAccount = "CreateGitProviderAccount", + UpdateGitProviderAccount = "UpdateGitProviderAccount", + DeleteGitProviderAccount = "DeleteGitProviderAccount", + CreateDockerRegistryAccount = "CreateDockerRegistryAccount", + UpdateDockerRegistryAccount = "UpdateDockerRegistryAccount", + DeleteDockerRegistryAccount = "DeleteDockerRegistryAccount", } -/** Configuration for a container that is portable between hosts. When used as `ContainerConfig` field in an image, `ContainerConfig` is an optional field containing the configuration of the container that was last committed when creating the image. Previous versions of Docker builder used this field to store build cache, and it is not in active use anymore. */ -export interface ContainerConfig { - /** The hostname to use for the container, as a valid RFC 1123 hostname. */ - Hostname?: string; - /** The domain name to use for the container. */ - Domainname?: string; - /** The user that commands are run as inside the container. */ - User?: string; - /** Whether to attach to `stdin`. */ - AttachStdin?: boolean; - /** Whether to attach to `stdout`. */ - AttachStdout?: boolean; - /** Whether to attach to `stderr`. */ - AttachStderr?: boolean; - /** An object mapping ports to an empty object in the form: `{\"/\": {}}` */ - ExposedPorts?: Record>; - /** Attach standard streams to a TTY, including `stdin` if it is not closed. */ - Tty?: boolean; - /** Open `stdin` */ - OpenStdin?: boolean; - /** Close `stdin` after one attached client disconnects */ - StdinOnce?: boolean; - /** A list of environment variables to set inside the container in the form `[\"VAR=value\", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. */ - Env?: string[]; - /** Command to run specified as a string or an array of strings. */ - Cmd?: string[]; - Healthcheck?: HealthConfig; - /** Command is already escaped (Windows only) */ - ArgsEscaped?: boolean; - /** The name (or reference) of the image to use when creating the container, or which was used when the container was created. */ - Image?: string; - /** An object mapping mount point paths inside the container to empty objects. */ - Volumes?: Record>; - /** The working directory for commands to run in. */ - WorkingDir?: string; - /** The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string (`[\"\"]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). */ - Entrypoint?: string[]; - /** Disable networking for the container. */ - NetworkDisabled?: boolean; - /** MAC address of the container. Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ - MacAddress?: string; - /** `ONBUILD` metadata that were defined in the image's `Dockerfile`. */ - OnBuild?: string[]; - /** User-defined key/value metadata. */ - Labels?: Record; - /** Signal to stop a container as a string or unsigned integer. */ - StopSignal?: string; - /** Timeout to stop a container in seconds. */ - StopTimeout?: I64; - /** Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. */ - Shell?: string[]; +/** An update's status */ +export enum UpdateStatus { + /** The run is in the system but hasn't started yet */ + Queued = "Queued", + /** The run is currently running */ + InProgress = "InProgress", + /** The run is complete */ + Complete = "Complete", } -/** Information about the storage driver used to store the container's and image's filesystem. */ -export interface GraphDriverData { - /** Name of the storage driver. */ - Name?: string; - /** Low-level storage metadata, provided as key/value pairs. This information is driver-specific, and depends on the storage-driver in use, and should be used for informational purposes only. */ - Data?: Record; +/** Represents an action performed by Komodo. */ +export interface Update { + /** + * The Mongo ID of the update. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Update) }` + */ + _id?: MongoId; + /** The operation performed */ + operation: Operation; + /** The time the operation started */ + start_ts: I64; + /** Whether the operation was successful */ + success: boolean; + /** + * The user id that triggered the update. + * + * Also can take these values for operations triggered automatically: + * - `Procedure`: The operation was triggered as part of a procedure run + * - `Github`: The operation was triggered by a github webhook + * - `Auto Redeploy`: The operation (always `Deploy`) was triggered by an attached build finishing. + */ + operator: string; + /** The target resource to which this update refers */ + target: ResourceTarget; + /** Logs produced as the operation is performed */ + logs: Log[]; + /** The time the operation completed. */ + end_ts?: I64; + /** + * The status of the update + * - `Queued` + * - `InProgress` + * - `Complete` + */ + status: UpdateStatus; + /** An optional version on the update, ie build version or deployed version. */ + version?: Version; + /** An optional commit hash associated with the update, ie cloned hash or deployed hash. */ + commit_hash?: string; + /** Some unstructured, operation specific data. Not for general usage. */ + other_data?: string; } -/** Information about the image's RootFS, including the layer IDs. */ -export interface ImageInspectRootFs { - Type?: string; - Layers?: string[]; +export type GetUpdateResponse = Update; + +/** + * Permission users at the group level. + * + * All users that are part of a group inherit the group's permissions. + * A user can be a part of multiple groups. A user's permission on a particular resource + * will be resolved to be the maximum permission level between the user's own permissions and + * any groups they are a part of. + */ +export interface UserGroup { + /** + * The Mongo ID of the UserGroup. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized User) }` + */ + _id?: MongoId; + /** A name for the user group */ + name: string; + /** User ids of group members */ + users?: string[]; + /** Give the user group elevated permissions on all resources of a certain type */ + all?: Record; + /** Unix time (ms) when user group last updated */ + updated_at?: I64; } -/** Additional metadata of the image in the local cache. This information is local to the daemon, and not part of the image itself. */ -export interface ImageInspectMetadata { - /** Date and time at which the image was last tagged in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. This information is only available if the image was tagged locally, and omitted otherwise. */ - LastTagTime?: string; -} +export type GetUserGroupResponse = UserGroup; -/** Information about an image in the local image cache. */ -export interface Image { - /** ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. */ - Id?: string; - /** List of image names/tags in the local image cache that reference this image. Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. */ - RepoTags?: string[]; - /** List of content-addressable digests of locally available image manifests that the image is referenced from. Multiple manifests can refer to the same image. These digests are usually only available if the image was either pulled from a registry, or if the image was pushed to a registry, which is when the manifest is generated and its digest calculated. */ - RepoDigests?: string[]; - /** ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. */ - Parent?: string; - /** Optional message that was set when committing or importing the image. */ - Comment?: string; - /** Date and time at which the image was created, formatted in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. This information is only available if present in the image, and omitted otherwise. */ - Created?: string; - /** The version of Docker that was used to build the image. Depending on how the image was created, this field may be empty. */ - DockerVersion?: string; - /** Name of the author that was specified when committing the image, or as specified through MAINTAINER (deprecated) in the Dockerfile. */ - Author?: string; - /** Configuration for a container that is portable between hosts. */ - Config?: ContainerConfig; - /** Hardware CPU architecture that the image runs on. */ - Architecture?: string; - /** CPU architecture variant (presently ARM-only). */ - Variant?: string; - /** Operating System the image is built to run on. */ - Os?: string; - /** Operating System version the image is built to run on (especially for Windows). */ - OsVersion?: string; - /** Total size of the image including all layers it is composed of. */ - Size?: I64; - GraphDriver?: GraphDriverData; - RootFS?: ImageInspectRootFs; - Metadata?: ImageInspectMetadata; -} +export type GetUserResponse = User; -export type InspectDockerImageResponse = Image; - -/** individual image layer information in response to ImageHistory operation */ -export interface ImageHistoryResponseItem { - Id: string; - Created: I64; - CreatedBy: string; - Tags?: string[]; - Size: I64; - Comment: string; -} - -export type ListDockerImageHistoryResponse = ImageHistoryResponseItem[]; +export type GetVariableResponse = Variable; export enum ContainerStateStatusEnum { Empty = "", @@ -1499,45 +1962,6 @@ export enum ContainerStateStatusEnum { Dead = "dead", } -export interface ContainerListItem { - /** The Server which holds the container. */ - server_id?: string; - /** The first name in Names, not including the initial '/' */ - name: string; - /** The ID of this container */ - id?: string; - /** The name of the image used when creating this container */ - image?: string; - /** The ID of the image that this container was created from */ - image_id?: string; - /** When the container was created */ - created?: I64; - /** The size of files that have been created or changed by this container */ - size_rw?: I64; - /** The total size of all the files in this container */ - size_root_fs?: I64; - /** The state of this container (e.g. `exited`) */ - state: ContainerStateStatusEnum; - /** Additional human-readable status of this container (e.g. `Exit 0`) */ - status?: string; - /** The network mode */ - network_mode?: string; - /** The network names attached to container */ - networks: string[]; - /** The volume names attached to container */ - volumes: string[]; - /** - * The labels attached to container. - * It's too big to send with container list, - * can get it using InspectContainer - */ - labels?: Record; -} - -export type ListDockerContainersResponse = ContainerListItem[]; - -export type ListAllDockerContainersResponse = ContainerListItem[]; - export enum HealthStatusEnum { Empty = "", None = "none", @@ -1894,6 +2318,14 @@ export interface HostConfig { ReadonlyPaths?: string[]; } +/** Information about the storage driver used to store the container's and image's filesystem. */ +export interface GraphDriverData { + /** Name of the storage driver. */ + Name?: string; + /** Low-level storage metadata, provided as key/value pairs. This information is driver-specific, and depends on the storage-driver in use, and should be used for informational purposes only. */ + Data?: Record; +} + /** MountPoint represents a mount point configuration inside the container. This is used for reporting the mountpoints in use by a container. */ export interface MountPoint { /** The mount type: - `bind` a mount of a file or directory from the host into the container. - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - `cluster` a Swarm cluster volume */ @@ -1914,6 +2346,75 @@ export interface MountPoint { Propagation?: string; } +/** A test to perform to check that the container is healthy. */ +export interface HealthConfig { + /** The test to perform. Possible values are: - `[]` inherit healthcheck from image or parent image - `[\"NONE\"]` disable healthcheck - `[\"CMD\", args...]` exec arguments directly - `[\"CMD-SHELL\", command]` run command with system's default shell */ + Test?: string[]; + /** The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + Interval?: I64; + /** The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + Timeout?: I64; + /** The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. */ + Retries?: I64; + /** Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + StartPeriod?: I64; + /** The time to wait between checks in nanoseconds during the start period. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + StartInterval?: I64; +} + +/** Configuration for a container that is portable between hosts. When used as `ContainerConfig` field in an image, `ContainerConfig` is an optional field containing the configuration of the container that was last committed when creating the image. Previous versions of Docker builder used this field to store build cache, and it is not in active use anymore. */ +export interface ContainerConfig { + /** The hostname to use for the container, as a valid RFC 1123 hostname. */ + Hostname?: string; + /** The domain name to use for the container. */ + Domainname?: string; + /** The user that commands are run as inside the container. */ + User?: string; + /** Whether to attach to `stdin`. */ + AttachStdin?: boolean; + /** Whether to attach to `stdout`. */ + AttachStdout?: boolean; + /** Whether to attach to `stderr`. */ + AttachStderr?: boolean; + /** An object mapping ports to an empty object in the form: `{\"/\": {}}` */ + ExposedPorts?: Record>; + /** Attach standard streams to a TTY, including `stdin` if it is not closed. */ + Tty?: boolean; + /** Open `stdin` */ + OpenStdin?: boolean; + /** Close `stdin` after one attached client disconnects */ + StdinOnce?: boolean; + /** A list of environment variables to set inside the container in the form `[\"VAR=value\", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. */ + Env?: string[]; + /** Command to run specified as a string or an array of strings. */ + Cmd?: string[]; + Healthcheck?: HealthConfig; + /** Command is already escaped (Windows only) */ + ArgsEscaped?: boolean; + /** The name (or reference) of the image to use when creating the container, or which was used when the container was created. */ + Image?: string; + /** An object mapping mount point paths inside the container to empty objects. */ + Volumes?: Record>; + /** The working directory for commands to run in. */ + WorkingDir?: string; + /** The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string (`[\"\"]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). */ + Entrypoint?: string[]; + /** Disable networking for the container. */ + NetworkDisabled?: boolean; + /** MAC address of the container. Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ + MacAddress?: string; + /** `ONBUILD` metadata that were defined in the image's `Dockerfile`. */ + OnBuild?: string[]; + /** User-defined key/value metadata. */ + Labels?: Record; + /** Signal to stop a container as a string or unsigned integer. */ + StopSignal?: string; + /** Timeout to stop a container in seconds. */ + StopTimeout?: I64; + /** Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. */ + Shell?: string[]; +} + /** EndpointIPAMConfig represents an endpoint's IPAM configuration. */ export interface EndpointIpamConfig { IPv4Address?: string; @@ -2001,9 +2502,99 @@ export interface Container { export type InspectDockerContainerResponse = Container; -export type GetContainerLogResponse = Log; +/** Information about the image's RootFS, including the layer IDs. */ +export interface ImageInspectRootFs { + Type?: string; + Layers?: string[]; +} -export type SearchContainerLogResponse = Log; +/** Additional metadata of the image in the local cache. This information is local to the daemon, and not part of the image itself. */ +export interface ImageInspectMetadata { + /** Date and time at which the image was last tagged in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. This information is only available if the image was tagged locally, and omitted otherwise. */ + LastTagTime?: string; +} + +/** Information about an image in the local image cache. */ +export interface Image { + /** ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. */ + Id?: string; + /** List of image names/tags in the local image cache that reference this image. Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. */ + RepoTags?: string[]; + /** List of content-addressable digests of locally available image manifests that the image is referenced from. Multiple manifests can refer to the same image. These digests are usually only available if the image was either pulled from a registry, or if the image was pushed to a registry, which is when the manifest is generated and its digest calculated. */ + RepoDigests?: string[]; + /** ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. */ + Parent?: string; + /** Optional message that was set when committing or importing the image. */ + Comment?: string; + /** Date and time at which the image was created, formatted in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. This information is only available if present in the image, and omitted otherwise. */ + Created?: string; + /** The version of Docker that was used to build the image. Depending on how the image was created, this field may be empty. */ + DockerVersion?: string; + /** Name of the author that was specified when committing the image, or as specified through MAINTAINER (deprecated) in the Dockerfile. */ + Author?: string; + /** Configuration for a container that is portable between hosts. */ + Config?: ContainerConfig; + /** Hardware CPU architecture that the image runs on. */ + Architecture?: string; + /** CPU architecture variant (presently ARM-only). */ + Variant?: string; + /** Operating System the image is built to run on. */ + Os?: string; + /** Operating System version the image is built to run on (especially for Windows). */ + OsVersion?: string; + /** Total size of the image including all layers it is composed of. */ + Size?: I64; + GraphDriver?: GraphDriverData; + RootFS?: ImageInspectRootFs; + Metadata?: ImageInspectMetadata; +} + +export type InspectDockerImageResponse = Image; + +export interface IpamConfig { + Subnet?: string; + IPRange?: string; + Gateway?: string; + AuxiliaryAddresses: Record; +} + +export interface Ipam { + /** Name of the IPAM driver to use. */ + Driver?: string; + /** List of IPAM configuration options, specified as a map: ``` {\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": } ``` */ + Config: IpamConfig[]; + /** Driver-specific options, specified as a map. */ + Options: Record; +} + +export interface NetworkContainer { + /** This is the key on the incoming map of NetworkContainer */ + ContainerID?: string; + Name?: string; + EndpointID?: string; + MacAddress?: string; + IPv4Address?: string; + IPv6Address?: string; +} + +export interface Network { + Name?: string; + Id?: string; + Created?: string; + Scope?: string; + Driver?: string; + EnableIPv6?: boolean; + IPAM?: Ipam; + Internal?: boolean; + Attachable?: boolean; + Ingress?: boolean; + /** This field is turned from map into array for easier usability. */ + Containers: NetworkContainer[]; + Options?: Record; + Labels?: Record; +} + +export type InspectDockerNetworkResponse = Network; export enum VolumeScopeEnum { Empty = "", @@ -2011,21 +2602,6 @@ export enum VolumeScopeEnum { Global = "global", } -export interface VolumeListItem { - /** The name of the volume */ - name: string; - driver: string; - mountpoint: string; - created?: string; - scope: VolumeScopeEnum; - /** Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") */ - size?: I64; - /** Whether the volume is currently attached to any container */ - in_use: boolean; -} - -export type ListDockerVolumesResponse = VolumeListItem[]; - export type U64 = number; /** The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. The client must send the version number along with the modified specification when updating these objects. This approach ensures safe concurrency and determinism in that the change on the object may not be applied if the version number has changed from the last read. In other words, if two update requests specify the same base version, only one of the requests can succeed. As a result, two separate update requests that happen at the same time will not unintentionally overwrite each other. */ @@ -2174,6 +2750,88 @@ export interface Volume { export type InspectDockerVolumeResponse = Volume; +export type JsonValue = any; + +export type ListActionsResponse = ActionListItem[]; + +export type ListAlertersResponse = AlerterListItem[]; + +export interface ContainerListItem { + /** The Server which holds the container. */ + server_id?: string; + /** The first name in Names, not including the initial '/' */ + name: string; + /** The ID of this container */ + id?: string; + /** The name of the image used when creating this container */ + image?: string; + /** The ID of the image that this container was created from */ + image_id?: string; + /** When the container was created */ + created?: I64; + /** The size of files that have been created or changed by this container */ + size_rw?: I64; + /** The total size of all the files in this container */ + size_root_fs?: I64; + /** The state of this container (e.g. `exited`) */ + state: ContainerStateStatusEnum; + /** Additional human-readable status of this container (e.g. `Exit 0`) */ + status?: string; + /** The network mode */ + network_mode?: string; + /** The network names attached to container */ + networks: string[]; + /** The volume names attached to container */ + volumes: string[]; + /** + * The labels attached to container. + * It's too big to send with container list, + * can get it using InspectContainer + */ + labels?: Record; +} + +export type ListAllDockerContainersResponse = ContainerListItem[]; + +/** An api key used to authenticate requests via request headers. */ +export interface ApiKey { + /** Unique key associated with secret */ + key: string; + /** Hash of the secret */ + secret: string; + /** User associated with the api key */ + user_id: string; + /** Name associated with the api key for management */ + name: string; + /** Timestamp of key creation */ + created_at: I64; + /** Expiry of key, or 0 if never expires */ + expires: I64; +} + +export type ListApiKeysForServiceUserResponse = ApiKey[]; + +export type ListApiKeysResponse = ApiKey[]; + +export interface BuildVersionResponseItem { + version: Version; + ts: I64; +} + +export type ListBuildVersionsResponse = BuildVersionResponseItem[]; + +export type ListBuildersResponse = BuilderListItem[]; + +export type ListBuildsResponse = BuildListItem[]; + +export type ListCommonBuildExtraArgsResponse = string[]; + +export type ListCommonDeploymentExtraArgsResponse = string[]; + +export type ListCommonStackBuildExtraArgsResponse = string[]; + +export type ListCommonStackExtraArgsResponse = string[]; + export interface ComposeProject { /** The compose project name. */ name: string; @@ -2185,124 +2843,262 @@ export interface ComposeProject { export type ListComposeProjectsResponse = ComposeProject[]; -/** System information of a server */ -export interface SystemInformation { - /** The system name */ - name?: string; - /** The system long os version */ - os?: string; - /** System's kernel version */ - kernel?: string; - /** Physical core count */ - core_count?: number; - /** System hostname based off DNS */ - host_name?: string; - /** The CPU's brand */ - cpu_brand: string; +export type ListDeploymentsResponse = DeploymentListItem[]; + +export type ListDockerContainersResponse = ContainerListItem[]; + +/** individual image layer information in response to ImageHistory operation */ +export interface ImageHistoryResponseItem { + Id: string; + Created: I64; + CreatedBy: string; + Tags?: string[]; + Size: I64; + Comment: string; } -export type GetSystemInformationResponse = SystemInformation; +export type ListDockerImageHistoryResponse = ImageHistoryResponseItem[]; -/** Info for a single disk mounted on the system. */ -export interface SingleDiskUsage { - /** The mount point of the disk */ - mount: string; - /** Detected file system */ - file_system: string; - /** Used portion of the disk in GB */ - used_gb: number; - /** Total size of the disk in GB */ - total_gb: number; -} - -export enum Timelength { - OneSecond = "1-sec", - FiveSeconds = "5-sec", - TenSeconds = "10-sec", - FifteenSeconds = "15-sec", - ThirtySeconds = "30-sec", - OneMinute = "1-min", - TwoMinutes = "2-min", - FiveMinutes = "5-min", - TenMinutes = "10-min", - FifteenMinutes = "15-min", - ThirtyMinutes = "30-min", - OneHour = "1-hr", - TwoHours = "2-hr", - SixHours = "6-hr", - EightHours = "8-hr", - TwelveHours = "12-hr", - OneDay = "1-day", - ThreeDay = "3-day", - OneWeek = "1-wk", - TwoWeeks = "2-wk", - ThirtyDays = "30-day", -} - -/** Realtime system stats data. */ -export interface SystemStats { - /** Cpu usage percentage */ - cpu_perc: number; - /** - * [1.15.9+] - * Free memory in GB. - * This is really the 'Free' memory, not the 'Available' memory. - * It may be different than mem_total_gb - mem_used_gb. - */ - mem_free_gb?: number; - /** Used memory in GB. 'Total' - 'Available' (not free) memory. */ - mem_used_gb: number; - /** Total memory in GB */ - mem_total_gb: number; - /** Breakdown of individual disks, ie their usages, sizes, and mount points */ - disks: SingleDiskUsage[]; - /** The rate the system stats are being polled from the system */ - polling_rate: Timelength; - /** Unix timestamp in milliseconds when stats were last polled */ - refresh_ts: I64; - /** Unix timestamp in milliseconds when disk list was last refreshed */ - refresh_list_ts: I64; -} - -export type GetSystemStatsResponse = SystemStats; - -/** Information about a process on the system. */ -export interface SystemProcess { - /** The process PID */ - pid: number; - /** The process name */ +export interface ImageListItem { + /** The first tag in `repo_tags`, or Id if no tags. */ name: string; - /** The path to the process executable */ - exe?: string; - /** The command used to start the process */ - cmd: string[]; - /** The time the process was started */ - start_time?: number; - /** - * The cpu usage percentage of the process. - * This is in core-percentage, eg 100% is 1 full core, and - * an 8 core machine would max at 800%. - */ - cpu_perc: number; - /** The memory usage of the process in MB */ - mem_mb: number; - /** Process disk read in KB/s */ - disk_read_kb: number; - /** Process disk write in KB/s */ - disk_write_kb: number; + /** ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. */ + id: string; + /** ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. */ + parent_id: string; + /** Date and time at which the image was created as a Unix timestamp (number of seconds sinds EPOCH). */ + created: I64; + /** Total size of the image including all layers it is composed of. */ + size: I64; + /** Whether the image is in use by any container */ + in_use: boolean; } -export type ListSystemProcessesResponse = SystemProcess[]; +export type ListDockerImagesResponse = ImageListItem[]; -export type ServerTemplateConfig = - /** Template to launch an AWS EC2 instance */ - | { type: "Aws", params: AwsServerTemplateConfig } - /** Template to launch a Hetzner server */ - | { type: "Hetzner", params: HetznerServerTemplateConfig }; +export interface NetworkListItem { + name?: string; + id?: string; + created?: string; + scope?: string; + driver?: string; + enable_ipv6?: boolean; + ipam_driver?: string; + ipam_subnet?: string; + ipam_gateway?: string; + internal?: boolean; + attachable?: boolean; + ingress?: boolean; + /** Whether the network is attached to one or more containers */ + in_use: boolean; +} -export type ServerTemplate = Resource; +export type ListDockerNetworksResponse = NetworkListItem[]; -export type GetServerTemplateResponse = ServerTemplate; +export interface ProviderAccount { + /** The account username. Required. */ + username: string; + /** The account access token. Required. */ + token?: string; +} + +export interface DockerRegistry { + /** The docker provider domain. Default: `docker.io`. */ + domain: string; + /** The account username. Required. */ + accounts?: ProviderAccount[]; + /** + * Available organizations on the registry provider. + * Used to push an image under an organization's repo rather than an account's repo. + */ + organizations?: string[]; +} + +export type ListDockerRegistriesFromConfigResponse = DockerRegistry[]; + +export type ListDockerRegistryAccountsResponse = DockerRegistryAccount[]; + +export interface VolumeListItem { + /** The name of the volume */ + name: string; + driver: string; + mountpoint: string; + created?: string; + scope: VolumeScopeEnum; + /** Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") */ + size?: I64; + /** Whether the volume is currently attached to any container */ + in_use: boolean; +} + +export type ListDockerVolumesResponse = VolumeListItem[]; + +export type ListFullActionsResponse = Action[]; + +export type ListFullAlertersResponse = Alerter[]; + +export type ListFullBuildersResponse = Builder[]; + +export type ListFullBuildsResponse = Build[]; + +export type ListFullDeploymentsResponse = Deployment[]; + +export type ListFullProceduresResponse = Procedure[]; + +export type ListFullReposResponse = Repo[]; + +export type ListFullResourceSyncsResponse = ResourceSync[]; + +export type ListFullServerTemplatesResponse = ServerTemplate[]; + +export type ListFullServersResponse = Server[]; + +export type ListFullStacksResponse = Stack[]; + +export type ListGitProviderAccountsResponse = GitProviderAccount[]; + +export interface GitProvider { + /** The git provider domain. Default: `github.com`. */ + domain: string; + /** Whether to use https. Default: true. */ + https: boolean; + /** The account username. Required. */ + accounts: ProviderAccount[]; +} + +export type ListGitProvidersFromConfigResponse = GitProvider[]; + +export type UserTarget = + /** User Id */ + | { type: "User", id: string } + /** UserGroup Id */ + | { type: "UserGroup", id: string }; + +/** Representation of a User or UserGroups permission on a resource. */ +export interface Permission { + /** The id of the permission document */ + _id?: MongoId; + /** The target User / UserGroup */ + user_target: UserTarget; + /** The target resource */ + resource_target: ResourceTarget; + /** The permission level */ + level?: PermissionLevel; +} + +export type ListPermissionsResponse = Permission[]; + +export enum ProcedureState { + /** Last run successful */ + Ok = "Ok", + /** Last run failed */ + Failed = "Failed", + /** Currently running */ + Running = "Running", + /** Other case (never run) */ + Unknown = "Unknown", +} + +export interface ProcedureListItemInfo { + /** Number of stages procedure has. */ + stages: I64; + /** Reflect whether last run successful / currently running. */ + state: ProcedureState; +} + +export type ProcedureListItem = ResourceListItem; + +export type ListProceduresResponse = ProcedureListItem[]; + +export enum RepoState { + /** Unknown case */ + Unknown = "Unknown", + /** Last clone / pull successful (or never cloned) */ + Ok = "Ok", + /** Last clone / pull failed */ + Failed = "Failed", + /** Currently cloning */ + Cloning = "Cloning", + /** Currently pulling */ + Pulling = "Pulling", + /** Currently building */ + Building = "Building", +} + +export interface RepoListItemInfo { + /** The server that repo sits on. */ + server_id: string; + /** The builder that builds the repo. */ + builder_id: string; + /** Repo last cloned / pulled timestamp in ms. */ + last_pulled_at: I64; + /** Repo last built timestamp in ms. */ + last_built_at: I64; + /** The git provider domain */ + git_provider: string; + /** The configured repo */ + repo: string; + /** The configured branch */ + branch: string; + /** The repo state */ + state: RepoState; + /** If the repo is cloned, will be the cloned short commit hash. */ + cloned_hash?: string; + /** If the repo is cloned, will be the cloned commit message. */ + cloned_message?: string; + /** If the repo is built, will be the latest built short commit hash. */ + built_hash?: string; + /** Will be the latest remote short commit hash. */ + latest_hash?: string; +} + +export type RepoListItem = ResourceListItem; + +export type ListReposResponse = RepoListItem[]; + +export enum ResourceSyncState { + /** Last sync successful (or never synced). No Changes pending */ + Ok = "Ok", + /** Last sync failed */ + Failed = "Failed", + /** Currently syncing */ + Syncing = "Syncing", + /** Updates pending */ + Pending = "Pending", + /** Other case */ + Unknown = "Unknown", +} + +export interface ResourceSyncListItemInfo { + /** Unix timestamp of last sync, or 0 */ + last_sync_ts: I64; + /** Whether sync is `files_on_host` mode. */ + files_on_host: boolean; + /** Whether sync has file contents defined. */ + file_contents: boolean; + /** Whether sync has `managed` mode enabled. */ + managed: boolean; + /** Resource paths to the files. */ + resource_path: string[]; + /** The git provider domain. */ + git_provider: string; + /** The Github repo used as the source of the sync resources */ + repo: string; + /** The branch of the repo */ + branch: string; + /** Short commit hash of last sync, or empty string */ + last_sync_hash?: string; + /** Commit message of last sync, or empty string */ + last_sync_message?: string; + /** State of the sync. Reflects whether most recent sync successful. */ + state: ResourceSyncState; +} + +export type ResourceSyncListItem = ResourceListItem; + +export type ListResourceSyncsResponse = ResourceSyncListItem[]; + +export type ListSecretsResponse = string[]; export interface ServerTemplateListItemInfo { /** The cloud provider */ @@ -2315,214 +3111,33 @@ export type ServerTemplateListItem = ResourceListItem; -export interface StackInfo { - /** - * If any of the expected files are missing in the repo, - * they will be stored here. - */ - missing_files?: string[]; - /** - * The deployed project name. - * This is updated whenever Komodo successfully deploys the stack. - * If it is present, Komodo will use it for actions over other options, - * to ensure control is maintained after changing the project name (there is no rename compose project api). - */ - deployed_project_name?: string; - /** Deployed short commit hash, or null. Only for repo based stacks. */ - deployed_hash?: string; - /** Deployed commit message, or null. Only for repo based stacks */ - deployed_message?: string; - /** The deployed compose file contents. This is updated whenever Komodo successfully deploys the stack. */ - deployed_contents?: FileContents[]; - /** - * The deployed service names. - * This is updated whenever it is empty, or deployed contents is updated. - */ - deployed_services?: StackServiceNames[]; - /** - * The latest service names. - * This is updated whenever the stack cache refreshes, using the latest file contents (either db defined or remote). - */ - latest_services?: StackServiceNames[]; - /** - * The remote compose file contents, whether on host or in repo. - * This is updated whenever Komodo refreshes the stack cache. - * It will be empty if the file is defined directly in the stack config. - */ - remote_contents?: FileContents[]; - /** If there was an error in getting the remote contents, it will be here. */ - remote_errors?: FileContents[]; - /** Latest commit hash, or null */ - latest_hash?: string; - /** Latest commit message, or null */ - latest_message?: string; -} - -export type Stack = Resource; - -export type GetStackResponse = Stack; +export type ListServersResponse = ServerListItem[]; export interface StackService { /** The service name */ @@ -2533,14 +3148,6 @@ export interface StackService { export type ListStackServicesResponse = StackService[]; -export type GetStackServiceLogResponse = Log; - -export type SearchStackServiceLogResponse = Log; - -export type ListCommonStackExtraArgsResponse = string[]; - -export type ListCommonStackBuildExtraArgsResponse = string[]; - export enum StackState { /** All containers are running. */ Running = "running", @@ -2608,662 +3215,55 @@ export type StackListItem = ResourceListItem; export type ListStacksResponse = StackListItem[]; -export type ListFullStacksResponse = Stack[]; - -export interface StackActionState { - deploying: boolean; - starting: boolean; - restarting: boolean; - pausing: boolean; - unpausing: boolean; - stopping: boolean; - destroying: boolean; -} - -export type GetStackActionStateResponse = StackActionState; - -/** The sync configuration. */ -export interface ResourceSyncConfig { - /** The git provider domain. Default: github.com */ - git_provider: string; - /** - * Whether to use https to clone the repo (versus http). Default: true - * - * Note. Komodo does not currently support cloning repos via ssh. - */ - git_https: boolean; - /** The Github repo used as the source of the build. */ - repo?: string; - /** The branch of the repo. */ - branch: string; - /** Optionally set a specific commit hash. */ - commit?: string; - /** - * The git account used to access private repos. - * Passing empty string can only clone public repos. - * - * Note. A token for the account must be available in the core config or the builder server's periphery config - * for the configured git provider. - */ - git_account?: string; - /** Whether incoming webhooks actually trigger action. */ - webhook_enabled: boolean; - /** - * Optionally provide an alternate webhook secret for this sync. - * If its an empty string, use the default secret from the config. - */ - webhook_secret?: string; - /** - * Files are available on the Komodo Core host. - * Specify the file / folder with [ResourceSyncConfig::resource_path]. - */ - files_on_host?: boolean; - /** - * The path of the resource file(s) to sync. - * - If Files on Host, this is relative to the configured `sync_directory` in core config. - * - If Git Repo based, this is relative to the root of the repo. - * Can be a specific file, or a directory containing multiple files / folders. - * See [https://komo.do/docs/sync-resources](https://komo.do/docs/sync-resources) for more information. - */ - resource_path?: string[]; - /** - * Enable "pushes" to the file, - * which exports resources matching tags to single file. - * - If using `files_on_host`, it is stored in the file_contents, which must point to a .toml file path (it will be created if it doesn't exist). - * - If using `file_contents`, it is stored in the database. - * When using this, "delete" mode is always enabled. - */ - managed?: boolean; - /** - * Whether sync should delete resources - * not declared in the resource files - */ - delete?: boolean; - /** - * When using `managed` resource sync, will only export resources - * matching all of the given tags. If none, will match all resources. - */ - match_tags?: string[]; - /** Manage the file contents in the UI. */ - file_contents?: string; -} - -export type DiffData = - /** Resource will be created */ - | { type: "Create", data: { - /** The name of resource to create */ - name?: string; - /** The proposed resource to create in TOML */ - proposed: string; -}} - | { type: "Update", data: { - /** The proposed TOML */ - proposed: string; - /** The current TOML */ - current: string; -}} - | { type: "Delete", data: { - /** The current TOML of the resource to delete */ - current: string; -}}; - -export interface ResourceDiff { - /** - * The resource target. - * The target id will be empty if "Create" ResourceDiffType. - */ - target: ResourceTarget; - /** The data associated with the diff. */ - data: DiffData; -} - -export interface SyncDeployUpdate { - /** Resources to deploy */ - to_deploy: number; - /** A readable log of all the changes to be applied */ - log: string; -} - -export interface SyncFileContents { - /** The base resource path. */ - resource_path?: string; - /** The path of the file / error path relative to the resource path. */ - path: string; - /** The contents of the file */ - contents: string; -} - -export interface ResourceSyncInfo { - /** Unix timestamp of last applied sync */ - last_sync_ts?: I64; - /** Short commit hash of last applied sync */ - last_sync_hash?: string; - /** Commit message of last applied sync */ - last_sync_message?: string; - /** The list of pending updates to resources */ - resource_updates?: ResourceDiff[]; - /** The list of pending updates to variables */ - variable_updates?: DiffData[]; - /** The list of pending updates to user groups */ - user_group_updates?: DiffData[]; - /** The list of pending deploys to resources. */ - pending_deploy?: SyncDeployUpdate; - /** If there is an error, it will be stored here */ - pending_error?: string; - /** The commit hash which produced these pending updates. */ - pending_hash?: string; - /** The commit message which produced these pending updates. */ - pending_message?: string; - /** The current sync files */ - remote_contents?: SyncFileContents[]; - /** Any read errors in files by path */ - remote_errors?: SyncFileContents[]; -} - -export type ResourceSync = Resource; - -export type GetResourceSyncResponse = ResourceSync; - -export enum ResourceSyncState { - /** Last sync successful (or never synced). No Changes pending */ - Ok = "Ok", - /** Last sync failed */ - Failed = "Failed", - /** Currently syncing */ - Syncing = "Syncing", - /** Updates pending */ - Pending = "Pending", - /** Other case */ - Unknown = "Unknown", -} - -export interface ResourceSyncListItemInfo { - /** Unix timestamp of last sync, or 0 */ - last_sync_ts: I64; - /** Whether sync is `files_on_host` mode. */ - files_on_host: boolean; - /** Whether sync has file contents defined. */ - file_contents: boolean; - /** Whether sync has `managed` mode enabled. */ - managed: boolean; - /** Resource paths to the files. */ - resource_path: string[]; - /** The git provider domain. */ - git_provider: string; - /** The Github repo used as the source of the sync resources */ - repo: string; - /** The branch of the repo */ - branch: string; - /** Short commit hash of last sync, or empty string */ - last_sync_hash?: string; - /** Commit message of last sync, or empty string */ - last_sync_message?: string; - /** State of the sync. Reflects whether most recent sync successful. */ - state: ResourceSyncState; -} - -export type ResourceSyncListItem = ResourceListItem; - -export type ListResourceSyncsResponse = ResourceSyncListItem[]; - -export type ListFullResourceSyncsResponse = ResourceSync[]; - -export interface ResourceSyncActionState { - /** Whether sync currently syncing */ - syncing: boolean; -} - -export type GetResourceSyncActionStateResponse = ResourceSyncActionState; - -export interface Tag { - /** - * The Mongo ID of the tag. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of serialized Tag) }` - */ - _id?: MongoId; +/** Information about a process on the system. */ +export interface SystemProcess { + /** The process PID */ + pid: number; + /** The process name */ name: string; - owner?: string; + /** The path to the process executable */ + exe?: string; + /** The command used to start the process */ + cmd: string[]; + /** The time the process was started */ + start_time?: number; + /** + * The cpu usage percentage of the process. + * This is in core-percentage, eg 100% is 1 full core, and + * an 8 core machine would max at 800%. + */ + cpu_perc: number; + /** The memory usage of the process in MB */ + mem_mb: number; + /** Process disk read in KB/s */ + disk_read_kb: number; + /** Process disk write in KB/s */ + disk_write_kb: number; } -export type GetTagResponse = Tag; +export type ListSystemProcessesResponse = SystemProcess[]; export type ListTagsResponse = Tag[]; -/** Response containing pretty formatted toml contents. */ -export interface TomlResponse { - toml: string; -} +export type ListUserGroupsResponse = UserGroup[]; -export type ExportAllResourcesToTomlResponse = TomlResponse; - -export type ExportResourcesToTomlResponse = TomlResponse; - -export enum Operation { - None = "None", - CreateServer = "CreateServer", - UpdateServer = "UpdateServer", - DeleteServer = "DeleteServer", - RenameServer = "RenameServer", - StartContainer = "StartContainer", - RestartContainer = "RestartContainer", - PauseContainer = "PauseContainer", - UnpauseContainer = "UnpauseContainer", - StopContainer = "StopContainer", - DestroyContainer = "DestroyContainer", - StartAllContainers = "StartAllContainers", - RestartAllContainers = "RestartAllContainers", - PauseAllContainers = "PauseAllContainers", - UnpauseAllContainers = "UnpauseAllContainers", - StopAllContainers = "StopAllContainers", - PruneContainers = "PruneContainers", - CreateNetwork = "CreateNetwork", - DeleteNetwork = "DeleteNetwork", - PruneNetworks = "PruneNetworks", - DeleteImage = "DeleteImage", - PruneImages = "PruneImages", - DeleteVolume = "DeleteVolume", - PruneVolumes = "PruneVolumes", - PruneDockerBuilders = "PruneDockerBuilders", - PruneBuildx = "PruneBuildx", - PruneSystem = "PruneSystem", - CreateStack = "CreateStack", - UpdateStack = "UpdateStack", - RenameStack = "RenameStack", - DeleteStack = "DeleteStack", - WriteStackContents = "WriteStackContents", - RefreshStackCache = "RefreshStackCache", - DeployStack = "DeployStack", - StartStack = "StartStack", - RestartStack = "RestartStack", - PauseStack = "PauseStack", - UnpauseStack = "UnpauseStack", - StopStack = "StopStack", - DestroyStack = "DestroyStack", - StartStackService = "StartStackService", - RestartStackService = "RestartStackService", - PauseStackService = "PauseStackService", - UnpauseStackService = "UnpauseStackService", - StopStackService = "StopStackService", - CreateDeployment = "CreateDeployment", - UpdateDeployment = "UpdateDeployment", - DeleteDeployment = "DeleteDeployment", - Deploy = "Deploy", - StartDeployment = "StartDeployment", - RestartDeployment = "RestartDeployment", - PauseDeployment = "PauseDeployment", - UnpauseDeployment = "UnpauseDeployment", - StopDeployment = "StopDeployment", - DestroyDeployment = "DestroyDeployment", - RenameDeployment = "RenameDeployment", - CreateBuild = "CreateBuild", - UpdateBuild = "UpdateBuild", - DeleteBuild = "DeleteBuild", - RunBuild = "RunBuild", - CancelBuild = "CancelBuild", - CreateRepo = "CreateRepo", - UpdateRepo = "UpdateRepo", - DeleteRepo = "DeleteRepo", - CloneRepo = "CloneRepo", - PullRepo = "PullRepo", - BuildRepo = "BuildRepo", - CancelRepoBuild = "CancelRepoBuild", - CreateProcedure = "CreateProcedure", - UpdateProcedure = "UpdateProcedure", - DeleteProcedure = "DeleteProcedure", - RunProcedure = "RunProcedure", - CreateBuilder = "CreateBuilder", - UpdateBuilder = "UpdateBuilder", - DeleteBuilder = "DeleteBuilder", - CreateAlerter = "CreateAlerter", - UpdateAlerter = "UpdateAlerter", - DeleteAlerter = "DeleteAlerter", - CreateServerTemplate = "CreateServerTemplate", - UpdateServerTemplate = "UpdateServerTemplate", - DeleteServerTemplate = "DeleteServerTemplate", - LaunchServer = "LaunchServer", - CreateResourceSync = "CreateResourceSync", - UpdateResourceSync = "UpdateResourceSync", - DeleteResourceSync = "DeleteResourceSync", - WriteSyncContents = "WriteSyncContents", - CommitSync = "CommitSync", - RunSync = "RunSync", - CreateVariable = "CreateVariable", - UpdateVariableValue = "UpdateVariableValue", - DeleteVariable = "DeleteVariable", - CreateGitProviderAccount = "CreateGitProviderAccount", - UpdateGitProviderAccount = "UpdateGitProviderAccount", - DeleteGitProviderAccount = "DeleteGitProviderAccount", - CreateDockerRegistryAccount = "CreateDockerRegistryAccount", - UpdateDockerRegistryAccount = "UpdateDockerRegistryAccount", - DeleteDockerRegistryAccount = "DeleteDockerRegistryAccount", -} - -/** An update's status */ -export enum UpdateStatus { - /** The run is in the system but hasn't started yet */ - Queued = "Queued", - /** The run is currently running */ - InProgress = "InProgress", - /** The run is complete */ - Complete = "Complete", -} - -/** Represents an action performed by Komodo. */ -export interface Update { - /** - * The Mongo ID of the update. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of serialized Update) }` - */ - _id?: MongoId; - /** The operation performed */ - operation: Operation; - /** The time the operation started */ - start_ts: I64; - /** Whether the operation was successful */ - success: boolean; - /** - * The user id that triggered the update. - * - * Also can take these values for operations triggered automatically: - * - `Procedure`: The operation was triggered as part of a procedure run - * - `Github`: The operation was triggered by a github webhook - * - `Auto Redeploy`: The operation (always `Deploy`) was triggered by an attached build finishing. - */ - operator: string; - /** The target resource to which this update refers */ - target: ResourceTarget; - /** Logs produced as the operation is performed */ - logs: Log[]; - /** The time the operation completed. */ - end_ts?: I64; - /** - * The status of the update - * - `Queued` - * - `InProgress` - * - `Complete` - */ - status: UpdateStatus; - /** An optional version on the update, ie build version or deployed version. */ - version?: Version; - /** An optional commit hash associated with the update, ie cloned hash or deployed hash. */ - commit_hash?: string; - /** Some unstructured, operation specific data. Not for general usage. */ - other_data?: string; -} - -export type GetUpdateResponse = Update; - -/** An api key used to authenticate requests via request headers. */ -export interface ApiKey { - /** Unique key associated with secret */ - key: string; - /** Hash of the secret */ - secret: string; - /** User associated with the api key */ - user_id: string; - /** Name associated with the api key for management */ - name: string; - /** Timestamp of key creation */ - created_at: I64; - /** Expiry of key, or 0 if never expires */ - expires: I64; -} - -export type ListApiKeysResponse = ApiKey[]; - -export type ListApiKeysForServiceUserResponse = ApiKey[]; - -export type FindUserResponse = User; +export type ListUserTargetPermissionsResponse = Permission[]; export type ListUsersResponse = User[]; -/** - * Permission users at the group level. - * - * All users that are part of a group inherit the group's permissions. - * A user can be a part of multiple groups. A user's permission on a particular resource - * will be resolved to be the maximum permission level between the user's own permissions and - * any groups they are a part of. - */ -export interface UserGroup { - /** - * The Mongo ID of the UserGroup. - * This field is de/serialized from/to JSON as - * `{ "_id": { "$oid": "..." }, ...(rest of serialized User) }` - */ - _id?: MongoId; - /** A name for the user group */ - name: string; - /** User ids of group members */ - users: string[]; - /** Give the user group elevated permissions on all resources of a certain type */ - all?: Record; - /** Unix time (ms) when user group last updated */ - updated_at?: I64; -} - -export type GetUserGroupResponse = UserGroup; - -export type ListUserGroupsResponse = UserGroup[]; - -/** - * A non-secret global variable which can be interpolated into deployment - * environment variable values and build argument values. - */ -export interface Variable { - /** - * Unique name associated with the variable. - * Instances of '[[variable.name]]' in value will be replaced with 'variable.value'. - */ - name: string; - /** A description for the variable. */ - description?: string; - /** The value associated with the variable. */ - value?: string; - /** - * If marked as secret, the variable value will be hidden in updates / logs. - * Additionally the value will not be served in read requests by non admin users. - * - * Note that the value is NOT encrypted in the database, and will likely show up in database logs. - * The security of these variables comes down to the security - * of the database (system level encryption, network isolation, etc.) - */ - is_secret?: boolean; -} - -export type GetVariableResponse = Variable; - export type ListVariablesResponse = Variable[]; -/** Represents an empty json object: `{}` */ -export interface NoData { -} - -export type PushRecentlyViewedResponse = NoData; - -export type SetLastSeenUpdateResponse = NoData; - -export type DeleteApiKeyResponse = NoData; - -/** Response for [CreateApiKey]. */ -export interface CreateApiKeyResponse { - /** X-API-KEY */ - key: string; - /** - * X-API-SECRET - * - * Note. - * There is no way to get the secret again after it is distributed in this message - */ - secret: string; -} - -export type CreateApiKeyForServiceUserResponse = CreateApiKeyResponse; - -export type DeleteApiKeyForServiceUserResponse = NoData; - -export type CreateBuildWebhookResponse = NoData; - -export type DeleteBuildWebhookResponse = NoData; - -export type UpdateDescriptionResponse = NoData; - -export type UpdatePermissionOnTargetResponse = NoData; - -export type UpdatePermissionOnResourceTypeResponse = NoData; - -export type UpdateUserBasePermissionsResponse = NoData; - -export type UpdateUserAdminResponse = NoData; - -export type CreateProcedureResponse = Procedure; - -export type CopyProcedureResponse = Procedure; - -export type DeleteProcedureResponse = Procedure; - -export type UpdateProcedureResponse = Procedure; - -export type CreateGitProviderAccountResponse = GitProviderAccount; - -export type UpdateGitProviderAccountResponse = GitProviderAccount; - -export type DeleteGitProviderAccountResponse = GitProviderAccount; - -export type CreateDockerRegistryAccountResponse = DockerRegistryAccount; - -export type UpdateDockerRegistryAccountResponse = DockerRegistryAccount; - -export type DeleteDockerRegistryAccountResponse = DockerRegistryAccount; - -export type CreateRepoWebhookResponse = NoData; - -export type DeleteRepoWebhookResponse = NoData; - -export type CreateStackWebhookResponse = NoData; - -export type DeleteStackWebhookResponse = NoData; - -export type CreateSyncWebhookResponse = NoData; - -export type DeleteSyncWebhookResponse = NoData; - -export type UpdateTagsOnResourceResponse = NoData; - -export type UpdateUserUsernameResponse = NoData; - -export type UpdateUserPasswordResponse = NoData; - -export type DeleteUserResponse = User; - -export type CreateServiceUserResponse = User; - -export type UpdateServiceUserDescriptionResponse = User; - -export type CreateVariableResponse = Variable; - -export type UpdateVariableValueResponse = Variable; - -export type UpdateVariableDescriptionResponse = Variable; - -export type UpdateVariableIsSecretResponse = Variable; - -export type DeleteVariableResponse = Variable; - -export type _PartialAlerterConfig = Partial; - -export enum TagBehavior { - /** Returns resources which have strictly all the tags */ - All = "All", - /** Returns resources which have one or more of the tags */ - Any = "Any", -} - -/** Passing empty Vec is the same as not filtering by that field */ -export interface ResourceQuery { - names?: string[]; - /** Pass Vec of tag ids or tag names */ - tags?: string[]; - tag_behavior?: TagBehavior; - specific?: T; -} - -export interface AlerterQuerySpecifics { - /** - * Filter alerters by enabled. - * - `None`: Don't filter by enabled - * - `Some(true)`: Only include alerts with `enabled: true` - * - `Some(false)`: Only include alerts with `enabled: false` - */ - enabled?: boolean; - /** - * Only include alerters with these endpoint types. - * If empty, don't filter by enpoint type. - */ - types: AlerterEndpoint["type"][]; -} - -export type AlerterQuery = ResourceQuery; - -export type _PartialBuildConfig = Partial; - -export interface BuildQuerySpecifics { - builder_ids?: string[]; - repos?: string[]; - /** - * query for builds last built more recently than this timestamp - * defaults to 0 which is a no op - */ - built_since?: I64; -} - -export type BuildQuery = ResourceQuery; - -export type _PartialBuilderConfig = Partial; - -export type _PartialServerBuilderConfig = Partial; - -export type _PartialAwsBuilderConfig = Partial; - -export interface BuilderQuerySpecifics { -} - -export type BuilderQuery = ResourceQuery; - -export type _PartialDeploymentConfig = Partial; - -export interface DeploymentQuerySpecifics { - server_ids?: string[]; - build_ids?: string[]; -} - -export type DeploymentQuery = ResourceQuery; +/** The response for [LoginLocalUser] */ +export type LoginLocalUserResponse = JwtResponse; export type MongoDocument = any; -export type JsonValue = any; - -export interface __Serror { - error: string; - trace: string[]; -} - -export type _Serror = __Serror; - -export type _PartialProcedureConfig = Partial; - export interface ProcedureQuerySpecifics { } export type ProcedureQuery = ResourceQuery; -export type _PartialGitProviderAccount = Partial; - -export type _PartialDockerRegistryAccount = Partial; - -export type _PartialRepoConfig = Partial; +export type PushRecentlyViewedResponse = NoData; export interface RepoQuerySpecifics { /** Filter repos by their repo. */ @@ -3272,7 +3272,18 @@ export interface RepoQuerySpecifics { export type RepoQuery = ResourceQuery; -export type _PartialServerConfig = Partial; +export interface ResourceSyncQuerySpecifics { + /** Filter syncs by their repo. */ + repos: string[]; +} + +export type ResourceSyncQuery = ResourceQuery; + +export type SearchContainerLogResponse = Log; + +export type SearchDeploymentLogResponse = Log; + +export type SearchStackServiceLogResponse = Log; export interface ServerQuerySpecifics { } @@ -3280,17 +3291,13 @@ export interface ServerQuerySpecifics { /** Server-specific query */ export type ServerQuery = ResourceQuery; -export type _PartialAwsServerTemplateConfig = Partial; - -export type _PartialHetznerServerTemplateConfig = Partial; - export interface ServerTemplateQuerySpecifics { types: ServerTemplateConfig["type"][]; } export type ServerTemplateQuery = ResourceQuery; -export type _PartialStackConfig = Partial; +export type SetLastSeenUpdateResponse = NoData; export interface StackQuerySpecifics { /** Filter syncs by their repo. */ @@ -3299,2939 +3306,76 @@ export interface StackQuerySpecifics { export type StackQuery = ResourceQuery; +export type UpdateDescriptionResponse = NoData; + +export type UpdateDockerRegistryAccountResponse = DockerRegistryAccount; + +export type UpdateGitProviderAccountResponse = GitProviderAccount; + +export type UpdatePermissionOnResourceTypeResponse = NoData; + +export type UpdatePermissionOnTargetResponse = NoData; + +export type UpdateProcedureResponse = Procedure; + +export type UpdateServiceUserDescriptionResponse = User; + +export type UpdateTagsOnResourceResponse = NoData; + +export type UpdateUserAdminResponse = NoData; + +export type UpdateUserBasePermissionsResponse = NoData; + +export type UpdateUserPasswordResponse = NoData; + +export type UpdateUserUsernameResponse = NoData; + +export type UpdateVariableDescriptionResponse = Variable; + +export type UpdateVariableIsSecretResponse = Variable; + +export type UpdateVariableValueResponse = Variable; + +export type _PartialActionConfig = Partial; + +export type _PartialAlerterConfig = Partial; + +export type _PartialAwsBuilderConfig = Partial; + +export type _PartialAwsServerTemplateConfig = Partial; + +export type _PartialBuildConfig = Partial; + +export type _PartialBuilderConfig = Partial; + +export type _PartialDeploymentConfig = Partial; + +export type _PartialDockerRegistryAccount = Partial; + +export type _PartialGitProviderAccount = Partial; + +export type _PartialHetznerServerTemplateConfig = Partial; + +export type _PartialProcedureConfig = Partial; + +export type _PartialRepoConfig = Partial; + export type _PartialResourceSyncConfig = Partial; -export interface ResourceSyncQuerySpecifics { - /** Filter syncs by their repo. */ - repos: string[]; -} +export type _PartialServerBuilderConfig = Partial; -export type ResourceSyncQuery = ResourceQuery; +export type _PartialServerConfig = Partial; + +export type _PartialStackConfig = Partial; export type _PartialTag = Partial; -/** - * Non authenticated route to see the available options - * users have to login to Komodo, eg. local auth, github, google. - * Response: [GetLoginOptionsResponse]. - */ -export interface GetLoginOptions { +export interface __Serror { + error: string; + trace: string[]; } -/** The response for [GetLoginOptions]. */ -export interface GetLoginOptionsResponse { - /** Whether local auth is enabled. */ - local: boolean; - /** Whether github login is enabled. */ - github: boolean; - /** Whether google login is enabled. */ - google: boolean; - /** Whether OIDC login is enabled. */ - oidc: boolean; - /** Whether user registration (Sign Up) has been disabled */ - registration_disabled: boolean; -} - -/** - * Create a new local user account. Will fail if a user with the - * given username already exists. - * Response: [CreateLocalUserResponse]. - * - * Note. This method is only available if the core api has `local_auth` enabled. - */ -export interface CreateLocalUser { - /** The username for the new user. */ - username: string; - /** - * The password for the new user. - * This cannot be retreived later. - */ - password: string; -} - -/** - * Login as a local user. Will fail if the users credentials don't match - * any local user. - * - * Note. This method is only available if the core api has `local_auth` enabled. - */ -export interface LoginLocalUser { - /** The user's username */ - username: string; - /** The user's password */ - password: string; -} - -/** - * Exchange a single use exchange token (safe for transport in url query) - * for a jwt. - * Response: [ExchangeForJwtResponse]. - */ -export interface ExchangeForJwt { - /** The 'exchange token' */ - token: string; -} - -/** - * Get the user extracted from the request headers. - * Response: [User]. - */ -export interface GetUser { -} - -/** - * Runs the target build. Response: [Update]. - * - * 1. Get a handle to the builder. If using AWS builder, this means starting a builder ec2 instance. - * 2. Clone the repo on the builder. If an `on_clone` commmand is given, it will be executed. - * 3. Execute `docker build {...params}`, where params are determined using the builds configuration. - * 4. If a dockerhub account is attached, the build will be pushed to that account. - */ -export interface RunBuild { - /** Can be build id or name */ - build: string; -} - -/** - * Cancels the target build. - * Only does anything if the build is `building` when called. - * Response: [Update] - */ -export interface CancelBuild { - /** Can be id or name */ - build: string; -} - -/** - * Deploys the container for the target deployment. Response: [Update]. - * - * 1. Pulls the image onto the target server. - * 2. If the container is already running, - * it will be stopped and removed using `docker container rm ${container_name}`. - * 3. The container will be run using `docker run {...params}`, - * where params are determined by the deployment's configuration. - */ -export interface Deploy { - /** Name or id */ - deployment: string; - /** - * Override the default termination signal specified in the deployment. - * Only used when deployment needs to be taken down before redeploy. - */ - stop_signal?: TerminationSignal; - /** - * Override the default termination max time. - * Only used when deployment needs to be taken down before redeploy. - */ - stop_time?: number; -} - -/** - * Starts the container for the target deployment. Response: [Update] - * - * 1. Runs `docker start ${container_name}`. - */ -export interface StartDeployment { - /** Name or id */ - deployment: string; -} - -/** - * Restarts the container for the target deployment. Response: [Update] - * - * 1. Runs `docker restart ${container_name}`. - */ -export interface RestartDeployment { - /** Name or id */ - deployment: string; -} - -/** - * Pauses the container for the target deployment. Response: [Update] - * - * 1. Runs `docker pause ${container_name}`. - */ -export interface PauseDeployment { - /** Name or id */ - deployment: string; -} - -/** - * Unpauses the container for the target deployment. Response: [Update] - * - * 1. Runs `docker unpause ${container_name}`. - * - * Note. This is the only way to restart a paused container. - */ -export interface UnpauseDeployment { - /** Name or id */ - deployment: string; -} - -/** - * Stops the container for the target deployment. Response: [Update] - * - * 1. Runs `docker stop ${container_name}`. - */ -export interface StopDeployment { - /** Name or id */ - deployment: string; - /** Override the default termination signal specified in the deployment. */ - signal?: TerminationSignal; - /** Override the default termination max time. */ - time?: number; -} - -/** - * Stops and destroys the container for the target deployment. - * Reponse: [Update]. - * - * 1. The container is stopped and removed using `docker container rm ${container_name}`. - */ -export interface DestroyDeployment { - /** Name or id. */ - deployment: string; - /** Override the default termination signal specified in the deployment. */ - signal?: TerminationSignal; - /** Override the default termination max time. */ - time?: number; -} - -export interface Sleep { - duration_ms?: I64; -} - -/** Runs the target procedure. Response: [Update] */ -export interface RunProcedure { - /** Id or name */ - procedure: string; -} - -/** - * Clones the target repo. Response: [Update]. - * - * Note. Repo must have server attached at `server_id`. - * - * 1. Clones the repo on the target server using `git clone https://{$token?}@github.com/${repo} -b ${branch}`. - * The token will only be used if a github account is specified, - * and must be declared in the periphery configuration on the target server. - * 2. If `on_clone` and `on_pull` are specified, they will be executed. - * `on_clone` will be executed before `on_pull`. - */ -export interface CloneRepo { - /** Id or name */ - repo: string; -} - -/** - * Pulls the target repo. Response: [Update]. - * - * Note. Repo must have server attached at `server_id`. - * - * 1. Pulls the repo on the target server using `git pull`. - * 2. If `on_pull` is specified, it will be executed after the pull is complete. - */ -export interface PullRepo { - /** Id or name */ - repo: string; -} - -/** - * Builds the target repo, using the attached builder. Response: [Update]. - * - * Note. Repo must have builder attached at `builder_id`. - * - * 1. Spawns the target builder instance (For AWS type. For Server type, just use CloneRepo). - * 2. Clones the repo on the builder using `git clone https://{$token?}@github.com/${repo} -b ${branch}`. - * The token will only be used if a github account is specified, - * and must be declared in the periphery configuration on the builder instance. - * 3. If `on_clone` and `on_pull` are specified, they will be executed. - * `on_clone` will be executed before `on_pull`. - */ -export interface BuildRepo { - /** Id or name */ - repo: string; -} - -/** - * Cancels the target repo build. - * Only does anything if the repo build is `building` when called. - * Response: [Update] - */ -export interface CancelRepoBuild { - /** Can be id or name */ - repo: string; -} - -/** - * Starts the container on the target server. Response: [Update] - * - * 1. Runs `docker start ${container_name}`. - */ -export interface StartContainer { - /** Name or id */ - server: string; - /** The container name */ - container: string; -} - -/** - * Restarts the container on the target server. Response: [Update] - * - * 1. Runs `docker restart ${container_name}`. - */ -export interface RestartContainer { - /** Name or id */ - server: string; - /** The container name */ - container: string; -} - -/** - * Pauses the container on the target server. Response: [Update] - * - * 1. Runs `docker pause ${container_name}`. - */ -export interface PauseContainer { - /** Name or id */ - server: string; - /** The container name */ - container: string; -} - -/** - * Unpauses the container on the target server. Response: [Update] - * - * 1. Runs `docker unpause ${container_name}`. - * - * Note. This is the only way to restart a paused container. - */ -export interface UnpauseContainer { - /** Name or id */ - server: string; - /** The container name */ - container: string; -} - -/** - * Stops the container on the target server. Response: [Update] - * - * 1. Runs `docker stop ${container_name}`. - */ -export interface StopContainer { - /** Name or id */ - server: string; - /** The container name */ - container: string; - /** Override the default termination signal. */ - signal?: TerminationSignal; - /** Override the default termination max time. */ - time?: number; -} - -/** - * Stops and destroys the container on the target server. - * Reponse: [Update]. - * - * 1. The container is stopped and removed using `docker container rm ${container_name}`. - */ -export interface DestroyContainer { - /** Name or id */ - server: string; - /** The container name */ - container: string; - /** Override the default termination signal. */ - signal?: TerminationSignal; - /** Override the default termination max time. */ - time?: number; -} - -/** Starts all containers on the target server. Response: [Update] */ -export interface StartAllContainers { - /** Name or id */ - server: string; -} - -/** Restarts all containers on the target server. Response: [Update] */ -export interface RestartAllContainers { - /** Name or id */ - server: string; -} - -/** Pauses all containers on the target server. Response: [Update] */ -export interface PauseAllContainers { - /** Name or id */ - server: string; -} - -/** Unpauses all containers on the target server. Response: [Update] */ -export interface UnpauseAllContainers { - /** Name or id */ - server: string; -} - -/** Stops all containers on the target server. Response: [Update] */ -export interface StopAllContainers { - /** Name or id */ - server: string; -} - -/** - * Prunes the docker containers on the target server. Response: [Update]. - * - * 1. Runs `docker container prune -f`. - */ -export interface PruneContainers { - /** Id or name */ - server: string; -} - -/** - * Delete a docker network. - * Response: [Update] - */ -export interface DeleteNetwork { - /** Id or name. */ - server: string; - /** The name of the network to delete. */ - name: string; -} - -/** - * Prunes the docker networks on the target server. Response: [Update]. - * - * 1. Runs `docker network prune -f`. - */ -export interface PruneNetworks { - /** Id or name */ - server: string; -} - -/** - * Delete a docker image. - * Response: [Update] - */ -export interface DeleteImage { - /** Id or name. */ - server: string; - /** The name of the image to delete. */ - name: string; -} - -/** - * Prunes the docker images on the target server. Response: [Update]. - * - * 1. Runs `docker image prune -a -f`. - */ -export interface PruneImages { - /** Id or name */ - server: string; -} - -/** - * Delete a docker volume. - * Response: [Update] - */ -export interface DeleteVolume { - /** Id or name. */ - server: string; - /** The name of the volume to delete. */ - name: string; -} - -/** - * Prunes the docker volumes on the target server. Response: [Update]. - * - * 1. Runs `docker volume prune -a -f`. - */ -export interface PruneVolumes { - /** Id or name */ - server: string; -} - -/** - * Prunes the docker builders (build cache) on the target server. Response: [Update]. - * - * 1. Runs `docker builder prune -a -f`. - */ -export interface PruneDockerBuilders { - /** Id or name */ - server: string; -} - -/** - * Prunes the docker buildx cache on the target server. Response: [Update]. - * - * 1. Runs `docker buildx prune -a -f`. - */ -export interface PruneBuildx { - /** Id or name */ - server: string; -} - -/** - * Prunes the docker system on the target server, including volumes. Response: [Update]. - * - * 1. Runs `docker system prune -a -f --volumes`. - */ -export interface PruneSystem { - /** Id or name */ - server: string; -} - -/** - * Launch an EC2 instance with the specified config. - * Response: [Update]. - */ -export interface LaunchServer { - /** The name of the created server. */ - name: string; - /** The server template used to define the config. */ - server_template: string; -} - -/** Deploys the target stack. `docker compose up`. Response: [Update] */ -export interface DeployStack { - /** Id or name */ - stack: string; - /** - * Override the default termination max time. - * Only used if the stack needs to be taken down first. - */ - stop_time?: number; -} - -/** - * Checks deployed contents vs latest contents, - * and only if any changes found - * will `docker compose up`. Response: [Update] - */ -export interface DeployStackIfChanged { - /** Id or name */ - stack: string; - /** - * Override the default termination max time. - * Only used if the stack needs to be taken down first. - */ - stop_time?: number; -} - -/** Starts the target stack. `docker compose start`. Response: [Update] */ -export interface StartStack { - /** Id or name */ - stack: string; - /** Optionally specify a specific service to start */ - service?: string; -} - -/** Restarts the target stack. `docker compose restart`. Response: [Update] */ -export interface RestartStack { - /** Id or name */ - stack: string; - /** Optionally specify a specific service to restart */ - service?: string; -} - -/** Pauses the target stack. `docker compose pause`. Response: [Update] */ -export interface PauseStack { - /** Id or name */ - stack: string; - /** Optionally specify a specific service to pause */ - service?: string; -} - -/** - * Unpauses the target stack. `docker compose unpause`. Response: [Update]. - * - * Note. This is the only way to restart a paused container. - */ -export interface UnpauseStack { - /** Id or name */ - stack: string; - /** Optionally specify a specific service to unpause */ - service?: string; -} - -/** Stops the target stack. `docker compose stop`. Response: [Update] */ -export interface StopStack { - /** Id or name */ - stack: string; - /** Override the default termination max time. */ - stop_time?: number; - /** Optionally specify a specific service to stop */ - service?: string; -} - -/** Destoys the target stack. `docker compose down`. Response: [Update] */ -export interface DestroyStack { - /** Id or name */ - stack: string; - /** Pass `--remove-orphans` */ - remove_orphans?: boolean; - /** Override the default termination max time. */ - stop_time?: number; -} - -/** Runs the target resource sync. Response: [Update] */ -export interface RunSync { - /** Id or name */ - sync: string; - /** - * Only execute sync on a specific resource type. - * Combine with `resource_id` to specify resource. - */ - resource_type?: ResourceTarget["type"]; - /** - * Only execute sync on a specific resources. - * Combine with `resource_type` to specify resources. - * Supports name or id. - */ - resources?: string[]; -} - -/** - * Get a paginated list of alerts sorted by timestamp descending. - * Response: [ListAlertsResponse]. - */ -export interface ListAlerts { - /** - * Pass a custom mongo query to filter the alerts. - * - * ## Example JSON - * ``` - * { - * "resolved": "false", - * "level": "CRITICAL", - * "$or": [ - * { - * "target": { - * "type": "Server", - * "id": "6608bf89cb2a12b257ab6c09" - * } - * }, - * { - * "target": { - * "type": "Server", - * "id": "660a5f60b74f90d5dae45fa3" - * } - * } - * ] - * } - * ``` - * This will filter to only include open alerts that have CRITICAL level on those two servers. - */ - query?: MongoDocument; - /** - * Retrieve older results by incrementing the page. - * `page: 0` is default, and returns the most recent results. - */ - page?: U64; -} - -/** Response for [ListAlerts]. */ -export interface ListAlertsResponse { - alerts: Alert[]; - /** - * If more alerts exist, the next page will be given here. - * Otherwise it will be `null` - */ - next_page?: I64; -} - -/** Get an alert: Response: [Alert]. */ -export interface GetAlert { - id: string; -} - -/** Get a specific alerter. Response: [Alerter]. */ -export interface GetAlerter { - /** Id or name */ - alerter: string; -} - -/** List alerters matching optional query. Response: [ListAlertersResponse]. */ -export interface ListAlerters { - /** Structured query to filter alerters. */ - query?: AlerterQuery; -} - -/** List full alerters matching optional query. Response: [ListFullAlertersResponse]. */ -export interface ListFullAlerters { - /** Structured query to filter alerters. */ - query?: AlerterQuery; -} - -/** - * Gets a summary of data relating to all alerters. - * Response: [GetAlertersSummaryResponse]. - */ -export interface GetAlertersSummary { -} - -/** Response for [GetAlertersSummary]. */ -export interface GetAlertersSummaryResponse { - total: number; -} - -/** Get a specific build. Response: [Build]. */ -export interface GetBuild { - /** Id or name */ - build: string; -} - -/** List builds matching optional query. Response: [ListBuildsResponse]. */ -export interface ListBuilds { - /** optional structured query to filter builds. */ - query?: BuildQuery; -} - -/** List builds matching optional query. Response: [ListFullBuildsResponse]. */ -export interface ListFullBuilds { - /** optional structured query to filter builds. */ - query?: BuildQuery; -} - -/** Get current action state for the build. Response: [BuildActionState]. */ -export interface GetBuildActionState { - /** Id or name */ - build: string; -} - -/** - * Gets a summary of data relating to all builds. - * Response: [GetBuildsSummaryResponse]. - */ -export interface GetBuildsSummary { -} - -/** Response for [GetBuildsSummary]. */ -export interface GetBuildsSummaryResponse { - /** The total number of builds in Komodo. */ - total: number; - /** The number of builds with Ok state. */ - ok: number; - /** The number of builds with Failed state. */ - failed: number; - /** The number of builds currently building. */ - building: number; - /** The number of builds with unknown state. */ - unknown: number; -} - -/** - * Gets summary and timeseries breakdown of the last months build count / time for charting. - * Response: [GetBuildMonthlyStatsResponse]. - * - * Note. This method is paginated. One page is 30 days of data. - * Query for older pages by incrementing the page, starting at 0. - */ -export interface GetBuildMonthlyStats { - /** - * Query for older data by incrementing the page. - * `page: 0` is the default, and will return the most recent data. - */ - page?: number; -} - -/** Item in [GetBuildMonthlyStatsResponse] */ -export interface BuildStatsDay { - time: number; - count: number; - ts: number; -} - -/** Response for [GetBuildMonthlyStats]. */ -export interface GetBuildMonthlyStatsResponse { - total_time: number; - total_count: number; - days: BuildStatsDay[]; -} - -/** - * Retrieve versions of the build that were built in the past and available for deployment, - * sorted by most recent first. - * Response: [GetBuildVersionsResponse]. - */ -export interface ListBuildVersions { - /** Id or name */ - build: string; - /** Filter to only include versions matching this major version. */ - major?: number; - /** Filter to only include versions matching this minor version. */ - minor?: number; - /** Filter to only include versions matching this patch version. */ - patch?: number; - /** Limit the number of included results. Default is no limit. */ - limit?: I64; -} - -/** - * Gets a list of existing values used as extra args across other builds. - * Useful to offer suggestions. Response: [ListCommonBuildExtraArgsResponse] - */ -export interface ListCommonBuildExtraArgs { - /** optional structured query to filter builds. */ - query?: BuildQuery; -} - -/** Get whether a Build's target repo has a webhook for the build configured. Response: [GetBuildWebhookEnabledResponse]. */ -export interface GetBuildWebhookEnabled { - /** Id or name */ - build: string; -} - -/** Response for [GetBuildWebhookEnabled] */ -export interface GetBuildWebhookEnabledResponse { - /** - * Whether the repo webhooks can even be managed. - * The repo owner must be in `github_webhook_app.owners` list to be managed. - */ - managed: boolean; - /** Whether pushes to branch trigger build. Will always be false if managed is false. */ - enabled: boolean; -} - -/** Get a specific builder by id or name. Response: [Builder]. */ -export interface GetBuilder { - /** Id or name */ - builder: string; -} - -/** List builders matching structured query. Response: [ListBuildersResponse]. */ -export interface ListBuilders { - query?: BuilderQuery; -} - -/** List builders matching structured query. Response: [ListFullBuildersResponse]. */ -export interface ListFullBuilders { - query?: BuilderQuery; -} - -/** - * Gets a summary of data relating to all builders. - * Response: [GetBuildersSummaryResponse]. - */ -export interface GetBuildersSummary { -} - -/** Response for [GetBuildersSummary]. */ -export interface GetBuildersSummaryResponse { - /** The total number of builders. */ - total: number; -} - -/** Get a specific deployment by name or id. Response: [Deployment]. */ -export interface GetDeployment { - /** Id or name */ - deployment: string; -} - -/** - * List deployments matching optional query. - * Response: [ListDeploymentsResponse]. - */ -export interface ListDeployments { - /** optional structured query to filter deployments. */ - query?: DeploymentQuery; -} - -/** - * List deployments matching optional query. - * Response: [ListFullDeploymentsResponse]. - */ -export interface ListFullDeployments { - /** optional structured query to filter deployments. */ - query?: DeploymentQuery; -} - -/** - * Get the container, including image / status, of the target deployment. - * Response: [GetDeploymentContainerResponse]. - * - * Note. This does not hit the server directly. The status comes from an - * in memory cache on the core, which hits the server periodically - * to keep it up to date. - */ -export interface GetDeploymentContainer { - /** Id or name */ - deployment: string; -} - -/** Response for [GetDeploymentContainer]. */ -export interface GetDeploymentContainerResponse { - state: DeploymentState; - container?: ContainerListItem; -} - -/** - * Get the deployment log's tail, split by stdout/stderr. - * Response: [Log]. - * - * Note. This call will hit the underlying server directly for most up to date log. - */ -export interface GetDeploymentLog { - /** Id or name */ - deployment: string; - /** - * The number of lines of the log tail to include. - * Default: 100. - * Max: 5000. - */ - tail: U64; - /** Enable `--timestamps` */ - timestamps?: boolean; -} - -export enum SearchCombinator { - Or = "Or", - And = "And", -} - -/** - * Search the deployment log's tail using `grep`. All lines go to stdout. - * Response: [Log]. - * - * Note. This call will hit the underlying server directly for most up to date log. - */ -export interface SearchDeploymentLog { - /** Id or name */ - deployment: string; - /** The terms to search for. */ - terms: string[]; - /** - * When searching for multiple terms, can use `AND` or `OR` combinator. - * - * - `AND`: Only include lines with **all** terms present in that line. - * - `OR`: Include lines that have one or more matches in the terms. - */ - combinator?: SearchCombinator; - /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ - invert?: boolean; - /** Enable `--timestamps` */ - timestamps?: boolean; -} - -/** - * Get the deployment container's stats using `docker stats`. - * Response: [DockerContainerStats]. - * - * Note. This call will hit the underlying server directly for most up to date stats. - */ -export interface GetDeploymentStats { - /** Id or name */ - deployment: string; -} - -/** - * Get current action state for the deployment. - * Response: [DeploymentActionState]. - */ -export interface GetDeploymentActionState { - /** Id or name */ - deployment: string; -} - -/** - * Gets a summary of data relating to all deployments. - * Response: [GetDeploymentsSummaryResponse]. - */ -export interface GetDeploymentsSummary { -} - -/** Response for [GetDeploymentsSummary]. */ -export interface GetDeploymentsSummaryResponse { - /** The total number of Deployments */ - total: I64; - /** The number of Deployments with Running state */ - running: I64; - /** The number of Deployments with Stopped or Paused state */ - stopped: I64; - /** The number of Deployments with NotDeployed state */ - not_deployed: I64; - /** The number of Deployments with Restarting or Dead or Created (other) state */ - unhealthy: I64; - /** The number of Deployments with Unknown state */ - unknown: I64; -} - -/** - * Gets a list of existing values used as extra args across other deployments. - * Useful to offer suggestions. Response: [ListCommonDeploymentExtraArgsResponse] - */ -export interface ListCommonDeploymentExtraArgs { - /** optional structured query to filter deployments. */ - query?: DeploymentQuery; -} - -/** - * Get the version of the Komodo Core api. - * Response: [GetVersionResponse]. - */ -export interface GetVersion { -} - -/** Response for [GetVersion]. */ -export interface GetVersionResponse { - /** The version of the core api. */ - version: string; -} - -/** - * Get info about the core api configuration. - * Response: [GetCoreInfoResponse]. - */ -export interface GetCoreInfo { -} - -/** Response for [GetCoreInfo]. */ -export interface GetCoreInfoResponse { - /** The title assigned to this core api. */ - title: string; - /** The monitoring interval of this core api. */ - monitoring_interval: Timelength; - /** The webhook base url. */ - webhook_base_url: string; - /** Whether transparent mode is enabled, which gives all users read access to all resources. */ - transparent_mode: boolean; - /** Whether UI write access should be disabled */ - ui_write_disabled: boolean; - /** Whether non admins can create resources */ - disable_non_admin_create: boolean; - /** Whether confirm dialog should be disabled */ - disable_confirm_dialog: boolean; - /** The repo owners for which github webhook management api is available */ - github_webhook_owners: string[]; -} - -/** - * List the git providers available in Core / Periphery config files. - * Response: [ListGitProvidersFromConfigResponse]. - * - * Includes: - * - providers in core config - * - providers configured on builds, repos, syncs - * - providers on the optional Server or Builder - */ -export interface ListGitProvidersFromConfig { - /** - * Accepts an optional Server or Builder target to expand the core list with - * providers available on that specific resource. - */ - target?: ResourceTarget; -} - -/** - * List the docker registry providers available in Core / Periphery config files. - * Response: [ListDockerRegistriesFromConfigResponse]. - * - * Includes: - * - registries in core config - * - registries configured on builds, deployments - * - registries on the optional Server or Builder - */ -export interface ListDockerRegistriesFromConfig { - /** - * Accepts an optional Server or Builder target to expand the core list with - * providers available on that specific resource. - */ - target?: ResourceTarget; -} - -/** - * List the available secrets from the core config. - * Response: [ListSecretsResponse]. - */ -export interface ListSecrets { - /** - * Accepts an optional Server or Builder target to expand the core list with - * providers available on that specific resource. - */ - target?: ResourceTarget; -} - -/** - * List permissions for the calling user. - * Does not include any permissions on UserGroups they may be a part of. - * Response: [ListPermissionsResponse] - */ -export interface ListPermissions { -} - -/** - * Gets the calling user's permission level on a specific resource. - * Factors in any UserGroup's permissions they may be a part of. - * Response: [PermissionLevel] - */ -export interface GetPermissionLevel { - /** The target to get user permission on. */ - target: ResourceTarget; -} - -/** - * List permissions for a specific user. **Admin only**. - * Response: [ListUserTargetPermissionsResponse] - */ -export interface ListUserTargetPermissions { - /** Specify either a user or a user group. */ - user_target: UserTarget; -} - -/** Get a specific procedure. Response: [Procedure]. */ -export interface GetProcedure { - /** Id or name */ - procedure: string; -} - -/** List procedures matching optional query. Response: [ListProceduresResponse]. */ -export interface ListProcedures { - /** optional structured query to filter procedures. */ - query?: ProcedureQuery; -} - -/** List procedures matching optional query. Response: [ListFullProceduresResponse]. */ -export interface ListFullProcedures { - /** optional structured query to filter procedures. */ - query?: ProcedureQuery; -} - -/** Get current action state for the procedure. Response: [ProcedureActionState]. */ -export interface GetProcedureActionState { - /** Id or name */ - procedure: string; -} - -/** - * Gets a summary of data relating to all procedures. - * Response: [GetProceduresSummaryResponse]. - */ -export interface GetProceduresSummary { -} - -/** Response for [GetProceduresSummary]. */ -export interface GetProceduresSummaryResponse { - /** The total number of procedures. */ - total: number; - /** The number of procedures with Ok state. */ - ok: number; - /** The number of procedures currently running. */ - running: number; - /** The number of procedures with failed state. */ - failed: number; - /** The number of procedures with unknown state. */ - unknown: number; -} - -/** - * Get a specific git provider account. - * Response: [GetGitProviderAccountResponse]. - */ -export interface GetGitProviderAccount { - id: string; -} - -/** - * List git provider accounts matching optional query. - * Response: [ListGitProvidersResponse]. - */ -export interface ListGitProviderAccounts { - /** Optionally filter by accounts with a specific domain. */ - domain?: string; - /** Optionally filter by accounts with a specific username. */ - username?: string; -} - -/** - * Get a specific docker registry account. - * Response: [GetDockerRegistryAccountResponse]. - */ -export interface GetDockerRegistryAccount { - id: string; -} - -/** - * List docker registry accounts matching optional query. - * Response: [ListDockerRegistrysResponse]. - */ -export interface ListDockerRegistryAccounts { - /** Optionally filter by accounts with a specific domain. */ - domain?: string; - /** Optionally filter by accounts with a specific username. */ - username?: string; -} - -/** Get a specific repo. Response: [Repo]. */ -export interface GetRepo { - /** Id or name */ - repo: string; -} - -/** List repos matching optional query. Response: [ListReposResponse]. */ -export interface ListRepos { - /** optional structured query to filter repos. */ - query?: RepoQuery; -} - -/** List repos matching optional query. Response: [ListFullReposResponse]. */ -export interface ListFullRepos { - /** optional structured query to filter repos. */ - query?: RepoQuery; -} - -/** Get current action state for the repo. Response: [RepoActionState]. */ -export interface GetRepoActionState { - /** Id or name */ - repo: string; -} - -/** - * Gets a summary of data relating to all repos. - * Response: [GetReposSummaryResponse]. - */ -export interface GetReposSummary { -} - -/** Response for [GetReposSummary] */ -export interface GetReposSummaryResponse { - /** The total number of repos */ - total: number; - /** The number of repos with Ok state. */ - ok: number; - /** The number of repos currently cloning. */ - cloning: number; - /** The number of repos currently pulling. */ - pulling: number; - /** The number of repos currently building. */ - building: number; - /** The number of repos with failed state. */ - failed: number; - /** The number of repos with unknown state. */ - unknown: number; -} - -/** Get a target Repo's configured webhooks. Response: [GetRepoWebhooksEnabledResponse]. */ -export interface GetRepoWebhooksEnabled { - /** Id or name */ - repo: string; -} - -/** Response for [GetRepoWebhooksEnabled] */ -export interface GetRepoWebhooksEnabledResponse { - /** - * Whether the repo webhooks can even be managed. - * The repo owner must be in `github_webhook_app.owners` list to be managed. - */ - managed: boolean; - /** Whether pushes to branch trigger clone. Will always be false if managed is false. */ - clone_enabled: boolean; - /** Whether pushes to branch trigger pull. Will always be false if managed is false. */ - pull_enabled: boolean; - /** Whether pushes to branch trigger build. Will always be false if managed is false. */ - build_enabled: boolean; -} - -/** Find resources matching a common query. Response: [FindResourcesResponse]. */ -export interface FindResources { - /** The mongo query as JSON */ - query?: MongoDocument; - /** The resource variants to include in the response. */ - resources?: ResourceTarget["type"][]; -} - -/** Response for [FindResources]. */ -export interface FindResourcesResponse { - /** The matching servers. */ - servers: ServerListItem[]; - /** The matching deployments. */ - deployments: DeploymentListItem[]; - /** The matching builds. */ - builds: BuildListItem[]; - /** The matching repos. */ - repos: RepoListItem[]; - /** The matching procedures. */ - procedures: ProcedureListItem[]; -} - -/** Get a specific server. Response: [Server]. */ -export interface GetServer { - /** Id or name */ - server: string; -} - -/** List servers matching optional query. Response: [ListServersResponse]. */ -export interface ListServers { - /** optional structured query to filter servers. */ - query?: ServerQuery; -} - -/** List servers matching optional query. Response: [ListFullServersResponse]. */ -export interface ListFullServers { - /** optional structured query to filter servers. */ - query?: ServerQuery; -} - -/** Get the state of the target server. Response: [GetServerStateResponse]. */ -export interface GetServerState { - /** Id or name */ - server: string; -} - -/** The response for [GetServerState]. */ -export interface GetServerStateResponse { - /** The server status. */ - status: ServerState; -} - -/** Get current action state for the servers. Response: [ServerActionState]. */ -export interface GetServerActionState { - /** Id or name */ - server: string; -} - -/** - * Get the version of the Komodo Periphery agent on the target server. - * Response: [GetPeripheryVersionResponse]. - */ -export interface GetPeripheryVersion { - /** Id or name */ - server: string; -} - -/** Response for [GetPeripheryVersion]. */ -export interface GetPeripheryVersionResponse { - /** The version of periphery. */ - version: string; -} - -/** List the docker networks on the server. Response: [ListDockerNetworksResponse]. */ -export interface ListDockerNetworks { - /** Id or name */ - server: string; -} - -/** Inspect a docker network on the server. Response: [InspectDockerNetworkResponse]. */ -export interface InspectDockerNetwork { - /** Id or name */ - server: string; - /** The network name */ - network: string; -} - -/** - * List the docker images locally cached on the target server. - * Response: [ListDockerImagesResponse]. - */ -export interface ListDockerImages { - /** Id or name */ - server: string; -} - -/** Inspect a docker image on the server. Response: [Image]. */ -export interface InspectDockerImage { - /** Id or name */ - server: string; - /** The image name */ - image: string; -} - -/** Get image history from the server. Response: [ListDockerImageHistoryResponse]. */ -export interface ListDockerImageHistory { - /** Id or name */ - server: string; - /** The image name */ - image: string; -} - -/** - * List all docker containers on the target server. - * Response: [ListDockerContainersResponse]. - */ -export interface ListDockerContainers { - /** Id or name */ - server: string; -} - -/** - * List all docker containers on the target server. - * Response: [ListDockerContainersResponse]. - */ -export interface ListAllDockerContainers { - /** Filter by server id or name. */ - servers?: string[]; -} - -/** Inspect a docker container on the server. Response: [Container]. */ -export interface InspectDockerContainer { - /** Id or name */ - server: string; - /** The container name */ - container: string; -} - -/** - * Get the container log's tail, split by stdout/stderr. - * Response: [Log]. - * - * Note. This call will hit the underlying server directly for most up to date log. - */ -export interface GetContainerLog { - /** Id or name */ - server: string; - /** The container name */ - container: string; - /** - * The number of lines of the log tail to include. - * Default: 100. - * Max: 5000. - */ - tail: U64; - /** Enable `--timestamps` */ - timestamps?: boolean; -} - -/** - * Search the container log's tail using `grep`. All lines go to stdout. - * Response: [Log]. - * - * Note. This call will hit the underlying server directly for most up to date log. - */ -export interface SearchContainerLog { - /** Id or name */ - server: string; - /** The container name */ - container: string; - /** The terms to search for. */ - terms: string[]; - /** - * When searching for multiple terms, can use `AND` or `OR` combinator. - * - * - `AND`: Only include lines with **all** terms present in that line. - * - `OR`: Include lines that have one or more matches in the terms. - */ - combinator?: SearchCombinator; - /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ - invert?: boolean; - /** Enable `--timestamps` */ - timestamps?: boolean; -} - -/** Inspect a docker container on the server. Response: [Container]. */ -export interface GetResourceMatchingContainer { - /** Id or name */ - server: string; - /** The container name */ - container: string; -} - -export interface GetResourceMatchingContainerResponse { - resource?: ResourceTarget; -} - -/** - * List all docker volumes on the target server. - * Response: [ListDockerVolumesResponse]. - */ -export interface ListDockerVolumes { - /** Id or name */ - server: string; -} - -/** Inspect a docker volume on the server. Response: [Volume]. */ -export interface InspectDockerVolume { - /** Id or name */ - server: string; - /** The volume name */ - volume: string; -} - -/** - * List all docker compose projects on the target server. - * Response: [ListComposeProjectsResponse]. - */ -export interface ListComposeProjects { - /** Id or name */ - server: string; -} - -/** - * Get the system information of the target server. - * Response: [SystemInformation]. - */ -export interface GetSystemInformation { - /** Id or name */ - server: string; -} - -/** - * Get the system stats on the target server. Response: [SystemStats]. - * - * Note. This does not hit the server directly. The stats come from an - * in memory cache on the core, which hits the server periodically - * to keep it up to date. - */ -export interface GetSystemStats { - /** Id or name */ - server: string; -} - -/** - * List the processes running on the target server. - * Response: [ListSystemProcessesResponse]. - * - * Note. This does not hit the server directly. The procedures come from an - * in memory cache on the core, which hits the server periodically - * to keep it up to date. - */ -export interface ListSystemProcesses { - /** Id or name */ - server: string; -} - -/** - * Paginated endpoint serving historical (timeseries) server stats for graphing. - * Response: [GetHistoricalServerStatsResponse]. - */ -export interface GetHistoricalServerStats { - /** Id or name */ - server: string; - /** The granularity of the data. */ - granularity: Timelength; - /** - * Page of historical data. Default is 0, which is the most recent data. - * Use with the `next_page` field of the response. - */ - page?: number; -} - -/** System stats stored on the database. */ -export interface SystemStatsRecord { - /** Unix timestamp in milliseconds */ - ts: I64; - /** Server id */ - sid: string; - /** Cpu usage percentage */ - cpu_perc: number; - /** Memory used in GB */ - mem_used_gb: number; - /** Total memory in GB */ - mem_total_gb: number; - /** Disk used in GB */ - disk_used_gb: number; - /** Total disk size in GB */ - disk_total_gb: number; - /** Breakdown of individual disks, ie their usages, sizes, and mount points */ - disks: SingleDiskUsage[]; -} - -/** Response to [GetHistoricalServerStats]. */ -export interface GetHistoricalServerStatsResponse { - /** The timeseries page of data. */ - stats: SystemStatsRecord[]; - /** If there is a next page of data, pass this to `page` to get it. */ - next_page?: number; -} - -/** - * Gets a summary of data relating to all servers. - * Response: [GetServersSummaryResponse]. - */ -export interface GetServersSummary { -} - -/** Response for [GetServersSummary]. */ -export interface GetServersSummaryResponse { - /** The total number of servers. */ - total: I64; - /** The number of healthy (`status: OK`) servers. */ - healthy: I64; - /** The number of unhealthy servers. */ - unhealthy: I64; - /** The number of disabled servers. */ - disabled: I64; -} - -/** Get a specific server template by id or name. Response: [ServerTemplate]. */ -export interface GetServerTemplate { - /** Id or name */ - server_template: string; -} - -/** List server templates matching structured query. Response: [ListServerTemplatesResponse]. */ -export interface ListServerTemplates { - query?: ServerTemplateQuery; -} - -/** List server templates matching structured query. Response: [ListFullServerTemplatesResponse]. */ -export interface ListFullServerTemplates { - query?: ServerTemplateQuery; -} - -/** - * Gets a summary of data relating to all server templates. - * Response: [GetServerTemplatesSummaryResponse]. - */ -export interface GetServerTemplatesSummary { -} - -/** Response for [GetServerTemplatesSummary]. */ -export interface GetServerTemplatesSummaryResponse { - /** The total number of server templates. */ - total: number; -} - -/** Get a specific stack. Response: [Stack]. */ -export interface GetStack { - /** Id or name */ - stack: string; -} - -/** Lists a specific stacks services (the containers). Response: [ListStackServicesResponse]. */ -export interface ListStackServices { - /** Id or name */ - stack: string; -} - -/** Get a stack service's log. Response: [GetStackContainersResponse]. */ -export interface GetStackServiceLog { - /** Id or name */ - stack: string; - /** The service to get the log for. */ - service: string; - /** - * The number of lines of the log tail to include. - * Default: 100. - * Max: 5000. - */ - tail: U64; - /** Enable `--timestamps` */ - timestamps?: boolean; -} - -/** - * Search the deployment log's tail using `grep`. All lines go to stdout. - * Response: [Log]. - * - * Note. This call will hit the underlying server directly for most up to date log. - */ -export interface SearchStackServiceLog { - /** Id or name */ - stack: string; - /** The service to get the log for. */ - service: string; - /** The terms to search for. */ - terms: string[]; - /** - * When searching for multiple terms, can use `AND` or `OR` combinator. - * - * - `AND`: Only include lines with **all** terms present in that line. - * - `OR`: Include lines that have one or more matches in the terms. - */ - combinator?: SearchCombinator; - /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ - invert?: boolean; - /** Enable `--timestamps` */ - timestamps?: boolean; -} - -/** - * Gets a list of existing values used as extra args across other stacks. - * Useful to offer suggestions. Response: [ListCommonStackExtraArgsResponse] - */ -export interface ListCommonStackExtraArgs { - /** optional structured query to filter stacks. */ - query?: StackQuery; -} - -/** - * Gets a list of existing values used as build extra args across other stacks. - * Useful to offer suggestions. Response: [ListCommonStackBuildExtraArgsResponse] - */ -export interface ListCommonStackBuildExtraArgs { - /** optional structured query to filter stacks. */ - query?: StackQuery; -} - -/** List stacks matching optional query. Response: [ListStacksResponse]. */ -export interface ListStacks { - /** optional structured query to filter syncs. */ - query?: StackQuery; -} - -/** List stacks matching optional query. Response: [ListFullStacksResponse]. */ -export interface ListFullStacks { - /** optional structured query to filter stacks. */ - query?: StackQuery; -} - -/** Get current action state for the stack. Response: [StackActionState]. */ -export interface GetStackActionState { - /** Id or name */ - stack: string; -} - -/** - * Gets a summary of data relating to all syncs. - * Response: [GetStacksSummaryResponse]. - */ -export interface GetStacksSummary { -} - -/** Response for [GetStacksSummary] */ -export interface GetStacksSummaryResponse { - /** The total number of stacks */ - total: number; - /** The number of stacks with Running state. */ - running: number; - /** The number of stacks with Stopped or Paused state. */ - stopped: number; - /** The number of stacks with Down state. */ - down: number; - /** The number of stacks with Unhealthy or Restarting or Dead or Created or Removing state. */ - unhealthy: number; - /** The number of stacks with Unknown state. */ - unknown: number; -} - -/** Get a target stack's configured webhooks. Response: [GetStackWebhooksEnabledResponse]. */ -export interface GetStackWebhooksEnabled { - /** Id or name */ - stack: string; -} - -/** Response for [GetStackWebhooksEnabled] */ -export interface GetStackWebhooksEnabledResponse { - /** - * Whether the repo webhooks can even be managed. - * The repo owner must be in `github_webhook_app.owners` list to be managed. - */ - managed: boolean; - /** Whether pushes to branch trigger refresh. Will always be false if managed is false. */ - refresh_enabled: boolean; - /** Whether pushes to branch trigger stack execution. Will always be false if managed is false. */ - deploy_enabled: boolean; -} - -/** Get a specific sync. Response: [ResourceSync]. */ -export interface GetResourceSync { - /** Id or name */ - sync: string; -} - -/** List syncs matching optional query. Response: [ListResourceSyncsResponse]. */ -export interface ListResourceSyncs { - /** optional structured query to filter syncs. */ - query?: ResourceSyncQuery; -} - -/** List syncs matching optional query. Response: [ListFullResourceSyncsResponse]. */ -export interface ListFullResourceSyncs { - /** optional structured query to filter syncs. */ - query?: ResourceSyncQuery; -} - -/** Get current action state for the sync. Response: [ResourceSyncActionState]. */ -export interface GetResourceSyncActionState { - /** Id or name */ - sync: string; -} - -/** - * Gets a summary of data relating to all syncs. - * Response: [GetResourceSyncsSummaryResponse]. - */ -export interface GetResourceSyncsSummary { -} - -/** Response for [GetResourceSyncsSummary] */ -export interface GetResourceSyncsSummaryResponse { - /** The total number of syncs */ - total: number; - /** The number of syncs with Ok state. */ - ok: number; - /** The number of syncs currently syncing. */ - syncing: number; - /** The number of syncs with pending updates */ - pending: number; - /** The number of syncs with failed state. */ - failed: number; - /** The number of syncs with unknown state. */ - unknown: number; -} - -/** Get a target Sync's configured webhooks. Response: [GetSyncWebhooksEnabledResponse]. */ -export interface GetSyncWebhooksEnabled { - /** Id or name */ - sync: string; -} - -/** Response for [GetSyncWebhooksEnabled] */ -export interface GetSyncWebhooksEnabledResponse { - /** - * Whether the repo webhooks can even be managed. - * The repo owner must be in `github_webhook_app.owners` list to be managed. - */ - managed: boolean; - /** Whether pushes to branch trigger refresh. Will always be false if managed is false. */ - refresh_enabled: boolean; - /** Whether pushes to branch trigger sync execution. Will always be false if managed is false. */ - sync_enabled: boolean; -} - -/** Get data for a specific tag. Response [Tag]. */ -export interface GetTag { - /** Id or name */ - tag: string; -} - -/** - * List data for tags matching optional mongo query. - * Response: [ListTagsResponse]. - */ -export interface ListTags { - query?: MongoDocument; -} - -/** - * Get pretty formatted monrun sync toml for all resources - * which the user has permissions to view. - * Response: [TomlResponse]. - */ -export interface ExportAllResourcesToToml { - /** Tag name or id. Empty array will not filter by tag. */ - tags?: string[]; -} - -/** - * Get pretty formatted monrun sync toml for specific resources and user groups. - * Response: [TomlResponse]. - */ -export interface ExportResourcesToToml { - /** The targets to include in the export. */ - targets?: ResourceTarget[]; - /** The user group names or ids to include in the export. */ - user_groups?: string[]; - /** Whether to include variables */ - include_variables?: boolean; -} - -/** - * Get all data for the target update. - * Response: [Update]. - */ -export interface GetUpdate { - /** The update id. */ - id: string; -} - -/** - * Paginated endpoint for updates matching optional query. - * More recent updates will be returned first. - */ -export interface ListUpdates { - /** An optional mongo query to filter the updates. */ - query?: MongoDocument; - /** - * Page of updates. Default is 0, which is the most recent data. - * Use with the `next_page` field of the response. - */ - page?: number; -} - -/** Minimal representation of an action performed by Komodo. */ -export interface UpdateListItem { - /** The id of the update */ - id: string; - /** Which operation was run */ - operation: Operation; - /** The starting time of the operation */ - start_ts: I64; - /** Whether the operation was successful */ - success: boolean; - /** The username of the user performing update */ - username: string; - /** - * The user id that triggered the update. - * - * Also can take these values for operations triggered automatically: - * - `Procedure`: The operation was triggered as part of a procedure run - * - `Github`: The operation was triggered by a github webhook - * - `Auto Redeploy`: The operation (always `Deploy`) was triggered by an attached build finishing. - */ - operator: string; - /** The target resource to which this update refers */ - target: ResourceTarget; - /** - * The status of the update - * - `Queued` - * - `InProgress` - * - `Complete` - */ - status: UpdateStatus; - /** An optional version on the update, ie build version or deployed version. */ - version?: Version; - /** Some unstructured, operation specific data. Not for general usage. */ - other_data?: string; -} - -/** Response for [ListUpdates]. */ -export interface ListUpdatesResponse { - /** The page of updates, sorted by timestamp descending. */ - updates: UpdateListItem[]; - /** If there is a next page of data, pass this to `page` to get it. */ - next_page?: number; -} - -/** - * Gets list of api keys for the calling user. - * Response: [ListApiKeysResponse] - */ -export interface ListApiKeys { -} - -/** - * **Admin only.** - * Gets list of api keys for the user. - * Will still fail if you call for a user_id that isn't a service user. - * Response: [ListApiKeysForServiceUserResponse] - */ -export interface ListApiKeysForServiceUser { - /** Id or username */ - user: string; -} - -/** - * **Admin only.** - * Find a user. - * Response: [FindUserResponse] - */ -export interface FindUser { - /** Id or username */ - user: string; -} - -/** - * **Admin only.** - * Gets list of Komodo users. - * Response: [ListUsersResponse] - */ -export interface ListUsers { -} - -/** - * Gets the username of a specific user. - * Response: [GetUsernameResponse] - */ -export interface GetUsername { - /** The id of the user. */ - user_id: string; -} - -/** Response for [GetUsername]. */ -export interface GetUsernameResponse { - /** The username of the user. */ - username: string; - /** An optional icon for the user. */ - avatar?: string; -} - -/** - * Get a specific user group by name or id. - * Response: [UserGroup]. - */ -export interface GetUserGroup { - /** Name or Id */ - user_group: string; -} - -/** - * List all user groups which user can see. Response: [ListUserGroupsResponse]. - * - * Admins can see all user groups, - * and users can see user groups to which they belong. - */ -export interface ListUserGroups { -} - -/** - * List all available global variables. - * Response: [Variable] - * - * Note. For non admin users making this call, - * secret variables will have their values obscured. - */ -export interface GetVariable { - /** The name of the variable to get. */ - name: string; -} - -/** - * List all available global variables. - * Response: [ListVariablesResponse] - * - * Note. For non admin users making this call, - * secret variables will have their values obscured. - */ -export interface ListVariables { -} - -/** - * Push a resource to the front of the users 10 most recently viewed resources. - * Response: [NoData]. - */ -export interface PushRecentlyViewed { - /** The target to push. */ - resource: ResourceTarget; -} - -/** - * Set the time the user last opened the UI updates. - * Used for unseen notification dot. - * Response: [NoData] - */ -export interface SetLastSeenUpdate { -} - -/** - * Create an api key for the calling user. - * Response: [CreateApiKeyResponse]. - * - * Note. After the response is served, there will be no way - * to get the secret later. - */ -export interface CreateApiKey { - /** The name for the api key. */ - name: string; - /** - * A unix timestamp in millseconds specifying api key expire time. - * Default is 0, which means no expiry. - */ - expires?: I64; -} - -/** - * Delete an api key for the calling user. - * Response: [NoData] - */ -export interface DeleteApiKey { - /** The key which the user intends to delete. */ - key: string; -} - -/** Create an alerter. Response: [Alerter]. */ -export interface CreateAlerter { - /** The name given to newly created alerter. */ - name: string; - /** Optional partial config to initialize the alerter with. */ - config: _PartialAlerterConfig; -} - -/** - * Creates a new alerter with given `name` and the configuration - * of the alerter at the given `id`. Response: [Alerter]. - */ -export interface CopyAlerter { - /** The name of the new alerter. */ - name: string; - /** The id of the alerter to copy. */ - id: string; -} - -/** - * Deletes the alerter at the given id, and returns the deleted alerter. - * Response: [Alerter] - */ -export interface DeleteAlerter { - /** The id or name of the alerter to delete. */ - id: string; -} - -/** - * Update the alerter at the given id, and return the updated alerter. Response: [Alerter]. - * - * Note. This method updates only the fields which are set in the [PartialAlerterConfig][crate::entities::alerter::PartialAlerterConfig], - * effectively merging diffs into the final document. This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateAlerter { - /** The id of the alerter to update. */ - id: string; - /** The partial config update to apply. */ - config: _PartialAlerterConfig; -} - -/** - * Admin only method to create an api key for a service user. - * Response: [CreateApiKeyResponse]. - */ -export interface CreateApiKeyForServiceUser { - /** Must be service user */ - user_id: string; - /** The name for the api key */ - name: string; - /** - * A unix timestamp in millseconds specifying api key expire time. - * Default is 0, which means no expiry. - */ - expires?: I64; -} - -/** - * Admin only method to delete an api key for a service user. - * Response: [NoData]. - */ -export interface DeleteApiKeyForServiceUser { - key: string; -} - -/** Create a build. Response: [Build]. */ -export interface CreateBuild { - /** The name given to newly created build. */ - name: string; - /** Optional partial config to initialize the build with. */ - config: _PartialBuildConfig; -} - -/** - * Creates a new build with given `name` and the configuration - * of the build at the given `id`. Response: [Build]. - */ -export interface CopyBuild { - /** The name of the new build. */ - name: string; - /** The id of the build to copy. */ - id: string; -} - -/** - * Deletes the build at the given id, and returns the deleted build. - * Response: [Build] - */ -export interface DeleteBuild { - /** The id or name of the build to delete. */ - id: string; -} - -/** - * Update the build at the given id, and return the updated build. - * Response: [Build]. - * - * Note. This method updates only the fields which are set in the [_PartialBuildConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateBuild { - /** The id of the build to update. */ - id: string; - /** The partial config update to apply. */ - config: _PartialBuildConfig; -} - -/** Trigger a refresh of the cached latest hash and message. */ -export interface RefreshBuildCache { - /** Id or name */ - build: string; -} - -/** - * Create a webhook on the github repo attached to the build - * passed in request. Response: [CreateBuildWebhookResponse] - */ -export interface CreateBuildWebhook { - /** Id or name */ - build: string; -} - -/** - * Delete a webhook on the github repo attached to the build - * passed in request. Response: [CreateBuildWebhookResponse] - */ -export interface DeleteBuildWebhook { - /** Id or name */ - build: string; -} - -/** Partial representation of [BuilderConfig] */ -export type PartialBuilderConfig = - | { type: "Server", params: _PartialServerBuilderConfig } - | { type: "Aws", params: _PartialAwsBuilderConfig }; - -/** Create a builder. Response: [Builder]. */ -export interface CreateBuilder { - /** The name given to newly created builder. */ - name: string; - /** Optional partial config to initialize the builder with. */ - config: PartialBuilderConfig; -} - -/** - * Creates a new builder with given `name` and the configuration - * of the builder at the given `id`. Response: [Builder] - */ -export interface CopyBuilder { - /** The name of the new builder. */ - name: string; - /** The id of the builder to copy. */ - id: string; -} - -/** - * Deletes the builder at the given id, and returns the deleted builder. - * Response: [Builder] - */ -export interface DeleteBuilder { - /** The id or name of the builder to delete. */ - id: string; -} - -/** - * Update the builder at the given id, and return the updated builder. - * Response: [Builder]. - * - * Note. This method updates only the fields which are set in the [PartialBuilderConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateBuilder { - /** The id of the builder to update. */ - id: string; - /** The partial config update to apply. */ - config: PartialBuilderConfig; -} - -/** Create a deployment. Response: [Deployment]. */ -export interface CreateDeployment { - /** The name given to newly created deployment. */ - name: string; - /** Optional partial config to initialize the deployment with. */ - config: _PartialDeploymentConfig; -} - -/** - * Creates a new deployment with given `name` and the configuration - * of the deployment at the given `id`. Response: [Deployment] - */ -export interface CopyDeployment { - /** The name of the new deployment. */ - name: string; - /** The id of the deployment to copy. */ - id: string; -} - -/** - * Deletes the deployment at the given id, and returns the deleted deployment. - * Response: [Deployment]. - * - * Note. If the associated container is running, it will be deleted as part of - * the deployment clean up. - */ -export interface DeleteDeployment { - /** The id or name of the deployment to delete. */ - id: string; -} - -/** - * Update the deployment at the given id, and return the updated deployment. - * Response: [Deployment]. - * - * Note. If the attached server for the deployment changes, - * the deployment will be deleted / cleaned up on the old server. - * - * Note. This method updates only the fields which are set in the [_PartialDeploymentConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateDeployment { - /** The deployment id to update. */ - id: string; - /** The partial config update. */ - config: _PartialDeploymentConfig; -} - -/** - * Rename the deployment at id to the given name. Response: [Update]. - * - * Note. If a container is created for the deployment, it will be renamed using - * `docker rename ...`. - */ -export interface RenameDeployment { - /** The id of the deployment to rename. */ - id: string; - /** The new name. */ - name: string; -} - -/** - * Update a resources description. - * Response: [NoData]. - */ -export interface UpdateDescription { - /** The target resource to set description for. */ - target: ResourceTarget; - /** The new description. */ - description: string; -} - -/** - * **Admin only.** Update a user or user groups permission on a resource. - * Response: [NoData]. - */ -export interface UpdatePermissionOnTarget { - /** Specify the user or user group. */ - user_target: UserTarget; - /** Specify the target resource. */ - resource_target: ResourceTarget; - /** Specify the permission level. */ - permission: PermissionLevel; -} - -/** - * **Admin only.** Update a user or user groups base permission level on a resource type. - * Response: [NoData]. - */ -export interface UpdatePermissionOnResourceType { - /** Specify the user or user group. */ - user_target: UserTarget; - /** The resource type: eg. Server, Build, Deployment, etc. */ - resource_type: ResourceTarget["type"]; - /** The base permission level. */ - permission: PermissionLevel; -} - -/** - * **Admin only.** Update a user's "base" permissions, eg. "enabled". - * Response: [NoData]. - */ -export interface UpdateUserBasePermissions { - /** The target user. */ - user_id: string; - /** If specified, will update users enabled state. */ - enabled?: boolean; - /** If specified, will update user's ability to create servers. */ - create_servers?: boolean; - /** If specified, will update user's ability to create builds. */ - create_builds?: boolean; -} - -/** - * **Super Admin only.** Update's whether a user is admin. - * Response: [NoData]. - */ -export interface UpdateUserAdmin { - /** The target user. */ - user_id: string; - /** Whether user should be admin. */ - admin: boolean; -} - -/** Create a procedure. Response: [Procedure]. */ -export interface CreateProcedure { - /** The name given to newly created build. */ - name: string; - /** Optional partial config to initialize the procedure with. */ - config: _PartialProcedureConfig; -} - -/** - * Creates a new procedure with given `name` and the configuration - * of the procedure at the given `id`. Response: [Procedure]. - */ -export interface CopyProcedure { - /** The name of the new procedure. */ - name: string; - /** The id of the procedure to copy. */ - id: string; -} - -/** - * Deletes the procedure at the given id, and returns the deleted procedure. - * Response: [Procedure] - */ -export interface DeleteProcedure { - /** The id or name of the procedure to delete. */ - id: string; -} - -/** - * Update the procedure at the given id, and return the updated procedure. - * Response: [Procedure]. - * - * Note. This method updates only the fields which are set in the [_PartialProcedureConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateProcedure { - /** The id of the procedure to update. */ - id: string; - /** The partial config update. */ - config: _PartialProcedureConfig; -} - -/** - * **Admin only.** Create a git provider account. - * Response: [GitProviderAccount]. - */ -export interface CreateGitProviderAccount { - /** - * The initial account config. Anything in the _id field will be ignored, - * as this is generated on creation. - */ - account: _PartialGitProviderAccount; -} - -/** - * **Admin only.** Update a git provider account. - * Response: [GitProviderAccount]. - */ -export interface UpdateGitProviderAccount { - /** The id of the git provider account to update. */ - id: string; - /** The partial git provider account. */ - account: _PartialGitProviderAccount; -} - -/** - * **Admin only.** Delete a git provider account. - * Response: [User]. - */ -export interface DeleteGitProviderAccount { - /** The id of the git provider to delete */ - id: string; -} - -/** - * **Admin only.** Create a docker registry account. - * Response: [DockerRegistryAccount]. - */ -export interface CreateDockerRegistryAccount { - account: _PartialDockerRegistryAccount; -} - -/** - * **Admin only.** Update a docker registry account. - * Response: [DockerRegistryAccount]. - */ -export interface UpdateDockerRegistryAccount { - /** The id of the docker registry to update */ - id: string; - /** The partial docker registry account. */ - account: _PartialDockerRegistryAccount; -} - -/** - * **Admin only.** Delete a docker registry account. - * Response: [DockerRegistryAccount]. - */ -export interface DeleteDockerRegistryAccount { - /** The id of the docker registry account to delete */ - id: string; -} - -/** Create a repo. Response: [Repo]. */ -export interface CreateRepo { - /** The name given to newly created repo. */ - name: string; - /** Optional partial config to initialize the repo with. */ - config: _PartialRepoConfig; -} - -/** - * Creates a new repo with given `name` and the configuration - * of the repo at the given `id`. Response: [Repo]. - */ -export interface CopyRepo { - /** The name of the new repo. */ - name: string; - /** The id of the repo to copy. */ - id: string; -} - -/** - * Deletes the repo at the given id, and returns the deleted repo. - * Response: [Repo] - */ -export interface DeleteRepo { - /** The id or name of the repo to delete. */ - id: string; -} - -/** - * Update the repo at the given id, and return the updated repo. - * Response: [Repo]. - * - * Note. If the attached server for the repo changes, - * the repo will be deleted / cleaned up on the old server. - * - * Note. This method updates only the fields which are set in the [_PartialRepoConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateRepo { - /** The id of the repo to update. */ - id: string; - /** The partial config update to apply. */ - config: _PartialRepoConfig; -} - -/** Trigger a refresh of the cached latest hash and message. */ -export interface RefreshRepoCache { - /** Id or name */ - repo: string; -} - -export enum RepoWebhookAction { - Clone = "Clone", - Pull = "Pull", - Build = "Build", -} - -/** - * Create a webhook on the github repo attached to the (Komodo) Repo resource. - * passed in request. Response: [CreateRepoWebhookResponse] - */ -export interface CreateRepoWebhook { - /** Id or name */ - repo: string; - /** "Clone" or "Pull" */ - action: RepoWebhookAction; -} - -/** - * Delete the webhook on the github repo attached to the (Komodo) Repo resource. - * passed in request. Response: [DeleteRepoWebhookResponse] - */ -export interface DeleteRepoWebhook { - /** Id or name */ - repo: string; - /** "Clone" or "Pull" */ - action: RepoWebhookAction; -} - -/** Create a server. Response: [Server]. */ -export interface CreateServer { - /** The name given to newly created server. */ - name: string; - /** Optional partial config to initialize the server with. */ - config: _PartialServerConfig; -} - -/** - * Deletes the server at the given id, and returns the deleted server. - * Response: [Server] - */ -export interface DeleteServer { - /** The id or name of the server to delete. */ - id: string; -} - -/** - * Update the server at the given id, and return the updated server. - * Response: [Server]. - * - * Note. This method updates only the fields which are set in the [_PartialServerConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateServer { - /** The id of the server to update. */ - id: string; - /** The partial config update to apply. */ - config: _PartialServerConfig; -} - -/** Rename the server at id to the given name. Response: [Update]. */ -export interface RenameServer { - /** The id of the server to rename. */ - id: string; - /** The new name. */ - name: string; -} - -/** - * Create a docker network on the server. - * Respone: [Update] - */ -export interface CreateNetwork { - /** Id or name */ - server: string; - /** The name of the network to create. */ - name: string; -} - -export type PartialServerTemplateConfig = - | { type: "Aws", params: _PartialAwsServerTemplateConfig } - | { type: "Hetzner", params: _PartialHetznerServerTemplateConfig }; - -/** Create a server template. Response: [ServerTemplate]. */ -export interface CreateServerTemplate { - /** The name given to newly created server template. */ - name: string; - /** Optional partial config to initialize the server template with. */ - config: PartialServerTemplateConfig; -} - -/** - * Creates a new server template with given `name` and the configuration - * of the server template at the given `id`. Response: [ServerTemplate] - */ -export interface CopyServerTemplate { - /** The name of the new server template. */ - name: string; - /** The id of the server template to copy. */ - id: string; -} - -/** - * Deletes the server template at the given id, and returns the deleted server template. - * Response: [ServerTemplate] - */ -export interface DeleteServerTemplate { - /** The id or name of the server template to delete. */ - id: string; -} - -/** - * Update the server template at the given id, and return the updated server template. - * Response: [ServerTemplate]. - * - * Note. This method updates only the fields which are set in the [PartialServerTemplateConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateServerTemplate { - /** The id of the server template to update. */ - id: string; - /** The partial config update to apply. */ - config: PartialServerTemplateConfig; -} - -/** Create a stack. Response: [Stack]. */ -export interface CreateStack { - /** The name given to newly created stack. */ - name: string; - /** Optional partial config to initialize the stack with. */ - config: _PartialStackConfig; -} - -/** - * Creates a new stack with given `name` and the configuration - * of the stack at the given `id`. Response: [Stack]. - */ -export interface CopyStack { - /** The name of the new stack. */ - name: string; - /** The id of the stack to copy. */ - id: string; -} - -/** - * Deletes the stack at the given id, and returns the deleted stack. - * Response: [Stack] - */ -export interface DeleteStack { - /** The id or name of the stack to delete. */ - id: string; -} - -/** - * Update the stack at the given id, and return the updated stack. - * Response: [Stack]. - * - * Note. If the attached server for the stack changes, - * the stack will be deleted / cleaned up on the old server. - * - * Note. This method updates only the fields which are set in the [_PartialStackConfig], - * merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateStack { - /** The id of the Stack to update. */ - id: string; - /** The partial config update to apply. */ - config: _PartialStackConfig; -} - -/** Rename the stack at id to the given name. Response: [Update]. */ -export interface RenameStack { - /** The id of the stack to rename. */ - id: string; - /** The new name. */ - name: string; -} - -/** Update file contents in Files on Server or Git Repo mode. Response: [Update]. */ -export interface WriteStackFileContents { - /** The name or id of the target Stack. */ - stack: string; - /** - * The file path relative to the stack run directory, - * or absolute path. - */ - file_path: string; - /** The contents to write. */ - contents: string; -} - -/** - * Trigger a refresh of the cached compose file contents. - * Refreshes: - * - Whether the remote file is missing - * - The latest json, and for repos, the remote contents, hash, and message. - */ -export interface RefreshStackCache { - /** Id or name */ - stack: string; -} - -export enum StackWebhookAction { - Refresh = "Refresh", - Deploy = "Deploy", -} - -/** - * Create a webhook on the github repo attached to the stack - * passed in request. Response: [CreateStackWebhookResponse] - */ -export interface CreateStackWebhook { - /** Id or name */ - stack: string; - /** "Refresh" or "Deploy" */ - action: StackWebhookAction; -} - -/** - * Delete the webhook on the github repo attached to the stack - * passed in request. Response: [DeleteStackWebhookResponse] - */ -export interface DeleteStackWebhook { - /** Id or name */ - stack: string; - /** "Refresh" or "Deploy" */ - action: StackWebhookAction; -} - -/** Create a sync. Response: [ResourceSync]. */ -export interface CreateResourceSync { - /** The name given to newly created sync. */ - name: string; - /** Optional partial config to initialize the sync with. */ - config: _PartialResourceSyncConfig; -} - -/** - * Creates a new sync with given `name` and the configuration - * of the sync at the given `id`. Response: [ResourceSync]. - */ -export interface CopyResourceSync { - /** The name of the new sync. */ - name: string; - /** The id of the sync to copy. */ - id: string; -} - -/** - * Deletes the sync at the given id, and returns the deleted sync. - * Response: [ResourceSync] - */ -export interface DeleteResourceSync { - /** The id or name of the sync to delete. */ - id: string; -} - -/** - * Update the sync at the given id, and return the updated sync. - * Response: [ResourceSync]. - * - * Note. This method updates only the fields which are set in the [_PartialResourceSyncConfig], - * effectively merging diffs into the final document. - * This is helpful when multiple users are using - * the same resources concurrently by ensuring no unintentional - * field changes occur from out of date local state. - */ -export interface UpdateResourceSync { - /** The id of the sync to update. */ - id: string; - /** The partial config update to apply. */ - config: _PartialResourceSyncConfig; -} - -/** Trigger a refresh of the computed diff logs for view. Response: [ResourceSync] */ -export interface RefreshResourceSyncPending { - /** Id or name */ - sync: string; -} - -/** Rename the stack at id to the given name. Response: [Update]. */ -export interface WriteSyncFileContents { - /** The name or id of the target Sync. */ - sync: string; - /** - * If this file was under a resource folder, this will be the folder. - * Otherwise, it should be empty string. - */ - resource_path: string; - /** The file path relative to the resource path. */ - file_path: string; - /** The contents to write. */ - contents: string; -} - -/** - * Exports matching resources, and writes to the target sync's resource file. Response: [Update] - * - * Note. Will fail if the Sync is not `managed`. - */ -export interface CommitSync { - /** Id or name */ - sync: string; -} - -export enum SyncWebhookAction { - Refresh = "Refresh", - Sync = "Sync", -} - -/** - * Create a webhook on the github repo attached to the sync - * passed in request. Response: [CreateSyncWebhookResponse] - */ -export interface CreateSyncWebhook { - /** Id or name */ - sync: string; - /** "Refresh" or "Sync" */ - action: SyncWebhookAction; -} - -/** - * Delete the webhook on the github repo attached to the sync - * passed in request. Response: [DeleteSyncWebhookResponse] - */ -export interface DeleteSyncWebhook { - /** Id or name */ - sync: string; - /** "Refresh" or "Sync" */ - action: SyncWebhookAction; -} - -/** Create a tag. Response: [Tag]. */ -export interface CreateTag { - /** The name of the tag. */ - name: string; -} - -/** - * Delete a tag, and return the deleted tag. Response: [Tag]. - * - * Note. Will also remove this tag from all attached resources. - */ -export interface DeleteTag { - /** The id of the tag to delete. */ - id: string; -} - -/** Rename a tag at id. Response: [Tag]. */ -export interface RenameTag { - /** The id of the tag to rename. */ - id: string; - /** The new name of the tag. */ - name: string; -} - -/** - * Update the tags on a resource. - * Response: [NoData] - */ -export interface UpdateTagsOnResource { - target: ResourceTarget; - /** Tag Ids */ - tags: string[]; -} - -/** - * **Only for local users**. Update the calling users username. - * Response: [NoData]. - */ -export interface UpdateUserUsername { - username: string; -} - -/** - * **Only for local users**. Update the calling users password. - * Response: [NoData]. - */ -export interface UpdateUserPassword { - password: string; -} - -/** - * **Admin only**. Delete a user. - * Admins can delete any non-admin user. - * Only Super Admin can delete an admin. - * No users can delete a Super Admin user. - * User cannot delete themselves. - * Response: [NoData]. - */ -export interface DeleteUser { - /** User id or username */ - user: string; -} - -/** - * **Admin only.** Create a service user. - * Response: [User]. - */ -export interface CreateServiceUser { - /** The username for the service user. */ - username: string; - /** A description for the service user. */ - description: string; -} - -/** - * **Admin only.** Update a service user's description. - * Response: [User]. - */ -export interface UpdateServiceUserDescription { - /** The service user's username */ - username: string; - /** A new description for the service user. */ - description: string; -} - -/** **Admin only.** Create a user group. Response: [UserGroup] */ -export interface CreateUserGroup { - /** The name to assign to the new UserGroup */ - name: string; -} - -/** **Admin only.** Rename a user group. Response: [UserGroup] */ -export interface RenameUserGroup { - /** The id of the UserGroup */ - id: string; - /** The new name for the UserGroup */ - name: string; -} - -/** **Admin only.** Delete a user group. Response: [UserGroup] */ -export interface DeleteUserGroup { - /** The id of the UserGroup */ - id: string; -} +export type _Serror = __Serror; /** **Admin only.** Add a user to a user group. Response: [UserGroup] */ export interface AddUserToUserGroup { @@ -6241,90 +3385,6 @@ export interface AddUserToUserGroup { user: string; } -/** **Admin only.** Remove a user from a user group. Response: [UserGroup] */ -export interface RemoveUserFromUserGroup { - /** The name or id of UserGroup that user should be removed from. */ - user_group: string; - /** The id or username of the user to remove */ - user: string; -} - -/** - * **Admin only.** Completely override the user in the group. - * Response: [UserGroup] - */ -export interface SetUsersInUserGroup { - /** Id or name. */ - user_group: string; - /** The user ids or usernames to hard set as the group's users. */ - users: string[]; -} - -/** **Admin only.** Create variable. Response: [Variable]. */ -export interface CreateVariable { - /** The name of the variable to create. */ - name: string; - /** The initial value of the variable. defualt: "". */ - value?: string; - /** The initial value of the description. default: "". */ - description?: string; - /** Whether to make this a secret variable. */ - is_secret?: boolean; -} - -/** **Admin only.** Update variable value. Response: [Variable]. */ -export interface UpdateVariableValue { - /** The name of the variable to update. */ - name: string; - /** The value to set. */ - value: string; -} - -/** **Admin only.** Update variable description. Response: [Variable]. */ -export interface UpdateVariableDescription { - /** The name of the variable to update. */ - name: string; - /** The description to set. */ - description: string; -} - -/** **Admin only.** Update whether variable is secret. Response: [Variable]. */ -export interface UpdateVariableIsSecret { - /** The name of the variable to update. */ - name: string; - /** Whether variable is secret. */ - is_secret: boolean; -} - -/** **Admin only.** Delete a variable. Response: [Variable]. */ -export interface DeleteVariable { - name: string; -} - -/** Configuration for a Custom alerter endpoint. */ -export interface CustomAlerterEndpoint { - /** The http/s endpoint to send the POST to */ - url: string; -} - -/** Configuration for a Slack alerter. */ -export interface SlackAlerterEndpoint { - /** The Slack app webhook url */ - url: string; -} - -/** Configuration for a Discord alerter. */ -export interface DiscordAlerterEndpoint { - /** The Discord webhook url */ - url: string; -} - -/** Configuration for a Komodo Server Builder. */ -export interface ServerBuilderConfig { - /** The server id of the builder */ - server_id: string; -} - /** Configuration for an AWS builder. */ export interface AwsBuilderConfig { /** The AWS region to create the instance in */ @@ -6374,88 +3434,6 @@ export interface AwsBuilderConfig { secrets?: string[]; } -export interface Conversion { - /** reference on the server. */ - local: string; - /** reference in the container. */ - container: string; -} - -export interface TerminationSignalLabel { - signal: TerminationSignal; - label: string; -} - -export interface NameAndId { - name: string; - id: string; -} - -export enum PortTypeEnum { - EMPTY = "", - TCP = "tcp", - UDP = "udp", - SCTP = "sctp", -} - -/** An open port on a container */ -export interface Port { - /** Host IP address that the container's port is mapped to */ - IP?: string; - /** Port on the container */ - PrivatePort?: number; - /** Port exposed on the host */ - PublicPort?: number; - Type?: PortTypeEnum; -} - -export interface EnvironmentVar { - variable: string; - value: string; -} - -export interface LatestCommit { - hash: string; - message: string; -} - -export interface CloneArgs { - /** Resource name (eg Build name, Repo name) */ - name: string; - /** Git provider domain. Default: `github.com` */ - provider: string; - /** Use https (vs http). */ - https: boolean; - /** Full repo identifier. / */ - repo?: string; - /** Git Branch. Default: `main` */ - branch: string; - /** Specific commit hash. Optional */ - commit?: string; - /** The clone destination path */ - destination?: string; - /** Command to run after the repo has been cloned */ - on_clone?: SystemCommand; - /** Command to run after the repo has been pulled */ - on_pull?: SystemCommand; - /** Configure the account used to access repo (if private) */ - account?: string; -} - -/** The health of a part of the server. */ -export interface ServerHealthState { - level: SeverityLevel; - /** Whether the health is good enough to close an open alert. */ - should_close_alert: boolean; -} - -/** Summary of the health of the server. */ -export interface ServerHealth { - cpu: ServerHealthState; - mem: ServerHealthState; - disks: Record; -} - export enum AwsVolumeType { Gp2 = "gp2", Gp3 = "gp3", @@ -6517,6 +3495,1709 @@ export interface AwsServerTemplateConfig { user_data: string; } +/** + * Builds the target repo, using the attached builder. Response: [Update]. + * + * Note. Repo must have builder attached at `builder_id`. + * + * 1. Spawns the target builder instance (For AWS type. For Server type, just use CloneRepo). + * 2. Clones the repo on the builder using `git clone https://{$token?}@github.com/${repo} -b ${branch}`. + * The token will only be used if a github account is specified, + * and must be declared in the periphery configuration on the builder instance. + * 3. If `on_clone` and `on_pull` are specified, they will be executed. + * `on_clone` will be executed before `on_pull`. + */ +export interface BuildRepo { + /** Id or name */ + repo: string; +} + +/** Item in [GetBuildMonthlyStatsResponse] */ +export interface BuildStatsDay { + time: number; + count: number; + ts: number; +} + +/** + * Cancels the target build. + * Only does anything if the build is `building` when called. + * Response: [Update] + */ +export interface CancelBuild { + /** Can be id or name */ + build: string; +} + +/** + * Cancels the target repo build. + * Only does anything if the repo build is `building` when called. + * Response: [Update] + */ +export interface CancelRepoBuild { + /** Can be id or name */ + repo: string; +} + +export interface CloneArgs { + /** Resource name (eg Build name, Repo name) */ + name: string; + /** Git provider domain. Default: `github.com` */ + provider: string; + /** Use https (vs http). */ + https: boolean; + /** Full repo identifier. / */ + repo?: string; + /** Git Branch. Default: `main` */ + branch: string; + /** Specific commit hash. Optional */ + commit?: string; + /** The clone destination path */ + destination?: string; + /** Command to run after the repo has been cloned */ + on_clone?: SystemCommand; + /** Command to run after the repo has been pulled */ + on_pull?: SystemCommand; + /** Configure the account used to access repo (if private) */ + account?: string; +} + +/** + * Clones the target repo. Response: [Update]. + * + * Note. Repo must have server attached at `server_id`. + * + * 1. Clones the repo on the target server using `git clone https://{$token?}@github.com/${repo} -b ${branch}`. + * The token will only be used if a github account is specified, + * and must be declared in the periphery configuration on the target server. + * 2. If `on_clone` and `on_pull` are specified, they will be executed. + * `on_clone` will be executed before `on_pull`. + */ +export interface CloneRepo { + /** Id or name */ + repo: string; +} + +/** + * Exports matching resources, and writes to the target sync's resource file. Response: [Update] + * + * Note. Will fail if the Sync is not `managed`. + */ +export interface CommitSync { + /** Id or name */ + sync: string; +} + +export interface ComposeService { + image?: string; + container_name?: string; +} + +/** Keeping this minimal for now as its only needed to parse the service names / container names */ +export interface ComposeFile { + /** If not provided, will default to the parent folder holding the compose file. */ + name?: string; + services?: Record; +} + +export interface Conversion { + /** reference on the server. */ + local: string; + /** reference in the container. */ + container: string; +} + +/** + * Creates a new action with given `name` and the configuration + * of the action at the given `id`. Response: [Action]. + */ +export interface CopyAction { + /** The name of the new action. */ + name: string; + /** The id of the action to copy. */ + id: string; +} + +/** + * Creates a new alerter with given `name` and the configuration + * of the alerter at the given `id`. Response: [Alerter]. + */ +export interface CopyAlerter { + /** The name of the new alerter. */ + name: string; + /** The id of the alerter to copy. */ + id: string; +} + +/** + * Creates a new build with given `name` and the configuration + * of the build at the given `id`. Response: [Build]. + */ +export interface CopyBuild { + /** The name of the new build. */ + name: string; + /** The id of the build to copy. */ + id: string; +} + +/** + * Creates a new builder with given `name` and the configuration + * of the builder at the given `id`. Response: [Builder] + */ +export interface CopyBuilder { + /** The name of the new builder. */ + name: string; + /** The id of the builder to copy. */ + id: string; +} + +/** + * Creates a new deployment with given `name` and the configuration + * of the deployment at the given `id`. Response: [Deployment] + */ +export interface CopyDeployment { + /** The name of the new deployment. */ + name: string; + /** The id of the deployment to copy. */ + id: string; +} + +/** + * Creates a new procedure with given `name` and the configuration + * of the procedure at the given `id`. Response: [Procedure]. + */ +export interface CopyProcedure { + /** The name of the new procedure. */ + name: string; + /** The id of the procedure to copy. */ + id: string; +} + +/** + * Creates a new repo with given `name` and the configuration + * of the repo at the given `id`. Response: [Repo]. + */ +export interface CopyRepo { + /** The name of the new repo. */ + name: string; + /** The id of the repo to copy. */ + id: string; +} + +/** + * Creates a new sync with given `name` and the configuration + * of the sync at the given `id`. Response: [ResourceSync]. + */ +export interface CopyResourceSync { + /** The name of the new sync. */ + name: string; + /** The id of the sync to copy. */ + id: string; +} + +/** + * Creates a new server template with given `name` and the configuration + * of the server template at the given `id`. Response: [ServerTemplate] + */ +export interface CopyServerTemplate { + /** The name of the new server template. */ + name: string; + /** The id of the server template to copy. */ + id: string; +} + +/** + * Creates a new stack with given `name` and the configuration + * of the stack at the given `id`. Response: [Stack]. + */ +export interface CopyStack { + /** The name of the new stack. */ + name: string; + /** The id of the stack to copy. */ + id: string; +} + +/** Create a action. Response: [Action]. */ +export interface CreateAction { + /** The name given to newly created action. */ + name: string; + /** Optional partial config to initialize the action with. */ + config: _PartialActionConfig; +} + +/** + * Create a webhook on the github action attached to the Action resource. + * passed in request. Response: [CreateActionWebhookResponse] + */ +export interface CreateActionWebhook { + /** Id or name */ + action: string; +} + +/** Create an alerter. Response: [Alerter]. */ +export interface CreateAlerter { + /** The name given to newly created alerter. */ + name: string; + /** Optional partial config to initialize the alerter with. */ + config: _PartialAlerterConfig; +} + +/** + * Create an api key for the calling user. + * Response: [CreateApiKeyResponse]. + * + * Note. After the response is served, there will be no way + * to get the secret later. + */ +export interface CreateApiKey { + /** The name for the api key. */ + name: string; + /** + * A unix timestamp in millseconds specifying api key expire time. + * Default is 0, which means no expiry. + */ + expires?: I64; +} + +/** + * Admin only method to create an api key for a service user. + * Response: [CreateApiKeyResponse]. + */ +export interface CreateApiKeyForServiceUser { + /** Must be service user */ + user_id: string; + /** The name for the api key */ + name: string; + /** + * A unix timestamp in millseconds specifying api key expire time. + * Default is 0, which means no expiry. + */ + expires?: I64; +} + +/** Create a build. Response: [Build]. */ +export interface CreateBuild { + /** The name given to newly created build. */ + name: string; + /** Optional partial config to initialize the build with. */ + config: _PartialBuildConfig; +} + +/** + * Create a webhook on the github repo attached to the build + * passed in request. Response: [CreateBuildWebhookResponse] + */ +export interface CreateBuildWebhook { + /** Id or name */ + build: string; +} + +/** Partial representation of [BuilderConfig] */ +export type PartialBuilderConfig = + | { type: "Server", params: _PartialServerBuilderConfig } + | { type: "Aws", params: _PartialAwsBuilderConfig }; + +/** Create a builder. Response: [Builder]. */ +export interface CreateBuilder { + /** The name given to newly created builder. */ + name: string; + /** Optional partial config to initialize the builder with. */ + config: PartialBuilderConfig; +} + +/** Create a deployment. Response: [Deployment]. */ +export interface CreateDeployment { + /** The name given to newly created deployment. */ + name: string; + /** Optional partial config to initialize the deployment with. */ + config: _PartialDeploymentConfig; +} + +/** + * **Admin only.** Create a docker registry account. + * Response: [DockerRegistryAccount]. + */ +export interface CreateDockerRegistryAccount { + account: _PartialDockerRegistryAccount; +} + +/** + * **Admin only.** Create a git provider account. + * Response: [GitProviderAccount]. + */ +export interface CreateGitProviderAccount { + /** + * The initial account config. Anything in the _id field will be ignored, + * as this is generated on creation. + */ + account: _PartialGitProviderAccount; +} + +/** + * Create a new local user account. Will fail if a user with the + * given username already exists. + * Response: [CreateLocalUserResponse]. + * + * Note. This method is only available if the core api has `local_auth` enabled. + */ +export interface CreateLocalUser { + /** The username for the new user. */ + username: string; + /** + * The password for the new user. + * This cannot be retreived later. + */ + password: string; +} + +/** + * Create a docker network on the server. + * Respone: [Update] + */ +export interface CreateNetwork { + /** Id or name */ + server: string; + /** The name of the network to create. */ + name: string; +} + +/** Create a procedure. Response: [Procedure]. */ +export interface CreateProcedure { + /** The name given to newly created build. */ + name: string; + /** Optional partial config to initialize the procedure with. */ + config: _PartialProcedureConfig; +} + +/** Create a repo. Response: [Repo]. */ +export interface CreateRepo { + /** The name given to newly created repo. */ + name: string; + /** Optional partial config to initialize the repo with. */ + config: _PartialRepoConfig; +} + +export enum RepoWebhookAction { + Clone = "Clone", + Pull = "Pull", + Build = "Build", +} + +/** + * Create a webhook on the github repo attached to the (Komodo) Repo resource. + * passed in request. Response: [CreateRepoWebhookResponse] + */ +export interface CreateRepoWebhook { + /** Id or name */ + repo: string; + /** "Clone" or "Pull" or "Build" */ + action: RepoWebhookAction; +} + +/** Create a sync. Response: [ResourceSync]. */ +export interface CreateResourceSync { + /** The name given to newly created sync. */ + name: string; + /** Optional partial config to initialize the sync with. */ + config: _PartialResourceSyncConfig; +} + +/** Create a server. Response: [Server]. */ +export interface CreateServer { + /** The name given to newly created server. */ + name: string; + /** Optional partial config to initialize the server with. */ + config: _PartialServerConfig; +} + +export type PartialServerTemplateConfig = + | { type: "Aws", params: _PartialAwsServerTemplateConfig } + | { type: "Hetzner", params: _PartialHetznerServerTemplateConfig }; + +/** Create a server template. Response: [ServerTemplate]. */ +export interface CreateServerTemplate { + /** The name given to newly created server template. */ + name: string; + /** Optional partial config to initialize the server template with. */ + config: PartialServerTemplateConfig; +} + +/** + * **Admin only.** Create a service user. + * Response: [User]. + */ +export interface CreateServiceUser { + /** The username for the service user. */ + username: string; + /** A description for the service user. */ + description: string; +} + +/** Create a stack. Response: [Stack]. */ +export interface CreateStack { + /** The name given to newly created stack. */ + name: string; + /** Optional partial config to initialize the stack with. */ + config: _PartialStackConfig; +} + +export enum StackWebhookAction { + Refresh = "Refresh", + Deploy = "Deploy", +} + +/** + * Create a webhook on the github repo attached to the stack + * passed in request. Response: [CreateStackWebhookResponse] + */ +export interface CreateStackWebhook { + /** Id or name */ + stack: string; + /** "Refresh" or "Deploy" */ + action: StackWebhookAction; +} + +export enum SyncWebhookAction { + Refresh = "Refresh", + Sync = "Sync", +} + +/** + * Create a webhook on the github repo attached to the sync + * passed in request. Response: [CreateSyncWebhookResponse] + */ +export interface CreateSyncWebhook { + /** Id or name */ + sync: string; + /** "Refresh" or "Sync" */ + action: SyncWebhookAction; +} + +/** Create a tag. Response: [Tag]. */ +export interface CreateTag { + /** The name of the tag. */ + name: string; +} + +/** **Admin only.** Create a user group. Response: [UserGroup] */ +export interface CreateUserGroup { + /** The name to assign to the new UserGroup */ + name: string; +} + +/** **Admin only.** Create variable. Response: [Variable]. */ +export interface CreateVariable { + /** The name of the variable to create. */ + name: string; + /** The initial value of the variable. defualt: "". */ + value?: string; + /** The initial value of the description. default: "". */ + description?: string; + /** Whether to make this a secret variable. */ + is_secret?: boolean; +} + +/** Configuration for a Custom alerter endpoint. */ +export interface CustomAlerterEndpoint { + /** The http/s endpoint to send the POST to */ + url: string; +} + +/** + * Deletes the action at the given id, and returns the deleted action. + * Response: [Action] + */ +export interface DeleteAction { + /** The id or name of the action to delete. */ + id: string; +} + +/** + * Delete the webhook on the github action attached to the Action resource. + * passed in request. Response: [DeleteActionWebhookResponse] + */ +export interface DeleteActionWebhook { + /** Id or name */ + action: string; +} + +/** + * Deletes the alerter at the given id, and returns the deleted alerter. + * Response: [Alerter] + */ +export interface DeleteAlerter { + /** The id or name of the alerter to delete. */ + id: string; +} + +/** + * Delete an api key for the calling user. + * Response: [NoData] + */ +export interface DeleteApiKey { + /** The key which the user intends to delete. */ + key: string; +} + +/** + * Admin only method to delete an api key for a service user. + * Response: [NoData]. + */ +export interface DeleteApiKeyForServiceUser { + key: string; +} + +/** + * Deletes the build at the given id, and returns the deleted build. + * Response: [Build] + */ +export interface DeleteBuild { + /** The id or name of the build to delete. */ + id: string; +} + +/** + * Delete a webhook on the github repo attached to the build + * passed in request. Response: [CreateBuildWebhookResponse] + */ +export interface DeleteBuildWebhook { + /** Id or name */ + build: string; +} + +/** + * Deletes the builder at the given id, and returns the deleted builder. + * Response: [Builder] + */ +export interface DeleteBuilder { + /** The id or name of the builder to delete. */ + id: string; +} + +/** + * Deletes the deployment at the given id, and returns the deleted deployment. + * Response: [Deployment]. + * + * Note. If the associated container is running, it will be deleted as part of + * the deployment clean up. + */ +export interface DeleteDeployment { + /** The id or name of the deployment to delete. */ + id: string; +} + +/** + * **Admin only.** Delete a docker registry account. + * Response: [DockerRegistryAccount]. + */ +export interface DeleteDockerRegistryAccount { + /** The id of the docker registry account to delete */ + id: string; +} + +/** + * **Admin only.** Delete a git provider account. + * Response: [User]. + */ +export interface DeleteGitProviderAccount { + /** The id of the git provider to delete */ + id: string; +} + +/** + * Delete a docker image. + * Response: [Update] + */ +export interface DeleteImage { + /** Id or name. */ + server: string; + /** The name of the image to delete. */ + name: string; +} + +/** + * Delete a docker network. + * Response: [Update] + */ +export interface DeleteNetwork { + /** Id or name. */ + server: string; + /** The name of the network to delete. */ + name: string; +} + +/** + * Deletes the procedure at the given id, and returns the deleted procedure. + * Response: [Procedure] + */ +export interface DeleteProcedure { + /** The id or name of the procedure to delete. */ + id: string; +} + +/** + * Deletes the repo at the given id, and returns the deleted repo. + * Response: [Repo] + */ +export interface DeleteRepo { + /** The id or name of the repo to delete. */ + id: string; +} + +/** + * Delete the webhook on the github repo attached to the (Komodo) Repo resource. + * passed in request. Response: [DeleteRepoWebhookResponse] + */ +export interface DeleteRepoWebhook { + /** Id or name */ + repo: string; + /** "Clone" or "Pull" or "Build" */ + action: RepoWebhookAction; +} + +/** + * Deletes the sync at the given id, and returns the deleted sync. + * Response: [ResourceSync] + */ +export interface DeleteResourceSync { + /** The id or name of the sync to delete. */ + id: string; +} + +/** + * Deletes the server at the given id, and returns the deleted server. + * Response: [Server] + */ +export interface DeleteServer { + /** The id or name of the server to delete. */ + id: string; +} + +/** + * Deletes the server template at the given id, and returns the deleted server template. + * Response: [ServerTemplate] + */ +export interface DeleteServerTemplate { + /** The id or name of the server template to delete. */ + id: string; +} + +/** + * Deletes the stack at the given id, and returns the deleted stack. + * Response: [Stack] + */ +export interface DeleteStack { + /** The id or name of the stack to delete. */ + id: string; +} + +/** + * Delete the webhook on the github repo attached to the stack + * passed in request. Response: [DeleteStackWebhookResponse] + */ +export interface DeleteStackWebhook { + /** Id or name */ + stack: string; + /** "Refresh" or "Deploy" */ + action: StackWebhookAction; +} + +/** + * Delete the webhook on the github repo attached to the sync + * passed in request. Response: [DeleteSyncWebhookResponse] + */ +export interface DeleteSyncWebhook { + /** Id or name */ + sync: string; + /** "Refresh" or "Sync" */ + action: SyncWebhookAction; +} + +/** + * Delete a tag, and return the deleted tag. Response: [Tag]. + * + * Note. Will also remove this tag from all attached resources. + */ +export interface DeleteTag { + /** The id of the tag to delete. */ + id: string; +} + +/** + * **Admin only**. Delete a user. + * Admins can delete any non-admin user. + * Only Super Admin can delete an admin. + * No users can delete a Super Admin user. + * User cannot delete themselves. + * Response: [NoData]. + */ +export interface DeleteUser { + /** User id or username */ + user: string; +} + +/** **Admin only.** Delete a user group. Response: [UserGroup] */ +export interface DeleteUserGroup { + /** The id of the UserGroup */ + id: string; +} + +/** **Admin only.** Delete a variable. Response: [Variable]. */ +export interface DeleteVariable { + name: string; +} + +/** + * Delete a docker volume. + * Response: [Update] + */ +export interface DeleteVolume { + /** Id or name. */ + server: string; + /** The name of the volume to delete. */ + name: string; +} + +/** + * Deploys the container for the target deployment. Response: [Update]. + * + * 1. Pulls the image onto the target server. + * 2. If the container is already running, + * it will be stopped and removed using `docker container rm ${container_name}`. + * 3. The container will be run using `docker run {...params}`, + * where params are determined by the deployment's configuration. + */ +export interface Deploy { + /** Name or id */ + deployment: string; + /** + * Override the default termination signal specified in the deployment. + * Only used when deployment needs to be taken down before redeploy. + */ + stop_signal?: TerminationSignal; + /** + * Override the default termination max time. + * Only used when deployment needs to be taken down before redeploy. + */ + stop_time?: number; +} + +/** Deploys the target stack. `docker compose up`. Response: [Update] */ +export interface DeployStack { + /** Id or name */ + stack: string; + /** + * Override the default termination max time. + * Only used if the stack needs to be taken down first. + */ + stop_time?: number; +} + +/** + * Checks deployed contents vs latest contents, + * and only if any changes found + * will `docker compose up`. Response: [Update] + */ +export interface DeployStackIfChanged { + /** Id or name */ + stack: string; + /** + * Override the default termination max time. + * Only used if the stack needs to be taken down first. + */ + stop_time?: number; +} + +/** + * Stops and destroys the container on the target server. + * Reponse: [Update]. + * + * 1. The container is stopped and removed using `docker container rm ${container_name}`. + */ +export interface DestroyContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; + /** Override the default termination signal. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} + +/** + * Stops and destroys the container for the target deployment. + * Reponse: [Update]. + * + * 1. The container is stopped and removed using `docker container rm ${container_name}`. + */ +export interface DestroyDeployment { + /** Name or id. */ + deployment: string; + /** Override the default termination signal specified in the deployment. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} + +/** Destoys the target stack. `docker compose down`. Response: [Update] */ +export interface DestroyStack { + /** Id or name */ + stack: string; + /** Pass `--remove-orphans` */ + remove_orphans?: boolean; + /** Override the default termination max time. */ + stop_time?: number; +} + +/** Configuration for a Discord alerter. */ +export interface DiscordAlerterEndpoint { + /** The Discord webhook url */ + url: string; +} + +export interface EnvironmentVar { + variable: string; + value: string; +} + +/** + * Exchange a single use exchange token (safe for transport in url query) + * for a jwt. + * Response: [ExchangeForJwtResponse]. + */ +export interface ExchangeForJwt { + /** The 'exchange token' */ + token: string; +} + +/** + * Get pretty formatted monrun sync toml for all resources + * which the user has permissions to view. + * Response: [TomlResponse]. + */ +export interface ExportAllResourcesToToml { + /** Tag name or id. Empty array will not filter by tag. */ + tags?: string[]; +} + +/** + * Get pretty formatted monrun sync toml for specific resources and user groups. + * Response: [TomlResponse]. + */ +export interface ExportResourcesToToml { + /** The targets to include in the export. */ + targets?: ResourceTarget[]; + /** The user group names or ids to include in the export. */ + user_groups?: string[]; + /** Whether to include variables */ + include_variables?: boolean; +} + +/** Find resources matching a common query. Response: [FindResourcesResponse]. */ +export interface FindResources { + /** The mongo query as JSON */ + query?: MongoDocument; + /** The resource variants to include in the response. */ + resources?: ResourceTarget["type"][]; +} + +/** Response for [FindResources]. */ +export interface FindResourcesResponse { + /** The matching servers. */ + servers: ServerListItem[]; + /** The matching deployments. */ + deployments: DeploymentListItem[]; + /** The matching builds. */ + builds: BuildListItem[]; + /** The matching repos. */ + repos: RepoListItem[]; + /** The matching procedures. */ + procedures: ProcedureListItem[]; +} + +/** + * **Admin only.** + * Find a user. + * Response: [FindUserResponse] + */ +export interface FindUser { + /** Id or username */ + user: string; +} + +/** Get a specific action. Response: [Action]. */ +export interface GetAction { + /** Id or name */ + action: string; +} + +/** Get current action state for the action. Response: [ActionActionState]. */ +export interface GetActionActionState { + /** Id or name */ + action: string; +} + +/** + * Gets a summary of data relating to all actions. + * Response: [GetActionsSummaryResponse]. + */ +export interface GetActionsSummary { +} + +/** Response for [GetActionsSummary]. */ +export interface GetActionsSummaryResponse { + /** The total number of actions. */ + total: number; + /** The number of actions with Ok state. */ + ok: number; + /** The number of actions currently running. */ + running: number; + /** The number of actions with failed state. */ + failed: number; + /** The number of actions with unknown state. */ + unknown: number; +} + +/** Get an alert: Response: [Alert]. */ +export interface GetAlert { + id: string; +} + +/** Get a specific alerter. Response: [Alerter]. */ +export interface GetAlerter { + /** Id or name */ + alerter: string; +} + +/** + * Gets a summary of data relating to all alerters. + * Response: [GetAlertersSummaryResponse]. + */ +export interface GetAlertersSummary { +} + +/** Response for [GetAlertersSummary]. */ +export interface GetAlertersSummaryResponse { + total: number; +} + +/** Get a specific build. Response: [Build]. */ +export interface GetBuild { + /** Id or name */ + build: string; +} + +/** Get current action state for the build. Response: [BuildActionState]. */ +export interface GetBuildActionState { + /** Id or name */ + build: string; +} + +/** + * Gets summary and timeseries breakdown of the last months build count / time for charting. + * Response: [GetBuildMonthlyStatsResponse]. + * + * Note. This method is paginated. One page is 30 days of data. + * Query for older pages by incrementing the page, starting at 0. + */ +export interface GetBuildMonthlyStats { + /** + * Query for older data by incrementing the page. + * `page: 0` is the default, and will return the most recent data. + */ + page?: number; +} + +/** Response for [GetBuildMonthlyStats]. */ +export interface GetBuildMonthlyStatsResponse { + total_time: number; + total_count: number; + days: BuildStatsDay[]; +} + +/** Get whether a Build's target repo has a webhook for the build configured. Response: [GetBuildWebhookEnabledResponse]. */ +export interface GetBuildWebhookEnabled { + /** Id or name */ + build: string; +} + +/** Response for [GetBuildWebhookEnabled] */ +export interface GetBuildWebhookEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger build. Will always be false if managed is false. */ + enabled: boolean; +} + +/** Get a specific builder by id or name. Response: [Builder]. */ +export interface GetBuilder { + /** Id or name */ + builder: string; +} + +/** + * Gets a summary of data relating to all builders. + * Response: [GetBuildersSummaryResponse]. + */ +export interface GetBuildersSummary { +} + +/** Response for [GetBuildersSummary]. */ +export interface GetBuildersSummaryResponse { + /** The total number of builders. */ + total: number; +} + +/** + * Gets a summary of data relating to all builds. + * Response: [GetBuildsSummaryResponse]. + */ +export interface GetBuildsSummary { +} + +/** Response for [GetBuildsSummary]. */ +export interface GetBuildsSummaryResponse { + /** The total number of builds in Komodo. */ + total: number; + /** The number of builds with Ok state. */ + ok: number; + /** The number of builds with Failed state. */ + failed: number; + /** The number of builds currently building. */ + building: number; + /** The number of builds with unknown state. */ + unknown: number; +} + +/** + * Get the container log's tail, split by stdout/stderr. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface GetContainerLog { + /** Id or name */ + server: string; + /** The container name */ + container: string; + /** + * The number of lines of the log tail to include. + * Default: 100. + * Max: 5000. + */ + tail: U64; + /** Enable `--timestamps` */ + timestamps?: boolean; +} + +/** + * Get info about the core api configuration. + * Response: [GetCoreInfoResponse]. + */ +export interface GetCoreInfo { +} + +/** Response for [GetCoreInfo]. */ +export interface GetCoreInfoResponse { + /** The title assigned to this core api. */ + title: string; + /** The monitoring interval of this core api. */ + monitoring_interval: Timelength; + /** The webhook base url. */ + webhook_base_url: string; + /** Whether transparent mode is enabled, which gives all users read access to all resources. */ + transparent_mode: boolean; + /** Whether UI write access should be disabled */ + ui_write_disabled: boolean; + /** Whether non admins can create resources */ + disable_non_admin_create: boolean; + /** Whether confirm dialog should be disabled */ + disable_confirm_dialog: boolean; + /** The repo owners for which github webhook management api is available */ + github_webhook_owners: string[]; +} + +/** Get a specific deployment by name or id. Response: [Deployment]. */ +export interface GetDeployment { + /** Id or name */ + deployment: string; +} + +/** + * Get current action state for the deployment. + * Response: [DeploymentActionState]. + */ +export interface GetDeploymentActionState { + /** Id or name */ + deployment: string; +} + +/** + * Get the container, including image / status, of the target deployment. + * Response: [GetDeploymentContainerResponse]. + * + * Note. This does not hit the server directly. The status comes from an + * in memory cache on the core, which hits the server periodically + * to keep it up to date. + */ +export interface GetDeploymentContainer { + /** Id or name */ + deployment: string; +} + +/** Response for [GetDeploymentContainer]. */ +export interface GetDeploymentContainerResponse { + state: DeploymentState; + container?: ContainerListItem; +} + +/** + * Get the deployment log's tail, split by stdout/stderr. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface GetDeploymentLog { + /** Id or name */ + deployment: string; + /** + * The number of lines of the log tail to include. + * Default: 100. + * Max: 5000. + */ + tail: U64; + /** Enable `--timestamps` */ + timestamps?: boolean; +} + +/** + * Get the deployment container's stats using `docker stats`. + * Response: [DockerContainerStats]. + * + * Note. This call will hit the underlying server directly for most up to date stats. + */ +export interface GetDeploymentStats { + /** Id or name */ + deployment: string; +} + +/** + * Gets a summary of data relating to all deployments. + * Response: [GetDeploymentsSummaryResponse]. + */ +export interface GetDeploymentsSummary { +} + +/** Response for [GetDeploymentsSummary]. */ +export interface GetDeploymentsSummaryResponse { + /** The total number of Deployments */ + total: I64; + /** The number of Deployments with Running state */ + running: I64; + /** The number of Deployments with Stopped or Paused state */ + stopped: I64; + /** The number of Deployments with NotDeployed state */ + not_deployed: I64; + /** The number of Deployments with Restarting or Dead or Created (other) state */ + unhealthy: I64; + /** The number of Deployments with Unknown state */ + unknown: I64; +} + +/** + * Get a specific docker registry account. + * Response: [GetDockerRegistryAccountResponse]. + */ +export interface GetDockerRegistryAccount { + id: string; +} + +/** + * Get a specific git provider account. + * Response: [GetGitProviderAccountResponse]. + */ +export interface GetGitProviderAccount { + id: string; +} + +/** + * Paginated endpoint serving historical (timeseries) server stats for graphing. + * Response: [GetHistoricalServerStatsResponse]. + */ +export interface GetHistoricalServerStats { + /** Id or name */ + server: string; + /** The granularity of the data. */ + granularity: Timelength; + /** + * Page of historical data. Default is 0, which is the most recent data. + * Use with the `next_page` field of the response. + */ + page?: number; +} + +/** System stats stored on the database. */ +export interface SystemStatsRecord { + /** Unix timestamp in milliseconds */ + ts: I64; + /** Server id */ + sid: string; + /** Cpu usage percentage */ + cpu_perc: number; + /** Memory used in GB */ + mem_used_gb: number; + /** Total memory in GB */ + mem_total_gb: number; + /** Disk used in GB */ + disk_used_gb: number; + /** Total disk size in GB */ + disk_total_gb: number; + /** Breakdown of individual disks, ie their usages, sizes, and mount points */ + disks: SingleDiskUsage[]; +} + +/** Response to [GetHistoricalServerStats]. */ +export interface GetHistoricalServerStatsResponse { + /** The timeseries page of data. */ + stats: SystemStatsRecord[]; + /** If there is a next page of data, pass this to `page` to get it. */ + next_page?: number; +} + +/** + * Non authenticated route to see the available options + * users have to login to Komodo, eg. local auth, github, google. + * Response: [GetLoginOptionsResponse]. + */ +export interface GetLoginOptions { +} + +/** The response for [GetLoginOptions]. */ +export interface GetLoginOptionsResponse { + /** Whether local auth is enabled. */ + local: boolean; + /** Whether github login is enabled. */ + github: boolean; + /** Whether google login is enabled. */ + google: boolean; + /** Whether OIDC login is enabled. */ + oidc: boolean; + /** Whether user registration (Sign Up) has been disabled */ + registration_disabled: boolean; +} + +/** + * Get the version of the Komodo Periphery agent on the target server. + * Response: [GetPeripheryVersionResponse]. + */ +export interface GetPeripheryVersion { + /** Id or name */ + server: string; +} + +/** Response for [GetPeripheryVersion]. */ +export interface GetPeripheryVersionResponse { + /** The version of periphery. */ + version: string; +} + +/** + * Gets the calling user's permission level on a specific resource. + * Factors in any UserGroup's permissions they may be a part of. + * Response: [PermissionLevel] + */ +export interface GetPermissionLevel { + /** The target to get user permission on. */ + target: ResourceTarget; +} + +/** Get a specific procedure. Response: [Procedure]. */ +export interface GetProcedure { + /** Id or name */ + procedure: string; +} + +/** Get current action state for the procedure. Response: [ProcedureActionState]. */ +export interface GetProcedureActionState { + /** Id or name */ + procedure: string; +} + +/** + * Gets a summary of data relating to all procedures. + * Response: [GetProceduresSummaryResponse]. + */ +export interface GetProceduresSummary { +} + +/** Response for [GetProceduresSummary]. */ +export interface GetProceduresSummaryResponse { + /** The total number of procedures. */ + total: number; + /** The number of procedures with Ok state. */ + ok: number; + /** The number of procedures currently running. */ + running: number; + /** The number of procedures with failed state. */ + failed: number; + /** The number of procedures with unknown state. */ + unknown: number; +} + +/** Get a specific repo. Response: [Repo]. */ +export interface GetRepo { + /** Id or name */ + repo: string; +} + +/** Get current action state for the repo. Response: [RepoActionState]. */ +export interface GetRepoActionState { + /** Id or name */ + repo: string; +} + +/** Get a target Repo's configured webhooks. Response: [GetRepoWebhooksEnabledResponse]. */ +export interface GetRepoWebhooksEnabled { + /** Id or name */ + repo: string; +} + +/** Response for [GetRepoWebhooksEnabled] */ +export interface GetRepoWebhooksEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger clone. Will always be false if managed is false. */ + clone_enabled: boolean; + /** Whether pushes to branch trigger pull. Will always be false if managed is false. */ + pull_enabled: boolean; + /** Whether pushes to branch trigger build. Will always be false if managed is false. */ + build_enabled: boolean; +} + +/** + * Gets a summary of data relating to all repos. + * Response: [GetReposSummaryResponse]. + */ +export interface GetReposSummary { +} + +/** Response for [GetReposSummary] */ +export interface GetReposSummaryResponse { + /** The total number of repos */ + total: number; + /** The number of repos with Ok state. */ + ok: number; + /** The number of repos currently cloning. */ + cloning: number; + /** The number of repos currently pulling. */ + pulling: number; + /** The number of repos currently building. */ + building: number; + /** The number of repos with failed state. */ + failed: number; + /** The number of repos with unknown state. */ + unknown: number; +} + +/** Inspect a docker container on the server. Response: [Container]. */ +export interface GetResourceMatchingContainer { + /** Id or name */ + server: string; + /** The container name */ + container: string; +} + +export interface GetResourceMatchingContainerResponse { + resource?: ResourceTarget; +} + +/** Get a specific sync. Response: [ResourceSync]. */ +export interface GetResourceSync { + /** Id or name */ + sync: string; +} + +/** Get current action state for the sync. Response: [ResourceSyncActionState]. */ +export interface GetResourceSyncActionState { + /** Id or name */ + sync: string; +} + +/** + * Gets a summary of data relating to all syncs. + * Response: [GetResourceSyncsSummaryResponse]. + */ +export interface GetResourceSyncsSummary { +} + +/** Response for [GetResourceSyncsSummary] */ +export interface GetResourceSyncsSummaryResponse { + /** The total number of syncs */ + total: number; + /** The number of syncs with Ok state. */ + ok: number; + /** The number of syncs currently syncing. */ + syncing: number; + /** The number of syncs with pending updates */ + pending: number; + /** The number of syncs with failed state. */ + failed: number; + /** The number of syncs with unknown state. */ + unknown: number; +} + +/** Get a specific server. Response: [Server]. */ +export interface GetServer { + /** Id or name */ + server: string; +} + +/** Get current action state for the servers. Response: [ServerActionState]. */ +export interface GetServerActionState { + /** Id or name */ + server: string; +} + +/** Get the state of the target server. Response: [GetServerStateResponse]. */ +export interface GetServerState { + /** Id or name */ + server: string; +} + +/** The response for [GetServerState]. */ +export interface GetServerStateResponse { + /** The server status. */ + status: ServerState; +} + +/** Get a specific server template by id or name. Response: [ServerTemplate]. */ +export interface GetServerTemplate { + /** Id or name */ + server_template: string; +} + +/** + * Gets a summary of data relating to all server templates. + * Response: [GetServerTemplatesSummaryResponse]. + */ +export interface GetServerTemplatesSummary { +} + +/** Response for [GetServerTemplatesSummary]. */ +export interface GetServerTemplatesSummaryResponse { + /** The total number of server templates. */ + total: number; +} + +/** + * Gets a summary of data relating to all servers. + * Response: [GetServersSummaryResponse]. + */ +export interface GetServersSummary { +} + +/** Response for [GetServersSummary]. */ +export interface GetServersSummaryResponse { + /** The total number of servers. */ + total: I64; + /** The number of healthy (`status: OK`) servers. */ + healthy: I64; + /** The number of unhealthy servers. */ + unhealthy: I64; + /** The number of disabled servers. */ + disabled: I64; +} + +/** Get a specific stack. Response: [Stack]. */ +export interface GetStack { + /** Id or name */ + stack: string; +} + +/** Get current action state for the stack. Response: [StackActionState]. */ +export interface GetStackActionState { + /** Id or name */ + stack: string; +} + +/** Get a stack service's log. Response: [GetStackContainersResponse]. */ +export interface GetStackServiceLog { + /** Id or name */ + stack: string; + /** The service to get the log for. */ + service: string; + /** + * The number of lines of the log tail to include. + * Default: 100. + * Max: 5000. + */ + tail: U64; + /** Enable `--timestamps` */ + timestamps?: boolean; +} + +/** Get a target stack's configured webhooks. Response: [GetStackWebhooksEnabledResponse]. */ +export interface GetStackWebhooksEnabled { + /** Id or name */ + stack: string; +} + +/** Response for [GetStackWebhooksEnabled] */ +export interface GetStackWebhooksEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger refresh. Will always be false if managed is false. */ + refresh_enabled: boolean; + /** Whether pushes to branch trigger stack execution. Will always be false if managed is false. */ + deploy_enabled: boolean; +} + +/** + * Gets a summary of data relating to all syncs. + * Response: [GetStacksSummaryResponse]. + */ +export interface GetStacksSummary { +} + +/** Response for [GetStacksSummary] */ +export interface GetStacksSummaryResponse { + /** The total number of stacks */ + total: number; + /** The number of stacks with Running state. */ + running: number; + /** The number of stacks with Stopped or Paused state. */ + stopped: number; + /** The number of stacks with Down state. */ + down: number; + /** The number of stacks with Unhealthy or Restarting or Dead or Created or Removing state. */ + unhealthy: number; + /** The number of stacks with Unknown state. */ + unknown: number; +} + +/** Get a target Sync's configured webhooks. Response: [GetSyncWebhooksEnabledResponse]. */ +export interface GetSyncWebhooksEnabled { + /** Id or name */ + sync: string; +} + +/** Response for [GetSyncWebhooksEnabled] */ +export interface GetSyncWebhooksEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger refresh. Will always be false if managed is false. */ + refresh_enabled: boolean; + /** Whether pushes to branch trigger sync execution. Will always be false if managed is false. */ + sync_enabled: boolean; +} + +/** + * Get the system information of the target server. + * Response: [SystemInformation]. + */ +export interface GetSystemInformation { + /** Id or name */ + server: string; +} + +/** + * Get the system stats on the target server. Response: [SystemStats]. + * + * Note. This does not hit the server directly. The stats come from an + * in memory cache on the core, which hits the server periodically + * to keep it up to date. + */ +export interface GetSystemStats { + /** Id or name */ + server: string; +} + +/** Get data for a specific tag. Response [Tag]. */ +export interface GetTag { + /** Id or name */ + tag: string; +} + +/** + * Get all data for the target update. + * Response: [Update]. + */ +export interface GetUpdate { + /** The update id. */ + id: string; +} + +/** + * Get the user extracted from the request headers. + * Response: [User]. + */ +export interface GetUser { +} + +/** + * Get a specific user group by name or id. + * Response: [UserGroup]. + */ +export interface GetUserGroup { + /** Name or Id */ + user_group: string; +} + +/** + * Gets the username of a specific user. + * Response: [GetUsernameResponse] + */ +export interface GetUsername { + /** The id of the user. */ + user_id: string; +} + +/** Response for [GetUsername]. */ +export interface GetUsernameResponse { + /** The username of the user. */ + username: string; + /** An optional icon for the user. */ + avatar?: string; +} + +/** + * List all available global variables. + * Response: [Variable] + * + * Note. For non admin users making this call, + * secret variables will have their values obscured. + */ +export interface GetVariable { + /** The name of the variable to get. */ + name: string; +} + +/** + * Get the version of the Komodo Core api. + * Response: [GetVersionResponse]. + */ +export interface GetVersion { +} + +/** Response for [GetVersion]. */ +export interface GetVersionResponse { + /** The version of the core api. */ + version: string; +} + export enum HetznerDatacenter { Nuremberg1Dc3 = "Nuremberg1Dc3", Helsinki1Dc2 = "Helsinki1Dc2", @@ -6623,16 +5304,1104 @@ export interface HetznerServerTemplateConfig { user_data: string; } -export interface ComposeService { - image?: string; - container_name?: string; +/** Inspect a docker container on the server. Response: [Container]. */ +export interface InspectDockerContainer { + /** Id or name */ + server: string; + /** The container name */ + container: string; } -/** Keeping this minimal for now as its only needed to parse the service names / container names */ -export interface ComposeFile { - /** If not provided, will default to the parent folder holding the compose file. */ - name?: string; - services?: Record; +/** Inspect a docker image on the server. Response: [Image]. */ +export interface InspectDockerImage { + /** Id or name */ + server: string; + /** The image name */ + image: string; +} + +/** Inspect a docker network on the server. Response: [InspectDockerNetworkResponse]. */ +export interface InspectDockerNetwork { + /** Id or name */ + server: string; + /** The network name */ + network: string; +} + +/** Inspect a docker volume on the server. Response: [Volume]. */ +export interface InspectDockerVolume { + /** Id or name */ + server: string; + /** The volume name */ + volume: string; +} + +export interface LatestCommit { + hash: string; + message: string; +} + +/** + * Launch an EC2 instance with the specified config. + * Response: [Update]. + */ +export interface LaunchServer { + /** The name of the created server. */ + name: string; + /** The server template used to define the config. */ + server_template: string; +} + +/** List actions matching optional query. Response: [ListActionsResponse]. */ +export interface ListActions { + /** optional structured query to filter actions. */ + query?: ActionQuery; +} + +/** List alerters matching optional query. Response: [ListAlertersResponse]. */ +export interface ListAlerters { + /** Structured query to filter alerters. */ + query?: AlerterQuery; +} + +/** + * Get a paginated list of alerts sorted by timestamp descending. + * Response: [ListAlertsResponse]. + */ +export interface ListAlerts { + /** + * Pass a custom mongo query to filter the alerts. + * + * ## Example JSON + * ``` + * { + * "resolved": "false", + * "level": "CRITICAL", + * "$or": [ + * { + * "target": { + * "type": "Server", + * "id": "6608bf89cb2a12b257ab6c09" + * } + * }, + * { + * "target": { + * "type": "Server", + * "id": "660a5f60b74f90d5dae45fa3" + * } + * } + * ] + * } + * ``` + * This will filter to only include open alerts that have CRITICAL level on those two servers. + */ + query?: MongoDocument; + /** + * Retrieve older results by incrementing the page. + * `page: 0` is default, and returns the most recent results. + */ + page?: U64; +} + +/** Response for [ListAlerts]. */ +export interface ListAlertsResponse { + alerts: Alert[]; + /** + * If more alerts exist, the next page will be given here. + * Otherwise it will be `null` + */ + next_page?: I64; +} + +/** + * List all docker containers on the target server. + * Response: [ListDockerContainersResponse]. + */ +export interface ListAllDockerContainers { + /** Filter by server id or name. */ + servers?: string[]; +} + +/** + * Gets list of api keys for the calling user. + * Response: [ListApiKeysResponse] + */ +export interface ListApiKeys { +} + +/** + * **Admin only.** + * Gets list of api keys for the user. + * Will still fail if you call for a user_id that isn't a service user. + * Response: [ListApiKeysForServiceUserResponse] + */ +export interface ListApiKeysForServiceUser { + /** Id or username */ + user: string; +} + +/** + * Retrieve versions of the build that were built in the past and available for deployment, + * sorted by most recent first. + * Response: [GetBuildVersionsResponse]. + */ +export interface ListBuildVersions { + /** Id or name */ + build: string; + /** Filter to only include versions matching this major version. */ + major?: number; + /** Filter to only include versions matching this minor version. */ + minor?: number; + /** Filter to only include versions matching this patch version. */ + patch?: number; + /** Limit the number of included results. Default is no limit. */ + limit?: I64; +} + +/** List builders matching structured query. Response: [ListBuildersResponse]. */ +export interface ListBuilders { + query?: BuilderQuery; +} + +/** List builds matching optional query. Response: [ListBuildsResponse]. */ +export interface ListBuilds { + /** optional structured query to filter builds. */ + query?: BuildQuery; +} + +/** + * Gets a list of existing values used as extra args across other builds. + * Useful to offer suggestions. Response: [ListCommonBuildExtraArgsResponse] + */ +export interface ListCommonBuildExtraArgs { + /** optional structured query to filter builds. */ + query?: BuildQuery; +} + +/** + * Gets a list of existing values used as extra args across other deployments. + * Useful to offer suggestions. Response: [ListCommonDeploymentExtraArgsResponse] + */ +export interface ListCommonDeploymentExtraArgs { + /** optional structured query to filter deployments. */ + query?: DeploymentQuery; +} + +/** + * Gets a list of existing values used as build extra args across other stacks. + * Useful to offer suggestions. Response: [ListCommonStackBuildExtraArgsResponse] + */ +export interface ListCommonStackBuildExtraArgs { + /** optional structured query to filter stacks. */ + query?: StackQuery; +} + +/** + * Gets a list of existing values used as extra args across other stacks. + * Useful to offer suggestions. Response: [ListCommonStackExtraArgsResponse] + */ +export interface ListCommonStackExtraArgs { + /** optional structured query to filter stacks. */ + query?: StackQuery; +} + +/** + * List all docker compose projects on the target server. + * Response: [ListComposeProjectsResponse]. + */ +export interface ListComposeProjects { + /** Id or name */ + server: string; +} + +/** + * List deployments matching optional query. + * Response: [ListDeploymentsResponse]. + */ +export interface ListDeployments { + /** optional structured query to filter deployments. */ + query?: DeploymentQuery; +} + +/** + * List all docker containers on the target server. + * Response: [ListDockerContainersResponse]. + */ +export interface ListDockerContainers { + /** Id or name */ + server: string; +} + +/** Get image history from the server. Response: [ListDockerImageHistoryResponse]. */ +export interface ListDockerImageHistory { + /** Id or name */ + server: string; + /** The image name */ + image: string; +} + +/** + * List the docker images locally cached on the target server. + * Response: [ListDockerImagesResponse]. + */ +export interface ListDockerImages { + /** Id or name */ + server: string; +} + +/** List the docker networks on the server. Response: [ListDockerNetworksResponse]. */ +export interface ListDockerNetworks { + /** Id or name */ + server: string; +} + +/** + * List the docker registry providers available in Core / Periphery config files. + * Response: [ListDockerRegistriesFromConfigResponse]. + * + * Includes: + * - registries in core config + * - registries configured on builds, deployments + * - registries on the optional Server or Builder + */ +export interface ListDockerRegistriesFromConfig { + /** + * Accepts an optional Server or Builder target to expand the core list with + * providers available on that specific resource. + */ + target?: ResourceTarget; +} + +/** + * List docker registry accounts matching optional query. + * Response: [ListDockerRegistrysResponse]. + */ +export interface ListDockerRegistryAccounts { + /** Optionally filter by accounts with a specific domain. */ + domain?: string; + /** Optionally filter by accounts with a specific username. */ + username?: string; +} + +/** + * List all docker volumes on the target server. + * Response: [ListDockerVolumesResponse]. + */ +export interface ListDockerVolumes { + /** Id or name */ + server: string; +} + +/** List actions matching optional query. Response: [ListFullActionsResponse]. */ +export interface ListFullActions { + /** optional structured query to filter actions. */ + query?: ActionQuery; +} + +/** List full alerters matching optional query. Response: [ListFullAlertersResponse]. */ +export interface ListFullAlerters { + /** Structured query to filter alerters. */ + query?: AlerterQuery; +} + +/** List builders matching structured query. Response: [ListFullBuildersResponse]. */ +export interface ListFullBuilders { + query?: BuilderQuery; +} + +/** List builds matching optional query. Response: [ListFullBuildsResponse]. */ +export interface ListFullBuilds { + /** optional structured query to filter builds. */ + query?: BuildQuery; +} + +/** + * List deployments matching optional query. + * Response: [ListFullDeploymentsResponse]. + */ +export interface ListFullDeployments { + /** optional structured query to filter deployments. */ + query?: DeploymentQuery; +} + +/** List procedures matching optional query. Response: [ListFullProceduresResponse]. */ +export interface ListFullProcedures { + /** optional structured query to filter procedures. */ + query?: ProcedureQuery; +} + +/** List repos matching optional query. Response: [ListFullReposResponse]. */ +export interface ListFullRepos { + /** optional structured query to filter repos. */ + query?: RepoQuery; +} + +/** List syncs matching optional query. Response: [ListFullResourceSyncsResponse]. */ +export interface ListFullResourceSyncs { + /** optional structured query to filter syncs. */ + query?: ResourceSyncQuery; +} + +/** List server templates matching structured query. Response: [ListFullServerTemplatesResponse]. */ +export interface ListFullServerTemplates { + query?: ServerTemplateQuery; +} + +/** List servers matching optional query. Response: [ListFullServersResponse]. */ +export interface ListFullServers { + /** optional structured query to filter servers. */ + query?: ServerQuery; +} + +/** List stacks matching optional query. Response: [ListFullStacksResponse]. */ +export interface ListFullStacks { + /** optional structured query to filter stacks. */ + query?: StackQuery; +} + +/** + * List git provider accounts matching optional query. + * Response: [ListGitProvidersResponse]. + */ +export interface ListGitProviderAccounts { + /** Optionally filter by accounts with a specific domain. */ + domain?: string; + /** Optionally filter by accounts with a specific username. */ + username?: string; +} + +/** + * List the git providers available in Core / Periphery config files. + * Response: [ListGitProvidersFromConfigResponse]. + * + * Includes: + * - providers in core config + * - providers configured on builds, repos, syncs + * - providers on the optional Server or Builder + */ +export interface ListGitProvidersFromConfig { + /** + * Accepts an optional Server or Builder target to expand the core list with + * providers available on that specific resource. + */ + target?: ResourceTarget; +} + +/** + * List permissions for the calling user. + * Does not include any permissions on UserGroups they may be a part of. + * Response: [ListPermissionsResponse] + */ +export interface ListPermissions { +} + +/** List procedures matching optional query. Response: [ListProceduresResponse]. */ +export interface ListProcedures { + /** optional structured query to filter procedures. */ + query?: ProcedureQuery; +} + +/** List repos matching optional query. Response: [ListReposResponse]. */ +export interface ListRepos { + /** optional structured query to filter repos. */ + query?: RepoQuery; +} + +/** List syncs matching optional query. Response: [ListResourceSyncsResponse]. */ +export interface ListResourceSyncs { + /** optional structured query to filter syncs. */ + query?: ResourceSyncQuery; +} + +/** + * List the available secrets from the core config. + * Response: [ListSecretsResponse]. + */ +export interface ListSecrets { + /** + * Accepts an optional Server or Builder target to expand the core list with + * providers available on that specific resource. + */ + target?: ResourceTarget; +} + +/** List server templates matching structured query. Response: [ListServerTemplatesResponse]. */ +export interface ListServerTemplates { + query?: ServerTemplateQuery; +} + +/** List servers matching optional query. Response: [ListServersResponse]. */ +export interface ListServers { + /** optional structured query to filter servers. */ + query?: ServerQuery; +} + +/** Lists a specific stacks services (the containers). Response: [ListStackServicesResponse]. */ +export interface ListStackServices { + /** Id or name */ + stack: string; +} + +/** List stacks matching optional query. Response: [ListStacksResponse]. */ +export interface ListStacks { + /** optional structured query to filter syncs. */ + query?: StackQuery; +} + +/** + * List the processes running on the target server. + * Response: [ListSystemProcessesResponse]. + * + * Note. This does not hit the server directly. The procedures come from an + * in memory cache on the core, which hits the server periodically + * to keep it up to date. + */ +export interface ListSystemProcesses { + /** Id or name */ + server: string; +} + +/** + * List data for tags matching optional mongo query. + * Response: [ListTagsResponse]. + */ +export interface ListTags { + query?: MongoDocument; +} + +/** + * Paginated endpoint for updates matching optional query. + * More recent updates will be returned first. + */ +export interface ListUpdates { + /** An optional mongo query to filter the updates. */ + query?: MongoDocument; + /** + * Page of updates. Default is 0, which is the most recent data. + * Use with the `next_page` field of the response. + */ + page?: number; +} + +/** Minimal representation of an action performed by Komodo. */ +export interface UpdateListItem { + /** The id of the update */ + id: string; + /** Which operation was run */ + operation: Operation; + /** The starting time of the operation */ + start_ts: I64; + /** Whether the operation was successful */ + success: boolean; + /** The username of the user performing update */ + username: string; + /** + * The user id that triggered the update. + * + * Also can take these values for operations triggered automatically: + * - `Procedure`: The operation was triggered as part of a procedure run + * - `Github`: The operation was triggered by a github webhook + * - `Auto Redeploy`: The operation (always `Deploy`) was triggered by an attached build finishing. + */ + operator: string; + /** The target resource to which this update refers */ + target: ResourceTarget; + /** + * The status of the update + * - `Queued` + * - `InProgress` + * - `Complete` + */ + status: UpdateStatus; + /** An optional version on the update, ie build version or deployed version. */ + version?: Version; + /** Some unstructured, operation specific data. Not for general usage. */ + other_data?: string; +} + +/** Response for [ListUpdates]. */ +export interface ListUpdatesResponse { + /** The page of updates, sorted by timestamp descending. */ + updates: UpdateListItem[]; + /** If there is a next page of data, pass this to `page` to get it. */ + next_page?: number; +} + +/** + * List all user groups which user can see. Response: [ListUserGroupsResponse]. + * + * Admins can see all user groups, + * and users can see user groups to which they belong. + */ +export interface ListUserGroups { +} + +/** + * List permissions for a specific user. **Admin only**. + * Response: [ListUserTargetPermissionsResponse] + */ +export interface ListUserTargetPermissions { + /** Specify either a user or a user group. */ + user_target: UserTarget; +} + +/** + * **Admin only.** + * Gets list of Komodo users. + * Response: [ListUsersResponse] + */ +export interface ListUsers { +} + +/** + * List all available global variables. + * Response: [ListVariablesResponse] + * + * Note. For non admin users making this call, + * secret variables will have their values obscured. + */ +export interface ListVariables { +} + +/** + * Login as a local user. Will fail if the users credentials don't match + * any local user. + * + * Note. This method is only available if the core api has `local_auth` enabled. + */ +export interface LoginLocalUser { + /** The user's username */ + username: string; + /** The user's password */ + password: string; +} + +export interface NameAndId { + name: string; + id: string; +} + +/** Pauses all containers on the target server. Response: [Update] */ +export interface PauseAllContainers { + /** Name or id */ + server: string; +} + +/** + * Pauses the container on the target server. Response: [Update] + * + * 1. Runs `docker pause ${container_name}`. + */ +export interface PauseContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} + +/** + * Pauses the container for the target deployment. Response: [Update] + * + * 1. Runs `docker pause ${container_name}`. + */ +export interface PauseDeployment { + /** Name or id */ + deployment: string; +} + +/** Pauses the target stack. `docker compose pause`. Response: [Update] */ +export interface PauseStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to pause */ + service?: string; +} + +export enum PortTypeEnum { + EMPTY = "", + TCP = "tcp", + UDP = "udp", + SCTP = "sctp", +} + +/** An open port on a container */ +export interface Port { + /** Host IP address that the container's port is mapped to */ + IP?: string; + /** Port on the container */ + PrivatePort?: number; + /** Port exposed on the host */ + PublicPort?: number; + Type?: PortTypeEnum; +} + +/** + * Prunes the docker buildx cache on the target server. Response: [Update]. + * + * 1. Runs `docker buildx prune -a -f`. + */ +export interface PruneBuildx { + /** Id or name */ + server: string; +} + +/** + * Prunes the docker containers on the target server. Response: [Update]. + * + * 1. Runs `docker container prune -f`. + */ +export interface PruneContainers { + /** Id or name */ + server: string; +} + +/** + * Prunes the docker builders (build cache) on the target server. Response: [Update]. + * + * 1. Runs `docker builder prune -a -f`. + */ +export interface PruneDockerBuilders { + /** Id or name */ + server: string; +} + +/** + * Prunes the docker images on the target server. Response: [Update]. + * + * 1. Runs `docker image prune -a -f`. + */ +export interface PruneImages { + /** Id or name */ + server: string; +} + +/** + * Prunes the docker networks on the target server. Response: [Update]. + * + * 1. Runs `docker network prune -f`. + */ +export interface PruneNetworks { + /** Id or name */ + server: string; +} + +/** + * Prunes the docker system on the target server, including volumes. Response: [Update]. + * + * 1. Runs `docker system prune -a -f --volumes`. + */ +export interface PruneSystem { + /** Id or name */ + server: string; +} + +/** + * Prunes the docker volumes on the target server. Response: [Update]. + * + * 1. Runs `docker volume prune -a -f`. + */ +export interface PruneVolumes { + /** Id or name */ + server: string; +} + +/** + * Pulls the target repo. Response: [Update]. + * + * Note. Repo must have server attached at `server_id`. + * + * 1. Pulls the repo on the target server using `git pull`. + * 2. If `on_pull` is specified, it will be executed after the pull is complete. + */ +export interface PullRepo { + /** Id or name */ + repo: string; +} + +/** + * Push a resource to the front of the users 10 most recently viewed resources. + * Response: [NoData]. + */ +export interface PushRecentlyViewed { + /** The target to push. */ + resource: ResourceTarget; +} + +/** Trigger a refresh of the cached latest hash and message. */ +export interface RefreshBuildCache { + /** Id or name */ + build: string; +} + +/** Trigger a refresh of the cached latest hash and message. */ +export interface RefreshRepoCache { + /** Id or name */ + repo: string; +} + +/** Trigger a refresh of the computed diff logs for view. Response: [ResourceSync] */ +export interface RefreshResourceSyncPending { + /** Id or name */ + sync: string; +} + +/** + * Trigger a refresh of the cached compose file contents. + * Refreshes: + * - Whether the remote file is missing + * - The latest json, and for repos, the remote contents, hash, and message. + */ +export interface RefreshStackCache { + /** Id or name */ + stack: string; +} + +/** **Admin only.** Remove a user from a user group. Response: [UserGroup] */ +export interface RemoveUserFromUserGroup { + /** The name or id of UserGroup that user should be removed from. */ + user_group: string; + /** The id or username of the user to remove */ + user: string; +} + +/** + * Rename the deployment at id to the given name. Response: [Update]. + * + * Note. If a container is created for the deployment, it will be renamed using + * `docker rename ...`. + */ +export interface RenameDeployment { + /** The id of the deployment to rename. */ + id: string; + /** The new name. */ + name: string; +} + +/** Rename the server at id to the given name. Response: [Update]. */ +export interface RenameServer { + /** The id of the server to rename. */ + id: string; + /** The new name. */ + name: string; +} + +/** Rename the stack at id to the given name. Response: [Update]. */ +export interface RenameStack { + /** The id of the stack to rename. */ + id: string; + /** The new name. */ + name: string; +} + +/** Rename a tag at id. Response: [Tag]. */ +export interface RenameTag { + /** The id of the tag to rename. */ + id: string; + /** The new name of the tag. */ + name: string; +} + +/** **Admin only.** Rename a user group. Response: [UserGroup] */ +export interface RenameUserGroup { + /** The id of the UserGroup */ + id: string; + /** The new name for the UserGroup */ + name: string; +} + +/** Restarts all containers on the target server. Response: [Update] */ +export interface RestartAllContainers { + /** Name or id */ + server: string; +} + +/** + * Restarts the container on the target server. Response: [Update] + * + * 1. Runs `docker restart ${container_name}`. + */ +export interface RestartContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} + +/** + * Restarts the container for the target deployment. Response: [Update] + * + * 1. Runs `docker restart ${container_name}`. + */ +export interface RestartDeployment { + /** Name or id */ + deployment: string; +} + +/** Restarts the target stack. `docker compose restart`. Response: [Update] */ +export interface RestartStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to restart */ + service?: string; +} + +/** Runs the target Action. Response: [Update] */ +export interface RunAction { + /** Id or name */ + action: string; +} + +/** + * Runs the target build. Response: [Update]. + * + * 1. Get a handle to the builder. If using AWS builder, this means starting a builder ec2 instance. + * 2. Clone the repo on the builder. If an `on_clone` commmand is given, it will be executed. + * 3. Execute `docker build {...params}`, where params are determined using the builds configuration. + * 4. If a dockerhub account is attached, the build will be pushed to that account. + */ +export interface RunBuild { + /** Can be build id or name */ + build: string; +} + +/** Runs the target Procedure. Response: [Update] */ +export interface RunProcedure { + /** Id or name */ + procedure: string; +} + +/** Runs the target resource sync. Response: [Update] */ +export interface RunSync { + /** Id or name */ + sync: string; + /** + * Only execute sync on a specific resource type. + * Combine with `resource_id` to specify resource. + */ + resource_type?: ResourceTarget["type"]; + /** + * Only execute sync on a specific resources. + * Combine with `resource_type` to specify resources. + * Supports name or id. + */ + resources?: string[]; +} + +export enum SearchCombinator { + Or = "Or", + And = "And", +} + +/** + * Search the container log's tail using `grep`. All lines go to stdout. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface SearchContainerLog { + /** Id or name */ + server: string; + /** The container name */ + container: string; + /** The terms to search for. */ + terms: string[]; + /** + * When searching for multiple terms, can use `AND` or `OR` combinator. + * + * - `AND`: Only include lines with **all** terms present in that line. + * - `OR`: Include lines that have one or more matches in the terms. + */ + combinator?: SearchCombinator; + /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ + invert?: boolean; + /** Enable `--timestamps` */ + timestamps?: boolean; +} + +/** + * Search the deployment log's tail using `grep`. All lines go to stdout. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface SearchDeploymentLog { + /** Id or name */ + deployment: string; + /** The terms to search for. */ + terms: string[]; + /** + * When searching for multiple terms, can use `AND` or `OR` combinator. + * + * - `AND`: Only include lines with **all** terms present in that line. + * - `OR`: Include lines that have one or more matches in the terms. + */ + combinator?: SearchCombinator; + /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ + invert?: boolean; + /** Enable `--timestamps` */ + timestamps?: boolean; +} + +/** + * Search the deployment log's tail using `grep`. All lines go to stdout. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface SearchStackServiceLog { + /** Id or name */ + stack: string; + /** The service to get the log for. */ + service: string; + /** The terms to search for. */ + terms: string[]; + /** + * When searching for multiple terms, can use `AND` or `OR` combinator. + * + * - `AND`: Only include lines with **all** terms present in that line. + * - `OR`: Include lines that have one or more matches in the terms. + */ + combinator?: SearchCombinator; + /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ + invert?: boolean; + /** Enable `--timestamps` */ + timestamps?: boolean; +} + +/** Configuration for a Komodo Server Builder. */ +export interface ServerBuilderConfig { + /** The server id of the builder */ + server_id: string; +} + +/** The health of a part of the server. */ +export interface ServerHealthState { + level: SeverityLevel; + /** Whether the health is good enough to close an open alert. */ + should_close_alert: boolean; +} + +/** Summary of the health of the server. */ +export interface ServerHealth { + cpu: ServerHealthState; + mem: ServerHealthState; + disks: Record; +} + +/** + * Set the time the user last opened the UI updates. + * Used for unseen notification dot. + * Response: [NoData] + */ +export interface SetLastSeenUpdate { +} + +/** + * **Admin only.** Completely override the user in the group. + * Response: [UserGroup] + */ +export interface SetUsersInUserGroup { + /** Id or name. */ + user_group: string; + /** The user ids or usernames to hard set as the group's users. */ + users: string[]; +} + +/** Configuration for a Slack alerter. */ +export interface SlackAlerterEndpoint { + /** The Slack app webhook url */ + url: string; +} + +export interface Sleep { + duration_ms?: I64; +} + +/** Starts all containers on the target server. Response: [Update] */ +export interface StartAllContainers { + /** Name or id */ + server: string; +} + +/** + * Starts the container on the target server. Response: [Update] + * + * 1. Runs `docker start ${container_name}`. + */ +export interface StartContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} + +/** + * Starts the container for the target deployment. Response: [Update] + * + * 1. Runs `docker start ${container_name}`. + */ +export interface StartDeployment { + /** Name or id */ + deployment: string; +} + +/** Starts the target stack. `docker compose start`. Response: [Update] */ +export interface StartStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to start */ + service?: string; +} + +/** Stops all containers on the target server. Response: [Update] */ +export interface StopAllContainers { + /** Name or id */ + server: string; +} + +/** + * Stops the container on the target server. Response: [Update] + * + * 1. Runs `docker stop ${container_name}`. + */ +export interface StopContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; + /** Override the default termination signal. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} + +/** + * Stops the container for the target deployment. Response: [Update] + * + * 1. Runs `docker stop ${container_name}`. + */ +export interface StopDeployment { + /** Name or id */ + deployment: string; + /** Override the default termination signal specified in the deployment. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} + +/** Stops the target stack. `docker compose stop`. Response: [Update] */ +export interface StopStack { + /** Id or name */ + stack: string; + /** Override the default termination max time. */ + stop_time?: number; + /** Optionally specify a specific service to stop */ + service?: string; +} + +export interface TerminationSignalLabel { + signal: TerminationSignal; + label: string; } /** Info for the all system disks combined. */ @@ -6643,6 +6412,418 @@ export interface TotalDiskUsage { total_gb: number; } +/** Unpauses all containers on the target server. Response: [Update] */ +export interface UnpauseAllContainers { + /** Name or id */ + server: string; +} + +/** + * Unpauses the container on the target server. Response: [Update] + * + * 1. Runs `docker unpause ${container_name}`. + * + * Note. This is the only way to restart a paused container. + */ +export interface UnpauseContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} + +/** + * Unpauses the container for the target deployment. Response: [Update] + * + * 1. Runs `docker unpause ${container_name}`. + * + * Note. This is the only way to restart a paused container. + */ +export interface UnpauseDeployment { + /** Name or id */ + deployment: string; +} + +/** + * Unpauses the target stack. `docker compose unpause`. Response: [Update]. + * + * Note. This is the only way to restart a paused container. + */ +export interface UnpauseStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to unpause */ + service?: string; +} + +/** + * Update the action at the given id, and return the updated action. + * Response: [Action]. + * + * Note. This method updates only the fields which are set in the [_PartialActionConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateAction { + /** The id of the action to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialActionConfig; +} + +/** + * Update the alerter at the given id, and return the updated alerter. Response: [Alerter]. + * + * Note. This method updates only the fields which are set in the [PartialAlerterConfig][crate::entities::alerter::PartialAlerterConfig], + * effectively merging diffs into the final document. This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateAlerter { + /** The id of the alerter to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialAlerterConfig; +} + +/** + * Update the build at the given id, and return the updated build. + * Response: [Build]. + * + * Note. This method updates only the fields which are set in the [_PartialBuildConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateBuild { + /** The id of the build to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialBuildConfig; +} + +/** + * Update the builder at the given id, and return the updated builder. + * Response: [Builder]. + * + * Note. This method updates only the fields which are set in the [PartialBuilderConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateBuilder { + /** The id of the builder to update. */ + id: string; + /** The partial config update to apply. */ + config: PartialBuilderConfig; +} + +/** + * Update the deployment at the given id, and return the updated deployment. + * Response: [Deployment]. + * + * Note. If the attached server for the deployment changes, + * the deployment will be deleted / cleaned up on the old server. + * + * Note. This method updates only the fields which are set in the [_PartialDeploymentConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateDeployment { + /** The deployment id to update. */ + id: string; + /** The partial config update. */ + config: _PartialDeploymentConfig; +} + +/** + * Update a resources description. + * Response: [NoData]. + */ +export interface UpdateDescription { + /** The target resource to set description for. */ + target: ResourceTarget; + /** The new description. */ + description: string; +} + +/** + * **Admin only.** Update a docker registry account. + * Response: [DockerRegistryAccount]. + */ +export interface UpdateDockerRegistryAccount { + /** The id of the docker registry to update */ + id: string; + /** The partial docker registry account. */ + account: _PartialDockerRegistryAccount; +} + +/** + * **Admin only.** Update a git provider account. + * Response: [GitProviderAccount]. + */ +export interface UpdateGitProviderAccount { + /** The id of the git provider account to update. */ + id: string; + /** The partial git provider account. */ + account: _PartialGitProviderAccount; +} + +/** + * **Admin only.** Update a user or user groups base permission level on a resource type. + * Response: [NoData]. + */ +export interface UpdatePermissionOnResourceType { + /** Specify the user or user group. */ + user_target: UserTarget; + /** The resource type: eg. Server, Build, Deployment, etc. */ + resource_type: ResourceTarget["type"]; + /** The base permission level. */ + permission: PermissionLevel; +} + +/** + * **Admin only.** Update a user or user groups permission on a resource. + * Response: [NoData]. + */ +export interface UpdatePermissionOnTarget { + /** Specify the user or user group. */ + user_target: UserTarget; + /** Specify the target resource. */ + resource_target: ResourceTarget; + /** Specify the permission level. */ + permission: PermissionLevel; +} + +/** + * Update the procedure at the given id, and return the updated procedure. + * Response: [Procedure]. + * + * Note. This method updates only the fields which are set in the [_PartialProcedureConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateProcedure { + /** The id of the procedure to update. */ + id: string; + /** The partial config update. */ + config: _PartialProcedureConfig; +} + +/** + * Update the repo at the given id, and return the updated repo. + * Response: [Repo]. + * + * Note. If the attached server for the repo changes, + * the repo will be deleted / cleaned up on the old server. + * + * Note. This method updates only the fields which are set in the [_PartialRepoConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateRepo { + /** The id of the repo to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialRepoConfig; +} + +/** + * Update the sync at the given id, and return the updated sync. + * Response: [ResourceSync]. + * + * Note. This method updates only the fields which are set in the [_PartialResourceSyncConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateResourceSync { + /** The id of the sync to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialResourceSyncConfig; +} + +/** + * Update the server at the given id, and return the updated server. + * Response: [Server]. + * + * Note. This method updates only the fields which are set in the [_PartialServerConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateServer { + /** The id of the server to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialServerConfig; +} + +/** + * Update the server template at the given id, and return the updated server template. + * Response: [ServerTemplate]. + * + * Note. This method updates only the fields which are set in the [PartialServerTemplateConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateServerTemplate { + /** The id of the server template to update. */ + id: string; + /** The partial config update to apply. */ + config: PartialServerTemplateConfig; +} + +/** + * **Admin only.** Update a service user's description. + * Response: [User]. + */ +export interface UpdateServiceUserDescription { + /** The service user's username */ + username: string; + /** A new description for the service user. */ + description: string; +} + +/** + * Update the stack at the given id, and return the updated stack. + * Response: [Stack]. + * + * Note. If the attached server for the stack changes, + * the stack will be deleted / cleaned up on the old server. + * + * Note. This method updates only the fields which are set in the [_PartialStackConfig], + * merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateStack { + /** The id of the Stack to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialStackConfig; +} + +/** + * Update the tags on a resource. + * Response: [NoData] + */ +export interface UpdateTagsOnResource { + target: ResourceTarget; + /** Tag Ids */ + tags: string[]; +} + +/** + * **Super Admin only.** Update's whether a user is admin. + * Response: [NoData]. + */ +export interface UpdateUserAdmin { + /** The target user. */ + user_id: string; + /** Whether user should be admin. */ + admin: boolean; +} + +/** + * **Admin only.** Update a user's "base" permissions, eg. "enabled". + * Response: [NoData]. + */ +export interface UpdateUserBasePermissions { + /** The target user. */ + user_id: string; + /** If specified, will update users enabled state. */ + enabled?: boolean; + /** If specified, will update user's ability to create servers. */ + create_servers?: boolean; + /** If specified, will update user's ability to create builds. */ + create_builds?: boolean; +} + +/** + * **Only for local users**. Update the calling users password. + * Response: [NoData]. + */ +export interface UpdateUserPassword { + password: string; +} + +/** + * **Only for local users**. Update the calling users username. + * Response: [NoData]. + */ +export interface UpdateUserUsername { + username: string; +} + +/** **Admin only.** Update variable description. Response: [Variable]. */ +export interface UpdateVariableDescription { + /** The name of the variable to update. */ + name: string; + /** The description to set. */ + description: string; +} + +/** **Admin only.** Update whether variable is secret. Response: [Variable]. */ +export interface UpdateVariableIsSecret { + /** The name of the variable to update. */ + name: string; + /** Whether variable is secret. */ + is_secret: boolean; +} + +/** **Admin only.** Update variable value. Response: [Variable]. */ +export interface UpdateVariableValue { + /** The name of the variable to update. */ + name: string; + /** The value to set. */ + value: string; +} + +/** Update file contents in Files on Server or Git Repo mode. Response: [Update]. */ +export interface WriteStackFileContents { + /** The name or id of the target Stack. */ + stack: string; + /** + * The file path relative to the stack run directory, + * or absolute path. + */ + file_path: string; + /** The contents to write. */ + contents: string; +} + +/** Rename the stack at id to the given name. Response: [Update]. */ +export interface WriteSyncFileContents { + /** The name or id of the target Sync. */ + sync: string; + /** + * If this file was under a resource folder, this will be the folder. + * Otherwise, it should be empty string. + */ + resource_path: string; + /** The file path relative to the resource path. */ + file_path: string; + /** The contents to write. */ + contents: string; +} + export type AuthRequest = | { type: "GetLoginOptions", params: GetLoginOptions } | { type: "CreateLocalUser", params: CreateLocalUser } @@ -6694,9 +6875,17 @@ export type ExecuteRequest = | { type: "BuildRepo", params: BuildRepo } | { type: "CancelRepoBuild", params: CancelRepoBuild } | { type: "RunProcedure", params: RunProcedure } + | { type: "RunAction", params: RunAction } | { type: "LaunchServer", params: LaunchServer } | { type: "RunSync", params: RunSync }; +/** Configuration for the registry to push the built image to. */ +export type ImageRegistryLegacy1_14 = + /** Don't push the image to any registry */ + | { type: "None", params: NoData } + /** Push the image to a standard image registry (any domain) */ + | { type: "Standard", params: ImageRegistryConfig }; + export type ReadRequest = | { type: "GetVersion", params: GetVersion } | { type: "GetCoreInfo", params: GetCoreInfo } @@ -6719,6 +6908,11 @@ export type ReadRequest = | { type: "GetProcedureActionState", params: GetProcedureActionState } | { type: "ListProcedures", params: ListProcedures } | { type: "ListFullProcedures", params: ListFullProcedures } + | { type: "GetActionsSummary", params: GetActionsSummary } + | { type: "GetAction", params: GetAction } + | { type: "GetActionActionState", params: GetActionActionState } + | { type: "ListActions", params: ListActions } + | { type: "ListFullActions", params: ListFullActions } | { type: "GetServerTemplate", params: GetServerTemplate } | { type: "GetServerTemplatesSummary", params: GetServerTemplatesSummary } | { type: "ListServerTemplates", params: ListServerTemplates } @@ -6878,6 +7072,10 @@ export type WriteRequest = | { type: "CopyProcedure", params: CopyProcedure } | { type: "DeleteProcedure", params: DeleteProcedure } | { type: "UpdateProcedure", params: UpdateProcedure } + | { type: "CreateAction", params: CreateAction } + | { type: "CopyAction", params: CopyAction } + | { type: "DeleteAction", params: DeleteAction } + | { type: "UpdateAction", params: UpdateAction } | { type: "CreateResourceSync", params: CreateResourceSync } | { type: "CopyResourceSync", params: CopyResourceSync } | { type: "DeleteResourceSync", params: DeleteResourceSync } @@ -6912,13 +7110,6 @@ export type WriteRequest = | { type: "UpdateDockerRegistryAccount", params: UpdateDockerRegistryAccount } | { type: "DeleteDockerRegistryAccount", params: DeleteDockerRegistryAccount }; -/** Configuration for the registry to push the built image to. */ -export type ImageRegistryLegacy1_14 = - /** Don't push the image to any registry */ - | { type: "None", params: NoData } - /** Push the image to a standard image registry (any domain) */ - | { type: "Standard", params: ImageRegistryConfig }; - export type WsLoginMessage = | { type: "Jwt", params: { jwt: string; diff --git a/client/core/ts/yarn.lock b/client/core/ts/yarn.lock index 91e9572eb..b72816c28 100644 --- a/client/core/ts/yarn.lock +++ b/client/core/ts/yarn.lock @@ -2,63 +2,6 @@ # yarn lockfile v1 -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== - -axios@^1.7.7: - version "1.7.7" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.7.tgz#2f554296f9892a72ac8d8e4c5b79c14a91d0a47f" - integrity sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q== - dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== - -follow-redirects@^1.15.6: - version "1.15.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" - integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== - -form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -mime-db@1.52.0: - version "1.52.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" - integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== - -mime-types@^2.1.12: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - typescript@^5.6.3: version "5.6.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" diff --git a/config/core.config.toml b/config/core.config.toml index beab82ac4..448c66d11 100644 --- a/config/core.config.toml +++ b/config/core.config.toml @@ -71,6 +71,12 @@ sync_directory = "/syncs" ## Default: /repo-cache repo_directory = "/repo-cache" +## Configure the action directory (inside the container). +## There shouldn't be a need to change this, or even mount a volume. +## Env: KOMODO_ACTION_DIRECTORY +## Default: /action-cache +action_directory = "/action-cache" + ################ # AUTH / LOGIN # ################ diff --git a/frontend/package.json b/frontend/package.json index 187a3e22e..116ee8eb3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -12,55 +12,56 @@ }, "dependencies": { "@monaco-editor/react": "^4.6.0", - "@radix-ui/react-checkbox": "^1.1.1", - "@radix-ui/react-dialog": "^1.1.1", - "@radix-ui/react-dropdown-menu": "^2.1.1", - "@radix-ui/react-hover-card": "^1.1.1", + "@radix-ui/react-checkbox": "^1.1.2", + "@radix-ui/react-dialog": "^1.1.2", + "@radix-ui/react-dropdown-menu": "^2.1.2", + "@radix-ui/react-hover-card": "^1.1.2", "@radix-ui/react-icons": "1.3.0", "@radix-ui/react-label": "^2.1.0", - "@radix-ui/react-popover": "^1.1.1", + "@radix-ui/react-popover": "^1.1.2", "@radix-ui/react-progress": "^1.1.0", - "@radix-ui/react-select": "^2.1.1", + "@radix-ui/react-select": "^2.1.2", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-switch": "^1.1.0", "@radix-ui/react-tabs": "^1.1.0", - "@radix-ui/react-toast": "^1.2.1", + "@radix-ui/react-toast": "^1.2.2", "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", - "@tanstack/react-query": "5.51.23", - "@tanstack/react-table": "8.20.1", + "@tanstack/react-query": "5.59.15", + "@tanstack/react-table": "8.20.5", "ansi-to-html": "0.7.2", "class-variance-authority": "0.7.0", "clsx": "2.1.1", "cmdk": "1.0.0", - "jotai": "2.9.2", - "lucide-react": "0.437.0", + "jotai": "2.10.1", + "lucide-react": "0.453.0", "monaco-editor": "^0.52.0", + "prettier": "3.3.3", "react": "18.3.1", "react-charts": "^3.0.0-beta.57", "react-dom": "18.3.1", "react-minimal-pie-chart": "8.4.0", - "react-router-dom": "6.26.0", - "sanitize-html": "2.13.0", - "tailwind-merge": "2.4.0", + "react-router-dom": "6.27.0", + "sanitize-html": "2.13.1", + "tailwind-merge": "2.5.4", "tailwindcss-animate": "1.0.7" }, "devDependencies": { - "@types/react": "18.3.3", - "@types/react-dom": "18.3.0", - "@types/sanitize-html": "2.11.0", - "@typescript-eslint/eslint-plugin": "8.0.1", + "@types/react": "18.3.11", + "@types/react-dom": "18.3.1", + "@types/sanitize-html": "2.13.0", + "@typescript-eslint/eslint-plugin": "8.10.0", "@typescript-eslint/parser": "8.0.1", - "@vitejs/plugin-react": "4.3.1", + "@vitejs/plugin-react": "4.3.3", "autoprefixer": "10.4.20", - "eslint": "9.9.0", - "eslint-plugin-react-hooks": "4.6.2", - "eslint-plugin-react-refresh": "0.4.9", - "postcss": "8.4.41", - "tailwindcss": "3.4.9", - "typescript": "5.5.4", - "vite": "5.4.0", + "eslint": "9.13.0", + "eslint-plugin-react-hooks": "5.0.0", + "eslint-plugin-react-refresh": "0.4.13", + "postcss": "8.4.47", + "tailwindcss": "3.4.14", + "typescript": "5.6.3", + "vite": "5.4.9", "vite-tsconfig-paths": "5.0.1" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" diff --git a/frontend/public/client/lib.d.ts b/frontend/public/client/lib.d.ts new file mode 100644 index 000000000..dd65cdb78 --- /dev/null +++ b/frontend/public/client/lib.d.ts @@ -0,0 +1,91 @@ +import { AuthResponses, ExecuteResponses, ReadResponses, UserResponses, WriteResponses } from "./responses.js"; +import { AuthRequest, ExecuteRequest, ReadRequest, UserRequest, WriteRequest } from "./types.js"; +export * as Types from "./types.js"; +type InitOptions = { + type: "jwt"; + params: { + jwt: string; + }; +} | { + type: "api-key"; + params: { + key: string; + secret: string; + }; +}; +/** Initialize a new client for Komodo */ +export declare function KomodoClient(url: string, options: InitOptions): { + /** + * Call the `/auth` api. + * + * ``` + * const login_options = await komodo.auth("GetLoginOptions", {}); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/auth/index.html + */ + auth: >(type: T, params: Req["params"]) => Promise; + /** + * Call the `/user` api. + * + * ``` + * const { key, secret } = await komodo.user("CreateApiKey", { + * name: "my-api-key" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/user/index.html + */ + user: >(type: T, params: Req["params"]) => Promise; + /** + * Call the `/read` api. + * + * ``` + * const stack = await komodo.read("GetStack", { + * stack: "my-stack" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/read/index.html + */ + read: >(type: T, params: Req["params"]) => Promise; + /** + * Call the `/write` api. + * + * ``` + * const build = await komodo.write("UpdateBuild", { + * id: "my-build", + * config: { + * version: "1.0.4" + * } + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/write/index.html + */ + write: >(type: T, params: Req["params"]) => Promise; + /** + * Call the `/execute` api. + * + * ``` + * const update = await komodo.execute("DeployStack", { + * stack: "my-stack" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/execute/index.html + */ + execute: >(type: T, params: Req["params"]) => Promise; + /** Returns the version of Komodo Core the client is calling to. */ + core_version: () => Promise; +}; diff --git a/frontend/public/client/lib.js b/frontend/public/client/lib.js new file mode 100644 index 000000000..567e0623a --- /dev/null +++ b/frontend/public/client/lib.js @@ -0,0 +1,134 @@ +export * as Types from "./types.js"; +/** Initialize a new client for Komodo */ +export function KomodoClient(url, options) { + const state = { + jwt: options.type === "jwt" ? options.params.jwt : undefined, + key: options.type === "api-key" ? options.params.key : undefined, + secret: options.type === "api-key" ? options.params.secret : undefined, + }; + const request = async (path, request) => new Promise(async (res, rej) => { + try { + let response = await fetch(url + path, { + method: "POST", + body: JSON.stringify(request), + headers: { + ...(state.jwt + ? { + authorization: state.jwt, + } + : state.key && state.secret + ? { + "x-api-key": state.key, + "x-api-secret": state.secret, + } + : {}), + "content-type": "application/json", + }, + }); + if (response.status === 200) { + const body = await response.json(); + res(body); + } + else { + try { + const result = await response.json(); + rej({ status: response.status, result }); + } + catch (error) { + rej({ + status: response.status, + result: { + error: "Failed to get response body", + trace: [JSON.stringify(error)], + }, + error, + }); + } + } + } + catch (error) { + rej({ + status: 1, + result: { + error: "Request failed with error", + trace: [JSON.stringify(error)], + }, + error, + }); + } + }); + const auth = async (type, params) => await request("/auth", { + type, + params, + }); + const user = async (type, params) => await request("/user", { type, params }); + const read = async (type, params) => await request("/read", { type, params }); + const write = async (type, params) => await request("/write", { type, params }); + const execute = async (type, params) => await request("/execute", { type, params }); + const core_version = () => read("GetVersion", {}).then((res) => res.version); + return { + /** + * Call the `/auth` api. + * + * ``` + * const login_options = await komodo.auth("GetLoginOptions", {}); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/auth/index.html + */ + auth, + /** + * Call the `/user` api. + * + * ``` + * const { key, secret } = await komodo.user("CreateApiKey", { + * name: "my-api-key" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/user/index.html + */ + user, + /** + * Call the `/read` api. + * + * ``` + * const stack = await komodo.read("GetStack", { + * stack: "my-stack" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/read/index.html + */ + read, + /** + * Call the `/write` api. + * + * ``` + * const build = await komodo.write("UpdateBuild", { + * id: "my-build", + * config: { + * version: "1.0.4" + * } + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/write/index.html + */ + write, + /** + * Call the `/execute` api. + * + * ``` + * const update = await komodo.execute("DeployStack", { + * stack: "my-stack" + * }); + * ``` + * + * https://docs.rs/komodo_client/latest/komodo_client/api/execute/index.html + */ + execute, + /** Returns the version of Komodo Core the client is calling to. */ + core_version, + }; +} diff --git a/frontend/public/client/responses.d.ts b/frontend/public/client/responses.d.ts new file mode 100644 index 000000000..2c64496c5 --- /dev/null +++ b/frontend/public/client/responses.d.ts @@ -0,0 +1,288 @@ +import * as Types from "./types.js"; +export type AuthResponses = { + GetLoginOptions: Types.GetLoginOptionsResponse; + CreateLocalUser: Types.CreateLocalUserResponse; + LoginLocalUser: Types.LoginLocalUserResponse; + ExchangeForJwt: Types.ExchangeForJwtResponse; + GetUser: Types.GetUserResponse; +}; +export type UserResponses = { + PushRecentlyViewed: Types.PushRecentlyViewedResponse; + SetLastSeenUpdate: Types.SetLastSeenUpdateResponse; + CreateApiKey: Types.CreateApiKeyResponse; + DeleteApiKey: Types.DeleteApiKeyResponse; +}; +export type ReadResponses = { + GetVersion: Types.GetVersionResponse; + GetCoreInfo: Types.GetCoreInfoResponse; + ListSecrets: Types.ListSecretsResponse; + ListGitProvidersFromConfig: Types.ListGitProvidersFromConfigResponse; + ListDockerRegistriesFromConfig: Types.ListDockerRegistriesFromConfigResponse; + GetUsername: Types.GetUsernameResponse; + GetPermissionLevel: Types.GetPermissionLevelResponse; + FindUser: Types.FindUserResponse; + ListUsers: Types.ListUsersResponse; + ListApiKeys: Types.ListApiKeysResponse; + ListApiKeysForServiceUser: Types.ListApiKeysForServiceUserResponse; + ListPermissions: Types.ListPermissionsResponse; + ListUserTargetPermissions: Types.ListUserTargetPermissionsResponse; + GetUserGroup: Types.GetUserGroupResponse; + ListUserGroups: Types.ListUserGroupsResponse; + FindResources: Types.FindResourcesResponse; + GetProceduresSummary: Types.GetProceduresSummaryResponse; + GetProcedure: Types.GetProcedureResponse; + GetProcedureActionState: Types.GetProcedureActionStateResponse; + ListProcedures: Types.ListProceduresResponse; + ListFullProcedures: Types.ListFullProceduresResponse; + GetActionsSummary: Types.GetActionsSummaryResponse; + GetAction: Types.GetActionResponse; + GetActionActionState: Types.GetActionActionStateResponse; + ListActions: Types.ListActionsResponse; + ListFullActions: Types.ListFullActionsResponse; + GetServerTemplate: Types.GetServerTemplateResponse; + GetServerTemplatesSummary: Types.GetServerTemplatesSummaryResponse; + ListServerTemplates: Types.ListServerTemplatesResponse; + ListFullServerTemplates: Types.ListFullServerTemplatesResponse; + GetServersSummary: Types.GetServersSummaryResponse; + GetServer: Types.GetServerResponse; + GetServerState: Types.GetServerStateResponse; + GetPeripheryVersion: Types.GetPeripheryVersionResponse; + ListDockerContainers: Types.ListDockerContainersResponse; + ListAllDockerContainers: Types.ListAllDockerContainersResponse; + InspectDockerContainer: Types.InspectDockerContainerResponse; + GetResourceMatchingContainer: Types.GetResourceMatchingContainerResponse; + GetContainerLog: Types.GetContainerLogResponse; + SearchContainerLog: Types.SearchContainerLogResponse; + ListDockerNetworks: Types.ListDockerNetworksResponse; + InspectDockerNetwork: Types.InspectDockerNetworkResponse; + ListDockerImages: Types.ListDockerImagesResponse; + InspectDockerImage: Types.InspectDockerImageResponse; + ListDockerImageHistory: Types.ListDockerImageHistoryResponse; + ListDockerVolumes: Types.ListDockerVolumesResponse; + InspectDockerVolume: Types.InspectDockerVolumeResponse; + ListComposeProjects: Types.ListComposeProjectsResponse; + GetServerActionState: Types.GetServerActionStateResponse; + GetHistoricalServerStats: Types.GetHistoricalServerStatsResponse; + ListServers: Types.ListServersResponse; + ListFullServers: Types.ListFullServersResponse; + GetDeploymentsSummary: Types.GetDeploymentsSummaryResponse; + GetDeployment: Types.GetDeploymentResponse; + GetDeploymentContainer: Types.GetDeploymentContainerResponse; + GetDeploymentActionState: Types.GetDeploymentActionStateResponse; + GetDeploymentStats: Types.GetDeploymentStatsResponse; + GetDeploymentLog: Types.GetDeploymentLogResponse; + SearchDeploymentLog: Types.SearchDeploymentLogResponse; + ListDeployments: Types.ListDeploymentsResponse; + ListFullDeployments: Types.ListFullDeploymentsResponse; + ListCommonDeploymentExtraArgs: Types.ListCommonDeploymentExtraArgsResponse; + GetBuildsSummary: Types.GetBuildsSummaryResponse; + GetBuild: Types.GetBuildResponse; + GetBuildActionState: Types.GetBuildActionStateResponse; + GetBuildMonthlyStats: Types.GetBuildMonthlyStatsResponse; + GetBuildWebhookEnabled: Types.GetBuildWebhookEnabledResponse; + ListBuilds: Types.ListBuildsResponse; + ListFullBuilds: Types.ListFullBuildsResponse; + ListBuildVersions: Types.ListBuildVersionsResponse; + ListCommonBuildExtraArgs: Types.ListCommonBuildExtraArgsResponse; + GetReposSummary: Types.GetReposSummaryResponse; + GetRepo: Types.GetRepoResponse; + GetRepoActionState: Types.GetRepoActionStateResponse; + GetRepoWebhooksEnabled: Types.GetRepoWebhooksEnabledResponse; + ListRepos: Types.ListReposResponse; + ListFullRepos: Types.ListFullReposResponse; + GetResourceSyncsSummary: Types.GetResourceSyncsSummaryResponse; + GetResourceSync: Types.GetResourceSyncResponse; + GetResourceSyncActionState: Types.GetResourceSyncActionStateResponse; + GetSyncWebhooksEnabled: Types.GetSyncWebhooksEnabledResponse; + ListResourceSyncs: Types.ListResourceSyncsResponse; + ListFullResourceSyncs: Types.ListFullResourceSyncsResponse; + GetStacksSummary: Types.GetStacksSummaryResponse; + GetStack: Types.GetStackResponse; + GetStackActionState: Types.GetStackActionStateResponse; + GetStackWebhooksEnabled: Types.GetStackWebhooksEnabledResponse; + GetStackServiceLog: Types.GetStackServiceLogResponse; + SearchStackServiceLog: Types.SearchStackServiceLogResponse; + ListStacks: Types.ListStacksResponse; + ListFullStacks: Types.ListFullStacksResponse; + ListStackServices: Types.ListStackServicesResponse; + ListCommonStackExtraArgs: Types.ListCommonStackExtraArgsResponse; + ListCommonStackBuildExtraArgs: Types.ListCommonStackBuildExtraArgsResponse; + GetBuildersSummary: Types.GetBuildersSummaryResponse; + GetBuilder: Types.GetBuilderResponse; + ListBuilders: Types.ListBuildersResponse; + ListFullBuilders: Types.ListFullBuildersResponse; + GetAlertersSummary: Types.GetAlertersSummaryResponse; + GetAlerter: Types.GetAlerterResponse; + ListAlerters: Types.ListAlertersResponse; + ListFullAlerters: Types.ListFullAlertersResponse; + ExportAllResourcesToToml: Types.ExportAllResourcesToTomlResponse; + ExportResourcesToToml: Types.ExportResourcesToTomlResponse; + GetTag: Types.GetTagResponse; + ListTags: Types.ListTagsResponse; + GetUpdate: Types.GetUpdateResponse; + ListUpdates: Types.ListUpdatesResponse; + ListAlerts: Types.ListAlertsResponse; + GetAlert: Types.GetAlertResponse; + GetSystemInformation: Types.GetSystemInformationResponse; + GetSystemStats: Types.GetSystemStatsResponse; + ListSystemProcesses: Types.ListSystemProcessesResponse; + GetVariable: Types.GetVariableResponse; + ListVariables: Types.ListVariablesResponse; + GetGitProviderAccount: Types.GetGitProviderAccountResponse; + ListGitProviderAccounts: Types.ListGitProviderAccountsResponse; + GetDockerRegistryAccount: Types.GetDockerRegistryAccountResponse; + ListDockerRegistryAccounts: Types.ListDockerRegistryAccountsResponse; +}; +export type WriteResponses = { + UpdateUserUsername: Types.UpdateUserUsername; + UpdateUserPassword: Types.UpdateUserPassword; + DeleteUser: Types.DeleteUser; + CreateServiceUser: Types.CreateServiceUserResponse; + UpdateServiceUserDescription: Types.UpdateServiceUserDescriptionResponse; + CreateApiKeyForServiceUser: Types.CreateApiKeyForServiceUserResponse; + DeleteApiKeyForServiceUser: Types.DeleteApiKeyForServiceUserResponse; + CreateUserGroup: Types.UserGroup; + RenameUserGroup: Types.UserGroup; + DeleteUserGroup: Types.UserGroup; + AddUserToUserGroup: Types.UserGroup; + RemoveUserFromUserGroup: Types.UserGroup; + SetUsersInUserGroup: Types.UserGroup; + UpdateUserAdmin: Types.UpdateUserAdminResponse; + UpdateUserBasePermissions: Types.UpdateUserBasePermissionsResponse; + UpdatePermissionOnResourceType: Types.UpdatePermissionOnResourceTypeResponse; + UpdatePermissionOnTarget: Types.UpdatePermissionOnTargetResponse; + UpdateDescription: Types.UpdateDescriptionResponse; + LaunchServer: Types.Update; + CreateServer: Types.Server; + DeleteServer: Types.Server; + UpdateServer: Types.Server; + RenameServer: Types.Update; + CreateNetwork: Types.Update; + CreateDeployment: Types.Deployment; + CopyDeployment: Types.Deployment; + DeleteDeployment: Types.Deployment; + UpdateDeployment: Types.Deployment; + RenameDeployment: Types.Update; + CreateBuild: Types.Build; + CopyBuild: Types.Build; + DeleteBuild: Types.Build; + UpdateBuild: Types.Build; + RefreshBuildCache: Types.NoData; + CreateBuildWebhook: Types.CreateBuildWebhookResponse; + DeleteBuildWebhook: Types.DeleteBuildWebhookResponse; + CreateBuilder: Types.Builder; + CopyBuilder: Types.Builder; + DeleteBuilder: Types.Builder; + UpdateBuilder: Types.Builder; + CreateServerTemplate: Types.ServerTemplate; + CopyServerTemplate: Types.ServerTemplate; + DeleteServerTemplate: Types.ServerTemplate; + UpdateServerTemplate: Types.ServerTemplate; + CreateRepo: Types.Repo; + CopyRepo: Types.Repo; + DeleteRepo: Types.Repo; + UpdateRepo: Types.Repo; + RefreshRepoCache: Types.NoData; + CreateRepoWebhook: Types.CreateRepoWebhookResponse; + DeleteRepoWebhook: Types.DeleteRepoWebhookResponse; + CreateAlerter: Types.Alerter; + CopyAlerter: Types.Alerter; + DeleteAlerter: Types.Alerter; + UpdateAlerter: Types.Alerter; + CreateProcedure: Types.Procedure; + CopyProcedure: Types.Procedure; + DeleteProcedure: Types.Procedure; + UpdateProcedure: Types.Procedure; + CreateAction: Types.Action; + CopyAction: Types.Action; + DeleteAction: Types.Action; + UpdateAction: Types.Action; + CreateResourceSync: Types.ResourceSync; + CopyResourceSync: Types.ResourceSync; + DeleteResourceSync: Types.ResourceSync; + UpdateResourceSync: Types.ResourceSync; + CommitSync: Types.ResourceSync; + WriteSyncFileContents: Types.Update; + RefreshResourceSyncPending: Types.ResourceSync; + CreateSyncWebhook: Types.CreateSyncWebhookResponse; + DeleteSyncWebhook: Types.DeleteSyncWebhookResponse; + CreateStack: Types.Stack; + CopyStack: Types.Stack; + DeleteStack: Types.Stack; + UpdateStack: Types.Stack; + RenameStack: Types.Update; + WriteStackFileContents: Types.Update; + RefreshStackCache: Types.NoData; + CreateStackWebhook: Types.CreateStackWebhookResponse; + DeleteStackWebhook: Types.DeleteStackWebhookResponse; + CreateTag: Types.Tag; + DeleteTag: Types.Tag; + RenameTag: Types.Tag; + UpdateTagsOnResource: Types.UpdateTagsOnResourceResponse; + CreateVariable: Types.CreateVariableResponse; + UpdateVariableValue: Types.UpdateVariableValueResponse; + UpdateVariableDescription: Types.UpdateVariableDescriptionResponse; + UpdateVariableIsSecret: Types.UpdateVariableIsSecretResponse; + DeleteVariable: Types.DeleteVariableResponse; + CreateGitProviderAccount: Types.CreateGitProviderAccountResponse; + UpdateGitProviderAccount: Types.UpdateGitProviderAccountResponse; + DeleteGitProviderAccount: Types.DeleteGitProviderAccountResponse; + CreateDockerRegistryAccount: Types.CreateDockerRegistryAccountResponse; + UpdateDockerRegistryAccount: Types.UpdateDockerRegistryAccountResponse; + DeleteDockerRegistryAccount: Types.DeleteDockerRegistryAccountResponse; +}; +export type ExecuteResponses = { + StartContainer: Types.Update; + RestartContainer: Types.Update; + PauseContainer: Types.Update; + UnpauseContainer: Types.Update; + StopContainer: Types.Update; + DestroyContainer: Types.Update; + StartAllContainers: Types.Update; + RestartAllContainers: Types.Update; + PauseAllContainers: Types.Update; + UnpauseAllContainers: Types.Update; + StopAllContainers: Types.Update; + PruneContainers: Types.Update; + DeleteNetwork: Types.Update; + PruneNetworks: Types.Update; + DeleteImage: Types.Update; + PruneImages: Types.Update; + DeleteVolume: Types.Update; + PruneVolumes: Types.Update; + PruneDockerBuilders: Types.Update; + PruneBuildx: Types.Update; + PruneSystem: Types.Update; + Deploy: Types.Update; + StartDeployment: Types.Update; + RestartDeployment: Types.Update; + PauseDeployment: Types.Update; + UnpauseDeployment: Types.Update; + StopDeployment: Types.Update; + DestroyDeployment: Types.Update; + RunBuild: Types.Update; + CancelBuild: Types.Update; + CloneRepo: Types.Update; + PullRepo: Types.Update; + BuildRepo: Types.Update; + CancelRepoBuild: Types.Update; + RunProcedure: Types.Update; + RunAction: Types.Update; + LaunchServer: Types.Update; + RunSync: Types.Update; + DeployStack: Types.Update; + DeployStackIfChanged: Types.Update; + StartStack: Types.Update; + RestartStack: Types.Update; + StopStack: Types.Update; + PauseStack: Types.Update; + UnpauseStack: Types.Update; + DestroyStack: Types.Update; + DeployStackService: Types.Update; + StartStackService: Types.Update; + RestartStackService: Types.Update; + StopStackService: Types.Update; + PauseStackService: Types.Update; + UnpauseStackService: Types.Update; + DestroyStackService: Types.Update; +}; diff --git a/frontend/public/client/responses.js b/frontend/public/client/responses.js new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/frontend/public/client/responses.js @@ -0,0 +1 @@ +export {}; diff --git a/frontend/public/client/types.d.ts b/frontend/public/client/types.d.ts new file mode 100644 index 000000000..4e7860f8c --- /dev/null +++ b/frontend/public/client/types.d.ts @@ -0,0 +1,7173 @@ +export interface MongoIdObj { + $oid: string; +} +export type MongoId = MongoIdObj; +export type I64 = number; +/** The levels of permission that a User or UserGroup can have on a resource. */ +export declare enum PermissionLevel { + /** No permissions. */ + None = "None", + /** Can see the rousource */ + Read = "Read", + /** Can execute actions on the resource */ + Execute = "Execute", + /** Can update the resource configuration */ + Write = "Write" +} +export interface Resource { + /** + * The Mongo ID of the resource. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Resource) }` + */ + _id?: MongoId; + /** + * The resource name. + * This is guaranteed unique among others of the same resource type. + */ + name: string; + /** A description for the resource */ + description?: string; + /** When description last updated */ + updated_at?: I64; + /** Tag Ids */ + tags?: string[]; + /** Resource-specific information (not user configurable). */ + info?: Info; + /** Resource-specific configuration. */ + config?: Config; + /** + * Set a base permission level that all users will have on the + * resource. + */ + base_permission?: PermissionLevel; +} +export interface ActionConfig { + /** Typescript file contents using pre-initialized `komodo` client. */ + file_contents?: string; +} +export interface ActionInfo { + /** When action was last run */ + last_run_at?: I64; +} +export type Action = Resource; +export interface ResourceListItem { + /** The resource id */ + id: string; + /** The resource type, ie `Server` or `Deployment` */ + type: ResourceTarget["type"]; + /** The resource name */ + name: string; + /** Tag Ids */ + tags: string[]; + /** Resource specific info */ + info: Info; +} +export declare enum ActionState { + /** Unknown case */ + Unknown = "Unknown", + /** Last clone / pull successful (or never cloned) */ + Ok = "Ok", + /** Last clone / pull failed */ + Failed = "Failed", + /** Currently running */ + Running = "Running" +} +export interface ActionListItemInfo { + /** Action last run timestamp in ms. */ + last_run_at: I64; + /** Whether last action run successful */ + state: ActionState; +} +export type ActionListItem = ResourceListItem; +export declare enum TagBehavior { + /** Returns resources which have strictly all the tags */ + All = "All", + /** Returns resources which have one or more of the tags */ + Any = "Any" +} +/** Passing empty Vec is the same as not filtering by that field */ +export interface ResourceQuery { + names?: string[]; + /** Pass Vec of tag ids or tag names */ + tags?: string[]; + tag_behavior?: TagBehavior; + specific?: T; +} +export interface ActionQuerySpecifics { +} +export type ActionQuery = ResourceQuery; +export type AlerterEndpoint = +/** Send alert serialized to JSON to an http endpoint. */ +{ + type: "Custom"; + params: CustomAlerterEndpoint; +} +/** Send alert to a Slack app */ + | { + type: "Slack"; + params: SlackAlerterEndpoint; +} +/** Send alert to a Discord app */ + | { + type: "Discord"; + params: DiscordAlerterEndpoint; +}; +/** Used to reference a specific resource across all resource types */ +export type ResourceTarget = { + type: "System"; + id: string; +} | { + type: "Server"; + id: string; +} | { + type: "Stack"; + id: string; +} | { + type: "Deployment"; + id: string; +} | { + type: "Build"; + id: string; +} | { + type: "Repo"; + id: string; +} | { + type: "Procedure"; + id: string; +} | { + type: "Action"; + id: string; +} | { + type: "Builder"; + id: string; +} | { + type: "Alerter"; + id: string; +} | { + type: "ServerTemplate"; + id: string; +} | { + type: "ResourceSync"; + id: string; +}; +export interface AlerterConfig { + /** Whether the alerter is enabled */ + enabled?: boolean; + /** + * Where to route the alert messages. + * + * Default: Custom endpoint `http://localhost:7000` + */ + endpoint?: AlerterEndpoint; + /** + * Only send specific alert types. + * If empty, will send all alert types. + */ + alert_types?: AlertData["type"][]; + /** + * Only send alerts on specific resources. + * If empty, will send alerts for all resources. + */ + resources?: ResourceTarget[]; + /** DON'T send alerts on these resources. */ + except_resources?: ResourceTarget[]; +} +export type Alerter = Resource; +export interface AlerterListItemInfo { + /** Whether alerter is enabled for sending alerts */ + enabled: boolean; + /** The type of the alerter, eg. `Slack`, `Custom` */ + endpoint_type: AlerterEndpoint["type"]; +} +export type AlerterListItem = ResourceListItem; +export interface AlerterQuerySpecifics { + /** + * Filter alerters by enabled. + * - `None`: Don't filter by enabled + * - `Some(true)`: Only include alerts with `enabled: true` + * - `Some(false)`: Only include alerts with `enabled: false` + */ + enabled?: boolean; + /** + * Only include alerters with these endpoint types. + * If empty, don't filter by enpoint type. + */ + types: AlerterEndpoint["type"][]; +} +export type AlerterQuery = ResourceQuery; +export interface Version { + major: number; + minor: number; + patch: number; +} +export interface SystemCommand { + path?: string; + command?: string; +} +/** Configuration for an image registry */ +export interface ImageRegistryConfig { + /** + * Specify the registry provider domain, eg `docker.io`. + * If not provided, will not push to any registry. + */ + domain?: string; + /** Specify an account to use with the registry. */ + account?: string; + /** + * Optional. Specify an organization to push the image under. + * Empty string means no organization. + */ + organization?: string; +} +/** The build configuration. */ +export interface BuildConfig { + /** Which builder is used to build the image. */ + builder_id?: string; + /** The current version of the build. */ + version?: Version; + /** + * Whether to automatically increment the patch on every build. + * Default is `true` + */ + auto_increment_version: boolean; + /** + * An alternate name for the image pushed to the repository. + * If this is empty, it will use the build name. + * + * Can be used in conjunction with `image_tag` to direct multiple builds + * with different configs to push to the same image registry, under different, + * independantly versioned tags. + */ + image_name?: string; + /** + * An extra tag put before the build version, for the image pushed to the repository. + * Eg. in image tag of `aarch64` would push to mbecker20/komodo:1.13.2-aarch64. + * If this is empty, the image tag will just be the build version. + * + * Can be used in conjunction with `image_name` to direct multiple builds + * with different configs to push to the same image registry, under different, + * independantly versioned tags. + */ + image_tag?: string; + /** Configure quick links that are displayed in the resource header */ + links?: string[]; + /** The git provider domain. Default: github.com */ + git_provider: string; + /** + * Whether to use https to clone the repo (versus http). Default: true + * + * Note. Komodo does not currently support cloning repos via ssh. + */ + git_https: boolean; + /** + * The git account used to access private repos. + * Passing empty string can only clone public repos. + * + * Note. A token for the account must be available in the core config or the builder server's periphery config + * for the configured git provider. + */ + git_account?: string; + /** The repo used as the source of the build. */ + repo?: string; + /** The branch of the repo. */ + branch: string; + /** Optionally set a specific commit hash. */ + commit?: string; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this build. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; + /** The optional command run after repo clone and before docker build. */ + pre_build?: SystemCommand; + /** + * The path of the docker build context relative to the root of the repo. + * Default: "." (the root of the repo). + */ + build_path: string; + /** The path of the dockerfile relative to the build path. */ + dockerfile_path: string; + /** Configuration for the registry to push the built image to. */ + image_registry?: ImageRegistryConfig; + /** Whether to skip secret interpolation in the build_args. */ + skip_secret_interp?: boolean; + /** Whether to use buildx to build (eg `docker buildx build ...`) */ + use_buildx?: boolean; + /** Any extra docker cli arguments to be included in the build command */ + extra_args?: string[]; + /** + * Docker build arguments. + * + * These values are visible in the final image by running `docker inspect`. + */ + build_args?: string; + /** + * Secret arguments. + * + * These values remain hidden in the final image by using + * docker secret mounts. See [https://docs.docker.com/build/building/secrets]. + * + * The values can be used in RUN commands: + * ``` + * RUN --mount=type=secret,id=SECRET_KEY \ + * SECRET_KEY=$(cat /run/secrets/SECRET_KEY) ... + * ``` + */ + secret_args?: string; + /** Docker labels */ + labels?: string; +} +export interface BuildInfo { + last_built_at: I64; + /** Latest built short commit hash, or null. */ + built_hash?: string; + /** Latest built commit message, or null. Only for repo based stacks */ + built_message?: string; + /** Latest remote short commit hash, or null. */ + latest_hash?: string; + /** Latest remote commit message, or null */ + latest_message?: string; +} +export type Build = Resource; +export declare enum BuildState { + /** Last build successful (or never built) */ + Ok = "Ok", + /** Last build failed */ + Failed = "Failed", + /** Currently building */ + Building = "Building", + /** Other case */ + Unknown = "Unknown" +} +export interface BuildListItemInfo { + /** Unix timestamp in milliseconds of last build */ + last_built_at: I64; + /** The current version of the build */ + version: Version; + /** The builder attached to build. */ + builder_id: string; + /** The git provider domain */ + git_provider: string; + /** The image registry domain */ + image_registry_domain: string; + /** The repo used as the source of the build */ + repo: string; + /** The branch of the repo */ + branch: string; + /** State of the build. Reflects whether most recent build successful. */ + state: BuildState; + /** Latest built short commit hash, or null. */ + built_hash?: string; + /** Latest short commit hash, or null. Only for repo based stacks */ + latest_hash?: string; +} +export type BuildListItem = ResourceListItem; +export interface BuildQuerySpecifics { + builder_ids?: string[]; + repos?: string[]; + /** + * query for builds last built more recently than this timestamp + * defaults to 0 which is a no op + */ + built_since?: I64; +} +export type BuildQuery = ResourceQuery; +export type BuilderConfig = +/** Use a connected server an image builder. */ +{ + type: "Server"; + params: ServerBuilderConfig; +} +/** Use EC2 instances spawned on demand as an image builder. */ + | { + type: "Aws"; + params: AwsBuilderConfig; +}; +export type Builder = Resource; +export interface BuilderListItemInfo { + /** 'Server' or 'Aws' */ + builder_type: string; + /** + * If 'Server': the server id + * If 'Aws': the instance type (eg. c5.xlarge) + */ + instance_type?: string; +} +export type BuilderListItem = ResourceListItem; +export interface BuilderQuerySpecifics { +} +export type BuilderQuery = ResourceQuery; +/** A wrapper for all Komodo exections. */ +export type Execution = +/** The "null" execution. Does nothing. */ +{ + type: "None"; + params: NoData; +} | { + type: "RunAction"; + params: RunAction; +} | { + type: "RunProcedure"; + params: RunProcedure; +} | { + type: "RunBuild"; + params: RunBuild; +} | { + type: "CancelBuild"; + params: CancelBuild; +} | { + type: "Deploy"; + params: Deploy; +} | { + type: "StartDeployment"; + params: StartDeployment; +} | { + type: "RestartDeployment"; + params: RestartDeployment; +} | { + type: "PauseDeployment"; + params: PauseDeployment; +} | { + type: "UnpauseDeployment"; + params: UnpauseDeployment; +} | { + type: "StopDeployment"; + params: StopDeployment; +} | { + type: "DestroyDeployment"; + params: DestroyDeployment; +} | { + type: "CloneRepo"; + params: CloneRepo; +} | { + type: "PullRepo"; + params: PullRepo; +} | { + type: "BuildRepo"; + params: BuildRepo; +} | { + type: "CancelRepoBuild"; + params: CancelRepoBuild; +} | { + type: "StartContainer"; + params: StartContainer; +} | { + type: "RestartContainer"; + params: RestartContainer; +} | { + type: "PauseContainer"; + params: PauseContainer; +} | { + type: "UnpauseContainer"; + params: UnpauseContainer; +} | { + type: "StopContainer"; + params: StopContainer; +} | { + type: "DestroyContainer"; + params: DestroyContainer; +} | { + type: "StartAllContainers"; + params: StartAllContainers; +} | { + type: "RestartAllContainers"; + params: RestartAllContainers; +} | { + type: "PauseAllContainers"; + params: PauseAllContainers; +} | { + type: "UnpauseAllContainers"; + params: UnpauseAllContainers; +} | { + type: "StopAllContainers"; + params: StopAllContainers; +} | { + type: "PruneContainers"; + params: PruneContainers; +} | { + type: "DeleteNetwork"; + params: DeleteNetwork; +} | { + type: "PruneNetworks"; + params: PruneNetworks; +} | { + type: "DeleteImage"; + params: DeleteImage; +} | { + type: "PruneImages"; + params: PruneImages; +} | { + type: "DeleteVolume"; + params: DeleteVolume; +} | { + type: "PruneVolumes"; + params: PruneVolumes; +} | { + type: "PruneDockerBuilders"; + params: PruneDockerBuilders; +} | { + type: "PruneBuildx"; + params: PruneBuildx; +} | { + type: "PruneSystem"; + params: PruneSystem; +} | { + type: "RunSync"; + params: RunSync; +} | { + type: "CommitSync"; + params: CommitSync; +} | { + type: "DeployStack"; + params: DeployStack; +} | { + type: "DeployStackIfChanged"; + params: DeployStackIfChanged; +} | { + type: "StartStack"; + params: StartStack; +} | { + type: "RestartStack"; + params: RestartStack; +} | { + type: "PauseStack"; + params: PauseStack; +} | { + type: "UnpauseStack"; + params: UnpauseStack; +} | { + type: "StopStack"; + params: StopStack; +} | { + type: "DestroyStack"; + params: DestroyStack; +} | { + type: "Sleep"; + params: Sleep; +}; +/** Allows to enable / disabled procedures in the sequence / parallel vec on the fly */ +export interface EnabledExecution { + /** The execution request to run. */ + execution: Execution; + /** Whether the execution is enabled to run in the procedure. */ + enabled: boolean; +} +/** A single stage of a procedure. Runs a list of executions in parallel. */ +export interface ProcedureStage { + /** A name for the procedure */ + name: string; + /** Whether the stage should be run as part of the procedure. */ + enabled: boolean; + /** The executions in the stage */ + executions?: EnabledExecution[]; +} +/** Config for the [Procedure] */ +export interface ProcedureConfig { + /** The stages to be run by the procedure. */ + stages?: ProcedureStage[]; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this procedure. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; +} +/** + * Procedures run a series of stages sequentially, where + * each stage runs executions in parallel. + */ +export type Procedure = Resource; +export type CopyProcedureResponse = Procedure; +/** Represents an empty json object: `{}` */ +export interface NoData { +} +export type CreateActionWebhookResponse = NoData; +/** Response for [CreateApiKey]. */ +export interface CreateApiKeyResponse { + /** X-API-KEY */ + key: string; + /** + * X-API-SECRET + * + * Note. + * There is no way to get the secret again after it is distributed in this message + */ + secret: string; +} +export type CreateApiKeyForServiceUserResponse = CreateApiKeyResponse; +export type CreateBuildWebhookResponse = NoData; +/** Configuration to access private image repositories on various registries. */ +export interface DockerRegistryAccount { + /** + * The Mongo ID of the docker registry account. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of DockerRegistryAccount) }` + */ + _id?: MongoId; + /** + * The domain of the provider. + * + * For docker registry, this can include 'http://...', + * however this is not recommended and won't work unless "insecure registries" are enabled + * on your hosts. See [https://docs.docker.com/reference/cli/dockerd/#insecure-registries]. + */ + domain: string; + /** The account username */ + username?: string; + /** + * The token in plain text on the db. + * If the database / host can be accessed this is insecure. + */ + token?: string; +} +export type CreateDockerRegistryAccountResponse = DockerRegistryAccount; +/** + * Configuration to access private git repos from various git providers. + * Note. Cannot create two accounts with the same domain and username. + */ +export interface GitProviderAccount { + /** + * The Mongo ID of the git provider account. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized User) }` + */ + _id?: MongoId; + /** + * The domain of the provider. + * + * For git, this cannot include the protocol eg 'http://', + * which is controlled with 'https' field. + */ + domain: string; + /** Whether git provider is accessed over http or https. */ + https: boolean; + /** The account username */ + username?: string; + /** + * The token in plain text on the db. + * If the database / host can be accessed this is insecure. + */ + token?: string; +} +export type CreateGitProviderAccountResponse = GitProviderAccount; +/** JSON containing an authentication token. */ +export interface JwtResponse { + /** A token the user can use to authenticate their requests. */ + jwt: string; +} +/** Response for [CreateLocalUser]. */ +export type CreateLocalUserResponse = JwtResponse; +export type CreateProcedureResponse = Procedure; +export type CreateRepoWebhookResponse = NoData; +export type UserConfig = +/** User that logs in with username / password */ +{ + type: "Local"; + data: { + password: string; + }; +} +/** User that logs in via Google Oauth */ + | { + type: "Google"; + data: { + google_id: string; + avatar: string; + }; +} +/** User that logs in via Github Oauth */ + | { + type: "Github"; + data: { + github_id: string; + avatar: string; + }; +} +/** User that logs in via Oidc provider */ + | { + type: "Oidc"; + data: { + provider: string; + user_id: string; + }; +} +/** Non-human managed user, can have it's own permissions / api keys */ + | { + type: "Service"; + data: { + description: string; + }; +}; +export interface User { + /** + * The Mongo ID of the User. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of User schema) }` + */ + _id?: MongoId; + /** The globally unique username for the user. */ + username: string; + /** Whether user is enabled / able to access the api. */ + enabled?: boolean; + /** Can give / take other users admin priviledges. */ + super_admin?: boolean; + /** Whether the user has global admin permissions. */ + admin?: boolean; + /** Whether the user has permission to create servers. */ + create_server_permissions?: boolean; + /** Whether the user has permission to create builds */ + create_build_permissions?: boolean; + /** The user-type specific config. */ + config: UserConfig; + /** When the user last opened updates dropdown. */ + last_update_view?: I64; + /** Recently viewed ids */ + recents?: Record; + /** Give the user elevated permissions on all resources of a certain type */ + all?: Record; + updated_at?: I64; +} +export type CreateServiceUserResponse = User; +export type CreateStackWebhookResponse = NoData; +export type CreateSyncWebhookResponse = NoData; +/** + * A non-secret global variable which can be interpolated into deployment + * environment variable values and build argument values. + */ +export interface Variable { + /** + * Unique name associated with the variable. + * Instances of '[[variable.name]]' in value will be replaced with 'variable.value'. + */ + name: string; + /** A description for the variable. */ + description?: string; + /** The value associated with the variable. */ + value?: string; + /** + * If marked as secret, the variable value will be hidden in updates / logs. + * Additionally the value will not be served in read requests by non admin users. + * + * Note that the value is NOT encrypted in the database, and will likely show up in database logs. + * The security of these variables comes down to the security + * of the database (system level encryption, network isolation, etc.) + */ + is_secret?: boolean; +} +export type CreateVariableResponse = Variable; +export type DeleteActionWebhookResponse = NoData; +export type DeleteApiKeyForServiceUserResponse = NoData; +export type DeleteApiKeyResponse = NoData; +export type DeleteBuildWebhookResponse = NoData; +export type DeleteDockerRegistryAccountResponse = DockerRegistryAccount; +export type DeleteGitProviderAccountResponse = GitProviderAccount; +export type DeleteProcedureResponse = Procedure; +export type DeleteRepoWebhookResponse = NoData; +export type DeleteStackWebhookResponse = NoData; +export type DeleteSyncWebhookResponse = NoData; +export type DeleteUserResponse = User; +export type DeleteVariableResponse = Variable; +export type DeploymentImage = +/** Deploy any external image. */ +{ + type: "Image"; + params: { + /** The docker image, can be from any registry that works with docker and that the host server can reach. */ + image?: string; + }; +} +/** Deploy a Komodo Build. */ + | { + type: "Build"; + params: { + /** The id of the Build */ + build_id?: string; + /** + * Use a custom / older version of the image produced by the build. + * if version is 0.0.0, this means `latest` image. + */ + version?: Version; + }; +}; +export declare enum RestartMode { + NoRestart = "no", + OnFailure = "on-failure", + Always = "always", + UnlessStopped = "unless-stopped" +} +export declare enum TerminationSignal { + SigHup = "SIGHUP", + SigInt = "SIGINT", + SigQuit = "SIGQUIT", + SigTerm = "SIGTERM" +} +export interface DeploymentConfig { + /** The id of server the deployment is deployed on. */ + server_id?: string; + /** + * The image which the deployment deploys. + * Can either be a user inputted image, or a Komodo Build. + */ + image?: DeploymentImage; + /** + * Configure the account used to pull the image from the registry. + * Used with `docker login`. + * + * - If the field is empty string, will use the same account config as the build, or none at all if using image. + * - If the field contains an account, a token for the account must be available. + * - Will get the registry domain from the build / image + */ + image_registry_account?: string; + /** Whether to skip secret interpolation into the deployment environment variables. */ + skip_secret_interp?: boolean; + /** Whether to redeploy the deployment whenever the attached build finishes. */ + redeploy_on_build?: boolean; + /** Whether to send ContainerStateChange alerts for this deployment. */ + send_alerts: boolean; + /** Configure quick links that are displayed in the resource header */ + links?: string[]; + /** + * The network attached to the container. + * Default is `host`. + */ + network: string; + /** The restart mode given to the container. */ + restart?: RestartMode; + /** + * This is interpolated at the end of the `docker run` command, + * which means they are either passed to the containers inner process, + * or replaces the container command, depending on use of ENTRYPOINT or CMD in dockerfile. + * Empty is no command. + */ + command?: string; + /** The default termination signal to use to stop the deployment. Defaults to SigTerm (default docker signal). */ + termination_signal?: TerminationSignal; + /** The termination timeout. */ + termination_timeout: number; + /** + * Extra args which are interpolated into the `docker run` command, + * and affect the container configuration. + */ + extra_args?: string[]; + /** + * Labels attached to various termination signal options. + * Used to specify different shutdown functionality depending on the termination signal. + */ + term_signal_labels?: string; + /** + * The container port mapping. + * Irrelevant if container network is `host`. + * Maps ports on host to ports on container. + */ + ports?: string; + /** + * The container volume mapping. + * Maps files / folders on host to files / folders in container. + */ + volumes?: string; + /** The environment variables passed to the container. */ + environment?: string; + /** The docker labels given to the container. */ + labels?: string; +} +export type Deployment = Resource; +/** + * Variants de/serialized from/to snake_case. + * + * Eg. + * - NotDeployed -> not_deployed + * - Restarting -> restarting + * - Running -> running. + */ +export declare enum DeploymentState { + Unknown = "unknown", + NotDeployed = "not_deployed", + Created = "created", + Restarting = "restarting", + Running = "running", + Removing = "removing", + Paused = "paused", + Exited = "exited", + Dead = "dead" +} +export interface DeploymentListItemInfo { + /** The state of the deployment / underlying docker container. */ + state: DeploymentState; + /** The status of the docker container (eg. up 12 hours, exited 5 minutes ago.) */ + status?: string; + /** The image attached to the deployment. */ + image: string; + /** The server that deployment sits on. */ + server_id: string; + /** An attached Komodo Build, if it exists. */ + build_id?: string; +} +export type DeploymentListItem = ResourceListItem; +export interface DeploymentQuerySpecifics { + server_ids?: string[]; + build_ids?: string[]; +} +export type DeploymentQuery = ResourceQuery; +/** Response for [ExchangeForJwt]. */ +export type ExchangeForJwtResponse = JwtResponse; +/** Response containing pretty formatted toml contents. */ +export interface TomlResponse { + toml: string; +} +export type ExportAllResourcesToTomlResponse = TomlResponse; +export type ExportResourcesToTomlResponse = TomlResponse; +export type FindUserResponse = User; +export interface ActionActionState { + /** Whether the action is currently running. */ + running: boolean; +} +export type GetActionActionStateResponse = ActionActionState; +export type GetActionResponse = Action; +/** Severity level of problem. */ +export declare enum SeverityLevel { + /** No problem. */ + Ok = "OK", + /** Problem is imminent. */ + Warning = "WARNING", + /** Problem fully realized. */ + Critical = "CRITICAL" +} +/** The variants of data related to the alert. */ +export type AlertData = +/** A null alert */ +{ + type: "None"; + data: {}; +} +/** A server could not be reached. */ + | { + type: "ServerUnreachable"; + data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The error data */ + err?: _Serror; + }; +} +/** A server has high CPU usage. */ + | { + type: "ServerCpu"; + data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The cpu usage percentage */ + percentage: number; + }; +} +/** A server has high memory usage. */ + | { + type: "ServerMem"; + data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The used memory */ + used_gb: number; + /** The total memory */ + total_gb: number; + }; +} +/** A server has high disk usage. */ + | { + type: "ServerDisk"; + data: { + /** The id of the server */ + id: string; + /** The name of the server */ + name: string; + /** The region of the server */ + region?: string; + /** The mount path of the disk */ + path: string; + /** The used portion of the disk in GB */ + used_gb: number; + /** The total size of the disk in GB */ + total_gb: number; + }; +} +/** A container's state has changed unexpectedly. */ + | { + type: "ContainerStateChange"; + data: { + /** The id of the deployment */ + id: string; + /** The name of the deployment */ + name: string; + /** The server id of server that the deployment is on */ + server_id: string; + /** The server name */ + server_name: string; + /** The previous container state */ + from: DeploymentState; + /** The current container state */ + to: DeploymentState; + }; +} +/** A stack's state has changed unexpectedly. */ + | { + type: "StackStateChange"; + data: { + /** The id of the stack */ + id: string; + /** The name of the stack */ + name: string; + /** The server id of server that the stack is on */ + server_id: string; + /** The server name */ + server_name: string; + /** The previous stack state */ + from: StackState; + /** The current stack state */ + to: StackState; + }; +} +/** An AWS builder failed to terminate. */ + | { + type: "AwsBuilderTerminationFailed"; + data: { + /** The id of the aws instance which failed to terminate */ + instance_id: string; + /** A reason for the failure */ + message: string; + }; +} +/** A resource sync has pending updates */ + | { + type: "ResourceSyncPendingUpdates"; + data: { + /** The id of the resource sync */ + id: string; + /** The name of the resource sync */ + name: string; + }; +} +/** A build has failed */ + | { + type: "BuildFailed"; + data: { + /** The id of the build */ + id: string; + /** The name of the build */ + name: string; + /** The version that failed to build */ + version: Version; + }; +} +/** A repo has failed */ + | { + type: "RepoBuildFailed"; + data: { + /** The id of the repo */ + id: string; + /** The name of the repo */ + name: string; + }; +}; +/** Representation of an alert in the system. */ +export interface Alert { + /** + * The Mongo ID of the alert. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Alert) }` + */ + _id?: MongoId; + /** Unix timestamp in milliseconds the alert was opened */ + ts: I64; + /** Whether the alert is already resolved */ + resolved: boolean; + /** The severity of the alert */ + level: SeverityLevel; + /** The target of the alert */ + target: ResourceTarget; + /** The data attached to the alert */ + data: AlertData; + /** The timestamp of alert resolution */ + resolved_ts?: I64; +} +export type GetAlertResponse = Alert; +export type GetAlerterResponse = Alerter; +export interface BuildActionState { + building: boolean; +} +export type GetBuildActionStateResponse = BuildActionState; +export type GetBuildResponse = Build; +export type GetBuilderResponse = Builder; +/** Represents the output of some command being run */ +export interface Log { + /** A label for the log */ + stage: string; + /** The command which was executed */ + command: string; + /** The output of the command in the standard channel */ + stdout: string; + /** The output of the command in the error channel */ + stderr: string; + /** Whether the command run was successful */ + success: boolean; + /** The start time of the command execution */ + start_ts: I64; + /** The end time of the command execution */ + end_ts: I64; +} +export type GetContainerLogResponse = Log; +export interface DeploymentActionState { + deploying: boolean; + starting: boolean; + restarting: boolean; + pausing: boolean; + unpausing: boolean; + stopping: boolean; + destroying: boolean; + renaming: boolean; +} +export type GetDeploymentActionStateResponse = DeploymentActionState; +export type GetDeploymentLogResponse = Log; +export type GetDeploymentResponse = Deployment; +export interface ContainerStats { + name: string; + cpu_perc: string; + mem_perc: string; + mem_usage: string; + net_io: string; + block_io: string; + pids: string; +} +export type GetDeploymentStatsResponse = ContainerStats; +export type GetDockerRegistryAccountResponse = DockerRegistryAccount; +export type GetGitProviderAccountResponse = GitProviderAccount; +export type GetPermissionLevelResponse = PermissionLevel; +export interface ProcedureActionState { + running: boolean; +} +export type GetProcedureActionStateResponse = ProcedureActionState; +export type GetProcedureResponse = Procedure; +export interface RepoActionState { + /** Whether repo currently cloning */ + cloning: boolean; + /** Whether repo currently pulling */ + pulling: boolean; + /** Whether repo currently building, using the attached builder. */ + building: boolean; +} +export type GetRepoActionStateResponse = RepoActionState; +export interface RepoConfig { + /** The server to clone the repo on. */ + server_id?: string; + /** Attach a builder to 'build' the repo. */ + builder_id?: string; + /** The git provider domain. Default: github.com */ + git_provider: string; + /** + * Whether to use https to clone the repo (versus http). Default: true + * + * Note. Komodo does not currently support cloning repos via ssh. + */ + git_https: boolean; + /** + * The git account used to access private repos. + * Passing empty string can only clone public repos. + * + * Note. A token for the account must be available in the core config or the builder server's periphery config + * for the configured git provider. + */ + git_account?: string; + /** The github repo to clone. */ + repo?: string; + /** The repo branch. */ + branch: string; + /** Optionally set a specific commit hash. */ + commit?: string; + /** Explicitly specify the folder to clone the repo in. */ + path?: string; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this repo. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; + /** + * Command to be run after the repo is cloned. + * The path is relative to the root of the repo. + */ + on_clone?: SystemCommand; + /** + * Command to be run after the repo is pulled. + * The path is relative to the root of the repo. + */ + on_pull?: SystemCommand; + /** Configure quick links that are displayed in the resource header */ + links?: string[]; + /** + * The environment variables passed to the compose file. + * They will be written to path defined in env_file_path, + * which is given relative to the run directory. + * + * If it is empty, no file will be written. + */ + environment?: string; + /** + * The name of the written environment file before `docker compose up`. + * Relative to the repo root. + * Default: .env + */ + env_file_path: string; + /** Whether to skip secret interpolation into the repo environment variable file. */ + skip_secret_interp?: boolean; +} +export interface RepoInfo { + /** When repo was last pulled */ + last_pulled_at?: I64; + /** When repo was last built */ + last_built_at?: I64; + /** Latest built short commit hash, or null. */ + built_hash?: string; + /** Latest built commit message, or null. Only for repo based stacks */ + built_message?: string; + /** Latest remote short commit hash, or null. */ + latest_hash?: string; + /** Latest remote commit message, or null */ + latest_message?: string; +} +export type Repo = Resource; +export type GetRepoResponse = Repo; +export interface ResourceSyncActionState { + /** Whether sync currently syncing */ + syncing: boolean; +} +export type GetResourceSyncActionStateResponse = ResourceSyncActionState; +/** The sync configuration. */ +export interface ResourceSyncConfig { + /** The git provider domain. Default: github.com */ + git_provider: string; + /** + * Whether to use https to clone the repo (versus http). Default: true + * + * Note. Komodo does not currently support cloning repos via ssh. + */ + git_https: boolean; + /** The Github repo used as the source of the build. */ + repo?: string; + /** The branch of the repo. */ + branch: string; + /** Optionally set a specific commit hash. */ + commit?: string; + /** + * The git account used to access private repos. + * Passing empty string can only clone public repos. + * + * Note. A token for the account must be available in the core config or the builder server's periphery config + * for the configured git provider. + */ + git_account?: string; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this sync. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; + /** + * Files are available on the Komodo Core host. + * Specify the file / folder with [ResourceSyncConfig::resource_path]. + */ + files_on_host?: boolean; + /** + * The path of the resource file(s) to sync. + * - If Files on Host, this is relative to the configured `sync_directory` in core config. + * - If Git Repo based, this is relative to the root of the repo. + * Can be a specific file, or a directory containing multiple files / folders. + * See [https://komo.do/docs/sync-resources](https://komo.do/docs/sync-resources) for more information. + */ + resource_path?: string[]; + /** + * Enable "pushes" to the file, + * which exports resources matching tags to single file. + * - If using `files_on_host`, it is stored in the file_contents, which must point to a .toml file path (it will be created if it doesn't exist). + * - If using `file_contents`, it is stored in the database. + * When using this, "delete" mode is always enabled. + */ + managed?: boolean; + /** + * Whether sync should delete resources + * not declared in the resource files + */ + delete?: boolean; + /** + * When using `managed` resource sync, will only export resources + * matching all of the given tags. If none, will match all resources. + */ + match_tags?: string[]; + /** Manage the file contents in the UI. */ + file_contents?: string; +} +export type DiffData = +/** Resource will be created */ +{ + type: "Create"; + data: { + /** The name of resource to create */ + name?: string; + /** The proposed resource to create in TOML */ + proposed: string; + }; +} | { + type: "Update"; + data: { + /** The proposed TOML */ + proposed: string; + /** The current TOML */ + current: string; + }; +} | { + type: "Delete"; + data: { + /** The current TOML of the resource to delete */ + current: string; + }; +}; +export interface ResourceDiff { + /** + * The resource target. + * The target id will be empty if "Create" ResourceDiffType. + */ + target: ResourceTarget; + /** The data associated with the diff. */ + data: DiffData; +} +export interface SyncDeployUpdate { + /** Resources to deploy */ + to_deploy: number; + /** A readable log of all the changes to be applied */ + log: string; +} +export interface SyncFileContents { + /** The base resource path. */ + resource_path?: string; + /** The path of the file / error path relative to the resource path. */ + path: string; + /** The contents of the file */ + contents: string; +} +export interface ResourceSyncInfo { + /** Unix timestamp of last applied sync */ + last_sync_ts?: I64; + /** Short commit hash of last applied sync */ + last_sync_hash?: string; + /** Commit message of last applied sync */ + last_sync_message?: string; + /** The list of pending updates to resources */ + resource_updates?: ResourceDiff[]; + /** The list of pending updates to variables */ + variable_updates?: DiffData[]; + /** The list of pending updates to user groups */ + user_group_updates?: DiffData[]; + /** The list of pending deploys to resources. */ + pending_deploy?: SyncDeployUpdate; + /** If there is an error, it will be stored here */ + pending_error?: string; + /** The commit hash which produced these pending updates. */ + pending_hash?: string; + /** The commit message which produced these pending updates. */ + pending_message?: string; + /** The current sync files */ + remote_contents?: SyncFileContents[]; + /** Any read errors in files by path */ + remote_errors?: SyncFileContents[]; +} +export type ResourceSync = Resource; +export type GetResourceSyncResponse = ResourceSync; +/** Current pending actions on the server. */ +export interface ServerActionState { + /** Server currently pruning networks */ + pruning_networks: boolean; + /** Server currently pruning containers */ + pruning_containers: boolean; + /** Server currently pruning images */ + pruning_images: boolean; + /** Server currently pruning volumes */ + pruning_volumes: boolean; + /** Server currently pruning docker builders */ + pruning_builders: boolean; + /** Server currently pruning builx cache */ + pruning_buildx: boolean; + /** Server currently pruning system */ + pruning_system: boolean; + /** Server currently starting containers. */ + starting_containers: boolean; + /** Server currently restarting containers. */ + restarting_containers: boolean; + /** Server currently pausing containers. */ + pausing_containers: boolean; + /** Server currently unpausing containers. */ + unpausing_containers: boolean; + /** Server currently stopping containers. */ + stopping_containers: boolean; +} +export type GetServerActionStateResponse = ServerActionState; +/** Server configuration. */ +export interface ServerConfig { + /** + * The http address of the periphery client. + * Default: http://localhost:8120 + */ + address: string; + /** An optional region label */ + region?: string; + /** + * Whether a server is enabled. + * If a server is disabled, + * you won't be able to perform any actions on it or see deployment's status. + * default: true + */ + enabled: boolean; + /** + * Sometimes the system stats reports a mount path that is not desired. + * Use this field to filter it out from the report. + */ + ignore_mounts?: string[]; + /** + * Whether to monitor any server stats beyond passing health check. + * default: true + */ + stats_monitoring: boolean; + /** + * Whether to trigger 'docker image prune -a -f' every 24 hours. + * default: true + */ + auto_prune: boolean; + /** Configure quick links that are displayed in the resource header */ + links?: string[]; + /** Whether to send alerts about the servers reachability */ + send_unreachable_alerts: boolean; + /** Whether to send alerts about the servers CPU status */ + send_cpu_alerts: boolean; + /** Whether to send alerts about the servers MEM status */ + send_mem_alerts: boolean; + /** Whether to send alerts about the servers DISK status */ + send_disk_alerts: boolean; + /** The percentage threshhold which triggers WARNING state for CPU. */ + cpu_warning: number; + /** The percentage threshhold which triggers CRITICAL state for CPU. */ + cpu_critical: number; + /** The percentage threshhold which triggers WARNING state for MEM. */ + mem_warning: number; + /** The percentage threshhold which triggers CRITICAL state for MEM. */ + mem_critical: number; + /** The percentage threshhold which triggers WARNING state for DISK. */ + disk_warning: number; + /** The percentage threshhold which triggers CRITICAL state for DISK. */ + disk_critical: number; +} +export type Server = Resource; +export type GetServerResponse = Server; +export type ServerTemplateConfig = +/** Template to launch an AWS EC2 instance */ +{ + type: "Aws"; + params: AwsServerTemplateConfig; +} +/** Template to launch a Hetzner server */ + | { + type: "Hetzner"; + params: HetznerServerTemplateConfig; +}; +export type ServerTemplate = Resource; +export type GetServerTemplateResponse = ServerTemplate; +export interface StackActionState { + deploying: boolean; + starting: boolean; + restarting: boolean; + pausing: boolean; + unpausing: boolean; + stopping: boolean; + destroying: boolean; +} +export type GetStackActionStateResponse = StackActionState; +/** The compose file configuration. */ +export interface StackConfig { + /** The server to deploy the stack on. */ + server_id?: string; + /** Configure quick links that are displayed in the resource header */ + links?: string[]; + /** + * Optionally specify a custom project name for the stack. + * If this is empty string, it will default to the stack name. + * Used with `docker compose -p {project_name}`. + * + * Note. Can be used to import pre-existing stacks. + */ + project_name?: string; + /** + * Whether to automatically `compose pull` before redeploying stack. + * Ensured latest images are deployed. + * Will fail if the compose file specifies a locally build image. + */ + auto_pull: boolean; + /** + * Whether to `docker compose build` before `compose down` / `compose up`. + * Combine with build_extra_args for custom behaviors. + */ + run_build?: boolean; + /** Whether to run `docker compose down` before `compose up`. */ + destroy_before_deploy?: boolean; + /** Whether to skip secret interpolation into the stack environment variables. */ + skip_secret_interp?: boolean; + /** + * If this is checked, the stack will source the files on the host. + * Use `run_directory` and `file_paths` to specify the path on the host. + * This is useful for those who wish to setup their files on the host using SSH or similar, + * rather than defining the contents in UI or in a git repo. + */ + files_on_host?: boolean; + /** Directory to change to (`cd`) before running `docker compose up -d`. */ + run_directory?: string; + /** + * Add paths to compose files, relative to the run path. + * If this is empty, will use file `compose.yaml`. + */ + file_paths?: string[]; + /** + * The name of the written environment file before `docker compose up`. + * Relative to the run directory root. + * Default: .env + */ + env_file_path: string; + /** + * Add additional env files to attach with `--env-file`. + * Relative to the run directory root. + */ + additional_env_files?: string[]; + /** The git provider domain. Default: github.com */ + git_provider: string; + /** + * Whether to use https to clone the repo (versus http). Default: true + * + * Note. Komodo does not currently support cloning repos via ssh. + */ + git_https: boolean; + /** + * The git account used to access private repos. + * Passing empty string can only clone public repos. + * + * Note. A token for the account must be available in the core config or the builder server's periphery config + * for the configured git provider. + */ + git_account?: string; + /** The Github repo used as the source of the build. */ + repo?: string; + /** The branch of the repo. */ + branch: string; + /** Optionally set a specific commit hash. */ + commit?: string; + /** + * By default, the Stack will `git pull` the repo after it is first cloned. + * If this option is enabled, the repo folder will be deleted and recloned instead. + */ + reclone?: boolean; + /** Whether incoming webhooks actually trigger action. */ + webhook_enabled: boolean; + /** + * Optionally provide an alternate webhook secret for this stack. + * If its an empty string, use the default secret from the config. + */ + webhook_secret?: string; + /** + * By default, the Stack will `DeployStackIfChanged`. + * If this option is enabled, will always run `DeployStack` without diffing. + */ + webhook_force_deploy?: boolean; + /** Whether to send StackStateChange alerts for this stack. */ + send_alerts: boolean; + /** Used with `registry_account` to login to a registry before docker compose up. */ + registry_provider?: string; + /** Used with `registry_provider` to login to a registry before docker compose up. */ + registry_account?: string; + /** The optional command to run before the Stack is deployed. */ + pre_deploy?: SystemCommand; + /** + * The extra arguments to pass after `docker compose up -d`. + * If empty, no extra arguments will be passed. + */ + extra_args?: string[]; + /** + * The extra arguments to pass after `docker compose build`. + * If empty, no extra build arguments will be passed. + * Only used if `run_build: true` + */ + build_extra_args?: string[]; + /** + * Ignore certain services declared in the compose file when checking + * the stack status. For example, an init service might be exited, but the + * stack should be healthy. This init service should be in `ignore_services` + */ + ignore_services?: string[]; + /** + * The contents of the file directly, for management in the UI. + * If this is empty, it will fall back to checking git config for + * repo based compose file. + */ + file_contents?: string; + /** + * The environment variables passed to the compose file. + * They will be written to path defined in env_file_path, + * which is given relative to the run directory. + * + * If it is empty, no file will be written. + */ + environment?: string; +} +export interface FileContents { + /** The path of the file on the host */ + path: string; + /** The contents of the file */ + contents: string; +} +export interface StackServiceNames { + /** The name of the service */ + service_name: string; + /** + * Will either be the declared container_name in the compose file, + * or a pattern to match auto named containers. + * + * Auto named containers are composed of three parts: + * + * 1. The name of the compose project (top level name field of compose file). + * This defaults to the name of the parent folder of the compose file. + * Komodo will always set it to be the name of the stack, but imported stacks + * will have a different name. + * 2. The service name + * 3. The replica number + * + * Example: stacko-mongo-1. + * + * This stores only 1. and 2., ie stacko-mongo. + * Containers will be matched via regex like `^container_name-?[0-9]*$`` + */ + container_name: string; +} +export interface StackInfo { + /** + * If any of the expected files are missing in the repo, + * they will be stored here. + */ + missing_files?: string[]; + /** + * The deployed project name. + * This is updated whenever Komodo successfully deploys the stack. + * If it is present, Komodo will use it for actions over other options, + * to ensure control is maintained after changing the project name (there is no rename compose project api). + */ + deployed_project_name?: string; + /** Deployed short commit hash, or null. Only for repo based stacks. */ + deployed_hash?: string; + /** Deployed commit message, or null. Only for repo based stacks */ + deployed_message?: string; + /** The deployed compose file contents. This is updated whenever Komodo successfully deploys the stack. */ + deployed_contents?: FileContents[]; + /** + * The deployed service names. + * This is updated whenever it is empty, or deployed contents is updated. + */ + deployed_services?: StackServiceNames[]; + /** + * The latest service names. + * This is updated whenever the stack cache refreshes, using the latest file contents (either db defined or remote). + */ + latest_services?: StackServiceNames[]; + /** + * The remote compose file contents, whether on host or in repo. + * This is updated whenever Komodo refreshes the stack cache. + * It will be empty if the file is defined directly in the stack config. + */ + remote_contents?: FileContents[]; + /** If there was an error in getting the remote contents, it will be here. */ + remote_errors?: FileContents[]; + /** Latest commit hash, or null */ + latest_hash?: string; + /** Latest commit message, or null */ + latest_message?: string; +} +export type Stack = Resource; +export type GetStackResponse = Stack; +export type GetStackServiceLogResponse = Log; +/** System information of a server */ +export interface SystemInformation { + /** The system name */ + name?: string; + /** The system long os version */ + os?: string; + /** System's kernel version */ + kernel?: string; + /** Physical core count */ + core_count?: number; + /** System hostname based off DNS */ + host_name?: string; + /** The CPU's brand */ + cpu_brand: string; +} +export type GetSystemInformationResponse = SystemInformation; +/** Info for a single disk mounted on the system. */ +export interface SingleDiskUsage { + /** The mount point of the disk */ + mount: string; + /** Detected file system */ + file_system: string; + /** Used portion of the disk in GB */ + used_gb: number; + /** Total size of the disk in GB */ + total_gb: number; +} +export declare enum Timelength { + OneSecond = "1-sec", + FiveSeconds = "5-sec", + TenSeconds = "10-sec", + FifteenSeconds = "15-sec", + ThirtySeconds = "30-sec", + OneMinute = "1-min", + TwoMinutes = "2-min", + FiveMinutes = "5-min", + TenMinutes = "10-min", + FifteenMinutes = "15-min", + ThirtyMinutes = "30-min", + OneHour = "1-hr", + TwoHours = "2-hr", + SixHours = "6-hr", + EightHours = "8-hr", + TwelveHours = "12-hr", + OneDay = "1-day", + ThreeDay = "3-day", + OneWeek = "1-wk", + TwoWeeks = "2-wk", + ThirtyDays = "30-day" +} +/** Realtime system stats data. */ +export interface SystemStats { + /** Cpu usage percentage */ + cpu_perc: number; + /** + * [1.15.9+] + * Free memory in GB. + * This is really the 'Free' memory, not the 'Available' memory. + * It may be different than mem_total_gb - mem_used_gb. + */ + mem_free_gb?: number; + /** Used memory in GB. 'Total' - 'Available' (not free) memory. */ + mem_used_gb: number; + /** Total memory in GB */ + mem_total_gb: number; + /** Breakdown of individual disks, ie their usages, sizes, and mount points */ + disks: SingleDiskUsage[]; + /** The rate the system stats are being polled from the system */ + polling_rate: Timelength; + /** Unix timestamp in milliseconds when stats were last polled */ + refresh_ts: I64; + /** Unix timestamp in milliseconds when disk list was last refreshed */ + refresh_list_ts: I64; +} +export type GetSystemStatsResponse = SystemStats; +export interface Tag { + /** + * The Mongo ID of the tag. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Tag) }` + */ + _id?: MongoId; + name: string; + owner?: string; +} +export type GetTagResponse = Tag; +export declare enum Operation { + None = "None", + CreateServer = "CreateServer", + UpdateServer = "UpdateServer", + DeleteServer = "DeleteServer", + RenameServer = "RenameServer", + StartContainer = "StartContainer", + RestartContainer = "RestartContainer", + PauseContainer = "PauseContainer", + UnpauseContainer = "UnpauseContainer", + StopContainer = "StopContainer", + DestroyContainer = "DestroyContainer", + StartAllContainers = "StartAllContainers", + RestartAllContainers = "RestartAllContainers", + PauseAllContainers = "PauseAllContainers", + UnpauseAllContainers = "UnpauseAllContainers", + StopAllContainers = "StopAllContainers", + PruneContainers = "PruneContainers", + CreateNetwork = "CreateNetwork", + DeleteNetwork = "DeleteNetwork", + PruneNetworks = "PruneNetworks", + DeleteImage = "DeleteImage", + PruneImages = "PruneImages", + DeleteVolume = "DeleteVolume", + PruneVolumes = "PruneVolumes", + PruneDockerBuilders = "PruneDockerBuilders", + PruneBuildx = "PruneBuildx", + PruneSystem = "PruneSystem", + CreateStack = "CreateStack", + UpdateStack = "UpdateStack", + RenameStack = "RenameStack", + DeleteStack = "DeleteStack", + WriteStackContents = "WriteStackContents", + RefreshStackCache = "RefreshStackCache", + DeployStack = "DeployStack", + StartStack = "StartStack", + RestartStack = "RestartStack", + PauseStack = "PauseStack", + UnpauseStack = "UnpauseStack", + StopStack = "StopStack", + DestroyStack = "DestroyStack", + StartStackService = "StartStackService", + RestartStackService = "RestartStackService", + PauseStackService = "PauseStackService", + UnpauseStackService = "UnpauseStackService", + StopStackService = "StopStackService", + CreateDeployment = "CreateDeployment", + UpdateDeployment = "UpdateDeployment", + DeleteDeployment = "DeleteDeployment", + Deploy = "Deploy", + StartDeployment = "StartDeployment", + RestartDeployment = "RestartDeployment", + PauseDeployment = "PauseDeployment", + UnpauseDeployment = "UnpauseDeployment", + StopDeployment = "StopDeployment", + DestroyDeployment = "DestroyDeployment", + RenameDeployment = "RenameDeployment", + CreateBuild = "CreateBuild", + UpdateBuild = "UpdateBuild", + DeleteBuild = "DeleteBuild", + RunBuild = "RunBuild", + CancelBuild = "CancelBuild", + CreateRepo = "CreateRepo", + UpdateRepo = "UpdateRepo", + DeleteRepo = "DeleteRepo", + CloneRepo = "CloneRepo", + PullRepo = "PullRepo", + BuildRepo = "BuildRepo", + CancelRepoBuild = "CancelRepoBuild", + CreateProcedure = "CreateProcedure", + UpdateProcedure = "UpdateProcedure", + DeleteProcedure = "DeleteProcedure", + RunProcedure = "RunProcedure", + CreateAction = "CreateAction", + UpdateAction = "UpdateAction", + DeleteAction = "DeleteAction", + RunAction = "RunAction", + CreateBuilder = "CreateBuilder", + UpdateBuilder = "UpdateBuilder", + DeleteBuilder = "DeleteBuilder", + CreateAlerter = "CreateAlerter", + UpdateAlerter = "UpdateAlerter", + DeleteAlerter = "DeleteAlerter", + CreateServerTemplate = "CreateServerTemplate", + UpdateServerTemplate = "UpdateServerTemplate", + DeleteServerTemplate = "DeleteServerTemplate", + LaunchServer = "LaunchServer", + CreateResourceSync = "CreateResourceSync", + UpdateResourceSync = "UpdateResourceSync", + DeleteResourceSync = "DeleteResourceSync", + WriteSyncContents = "WriteSyncContents", + CommitSync = "CommitSync", + RunSync = "RunSync", + CreateVariable = "CreateVariable", + UpdateVariableValue = "UpdateVariableValue", + DeleteVariable = "DeleteVariable", + CreateGitProviderAccount = "CreateGitProviderAccount", + UpdateGitProviderAccount = "UpdateGitProviderAccount", + DeleteGitProviderAccount = "DeleteGitProviderAccount", + CreateDockerRegistryAccount = "CreateDockerRegistryAccount", + UpdateDockerRegistryAccount = "UpdateDockerRegistryAccount", + DeleteDockerRegistryAccount = "DeleteDockerRegistryAccount" +} +/** An update's status */ +export declare enum UpdateStatus { + /** The run is in the system but hasn't started yet */ + Queued = "Queued", + /** The run is currently running */ + InProgress = "InProgress", + /** The run is complete */ + Complete = "Complete" +} +/** Represents an action performed by Komodo. */ +export interface Update { + /** + * The Mongo ID of the update. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized Update) }` + */ + _id?: MongoId; + /** The operation performed */ + operation: Operation; + /** The time the operation started */ + start_ts: I64; + /** Whether the operation was successful */ + success: boolean; + /** + * The user id that triggered the update. + * + * Also can take these values for operations triggered automatically: + * - `Procedure`: The operation was triggered as part of a procedure run + * - `Github`: The operation was triggered by a github webhook + * - `Auto Redeploy`: The operation (always `Deploy`) was triggered by an attached build finishing. + */ + operator: string; + /** The target resource to which this update refers */ + target: ResourceTarget; + /** Logs produced as the operation is performed */ + logs: Log[]; + /** The time the operation completed. */ + end_ts?: I64; + /** + * The status of the update + * - `Queued` + * - `InProgress` + * - `Complete` + */ + status: UpdateStatus; + /** An optional version on the update, ie build version or deployed version. */ + version?: Version; + /** An optional commit hash associated with the update, ie cloned hash or deployed hash. */ + commit_hash?: string; + /** Some unstructured, operation specific data. Not for general usage. */ + other_data?: string; +} +export type GetUpdateResponse = Update; +/** + * Permission users at the group level. + * + * All users that are part of a group inherit the group's permissions. + * A user can be a part of multiple groups. A user's permission on a particular resource + * will be resolved to be the maximum permission level between the user's own permissions and + * any groups they are a part of. + */ +export interface UserGroup { + /** + * The Mongo ID of the UserGroup. + * This field is de/serialized from/to JSON as + * `{ "_id": { "$oid": "..." }, ...(rest of serialized User) }` + */ + _id?: MongoId; + /** A name for the user group */ + name: string; + /** User ids of group members */ + users?: string[]; + /** Give the user group elevated permissions on all resources of a certain type */ + all?: Record; + /** Unix time (ms) when user group last updated */ + updated_at?: I64; +} +export type GetUserGroupResponse = UserGroup; +export type GetUserResponse = User; +export type GetVariableResponse = Variable; +export declare enum ContainerStateStatusEnum { + Empty = "", + Created = "created", + Running = "running", + Paused = "paused", + Restarting = "restarting", + Removing = "removing", + Exited = "exited", + Dead = "dead" +} +export declare enum HealthStatusEnum { + Empty = "", + None = "none", + Starting = "starting", + Healthy = "healthy", + Unhealthy = "unhealthy" +} +/** HealthcheckResult stores information about a single run of a healthcheck probe */ +export interface HealthcheckResult { + /** Date and time at which this check started in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ + Start?: string; + /** Date and time at which this check ended in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. */ + End?: string; + /** ExitCode meanings: - `0` healthy - `1` unhealthy - `2` reserved (considered unhealthy) - other values: error running probe */ + ExitCode?: I64; + /** Output from last check */ + Output?: string; +} +/** Health stores information about the container's healthcheck results. */ +export interface ContainerHealth { + /** Status is one of `none`, `starting`, `healthy` or `unhealthy` - \"none\" Indicates there is no healthcheck - \"starting\" Starting indicates that the container is not yet ready - \"healthy\" Healthy indicates that the container is running correctly - \"unhealthy\" Unhealthy indicates that the container has a problem */ + Status?: HealthStatusEnum; + /** FailingStreak is the number of consecutive failures */ + FailingStreak?: I64; + /** Log contains the last few results (oldest first) */ + Log?: HealthcheckResult[]; +} +/** ContainerState stores container's running state. It's part of ContainerJSONBase and will be returned by the \"inspect\" command. */ +export interface ContainerState { + /** String representation of the container state. Can be one of \"created\", \"running\", \"paused\", \"restarting\", \"removing\", \"exited\", or \"dead\". */ + Status?: ContainerStateStatusEnum; + /** Whether this container is running. Note that a running container can be _paused_. The `Running` and `Paused` booleans are not mutually exclusive: When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers are both `Running` _and_ `Paused`. Use the `Status` field instead to determine if a container's state is \"running\". */ + Running?: boolean; + /** Whether this container is paused. */ + Paused?: boolean; + /** Whether this container is restarting. */ + Restarting?: boolean; + /** Whether a process within this container has been killed because it ran out of memory since the container was last started. */ + OOMKilled?: boolean; + Dead?: boolean; + /** The process ID of this container */ + Pid?: I64; + /** The last exit code of this container */ + ExitCode?: I64; + Error?: string; + /** The time when this container was last started. */ + StartedAt?: string; + /** The time when this container last exited. */ + FinishedAt?: string; + Health?: ContainerHealth; +} +export type Usize = number; +export interface ResourcesBlkioWeightDevice { + Path?: string; + Weight?: Usize; +} +export interface ThrottleDevice { + /** Device path */ + Path?: string; + /** Rate */ + Rate?: I64; +} +/** A device mapping between the host and container */ +export interface DeviceMapping { + PathOnHost?: string; + PathInContainer?: string; + CgroupPermissions?: string; +} +/** A request for devices to be sent to device drivers */ +export interface DeviceRequest { + Driver?: string; + Count?: I64; + DeviceIDs?: string[]; + /** A list of capabilities; an OR list of AND lists of capabilities. */ + Capabilities?: string[][]; + /** Driver-specific options, specified as a key/value pairs. These options are passed directly to the driver. */ + Options?: Record; +} +export interface ResourcesUlimits { + /** Name of ulimit */ + Name?: string; + /** Soft limit */ + Soft?: I64; + /** Hard limit */ + Hard?: I64; +} +/** The logging configuration for this container */ +export interface HostConfigLogConfig { + Type?: string; + Config?: Record; +} +/** PortBinding represents a binding between a host IP address and a host port. */ +export interface PortBinding { + /** Host IP address that the container's port is mapped to. */ + HostIp?: string; + /** Host port number that the container's port is mapped to. */ + HostPort?: string; +} +export declare enum RestartPolicyNameEnum { + Empty = "", + No = "no", + Always = "always", + UnlessStopped = "unless-stopped", + OnFailure = "on-failure" +} +/** The behavior to apply when the container exits. The default is not to restart. An ever increasing delay (double the previous delay, starting at 100ms) is added before each restart to prevent flooding the server. */ +export interface RestartPolicy { + /** - Empty string means not to restart - `no` Do not automatically restart - `always` Always restart - `unless-stopped` Restart always except when the user has manually stopped the container - `on-failure` Restart only when the container exit code is non-zero */ + Name?: RestartPolicyNameEnum; + /** If `on-failure` is used, the number of times to retry before giving up. */ + MaximumRetryCount?: I64; +} +export declare enum MountTypeEnum { + Empty = "", + Bind = "bind", + Volume = "volume", + Tmpfs = "tmpfs", + Npipe = "npipe", + Cluster = "cluster" +} +export declare enum MountBindOptionsPropagationEnum { + Empty = "", + Private = "private", + Rprivate = "rprivate", + Shared = "shared", + Rshared = "rshared", + Slave = "slave", + Rslave = "rslave" +} +/** Optional configuration for the `bind` type. */ +export interface MountBindOptions { + /** A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. */ + Propagation?: MountBindOptionsPropagationEnum; + /** Disable recursive bind mount. */ + NonRecursive?: boolean; + /** Create mount point on host if missing */ + CreateMountpoint?: boolean; + /** Make the mount non-recursively read-only, but still leave the mount recursive (unless NonRecursive is set to `true` in conjunction). Addded in v1.44, before that version all read-only mounts were non-recursive by default. To match the previous behaviour this will default to `true` for clients on versions prior to v1.44. */ + ReadOnlyNonRecursive?: boolean; + /** Raise an error if the mount cannot be made recursively read-only. */ + ReadOnlyForceRecursive?: boolean; +} +/** Map of driver specific options */ +export interface MountVolumeOptionsDriverConfig { + /** Name of the driver to use to create the volume. */ + Name?: string; + /** key/value map of driver specific options. */ + Options?: Record; +} +/** Optional configuration for the `volume` type. */ +export interface MountVolumeOptions { + /** Populate volume with data from the target. */ + NoCopy?: boolean; + /** User-defined key/value metadata. */ + Labels?: Record; + DriverConfig?: MountVolumeOptionsDriverConfig; + /** Source path inside the volume. Must be relative without any back traversals. */ + Subpath?: string; +} +/** Optional configuration for the `tmpfs` type. */ +export interface MountTmpfsOptions { + /** The size for the tmpfs mount in bytes. */ + SizeBytes?: I64; + /** The permission mode for the tmpfs mount in an integer. */ + Mode?: I64; +} +export interface ContainerMount { + /** Container path. */ + Target?: string; + /** Mount source (e.g. a volume name, a host path). */ + Source?: string; + /** The mount type. Available types: - `bind` Mounts a file or directory from the host into the container. Must exist prior to creating the container. - `volume` Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. - `tmpfs` Create a tmpfs with the given options. The mount source cannot be specified for tmpfs. - `npipe` Mounts a named pipe from the host into the container. Must exist prior to creating the container. - `cluster` a Swarm cluster volume */ + Type?: MountTypeEnum; + /** Whether the mount should be read-only. */ + ReadOnly?: boolean; + /** The consistency requirement for the mount: `default`, `consistent`, `cached`, or `delegated`. */ + Consistency?: string; + BindOptions?: MountBindOptions; + VolumeOptions?: MountVolumeOptions; + TmpfsOptions?: MountTmpfsOptions; +} +export declare enum HostConfigCgroupnsModeEnum { + Empty = "", + Private = "private", + Host = "host" +} +export declare enum HostConfigIsolationEnum { + Empty = "", + Default = "default", + Process = "process", + Hyperv = "hyperv" +} +/** Container configuration that depends on the host we are running on */ +export interface HostConfig { + /** An integer value representing this container's relative CPU weight versus other containers. */ + CpuShares?: I64; + /** Memory limit in bytes. */ + Memory?: I64; + /** Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. */ + CgroupParent?: string; + /** Block IO weight (relative weight). */ + BlkioWeight?: number; + /** Block IO weight (relative device weight) in the form: ``` [{\"Path\": \"device_path\", \"Weight\": weight}] ``` */ + BlkioWeightDevice?: ResourcesBlkioWeightDevice[]; + /** Limit read rate (bytes per second) from a device, in the form: ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` */ + BlkioDeviceReadBps?: ThrottleDevice[]; + /** Limit write rate (bytes per second) to a device, in the form: ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` */ + BlkioDeviceWriteBps?: ThrottleDevice[]; + /** Limit read rate (IO per second) from a device, in the form: ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` */ + BlkioDeviceReadIOps?: ThrottleDevice[]; + /** Limit write rate (IO per second) to a device, in the form: ``` [{\"Path\": \"device_path\", \"Rate\": rate}] ``` */ + BlkioDeviceWriteIOps?: ThrottleDevice[]; + /** The length of a CPU period in microseconds. */ + CpuPeriod?: I64; + /** Microseconds of CPU time that the container can get in a CPU period. */ + CpuQuota?: I64; + /** The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks. */ + CpuRealtimePeriod?: I64; + /** The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks. */ + CpuRealtimeRuntime?: I64; + /** CPUs in which to allow execution (e.g., `0-3`, `0,1`). */ + CpusetCpus?: string; + /** Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems. */ + CpusetMems?: string; + /** A list of devices to add to the container. */ + Devices?: DeviceMapping[]; + /** a list of cgroup rules to apply to the container */ + DeviceCgroupRules?: string[]; + /** A list of requests for devices to be sent to device drivers. */ + DeviceRequests?: DeviceRequest[]; + /** Hard limit for kernel TCP buffer memory (in bytes). Depending on the OCI runtime in use, this option may be ignored. It is no longer supported by the default (runc) runtime. This field is omitted when empty. */ + KernelMemoryTCP?: I64; + /** Memory soft limit in bytes. */ + MemoryReservation?: I64; + /** Total memory limit (memory + swap). Set as `-1` to enable unlimited swap. */ + MemorySwap?: I64; + /** Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100. */ + MemorySwappiness?: I64; + /** CPU quota in units of 10-9 CPUs. */ + NanoCpus?: I64; + /** Disable OOM Killer for the container. */ + OomKillDisable?: boolean; + /** Run an init inside the container that forwards signals and reaps processes. This field is omitted if empty, and the default (as configured on the daemon) is used. */ + Init?: boolean; + /** Tune a container's PIDs limit. Set `0` or `-1` for unlimited, or `null` to not change. */ + PidsLimit?: I64; + /** A list of resource limits to set in the container. For example: ``` {\"Name\": \"nofile\", \"Soft\": 1024, \"Hard\": 2048} ``` */ + Ulimits?: ResourcesUlimits[]; + /** The number of usable CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. */ + CpuCount?: I64; + /** The usable percentage of the available CPUs (Windows only). On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last. */ + CpuPercent?: I64; + /** Maximum IOps for the container system drive (Windows only) */ + IOMaximumIOps?: I64; + /** Maximum IO in bytes per second for the container system drive (Windows only). */ + IOMaximumBandwidth?: I64; + /** A list of volume bindings for this container. Each volume binding is a string in one of these forms: - `host-src:container-dest[:options]` to bind-mount a host path into the container. Both `host-src`, and `container-dest` must be an _absolute_ path. - `volume-name:container-dest[:options]` to bind-mount a volume managed by a volume driver into the container. `container-dest` must be an _absolute_ path. `options` is an optional, comma-delimited list of: - `nocopy` disables automatic copying of data from the container path to the volume. The `nocopy` flag only applies to named volumes. - `[ro|rw]` mounts a volume read-only or read-write, respectively. If omitted or set to `rw`, volumes are mounted read-write. - `[z|Z]` applies SELinux labels to allow or deny multiple containers to read and write to the same volume. - `z`: a _shared_ content label is applied to the content. This label indicates that multiple containers can share the volume content, for both reading and writing. - `Z`: a _private unshared_ label is applied to the content. This label indicates that only the current container can use a private volume. Labeling systems such as SELinux require proper labels to be placed on volume content that is mounted into a container. Without a label, the security system can prevent a container's processes from using the content. By default, the labels set by the host operating system are not modified. - `[[r]shared|[r]slave|[r]private]` specifies mount [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt). This only applies to bind-mounted volumes, not internal volumes or named volumes. Mount propagation requires the source mount point (the location where the source directory is mounted in the host operating system) to have the correct propagation properties. For shared volumes, the source mount point must be set to `shared`. For slave volumes, the mount must be set to either `shared` or `slave`. */ + Binds?: string[]; + /** Path to a file where the container ID is written */ + ContainerIDFile?: string; + LogConfig?: HostConfigLogConfig; + /** Network mode to use for this container. Supported standard values are: `bridge`, `host`, `none`, and `container:`. Any other value is taken as a custom network's name to which this container should connect to. */ + NetworkMode?: string; + PortBindings?: Record; + RestartPolicy?: RestartPolicy; + /** Automatically remove the container when the container's process exits. This has no effect if `RestartPolicy` is set. */ + AutoRemove?: boolean; + /** Driver that this container uses to mount volumes. */ + VolumeDriver?: string; + /** A list of volumes to inherit from another container, specified in the form `[:]`. */ + VolumesFrom?: string[]; + /** Specification for mounts to be added to the container. */ + Mounts?: ContainerMount[]; + /** Initial console size, as an `[height, width]` array. */ + ConsoleSize?: number[]; + /** Arbitrary non-identifying metadata attached to container and provided to the runtime when the container is started. */ + Annotations?: Record; + /** A list of kernel capabilities to add to the container. Conflicts with option 'Capabilities'. */ + CapAdd?: string[]; + /** A list of kernel capabilities to drop from the container. Conflicts with option 'Capabilities'. */ + CapDrop?: string[]; + /** cgroup namespace mode for the container. Possible values are: - `\"private\"`: the container runs in its own private cgroup namespace - `\"host\"`: use the host system's cgroup namespace If not specified, the daemon default is used, which can either be `\"private\"` or `\"host\"`, depending on daemon version, kernel support and configuration. */ + CgroupnsMode?: HostConfigCgroupnsModeEnum; + /** A list of DNS servers for the container to use. */ + Dns?: string[]; + /** A list of DNS options. */ + DnsOptions?: string[]; + /** A list of DNS search domains. */ + DnsSearch?: string[]; + /** A list of hostnames/IP mappings to add to the container's `/etc/hosts` file. Specified in the form `[\"hostname:IP\"]`. */ + ExtraHosts?: string[]; + /** A list of additional groups that the container process will run as. */ + GroupAdd?: string[]; + /** IPC sharing mode for the container. Possible values are: - `\"none\"`: own private IPC namespace, with /dev/shm not mounted - `\"private\"`: own private IPC namespace - `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers - `\"container:\"`: join another (shareable) container's IPC namespace - `\"host\"`: use the host system's IPC namespace If not specified, daemon default is used, which can either be `\"private\"` or `\"shareable\"`, depending on daemon version and configuration. */ + IpcMode?: string; + /** Cgroup to use for the container. */ + Cgroup?: string; + /** A list of links for the container in the form `container_name:alias`. */ + Links?: string[]; + /** An integer value containing the score given to the container in order to tune OOM killer preferences. */ + OomScoreAdj?: I64; + /** Set the PID (Process) Namespace mode for the container. It can be either: - `\"container:\"`: joins another container's PID namespace - `\"host\"`: use the host's PID namespace inside the container */ + PidMode?: string; + /** Gives the container full access to the host. */ + Privileged?: boolean; + /** Allocates an ephemeral host port for all of a container's exposed ports. Ports are de-allocated when the container stops and allocated when the container starts. The allocated port might be changed when restarting the container. The port is selected from the ephemeral port range that depends on the kernel. For example, on Linux the range is defined by `/proc/sys/net/ipv4/ip_local_port_range`. */ + PublishAllPorts?: boolean; + /** Mount the container's root filesystem as read only. */ + ReadonlyRootfs?: boolean; + /** A list of string values to customize labels for MLS systems, such as SELinux. */ + SecurityOpt?: string[]; + /** Storage driver options for this container, in the form `{\"size\": \"120G\"}`. */ + StorageOpt?: Record; + /** A map of container directories which should be replaced by tmpfs mounts, and their corresponding mount options. For example: ``` { \"/run\": \"rw,noexec,nosuid,size=65536k\" } ``` */ + Tmpfs?: Record; + /** UTS namespace to use for the container. */ + UTSMode?: string; + /** Sets the usernamespace mode for the container when usernamespace remapping option is enabled. */ + UsernsMode?: string; + /** Size of `/dev/shm` in bytes. If omitted, the system uses 64MB. */ + ShmSize?: I64; + /** A list of kernel parameters (sysctls) to set in the container. For example: ``` {\"net.ipv4.ip_forward\": \"1\"} ``` */ + Sysctls?: Record; + /** Runtime to use with this container. */ + Runtime?: string; + /** Isolation technology of the container. (Windows only) */ + Isolation?: HostConfigIsolationEnum; + /** The list of paths to be masked inside the container (this overrides the default set of paths). */ + MaskedPaths?: string[]; + /** The list of paths to be set as read-only inside the container (this overrides the default set of paths). */ + ReadonlyPaths?: string[]; +} +/** Information about the storage driver used to store the container's and image's filesystem. */ +export interface GraphDriverData { + /** Name of the storage driver. */ + Name?: string; + /** Low-level storage metadata, provided as key/value pairs. This information is driver-specific, and depends on the storage-driver in use, and should be used for informational purposes only. */ + Data?: Record; +} +/** MountPoint represents a mount point configuration inside the container. This is used for reporting the mountpoints in use by a container. */ +export interface MountPoint { + /** The mount type: - `bind` a mount of a file or directory from the host into the container. - `volume` a docker volume with the given `Name`. - `tmpfs` a `tmpfs`. - `npipe` a named pipe from the host into the container. - `cluster` a Swarm cluster volume */ + Type?: MountTypeEnum; + /** Name is the name reference to the underlying data defined by `Source` e.g., the volume name. */ + Name?: string; + /** Source location of the mount. For volumes, this contains the storage location of the volume (within `/var/lib/docker/volumes/`). For bind-mounts, and `npipe`, this contains the source (host) part of the bind-mount. For `tmpfs` mount points, this field is empty. */ + Source?: string; + /** Destination is the path relative to the container root (`/`) where the `Source` is mounted inside the container. */ + Destination?: string; + /** Driver is the volume driver used to create the volume (if it is a volume). */ + Driver?: string; + /** Mode is a comma separated list of options supplied by the user when creating the bind/volume mount. The default is platform-specific (`\"z\"` on Linux, empty on Windows). */ + Mode?: string; + /** Whether the mount is mounted writable (read-write). */ + RW?: boolean; + /** Propagation describes how mounts are propagated from the host into the mount point, and vice-versa. Refer to the [Linux kernel documentation](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) for details. This field is not used on Windows. */ + Propagation?: string; +} +/** A test to perform to check that the container is healthy. */ +export interface HealthConfig { + /** The test to perform. Possible values are: - `[]` inherit healthcheck from image or parent image - `[\"NONE\"]` disable healthcheck - `[\"CMD\", args...]` exec arguments directly - `[\"CMD-SHELL\", command]` run command with system's default shell */ + Test?: string[]; + /** The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + Interval?: I64; + /** The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + Timeout?: I64; + /** The number of consecutive failures needed to consider a container as unhealthy. 0 means inherit. */ + Retries?: I64; + /** Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + StartPeriod?: I64; + /** The time to wait between checks in nanoseconds during the start period. It should be 0 or at least 1000000 (1 ms). 0 means inherit. */ + StartInterval?: I64; +} +/** Configuration for a container that is portable between hosts. When used as `ContainerConfig` field in an image, `ContainerConfig` is an optional field containing the configuration of the container that was last committed when creating the image. Previous versions of Docker builder used this field to store build cache, and it is not in active use anymore. */ +export interface ContainerConfig { + /** The hostname to use for the container, as a valid RFC 1123 hostname. */ + Hostname?: string; + /** The domain name to use for the container. */ + Domainname?: string; + /** The user that commands are run as inside the container. */ + User?: string; + /** Whether to attach to `stdin`. */ + AttachStdin?: boolean; + /** Whether to attach to `stdout`. */ + AttachStdout?: boolean; + /** Whether to attach to `stderr`. */ + AttachStderr?: boolean; + /** An object mapping ports to an empty object in the form: `{\"/\": {}}` */ + ExposedPorts?: Record>; + /** Attach standard streams to a TTY, including `stdin` if it is not closed. */ + Tty?: boolean; + /** Open `stdin` */ + OpenStdin?: boolean; + /** Close `stdin` after one attached client disconnects */ + StdinOnce?: boolean; + /** A list of environment variables to set inside the container in the form `[\"VAR=value\", ...]`. A variable without `=` is removed from the environment, rather than to have an empty value. */ + Env?: string[]; + /** Command to run specified as a string or an array of strings. */ + Cmd?: string[]; + Healthcheck?: HealthConfig; + /** Command is already escaped (Windows only) */ + ArgsEscaped?: boolean; + /** The name (or reference) of the image to use when creating the container, or which was used when the container was created. */ + Image?: string; + /** An object mapping mount point paths inside the container to empty objects. */ + Volumes?: Record>; + /** The working directory for commands to run in. */ + WorkingDir?: string; + /** The entry point for the container as a string or an array of strings. If the array consists of exactly one empty string (`[\"\"]`) then the entry point is reset to system default (i.e., the entry point used by docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`). */ + Entrypoint?: string[]; + /** Disable networking for the container. */ + NetworkDisabled?: boolean; + /** MAC address of the container. Deprecated: this field is deprecated in API v1.44 and up. Use EndpointSettings.MacAddress instead. */ + MacAddress?: string; + /** `ONBUILD` metadata that were defined in the image's `Dockerfile`. */ + OnBuild?: string[]; + /** User-defined key/value metadata. */ + Labels?: Record; + /** Signal to stop a container as a string or unsigned integer. */ + StopSignal?: string; + /** Timeout to stop a container in seconds. */ + StopTimeout?: I64; + /** Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell. */ + Shell?: string[]; +} +/** EndpointIPAMConfig represents an endpoint's IPAM configuration. */ +export interface EndpointIpamConfig { + IPv4Address?: string; + IPv6Address?: string; + LinkLocalIPs?: string[]; +} +/** Configuration for a network endpoint. */ +export interface EndpointSettings { + IPAMConfig?: EndpointIpamConfig; + Links?: string[]; + /** MAC address for the endpoint on this network. The network driver might ignore this parameter. */ + MacAddress?: string; + Aliases?: string[]; + /** Unique ID of the network. */ + NetworkID?: string; + /** Unique ID for the service endpoint in a Sandbox. */ + EndpointID?: string; + /** Gateway address for this network. */ + Gateway?: string; + /** IPv4 address. */ + IPAddress?: string; + /** Mask length of the IPv4 address. */ + IPPrefixLen?: I64; + /** IPv6 gateway address. */ + IPv6Gateway?: string; + /** Global IPv6 address. */ + GlobalIPv6Address?: string; + /** Mask length of the global IPv6 address. */ + GlobalIPv6PrefixLen?: I64; + /** DriverOpts is a mapping of driver options and values. These options are passed directly to the driver and are driver specific. */ + DriverOpts?: Record; + /** List of all DNS names an endpoint has on a specific network. This list is based on the container name, network aliases, container short ID, and hostname. These DNS names are non-fully qualified but can contain several dots. You can get fully qualified DNS names by appending `.`. For instance, if container name is `my.ctr` and the network is named `testnet`, `DNSNames` will contain `my.ctr` and the FQDN will be `my.ctr.testnet`. */ + DNSNames?: string[]; +} +/** NetworkSettings exposes the network settings in the API */ +export interface NetworkSettings { + /** Name of the default bridge interface when dockerd's --bridge flag is set. */ + Bridge?: string; + /** SandboxID uniquely represents a container's network stack. */ + SandboxID?: string; + Ports?: Record; + /** SandboxKey is the full path of the netns handle */ + SandboxKey?: string; + /** Information about all networks that the container is connected to. */ + Networks?: Record; +} +export interface Container { + /** The ID of the container */ + Id?: string; + /** The time the container was created */ + Created?: string; + /** The path to the command being run */ + Path?: string; + /** The arguments to the command being run */ + Args?: string[]; + State?: ContainerState; + /** The container's image ID */ + Image?: string; + ResolvConfPath?: string; + HostnamePath?: string; + HostsPath?: string; + LogPath?: string; + Name?: string; + RestartCount?: I64; + Driver?: string; + Platform?: string; + MountLabel?: string; + ProcessLabel?: string; + AppArmorProfile?: string; + /** IDs of exec instances that are running in the container. */ + ExecIDs?: string[]; + HostConfig?: HostConfig; + GraphDriver?: GraphDriverData; + /** The size of files that have been created or changed by this container. */ + SizeRw?: I64; + /** The total size of all the files in this container. */ + SizeRootFs?: I64; + Mounts?: MountPoint[]; + Config?: ContainerConfig; + NetworkSettings?: NetworkSettings; +} +export type InspectDockerContainerResponse = Container; +/** Information about the image's RootFS, including the layer IDs. */ +export interface ImageInspectRootFs { + Type?: string; + Layers?: string[]; +} +/** Additional metadata of the image in the local cache. This information is local to the daemon, and not part of the image itself. */ +export interface ImageInspectMetadata { + /** Date and time at which the image was last tagged in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. This information is only available if the image was tagged locally, and omitted otherwise. */ + LastTagTime?: string; +} +/** Information about an image in the local image cache. */ +export interface Image { + /** ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. */ + Id?: string; + /** List of image names/tags in the local image cache that reference this image. Multiple image tags can refer to the same image, and this list may be empty if no tags reference the image, in which case the image is \"untagged\", in which case it can still be referenced by its ID. */ + RepoTags?: string[]; + /** List of content-addressable digests of locally available image manifests that the image is referenced from. Multiple manifests can refer to the same image. These digests are usually only available if the image was either pulled from a registry, or if the image was pushed to a registry, which is when the manifest is generated and its digest calculated. */ + RepoDigests?: string[]; + /** ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. */ + Parent?: string; + /** Optional message that was set when committing or importing the image. */ + Comment?: string; + /** Date and time at which the image was created, formatted in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format with nano-seconds. This information is only available if present in the image, and omitted otherwise. */ + Created?: string; + /** The version of Docker that was used to build the image. Depending on how the image was created, this field may be empty. */ + DockerVersion?: string; + /** Name of the author that was specified when committing the image, or as specified through MAINTAINER (deprecated) in the Dockerfile. */ + Author?: string; + /** Configuration for a container that is portable between hosts. */ + Config?: ContainerConfig; + /** Hardware CPU architecture that the image runs on. */ + Architecture?: string; + /** CPU architecture variant (presently ARM-only). */ + Variant?: string; + /** Operating System the image is built to run on. */ + Os?: string; + /** Operating System version the image is built to run on (especially for Windows). */ + OsVersion?: string; + /** Total size of the image including all layers it is composed of. */ + Size?: I64; + GraphDriver?: GraphDriverData; + RootFS?: ImageInspectRootFs; + Metadata?: ImageInspectMetadata; +} +export type InspectDockerImageResponse = Image; +export interface IpamConfig { + Subnet?: string; + IPRange?: string; + Gateway?: string; + AuxiliaryAddresses: Record; +} +export interface Ipam { + /** Name of the IPAM driver to use. */ + Driver?: string; + /** List of IPAM configuration options, specified as a map: ``` {\"Subnet\": , \"IPRange\": , \"Gateway\": , \"AuxAddress\": } ``` */ + Config: IpamConfig[]; + /** Driver-specific options, specified as a map. */ + Options: Record; +} +export interface NetworkContainer { + /** This is the key on the incoming map of NetworkContainer */ + ContainerID?: string; + Name?: string; + EndpointID?: string; + MacAddress?: string; + IPv4Address?: string; + IPv6Address?: string; +} +export interface Network { + Name?: string; + Id?: string; + Created?: string; + Scope?: string; + Driver?: string; + EnableIPv6?: boolean; + IPAM?: Ipam; + Internal?: boolean; + Attachable?: boolean; + Ingress?: boolean; + /** This field is turned from map into array for easier usability. */ + Containers: NetworkContainer[]; + Options?: Record; + Labels?: Record; +} +export type InspectDockerNetworkResponse = Network; +export declare enum VolumeScopeEnum { + Empty = "", + Local = "local", + Global = "global" +} +export type U64 = number; +/** The version number of the object such as node, service, etc. This is needed to avoid conflicting writes. The client must send the version number along with the modified specification when updating these objects. This approach ensures safe concurrency and determinism in that the change on the object may not be applied if the version number has changed from the last read. In other words, if two update requests specify the same base version, only one of the requests can succeed. As a result, two separate update requests that happen at the same time will not unintentionally overwrite each other. */ +export interface ObjectVersion { + Index?: U64; +} +export declare enum ClusterVolumeSpecAccessModeScopeEnum { + Empty = "", + Single = "single", + Multi = "multi" +} +export declare enum ClusterVolumeSpecAccessModeSharingEnum { + Empty = "", + None = "none", + Readonly = "readonly", + Onewriter = "onewriter", + All = "all" +} +/** One cluster volume secret entry. Defines a key-value pair that is passed to the plugin. */ +export interface ClusterVolumeSpecAccessModeSecrets { + /** Key is the name of the key of the key-value pair passed to the plugin. */ + Key?: string; + /** Secret is the swarm Secret object from which to read data. This can be a Secret name or ID. The Secret data is retrieved by swarm and used as the value of the key-value pair passed to the plugin. */ + Secret?: string; +} +export type Topology = Record; +/** Requirements for the accessible topology of the volume. These fields are optional. For an in-depth description of what these fields mean, see the CSI specification. */ +export interface ClusterVolumeSpecAccessModeAccessibilityRequirements { + /** A list of required topologies, at least one of which the volume must be accessible from. */ + Requisite?: Topology[]; + /** A list of topologies that the volume should attempt to be provisioned in. */ + Preferred?: Topology[]; +} +/** The desired capacity that the volume should be created with. If empty, the plugin will decide the capacity. */ +export interface ClusterVolumeSpecAccessModeCapacityRange { + /** The volume must be at least this big. The value of 0 indicates an unspecified minimum */ + RequiredBytes?: I64; + /** The volume must not be bigger than this. The value of 0 indicates an unspecified maximum. */ + LimitBytes?: I64; +} +export declare enum ClusterVolumeSpecAccessModeAvailabilityEnum { + Empty = "", + Active = "active", + Pause = "pause", + Drain = "drain" +} +/** Defines how the volume is used by tasks. */ +export interface ClusterVolumeSpecAccessMode { + /** The set of nodes this volume can be used on at one time. - `single` The volume may only be scheduled to one node at a time. - `multi` the volume may be scheduled to any supported number of nodes at a time. */ + Scope?: ClusterVolumeSpecAccessModeScopeEnum; + /** The number and way that different tasks can use this volume at one time. - `none` The volume may only be used by one task at a time. - `readonly` The volume may be used by any number of tasks, but they all must mount the volume as readonly - `onewriter` The volume may be used by any number of tasks, but only one may mount it as read/write. - `all` The volume may have any number of readers and writers. */ + Sharing?: ClusterVolumeSpecAccessModeSharingEnum; + /** Swarm Secrets that are passed to the CSI storage plugin when operating on this volume. */ + Secrets?: ClusterVolumeSpecAccessModeSecrets[]; + AccessibilityRequirements?: ClusterVolumeSpecAccessModeAccessibilityRequirements; + CapacityRange?: ClusterVolumeSpecAccessModeCapacityRange; + /** The availability of the volume for use in tasks. - `active` The volume is fully available for scheduling on the cluster - `pause` No new workloads should use the volume, but existing workloads are not stopped. - `drain` All workloads using this volume should be stopped and rescheduled, and no new ones should be started. */ + Availability?: ClusterVolumeSpecAccessModeAvailabilityEnum; +} +/** Cluster-specific options used to create the volume. */ +export interface ClusterVolumeSpec { + /** Group defines the volume group of this volume. Volumes belonging to the same group can be referred to by group name when creating Services. Referring to a volume by group instructs Swarm to treat volumes in that group interchangeably for the purpose of scheduling. Volumes with an empty string for a group technically all belong to the same, emptystring group. */ + Group?: string; + AccessMode?: ClusterVolumeSpecAccessMode; +} +/** Information about the global status of the volume. */ +export interface ClusterVolumeInfo { + /** The capacity of the volume in bytes. A value of 0 indicates that the capacity is unknown. */ + CapacityBytes?: I64; + /** A map of strings to strings returned from the storage plugin when the volume is created. */ + VolumeContext?: Record; + /** The ID of the volume as returned by the CSI storage plugin. This is distinct from the volume's ID as provided by Docker. This ID is never used by the user when communicating with Docker to refer to this volume. If the ID is blank, then the Volume has not been successfully created in the plugin yet. */ + VolumeID?: string; + /** The topology this volume is actually accessible from. */ + AccessibleTopology?: Topology[]; +} +export declare enum ClusterVolumePublishStatusStateEnum { + Empty = "", + PendingPublish = "pending-publish", + Published = "published", + PendingNodeUnpublish = "pending-node-unpublish", + PendingControllerUnpublish = "pending-controller-unpublish" +} +export interface ClusterVolumePublishStatus { + /** The ID of the Swarm node the volume is published on. */ + NodeID?: string; + /** The published state of the volume. * `pending-publish` The volume should be published to this node, but the call to the controller plugin to do so has not yet been successfully completed. * `published` The volume is published successfully to the node. * `pending-node-unpublish` The volume should be unpublished from the node, and the manager is awaiting confirmation from the worker that it has done so. * `pending-controller-unpublish` The volume is successfully unpublished from the node, but has not yet been successfully unpublished on the controller. */ + State?: ClusterVolumePublishStatusStateEnum; + /** A map of strings to strings returned by the CSI controller plugin when a volume is published. */ + PublishContext?: Record; +} +/** Options and information specific to, and only present on, Swarm CSI cluster volumes. */ +export interface ClusterVolume { + /** The Swarm ID of this volume. Because cluster volumes are Swarm objects, they have an ID, unlike non-cluster volumes. This ID can be used to refer to the Volume instead of the name. */ + ID?: string; + Version?: ObjectVersion; + CreatedAt?: string; + UpdatedAt?: string; + Spec?: ClusterVolumeSpec; + Info?: ClusterVolumeInfo; + /** The status of the volume as it pertains to its publishing and use on specific nodes */ + PublishStatus?: ClusterVolumePublishStatus[]; +} +/** Usage details about the volume. This information is used by the `GET /system/df` endpoint, and omitted in other endpoints. */ +export interface VolumeUsageData { + /** Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") */ + Size: I64; + /** The number of containers referencing this volume. This field is set to `-1` if the reference-count is not available. */ + RefCount: I64; +} +export interface Volume { + /** Name of the volume. */ + Name: string; + /** Name of the volume driver used by the volume. */ + Driver: string; + /** Mount path of the volume on the host. */ + Mountpoint: string; + /** Date/Time the volume was created. */ + CreatedAt?: string; + /** Low-level details about the volume, provided by the volume driver. Details are returned as a map with key/value pairs: `{\"key\":\"value\",\"key2\":\"value2\"}`. The `Status` field is optional, and is omitted if the volume driver does not support this feature. */ + Status?: Record>; + /** User-defined key/value metadata. */ + Labels?: Record; + /** The level at which the volume exists. Either `global` for cluster-wide, or `local` for machine level. */ + Scope?: VolumeScopeEnum; + ClusterVolume?: ClusterVolume; + /** The driver specific options used when creating the volume. */ + Options?: Record; + UsageData?: VolumeUsageData; +} +export type InspectDockerVolumeResponse = Volume; +export type JsonValue = any; +export type ListActionsResponse = ActionListItem[]; +export type ListAlertersResponse = AlerterListItem[]; +export interface ContainerListItem { + /** The Server which holds the container. */ + server_id?: string; + /** The first name in Names, not including the initial '/' */ + name: string; + /** The ID of this container */ + id?: string; + /** The name of the image used when creating this container */ + image?: string; + /** The ID of the image that this container was created from */ + image_id?: string; + /** When the container was created */ + created?: I64; + /** The size of files that have been created or changed by this container */ + size_rw?: I64; + /** The total size of all the files in this container */ + size_root_fs?: I64; + /** The state of this container (e.g. `exited`) */ + state: ContainerStateStatusEnum; + /** Additional human-readable status of this container (e.g. `Exit 0`) */ + status?: string; + /** The network mode */ + network_mode?: string; + /** The network names attached to container */ + networks: string[]; + /** The volume names attached to container */ + volumes: string[]; + /** + * The labels attached to container. + * It's too big to send with container list, + * can get it using InspectContainer + */ + labels?: Record; +} +export type ListAllDockerContainersResponse = ContainerListItem[]; +/** An api key used to authenticate requests via request headers. */ +export interface ApiKey { + /** Unique key associated with secret */ + key: string; + /** Hash of the secret */ + secret: string; + /** User associated with the api key */ + user_id: string; + /** Name associated with the api key for management */ + name: string; + /** Timestamp of key creation */ + created_at: I64; + /** Expiry of key, or 0 if never expires */ + expires: I64; +} +export type ListApiKeysForServiceUserResponse = ApiKey[]; +export type ListApiKeysResponse = ApiKey[]; +export interface BuildVersionResponseItem { + version: Version; + ts: I64; +} +export type ListBuildVersionsResponse = BuildVersionResponseItem[]; +export type ListBuildersResponse = BuilderListItem[]; +export type ListBuildsResponse = BuildListItem[]; +export type ListCommonBuildExtraArgsResponse = string[]; +export type ListCommonDeploymentExtraArgsResponse = string[]; +export type ListCommonStackBuildExtraArgsResponse = string[]; +export type ListCommonStackExtraArgsResponse = string[]; +export interface ComposeProject { + /** The compose project name. */ + name: string; + /** The status of the project, as returned by docker. */ + status?: string; + /** The compose files included in the project. */ + compose_files: string[]; +} +export type ListComposeProjectsResponse = ComposeProject[]; +export type ListDeploymentsResponse = DeploymentListItem[]; +export type ListDockerContainersResponse = ContainerListItem[]; +/** individual image layer information in response to ImageHistory operation */ +export interface ImageHistoryResponseItem { + Id: string; + Created: I64; + CreatedBy: string; + Tags?: string[]; + Size: I64; + Comment: string; +} +export type ListDockerImageHistoryResponse = ImageHistoryResponseItem[]; +export interface ImageListItem { + /** The first tag in `repo_tags`, or Id if no tags. */ + name: string; + /** ID is the content-addressable ID of an image. This identifier is a content-addressable digest calculated from the image's configuration (which includes the digests of layers used by the image). Note that this digest differs from the `RepoDigests` below, which holds digests of image manifests that reference the image. */ + id: string; + /** ID of the parent image. Depending on how the image was created, this field may be empty and is only set for images that were built/created locally. This field is empty if the image was pulled from an image registry. */ + parent_id: string; + /** Date and time at which the image was created as a Unix timestamp (number of seconds sinds EPOCH). */ + created: I64; + /** Total size of the image including all layers it is composed of. */ + size: I64; + /** Whether the image is in use by any container */ + in_use: boolean; +} +export type ListDockerImagesResponse = ImageListItem[]; +export interface NetworkListItem { + name?: string; + id?: string; + created?: string; + scope?: string; + driver?: string; + enable_ipv6?: boolean; + ipam_driver?: string; + ipam_subnet?: string; + ipam_gateway?: string; + internal?: boolean; + attachable?: boolean; + ingress?: boolean; + /** Whether the network is attached to one or more containers */ + in_use: boolean; +} +export type ListDockerNetworksResponse = NetworkListItem[]; +export interface ProviderAccount { + /** The account username. Required. */ + username: string; + /** The account access token. Required. */ + token?: string; +} +export interface DockerRegistry { + /** The docker provider domain. Default: `docker.io`. */ + domain: string; + /** The account username. Required. */ + accounts?: ProviderAccount[]; + /** + * Available organizations on the registry provider. + * Used to push an image under an organization's repo rather than an account's repo. + */ + organizations?: string[]; +} +export type ListDockerRegistriesFromConfigResponse = DockerRegistry[]; +export type ListDockerRegistryAccountsResponse = DockerRegistryAccount[]; +export interface VolumeListItem { + /** The name of the volume */ + name: string; + driver: string; + mountpoint: string; + created?: string; + scope: VolumeScopeEnum; + /** Amount of disk space used by the volume (in bytes). This information is only available for volumes created with the `\"local\"` volume driver. For volumes created with other volume drivers, this field is set to `-1` (\"not available\") */ + size?: I64; + /** Whether the volume is currently attached to any container */ + in_use: boolean; +} +export type ListDockerVolumesResponse = VolumeListItem[]; +export type ListFullActionsResponse = Action[]; +export type ListFullAlertersResponse = Alerter[]; +export type ListFullBuildersResponse = Builder[]; +export type ListFullBuildsResponse = Build[]; +export type ListFullDeploymentsResponse = Deployment[]; +export type ListFullProceduresResponse = Procedure[]; +export type ListFullReposResponse = Repo[]; +export type ListFullResourceSyncsResponse = ResourceSync[]; +export type ListFullServerTemplatesResponse = ServerTemplate[]; +export type ListFullServersResponse = Server[]; +export type ListFullStacksResponse = Stack[]; +export type ListGitProviderAccountsResponse = GitProviderAccount[]; +export interface GitProvider { + /** The git provider domain. Default: `github.com`. */ + domain: string; + /** Whether to use https. Default: true. */ + https: boolean; + /** The account username. Required. */ + accounts: ProviderAccount[]; +} +export type ListGitProvidersFromConfigResponse = GitProvider[]; +export type UserTarget = +/** User Id */ +{ + type: "User"; + id: string; +} +/** UserGroup Id */ + | { + type: "UserGroup"; + id: string; +}; +/** Representation of a User or UserGroups permission on a resource. */ +export interface Permission { + /** The id of the permission document */ + _id?: MongoId; + /** The target User / UserGroup */ + user_target: UserTarget; + /** The target resource */ + resource_target: ResourceTarget; + /** The permission level */ + level?: PermissionLevel; +} +export type ListPermissionsResponse = Permission[]; +export declare enum ProcedureState { + /** Last run successful */ + Ok = "Ok", + /** Last run failed */ + Failed = "Failed", + /** Currently running */ + Running = "Running", + /** Other case (never run) */ + Unknown = "Unknown" +} +export interface ProcedureListItemInfo { + /** Number of stages procedure has. */ + stages: I64; + /** Reflect whether last run successful / currently running. */ + state: ProcedureState; +} +export type ProcedureListItem = ResourceListItem; +export type ListProceduresResponse = ProcedureListItem[]; +export declare enum RepoState { + /** Unknown case */ + Unknown = "Unknown", + /** Last clone / pull successful (or never cloned) */ + Ok = "Ok", + /** Last clone / pull failed */ + Failed = "Failed", + /** Currently cloning */ + Cloning = "Cloning", + /** Currently pulling */ + Pulling = "Pulling", + /** Currently building */ + Building = "Building" +} +export interface RepoListItemInfo { + /** The server that repo sits on. */ + server_id: string; + /** The builder that builds the repo. */ + builder_id: string; + /** Repo last cloned / pulled timestamp in ms. */ + last_pulled_at: I64; + /** Repo last built timestamp in ms. */ + last_built_at: I64; + /** The git provider domain */ + git_provider: string; + /** The configured repo */ + repo: string; + /** The configured branch */ + branch: string; + /** The repo state */ + state: RepoState; + /** If the repo is cloned, will be the cloned short commit hash. */ + cloned_hash?: string; + /** If the repo is cloned, will be the cloned commit message. */ + cloned_message?: string; + /** If the repo is built, will be the latest built short commit hash. */ + built_hash?: string; + /** Will be the latest remote short commit hash. */ + latest_hash?: string; +} +export type RepoListItem = ResourceListItem; +export type ListReposResponse = RepoListItem[]; +export declare enum ResourceSyncState { + /** Last sync successful (or never synced). No Changes pending */ + Ok = "Ok", + /** Last sync failed */ + Failed = "Failed", + /** Currently syncing */ + Syncing = "Syncing", + /** Updates pending */ + Pending = "Pending", + /** Other case */ + Unknown = "Unknown" +} +export interface ResourceSyncListItemInfo { + /** Unix timestamp of last sync, or 0 */ + last_sync_ts: I64; + /** Whether sync is `files_on_host` mode. */ + files_on_host: boolean; + /** Whether sync has file contents defined. */ + file_contents: boolean; + /** Whether sync has `managed` mode enabled. */ + managed: boolean; + /** Resource paths to the files. */ + resource_path: string[]; + /** The git provider domain. */ + git_provider: string; + /** The Github repo used as the source of the sync resources */ + repo: string; + /** The branch of the repo */ + branch: string; + /** Short commit hash of last sync, or empty string */ + last_sync_hash?: string; + /** Commit message of last sync, or empty string */ + last_sync_message?: string; + /** State of the sync. Reflects whether most recent sync successful. */ + state: ResourceSyncState; +} +export type ResourceSyncListItem = ResourceListItem; +export type ListResourceSyncsResponse = ResourceSyncListItem[]; +export type ListSecretsResponse = string[]; +export interface ServerTemplateListItemInfo { + /** The cloud provider */ + provider: string; + /** The instance type, eg c5.2xlarge on for Aws templates */ + instance_type?: string; +} +export type ServerTemplateListItem = ResourceListItem; +export type ListServerTemplatesResponse = ServerTemplateListItem[]; +export declare enum ServerState { + /** Server is unreachable. */ + NotOk = "NotOk", + /** Server health check passing. */ + Ok = "Ok", + /** Server is disabled. */ + Disabled = "Disabled" +} +export interface ServerListItemInfo { + /** The server's state. */ + state: ServerState; + /** Region of the server. */ + region: string; + /** Whether server is configured to send unreachable alerts. */ + send_unreachable_alerts: boolean; + /** Whether server is configured to send cpu alerts. */ + send_cpu_alerts: boolean; + /** Whether server is configured to send mem alerts. */ + send_mem_alerts: boolean; + /** Whether server is configured to send disk alerts. */ + send_disk_alerts: boolean; +} +export type ServerListItem = ResourceListItem; +export type ListServersResponse = ServerListItem[]; +export interface StackService { + /** The service name */ + service: string; + /** The container */ + container?: ContainerListItem; +} +export type ListStackServicesResponse = StackService[]; +export declare enum StackState { + /** All containers are running. */ + Running = "running", + /** All containers are paused */ + Paused = "paused", + /** All contianers are stopped */ + Stopped = "stopped", + /** All containers are created */ + Created = "created", + /** All containers are restarting */ + Restarting = "restarting", + /** All containers are dead */ + Dead = "dead", + /** All containers are removing */ + Removing = "removing", + /** The containers are in a mix of states */ + Unhealthy = "unhealthy", + /** The stack is not deployed */ + Down = "down", + /** Server not reachable */ + Unknown = "unknown" +} +export interface StackListItemInfo { + /** The server that stack is deployed on. */ + server_id: string; + /** Whether stack is using files on host mode */ + files_on_host: boolean; + /** Whether stack has file contents defined. */ + file_contents: boolean; + /** The git provider domain */ + git_provider: string; + /** The configured repo */ + repo: string; + /** The configured branch */ + branch: string; + /** The stack state */ + state: StackState; + /** A string given by docker conveying the status of the stack. */ + status?: string; + /** + * The service names that are part of the stack. + * If deployed, will be `deployed_services`. + * Otherwise, its `latest_services` + */ + services: string[]; + /** + * Whether the compose project is missing on the host. + * Ie, it does not show up in `docker compose ls`. + * If true, and the stack is not Down, this is an unhealthy state. + */ + project_missing: boolean; + /** + * If any compose files are missing in the repo, the path will be here. + * If there are paths here, this is an unhealthy state, and deploying will fail. + */ + missing_files: string[]; + /** Deployed short commit hash, or null. Only for repo based stacks. */ + deployed_hash?: string; + /** Latest short commit hash, or null. Only for repo based stacks */ + latest_hash?: string; +} +export type StackListItem = ResourceListItem; +export type ListStacksResponse = StackListItem[]; +/** Information about a process on the system. */ +export interface SystemProcess { + /** The process PID */ + pid: number; + /** The process name */ + name: string; + /** The path to the process executable */ + exe?: string; + /** The command used to start the process */ + cmd: string[]; + /** The time the process was started */ + start_time?: number; + /** + * The cpu usage percentage of the process. + * This is in core-percentage, eg 100% is 1 full core, and + * an 8 core machine would max at 800%. + */ + cpu_perc: number; + /** The memory usage of the process in MB */ + mem_mb: number; + /** Process disk read in KB/s */ + disk_read_kb: number; + /** Process disk write in KB/s */ + disk_write_kb: number; +} +export type ListSystemProcessesResponse = SystemProcess[]; +export type ListTagsResponse = Tag[]; +export type ListUserGroupsResponse = UserGroup[]; +export type ListUserTargetPermissionsResponse = Permission[]; +export type ListUsersResponse = User[]; +export type ListVariablesResponse = Variable[]; +/** The response for [LoginLocalUser] */ +export type LoginLocalUserResponse = JwtResponse; +export type MongoDocument = any; +export interface ProcedureQuerySpecifics { +} +export type ProcedureQuery = ResourceQuery; +export type PushRecentlyViewedResponse = NoData; +export interface RepoQuerySpecifics { + /** Filter repos by their repo. */ + repos: string[]; +} +export type RepoQuery = ResourceQuery; +export interface ResourceSyncQuerySpecifics { + /** Filter syncs by their repo. */ + repos: string[]; +} +export type ResourceSyncQuery = ResourceQuery; +export type SearchContainerLogResponse = Log; +export type SearchDeploymentLogResponse = Log; +export type SearchStackServiceLogResponse = Log; +export interface ServerQuerySpecifics { +} +/** Server-specific query */ +export type ServerQuery = ResourceQuery; +export interface ServerTemplateQuerySpecifics { + types: ServerTemplateConfig["type"][]; +} +export type ServerTemplateQuery = ResourceQuery; +export type SetLastSeenUpdateResponse = NoData; +export interface StackQuerySpecifics { + /** Filter syncs by their repo. */ + repos: string[]; +} +export type StackQuery = ResourceQuery; +export type UpdateDescriptionResponse = NoData; +export type UpdateDockerRegistryAccountResponse = DockerRegistryAccount; +export type UpdateGitProviderAccountResponse = GitProviderAccount; +export type UpdatePermissionOnResourceTypeResponse = NoData; +export type UpdatePermissionOnTargetResponse = NoData; +export type UpdateProcedureResponse = Procedure; +export type UpdateServiceUserDescriptionResponse = User; +export type UpdateTagsOnResourceResponse = NoData; +export type UpdateUserAdminResponse = NoData; +export type UpdateUserBasePermissionsResponse = NoData; +export type UpdateUserPasswordResponse = NoData; +export type UpdateUserUsernameResponse = NoData; +export type UpdateVariableDescriptionResponse = Variable; +export type UpdateVariableIsSecretResponse = Variable; +export type UpdateVariableValueResponse = Variable; +export type _PartialActionConfig = Partial; +export type _PartialAlerterConfig = Partial; +export type _PartialAwsBuilderConfig = Partial; +export type _PartialAwsServerTemplateConfig = Partial; +export type _PartialBuildConfig = Partial; +export type _PartialBuilderConfig = Partial; +export type _PartialDeploymentConfig = Partial; +export type _PartialDockerRegistryAccount = Partial; +export type _PartialGitProviderAccount = Partial; +export type _PartialHetznerServerTemplateConfig = Partial; +export type _PartialProcedureConfig = Partial; +export type _PartialRepoConfig = Partial; +export type _PartialResourceSyncConfig = Partial; +export type _PartialServerBuilderConfig = Partial; +export type _PartialServerConfig = Partial; +export type _PartialStackConfig = Partial; +export type _PartialTag = Partial; +export interface __Serror { + error: string; + trace: string[]; +} +export type _Serror = __Serror; +/** **Admin only.** Add a user to a user group. Response: [UserGroup] */ +export interface AddUserToUserGroup { + /** The name or id of UserGroup that user should be added to. */ + user_group: string; + /** The id or username of the user to add */ + user: string; +} +/** Configuration for an AWS builder. */ +export interface AwsBuilderConfig { + /** The AWS region to create the instance in */ + region: string; + /** The instance type to create for the build */ + instance_type: string; + /** The size of the builder volume in gb */ + volume_gb: number; + /** + * The port periphery will be running on. + * Default: `8120` + */ + port: number; + use_https: boolean; + /** + * The EC2 ami id to create. + * The ami should have the periphery client configured to start on startup, + * and should have the necessary github / dockerhub accounts configured. + */ + ami_id?: string; + /** The subnet id to create the instance in. */ + subnet_id?: string; + /** The key pair name to attach to the instance */ + key_pair_name?: string; + /** + * Whether to assign the instance a public IP address. + * Likely needed for the instance to be able to reach the open internet. + */ + assign_public_ip?: boolean; + /** + * Whether core should use the public IP address to communicate with periphery on the builder. + * If false, core will communicate with the instance using the private IP. + */ + use_public_ip?: boolean; + /** + * The security group ids to attach to the instance. + * This should include a security group to allow core inbound access to the periphery port. + */ + security_group_ids?: string[]; + /** The user data to deploy the instance with. */ + user_data?: string; + /** Which git providers are available on the AMI */ + git_providers?: GitProvider[]; + /** Which docker registries are available on the AMI. */ + docker_registries?: DockerRegistry[]; + /** Which secrets are available on the AMI. */ + secrets?: string[]; +} +export declare enum AwsVolumeType { + Gp2 = "gp2", + Gp3 = "gp3", + Io1 = "io1", + Io2 = "io2" +} +/** + * For information on AWS volumes, see + * ``. + */ +export interface AwsVolume { + /** The device name (for example, `/dev/sda1` or `xvdh`). */ + device_name: string; + /** The size of the volume in GB */ + size_gb: number; + /** The type of volume. Options: gp2, gp3, io1, io2. */ + volume_type: AwsVolumeType; + /** The iops of the volume, or 0 for AWS default. */ + iops: number; + /** The throughput of the volume, or 0 for AWS default. */ + throughput: number; +} +/** Aws EC2 instance config. */ +export interface AwsServerTemplateConfig { + /** The aws region to launch the server in, eg. us-east-1 */ + region: string; + /** The instance type to launch, eg. c5.2xlarge */ + instance_type: string; + /** Specify the ami id to use. Must be set up to start the periphery binary on startup. */ + ami_id: string; + /** The subnet to assign to the instance. */ + subnet_id: string; + /** The key pair name to give to the instance in case SSH access required. */ + key_pair_name: string; + /** + * Assign a public ip to the instance. Depending on how your network is + * setup, this may be required for the instance to reach the public internet. + */ + assign_public_ip: boolean; + /** + * Use the instances public ip as the address for the server. + * Could be used when build instances are created in another non-interconnected network to the core api. + */ + use_public_ip: boolean; + /** + * The port periphery will be running on in AMI. + * Default: `8120` + */ + port: number; + /** Whether Periphery will be running on https */ + use_https: boolean; + /** The security groups to give to the instance. */ + security_group_ids?: string[]; + /** Specify the EBS volumes to attach. */ + volumes: AwsVolume[]; + /** The user data to deploy the instance with. */ + user_data: string; +} +/** + * Builds the target repo, using the attached builder. Response: [Update]. + * + * Note. Repo must have builder attached at `builder_id`. + * + * 1. Spawns the target builder instance (For AWS type. For Server type, just use CloneRepo). + * 2. Clones the repo on the builder using `git clone https://{$token?}@github.com/${repo} -b ${branch}`. + * The token will only be used if a github account is specified, + * and must be declared in the periphery configuration on the builder instance. + * 3. If `on_clone` and `on_pull` are specified, they will be executed. + * `on_clone` will be executed before `on_pull`. + */ +export interface BuildRepo { + /** Id or name */ + repo: string; +} +/** Item in [GetBuildMonthlyStatsResponse] */ +export interface BuildStatsDay { + time: number; + count: number; + ts: number; +} +/** + * Cancels the target build. + * Only does anything if the build is `building` when called. + * Response: [Update] + */ +export interface CancelBuild { + /** Can be id or name */ + build: string; +} +/** + * Cancels the target repo build. + * Only does anything if the repo build is `building` when called. + * Response: [Update] + */ +export interface CancelRepoBuild { + /** Can be id or name */ + repo: string; +} +export interface CloneArgs { + /** Resource name (eg Build name, Repo name) */ + name: string; + /** Git provider domain. Default: `github.com` */ + provider: string; + /** Use https (vs http). */ + https: boolean; + /** Full repo identifier. / */ + repo?: string; + /** Git Branch. Default: `main` */ + branch: string; + /** Specific commit hash. Optional */ + commit?: string; + /** The clone destination path */ + destination?: string; + /** Command to run after the repo has been cloned */ + on_clone?: SystemCommand; + /** Command to run after the repo has been pulled */ + on_pull?: SystemCommand; + /** Configure the account used to access repo (if private) */ + account?: string; +} +/** + * Clones the target repo. Response: [Update]. + * + * Note. Repo must have server attached at `server_id`. + * + * 1. Clones the repo on the target server using `git clone https://{$token?}@github.com/${repo} -b ${branch}`. + * The token will only be used if a github account is specified, + * and must be declared in the periphery configuration on the target server. + * 2. If `on_clone` and `on_pull` are specified, they will be executed. + * `on_clone` will be executed before `on_pull`. + */ +export interface CloneRepo { + /** Id or name */ + repo: string; +} +/** + * Exports matching resources, and writes to the target sync's resource file. Response: [Update] + * + * Note. Will fail if the Sync is not `managed`. + */ +export interface CommitSync { + /** Id or name */ + sync: string; +} +export interface ComposeService { + image?: string; + container_name?: string; +} +/** Keeping this minimal for now as its only needed to parse the service names / container names */ +export interface ComposeFile { + /** If not provided, will default to the parent folder holding the compose file. */ + name?: string; + services?: Record; +} +export interface Conversion { + /** reference on the server. */ + local: string; + /** reference in the container. */ + container: string; +} +/** + * Creates a new action with given `name` and the configuration + * of the action at the given `id`. Response: [Action]. + */ +export interface CopyAction { + /** The name of the new action. */ + name: string; + /** The id of the action to copy. */ + id: string; +} +/** + * Creates a new alerter with given `name` and the configuration + * of the alerter at the given `id`. Response: [Alerter]. + */ +export interface CopyAlerter { + /** The name of the new alerter. */ + name: string; + /** The id of the alerter to copy. */ + id: string; +} +/** + * Creates a new build with given `name` and the configuration + * of the build at the given `id`. Response: [Build]. + */ +export interface CopyBuild { + /** The name of the new build. */ + name: string; + /** The id of the build to copy. */ + id: string; +} +/** + * Creates a new builder with given `name` and the configuration + * of the builder at the given `id`. Response: [Builder] + */ +export interface CopyBuilder { + /** The name of the new builder. */ + name: string; + /** The id of the builder to copy. */ + id: string; +} +/** + * Creates a new deployment with given `name` and the configuration + * of the deployment at the given `id`. Response: [Deployment] + */ +export interface CopyDeployment { + /** The name of the new deployment. */ + name: string; + /** The id of the deployment to copy. */ + id: string; +} +/** + * Creates a new procedure with given `name` and the configuration + * of the procedure at the given `id`. Response: [Procedure]. + */ +export interface CopyProcedure { + /** The name of the new procedure. */ + name: string; + /** The id of the procedure to copy. */ + id: string; +} +/** + * Creates a new repo with given `name` and the configuration + * of the repo at the given `id`. Response: [Repo]. + */ +export interface CopyRepo { + /** The name of the new repo. */ + name: string; + /** The id of the repo to copy. */ + id: string; +} +/** + * Creates a new sync with given `name` and the configuration + * of the sync at the given `id`. Response: [ResourceSync]. + */ +export interface CopyResourceSync { + /** The name of the new sync. */ + name: string; + /** The id of the sync to copy. */ + id: string; +} +/** + * Creates a new server template with given `name` and the configuration + * of the server template at the given `id`. Response: [ServerTemplate] + */ +export interface CopyServerTemplate { + /** The name of the new server template. */ + name: string; + /** The id of the server template to copy. */ + id: string; +} +/** + * Creates a new stack with given `name` and the configuration + * of the stack at the given `id`. Response: [Stack]. + */ +export interface CopyStack { + /** The name of the new stack. */ + name: string; + /** The id of the stack to copy. */ + id: string; +} +/** Create a action. Response: [Action]. */ +export interface CreateAction { + /** The name given to newly created action. */ + name: string; + /** Optional partial config to initialize the action with. */ + config: _PartialActionConfig; +} +/** + * Create a webhook on the github action attached to the Action resource. + * passed in request. Response: [CreateActionWebhookResponse] + */ +export interface CreateActionWebhook { + /** Id or name */ + action: string; +} +/** Create an alerter. Response: [Alerter]. */ +export interface CreateAlerter { + /** The name given to newly created alerter. */ + name: string; + /** Optional partial config to initialize the alerter with. */ + config: _PartialAlerterConfig; +} +/** + * Create an api key for the calling user. + * Response: [CreateApiKeyResponse]. + * + * Note. After the response is served, there will be no way + * to get the secret later. + */ +export interface CreateApiKey { + /** The name for the api key. */ + name: string; + /** + * A unix timestamp in millseconds specifying api key expire time. + * Default is 0, which means no expiry. + */ + expires?: I64; +} +/** + * Admin only method to create an api key for a service user. + * Response: [CreateApiKeyResponse]. + */ +export interface CreateApiKeyForServiceUser { + /** Must be service user */ + user_id: string; + /** The name for the api key */ + name: string; + /** + * A unix timestamp in millseconds specifying api key expire time. + * Default is 0, which means no expiry. + */ + expires?: I64; +} +/** Create a build. Response: [Build]. */ +export interface CreateBuild { + /** The name given to newly created build. */ + name: string; + /** Optional partial config to initialize the build with. */ + config: _PartialBuildConfig; +} +/** + * Create a webhook on the github repo attached to the build + * passed in request. Response: [CreateBuildWebhookResponse] + */ +export interface CreateBuildWebhook { + /** Id or name */ + build: string; +} +/** Partial representation of [BuilderConfig] */ +export type PartialBuilderConfig = { + type: "Server"; + params: _PartialServerBuilderConfig; +} | { + type: "Aws"; + params: _PartialAwsBuilderConfig; +}; +/** Create a builder. Response: [Builder]. */ +export interface CreateBuilder { + /** The name given to newly created builder. */ + name: string; + /** Optional partial config to initialize the builder with. */ + config: PartialBuilderConfig; +} +/** Create a deployment. Response: [Deployment]. */ +export interface CreateDeployment { + /** The name given to newly created deployment. */ + name: string; + /** Optional partial config to initialize the deployment with. */ + config: _PartialDeploymentConfig; +} +/** + * **Admin only.** Create a docker registry account. + * Response: [DockerRegistryAccount]. + */ +export interface CreateDockerRegistryAccount { + account: _PartialDockerRegistryAccount; +} +/** + * **Admin only.** Create a git provider account. + * Response: [GitProviderAccount]. + */ +export interface CreateGitProviderAccount { + /** + * The initial account config. Anything in the _id field will be ignored, + * as this is generated on creation. + */ + account: _PartialGitProviderAccount; +} +/** + * Create a new local user account. Will fail if a user with the + * given username already exists. + * Response: [CreateLocalUserResponse]. + * + * Note. This method is only available if the core api has `local_auth` enabled. + */ +export interface CreateLocalUser { + /** The username for the new user. */ + username: string; + /** + * The password for the new user. + * This cannot be retreived later. + */ + password: string; +} +/** + * Create a docker network on the server. + * Respone: [Update] + */ +export interface CreateNetwork { + /** Id or name */ + server: string; + /** The name of the network to create. */ + name: string; +} +/** Create a procedure. Response: [Procedure]. */ +export interface CreateProcedure { + /** The name given to newly created build. */ + name: string; + /** Optional partial config to initialize the procedure with. */ + config: _PartialProcedureConfig; +} +/** Create a repo. Response: [Repo]. */ +export interface CreateRepo { + /** The name given to newly created repo. */ + name: string; + /** Optional partial config to initialize the repo with. */ + config: _PartialRepoConfig; +} +export declare enum RepoWebhookAction { + Clone = "Clone", + Pull = "Pull", + Build = "Build" +} +/** + * Create a webhook on the github repo attached to the (Komodo) Repo resource. + * passed in request. Response: [CreateRepoWebhookResponse] + */ +export interface CreateRepoWebhook { + /** Id or name */ + repo: string; + /** "Clone" or "Pull" or "Build" */ + action: RepoWebhookAction; +} +/** Create a sync. Response: [ResourceSync]. */ +export interface CreateResourceSync { + /** The name given to newly created sync. */ + name: string; + /** Optional partial config to initialize the sync with. */ + config: _PartialResourceSyncConfig; +} +/** Create a server. Response: [Server]. */ +export interface CreateServer { + /** The name given to newly created server. */ + name: string; + /** Optional partial config to initialize the server with. */ + config: _PartialServerConfig; +} +export type PartialServerTemplateConfig = { + type: "Aws"; + params: _PartialAwsServerTemplateConfig; +} | { + type: "Hetzner"; + params: _PartialHetznerServerTemplateConfig; +}; +/** Create a server template. Response: [ServerTemplate]. */ +export interface CreateServerTemplate { + /** The name given to newly created server template. */ + name: string; + /** Optional partial config to initialize the server template with. */ + config: PartialServerTemplateConfig; +} +/** + * **Admin only.** Create a service user. + * Response: [User]. + */ +export interface CreateServiceUser { + /** The username for the service user. */ + username: string; + /** A description for the service user. */ + description: string; +} +/** Create a stack. Response: [Stack]. */ +export interface CreateStack { + /** The name given to newly created stack. */ + name: string; + /** Optional partial config to initialize the stack with. */ + config: _PartialStackConfig; +} +export declare enum StackWebhookAction { + Refresh = "Refresh", + Deploy = "Deploy" +} +/** + * Create a webhook on the github repo attached to the stack + * passed in request. Response: [CreateStackWebhookResponse] + */ +export interface CreateStackWebhook { + /** Id or name */ + stack: string; + /** "Refresh" or "Deploy" */ + action: StackWebhookAction; +} +export declare enum SyncWebhookAction { + Refresh = "Refresh", + Sync = "Sync" +} +/** + * Create a webhook on the github repo attached to the sync + * passed in request. Response: [CreateSyncWebhookResponse] + */ +export interface CreateSyncWebhook { + /** Id or name */ + sync: string; + /** "Refresh" or "Sync" */ + action: SyncWebhookAction; +} +/** Create a tag. Response: [Tag]. */ +export interface CreateTag { + /** The name of the tag. */ + name: string; +} +/** **Admin only.** Create a user group. Response: [UserGroup] */ +export interface CreateUserGroup { + /** The name to assign to the new UserGroup */ + name: string; +} +/** **Admin only.** Create variable. Response: [Variable]. */ +export interface CreateVariable { + /** The name of the variable to create. */ + name: string; + /** The initial value of the variable. defualt: "". */ + value?: string; + /** The initial value of the description. default: "". */ + description?: string; + /** Whether to make this a secret variable. */ + is_secret?: boolean; +} +/** Configuration for a Custom alerter endpoint. */ +export interface CustomAlerterEndpoint { + /** The http/s endpoint to send the POST to */ + url: string; +} +/** + * Deletes the action at the given id, and returns the deleted action. + * Response: [Action] + */ +export interface DeleteAction { + /** The id or name of the action to delete. */ + id: string; +} +/** + * Delete the webhook on the github action attached to the Action resource. + * passed in request. Response: [DeleteActionWebhookResponse] + */ +export interface DeleteActionWebhook { + /** Id or name */ + action: string; +} +/** + * Deletes the alerter at the given id, and returns the deleted alerter. + * Response: [Alerter] + */ +export interface DeleteAlerter { + /** The id or name of the alerter to delete. */ + id: string; +} +/** + * Delete an api key for the calling user. + * Response: [NoData] + */ +export interface DeleteApiKey { + /** The key which the user intends to delete. */ + key: string; +} +/** + * Admin only method to delete an api key for a service user. + * Response: [NoData]. + */ +export interface DeleteApiKeyForServiceUser { + key: string; +} +/** + * Deletes the build at the given id, and returns the deleted build. + * Response: [Build] + */ +export interface DeleteBuild { + /** The id or name of the build to delete. */ + id: string; +} +/** + * Delete a webhook on the github repo attached to the build + * passed in request. Response: [CreateBuildWebhookResponse] + */ +export interface DeleteBuildWebhook { + /** Id or name */ + build: string; +} +/** + * Deletes the builder at the given id, and returns the deleted builder. + * Response: [Builder] + */ +export interface DeleteBuilder { + /** The id or name of the builder to delete. */ + id: string; +} +/** + * Deletes the deployment at the given id, and returns the deleted deployment. + * Response: [Deployment]. + * + * Note. If the associated container is running, it will be deleted as part of + * the deployment clean up. + */ +export interface DeleteDeployment { + /** The id or name of the deployment to delete. */ + id: string; +} +/** + * **Admin only.** Delete a docker registry account. + * Response: [DockerRegistryAccount]. + */ +export interface DeleteDockerRegistryAccount { + /** The id of the docker registry account to delete */ + id: string; +} +/** + * **Admin only.** Delete a git provider account. + * Response: [User]. + */ +export interface DeleteGitProviderAccount { + /** The id of the git provider to delete */ + id: string; +} +/** + * Delete a docker image. + * Response: [Update] + */ +export interface DeleteImage { + /** Id or name. */ + server: string; + /** The name of the image to delete. */ + name: string; +} +/** + * Delete a docker network. + * Response: [Update] + */ +export interface DeleteNetwork { + /** Id or name. */ + server: string; + /** The name of the network to delete. */ + name: string; +} +/** + * Deletes the procedure at the given id, and returns the deleted procedure. + * Response: [Procedure] + */ +export interface DeleteProcedure { + /** The id or name of the procedure to delete. */ + id: string; +} +/** + * Deletes the repo at the given id, and returns the deleted repo. + * Response: [Repo] + */ +export interface DeleteRepo { + /** The id or name of the repo to delete. */ + id: string; +} +/** + * Delete the webhook on the github repo attached to the (Komodo) Repo resource. + * passed in request. Response: [DeleteRepoWebhookResponse] + */ +export interface DeleteRepoWebhook { + /** Id or name */ + repo: string; + /** "Clone" or "Pull" or "Build" */ + action: RepoWebhookAction; +} +/** + * Deletes the sync at the given id, and returns the deleted sync. + * Response: [ResourceSync] + */ +export interface DeleteResourceSync { + /** The id or name of the sync to delete. */ + id: string; +} +/** + * Deletes the server at the given id, and returns the deleted server. + * Response: [Server] + */ +export interface DeleteServer { + /** The id or name of the server to delete. */ + id: string; +} +/** + * Deletes the server template at the given id, and returns the deleted server template. + * Response: [ServerTemplate] + */ +export interface DeleteServerTemplate { + /** The id or name of the server template to delete. */ + id: string; +} +/** + * Deletes the stack at the given id, and returns the deleted stack. + * Response: [Stack] + */ +export interface DeleteStack { + /** The id or name of the stack to delete. */ + id: string; +} +/** + * Delete the webhook on the github repo attached to the stack + * passed in request. Response: [DeleteStackWebhookResponse] + */ +export interface DeleteStackWebhook { + /** Id or name */ + stack: string; + /** "Refresh" or "Deploy" */ + action: StackWebhookAction; +} +/** + * Delete the webhook on the github repo attached to the sync + * passed in request. Response: [DeleteSyncWebhookResponse] + */ +export interface DeleteSyncWebhook { + /** Id or name */ + sync: string; + /** "Refresh" or "Sync" */ + action: SyncWebhookAction; +} +/** + * Delete a tag, and return the deleted tag. Response: [Tag]. + * + * Note. Will also remove this tag from all attached resources. + */ +export interface DeleteTag { + /** The id of the tag to delete. */ + id: string; +} +/** + * **Admin only**. Delete a user. + * Admins can delete any non-admin user. + * Only Super Admin can delete an admin. + * No users can delete a Super Admin user. + * User cannot delete themselves. + * Response: [NoData]. + */ +export interface DeleteUser { + /** User id or username */ + user: string; +} +/** **Admin only.** Delete a user group. Response: [UserGroup] */ +export interface DeleteUserGroup { + /** The id of the UserGroup */ + id: string; +} +/** **Admin only.** Delete a variable. Response: [Variable]. */ +export interface DeleteVariable { + name: string; +} +/** + * Delete a docker volume. + * Response: [Update] + */ +export interface DeleteVolume { + /** Id or name. */ + server: string; + /** The name of the volume to delete. */ + name: string; +} +/** + * Deploys the container for the target deployment. Response: [Update]. + * + * 1. Pulls the image onto the target server. + * 2. If the container is already running, + * it will be stopped and removed using `docker container rm ${container_name}`. + * 3. The container will be run using `docker run {...params}`, + * where params are determined by the deployment's configuration. + */ +export interface Deploy { + /** Name or id */ + deployment: string; + /** + * Override the default termination signal specified in the deployment. + * Only used when deployment needs to be taken down before redeploy. + */ + stop_signal?: TerminationSignal; + /** + * Override the default termination max time. + * Only used when deployment needs to be taken down before redeploy. + */ + stop_time?: number; +} +/** Deploys the target stack. `docker compose up`. Response: [Update] */ +export interface DeployStack { + /** Id or name */ + stack: string; + /** + * Override the default termination max time. + * Only used if the stack needs to be taken down first. + */ + stop_time?: number; +} +/** + * Checks deployed contents vs latest contents, + * and only if any changes found + * will `docker compose up`. Response: [Update] + */ +export interface DeployStackIfChanged { + /** Id or name */ + stack: string; + /** + * Override the default termination max time. + * Only used if the stack needs to be taken down first. + */ + stop_time?: number; +} +/** + * Stops and destroys the container on the target server. + * Reponse: [Update]. + * + * 1. The container is stopped and removed using `docker container rm ${container_name}`. + */ +export interface DestroyContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; + /** Override the default termination signal. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} +/** + * Stops and destroys the container for the target deployment. + * Reponse: [Update]. + * + * 1. The container is stopped and removed using `docker container rm ${container_name}`. + */ +export interface DestroyDeployment { + /** Name or id. */ + deployment: string; + /** Override the default termination signal specified in the deployment. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} +/** Destoys the target stack. `docker compose down`. Response: [Update] */ +export interface DestroyStack { + /** Id or name */ + stack: string; + /** Pass `--remove-orphans` */ + remove_orphans?: boolean; + /** Override the default termination max time. */ + stop_time?: number; +} +/** Configuration for a Discord alerter. */ +export interface DiscordAlerterEndpoint { + /** The Discord webhook url */ + url: string; +} +export interface EnvironmentVar { + variable: string; + value: string; +} +/** + * Exchange a single use exchange token (safe for transport in url query) + * for a jwt. + * Response: [ExchangeForJwtResponse]. + */ +export interface ExchangeForJwt { + /** The 'exchange token' */ + token: string; +} +/** + * Get pretty formatted monrun sync toml for all resources + * which the user has permissions to view. + * Response: [TomlResponse]. + */ +export interface ExportAllResourcesToToml { + /** Tag name or id. Empty array will not filter by tag. */ + tags?: string[]; +} +/** + * Get pretty formatted monrun sync toml for specific resources and user groups. + * Response: [TomlResponse]. + */ +export interface ExportResourcesToToml { + /** The targets to include in the export. */ + targets?: ResourceTarget[]; + /** The user group names or ids to include in the export. */ + user_groups?: string[]; + /** Whether to include variables */ + include_variables?: boolean; +} +/** Find resources matching a common query. Response: [FindResourcesResponse]. */ +export interface FindResources { + /** The mongo query as JSON */ + query?: MongoDocument; + /** The resource variants to include in the response. */ + resources?: ResourceTarget["type"][]; +} +/** Response for [FindResources]. */ +export interface FindResourcesResponse { + /** The matching servers. */ + servers: ServerListItem[]; + /** The matching deployments. */ + deployments: DeploymentListItem[]; + /** The matching builds. */ + builds: BuildListItem[]; + /** The matching repos. */ + repos: RepoListItem[]; + /** The matching procedures. */ + procedures: ProcedureListItem[]; +} +/** + * **Admin only.** + * Find a user. + * Response: [FindUserResponse] + */ +export interface FindUser { + /** Id or username */ + user: string; +} +/** Get a specific action. Response: [Action]. */ +export interface GetAction { + /** Id or name */ + action: string; +} +/** Get current action state for the action. Response: [ActionActionState]. */ +export interface GetActionActionState { + /** Id or name */ + action: string; +} +/** + * Gets a summary of data relating to all actions. + * Response: [GetActionsSummaryResponse]. + */ +export interface GetActionsSummary { +} +/** Response for [GetActionsSummary]. */ +export interface GetActionsSummaryResponse { + /** The total number of actions. */ + total: number; + /** The number of actions with Ok state. */ + ok: number; + /** The number of actions currently running. */ + running: number; + /** The number of actions with failed state. */ + failed: number; + /** The number of actions with unknown state. */ + unknown: number; +} +/** Get an alert: Response: [Alert]. */ +export interface GetAlert { + id: string; +} +/** Get a specific alerter. Response: [Alerter]. */ +export interface GetAlerter { + /** Id or name */ + alerter: string; +} +/** + * Gets a summary of data relating to all alerters. + * Response: [GetAlertersSummaryResponse]. + */ +export interface GetAlertersSummary { +} +/** Response for [GetAlertersSummary]. */ +export interface GetAlertersSummaryResponse { + total: number; +} +/** Get a specific build. Response: [Build]. */ +export interface GetBuild { + /** Id or name */ + build: string; +} +/** Get current action state for the build. Response: [BuildActionState]. */ +export interface GetBuildActionState { + /** Id or name */ + build: string; +} +/** + * Gets summary and timeseries breakdown of the last months build count / time for charting. + * Response: [GetBuildMonthlyStatsResponse]. + * + * Note. This method is paginated. One page is 30 days of data. + * Query for older pages by incrementing the page, starting at 0. + */ +export interface GetBuildMonthlyStats { + /** + * Query for older data by incrementing the page. + * `page: 0` is the default, and will return the most recent data. + */ + page?: number; +} +/** Response for [GetBuildMonthlyStats]. */ +export interface GetBuildMonthlyStatsResponse { + total_time: number; + total_count: number; + days: BuildStatsDay[]; +} +/** Get whether a Build's target repo has a webhook for the build configured. Response: [GetBuildWebhookEnabledResponse]. */ +export interface GetBuildWebhookEnabled { + /** Id or name */ + build: string; +} +/** Response for [GetBuildWebhookEnabled] */ +export interface GetBuildWebhookEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger build. Will always be false if managed is false. */ + enabled: boolean; +} +/** Get a specific builder by id or name. Response: [Builder]. */ +export interface GetBuilder { + /** Id or name */ + builder: string; +} +/** + * Gets a summary of data relating to all builders. + * Response: [GetBuildersSummaryResponse]. + */ +export interface GetBuildersSummary { +} +/** Response for [GetBuildersSummary]. */ +export interface GetBuildersSummaryResponse { + /** The total number of builders. */ + total: number; +} +/** + * Gets a summary of data relating to all builds. + * Response: [GetBuildsSummaryResponse]. + */ +export interface GetBuildsSummary { +} +/** Response for [GetBuildsSummary]. */ +export interface GetBuildsSummaryResponse { + /** The total number of builds in Komodo. */ + total: number; + /** The number of builds with Ok state. */ + ok: number; + /** The number of builds with Failed state. */ + failed: number; + /** The number of builds currently building. */ + building: number; + /** The number of builds with unknown state. */ + unknown: number; +} +/** + * Get the container log's tail, split by stdout/stderr. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface GetContainerLog { + /** Id or name */ + server: string; + /** The container name */ + container: string; + /** + * The number of lines of the log tail to include. + * Default: 100. + * Max: 5000. + */ + tail: U64; + /** Enable `--timestamps` */ + timestamps?: boolean; +} +/** + * Get info about the core api configuration. + * Response: [GetCoreInfoResponse]. + */ +export interface GetCoreInfo { +} +/** Response for [GetCoreInfo]. */ +export interface GetCoreInfoResponse { + /** The title assigned to this core api. */ + title: string; + /** The monitoring interval of this core api. */ + monitoring_interval: Timelength; + /** The webhook base url. */ + webhook_base_url: string; + /** Whether transparent mode is enabled, which gives all users read access to all resources. */ + transparent_mode: boolean; + /** Whether UI write access should be disabled */ + ui_write_disabled: boolean; + /** Whether non admins can create resources */ + disable_non_admin_create: boolean; + /** Whether confirm dialog should be disabled */ + disable_confirm_dialog: boolean; + /** The repo owners for which github webhook management api is available */ + github_webhook_owners: string[]; +} +/** Get a specific deployment by name or id. Response: [Deployment]. */ +export interface GetDeployment { + /** Id or name */ + deployment: string; +} +/** + * Get current action state for the deployment. + * Response: [DeploymentActionState]. + */ +export interface GetDeploymentActionState { + /** Id or name */ + deployment: string; +} +/** + * Get the container, including image / status, of the target deployment. + * Response: [GetDeploymentContainerResponse]. + * + * Note. This does not hit the server directly. The status comes from an + * in memory cache on the core, which hits the server periodically + * to keep it up to date. + */ +export interface GetDeploymentContainer { + /** Id or name */ + deployment: string; +} +/** Response for [GetDeploymentContainer]. */ +export interface GetDeploymentContainerResponse { + state: DeploymentState; + container?: ContainerListItem; +} +/** + * Get the deployment log's tail, split by stdout/stderr. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface GetDeploymentLog { + /** Id or name */ + deployment: string; + /** + * The number of lines of the log tail to include. + * Default: 100. + * Max: 5000. + */ + tail: U64; + /** Enable `--timestamps` */ + timestamps?: boolean; +} +/** + * Get the deployment container's stats using `docker stats`. + * Response: [DockerContainerStats]. + * + * Note. This call will hit the underlying server directly for most up to date stats. + */ +export interface GetDeploymentStats { + /** Id or name */ + deployment: string; +} +/** + * Gets a summary of data relating to all deployments. + * Response: [GetDeploymentsSummaryResponse]. + */ +export interface GetDeploymentsSummary { +} +/** Response for [GetDeploymentsSummary]. */ +export interface GetDeploymentsSummaryResponse { + /** The total number of Deployments */ + total: I64; + /** The number of Deployments with Running state */ + running: I64; + /** The number of Deployments with Stopped or Paused state */ + stopped: I64; + /** The number of Deployments with NotDeployed state */ + not_deployed: I64; + /** The number of Deployments with Restarting or Dead or Created (other) state */ + unhealthy: I64; + /** The number of Deployments with Unknown state */ + unknown: I64; +} +/** + * Get a specific docker registry account. + * Response: [GetDockerRegistryAccountResponse]. + */ +export interface GetDockerRegistryAccount { + id: string; +} +/** + * Get a specific git provider account. + * Response: [GetGitProviderAccountResponse]. + */ +export interface GetGitProviderAccount { + id: string; +} +/** + * Paginated endpoint serving historical (timeseries) server stats for graphing. + * Response: [GetHistoricalServerStatsResponse]. + */ +export interface GetHistoricalServerStats { + /** Id or name */ + server: string; + /** The granularity of the data. */ + granularity: Timelength; + /** + * Page of historical data. Default is 0, which is the most recent data. + * Use with the `next_page` field of the response. + */ + page?: number; +} +/** System stats stored on the database. */ +export interface SystemStatsRecord { + /** Unix timestamp in milliseconds */ + ts: I64; + /** Server id */ + sid: string; + /** Cpu usage percentage */ + cpu_perc: number; + /** Memory used in GB */ + mem_used_gb: number; + /** Total memory in GB */ + mem_total_gb: number; + /** Disk used in GB */ + disk_used_gb: number; + /** Total disk size in GB */ + disk_total_gb: number; + /** Breakdown of individual disks, ie their usages, sizes, and mount points */ + disks: SingleDiskUsage[]; +} +/** Response to [GetHistoricalServerStats]. */ +export interface GetHistoricalServerStatsResponse { + /** The timeseries page of data. */ + stats: SystemStatsRecord[]; + /** If there is a next page of data, pass this to `page` to get it. */ + next_page?: number; +} +/** + * Non authenticated route to see the available options + * users have to login to Komodo, eg. local auth, github, google. + * Response: [GetLoginOptionsResponse]. + */ +export interface GetLoginOptions { +} +/** The response for [GetLoginOptions]. */ +export interface GetLoginOptionsResponse { + /** Whether local auth is enabled. */ + local: boolean; + /** Whether github login is enabled. */ + github: boolean; + /** Whether google login is enabled. */ + google: boolean; + /** Whether OIDC login is enabled. */ + oidc: boolean; + /** Whether user registration (Sign Up) has been disabled */ + registration_disabled: boolean; +} +/** + * Get the version of the Komodo Periphery agent on the target server. + * Response: [GetPeripheryVersionResponse]. + */ +export interface GetPeripheryVersion { + /** Id or name */ + server: string; +} +/** Response for [GetPeripheryVersion]. */ +export interface GetPeripheryVersionResponse { + /** The version of periphery. */ + version: string; +} +/** + * Gets the calling user's permission level on a specific resource. + * Factors in any UserGroup's permissions they may be a part of. + * Response: [PermissionLevel] + */ +export interface GetPermissionLevel { + /** The target to get user permission on. */ + target: ResourceTarget; +} +/** Get a specific procedure. Response: [Procedure]. */ +export interface GetProcedure { + /** Id or name */ + procedure: string; +} +/** Get current action state for the procedure. Response: [ProcedureActionState]. */ +export interface GetProcedureActionState { + /** Id or name */ + procedure: string; +} +/** + * Gets a summary of data relating to all procedures. + * Response: [GetProceduresSummaryResponse]. + */ +export interface GetProceduresSummary { +} +/** Response for [GetProceduresSummary]. */ +export interface GetProceduresSummaryResponse { + /** The total number of procedures. */ + total: number; + /** The number of procedures with Ok state. */ + ok: number; + /** The number of procedures currently running. */ + running: number; + /** The number of procedures with failed state. */ + failed: number; + /** The number of procedures with unknown state. */ + unknown: number; +} +/** Get a specific repo. Response: [Repo]. */ +export interface GetRepo { + /** Id or name */ + repo: string; +} +/** Get current action state for the repo. Response: [RepoActionState]. */ +export interface GetRepoActionState { + /** Id or name */ + repo: string; +} +/** Get a target Repo's configured webhooks. Response: [GetRepoWebhooksEnabledResponse]. */ +export interface GetRepoWebhooksEnabled { + /** Id or name */ + repo: string; +} +/** Response for [GetRepoWebhooksEnabled] */ +export interface GetRepoWebhooksEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger clone. Will always be false if managed is false. */ + clone_enabled: boolean; + /** Whether pushes to branch trigger pull. Will always be false if managed is false. */ + pull_enabled: boolean; + /** Whether pushes to branch trigger build. Will always be false if managed is false. */ + build_enabled: boolean; +} +/** + * Gets a summary of data relating to all repos. + * Response: [GetReposSummaryResponse]. + */ +export interface GetReposSummary { +} +/** Response for [GetReposSummary] */ +export interface GetReposSummaryResponse { + /** The total number of repos */ + total: number; + /** The number of repos with Ok state. */ + ok: number; + /** The number of repos currently cloning. */ + cloning: number; + /** The number of repos currently pulling. */ + pulling: number; + /** The number of repos currently building. */ + building: number; + /** The number of repos with failed state. */ + failed: number; + /** The number of repos with unknown state. */ + unknown: number; +} +/** Inspect a docker container on the server. Response: [Container]. */ +export interface GetResourceMatchingContainer { + /** Id or name */ + server: string; + /** The container name */ + container: string; +} +export interface GetResourceMatchingContainerResponse { + resource?: ResourceTarget; +} +/** Get a specific sync. Response: [ResourceSync]. */ +export interface GetResourceSync { + /** Id or name */ + sync: string; +} +/** Get current action state for the sync. Response: [ResourceSyncActionState]. */ +export interface GetResourceSyncActionState { + /** Id or name */ + sync: string; +} +/** + * Gets a summary of data relating to all syncs. + * Response: [GetResourceSyncsSummaryResponse]. + */ +export interface GetResourceSyncsSummary { +} +/** Response for [GetResourceSyncsSummary] */ +export interface GetResourceSyncsSummaryResponse { + /** The total number of syncs */ + total: number; + /** The number of syncs with Ok state. */ + ok: number; + /** The number of syncs currently syncing. */ + syncing: number; + /** The number of syncs with pending updates */ + pending: number; + /** The number of syncs with failed state. */ + failed: number; + /** The number of syncs with unknown state. */ + unknown: number; +} +/** Get a specific server. Response: [Server]. */ +export interface GetServer { + /** Id or name */ + server: string; +} +/** Get current action state for the servers. Response: [ServerActionState]. */ +export interface GetServerActionState { + /** Id or name */ + server: string; +} +/** Get the state of the target server. Response: [GetServerStateResponse]. */ +export interface GetServerState { + /** Id or name */ + server: string; +} +/** The response for [GetServerState]. */ +export interface GetServerStateResponse { + /** The server status. */ + status: ServerState; +} +/** Get a specific server template by id or name. Response: [ServerTemplate]. */ +export interface GetServerTemplate { + /** Id or name */ + server_template: string; +} +/** + * Gets a summary of data relating to all server templates. + * Response: [GetServerTemplatesSummaryResponse]. + */ +export interface GetServerTemplatesSummary { +} +/** Response for [GetServerTemplatesSummary]. */ +export interface GetServerTemplatesSummaryResponse { + /** The total number of server templates. */ + total: number; +} +/** + * Gets a summary of data relating to all servers. + * Response: [GetServersSummaryResponse]. + */ +export interface GetServersSummary { +} +/** Response for [GetServersSummary]. */ +export interface GetServersSummaryResponse { + /** The total number of servers. */ + total: I64; + /** The number of healthy (`status: OK`) servers. */ + healthy: I64; + /** The number of unhealthy servers. */ + unhealthy: I64; + /** The number of disabled servers. */ + disabled: I64; +} +/** Get a specific stack. Response: [Stack]. */ +export interface GetStack { + /** Id or name */ + stack: string; +} +/** Get current action state for the stack. Response: [StackActionState]. */ +export interface GetStackActionState { + /** Id or name */ + stack: string; +} +/** Get a stack service's log. Response: [GetStackContainersResponse]. */ +export interface GetStackServiceLog { + /** Id or name */ + stack: string; + /** The service to get the log for. */ + service: string; + /** + * The number of lines of the log tail to include. + * Default: 100. + * Max: 5000. + */ + tail: U64; + /** Enable `--timestamps` */ + timestamps?: boolean; +} +/** Get a target stack's configured webhooks. Response: [GetStackWebhooksEnabledResponse]. */ +export interface GetStackWebhooksEnabled { + /** Id or name */ + stack: string; +} +/** Response for [GetStackWebhooksEnabled] */ +export interface GetStackWebhooksEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger refresh. Will always be false if managed is false. */ + refresh_enabled: boolean; + /** Whether pushes to branch trigger stack execution. Will always be false if managed is false. */ + deploy_enabled: boolean; +} +/** + * Gets a summary of data relating to all syncs. + * Response: [GetStacksSummaryResponse]. + */ +export interface GetStacksSummary { +} +/** Response for [GetStacksSummary] */ +export interface GetStacksSummaryResponse { + /** The total number of stacks */ + total: number; + /** The number of stacks with Running state. */ + running: number; + /** The number of stacks with Stopped or Paused state. */ + stopped: number; + /** The number of stacks with Down state. */ + down: number; + /** The number of stacks with Unhealthy or Restarting or Dead or Created or Removing state. */ + unhealthy: number; + /** The number of stacks with Unknown state. */ + unknown: number; +} +/** Get a target Sync's configured webhooks. Response: [GetSyncWebhooksEnabledResponse]. */ +export interface GetSyncWebhooksEnabled { + /** Id or name */ + sync: string; +} +/** Response for [GetSyncWebhooksEnabled] */ +export interface GetSyncWebhooksEnabledResponse { + /** + * Whether the repo webhooks can even be managed. + * The repo owner must be in `github_webhook_app.owners` list to be managed. + */ + managed: boolean; + /** Whether pushes to branch trigger refresh. Will always be false if managed is false. */ + refresh_enabled: boolean; + /** Whether pushes to branch trigger sync execution. Will always be false if managed is false. */ + sync_enabled: boolean; +} +/** + * Get the system information of the target server. + * Response: [SystemInformation]. + */ +export interface GetSystemInformation { + /** Id or name */ + server: string; +} +/** + * Get the system stats on the target server. Response: [SystemStats]. + * + * Note. This does not hit the server directly. The stats come from an + * in memory cache on the core, which hits the server periodically + * to keep it up to date. + */ +export interface GetSystemStats { + /** Id or name */ + server: string; +} +/** Get data for a specific tag. Response [Tag]. */ +export interface GetTag { + /** Id or name */ + tag: string; +} +/** + * Get all data for the target update. + * Response: [Update]. + */ +export interface GetUpdate { + /** The update id. */ + id: string; +} +/** + * Get the user extracted from the request headers. + * Response: [User]. + */ +export interface GetUser { +} +/** + * Get a specific user group by name or id. + * Response: [UserGroup]. + */ +export interface GetUserGroup { + /** Name or Id */ + user_group: string; +} +/** + * Gets the username of a specific user. + * Response: [GetUsernameResponse] + */ +export interface GetUsername { + /** The id of the user. */ + user_id: string; +} +/** Response for [GetUsername]. */ +export interface GetUsernameResponse { + /** The username of the user. */ + username: string; + /** An optional icon for the user. */ + avatar?: string; +} +/** + * List all available global variables. + * Response: [Variable] + * + * Note. For non admin users making this call, + * secret variables will have their values obscured. + */ +export interface GetVariable { + /** The name of the variable to get. */ + name: string; +} +/** + * Get the version of the Komodo Core api. + * Response: [GetVersionResponse]. + */ +export interface GetVersion { +} +/** Response for [GetVersion]. */ +export interface GetVersionResponse { + /** The version of the core api. */ + version: string; +} +export declare enum HetznerDatacenter { + Nuremberg1Dc3 = "Nuremberg1Dc3", + Helsinki1Dc2 = "Helsinki1Dc2", + Falkenstein1Dc14 = "Falkenstein1Dc14", + AshburnDc1 = "AshburnDc1", + HillsboroDc1 = "HillsboroDc1", + SingaporeDc1 = "SingaporeDc1" +} +export declare enum HetznerServerType { + /** CPX11 - AMD 2 Cores, 2 Gb Ram, 40 Gb disk */ + SharedAmd2Core2Ram40Disk = "SharedAmd2Core2Ram40Disk", + /** CAX11 - Arm 2 Cores, 4 Gb Ram, 40 Gb disk */ + SharedArm2Core4Ram40Disk = "SharedArm2Core4Ram40Disk", + /** CX22 - Intel 2 Cores, 4 Gb Ram, 40 Gb disk */ + SharedIntel2Core4Ram40Disk = "SharedIntel2Core4Ram40Disk", + /** CPX21 - AMD 3 Cores, 4 Gb Ram, 80 Gb disk */ + SharedAmd3Core4Ram80Disk = "SharedAmd3Core4Ram80Disk", + /** CAX21 - Arm 4 Cores, 8 Gb Ram, 80 Gb disk */ + SharedArm4Core8Ram80Disk = "SharedArm4Core8Ram80Disk", + /** CX32 - Intel 4 Cores, 8 Gb Ram, 80 Gb disk */ + SharedIntel4Core8Ram80Disk = "SharedIntel4Core8Ram80Disk", + /** CPX31 - AMD 4 Cores, 8 Gb Ram, 160 Gb disk */ + SharedAmd4Core8Ram160Disk = "SharedAmd4Core8Ram160Disk", + /** CAX31 - Arm 8 Cores, 16 Gb Ram, 160 Gb disk */ + SharedArm8Core16Ram160Disk = "SharedArm8Core16Ram160Disk", + /** CX42 - Intel 8 Cores, 16 Gb Ram, 160 Gb disk */ + SharedIntel8Core16Ram160Disk = "SharedIntel8Core16Ram160Disk", + /** CPX41 - AMD 8 Cores, 16 Gb Ram, 240 Gb disk */ + SharedAmd8Core16Ram240Disk = "SharedAmd8Core16Ram240Disk", + /** CAX41 - Arm 16 Cores, 32 Gb Ram, 320 Gb disk */ + SharedArm16Core32Ram320Disk = "SharedArm16Core32Ram320Disk", + /** CX52 - Intel 16 Cores, 32 Gb Ram, 320 Gb disk */ + SharedIntel16Core32Ram320Disk = "SharedIntel16Core32Ram320Disk", + /** CPX51 - AMD 16 Cores, 32 Gb Ram, 360 Gb disk */ + SharedAmd16Core32Ram360Disk = "SharedAmd16Core32Ram360Disk", + /** CCX13 - AMD 2 Cores, 8 Gb Ram, 80 Gb disk */ + DedicatedAmd2Core8Ram80Disk = "DedicatedAmd2Core8Ram80Disk", + /** CCX23 - AMD 4 Cores, 16 Gb Ram, 160 Gb disk */ + DedicatedAmd4Core16Ram160Disk = "DedicatedAmd4Core16Ram160Disk", + /** CCX33 - AMD 8 Cores, 32 Gb Ram, 240 Gb disk */ + DedicatedAmd8Core32Ram240Disk = "DedicatedAmd8Core32Ram240Disk", + /** CCX43 - AMD 16 Cores, 64 Gb Ram, 360 Gb disk */ + DedicatedAmd16Core64Ram360Disk = "DedicatedAmd16Core64Ram360Disk", + /** CCX53 - AMD 32 Cores, 128 Gb Ram, 600 Gb disk */ + DedicatedAmd32Core128Ram600Disk = "DedicatedAmd32Core128Ram600Disk", + /** CCX63 - AMD 48 Cores, 192 Gb Ram, 960 Gb disk */ + DedicatedAmd48Core192Ram960Disk = "DedicatedAmd48Core192Ram960Disk" +} +export declare enum HetznerVolumeFormat { + Xfs = "Xfs", + Ext4 = "Ext4" +} +export interface HetznerVolumeSpecs { + /** A name for the volume */ + name: string; + /** Size of the volume in GB */ + size_gb: I64; + /** The format for the volume */ + format?: HetznerVolumeFormat; + /** Labels for the volume */ + labels?: Record; +} +/** Hetzner server config. */ +export interface HetznerServerTemplateConfig { + /** ID or name of the Image the Server is created from */ + image: string; + /** ID or name of Datacenter to create Server in */ + datacenter?: HetznerDatacenter; + /** + * ID of the Placement Group the server should be in, + * Or 0 to not use placement group. + */ + placement_group?: I64; + /** ID or name of the Server type this Server should be created with */ + server_type?: HetznerServerType; + /** SSH key IDs ( integer ) or names ( string ) which should be injected into the Server at creation time */ + ssh_keys?: string[]; + /** Network IDs which should be attached to the Server private network interface at the creation time */ + private_network_ids?: I64[]; + /** Attach an IPv4 on the public NIC. If false, no IPv4 address will be attached. */ + enable_public_ipv4?: boolean; + /** Attach an IPv6 on the public NIC. If false, no IPv6 address will be attached. */ + enable_public_ipv6?: boolean; + /** Connect to the instance using it's public ip. */ + use_public_ip?: boolean; + /** + * The port periphery will be running on in AMI. + * Default: `8120` + */ + port: number; + /** Whether Periphery will be running on https */ + use_https: boolean; + /** The firewalls to attach to the instance */ + firewall_ids?: I64[]; + /** Labels for the server */ + labels?: Record; + /** Specs for volumes to attach */ + volumes?: HetznerVolumeSpecs[]; + /** Cloud-Init user data to use during Server creation. This field is limited to 32KiB. */ + user_data: string; +} +/** Inspect a docker container on the server. Response: [Container]. */ +export interface InspectDockerContainer { + /** Id or name */ + server: string; + /** The container name */ + container: string; +} +/** Inspect a docker image on the server. Response: [Image]. */ +export interface InspectDockerImage { + /** Id or name */ + server: string; + /** The image name */ + image: string; +} +/** Inspect a docker network on the server. Response: [InspectDockerNetworkResponse]. */ +export interface InspectDockerNetwork { + /** Id or name */ + server: string; + /** The network name */ + network: string; +} +/** Inspect a docker volume on the server. Response: [Volume]. */ +export interface InspectDockerVolume { + /** Id or name */ + server: string; + /** The volume name */ + volume: string; +} +export interface LatestCommit { + hash: string; + message: string; +} +/** + * Launch an EC2 instance with the specified config. + * Response: [Update]. + */ +export interface LaunchServer { + /** The name of the created server. */ + name: string; + /** The server template used to define the config. */ + server_template: string; +} +/** List actions matching optional query. Response: [ListActionsResponse]. */ +export interface ListActions { + /** optional structured query to filter actions. */ + query?: ActionQuery; +} +/** List alerters matching optional query. Response: [ListAlertersResponse]. */ +export interface ListAlerters { + /** Structured query to filter alerters. */ + query?: AlerterQuery; +} +/** + * Get a paginated list of alerts sorted by timestamp descending. + * Response: [ListAlertsResponse]. + */ +export interface ListAlerts { + /** + * Pass a custom mongo query to filter the alerts. + * + * ## Example JSON + * ``` + * { + * "resolved": "false", + * "level": "CRITICAL", + * "$or": [ + * { + * "target": { + * "type": "Server", + * "id": "6608bf89cb2a12b257ab6c09" + * } + * }, + * { + * "target": { + * "type": "Server", + * "id": "660a5f60b74f90d5dae45fa3" + * } + * } + * ] + * } + * ``` + * This will filter to only include open alerts that have CRITICAL level on those two servers. + */ + query?: MongoDocument; + /** + * Retrieve older results by incrementing the page. + * `page: 0` is default, and returns the most recent results. + */ + page?: U64; +} +/** Response for [ListAlerts]. */ +export interface ListAlertsResponse { + alerts: Alert[]; + /** + * If more alerts exist, the next page will be given here. + * Otherwise it will be `null` + */ + next_page?: I64; +} +/** + * List all docker containers on the target server. + * Response: [ListDockerContainersResponse]. + */ +export interface ListAllDockerContainers { + /** Filter by server id or name. */ + servers?: string[]; +} +/** + * Gets list of api keys for the calling user. + * Response: [ListApiKeysResponse] + */ +export interface ListApiKeys { +} +/** + * **Admin only.** + * Gets list of api keys for the user. + * Will still fail if you call for a user_id that isn't a service user. + * Response: [ListApiKeysForServiceUserResponse] + */ +export interface ListApiKeysForServiceUser { + /** Id or username */ + user: string; +} +/** + * Retrieve versions of the build that were built in the past and available for deployment, + * sorted by most recent first. + * Response: [GetBuildVersionsResponse]. + */ +export interface ListBuildVersions { + /** Id or name */ + build: string; + /** Filter to only include versions matching this major version. */ + major?: number; + /** Filter to only include versions matching this minor version. */ + minor?: number; + /** Filter to only include versions matching this patch version. */ + patch?: number; + /** Limit the number of included results. Default is no limit. */ + limit?: I64; +} +/** List builders matching structured query. Response: [ListBuildersResponse]. */ +export interface ListBuilders { + query?: BuilderQuery; +} +/** List builds matching optional query. Response: [ListBuildsResponse]. */ +export interface ListBuilds { + /** optional structured query to filter builds. */ + query?: BuildQuery; +} +/** + * Gets a list of existing values used as extra args across other builds. + * Useful to offer suggestions. Response: [ListCommonBuildExtraArgsResponse] + */ +export interface ListCommonBuildExtraArgs { + /** optional structured query to filter builds. */ + query?: BuildQuery; +} +/** + * Gets a list of existing values used as extra args across other deployments. + * Useful to offer suggestions. Response: [ListCommonDeploymentExtraArgsResponse] + */ +export interface ListCommonDeploymentExtraArgs { + /** optional structured query to filter deployments. */ + query?: DeploymentQuery; +} +/** + * Gets a list of existing values used as build extra args across other stacks. + * Useful to offer suggestions. Response: [ListCommonStackBuildExtraArgsResponse] + */ +export interface ListCommonStackBuildExtraArgs { + /** optional structured query to filter stacks. */ + query?: StackQuery; +} +/** + * Gets a list of existing values used as extra args across other stacks. + * Useful to offer suggestions. Response: [ListCommonStackExtraArgsResponse] + */ +export interface ListCommonStackExtraArgs { + /** optional structured query to filter stacks. */ + query?: StackQuery; +} +/** + * List all docker compose projects on the target server. + * Response: [ListComposeProjectsResponse]. + */ +export interface ListComposeProjects { + /** Id or name */ + server: string; +} +/** + * List deployments matching optional query. + * Response: [ListDeploymentsResponse]. + */ +export interface ListDeployments { + /** optional structured query to filter deployments. */ + query?: DeploymentQuery; +} +/** + * List all docker containers on the target server. + * Response: [ListDockerContainersResponse]. + */ +export interface ListDockerContainers { + /** Id or name */ + server: string; +} +/** Get image history from the server. Response: [ListDockerImageHistoryResponse]. */ +export interface ListDockerImageHistory { + /** Id or name */ + server: string; + /** The image name */ + image: string; +} +/** + * List the docker images locally cached on the target server. + * Response: [ListDockerImagesResponse]. + */ +export interface ListDockerImages { + /** Id or name */ + server: string; +} +/** List the docker networks on the server. Response: [ListDockerNetworksResponse]. */ +export interface ListDockerNetworks { + /** Id or name */ + server: string; +} +/** + * List the docker registry providers available in Core / Periphery config files. + * Response: [ListDockerRegistriesFromConfigResponse]. + * + * Includes: + * - registries in core config + * - registries configured on builds, deployments + * - registries on the optional Server or Builder + */ +export interface ListDockerRegistriesFromConfig { + /** + * Accepts an optional Server or Builder target to expand the core list with + * providers available on that specific resource. + */ + target?: ResourceTarget; +} +/** + * List docker registry accounts matching optional query. + * Response: [ListDockerRegistrysResponse]. + */ +export interface ListDockerRegistryAccounts { + /** Optionally filter by accounts with a specific domain. */ + domain?: string; + /** Optionally filter by accounts with a specific username. */ + username?: string; +} +/** + * List all docker volumes on the target server. + * Response: [ListDockerVolumesResponse]. + */ +export interface ListDockerVolumes { + /** Id or name */ + server: string; +} +/** List actions matching optional query. Response: [ListFullActionsResponse]. */ +export interface ListFullActions { + /** optional structured query to filter actions. */ + query?: ActionQuery; +} +/** List full alerters matching optional query. Response: [ListFullAlertersResponse]. */ +export interface ListFullAlerters { + /** Structured query to filter alerters. */ + query?: AlerterQuery; +} +/** List builders matching structured query. Response: [ListFullBuildersResponse]. */ +export interface ListFullBuilders { + query?: BuilderQuery; +} +/** List builds matching optional query. Response: [ListFullBuildsResponse]. */ +export interface ListFullBuilds { + /** optional structured query to filter builds. */ + query?: BuildQuery; +} +/** + * List deployments matching optional query. + * Response: [ListFullDeploymentsResponse]. + */ +export interface ListFullDeployments { + /** optional structured query to filter deployments. */ + query?: DeploymentQuery; +} +/** List procedures matching optional query. Response: [ListFullProceduresResponse]. */ +export interface ListFullProcedures { + /** optional structured query to filter procedures. */ + query?: ProcedureQuery; +} +/** List repos matching optional query. Response: [ListFullReposResponse]. */ +export interface ListFullRepos { + /** optional structured query to filter repos. */ + query?: RepoQuery; +} +/** List syncs matching optional query. Response: [ListFullResourceSyncsResponse]. */ +export interface ListFullResourceSyncs { + /** optional structured query to filter syncs. */ + query?: ResourceSyncQuery; +} +/** List server templates matching structured query. Response: [ListFullServerTemplatesResponse]. */ +export interface ListFullServerTemplates { + query?: ServerTemplateQuery; +} +/** List servers matching optional query. Response: [ListFullServersResponse]. */ +export interface ListFullServers { + /** optional structured query to filter servers. */ + query?: ServerQuery; +} +/** List stacks matching optional query. Response: [ListFullStacksResponse]. */ +export interface ListFullStacks { + /** optional structured query to filter stacks. */ + query?: StackQuery; +} +/** + * List git provider accounts matching optional query. + * Response: [ListGitProvidersResponse]. + */ +export interface ListGitProviderAccounts { + /** Optionally filter by accounts with a specific domain. */ + domain?: string; + /** Optionally filter by accounts with a specific username. */ + username?: string; +} +/** + * List the git providers available in Core / Periphery config files. + * Response: [ListGitProvidersFromConfigResponse]. + * + * Includes: + * - providers in core config + * - providers configured on builds, repos, syncs + * - providers on the optional Server or Builder + */ +export interface ListGitProvidersFromConfig { + /** + * Accepts an optional Server or Builder target to expand the core list with + * providers available on that specific resource. + */ + target?: ResourceTarget; +} +/** + * List permissions for the calling user. + * Does not include any permissions on UserGroups they may be a part of. + * Response: [ListPermissionsResponse] + */ +export interface ListPermissions { +} +/** List procedures matching optional query. Response: [ListProceduresResponse]. */ +export interface ListProcedures { + /** optional structured query to filter procedures. */ + query?: ProcedureQuery; +} +/** List repos matching optional query. Response: [ListReposResponse]. */ +export interface ListRepos { + /** optional structured query to filter repos. */ + query?: RepoQuery; +} +/** List syncs matching optional query. Response: [ListResourceSyncsResponse]. */ +export interface ListResourceSyncs { + /** optional structured query to filter syncs. */ + query?: ResourceSyncQuery; +} +/** + * List the available secrets from the core config. + * Response: [ListSecretsResponse]. + */ +export interface ListSecrets { + /** + * Accepts an optional Server or Builder target to expand the core list with + * providers available on that specific resource. + */ + target?: ResourceTarget; +} +/** List server templates matching structured query. Response: [ListServerTemplatesResponse]. */ +export interface ListServerTemplates { + query?: ServerTemplateQuery; +} +/** List servers matching optional query. Response: [ListServersResponse]. */ +export interface ListServers { + /** optional structured query to filter servers. */ + query?: ServerQuery; +} +/** Lists a specific stacks services (the containers). Response: [ListStackServicesResponse]. */ +export interface ListStackServices { + /** Id or name */ + stack: string; +} +/** List stacks matching optional query. Response: [ListStacksResponse]. */ +export interface ListStacks { + /** optional structured query to filter syncs. */ + query?: StackQuery; +} +/** + * List the processes running on the target server. + * Response: [ListSystemProcessesResponse]. + * + * Note. This does not hit the server directly. The procedures come from an + * in memory cache on the core, which hits the server periodically + * to keep it up to date. + */ +export interface ListSystemProcesses { + /** Id or name */ + server: string; +} +/** + * List data for tags matching optional mongo query. + * Response: [ListTagsResponse]. + */ +export interface ListTags { + query?: MongoDocument; +} +/** + * Paginated endpoint for updates matching optional query. + * More recent updates will be returned first. + */ +export interface ListUpdates { + /** An optional mongo query to filter the updates. */ + query?: MongoDocument; + /** + * Page of updates. Default is 0, which is the most recent data. + * Use with the `next_page` field of the response. + */ + page?: number; +} +/** Minimal representation of an action performed by Komodo. */ +export interface UpdateListItem { + /** The id of the update */ + id: string; + /** Which operation was run */ + operation: Operation; + /** The starting time of the operation */ + start_ts: I64; + /** Whether the operation was successful */ + success: boolean; + /** The username of the user performing update */ + username: string; + /** + * The user id that triggered the update. + * + * Also can take these values for operations triggered automatically: + * - `Procedure`: The operation was triggered as part of a procedure run + * - `Github`: The operation was triggered by a github webhook + * - `Auto Redeploy`: The operation (always `Deploy`) was triggered by an attached build finishing. + */ + operator: string; + /** The target resource to which this update refers */ + target: ResourceTarget; + /** + * The status of the update + * - `Queued` + * - `InProgress` + * - `Complete` + */ + status: UpdateStatus; + /** An optional version on the update, ie build version or deployed version. */ + version?: Version; + /** Some unstructured, operation specific data. Not for general usage. */ + other_data?: string; +} +/** Response for [ListUpdates]. */ +export interface ListUpdatesResponse { + /** The page of updates, sorted by timestamp descending. */ + updates: UpdateListItem[]; + /** If there is a next page of data, pass this to `page` to get it. */ + next_page?: number; +} +/** + * List all user groups which user can see. Response: [ListUserGroupsResponse]. + * + * Admins can see all user groups, + * and users can see user groups to which they belong. + */ +export interface ListUserGroups { +} +/** + * List permissions for a specific user. **Admin only**. + * Response: [ListUserTargetPermissionsResponse] + */ +export interface ListUserTargetPermissions { + /** Specify either a user or a user group. */ + user_target: UserTarget; +} +/** + * **Admin only.** + * Gets list of Komodo users. + * Response: [ListUsersResponse] + */ +export interface ListUsers { +} +/** + * List all available global variables. + * Response: [ListVariablesResponse] + * + * Note. For non admin users making this call, + * secret variables will have their values obscured. + */ +export interface ListVariables { +} +/** + * Login as a local user. Will fail if the users credentials don't match + * any local user. + * + * Note. This method is only available if the core api has `local_auth` enabled. + */ +export interface LoginLocalUser { + /** The user's username */ + username: string; + /** The user's password */ + password: string; +} +export interface NameAndId { + name: string; + id: string; +} +/** Pauses all containers on the target server. Response: [Update] */ +export interface PauseAllContainers { + /** Name or id */ + server: string; +} +/** + * Pauses the container on the target server. Response: [Update] + * + * 1. Runs `docker pause ${container_name}`. + */ +export interface PauseContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} +/** + * Pauses the container for the target deployment. Response: [Update] + * + * 1. Runs `docker pause ${container_name}`. + */ +export interface PauseDeployment { + /** Name or id */ + deployment: string; +} +/** Pauses the target stack. `docker compose pause`. Response: [Update] */ +export interface PauseStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to pause */ + service?: string; +} +export declare enum PortTypeEnum { + EMPTY = "", + TCP = "tcp", + UDP = "udp", + SCTP = "sctp" +} +/** An open port on a container */ +export interface Port { + /** Host IP address that the container's port is mapped to */ + IP?: string; + /** Port on the container */ + PrivatePort?: number; + /** Port exposed on the host */ + PublicPort?: number; + Type?: PortTypeEnum; +} +/** + * Prunes the docker buildx cache on the target server. Response: [Update]. + * + * 1. Runs `docker buildx prune -a -f`. + */ +export interface PruneBuildx { + /** Id or name */ + server: string; +} +/** + * Prunes the docker containers on the target server. Response: [Update]. + * + * 1. Runs `docker container prune -f`. + */ +export interface PruneContainers { + /** Id or name */ + server: string; +} +/** + * Prunes the docker builders (build cache) on the target server. Response: [Update]. + * + * 1. Runs `docker builder prune -a -f`. + */ +export interface PruneDockerBuilders { + /** Id or name */ + server: string; +} +/** + * Prunes the docker images on the target server. Response: [Update]. + * + * 1. Runs `docker image prune -a -f`. + */ +export interface PruneImages { + /** Id or name */ + server: string; +} +/** + * Prunes the docker networks on the target server. Response: [Update]. + * + * 1. Runs `docker network prune -f`. + */ +export interface PruneNetworks { + /** Id or name */ + server: string; +} +/** + * Prunes the docker system on the target server, including volumes. Response: [Update]. + * + * 1. Runs `docker system prune -a -f --volumes`. + */ +export interface PruneSystem { + /** Id or name */ + server: string; +} +/** + * Prunes the docker volumes on the target server. Response: [Update]. + * + * 1. Runs `docker volume prune -a -f`. + */ +export interface PruneVolumes { + /** Id or name */ + server: string; +} +/** + * Pulls the target repo. Response: [Update]. + * + * Note. Repo must have server attached at `server_id`. + * + * 1. Pulls the repo on the target server using `git pull`. + * 2. If `on_pull` is specified, it will be executed after the pull is complete. + */ +export interface PullRepo { + /** Id or name */ + repo: string; +} +/** + * Push a resource to the front of the users 10 most recently viewed resources. + * Response: [NoData]. + */ +export interface PushRecentlyViewed { + /** The target to push. */ + resource: ResourceTarget; +} +/** Trigger a refresh of the cached latest hash and message. */ +export interface RefreshBuildCache { + /** Id or name */ + build: string; +} +/** Trigger a refresh of the cached latest hash and message. */ +export interface RefreshRepoCache { + /** Id or name */ + repo: string; +} +/** Trigger a refresh of the computed diff logs for view. Response: [ResourceSync] */ +export interface RefreshResourceSyncPending { + /** Id or name */ + sync: string; +} +/** + * Trigger a refresh of the cached compose file contents. + * Refreshes: + * - Whether the remote file is missing + * - The latest json, and for repos, the remote contents, hash, and message. + */ +export interface RefreshStackCache { + /** Id or name */ + stack: string; +} +/** **Admin only.** Remove a user from a user group. Response: [UserGroup] */ +export interface RemoveUserFromUserGroup { + /** The name or id of UserGroup that user should be removed from. */ + user_group: string; + /** The id or username of the user to remove */ + user: string; +} +/** + * Rename the deployment at id to the given name. Response: [Update]. + * + * Note. If a container is created for the deployment, it will be renamed using + * `docker rename ...`. + */ +export interface RenameDeployment { + /** The id of the deployment to rename. */ + id: string; + /** The new name. */ + name: string; +} +/** Rename the server at id to the given name. Response: [Update]. */ +export interface RenameServer { + /** The id of the server to rename. */ + id: string; + /** The new name. */ + name: string; +} +/** Rename the stack at id to the given name. Response: [Update]. */ +export interface RenameStack { + /** The id of the stack to rename. */ + id: string; + /** The new name. */ + name: string; +} +/** Rename a tag at id. Response: [Tag]. */ +export interface RenameTag { + /** The id of the tag to rename. */ + id: string; + /** The new name of the tag. */ + name: string; +} +/** **Admin only.** Rename a user group. Response: [UserGroup] */ +export interface RenameUserGroup { + /** The id of the UserGroup */ + id: string; + /** The new name for the UserGroup */ + name: string; +} +/** Restarts all containers on the target server. Response: [Update] */ +export interface RestartAllContainers { + /** Name or id */ + server: string; +} +/** + * Restarts the container on the target server. Response: [Update] + * + * 1. Runs `docker restart ${container_name}`. + */ +export interface RestartContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} +/** + * Restarts the container for the target deployment. Response: [Update] + * + * 1. Runs `docker restart ${container_name}`. + */ +export interface RestartDeployment { + /** Name or id */ + deployment: string; +} +/** Restarts the target stack. `docker compose restart`. Response: [Update] */ +export interface RestartStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to restart */ + service?: string; +} +/** Runs the target Action. Response: [Update] */ +export interface RunAction { + /** Id or name */ + action: string; +} +/** + * Runs the target build. Response: [Update]. + * + * 1. Get a handle to the builder. If using AWS builder, this means starting a builder ec2 instance. + * 2. Clone the repo on the builder. If an `on_clone` commmand is given, it will be executed. + * 3. Execute `docker build {...params}`, where params are determined using the builds configuration. + * 4. If a dockerhub account is attached, the build will be pushed to that account. + */ +export interface RunBuild { + /** Can be build id or name */ + build: string; +} +/** Runs the target Procedure. Response: [Update] */ +export interface RunProcedure { + /** Id or name */ + procedure: string; +} +/** Runs the target resource sync. Response: [Update] */ +export interface RunSync { + /** Id or name */ + sync: string; + /** + * Only execute sync on a specific resource type. + * Combine with `resource_id` to specify resource. + */ + resource_type?: ResourceTarget["type"]; + /** + * Only execute sync on a specific resources. + * Combine with `resource_type` to specify resources. + * Supports name or id. + */ + resources?: string[]; +} +export declare enum SearchCombinator { + Or = "Or", + And = "And" +} +/** + * Search the container log's tail using `grep`. All lines go to stdout. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface SearchContainerLog { + /** Id or name */ + server: string; + /** The container name */ + container: string; + /** The terms to search for. */ + terms: string[]; + /** + * When searching for multiple terms, can use `AND` or `OR` combinator. + * + * - `AND`: Only include lines with **all** terms present in that line. + * - `OR`: Include lines that have one or more matches in the terms. + */ + combinator?: SearchCombinator; + /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ + invert?: boolean; + /** Enable `--timestamps` */ + timestamps?: boolean; +} +/** + * Search the deployment log's tail using `grep`. All lines go to stdout. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface SearchDeploymentLog { + /** Id or name */ + deployment: string; + /** The terms to search for. */ + terms: string[]; + /** + * When searching for multiple terms, can use `AND` or `OR` combinator. + * + * - `AND`: Only include lines with **all** terms present in that line. + * - `OR`: Include lines that have one or more matches in the terms. + */ + combinator?: SearchCombinator; + /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ + invert?: boolean; + /** Enable `--timestamps` */ + timestamps?: boolean; +} +/** + * Search the deployment log's tail using `grep`. All lines go to stdout. + * Response: [Log]. + * + * Note. This call will hit the underlying server directly for most up to date log. + */ +export interface SearchStackServiceLog { + /** Id or name */ + stack: string; + /** The service to get the log for. */ + service: string; + /** The terms to search for. */ + terms: string[]; + /** + * When searching for multiple terms, can use `AND` or `OR` combinator. + * + * - `AND`: Only include lines with **all** terms present in that line. + * - `OR`: Include lines that have one or more matches in the terms. + */ + combinator?: SearchCombinator; + /** Invert the results, ie return all lines that DON'T match the terms / combinator. */ + invert?: boolean; + /** Enable `--timestamps` */ + timestamps?: boolean; +} +/** Configuration for a Komodo Server Builder. */ +export interface ServerBuilderConfig { + /** The server id of the builder */ + server_id: string; +} +/** The health of a part of the server. */ +export interface ServerHealthState { + level: SeverityLevel; + /** Whether the health is good enough to close an open alert. */ + should_close_alert: boolean; +} +/** Summary of the health of the server. */ +export interface ServerHealth { + cpu: ServerHealthState; + mem: ServerHealthState; + disks: Record; +} +/** + * Set the time the user last opened the UI updates. + * Used for unseen notification dot. + * Response: [NoData] + */ +export interface SetLastSeenUpdate { +} +/** + * **Admin only.** Completely override the user in the group. + * Response: [UserGroup] + */ +export interface SetUsersInUserGroup { + /** Id or name. */ + user_group: string; + /** The user ids or usernames to hard set as the group's users. */ + users: string[]; +} +/** Configuration for a Slack alerter. */ +export interface SlackAlerterEndpoint { + /** The Slack app webhook url */ + url: string; +} +export interface Sleep { + duration_ms?: I64; +} +/** Starts all containers on the target server. Response: [Update] */ +export interface StartAllContainers { + /** Name or id */ + server: string; +} +/** + * Starts the container on the target server. Response: [Update] + * + * 1. Runs `docker start ${container_name}`. + */ +export interface StartContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} +/** + * Starts the container for the target deployment. Response: [Update] + * + * 1. Runs `docker start ${container_name}`. + */ +export interface StartDeployment { + /** Name or id */ + deployment: string; +} +/** Starts the target stack. `docker compose start`. Response: [Update] */ +export interface StartStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to start */ + service?: string; +} +/** Stops all containers on the target server. Response: [Update] */ +export interface StopAllContainers { + /** Name or id */ + server: string; +} +/** + * Stops the container on the target server. Response: [Update] + * + * 1. Runs `docker stop ${container_name}`. + */ +export interface StopContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; + /** Override the default termination signal. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} +/** + * Stops the container for the target deployment. Response: [Update] + * + * 1. Runs `docker stop ${container_name}`. + */ +export interface StopDeployment { + /** Name or id */ + deployment: string; + /** Override the default termination signal specified in the deployment. */ + signal?: TerminationSignal; + /** Override the default termination max time. */ + time?: number; +} +/** Stops the target stack. `docker compose stop`. Response: [Update] */ +export interface StopStack { + /** Id or name */ + stack: string; + /** Override the default termination max time. */ + stop_time?: number; + /** Optionally specify a specific service to stop */ + service?: string; +} +export interface TerminationSignalLabel { + signal: TerminationSignal; + label: string; +} +/** Info for the all system disks combined. */ +export interface TotalDiskUsage { + /** Used portion in GB */ + used_gb: number; + /** Total size in GB */ + total_gb: number; +} +/** Unpauses all containers on the target server. Response: [Update] */ +export interface UnpauseAllContainers { + /** Name or id */ + server: string; +} +/** + * Unpauses the container on the target server. Response: [Update] + * + * 1. Runs `docker unpause ${container_name}`. + * + * Note. This is the only way to restart a paused container. + */ +export interface UnpauseContainer { + /** Name or id */ + server: string; + /** The container name */ + container: string; +} +/** + * Unpauses the container for the target deployment. Response: [Update] + * + * 1. Runs `docker unpause ${container_name}`. + * + * Note. This is the only way to restart a paused container. + */ +export interface UnpauseDeployment { + /** Name or id */ + deployment: string; +} +/** + * Unpauses the target stack. `docker compose unpause`. Response: [Update]. + * + * Note. This is the only way to restart a paused container. + */ +export interface UnpauseStack { + /** Id or name */ + stack: string; + /** Optionally specify a specific service to unpause */ + service?: string; +} +/** + * Update the action at the given id, and return the updated action. + * Response: [Action]. + * + * Note. This method updates only the fields which are set in the [_PartialActionConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateAction { + /** The id of the action to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialActionConfig; +} +/** + * Update the alerter at the given id, and return the updated alerter. Response: [Alerter]. + * + * Note. This method updates only the fields which are set in the [PartialAlerterConfig][crate::entities::alerter::PartialAlerterConfig], + * effectively merging diffs into the final document. This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateAlerter { + /** The id of the alerter to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialAlerterConfig; +} +/** + * Update the build at the given id, and return the updated build. + * Response: [Build]. + * + * Note. This method updates only the fields which are set in the [_PartialBuildConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateBuild { + /** The id of the build to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialBuildConfig; +} +/** + * Update the builder at the given id, and return the updated builder. + * Response: [Builder]. + * + * Note. This method updates only the fields which are set in the [PartialBuilderConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateBuilder { + /** The id of the builder to update. */ + id: string; + /** The partial config update to apply. */ + config: PartialBuilderConfig; +} +/** + * Update the deployment at the given id, and return the updated deployment. + * Response: [Deployment]. + * + * Note. If the attached server for the deployment changes, + * the deployment will be deleted / cleaned up on the old server. + * + * Note. This method updates only the fields which are set in the [_PartialDeploymentConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateDeployment { + /** The deployment id to update. */ + id: string; + /** The partial config update. */ + config: _PartialDeploymentConfig; +} +/** + * Update a resources description. + * Response: [NoData]. + */ +export interface UpdateDescription { + /** The target resource to set description for. */ + target: ResourceTarget; + /** The new description. */ + description: string; +} +/** + * **Admin only.** Update a docker registry account. + * Response: [DockerRegistryAccount]. + */ +export interface UpdateDockerRegistryAccount { + /** The id of the docker registry to update */ + id: string; + /** The partial docker registry account. */ + account: _PartialDockerRegistryAccount; +} +/** + * **Admin only.** Update a git provider account. + * Response: [GitProviderAccount]. + */ +export interface UpdateGitProviderAccount { + /** The id of the git provider account to update. */ + id: string; + /** The partial git provider account. */ + account: _PartialGitProviderAccount; +} +/** + * **Admin only.** Update a user or user groups base permission level on a resource type. + * Response: [NoData]. + */ +export interface UpdatePermissionOnResourceType { + /** Specify the user or user group. */ + user_target: UserTarget; + /** The resource type: eg. Server, Build, Deployment, etc. */ + resource_type: ResourceTarget["type"]; + /** The base permission level. */ + permission: PermissionLevel; +} +/** + * **Admin only.** Update a user or user groups permission on a resource. + * Response: [NoData]. + */ +export interface UpdatePermissionOnTarget { + /** Specify the user or user group. */ + user_target: UserTarget; + /** Specify the target resource. */ + resource_target: ResourceTarget; + /** Specify the permission level. */ + permission: PermissionLevel; +} +/** + * Update the procedure at the given id, and return the updated procedure. + * Response: [Procedure]. + * + * Note. This method updates only the fields which are set in the [_PartialProcedureConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateProcedure { + /** The id of the procedure to update. */ + id: string; + /** The partial config update. */ + config: _PartialProcedureConfig; +} +/** + * Update the repo at the given id, and return the updated repo. + * Response: [Repo]. + * + * Note. If the attached server for the repo changes, + * the repo will be deleted / cleaned up on the old server. + * + * Note. This method updates only the fields which are set in the [_PartialRepoConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateRepo { + /** The id of the repo to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialRepoConfig; +} +/** + * Update the sync at the given id, and return the updated sync. + * Response: [ResourceSync]. + * + * Note. This method updates only the fields which are set in the [_PartialResourceSyncConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateResourceSync { + /** The id of the sync to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialResourceSyncConfig; +} +/** + * Update the server at the given id, and return the updated server. + * Response: [Server]. + * + * Note. This method updates only the fields which are set in the [_PartialServerConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateServer { + /** The id of the server to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialServerConfig; +} +/** + * Update the server template at the given id, and return the updated server template. + * Response: [ServerTemplate]. + * + * Note. This method updates only the fields which are set in the [PartialServerTemplateConfig], + * effectively merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateServerTemplate { + /** The id of the server template to update. */ + id: string; + /** The partial config update to apply. */ + config: PartialServerTemplateConfig; +} +/** + * **Admin only.** Update a service user's description. + * Response: [User]. + */ +export interface UpdateServiceUserDescription { + /** The service user's username */ + username: string; + /** A new description for the service user. */ + description: string; +} +/** + * Update the stack at the given id, and return the updated stack. + * Response: [Stack]. + * + * Note. If the attached server for the stack changes, + * the stack will be deleted / cleaned up on the old server. + * + * Note. This method updates only the fields which are set in the [_PartialStackConfig], + * merging diffs into the final document. + * This is helpful when multiple users are using + * the same resources concurrently by ensuring no unintentional + * field changes occur from out of date local state. + */ +export interface UpdateStack { + /** The id of the Stack to update. */ + id: string; + /** The partial config update to apply. */ + config: _PartialStackConfig; +} +/** + * Update the tags on a resource. + * Response: [NoData] + */ +export interface UpdateTagsOnResource { + target: ResourceTarget; + /** Tag Ids */ + tags: string[]; +} +/** + * **Super Admin only.** Update's whether a user is admin. + * Response: [NoData]. + */ +export interface UpdateUserAdmin { + /** The target user. */ + user_id: string; + /** Whether user should be admin. */ + admin: boolean; +} +/** + * **Admin only.** Update a user's "base" permissions, eg. "enabled". + * Response: [NoData]. + */ +export interface UpdateUserBasePermissions { + /** The target user. */ + user_id: string; + /** If specified, will update users enabled state. */ + enabled?: boolean; + /** If specified, will update user's ability to create servers. */ + create_servers?: boolean; + /** If specified, will update user's ability to create builds. */ + create_builds?: boolean; +} +/** + * **Only for local users**. Update the calling users password. + * Response: [NoData]. + */ +export interface UpdateUserPassword { + password: string; +} +/** + * **Only for local users**. Update the calling users username. + * Response: [NoData]. + */ +export interface UpdateUserUsername { + username: string; +} +/** **Admin only.** Update variable description. Response: [Variable]. */ +export interface UpdateVariableDescription { + /** The name of the variable to update. */ + name: string; + /** The description to set. */ + description: string; +} +/** **Admin only.** Update whether variable is secret. Response: [Variable]. */ +export interface UpdateVariableIsSecret { + /** The name of the variable to update. */ + name: string; + /** Whether variable is secret. */ + is_secret: boolean; +} +/** **Admin only.** Update variable value. Response: [Variable]. */ +export interface UpdateVariableValue { + /** The name of the variable to update. */ + name: string; + /** The value to set. */ + value: string; +} +/** Update file contents in Files on Server or Git Repo mode. Response: [Update]. */ +export interface WriteStackFileContents { + /** The name or id of the target Stack. */ + stack: string; + /** + * The file path relative to the stack run directory, + * or absolute path. + */ + file_path: string; + /** The contents to write. */ + contents: string; +} +/** Rename the stack at id to the given name. Response: [Update]. */ +export interface WriteSyncFileContents { + /** The name or id of the target Sync. */ + sync: string; + /** + * If this file was under a resource folder, this will be the folder. + * Otherwise, it should be empty string. + */ + resource_path: string; + /** The file path relative to the resource path. */ + file_path: string; + /** The contents to write. */ + contents: string; +} +export type AuthRequest = { + type: "GetLoginOptions"; + params: GetLoginOptions; +} | { + type: "CreateLocalUser"; + params: CreateLocalUser; +} | { + type: "LoginLocalUser"; + params: LoginLocalUser; +} | { + type: "ExchangeForJwt"; + params: ExchangeForJwt; +} | { + type: "GetUser"; + params: GetUser; +}; +export type ExecuteRequest = { + type: "StartContainer"; + params: StartContainer; +} | { + type: "RestartContainer"; + params: RestartContainer; +} | { + type: "PauseContainer"; + params: PauseContainer; +} | { + type: "UnpauseContainer"; + params: UnpauseContainer; +} | { + type: "StopContainer"; + params: StopContainer; +} | { + type: "DestroyContainer"; + params: DestroyContainer; +} | { + type: "StartAllContainers"; + params: StartAllContainers; +} | { + type: "RestartAllContainers"; + params: RestartAllContainers; +} | { + type: "PauseAllContainers"; + params: PauseAllContainers; +} | { + type: "UnpauseAllContainers"; + params: UnpauseAllContainers; +} | { + type: "StopAllContainers"; + params: StopAllContainers; +} | { + type: "PruneContainers"; + params: PruneContainers; +} | { + type: "DeleteNetwork"; + params: DeleteNetwork; +} | { + type: "PruneNetworks"; + params: PruneNetworks; +} | { + type: "DeleteImage"; + params: DeleteImage; +} | { + type: "PruneImages"; + params: PruneImages; +} | { + type: "DeleteVolume"; + params: DeleteVolume; +} | { + type: "PruneVolumes"; + params: PruneVolumes; +} | { + type: "PruneDockerBuilders"; + params: PruneDockerBuilders; +} | { + type: "PruneBuildx"; + params: PruneBuildx; +} | { + type: "PruneSystem"; + params: PruneSystem; +} | { + type: "Deploy"; + params: Deploy; +} | { + type: "StartDeployment"; + params: StartDeployment; +} | { + type: "RestartDeployment"; + params: RestartDeployment; +} | { + type: "PauseDeployment"; + params: PauseDeployment; +} | { + type: "UnpauseDeployment"; + params: UnpauseDeployment; +} | { + type: "StopDeployment"; + params: StopDeployment; +} | { + type: "DestroyDeployment"; + params: DestroyDeployment; +} | { + type: "DeployStack"; + params: DeployStack; +} | { + type: "DeployStackIfChanged"; + params: DeployStackIfChanged; +} | { + type: "StartStack"; + params: StartStack; +} | { + type: "RestartStack"; + params: RestartStack; +} | { + type: "StopStack"; + params: StopStack; +} | { + type: "PauseStack"; + params: PauseStack; +} | { + type: "UnpauseStack"; + params: UnpauseStack; +} | { + type: "DestroyStack"; + params: DestroyStack; +} | { + type: "RunBuild"; + params: RunBuild; +} | { + type: "CancelBuild"; + params: CancelBuild; +} | { + type: "CloneRepo"; + params: CloneRepo; +} | { + type: "PullRepo"; + params: PullRepo; +} | { + type: "BuildRepo"; + params: BuildRepo; +} | { + type: "CancelRepoBuild"; + params: CancelRepoBuild; +} | { + type: "RunProcedure"; + params: RunProcedure; +} | { + type: "RunAction"; + params: RunAction; +} | { + type: "LaunchServer"; + params: LaunchServer; +} | { + type: "RunSync"; + params: RunSync; +}; +/** Configuration for the registry to push the built image to. */ +export type ImageRegistryLegacy1_14 = +/** Don't push the image to any registry */ +{ + type: "None"; + params: NoData; +} +/** Push the image to a standard image registry (any domain) */ + | { + type: "Standard"; + params: ImageRegistryConfig; +}; +export type ReadRequest = { + type: "GetVersion"; + params: GetVersion; +} | { + type: "GetCoreInfo"; + params: GetCoreInfo; +} | { + type: "ListSecrets"; + params: ListSecrets; +} | { + type: "ListGitProvidersFromConfig"; + params: ListGitProvidersFromConfig; +} | { + type: "ListDockerRegistriesFromConfig"; + params: ListDockerRegistriesFromConfig; +} | { + type: "GetUsername"; + params: GetUsername; +} | { + type: "GetPermissionLevel"; + params: GetPermissionLevel; +} | { + type: "FindUser"; + params: FindUser; +} | { + type: "ListUsers"; + params: ListUsers; +} | { + type: "ListApiKeys"; + params: ListApiKeys; +} | { + type: "ListApiKeysForServiceUser"; + params: ListApiKeysForServiceUser; +} | { + type: "ListPermissions"; + params: ListPermissions; +} | { + type: "ListUserTargetPermissions"; + params: ListUserTargetPermissions; +} | { + type: "GetUserGroup"; + params: GetUserGroup; +} | { + type: "ListUserGroups"; + params: ListUserGroups; +} | { + type: "FindResources"; + params: FindResources; +} | { + type: "GetProceduresSummary"; + params: GetProceduresSummary; +} | { + type: "GetProcedure"; + params: GetProcedure; +} | { + type: "GetProcedureActionState"; + params: GetProcedureActionState; +} | { + type: "ListProcedures"; + params: ListProcedures; +} | { + type: "ListFullProcedures"; + params: ListFullProcedures; +} | { + type: "GetActionsSummary"; + params: GetActionsSummary; +} | { + type: "GetAction"; + params: GetAction; +} | { + type: "GetActionActionState"; + params: GetActionActionState; +} | { + type: "ListActions"; + params: ListActions; +} | { + type: "ListFullActions"; + params: ListFullActions; +} | { + type: "GetServerTemplate"; + params: GetServerTemplate; +} | { + type: "GetServerTemplatesSummary"; + params: GetServerTemplatesSummary; +} | { + type: "ListServerTemplates"; + params: ListServerTemplates; +} | { + type: "ListFullServerTemplates"; + params: ListFullServerTemplates; +} | { + type: "GetServersSummary"; + params: GetServersSummary; +} | { + type: "GetServer"; + params: GetServer; +} | { + type: "GetServerState"; + params: GetServerState; +} | { + type: "GetPeripheryVersion"; + params: GetPeripheryVersion; +} | { + type: "GetServerActionState"; + params: GetServerActionState; +} | { + type: "GetHistoricalServerStats"; + params: GetHistoricalServerStats; +} | { + type: "ListServers"; + params: ListServers; +} | { + type: "ListFullServers"; + params: ListFullServers; +} | { + type: "InspectDockerContainer"; + params: InspectDockerContainer; +} | { + type: "GetResourceMatchingContainer"; + params: GetResourceMatchingContainer; +} | { + type: "GetContainerLog"; + params: GetContainerLog; +} | { + type: "SearchContainerLog"; + params: SearchContainerLog; +} | { + type: "InspectDockerNetwork"; + params: InspectDockerNetwork; +} | { + type: "InspectDockerImage"; + params: InspectDockerImage; +} | { + type: "ListDockerImageHistory"; + params: ListDockerImageHistory; +} | { + type: "InspectDockerVolume"; + params: InspectDockerVolume; +} | { + type: "ListAllDockerContainers"; + params: ListAllDockerContainers; +} | { + type: "ListDockerContainers"; + params: ListDockerContainers; +} | { + type: "ListDockerNetworks"; + params: ListDockerNetworks; +} | { + type: "ListDockerImages"; + params: ListDockerImages; +} | { + type: "ListDockerVolumes"; + params: ListDockerVolumes; +} | { + type: "ListComposeProjects"; + params: ListComposeProjects; +} | { + type: "GetDeploymentsSummary"; + params: GetDeploymentsSummary; +} | { + type: "GetDeployment"; + params: GetDeployment; +} | { + type: "GetDeploymentContainer"; + params: GetDeploymentContainer; +} | { + type: "GetDeploymentActionState"; + params: GetDeploymentActionState; +} | { + type: "GetDeploymentStats"; + params: GetDeploymentStats; +} | { + type: "GetDeploymentLog"; + params: GetDeploymentLog; +} | { + type: "SearchDeploymentLog"; + params: SearchDeploymentLog; +} | { + type: "ListDeployments"; + params: ListDeployments; +} | { + type: "ListFullDeployments"; + params: ListFullDeployments; +} | { + type: "ListCommonDeploymentExtraArgs"; + params: ListCommonDeploymentExtraArgs; +} | { + type: "GetBuildsSummary"; + params: GetBuildsSummary; +} | { + type: "GetBuild"; + params: GetBuild; +} | { + type: "GetBuildActionState"; + params: GetBuildActionState; +} | { + type: "GetBuildMonthlyStats"; + params: GetBuildMonthlyStats; +} | { + type: "ListBuildVersions"; + params: ListBuildVersions; +} | { + type: "GetBuildWebhookEnabled"; + params: GetBuildWebhookEnabled; +} | { + type: "ListBuilds"; + params: ListBuilds; +} | { + type: "ListFullBuilds"; + params: ListFullBuilds; +} | { + type: "ListCommonBuildExtraArgs"; + params: ListCommonBuildExtraArgs; +} | { + type: "GetReposSummary"; + params: GetReposSummary; +} | { + type: "GetRepo"; + params: GetRepo; +} | { + type: "GetRepoActionState"; + params: GetRepoActionState; +} | { + type: "GetRepoWebhooksEnabled"; + params: GetRepoWebhooksEnabled; +} | { + type: "ListRepos"; + params: ListRepos; +} | { + type: "ListFullRepos"; + params: ListFullRepos; +} | { + type: "GetResourceSyncsSummary"; + params: GetResourceSyncsSummary; +} | { + type: "GetResourceSync"; + params: GetResourceSync; +} | { + type: "GetResourceSyncActionState"; + params: GetResourceSyncActionState; +} | { + type: "GetSyncWebhooksEnabled"; + params: GetSyncWebhooksEnabled; +} | { + type: "ListResourceSyncs"; + params: ListResourceSyncs; +} | { + type: "ListFullResourceSyncs"; + params: ListFullResourceSyncs; +} | { + type: "GetStacksSummary"; + params: GetStacksSummary; +} | { + type: "GetStack"; + params: GetStack; +} | { + type: "GetStackActionState"; + params: GetStackActionState; +} | { + type: "GetStackWebhooksEnabled"; + params: GetStackWebhooksEnabled; +} | { + type: "GetStackServiceLog"; + params: GetStackServiceLog; +} | { + type: "SearchStackServiceLog"; + params: SearchStackServiceLog; +} | { + type: "ListStacks"; + params: ListStacks; +} | { + type: "ListFullStacks"; + params: ListFullStacks; +} | { + type: "ListStackServices"; + params: ListStackServices; +} | { + type: "ListCommonStackExtraArgs"; + params: ListCommonStackExtraArgs; +} | { + type: "ListCommonStackBuildExtraArgs"; + params: ListCommonStackBuildExtraArgs; +} | { + type: "GetBuildersSummary"; + params: GetBuildersSummary; +} | { + type: "GetBuilder"; + params: GetBuilder; +} | { + type: "ListBuilders"; + params: ListBuilders; +} | { + type: "ListFullBuilders"; + params: ListFullBuilders; +} | { + type: "GetAlertersSummary"; + params: GetAlertersSummary; +} | { + type: "GetAlerter"; + params: GetAlerter; +} | { + type: "ListAlerters"; + params: ListAlerters; +} | { + type: "ListFullAlerters"; + params: ListFullAlerters; +} | { + type: "ExportAllResourcesToToml"; + params: ExportAllResourcesToToml; +} | { + type: "ExportResourcesToToml"; + params: ExportResourcesToToml; +} | { + type: "GetTag"; + params: GetTag; +} | { + type: "ListTags"; + params: ListTags; +} | { + type: "GetUpdate"; + params: GetUpdate; +} | { + type: "ListUpdates"; + params: ListUpdates; +} | { + type: "ListAlerts"; + params: ListAlerts; +} | { + type: "GetAlert"; + params: GetAlert; +} | { + type: "GetSystemInformation"; + params: GetSystemInformation; +} | { + type: "GetSystemStats"; + params: GetSystemStats; +} | { + type: "ListSystemProcesses"; + params: ListSystemProcesses; +} | { + type: "GetVariable"; + params: GetVariable; +} | { + type: "ListVariables"; + params: ListVariables; +} | { + type: "GetGitProviderAccount"; + params: GetGitProviderAccount; +} | { + type: "ListGitProviderAccounts"; + params: ListGitProviderAccounts; +} | { + type: "GetDockerRegistryAccount"; + params: GetDockerRegistryAccount; +} | { + type: "ListDockerRegistryAccounts"; + params: ListDockerRegistryAccounts; +}; +export type UserRequest = { + type: "PushRecentlyViewed"; + params: PushRecentlyViewed; +} | { + type: "SetLastSeenUpdate"; + params: SetLastSeenUpdate; +} | { + type: "CreateApiKey"; + params: CreateApiKey; +} | { + type: "DeleteApiKey"; + params: DeleteApiKey; +}; +export type WriteRequest = { + type: "UpdateUserUsername"; + params: UpdateUserUsername; +} | { + type: "UpdateUserPassword"; + params: UpdateUserPassword; +} | { + type: "DeleteUser"; + params: DeleteUser; +} | { + type: "CreateServiceUser"; + params: CreateServiceUser; +} | { + type: "UpdateServiceUserDescription"; + params: UpdateServiceUserDescription; +} | { + type: "CreateApiKeyForServiceUser"; + params: CreateApiKeyForServiceUser; +} | { + type: "DeleteApiKeyForServiceUser"; + params: DeleteApiKeyForServiceUser; +} | { + type: "CreateUserGroup"; + params: CreateUserGroup; +} | { + type: "RenameUserGroup"; + params: RenameUserGroup; +} | { + type: "DeleteUserGroup"; + params: DeleteUserGroup; +} | { + type: "AddUserToUserGroup"; + params: AddUserToUserGroup; +} | { + type: "RemoveUserFromUserGroup"; + params: RemoveUserFromUserGroup; +} | { + type: "SetUsersInUserGroup"; + params: SetUsersInUserGroup; +} | { + type: "UpdateUserAdmin"; + params: UpdateUserAdmin; +} | { + type: "UpdateUserBasePermissions"; + params: UpdateUserBasePermissions; +} | { + type: "UpdatePermissionOnResourceType"; + params: UpdatePermissionOnResourceType; +} | { + type: "UpdatePermissionOnTarget"; + params: UpdatePermissionOnTarget; +} | { + type: "UpdateDescription"; + params: UpdateDescription; +} | { + type: "CreateServer"; + params: CreateServer; +} | { + type: "DeleteServer"; + params: DeleteServer; +} | { + type: "UpdateServer"; + params: UpdateServer; +} | { + type: "RenameServer"; + params: RenameServer; +} | { + type: "CreateNetwork"; + params: CreateNetwork; +} | { + type: "CreateDeployment"; + params: CreateDeployment; +} | { + type: "CopyDeployment"; + params: CopyDeployment; +} | { + type: "DeleteDeployment"; + params: DeleteDeployment; +} | { + type: "UpdateDeployment"; + params: UpdateDeployment; +} | { + type: "RenameDeployment"; + params: RenameDeployment; +} | { + type: "CreateBuild"; + params: CreateBuild; +} | { + type: "CopyBuild"; + params: CopyBuild; +} | { + type: "DeleteBuild"; + params: DeleteBuild; +} | { + type: "UpdateBuild"; + params: UpdateBuild; +} | { + type: "RefreshBuildCache"; + params: RefreshBuildCache; +} | { + type: "CreateBuildWebhook"; + params: CreateBuildWebhook; +} | { + type: "DeleteBuildWebhook"; + params: DeleteBuildWebhook; +} | { + type: "CreateBuilder"; + params: CreateBuilder; +} | { + type: "CopyBuilder"; + params: CopyBuilder; +} | { + type: "DeleteBuilder"; + params: DeleteBuilder; +} | { + type: "UpdateBuilder"; + params: UpdateBuilder; +} | { + type: "CreateServerTemplate"; + params: CreateServerTemplate; +} | { + type: "CopyServerTemplate"; + params: CopyServerTemplate; +} | { + type: "DeleteServerTemplate"; + params: DeleteServerTemplate; +} | { + type: "UpdateServerTemplate"; + params: UpdateServerTemplate; +} | { + type: "CreateRepo"; + params: CreateRepo; +} | { + type: "CopyRepo"; + params: CopyRepo; +} | { + type: "DeleteRepo"; + params: DeleteRepo; +} | { + type: "UpdateRepo"; + params: UpdateRepo; +} | { + type: "RefreshRepoCache"; + params: RefreshRepoCache; +} | { + type: "CreateRepoWebhook"; + params: CreateRepoWebhook; +} | { + type: "DeleteRepoWebhook"; + params: DeleteRepoWebhook; +} | { + type: "CreateAlerter"; + params: CreateAlerter; +} | { + type: "CopyAlerter"; + params: CopyAlerter; +} | { + type: "DeleteAlerter"; + params: DeleteAlerter; +} | { + type: "UpdateAlerter"; + params: UpdateAlerter; +} | { + type: "CreateProcedure"; + params: CreateProcedure; +} | { + type: "CopyProcedure"; + params: CopyProcedure; +} | { + type: "DeleteProcedure"; + params: DeleteProcedure; +} | { + type: "UpdateProcedure"; + params: UpdateProcedure; +} | { + type: "CreateAction"; + params: CreateAction; +} | { + type: "CopyAction"; + params: CopyAction; +} | { + type: "DeleteAction"; + params: DeleteAction; +} | { + type: "UpdateAction"; + params: UpdateAction; +} | { + type: "CreateResourceSync"; + params: CreateResourceSync; +} | { + type: "CopyResourceSync"; + params: CopyResourceSync; +} | { + type: "DeleteResourceSync"; + params: DeleteResourceSync; +} | { + type: "UpdateResourceSync"; + params: UpdateResourceSync; +} | { + type: "WriteSyncFileContents"; + params: WriteSyncFileContents; +} | { + type: "CommitSync"; + params: CommitSync; +} | { + type: "RefreshResourceSyncPending"; + params: RefreshResourceSyncPending; +} | { + type: "CreateSyncWebhook"; + params: CreateSyncWebhook; +} | { + type: "DeleteSyncWebhook"; + params: DeleteSyncWebhook; +} | { + type: "CreateStack"; + params: CreateStack; +} | { + type: "CopyStack"; + params: CopyStack; +} | { + type: "DeleteStack"; + params: DeleteStack; +} | { + type: "UpdateStack"; + params: UpdateStack; +} | { + type: "RenameStack"; + params: RenameStack; +} | { + type: "WriteStackFileContents"; + params: WriteStackFileContents; +} | { + type: "RefreshStackCache"; + params: RefreshStackCache; +} | { + type: "CreateStackWebhook"; + params: CreateStackWebhook; +} | { + type: "DeleteStackWebhook"; + params: DeleteStackWebhook; +} | { + type: "CreateTag"; + params: CreateTag; +} | { + type: "DeleteTag"; + params: DeleteTag; +} | { + type: "RenameTag"; + params: RenameTag; +} | { + type: "UpdateTagsOnResource"; + params: UpdateTagsOnResource; +} | { + type: "CreateVariable"; + params: CreateVariable; +} | { + type: "UpdateVariableValue"; + params: UpdateVariableValue; +} | { + type: "UpdateVariableDescription"; + params: UpdateVariableDescription; +} | { + type: "UpdateVariableIsSecret"; + params: UpdateVariableIsSecret; +} | { + type: "DeleteVariable"; + params: DeleteVariable; +} | { + type: "CreateGitProviderAccount"; + params: CreateGitProviderAccount; +} | { + type: "UpdateGitProviderAccount"; + params: UpdateGitProviderAccount; +} | { + type: "DeleteGitProviderAccount"; + params: DeleteGitProviderAccount; +} | { + type: "CreateDockerRegistryAccount"; + params: CreateDockerRegistryAccount; +} | { + type: "UpdateDockerRegistryAccount"; + params: UpdateDockerRegistryAccount; +} | { + type: "DeleteDockerRegistryAccount"; + params: DeleteDockerRegistryAccount; +}; +export type WsLoginMessage = { + type: "Jwt"; + params: { + jwt: string; + }; +} | { + type: "ApiKeys"; + params: { + key: string; + secret: string; + }; +}; diff --git a/frontend/public/client/types.js b/frontend/public/client/types.js new file mode 100644 index 000000000..88cc4fefa --- /dev/null +++ b/frontend/public/client/types.js @@ -0,0 +1,481 @@ +/* + Generated by typeshare 1.11.0 +*/ +/** The levels of permission that a User or UserGroup can have on a resource. */ +export var PermissionLevel; +(function (PermissionLevel) { + /** No permissions. */ + PermissionLevel["None"] = "None"; + /** Can see the rousource */ + PermissionLevel["Read"] = "Read"; + /** Can execute actions on the resource */ + PermissionLevel["Execute"] = "Execute"; + /** Can update the resource configuration */ + PermissionLevel["Write"] = "Write"; +})(PermissionLevel || (PermissionLevel = {})); +export var ActionState; +(function (ActionState) { + /** Unknown case */ + ActionState["Unknown"] = "Unknown"; + /** Last clone / pull successful (or never cloned) */ + ActionState["Ok"] = "Ok"; + /** Last clone / pull failed */ + ActionState["Failed"] = "Failed"; + /** Currently running */ + ActionState["Running"] = "Running"; +})(ActionState || (ActionState = {})); +export var TagBehavior; +(function (TagBehavior) { + /** Returns resources which have strictly all the tags */ + TagBehavior["All"] = "All"; + /** Returns resources which have one or more of the tags */ + TagBehavior["Any"] = "Any"; +})(TagBehavior || (TagBehavior = {})); +export var BuildState; +(function (BuildState) { + /** Last build successful (or never built) */ + BuildState["Ok"] = "Ok"; + /** Last build failed */ + BuildState["Failed"] = "Failed"; + /** Currently building */ + BuildState["Building"] = "Building"; + /** Other case */ + BuildState["Unknown"] = "Unknown"; +})(BuildState || (BuildState = {})); +export var RestartMode; +(function (RestartMode) { + RestartMode["NoRestart"] = "no"; + RestartMode["OnFailure"] = "on-failure"; + RestartMode["Always"] = "always"; + RestartMode["UnlessStopped"] = "unless-stopped"; +})(RestartMode || (RestartMode = {})); +export var TerminationSignal; +(function (TerminationSignal) { + TerminationSignal["SigHup"] = "SIGHUP"; + TerminationSignal["SigInt"] = "SIGINT"; + TerminationSignal["SigQuit"] = "SIGQUIT"; + TerminationSignal["SigTerm"] = "SIGTERM"; +})(TerminationSignal || (TerminationSignal = {})); +/** + * Variants de/serialized from/to snake_case. + * + * Eg. + * - NotDeployed -> not_deployed + * - Restarting -> restarting + * - Running -> running. + */ +export var DeploymentState; +(function (DeploymentState) { + DeploymentState["Unknown"] = "unknown"; + DeploymentState["NotDeployed"] = "not_deployed"; + DeploymentState["Created"] = "created"; + DeploymentState["Restarting"] = "restarting"; + DeploymentState["Running"] = "running"; + DeploymentState["Removing"] = "removing"; + DeploymentState["Paused"] = "paused"; + DeploymentState["Exited"] = "exited"; + DeploymentState["Dead"] = "dead"; +})(DeploymentState || (DeploymentState = {})); +/** Severity level of problem. */ +export var SeverityLevel; +(function (SeverityLevel) { + /** No problem. */ + SeverityLevel["Ok"] = "OK"; + /** Problem is imminent. */ + SeverityLevel["Warning"] = "WARNING"; + /** Problem fully realized. */ + SeverityLevel["Critical"] = "CRITICAL"; +})(SeverityLevel || (SeverityLevel = {})); +export var Timelength; +(function (Timelength) { + Timelength["OneSecond"] = "1-sec"; + Timelength["FiveSeconds"] = "5-sec"; + Timelength["TenSeconds"] = "10-sec"; + Timelength["FifteenSeconds"] = "15-sec"; + Timelength["ThirtySeconds"] = "30-sec"; + Timelength["OneMinute"] = "1-min"; + Timelength["TwoMinutes"] = "2-min"; + Timelength["FiveMinutes"] = "5-min"; + Timelength["TenMinutes"] = "10-min"; + Timelength["FifteenMinutes"] = "15-min"; + Timelength["ThirtyMinutes"] = "30-min"; + Timelength["OneHour"] = "1-hr"; + Timelength["TwoHours"] = "2-hr"; + Timelength["SixHours"] = "6-hr"; + Timelength["EightHours"] = "8-hr"; + Timelength["TwelveHours"] = "12-hr"; + Timelength["OneDay"] = "1-day"; + Timelength["ThreeDay"] = "3-day"; + Timelength["OneWeek"] = "1-wk"; + Timelength["TwoWeeks"] = "2-wk"; + Timelength["ThirtyDays"] = "30-day"; +})(Timelength || (Timelength = {})); +export var Operation; +(function (Operation) { + Operation["None"] = "None"; + Operation["CreateServer"] = "CreateServer"; + Operation["UpdateServer"] = "UpdateServer"; + Operation["DeleteServer"] = "DeleteServer"; + Operation["RenameServer"] = "RenameServer"; + Operation["StartContainer"] = "StartContainer"; + Operation["RestartContainer"] = "RestartContainer"; + Operation["PauseContainer"] = "PauseContainer"; + Operation["UnpauseContainer"] = "UnpauseContainer"; + Operation["StopContainer"] = "StopContainer"; + Operation["DestroyContainer"] = "DestroyContainer"; + Operation["StartAllContainers"] = "StartAllContainers"; + Operation["RestartAllContainers"] = "RestartAllContainers"; + Operation["PauseAllContainers"] = "PauseAllContainers"; + Operation["UnpauseAllContainers"] = "UnpauseAllContainers"; + Operation["StopAllContainers"] = "StopAllContainers"; + Operation["PruneContainers"] = "PruneContainers"; + Operation["CreateNetwork"] = "CreateNetwork"; + Operation["DeleteNetwork"] = "DeleteNetwork"; + Operation["PruneNetworks"] = "PruneNetworks"; + Operation["DeleteImage"] = "DeleteImage"; + Operation["PruneImages"] = "PruneImages"; + Operation["DeleteVolume"] = "DeleteVolume"; + Operation["PruneVolumes"] = "PruneVolumes"; + Operation["PruneDockerBuilders"] = "PruneDockerBuilders"; + Operation["PruneBuildx"] = "PruneBuildx"; + Operation["PruneSystem"] = "PruneSystem"; + Operation["CreateStack"] = "CreateStack"; + Operation["UpdateStack"] = "UpdateStack"; + Operation["RenameStack"] = "RenameStack"; + Operation["DeleteStack"] = "DeleteStack"; + Operation["WriteStackContents"] = "WriteStackContents"; + Operation["RefreshStackCache"] = "RefreshStackCache"; + Operation["DeployStack"] = "DeployStack"; + Operation["StartStack"] = "StartStack"; + Operation["RestartStack"] = "RestartStack"; + Operation["PauseStack"] = "PauseStack"; + Operation["UnpauseStack"] = "UnpauseStack"; + Operation["StopStack"] = "StopStack"; + Operation["DestroyStack"] = "DestroyStack"; + Operation["StartStackService"] = "StartStackService"; + Operation["RestartStackService"] = "RestartStackService"; + Operation["PauseStackService"] = "PauseStackService"; + Operation["UnpauseStackService"] = "UnpauseStackService"; + Operation["StopStackService"] = "StopStackService"; + Operation["CreateDeployment"] = "CreateDeployment"; + Operation["UpdateDeployment"] = "UpdateDeployment"; + Operation["DeleteDeployment"] = "DeleteDeployment"; + Operation["Deploy"] = "Deploy"; + Operation["StartDeployment"] = "StartDeployment"; + Operation["RestartDeployment"] = "RestartDeployment"; + Operation["PauseDeployment"] = "PauseDeployment"; + Operation["UnpauseDeployment"] = "UnpauseDeployment"; + Operation["StopDeployment"] = "StopDeployment"; + Operation["DestroyDeployment"] = "DestroyDeployment"; + Operation["RenameDeployment"] = "RenameDeployment"; + Operation["CreateBuild"] = "CreateBuild"; + Operation["UpdateBuild"] = "UpdateBuild"; + Operation["DeleteBuild"] = "DeleteBuild"; + Operation["RunBuild"] = "RunBuild"; + Operation["CancelBuild"] = "CancelBuild"; + Operation["CreateRepo"] = "CreateRepo"; + Operation["UpdateRepo"] = "UpdateRepo"; + Operation["DeleteRepo"] = "DeleteRepo"; + Operation["CloneRepo"] = "CloneRepo"; + Operation["PullRepo"] = "PullRepo"; + Operation["BuildRepo"] = "BuildRepo"; + Operation["CancelRepoBuild"] = "CancelRepoBuild"; + Operation["CreateProcedure"] = "CreateProcedure"; + Operation["UpdateProcedure"] = "UpdateProcedure"; + Operation["DeleteProcedure"] = "DeleteProcedure"; + Operation["RunProcedure"] = "RunProcedure"; + Operation["CreateAction"] = "CreateAction"; + Operation["UpdateAction"] = "UpdateAction"; + Operation["DeleteAction"] = "DeleteAction"; + Operation["RunAction"] = "RunAction"; + Operation["CreateBuilder"] = "CreateBuilder"; + Operation["UpdateBuilder"] = "UpdateBuilder"; + Operation["DeleteBuilder"] = "DeleteBuilder"; + Operation["CreateAlerter"] = "CreateAlerter"; + Operation["UpdateAlerter"] = "UpdateAlerter"; + Operation["DeleteAlerter"] = "DeleteAlerter"; + Operation["CreateServerTemplate"] = "CreateServerTemplate"; + Operation["UpdateServerTemplate"] = "UpdateServerTemplate"; + Operation["DeleteServerTemplate"] = "DeleteServerTemplate"; + Operation["LaunchServer"] = "LaunchServer"; + Operation["CreateResourceSync"] = "CreateResourceSync"; + Operation["UpdateResourceSync"] = "UpdateResourceSync"; + Operation["DeleteResourceSync"] = "DeleteResourceSync"; + Operation["WriteSyncContents"] = "WriteSyncContents"; + Operation["CommitSync"] = "CommitSync"; + Operation["RunSync"] = "RunSync"; + Operation["CreateVariable"] = "CreateVariable"; + Operation["UpdateVariableValue"] = "UpdateVariableValue"; + Operation["DeleteVariable"] = "DeleteVariable"; + Operation["CreateGitProviderAccount"] = "CreateGitProviderAccount"; + Operation["UpdateGitProviderAccount"] = "UpdateGitProviderAccount"; + Operation["DeleteGitProviderAccount"] = "DeleteGitProviderAccount"; + Operation["CreateDockerRegistryAccount"] = "CreateDockerRegistryAccount"; + Operation["UpdateDockerRegistryAccount"] = "UpdateDockerRegistryAccount"; + Operation["DeleteDockerRegistryAccount"] = "DeleteDockerRegistryAccount"; +})(Operation || (Operation = {})); +/** An update's status */ +export var UpdateStatus; +(function (UpdateStatus) { + /** The run is in the system but hasn't started yet */ + UpdateStatus["Queued"] = "Queued"; + /** The run is currently running */ + UpdateStatus["InProgress"] = "InProgress"; + /** The run is complete */ + UpdateStatus["Complete"] = "Complete"; +})(UpdateStatus || (UpdateStatus = {})); +export var ContainerStateStatusEnum; +(function (ContainerStateStatusEnum) { + ContainerStateStatusEnum["Empty"] = ""; + ContainerStateStatusEnum["Created"] = "created"; + ContainerStateStatusEnum["Running"] = "running"; + ContainerStateStatusEnum["Paused"] = "paused"; + ContainerStateStatusEnum["Restarting"] = "restarting"; + ContainerStateStatusEnum["Removing"] = "removing"; + ContainerStateStatusEnum["Exited"] = "exited"; + ContainerStateStatusEnum["Dead"] = "dead"; +})(ContainerStateStatusEnum || (ContainerStateStatusEnum = {})); +export var HealthStatusEnum; +(function (HealthStatusEnum) { + HealthStatusEnum["Empty"] = ""; + HealthStatusEnum["None"] = "none"; + HealthStatusEnum["Starting"] = "starting"; + HealthStatusEnum["Healthy"] = "healthy"; + HealthStatusEnum["Unhealthy"] = "unhealthy"; +})(HealthStatusEnum || (HealthStatusEnum = {})); +export var RestartPolicyNameEnum; +(function (RestartPolicyNameEnum) { + RestartPolicyNameEnum["Empty"] = ""; + RestartPolicyNameEnum["No"] = "no"; + RestartPolicyNameEnum["Always"] = "always"; + RestartPolicyNameEnum["UnlessStopped"] = "unless-stopped"; + RestartPolicyNameEnum["OnFailure"] = "on-failure"; +})(RestartPolicyNameEnum || (RestartPolicyNameEnum = {})); +export var MountTypeEnum; +(function (MountTypeEnum) { + MountTypeEnum["Empty"] = ""; + MountTypeEnum["Bind"] = "bind"; + MountTypeEnum["Volume"] = "volume"; + MountTypeEnum["Tmpfs"] = "tmpfs"; + MountTypeEnum["Npipe"] = "npipe"; + MountTypeEnum["Cluster"] = "cluster"; +})(MountTypeEnum || (MountTypeEnum = {})); +export var MountBindOptionsPropagationEnum; +(function (MountBindOptionsPropagationEnum) { + MountBindOptionsPropagationEnum["Empty"] = ""; + MountBindOptionsPropagationEnum["Private"] = "private"; + MountBindOptionsPropagationEnum["Rprivate"] = "rprivate"; + MountBindOptionsPropagationEnum["Shared"] = "shared"; + MountBindOptionsPropagationEnum["Rshared"] = "rshared"; + MountBindOptionsPropagationEnum["Slave"] = "slave"; + MountBindOptionsPropagationEnum["Rslave"] = "rslave"; +})(MountBindOptionsPropagationEnum || (MountBindOptionsPropagationEnum = {})); +export var HostConfigCgroupnsModeEnum; +(function (HostConfigCgroupnsModeEnum) { + HostConfigCgroupnsModeEnum["Empty"] = ""; + HostConfigCgroupnsModeEnum["Private"] = "private"; + HostConfigCgroupnsModeEnum["Host"] = "host"; +})(HostConfigCgroupnsModeEnum || (HostConfigCgroupnsModeEnum = {})); +export var HostConfigIsolationEnum; +(function (HostConfigIsolationEnum) { + HostConfigIsolationEnum["Empty"] = ""; + HostConfigIsolationEnum["Default"] = "default"; + HostConfigIsolationEnum["Process"] = "process"; + HostConfigIsolationEnum["Hyperv"] = "hyperv"; +})(HostConfigIsolationEnum || (HostConfigIsolationEnum = {})); +export var VolumeScopeEnum; +(function (VolumeScopeEnum) { + VolumeScopeEnum["Empty"] = ""; + VolumeScopeEnum["Local"] = "local"; + VolumeScopeEnum["Global"] = "global"; +})(VolumeScopeEnum || (VolumeScopeEnum = {})); +export var ClusterVolumeSpecAccessModeScopeEnum; +(function (ClusterVolumeSpecAccessModeScopeEnum) { + ClusterVolumeSpecAccessModeScopeEnum["Empty"] = ""; + ClusterVolumeSpecAccessModeScopeEnum["Single"] = "single"; + ClusterVolumeSpecAccessModeScopeEnum["Multi"] = "multi"; +})(ClusterVolumeSpecAccessModeScopeEnum || (ClusterVolumeSpecAccessModeScopeEnum = {})); +export var ClusterVolumeSpecAccessModeSharingEnum; +(function (ClusterVolumeSpecAccessModeSharingEnum) { + ClusterVolumeSpecAccessModeSharingEnum["Empty"] = ""; + ClusterVolumeSpecAccessModeSharingEnum["None"] = "none"; + ClusterVolumeSpecAccessModeSharingEnum["Readonly"] = "readonly"; + ClusterVolumeSpecAccessModeSharingEnum["Onewriter"] = "onewriter"; + ClusterVolumeSpecAccessModeSharingEnum["All"] = "all"; +})(ClusterVolumeSpecAccessModeSharingEnum || (ClusterVolumeSpecAccessModeSharingEnum = {})); +export var ClusterVolumeSpecAccessModeAvailabilityEnum; +(function (ClusterVolumeSpecAccessModeAvailabilityEnum) { + ClusterVolumeSpecAccessModeAvailabilityEnum["Empty"] = ""; + ClusterVolumeSpecAccessModeAvailabilityEnum["Active"] = "active"; + ClusterVolumeSpecAccessModeAvailabilityEnum["Pause"] = "pause"; + ClusterVolumeSpecAccessModeAvailabilityEnum["Drain"] = "drain"; +})(ClusterVolumeSpecAccessModeAvailabilityEnum || (ClusterVolumeSpecAccessModeAvailabilityEnum = {})); +export var ClusterVolumePublishStatusStateEnum; +(function (ClusterVolumePublishStatusStateEnum) { + ClusterVolumePublishStatusStateEnum["Empty"] = ""; + ClusterVolumePublishStatusStateEnum["PendingPublish"] = "pending-publish"; + ClusterVolumePublishStatusStateEnum["Published"] = "published"; + ClusterVolumePublishStatusStateEnum["PendingNodeUnpublish"] = "pending-node-unpublish"; + ClusterVolumePublishStatusStateEnum["PendingControllerUnpublish"] = "pending-controller-unpublish"; +})(ClusterVolumePublishStatusStateEnum || (ClusterVolumePublishStatusStateEnum = {})); +export var ProcedureState; +(function (ProcedureState) { + /** Last run successful */ + ProcedureState["Ok"] = "Ok"; + /** Last run failed */ + ProcedureState["Failed"] = "Failed"; + /** Currently running */ + ProcedureState["Running"] = "Running"; + /** Other case (never run) */ + ProcedureState["Unknown"] = "Unknown"; +})(ProcedureState || (ProcedureState = {})); +export var RepoState; +(function (RepoState) { + /** Unknown case */ + RepoState["Unknown"] = "Unknown"; + /** Last clone / pull successful (or never cloned) */ + RepoState["Ok"] = "Ok"; + /** Last clone / pull failed */ + RepoState["Failed"] = "Failed"; + /** Currently cloning */ + RepoState["Cloning"] = "Cloning"; + /** Currently pulling */ + RepoState["Pulling"] = "Pulling"; + /** Currently building */ + RepoState["Building"] = "Building"; +})(RepoState || (RepoState = {})); +export var ResourceSyncState; +(function (ResourceSyncState) { + /** Last sync successful (or never synced). No Changes pending */ + ResourceSyncState["Ok"] = "Ok"; + /** Last sync failed */ + ResourceSyncState["Failed"] = "Failed"; + /** Currently syncing */ + ResourceSyncState["Syncing"] = "Syncing"; + /** Updates pending */ + ResourceSyncState["Pending"] = "Pending"; + /** Other case */ + ResourceSyncState["Unknown"] = "Unknown"; +})(ResourceSyncState || (ResourceSyncState = {})); +export var ServerState; +(function (ServerState) { + /** Server is unreachable. */ + ServerState["NotOk"] = "NotOk"; + /** Server health check passing. */ + ServerState["Ok"] = "Ok"; + /** Server is disabled. */ + ServerState["Disabled"] = "Disabled"; +})(ServerState || (ServerState = {})); +export var StackState; +(function (StackState) { + /** All containers are running. */ + StackState["Running"] = "running"; + /** All containers are paused */ + StackState["Paused"] = "paused"; + /** All contianers are stopped */ + StackState["Stopped"] = "stopped"; + /** All containers are created */ + StackState["Created"] = "created"; + /** All containers are restarting */ + StackState["Restarting"] = "restarting"; + /** All containers are dead */ + StackState["Dead"] = "dead"; + /** All containers are removing */ + StackState["Removing"] = "removing"; + /** The containers are in a mix of states */ + StackState["Unhealthy"] = "unhealthy"; + /** The stack is not deployed */ + StackState["Down"] = "down"; + /** Server not reachable */ + StackState["Unknown"] = "unknown"; +})(StackState || (StackState = {})); +export var AwsVolumeType; +(function (AwsVolumeType) { + AwsVolumeType["Gp2"] = "gp2"; + AwsVolumeType["Gp3"] = "gp3"; + AwsVolumeType["Io1"] = "io1"; + AwsVolumeType["Io2"] = "io2"; +})(AwsVolumeType || (AwsVolumeType = {})); +export var RepoWebhookAction; +(function (RepoWebhookAction) { + RepoWebhookAction["Clone"] = "Clone"; + RepoWebhookAction["Pull"] = "Pull"; + RepoWebhookAction["Build"] = "Build"; +})(RepoWebhookAction || (RepoWebhookAction = {})); +export var StackWebhookAction; +(function (StackWebhookAction) { + StackWebhookAction["Refresh"] = "Refresh"; + StackWebhookAction["Deploy"] = "Deploy"; +})(StackWebhookAction || (StackWebhookAction = {})); +export var SyncWebhookAction; +(function (SyncWebhookAction) { + SyncWebhookAction["Refresh"] = "Refresh"; + SyncWebhookAction["Sync"] = "Sync"; +})(SyncWebhookAction || (SyncWebhookAction = {})); +export var HetznerDatacenter; +(function (HetznerDatacenter) { + HetznerDatacenter["Nuremberg1Dc3"] = "Nuremberg1Dc3"; + HetznerDatacenter["Helsinki1Dc2"] = "Helsinki1Dc2"; + HetznerDatacenter["Falkenstein1Dc14"] = "Falkenstein1Dc14"; + HetznerDatacenter["AshburnDc1"] = "AshburnDc1"; + HetznerDatacenter["HillsboroDc1"] = "HillsboroDc1"; + HetznerDatacenter["SingaporeDc1"] = "SingaporeDc1"; +})(HetznerDatacenter || (HetznerDatacenter = {})); +export var HetznerServerType; +(function (HetznerServerType) { + /** CPX11 - AMD 2 Cores, 2 Gb Ram, 40 Gb disk */ + HetznerServerType["SharedAmd2Core2Ram40Disk"] = "SharedAmd2Core2Ram40Disk"; + /** CAX11 - Arm 2 Cores, 4 Gb Ram, 40 Gb disk */ + HetznerServerType["SharedArm2Core4Ram40Disk"] = "SharedArm2Core4Ram40Disk"; + /** CX22 - Intel 2 Cores, 4 Gb Ram, 40 Gb disk */ + HetznerServerType["SharedIntel2Core4Ram40Disk"] = "SharedIntel2Core4Ram40Disk"; + /** CPX21 - AMD 3 Cores, 4 Gb Ram, 80 Gb disk */ + HetznerServerType["SharedAmd3Core4Ram80Disk"] = "SharedAmd3Core4Ram80Disk"; + /** CAX21 - Arm 4 Cores, 8 Gb Ram, 80 Gb disk */ + HetznerServerType["SharedArm4Core8Ram80Disk"] = "SharedArm4Core8Ram80Disk"; + /** CX32 - Intel 4 Cores, 8 Gb Ram, 80 Gb disk */ + HetznerServerType["SharedIntel4Core8Ram80Disk"] = "SharedIntel4Core8Ram80Disk"; + /** CPX31 - AMD 4 Cores, 8 Gb Ram, 160 Gb disk */ + HetznerServerType["SharedAmd4Core8Ram160Disk"] = "SharedAmd4Core8Ram160Disk"; + /** CAX31 - Arm 8 Cores, 16 Gb Ram, 160 Gb disk */ + HetznerServerType["SharedArm8Core16Ram160Disk"] = "SharedArm8Core16Ram160Disk"; + /** CX42 - Intel 8 Cores, 16 Gb Ram, 160 Gb disk */ + HetznerServerType["SharedIntel8Core16Ram160Disk"] = "SharedIntel8Core16Ram160Disk"; + /** CPX41 - AMD 8 Cores, 16 Gb Ram, 240 Gb disk */ + HetznerServerType["SharedAmd8Core16Ram240Disk"] = "SharedAmd8Core16Ram240Disk"; + /** CAX41 - Arm 16 Cores, 32 Gb Ram, 320 Gb disk */ + HetznerServerType["SharedArm16Core32Ram320Disk"] = "SharedArm16Core32Ram320Disk"; + /** CX52 - Intel 16 Cores, 32 Gb Ram, 320 Gb disk */ + HetznerServerType["SharedIntel16Core32Ram320Disk"] = "SharedIntel16Core32Ram320Disk"; + /** CPX51 - AMD 16 Cores, 32 Gb Ram, 360 Gb disk */ + HetznerServerType["SharedAmd16Core32Ram360Disk"] = "SharedAmd16Core32Ram360Disk"; + /** CCX13 - AMD 2 Cores, 8 Gb Ram, 80 Gb disk */ + HetznerServerType["DedicatedAmd2Core8Ram80Disk"] = "DedicatedAmd2Core8Ram80Disk"; + /** CCX23 - AMD 4 Cores, 16 Gb Ram, 160 Gb disk */ + HetznerServerType["DedicatedAmd4Core16Ram160Disk"] = "DedicatedAmd4Core16Ram160Disk"; + /** CCX33 - AMD 8 Cores, 32 Gb Ram, 240 Gb disk */ + HetznerServerType["DedicatedAmd8Core32Ram240Disk"] = "DedicatedAmd8Core32Ram240Disk"; + /** CCX43 - AMD 16 Cores, 64 Gb Ram, 360 Gb disk */ + HetznerServerType["DedicatedAmd16Core64Ram360Disk"] = "DedicatedAmd16Core64Ram360Disk"; + /** CCX53 - AMD 32 Cores, 128 Gb Ram, 600 Gb disk */ + HetznerServerType["DedicatedAmd32Core128Ram600Disk"] = "DedicatedAmd32Core128Ram600Disk"; + /** CCX63 - AMD 48 Cores, 192 Gb Ram, 960 Gb disk */ + HetznerServerType["DedicatedAmd48Core192Ram960Disk"] = "DedicatedAmd48Core192Ram960Disk"; +})(HetznerServerType || (HetznerServerType = {})); +export var HetznerVolumeFormat; +(function (HetznerVolumeFormat) { + HetznerVolumeFormat["Xfs"] = "Xfs"; + HetznerVolumeFormat["Ext4"] = "Ext4"; +})(HetznerVolumeFormat || (HetznerVolumeFormat = {})); +export var PortTypeEnum; +(function (PortTypeEnum) { + PortTypeEnum["EMPTY"] = ""; + PortTypeEnum["TCP"] = "tcp"; + PortTypeEnum["UDP"] = "udp"; + PortTypeEnum["SCTP"] = "sctp"; +})(PortTypeEnum || (PortTypeEnum = {})); +export var SearchCombinator; +(function (SearchCombinator) { + SearchCombinator["Or"] = "Or"; + SearchCombinator["And"] = "And"; +})(SearchCombinator || (SearchCombinator = {})); diff --git a/frontend/public/index.d.ts b/frontend/public/index.d.ts new file mode 100644 index 000000000..5e1aff6d8 --- /dev/null +++ b/frontend/public/index.d.ts @@ -0,0 +1,8 @@ +import { KomodoClient, Types as KomodoTypes } from "./client/lib.js"; + +declare global { + var komodo: ReturnType; + export import Types = KomodoTypes; +} + +export {} \ No newline at end of file diff --git a/frontend/src/components/alert/index.tsx b/frontend/src/components/alert/index.tsx index 229356842..f475fd4b1 100644 --- a/frontend/src/components/alert/index.tsx +++ b/frontend/src/components/alert/index.tsx @@ -1,17 +1,14 @@ import { Section } from "@components/layouts"; import { alert_level_intention } from "@lib/color"; -import { useRead, atomWithStorage } from "@lib/hooks"; +import { useRead, useLocalStorage } from "@lib/hooks"; import { Types } from "komodo_client"; import { Button } from "@ui/button"; -import { useAtom } from "jotai"; import { AlertTriangle } from "lucide-react"; import { AlertsTable } from "./table"; import { StatusBadge } from "@components/util"; -const openAtom = atomWithStorage("show-alerts-v0", true); - export const OpenAlerts = () => { - const [open, setOpen] = useAtom(openAtom); + const [open, setOpen] = useLocalStorage("open-alerts-v0", true); const alerts = useRead("ListAlerts", { query: { resolved: false } }).data ?.alerts; if (!alerts || alerts.length === 0) return null; diff --git a/frontend/src/components/config/index.tsx b/frontend/src/components/config/index.tsx index c9de4320d..75b044109 100644 --- a/frontend/src/components/config/index.tsx +++ b/frontend/src/components/config/index.tsx @@ -22,7 +22,7 @@ const keys = >(obj: T) => Object.keys(obj) as Array; export const ConfigLayout = < - T extends Types.Resource["config"] + T extends Types.Resource["config"], >({ original, config, @@ -148,13 +148,13 @@ export const Config = ({ // ); // const show = (components[_show] && _show) || component_keys[0]; - // let activeCount = 0; - // for (const key in components) { - // if (components[key] && components[key].length) { - // activeCount++; - // } - // } - // const showSidebar = activeCount > 1; + let activeCount = 0; + for (const key in components) { + if (components[key] && components[key].length) { + activeCount++; + } + } + const showSidebar = activeCount > 1; const sections = keys(components).filter((section) => !!components[section]); @@ -173,39 +173,41 @@ export const Config = ({ file_contents_language={file_contents_language} > - + )}
{sections.map( (section) => @@ -255,48 +257,50 @@ export const Config = ({ hidden, contentHidden, components, - }) => - !hidden && ( -
- {!labelHidden && ( -
-
-
- {icon} -
- {label} -
- {labelExtra} + }) => ( + + )} + {!contentHidden && ( + set((p) => ({ ...p, ...u }))} + components={components} + disabled={disabled} + /> + )} +
+ ) )}
@@ -309,7 +313,7 @@ export const Config = ({ }; export const ConfigAgain = < - T extends Types.Resource["config"] + T extends Types.Resource["config"], >({ config, update, @@ -384,9 +388,11 @@ export const ConfigAgain = < /> ); default: - return
{args?.label ?? key.toString()}
; + return ( +
{args?.label ?? key.toString()}
+ ); } - } else if (component === false) { + } else { return ; } })} diff --git a/frontend/src/components/config/util.tsx b/frontend/src/components/config/util.tsx index 7d904a5e2..854e5e7ec 100644 --- a/frontend/src/components/config/util.tsx +++ b/frontend/src/components/config/util.tsx @@ -18,6 +18,7 @@ import { Save, Search, SearchX, + SquareArrowOutUpRight, } from "lucide-react"; import { ReactNode, useState } from "react"; import { cn, env_to_text, filterBySplit } from "@lib/utils"; @@ -51,6 +52,8 @@ import { MonacoEditor, MonacoLanguage, } from "@components/monaco"; +import { useSettingsView } from "@pages/settings"; +import { useNavigate } from "react-router-dom"; export const ConfigItem = ({ label, @@ -1023,6 +1026,8 @@ export const SecretSelector = ({ align?: "start" | "center" | "end"; side?: "bottom" | "right"; }) => { + const nav = useNavigate(); + const [_, setSettingsView] = useSettingsView(); const [open, setOpen] = useState(false); const [search, setSearch] = useState(""); const filtered = filterBySplit(keys, search, (item) => item).sort((a, b) => { @@ -1073,6 +1078,17 @@ export const SecretSelector = ({
{key}
))} + { + setOpen(false); + setSettingsView("Variables"); + nav("/settings"); + }} + className="flex items-center justify-between cursor-pointer" + > +
All
+ +
diff --git a/frontend/src/components/monaco.tsx b/frontend/src/components/monaco.tsx index d30252081..a60f6602f 100644 --- a/frontend/src/components/monaco.tsx +++ b/frontend/src/components/monaco.tsx @@ -1,8 +1,12 @@ import { useEffect, useState } from "react"; -import monaco from "monaco-editor"; import { DiffEditor, Editor } from "@monaco-editor/react"; import { useTheme } from "@ui/theme"; import { cn } from "@lib/utils"; +import * as monaco from "monaco-editor"; +import * as prettier from "prettier/standalone"; +import * as pluginTypescript from "prettier/plugins/typescript"; +import * as pluginEstree from "prettier/plugins/estree"; +import * as pluginYaml from "prettier/plugins/yaml"; const MIN_EDITOR_HEIGHT = 56; // const MAX_EDITOR_HEIGHT = 500; @@ -15,6 +19,8 @@ export type MonacoLanguage = | "shell" | "dockerfile" | "rust" + | "javascript" + | "typescript" | undefined; export const MonacoEditor = ({ @@ -47,6 +53,41 @@ export const MonacoEditor = ({ return () => node.removeEventListener("keydown", callback); }, [editor]); + useEffect(() => { + if ( + language !== "typescript" && + language !== "javascript" && + language !== "yaml" + ) + return; + if (!editor) return; + editor.addCommand( + monaco.KeyMod.Alt | monaco.KeyMod.Shift | monaco.KeyCode.KeyF, + async () => { + if (!editor) return; + const model = editor.getModel(); + if (!model) return; + const position = editor.getPosition(); + let beforeOffset = (position && model.getOffsetAt(position)) ?? 0; + const curr = editor.getValue(); + const { formatted, cursorOffset } = await prettier.formatWithCursor( + curr, + { + cursorOffset: beforeOffset, + parser: language === "yaml" ? "yaml" : "typescript", + plugins: + language === "yaml" + ? [pluginYaml] + : [pluginTypescript, pluginEstree], + printWidth: 80, // Set the desired max line length + } + ); + editor.setValue(formatted); + editor.setPosition(model.getPositionAt(cursorOffset)); + } + ); + }, [editor]); + const line_count = value?.split(/\r\n|\r|\n/).length ?? 0; useEffect(() => { @@ -83,6 +124,7 @@ export const MonacoEditor = ({ readOnly, tabSize: 2, detectIndentation: true, + quickSuggestions: true, padding: { top: 15, }, diff --git a/frontend/src/components/resources/action/config.tsx b/frontend/src/components/resources/action/config.tsx new file mode 100644 index 000000000..90e0d9e95 --- /dev/null +++ b/frontend/src/components/resources/action/config.tsx @@ -0,0 +1,92 @@ +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; +import { Types } from "komodo_client"; +import { Config } from "@components/config"; +import { MonacoEditor } from "@components/monaco"; +import { SecretsSearch } from "@components/config/env_vars"; +import { Button } from "@ui/button"; +import { ReactNode } from "react"; + +export const ActionConfig = ({ id, titleOther }: { id: string; titleOther: ReactNode }) => { + const perms = useRead("GetPermissionLevel", { + target: { type: "Action", id }, + }).data; + const config = useRead("GetAction", { action: id }).data?.config; + const global_disabled = + useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; + const [update, set] = useLocalStorage>( + `action-${id}-update-v1`, + {} + ); + const { mutateAsync } = useWrite("UpdateAction"); + + if (!config) return null; + + const disabled = global_disabled || perms !== Types.PermissionLevel.Write; + + return ( + { + await mutateAsync({ id, config: update }); + }} + components={{ + "": [ + { + label: "Action File", + description: "Manage the action file contents here.", + // actions: ( + // setShow({ ...show, file })} + // /> + // ), + // contentHidden: !show.file, + components: { + file_contents: (file_contents, set) => { + return ( +
+
+ +
+
+ Docs: +
+ {["read", "execute", "write"].map((api) => ( + + + + ))} +
+
+ set({ file_contents })} + language="typescript" + readOnly={disabled} + /> +
+ ); + }, + }, + }, + ], + }} + /> + ); +}; diff --git a/frontend/src/components/resources/action/index.tsx b/frontend/src/components/resources/action/index.tsx new file mode 100644 index 000000000..2f1e3d4fa --- /dev/null +++ b/frontend/src/components/resources/action/index.tsx @@ -0,0 +1,151 @@ +import { + ActionWithDialog, + ResourcePageHeader, + StatusBadge, +} from "@components/util"; +import { useExecute, useLocalStorage, useRead } from "@lib/hooks"; +import { RequiredResourceComponents } from "@types"; +import { Clapperboard } from "lucide-react"; +import { ActionConfig } from "./config"; +import { ActionTable } from "./table"; +import { DeleteResource, NewResource } from "../common"; +import { + action_state_intention, + stroke_color_class_by_intention, +} from "@lib/color"; +import { cn } from "@lib/utils"; +import { Types } from "komodo_client"; +import { DashboardPieChart } from "@pages/home/dashboard"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@ui/tabs"; +import { ActionInfo } from "./info"; + +const useAction = (id?: string) => + useRead("ListActions", {}).data?.find((d) => d.id === id); + +const ActionIcon = ({ id, size }: { id?: string; size: number }) => { + const state = useAction(id)?.info.state; + const color = stroke_color_class_by_intention(action_state_intention(state)); + return ; +}; + +const ConfigInfo = ({ id }: { id: string }) => { + const [view, setView] = useLocalStorage<"Config" | "Info">( + "action-tabs-v1", + "Config" + ); + + const title = ( + + + Config + + + Info + + + ); + return ( + + + + + + + + + ); +}; + +export const ActionComponents: RequiredResourceComponents = { + list_item: (id) => useAction(id), + resource_links: () => undefined, + + Description: () => <>Custom scripts using the Komodo client., + + Dashboard: () => { + const summary = useRead("GetActionsSummary", {}).data; + return ( + + ); + }, + + New: () => , + + Table: ({ resources }) => ( + + ), + + Icon: ({ id }) => , + BigIcon: ({ id }) => , + + State: ({ id }) => { + let state = useAction(id)?.info.state; + return ; + }, + + Status: {}, + + Info: {}, + + Actions: { + RunAction: ({ id }) => { + const running = useRead( + "GetActionActionState", + { action: id }, + { refetchInterval: 5000 } + ).data?.running; + const { mutate, isPending } = useExecute("RunAction"); + const action = useAction(id); + if (!action) return null; + return ( + } + onClick={() => mutate({ action: id })} + disabled={running || isPending} + loading={running} + /> + ); + }, + }, + + Page: {}, + + Config: ConfigInfo, + + DangerZone: ({ id }) => , + + ResourcePageHeader: ({ id }) => { + const action = useAction(id); + + return ( + } + name={action?.name} + state={action?.info.state} + status={undefined} + /> + ); + }, +}; diff --git a/frontend/src/components/resources/action/info.tsx b/frontend/src/components/resources/action/info.tsx new file mode 100644 index 000000000..a13db39e8 --- /dev/null +++ b/frontend/src/components/resources/action/info.tsx @@ -0,0 +1,87 @@ +import { Section } from "@components/layouts"; +import { ReactNode } from "react"; +import { Card, CardContent, CardHeader } from "@ui/card"; +import { cn, getUpdateQuery, updateLogToHtml } from "@lib/utils"; +import { useRead } from "@lib/hooks"; +import { text_color_class_by_intention } from "@lib/color"; + +export const ActionInfo = ({ + id, + titleOther, +}: { + id: string; + titleOther: ReactNode; +}) => { + const update = useRead("ListUpdates", { + query: { + ...getUpdateQuery({ type: "Action", id }, undefined), + operation: "RunAction", + }, + }).data?.updates[0]; + + const full_update = useRead( + "GetUpdate", + { id: update?.id! }, + { enabled: !!update?.id } + ).data; + + const log = full_update?.logs.find((log) => log.stage === "Execute Action"); + + return ( +
+ {!log?.stdout && !log?.stderr && ( + + + Never run + + + )} + {/* Last run */} + {log?.stdout && ( + + + Stdout + + +
+          
+        
+      )}
+      {log?.stderr && (
+        
+          
+            Stderr
+          
+          
+            
+          
+        
+      )}
+    
+ ); +}; diff --git a/frontend/src/components/resources/action/table.tsx b/frontend/src/components/resources/action/table.tsx new file mode 100644 index 000000000..f36a4daba --- /dev/null +++ b/frontend/src/components/resources/action/table.tsx @@ -0,0 +1,40 @@ +import { DataTable, SortableHeader } from "@ui/data-table"; +import { TableTags } from "@components/tags"; +import { ResourceLink } from "../common"; +import { ActionComponents } from "."; +import { Types } from "komodo_client"; + +export const ActionTable = ({ + actions, +}: { + actions: Types.ActionListItem[]; +}) => { + return ( + ( + + ), + cell: ({ row }) => ( + + ), + }, + { + accessorKey: "info.state", + header: ({ column }) => ( + + ), + cell: ({ row }) => , + }, + { + header: "Tags", + cell: ({ row }) => , + }, + ]} + /> + ); +}; diff --git a/frontend/src/components/resources/alerter/config/index.tsx b/frontend/src/components/resources/alerter/config/index.tsx index 5aa1c7a86..6cb77f588 100644 --- a/frontend/src/components/resources/alerter/config/index.tsx +++ b/frontend/src/components/resources/alerter/config/index.tsx @@ -1,7 +1,6 @@ import { Config } from "@components/config"; -import { useRead, useWrite } from "@lib/hooks"; +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; -import { useState } from "react"; import { EndpointConfig } from "./endpoint"; import { AlertTypeConfig } from "./alert_types"; import { ResourcesConfig } from "./resources"; @@ -14,7 +13,10 @@ export const AlerterConfig = ({ id }: { id: string }) => { const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; const { mutateAsync } = useWrite("UpdateAlerter"); - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `alerter-${id}-update-v1`, + {} + ); if (!config) return null; const disabled = global_disabled || perms !== Types.PermissionLevel.Write; diff --git a/frontend/src/components/resources/build/config.tsx b/frontend/src/components/resources/build/config.tsx index fc05ff6d8..c1a6a640c 100644 --- a/frontend/src/components/resources/build/config.tsx +++ b/frontend/src/components/resources/build/config.tsx @@ -9,11 +9,11 @@ import { ProviderSelectorConfig, SystemCommand, } from "@components/config/util"; -import { useInvalidate, useRead, useWrite } from "@lib/hooks"; +import { useInvalidate, useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; import { Button } from "@ui/button"; import { Ban, CirclePlus, PlusCircle } from "lucide-react"; -import { ReactNode, useState } from "react"; +import { ReactNode } from "react"; import { CopyGithubWebhook, ResourceLink, ResourceSelector } from "../common"; import { useToast } from "@ui/use-toast"; import { text_color_class_by_intention } from "@lib/color"; @@ -36,7 +36,10 @@ export const BuildConfig = ({ const webhook = useRead("GetBuildWebhookEnabled", { build: id }).data; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `build-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateBuild"); if (!config) return null; diff --git a/frontend/src/components/resources/builder/config.tsx b/frontend/src/components/resources/builder/config.tsx index 002baa554..aa5c23f25 100644 --- a/frontend/src/components/resources/builder/config.tsx +++ b/frontend/src/components/resources/builder/config.tsx @@ -1,6 +1,6 @@ import { Config } from "@components/config"; import { ConfigItem, ConfigList } from "@components/config/util"; -import { useRead, useWrite } from "@lib/hooks"; +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; import { useState } from "react"; import { ResourceLink, ResourceSelector } from "../common"; @@ -32,7 +32,10 @@ const AwsBuilderConfig = ({ id }: { id: string }) => { ?.params as Types.AwsBuilderConfig; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `aws-builder-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateBuilder"); if (!config) return null; @@ -243,7 +246,10 @@ const ServerBuilderConfig = ({ id }: { id: string }) => { target: { type: "Builder", id }, }).data; const config = useRead("GetBuilder", { builder: id }).data?.config; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `server-builder-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateBuilder"); if (!config) return null; diff --git a/frontend/src/components/resources/deployment/config/index.tsx b/frontend/src/components/resources/deployment/config/index.tsx index 5b0f6f475..2e9affecd 100644 --- a/frontend/src/components/resources/deployment/config/index.tsx +++ b/frontend/src/components/resources/deployment/config/index.tsx @@ -1,6 +1,6 @@ -import { useRead, useWrite } from "@lib/hooks"; +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; -import { ReactNode, useState } from "react"; +import { ReactNode } from "react"; import { AccountSelectorConfig, AddExtraArgMenu, @@ -36,7 +36,10 @@ export const DeploymentConfig = ({ const builds = useRead("ListBuilds", {}).data; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `deployment-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateDeployment"); if (!config) return null; diff --git a/frontend/src/components/resources/index.tsx b/frontend/src/components/resources/index.tsx index 58ef921e2..67d77e584 100644 --- a/frontend/src/components/resources/index.tsx +++ b/frontend/src/components/resources/index.tsx @@ -9,6 +9,7 @@ import { ProcedureComponents } from "./procedure/index"; import { ServerTemplateComponents } from "./server-template"; import { ResourceSyncComponents } from "./resource-sync"; import { StackComponents } from "./stack"; +import { ActionComponents } from "./action"; export const ResourceComponents: { [key in UsableResource]: RequiredResourceComponents; @@ -19,6 +20,7 @@ export const ResourceComponents: { Build: BuildComponents, Repo: RepoComponents, Procedure: ProcedureComponents, + Action: ActionComponents, ResourceSync: ResourceSyncComponents, Builder: BuilderComponents, Alerter: AlerterComponents, diff --git a/frontend/src/components/resources/procedure/config.tsx b/frontend/src/components/resources/procedure/config.tsx index 0fa3f1307..6e6736c8a 100644 --- a/frontend/src/components/resources/procedure/config.tsx +++ b/frontend/src/components/resources/procedure/config.tsx @@ -1,6 +1,6 @@ import { ConfigItem } from "@components/config/util"; import { Section } from "@components/layouts"; -import { useRead, useWrite } from "@lib/hooks"; +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; import { Card, CardHeader } from "@ui/card"; import { Input } from "@ui/input"; @@ -56,7 +56,10 @@ const ProcedureConfigInner = ({ procedure: Types.Procedure; }) => { const [branch, setBranch] = useState("main"); - const [config, setConfig] = useState>({}); + const [config, setConfig] = useLocalStorage>( + `procedure-${procedure._id?.$oid}-update-v1`, + {} + ); const perms = useRead("GetPermissionLevel", { target: { type: "Procedure", id: procedure._id?.$oid! }, }).data; @@ -612,6 +615,18 @@ const TARGET_COMPONENTS: ExecutionConfigs = { /> ), }, + // Action + RunAction: { + params: { action: "" }, + Component: ({ params, setParams, disabled }) => ( + setParams({ action })} + disabled={disabled} + /> + ), + }, // Build RunBuild: { params: { build: "" }, diff --git a/frontend/src/components/resources/procedure/index.tsx b/frontend/src/components/resources/procedure/index.tsx index e7cfbbd40..287f7570b 100644 --- a/frontend/src/components/resources/procedure/index.tsx +++ b/frontend/src/components/resources/procedure/index.tsx @@ -95,7 +95,7 @@ export const ProcedureComponents: RequiredResourceComponents = { return ( } onClick={() => mutate({ procedure: id })} disabled={running || isPending} diff --git a/frontend/src/components/resources/repo/config.tsx b/frontend/src/components/resources/repo/config.tsx index 58ada9c72..d15c00ddc 100644 --- a/frontend/src/components/resources/repo/config.tsx +++ b/frontend/src/components/resources/repo/config.tsx @@ -6,9 +6,8 @@ import { ProviderSelectorConfig, SystemCommand, } from "@components/config/util"; -import { useInvalidate, useRead, useWrite } from "@lib/hooks"; +import { useInvalidate, useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; -import { useState } from "react"; import { CopyGithubWebhook, ResourceLink, ResourceSelector } from "../common"; import { useToast } from "@ui/use-toast"; import { text_color_class_by_intention } from "@lib/color"; @@ -26,7 +25,10 @@ export const RepoConfig = ({ id }: { id: string }) => { const webhooks = useRead("GetRepoWebhooksEnabled", { repo: id }).data; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `repo-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateRepo"); if (!config) return null; diff --git a/frontend/src/components/resources/resource-sync/config.tsx b/frontend/src/components/resources/resource-sync/config.tsx index 2e78a35a0..af19a713d 100644 --- a/frontend/src/components/resources/resource-sync/config.tsx +++ b/frontend/src/components/resources/resource-sync/config.tsx @@ -65,7 +65,10 @@ export const ResourceSyncConfig = ({ const webhooks = useRead("GetSyncWebhooksEnabled", { sync: id }).data; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `sync-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateResourceSync"); if (!config) return null; diff --git a/frontend/src/components/resources/server-template/config/aws.tsx b/frontend/src/components/resources/server-template/config/aws.tsx index f3c92c2c6..bc43eade9 100644 --- a/frontend/src/components/resources/server-template/config/aws.tsx +++ b/frontend/src/components/resources/server-template/config/aws.tsx @@ -1,6 +1,6 @@ import { Config } from "@components/config"; import { ConfigList } from "@components/config/util"; -import { useRead, useWrite } from "@lib/hooks"; +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { cn } from "@lib/utils"; import { Types } from "komodo_client"; import { Button } from "@ui/button"; @@ -33,7 +33,10 @@ export const AwsServerTemplateConfig = ({ }) => { const config = useRead("GetServerTemplate", { server_template: id }).data ?.config?.params as Types.AwsServerTemplateConfig; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `aws-template-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateServerTemplate"); if (!config) return null; diff --git a/frontend/src/components/resources/server-template/config/hetzner.tsx b/frontend/src/components/resources/server-template/config/hetzner.tsx index 009359485..90adac2b1 100644 --- a/frontend/src/components/resources/server-template/config/hetzner.tsx +++ b/frontend/src/components/resources/server-template/config/hetzner.tsx @@ -1,6 +1,6 @@ import { Config } from "@components/config"; import { ConfigItem, ConfigList } from "@components/config/util"; -import { useRead, useWrite } from "@lib/hooks"; +import { useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { cn, filterBySplit } from "@lib/utils"; import { Types } from "komodo_client"; import { Button } from "@ui/button"; @@ -42,9 +42,9 @@ export const HetznerServerTemplateConfig = ({ }) => { const config = useRead("GetServerTemplate", { server_template: id }).data ?.config?.params as Types.HetznerServerTemplateConfig; - const [update, set] = useState>( - {} - ); + const [update, set] = useLocalStorage< + Partial + >(`hetzner-template-${id}-update-v1`, {}); const { mutateAsync } = useWrite("UpdateServerTemplate"); if (!config) return null; diff --git a/frontend/src/components/resources/server/config.tsx b/frontend/src/components/resources/server/config.tsx index 16a596813..9cc76e905 100644 --- a/frontend/src/components/resources/server/config.tsx +++ b/frontend/src/components/resources/server/config.tsx @@ -1,8 +1,8 @@ import { Config } from "@components/config"; import { ConfigList } from "@components/config/util"; -import { useInvalidate, useRead, useWrite } from "@lib/hooks"; +import { useInvalidate, useLocalStorage, useRead, useWrite } from "@lib/hooks"; import { Types } from "komodo_client"; -import { ReactNode, useState } from "react"; +import { ReactNode } from "react"; export const ServerConfig = ({ id, @@ -18,7 +18,10 @@ export const ServerConfig = ({ const config = useRead("GetServer", { server: id }).data?.config; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `server-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateServer", { onSuccess: () => { // In case of disabling to resolve unreachable alert diff --git a/frontend/src/components/resources/stack/config.tsx b/frontend/src/components/resources/stack/config.tsx index 706f91eaa..da0ffb4c2 100644 --- a/frontend/src/components/resources/stack/config.tsx +++ b/frontend/src/components/resources/stack/config.tsx @@ -10,7 +10,7 @@ import { } from "@components/config/util"; import { Types } from "komodo_client"; import { useInvalidate, useLocalStorage, useRead, useWrite } from "@lib/hooks"; -import { ReactNode, useState } from "react"; +import { ReactNode } from "react"; import { CopyGithubWebhook, ResourceLink, ResourceSelector } from "../common"; import { Select, @@ -59,7 +59,10 @@ export const StackConfig = ({ const webhooks = useRead("GetStackWebhooksEnabled", { stack: id }).data; const global_disabled = useRead("GetCoreInfo", {}).data?.ui_write_disabled ?? false; - const [update, set] = useState>({}); + const [update, set] = useLocalStorage>( + `stack-${id}-update-v1`, + {} + ); const { mutateAsync } = useWrite("UpdateStack"); if (!config) return null; @@ -198,10 +201,22 @@ export const StackConfig = ({ ), env_file_path: { description: - "The path to write the file to, relative to the run directory", + "The path to write the file to, relative to the 'Run Directory'.", placeholder: ".env", }, - // skip_secret_interp: true, + additional_env_files: (values, set) => ( + + ), }, }, { diff --git a/frontend/src/components/topbar.tsx b/frontend/src/components/topbar.tsx index 79740daa2..3b4546ddd 100644 --- a/frontend/src/components/topbar.tsx +++ b/frontend/src/components/topbar.tsx @@ -64,7 +64,7 @@ export const Topbar = () => {
{/* Shortcuts */} -
+
@@ -90,7 +90,7 @@ const Docs = () => ( target="_blank" className="hidden lg:block" > - @@ -106,7 +106,7 @@ const Version = () => { target="_blank" className="hidden lg:block" > - diff --git a/frontend/src/lib/color.ts b/frontend/src/lib/color.ts index 3aaed2199..1026e8d8b 100644 --- a/frontend/src/lib/color.ts +++ b/frontend/src/lib/color.ts @@ -256,6 +256,23 @@ export const procedure_state_intention = (status?: Types.ProcedureState) => { } }; +export const action_state_intention = (status?: Types.ActionState) => { + switch (status) { + case undefined: + return "None"; + case Types.ActionState.Unknown: + return "Unknown"; + case Types.ActionState.Ok: + return "Good"; + case Types.ActionState.Running: + return "Warning"; + case Types.ActionState.Failed: + return "Critical"; + default: + return "None"; + } +}; + export const resource_sync_state_intention = ( status?: Types.ResourceSyncState ) => { diff --git a/frontend/src/lib/hooks.ts b/frontend/src/lib/hooks.ts index 53dd2d179..5622a0d82 100644 --- a/frontend/src/lib/hooks.ts +++ b/frontend/src/lib/hooks.ts @@ -30,14 +30,14 @@ const client = () => Client(KOMODO_BASE_URL, { type: "jwt", params: token() }); export const useLoginOptions = () => useQuery({ queryKey: ["GetLoginOptions"], - queryFn: () => client().auth({ type: "GetLoginOptions", params: {} }), + queryFn: () => client().auth("GetLoginOptions", {}), }); export const useUser = () => { const userInvalidate = useUserInvalidate(); const query = useQuery({ queryKey: ["GetUser"], - queryFn: () => client().auth({ type: "GetUser", params: {} }), + queryFn: () => client().auth("GetUser", {}), refetchInterval: 30_000, }); useEffect(() => { @@ -75,7 +75,7 @@ export const useRead = < ) => useQuery({ queryKey: [type, params], - queryFn: () => client().read({ type, params } as R), + queryFn: () => client().read(type, params), ...config, }); @@ -104,10 +104,10 @@ export const useManageUser = < const { toast } = useToast(); return useMutation({ mutationKey: [type], - mutationFn: (params: P) => client().user({ type, params } as R), - onError: (e: { response: { data: any } }, v, c) => { - console.log("Auth error:", e.response.data); - const msg = e.response.data?.error as string; + mutationFn: (params: P) => client().user(type, params), + onError: (e: { result: { error?: string } }, v, c) => { + console.log("Auth error:", e); + const msg = e.result.error ?? "Unknown error. See console."; let msg_log = msg ? msg + " | " : ""; if (msg_log) { msg_log = msg_log[0].toUpperCase() + msg_log.slice(1); @@ -128,7 +128,7 @@ export const useWrite = < R extends Extract, P extends R["params"], C extends Omit< - UseMutationOptions, + UseMutationOptions, "mutationKey" | "mutationFn" > >( @@ -138,10 +138,10 @@ export const useWrite = < const { toast } = useToast(); return useMutation({ mutationKey: [type], - mutationFn: (params: P) => client().write({ type, params } as R), - onError: (e: { response: { data: any } }, v, c) => { - console.log("Write error:", e.response.data); - const msg = e.response.data?.error; + mutationFn: (params: P) => client().write(type, params), + onError: (e: { result: { error?: string } }, v, c) => { + console.log("Write error:", e); + const msg = e.result.error ?? "Unknown error. See console."; let msg_log = msg ? msg + " - " : ""; if (msg_log) { msg_log = msg_log[0].toUpperCase() + msg_log.slice(1); @@ -172,10 +172,10 @@ export const useExecute = < const { toast } = useToast(); return useMutation({ mutationKey: [type], - mutationFn: (params: P) => client().execute({ type, params } as R), - onError: (e: { response: { data: any } }, v, c) => { - console.log("Execute error:", e.response.data); - const msg = e.response.data?.error; + mutationFn: (params: P) => client().execute(type, params), + onError: (e: { result: { error?: string } }, v, c) => { + console.log("Execute error:", e); + const msg = e.result.error ?? "Unknown error. See console."; let msg_log = msg ? msg + " | " : ""; if (msg_log) { msg_log = msg_log[0].toUpperCase() + msg_log.slice(1); @@ -202,12 +202,28 @@ export const useAuth = < >( type: T, config?: C -) => - useMutation({ +) => { + const { toast } = useToast(); + return useMutation({ mutationKey: [type], - mutationFn: (params: P) => client().auth({ type, params } as R), + mutationFn: (params: P) => client().auth(type, params), + onError: (e: { result: { error?: string } }, v, c) => { + console.log("Auth error:", e); + const msg = e.result.error ?? "Unknown error. See console."; + let msg_log = msg ? msg + " | " : ""; + if (msg_log) { + msg_log = msg_log[0].toUpperCase() + msg_log.slice(1); + } + toast({ + title: `Auth request ${type} failed`, + description: `${msg_log}See console for details`, + variant: "destructive", + }); + config?.onError && config.onError(e, v, c); + }, ...config, }); +}; // ============== UTILITY ============== diff --git a/frontend/src/lib/socket.tsx b/frontend/src/lib/socket.tsx index 749674d28..172283294 100644 --- a/frontend/src/lib/socket.tsx +++ b/frontend/src/lib/socket.tsx @@ -74,6 +74,8 @@ const on_message = ( invalidate(["GetRepoActionState", { repo: update.target.id }]); } else if (update.target.type === "Procedure") { invalidate(["GetProcedureActionState", { procedure: update.target.id }]); + } else if (update.target.type === "Action") { + invalidate(["GetActionActionState", { action: update.target.id }]); } else if (update.target.type === "ResourceSync") { invalidate(["GetResourceSyncActionState", { sync: update.target.id }]); } @@ -91,6 +93,8 @@ const on_message = ( invalidate(["ListRepos"]); } else if (update.operation === Types.Operation.RunProcedure) { invalidate(["ListProcedures"]); + } else if (update.operation === Types.Operation.RunAction) { + invalidate(["ListActions"]); } // Do invalidations of these only if update is completed @@ -185,6 +189,15 @@ const on_message = ( ); } + if (update.target.type === "Action") { + invalidate( + ["ListActions"], + ["ListFullActions"], + ["GetActionsSummary"], + ["GetAction"] + ); + } + if (update.target.type === "Builder") { invalidate( ["ListBuilders"], diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index f736972e5..21ce9fb05 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -20,6 +20,7 @@ export const RESOURCE_TARGETS: UsableResource[] = [ "Build", "Repo", "Procedure", + "Action", "Builder", "Alerter", "ServerTemplate", diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 3779cece7..f9ca3b84b 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -7,7 +7,8 @@ import { WebsocketProvider } from "@lib/socket"; import { Toaster } from "@ui/toaster"; import { atomWithStorage } from "@lib/hooks"; // Run monaco setup -import "./monaco" +import "./monaco"; +import { init_monaco } from "./monaco/init"; export const AUTH_TOKEN_STORAGE_KEY = "komodo-auth-token"; @@ -28,15 +29,17 @@ export const homeViewAtom = atomWithStorage( "Dashboard" ); -ReactDOM.createRoot(document.getElementById("root")!).render( - // - - - - - - - - - // +init_monaco().then(() => + ReactDOM.createRoot(document.getElementById("root")!).render( + // + + + + + + + + + // + ) ); diff --git a/frontend/src/monaco/init.ts b/frontend/src/monaco/init.ts new file mode 100644 index 000000000..be44adb9c --- /dev/null +++ b/frontend/src/monaco/init.ts @@ -0,0 +1,40 @@ +import * as monaco from "monaco-editor"; + +export async function init_monaco() { + const promises = ["lib", "responses", "types"].map((file) => + Promise.all( + [".js", ".d.ts"].map((extension) => + fetch(`/client/${file}${extension}`) + .then((res) => res.text()) + .then((dts) => + monaco.languages.typescript.typescriptDefaults.addExtraLib( + dts, + `file:///client/${file}${extension}` + ) + ) + ) + ) + ); + await Promise.all(promises); + + fetch(`/index.d.ts`) + .then((res) => res.text()) + .then((dts) => + monaco.languages.typescript.typescriptDefaults.addExtraLib( + dts, + `file:///index.d.ts` + ) + ); + + monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ + module: monaco.languages.typescript.ModuleKind.ESNext, + target: monaco.languages.typescript.ScriptTarget.ESNext, + allowNonTsExtensions: true, + moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs, + typeRoots: ["index.d.ts"], + }); + + monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({ + diagnosticCodesToIgnore: [1375], + }); +} diff --git a/frontend/src/pages/home/dashboard.tsx b/frontend/src/pages/home/dashboard.tsx index 0664770fc..500601aa8 100644 --- a/frontend/src/pages/home/dashboard.tsx +++ b/frontend/src/pages/home/dashboard.tsx @@ -51,6 +51,7 @@ export const Dashboard = () => { +
diff --git a/frontend/src/pages/resource.tsx b/frontend/src/pages/resource.tsx index 429245f5e..1ceafe9ce 100644 --- a/frontend/src/pages/resource.tsx +++ b/frontend/src/pages/resource.tsx @@ -20,8 +20,8 @@ import { Button } from "@ui/button"; import { AlertTriangle, ChevronLeft, - Clapperboard, LinkIcon, + Zap, } from "lucide-react"; import { Link, useParams } from "react-router-dom"; import { ResourceNotifications } from "./resource-notifications"; @@ -129,7 +129,7 @@ const ResourceInner = ({ type, id }: { type: UsableResource; id: string }) => {
{canExecute && Object.keys(Components.Actions).length > 0 && ( -
}> +
}>
{Object.entries(Components.Actions).map(([key, Action]) => ( @@ -192,7 +192,7 @@ export const ResourceHeader = ({ {links?.map((link) => ( diff --git a/frontend/src/pages/settings/index.tsx b/frontend/src/pages/settings/index.tsx index a88c041f3..e7b2049dd 100644 --- a/frontend/src/pages/settings/index.tsx +++ b/frontend/src/pages/settings/index.tsx @@ -1,4 +1,4 @@ -import { useLocalStorage, useUser } from "@lib/hooks"; +import { atomWithStorage, useUser } from "@lib/hooks"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@ui/tabs"; import { Variables } from "./variables"; import { Tags } from "./tags"; @@ -7,12 +7,17 @@ import { Profile } from "./profile"; import { Page } from "@components/layouts"; import { ProvidersPage } from "./providers"; import { ExportButton } from "@components/export"; +import { useAtom } from "jotai"; + +type SettingsView = "Variables" | "Tags" | "Providers" | "Users" | "Profile"; + +const viewAtom = atomWithStorage("settings-view-v2", "Variables"); + +export const useSettingsView = () => useAtom(viewAtom); export const Settings = () => { const user = useUser().data; - const [view, setView] = useLocalStorage< - "Variables" | "Tags" | "Providers" | "Users" | "Profile" - >("settings-view-v1", "Variables"); + const [view, setView] = useSettingsView(); const currentView = (view === "Users" || view === "Providers") && !user?.admin ? "Variables" diff --git a/frontend/src/pages/settings/users.tsx b/frontend/src/pages/settings/users.tsx index feedb24f3..e68eba60f 100644 --- a/frontend/src/pages/settings/users.tsx +++ b/frontend/src/pages/settings/users.tsx @@ -68,7 +68,7 @@ const UserGroupsSection = () => { { header: "Name", accessorKey: "name" }, { header: "Members", - accessorFn: (group) => group.users.length, + accessorFn: (group) => (group.users ?? []).length, }, { header: "Delete", diff --git a/frontend/src/pages/user-group.tsx b/frontend/src/pages/user-group.tsx index ebf93ba7e..5d7b315c3 100644 --- a/frontend/src/pages/user-group.tsx +++ b/frontend/src/pages/user-group.tsx @@ -61,12 +61,13 @@ export const UserGroupPage = () => { subtitle={
User Group
| - {group.users.length > 0 && ( + {(group.users ?? []).length > 0 && (
- {group.users.length} User{group.users.length > 1 ? "s" : ""} + {(group.users ?? []).length} User + {(group.users ?? []).length > 1 ? "s" : ""}
)} - {group.users.length === 0 &&
No Users
} + {(group.users ?? []).length === 0 &&
No Users
}
} > @@ -78,7 +79,7 @@ export const UserGroupPage = () => { - group ? group.users.includes(user._id?.$oid!) : false + group ? (group.users ?? []).includes(user._id?.$oid!) : false ) ?? [] } onUserRemove={(user_id) => diff --git a/frontend/src/pages/user.tsx b/frontend/src/pages/user.tsx index 2160a4dc3..87d54d60a 100644 --- a/frontend/src/pages/user.tsx +++ b/frontend/src/pages/user.tsx @@ -148,7 +148,7 @@ const ApiKeysTable = ({ user_id }: { user_id: string }) => { const Groups = ({ user_id }: { user_id: string }) => { const groups = useRead("ListUserGroups", {}).data?.filter((group) => - group.users.includes(user_id) + group.users?.includes(user_id) ); if (!groups || groups.length === 0) { return null; diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 3fbd82680..1ec29405b 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -20,131 +20,131 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" - integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== +"@babel/code-frame@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.7.tgz#438f2c524071531d643c6f0188e1e28f130cebc7" + integrity sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g== dependencies: - "@babel/highlight" "^7.24.7" + "@babel/highlight" "^7.25.7" picocolors "^1.0.0" -"@babel/compat-data@^7.25.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.2.tgz#e41928bd33475305c586f6acbbb7e3ade7a6f7f5" - integrity sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ== +"@babel/compat-data@^7.25.7": + version "7.25.8" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.25.8.tgz#0376e83df5ab0eb0da18885c0140041f0747a402" + integrity sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA== -"@babel/core@^7.24.5": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.2.tgz#ed8eec275118d7613e77a352894cd12ded8eba77" - integrity sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA== +"@babel/core@^7.25.2": + version "7.25.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.25.8.tgz#a57137d2a51bbcffcfaeba43cb4dd33ae3e0e1c6" + integrity sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg== dependencies: "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.25.0" - "@babel/helper-compilation-targets" "^7.25.2" - "@babel/helper-module-transforms" "^7.25.2" - "@babel/helpers" "^7.25.0" - "@babel/parser" "^7.25.0" - "@babel/template" "^7.25.0" - "@babel/traverse" "^7.25.2" - "@babel/types" "^7.25.2" + "@babel/code-frame" "^7.25.7" + "@babel/generator" "^7.25.7" + "@babel/helper-compilation-targets" "^7.25.7" + "@babel/helper-module-transforms" "^7.25.7" + "@babel/helpers" "^7.25.7" + "@babel/parser" "^7.25.8" + "@babel/template" "^7.25.7" + "@babel/traverse" "^7.25.7" + "@babel/types" "^7.25.8" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.25.0": - version "7.25.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.0.tgz#f858ddfa984350bc3d3b7f125073c9af6988f18e" - integrity sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw== +"@babel/generator@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.25.7.tgz#de86acbeb975a3e11ee92dd52223e6b03b479c56" + integrity sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA== dependencies: - "@babel/types" "^7.25.0" + "@babel/types" "^7.25.7" "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.25" - jsesc "^2.5.1" + jsesc "^3.0.2" -"@babel/helper-compilation-targets@^7.25.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz#e1d9410a90974a3a5a66e84ff55ef62e3c02d06c" - integrity sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw== +"@babel/helper-compilation-targets@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz#11260ac3322dda0ef53edfae6e97b961449f5fa4" + integrity sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A== dependencies: - "@babel/compat-data" "^7.25.2" - "@babel/helper-validator-option" "^7.24.8" - browserslist "^4.23.1" + "@babel/compat-data" "^7.25.7" + "@babel/helper-validator-option" "^7.25.7" + browserslist "^4.24.0" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-module-imports@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" - integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== +"@babel/helper-module-imports@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz#dba00d9523539152906ba49263e36d7261040472" + integrity sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw== dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" + "@babel/traverse" "^7.25.7" + "@babel/types" "^7.25.7" -"@babel/helper-module-transforms@^7.25.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz#ee713c29768100f2776edf04d4eb23b8d27a66e6" - integrity sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ== +"@babel/helper-module-transforms@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz#2ac9372c5e001b19bc62f1fe7d96a18cb0901d1a" + integrity sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ== dependencies: - "@babel/helper-module-imports" "^7.24.7" - "@babel/helper-simple-access" "^7.24.7" - "@babel/helper-validator-identifier" "^7.24.7" - "@babel/traverse" "^7.25.2" + "@babel/helper-module-imports" "^7.25.7" + "@babel/helper-simple-access" "^7.25.7" + "@babel/helper-validator-identifier" "^7.25.7" + "@babel/traverse" "^7.25.7" -"@babel/helper-plugin-utils@^7.24.7": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz#94ee67e8ec0e5d44ea7baeb51e571bd26af07878" - integrity sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg== +"@babel/helper-plugin-utils@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz#8ec5b21812d992e1ef88a9b068260537b6f0e36c" + integrity sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw== -"@babel/helper-simple-access@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" - integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== +"@babel/helper-simple-access@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz#5eb9f6a60c5d6b2e0f76057004f8dacbddfae1c0" + integrity sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ== dependencies: - "@babel/traverse" "^7.24.7" - "@babel/types" "^7.24.7" + "@babel/traverse" "^7.25.7" + "@babel/types" "^7.25.7" "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== -"@babel/helper-string-parser@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz#5b3329c9a58803d5df425e5785865881a81ca48d" - integrity sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ== +"@babel/helper-string-parser@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz#d50e8d37b1176207b4fe9acedec386c565a44a54" + integrity sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g== "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/helper-validator-identifier@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" - integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== +"@babel/helper-validator-identifier@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz#77b7f60c40b15c97df735b38a66ba1d7c3e93da5" + integrity sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg== -"@babel/helper-validator-option@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz#3725cdeea8b480e86d34df15304806a06975e33d" - integrity sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q== +"@babel/helper-validator-option@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz#97d1d684448228b30b506d90cace495d6f492729" + integrity sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ== -"@babel/helpers@^7.25.0": - version "7.25.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.0.tgz#e69beb7841cb93a6505531ede34f34e6a073650a" - integrity sha512-MjgLZ42aCm0oGjJj8CtSM3DB8NOOf8h2l7DCTePJs29u+v7yO/RBX9nShlKMgFnRks/Q4tBAe7Hxnov9VkGwLw== +"@babel/helpers@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.25.7.tgz#091b52cb697a171fe0136ab62e54e407211f09c2" + integrity sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA== dependencies: - "@babel/template" "^7.25.0" - "@babel/types" "^7.25.0" + "@babel/template" "^7.25.7" + "@babel/types" "^7.25.7" -"@babel/highlight@^7.24.7": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" - integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== +"@babel/highlight@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.7.tgz#20383b5f442aa606e7b5e3043b0b1aafe9f37de5" + integrity sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw== dependencies: - "@babel/helper-validator-identifier" "^7.24.7" + "@babel/helper-validator-identifier" "^7.25.7" chalk "^2.4.2" js-tokens "^4.0.0" picocolors "^1.0.0" @@ -154,26 +154,26 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== -"@babel/parser@^7.25.0", "@babel/parser@^7.25.3": - version "7.25.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.3.tgz#91fb126768d944966263f0657ab222a642b82065" - integrity sha512-iLTJKDbJ4hMvFPgQwwsVoxtHyWpKKPBrxkANrSYewDPaPpT5py5yeVkgPIJ7XYXhndxJpaA3PyALSXQ7u8e/Dw== +"@babel/parser@^7.25.7", "@babel/parser@^7.25.8": + version "7.25.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.25.8.tgz#f6aaf38e80c36129460c1657c0762db584c9d5e2" + integrity sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ== dependencies: - "@babel/types" "^7.25.2" + "@babel/types" "^7.25.8" -"@babel/plugin-transform-react-jsx-self@^7.24.5": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.24.7.tgz#66bff0248ea0b549972e733516ffad577477bdab" - integrity sha512-fOPQYbGSgH0HUp4UJO4sMBFjY6DuWq+2i8rixyUMb3CdGixs/gccURvYOAhajBdKDoGajFr3mUq5rH3phtkGzw== +"@babel/plugin-transform-react-jsx-self@^7.24.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.25.7.tgz#3d11df143131fd8f5486a1f7d3839890f88f8c85" + integrity sha512-JD9MUnLbPL0WdVK8AWC7F7tTG2OS6u/AKKnsK+NdRhUiVdnzyR1S3kKQCaRLOiaULvUiqK6Z4JQE635VgtCFeg== dependencies: - "@babel/helper-plugin-utils" "^7.24.7" + "@babel/helper-plugin-utils" "^7.25.7" -"@babel/plugin-transform-react-jsx-source@^7.24.1": - version "7.24.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.24.7.tgz#1198aab2548ad19582013815c938d3ebd8291ee3" - integrity sha512-J2z+MWzZHVOemyLweMqngXrgGC42jQ//R0KdxqkIz/OrbVIIlhFI3WigZ5fO+nwFvBlncr4MGapd8vTyc7RPNQ== +"@babel/plugin-transform-react-jsx-source@^7.24.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.25.7.tgz#a0d8372310d5ea5b0447dfa03a8485f960eff7be" + integrity sha512-S/JXG/KrbIY06iyJPKfxr0qRxnhNOdkNXYBl/rmwgDd72cQLH9tEGkDm/yJPGvcSIUoikzfjMios9i+xT/uv9w== dependencies: - "@babel/helper-plugin-utils" "^7.24.7" + "@babel/helper-plugin-utils" "^7.25.7" "@babel/runtime@^7.13.10": version "7.22.15" @@ -189,25 +189,25 @@ dependencies: regenerator-runtime "^0.14.0" -"@babel/template@^7.25.0": - version "7.25.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.0.tgz#e733dc3134b4fede528c15bc95e89cb98c52592a" - integrity sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q== +"@babel/template@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.7.tgz#27f69ce382855d915b14ab0fe5fb4cbf88fa0769" + integrity sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA== dependencies: - "@babel/code-frame" "^7.24.7" - "@babel/parser" "^7.25.0" - "@babel/types" "^7.25.0" + "@babel/code-frame" "^7.25.7" + "@babel/parser" "^7.25.7" + "@babel/types" "^7.25.7" -"@babel/traverse@^7.24.7", "@babel/traverse@^7.25.2": - version "7.25.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.3.tgz#f1b901951c83eda2f3e29450ce92743783373490" - integrity sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ== +"@babel/traverse@^7.25.7": + version "7.25.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.25.7.tgz#83e367619be1cab8e4f2892ef30ba04c26a40fa8" + integrity sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg== dependencies: - "@babel/code-frame" "^7.24.7" - "@babel/generator" "^7.25.0" - "@babel/parser" "^7.25.3" - "@babel/template" "^7.25.0" - "@babel/types" "^7.25.2" + "@babel/code-frame" "^7.25.7" + "@babel/generator" "^7.25.7" + "@babel/parser" "^7.25.7" + "@babel/template" "^7.25.7" + "@babel/types" "^7.25.7" debug "^4.3.1" globals "^11.1.0" @@ -220,13 +220,13 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@babel/types@^7.24.7", "@babel/types@^7.25.0", "@babel/types@^7.25.2": - version "7.25.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.2.tgz#55fb231f7dc958cd69ea141a4c2997e819646125" - integrity sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q== +"@babel/types@^7.25.7", "@babel/types@^7.25.8": + version "7.25.8" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.25.8.tgz#5cf6037258e8a9bcad533f4979025140cb9993e1" + integrity sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg== dependencies: - "@babel/helper-string-parser" "^7.24.8" - "@babel/helper-validator-identifier" "^7.24.7" + "@babel/helper-string-parser" "^7.25.7" + "@babel/helper-validator-identifier" "^7.25.7" to-fast-properties "^2.0.0" "@esbuild/aix-ppc64@0.21.5": @@ -361,15 +361,20 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.0.tgz#b0ffd0312b4a3fd2d6f77237e7248a5ad3a680ae" integrity sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A== -"@eslint/config-array@^0.17.1": - version "0.17.1" - resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.17.1.tgz#d9b8b8b6b946f47388f32bedfd3adf29ca8f8910" - integrity sha512-BlYOpej8AQ8Ev9xVqroV7a02JK3SkBAaN9GfMMH9W6Ch8FlQlkjGw4Ir7+FgYwfirivAf4t+GtzuAxqfukmISA== +"@eslint/config-array@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@eslint/config-array/-/config-array-0.18.0.tgz#37d8fe656e0d5e3dbaea7758ea56540867fd074d" + integrity sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw== dependencies: "@eslint/object-schema" "^2.1.4" debug "^4.3.1" minimatch "^3.1.2" +"@eslint/core@^0.7.0": + version "0.7.0" + resolved "https://registry.yarnpkg.com/@eslint/core/-/core-0.7.0.tgz#a1bb4b6a4e742a5ff1894b7ee76fbf884ec72bd3" + integrity sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw== + "@eslint/eslintrc@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.1.0.tgz#dbd3482bfd91efa663cbe7aa1f506839868207b6" @@ -385,16 +390,23 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.9.0": - version "9.9.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.9.0.tgz#d8437adda50b3ed4401964517b64b4f59b0e2638" - integrity sha512-hhetes6ZHP3BlXLxmd8K2SNgkhNSi+UcecbnwWKwpP7kyi/uC75DJ1lOOBO3xrC4jyojtGE3YxKZPHfk4yrgug== +"@eslint/js@9.13.0": + version "9.13.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.13.0.tgz#c5f89bcd57eb54d5d4fa8b77693e9c28dc97e547" + integrity sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA== "@eslint/object-schema@^2.1.4": version "2.1.4" resolved "https://registry.yarnpkg.com/@eslint/object-schema/-/object-schema-2.1.4.tgz#9e69f8bb4031e11df79e03db09f9dbbae1740843" integrity sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ== +"@eslint/plugin-kit@^0.2.0": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@eslint/plugin-kit/-/plugin-kit-0.2.1.tgz#cd14fe2db79fa639839dfef4105e83bad1814482" + integrity sha512-HFZ4Mp26nbWk9d/BpvP0YNL6W4UoZF0VFcTw/aPPA8RpOxeFQgK+ClABGgAUXs9Y/RGX/l1vOmrqz1MQt9MNuw== + dependencies: + levn "^0.4.1" + "@floating-ui/core@^1.4.1": version "1.4.1" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.4.1.tgz#0d633f4b76052668afb932492ac452f7ebe97f17" @@ -422,6 +434,19 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.1.1.tgz#1a5b1959a528e374e8037c4396c3e825d6cf4a83" integrity sha512-m0G6wlnhm/AX0H12IOWtK8gASEMffnX08RtKkCgTdHb9JpHKGloI7icFfLg9ZmQeavcvR0PKmzxClyuFPSjKWw== +"@humanfs/core@^0.19.0": + version "0.19.0" + resolved "https://registry.yarnpkg.com/@humanfs/core/-/core-0.19.0.tgz#08db7a8c73bb07673d9ebd925f2dad746411fcec" + integrity sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw== + +"@humanfs/node@^0.16.5": + version "0.16.5" + resolved "https://registry.yarnpkg.com/@humanfs/node/-/node-0.16.5.tgz#a9febb7e7ad2aff65890fdc630938f8d20aa84ba" + integrity sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg== + dependencies: + "@humanfs/core" "^0.19.0" + "@humanwhocodes/retry" "^0.3.0" + "@humanwhocodes/module-importer@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" @@ -432,6 +457,11 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.0.tgz#6d86b8cb322660f03d3f0aa94b99bdd8e172d570" integrity sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew== +"@humanwhocodes/retry@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.3.1.tgz#c72a5c76a9fbaf3488e231b13dc52c0da7bab42a" + integrity sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA== + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -513,7 +543,7 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": +"@nodelib/fs.walk@^1.2.3": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== @@ -545,15 +575,15 @@ dependencies: "@radix-ui/react-primitive" "2.0.0" -"@radix-ui/react-checkbox@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-checkbox/-/react-checkbox-1.1.1.tgz#a559c4303957d797acee99914480b755aa1f27d6" - integrity sha512-0i/EKJ222Afa1FE0C6pNJxDq1itzcl3HChE9DwskA4th4KRse8ojx8a1nVcOjwJdbpDLcz7uol77yYnQNMHdKw== +"@radix-ui/react-checkbox@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-checkbox/-/react-checkbox-1.1.2.tgz#6465b800420923ecc39cbeaa8f357b5f09dbfd52" + integrity sha512-/i0fl686zaJbDQLNKrkCbMyDm6FQMt4jg323k7HuqitoANm9sE23Ql8yOK3Wusk34HSLKDChhMux05FnP6KUkw== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" - "@radix-ui/react-presence" "1.1.0" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-presence" "1.1.1" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-controllable-state" "1.1.0" "@radix-ui/react-use-previous" "1.1.0" @@ -593,6 +623,11 @@ resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.1.0.tgz#6df8d983546cfd1999c8512f3a8ad85a6e7fcee8" integrity sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A== +"@radix-ui/react-context@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.1.1.tgz#82074aa83a472353bb22e86f11bcbd1c61c4c71a" + integrity sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q== + "@radix-ui/react-dialog@1.0.5": version "1.0.5" resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.0.5.tgz#71657b1b116de6c7a0b03242d7d43e01062c7300" @@ -614,25 +649,25 @@ aria-hidden "^1.1.1" react-remove-scroll "2.5.5" -"@radix-ui/react-dialog@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.1.1.tgz#4906507f7b4ad31e22d7dad69d9330c87c431d44" - integrity sha512-zysS+iU4YP3STKNS6USvFVqI4qqx8EpiwmT5TuCApVEBca+eRCbONi4EgzfNSuVnOXvC5UPHHMjs8RXO6DH9Bg== +"@radix-ui/react-dialog@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.1.2.tgz#d9345575211d6f2d13e209e84aec9a8584b54d6c" + integrity sha512-Yj4dZtqa2o+kG61fzB0H2qUvmwBA2oyQroGLyNtBj1beo1khoQ3q1a2AO8rrQYjd8256CO9+N8L9tvsS+bnIyA== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" - "@radix-ui/react-dismissable-layer" "1.1.0" - "@radix-ui/react-focus-guards" "1.1.0" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-dismissable-layer" "1.1.1" + "@radix-ui/react-focus-guards" "1.1.1" "@radix-ui/react-focus-scope" "1.1.0" "@radix-ui/react-id" "1.1.0" - "@radix-ui/react-portal" "1.1.1" - "@radix-ui/react-presence" "1.1.0" + "@radix-ui/react-portal" "1.1.2" + "@radix-ui/react-presence" "1.1.1" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-slot" "1.1.0" "@radix-ui/react-use-controllable-state" "1.1.0" aria-hidden "^1.1.1" - react-remove-scroll "2.5.7" + react-remove-scroll "2.6.0" "@radix-ui/react-direction@1.1.0": version "1.1.0" @@ -651,10 +686,10 @@ "@radix-ui/react-use-callback-ref" "1.0.1" "@radix-ui/react-use-escape-keydown" "1.0.3" -"@radix-ui/react-dismissable-layer@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.0.tgz#2cd0a49a732372513733754e6032d3fb7988834e" - integrity sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig== +"@radix-ui/react-dismissable-layer@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.1.tgz#cbdcb739c5403382bdde5f9243042ba643883396" + integrity sha512-QSxg29lfr/xcev6kSz7MAlmDnzbP1eI/Dwn3Tp1ip0KT5CUELsxkekFEMVBEoykI3oV39hKT4TKZzBNMbcTZYQ== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" @@ -662,16 +697,16 @@ "@radix-ui/react-use-callback-ref" "1.1.0" "@radix-ui/react-use-escape-keydown" "1.1.0" -"@radix-ui/react-dropdown-menu@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.1.tgz#3dc578488688250dbbe109d9ff2ca28a9bca27ec" - integrity sha512-y8E+x9fBq9qvteD2Zwa4397pUVhYsh9iq44b5RD5qu1GMJWBCBuVg1hMyItbc6+zH00TxGRqd9Iot4wzf3OoBQ== +"@radix-ui/react-dropdown-menu@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.2.tgz#acc49577130e3c875ef0133bd1e271ea3392d924" + integrity sha512-GVZMR+eqK8/Kes0a36Qrv+i20bAPXSn8rCBTHx30w+3ECnR5o3xixAlqcVaYvLeyKUsm0aqyhWfmUcqufM8nYA== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" + "@radix-ui/react-context" "1.1.1" "@radix-ui/react-id" "1.1.0" - "@radix-ui/react-menu" "2.1.1" + "@radix-ui/react-menu" "2.1.2" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-controllable-state" "1.1.0" @@ -682,10 +717,10 @@ dependencies: "@babel/runtime" "^7.13.10" -"@radix-ui/react-focus-guards@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.0.tgz#8e9abb472a9a394f59a1b45f3dd26cfe3fc6da13" - integrity sha512-w6XZNUPVv6xCpZUqb/yN9DL6auvpGX3C/ee6Hdi16v2UUy25HV2Q5bcflsiDyT/g5RwbPQ/GIT1vLkeRb+ITBw== +"@radix-ui/react-focus-guards@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.1.tgz#8635edd346304f8b42cae86b05912b61aef27afe" + integrity sha512-pSIwfrT1a6sIoDASCSpFwOasEwKTZWDw/iBdtnqKO7v6FeOzYJ7U53cPzYFVR3geGGXgVHaH+CdngrrAzqUGxg== "@radix-ui/react-focus-scope@1.0.4": version "1.0.4" @@ -706,18 +741,18 @@ "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-callback-ref" "1.1.0" -"@radix-ui/react-hover-card@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-hover-card/-/react-hover-card-1.1.1.tgz#2982a5a91c7ae5a98e0cacd845fbdfbfdcdab355" - integrity sha512-IwzAOP97hQpDADYVKrEEHUH/b2LA+9MgB0LgdmnbFO2u/3M5hmEofjjr2M6CyzUblaAqJdFm6B7oFtU72DPXrA== +"@radix-ui/react-hover-card@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-hover-card/-/react-hover-card-1.1.2.tgz#912e158cd9ee71cba86f08ba063d1f5953cfb0e6" + integrity sha512-Y5w0qGhysvmqsIy6nQxaPa6mXNKznfoGjOfBgzOjocLxr2XlSjqBMYQQL+FfyogsMuX+m8cZyQGYhJxvxUzO4w== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" - "@radix-ui/react-dismissable-layer" "1.1.0" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-dismissable-layer" "1.1.1" "@radix-ui/react-popper" "1.2.0" - "@radix-ui/react-portal" "1.1.1" - "@radix-ui/react-presence" "1.1.0" + "@radix-ui/react-portal" "1.1.2" + "@radix-ui/react-presence" "1.1.1" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-controllable-state" "1.1.0" @@ -748,50 +783,50 @@ dependencies: "@radix-ui/react-primitive" "2.0.0" -"@radix-ui/react-menu@2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-menu/-/react-menu-2.1.1.tgz#bd623ace0e1ae1ac78023a505fec0541d59fb346" - integrity sha512-oa3mXRRVjHi6DZu/ghuzdylyjaMXLymx83irM7hTxutQbD+7IhPKdMdRHD26Rm+kHRrWcrUkkRPv5pd47a2xFQ== +"@radix-ui/react-menu@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-menu/-/react-menu-2.1.2.tgz#91f6815845a4298dde775563ed2d80b7ad667899" + integrity sha512-lZ0R4qR2Al6fZ4yCCZzu/ReTFrylHFxIqy7OezIpWF4bL0o9biKo0pFIvkaew3TyZ9Fy5gYVrR5zCGZBVbO1zg== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-collection" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" + "@radix-ui/react-context" "1.1.1" "@radix-ui/react-direction" "1.1.0" - "@radix-ui/react-dismissable-layer" "1.1.0" - "@radix-ui/react-focus-guards" "1.1.0" + "@radix-ui/react-dismissable-layer" "1.1.1" + "@radix-ui/react-focus-guards" "1.1.1" "@radix-ui/react-focus-scope" "1.1.0" "@radix-ui/react-id" "1.1.0" "@radix-ui/react-popper" "1.2.0" - "@radix-ui/react-portal" "1.1.1" - "@radix-ui/react-presence" "1.1.0" + "@radix-ui/react-portal" "1.1.2" + "@radix-ui/react-presence" "1.1.1" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-roving-focus" "1.1.0" "@radix-ui/react-slot" "1.1.0" "@radix-ui/react-use-callback-ref" "1.1.0" aria-hidden "^1.1.1" - react-remove-scroll "2.5.7" + react-remove-scroll "2.6.0" -"@radix-ui/react-popover@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-popover/-/react-popover-1.1.1.tgz#604b783cdb3494ed4f16a58c17f0e81e61ab7775" - integrity sha512-3y1A3isulwnWhvTTwmIreiB8CF4L+qRjZnK1wYLO7pplddzXKby/GnZ2M7OZY3qgnl6p9AodUIHRYGXNah8Y7g== +"@radix-ui/react-popover@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-popover/-/react-popover-1.1.2.tgz#a0cab25f69aa49ad0077d91e9e9dcd323758020c" + integrity sha512-u2HRUyWW+lOiA2g0Le0tMmT55FGOEWHwPFt1EPfbLly7uXQExFo5duNKqG2DzmFXIdqOeNd+TpE8baHWJCyP9w== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" - "@radix-ui/react-dismissable-layer" "1.1.0" - "@radix-ui/react-focus-guards" "1.1.0" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-dismissable-layer" "1.1.1" + "@radix-ui/react-focus-guards" "1.1.1" "@radix-ui/react-focus-scope" "1.1.0" "@radix-ui/react-id" "1.1.0" "@radix-ui/react-popper" "1.2.0" - "@radix-ui/react-portal" "1.1.1" - "@radix-ui/react-presence" "1.1.0" + "@radix-ui/react-portal" "1.1.2" + "@radix-ui/react-presence" "1.1.1" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-slot" "1.1.0" "@radix-ui/react-use-controllable-state" "1.1.0" aria-hidden "^1.1.1" - react-remove-scroll "2.5.7" + react-remove-scroll "2.6.0" "@radix-ui/react-popper@1.2.0": version "1.2.0" @@ -817,10 +852,10 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.3" -"@radix-ui/react-portal@1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.1.1.tgz#1957f1eb2e1aedfb4a5475bd6867d67b50b1d15f" - integrity sha512-A3UtLk85UtqhzFqtoC8Q0KvR2GbXF3mtPgACSazajqq6A41mEQgo53iPzY4i6BwDxlIFqWIhiQ2G729n+2aw/g== +"@radix-ui/react-portal@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.1.2.tgz#51eb46dae7505074b306ebcb985bf65cc547d74e" + integrity sha512-WeDYLGPxJb/5EGBoedyJbT0MpoULmwnIPMJMSldkuiMsBAv7N1cRdsTWZWht9vpPOiN3qyiGAtbK2is47/uMFg== dependencies: "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-layout-effect" "1.1.0" @@ -842,6 +877,14 @@ "@radix-ui/react-compose-refs" "1.1.0" "@radix-ui/react-use-layout-effect" "1.1.0" +"@radix-ui/react-presence@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.1.1.tgz#98aba423dba5e0c687a782c0669dcd99de17f9b1" + integrity sha512-IeFXVi4YS1K0wVZzXNrbaaUvIJ3qdY+/Ih4eHFhWA9SwGR9UDX7Ck8abvL57C4cv3wwMvUE0OG69Qc3NCcTe/A== + dependencies: + "@radix-ui/react-compose-refs" "1.1.0" + "@radix-ui/react-use-layout-effect" "1.1.0" + "@radix-ui/react-primitive@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz#d49ea0f3f0b2fe3ab1cb5667eb03e8b843b914d0" @@ -880,23 +923,23 @@ "@radix-ui/react-use-callback-ref" "1.1.0" "@radix-ui/react-use-controllable-state" "1.1.0" -"@radix-ui/react-select@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-select/-/react-select-2.1.1.tgz#df05cb0b29d3deaef83b505917c4042e0e418a9f" - integrity sha512-8iRDfyLtzxlprOo9IicnzvpsO1wNCkuwzzCM+Z5Rb5tNOpCdMvcc2AkzX0Fz+Tz9v6NJ5B/7EEgyZveo4FBRfQ== +"@radix-ui/react-select@^2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-select/-/react-select-2.1.2.tgz#2346e118966db793940f6a866fd4cc5db2cc275e" + integrity sha512-rZJtWmorC7dFRi0owDmoijm6nSJH1tVw64QGiNIZ9PNLyBDtG+iAq+XGsya052At4BfarzY/Dhv9wrrUr6IMZA== dependencies: "@radix-ui/number" "1.1.0" "@radix-ui/primitive" "1.1.0" "@radix-ui/react-collection" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" + "@radix-ui/react-context" "1.1.1" "@radix-ui/react-direction" "1.1.0" - "@radix-ui/react-dismissable-layer" "1.1.0" - "@radix-ui/react-focus-guards" "1.1.0" + "@radix-ui/react-dismissable-layer" "1.1.1" + "@radix-ui/react-focus-guards" "1.1.1" "@radix-ui/react-focus-scope" "1.1.0" "@radix-ui/react-id" "1.1.0" "@radix-ui/react-popper" "1.2.0" - "@radix-ui/react-portal" "1.1.1" + "@radix-ui/react-portal" "1.1.2" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-slot" "1.1.0" "@radix-ui/react-use-callback-ref" "1.1.0" @@ -905,7 +948,7 @@ "@radix-ui/react-use-previous" "1.1.0" "@radix-ui/react-visually-hidden" "1.1.0" aria-hidden "^1.1.1" - react-remove-scroll "2.5.7" + react-remove-scroll "2.6.0" "@radix-ui/react-separator@^1.1.0": version "1.1.0" @@ -956,18 +999,18 @@ "@radix-ui/react-roving-focus" "1.1.0" "@radix-ui/react-use-controllable-state" "1.1.0" -"@radix-ui/react-toast@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@radix-ui/react-toast/-/react-toast-1.2.1.tgz#4bde231ed27d007dcd0455a446565ca619f92a2d" - integrity sha512-5trl7piMXcZiCq7MW6r8YYmu0bK5qDpTWz+FdEPdKyft2UixkspheYbjbrLXVN5NGKHFbOP7lm8eD0biiSqZqg== +"@radix-ui/react-toast@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-toast/-/react-toast-1.2.2.tgz#fdd8ed0b80f47d6631dfd90278fee6debc06bf33" + integrity sha512-Z6pqSzmAP/bFJoqMAston4eSNa+ud44NSZTiZUmUen+IOZ5nBY8kzuU5WDBVyFXPtcW6yUalOHsxM/BP6Sv8ww== dependencies: "@radix-ui/primitive" "1.1.0" "@radix-ui/react-collection" "1.1.0" "@radix-ui/react-compose-refs" "1.1.0" - "@radix-ui/react-context" "1.1.0" - "@radix-ui/react-dismissable-layer" "1.1.0" - "@radix-ui/react-portal" "1.1.1" - "@radix-ui/react-presence" "1.1.0" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-dismissable-layer" "1.1.1" + "@radix-ui/react-portal" "1.1.2" + "@radix-ui/react-presence" "1.1.1" "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-callback-ref" "1.1.0" "@radix-ui/react-use-controllable-state" "1.1.0" @@ -1081,114 +1124,114 @@ resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.1.0.tgz#f817d1d3265ac5415dadc67edab30ae196696438" integrity sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg== -"@remix-run/router@1.19.0": - version "1.19.0" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.19.0.tgz#745dbffbce67f05386d57ca22c51dfd85c979593" - integrity sha512-zDICCLKEwbVYTS6TjYaWtHXxkdoUvD/QXvyVZjGCsWz5vyH7aFeONlPffPdW+Y/t6KT0MgXb2Mfjun9YpWN1dA== +"@remix-run/router@1.20.0": + version "1.20.0" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.20.0.tgz#03554155b45d8b529adf635b2f6ad1165d70d8b4" + integrity sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg== -"@rollup/rollup-android-arm-eabi@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz#bddf05c3387d02fac04b6b86b3a779337edfed75" - integrity sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g== +"@rollup/rollup-android-arm-eabi@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz#1661ff5ea9beb362795304cb916049aba7ac9c54" + integrity sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA== -"@rollup/rollup-android-arm64@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz#b26bd09de58704c0a45e3375b76796f6eda825e4" - integrity sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ== +"@rollup/rollup-android-arm64@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz#2ffaa91f1b55a0082b8a722525741aadcbd3971e" + integrity sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA== -"@rollup/rollup-darwin-arm64@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz#c5f3fd1aa285b6d33dda6e3f3ca395f8c37fd5ca" - integrity sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA== +"@rollup/rollup-darwin-arm64@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz#627007221b24b8cc3063703eee0b9177edf49c1f" + integrity sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA== -"@rollup/rollup-darwin-x64@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz#8e4673734d7dc9d68f6d48e81246055cda0e840f" - integrity sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw== +"@rollup/rollup-darwin-x64@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz#0605506142b9e796c370d59c5984ae95b9758724" + integrity sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ== -"@rollup/rollup-linux-arm-gnueabihf@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz#53ed38eb13b58ababdb55a7f66f0538a7f85dcba" - integrity sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw== +"@rollup/rollup-linux-arm-gnueabihf@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz#62dfd196d4b10c0c2db833897164d2d319ee0cbb" + integrity sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA== -"@rollup/rollup-linux-arm-musleabihf@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz#0706ee38330e267a5c9326956820f009cfb21fcd" - integrity sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw== +"@rollup/rollup-linux-arm-musleabihf@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz#53ce72aeb982f1f34b58b380baafaf6a240fddb3" + integrity sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw== -"@rollup/rollup-linux-arm64-gnu@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz#426fce7b8b242ac5abd48a10a5020f5a468c6cb4" - integrity sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA== +"@rollup/rollup-linux-arm64-gnu@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz#1632990f62a75c74f43e4b14ab3597d7ed416496" + integrity sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA== -"@rollup/rollup-linux-arm64-musl@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz#65bf944530d759b50d7ffd00dfbdf4125a43406f" - integrity sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw== +"@rollup/rollup-linux-arm64-musl@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz#8c03a996efb41e257b414b2e0560b7a21f2d9065" + integrity sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw== -"@rollup/rollup-linux-powerpc64le-gnu@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz#494ba3b31095e9a45df9c3f646d21400fb631a95" - integrity sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw== +"@rollup/rollup-linux-powerpc64le-gnu@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz#5b98729628d5bcc8f7f37b58b04d6845f85c7b5d" + integrity sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw== -"@rollup/rollup-linux-riscv64-gnu@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz#8b88ed0a40724cce04aa15374ebe5ba4092d679f" - integrity sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ== +"@rollup/rollup-linux-riscv64-gnu@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz#48e42e41f4cabf3573cfefcb448599c512e22983" + integrity sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg== -"@rollup/rollup-linux-s390x-gnu@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz#09c9e5ec57a0f6ec3551272c860bb9a04b96d70f" - integrity sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg== +"@rollup/rollup-linux-s390x-gnu@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz#e0b4f9a966872cb7d3e21b9e412a4b7efd7f0b58" + integrity sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g== -"@rollup/rollup-linux-x64-gnu@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz#197f27fd481ad9c861021d5cbbf21793922a631c" - integrity sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA== +"@rollup/rollup-linux-x64-gnu@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz#78144741993100f47bd3da72fce215e077ae036b" + integrity sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A== -"@rollup/rollup-linux-x64-musl@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz#5cc0522f4942f2df625e9bfb6fb02c6580ffbce6" - integrity sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg== +"@rollup/rollup-linux-x64-musl@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz#d9fe32971883cd1bd858336bd33a1c3ca6146127" + integrity sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ== -"@rollup/rollup-win32-arm64-msvc@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz#a648122389d23a7543b261fba082e65fefefe4f6" - integrity sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg== +"@rollup/rollup-win32-arm64-msvc@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz#71fa3ea369316db703a909c790743972e98afae5" + integrity sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ== -"@rollup/rollup-win32-ia32-msvc@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz#34727b5c7953c35fc6e1ae4f770ad3a2025f8e03" - integrity sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw== +"@rollup/rollup-win32-ia32-msvc@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz#653f5989a60658e17d7576a3996deb3902e342e2" + integrity sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ== -"@rollup/rollup-win32-x64-msvc@4.14.3": - version "4.14.3" - resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz#5b2fb4d8cd44c05deef8a7b0e6deb9ccb8939d18" - integrity sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA== +"@rollup/rollup-win32-x64-msvc@4.24.0": + version "4.24.0" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz#0574d7e87b44ee8511d08cc7f914bcb802b70818" + integrity sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw== -"@tanstack/query-core@5.51.21": - version "5.51.21" - resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.51.21.tgz#a510469c6c30d3de2a8b8798e340169a4b0fd08f" - integrity sha512-POQxm42IUp6n89kKWF4IZi18v3fxQWFRolvBA6phNVmA8psdfB1MvDnGacCJdS+EOX12w/CyHM62z//rHmYmvw== +"@tanstack/query-core@5.59.13": + version "5.59.13" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.59.13.tgz#8c962980af174bbd446b7e9b9999f7432897df80" + integrity sha512-Oou0bBu/P8+oYjXsJQ11j+gcpLAMpqW42UlokQYEz4dE7+hOtVO9rVuolJKgEccqzvyFzqX4/zZWY+R/v1wVsQ== -"@tanstack/react-query@5.51.23": - version "5.51.23" - resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.51.23.tgz#83c223f4cb6054b206de8856b73ca7e41a63ba1f" - integrity sha512-CfJCfX45nnVIZjQBRYYtvVMIsGgWLKLYC4xcUiYEey671n1alvTZoCBaU9B85O8mF/tx9LPyrI04A6Bs2THv4A== +"@tanstack/react-query@5.59.15": + version "5.59.15" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.59.15.tgz#fa1c5b4d96e6a148ec761f214304bbf5ac1906be" + integrity sha512-QbVlAkTI78wB4Mqgf2RDmgC0AOiJqer2c5k9STOOSXGv1S6ZkY37r/6UpE8DbQ2Du0ohsdoXgFNEyv+4eDoPEw== dependencies: - "@tanstack/query-core" "5.51.21" + "@tanstack/query-core" "5.59.13" -"@tanstack/react-table@8.20.1": - version "8.20.1" - resolved "https://registry.yarnpkg.com/@tanstack/react-table/-/react-table-8.20.1.tgz#bd2d549d8a18458fb8284025ce66a9b86176fa6b" - integrity sha512-PJK+07qbengObe5l7c8vCdtefXm8cyR4i078acWrHbdm8JKw1ES7YpmOtVt9ALUVEEFAHscdVpGRhRgikgFMbQ== +"@tanstack/react-table@8.20.5": + version "8.20.5" + resolved "https://registry.yarnpkg.com/@tanstack/react-table/-/react-table-8.20.5.tgz#19987d101e1ea25ef5406dce4352cab3932449d8" + integrity sha512-WEHopKw3znbUZ61s9i0+i9g8drmDo6asTWbrQh8Us63DAk/M0FkmIqERew6P71HI75ksZ2Pxyuf4vvKh9rAkiA== dependencies: - "@tanstack/table-core" "8.20.1" + "@tanstack/table-core" "8.20.5" -"@tanstack/table-core@8.20.1": - version "8.20.1" - resolved "https://registry.yarnpkg.com/@tanstack/table-core/-/table-core-8.20.1.tgz#74bfab10fa35bed51fa0bd2f3539a331d7e78f1b" - integrity sha512-5Ly5TIRHnWH7vSDell9B/OVyV380qqIJVg7H7R7jU4fPEmOD4smqAX7VRflpYI09srWR8aj5OLD2Ccs1pI5mTg== +"@tanstack/table-core@8.20.5": + version "8.20.5" + resolved "https://registry.yarnpkg.com/@tanstack/table-core/-/table-core-8.20.5.tgz#3974f0b090bed11243d4107283824167a395cf1d" + integrity sha512-P9dF7XbibHph2PFRz8gfBKEXEY/HJPOhym8CHmjF8y3q5mWpKx9xtZapXQUWCgkqvsK0R46Azuz+VaxD4Xl+Tg== "@types/babel__core@^7.20.5": version "7.20.5" @@ -1252,10 +1295,15 @@ resolved "https://registry.yarnpkg.com/@types/d3-time/-/d3-time-3.0.3.tgz#3c186bbd9d12b9d84253b6be6487ca56b54f88be" integrity sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw== -"@types/estree@1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" - integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== +"@types/estree@1.0.6", "@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + +"@types/json-schema@^7.0.15": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/prop-types@*": version "15.7.5" @@ -1267,10 +1315,10 @@ resolved "https://registry.yarnpkg.com/@types/raf/-/raf-3.4.3.tgz#85f1d1d17569b28b8db45e16e996407a56b0ab04" integrity sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw== -"@types/react-dom@18.3.0": - version "18.3.0" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.0.tgz#0cbc818755d87066ab6ca74fbedb2547d74a82b0" - integrity sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg== +"@types/react-dom@18.3.1": + version "18.3.1" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.1.tgz#1e4654c08a9cdcfb6594c780ac59b55aad42fe07" + integrity sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ== dependencies: "@types/react" "*" @@ -1290,10 +1338,10 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@18.3.3": - version "18.3.3" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3.tgz#9679020895318b0915d7a3ab004d92d33375c45f" - integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw== +"@types/react@18.3.11": + version "18.3.11" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.11.tgz#9d530601ff843ee0d7030d4227ea4360236bd537" + integrity sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ== dependencies: "@types/prop-types" "*" csstype "^3.0.2" @@ -1307,10 +1355,10 @@ "@types/scheduler" "^0.16" csstype "^3.0.2" -"@types/sanitize-html@2.11.0": - version "2.11.0" - resolved "https://registry.yarnpkg.com/@types/sanitize-html/-/sanitize-html-2.11.0.tgz#582d8c72215c0228e3af2be136e40e0b531addf2" - integrity sha512-7oxPGNQHXLHE48r/r/qjn7q0hlrs3kL7oZnGj0Wf/h9tj/6ibFyRkNbsDxaBBZ4XUZ0Dx5LGCyDJ04ytSofacQ== +"@types/sanitize-html@2.13.0": + version "2.13.0" + resolved "https://registry.yarnpkg.com/@types/sanitize-html/-/sanitize-html-2.13.0.tgz#ac3620e867b7c68deab79c72bd117e2049cdd98e" + integrity sha512-X31WxbvW9TjIhZZNyNBZ/p5ax4ti7qsNDBDEnH4zAgmEh35YnFD1UiS6z9Cd34kKm0LslFW0KPmTQzu/oGtsqQ== dependencies: htmlparser2 "^8.0.0" @@ -1329,16 +1377,16 @@ resolved "https://registry.yarnpkg.com/@types/svg-path-parser/-/svg-path-parser-1.1.3.tgz#659aca2e886071e5c593e06206b6254bcb811202" integrity sha512-F1Y6lQIto5b2sKCseVUsFfY5J+8PIhhX4jrDVxpth4m7hwM2OdySh3iTLeR35lEhl/K4ZMEF+GDAwTl7yJcO5Q== -"@typescript-eslint/eslint-plugin@8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.1.tgz#5dbd1b498fdea83a16d292322d27d293ce156f94" - integrity sha512-5g3Y7GDFsJAnY4Yhvk8sZtFfV6YNF2caLzjrRPUBzewjPCaj0yokePB4LJSobyCzGMzjZZYFbwuzbfDHlimXbQ== +"@typescript-eslint/eslint-plugin@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.10.0.tgz#9c8218ed62f9a322df10ded7c34990f014df44f2" + integrity sha512-phuB3hoP7FFKbRXxjl+DRlQDuJqhpOnm5MmtROXyWi3uS/Xg2ZXqiQfcG2BJHiN4QKyzdOJi3NEn/qTnjUlkmQ== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.0.1" - "@typescript-eslint/type-utils" "8.0.1" - "@typescript-eslint/utils" "8.0.1" - "@typescript-eslint/visitor-keys" "8.0.1" + "@typescript-eslint/scope-manager" "8.10.0" + "@typescript-eslint/type-utils" "8.10.0" + "@typescript-eslint/utils" "8.10.0" + "@typescript-eslint/visitor-keys" "8.10.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" @@ -1363,13 +1411,21 @@ "@typescript-eslint/types" "8.0.1" "@typescript-eslint/visitor-keys" "8.0.1" -"@typescript-eslint/type-utils@8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.0.1.tgz#a613ee2dfeed4a9781300b5d326ec7cf946eed92" - integrity sha512-+/UT25MWvXeDX9YaHv1IS6KI1fiuTto43WprE7pgSMswHbn1Jm9GEM4Txp+X74ifOWV8emu2AWcbLhpJAvD5Ng== +"@typescript-eslint/scope-manager@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.10.0.tgz#606ffe18314d7b5c2f118f2f02aaa2958107a19c" + integrity sha512-AgCaEjhfql9MDKjMUxWvH7HjLeBqMCBfIaBbzzIcBbQPZE7CPh1m6FF+L75NUMJFMLYhCywJXIDEMa3//1A0dw== dependencies: - "@typescript-eslint/typescript-estree" "8.0.1" - "@typescript-eslint/utils" "8.0.1" + "@typescript-eslint/types" "8.10.0" + "@typescript-eslint/visitor-keys" "8.10.0" + +"@typescript-eslint/type-utils@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.10.0.tgz#99f1d2e21f8c74703e7d9c4a67a87271eaf57597" + integrity sha512-PCpUOpyQSpxBn230yIcK+LeCQaXuxrgCm2Zk1S+PTIRJsEfU6nJ0TtwyH8pIwPK/vJoA+7TZtzyAJSGBz+s/dg== + dependencies: + "@typescript-eslint/typescript-estree" "8.10.0" + "@typescript-eslint/utils" "8.10.0" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -1378,6 +1434,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.0.1.tgz#333e2f4c158952dbc8181a4ddcc6e49898a28918" integrity sha512-PpqTVT3yCA/bIgJ12czBuE3iBlM3g4inRSC5J0QOdQFAn07TYrYEQBBKgXH1lQpglup+Zy6c1fxuwTk4MTNKIw== +"@typescript-eslint/types@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.10.0.tgz#eb29c4bc2ed23489348c297469c76d28c38fb618" + integrity sha512-k/E48uzsfJCRRbGLapdZgrX52csmWJ2rcowwPvOZ8lwPUv3xW6CcFeJAXgx4uJm+Ge4+a4tFOkdYvSpxhRhg1w== + "@typescript-eslint/typescript-estree@8.0.1": version "8.0.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.1.tgz#64575ec7b77aedfe497acdfb2779ec942bb8d866" @@ -1392,15 +1453,29 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@8.0.1": - version "8.0.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.0.1.tgz#b48e3320c4f9011f97d25e0588b8c143adc38d2a" - integrity sha512-CBFR0G0sCt0+fzfnKaciu9IBsKvEKYwN9UZ+eeogK1fYHg4Qxk1yf/wLQkLXlq8wbU2dFlgAesxt8Gi76E8RTA== +"@typescript-eslint/typescript-estree@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.10.0.tgz#36cc66e06c5f44d6781f95cb03b132e985273a33" + integrity sha512-3OE0nlcOHaMvQ8Xu5gAfME3/tWVDpb/HxtpUZ1WeOAksZ/h/gwrBzCklaGzwZT97/lBbbxJ16dMA98JMEngW4w== + dependencies: + "@typescript-eslint/types" "8.10.0" + "@typescript-eslint/visitor-keys" "8.10.0" + debug "^4.3.4" + fast-glob "^3.3.2" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/utils@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.10.0.tgz#d78d1ce3ea3d2a88a2593ebfb1c98490131d00bf" + integrity sha512-Oq4uZ7JFr9d1ZunE/QKy5egcDRXT/FrS2z/nlxzPua2VHFtmMvFNDvpq1m/hq0ra+T52aUezfcjGRIB7vNJF9w== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.0.1" - "@typescript-eslint/types" "8.0.1" - "@typescript-eslint/typescript-estree" "8.0.1" + "@typescript-eslint/scope-manager" "8.10.0" + "@typescript-eslint/types" "8.10.0" + "@typescript-eslint/typescript-estree" "8.10.0" "@typescript-eslint/visitor-keys@8.0.1": version "8.0.1" @@ -1410,14 +1485,22 @@ "@typescript-eslint/types" "8.0.1" eslint-visitor-keys "^3.4.3" -"@vitejs/plugin-react@4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-4.3.1.tgz#d0be6594051ded8957df555ff07a991fb618b48e" - integrity sha512-m/V2syj5CuVnaxcUJOQRel/Wr31FFXRFlnOoq1TVtkCxsY5veGMTEmpWHndrhB2U8ScHtCQB1e+4hWYExQc6Lg== +"@typescript-eslint/visitor-keys@8.10.0": + version "8.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.10.0.tgz#7ce4c0c3b82140415c9cd9babe09e0000b4e9979" + integrity sha512-k8nekgqwr7FadWk548Lfph6V3r9OVqjzAIVskE7orMZR23cGJjAOVazsZSJW+ElyjfTM4wx/1g88Mi70DDtG9A== dependencies: - "@babel/core" "^7.24.5" - "@babel/plugin-transform-react-jsx-self" "^7.24.5" - "@babel/plugin-transform-react-jsx-source" "^7.24.1" + "@typescript-eslint/types" "8.10.0" + eslint-visitor-keys "^3.4.3" + +"@vitejs/plugin-react@4.3.3": + version "4.3.3" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-4.3.3.tgz#28301ac6d7aaf20b73a418ee5c65b05519b4836c" + integrity sha512-NooDe9GpHGqNns1i8XDERg0Vsg5SSYRhRxxyTGogUdkdNt47jal+fbuYi+Yfq6pzRCKXyoPcWisfxE6RIM3GKA== + dependencies: + "@babel/core" "^7.25.2" + "@babel/plugin-transform-react-jsx-self" "^7.24.7" + "@babel/plugin-transform-react-jsx-source" "^7.24.7" "@types/babel__core" "^7.20.5" react-refresh "^0.14.2" @@ -1446,11 +1529,6 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -1551,7 +1629,7 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.23.1, browserslist@^4.23.3: +browserslist@^4.23.3: version "4.23.3" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.3.tgz#debb029d3c93ebc97ffbc8d9cbb03403e227c800" integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA== @@ -1561,6 +1639,16 @@ browserslist@^4.23.1, browserslist@^4.23.3: node-releases "^2.0.18" update-browserslist-db "^1.1.0" +browserslist@^4.24.0: + version "4.24.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.0.tgz#a1325fe4bc80b64fda169629fc01b3d6cecd38d4" + integrity sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A== + dependencies: + caniuse-lite "^1.0.30001663" + electron-to-chromium "^1.5.28" + node-releases "^2.0.18" + update-browserslist-db "^1.1.0" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1576,6 +1664,11 @@ caniuse-lite@^1.0.30001646: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138" integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg== +caniuse-lite@^1.0.30001663: + version "1.0.30001669" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz#fda8f1d29a8bfdc42de0c170d7f34a9cf19ed7a3" + integrity sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w== + chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1854,6 +1947,11 @@ domutils@^3.0.1: domelementtype "^2.3.0" domhandler "^5.0.3" +electron-to-chromium@^1.5.28: + version "1.5.41" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.41.tgz#eae1ba6c49a1a61d84cf8263351d3513b2bcc534" + integrity sha512-dfdv/2xNjX0P8Vzme4cfzHqnPm5xsZXwsolTYr0eyW18IUmNyG08vL+fttvinTfhKfIKdRoqkDIC9e9iWQCNYQ== + electron-to-chromium@^1.5.4: version "1.5.6" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz#c81d9938b5a877314ad370feb73b4e5409b36abd" @@ -1913,20 +2011,20 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-plugin-react-hooks@4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596" - integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ== +eslint-plugin-react-hooks@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.0.0.tgz#72e2eefbac4b694f5324154619fee44f5f60f101" + integrity sha512-hIOwI+5hYGpJEc4uPRmz2ulCjAGD/N13Lukkh8cLV0i2IRk/bdZDYjgLVHj+U9Z704kLIdIO6iueGvxNur0sgw== -eslint-plugin-react-refresh@0.4.9: - version "0.4.9" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.9.tgz#bf870372b353b12e1e6fb7fc41b282d9cbc8d93d" - integrity sha512-QK49YrBAo5CLNLseZ7sZgvgTy21E6NEw22eZqc4teZfH8pxV3yXc9XXOYfUI6JNpw7mfHNkAeWtBxrTyykB6HA== +eslint-plugin-react-refresh@0.4.13: + version "0.4.13" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.13.tgz#ed7330da09b6192e6fa9b1b217ad979afbc898bf" + integrity sha512-f1EppwrpJRWmqDTyvAyomFVDYRtrS7iTEqv3nokETnMiMzs2SSTmKRTACce4O2p4jYyowiSMvpdwC/RLcMFhuQ== -eslint-scope@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.2.tgz#5cbb33d4384c9136083a71190d548158fe128f94" - integrity sha512-6E4xmrTw5wtxnLA5wYL3WDfhZ/1bUBGOXV0zQvVRDOtrR8D0p6W7fs3JweNYhwRYeGvd/1CKX2se0/2s7Q/nJA== +eslint-scope@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.1.0.tgz#70214a174d4cbffbc3e8a26911d8bf51b9ae9d30" + integrity sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" @@ -1941,27 +2039,36 @@ eslint-visitor-keys@^4.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== -eslint@9.9.0: - version "9.9.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.9.0.tgz#8d214e69ae4debeca7ae97daebbefe462072d975" - integrity sha512-JfiKJrbx0506OEerjK2Y1QlldtBxkAlLxT5OEcRF8uaQ86noDe2k31Vw9rnSWv+MXZHj7OOUV/dA0AhdLFcyvA== +eslint-visitor-keys@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz#1f785cc5e81eb7534523d85922248232077d2f8c" + integrity sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg== + +eslint@9.13.0: + version "9.13.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.13.0.tgz#7659014b7dda1ff876ecbd990f726e11c61596e6" + integrity sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.11.0" - "@eslint/config-array" "^0.17.1" + "@eslint/config-array" "^0.18.0" + "@eslint/core" "^0.7.0" "@eslint/eslintrc" "^3.1.0" - "@eslint/js" "9.9.0" + "@eslint/js" "9.13.0" + "@eslint/plugin-kit" "^0.2.0" + "@humanfs/node" "^0.16.5" "@humanwhocodes/module-importer" "^1.0.1" - "@humanwhocodes/retry" "^0.3.0" - "@nodelib/fs.walk" "^1.2.8" + "@humanwhocodes/retry" "^0.3.1" + "@types/estree" "^1.0.6" + "@types/json-schema" "^7.0.15" ajv "^6.12.4" chalk "^4.0.0" cross-spawn "^7.0.2" debug "^4.3.2" escape-string-regexp "^4.0.0" - eslint-scope "^8.0.2" - eslint-visitor-keys "^4.0.0" - espree "^10.1.0" + eslint-scope "^8.1.0" + eslint-visitor-keys "^4.1.0" + espree "^10.2.0" esquery "^1.5.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -1971,14 +2078,11 @@ eslint@9.9.0: ignore "^5.2.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - is-path-inside "^3.0.3" json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" lodash.merge "^4.6.2" minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.3" - strip-ansi "^6.0.1" text-table "^0.2.0" espree@^10.0.1: @@ -1990,14 +2094,14 @@ espree@^10.0.1: acorn-jsx "^5.3.2" eslint-visitor-keys "^4.0.0" -espree@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-10.1.0.tgz#8788dae611574c0f070691f522e4116c5a11fc56" - integrity sha512-M1M6CpiE6ffoigIOWYO9UDP8TMUw9kqb21tf+08IgDYjCsOvCuDt4jQcZmoYxx+w7zlKw9/N0KXfto+I8/FrXA== +espree@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.2.0.tgz#f4bcead9e05b0615c968e85f83816bc386a45df6" + integrity sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g== dependencies: acorn "^8.12.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^4.0.0" + eslint-visitor-keys "^4.1.0" esquery@^1.5.0: version "1.6.0" @@ -2039,7 +2143,7 @@ fast-glob@^3.2.9: merge2 "^1.3.0" micromatch "^4.0.4" -fast-glob@^3.3.0: +fast-glob@^3.3.0, fast-glob@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -2301,11 +2405,6 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - is-plain-object@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" @@ -2321,10 +2420,10 @@ jiti@^1.21.0: resolved "https://registry.yarnpkg.com/jiti/-/jiti-1.21.0.tgz#7c97f8fe045724e136a397f7340475244156105d" integrity sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q== -jotai@2.9.2: - version "2.9.2" - resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.9.2.tgz#0b1036bc1672d02ea7cf73c6b01728de461d6ecf" - integrity sha512-jIBXEadOHCziOuMY6HAy2KQcHipGhnsbF+twqh8Lcmcz/Yei0gdBtW5mOYdKmbQxGqkvfvXM3w/oHtJ2WNGSFg== +jotai@2.10.1: + version "2.10.1" + resolved "https://registry.yarnpkg.com/jotai/-/jotai-2.10.1.tgz#8d5598d06fa295110de0914f10bd1d10ea229723" + integrity sha512-4FycO+BOTl2auLyF2Chvi6KTDqdsdDDtpaL/WHQMs8f3KS1E3loiUShQzAzFA/sMU5cJ0hz/RT1xum9YbG/zaA== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" @@ -2338,10 +2437,10 @@ js-yaml@^4.1.0: dependencies: argparse "^2.0.1" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.0.2.tgz#bb8b09a6597ba426425f2e4a07245c3d00b9343e" + integrity sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g== json-buffer@3.0.1: version "3.0.1" @@ -2421,10 +2520,10 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lucide-react@0.437.0: - version "0.437.0" - resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.437.0.tgz#d0bef1567b867693d21b179763bfa1e0199b8fef" - integrity sha512-RXQq6tnm1FlXDUtOwLaoXET2TOEGpQULrQlPOjGHgIVsPhicHNat9sWF33OAe2UCLMFiWF1oL+FtAg43BqVY4Q== +lucide-react@0.453.0: + version "0.453.0" + resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.453.0.tgz#d37909a45a29d89680383a202ee861224b05ba6a" + integrity sha512-kL+RGZCcJi9BvJtzg2kshO192Ddy9hv3ij+cPrVPWSRzgCWCVazoQJxOjAwgK53NomL07HB7GPHW120FimjNhQ== merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" @@ -2592,6 +2691,11 @@ picocolors@^1.0.1: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== +picocolors@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -2651,14 +2755,14 @@ postcss-value-parser@^4.0.0, postcss-value-parser@^4.2.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== -postcss@8.4.41, postcss@^8.4.40: - version "8.4.41" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.41.tgz#d6104d3ba272d882fe18fc07d15dc2da62fa2681" - integrity sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ== +postcss@8.4.47, postcss@^8.4.43: + version "8.4.47" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.47.tgz#5bf6c9a010f3e724c503bf03ef7947dcb0fea365" + integrity sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ== dependencies: nanoid "^3.3.7" - picocolors "^1.0.1" - source-map-js "^1.2.0" + picocolors "^1.1.0" + source-map-js "^1.2.1" postcss@^8.3.11: version "8.4.38" @@ -2683,6 +2787,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.3.tgz#30c54fe0be0d8d12e6ae61dbb10109ea00d53105" + integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== + punycode@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" @@ -2741,7 +2850,7 @@ react-remove-scroll-bar@^2.3.3: react-style-singleton "^2.2.1" tslib "^2.0.0" -react-remove-scroll-bar@^2.3.4: +react-remove-scroll-bar@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.6.tgz#3e585e9d163be84a010180b18721e851ac81a29c" integrity sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g== @@ -2760,31 +2869,31 @@ react-remove-scroll@2.5.5: use-callback-ref "^1.3.0" use-sidecar "^1.1.2" -react-remove-scroll@2.5.7: - version "2.5.7" - resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.7.tgz#15a1fd038e8497f65a695bf26a4a57970cac1ccb" - integrity sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA== +react-remove-scroll@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.6.0.tgz#fb03a0845d7768a4f1519a99fdb84983b793dc07" + integrity sha512-I2U4JVEsQenxDAKaVa3VZ/JeJZe0/2DxPWL8Tj8yLKctQJQiZM52pn/GWFpSp8dftjM3pSAHVJZscAnC/y+ySQ== dependencies: - react-remove-scroll-bar "^2.3.4" + react-remove-scroll-bar "^2.3.6" react-style-singleton "^2.2.1" tslib "^2.1.0" use-callback-ref "^1.3.0" use-sidecar "^1.1.2" -react-router-dom@6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.26.0.tgz#8debe13295c58605c04f93018d659a763245e58c" - integrity sha512-RRGUIiDtLrkX3uYcFiCIxKFWMcWQGMojpYZfcstc63A1+sSnVgILGIm9gNUA6na3Fm1QuPGSBQH2EMbAZOnMsQ== +react-router-dom@6.27.0: + version "6.27.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.27.0.tgz#8d7972a425fd75f91c1e1ff67e47240c5752dc3f" + integrity sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g== dependencies: - "@remix-run/router" "1.19.0" - react-router "6.26.0" + "@remix-run/router" "1.20.0" + react-router "6.27.0" -react-router@6.26.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.26.0.tgz#d5af4c46835b202348ef2b7ddacd32a2db539fde" - integrity sha512-wVQq0/iFYd3iZ9H2l3N3k4PL8EEHcb0XlU2Na8nEwmiXgIUElEH6gaJDtUQxJ+JFzmIXaQjfdpcGWaM6IoQGxg== +react-router@6.27.0: + version "6.27.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.27.0.tgz#db292474926c814c996c0ff3ef0162d1f9f60ed4" + integrity sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw== dependencies: - "@remix-run/router" "1.19.0" + "@remix-run/router" "1.20.0" react-style-singleton@^2.2.1: version "2.2.1" @@ -2840,29 +2949,29 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rollup@^4.13.0: - version "4.14.3" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.14.3.tgz#bcbb7784b35826d3164346fa6d5aac95190d8ba9" - integrity sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw== +rollup@^4.20.0: + version "4.24.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.24.0.tgz#c14a3576f20622ea6a5c9cad7caca5e6e9555d05" + integrity sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg== dependencies: - "@types/estree" "1.0.5" + "@types/estree" "1.0.6" optionalDependencies: - "@rollup/rollup-android-arm-eabi" "4.14.3" - "@rollup/rollup-android-arm64" "4.14.3" - "@rollup/rollup-darwin-arm64" "4.14.3" - "@rollup/rollup-darwin-x64" "4.14.3" - "@rollup/rollup-linux-arm-gnueabihf" "4.14.3" - "@rollup/rollup-linux-arm-musleabihf" "4.14.3" - "@rollup/rollup-linux-arm64-gnu" "4.14.3" - "@rollup/rollup-linux-arm64-musl" "4.14.3" - "@rollup/rollup-linux-powerpc64le-gnu" "4.14.3" - "@rollup/rollup-linux-riscv64-gnu" "4.14.3" - "@rollup/rollup-linux-s390x-gnu" "4.14.3" - "@rollup/rollup-linux-x64-gnu" "4.14.3" - "@rollup/rollup-linux-x64-musl" "4.14.3" - "@rollup/rollup-win32-arm64-msvc" "4.14.3" - "@rollup/rollup-win32-ia32-msvc" "4.14.3" - "@rollup/rollup-win32-x64-msvc" "4.14.3" + "@rollup/rollup-android-arm-eabi" "4.24.0" + "@rollup/rollup-android-arm64" "4.24.0" + "@rollup/rollup-darwin-arm64" "4.24.0" + "@rollup/rollup-darwin-x64" "4.24.0" + "@rollup/rollup-linux-arm-gnueabihf" "4.24.0" + "@rollup/rollup-linux-arm-musleabihf" "4.24.0" + "@rollup/rollup-linux-arm64-gnu" "4.24.0" + "@rollup/rollup-linux-arm64-musl" "4.24.0" + "@rollup/rollup-linux-powerpc64le-gnu" "4.24.0" + "@rollup/rollup-linux-riscv64-gnu" "4.24.0" + "@rollup/rollup-linux-s390x-gnu" "4.24.0" + "@rollup/rollup-linux-x64-gnu" "4.24.0" + "@rollup/rollup-linux-x64-musl" "4.24.0" + "@rollup/rollup-win32-arm64-msvc" "4.24.0" + "@rollup/rollup-win32-ia32-msvc" "4.24.0" + "@rollup/rollup-win32-x64-msvc" "4.24.0" fsevents "~2.3.2" run-parallel@^1.1.9: @@ -2872,10 +2981,10 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -sanitize-html@2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.13.0.tgz#71aedcdb777897985a4ea1877bf4f895a1170dae" - integrity sha512-Xff91Z+4Mz5QiNSLdLWwjgBDm5b1RU6xBT0+12rapjiaR7SwfRdjw8f+6Rir2MXKLrDicRFHdb51hGOAxmsUIA== +sanitize-html@2.13.1: + version "2.13.1" + resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-2.13.1.tgz#b4639b0a09574ab62b1b353cb99b1b87af742834" + integrity sha512-ZXtKq89oue4RP7abL9wp/9URJcqQNABB5GGJ2acW1sdO8JTVl92f4ygD7Yc9Ze09VAZhnt2zegeU0tbNsdcLYg== dependencies: deepmerge "^4.2.2" escape-string-regexp "^4.0.0" @@ -2930,18 +3039,16 @@ source-map-js@^1.2.0: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== + state-local@^1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/state-local/-/state-local-1.0.7.tgz#da50211d07f05748d53009bee46307a37db386d5" integrity sha512-HTEHMNieakEnoe33shBYcZ7NX83ACUjCu8c40iOGEZsngj9zRnkqS9j1pqQPXwobB0ZcVTk27REb7COQ0UR59w== -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -2979,20 +3086,20 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -tailwind-merge@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/tailwind-merge/-/tailwind-merge-2.4.0.tgz#1345209dc1f484f15159c9180610130587703042" - integrity sha512-49AwoOQNKdqKPd9CViyH5wJoSKsCDjUlzL8DxuGp3P1FsGY36NJDAa18jLZcaHAUUuTj+JB8IAo8zWgBNvBF7A== +tailwind-merge@2.5.4: + version "2.5.4" + resolved "https://registry.yarnpkg.com/tailwind-merge/-/tailwind-merge-2.5.4.tgz#4bf574e81fa061adeceba099ae4df56edcee78d1" + integrity sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q== tailwindcss-animate@1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/tailwindcss-animate/-/tailwindcss-animate-1.0.7.tgz#318b692c4c42676cc9e67b19b78775742388bef4" integrity sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA== -tailwindcss@3.4.9: - version "3.4.9" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.9.tgz#9e04cddce1924d530df62af37d3520f0e2a9d85e" - integrity sha512-1SEOvRr6sSdV5IDf9iC+NU4dhwdqzF4zKKq3sAbasUWHEM6lsMhX+eNN5gkPx1BvLFEnZQEUFbXnGj8Qlp83Pg== +tailwindcss@3.4.14: + version "3.4.14" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.4.14.tgz#6dd23a7f54ec197b19159e91e3bb1e55e7aa73ac" + integrity sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA== dependencies: "@alloc/quick-lru" "^5.2.0" arg "^5.0.2" @@ -3080,10 +3187,10 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -typescript@5.5.4: - version "5.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" - integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== +typescript@5.6.3: + version "5.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.3.tgz#5f3449e31c9d94febb17de03cc081dd56d81db5b" + integrity sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw== update-browserslist-db@^1.1.0: version "1.1.0" @@ -3129,14 +3236,14 @@ vite-tsconfig-paths@5.0.1: globrex "^0.1.2" tsconfck "^3.0.3" -vite@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.0.tgz#11dca8a961369ba8b5cae42d068c7ad684d5370f" - integrity sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg== +vite@5.4.9: + version "5.4.9" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.9.tgz#215c80cbebfd09ccbb9ceb8c0621391c9abdc19c" + integrity sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg== dependencies: esbuild "^0.21.3" - postcss "^8.4.40" - rollup "^4.13.0" + postcss "^8.4.43" + rollup "^4.20.0" optionalDependencies: fsevents "~2.3.3" diff --git a/lib/command/src/lib.rs b/lib/command/src/lib.rs index 71e20df43..558c314cc 100644 --- a/lib/command/src/lib.rs +++ b/lib/command/src/lib.rs @@ -2,7 +2,7 @@ use std::path::Path; use komodo_client::{ entities::{komodo_timestamp, update::Log}, - parser::parse_multiline_command, + parsers::parse_multiline_command, }; use run_command::{async_run_command, CommandOutput}; @@ -14,8 +14,13 @@ pub async fn run_komodo_command( stage: &str, path: impl Into>, command: impl AsRef, + parse_multiline: bool, ) -> Log { - let command = parse_multiline_command(command); + let command = if parse_multiline { + parse_multiline_command(command) + } else { + command.as_ref().to_string() + }; let command = if let Some(path) = path.into() { format!("cd {} && {command}", path.display(),) } else { diff --git a/lib/git/src/clone.rs b/lib/git/src/clone.rs index f188133f7..0abbffd0b 100644 --- a/lib/git/src/clone.rs +++ b/lib/git/src/clone.rs @@ -117,6 +117,7 @@ where "on clone", on_clone_path.as_ref(), full_command, + true, ) .await; @@ -139,6 +140,7 @@ where "on clone", on_clone_path.as_ref(), &command.command, + true, ) .await; tracing::debug!( @@ -169,6 +171,7 @@ where "on pull", on_pull_path.as_ref(), &full_command, + true, ) .await; @@ -191,6 +194,7 @@ where "on pull", on_pull_path.as_ref(), &command.command, + true, ) .await; tracing::debug!( @@ -253,6 +257,7 @@ async fn clone_inner( "set commit", destination, format!("git reset --hard {commit}",), + false, ) .await; logs.push(reset_log); diff --git a/lib/git/src/commit.rs b/lib/git/src/commit.rs index 06d130b87..bc3361899 100644 --- a/lib/git/src/commit.rs +++ b/lib/git/src/commit.rs @@ -66,6 +66,7 @@ pub async fn commit_file_inner( "add files", repo_dir, format!("git add {}", file.display()), + false, ) .await; res.logs.push(add_log); @@ -77,8 +78,9 @@ pub async fn commit_file_inner( "commit", repo_dir, format!( - "git commit -m \"[Komodo] {commit_msg}: update {file:?}\"" + "git commit -m \"[Komodo] {commit_msg}: update {file:?}\"", ), + false, ) .await; res.logs.push(commit_log); @@ -102,7 +104,7 @@ pub async fn commit_file_inner( }; let push_log = - run_komodo_command("push", repo_dir, "git push -f").await; + run_komodo_command("push", repo_dir, "git push -f", false).await; res.logs.push(push_log); } @@ -114,7 +116,8 @@ pub async fn commit_all(repo_dir: &Path, message: &str) -> GitRes { let mut res = GitRes::default(); let add_log = - run_komodo_command("add files", repo_dir, "git add -A").await; + run_komodo_command("add files", repo_dir, "git add -A", false) + .await; res.logs.push(add_log); if !all_logs_success(&res.logs) { return res; @@ -124,6 +127,7 @@ pub async fn commit_all(repo_dir: &Path, message: &str) -> GitRes { "commit", repo_dir, format!("git commit -m \"[Komodo] {message}\""), + false, ) .await; res.logs.push(commit_log); @@ -147,7 +151,7 @@ pub async fn commit_all(repo_dir: &Path, message: &str) -> GitRes { }; let push_log = - run_komodo_command("push", repo_dir, "git push -f").await; + run_komodo_command("push", repo_dir, "git push -f", false).await; res.logs.push(push_log); res diff --git a/lib/git/src/pull.rs b/lib/git/src/pull.rs index e96d82c26..d74def637 100644 --- a/lib/git/src/pull.rs +++ b/lib/git/src/pull.rs @@ -45,6 +45,7 @@ where "set git remote", path.as_ref(), format!("git remote set-url origin {repo_url}"), + false, ) .await; @@ -69,6 +70,7 @@ where "checkout branch", path.as_ref(), format!("git checkout -f {}", args.branch), + false, ) .await; @@ -85,6 +87,7 @@ where "git pull", path.as_ref(), format!("git pull --rebase --force origin {}", args.branch), + false, ) .await; @@ -104,6 +107,7 @@ where "set commit", path.as_ref(), format!("git reset --hard {commit}"), + false, ) .await; logs.push(reset_log); @@ -175,6 +179,7 @@ where "on pull", on_pull_path.as_ref(), &full_command, + true, ) .await; @@ -197,6 +202,7 @@ where "on pull", on_pull_path.as_ref(), &command.command, + true, ) .await; tracing::debug!( diff --git a/roadmap.md b/roadmap.md index be355e801..56dbbd496 100644 --- a/roadmap.md +++ b/roadmap.md @@ -10,7 +10,8 @@ If you have an idea for Komodo, feel free to open an issue beginning with the `[ - **v1.13**: Support "Compose" resource - Paste in a docker compose file and manage it like a Portainer "Stack" ✅ - **v1.14**: Manage docker networks, images, volumes in the UI ✅ - **v1.15**: Support generic OIDC providers (including self-hosted) ✅ -- **v1.16**: Support "Swarm" resource - Manage docker swarms, attach Deployments / Stacks to "Swarm". -- **v1.17+**: Support "Cluster" resource - Manage Kubernetes cluster, can attach deployments to "Cluster" (in addition to existing "Server") +- **v1.16**: "Action" resource: Run requests on the Komodo API using snippets of typescript. +- **v1.17**: Support "Swarm" resource - Manage docker swarms, attach Deployments / Stacks to "Swarm". +- **v1.18+**: Support "Cluster" resource - Manage Kubernetes cluster, can attach deployments to "Cluster" (in addition to existing "Server") **Note. The specific versions associated with these features are not final.** \ No newline at end of file diff --git a/runfile.toml b/runfile.toml index 777122ad5..4f2512f96 100644 --- a/runfile.toml +++ b/runfile.toml @@ -1,19 +1,18 @@ -[gen-ts-types] -description = "generates typescript types for the ts client" -path = "." -cmd = "node ./client/core/ts/generate_types.mjs" - -[build-ts-client] -path = "client/core/ts" -cmd = "yarn build" - [start-frontend] path = "frontend" cmd = "yarn dev" +[gen-client] +description = "generates typescript types and build the ts client" +cmd = """ +node ./client/core/ts/generate_types.mjs && \ +cd ./client/core/ts && yarn build && \ +cp -r dist/. ../../../frontend/public/client/.""" + [build-frontend] path = "frontend" cmd = "yarn build" +after = "gen-client" [publish-typescript] path = "client/core/ts" @@ -47,4 +46,4 @@ path = "docsite" cmd = "yarn deploy" # [rustdoc-server] -# cmd = "cargo watch -s 'cargo doc --no-deps -p komodo_client' & http --quiet target/doc" \ No newline at end of file +# cmd = "cargo watch -s 'cargo doc --no-deps -p komodo_client' & http --quiet target/doc" diff --git a/test.core.config.toml b/test.core.config.toml index 9aad808ef..51706296c 100644 --- a/test.core.config.toml +++ b/test.core.config.toml @@ -7,6 +7,7 @@ port = 9121 passkey = "a_random_passkey" sync_directory = ".komodo/syncs" repo_directory = ".komodo/core-repos" +action_directory = ".komodo/actions" frontend_path = "frontend/dist" first_server = "http://localhost:8121"