diff --git a/Cargo.lock b/Cargo.lock index 5b7c818..6921151 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,17 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -82,6 +93,15 @@ version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "async-trait" version = "0.1.88" @@ -177,6 +197,21 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + [[package]] name = "bytecount" version = "0.6.9" @@ -189,12 +224,42 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +[[package]] +name = "bzip2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea8dcd42434048e4f7a304411d9273a411f647446c1234a65ce0554923f4cff" +dependencies = [ + "libbz2-rs-sys", +] + +[[package]] +name = "cc" +version = "1.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + [[package]] name = "cfg-if" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clap" version = "4.5.41" @@ -239,13 +304,19 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" name = "cli" version = "0.0.1" dependencies = [ + "bytes", "clap", "code0-definition-reader", "colored", + "futures", "notify", + "reqwest", + "serde", "serde_json", "tabled", + "tokio", "tucana", + "zip", ] [[package]] @@ -273,6 +344,46 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.15" @@ -288,12 +399,79 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "deflate64" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "either" version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -334,12 +512,47 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "libz-rs-sys", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -349,6 +562,21 @@ dependencies = [ "libc", ] +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.31" @@ -356,6 +584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -364,6 +593,34 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "futures-sink" version = "0.3.31" @@ -382,10 +639,37 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", + "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] @@ -443,6 +727,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "http" version = "1.3.1" @@ -510,6 +803,22 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-timeout" version = "0.5.2" @@ -523,12 +832,29 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f66d5bd4c6f02bf0542fad85d626775bab9258cf795a4256dcaf3161114d1df" dependencies = [ + "base64", "bytes", "futures-channel", "futures-core", @@ -536,81 +862,237 @@ dependencies = [ "http", "http-body", "hyper", + "ipnet", "libc", + "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.5.10", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] -name = "indexmap" -version = "2.10.0" +name = "icu_collections" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ - "equivalent", - "hashbrown", + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "inotify" -version = "0.9.6" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ - "bitflags 1.3.2", - "inotify-sys", - "libc", + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", ] [[package]] -name = "inotify-sys" -version = "0.1.5" +name = "icu_normalizer" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ - "libc", + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", ] [[package]] -name = "io-uring" -version = "0.7.8" +name = "icu_normalizer_data" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "libc", + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" +name = "icu_properties_data" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] -name = "itertools" -version = "0.14.0" +name = "icu_provider" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ - "either", + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", ] [[package]] -name = "itoa" -version = "1.0.15" +name = "idna" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] [[package]] -name = "kqueue" -version = "1.1.1" +name = "idna_adapter" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "inotify" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" +dependencies = [ + "bitflags 1.3.2", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "io-uring" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "libc", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jobserver" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "kqueue" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac30106d7dce88daf4a3fcb4879ea939476d5074a9b7ddd0fb97fa4bed5596a" dependencies = [ "kqueue-sys", "libc", @@ -632,12 +1114,38 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "libbz2-rs-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775bf80d5878ab7c2b1080b5351a48b2f737d9f6f8b383574eebcc22be0dfccb" + [[package]] name = "libc" version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +[[package]] +name = "liblzma" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0791ab7e08ccc8e0ce893f6906eb2703ed8739d8e89b57c0714e71bad09024c8" +dependencies = [ + "liblzma-sys", +] + +[[package]] +name = "liblzma-sys" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b9596486f6d60c3bbe644c0e1be1aa6ccc472ad630fe8927b456973d7cb736" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "libredox" version = "0.1.6" @@ -649,12 +1157,27 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "libz-rs-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221" +dependencies = [ + "zlib-rs", +] + [[package]] name = "linux-raw-sys" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + [[package]] name = "log" version = "0.4.27" @@ -717,6 +1240,23 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "notify" version = "6.1.1" @@ -736,6 +1276,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "object" version = "0.36.7" @@ -757,6 +1303,50 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +[[package]] +name = "openssl" +version = "0.10.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "papergrid" version = "0.11.0" @@ -768,6 +1358,16 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", + "hmac", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -816,6 +1416,33 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppmd-rust" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c834641d8ad1b348c9ee86dec3b9840d805acd5f24daa5f90c788951a52ff59b" + [[package]] name = "prettyplease" version = "0.2.35" @@ -964,6 +1591,63 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +[[package]] +name = "reqwest" +version = "0.12.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rustc-demangle" version = "0.1.25" @@ -983,6 +1667,39 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "rustls" +version = "0.23.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.21" @@ -1004,6 +1721,38 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" version = "1.0.219" @@ -1036,6 +1785,41 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "slab" version = "0.4.10" @@ -1058,11 +1842,33 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -1091,6 +1897,41 @@ name = "sync_wrapper" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.9.1", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] name = "tabled" @@ -1123,17 +1964,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom", + "getrandom 0.3.3", "once_cell", "rustix", "windows-sys 0.59.0", ] +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tokio" -version = "1.46.1" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" +checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35" dependencies = [ "backtrace", "bytes", @@ -1142,9 +2012,9 @@ dependencies = [ "mio 1.0.4", "pin-project-lite", "slab", - "socket2", + "socket2 0.6.0", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1158,6 +2028,26 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.17" @@ -1202,7 +2092,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "socket2", + "socket2 0.5.10", "tokio", "tokio-stream", "tower", @@ -1244,6 +2134,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags 2.9.1", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -1307,6 +2215,12 @@ dependencies = [ "tonic-build", ] +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + [[package]] name = "unicode-ident" version = "1.0.18" @@ -1319,12 +2233,41 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -1365,6 +2308,100 @@ dependencies = [ "wit-bindgen-rt", ] +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.104", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi-util" version = "0.1.9" @@ -1374,6 +2411,41 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-registry" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1603,3 +2675,180 @@ checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags 2.9.1", ] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "zip" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aed4ac33e8eb078c89e6cbb1d5c4c7703ec6d299fc3e7c3695af8f8b423468b" +dependencies = [ + "aes", + "arbitrary", + "bzip2", + "constant_time_eq", + "crc32fast", + "deflate64", + "flate2", + "getrandom 0.3.3", + "hmac", + "indexmap", + "liblzma", + "memchr", + "pbkdf2", + "ppmd-rust", + "sha1", + "time", + "zeroize", + "zopfli", + "zstd", +] + +[[package]] +name = "zlib-rs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a" + +[[package]] +name = "zopfli" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfc5ee405f504cd4984ecc6f14d02d55cfda60fa4b689434ef4102aae150cd7" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.15+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 7bdb7c8..d473209 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,15 @@ edition = "2024" serde = "1.0.219" serde_json = "1.0.140" tucana = "0.0.32" -clap = { version = "4.5.41" } +clap = "4.5.41" colored = "2.0" tabled = "0.15" notify = "6.0" +reqwest = "0.12.22" +tokio = "1.47.0" +futures = "0.3.31" +zip = "4.3.0" +bytes = "1.10.1" [workspace.dependencies.code0-definition-reader] path = "../code0-definition/reader/rust" diff --git a/README.md b/README.md index 575c2fb..2e0de58 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Definitions +This repository contains all definitions for Code0. These definitions will be used to create a Flow. It also contains a CLI tool for managing definitions and a reader for reading all definitions. ## Definition CLI @@ -7,13 +8,28 @@ ### Usage (Stay inside the root directory when running the command) -### General Report + +#### Download +Will download the latest Definitions from the Code0 Definition Repository. + +If no feature is specified, all features will be downloaded. If a feature is specified, only that feature will be kept & can be loaded by one of the following languages: TypeScript, Rust. + +```bash +./cargo run download +./cargo run download -f feature_1 feature_2 feature_3 +``` + +#### General Report +Will create a report of all errors in the definitions. + ```bash ./cargo run report ./cargo run report -p /path/to/definitions ``` -### Feature Report +#### Feature Report +Will create a report of all errors in the definitions for a specific feature. Will also report on all specified functions, data types, and flow types. + ```bash ./cargo run feature ./cargo run feature -p /path/to/definitions @@ -21,13 +37,17 @@ ./cargo run feature -f feature_name -p /path/to/definitions ``` -### Watch for Changes +#### Watch for Changes +Will run the report each time a definition file changes. + ```bash ./cargo run watch ./cargo run watch -p /path/to/definitions ``` -### Definition +#### Definition +Will search for a specific definition. + ```bash ./cargo run definition -n definition_name ./cargo run definition -n definition_name -p /path/to/definitions @@ -53,3 +73,24 @@ for (const feature in features) { } ``` +## Rust Definition Package + +### Install Package +```bash +cargo add code0-definition-reader +``` + +### Usage + +```rs +use code0_definition_reader::Definition; + +let features = Definition::new("./path/to/definitions"); + +for feature in features { + let name = feature.name(); //name of the feature (e.g. rest) + let data_types = feature.data_types(); //dataTypes of this feature + let flow_types = feature.flow_types(); //flowTypes of this feature + let functions = feature.runtime_functions(); //runtimeFunctions of this feature +} +``` diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b354504..d29acd4 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -11,3 +11,9 @@ colored = { workspace = true } tabled = { workspace = true } notify = { workspace = true } serde_json = { workspace = true } +reqwest = { workspace = true, features = ["json", "stream"] } +serde = { workspace = true, features = ["derive"] } +tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] } +futures = { workspace = true } +zip = { workspace = true } +bytes = { workspace = true } diff --git a/cli/src/command/definition.rs b/cli/src/command/definition.rs new file mode 100644 index 0000000..e827e21 --- /dev/null +++ b/cli/src/command/definition.rs @@ -0,0 +1,122 @@ +use code0_definition_reader::parser::Parser; +use colored::Colorize; + +pub fn search_definition(name: String, path: Option) { + let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); + + let parser = match Parser::from_path(dir_path.as_str()) { + Some(reader) => reader, + None => { + panic!("Error reading definitions"); + } + }; + + search_and_display_definitions(&name, &parser); +} + +fn search_and_display_definitions(search_name: &str, parser: &Parser) { + let mut found_any = false; + let mut total_matches = 0; + println!( + "{}", + format!("Searching for definitions matching: '{search_name}'") + .bright_yellow() + .bold() + ); + println!("{}", "─".repeat(60).dimmed()); + + for feature in &parser.features { + // Search FlowTypes + for flow_type in &feature.flow_types { + if flow_type.identifier == search_name { + total_matches += 1; + if !found_any { + found_any = true; + } + + println!("\n{}", "FlowType".bright_cyan().bold()); + match serde_json::to_string_pretty(flow_type) { + Ok(json) => { + let mut index = 0; + for line in json.lines() { + index += 1; + println!( + "{} {}", + format!("{index}:").bright_blue(), + line.bright_green() + ); + } + } + Err(_) => println!("{}", "Error serializing FlowType".red()), + } + } + } + + // Search DataTypes + for data_type in &feature.data_types { + if data_type.identifier == search_name { + total_matches += 1; + if !found_any { + found_any = true; + } + + println!("\n{}", "DataType".bright_cyan().bold()); + match serde_json::to_string_pretty(data_type) { + Ok(json) => { + let mut index = 0; + for line in json.lines() { + index += 1; + println!( + "{} {}", + format!("{index}:").bright_blue(), + line.bright_green() + ); + } + } + Err(_) => println!("{}", "Error serializing DataType".red()), + } + } + } + + // Search RuntimeFunctions + for runtime_func in &feature.runtime_functions { + if runtime_func.runtime_name == search_name { + total_matches += 1; + if !found_any { + found_any = true; + } + + println!("\n{}", "RuntimeFunction".bright_cyan().bold()); + match serde_json::to_string_pretty(runtime_func) { + Ok(json) => { + let mut index = 0; + for line in json.lines() { + index += 1; + println!( + "{} {}", + format!("{index}:").bright_blue(), + line.bright_green() + ); + } + } + Err(_) => println!("{}", "Error serializing RuntimeFunction".red()), + } + } + } + } + + if !found_any { + println!( + "\n{}", + format!("No definitions found matching '{search_name}'") + .red() + .bold() + ); + } else { + println!("\n{}", "─".repeat(60).dimmed()); + println!( + "{}", + format!("Found {total_matches} matching definition(s)").bright_yellow() + ); + } +} diff --git a/cli/src/command/download.rs b/cli/src/command/download.rs new file mode 100644 index 0000000..ed137ce --- /dev/null +++ b/cli/src/command/download.rs @@ -0,0 +1,477 @@ +use bytes::Bytes; +use colored::*; +use reqwest::header::{ACCEPT, USER_AGENT}; +use serde::Deserialize; +use std::fs; +use std::fs::File; +use zip::ZipArchive; + +#[derive(Deserialize, Debug)] +struct Release { + tag_name: String, + assets: Vec, +} + +#[derive(Deserialize, Debug)] +struct Asset { + name: String, + browser_download_url: String, + size: u64, +} + +pub async fn handle_download(features: Option>) { + println!( + "{}", + "╔══════════════════════════════════════════════════════════════════════════════╗" + .bright_cyan() + ); + println!( + "{} {} {}", + "║".bright_cyan(), + "DOWNLOADING DEFINITIONS".bright_white().bold().on_blue(), + "║".bright_cyan() + ); + println!( + "{}", + "╚══════════════════════════════════════════════════════════════════════════════╝" + .bright_cyan() + ); + + let out_folder_path = "./definitions"; + let zip_path = "./definitions.zip"; + + // Check if definitions folder already exists + println!( + "\n{} Checking for existing definitions folder...", + "🔍".bright_blue() + ); + if let Ok(true) = fs::exists(out_folder_path) { + println!( + "{} {}", + "❌".red(), + format!("Definitions folder already exists at '{out_folder_path}'") + .red() + .bold() + ); + println!( + "{}", + " To prevent accidental deletion, please remove the existing folder manually." + .yellow() + ); + println!("{}", " Then run the download command again.".yellow()); + return; + } + println!( + "{} {}", + "✅".green(), + "No existing definitions folder found".green() + ); + + // Download the definitions + println!("\n{} Starting download process...", "📥".bright_blue()); + let bytes = match download_definitions_as_bytes().await { + Some(bytes) => { + println!( + "{} {}", + "✅".green(), + format!("Successfully downloaded {} bytes", bytes.len()).green() + ); + bytes + } + None => { + println!("{} {}", "❌".red(), "Download failed".red().bold()); + return; + } + }; + + // Extract the zip file + println!("\n{} Extracting definitions...", "📦".bright_blue()); + convert_bytes_to_folder(bytes, zip_path).await; + + // Handle feature filtering if specified + if let Some(selected_features) = features { + println!("\n{} Filtering features...", "🔧".bright_blue()); + println!( + "{}", + format!("Selected features: {}", selected_features.join(", ")).bright_cyan() + ); + + filter_features(selected_features).await; + } else { + println!( + "\n{} {}", + "ℹ️".bright_blue(), + "No feature filtering specified - keeping all features".bright_cyan() + ); + } + + println!("\n{}", "═".repeat(80).bright_cyan()); + println!( + "{} {}", + "🎉".bright_green(), + "Download completed successfully!".bright_green().bold() + ); + println!( + "{} {}", + "📁".bright_blue(), + format!("Definitions are now available in: {out_folder_path}").bright_cyan() + ); + println!("{}", "═".repeat(80).bright_cyan()); +} + +async fn download_definitions_as_bytes() -> Option { + let client = reqwest::Client::new(); + let url = "https://api.github.com/repos/code0-tech/code0-definition/releases/latest"; + + println!( + "{} Fetching latest release information...", + "🌐".bright_blue() + ); + + let release_request = match client + .get(url) + .header(USER_AGENT, "code0-definition-cli") + .header(ACCEPT, "application/vnd.github+json") + .send() + .await + { + Ok(response) => { + if response.status().is_success() { + println!( + "{} {}", + "✅".green(), + "Successfully connected to GitHub API".green() + ); + response + } else { + println!( + "{} {}", + "❌".red(), + format!( + "GitHub API request failed with status: {}", + response.status() + ) + .red() + ); + return None; + } + } + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Failed to connect to GitHub API: {e}").red() + ); + return None; + } + }; + + let release: Release = match release_request.json::().await { + Ok(release) => { + println!( + "{} {}", + "✅".green(), + format!("Found latest release: {}", release.tag_name).green() + ); + release + } + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Failed to parse release information: {e}").red() + ); + return None; + } + }; + + let asset = match release + .assets + .into_iter() + .find(|a| a.name == "definitions.zip") + { + Some(asset) => { + println!( + "{} {}", + "✅".green(), + format!( + "Found definitions.zip ({:.2} MB)", + asset.size as f64 / 1024.0 / 1024.0 + ) + .green() + ); + asset + } + None => { + println!( + "{} {}", + "❌".red(), + "definitions.zip not found in latest release".red() + ); + return None; + } + }; + + println!("{} Downloading definitions.zip...", "⬇️".bright_blue()); + + match client + .get(&asset.browser_download_url) + .header(USER_AGENT, "code0-definition-cli") + .send() + .await + { + Ok(response) => { + if response.status().is_success() { + match response.bytes().await { + Ok(bytes) => { + println!( + "{} {}", + "✅".green(), + "Download completed successfully".green() + ); + Some(bytes) + } + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Failed to read download data: {e}").red() + ); + None + } + } + } else { + println!( + "{} {}", + "❌".red(), + format!("Download failed with status: {}", response.status()).red() + ); + None + } + } + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Download request failed: {e}").red() + ); + None + } + } +} + +async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) { + println!("{} Writing zip file to disk...", "💾".bright_blue()); + + if let Err(e) = fs::write(zip_path, &bytes) { + println!( + "{} {}", + "❌".red(), + format!("Failed to write zip file: {e}").red() + ); + return; + } + println!( + "{} {}", + "✅".green(), + "Zip file written successfully".green() + ); + + println!("{} Opening zip archive...", "📂".bright_blue()); + let zip_file = match File::open(zip_path) { + Ok(file) => file, + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Failed to open zip file: {e}").red() + ); + return; + } + }; + + let mut archive = match ZipArchive::new(zip_file) { + Ok(archive) => { + println!( + "{} {}", + "✅".green(), + format!("Successfully opened archive with {} files", archive.len()).green() + ); + archive + } + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Failed to read zip archive: {e}").red() + ); + return; + } + }; + + println!("{} Extracting files...", "📤".bright_blue()); + let mut extracted_count = 0; + let total_files = archive.len(); + + for i in 0..archive.len() { + let mut file = match archive.by_index(i) { + Ok(file) => file, + Err(e) => { + println!( + "{} {}", + "⚠️".yellow(), + format!("Warning: Failed to read file at index {i}: {e}").yellow() + ); + continue; + } + }; + + let out_path = match file.enclosed_name() { + Some(path) => path, + None => continue, + }; + + if file.name().ends_with('/') { + if let Err(e) = std::fs::create_dir_all(&out_path) { + println!( + "{} {}", + "⚠️".yellow(), + format!( + "Warning: Failed to create directory {}: {}", + out_path.display(), + e + ) + .yellow() + ); + } + } else { + if let Some(p) = out_path.parent() { + if !p.exists() { + if let Err(e) = std::fs::create_dir_all(p) { + println!( + "{} {}", + "⚠️".yellow(), + format!( + "Warning: Failed to create parent directory {}: {}", + p.display(), + e + ) + .yellow() + ); + continue; + } + } + } + + match File::create(&out_path) { + Ok(mut outfile) => { + if let Err(e) = std::io::copy(&mut file, &mut outfile) { + println!( + "{} {}", + "⚠️".yellow(), + format!("Warning: Failed to extract {}: {}", out_path.display(), e) + .yellow() + ); + } else { + extracted_count += 1; + } + } + Err(e) => { + println!( + "{} {}", + "⚠️".yellow(), + format!( + "Warning: Failed to create file {}: {}", + out_path.display(), + e + ) + .yellow() + ); + } + } + } + } + + println!( + "{} {}", + "✅".green(), + format!("Successfully extracted {extracted_count}/{total_files} files").green() + ); + + // Clean up zip file + println!("{} Cleaning up temporary files...", "🧹".bright_blue()); + match fs::remove_file(zip_path) { + Ok(_) => println!("{} {}", "✅".green(), "Temporary zip file removed".green()), + Err(e) => println!( + "{} {}", + "⚠️".yellow(), + format!("Warning: Failed to remove temporary zip file: {e}").yellow() + ), + } +} + +async fn filter_features(selected_features: Vec) { + let definitions_path = "./definitions"; + + match fs::read_dir(definitions_path) { + Ok(entries) => { + let mut removed_count = 0; + let mut kept_count = 0; + + for entry in entries { + let directory = match entry { + Ok(directory) => directory, + Err(e) => { + println!( + "{} {}", + "⚠️".yellow(), + format!("Warning: Failed to read directory entry: {e}").yellow() + ); + continue; + } + }; + + let name = directory.file_name().to_str().unwrap_or("").to_string(); + + if !selected_features.contains(&name) { + println!(" {} Removing feature: {}", "🗑️".red(), name.red()); + match fs::remove_dir_all(directory.path()) { + Ok(_) => { + println!(" {} Successfully removed", "✅".green()); + removed_count += 1; + } + Err(e) => { + println!( + " {} Failed to remove: {}", + "❌".red(), + e.to_string().red() + ); + } + } + } else { + println!(" {} Keeping feature: {}", "📁".green(), name.green()); + kept_count += 1; + } + } + + println!("\n{} Feature filtering completed:", "📊".bright_blue()); + println!( + " {} Features kept: {}", + "✅".green(), + kept_count.to_string().green().bold() + ); + println!( + " {} Features removed: {}", + "🗑️".red(), + removed_count.to_string().red().bold() + ); + } + Err(e) => { + println!( + "{} {}", + "❌".red(), + format!("Failed to read definitions directory: {e}").red() + ); + } + } +} diff --git a/cli/src/command/feature.rs b/cli/src/command/feature.rs new file mode 100644 index 0000000..fe47324 --- /dev/null +++ b/cli/src/command/feature.rs @@ -0,0 +1,29 @@ +use crate::table::{feature_table, summary_table}; +use code0_definition_reader::parser::Parser; + +pub fn search_feature(name: Option, path: Option) { + let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); + + let parser = match Parser::from_path(dir_path.as_str()) { + Some(reader) => reader, + None => { + panic!("Error reading definitions"); + } + }; + + if let Some(feature_name) = name { + let mut features_to_report = Vec::new(); + for feature in &parser.features { + if feature.name == feature_name { + feature_table(feature); + features_to_report.push(feature.clone()); + } + } + summary_table(&features_to_report); + } else { + for feature in &parser.features { + feature_table(feature); + } + summary_table(&parser.features); + } +} diff --git a/cli/src/command/mod.rs b/cli/src/command/mod.rs new file mode 100644 index 0000000..351e876 --- /dev/null +++ b/cli/src/command/mod.rs @@ -0,0 +1,5 @@ +pub mod definition; +pub mod download; +pub mod feature; +pub mod report; +pub mod watch; diff --git a/cli/src/command/report.rs b/cli/src/command/report.rs new file mode 100644 index 0000000..a16010b --- /dev/null +++ b/cli/src/command/report.rs @@ -0,0 +1,15 @@ +use crate::table::{error_table, summary_table}; +use code0_definition_reader::parser::Parser; + +pub fn report_errors(path: Option) { + let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); + + let parser = match Parser::from_path(dir_path.as_str()) { + Some(reader) => reader, + None => { + panic!("Error reading definitions"); + } + }; + error_table(&parser.features); + summary_table(&parser.features); +} diff --git a/cli/src/command/watch.rs b/cli/src/command/watch.rs new file mode 100644 index 0000000..49d6491 --- /dev/null +++ b/cli/src/command/watch.rs @@ -0,0 +1,70 @@ +use crate::table::error_table; +use code0_definition_reader::parser::Parser; +use colored::Colorize; +use notify::{Event, EventKind, RecursiveMode, Watcher, recommended_watcher}; +use std::sync::mpsc::channel; + +pub async fn watch_for_changes(path: Option) { + let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); + + println!( + "{}", + format!("Watching directory: {dir_path}") + .bright_yellow() + .bold() + ); + println!("{}", "Press Ctrl+C to stop watching...".dimmed()); + + { + let parser = match Parser::from_path(dir_path.as_str()) { + Some(reader) => reader, + None => { + panic!("Error reading definitions"); + } + }; + + error_table(&parser.features); + } + + // Set up file watcher + let (tx, rx) = channel(); + let mut watcher = recommended_watcher(tx).unwrap(); + watcher + .watch(std::path::Path::new(&dir_path), RecursiveMode::Recursive) + .unwrap(); + + loop { + match rx.recv() { + Ok(event) => match event { + Ok(Event { + kind: EventKind::Create(_), + .. + }) + | Ok(Event { + kind: EventKind::Modify(_), + .. + }) + | Ok(Event { + kind: EventKind::Remove(_), + .. + }) => { + println!( + "\n{}", + "Change detected! Regenerating report...".bright_yellow() + ); + + let parser = match Parser::from_path(dir_path.as_str()) { + Some(reader) => reader, + None => { + panic!("Error reading definitions"); + } + }; + + error_table(&parser.features); + } + _ => {} + }, + Err(e) => println!("Watch error: {e:?}"), + } + } +} diff --git a/cli/src/main.rs b/cli/src/main.rs index 512fe5c..dd9ace7 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,10 +1,6 @@ -use crate::table::*; use clap::{Parser as ClapParser, Subcommand}; -use code0_definition_reader::parser::Parser; -use colored::*; -use notify::{Event, EventKind, RecursiveMode, Watcher, recommended_watcher}; -use std::sync::mpsc::channel; +mod command; mod table; /// Top-level CLI for 'definition' @@ -49,220 +45,21 @@ enum Commands { #[arg(short, long)] path: Option, }, + Download { + #[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')] + features: Option>, + }, } -fn main() { +#[tokio::main] +async fn main() { let cli = Cli::parse(); match cli.command { - Commands::Report { path } => { - let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); - - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - error_table(&parser.features); - summary_table(&parser.features); - } - Commands::Feature { name, path } => { - let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); - - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - - if let Some(feature_name) = name { - let mut features_to_report = Vec::new(); - for feature in &parser.features { - if feature.name == feature_name { - feature_table(feature); - features_to_report.push(feature.clone()); - } - } - summary_table(&features_to_report); - } else { - for feature in &parser.features { - feature_table(feature); - } - summary_table(&parser.features); - } - } - Commands::Definition { name, path } => { - let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); - - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - - search_and_display_definitions(&name, &parser); - } - Commands::Watch { path } => { - let dir_path = path.unwrap_or_else(|| "./definitions".to_string()); - - println!( - "{}", - format!("Watching directory: {dir_path}") - .bright_yellow() - .bold() - ); - println!("{}", "Press Ctrl+C to stop watching...".dimmed()); - - { - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - - error_table(&parser.features); - } - - // Set up file watcher - let (tx, rx) = channel(); - let mut watcher = recommended_watcher(tx).unwrap(); - watcher - .watch(std::path::Path::new(&dir_path), RecursiveMode::Recursive) - .unwrap(); - - loop { - match rx.recv() { - Ok(event) => match event { - Ok(Event { - kind: EventKind::Create(_), - .. - }) - | Ok(Event { - kind: EventKind::Modify(_), - .. - }) - | Ok(Event { - kind: EventKind::Remove(_), - .. - }) => { - println!( - "\n{}", - "Change detected! Regenerating report...".bright_yellow() - ); - - let parser = match Parser::from_path(dir_path.as_str()) { - Some(reader) => reader, - None => { - panic!("Error reading definitions"); - } - }; - - error_table(&parser.features); - } - _ => {} - }, - Err(e) => println!("Watch error: {e:?}"), - } - } - } - } -} - -fn search_and_display_definitions(search_name: &str, parser: &Parser) { - let mut found_any = false; - let mut total_matches = 0; - println!( - "{}", - format!("Searching for definitions matching: '{search_name}'") - .bright_yellow() - .bold() - ); - println!("{}", "─".repeat(60).dimmed()); - - for feature in &parser.features { - // Search FlowTypes - for flow_type in &feature.flow_types { - if flow_type.identifier == search_name { - total_matches += 1; - if !found_any { - found_any = true; - } - - println!("\n{}", "FlowType".bright_cyan().bold()); - match serde_json::to_string_pretty(flow_type) { - Ok(json) => { - for line in json.lines() { - println!("{}", line.bright_green()); - } - } - Err(_) => println!("{}", "Error serializing FlowType".red()), - } - } - } - - // Search DataTypes - for data_type in &feature.data_types { - if data_type.identifier == search_name { - total_matches += 1; - if !found_any { - found_any = true; - } - - println!("\n{}", "DataType".bright_cyan().bold()); - match serde_json::to_string_pretty(data_type) { - Ok(json) => { - for line in json.lines() { - println!("{}", line.bright_green()); - } - } - Err(_) => println!("{}", "Error serializing DataType".red()), - } - } - } - - // Search RuntimeFunctions - for runtime_func in &feature.runtime_functions { - if runtime_func.runtime_name == search_name { - total_matches += 1; - if !found_any { - found_any = true; - } - - println!("\n{}", "RuntimeFunction".bright_cyan().bold()); - match serde_json::to_string_pretty(runtime_func) { - Ok(json) => { - let mut index = 0; - for line in json.lines() { - index += 1; - println!( - "{} {}", - format!("{index}:").bright_blue(), - line.bright_green() - ); - } - } - Err(_) => println!("{}", "Error serializing RuntimeFunction".red()), - } - } - } - } - - if !found_any { - println!( - "\n{}", - format!("No definitions found matching '{search_name}'") - .red() - .bold() - ); - } else { - println!("\n{}", "─".repeat(60).dimmed()); - println!( - "{}", - format!("Found {total_matches} matching definition(s)").bright_yellow() - ); + Commands::Report { path } => command::report::report_errors(path), + Commands::Feature { name, path } => command::feature::search_feature(name, path), + Commands::Definition { name, path } => command::definition::search_definition(name, path), + Commands::Download { features } => command::download::handle_download(features).await, + Commands::Watch { path } => command::watch::watch_for_changes(path).await, } }