From 79691e93e04b820e44dce1c7d91b8865fa6ccb14 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:52:33 +0800 Subject: [PATCH 01/29] fix(store): `with_store` and `StoreCollection` become private in #1011 (#1040) * Fix with_store become private in #1011 * Add change file --- .changes/public-with-store.md | 5 +++++ plugins/store/src/lib.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/public-with-store.md diff --git a/.changes/public-with-store.md b/.changes/public-with-store.md new file mode 100644 index 00000000..33dc15bb --- /dev/null +++ b/.changes/public-with-store.md @@ -0,0 +1,5 @@ +--- +'store': patch +--- + +Fix `with_store` and `StoreCollection` changed to private in #1011 diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs index 700b058e..2b923fde 100644 --- a/plugins/store/src/lib.rs +++ b/plugins/store/src/lib.rs @@ -48,7 +48,7 @@ struct ChangePayload<'a> { value: &'a JsonValue, } -struct StoreCollection { +pub struct StoreCollection { stores: Mutex>>, frozen: bool, @@ -56,7 +56,7 @@ struct StoreCollection { mobile_plugin_handle: PluginHandle, } -fn with_store) -> Result>( +pub fn with_store) -> Result>( app: AppHandle, collection: State<'_, StoreCollection>, path: impl AsRef, From c281df8d791fb1e8ca3f5ed5b126eedc17152b43 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 7 Mar 2024 11:56:39 +0100 Subject: [PATCH 02/29] ci: Move cargo target dir to /mnt (#1039) Currently our publishing workflow fails _twice_ because it runs out of disk space. https://github.com/tauri-apps/plugins-workspace/actions/runs/8182433330/job/22373757645#step:8:8499 A month ago github changed the azure vms for public repos which resulted in a size decrease of the root partition by ~10gb (though i kinda doubt this is the sole reason because it doesn't fail once, but twice). At the same time the /mnt partition was increased to a whopping 75gb, over 60gb of it unused, since the root partition only has ~20gb free space we'll let rust save its artifact into /mnt hoping that we're actually dealing with space issues and not something else... --- .github/workflows/covector-version-or-publish-v2.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/covector-version-or-publish-v2.yml b/.github/workflows/covector-version-or-publish-v2.yml index 6d1ce3a7..bfbab699 100644 --- a/.github/workflows/covector-version-or-publish-v2.yml +++ b/.github/workflows/covector-version-or-publish-v2.yml @@ -46,10 +46,17 @@ jobs: git config --global user.name "${{ github.event.pusher.name }}" git config --global user.email "${{ github.event.pusher.email }}" + - name: Setup target dir on /mnt + run: | + sudo mkdir /mnt/target + WORKSPACE_OWNER="$(stat -c '%U:%G' "${GITHUB_WORKSPACE}")" + sudo chown -R "${WORKSPACE_OWNER}" /mnt/target + - name: covector version or publish (publish when no change files present) uses: jbolda/covector/packages/action@covector-v0 id: covector env: + CARGO_TARGET_DIR: /mnt/target NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} with: token: ${{ secrets.GITHUB_TOKEN }} From 685c4094c56ef0176809dafd0d33a83abed99828 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 7 Mar 2024 12:11:42 +0100 Subject: [PATCH 03/29] ci: Change paths-filter's base to v2 branch (#1043) Currently it compares it to the default branch (v1) which makes it always run all plugin checks. While i plan to change default branches soon i still need a bit more time for this. --- .github/workflows/test-rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-rust.yml b/.github/workflows/test-rust.yml index ead80be3..5d138fce 100644 --- a/.github/workflows/test-rust.yml +++ b/.github/workflows/test-rust.yml @@ -42,6 +42,7 @@ jobs: - uses: dorny/paths-filter@v2 id: filter with: + base: v2 filters: | tauri-plugin-authenticator: - .github/workflows/test-rust.yml From 75d82868b214b9d53ce8c80f518b78432574f9f4 Mon Sep 17 00:00:00 2001 From: DK Liao Date: Thu, 7 Mar 2024 19:15:46 +0800 Subject: [PATCH 04/29] docs(positioner): Update positioner readme to new tray api (#1041) `on_system_tray_event` is now reworked into `on_tray_icon_event` --- plugins/positioner/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index 4dd31413..e6b25170 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -51,12 +51,19 @@ First you need to register the core plugin with Tauri: `src-tauri/src/main.rs` ```rust +use tauri::tray::TrayIconBuilder; + fn main() { tauri::Builder::default() .plugin(tauri_plugin_positioner::init()) // This is required to get tray-relative positions to work - .on_system_tray_event(|app, event| { - tauri_plugin_positioner::on_tray_event(app, &event); + .setup(|app| { + TrayIconBuilder::new() + .on_tray_icon_event(|app, event| { + tauri_plugin_positioner::on_tray_event(app.app_handle(), &event); + }) + .build(app)?; + Ok(()) }) .run(tauri::generate_context!()) .expect("error while running tauri application"); From 644eb448bb5d32ee837c35902bfd14e3914e2bc5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:19:11 +0100 Subject: [PATCH 05/29] publish new versions (#1042) Co-authored-by: FabianLars --- .changes/pre.json | 1 + plugins/store/CHANGELOG.md | 4 ++++ plugins/store/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.changes/pre.json b/.changes/pre.json index b7b5906e..246884ca 100644 --- a/.changes/pre.json +++ b/.changes/pre.json @@ -11,6 +11,7 @@ ".changes/fix-zbus-import.md", ".changes/http-user-agent.md", ".changes/msrv-1.75.md", + ".changes/public-with-store.md", ".changes/shell-shellexcute.md", ".changes/tauri-beta-4.md", ".changes/tauri-beta-8.md", diff --git a/plugins/store/CHANGELOG.md b/plugins/store/CHANGELOG.md index 1a94cc62..ae9b43ab 100644 --- a/plugins/store/CHANGELOG.md +++ b/plugins/store/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## \[2.0.0-beta.3] + +- [`79691e9`](https://github.com/tauri-apps/plugins-workspace/commit/79691e93e04b820e44dce1c7d91b8865fa6ccb14)([#1040](https://github.com/tauri-apps/plugins-workspace/pull/1040)) Fix `with_store` and `StoreCollection` changed to private in #1011 + ## \[2.0.0-beta.2] - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml index 04e7fdf6..8b6328d6 100644 --- a/plugins/store/Cargo.toml +++ b/plugins/store/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin-store" -version = "2.0.0-beta.2" +version = "2.0.0-beta.3" description = "Simple, persistent key-value store." authors = { workspace = true } license = { workspace = true } From 62dafda6526899b407a7c5a1bb269c5c0dfb2630 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Thu, 7 Mar 2024 18:33:44 +0200 Subject: [PATCH 06/29] refactor!(global-shortcut): better APIs DX (#969) * feat(global-shortcut): add `GlobalShortcutExt::register_with_handler` ref: https://github.com/tauri-apps/plugins-workspace/issues/965 * clippy * refactor apis to take closure by default * change file * Update .changes/global-shortcut-refactor.md Co-authored-by: Simon Hyll * Update global-shortcut-refactor.md * use option instead * clippy * update readme * on_shortcut and with_shortcut * map handler * simplify events * lint --------- Co-authored-by: Simon Hyll Co-authored-by: Lucas Nogueira --- .changes/global-shortcut-refactor.md | 9 ++ plugins/global-shortcut/README.md | 24 +-- plugins/global-shortcut/src/lib.rs | 227 +++++++++++++++++---------- 3 files changed, 168 insertions(+), 92 deletions(-) create mode 100644 .changes/global-shortcut-refactor.md diff --git a/.changes/global-shortcut-refactor.md b/.changes/global-shortcut-refactor.md new file mode 100644 index 00000000..295c8f6f --- /dev/null +++ b/.changes/global-shortcut-refactor.md @@ -0,0 +1,9 @@ +--- +"global-shortcut": "patch" +--- + +**Breaking change** Refactored the plugin Rust APIs for better DX and flexibility: + +- Changed `Builder::with_handler` to be a method instead of a static method, it will also be triggered for any and all shortcuts even if the shortcut is registered through JS. +- Added `Builder::with_shortcut` and `Builder::with_shortcuts` to register shortcuts on the plugin builder. +- Added `on_shortcut` and `on_all_shortcuts` to register shortcuts with a handler. diff --git a/plugins/global-shortcut/README.md b/plugins/global-shortcut/README.md index 4bdb24f4..f3288258 100644 --- a/plugins/global-shortcut/README.md +++ b/plugins/global-shortcut/README.md @@ -57,20 +57,22 @@ fn main() { .setup(|app| { #[cfg(desktop)] { - use tauri_plugin_global_shortcut::{Code, GlobalShortcutExt, Modifiers, Shortcut}; + use tauri::Manager; + use tauri_plugin_global_shortcut::{Code, Modifiers}; - let ctrl_n_shortcut = Shortcut::new(Some(Modifiers::CONTROL), Code::KeyN); app.handle().plugin( - tauri_plugin_global_shortcut::Builder::with_handler(move |_app, shortcut| { - println!("{:?}", shortcut); - if shortcut == &ctrl_n_shortcut { - println!("Ctrl-N Detected!"); - } - }) - .build(), + tauri_plugin_global_shortcut::Builder::new() + .with_shortcuts(["ctrl+d", "alt+space"])? + .with_handler(|app, shortcut| { + if shortcut.matches(Modifiers::CONTROL, Code::KeyD) { + let _ = app.emit("shortcut-event", "Ctrl+D triggered"); + } + if shortcut.matches(Modifiers::ALT, Code::Space) { + let _ = app.emit("shortcut-event", "Alt+Space triggered"); + } + }) + .build(), )?; - - app.global_shortcut().register(ctrl_n_shortcut)?; } Ok(()) diff --git a/plugins/global-shortcut/src/lib.rs b/plugins/global-shortcut/src/lib.rs index eed72a99..b1f3b83e 100644 --- a/plugins/global-shortcut/src/lib.rs +++ b/plugins/global-shortcut/src/lib.rs @@ -35,20 +35,6 @@ type Result = std::result::Result; type HotKeyId = u32; type HandlerFn = Box, &Shortcut) + Send + Sync + 'static>; -enum ShortcutSource { - Ipc(Channel), - Rust, -} - -impl Clone for ShortcutSource { - fn clone(&self) -> Self { - match self { - Self::Ipc(channel) => Self::Ipc(channel.clone()), - Self::Rust => Self::Rust, - } - } -} - pub struct ShortcutWrapper(Shortcut); impl From for ShortcutWrapper { @@ -64,52 +50,52 @@ impl TryFrom<&str> for ShortcutWrapper { } } -struct RegisteredShortcut { - source: ShortcutSource, - shortcut: (Shortcut, Option), +struct RegisteredShortcut { + shortcut: Shortcut, + handler: Option>>, } pub struct GlobalShortcut { #[allow(dead_code)] app: AppHandle, - manager: std::result::Result, - shortcuts: Arc>>, + manager: GlobalHotKeyManager, + shortcuts: Arc>>>, } impl GlobalShortcut { - fn register_internal( + fn register_internal, &Shortcut) + Send + Sync + 'static>( &self, - shortcut: (Shortcut, Option), - source: ShortcutSource, + shortcut: Shortcut, + handler: Option, ) -> Result<()> { - let id = shortcut.0.id(); - acquire_manager(&self.manager)?.register(shortcut.0)?; + let id = shortcut.id(); + let handler = handler.map(|h| Arc::new(Box::new(h) as HandlerFn)); + + self.manager.register(shortcut)?; self.shortcuts .lock() .unwrap() - .insert(id, RegisteredShortcut { source, shortcut }); + .insert(id, RegisteredShortcut { shortcut, handler }); Ok(()) } - fn register_all_internal)>>( - &self, - shortcuts: S, - source: ShortcutSource, - ) -> Result<()> { - let hotkeys = shortcuts - .into_iter() - .collect::)>>(); + fn register_all_internal(&self, shortcuts: S, handler: Option) -> Result<()> + where + S: IntoIterator, + F: Fn(&AppHandle, &Shortcut) + Send + Sync + 'static, + { + let handler = handler.map(|h| Arc::new(Box::new(h) as HandlerFn)); - let manager = acquire_manager(&self.manager)?; - let mut shortcuts = self.shortcuts.lock().unwrap(); - for hotkey in hotkeys { - manager.register(hotkey.0)?; + let hotkeys = shortcuts.into_iter().collect::>(); + let mut shortcuts = self.shortcuts.lock().unwrap(); + for shortcut in hotkeys { + self.manager.register(shortcut)?; shortcuts.insert( - hotkey.0.id(), + shortcut.id(), RegisteredShortcut { - source: source.clone(), - shortcut: hotkey, + shortcut, + handler: handler.clone(), }, ); } @@ -117,34 +103,65 @@ impl GlobalShortcut { Ok(()) } - pub fn register>(&self, shortcut: S) -> Result<()> + /// Register a shortcut. + pub fn register(&self, shortcut: S) -> Result<()> where + S: TryInto, S::Error: std::error::Error, { - self.register_internal((try_into_shortcut(shortcut)?, None), ShortcutSource::Rust) + self.register_internal( + try_into_shortcut(shortcut)?, + None::, &Shortcut)>, + ) } - pub fn register_all, S: IntoIterator>( - &self, - shortcuts: S, - ) -> Result<()> + /// Register a shortcut with a handler. + pub fn on_shortcut(&self, shortcut: S, handler: F) -> Result<()> + where + S: TryInto, + S::Error: std::error::Error, + F: Fn(&AppHandle, &Shortcut) + Send + Sync + 'static, + { + self.register_internal(try_into_shortcut(shortcut)?, Some(handler)) + } + + /// Register multiple shortcuts. + pub fn register_all(&self, shortcuts: S) -> Result<()> where + S: IntoIterator, + T: TryInto, T::Error: std::error::Error, { let mut s = Vec::new(); for shortcut in shortcuts { - s.push((try_into_shortcut(shortcut)?, None)); + s.push(try_into_shortcut(shortcut)?); } - self.register_all_internal(s, ShortcutSource::Rust) + self.register_all_internal(s, None::, &Shortcut)>) + } + + /// Register multiple shortcuts with a handler. + pub fn on_all_shortcuts(&self, shortcuts: S, handler: F) -> Result<()> + where + S: IntoIterator, + T: TryInto, + T::Error: std::error::Error, + F: Fn(&AppHandle, &Shortcut) + Send + Sync + 'static, + { + let mut s = Vec::new(); + for shortcut in shortcuts { + s.push(try_into_shortcut(shortcut)?); + } + self.register_all_internal(s, Some(handler)) } pub fn unregister>(&self, shortcut: S) -> Result<()> where S::Error: std::error::Error, { - acquire_manager(&self.manager)? - .unregister(try_into_shortcut(shortcut)?) - .map_err(Into::into) + let shortcut = try_into_shortcut(shortcut)?; + self.manager.unregister(shortcut)?; + self.shortcuts.lock().unwrap().remove(&shortcut.id()); + Ok(()) } pub fn unregister_all, S: IntoIterator>( @@ -158,9 +175,15 @@ impl GlobalShortcut { for shortcut in shortcuts { s.push(try_into_shortcut(shortcut)?); } - acquire_manager(&self.manager)? - .unregister_all(&s) - .map_err(Into::into) + + self.manager.unregister_all(&s)?; + + let mut shortcuts = self.shortcuts.lock().unwrap(); + for s in s { + shortcuts.remove(&s.id()); + } + + Ok(()) } /// Determines whether the given shortcut is registered by this application or not. @@ -188,14 +211,6 @@ impl> GlobalShortcutExt for T { } } -fn acquire_manager( - manager: &std::result::Result, -) -> Result<&GlobalHotKeyManager> { - manager - .as_ref() - .map_err(|e| Error::GlobalHotkey(e.to_string())) -} - fn parse_shortcut>(shortcut: S) -> Result { shortcut.as_ref().parse().map_err(Into::into) } @@ -218,8 +233,10 @@ fn register( handler: Channel, ) -> Result<()> { global_shortcut.register_internal( - (parse_shortcut(&shortcut)?, Some(shortcut)), - ShortcutSource::Ipc(handler), + parse_shortcut(&shortcut)?, + Some(move |_app: &AppHandle, _shortcut: &Shortcut| { + let _ = handler.send(&shortcut); + }), ) } @@ -231,10 +248,22 @@ fn register_all( handler: Channel, ) -> Result<()> { let mut hotkeys = Vec::new(); + + let mut shortcut_map = HashMap::new(); for shortcut in shortcuts { - hotkeys.push((parse_shortcut(&shortcut)?, Some(shortcut))); + let hotkey = parse_shortcut(&shortcut)?; + shortcut_map.insert(hotkey.id(), shortcut); + hotkeys.push(hotkey); } - global_shortcut.register_all_internal(hotkeys, ShortcutSource::Ipc(handler)) + + global_shortcut.register_all_internal( + hotkeys, + Some(move |_app: &AppHandle, shortcut: &Shortcut| { + if let Some(shortcut_str) = shortcut_map.get(&shortcut.id()) { + let _ = handler.send(shortcut_str); + } + }), + ) } #[tauri::command] @@ -269,12 +298,14 @@ fn is_registered( } pub struct Builder { + shortcuts: Vec, handler: Option>, } impl Default for Builder { fn default() -> Self { Self { + shortcuts: Vec::new(), handler: Default::default(), } } @@ -285,16 +316,42 @@ impl Builder { Self::default() } + /// Add a shortcut to be registerd. + pub fn with_shortcut(mut self, shortcut: T) -> Result + where + T: TryInto, + T::Error: std::error::Error, + { + self.shortcuts.push(try_into_shortcut(shortcut)?); + Ok(self) + } + + /// Add multiple shortcuts to be registerd. + pub fn with_shortcuts(mut self, shortcuts: S) -> Result + where + S: IntoIterator, + T: TryInto, + T::Error: std::error::Error, + { + for shortcut in shortcuts { + self.shortcuts.push(try_into_shortcut(shortcut)?); + } + + Ok(self) + } + + /// Specify a global shortcut handler that will be triggered for any and all shortcuts. pub fn with_handler, &Shortcut) + Send + Sync + 'static>( + mut self, handler: F, ) -> Self { - Self { - handler: Some(Box::new(handler)), - } + self.handler.replace(Box::new(handler)); + self } pub fn build(self) -> TauriPlugin { let handler = self.handler; + let shortcuts = self.shortcuts; PluginBuilder::new("global-shortcut") .js_init_script(include_str!("api-iife.js").to_string()) .invoke_handler(tauri::generate_handler![ @@ -305,29 +362,37 @@ impl Builder { is_registered ]) .setup(move |app, _api| { - let shortcuts = - Arc::new(Mutex::new(HashMap::::new())); + let manager = GlobalHotKeyManager::new()?; + let mut store = HashMap::>::new(); + for shortcut in shortcuts { + manager.register(shortcut)?; + store.insert( + shortcut.id(), + RegisteredShortcut { + shortcut, + handler: None, + }, + ); + } + + let shortcuts = Arc::new(Mutex::new(store)); let shortcuts_ = shortcuts.clone(); let app_handle = app.clone(); GlobalHotKeyEvent::set_event_handler(Some(move |e: GlobalHotKeyEvent| { if let Some(shortcut) = shortcuts_.lock().unwrap().get(&e.id) { - match &shortcut.source { - ShortcutSource::Ipc(channel) => { - let _ = channel.send(&shortcut.shortcut.1); - } - ShortcutSource::Rust => { - if let Some(handler) = &handler { - handler(&app_handle, &shortcut.shortcut.0); - } - } + if let Some(handler) = &shortcut.handler { + handler(&app_handle, &shortcut.shortcut); + } + if let Some(handler) = &handler { + handler(&app_handle, &shortcut.shortcut); } } })); app.manage(GlobalShortcut { app: app.clone(), - manager: GlobalHotKeyManager::new(), + manager, shortcuts, }); Ok(()) From bff722451d904e0d4a00c605cfb02c5de2a59afc Mon Sep 17 00:00:00 2001 From: Naman Garg <155433377+naman-crabnebula@users.noreply.github.com> Date: Fri, 8 Mar 2024 04:37:08 +0530 Subject: [PATCH 07/29] docs(sql): Fix minor typo (#1048) --- plugins/sql/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/sql/README.md b/plugins/sql/README.md index 770db6b1..cbe47e86 100644 --- a/plugins/sql/README.md +++ b/plugins/sql/README.md @@ -89,7 +89,7 @@ const result = await db.execute( ); const result = await db.execute( - "UPDATE todos SET title = $1, completed = $2 WHERE id = $3", + "UPDATE todos SET title = $1, status = $2 WHERE id = $3", [todos.title, todos.status, todos.id], ); @@ -100,7 +100,7 @@ const result = await db.execute( ); const result = await db.execute( - "UPDATE todos SET title = ?, completed = ? WHERE id = ?", + "UPDATE todos SET title = ?, status = ? WHERE id = ?", [todos.title, todos.status, todos.id], ); ``` From 753c7be0a6a78121d2e88ea0efc3040580c885b4 Mon Sep 17 00:00:00 2001 From: Lorenzo Rizzotti Date: Fri, 8 Mar 2024 06:31:47 +0100 Subject: [PATCH 08/29] feat(http) add unsafe-headers feature flag (#1050) * [http] add unsafe-headers feature flag * change file * fmt --- .changes/http-unsafe-headers.md | 5 +++ Cargo.lock | 58 ++++++++++++++++----------------- plugins/http/Cargo.toml | 1 + plugins/http/src/commands.rs | 7 ++-- 4 files changed, 40 insertions(+), 31 deletions(-) create mode 100644 .changes/http-unsafe-headers.md diff --git a/.changes/http-unsafe-headers.md b/.changes/http-unsafe-headers.md new file mode 100644 index 00000000..a387be97 --- /dev/null +++ b/.changes/http-unsafe-headers.md @@ -0,0 +1,5 @@ +--- +"http": patch +--- + +Add `unsafe-headers` cargo feature flag to allow using [forbidden headers](https://fetch.spec.whatwg.org/#terminology-headers). \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 59c41093..fad46e8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,7 +230,7 @@ checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "api" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "log", "serde", @@ -6401,7 +6401,7 @@ dependencies = [ [[package]] name = "tauri-plugin-authenticator" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "authenticator", "base64 0.21.7", @@ -6423,7 +6423,7 @@ dependencies = [ [[package]] name = "tauri-plugin-autostart" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "auto-launch", "log", @@ -6436,7 +6436,7 @@ dependencies = [ [[package]] name = "tauri-plugin-barcode-scanner" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "log", "serde", @@ -6448,7 +6448,7 @@ dependencies = [ [[package]] name = "tauri-plugin-biometric" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "log", "serde", @@ -6461,7 +6461,7 @@ dependencies = [ [[package]] name = "tauri-plugin-cli" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "clap", "log", @@ -6474,7 +6474,7 @@ dependencies = [ [[package]] name = "tauri-plugin-clipboard-manager" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "arboard", "log", @@ -6487,7 +6487,7 @@ dependencies = [ [[package]] name = "tauri-plugin-deep-link" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "log", "serde", @@ -6500,7 +6500,7 @@ dependencies = [ [[package]] name = "tauri-plugin-dialog" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "glib 0.16.9", "log", @@ -6516,7 +6516,7 @@ dependencies = [ [[package]] name = "tauri-plugin-fs" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "anyhow", "glob", @@ -6535,7 +6535,7 @@ dependencies = [ [[package]] name = "tauri-plugin-global-shortcut" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "global-hotkey", "log", @@ -6548,7 +6548,7 @@ dependencies = [ [[package]] name = "tauri-plugin-http" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "data-url", "http 0.2.11", @@ -6567,7 +6567,7 @@ dependencies = [ [[package]] name = "tauri-plugin-localhost" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "http 1.0.0", "log", @@ -6580,7 +6580,7 @@ dependencies = [ [[package]] name = "tauri-plugin-log" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "android_logger", "byte-unit", @@ -6599,7 +6599,7 @@ dependencies = [ [[package]] name = "tauri-plugin-nfc" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "log", "serde", @@ -6612,7 +6612,7 @@ dependencies = [ [[package]] name = "tauri-plugin-notification" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "chrono", "color-backtrace", @@ -6640,7 +6640,7 @@ dependencies = [ [[package]] name = "tauri-plugin-os" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "gethostname", "log", @@ -6656,7 +6656,7 @@ dependencies = [ [[package]] name = "tauri-plugin-persisted-scope" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "aho-corasick", "bincode", @@ -6670,7 +6670,7 @@ dependencies = [ [[package]] name = "tauri-plugin-positioner" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "log", "serde", @@ -6683,7 +6683,7 @@ dependencies = [ [[package]] name = "tauri-plugin-process" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "tauri", "tauri-plugin", @@ -6691,7 +6691,7 @@ dependencies = [ [[package]] name = "tauri-plugin-shell" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "encoding_rs", "log", @@ -6709,7 +6709,7 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" -version = "2.0.0-beta.2" +version = "2.0.0-beta.3" dependencies = [ "log", "serde", @@ -6722,7 +6722,7 @@ dependencies = [ [[package]] name = "tauri-plugin-sql" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "futures-core", "log", @@ -6738,7 +6738,7 @@ dependencies = [ [[package]] name = "tauri-plugin-store" -version = "2.0.0-beta.1" +version = "2.0.0-beta.3" dependencies = [ "log", "serde", @@ -6750,7 +6750,7 @@ dependencies = [ [[package]] name = "tauri-plugin-stronghold" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "hex", "iota-crypto 0.23.1", @@ -6771,7 +6771,7 @@ dependencies = [ [[package]] name = "tauri-plugin-updater" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "base64 0.21.7", "dirs-next", @@ -6798,7 +6798,7 @@ dependencies = [ [[package]] name = "tauri-plugin-upload" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "futures-util", "log", @@ -6815,7 +6815,7 @@ dependencies = [ [[package]] name = "tauri-plugin-websocket" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "futures-util", "http 1.0.0", @@ -6832,7 +6832,7 @@ dependencies = [ [[package]] name = "tauri-plugin-window-state" -version = "2.0.0-beta.1" +version = "2.0.0-beta.2" dependencies = [ "bincode", "bitflags 2.4.2", diff --git a/plugins/http/Cargo.toml b/plugins/http/Cargo.toml index a35c1401..95860309 100644 --- a/plugins/http/Cargo.toml +++ b/plugins/http/Cargo.toml @@ -53,3 +53,4 @@ deflate = [ "reqwest/deflate" ] trust-dns = [ "reqwest/trust-dns" ] socks = [ "reqwest/socks" ] http3 = [ "reqwest/http3" ] +unsafe-headers = [] diff --git a/plugins/http/src/commands.rs b/plugins/http/src/commands.rs index d4b2469b..e88608f6 100644 --- a/plugins/http/src/commands.rs +++ b/plugins/http/src/commands.rs @@ -195,7 +195,8 @@ pub async fn fetch( for (name, value) in &headers { let name = HeaderName::from_bytes(name.as_bytes())?; let value = HeaderValue::from_bytes(value.as_bytes())?; - if !matches!( + #[cfg(not(feature = "unsafe-headers"))] + if matches!( name, // forbidden headers per fetch spec https://fetch.spec.whatwg.org/#terminology-headers header::ACCEPT_CHARSET @@ -218,8 +219,10 @@ pub async fn fetch( | header::UPGRADE | header::VIA ) { - request = request.header(name, value); + continue; } + + request = request.header(name, value); } // POST and PUT requests should always have a 0 length content-length, From 4e37316af0d6532bf9a9bd0e712b5b14b0598285 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 11 Mar 2024 23:29:16 +0800 Subject: [PATCH 09/29] fix(updater): fallback to passive mode & fix `installerArgs` deserialzation (#1051) --- ...-updater-installer-args-deserialization.md | 5 ++ .changes/fix-updater-installmode.md | 5 ++ plugins/updater/src/config.rs | 20 +++++++- plugins/updater/src/lib.rs | 13 ++--- plugins/updater/src/updater.rs | 50 ++++++++----------- .../updater/tests/app-updater/tauri.conf.json | 3 +- 6 files changed, 56 insertions(+), 40 deletions(-) create mode 100644 .changes/fix-updater-installer-args-deserialization.md create mode 100644 .changes/fix-updater-installmode.md diff --git a/.changes/fix-updater-installer-args-deserialization.md b/.changes/fix-updater-installer-args-deserialization.md new file mode 100644 index 00000000..6456f65f --- /dev/null +++ b/.changes/fix-updater-installer-args-deserialization.md @@ -0,0 +1,5 @@ +--- +"updater": patch +--- + +Fix deserialization of `windows > installerArgs` config field. diff --git a/.changes/fix-updater-installmode.md b/.changes/fix-updater-installmode.md new file mode 100644 index 00000000..ac20ee7a --- /dev/null +++ b/.changes/fix-updater-installmode.md @@ -0,0 +1,5 @@ +--- +"updater": patch +--- + +On Windows, fallback to `passive` install mode when not defined in config. diff --git a/plugins/updater/src/config.rs b/plugins/updater/src/config.rs index aea6a547..6847363c 100644 --- a/plugins/updater/src/config.rs +++ b/plugins/updater/src/config.rs @@ -64,13 +64,29 @@ impl Default for WindowsUpdateInstallMode { #[serde(rename_all = "camelCase")] pub struct WindowsConfig { /// Additional arguments given to the NSIS or WiX installer. - #[serde(default, alias = "installer-args")] + #[serde( + default, + alias = "installer-args", + deserialize_with = "deserialize_os_string" + )] pub installer_args: Vec, - /// Updating mode, see [`WindowsUpdateInstallMode`] for more info. + /// Updating mode, defaults to `passive` mode. + /// + /// See [`WindowsUpdateInstallMode`] for more info. #[serde(default, alias = "install-mode")] pub install_mode: WindowsUpdateInstallMode, } +fn deserialize_os_string<'de, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + Ok(Vec::::deserialize(deserializer)? + .into_iter() + .map(OsString::from) + .collect::>()) +} + /// Updater configuration. #[derive(Debug, Clone, Deserialize, Default)] #[serde(rename_all = "camelCase")] diff --git a/plugins/updater/src/lib.rs b/plugins/updater/src/lib.rs index 8c0ea2cb..e060827d 100644 --- a/plugins/updater/src/lib.rs +++ b/plugins/updater/src/lib.rs @@ -13,7 +13,7 @@ html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" )] -use std::ffi::{OsStr, OsString}; +use std::ffi::OsString; use tauri::{ plugin::{Builder as PluginBuilder, TauriPlugin}, @@ -136,21 +136,18 @@ impl Builder { pub fn installer_args(mut self, args: I) -> Self where I: IntoIterator, - S: AsRef, + S: Into, { - let args = args - .into_iter() - .map(|a| a.as_ref().to_os_string()) - .collect::>(); + let args = args.into_iter().map(|a| a.into()).collect::>(); self.installer_args.extend_from_slice(&args); self } pub fn installer_arg(mut self, arg: S) -> Self where - S: AsRef, + S: Into, { - self.installer_args.push(arg.as_ref().to_os_string()); + self.installer_args.push(arg.into()); self } diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index a77d0af5..52b33e21 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -176,21 +176,18 @@ impl UpdaterBuilder { pub fn installer_arg(mut self, arg: S) -> Self where - S: AsRef, + S: Into, { - self.installer_args.push(arg.as_ref().to_os_string()); + self.installer_args.push(arg.into()); self } pub fn installer_args(mut self, args: I) -> Self where I: IntoIterator, - S: AsRef, + S: Into, { - let args = args - .into_iter() - .map(|a| a.as_ref().to_os_string()) - .collect::>(); + let args = args.into_iter().map(|a| a.into()).collect::>(); self.installer_args.extend_from_slice(&args); self } @@ -543,6 +540,13 @@ impl Update { |p| format!("{p}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"), ); + let install_mode = self + .config + .windows + .as_ref() + .map(|w| w.install_mode.clone()) + .unwrap_or_default(); + for path in paths { let found_path = path?.path(); // we support 2 type of files exe & msi for now @@ -555,17 +559,11 @@ impl Update { installer_path.push("\""); let installer_args = [ - self.config - .windows - .as_ref() - .map(|w| { - w.install_mode - .nsis_args() - .iter() - .map(|a| OsStr::new(a)) - .collect::>() - }) - .unwrap_or_default(), + install_mode + .nsis_args() + .iter() + .map(OsStr::new) + .collect::>(), self.installer_args .iter() .map(|a| a.as_os_str()) @@ -600,17 +598,11 @@ impl Update { msi_path.push("\"\"\""); let installer_args = [ - self.config - .windows - .as_ref() - .map(|w| { - w.install_mode - .msiexec_args() - .iter() - .map(|a| OsStr::new(a)) - .collect::>() - }) - .unwrap_or_default(), + install_mode + .msiexec_args() + .iter() + .map(OsStr::new) + .collect::>(), self.installer_args .iter() .map(|a| a.as_os_str()) diff --git a/plugins/updater/tests/app-updater/tauri.conf.json b/plugins/updater/tests/app-updater/tauri.conf.json index 6eb919ef..4c891ab9 100644 --- a/plugins/updater/tests/app-updater/tauri.conf.json +++ b/plugins/updater/tests/app-updater/tauri.conf.json @@ -5,7 +5,8 @@ "endpoints": ["http://localhost:3007"], "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEUwNDRGMjkwRjg2MDhCRDAKUldUUWkyRDRrUEpFNEQ4SmdwcU5PaXl6R2ZRUUNvUnhIaVkwVUltV0NMaEx6VTkrWVhpT0ZqeEEK", "windows": { - "installMode": "quiet" + "installMode": "quiet", + "installerArgs": ["/NS"] } } }, From c873e4d6c74e759742f7c9a88e35cff10a75122a Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Mon, 11 Mar 2024 13:39:35 -0300 Subject: [PATCH 10/29] fix(http): inconsistencies on urlpattern usage on scope (#1059) * fix(http): inconsistencies on urlpattern usage on scope * fix tests * enhance tests --- .changes/fix-http-scope-url-match.md | 5 +++ plugins/http/src/scope.rs | 66 +++++++++++++++++++++++++--- 2 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 .changes/fix-http-scope-url-match.md diff --git a/.changes/fix-http-scope-url-match.md b/.changes/fix-http-scope-url-match.md new file mode 100644 index 00000000..c3929f5d --- /dev/null +++ b/.changes/fix-http-scope-url-match.md @@ -0,0 +1,5 @@ +--- +"http": patch +--- + +Fixes scope not allowing subpaths, query parameters and hash when those values are empty. diff --git a/plugins/http/src/scope.rs b/plugins/http/src/scope.rs index 9067f406..291cbfa3 100644 --- a/plugins/http/src/scope.rs +++ b/plugins/http/src/scope.rs @@ -6,7 +6,7 @@ use std::sync::Arc; use serde::{Deserialize, Deserializer}; use url::Url; -use urlpattern::{UrlPattern, UrlPatternInit, UrlPatternMatchInput}; +use urlpattern::{UrlPattern, UrlPatternMatchInput}; #[allow(rustdoc::bare_urls)] #[derive(Debug)] @@ -15,7 +15,21 @@ pub struct Entry { } fn parse_url_pattern(s: &str) -> Result { - let init = UrlPatternInit::parse_constructor_string::(s, None)?; + let mut init = urlpattern::UrlPatternInit::parse_constructor_string::(s, None)?; + if init.search.as_ref().map(|p| p.is_empty()).unwrap_or(true) { + init.search.replace("*".to_string()); + } + if init.hash.as_ref().map(|p| p.is_empty()).unwrap_or(true) { + init.hash.replace("*".to_string()); + } + if init + .pathname + .as_ref() + .map(|p| p.is_empty() || p == "/") + .unwrap_or(true) + { + init.pathname.replace("*".to_string()); + } UrlPattern::parse(init) } @@ -100,6 +114,7 @@ mod tests { let deny = Arc::new("http://localhost:8080/*".parse().unwrap()); let scope = super::Scope::new(vec![&allow], vec![&deny]); assert!(!scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); + assert!(!scope.is_allowed(&"http://localhost:8080?framework=tauri".parse().unwrap())); } #[test] @@ -109,9 +124,10 @@ mod tests { let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://localhost:8080".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/path/to/asset.png".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/path/list?limit=50".parse().unwrap())); - assert!(!scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); - assert!(!scope.is_allowed(&"http://localhost:8080/path/to/asset.png".parse().unwrap())); assert!(!scope.is_allowed(&"https://localhost:8080".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8081".parse().unwrap())); assert!(!scope.is_allowed(&"http://local:8080".parse().unwrap())); @@ -124,6 +140,7 @@ mod tests { let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/file.png?q=1".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080".parse().unwrap())); assert!(!scope.is_allowed(&"http://localhost:8080/file".parse().unwrap())); @@ -136,7 +153,13 @@ mod tests { let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://localhost:8080/file.png".parse().unwrap())); + assert!(scope.is_allowed(&"http://localhost:8080/file.png#head".parse().unwrap())); assert!(scope.is_allowed(&"http://localhost:8080/assets/file.png".parse().unwrap())); + assert!(scope.is_allowed( + &"http://localhost:8080/assets/file.png?width=100&height=200" + .parse() + .unwrap() + )); assert!(!scope.is_allowed(&"http://localhost:8080/file.jpeg".parse().unwrap())); } @@ -147,7 +170,15 @@ mod tests { let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); - assert!(!scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else#tauri".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else?rel=tauri".parse().unwrap())); + assert!(scope.is_allowed( + &"http://something.else/path/to/file.mp4?start=500" + .parse() + .unwrap() + )); + assert!(!scope.is_allowed(&"https://something.else".parse().unwrap())); let entry = Arc::new("http://*/*".parse().unwrap()); @@ -163,10 +194,11 @@ mod tests { let scope = super::Scope::new(vec![&entry], Vec::new()); assert!(scope.is_allowed(&"http://something.else".parse().unwrap())); - assert!(!scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"http://something.else/path/to/file".parse().unwrap())); assert!(scope.is_allowed(&"file://path".parse().unwrap())); - assert!(!scope.is_allowed(&"file://path/to/file".parse().unwrap())); + assert!(scope.is_allowed(&"file://path/to/file".parse().unwrap())); assert!(scope.is_allowed(&"https://something.else".parse().unwrap())); + assert!(scope.is_allowed(&"https://something.else?x=1#frag".parse().unwrap())); let entry = Arc::new("*://*/*".parse().unwrap()); let scope = super::Scope::new(vec![&entry], Vec::new()); @@ -176,4 +208,24 @@ mod tests { assert!(scope.is_allowed(&"file://path/to/file".parse().unwrap())); assert!(scope.is_allowed(&"https://something.else".parse().unwrap())); } + + #[test] + fn validate_query() { + let entry = Arc::new("https://tauri.app/path?x=*".parse().unwrap()); + let scope = super::Scope::new(vec![&entry], Vec::new()); + + assert!(scope.is_allowed(&"https://tauri.app/path?x=5".parse().unwrap())); + + assert!(!scope.is_allowed(&"https://tauri.app/path?y=5".parse().unwrap())); + } + + #[test] + fn validate_hash() { + let entry = Arc::new("https://tauri.app/path#frame*".parse().unwrap()); + let scope = super::Scope::new(vec![&entry], Vec::new()); + + assert!(scope.is_allowed(&"https://tauri.app/path#frame".parse().unwrap())); + + assert!(!scope.is_allowed(&"https://tauri.app/path#work".parse().unwrap())); + } } From 69d45a06a694a69233763cd5e57f5f8b3be6df8a Mon Sep 17 00:00:00 2001 From: Han Date: Tue, 12 Mar 2024 17:16:39 +0800 Subject: [PATCH 11/29] chore(examples): example incorrect command (#1068) --- examples/api/src-tauri/tauri.conf.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/api/src-tauri/tauri.conf.json b/examples/api/src-tauri/tauri.conf.json index ec3190ef..9f1852d2 100644 --- a/examples/api/src-tauri/tauri.conf.json +++ b/examples/api/src-tauri/tauri.conf.json @@ -6,8 +6,8 @@ "build": { "devUrl": "http://localhost:5173", "frontendDist": "../dist", - "beforeDevCommand": "yarn dev", - "beforeBuildCommand": "yarn build" + "beforeDevCommand": "pnpm dev", + "beforeBuildCommand": "pnpm build" }, "app": { "withGlobalTauri": true, From 040004a6b9fbb89161d1b5764d79428dfe693776 Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Tue, 12 Mar 2024 21:20:56 +0800 Subject: [PATCH 12/29] chore(shell): change schema property name `command` to `cmd` (#1069) * chore: fix shell plugin `command` property in schema * chore: add changelog --- .changes/shell-fix-schema-command-property-name.md | 5 +++++ plugins/shell/src/scope_entry.rs | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changes/shell-fix-schema-command-property-name.md diff --git a/.changes/shell-fix-schema-command-property-name.md b/.changes/shell-fix-schema-command-property-name.md new file mode 100644 index 00000000..836368a1 --- /dev/null +++ b/.changes/shell-fix-schema-command-property-name.md @@ -0,0 +1,5 @@ +--- +"shell": "patch" +--- + +Change shell's schema property name `command` to `cmd`. diff --git a/plugins/shell/src/scope_entry.rs b/plugins/shell/src/scope_entry.rs index aac8e695..ff94a3a7 100644 --- a/plugins/shell/src/scope_entry.rs +++ b/plugins/shell/src/scope_entry.rs @@ -22,6 +22,7 @@ pub struct Entry { /// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, /// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. // use default just so the schema doesn't flag it as required + #[serde(rename = "cmd")] pub command: PathBuf, /// The allowed arguments for the command execution. From a3b5396113ca93912274f6890d9ef5b1a409587a Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Tue, 12 Mar 2024 23:47:22 +0800 Subject: [PATCH 13/29] refactor!(updater): migrate run updater using powershell to `ShellExecute` (#1054) * Migrate to ShellExecute * Add change file * Revert cargo.toml style * Remove unused imports * Migrate to windows-sys * Use open instead of runas * Use encode_wide instead of hstring * small cleanup --- .changes/fix-updater-powershell-flashing.md | 5 + Cargo.lock | 57 +++---- plugins/updater/Cargo.toml | 1 + .../updater/permissions/schemas/schema.json | 10 +- plugins/updater/src/updater.rs | 150 +++++------------- 5 files changed, 82 insertions(+), 141 deletions(-) create mode 100644 .changes/fix-updater-powershell-flashing.md diff --git a/.changes/fix-updater-powershell-flashing.md b/.changes/fix-updater-powershell-flashing.md new file mode 100644 index 00000000..a23b5b06 --- /dev/null +++ b/.changes/fix-updater-powershell-flashing.md @@ -0,0 +1,5 @@ +--- +"updater": patch +--- + +Fix Windows powershell window flashing on update diff --git a/Cargo.lock b/Cargo.lock index fad46e8b..9dee2ec4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1039,7 +1039,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -6793,6 +6793,7 @@ dependencies = [ "time", "tokio", "url", + "windows-sys 0.52.0", "zip", ] @@ -8092,7 +8093,7 @@ dependencies = [ "windows-core 0.52.0", "windows-implement", "windows-interface", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -8110,7 +8111,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -8172,7 +8173,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -8207,17 +8208,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -8226,7 +8227,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -8243,9 +8244,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -8267,9 +8268,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -8291,9 +8292,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -8315,9 +8316,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -8339,9 +8340,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -8357,9 +8358,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -8381,9 +8382,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" diff --git a/plugins/updater/Cargo.toml b/plugins/updater/Cargo.toml index 2440a6ec..6159feb2 100644 --- a/plugins/updater/Cargo.toml +++ b/plugins/updater/Cargo.toml @@ -37,6 +37,7 @@ tar = "0.4" [target."cfg(target_os = \"windows\")".dependencies] zip = { version = "0.6", default-features = false } +windows-sys = { version = "0.52.0", features = ["Win32_Foundation", "Win32_UI_WindowsAndMessaging"] } [target."cfg(any(target_os = \"macos\", target_os = \"linux\"))".dependencies] flate2 = "1.0.27" diff --git a/plugins/updater/permissions/schemas/schema.json b/plugins/updater/permissions/schemas/schema.json index 6d6a3c21..69135976 100644 --- a/plugins/updater/permissions/schemas/schema.json +++ b/plugins/updater/permissions/schemas/schema.json @@ -139,14 +139,10 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index 52b33e21..4ba74435 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -512,7 +512,11 @@ impl Update { // Update server can provide a custom EXE (installer) who can run any task. #[cfg(windows)] fn install_inner(&self, bytes: Vec) -> Result<()> { - use std::{fs, process::Command}; + use std::fs; + use windows_sys::{ + w, + Win32::UI::{Shell::ShellExecuteW, WindowsAndMessaging::SW_SHOW}, + }; // FIXME: We need to create a memory buffer with the MSI and then run it. // (instead of extracting the MSI to a temp path) @@ -521,131 +525,54 @@ impl Update { // shouldn't drop but we should be able to pass the reference so we can drop it once the installation // is done, otherwise we have a huge memory leak. - let archive = Cursor::new(bytes); - let tmp_dir = tempfile::Builder::new().tempdir()?.into_path(); - - // extract the buffer to the tmp_dir - // we extract our signed archive into our final directory without any temp file + let archive = Cursor::new(bytes); let mut extractor = zip::ZipArchive::new(archive)?; - - // extract the msi extractor.extract(&tmp_dir)?; let paths = fs::read_dir(&tmp_dir)?; - let system_root = std::env::var("SYSTEMROOT"); - let powershell_path = system_root.as_ref().map_or_else( - |_| "powershell.exe".to_string(), - |p| format!("{p}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"), - ); - let install_mode = self .config .windows .as_ref() .map(|w| w.install_mode.clone()) .unwrap_or_default(); + let mut installer_args = self + .installer_args + .iter() + .map(|a| OsStr::new(a)) + .collect::>(); for path in paths { let found_path = path?.path(); // we support 2 type of files exe & msi for now - // If it's an `exe` we expect an installer not a runtime. + // If it's an `exe` we expect an NSIS installer. if found_path.extension() == Some(OsStr::new("exe")) { - // we need to wrap the installer path in quotes for Start-Process - let mut installer_path = std::ffi::OsString::new(); - installer_path.push("\""); - installer_path.push(&found_path); - installer_path.push("\""); - - let installer_args = [ - install_mode - .nsis_args() - .iter() - .map(OsStr::new) - .collect::>(), - self.installer_args - .iter() - .map(|a| a.as_os_str()) - .collect::>(), - ] - .concat(); - - // Run the installer - let mut cmd = Command::new(powershell_path); - - cmd.args(["-NoProfile", "-WindowStyle", "Hidden"]) - .args(["Start-Process"]) - .arg(installer_path); - - if !installer_args.is_empty() { - cmd.arg("-ArgumentList") - .arg(installer_args.join(OsStr::new(", "))); - } - cmd.spawn().expect("installer failed to start"); - - std::process::exit(0); + installer_args.extend(install_mode.nsis_args().iter().map(OsStr::new)); } else if found_path.extension() == Some(OsStr::new("msi")) { - // we need to wrap the current exe path in quotes for Start-Process - let mut current_exe_arg = std::ffi::OsString::new(); - current_exe_arg.push("\""); - current_exe_arg.push(current_exe()?); - current_exe_arg.push("\""); - - let mut msi_path = std::ffi::OsString::new(); - msi_path.push("\"\"\""); - msi_path.push(&found_path); - msi_path.push("\"\"\""); - - let installer_args = [ - install_mode - .msiexec_args() - .iter() - .map(OsStr::new) - .collect::>(), - self.installer_args - .iter() - .map(|a| a.as_os_str()) - .collect::>(), - ] - .concat(); - - // run the installer and relaunch the application - let powershell_install_res = Command::new(powershell_path) - .args(["-NoProfile", "-WindowStyle", "Hidden"]) - .args([ - "Start-Process", - "-Wait", - "-FilePath", - "$Env:SYSTEMROOT\\System32\\msiexec.exe", - "-ArgumentList", - ]) - .arg("/i,") - .arg(&msi_path) - .arg(format!( - ", {}, /promptrestart;", - installer_args.join(OsStr::new(", ")).to_string_lossy() - )) - .arg("Start-Process") - .arg(current_exe_arg) - .spawn(); - if powershell_install_res.is_err() { - // fallback to running msiexec directly - relaunch won't be available - // we use this here in case powershell fails in an older machine somehow - let msiexec_path = system_root.as_ref().map_or_else( - |_| "msiexec.exe".to_string(), - |p| format!("{p}\\System32\\msiexec.exe"), - ); - let _ = Command::new(msiexec_path) - .arg("/i") - .arg(msi_path) - .args(installer_args) - .arg("/promptrestart") - .spawn(); - } + installer_args.extend(install_mode.msiexec_args().iter().map(OsStr::new)); + installer_args.push(OsStr::new("/promptrestart")); + } else { + continue; + } - std::process::exit(0); + let file = encode_wide(found_path.as_os_str()); + let parameters = encode_wide(installer_args.join(OsStr::new(" ")).as_os_str()); + let ret = unsafe { + ShellExecuteW( + 0, + w!("open"), + file.as_ptr(), + parameters.as_ptr(), + std::ptr::null(), + SW_SHOW, + ) + }; + if ret <= 32 { + return Err(Error::Io(std::io::Error::last_os_error())); } + std::process::exit(0); } Ok(()) @@ -944,3 +871,14 @@ fn base64_to_string(base64_string: &str) -> Result { .to_string(); Ok(result) } + +#[cfg(target_os = "windows")] +fn encode_wide(string: impl AsRef) -> Vec { + use std::os::windows::ffi::OsStrExt; + + string + .as_ref() + .encode_wide() + .chain(std::iter::once(0)) + .collect() +} From 14c858391d12e2bbb64c6d46788c9788863bddd6 Mon Sep 17 00:00:00 2001 From: DK Liao Date: Wed, 13 Mar 2024 17:36:59 +0800 Subject: [PATCH 14/29] docs: Update positioner readme (#1072) --- plugins/positioner/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/positioner/README.md b/plugins/positioner/README.md index e6b25170..ad22ffac 100644 --- a/plugins/positioner/README.md +++ b/plugins/positioner/README.md @@ -73,9 +73,9 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { move_window, Position } from "@tauri-apps/plugin-positioner"; +import { moveWindow, Position } from "@tauri-apps/plugin-positioner"; -move_window(Position.TopRight); +moveWindow(Position.TopRight); ``` If you only intend on moving the window from rust code, you can import the Window trait extension instead of registering the plugin: From 35ea5956d060f0bdafd140f2541c607bb811805b Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Wed, 13 Mar 2024 14:41:23 +0100 Subject: [PATCH 15/29] fix(dialog): Create dialogs on main thread (#1073) fixes https://github.com/tauri-apps/tauri/issues/6301 --- .changes/dialog-main-thread.md | 5 ++ .../src-tauri/gen/schemas/desktop-schema.json | 8 ++-- plugins/dialog/src/desktop.rs | 48 ++++++++++++------- .../updater/permissions/schemas/schema.json | 10 ++-- 4 files changed, 46 insertions(+), 25 deletions(-) create mode 100644 .changes/dialog-main-thread.md diff --git a/.changes/dialog-main-thread.md b/.changes/dialog-main-thread.md new file mode 100644 index 00000000..c4388bc6 --- /dev/null +++ b/.changes/dialog-main-thread.md @@ -0,0 +1,5 @@ +--- +dialog: patch +--- + +Fixed an issue where the dialog apis panicked when they were called with no application windows open. diff --git a/examples/api/src-tauri/gen/schemas/desktop-schema.json b/examples/api/src-tauri/gen/schemas/desktop-schema.json index 52ed8e22..a01af248 100644 --- a/examples/api/src-tauri/gen/schemas/desktop-schema.json +++ b/examples/api/src-tauri/gen/schemas/desktop-schema.json @@ -2362,7 +2362,7 @@ "type": "object", "required": [ "args", - "command", + "cmd", "name", "sidecar" ], @@ -2375,7 +2375,7 @@ } ] }, - "command": { + "cmd": { "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "string" }, @@ -2397,7 +2397,7 @@ "type": "object", "required": [ "args", - "command", + "cmd", "name", "sidecar" ], @@ -2410,7 +2410,7 @@ } ] }, - "command": { + "cmd": { "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "type": "string" }, diff --git a/plugins/dialog/src/desktop.rs b/plugins/dialog/src/desktop.rs index 5d98952d..606a933f 100644 --- a/plugins/dialog/src/desktop.rs +++ b/plugins/dialog/src/desktop.rs @@ -42,18 +42,6 @@ impl Dialog { } } -macro_rules! run_dialog { - ($e:expr, $h: expr) => {{ - std::thread::spawn(move || $h(tauri::async_runtime::block_on($e))); - }}; -} - -macro_rules! run_file_dialog { - ($e:expr, $h: ident) => {{ - std::thread::spawn(move || $h(tauri::async_runtime::block_on($e))); - }}; -} - impl From for rfd::MessageLevel { fn from(kind: MessageDialogKind) -> Self { match kind { @@ -132,7 +120,11 @@ pub fn pick_file) + Send + 'static>( f: F, ) { let f = |path: Option| f(path.map(|p| p.path().to_path_buf())); - run_file_dialog!(AsyncFileDialog::from(dialog).pick_file(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_file(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } pub fn pick_files>) + Send + 'static>( @@ -142,7 +134,11 @@ pub fn pick_files>) + Send + 'static>( let f = |paths: Option>| { f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect())) }; - run_file_dialog!(AsyncFileDialog::from(dialog).pick_files(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_files(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } pub fn pick_folder) + Send + 'static>( @@ -150,7 +146,11 @@ pub fn pick_folder) + Send + 'static>( f: F, ) { let f = |path: Option| f(path.map(|p| p.path().to_path_buf())); - run_file_dialog!(AsyncFileDialog::from(dialog).pick_folder(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_folder(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } pub fn pick_folders>) + Send + 'static>( @@ -160,7 +160,11 @@ pub fn pick_folders>) + Send + 'static let f = |paths: Option>| { f(paths.map(|list| list.into_iter().map(|p| p.path().to_path_buf()).collect())) }; - run_file_dialog!(AsyncFileDialog::from(dialog).pick_folders(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).pick_folders(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } pub fn save_file) + Send + 'static>( @@ -168,7 +172,11 @@ pub fn save_file) + Send + 'static>( f: F, ) { let f = |path: Option| f(path.map(|p| p.path().to_path_buf())); - run_file_dialog!(AsyncFileDialog::from(dialog).save_file(), f) + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncFileDialog::from(dialog).save_file(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } /// Shows a message dialog @@ -187,5 +195,9 @@ pub fn show_message_dialog( }); }; - run_dialog!(AsyncMessageDialog::from(dialog).show(), f); + let handle = dialog.dialog.app_handle().to_owned(); + let _ = handle.run_on_main_thread(move || { + let dialog = AsyncMessageDialog::from(dialog).show(); + std::thread::spawn(move || f(tauri::async_runtime::block_on(dialog))); + }); } diff --git a/plugins/updater/permissions/schemas/schema.json b/plugins/updater/permissions/schemas/schema.json index 69135976..6d6a3c21 100644 --- a/plugins/updater/permissions/schemas/schema.json +++ b/plugins/updater/permissions/schemas/schema.json @@ -139,10 +139,14 @@ }, "platforms": { "description": "Target platforms this permission applies. By default all platforms are affected by this permission.", - "type": [ - "array", - "null" + "default": [ + "linux", + "macOS", + "windows", + "android", + "iOS" ], + "type": "array", "items": { "$ref": "#/definitions/Target" } From 1d7dc86ec3da382e0b2f23cbd052c6ce77173848 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:12:21 +0800 Subject: [PATCH 16/29] fix(updater): run cleanup before exit on Windows (#1070) --- .changes/fix-updater-cleanup-md | 5 +++++ plugins/updater/src/lib.rs | 5 +++++ plugins/updater/src/updater.rs | 31 ++++++++++++++++++++++++------- 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 .changes/fix-updater-cleanup-md diff --git a/.changes/fix-updater-cleanup-md b/.changes/fix-updater-cleanup-md new file mode 100644 index 00000000..fe69a004 --- /dev/null +++ b/.changes/fix-updater-cleanup-md @@ -0,0 +1,5 @@ +--- +"updater": patch +--- + +Add a `on_before_exit` hook for cleanup before spawning the updater on Windows, defaults to `app.cleanup_before_exit` when used through `UpdaterExt` diff --git a/plugins/updater/src/lib.rs b/plugins/updater/src/lib.rs index e060827d..37198150 100644 --- a/plugins/updater/src/lib.rs +++ b/plugins/updater/src/lib.rs @@ -98,6 +98,11 @@ impl> UpdaterExt for T { } } + let app_handle = app.app_handle().clone(); + builder = builder.on_before_exit(move || { + app_handle.cleanup_before_exit(); + }); + builder } diff --git a/plugins/updater/src/updater.rs b/plugins/updater/src/updater.rs index 4ba74435..27749bc3 100644 --- a/plugins/updater/src/updater.rs +++ b/plugins/updater/src/updater.rs @@ -8,6 +8,7 @@ use std::{ io::{Cursor, Read}, path::{Path, PathBuf}, str::FromStr, + sync::Arc, time::Duration, }; @@ -88,6 +89,8 @@ impl RemoteRelease { } } +pub type OnBeforeExit = Arc; + pub struct UpdaterBuilder { current_version: Version, config: Config, @@ -99,6 +102,7 @@ pub struct UpdaterBuilder { timeout: Option, proxy: Option, installer_args: Vec, + on_before_exit: Option, } impl UpdaterBuilder { @@ -118,6 +122,7 @@ impl UpdaterBuilder { headers: Default::default(), timeout: None, proxy: None, + on_before_exit: None, } } @@ -197,6 +202,11 @@ impl UpdaterBuilder { self } + pub fn on_before_exit(mut self, f: F) -> Self { + self.on_before_exit.replace(Arc::new(f)); + self + } + pub fn build(self) -> Result { let endpoints = self .endpoints @@ -236,6 +246,7 @@ impl UpdaterBuilder { json_target, headers: self.headers, extract_path, + on_before_exit: self.on_before_exit, }) } } @@ -256,6 +267,7 @@ pub struct Updater { json_target: String, headers: HeaderMap, extract_path: PathBuf, + on_before_exit: Option, } impl Updater { @@ -354,6 +366,7 @@ impl Updater { let update = if should_update { Some(Update { config: self.config.clone(), + on_before_exit: self.on_before_exit.clone(), current_version: self.current_version.to_string(), target: self.target.clone(), extract_path: self.extract_path.clone(), @@ -375,9 +388,11 @@ impl Updater { } } -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Update { config: Config, + #[allow(unused)] + on_before_exit: Option, /// Update description pub body: Option, /// Version used to check for update @@ -490,7 +505,7 @@ impl Update { } #[cfg(mobile)] - fn install_inner(&self, bytes: Vec) -> Result<()> { + fn install_inner(&self, _bytes: Vec) -> Result<()> { Ok(()) } @@ -541,7 +556,7 @@ impl Update { let mut installer_args = self .installer_args .iter() - .map(|a| OsStr::new(a)) + .map(OsStr::new) .collect::>(); for path in paths { @@ -557,9 +572,13 @@ impl Update { continue; } + if let Some(on_before_exit) = self.on_before_exit.as_ref() { + on_before_exit(); + } + let file = encode_wide(found_path.as_os_str()); let parameters = encode_wide(installer_args.join(OsStr::new(" ")).as_os_str()); - let ret = unsafe { + unsafe { ShellExecuteW( 0, w!("open"), @@ -569,9 +588,7 @@ impl Update { SW_SHOW, ) }; - if ret <= 32 { - return Err(Error::Io(std::io::Error::last_os_error())); - } + std::process::exit(0); } From cb96aa06277f7b864952827ec9fb1e74c8a1f761 Mon Sep 17 00:00:00 2001 From: i-c-b <133848861+i-c-b@users.noreply.github.com> Date: Sat, 16 Mar 2024 20:01:49 +1000 Subject: [PATCH 17/29] fix(fs): rename `dir` field to `base_dir` in `WatchOptions`, fixes #1081 (#1082) * fix(fs): rename `dir` field to `base_dir` in `WatchOptions`, fixes #1081 * Create fix-fs-watcher-basedir.md --- .changes/fix-fs-watcher-basedir.md | 5 +++++ plugins/fs/src/watcher.rs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/fix-fs-watcher-basedir.md diff --git a/.changes/fix-fs-watcher-basedir.md b/.changes/fix-fs-watcher-basedir.md new file mode 100644 index 00000000..031056b7 --- /dev/null +++ b/.changes/fix-fs-watcher-basedir.md @@ -0,0 +1,5 @@ +--- +"fs": patch +--- + +Fixes `watch` and `watchImmediate` which previously ignored the `baseDir` parameter. diff --git a/plugins/fs/src/watcher.rs b/plugins/fs/src/watcher.rs index d83262a2..0795aa49 100644 --- a/plugins/fs/src/watcher.rs +++ b/plugins/fs/src/watcher.rs @@ -75,7 +75,7 @@ fn watch_debounced(on_event: Channel, rx: Receiver) { #[derive(Deserialize)] #[serde(rename_all = "camelCase")] pub struct WatchOptions { - dir: Option, + base_dir: Option, recursive: bool, delay_ms: Option, } @@ -96,7 +96,7 @@ pub async fn watch( &global_scope, &command_scope, path, - options.dir, + options.base_dir, )?); } From 7b9fa6607bdcf9161b097e95ad68651a8db0bcb6 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Mon, 18 Mar 2024 09:40:37 +0100 Subject: [PATCH 18/29] chore(template): Replace {{name}} with PLUGIN_NAME (#1088) fixes #1052 --- shared/template/Cargo.toml | 4 ++-- shared/template/README.md | 20 ++++++++++---------- shared/template/package.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/shared/template/Cargo.toml b/shared/template/Cargo.toml index be8472bc..1a2deb3f 100644 --- a/shared/template/Cargo.toml +++ b/shared/template/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "tauri-plugin-{{name}}" +name = "tauri-plugin-PLUGIN_NAME" version = "1.0.0" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } -links = "tauri-plugin-{{name}}" +links = "tauri-plugin-PLUGIN_NAME" [package.metadata.docs.rs] rustc-args = [ "--cfg", "docsrs" ] diff --git a/shared/template/README.md b/shared/template/README.md index 920f5f8c..0bd82b56 100644 --- a/shared/template/README.md +++ b/shared/template/README.md @@ -1,4 +1,4 @@ -![{{plugin-name}}](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/{{plugin-name}}/banner.png) +![PLUGIN_NAME](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/PLUGIN_NAME/banner.png) @@ -18,9 +18,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-{{plugin-name}} = "2.0.0-beta" +tauri-plugin-PLUGIN_NAME = "2.0.0-beta" # alternatively with Git: -tauri-plugin-{{plugin-name}} = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +tauri-plugin-PLUGIN_NAME = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -30,18 +30,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa ```sh -pnpm add @tauri-apps/plugin-{{plugin-name}} +pnpm add @tauri-apps/plugin-PLUGIN_NAME # or -npm add @tauri-apps/plugin-{{plugin-name}} +npm add @tauri-apps/plugin-PLUGIN_NAME # or -yarn add @tauri-apps/plugin-{{plugin-name}} +yarn add @tauri-apps/plugin-PLUGIN_NAME # alternatively with Git: -pnpm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +pnpm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 # or -npm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +npm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 # or -yarn add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +yarn add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 ``` ## Usage @@ -53,7 +53,7 @@ First you need to register the core plugin with Tauri: ```rust fn main() { tauri::Builder::default() - .plugin(tauri_plugin_{{plugin-name}}::init()) + .plugin(tauri_plugin_PLUGIN_NAME::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/shared/template/package.json b/shared/template/package.json index caf348a4..542a1cb6 100644 --- a/shared/template/package.json +++ b/shared/template/package.json @@ -1,5 +1,5 @@ { - "name": "@tauri-apps/plugin-{{name}}", + "name": "@tauri-apps/plugin-PLUGIN_NAME", "version": "1.0.0", "license": "MIT or APACHE-2.0", "authors": [ From 9dec9605ed1ce19dbef697e55debddf9008ecba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=89=AF=E4=BB=94?= <32487868+cijiugechu@users.noreply.github.com> Date: Tue, 19 Mar 2024 20:35:37 +0800 Subject: [PATCH 19/29] feat(clipboard): support `readImage` & `writeImage` (#845) * feat(clipboard): support `read_image` & `write_image` * fix plugin name * platform specific bahavior * remove unnecessary BufWriter * improvement * update example * update example * format * header, fix change file * use image from tauri * fix ci * update tauri, fix read * image crate only on desktop [skip ci] * Update plugins/authenticator/src/u2f_crate/protocol.rs [skip ci] Co-authored-by: Amr Bashir * Update plugins/authenticator/src/u2f_crate/protocol.rs [skip ci] Co-authored-by: Amr Bashir * update deps, address code review * fix mobile [skip ci] --------- Co-authored-by: Lucas Nogueira Co-authored-by: Lucas Nogueira Co-authored-by: Amr Bashir --- .changes/clipboard-manager-image.md | 6 + .changes/clipboard-text-command-rename.md | 5 + Cargo.lock | 547 ++++++++++-------- Cargo.toml | 6 +- examples/api/package.json | 4 +- examples/api/src-tauri/capabilities/base.json | 7 +- .../src-tauri/gen/schemas/desktop-schema.json | 207 +++++-- .../src-tauri/gen/schemas/mobile-schema.json | 253 +++++++- examples/api/src-tauri/src/tray.rs | 5 +- examples/api/src/lib/utils.js | 15 + examples/api/src/views/Clipboard.svelte | 52 +- examples/api/src/views/FileSystem.svelte | 19 +- plugins/authenticator/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- .../authenticator/src/u2f_crate/protocol.rs | 6 +- plugins/autostart/package.json | 2 +- .../autostart/permissions/schemas/schema.json | 10 +- plugins/barcode-scanner/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- plugins/biometric/package.json | 2 +- .../biometric/permissions/schemas/schema.json | 10 +- plugins/cli/package.json | 2 +- plugins/cli/permissions/schemas/schema.json | 10 +- plugins/clipboard-manager/Cargo.toml | 1 + .../android/src/main/java/ClipboardPlugin.kt | 4 +- plugins/clipboard-manager/build.rs | 9 +- plugins/clipboard-manager/guest-js/index.ts | 57 +- .../ios/Sources/ClipboardPlugin.swift | 4 +- plugins/clipboard-manager/package.json | 2 +- .../autogenerated/commands/clear.toml | 13 + .../autogenerated/commands/read.toml | 13 - .../autogenerated/commands/read_image.toml | 13 + .../autogenerated/commands/read_text.toml | 13 + .../autogenerated/commands/write.toml | 13 - .../autogenerated/commands/write_html.toml | 13 + .../autogenerated/commands/write_image.toml | 13 + .../autogenerated/commands/write_text.toml | 13 + .../permissions/autogenerated/reference.md | 16 +- .../permissions/schemas/schema.json | 82 ++- plugins/clipboard-manager/src/api-iife.js | 2 +- plugins/clipboard-manager/src/commands.rs | 30 +- plugins/clipboard-manager/src/desktop.rs | 53 +- plugins/clipboard-manager/src/error.rs | 6 + plugins/clipboard-manager/src/lib.rs | 8 +- plugins/clipboard-manager/src/mobile.rs | 17 +- plugins/clipboard-manager/src/models.rs | 16 +- plugins/deep-link/examples/app/package.json | 4 +- plugins/deep-link/package.json | 2 +- .../deep-link/permissions/schemas/schema.json | 10 +- plugins/dialog/package.json | 2 +- .../dialog/permissions/schemas/schema.json | 10 +- plugins/fs/package.json | 2 +- plugins/fs/permissions/schemas/schema.json | 10 +- plugins/global-shortcut/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- plugins/http/package.json | 2 +- plugins/http/permissions/schemas/schema.json | 10 +- plugins/log/package.json | 2 +- plugins/log/permissions/schemas/schema.json | 10 +- plugins/nfc/package.json | 2 +- plugins/nfc/permissions/schemas/schema.json | 10 +- plugins/notification/Cargo.toml | 1 - plugins/notification/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- plugins/os/package.json | 2 +- plugins/os/permissions/schemas/schema.json | 10 +- plugins/positioner/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- plugins/process/package.json | 2 +- .../process/permissions/schemas/schema.json | 10 +- plugins/shell/package.json | 2 +- plugins/shell/permissions/schemas/schema.json | 10 +- .../examples/vanilla/package.json | 2 +- plugins/sql/package.json | 2 +- plugins/sql/permissions/schemas/schema.json | 10 +- plugins/store/package.json | 2 +- plugins/store/permissions/schemas/schema.json | 10 +- plugins/stronghold/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- plugins/updater/package.json | 2 +- .../updater/permissions/schemas/schema.json | 10 +- plugins/upload/package.json | 2 +- .../upload/permissions/schemas/schema.json | 10 +- .../websocket/examples/tauri-app/package.json | 2 +- plugins/websocket/package.json | 2 +- .../websocket/permissions/schemas/schema.json | 10 +- plugins/window-state/package.json | 2 +- .../permissions/schemas/schema.json | 10 +- plugins/window-state/src/api-iife.js | 2 +- pnpm-lock.yaml | 280 ++++----- shared/template/package.json | 2 +- 91 files changed, 1330 insertions(+), 794 deletions(-) create mode 100644 .changes/clipboard-manager-image.md create mode 100644 .changes/clipboard-text-command-rename.md create mode 100644 examples/api/src/lib/utils.js create mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/clear.toml delete mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/read.toml create mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/read_image.toml create mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/read_text.toml delete mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/write.toml create mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/write_html.toml create mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/write_image.toml create mode 100644 plugins/clipboard-manager/permissions/autogenerated/commands/write_text.toml diff --git a/.changes/clipboard-manager-image.md b/.changes/clipboard-manager-image.md new file mode 100644 index 00000000..9151d108 --- /dev/null +++ b/.changes/clipboard-manager-image.md @@ -0,0 +1,6 @@ +--- +"clipboard-manager": "minor" +"clipboard-manager-js": "minor" +--- + +Add support for `read_image` and `write_image` to the clipboard plugin (desktop). diff --git a/.changes/clipboard-text-command-rename.md b/.changes/clipboard-text-command-rename.md new file mode 100644 index 00000000..53ec3888 --- /dev/null +++ b/.changes/clipboard-text-command-rename.md @@ -0,0 +1,5 @@ +--- +"clipboard-manager": patch +--- + +The `write` and `read` commands are now called `write_text` and `read_text` so the permission name was changed. diff --git a/Cargo.lock b/Cargo.lock index 9dee2ec4..e4e67de7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,7 +83,7 @@ dependencies = [ "aes 0.8.4", "cipher 0.4.4", "ctr 0.9.2", - "ghash 0.5.0", + "ghash 0.5.1", "subtle", ] @@ -100,9 +100,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom 0.2.12", @@ -176,9 +176,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "arboard" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1faa3c733d9a3dd6fbaf85da5d162a2e03b2e0033a90dceb0e2a90fdd1e5380a" +checksum = "a2041f1943049c7978768d84e6d0fd95de98b76d6c4727b09e78ec253d29fa58" dependencies = [ "clipboard-win", "core-graphics 0.23.1", @@ -345,7 +345,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" dependencies = [ - "event-listener 5.1.0", + "event-listener 5.2.0", "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", @@ -358,7 +358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener 5.1.0", + "event-listener 5.2.0", "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", @@ -454,7 +454,7 @@ dependencies = [ "async-signal", "blocking", "cfg-if", - "event-listener 5.1.0", + "event-listener 5.2.0", "futures-lite", "rustix", "windows-sys 0.52.0", @@ -468,7 +468,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -503,7 +503,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -546,11 +546,11 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atomic-write-file" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" +checksum = "a8204db279bf648d64fe845bd8840f78b39c8132ed4d6a4194c3b10d4b4cfb0b" dependencies = [ - "nix 0.27.1", + "nix 0.28.0", "rand 0.8.5", ] @@ -742,9 +742,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ "borsh-derive", "cfg_aliases 0.1.1", @@ -752,15 +752,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" dependencies = [ "once_cell", - "proc-macro-crate 2.0.2", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", "syn_derive", ] @@ -787,9 +787,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byte-unit" @@ -841,7 +841,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -944,14 +944,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" dependencies = [ "serde", - "toml 0.8.2", + "toml 0.8.10", ] [[package]] name = "cc" -version = "1.0.83" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", @@ -1029,9 +1029,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1069,18 +1069,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1096,9 +1096,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clipboard-win" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec832972fefb8cf9313b45a0d1945e29c9c251f1d4c6eafc5fe2124c02d2e81" +checksum = "12f9a0700e0127ba15d1d52dd742097f821cd9c65939303a44d970465040a297" dependencies = [ "error-code", ] @@ -1352,9 +1352,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -1434,17 +1434,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] name = "ctor" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +checksum = "ad291aa74992b9b7a7e88c38acbbf6ad7e107f1d90ee8775b7bc1fc3394f485c" dependencies = [ "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1480,9 +1480,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -1490,27 +1490,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] name = "darling_macro" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1665,7 +1665,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.3", ] [[package]] @@ -1688,7 +1688,7 @@ checksum = "f2b99bf03862d7f545ebc28ddd33a665b50865f4dfd84031a393823879bd4c54" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1765,9 +1765,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ed25519-zebra" @@ -1794,16 +1794,16 @@ dependencies = [ [[package]] name = "embed-resource" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" +checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.2", + "toml 0.8.10", "vswhom", - "winreg 0.51.0", + "winreg 0.52.0", ] [[package]] @@ -1836,7 +1836,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1857,7 +1857,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1891,9 +1891,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.0.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "281e452d3bad4005426416cdba5ccfd4f5c1280e10099e21db27f7c1c28347fc" +checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" [[package]] name = "etcetera" @@ -1925,9 +1925,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7ad6fd685ce13acd6d9541a30f6db6567a7a24c9ffd4ba2955d29e3f22c8b27" +checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" dependencies = [ "concurrent-queue", "parking", @@ -1950,7 +1950,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" dependencies = [ - "event-listener 5.1.0", + "event-listener 5.2.0", "pin-project-lite", ] @@ -2086,7 +2086,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -2215,7 +2215,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -2425,19 +2425,19 @@ dependencies = [ [[package]] name = "ghash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" dependencies = [ "opaque-debug", - "polyval 0.6.1", + "polyval 0.6.2", ] [[package]] name = "gif" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +checksum = "3fb2d69b19215e18bb912fa30f7ce15846e301408695e44e0ef719f1da9e19f2" dependencies = [ "color_quant", "weezl", @@ -2561,11 +2561,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" dependencies = [ "heck", - "proc-macro-crate 2.0.2", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -2679,7 +2679,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -2693,8 +2693,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", - "indexmap 2.2.3", + "http 0.2.12", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -2710,7 +2710,7 @@ dependencies = [ "bytes", "fastrand", "futures-util", - "http 0.2.11", + "http 0.2.12", "pin-project-lite", "tokio", "tracing", @@ -2733,9 +2733,9 @@ dependencies = [ [[package]] name = "half" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" dependencies = [ "cfg-if", "crunchy", @@ -2756,7 +2756,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "allocator-api2", ] @@ -2789,9 +2789,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -2853,9 +2853,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -2864,9 +2864,9 @@ dependencies = [ [[package]] name = "http" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2880,7 +2880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", + "http 0.2.12", "pin-project-lite", ] @@ -2919,7 +2919,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", + "http 0.2.12", "http-body", "httparse", "httpdate", @@ -2939,7 +2939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.11", + "http 0.2.12", "hyper", "rustls 0.21.10", "tokio", @@ -3030,9 +3030,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder", @@ -3059,9 +3059,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3201,7 +3201,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.6", + "hermit-abi 0.3.9", "libc", "windows-sys 0.52.0", ] @@ -3302,9 +3302,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -3433,12 +3433,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.4", ] [[package]] @@ -3723,9 +3723,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -3753,9 +3753,9 @@ dependencies = [ [[package]] name = "muda" -version = "0.11.5" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c47e7625990fc1af2226ea4f34fb2412b03c12639fcb91868581eb3a6893453" +checksum = "3e27c56b8cb9b3214d196556227b0eaa12db8393b4f919a0a93ffb67ed17d185" dependencies = [ "cocoa 0.25.0", "crossbeam-channel", @@ -3836,12 +3836,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.4.2", "cfg-if", + "cfg_aliases 0.1.1", "libc", "memoffset 0.9.0", ] @@ -3965,7 +3966,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.6", + "hermit-abi 0.3.9", "libc", ] @@ -4055,9 +4056,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "open" @@ -4072,9 +4073,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -4093,7 +4094,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -4113,9 +4114,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", @@ -4369,7 +4370,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -4456,7 +4457,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" dependencies = [ "base64 0.21.7", - "indexmap 2.2.3", + "indexmap 2.2.5", "line-wrap", "quick-xml 0.31.0", "serde", @@ -4515,9 +4516,9 @@ dependencies = [ [[package]] name = "polyval" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" dependencies = [ "cfg-if", "cpufeatures", @@ -4555,12 +4556,20 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "2.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", ] [[package]] @@ -4829,9 +4838,9 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -4886,7 +4895,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "regex-syntax 0.8.2", ] @@ -4901,9 +4910,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -4949,7 +4958,7 @@ dependencies = [ "h2", "h3", "h3-quinn", - "http 0.2.11", + "http 0.2.12", "http-body", "hyper", "hyper-rustls", @@ -5218,9 +5227,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" [[package]] name = "rustls-webpki" @@ -5399,22 +5408,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -5430,9 +5439,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa 1.0.10", "ryu", @@ -5447,7 +5456,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -5481,7 +5490,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_derive", "serde_json", @@ -5498,7 +5507,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -5658,12 +5667,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -5778,7 +5787,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "atoi", "byteorder", "bytes", @@ -5794,7 +5803,7 @@ dependencies = [ "futures-util", "hashlink", "hex", - "indexmap 2.2.3", + "indexmap 2.2.5", "log", "memchr", "once_cell", @@ -6121,9 +6130,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -6139,7 +6148,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -6187,15 +6196,15 @@ dependencies = [ "cfg-expr", "heck", "pkg-config", - "toml 0.8.2", + "toml 0.8.10", "version-compare", ] [[package]] name = "tao" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d9325da2dd7ebd48a8a433c64240079b15dbe1249da04c72557611bcd08d1c" +checksum = "ccba570365293ca309d60f30fdac2c5271b732dc762e6154e59c85d2c762a0a1" dependencies = [ "bitflags 1.3.2", "cocoa 0.25.0", @@ -6261,15 +6270,15 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "2.0.0-beta.9" +version = "2.0.0-beta.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353a521566bd41164a05887f40fe93b375c82b82000726f63c66237955dfb4f5" +checksum = "c33d0026c6146b73322833bc8e51fc4ee400a814c4cbfe489e3c2aa92cfedcec" dependencies = [ "anyhow", "bytes", @@ -6281,10 +6290,9 @@ dependencies = [ "glob", "gtk", "heck", - "http 0.2.11", + "http 0.2.12", "http-range", - "ico", - "infer", + "image", "jni", "libc", "log", @@ -6292,7 +6300,6 @@ dependencies = [ "muda", "objc", "percent-encoding", - "png", "raw-window-handle 0.6.0", "reqwest", "serde", @@ -6310,6 +6317,7 @@ dependencies = [ "tokio", "tray-icon", "url", + "urlpattern", "uuid", "webkit2gtk", "webview2-com", @@ -6319,9 +6327,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50887f06d343b6ede0260d29abb4edd57f40d8aac538f6e34d801c9a4fa1c6b8" +checksum = "1e851a54f222a49babb6b8b94869307e0bf95be086ed92983c42a56d5ed92132" dependencies = [ "anyhow", "cargo_toml", @@ -6337,15 +6345,15 @@ dependencies = [ "tauri-codegen", "tauri-utils", "tauri-winres", - "toml 0.8.2", + "toml 0.8.10", "walkdir", ] [[package]] name = "tauri-codegen" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10c676621ba42f97d349ee1a835cfac8a268d8843c8b81fa7663ebac2854786a" +checksum = "3ff9b1089989eecc839680cb6b52f6e7ee4733d09fa31861fc4a855996006fe5" dependencies = [ "base64 0.22.0", "brotli", @@ -6359,7 +6367,7 @@ dependencies = [ "serde", "serde_json", "sha2 0.10.8", - "syn 2.0.49", + "syn 2.0.52", "tauri-utils", "thiserror", "time", @@ -6370,23 +6378,23 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5e87dc692a359ee99662616639fe35681e3ce9929e1ec2447b2e3853b6bda6" +checksum = "a4b56c7b752b2b70b74299ff5421795e0e287b6748dd7ec8d44ae8e1637216a7" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", "tauri-codegen", "tauri-utils", ] [[package]] name = "tauri-plugin" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84ccc2181a81c66f2b203775b6b67590cc357bc477c57f0fac844c31dd5c474" +checksum = "233d4ed7ba51ff398831204ed6c8971b9565c91077e3fdef4711fe7b7715b23a" dependencies = [ "anyhow", "glob", @@ -6395,7 +6403,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.8.2", + "toml 0.8.10", "walkdir", ] @@ -6477,6 +6485,7 @@ name = "tauri-plugin-clipboard-manager" version = "2.0.0-beta.2" dependencies = [ "arboard", + "image", "log", "serde", "serde_json", @@ -6551,7 +6560,7 @@ name = "tauri-plugin-http" version = "2.0.0-beta.2" dependencies = [ "data-url", - "http 0.2.11", + "http 0.2.12", "regex", "reqwest", "schemars", @@ -6569,7 +6578,7 @@ dependencies = [ name = "tauri-plugin-localhost" version = "2.0.0-beta.2" dependencies = [ - "http 1.0.0", + "http 1.1.0", "log", "serde", "serde_json", @@ -6618,7 +6627,6 @@ dependencies = [ "color-backtrace", "ctor", "env_logger", - "image", "lazy_static", "log", "mac-notification-sys", @@ -6777,7 +6785,7 @@ dependencies = [ "dirs-next", "flate2", "futures-util", - "http 0.2.11", + "http 0.2.12", "minisign-verify", "mockito", "percent-encoding", @@ -6819,7 +6827,7 @@ name = "tauri-plugin-websocket" version = "2.0.0-beta.2" dependencies = [ "futures-util", - "http 1.0.0", + "http 1.1.0", "log", "rand 0.8.5", "serde", @@ -6847,12 +6855,12 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc1ebe2a720c1b62a9980ebf44f27db4f8a475e1465917959ce3940d6903307" +checksum = "34ddcf3c08632714e854e38105b39260ec239edd05a77ffcf5f4b3a51f97b119" dependencies = [ "gtk", - "http 0.2.11", + "http 0.2.12", "jni", "raw-window-handle 0.6.0", "serde", @@ -6865,13 +6873,13 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e853c02137e908589e9f0c684f10bb49d0dedf9e86ad734a18e42ce9bbd2ab" +checksum = "e2694f090a001c55536bbafb45f813229f06e461b3878a5c8280a98e52abb501" dependencies = [ "cocoa 0.25.0", "gtk", - "http 0.2.11", + "http 0.2.12", "jni", "log", "percent-encoding", @@ -6889,9 +6897,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.0.0-beta.7" +version = "2.0.0-beta.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1973b15065cb63868f5fba789d54ef04232d7e0229fb2230d1f557480a5ceea" +checksum = "ef6a9ec42c3429fac6d46f4af147c765963a6fca18062dd73833032d812231af" dependencies = [ "aes-gcm 0.10.3", "brotli", @@ -6910,6 +6918,7 @@ dependencies = [ "phf 0.11.2", "proc-macro2", "quote", + "regex", "schemars", "semver", "serde", @@ -6918,8 +6927,9 @@ dependencies = [ "serialize-to-javascript", "swift-rs", "thiserror", - "toml 0.8.2", + "toml 0.8.10", "url", + "urlpattern", "walkdir", ] @@ -6945,9 +6955,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", @@ -6998,14 +7008,14 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -7063,7 +7073,7 @@ checksum = "d4098d49269baa034a8d1eae9bd63e9fa532148d772121dace3bcd6a6c98eb6d" dependencies = [ "as-raw-xcb-connection", "ctor", - "libloading 0.8.1", + "libloading 0.8.3", "tracing", ] @@ -7225,21 +7235,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.6", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -7250,24 +7260,46 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.5", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +dependencies = [ + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -7296,7 +7328,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -7340,9 +7372,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.11.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4d9ddd4a7c0f3b6862af1c4911b529a49db4ee89310d3a258859c2f5053fdd" +checksum = "454035ff34b8430638c894e6197748578d6b4d449c6edaf8ea854d94e2dd862b" dependencies = [ "cocoa 0.25.0", "core-graphics 0.23.1", @@ -7428,7 +7460,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.0.0", + "http 1.1.0", "httparse", "log", "native-tls", @@ -7522,9 +7554,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -7692,9 +7724,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -7721,11 +7753,17 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -7733,24 +7771,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -7760,9 +7798,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -7770,22 +7808,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" @@ -7851,9 +7889,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -7954,7 +7992,7 @@ checksum = "ac1345798ecd8122468840bcdf1b95e5dc6d2206c5e4b0eafa078d061f59c9bc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -7976,9 +8014,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "0fec781d48b41f8163426ed18e8fc2864c12937df9ce54c88ede7bd47270893e" +dependencies = [ + "redox_syscall", + "wasite", +] [[package]] name = "widestring" @@ -8122,7 +8164,7 @@ checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -8133,7 +8175,7 @@ checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -8395,6 +8437,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" @@ -8416,9 +8467,9 @@ dependencies = [ [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -8440,7 +8491,7 @@ dependencies = [ "gdkx11", "gtk", "html5ever", - "http 0.2.11", + "http 0.2.12", "javascriptcore-rs", "jni", "kuchikiki", @@ -8508,7 +8559,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.1", + "libloading 0.8.3", "once_cell", "rustix", "x11rb-protocol", @@ -8554,9 +8605,9 @@ dependencies = [ [[package]] name = "zbus" -version = "4.0.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b8e3d6ae3342792a6cc2340e4394334c7402f3d793b390d2c5494a4032b3030" +checksum = "c9ff46f2a25abd690ed072054733e0bc3157e3d4c45f41bd183dce09c2ff8ab9" dependencies = [ "async-broadcast", "async-executor", @@ -8570,12 +8621,12 @@ dependencies = [ "blocking", "derivative", "enumflags2", - "event-listener 5.1.0", + "event-listener 5.2.0", "futures-core", "futures-sink", "futures-util", "hex", - "nix 0.27.1", + "nix 0.28.0", "ordered-stream", "rand 0.8.5", "serde", @@ -8594,11 +8645,11 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.0.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7a3e850ff1e7217a3b7a07eba90d37fe9bb9e89a310f718afcde5885ca9b6d7" +checksum = "4e0e3852c93dcdb49c9462afe67a2a468f7bd464150d866e861eaf06208633e0" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "regex", @@ -8634,7 +8685,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -8654,7 +8705,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -8717,9 +8768,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "4.0.0" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e09e8be97d44eeab994d752f341e67b3b0d80512a8b315a0671d47232ef1b65" +checksum = "2c1b3ca6db667bfada0f1ebfc94b2b1759ba25472ee5373d4551bb892616389a" dependencies = [ "endi", "enumflags2", @@ -8731,11 +8782,11 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "4.0.0" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a5857e2856435331636a9fbb415b09243df4521a267c5bedcd5289b4d5799e" +checksum = "b7a4b236063316163b69039f77ce3117accb41a09567fd24c168e43491e521bc" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", diff --git a/Cargo.toml b/Cargo.toml index 5f2dae3b..b1db0153 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ resolver = "2" [workspace.dependencies] serde = { version = "1", features = ["derive"] } log = "0.4" -tauri = "2.0.0-beta.9" -tauri-build = "2.0.0-beta.7" -tauri-plugin = "2.0.0-beta.7" +tauri = "2.0.0-beta.12" +tauri-build = "2.0.0-beta.10" +tauri-plugin = "2.0.0-beta.10" serde_json = "1" thiserror = "1" url = "2" diff --git a/examples/api/package.json b/examples/api/package.json index 10858549..9c238503 100644 --- a/examples/api/package.json +++ b/examples/api/package.json @@ -9,7 +9,7 @@ "serve": "vite preview" }, "dependencies": { - "@tauri-apps/api": "2.0.0-beta.4", + "@tauri-apps/api": "2.0.0-beta.6", "@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.2", "@tauri-apps/plugin-biometric": "2.0.0-beta.2", "@tauri-apps/plugin-cli": "2.0.0-beta.2", @@ -30,7 +30,7 @@ "@iconify-json/codicon": "^1.1.37", "@iconify-json/ph": "^1.1.8", "@sveltejs/vite-plugin-svelte": "^3.0.1", - "@tauri-apps/cli": "2.0.0-beta.7", + "@tauri-apps/cli": "2.0.0-beta.9", "@unocss/extractor-svelte": "^0.58.0", "internal-ip": "^8.0.0", "svelte": "^4.2.8", diff --git a/examples/api/src-tauri/capabilities/base.json b/examples/api/src-tauri/capabilities/base.json index f34be5ec..486615b4 100644 --- a/examples/api/src-tauri/capabilities/base.json +++ b/examples/api/src-tauri/capabilities/base.json @@ -21,6 +21,7 @@ "tray:default", "event:default", "window:default", + "image:default", "notification:default", "os:allow-platform", "dialog:allow-open", @@ -54,8 +55,10 @@ }, "shell:allow-kill", "shell:allow-stdin-write", - "clipboard-manager:allow-read", - "clipboard-manager:allow-write", + "clipboard-manager:allow-read-text", + "clipboard-manager:allow-write-text", + "clipboard-manager:allow-read-image", + "clipboard-manager:allow-write-image", "fs:allow-rename", "fs:allow-mkdir", "fs:allow-remove", diff --git a/examples/api/src-tauri/gen/schemas/desktop-schema.json b/examples/api/src-tauri/gen/schemas/desktop-schema.json index a01af248..14558fd0 100644 --- a/examples/api/src-tauri/gen/schemas/desktop-schema.json +++ b/examples/api/src-tauri/gen/schemas/desktop-schema.json @@ -41,8 +41,7 @@ "type": "object", "required": [ "identifier", - "permissions", - "windows" + "permissions" ], "properties": { "identifier": { @@ -93,14 +92,10 @@ }, "platforms": { "description": "Target platforms this capability applies. By default all platforms are affected by this capability.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } @@ -115,7 +110,7 @@ ], "properties": { "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", + "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", "type": "array", "items": { "type": "string" @@ -2297,6 +2292,12 @@ "properties": { "identifier": { "oneOf": [ + { + "type": "string", + "enum": [ + "shell:default" + ] + }, { "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "type": "string", @@ -2532,31 +2533,99 @@ ] }, { - "description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:allow-read" + "clipboard-manager:default" + ] + }, + { + "description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-clear" + ] + }, + { + "description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-read-image" + ] + }, + { + "description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-read-text" + ] + }, + { + "description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-html" + ] + }, + { + "description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-image" ] }, { - "description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", + "description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:allow-write" + "clipboard-manager:allow-write-text" ] }, { - "description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", + "description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:deny-read" + "clipboard-manager:deny-clear" ] }, { - "description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", + "description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:deny-write" + "clipboard-manager:deny-read-image" + ] + }, + { + "description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-read-text" + ] + }, + { + "description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-html" + ] + }, + { + "description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-image" + ] + }, + { + "description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-text" + ] + }, + { + "type": "string", + "enum": [ + "dialog:default" ] }, { @@ -4680,6 +4749,12 @@ "fs:write-files" ] }, + { + "type": "string", + "enum": [ + "global-shortcut:default" + ] + }, { "description": "global-shortcut:allow-is-registered -> Enables the is_registered command without any pre-configured scope.", "type": "string", @@ -4827,13 +4902,6 @@ "image:allow-from-bytes" ] }, - { - "description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:allow-from-ico-bytes" - ] - }, { "description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.", "type": "string", @@ -4841,20 +4909,6 @@ "image:allow-from-path" ] }, - { - "description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:allow-from-png-bytes" - ] - }, - { - "description": "image:allow-height -> Enables the height command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:allow-height" - ] - }, { "description": "image:allow-new -> Enables the new command without any pre-configured scope.", "type": "string", @@ -4870,10 +4924,10 @@ ] }, { - "description": "image:allow-width -> Enables the width command without any pre-configured scope.", + "description": "image:allow-size -> Enables the size command without any pre-configured scope.", "type": "string", "enum": [ - "image:allow-width" + "image:allow-size" ] }, { @@ -4883,13 +4937,6 @@ "image:deny-from-bytes" ] }, - { - "description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:deny-from-ico-bytes" - ] - }, { "description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.", "type": "string", @@ -4897,20 +4944,6 @@ "image:deny-from-path" ] }, - { - "description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:deny-from-png-bytes" - ] - }, - { - "description": "image:deny-height -> Denies the height command without any pre-configured scope.", - "type": "string", - "enum": [ - "image:deny-height" - ] - }, { "description": "image:deny-new -> Denies the new command without any pre-configured scope.", "type": "string", @@ -4926,10 +4959,10 @@ ] }, { - "description": "image:deny-width -> Denies the width command without any pre-configured scope.", + "description": "image:deny-size -> Denies the size command without any pre-configured scope.", "type": "string", "enum": [ - "image:deny-width" + "image:deny-size" ] }, { @@ -5317,6 +5350,12 @@ "notification:deny-request-permission" ] }, + { + "type": "string", + "enum": [ + "os:default" + ] + }, { "description": "os:allow-arch -> Enables the arch command without any pre-configured scope.", "type": "string", @@ -5548,6 +5587,12 @@ "path:deny-resolve-directory" ] }, + { + "type": "string", + "enum": [ + "process:default" + ] + }, { "description": "process:allow-exit -> Enables the exit command without any pre-configured scope.", "type": "string", @@ -5597,6 +5642,12 @@ "resources:deny-close" ] }, + { + "type": "string", + "enum": [ + "shell:default" + ] + }, { "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "type": "string", @@ -5660,6 +5711,13 @@ "tray:default" ] }, + { + "description": "tray:allow-get-by-id -> Enables the get_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:allow-get-by-id" + ] + }, { "description": "tray:allow-new -> Enables the new command without any pre-configured scope.", "type": "string", @@ -5667,6 +5725,13 @@ "tray:allow-new" ] }, + { + "description": "tray:allow-remove-by-id -> Enables the remove_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:allow-remove-by-id" + ] + }, { "description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", "type": "string", @@ -5723,6 +5788,13 @@ "tray:allow-set-visible" ] }, + { + "description": "tray:deny-get-by-id -> Denies the get_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:deny-get-by-id" + ] + }, { "description": "tray:deny-new -> Denies the new command without any pre-configured scope.", "type": "string", @@ -5730,6 +5802,13 @@ "tray:deny-new" ] }, + { + "description": "tray:deny-remove-by-id -> Denies the remove_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:deny-remove-by-id" + ] + }, { "description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", "type": "string", diff --git a/examples/api/src-tauri/gen/schemas/mobile-schema.json b/examples/api/src-tauri/gen/schemas/mobile-schema.json index 6262fabb..29d8bf4e 100644 --- a/examples/api/src-tauri/gen/schemas/mobile-schema.json +++ b/examples/api/src-tauri/gen/schemas/mobile-schema.json @@ -11,6 +11,13 @@ } ] }, + { + "description": "A list of capabilities.", + "type": "array", + "items": { + "$ref": "#/definitions/Capability" + } + }, { "description": "A list of capabilities.", "type": "object", @@ -34,8 +41,7 @@ "type": "object", "required": [ "identifier", - "permissions", - "windows" + "permissions" ], "properties": { "identifier": { @@ -86,14 +92,10 @@ }, "platforms": { "description": "Target platforms this capability applies. By default all platforms are affected by this capability.", - "default": [ - "linux", - "macOS", - "windows", - "android", - "iOS" + "type": [ + "array", + "null" ], - "type": "array", "items": { "$ref": "#/definitions/Target" } @@ -108,7 +110,7 @@ ], "properties": { "urls": { - "description": "Remote domains this capability refers to. Can use glob patterns.", + "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", "type": "array", "items": { "type": "string" @@ -2290,6 +2292,12 @@ "properties": { "identifier": { "oneOf": [ + { + "type": "string", + "enum": [ + "shell:default" + ] + }, { "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "type": "string", @@ -2503,6 +2511,12 @@ "app:deny-version" ] }, + { + "type": "string", + "enum": [ + "barcode-scanner:default" + ] + }, { "description": "barcode-scanner:allow-cancel -> Enables the cancel command without any pre-configured scope.", "type": "string", @@ -2587,6 +2601,12 @@ "barcode-scanner:deny-vibrate" ] }, + { + "type": "string", + "enum": [ + "biometric:default" + ] + }, { "description": "biometric:allow-authenticate -> Enables the authenticate command without any pre-configured scope.", "type": "string", @@ -2616,31 +2636,99 @@ ] }, { - "description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:allow-read" + "clipboard-manager:default" ] }, { - "description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", + "description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:allow-write" + "clipboard-manager:allow-clear" ] }, { - "description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", + "description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:deny-read" + "clipboard-manager:allow-read-image" ] }, { - "description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", + "description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.", "type": "string", "enum": [ - "clipboard-manager:deny-write" + "clipboard-manager:allow-read-text" + ] + }, + { + "description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-html" + ] + }, + { + "description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-image" + ] + }, + { + "description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:allow-write-text" + ] + }, + { + "description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-clear" + ] + }, + { + "description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-read-image" + ] + }, + { + "description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-read-text" + ] + }, + { + "description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-html" + ] + }, + { + "description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-image" + ] + }, + { + "description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.", + "type": "string", + "enum": [ + "clipboard-manager:deny-write-text" + ] + }, + { + "type": "string", + "enum": [ + "dialog:default" ] }, { @@ -4827,6 +4915,83 @@ "http:deny-fetch-send" ] }, + { + "description": "image:default -> Default permissions for the plugin.", + "type": "string", + "enum": [ + "image:default" + ] + }, + { + "description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-bytes" + ] + }, + { + "description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-from-path" + ] + }, + { + "description": "image:allow-new -> Enables the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-new" + ] + }, + { + "description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-rgba" + ] + }, + { + "description": "image:allow-size -> Enables the size command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:allow-size" + ] + }, + { + "description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-bytes" + ] + }, + { + "description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-from-path" + ] + }, + { + "description": "image:deny-new -> Denies the new command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-new" + ] + }, + { + "description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-rgba" + ] + }, + { + "description": "image:deny-size -> Denies the size command without any pre-configured scope.", + "type": "string", + "enum": [ + "image:deny-size" + ] + }, { "description": "log:default -> Allows the log command", "type": "string", @@ -5163,6 +5328,12 @@ "menu:deny-text" ] }, + { + "type": "string", + "enum": [ + "nfc:default" + ] + }, { "description": "nfc:allow-is-available -> Enables the is_available command without any pre-configured scope.", "type": "string", @@ -5254,6 +5425,12 @@ "notification:deny-request-permission" ] }, + { + "type": "string", + "enum": [ + "os:default" + ] + }, { "description": "os:allow-arch -> Enables the arch command without any pre-configured scope.", "type": "string", @@ -5485,6 +5662,12 @@ "path:deny-resolve-directory" ] }, + { + "type": "string", + "enum": [ + "process:default" + ] + }, { "description": "process:allow-exit -> Enables the exit command without any pre-configured scope.", "type": "string", @@ -5534,6 +5717,12 @@ "resources:deny-close" ] }, + { + "type": "string", + "enum": [ + "shell:default" + ] + }, { "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "type": "string", @@ -5597,6 +5786,13 @@ "tray:default" ] }, + { + "description": "tray:allow-get-by-id -> Enables the get_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:allow-get-by-id" + ] + }, { "description": "tray:allow-new -> Enables the new command without any pre-configured scope.", "type": "string", @@ -5604,6 +5800,13 @@ "tray:allow-new" ] }, + { + "description": "tray:allow-remove-by-id -> Enables the remove_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:allow-remove-by-id" + ] + }, { "description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", "type": "string", @@ -5660,6 +5863,13 @@ "tray:allow-set-visible" ] }, + { + "description": "tray:deny-get-by-id -> Denies the get_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:deny-get-by-id" + ] + }, { "description": "tray:deny-new -> Denies the new command without any pre-configured scope.", "type": "string", @@ -5667,6 +5877,13 @@ "tray:deny-new" ] }, + { + "description": "tray:deny-remove-by-id -> Denies the remove_by_id command without any pre-configured scope.", + "type": "string", + "enum": [ + "tray:deny-remove-by-id" + ] + }, { "description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", "type": "string", diff --git a/examples/api/src-tauri/src/tray.rs b/examples/api/src-tauri/src/tray.rs index 74863c0a..bd700fdb 100644 --- a/examples/api/src-tauri/src/tray.rs +++ b/examples/api/src-tauri/src/tray.rs @@ -80,9 +80,10 @@ pub fn create_tray(app: &tauri::AppHandle) -> tauri::Result<()> { i @ "icon-1" | i @ "icon-2" => { if let Some(tray) = app.tray_by_id("tray-1") { let _ = tray.set_icon(Some(if i == "icon-1" { - tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap() + tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico")) + .unwrap() } else { - tauri::Image::from_png_bytes(include_bytes!( + tauri::image::Image::from_bytes(include_bytes!( "../icons/tray_icon_with_transparency.png" )) .unwrap() diff --git a/examples/api/src/lib/utils.js b/examples/api/src/lib/utils.js new file mode 100644 index 00000000..442052c2 --- /dev/null +++ b/examples/api/src/lib/utils.js @@ -0,0 +1,15 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +export function arrayBufferToBase64(buffer, callback) { + const blob = new Blob([buffer], { + type: "application/octet-binary", + }); + const reader = new FileReader(); + reader.onload = function (evt) { + const dataurl = evt.target.result; + callback(dataurl.substr(dataurl.indexOf(",") + 1)); + }; + reader.readAsDataURL(blob); +} diff --git a/examples/api/src/views/Clipboard.svelte b/examples/api/src/views/Clipboard.svelte index f571b2ee..c86282d9 100644 --- a/examples/api/src/views/Clipboard.svelte +++ b/examples/api/src/views/Clipboard.svelte @@ -1,23 +1,59 @@ @@ -27,6 +63,8 @@ placeholder="Text to write to the clipboard" bind:value={text} /> - + + + diff --git a/examples/api/src/views/FileSystem.svelte b/examples/api/src/views/FileSystem.svelte index dce83663..f7222ef8 100644 --- a/examples/api/src/views/FileSystem.svelte +++ b/examples/api/src/views/FileSystem.svelte @@ -1,6 +1,7 @@