From 03f381115c163dd2ca4c535f5cf3e9fb52309ecb Mon Sep 17 00:00:00 2001 From: Darius Clark Date: Fri, 19 May 2023 15:47:47 -0400 Subject: [PATCH] chore(cargo): Update dependency (#828) --- Cargo.lock | 216 ++++++++++-------- Cargo.toml | 8 +- common/src/lib.rs | 5 - .../commands/constellation_commands.rs | 105 +++------ .../src/warp_runner/manager/commands/mod.rs | 3 +- common/src/warp_runner/mod.rs | 14 +- ui/src/layouts/file_preview.rs | 4 +- ui/src/layouts/storage/mod.rs | 3 +- 8 files changed, 174 insertions(+), 184 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 739bb261d7b..8b35a873b42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -486,7 +486,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -503,7 +503,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1208,7 +1208,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1748,7 +1748,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1770,7 +1770,7 @@ checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" dependencies = [ "darling_core 0.20.1", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2151,7 +2151,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2338,7 +2338,7 @@ dependencies = [ "darling 0.20.1", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2416,7 +2416,7 @@ checksum = "55a9a55d1dab3b07854648d48e366f684aefe2ac78ae28cec3bf65e3cd53d9a3" dependencies = [ "execute-command-tokens", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2767,7 +2767,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -3340,9 +3340,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", @@ -3607,7 +3607,7 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" dependencies = [ - "libm 0.2.6", + "libm 0.2.7", ] [[package]] @@ -3636,13 +3636,13 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ "http", "hyper", - "rustls 0.20.8", + "rustls 0.21.1", "tokio", "tokio-rustls", ] @@ -4106,9 +4106,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -4385,9 +4385,9 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libm" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" @@ -5229,6 +5229,15 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "mediatype" +version = "0.19.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea6e62614ab2fc0faa58bb15102a0382d368f896a9fa4776592589ab55c4de7" +dependencies = [ + "serde", +] + [[package]] name = "memchr" version = "2.5.0" @@ -5648,9 +5657,9 @@ dependencies = [ [[package]] name = "notify" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ea850aa68a06e48fdb069c0ec44d0d64c8dbffa49bf3b6f7f0a901fdea1ba9" +checksum = "729f63e1ca555a43fe3efa4f3efdf4801c479da85b432242a7b726f353c88486" dependencies = [ "bitflags", "crossbeam-channel", @@ -5661,7 +5670,7 @@ dependencies = [ "libc", "mio", "walkdir", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -5903,7 +5912,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -6259,22 +6268,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.16", ] [[package]] @@ -6444,9 +6453,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" dependencies = [ "unicode-ident", ] @@ -6816,9 +6825,9 @@ checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "base64 0.21.0", "bytes", @@ -6839,7 +6848,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite 0.2.9", - "rustls 0.20.8", + "rustls 0.21.1", "rustls-pemfile", "serde", "serde_json", @@ -7145,6 +7154,18 @@ dependencies = [ "webpki 0.22.0", ] +[[package]] +name = "rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct 0.7.0", +] + [[package]] name = "rustls-pemfile" version = "1.0.2" @@ -7154,6 +7175,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rw-stream-sink" version = "0.3.0" @@ -7279,9 +7310,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "ca2855b3715770894e67cbfa3df957790aa0c9edc3bf06efa1a84d77fa0839d1" dependencies = [ "bitflags", "core-foundation", @@ -7292,9 +7323,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -7417,7 +7448,7 @@ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -7439,14 +7470,14 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] @@ -7959,9 +7990,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" dependencies = [ "proc-macro2", "quote", @@ -7982,9 +8013,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags", "core-foundation", @@ -8010,7 +8041,7 @@ dependencies = [ "cfg-expr 0.15.1", "heck 0.4.1", "pkg-config", - "toml 0.7.3", + "toml 0.7.4", "version-compare", ] @@ -8159,7 +8190,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -8328,7 +8359,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -8343,13 +8374,12 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" dependencies = [ - "rustls 0.20.8", + "rustls 0.21.1", "tokio", - "webpki 0.22.0", ] [[package]] @@ -8392,9 +8422,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ "serde", "serde_spanned", @@ -8404,18 +8434,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" dependencies = [ "indexmap", "serde", @@ -8451,7 +8481,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -8796,9 +8826,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dad5567ad0cf5b760e5665964bec1b47dfd077ba8a2544b513f3556d3d239a2" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" dependencies = [ "getrandom 0.2.9", "rand 0.8.5", @@ -8808,13 +8838,13 @@ dependencies = [ [[package]] name = "uuid-macro-internal" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d884370cccfad1f913e67c7362f9c00357844bc9f3cfce86faa2241cabd166" +checksum = "3f67b459f42af2e6e1ee213cb9da4dbd022d3320788c3fb3e1b893093f1e45da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -8889,7 +8919,7 @@ dependencies = [ [[package]] name = "warp" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=33a1c95cbb04b6a139057a1c043459799f4c8162#33a1c95cbb04b6a139057a1c043459799f4c8162" +source = "git+https://github.com/Satellite-im/Warp?rev=08486f1607d14c8702090030a39ab5687f2a00e4#08486f1607d14c8702090030a39ab5687f2a00e4" dependencies = [ "aes-gcm 0.10.1", "anyhow", @@ -8917,6 +8947,7 @@ dependencies = [ "js-sys", "libc", "libipld", + "mediatype", "multihash 0.18.1", "once_cell", "parking_lot 0.12.1", @@ -8949,7 +8980,7 @@ dependencies = [ [[package]] name = "warp-derive" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=33a1c95cbb04b6a139057a1c043459799f4c8162#33a1c95cbb04b6a139057a1c043459799f4c8162" +source = "git+https://github.com/Satellite-im/Warp?rev=08486f1607d14c8702090030a39ab5687f2a00e4#08486f1607d14c8702090030a39ab5687f2a00e4" dependencies = [ "paste", "quote", @@ -8959,15 +8990,18 @@ dependencies = [ [[package]] name = "warp-fs-ipfs" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=33a1c95cbb04b6a139057a1c043459799f4c8162#33a1c95cbb04b6a139057a1c043459799f4c8162" +source = "git+https://github.com/Satellite-im/Warp?rev=08486f1607d14c8702090030a39ab5687f2a00e4#08486f1607d14c8702090030a39ab5687f2a00e4" dependencies = [ "anyhow", "async-stream", "async-trait", "cbindgen", "chrono", + "derive_more", "futures", + "image", "libipld", + "mediatype", "rust-ipfs", "serde", "serde_json", @@ -8980,7 +9014,7 @@ dependencies = [ [[package]] name = "warp-mp-ipfs" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=33a1c95cbb04b6a139057a1c043459799f4c8162#33a1c95cbb04b6a139057a1c043459799f4c8162" +source = "git+https://github.com/Satellite-im/Warp?rev=08486f1607d14c8702090030a39ab5687f2a00e4#08486f1607d14c8702090030a39ab5687f2a00e4" dependencies = [ "anyhow", "async-stream", @@ -9003,7 +9037,7 @@ dependencies = [ [[package]] name = "warp-rg-ipfs" version = "0.1.0" -source = "git+https://github.com/Satellite-im/Warp?rev=33a1c95cbb04b6a139057a1c043459799f4c8162#33a1c95cbb04b6a139057a1c043459799f4c8162" +source = "git+https://github.com/Satellite-im/Warp?rev=08486f1607d14c8702090030a39ab5687f2a00e4#08486f1607d14c8702090030a39ab5687f2a00e4" dependencies = [ "anyhow", "async-stream", @@ -9045,9 +9079,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -9055,24 +9089,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.35" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if", "js-sys", @@ -9082,9 +9116,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9092,22 +9126,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "wasm-streams" @@ -9139,9 +9173,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", @@ -10078,9 +10112,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc95a04ea24f543cd9be5aab44f963fa35589c99e18415c38fb2b17e133bf8d2" +checksum = "1690519550bfa95525229b9ca2350c63043a4857b3b0013811b2ccf4a2420b01" [[package]] name = "xml5ever" @@ -10142,16 +10176,16 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] name = "zip" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e92305c174683d78035cbf1b70e18db6329cc0f1b9cae0a52ca90bf5bfe7125" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes 0.7.5", + "aes 0.8.2", "byteorder", "bzip2", "constant_time_eq 0.1.5", diff --git a/Cargo.toml b/Cargo.toml index 516ff45cedb..a53137d09e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,10 +43,10 @@ humansize = "2.1.3" window-vibrancy = "0.3.2" uuid = { version = "1", features = ["serde", "v4"] } libloading = "0.7.4" -warp = { git = "https://github.com/Satellite-im/Warp", rev = "33a1c95cbb04b6a139057a1c043459799f4c8162" } -warp-mp-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "33a1c95cbb04b6a139057a1c043459799f4c8162" } -warp-rg-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "33a1c95cbb04b6a139057a1c043459799f4c8162" } -warp-fs-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "33a1c95cbb04b6a139057a1c043459799f4c8162" } +warp = { git = "https://github.com/Satellite-im/Warp", rev = "08486f1607d14c8702090030a39ab5687f2a00e4" } +warp-mp-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "08486f1607d14c8702090030a39ab5687f2a00e4" } +warp-rg-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "08486f1607d14c8702090030a39ab5687f2a00e4" } +warp-fs-ipfs = { git = "https://github.com/Satellite-im/Warp", rev = "08486f1607d14c8702090030a39ab5687f2a00e4" } rfd = "0.11.3" mime = "0.3.16" serde = "1.0" diff --git a/common/src/lib.rs b/common/src/lib.rs index f612e895899..bd63d89ac89 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -161,11 +161,6 @@ pub const VIDEO_FILE_EXTENSIONS: &[&str] = &[ ".mp4", ".mov", ".mkv", ".avi", ".flv", ".wmv", ".m4v", ".3gp", ]; -pub const IMAGE_EXTENSIONS: &[&str] = &[ - ".png", ".jpg", ".jpeg", ".svg", ".heic", ".tiff", ".gif", ".webp", ".apng", ".avif", ".ico", - ".bmp", ".svgz", -]; - pub const DOC_EXTENSIONS: &[&str] = &[".doc", ".docx", ".pdf", ".txt"]; pub fn get_images_dir() -> anyhow::Result { diff --git a/common/src/warp_runner/manager/commands/constellation_commands.rs b/common/src/warp_runner/manager/commands/constellation_commands.rs index 1a6f91ef8bc..576c064bd34 100644 --- a/common/src/warp_runner/manager/commands/constellation_commands.rs +++ b/common/src/warp_runner/manager/commands/constellation_commands.rs @@ -9,18 +9,18 @@ use derive_more::Display; use futures::{channel::oneshot, StreamExt}; use humansize::{format_size, DECIMAL}; -use mime::*; use once_cell::sync::Lazy; use tempfile::TempDir; use tokio::sync::mpsc; -use crate::{state::storage::Storage as uplink_storage, IMAGE_EXTENSIONS, VIDEO_FILE_EXTENSIONS}; +use crate::{state::storage::Storage as uplink_storage, VIDEO_FILE_EXTENSIONS}; use crate::{warp_runner::Storage as warp_storage, DOC_EXTENSIONS}; use warp::{ constellation::{ directory::Directory, - item::{Item, ItemType}, + file::File, + item::{FormatType, Item, ItemType}, Progression, }, error::Error, @@ -473,7 +473,6 @@ async fn upload_files( } let video_formats = VIDEO_FILE_EXTENSIONS.to_vec(); - let image_formats = IMAGE_EXTENSIONS.to_vec(); let doc_formats = DOC_EXTENSIONS.to_vec(); let file_extension = std::path::Path::new(&filename) @@ -482,23 +481,6 @@ async fn upload_files( .map(|s| format!(".{s}")) .unwrap_or_default(); - if image_formats.iter().any(|f| f == &file_extension) { - match set_thumbnail_if_file_is_image(warp_storage, filename.clone()).await { - Ok(_) => { - log::info!("Image Thumbnail uploaded"); - let _ = tx.send(FileTransferProgress::Step( - FileTransferStep::Thumbnail(Some(())), - )); - } - Err(error) => { - log::error!("Not possible to update thumbnail for image: {:?}", error); - let _ = tx.send(FileTransferProgress::Step( - FileTransferStep::Thumbnail(None), - )); - } - }; - } - if video_formats.iter().any(|f| f == &file_extension) { match set_thumbnail_if_file_is_video( warp_storage, @@ -635,15 +617,14 @@ async fn set_thumbnail_if_file_is_video( if let Some(mut child) = output.stdout { let mut contents = vec![]; - child.read_to_end(&mut contents)?; let image = std::fs::read(temp_path)?; - let prefix = format!("data:{};base64,", IMAGE_JPEG); - let base64_image = base64::encode(image); - let img = prefix + base64_image.as_str(); - item.set_thumbnail(&img); + item.set_thumbnail(&image); + item.set_thumbnail_format(FormatType::Mime( + "image/jpeg".parse().expect("Correct mime type"), + )); Ok(()) } else { log::warn!("Failed to save thumbnail from a video file"); @@ -697,11 +678,10 @@ async fn set_thumbnail_if_file_is_document( let path_2 = format!("{}.jpg", temp_path.to_string_lossy()); std::thread::sleep(std::time::Duration::from_secs(1)); let image = std::fs::read(path_2)?; - - let prefix = format!("data:{};base64,", IMAGE_JPEG); - let base64_image = base64::encode(image); - let img = prefix + base64_image.as_str(); - item.set_thumbnail(&img); + item.set_thumbnail(&image); + item.set_thumbnail_format(FormatType::Mime( + "image/jpeg".parse().expect("Correct mime type"), + )); Ok(()) } else { log::warn!("Failed to save thumbnail from a document file"); @@ -712,50 +692,6 @@ async fn set_thumbnail_if_file_is_document( .map_err(anyhow::Error::from)? } -async fn set_thumbnail_if_file_is_image( - warp_storage: &warp_storage, - filename_to_save: String, -) -> Result<(), Error> { - let item = warp_storage - .current_directory()? - .get_item(&filename_to_save)?; - let file = warp_storage.get_buffer(&filename_to_save).await?; - - // Since files selected are filtered to be jpg, jpeg, png or svg the last branch is not reachable - let extension = Path::new(&filename_to_save) - .extension() - .and_then(OsStr::to_str) - .map(|ext| ext.to_lowercase()); - - let mime = match extension { - Some(m) => match m.as_str() { - "png" => IMAGE_PNG.to_string(), - "jpg" => IMAGE_JPEG.to_string(), - "jpeg" => IMAGE_JPEG.to_string(), - "svg" => IMAGE_SVG.to_string(), - _ => { - log::warn!("invalid mime type: {m:?}"); - return Err(Error::InvalidItem); - } - }, - None => { - log::warn!("thumbnail has no mime type"); - return Err(Error::InvalidItem); - } - }; - - if !file.is_empty() { - let prefix = format!("data:{mime};base64,"); - let base64_image = base64::encode(&file); - let img = prefix + base64_image.as_str(); - item.set_thumbnail(&img); - Ok(()) - } else { - log::warn!("thumbnail file is empty"); - Err(Error::InvalidItem) - } -} - async fn download_file( warp_storage: &warp_storage, file_name: String, @@ -767,3 +703,22 @@ async fn download_file( log::info!("{file_name} downloaded"); Ok(()) } + +pub fn thumbnail_to_base64(file: &File) -> String { + let thumbnail = file.thumbnail(); + + if thumbnail.is_empty() { + return String::new(); + } + + let ty = file.thumbnail_format(); + let mime = match ty { + FormatType::Mime(mime) => mime.to_string(), + FormatType::Generic => "application/octet-stream".into(), + }; + + let prefix = format!("data:image/{mime};base64,"); + let base64_image = base64::encode(thumbnail); + + prefix + &base64_image +} diff --git a/common/src/warp_runner/manager/commands/mod.rs b/common/src/warp_runner/manager/commands/mod.rs index a21c9f759d1..c18eb54a58d 100644 --- a/common/src/warp_runner/manager/commands/mod.rs +++ b/common/src/warp_runner/manager/commands/mod.rs @@ -6,7 +6,8 @@ mod tesseract_commands; // this shortens the path required to use the functions and structs pub use constellation_commands::{ - handle_constellation_cmd, ConstellationCmd, FileTransferProgress, FileTransferStep, + handle_constellation_cmd, thumbnail_to_base64, ConstellationCmd, FileTransferProgress, + FileTransferStep, }; pub use multipass_commands::{handle_multipass_cmd, MultiPassCmd}; pub use other_commands::*; diff --git a/common/src/warp_runner/mod.rs b/common/src/warp_runner/mod.rs index 4dee2aef88b..3e6a0031f24 100644 --- a/common/src/warp_runner/mod.rs +++ b/common/src/warp_runner/mod.rs @@ -25,7 +25,7 @@ mod conv_stream; mod manager; pub mod ui_adapter; -pub use manager::commands::{FileTransferProgress, FileTransferStep}; +pub use manager::commands::{thumbnail_to_base64, FileTransferProgress, FileTransferStep}; pub use manager::{ConstellationCmd, MultiPassCmd, OtherCmd, RayGunCmd, TesseractCmd}; pub type WarpCmdTx = UnboundedSender; @@ -338,10 +338,14 @@ async fn warp_initialization(tesseract: Tesseract) -> Result { #[allow(non_snake_case)] pub fn FilePreview<'a>(cx: Scope<'a, Props<'a>>) -> Element<'a> { - let thumbnail = cx.props.file.thumbnail(); + let thumbnail = thumbnail_to_base64(cx.props.file); cx.render(rsx!(rsx!(div { ContextMenu { diff --git a/ui/src/layouts/storage/mod.rs b/ui/src/layouts/storage/mod.rs index c19f0e90e3b..612be99c801 100644 --- a/ui/src/layouts/storage/mod.rs +++ b/ui/src/layouts/storage/mod.rs @@ -7,6 +7,7 @@ use common::icons::Icon as IconElement; use common::language::get_local_text; use common::state::ToastNotification; use common::state::{ui, Action, State}; +use common::warp_runner::thumbnail_to_base64; use dioxus::{html::input_data::keyboard_types::Code, prelude::*}; use dioxus_desktop::use_window; use dioxus_router::*; @@ -409,7 +410,7 @@ pub fn FilesLayout(cx: Scope) -> Element { )), File { key: "{key}-file", - thumbnail: file.thumbnail(), + thumbnail: thumbnail_to_base64(file), text: file.name(), aria_label: file.name(), with_rename: *is_renaming_map.read() == Some(key),