diff --git a/package-lock.json b/package-lock.json index fbf5a9b..6264b44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@tauri-apps/plugin-dialog": "^2.0.0-beta.5", "@tauri-apps/plugin-fs": "^2.0.0-beta.5", "@tauri-apps/plugin-http": "^2.0.0-beta.5", + "@tauri-apps/plugin-log": "^2.0.0-beta.7", "@tauri-apps/plugin-os": "^2.0.0-beta.6", "@tauri-apps/plugin-process": "^2.0.0-beta.5", "@tauri-apps/plugin-websocket": "^2.0.0-beta.5" @@ -254,6 +255,28 @@ "@tauri-apps/api": "2.0.0-beta.13" } }, + "node_modules/@tauri-apps/plugin-log": { + "version": "2.0.0-beta.7", + "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-log/-/plugin-log-2.0.0-beta.7.tgz", + "integrity": "sha512-rdwvmIWv0alRGvG5mxUvSCeT4ovVp5zRaUhtd2372mPPQgYKpHk2nxlRFiGtpcP/MCv0cwXh+MDsceVJpQLtZQ==", + "dependencies": { + "@tauri-apps/api": "2.0.0-beta.14" + } + }, + "node_modules/@tauri-apps/plugin-log/node_modules/@tauri-apps/api": { + "version": "2.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.0.0-beta.14.tgz", + "integrity": "sha512-YLYgHqdwWswr4Y70+hRzaLD6kLIUgHhE3shLXNquPiTaQ9+cX3Q2dB0AFfqsua6NXYFNe7LfkmMzaqEzqv3yQg==", + "engines": { + "node": ">= 18.18", + "npm": ">= 6.6.0", + "yarn": ">= 1.19.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/tauri" + } + }, "node_modules/@tauri-apps/plugin-os": { "version": "2.0.0-beta.6", "resolved": "https://registry.npmjs.org/@tauri-apps/plugin-os/-/plugin-os-2.0.0-beta.6.tgz", diff --git a/package.json b/package.json index 0134ba7..ecb1d5e 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@tauri-apps/plugin-dialog": "^2.0.0-beta.5", "@tauri-apps/plugin-fs": "^2.0.0-beta.5", "@tauri-apps/plugin-http": "^2.0.0-beta.5", + "@tauri-apps/plugin-log": "^2.0.0-beta.7", "@tauri-apps/plugin-os": "^2.0.0-beta.6", "@tauri-apps/plugin-process": "^2.0.0-beta.5", "@tauri-apps/plugin-websocket": "^2.0.0-beta.5" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index ead1d8b..3ef1f7d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -17,6 +17,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -47,6 +58,23 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" +[[package]] +name = "android_log-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" + +[[package]] +name = "android_logger" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b07e8e73d720a1f2e4b6014766e6039fd2e96a4fa44e2a78d0e1fa2ff49826" +dependencies = [ + "android_log-sys", + "env_filter", + "log", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -80,6 +108,12 @@ dependencies = [ "x11rb", ] +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "ashpd" version = "0.8.1" @@ -92,7 +126,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_repr", - "tokio", + "tokio 1.38.0", "url", "zbus", ] @@ -106,7 +140,7 @@ dependencies = [ "event-listener", "event-listener-strategy", "futures-core", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -118,7 +152,7 @@ dependencies = [ "concurrent-queue", "event-listener-strategy", "futures-core", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -128,7 +162,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ "async-lock", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "futures-io", "futures-lite", @@ -148,7 +182,7 @@ checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ "event-listener", "event-listener-strategy", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -163,7 +197,7 @@ dependencies = [ "async-signal", "async-task", "blocking", - "cfg-if", + "cfg-if 1.0.0", "event-listener", "futures-lite", "rustix", @@ -191,7 +225,7 @@ dependencies = [ "async-io", "async-lock", "atomic-waker", - "cfg-if", + "cfg-if 1.0.0", "futures-core", "futures-io", "rustix", @@ -260,13 +294,19 @@ checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.7" @@ -300,6 +340,18 @@ dependencies = [ "serde", ] +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "block" version = "0.1.6" @@ -337,6 +389,30 @@ dependencies = [ "piper", ] +[[package]] +name = "borsh" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" +dependencies = [ + "borsh-derive", + "cfg_aliases 0.1.1", +] + +[[package]] +name = "borsh-derive" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" +dependencies = [ + "once_cell", + "proc-macro-crate 2.0.2", + "proc-macro2", + "quote", + "syn 2.0.68", + "syn_derive", +] + [[package]] name = "brotli" version = "3.5.0" @@ -364,6 +440,39 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byte-unit" +version = "5.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ac19bdf0b2665407c39d82dbc937e951e7e2001609f0fb32edd0af45a2d63e" +dependencies = [ + "rust_decimal", + "serde", + "utf8-width", +] + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "bytemuck" version = "1.16.1" @@ -376,6 +485,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + [[package]] name = "bytes" version = "1.6.0" @@ -485,12 +600,24 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" @@ -561,7 +688,7 @@ version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "bytes", + "bytes 1.6.0", "memchr", ] @@ -663,7 +790,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -880,7 +1007,7 @@ dependencies = [ "dlopen2_derive", "libc", "once_cell", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -947,7 +1074,7 @@ dependencies = [ "rustc_version", "toml 0.8.2", "vswhom", - "winreg", + "winreg 0.52.0", ] [[package]] @@ -962,7 +1089,7 @@ version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -992,6 +1119,16 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1032,7 +1169,7 @@ checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -1042,7 +1179,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ "event-listener", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -1076,6 +1213,15 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "fern" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" +dependencies = [ + "log", +] + [[package]] name = "field-offset" version = "0.3.6" @@ -1162,6 +1308,28 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags 1.3.2", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futf" version = "0.1.5" @@ -1214,7 +1382,7 @@ dependencies = [ "futures-core", "futures-io", "parking", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -1252,7 +1420,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite", + "pin-project-lite 0.2.14", "pin-utils", "slab", ] @@ -1404,7 +1572,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1415,7 +1583,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1450,7 +1618,7 @@ dependencies = [ "glib", "libc", "once_cell", - "pin-project-lite", + "pin-project-lite 0.2.14", "smallvec", "thiserror", ] @@ -1465,7 +1633,7 @@ dependencies = [ "gobject-sys", "libc", "system-deps", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1584,6 +1752,26 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "h2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 1.9.3", + "slab", + "tokio 0.2.25", + "tokio-util 0.3.1", + "tracing", + "tracing-futures", +] + [[package]] name = "h2" version = "0.4.5" @@ -1591,15 +1779,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ "atomic-waker", - "bytes", + "bytes 1.6.0", "fnv", "futures-core", "futures-sink", - "http", + "http 1.1.0", "indexmap 2.2.6", "slab", - "tokio", - "tokio-util", + "tokio 1.38.0", + "tokio-util 0.7.11", "tracing", ] @@ -1609,7 +1797,7 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crunchy", ] @@ -1618,6 +1806,9 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] [[package]] name = "hashbrown" @@ -1669,25 +1860,46 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes 1.6.0", + "fnv", + "itoa 1.0.11", +] + [[package]] name = "http" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes", + "bytes 1.6.0", "fnv", "itoa 1.0.11", ] +[[package]] +name = "http-body" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +dependencies = [ + "bytes 0.5.6", + "http 0.2.12", +] + [[package]] name = "http-body" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ - "bytes", - "http", + "bytes 1.6.0", + "http 1.1.0", ] [[package]] @@ -1696,11 +1908,11 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-util", - "http", - "http-body", - "pin-project-lite", + "http 1.1.0", + "http-body 1.0.0", + "pin-project-lite 0.2.14", ] [[package]] @@ -1709,23 +1921,53 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + +[[package]] +name = "hyper" +version = "0.13.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" +dependencies = [ + "bytes 0.5.6", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.2.7", + "http 0.2.12", + "http-body 0.3.1", + "httparse", + "httpdate", + "itoa 0.4.8", + "pin-project", + "socket2 0.3.19", + "tokio 0.2.25", + "tower-service", + "tracing", + "want", +] + [[package]] name = "hyper" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-channel", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.0", "httparse", "itoa 1.0.11", - "pin-project-lite", + "pin-project-lite 0.2.14", "smallvec", - "tokio", + "tokio 1.38.0", "want", ] @@ -1736,12 +1978,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http", - "hyper", + "http 1.1.0", + "hyper 1.4.0", "hyper-util", "rustls", "rustls-pki-types", - "tokio", + "tokio 1.38.0", "tokio-rustls", "tower-service", "webpki-roots", @@ -1749,18 +1991,15 @@ dependencies = [ [[package]] name = "hyper-tls" -version = "0.6.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", + "bytes 0.5.6", + "hyper 0.13.10", "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "tokio 0.2.25", + "tokio-tls", ] [[package]] @@ -1769,15 +2008,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-channel", "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.4.0", + "pin-project-lite 0.2.14", + "socket2 0.5.7", + "tokio 1.38.0", "tower", "tower-service", "tracing", @@ -1910,7 +2149,16 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", ] [[package]] @@ -1980,7 +2228,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", - "cfg-if", + "cfg-if 1.0.0", "combine", "jni-sys", "log", @@ -2024,6 +2272,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + [[package]] name = "keyboard-types" version = "0.7.0" @@ -2096,8 +2354,8 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if", - "winapi", + "cfg-if 1.0.0", + "winapi 0.3.9", ] [[package]] @@ -2131,6 +2389,9 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +dependencies = [ + "value-bag", +] [[package]] name = "loom" @@ -2138,7 +2399,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "generator", "scoped-tls", "serde", @@ -2212,6 +2473,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -2222,6 +2493,25 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + [[package]] name = "mio" version = "0.8.11" @@ -2233,6 +2523,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + [[package]] name = "muda" version = "0.13.5" @@ -2298,6 +2600,17 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "net2" +version = "0.2.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -2311,7 +2624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "libc", "memoffset", ] @@ -2329,7 +2642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -2378,6 +2691,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + [[package]] name = "objc" version = "0.2.7" @@ -2550,7 +2872,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.6.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types 0.3.2", "libc", "once_cell", @@ -2600,7 +2922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" dependencies = [ "futures-core", - "pin-project-lite", + "pin-project-lite 0.2.14", ] [[package]] @@ -2677,7 +2999,7 @@ version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", @@ -2850,6 +3172,12 @@ dependencies = [ "syn 2.0.68", ] +[[package]] +name = "pin-project-lite" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -2911,10 +3239,10 @@ version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "hermit-abi 0.4.0", - "pin-project-lite", + "pin-project-lite 0.2.14", "rustix", "tracing", "windows-sys 0.52.0", @@ -3003,6 +3331,26 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "publicsuffix" version = "2.2.3" @@ -3037,14 +3385,14 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ - "bytes", - "pin-project-lite", + "bytes 1.6.0", + "pin-project-lite 0.2.14", "quinn-proto", "quinn-udp", "rustc-hash", "rustls", "thiserror", - "tokio", + "tokio 1.38.0", "tracing", ] @@ -3054,7 +3402,7 @@ version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ - "bytes", + "bytes 1.6.0", "rand 0.8.5", "ring", "rustc-hash", @@ -3073,7 +3421,7 @@ checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", - "socket2", + "socket2 0.5.7", "tracing", "windows-sys 0.52.0", ] @@ -3087,6 +3435,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.7.3" @@ -3264,6 +3618,50 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "reqwest" +version = "0.10.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" +dependencies = [ + "base64 0.13.1", + "bytes 0.5.6", + "encoding_rs", + "futures-core", + "futures-util", + "http 0.2.12", + "http-body 0.3.1", + "hyper 0.13.10", + "hyper-tls", + "ipnet", + "js-sys", + "lazy_static", + "log", + "mime", + "mime_guess", + "native-tls", + "percent-encoding", + "pin-project-lite 0.2.14", + "serde", + "serde_urlencoded", + "tokio 0.2.25", + "tokio-tls", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.7.0", +] + [[package]] name = "reqwest" version = "0.12.5" @@ -3271,28 +3669,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "base64 0.22.1", - "bytes", + "bytes 1.6.0", "cookie", "cookie_store", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.0", "http-body-util", - "hyper", + "hyper 1.4.0", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", - "pin-project-lite", + "pin-project-lite 0.2.14", "quinn", "rustls", "rustls-pemfile", @@ -3302,10 +3698,9 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "system-configuration", - "tokio", - "tokio-native-tls", + "tokio 1.38.0", "tokio-rustls", - "tokio-util", + "tokio-util 0.7.11", "tower-service", "url", "wasm-bindgen", @@ -3313,7 +3708,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg", + "winreg 0.52.0", ] [[package]] @@ -3347,7 +3742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom 0.2.15", "libc", "spin", @@ -3355,6 +3750,51 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rkyv" +version = "0.7.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +dependencies = [ + "bitvec", + "bytecheck", + "bytes 1.6.0", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust_decimal" +version = "1.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" +dependencies = [ + "arrayvec", + "borsh", + "bytes 1.6.0", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", +] + [[package]] name = "rustc-demangle" version = "0.1.24" @@ -3498,6 +3938,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "security-framework" version = "2.11.0" @@ -3703,7 +4149,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -3714,7 +4160,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -3735,7 +4181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -3753,6 +4199,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + [[package]] name = "siphasher" version = "0.3.11" @@ -3774,6 +4226,17 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "socket2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "winapi 0.3.9", +] + [[package]] name = "socket2" version = "0.5.7" @@ -3791,7 +4254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d623bff5d06f60d738990980d782c8c866997d9194cfe79ecad00aa2f76826dd" dependencies = [ "bytemuck", - "cfg_aliases", + "cfg_aliases 0.2.1", "core-graphics", "foreign-types 0.5.0", "js-sys", @@ -3934,6 +4397,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.68", +] + [[package]] name = "sync_wrapper" version = "1.0.1" @@ -4033,6 +4508,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "target-lexicon" version = "0.12.14" @@ -4046,7 +4527,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68725c4f17f62f0fb1fa2eecaf391200bf00a9414c84f30783ddca10570690c3" dependencies = [ "anyhow", - "bytes", + "bytes 1.6.0", "cocoa", "dirs", "dunce", @@ -4056,7 +4537,7 @@ dependencies = [ "glob", "gtk", "heck 0.5.0", - "http", + "http 1.1.0", "jni", "libc", "log", @@ -4065,7 +4546,7 @@ dependencies = [ "objc", "percent-encoding", "raw-window-handle 0.6.2", - "reqwest", + "reqwest 0.12.5", "serde", "serde_json", "serde_repr", @@ -4078,7 +4559,7 @@ dependencies = [ "tauri-runtime-wry", "tauri-utils", "thiserror", - "tokio", + "tokio 1.38.0", "tray-icon", "url", "urlpattern", @@ -4171,7 +4652,7 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" version = "2.1.0-beta.5" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "arboard", "image 0.24.9", @@ -4186,7 +4667,7 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" version = "2.0.0-beta.10" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "dunce", "log", @@ -4203,7 +4684,7 @@ dependencies = [ [[package]] name = "tauri-plugin-fs" version = "2.0.0-beta.10" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "anyhow", "glob", @@ -4221,12 +4702,12 @@ dependencies = [ [[package]] name = "tauri-plugin-http" version = "2.0.0-beta.11" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "data-url", - "http", + "http 1.1.0", "regex", - "reqwest", + "reqwest 0.12.5", "schemars", "serde", "serde_json", @@ -4238,10 +4719,31 @@ dependencies = [ "urlpattern", ] +[[package]] +name = "tauri-plugin-log" +version = "2.0.0-beta.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e245a601dc3abf972785e19d36330cb3baa5ba0560986abc5d88318c2313955d" +dependencies = [ + "android_logger", + "byte-unit", + "cocoa", + "fern", + "log", + "objc", + "serde", + "serde_json", + "serde_repr", + "swift-rs", + "tauri", + "tauri-plugin", + "time", +] + [[package]] name = "tauri-plugin-os" version = "2.0.0-beta.7" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "gethostname", "log", @@ -4258,7 +4760,7 @@ dependencies = [ [[package]] name = "tauri-plugin-process" version = "2.0.0-beta.7" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "tauri", "tauri-plugin", @@ -4282,16 +4784,16 @@ dependencies = [ "tauri", "tauri-plugin", "thiserror", - "tokio", + "tokio 1.38.0", ] [[package]] name = "tauri-plugin-websocket" version = "2.0.0-beta.8" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#4003bdada2f8bc07e6a8092c106daf6cd9f712fd" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v2#66e8dbfc1a5cbeff3846d9ccffb57c45eb0de51e" dependencies = [ "futures-util", - "http", + "http 1.1.0", "log", "rand 0.8.5", "serde", @@ -4299,7 +4801,7 @@ dependencies = [ "tauri", "tauri-plugin", "thiserror", - "tokio", + "tokio 1.38.0", "tokio-tungstenite", ] @@ -4311,7 +4813,7 @@ checksum = "e5fa872242a432195b814e87f91ce10f293ae5b01fbd1eb139455496260aa7c9" dependencies = [ "dpi", "gtk", - "http", + "http 1.1.0", "jni", "raw-window-handle 0.6.2", "serde", @@ -4330,7 +4832,7 @@ checksum = "3ad6d5ef3c05d1c4b6cf97b9eac1ca1ad8ff2a7057ad0a92b3e4c476f009341e" dependencies = [ "cocoa", "gtk", - "http", + "http 1.1.0", "jni", "log", "percent-encoding", @@ -4395,7 +4897,7 @@ dependencies = [ name = "tazik2" version = "0.0.2" dependencies = [ - "native-tls", + "reqwest 0.10.10", "serde", "serde_json", "tauri", @@ -4404,6 +4906,7 @@ dependencies = [ "tauri-plugin-dialog", "tauri-plugin-fs", "tauri-plugin-http", + "tauri-plugin-log", "tauri-plugin-os", "tauri-plugin-process", "tauri-plugin-shell", @@ -4416,7 +4919,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand", "rustix", "windows-sys 0.52.0", @@ -4465,7 +4968,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", ] @@ -4488,7 +4991,9 @@ checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa 1.0.11", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -4526,6 +5031,23 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +dependencies = [ + "bytes 0.5.6", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "memchr", + "mio 0.6.23", + "pin-project-lite 0.1.12", + "slab", +] + [[package]] name = "tokio" version = "1.38.0" @@ -4533,27 +5055,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", - "bytes", + "bytes 1.6.0", "libc", - "mio", + "mio 0.8.11", "num_cpus", - "pin-project-lite", + "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2", + "socket2 0.5.7", "tracing", "windows-sys 0.48.0", ] -[[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.0" @@ -4562,7 +5074,17 @@ checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", "rustls-pki-types", - "tokio", + "tokio 1.38.0", +] + +[[package]] +name = "tokio-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" +dependencies = [ + "native-tls", + "tokio 0.2.25", ] [[package]] @@ -4575,23 +5097,37 @@ dependencies = [ "log", "rustls", "rustls-pki-types", - "tokio", + "tokio 1.38.0", "tokio-rustls", "tungstenite", "webpki-roots", ] +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes 0.5.6", + "futures-core", + "futures-sink", + "log", + "pin-project-lite 0.1.12", + "tokio 0.2.25", +] + [[package]] name = "tokio-util" version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ - "bytes", + "bytes 1.6.0", "futures-core", "futures-sink", - "pin-project-lite", - "tokio", + "pin-project-lite 0.2.14", + "tokio 1.38.0", ] [[package]] @@ -4662,8 +5198,8 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite", - "tokio", + "pin-project-lite 0.2.14", + "tokio 1.38.0", "tower-layer", "tower-service", ] @@ -4686,7 +5222,8 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "pin-project-lite", + "log", + "pin-project-lite 0.2.14", "tracing-attributes", "tracing-core", ] @@ -4712,6 +5249,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -4774,9 +5321,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", - "bytes", + "bytes 1.6.0", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand 0.8.5", @@ -4807,7 +5354,7 @@ checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ "memoffset", "tempfile", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -4851,6 +5398,15 @@ dependencies = [ "unic-common", ] +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" @@ -4915,6 +5471,12 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf8-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" + [[package]] name = "uuid" version = "1.9.1" @@ -4930,6 +5492,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" + [[package]] name = "vcpkg" version = "0.2.15" @@ -5005,7 +5573,9 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", + "serde", + "serde_json", "wasm-bindgen-macro", ] @@ -5030,7 +5600,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -5183,6 +5753,12 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -5193,6 +5769,12 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -5521,13 +6103,22 @@ dependencies = [ "memchr", ] +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winreg" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] @@ -5547,7 +6138,7 @@ dependencies = [ "gdkx11", "gtk", "html5ever", - "http", + "http 1.1.0", "javascriptcore-rs", "jni", "kuchikiki", @@ -5573,6 +6164,25 @@ dependencies = [ "x11-dl", ] +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + [[package]] name = "x11" version = "2.21.0" @@ -5645,7 +6255,7 @@ dependencies = [ "serde_repr", "sha1", "static_assertions", - "tokio", + "tokio 1.38.0", "tracing", "uds_windows", "windows-sys 0.52.0", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4f87e9f..fd95eca 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -12,18 +12,19 @@ name = "tazik2_lib" crate-type = ["lib", "cdylib", "staticlib"] [build-dependencies] -tauri-build = { version = "2.0.0-beta", features = [] } +tauri-build = { version = "^2.0.0-beta", features = [] } [dependencies] -tauri = { version = "2.0.0-beta", features = ["native-tls"] } -tauri-plugin-shell = "2.0.0-beta" +tauri = { version = "^2.0.0-beta", features = [] } +tauri-plugin-shell = "^2.0.0-beta" serde = { version = "1", features = ["derive"] } serde_json = "1" tauri-plugin-fs = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } -tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +tauri-plugin-http = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2", features = [] } tauri-plugin-process = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-websocket = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-dialog = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } tauri-plugin-os = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } -native-tls = { version = "0.2", optional = true } +tauri-plugin-log = "2.0.0-beta.7" +reqwest = { version = "0.10.0-alpha.2" } diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 4ecad62..0dbeaf0 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -17,6 +17,15 @@ "shell:allow-open", "fs:read-all", "fs:write-all", + "fs:allow-exists", + { + "identifier": "fs:allow-exists", + "allow": [ + { + "path": "$APPDATA/**" + } + ] + }, { "identifier": "fs:write-all", "allow": [ @@ -66,10 +75,10 @@ "dialog:default", "clipboard-manager:default", "clipboard-manager:allow-write-text", - "clipboard-manager:default", "os:allow-version", "os:allow-platform", "os:allow-os-type", - "os:allow-arch" + "os:allow-arch", + "log:default" ] } \ No newline at end of file diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index fe81798..869152e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1,3 +1,4 @@ +use tauri_plugin_log::{Target, TargetKind}; // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command #[tauri::command] fn greet(name: &str) -> String { @@ -7,6 +8,13 @@ fn greet(name: &str) -> String { #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() + .plugin(tauri_plugin_log::Builder::new() + .targets([ + Target::new(TargetKind::Stdout), + Target::new(TargetKind::LogDir { file_name: None }), + Target::new(TargetKind::Webview), + ]) + .build()) .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_clipboard_manager::init()) .plugin(tauri_plugin_dialog::init()) @@ -17,6 +25,7 @@ pub fn run() { .plugin(tauri_plugin_shell::init()) .invoke_handler(tauri::generate_handler![greet]) .invoke_handler(tauri::generate_handler![send_request]) + // .invoke_handler(tauri::generate_handler![api_post_req]) .run(tauri::generate_context!()) .expect("error while running tauri application"); } @@ -27,3 +36,16 @@ pub fn run() { fn send_request(url: &str) -> String { format!("You've tried to access this URL: {}.", url) } + + +// use reqwest::{redirect::Policy}; + + +// #[tauri::command] +// async fn api_post_req(url: &str) -> String { + +// let client = reqwest::Client::new(); +// let u = url; +// let res = client.get("http://httpbin.org/post").send(); +// return "".to_string();//res.wait().is_ok().to_string(); +// } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0a46306..e998f5f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -10,12 +10,14 @@ "windows": [ { "title": "tazik2", - "width": 1280, - "height": 720 + "width": 1242, + "height": 692, + "y":0, + "x": 68 } ], "security": { - "csp": "" + "csp": "*" } }, "bundle": { diff --git a/src/index.html b/src/index.html index 4d22876..b168a5f 100644 --- a/src/index.html +++ b/src/index.html @@ -16,7 +16,6 @@ - @@ -24,6 +23,9 @@ + + + @@ -34,7 +36,6 @@ - diff --git a/src/main.js b/src/main.js index d89652a..419225b 100644 --- a/src/main.js +++ b/src/main.js @@ -2,6 +2,7 @@ const app = {} // this is the app, it'll contain every possible thing about the app.invoke = window?.__TAURI__?.core?.invoke app.fetch = window?.__TAURI__?.http?.fetch //|| fetch.bind(window) app.clipboard = window?.__TAURI__?.clipboardManager +app.fileExists = window?.__TAURI__?.fs?.exists app.readTextFile = window?.__TAURI__?.fs?.readTextFile app.writeTextFile = window?.__TAURI__?.fs?.writeTextFile app.process = window?.__TAURI__?.process @@ -43,6 +44,10 @@ async function greet() { greetMsgEl.textContent = await app.invoke("greet", { name: greetInputEl.value }); } + + + + // window.addEventListener("DOMContentLoaded", () => { // greetInputEl = document.querySelector("#greet-input"); // greetMsgEl = document.querySelector("#greet-msg"); @@ -112,9 +117,9 @@ function build_request_url(){ let enabled = inputs[(i*5)].checked let key = inputs[(i*5)+1].value let value = inputs[(i*5)+2].value - if (enabled) { + if (enabled) {// need to save disabled as well... somehow if (key) { - console.log(i, inputs[(i*5)+1].value, inputs[(i*5)+2].value, inputs[(i*5)+3].value) + //console.log(i, inputs[(i*5)+1].value, inputs[(i*5)+2].value, inputs[(i*5)+3].value) if (value) { result.push(inputs[(i*5)+1].value + "=" + inputs[(i*5)+2].value) } else { @@ -133,7 +138,7 @@ function build_request_url(){ // key && value === 0, and thus falsy (description misn't necessary) if (!(key && value)) { if (window.getComputedStyle(delete_butt).display != "none") { - delete_row(inputs[(i*5)]) + delete_row(null, inputs[(i*5)]) } } } @@ -196,12 +201,30 @@ async function build_request() { let auth_panel = document.getElementById('auth_panel_'+auth_type) let auth_inputs = auth_panel.getElementsByClassName("auth_input") + let user + let password + let token + let domain + let workstation + let result = {} result.url = build_request_url() + result.base_url = result.url.split("?")[0] result.timeout = 30 result.headers = build_request_headers() result.method = method + result.auth_type = auth_type + result.query_params = {} + + let [url, params] = result.url.split("?") + for (let param of (params || "").split("&")) { + console.log(param) + let [key, value] = param.split("=") + result.query_params[key] = value + } + + // process authentication switch (auth_type) { @@ -210,8 +233,6 @@ async function build_request() { break case "basic": - let user - let password for (let input of auth_inputs) { if (input.classList.contains("username_input")) { user = input.value @@ -223,12 +244,14 @@ async function build_request() { if (user && password) { let token = user + ":" + password - result.headers.Authorization = 'Basic '+btoa(token) + result.headers.Authorization = 'Basic '+btoa(token) } + + result.user = user + result.password = password break case "bearer": - let token for (let input of auth_inputs) { if (input.classList.contains("token_input")) { token = input.value @@ -237,9 +260,25 @@ async function build_request() { if (token) { result.headers.Authorization = 'Bearer '+token } + result.token = token break case "ntlm": + for (let input of auth_inputs) { + if (input.classList.contains("username_input")) { + user = input.value + } + if (input.classList.contains("password_input")) { + password = input.value + } + if (input.classList.contains("domain_input")) { + user = input.value + } + if (input.classList.contains("token_input")) { + password = input.value + } + } + break default: @@ -258,6 +297,8 @@ async function build_request() { } } + result.body_type = body_type + switch(body_type) { case "form-data" : // this is not a result, this is only a JSON object with everything necessary in it @@ -307,6 +348,8 @@ async function send_request() { // the request itself is built in here let request = await build_request() // fucking blobs made me do this + console.log(request) + app.current_request = JSON.parse(JSON.stringify(request)) let url = request.url @@ -320,7 +363,7 @@ async function send_request() { request.headers["Accept-Encoding"] = request.headers["Accept-Encoding"] || "gzip, deflate, br" request.headers.Connection = request.headers.Connection || "keep-alive" - write_request_file(app.current_tab) + await write_request_file(app.current_tab) // oauth /* @@ -408,6 +451,12 @@ function CallWebAPI() { let response_table = document.getElementById("response_headers_table") response_table.innerHTML = "KeyValue" + for (let i in window.sessionStorage) { + let item = window.sessionStorage[i] + //console.log(item) + } + //console.log(window.sessionStorage.length) + if (result1) { let response_headers = {} for (let pair of result1.headers.entries()) { @@ -420,9 +469,10 @@ function CallWebAPI() { tr.appendChild(td1) tr.appendChild(td2) response_table.appendChild(tr) + //console.log(pair) } - console.log(result1.headers.get('set-cookie')) + //console.log(result1.headers.get('set-cookie')) //for (let pair of result1.headers.get('set-cookie')) { // console.log(pair) //} @@ -474,7 +524,7 @@ function CallWebAPI() { let body_length = code.length let headers_length = JSON.stringify(response_headers).length - console.log("body_length", body_length, "headers_length", headers_length) + //console.log("body_length", body_length, "headers_length", headers_length) network_info.innerHTML = ['🌍'].join(" ") status_info.innerHTML = ["Status:", "", result1.status, result1.statusText,''].join(" ") @@ -522,7 +572,7 @@ function code_beautify(source, mode) { } switch (mode) { case "xml": - console.log('sorting as XML') + //console.log('sorting as XML') let xml = new DOMParser().parseFromString(source, 'application/xml'); var sorting_params = new DOMParser().parseFromString([ @@ -645,10 +695,12 @@ function enable_row() { } -function delete_row(element) { +function delete_row(event, element) { + //console.log("removing row", this, element) // find a row *this* button is from let row = element || this - while (!(row.tagName.toLowerCase() == "tr")) { + while (!(row?.tagName?.toLowerCase() == "tr")) { + //console.log("row",row, row?.tagName) row = row.parentElement } @@ -721,10 +773,11 @@ function add_row2(event, element) { } function add_row(event, element, data) { + console.log("adding row", data) let table = element || this while (!table.classList.contains("request_params_table")) { - console.log(table.parentElement) + //console.log(table.parentElement) table = table.parentElement } @@ -746,8 +799,15 @@ function add_row(event, element, data) { // inputs: checkbox, 3*text, button (not an input) if (tds[1].value != "" && tds[2].value != "") { } else { - return + // prevents addition of new empty rows upon key press + if (!data) { + console.log("here?") + + return + } } + } else { + } let tr = document.createElement('tr') @@ -790,30 +850,34 @@ function add_row(event, element, data) { tr.appendChild(td3) tr.appendChild(td4) tr.appendChild(td5) - table.insertBefore(tr, table.children[table.children.length]) - + table.appendChild(tr) + if (data) { console.log("data", data) ed1.value = data.key || "" ed2.value = data.value || "" ed3.value = data.descpription || "" cb.checked = data.enabled || false - let event = new Event('keyup') - ed1.dispatchEvent(event); + // this is needed because when I manually enter stuff, it add a new row below the current one + // but when I call this from the code, it inserts empty rows after each `data` + if (!data.prevent_addition_of_a_new_row) { + let event = new Event('keyup') + ed1.dispatchEvent(event); + } } } -function option_selected() { - let combobox = this +function option_selected(event, element) { + let combobox = element || this while (!(combobox.classList?.contains('dropdown'))) { combobox = combobox.parentElement } let button = combobox.getElementsByClassName('dropbtn')[0] let menu = combobox.getElementsByClassName('dropdown-content')[0] || combobox.getElementsByClassName('dropdown-content-replace')[0] - let style = window.getComputedStyle(this) + let style = window.getComputedStyle(element || this) let color = style.getPropertyValue('color') - button.value = this.getAttribute('value') + button.value = (element || this).getAttribute('value') if (~button.id.indexOf("body_type_select")) { let editor = window.exports[button.getAttribute('editor')] console.log('settings mode', button.value) @@ -845,7 +909,7 @@ function option_selected() { show_auth_tab(button.value) } - button.textContent = this.textContent + button.textContent = (element || this).textContent menu.style.display = 'none' } @@ -856,7 +920,7 @@ function open_combobox() { } let opened = (JSON.parse(combobox.getAttribute('opened'))) - console.log(opened) + //console.log(opened) if (opened) { let menu = combobox.getElementsByClassName('dropdown-content')[0] || combobox.getElementsByClassName('dropdown-content-replace')[0] // menu_items might not be there if there's no submenu @@ -1040,41 +1104,85 @@ function init_popups() { } } -function keyboard_shortcuts_handler(event) { - console.log(event) - if (event.ctrlKey && event.key === 'KeyS') { +async function keyboard_shortcuts_handler(event) { + //console.log(event) + if (event.ctrlKey && event.code === 'KeyS') { // save current request + let request = await build_request() + app.current_request = JSON.parse(JSON.stringify(request)) + await write_request_file(app.current_tab) - } else if (event.ctrlKey && event.key === "Enter") { + } else if (event.ctrlKey && event.code === "Enter") { // run qurent request - send_request() + await send_request() } } function handle_buttons(self) { - console.log(self.id) + //console.log(self.id) } - -async function write_request_file(request_id) { - console.log("writing " + request_id + '.json') - try { - await app.writeTextFile(request_id + '.json', JSON.stringify(app.current_request, null, 2), { baseDir: 15 }) // localappdata - } catch(err) { - console.log('333', err) +function set_modified(id, yes) { + let button = document.getElementById(id) + //console.log(button) + if (yes) { + // make tab appear modified + button.setAttribute("modified", true) + } else { + // make tab appear unmodified + button.setAttribute("modified", false) + } +} + +async function write_request_file(request_id, is_modified) { + if (request_id) { + try { + // I have 2 files: tmp_ and the regular one + let filename = request_id + '.json' + if (is_modified) { + // if modified, then write only to the _tmp one + filename = "tmp_" + filename + console.log("writing " + filename) + await app.writeTextFile(filename, JSON.stringify(app.current_request, null, 2), { baseDir: 15 }) // localappdata + } else { + // if NOT modified (i.e. saved), saving goes to BOTH files (since we first read the tmp file) + console.log("writing " + filename) + await app.writeTextFile(filename, JSON.stringify(app.current_request, null, 2), { baseDir: 15 }) // localappdata + filename = "tmp_" + filename + console.log("writing " + filename) + await app.writeTextFile(filename, JSON.stringify(app.current_request, null, 2), { baseDir: 15 }) // localappdata + } + // RESULT: the _tmp file is always saved and loaded first + // permanent changes go to the ergular file (the one eventually shared across dvices) + set_modified(request_id, is_modified) + } catch(err) { + console.log('can\'t write file', err) + } + // this ^ never returns anything + } else { + console.log("Can't write the file, as request_id is undefined") } - // this ^ never returns anything } async function read_request_file(request_id) { console.log("reading " + request_id + '.json') try { - let data = await app.readTextFile(request_id + '.json', { baseDir: 15 }) - console.log(data) - return JSON.parse(data) + let filename = request_id + '.json' + let data + try { + data = await app.readTextFile("tmp_"+filename, { baseDir: 15 }) + } catch(err) { + try { + data = await app.readTextFile(filename, { baseDir: 15 }) + } catch(err) { + } + } + console.log("read file contents:" + data) + let result = JSON.parse(data) // if data is null, this will fail and catch() will fire + return result } catch(err) { - console.log('333', err) + console.log( err) } } @@ -1110,8 +1218,22 @@ function main_scroll_tabbar_wheel(event) { -function request_tab_click(event) { +async function request_tab_click(event) { + console.log("CLICKED!!!!!!!!!!") + let request = await build_request() + app.current_request = JSON.parse(JSON.stringify(request)) + + let current_tab = document.getElementById(app.current_tab) + let is_modified = JSON.parse(current_tab.getAttribute("modified")) + //console.log("setting modified inside tab_click", is_modified) + if (is_modified) { // true/false shenanigans + await write_request_file(app.current_tab, true) + } else { + await write_request_file(app.current_tab) + } + + if ((this.scrollWidth - event.offsetX < 25*1.34) || event.target.classList.contains('close_button')) { let opened_tabs = [] for (let tid of app.opened_tabs) { @@ -1123,27 +1245,27 @@ function request_tab_click(event) { this.remove() } else { let tab_id = this.id - console.log("^^^^^^^^^^^^^^^^^^^^^^") - console.log("tab_id", tab_id) - console.log("app.opened_tabs", app.opened_tabs) - + //console.log("^^^^^^^^^^^^^^^^^^^^^^") + //console.log("tab_id", tab_id) + //console.log("app.opened_tabs", app.opened_tabs) + for (let tid of app.opened_tabs) { - console.log("tid", tid) + //console.log("tid", tid) if (tab_id == tid) { app.current_tab = tid break } } - console.log("vvvvvvvvvvvvvvvvvvvvvv") + //console.log("vvvvvvvvvvvvvvvvvvvvvv") } - manage_tab_history() // this also manages file reading/writing + await manage_tab_history() // this also manages file reading/writing adjust_main_tabbar_buttons() } -function manage_tab_history() { +async function manage_tab_history(new_tab) { // unconditionally add current tab to the history app.tab_history.push(app.current_tab) @@ -1158,27 +1280,27 @@ function manage_tab_history() { let tmp_history = [] let last_added for (let hid of app.tab_history) { - console.log("hid", hid) + //console.log("hid", hid) for (let tid of tabs) { - console.log("tid", tid, tid == hid) + //console.log("tid", tid, tid == hid) if (tid == hid) { if (last_added != hid) { tmp_history.push(hid) last_added = hid } else { - console.log("removed duplicate item", hid) + //console.log("removed duplicate item", hid) } - console.log("break") + //console.log("break") break } } } - console.log("tmp_history", tmp_history) + //console.log("tmp_history", tmp_history) app.tab_history = tmp_history let tab_id = tmp_history[tmp_history.length - 1] for (let tid of app.opened_tabs) { - console.log(tab_id, tid) + //console.log(tab_id, tid) if (tid == tab_id) { app.current_tab = tid break @@ -1186,15 +1308,145 @@ function manage_tab_history() { } // whatever in that file gets into current request data structure (and I can expect this to alvays be there) - app.current_request = read_request_file(app.current_tab) - + if (!new_tab) { + try { + app.current_request = await read_request_file(app.current_tab) + console.log("app.current_request", app.current_request) + } catch(err) { + // this is fine if there's no file to read (i.e. it's a new tab) + console.log(err) + } + } else { + app.current_request = build_empty_request() + } + // fills UI with data from the file + fill_in_forms() } +function build_empty_request() { + let result = { + method : "GET", + url : "", + base_url : "", + query_params : {}, + headers : [], + auth_type : "none", + body_type : "none", + scripts : { + pre : "", + post : "," + } + } + return result +} + +function fill_in_forms() { + if (app.current_request) {// + console.log('filling forms with',app.current_request) + + + let container = document.getElementById("request_body_wrapper") + let tables = container.getElementsByClassName("request_params_table") + + for (let table of tables) { + table.innerHTML = "✅KeyValueDescription🗑️" + let param_count = 0 + for (let pid in app.current_request?.query_params) { + param_count = param_count + 1 + } + } + + // fill in headers + let headers_table = document.getElementById("headers_table") + for (let hid in app.current_request.headers) { + add_row(null, headers_table, {key: hid, value: app.current_request.headers[hid], enabled: true}) + } + + let query_params_table = document.getElementById("query_params_table") + console.log("add rows start =========================") + + for (let qpid in app.current_request.query_params) { + console.log(qpid, app.current_request.query_params[qpid]) + add_row(null, query_params_table, {key: qpid, value: app.current_request.query_params[qpid], enabled: true, prevent_addition_of_a_new_row : true}) + } + console.log("add rows end ===========================") + + let metod_select = document.getElementById("metod_select") + metod_select.value = app.current_request.method || "" + + let url_input = document.getElementById("url_input") + url_input.value = app.current_request.base_url || "" + + let auth_type_select = document.getElementById("auth_type_select") + let items = auth_type_select.parentElement.getElementsByClassName("dropdown-item") + //console.log("items",items) + for (let item of items) { + if (item.getAttribute("value") == app.current_request.auth_type) { + //console.log("clicking",item) + option_selected(null, item) + break + } + } + auth_type_select.value = app.current_request.auth_type + + + ///=============================================================================== + let auth_panel = document.getElementById('auth_right_side') + let auth_inputs = auth_panel.getElementsByClassName("auth_input") + + + for (let input of auth_inputs) { + if (input.classList.contains("username_input")) { + input.value = app.current_request.user || "" + //console.log("setting username",input.id) + } + if (input.classList.contains("password_input")) { + input.value = app.current_request.password || "" + //console.log("setting password",input.id) + } + if (input.classList.contains("token_input")) { + input.value = app.current_request.token || "" + //console.log("setting token",input.id) + } + if (input.classList.contains("domain_input")) { + input.value = app.current_request.domain || "" + //console.log("setting domain",input.id) + } + if (input.classList.contains("workstation_input")) { + input.value = app.current_request.workstation || "" + //console.log("setting workstation",input.id) + } + } + + + + // process body + let request_body_tabbar = document.getElementById('request_body_tabbar') + let radios = request_body_tabbar.getElementsByClassName('tab_header_button') + for (let radio of radios) { + if (radio.value == app.current_request.body_type) { + radio.click() + } + } + + for (let table of tables) { + add_row(null, table) + } + + ///=============================================================================== + + + } else { + console.log('can\'t fill anything as app.current_request is empty') + } +} + + function adjust_main_tabbar_buttons() { let request_bar_scroll_area = document.getElementById('request_bar_scroll_area') let enable_scroll_buttons = request_bar_scroll_area.scrollWidth > (document.getElementById('request_area').clientWidth - 150) - console.log(enable_scroll_buttons) + //console.log(enable_scroll_buttons) let request_row_right_button = document.getElementById('request_row_right_button') let request_row_left_button = document.getElementById('request_row_left_button') @@ -1260,7 +1512,21 @@ function window_resize_trigger() { -function add_request() { +async function add_request() { + if (app.current_tab) { + let request = await build_request() + app.current_request = JSON.parse(JSON.stringify(request)) + + let current_tab = document.getElementById(app.current_tab) + let is_modified = JSON.parse(current_tab.getAttribute("modified")) + //console.log("setting modified inside tab_click", is_modified) + if (is_modified) { // true/false shenanigans + await write_request_file(app.current_tab, true) + } else { + await write_request_file(app.current_tab) + } + } + let request_id = crypto.randomUUID() let request_name = "New Request" //+ " " + app.opened_tabs.length @@ -1269,6 +1535,7 @@ function add_request() { for (let table of tables) { table.innerHTML = "✅KeyValueDescription🗑️" + console.log("add request") add_row(null, table) } @@ -1278,16 +1545,15 @@ function add_request() { tab_button.id = request_id tab_button.addEventListener("click", request_tab_click) - // set modified flag, cause it's not saved - tab_button.setAttribute("modified", true) - app.opened_tabs.push(request_id) app.current_tab = request_id let request_bar_scroll_area = document.getElementById('request_bar_scroll_area') request_bar_scroll_area.scrollBy(Number.MAX_SAFE_INTEGER, 0) request_bar_scroll_area.appendChild(tab_button) + // set modified flag, cause it's not saved + set_modified(request_id, true) - manage_tab_history() + await manage_tab_history(true) // pass true to indincate this is a new tab adjust_main_tabbar_buttons() } @@ -1356,7 +1622,9 @@ function init() { beautify_raw_data_response.addEventListener("click", beautify_button_click); let add_request_button = document.getElementById('add_request_button') + let mock_button = document.getElementById('mock_button') add_request_button.addEventListener("click", add_request); + mock_button.addEventListener("click", add_request); document.addEventListener("keydown", keyboard_shortcuts_handler); @@ -1381,15 +1649,23 @@ function init() { function fill_mock_data() { + let container = document.getElementById("request_body_wrapper") + let tables = container.getElementsByClassName("request_params_table") + + for (let table of tables) { + table.innerHTML = "✅KeyValueDescription🗑️" + add_row(null, table) + } + let auth_panel = document.getElementById('auth_right_side') let auth_inputs = auth_panel.getElementsByClassName("auth_input") for (let input of auth_inputs) { if (input.classList.contains("username_input")) { - input.value = "ezwrk@ntrnx.ru" + //input.value = "ezwrk@ntrnx.ru" } if (input.classList.contains("password_input")) { - input.value = "7VOlvV3frvhYJhDiHNf/xh6p" + //input.value = "7VOlvV3frvhYJhDiHNf/xh6p" } if (input.classList.contains("token_input")) { input.value = "eyJhbGciOiJSUzI1NiIsImtpZCI6IkE3QTY1NDE0OEM1MjMxRUE3QzAwRUNERDBEMTRDRjBGIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MjAwMTU5NzgsImV4cCI6MTc1MTU1MTk3OCwiaXNzIjoiaHR0cHM6Ly9kZW1vMS1yZWlzLmRldi5udHJueC5jb20iLCJhdWQiOiJSZWNvcmRlciIsImNsaWVudF9pZCI6IlJlY29yZGVyX1NQQSIsInN1YiI6IjQxNDUwYzQ2LTQ3ZmMtNDc1Yi1iNTRiLWE0Mzk2OWUyMzE0NiIsImF1dGhfdGltZSI6MTcyMDAxNTk3OCwiaWRwIjoibG9jYWwiLCJ0ZW5hbnRpZCI6Ijg0MWEyMjEzLTg4NWEtNGM5MS1iYzI3LWVhMzhmNjI3NDE0YiIsImVtYWlsIjoiYWRtaW5AZGVmYXVsdHRlbmFudC5jb20iLCJyb2xlIjpbImFkbWluIiwiUmVnaXN0ZXJlZFVzZXIiXSwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjoiRmFsc2UiLCJlbWFpbF92ZXJpZmllZCI6IlRydWUiLCJuYW1lIjoiYWRtaW4iLCJpYXQiOjE3MjAwMTU5NzgsInNjb3BlIjpbIlJlY29yZGVyIl0sImFtciI6WyJwd2QiXX0.YFaSFpTEo4KvsbHDQoooYoDNcIbLFr3x09TT0jB_pzJpl_00oIrgmc2GTzk5XNsWEl-Bq5m8quIA9VVHtwfJrJlSDjWg2MIpt-WrPD9r68BbMQNFuNjthyzfkiUvr06yANjSMbtMY-395EGRKck3g7Ro97CW_0qXdrc5GspO8yAJMdBWN_OtdK1fyUYr1Ai7TvxrGAFllMHQdBmhFvni8VZDksgv9fCaFBLkyOFpMgMyMy1L8zHc68XxIOVTLYdxG7jr90HCy1EZjOvX6C5qtiJEXqXD_2l1sASrUjG_R6oELoB07m4Q-nJ6_WH9eSpUXVksfSP0w7MaZvfC8S3jTQ" @@ -1397,14 +1673,15 @@ function fill_mock_data() { } let url_input = document.getElementById("url_input") - url_input.value = "https://demo1-recorder-api.dev.ntrnx.com/api/recorder/settings/notifications?api-version=1.0" + //url_input.value = "https://demo1-recorder-api.dev.ntrnx.com/api/recorder/settings/notifications?api-version=1.0" //url_input.value = "https://192.168.1.113:8443/web/save_isap_config" //url_input.value = "http://reconf-ad-2.dev.ntrnx.local/Ews/Exchange.asmx" - //url_input.value = "https://192.168.1.113:8443/api/hw-monitor" + url_input.value = "https://192.168.1.113:8443/api/hw-monitor" + //url_input.value = "https://wrong.host.badssl.com/" - let auth_type_select = document.getElementById("auth_type_select") - auth_type_select.value = 'bearer' - auth_type_select.value = 'basic' + //let auth_type_select = document.getElementById("auth_type_select") + //auth_type_select.value = 'bearer' + //auth_type_select.value = 'basic' } @@ -1430,14 +1707,16 @@ function fill_mock_data() { async function test(){ - try { - const response = await app.fetch("https://192.168.1.113:8443/api/hw-monitor"); - console.log(response.status); - console.log(response.statusText); - const jsonData = await response.json(); - console.log(jsonData) - } catch(err) { - console.log(err) - } + // try { + // const response = await app.fetch("https://192.168.1.113:8443/api/hw-monitor"); + // console.trace("fff") + // console.log(response.status); + // console.log(response.statusText); + // const jsonData = await response.json(); + // console.log(jsonData) + // } catch(err) { + // console.log(err) + // } +// console.log(await app.invoke("api_post_req", { url:"https://wrong.host.badssl.com/"})); } diff --git a/src/my.styles.css b/src/my.styles.css index 73bb87b..865137a 100644 --- a/src/my.styles.css +++ b/src/my.styles.css @@ -554,6 +554,10 @@ input:not(input[type="text"]) { } /* responce code preview */ +.editor-container * { + user-select: none; +} + .editor-container { width: calc(100% - 5pt); height: calc(100% - 5pt);