chore: update to tauri alpha.16, api alpha.9 (#673)

Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
pull/677/head
Lucas Fernandes Nogueira 2 years ago committed by GitHub
parent b7c5407cac
commit 5c137365c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
---
"log-plugin": patch
---
Update to tauri@2.0.0-alpha.16.

@ -0,0 +1,27 @@
---
"authenticator-js": patch
"autostart-js": patch
"barcode-scanner-js": patch
"cli-js": patch
"clipboard-manager-js": patch
"deep-link-js": patch
"dialog-js": patch
"fs-js": patch
"global-shortcut-js": patch
"http-js": patch
"log-js": patch
"notification-js": patch
"os-js": patch
"positioner-js": patch
"process-js": patch
"shell-js": patch
"sql-js": patch
"store-js": patch
"stronghold-js": patch
"updater-js": patch
"upload-js": patch
"websocket-js": patch
"window-state-js": patch
---
Update to @tauri-apps/api v2.0.0-alpha.16.

@ -0,0 +1,30 @@
---
"authenticator": patch
"autostart": patch
"barcode-scanner": patch
"cli": patch
"clipboard-manager": patch
"deep-link": patch
"dialog": patch
"fs": patch
"global-shortcut": patch
"http": patch
"localhost": patch
"log-plugin": patch
"notification": patch
"os": patch
"persisted-scope": patch
"positioner": patch
"process": patch
"shell": patch
"single-instance": patch
"sql": patch
"store": patch
"stronghold": patch
"updater": patch
"upload": patch
"websocket": patch
"window-state": patch
---
Update MSRV to 1.70.

@ -1,6 +1,8 @@
target
node_modules
dist
build/
dist-js
api-iife.js
init-iife.js
init.js

@ -130,31 +130,31 @@ jobs:
- {
target: x86_64-pc-windows-msvc,
os: windows-latest,
cross: false,
runner: 'cargo',
command: "test",
}
- {
target: x86_64-unknown-linux-gnu,
os: ubuntu-latest,
cross: false,
runner: 'cargo',
command: "test",
}
- {
target: x86_64-apple-darwin,
os: macos-latest,
cross: false,
runner: 'cargo',
command: "test",
}
- {
target: aarch64-apple-ios,
os: macos-latest,
cross: false,
runner: 'cargo',
command: "build",
}
- {
target: aarch64-linux-android,
os: ubuntu-latest,
cross: true,
runner: 'cross',
command: "build",
}
@ -175,13 +175,13 @@ jobs:
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md
- uses: dtolnay/rust-toolchain@1.65.0
- uses: dtolnay/rust-toolchain@1.70.0
with:
targets: ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.package }}
key: cache-${{ matrix.package }}
- name: create dummy dist
working-directory: examples/api
@ -192,34 +192,18 @@ jobs:
run: |
cargo update -p time@0.3.24 --precise 0.3.23
- name: install cross
if: ${{ matrix.platform.runner == 'cross' }}
run: cargo install cross --git https://github.com/cross-rs/cross
- name: test ${{ matrix.package }}
if: matrix.package != 'tauri-plugin-sql'
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.platform.cross }}
command: ${{ matrix.platform.command }}
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
- name: test ${{ matrix.package }} --all-features
if: ${{ !contains(fromJSON('["tauri-plugin-http", "tauri-plugin-upload", "tauri-plugin-updater", "tauri-plugin-websocket", "tauri-plugin-sql"]'), matrix.package) }}
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.platform.cross }}
command: ${{ matrix.platform.command }}
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --all-features
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets
- name: test ${{ matrix.package }} mysql
if: matrix.package == 'tauri-plugin-sql'
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.platform.cross }}
command: ${{ matrix.platform.command }}
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features mysql
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features mysql
- name: test ${{ matrix.package }} postgres
if: matrix.package == 'tauri-plugin-sql'
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.platform.cross }}
command: ${{ matrix.platform.command }}
args: --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features postgres
run: ${{ matrix.platform.runner }} ${{ matrix.platform.command }} --package ${{ matrix.package }} --target ${{ matrix.platform.target }} --all-targets --features postgres

@ -7,4 +7,5 @@ Cargo.lock
.build
build
api-iife.js
init-iife.js
intermediates/

@ -21,6 +21,7 @@ const ignore = [
"dist-js",
".svelte-kit",
"api-iife.js",
"init-iife.js",
".build",
];

310
Cargo.lock generated

@ -1234,12 +1234,12 @@ dependencies = [
[[package]]
name = "ctor"
version = "0.1.26"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096"
checksum = "37e366bff8cd32dd8754b0991fb66b279dc48f598c3a18914852a6673deef583"
dependencies = [
"quote",
"syn 1.0.109",
"syn 2.0.28",
]
[[package]]
@ -2054,7 +2054,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
dependencies = [
"libc",
"windows-targets 0.48.1",
"windows-targets 0.48.5",
]
[[package]]
@ -2619,15 +2619,6 @@ dependencies = [
"hashbrown 0.14.0",
]
[[package]]
name = "infer"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a898e4b7951673fce96614ce5751d13c40fc5674bc2d759288e46c3ab62598b3"
dependencies = [
"cfb",
]
[[package]]
name = "infer"
version = "0.15.0"
@ -3762,7 +3753,7 @@ dependencies = [
"libc",
"redox_syscall 0.3.5",
"smallvec",
"windows-targets 0.48.1",
"windows-targets 0.48.5",
]
[[package]]
@ -3832,9 +3823,17 @@ version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
dependencies = [
"phf_macros 0.10.0",
"phf_shared 0.10.0",
"proc-macro-hack",
]
[[package]]
name = "phf"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
dependencies = [
"phf_macros 0.11.2",
"phf_shared 0.11.2",
]
[[package]]
@ -3877,6 +3876,16 @@ dependencies = [
"rand 0.8.5",
]
[[package]]
name = "phf_generator"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
dependencies = [
"phf_shared 0.11.2",
"rand 0.8.5",
]
[[package]]
name = "phf_macros"
version = "0.8.0"
@ -3893,16 +3902,15 @@ dependencies = [
[[package]]
name = "phf_macros"
version = "0.10.0"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0"
checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b"
dependencies = [
"phf_generator 0.10.0",
"phf_shared 0.10.0",
"proc-macro-hack",
"phf_generator 0.11.2",
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.28",
]
[[package]]
@ -3923,6 +3931,15 @@ dependencies = [
"siphasher",
]
[[package]]
name = "phf_shared"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
dependencies = [
"siphasher",
]
[[package]]
name = "pin-project"
version = "1.1.2"
@ -4180,13 +4197,13 @@ dependencies = [
[[package]]
name = "quinn-proto"
version = "0.10.2"
version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8c8bb234e70c863204303507d841e7fa2295e95c822b2bb4ca8ebf57f17b1cb"
checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1"
dependencies = [
"bytes 1.4.0",
"rand 0.8.5",
"ring",
"ring 0.16.20",
"rustc-hash",
"rustls",
"slab",
@ -4488,11 +4505,25 @@ dependencies = [
"libc",
"once_cell",
"spin 0.5.2",
"untrusted",
"untrusted 0.7.1",
"web-sys",
"winapi",
]
[[package]]
name = "ring"
version = "0.17.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e"
dependencies = [
"cc",
"getrandom 0.2.10",
"libc",
"spin 0.9.8",
"untrusted 0.9.0",
"windows-sys 0.48.0",
]
[[package]]
name = "rsa"
version = "0.9.2"
@ -4583,13 +4614,13 @@ dependencies = [
[[package]]
name = "rustls"
version = "0.21.5"
version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36"
checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8"
dependencies = [
"log",
"ring",
"rustls-webpki 0.101.2",
"ring 0.16.20",
"rustls-webpki",
"sct",
]
@ -4616,22 +4647,12 @@ dependencies = [
[[package]]
name = "rustls-webpki"
version = "0.100.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b"
dependencies = [
"ring",
"untrusted",
]
[[package]]
name = "rustls-webpki"
version = "0.101.2"
version = "0.101.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59"
checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe"
dependencies = [
"ring",
"untrusted",
"ring 0.16.20",
"untrusted 0.7.1",
]
[[package]]
@ -4700,8 +4721,8 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
dependencies = [
"ring",
"untrusted",
"ring 0.16.20",
"untrusted 0.7.1",
]
[[package]]
@ -5525,7 +5546,7 @@ dependencies = [
"url",
"uuid",
"windows 0.48.0",
"windows-implement",
"windows-implement 0.48.0",
"x11-dl",
"zbus",
]
@ -5560,9 +5581,9 @@ checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e"
[[package]]
name = "tauri"
version = "2.0.0-alpha.15"
version = "2.0.0-alpha.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd8f1dc82ad6bf8a689b131febee60020e84193b7fdb9c21bbb344c3d9f25de4"
checksum = "350fce27e96fda5a5741ae200ebf775cc3423c682154224cfbd78066db777fc6"
dependencies = [
"anyhow",
"bytes 1.4.0",
@ -5570,6 +5591,7 @@ dependencies = [
"dirs-next",
"embed_plist",
"futures-util",
"getrandom 0.2.10",
"glib",
"glob",
"gtk",
@ -5577,7 +5599,7 @@ dependencies = [
"http",
"http-range",
"ico",
"infer 0.15.0",
"infer",
"jni",
"libc",
"log",
@ -5587,7 +5609,6 @@ dependencies = [
"once_cell",
"percent-encoding",
"png",
"rand 0.8.5",
"raw-window-handle",
"reqwest",
"serde",
@ -5608,14 +5629,15 @@ dependencies = [
"uuid",
"webkit2gtk",
"webview2-com",
"window-vibrancy",
"windows 0.48.0",
]
[[package]]
name = "tauri-build"
version = "2.0.0-alpha.9"
version = "2.0.0-alpha.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59048e05398d7d53e2d73d7f7fd14fbab53ec9f90f4b91e3c08f263e07ffc569"
checksum = "55e3fe1435d7bcf64d15182815f5e1b0b05ec71cd365ed5055204efb5436ebc4"
dependencies = [
"anyhow",
"cargo_toml",
@ -5635,9 +5657,9 @@ dependencies = [
[[package]]
name = "tauri-codegen"
version = "2.0.0-alpha.8"
version = "2.0.0-alpha.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d8acf40451edf9ccd16d110cb10e9959fec6ccca286c5cc66b859878f8aa9a7b"
checksum = "ff206ba5a7de8f20068f36d5fa49756a9fd375a156a2332278273b6d0dc57033"
dependencies = [
"base64 0.21.2",
"brotli",
@ -5661,9 +5683,9 @@ dependencies = [
[[package]]
name = "tauri-macros"
version = "2.0.0-alpha.8"
version = "2.0.0-alpha.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7037ba4260be47f4d6dab8c781bd15910ef1d3c16c74bf3e3c47e69c250ab82"
checksum = "d29a29d42cca831a9d9c8be91412ef6416813e7307e8dcfd1df38f3b13f3cc73"
dependencies = [
"heck",
"proc-macro2",
@ -6054,9 +6076,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "1.0.0-alpha.2"
version = "1.0.0-alpha.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d34b124f7731f3981deba3b643b2f1c8eaff59f3d6929edb401e1fc929ad93df"
checksum = "c373492a8e2d369c638bff48fc07abbe7292f8ddb867bc3b992fb7ea10006212"
dependencies = [
"gtk",
"http",
@ -6067,26 +6089,23 @@ dependencies = [
"tauri-utils",
"thiserror",
"url",
"uuid",
"windows 0.48.0",
]
[[package]]
name = "tauri-runtime-wry"
version = "1.0.0-alpha.3"
version = "1.0.0-alpha.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b94248fbaf1169c1fb085a2c43f49af3de650f6972a64d6f2bdf876c60949d5"
checksum = "ef7b8a49504f67c65a55188013439edf815356a6f8e2a9d2ed005120a201c98f"
dependencies = [
"cocoa 0.24.1",
"gtk",
"http",
"jni",
"percent-encoding",
"rand 0.8.5",
"raw-window-handle",
"tauri-runtime",
"tauri-utils",
"uuid",
"webkit2gtk",
"webview2-com",
"windows 0.48.0",
@ -6095,9 +6114,9 @@ dependencies = [
[[package]]
name = "tauri-utils"
version = "2.0.0-alpha.8"
version = "2.0.0-alpha.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "931ead8db578bc2f9aee6636345fe5b900cfa2b9985a1783913200fab5e607f1"
checksum = "4b821e0e6b5b94c6bde3c95568f5161eb70939a7b0d511f79c0cf85fed3b29c9"
dependencies = [
"aes-gcm 0.10.2",
"brotli",
@ -6107,12 +6126,12 @@ dependencies = [
"glob",
"heck",
"html5ever",
"infer 0.12.0",
"infer",
"json-patch",
"kuchikiki",
"log",
"memchr",
"phf 0.10.1",
"phf 0.11.2",
"proc-macro2",
"quote",
"semver",
@ -6123,7 +6142,7 @@ dependencies = [
"thiserror",
"url",
"walkdir",
"windows 0.48.0",
"windows 0.51.1",
]
[[package]]
@ -6360,9 +6379,9 @@ dependencies = [
[[package]]
name = "tokio-tungstenite"
version = "0.19.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c"
checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c"
dependencies = [
"futures-util",
"log",
@ -6372,7 +6391,7 @@ dependencies = [
"tokio-native-tls",
"tokio-rustls",
"tungstenite",
"webpki-roots 0.23.1",
"webpki-roots 0.25.2",
]
[[package]]
@ -6573,9 +6592,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
[[package]]
name = "tungstenite"
version = "0.19.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67"
checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9"
dependencies = [
"byteorder",
"bytes 1.4.0",
@ -6590,7 +6609,6 @@ dependencies = [
"thiserror",
"url",
"utf-8",
"webpki",
]
[[package]]
@ -6694,6 +6712,12 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]]
name = "untrusted"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
version = "2.4.0"
@ -6970,12 +6994,12 @@ dependencies = [
[[package]]
name = "webpki"
version = "0.22.0"
version = "0.22.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53"
dependencies = [
"ring",
"untrusted",
"ring 0.17.3",
"untrusted 0.9.0",
]
[[package]]
@ -6989,21 +7013,18 @@ dependencies = [
[[package]]
name = "webpki-roots"
version = "0.23.1"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338"
checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888"
dependencies = [
"rustls-webpki 0.100.1",
"rustls-webpki",
]
[[package]]
name = "webpki-roots"
version = "0.24.0"
version = "0.25.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888"
dependencies = [
"rustls-webpki 0.101.2",
]
checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc"
[[package]]
name = "websocket-example"
@ -7028,8 +7049,8 @@ dependencies = [
"webview2-com-macros",
"webview2-com-sys",
"windows 0.48.0",
"windows-implement",
"windows-interface",
"windows-implement 0.48.0",
"windows-interface 0.48.0",
]
[[package]]
@ -7138,6 +7159,18 @@ dependencies = [
"windows-sys 0.42.0",
]
[[package]]
name = "window-vibrancy"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5931735e675b972fada30c7a402915d4d827aa5ef6c929c133d640c4b785e963"
dependencies = [
"cocoa 0.25.0",
"objc",
"raw-window-handle",
"windows-sys 0.48.0",
]
[[package]]
name = "windows"
version = "0.36.1"
@ -7179,9 +7212,21 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
dependencies = [
"windows-implement",
"windows-interface",
"windows-targets 0.48.1",
"windows-implement 0.48.0",
"windows-interface 0.48.0",
"windows-targets 0.48.5",
]
[[package]]
name = "windows"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
dependencies = [
"windows-core",
"windows-implement 0.51.1",
"windows-interface 0.51.1",
"windows-targets 0.48.5",
]
[[package]]
@ -7194,6 +7239,15 @@ dependencies = [
"windows-tokens",
]
[[package]]
name = "windows-core"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows-implement"
version = "0.48.0"
@ -7205,6 +7259,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "windows-implement"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb2b158efec5af20d8846836622f50a87e6556b9153a42772fa047f773c0e555"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.28",
]
[[package]]
name = "windows-interface"
version = "0.48.0"
@ -7216,6 +7281,17 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "windows-interface"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0546e63e1ce64c04403d2311fa0e3ab5ae3a367bd524b4a38d8d8d18c70cfa76"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.28",
]
[[package]]
name = "windows-metadata"
version = "0.48.0"
@ -7265,7 +7341,7 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets 0.48.1",
"windows-targets 0.48.5",
]
[[package]]
@ -7285,17 +7361,17 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.48.1"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
dependencies = [
"windows_aarch64_gnullvm 0.48.0",
"windows_aarch64_msvc 0.48.0",
"windows_i686_gnu 0.48.0",
"windows_i686_msvc 0.48.0",
"windows_x86_64_gnu 0.48.0",
"windows_x86_64_gnullvm 0.48.0",
"windows_x86_64_msvc 0.48.0",
"windows_aarch64_gnullvm 0.48.5",
"windows_aarch64_msvc 0.48.5",
"windows_i686_gnu 0.48.5",
"windows_i686_msvc 0.48.5",
"windows_x86_64_gnu 0.48.5",
"windows_x86_64_gnullvm 0.48.5",
"windows_x86_64_msvc 0.48.5",
]
[[package]]
@ -7312,9 +7388,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_msvc"
@ -7336,9 +7412,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_i686_gnu"
@ -7360,9 +7436,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_msvc"
@ -7384,9 +7460,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_x86_64_gnu"
@ -7408,9 +7484,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnullvm"
@ -7420,9 +7496,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_msvc"
@ -7444,9 +7520,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "winnow"
@ -7522,7 +7598,7 @@ dependencies = [
"webkit2gtk-sys",
"webview2-com",
"windows 0.48.0",
"windows-implement",
"windows-implement 0.48.0",
]
[[package]]

@ -5,8 +5,8 @@ resolver = "2"
[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
log = "0.4"
tauri = "2.0.0-alpha.15"
tauri-build = "2.0.0-alpha.9"
tauri = "2.0.0-alpha.16"
tauri-build = "2.0.0-alpha.10"
serde_json = "1"
thiserror = "1"
@ -14,7 +14,7 @@ thiserror = "1"
edition = "2021"
authors = [ "Tauri Programme within The Commons Conservancy" ]
license = "Apache-2.0 OR MIT"
rust-version = "1.65"
rust-version = "1.70"
# default to small, optimized release binaries
[profile.release]

@ -16,4 +16,4 @@
| [websocket](plugins/websocket) | Open a WebSocket connection using a Rust client in JS. | ✅ | ✅ | ✅ | ? | ? |
| [window-state](plugins/window-state) | Persist window sizes and positions. | ✅ | ✅ | ✅ | ? | ? |
_This repo and all plugins require a Rust version of at least **1.65**_
_This repo and all plugins require a Rust version of at least **1.70**_

@ -9,7 +9,7 @@
"serve": "vite preview"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8",
"@tauri-apps/api": "2.0.0-alpha.9",
"@tauri-apps/plugin-barcode-scanner": "2.0.0-alpha.0",
"@tauri-apps/plugin-cli": "2.0.0-alpha.1",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.1",
@ -22,17 +22,17 @@
"@tauri-apps/plugin-process": "2.0.0-alpha.1",
"@tauri-apps/plugin-shell": "2.0.0-alpha.1",
"@tauri-apps/plugin-updater": "2.0.0-alpha.1",
"@zerodevx/svelte-json-view": "1.0.5"
"@zerodevx/svelte-json-view": "1.0.7"
},
"devDependencies": {
"@iconify-json/codicon": "^1.1.26",
"@iconify-json/ph": "^1.1.5",
"@sveltejs/vite-plugin-svelte": "^2.4.1",
"@tauri-apps/cli": "2.0.0-alpha.15",
"@unocss/extractor-svelte": "^0.53.1",
"@iconify-json/codicon": "^1.1.31",
"@iconify-json/ph": "^1.1.6",
"@sveltejs/vite-plugin-svelte": "^2.4.6",
"@tauri-apps/cli": "2.0.0-alpha.16",
"@unocss/extractor-svelte": "^0.56.5",
"internal-ip": "^8.0.0",
"svelte": "^3.59.1",
"unocss": "^0.53.1",
"vite": "^4.3.9"
"svelte": "^4.2.2",
"unocss": "^0.56.5",
"vite": "^4.5.0"
}
}

@ -1,116 +1,116 @@
{
"images" : [
"images": [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20x20@2x.png",
"scale" : "2x"
"size": "20x20",
"idiom": "iphone",
"filename": "AppIcon-20x20@2x.png",
"scale": "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20x20@3x.png",
"scale" : "3x"
"size": "20x20",
"idiom": "iphone",
"filename": "AppIcon-20x20@3x.png",
"scale": "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29x29@2x-1.png",
"scale" : "2x"
"size": "29x29",
"idiom": "iphone",
"filename": "AppIcon-29x29@2x-1.png",
"scale": "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29x29@3x.png",
"scale" : "3x"
"size": "29x29",
"idiom": "iphone",
"filename": "AppIcon-29x29@3x.png",
"scale": "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40x40@2x.png",
"scale" : "2x"
"size": "40x40",
"idiom": "iphone",
"filename": "AppIcon-40x40@2x.png",
"scale": "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40x40@3x.png",
"scale" : "3x"
"size": "40x40",
"idiom": "iphone",
"filename": "AppIcon-40x40@3x.png",
"scale": "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60x60@2x.png",
"scale" : "2x"
"size": "60x60",
"idiom": "iphone",
"filename": "AppIcon-60x60@2x.png",
"scale": "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60x60@3x.png",
"scale" : "3x"
"size": "60x60",
"idiom": "iphone",
"filename": "AppIcon-60x60@3x.png",
"scale": "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "AppIcon-20x20@1x.png",
"scale" : "1x"
"size": "20x20",
"idiom": "ipad",
"filename": "AppIcon-20x20@1x.png",
"scale": "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "AppIcon-20x20@2x-1.png",
"scale" : "2x"
"size": "20x20",
"idiom": "ipad",
"filename": "AppIcon-20x20@2x-1.png",
"scale": "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "AppIcon-29x29@1x.png",
"scale" : "1x"
"size": "29x29",
"idiom": "ipad",
"filename": "AppIcon-29x29@1x.png",
"scale": "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "AppIcon-29x29@2x.png",
"scale" : "2x"
"size": "29x29",
"idiom": "ipad",
"filename": "AppIcon-29x29@2x.png",
"scale": "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "AppIcon-40x40@1x.png",
"scale" : "1x"
"size": "40x40",
"idiom": "ipad",
"filename": "AppIcon-40x40@1x.png",
"scale": "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "AppIcon-40x40@2x-1.png",
"scale" : "2x"
"size": "40x40",
"idiom": "ipad",
"filename": "AppIcon-40x40@2x-1.png",
"scale": "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "AppIcon-76x76@1x.png",
"scale" : "1x"
"size": "76x76",
"idiom": "ipad",
"filename": "AppIcon-76x76@1x.png",
"scale": "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "AppIcon-76x76@2x.png",
"scale" : "2x"
"size": "76x76",
"idiom": "ipad",
"filename": "AppIcon-76x76@2x.png",
"scale": "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "AppIcon-83.5x83.5@2x.png",
"scale" : "2x"
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "AppIcon-83.5x83.5@2x.png",
"scale": "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "AppIcon-512@2x.png",
"scale" : "1x"
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "AppIcon-512@2x.png",
"scale": "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
}

@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
}

@ -1,6 +1,6 @@
<script>
import { getCurrent } from "@tauri-apps/api/window";
import { invoke } from "@tauri-apps/api/tauri";
import { invoke } from "@tauri-apps/api/primitives";
import { onMount, onDestroy } from "svelte";
const appWindow = getCurrent();

@ -5,7 +5,7 @@
readDir,
Dir,
} from "@tauri-apps/plugin-fs";
import { convertFileSrc } from "@tauri-apps/api/tauri";
import { convertFileSrc } from "@tauri-apps/api/primitives";
export let onMessage;
export let insecureRenderHtml;

@ -6,26 +6,26 @@
"scripts": {
"build": "pnpm run -r --parallel --filter !plugins-workspace --filter !\"./plugins/*/examples/**\" --filter !\"./examples/*\" build",
"lint": "eslint .",
"format": "prettier --write \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore",
"format-check": "prettier --check \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore"
"format": "prettier --write \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore",
"format-check": "prettier --check \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "15.1.0",
"@rollup/plugin-terser": "0.4.3",
"@rollup/plugin-typescript": "11.1.2",
"@typescript-eslint/eslint-plugin": "6.1.0",
"@typescript-eslint/parser": "6.1.0",
"covector": "^0.10.0",
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-config-standard-with-typescript": "36.1.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-n": "16.0.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "11.1.5",
"@typescript-eslint/eslint-plugin": "6.8.0",
"@typescript-eslint/parser": "6.8.0",
"covector": "^0.10.2",
"eslint": "8.51.0",
"eslint-config-prettier": "9.0.0",
"eslint-config-standard-with-typescript": "39.1.1",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-n": "16.2.0",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-security": "1.7.1",
"prettier": "3.0.0",
"rollup": "3.26.3",
"typescript": "5.1.6"
"prettier": "3.0.3",
"rollup": "4.1.4",
"typescript": "5.2.2"
},
"resolutions": {
"semver": ">=7.5.2",

@ -6,7 +6,7 @@ Use hardware security-keys in your Tauri App.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -2,19 +2,15 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
export class Authenticator {
async init(): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:authenticator|init_auth");
return await invoke("plugin:authenticator|init_auth");
}
async register(challenge: string, application: string): Promise<string> {
return await window.__TAURI_INVOKE__("plugin:authenticator|register", {
return await invoke("plugin:authenticator|register", {
timeout: 10000,
challenge,
application,
@ -27,15 +23,12 @@ export class Authenticator {
registerData: string,
clientData: string,
): Promise<string> {
return await window.__TAURI_INVOKE__(
"plugin:authenticator|verify_registration",
{
challenge,
application,
registerData,
clientData,
},
);
return await invoke("plugin:authenticator|verify_registration", {
challenge,
application,
registerData,
clientData,
});
}
async sign(
@ -43,7 +36,7 @@ export class Authenticator {
application: string,
keyHandle: string,
): Promise<string> {
return await window.__TAURI_INVOKE__("plugin:authenticator|sign", {
return await invoke("plugin:authenticator|sign", {
timeout: 10000,
challenge,
application,
@ -59,16 +52,13 @@ export class Authenticator {
keyHandle: string,
pubkey: string,
): Promise<number> {
return await window.__TAURI_INVOKE__(
"plugin:authenticator|verify_signature",
{
challenge,
application,
signData,
clientData,
keyHandle,
pubkey,
},
);
return await invoke("plugin:authenticator|verify_signature", {
challenge,
application,
signData,
clientData,
keyHandle,
pubkey,
});
}
}

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_AUTHENTICATOR__=function(t){"use strict";return t.Authenticator=class{async init(){return await window.__TAURI_INVOKE__("plugin:authenticator|init_auth")}async register(t,i){return await window.__TAURI_INVOKE__("plugin:authenticator|register",{timeout:1e4,challenge:t,application:i})}async verifyRegistration(t,i,a,n){return await window.__TAURI_INVOKE__("plugin:authenticator|verify_registration",{challenge:t,application:i,registerData:a,clientData:n})}async sign(t,i,a){return await window.__TAURI_INVOKE__("plugin:authenticator|sign",{timeout:1e4,challenge:t,application:i,keyHandle:a})}async verifySignature(t,i,a,n,e,_){return await window.__TAURI_INVOKE__("plugin:authenticator|verify_signature",{challenge:t,application:i,signData:a,clientData:n,keyHandle:e,pubkey:_})}},t}({});Object.defineProperty(window.__TAURI__,"authenticator",{value:__TAURI_AUTHENTICATOR__})}
if("__TAURI__"in window){var __TAURI_AUTHENTICATOR__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},i=(e,t,i)=>(n(e,t,"read from private field"),i?i.call(e):t.get(e));function a(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e,n)=>{for(var i in n)t(e,i,{get:n[i],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>c,addPluginListener:()=>l,convertFileSrc:()=>u,invoke:()=>o,transformCallback:()=>a});var r,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,r,(()=>{})),this.id=a((e=>{i(this,r).call(this,e)}))}set onmessage(e){var t,i,a,s;a=e,n(t=this,i=r,"write to private field"),s?s.call(t,a):i.set(t,a)}get onmessage(){return i(this,r)}toJSON(){return`__CHANNEL__:${this.id}`}};r=new WeakMap;var c=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return o(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,t,n){let i=new s;return i.onmessage=n,o(`plugin:${e}|register_listener`,{event:t,handler:i}).then((()=>new c(e,t,i.id)))}async function o(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function u(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}return e.Authenticator=class{async init(){return await o("plugin:authenticator|init_auth")}async register(e,t){return await o("plugin:authenticator|register",{timeout:1e4,challenge:e,application:t})}async verifyRegistration(e,t,n,i){return await o("plugin:authenticator|verify_registration",{challenge:e,application:t,registerData:n,clientData:i})}async sign(e,t,n){return await o("plugin:authenticator|sign",{timeout:1e4,challenge:e,application:t,keyHandle:n})}async verifySignature(e,t,n,i,a,r){return await o("plugin:authenticator|verify_signature",{challenge:e,application:t,signData:n,clientData:i,keyHandle:a,pubkey:r})}},e}({});Object.defineProperty(window.__TAURI__,"authenticator",{value:__TAURI_AUTHENTICATOR__})}

@ -4,7 +4,7 @@ Automatically launch your application at startup. Supports Windows, Mac (via App
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -2,20 +2,16 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
export async function isEnabled(): Promise<boolean> {
return await window.__TAURI_INVOKE__("plugin:autostart|is_enabled");
return await invoke("plugin:autostart|is_enabled");
}
export async function enable(): Promise<void> {
await window.__TAURI_INVOKE__("plugin:autostart|enable");
await invoke("plugin:autostart|enable");
}
export async function disable(): Promise<void> {
await window.__TAURI_INVOKE__("plugin:autostart|disable");
await invoke("plugin:autostart|disable");
}

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_AUTOSTART__=function(_){"use strict";return _.disable=async function(){await window.__TAURI_INVOKE__("plugin:autostart|disable")},_.enable=async function(){await window.__TAURI_INVOKE__("plugin:autostart|enable")},_.isEnabled=async function(){return await window.__TAURI_INVOKE__("plugin:autostart|is_enabled")},_}({});Object.defineProperty(window.__TAURI__,"autostart",{value:__TAURI_AUTOSTART__})}
if("__TAURI__"in window){var __TAURI_AUTOSTART__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function a(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>o,addPluginListener:()=>_,convertFileSrc:()=>c,invoke:()=>l,transformCallback:()=>a});var i,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,i,(()=>{})),this.id=a((e=>{r(this,i).call(this,e)}))}set onmessage(e){var n,r,a,s;a=e,t(n=this,r=i,"write to private field"),s?s.call(n,a):r.set(n,a)}get onmessage(){return r(this,i)}toJSON(){return`__CHANNEL__:${this.id}`}};i=new WeakMap;var o=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return l(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function _(e,n,t){let r=new s;return r.onmessage=t,l(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new o(e,n,r.id)))}async function l(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function c(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}return e.disable=async function(){await l("plugin:autostart|disable")},e.enable=async function(){await l("plugin:autostart|enable")},e.isEnabled=async function(){return await l("plugin:autostart|is_enabled")},e}({});Object.defineProperty(window.__TAURI__,"autostart",{value:__TAURI_AUTOSTART__})}

@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { invoke } from "@tauri-apps/api/tauri";
import { invoke } from "@tauri-apps/api/primitives";
export type PermissionState = "granted" | "denied" | "prompt";

@ -28,6 +28,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_BARCODESCANNER__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e)),a=(e,n,r,a)=>(t(e,n,"write to private field"),a?a.call(e,r):n.set(e,r),r);function i(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>c,PluginListener:()=>_,addPluginListener:()=>l,convertFileSrc:()=>u,invoke:()=>d,transformCallback:()=>i});var o,c=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,o,(()=>{})),this.id=i((e=>{r(this,o).call(this,e)}))}set onmessage(e){a(this,o,e)}get onmessage(){return r(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;var s,_=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return d(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,n,t){let r=new c;return r.onmessage=t,d(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new _(e,n,r.id)))}async function d(e,n={},t){return new Promise(((r,a)=>{let o=i((e=>{r(e),Reflect.deleteProperty(window,`_${c}`)}),!0),c=i((e=>{a(e),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:o,error:c,payload:n,options:t})}))}function u(e,n="asset"){return window.__TAURI__.convertFileSrc(e,n)}return e.Format=void 0,(s=e.Format||(e.Format={})).QRCode="QR_CODE",s.UPC_A="UPC_A",s.UPC_E="UPC_E",s.EAN8="EAN_8",s.EAN13="EAN_13",s.Code39="CODE_39",s.Code93="CODE_93",s.Code128="CODE_128",s.Codabar="CODABAR",s.ITF="ITF",s.Aztec="AZTEC",s.DataMatrix="DATA_MATRIX",s.PDF417="PDF_417",e.cancel=async function(){return await d("plugin:barcodeScanner|cancel")},e.checkPermissions=async function(){return await d("plugin:barcodeScanner|checkPermissions").then((e=>e.camera))},e.openAppSettings=async function(){return await d("plugin:barcodeScanner|openAppSettings")},e.requestPermissions=async function(){return await d("plugin:barcodeScanner|requestPermissions").then((e=>e.camera))},e.scan=async function(e){return await d("plugin:barcodeScanner|scan",{...e})},e}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_BARCODESCANNER__})}
if("__TAURI__"in window){var __TAURI_BARCODESCANNER__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function a(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>o,addPluginListener:()=>_,convertFileSrc:()=>l,invoke:()=>u,transformCallback:()=>a});var i,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,i,(()=>{})),this.id=a((e=>{r(this,i).call(this,e)}))}set onmessage(e){var n,r,a,s;a=e,t(n=this,r=i,"write to private field"),s?s.call(n,a):r.set(n,a)}get onmessage(){return r(this,i)}toJSON(){return`__CHANNEL__:${this.id}`}};i=new WeakMap;var c,o=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function _(e,n,t){let r=new s;return r.onmessage=t,u(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new o(e,n,r.id)))}async function u(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function l(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}return e.Format=void 0,(c=e.Format||(e.Format={})).QRCode="QR_CODE",c.UPC_A="UPC_A",c.UPC_E="UPC_E",c.EAN8="EAN_8",c.EAN13="EAN_13",c.Code39="CODE_39",c.Code93="CODE_93",c.Code128="CODE_128",c.Codabar="CODABAR",c.ITF="ITF",c.Aztec="AZTEC",c.DataMatrix="DATA_MATRIX",c.PDF417="PDF_417",e.cancel=async function(){return await u("plugin:barcodeScanner|cancel")},e.checkPermissions=async function(){return await u("plugin:barcodeScanner|checkPermissions").then((e=>e.camera))},e.openAppSettings=async function(){return await u("plugin:barcodeScanner|openAppSettings")},e.requestPermissions=async function(){return await u("plugin:barcodeScanner|requestPermissions").then((e=>e.camera))},e.scan=async function(e){return await u("plugin:barcodeScanner|scan",{...e})},e}({});Object.defineProperty(window.__TAURI__,"barcodeScanner",{value:__TAURI_BARCODESCANNER__})}

@ -6,7 +6,7 @@ Parse arguments from your Command Line Interface.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -8,11 +8,7 @@
* @module
*/
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
/**
* @since 2.0.0
@ -68,7 +64,7 @@ interface CliMatches {
* @since 2.0.0
*/
async function getMatches(): Promise<CliMatches> {
return await window.__TAURI_INVOKE__("plugin:cli|cli_matches");
return await invoke("plugin:cli|cli_matches");
}
export type { ArgMatch, SubcommandMatch, CliMatches };

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_CLI__=function(_){"use strict";return _.getMatches=async function(){return await window.__TAURI_INVOKE__("plugin:cli|cli_matches")},_}({});Object.defineProperty(window.__TAURI__,"cli",{value:__TAURI_CLI__})}
if("__TAURI__"in window){var __TAURI_CLI__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function i(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>_,addPluginListener:()=>o,convertFileSrc:()=>l,invoke:()=>c,transformCallback:()=>i});var a,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,a,(()=>{})),this.id=i((e=>{r(this,a).call(this,e)}))}set onmessage(e){var n,r,i,s;i=e,t(n=this,r=a,"write to private field"),s?s.call(n,i):r.set(n,i)}get onmessage(){return r(this,a)}toJSON(){return`__CHANNEL__:${this.id}`}};a=new WeakMap;var _=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function o(e,n,t){let r=new s;return r.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new _(e,n,r.id)))}async function c(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function l(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}return e.getMatches=async function(){return await c("plugin:cli|cli_matches")},e}({});Object.defineProperty(window.__TAURI__,"cli",{value:__TAURI_CLI__})}

@ -4,7 +4,7 @@ Read and write to the system clipboard.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -8,11 +8,7 @@
* @module
*/
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
interface Clip<K, T> {
kind: K;
@ -38,7 +34,7 @@ async function writeText(
text: string,
opts?: { label?: string },
): Promise<void> {
return window.__TAURI_INVOKE__("plugin:clipboard|write", {
return invoke("plugin:clipboard|write", {
data: {
kind: "PlainText",
options: {
@ -59,9 +55,7 @@ async function writeText(
* @since 2.0.0
*/
async function readText(): Promise<string> {
const kind: ClipResponse = await window.__TAURI_INVOKE__(
"plugin:clipboard|read",
);
const kind: ClipResponse = await invoke("plugin:clipboard|read");
return kind.options;
}

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_CLIPBOARDMANAGER__=function(_){"use strict";return _.readText=async function(){return(await window.__TAURI_INVOKE__("plugin:clipboard|read")).options},_.writeText=async function(_,n){return window.__TAURI_INVOKE__("plugin:clipboard|write",{data:{kind:"PlainText",options:{label:null==n?void 0:n.label,text:_}}})},_}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_CLIPBOARDMANAGER__})}
if("__TAURI__"in window){var __TAURI_CLIPBOARDMANAGER__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function i(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>o,addPluginListener:()=>_,convertFileSrc:()=>c,invoke:()=>l,transformCallback:()=>i});var a,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,a,(()=>{})),this.id=i((e=>{r(this,a).call(this,e)}))}set onmessage(e){var n,r,i,s;i=e,t(n=this,r=a,"write to private field"),s?s.call(n,i):r.set(n,i)}get onmessage(){return r(this,a)}toJSON(){return`__CHANNEL__:${this.id}`}};a=new WeakMap;var o=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return l(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function _(e,n,t){let r=new s;return r.onmessage=t,l(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new o(e,n,r.id)))}async function l(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function c(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}return e.readText=async function(){return(await l("plugin:clipboard|read")).options},e.writeText=async function(e,n){return l("plugin:clipboard|write",{data:{kind:"PlainText",options:{label:null==n?void 0:n.label,text:e}}})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_CLIPBOARDMANAGER__})}

@ -4,7 +4,7 @@ Set your Tauri application as the default handler for an URL.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -14,9 +14,9 @@
"@tauri-apps/plugin-deep-link": "2.0.0-alpha.0"
},
"devDependencies": {
"@tauri-apps/cli": "^2.0.0-alpha.15",
"internal-ip": "^7.0.0",
"typescript": "^4.8.2",
"vite": "^4.2.1"
"@tauri-apps/cli": "2.0.0-alpha.16",
"internal-ip": "^8.0.0",
"typescript": "^5.2.2",
"vite": "^4.5.0"
}
}

@ -6,7 +6,7 @@ authors = ["you"]
license = ""
repository = ""
edition = "2021"
rust-version = "1.60"
rust-version = "1.70"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { invoke } from "@tauri-apps/api/tauri";
import { invoke } from "@tauri-apps/api/primitives";
import { UnlistenFn, listen } from "@tauri-apps/api/event";
export async function getCurrent(): Promise<string[] | null> {

@ -28,6 +28,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_DEEPLINK__=function(e){"use strict";var t=Object.defineProperty,n=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},r=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},i=(e,t,n)=>(r(e,t,"read from private field"),n?n.call(e):t.get(e)),a=(e,t,n,i)=>(r(e,t,"write to private field"),i?i.call(e,n):t.set(e,n),n);function o(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}n({},{Channel:()=>s,PluginListener:()=>c,addPluginListener:()=>u,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var l,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,l,(()=>{})),this.id=o((e=>{i(this,l).call(this,e)}))}set onmessage(e){a(this,l,e)}get onmessage(){return i(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var c=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,t,n){let r=new s;return r.onmessage=n,_(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new c(e,t,r.id)))}async function _(e,t={},n){return new Promise(((r,i)=>{let a=o((e=>{r(e),Reflect.deleteProperty(window,`_${l}`)}),!0),l=o((e=>{i(e),Reflect.deleteProperty(window,`_${a}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:a,error:l,payload:t,options:n})}))}function d(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}n({},{TauriEvent:()=>w,emit:()=>f,listen:()=>E,once:()=>p});var w=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(w||{});async function h(e,t){await _("plugin:event|unlisten",{event:e,eventId:t})}async function E(e,t,n){return _("plugin:event|listen",{event:e,windowLabel:n?.target,handler:o(t)}).then((t=>async()=>h(e,t)))}async function p(e,t,n){return E(e,(n=>{t(n),h(e,n.id).catch((()=>{}))}),n)}async function f(e,t,n){await _("plugin:event|emit",{event:e,windowLabel:n?.target,payload:t})}async function I(){return await _("plugin:deep-link|get_current")}return e.getCurrent=I,e.onOpenUrl=async function(e){const t=await I();return null!=t&&e(t),await E("deep-link://new-url",(t=>e(t.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_DEEPLINK__})}
if("__TAURI__"in window){var __TAURI_DEEPLINK__=function(e){"use strict";var n=Object.defineProperty,t=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},r=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},i=(e,n,t)=>(r(e,n,"read from private field"),t?t.call(e):n.get(e));function a(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}t({},{Channel:()=>s,PluginListener:()=>u,addPluginListener:()=>o,convertFileSrc:()=>c,invoke:()=>l,transformCallback:()=>a});var _,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,_,(()=>{})),this.id=a((e=>{i(this,_).call(this,e)}))}set onmessage(e){((e,n,t,i)=>{r(e,n,"write to private field"),i?i.call(e,t):n.set(e,t)})(this,_,e)}get onmessage(){return i(this,_)}toJSON(){return`__CHANNEL__:${this.id}`}};_=new WeakMap;var u=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return l(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function o(e,n,t){let r=new s;return r.onmessage=t,l(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new u(e,n,r.id)))}async function l(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function c(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}t({},{TauriEvent:()=>d,emit:()=>v,listen:()=>h,once:()=>I});var d=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(d||{});async function E(e,n){await l("plugin:event|unlisten",{event:e,eventId:n})}async function h(e,n,t){return l("plugin:event|listen",{event:e,windowLabel:t?.target,handler:a(n)}).then((n=>async()=>E(e,n)))}async function I(e,n,t){return h(e,(t=>{n(t),E(e,t.id).catch((()=>{}))}),t)}async function v(e,n,t){await l("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}async function N(){return await l("plugin:deep-link|get_current")}return e.getCurrent=N,e.onOpenUrl=async function(e){const n=await N();return null!=n&&e(n),await h("deep-link://new-url",(n=>e(n.payload)))},e}({});Object.defineProperty(window.__TAURI__,"deepLink",{value:__TAURI_DEEPLINK__})}

@ -4,7 +4,7 @@ Native system dialogs for opening and saving files along with message dialogs.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -2,11 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
interface FileResponse {
base64Data?: string;
@ -173,7 +169,7 @@ async function open(
Object.freeze(options);
}
return window.__TAURI_INVOKE__("plugin:dialog|open", { options });
return invoke("plugin:dialog|open", { options });
}
/**
@ -205,7 +201,7 @@ async function save(options: SaveDialogOptions = {}): Promise<string | null> {
Object.freeze(options);
}
return window.__TAURI_INVOKE__("plugin:dialog|save", { options });
return invoke("plugin:dialog|save", { options });
}
/**
@ -230,7 +226,7 @@ async function message(
options?: string | MessageDialogOptions,
): Promise<void> {
const opts = typeof options === "string" ? { title: options } : options;
return window.__TAURI_INVOKE__("plugin:dialog|message", {
return invoke("plugin:dialog|message", {
message: message.toString(),
title: opts?.title?.toString(),
type_: opts?.type,
@ -259,7 +255,7 @@ async function ask(
options?: string | ConfirmDialogOptions,
): Promise<boolean> {
const opts = typeof options === "string" ? { title: options } : options;
return window.__TAURI_INVOKE__("plugin:dialog|ask", {
return invoke("plugin:dialog|ask", {
message: message.toString(),
title: opts?.title?.toString(),
type_: opts?.type,
@ -289,7 +285,7 @@ async function confirm(
options?: string | ConfirmDialogOptions,
): Promise<boolean> {
const opts = typeof options === "string" ? { title: options } : options;
return window.__TAURI_INVOKE__("plugin:dialog|confirm", {
return invoke("plugin:dialog|confirm", {
message: message.toString(),
title: opts?.title?.toString(),
type_: opts?.type,

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_DIALOG__=function(n){"use strict";return n.ask=async function(n,o){var t,i,l,e,u;const _="string"==typeof o?{title:o}:o;return window.__TAURI_INVOKE__("plugin:dialog|ask",{message:n.toString(),title:null===(t=null==_?void 0:_.title)||void 0===t?void 0:t.toString(),type_:null==_?void 0:_.type,okButtonLabel:null!==(l=null===(i=null==_?void 0:_.okLabel)||void 0===i?void 0:i.toString())&&void 0!==l?l:"Yes",cancelButtonLabel:null!==(u=null===(e=null==_?void 0:_.cancelLabel)||void 0===e?void 0:e.toString())&&void 0!==u?u:"No"})},n.confirm=async function(n,o){var t,i,l,e,u;const _="string"==typeof o?{title:o}:o;return window.__TAURI_INVOKE__("plugin:dialog|confirm",{message:n.toString(),title:null===(t=null==_?void 0:_.title)||void 0===t?void 0:t.toString(),type_:null==_?void 0:_.type,okButtonLabel:null!==(l=null===(i=null==_?void 0:_.okLabel)||void 0===i?void 0:i.toString())&&void 0!==l?l:"Ok",cancelButtonLabel:null!==(u=null===(e=null==_?void 0:_.cancelLabel)||void 0===e?void 0:e.toString())&&void 0!==u?u:"Cancel"})},n.message=async function(n,o){var t,i;const l="string"==typeof o?{title:o}:o;return window.__TAURI_INVOKE__("plugin:dialog|message",{message:n.toString(),title:null===(t=null==l?void 0:l.title)||void 0===t?void 0:t.toString(),type_:null==l?void 0:l.type,okButtonLabel:null===(i=null==l?void 0:l.okLabel)||void 0===i?void 0:i.toString()})},n.open=async function(n={}){return"object"==typeof n&&Object.freeze(n),window.__TAURI_INVOKE__("plugin:dialog|open",{options:n})},n.save=async function(n={}){return"object"==typeof n&&Object.freeze(n),window.__TAURI_INVOKE__("plugin:dialog|save",{options:n})},n}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_DIALOG__})}
if("__TAURI__"in window){var __TAURI_DIALOG__=function(n){"use strict";var t=Object.defineProperty,e=(n,t,e)=>{if(!t.has(n))throw TypeError("Cannot "+e)},i=(n,t,i)=>(e(n,t,"read from private field"),i?i.call(n):t.get(n));function o(n,t=!1){return window.__TAURI_INTERNALS__.transformCallback(n,t)}((n,e)=>{for(var i in e)t(n,i,{get:e[i],enumerable:!0})})({},{Channel:()=>r,PluginListener:()=>a,addPluginListener:()=>s,convertFileSrc:()=>d,invoke:()=>u,transformCallback:()=>o});var l,r=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((n,t,e)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,e)})(this,l,(()=>{})),this.id=o((n=>{i(this,l).call(this,n)}))}set onmessage(n){var t,i,o,r;o=n,e(t=this,i=l,"write to private field"),r?r.call(t,o):i.set(t,o)}get onmessage(){return i(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var a=class{constructor(n,t,e){this.plugin=n,this.event=t,this.channelId=e}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function s(n,t,e){let i=new r;return i.onmessage=e,u(`plugin:${n}|register_listener`,{event:t,handler:i}).then((()=>new a(n,t,i.id)))}async function u(n,t={},e){return window.__TAURI_INTERNALS__.invoke(n,t,e)}function d(n,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(n,t)}return n.ask=async function(n,t){var e,i,o,l,r;const a="string"==typeof t?{title:t}:t;return u("plugin:dialog|ask",{message:n.toString(),title:null===(e=null==a?void 0:a.title)||void 0===e?void 0:e.toString(),type_:null==a?void 0:a.type,okButtonLabel:null!==(o=null===(i=null==a?void 0:a.okLabel)||void 0===i?void 0:i.toString())&&void 0!==o?o:"Yes",cancelButtonLabel:null!==(r=null===(l=null==a?void 0:a.cancelLabel)||void 0===l?void 0:l.toString())&&void 0!==r?r:"No"})},n.confirm=async function(n,t){var e,i,o,l,r;const a="string"==typeof t?{title:t}:t;return u("plugin:dialog|confirm",{message:n.toString(),title:null===(e=null==a?void 0:a.title)||void 0===e?void 0:e.toString(),type_:null==a?void 0:a.type,okButtonLabel:null!==(o=null===(i=null==a?void 0:a.okLabel)||void 0===i?void 0:i.toString())&&void 0!==o?o:"Ok",cancelButtonLabel:null!==(r=null===(l=null==a?void 0:a.cancelLabel)||void 0===l?void 0:l.toString())&&void 0!==r?r:"Cancel"})},n.message=async function(n,t){var e,i;const o="string"==typeof t?{title:t}:t;return u("plugin:dialog|message",{message:n.toString(),title:null===(e=null==o?void 0:o.title)||void 0===e?void 0:e.toString(),type_:null==o?void 0:o.type,okButtonLabel:null===(i=null==o?void 0:o.okLabel)||void 0===i?void 0:i.toString()})},n.open=async function(n={}){return"object"==typeof n&&Object.freeze(n),u("plugin:dialog|open",{options:n})},n.save=async function(n={}){return"object"==typeof n&&Object.freeze(n),u("plugin:dialog|save",{options:n})},n}({});Object.defineProperty(window.__TAURI__,"dialog",{value:__TAURI_DIALOG__})}

@ -3,13 +3,13 @@
// SPDX-License-Identifier: MIT
window.alert = function (message) {
window.__TAURI_INVOKE__("plugin:dialog|message", {
invoke("plugin:dialog|message", {
message: message.toString(),
});
};
window.confirm = function (message) {
return window.__TAURI_INVOKE__("plugin:dialog|confirm", {
return invoke("plugin:dialog|confirm", {
message: message.toString(),
});
};

@ -1,5 +1,5 @@
{
"$schema": "../../../node_modules/.pnpm/@tauri-apps+cli@2.0.0-alpha.15/node_modules/@tauri-apps/cli/schema.json",
"$schema": "../../../node_modules/.pnpm/@tauri-apps+cli@2.0.0-alpha.16/node_modules/@tauri-apps/cli/schema.json",
"build": {
"distDir": ".",
"devPath": "http://localhost:4000"

@ -4,7 +4,7 @@ Access the file system.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -47,11 +47,7 @@
import { BaseDirectory } from "@tauri-apps/api/path";
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
interface Permissions {
/**
@ -231,7 +227,7 @@ async function readTextFile(
filePath: string,
options: FsOptions = {},
): Promise<string> {
return await window.__TAURI_INVOKE__("plugin:fs|read_text_file", {
return await invoke("plugin:fs|read_text_file", {
path: filePath,
options,
});
@ -252,7 +248,7 @@ async function readBinaryFile(
filePath: string,
options: FsOptions = {},
): Promise<Uint8Array> {
const arr = await window.__TAURI_INVOKE__<number[]>("plugin:fs|read_file", {
const arr = await invoke<number[]>("plugin:fs|read_file", {
path: filePath,
options,
});
@ -328,7 +324,7 @@ async function writeTextFile(
fileOptions = contents;
}
return await window.__TAURI_INVOKE__("plugin:fs|write_file", {
return await invoke("plugin:fs|write_file", {
path: file.path,
contents: Array.from(new TextEncoder().encode(file.contents)),
options: fileOptions,
@ -410,7 +406,7 @@ async function writeBinaryFile(
file.contents = contents ?? [];
}
return await window.__TAURI_INVOKE__("plugin:fs|write_file", {
return await invoke("plugin:fs|write_file", {
path: file.path,
contents: Array.from(
file.contents instanceof ArrayBuffer
@ -445,7 +441,7 @@ async function readDir(
dir: string,
options: FsDirOptions = {},
): Promise<FileEntry[]> {
return await window.__TAURI_INVOKE__("plugin:fs|read_dir", {
return await invoke("plugin:fs|read_dir", {
path: dir,
options,
});
@ -470,7 +466,7 @@ async function createDir(
dir: string,
options: FsDirOptions = {},
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:fs|create_dir", {
return await invoke("plugin:fs|create_dir", {
path: dir,
options,
});
@ -494,7 +490,7 @@ async function removeDir(
dir: string,
options: FsDirOptions = {},
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:fs|remove_dir", {
return await invoke("plugin:fs|remove_dir", {
path: dir,
options,
});
@ -518,7 +514,7 @@ async function copyFile(
destination: string,
options: FsOptions = {},
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:fs|copy_file", {
return await invoke("plugin:fs|copy_file", {
source,
destination,
options,
@ -542,7 +538,7 @@ async function removeFile(
file: string,
options: FsOptions = {},
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:fs|remove_file", {
return await invoke("plugin:fs|remove_file", {
path: file,
options,
});
@ -566,7 +562,7 @@ async function renameFile(
newPath: string,
options: FsOptions = {},
): Promise<void> {
return await window.__TAURI_INVOKE__("plugin:fs|rename_file", {
return await invoke("plugin:fs|rename_file", {
oldPath,
newPath,
options,
@ -585,7 +581,7 @@ async function renameFile(
* @since 2.0.0
*/
async function exists(path: string): Promise<boolean> {
return await window.__TAURI_INVOKE__("plugin:fs|exists", { path });
return await invoke("plugin:fs|exists", { path });
}
/**
@ -594,19 +590,17 @@ async function exists(path: string): Promise<boolean> {
* @since 2.0.0
*/
async function metadata(path: string): Promise<Metadata> {
return await window
.__TAURI_INVOKE__<BackendMetadata>("plugin:fs|metadata", {
path,
})
.then((metadata) => {
const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata;
return {
accessedAt: new Date(accessedAtMs),
createdAt: new Date(createdAtMs),
modifiedAt: new Date(modifiedAtMs),
...data,
};
});
return await invoke<BackendMetadata>("plugin:fs|metadata", {
path,
}).then((metadata) => {
const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata;
return {
accessedAt: new Date(accessedAtMs),
createdAt: new Date(createdAtMs),
modifiedAt: new Date(modifiedAtMs),
...data,
};
});
}
export type {

@ -28,6 +28,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

File diff suppressed because one or more lines are too long

@ -6,7 +6,7 @@ Register global shortcuts.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -8,7 +8,7 @@
* @module
*/
import { invoke, Channel } from "@tauri-apps/api/tauri";
import { invoke, Channel } from "@tauri-apps/api/primitives";
export type ShortcutHandler = (shortcut: string) => void;

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_GLOBALSHORTCUT__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},r=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),i=(e,t,r,i)=>(n(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r);function a(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>l,addPluginListener:()=>c,convertFileSrc:()=>_,invoke:()=>u,transformCallback:()=>a});var o,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,o,(()=>{})),this.id=a((e=>{r(this,o).call(this,e)}))}set onmessage(e){i(this,o,e)}get onmessage(){return r(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;var l=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function c(e,t,n){let r=new s;return r.onmessage=n,u(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new l(e,t,r.id)))}async function u(e,t={},n){return new Promise(((r,i)=>{let o=a((e=>{r(e),Reflect.deleteProperty(window,`_${s}`)}),!0),s=a((e=>{i(e),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:o,error:s,payload:t,options:n})}))}function _(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}return e.isRegistered=async function(e){return await u("plugin:globalShortcut|is_registered",{shortcut:e})},e.register=async function(e,t){const n=new s;return n.onmessage=t,await u("plugin:globalShortcut|register",{shortcut:e,handler:n})},e.registerAll=async function(e,t){const n=new s;return n.onmessage=t,await u("plugin:globalShortcut|register_all",{shortcuts:e,handler:n})},e.unregister=async function(e){return await u("plugin:globalShortcut|unregister",{shortcut:e})},e.unregisterAll=async function(){return await u("plugin:globalShortcut|unregister_all")},e}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_GLOBALSHORTCUT__})}
if("__TAURI__"in window){var __TAURI_GLOBALSHORTCUT__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},r=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e));function i(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>o,addPluginListener:()=>l,convertFileSrc:()=>c,invoke:()=>u,transformCallback:()=>i});var s,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,s,(()=>{})),this.id=i((e=>{r(this,s).call(this,e)}))}set onmessage(e){var t,r,i,a;i=e,n(t=this,r=s,"write to private field"),a?a.call(t,i):r.set(t,i)}get onmessage(){return r(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var o=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,t,n){let r=new a;return r.onmessage=n,u(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new o(e,t,r.id)))}async function u(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function c(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}return e.isRegistered=async function(e){return await u("plugin:globalShortcut|is_registered",{shortcut:e})},e.register=async function(e,t){const n=new a;return n.onmessage=t,await u("plugin:globalShortcut|register",{shortcut:e,handler:n})},e.registerAll=async function(e,t){const n=new a;return n.onmessage=t,await u("plugin:globalShortcut|register_all",{shortcuts:e,handler:n})},e.unregister=async function(e){return await u("plugin:globalShortcut|unregister",{shortcut:e})},e.unregisterAll=async function(){return await u("plugin:globalShortcut|unregister_all")},e}({});Object.defineProperty(window.__TAURI__,"globalShortcut",{value:__TAURI_GLOBALSHORTCUT__})}

@ -4,7 +4,7 @@ Access the HTTP client written in Rust.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -24,11 +24,7 @@
* @module
*/
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
/**
* Options to configure the Rust client used to make fetch requests
@ -76,7 +72,7 @@ export async function fetch(
const buffer = await req.arrayBuffer();
const reqData = buffer.byteLength ? Array.from(new Uint8Array(buffer)) : null;
const rid = await window.__TAURI_INVOKE__<number>("plugin:http|fetch", {
const rid = await invoke<number>("plugin:http|fetch", {
method: req.method,
url: req.url,
headers: Array.from(req.headers.entries()),
@ -86,7 +82,7 @@ export async function fetch(
});
req.signal.addEventListener("abort", () => {
window.__TAURI_INVOKE__("plugin:http|fetch_cancel", {
invoke("plugin:http|fetch_cancel", {
rid,
});
});
@ -98,18 +94,17 @@ export async function fetch(
url: string;
}
const { status, statusText, url, headers } =
await window.__TAURI_INVOKE__<FetchSendResponse>("plugin:http|fetch_send", {
rid,
});
const body = await window.__TAURI_INVOKE__<number[]>(
"plugin:http|fetch_read_body",
const { status, statusText, url, headers } = await invoke<FetchSendResponse>(
"plugin:http|fetch_send",
{
rid,
},
);
const body = await invoke<number[]>("plugin:http|fetch_read_body", {
rid,
});
const res = new Response(new Uint8Array(body), {
headers,
status,

@ -27,6 +27,6 @@
"tslib": "^2.5.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_HTTP__=function(e){"use strict";return e.fetch=async function(e,t){const n=null==t?void 0:t.maxRedirections,r=null==t?void 0:t.maxRedirections;t&&(delete t.maxRedirections,delete t.connectTimeout);const _=new Request(e,t),i=await _.arrayBuffer(),a=i.byteLength?Array.from(new Uint8Array(i)):null,d=await window.__TAURI_INVOKE__("plugin:http|fetch",{method:_.method,url:_.url,headers:Array.from(_.headers.entries()),data:a,maxRedirections:n,connectTimeout:r});_.signal.addEventListener("abort",(()=>{window.__TAURI_INVOKE__("plugin:http|fetch_cancel",{rid:d})}));const{status:o,statusText:s,url:u,headers:c}=await window.__TAURI_INVOKE__("plugin:http|fetch_send",{rid:d}),l=await window.__TAURI_INVOKE__("plugin:http|fetch_read_body",{rid:d}),w=new Response(new Uint8Array(l),{headers:c,status:o,statusText:s});return Object.defineProperty(w,"url",{value:u}),w},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_HTTP__})}
if("__TAURI__"in window){var __TAURI_HTTP__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},r=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e));function i(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})({},{Channel:()=>s,PluginListener:()=>o,addPluginListener:()=>c,convertFileSrc:()=>_,invoke:()=>l,transformCallback:()=>i});var a,s=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,a,(()=>{})),this.id=i((e=>{r(this,a).call(this,e)}))}set onmessage(e){var t,r,i,s;i=e,n(t=this,r=a,"write to private field"),s?s.call(t,i):r.set(t,i)}get onmessage(){return r(this,a)}toJSON(){return`__CHANNEL__:${this.id}`}};a=new WeakMap;var o=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return l(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function c(e,t,n){let r=new s;return r.onmessage=n,l(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new o(e,t,r.id)))}async function l(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function _(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}return e.fetch=async function(e,t){const n=null==t?void 0:t.maxRedirections,r=null==t?void 0:t.maxRedirections;t&&(delete t.maxRedirections,delete t.connectTimeout);const i=new Request(e,t),a=await i.arrayBuffer(),s=a.byteLength?Array.from(new Uint8Array(a)):null,o=await l("plugin:http|fetch",{method:i.method,url:i.url,headers:Array.from(i.headers.entries()),data:s,maxRedirections:n,connectTimeout:r});i.signal.addEventListener("abort",(()=>{l("plugin:http|fetch_cancel",{rid:o})}));const{status:c,statusText:_,url:d,headers:u}=await l("plugin:http|fetch_send",{rid:o}),h=await l("plugin:http|fetch_read_body",{rid:o}),f=new Response(new Uint8Array(h),{headers:u,status:c,statusText:_});return Object.defineProperty(f,"url",{value:d}),f},e}({});Object.defineProperty(window.__TAURI__,"http",{value:__TAURI_HTTP__})}

@ -6,7 +6,7 @@ Expose your apps assets through a localhost server instead of the default custom
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -4,7 +4,7 @@ Configurable logging for your Tauri app.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -4,11 +4,7 @@
import { listen, UnlistenFn } from "@tauri-apps/api/event";
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
export type LogOptions = {
file?: string;
@ -67,7 +63,7 @@ async function log(
location = "webview::unknown";
}
await window.__TAURI_INVOKE__("plugin:log|log", {
await invoke("plugin:log|log", {
level,
message,
location,

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_LOG__=function(e){"use strict";var n=Object.defineProperty,t=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},r=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},a=(e,n,t)=>(r(e,n,"read from private field"),t?t.call(e):n.get(e)),i=(e,n,t,a)=>(r(e,n,"write to private field"),a?a.call(e,t):n.set(e,t),t);function o(e,n=!1){let t=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${t}`;return Object.defineProperty(window,r,{value:t=>(n&&Reflect.deleteProperty(window,r),e?.(t)),writable:!1,configurable:!0}),t}t({},{Channel:()=>c,PluginListener:()=>s,addPluginListener:()=>u,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var l,c=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,l,(()=>{})),this.id=o((e=>{a(this,l).call(this,e)}))}set onmessage(e){i(this,l,e)}get onmessage(){return a(this,l)}toJSON(){return`__CHANNEL__:${this.id}`}};l=new WeakMap;var s=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function u(e,n,t){let r=new c;return r.onmessage=t,_(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new s(e,n,r.id)))}async function _(e,n={},t){return new Promise(((r,a)=>{let i=o((e=>{r(e),Reflect.deleteProperty(window,`_${l}`)}),!0),l=o((e=>{a(e),Reflect.deleteProperty(window,`_${i}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:i,error:l,payload:n,options:t})}))}function d(e,n="asset"){return window.__TAURI__.convertFileSrc(e,n)}t({},{TauriEvent:()=>f,emit:()=>E,listen:()=>v,once:()=>h});var w,f=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(f||{});async function g(e,n){await _("plugin:event|unlisten",{event:e,eventId:n})}async function v(e,n,t){return _("plugin:event|listen",{event:e,windowLabel:t?.target,handler:o(n)}).then((n=>async()=>g(e,n)))}async function h(e,n,t){return v(e,(t=>{n(t),g(e,t.id).catch((()=>{}))}),t)}async function E(e,n,t){await _("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}async function I(e,n,t){var r,a;const i=null===(r=(new Error).stack)||void 0===r?void 0:r.split("\n").map((e=>e.split("@"))),o=null==i?void 0:i.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:l,line:c,keyValues:s}=null!=t?t:{};let u=null===(a=null==o?void 0:o[0])||void 0===a?void 0:a.filter((e=>e.length>0)).join("@");"Error"===u&&(u="webview::unknown"),await window.__TAURI_INVOKE__("plugin:log|log",{level:e,message:n,location:u,file:l,line:c,keyValues:s})}return function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(w||(w={})),e.attachConsole=async function(){return await v("log://log",(e=>{const n=e.payload,t=n.message.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"");switch(n.level){case w.Trace:console.log(t);break;case w.Debug:console.debug(t);break;case w.Info:console.info(t);break;case w.Warn:console.warn(t);break;case w.Error:console.error(t);break;default:throw new Error(`unknown log level ${n.level}`)}}))},e.debug=async function(e,n){await I(w.Debug,e,n)},e.error=async function(e,n){await I(w.Error,e,n)},e.info=async function(e,n){await I(w.Info,e,n)},e.trace=async function(e,n){await I(w.Trace,e,n)},e.warn=async function(e,n){await I(w.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_LOG__})}
if("__TAURI__"in window){var __TAURI_LOG__=function(e){"use strict";var n=Object.defineProperty,t=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},r=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},a=(e,n,t)=>(r(e,n,"read from private field"),t?t.call(e):n.get(e));function i(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}t({},{Channel:()=>l,PluginListener:()=>s,addPluginListener:()=>c,convertFileSrc:()=>_,invoke:()=>u,transformCallback:()=>i});var o,l=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,o,(()=>{})),this.id=i((e=>{a(this,o).call(this,e)}))}set onmessage(e){((e,n,t,a)=>{r(e,n,"write to private field"),a?a.call(e,t):n.set(e,t)})(this,o,e)}get onmessage(){return a(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;var s=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function c(e,n,t){let r=new l;return r.onmessage=t,u(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new s(e,n,r.id)))}async function u(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function _(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}t({},{TauriEvent:()=>f,emit:()=>E,listen:()=>w,once:()=>g});var d,f=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(f||{});async function v(e,n){await u("plugin:event|unlisten",{event:e,eventId:n})}async function w(e,n,t){return u("plugin:event|listen",{event:e,windowLabel:t?.target,handler:i(n)}).then((n=>async()=>v(e,n)))}async function g(e,n,t){return w(e,(t=>{n(t),v(e,t.id).catch((()=>{}))}),t)}async function E(e,n,t){await u("plugin:event|emit",{event:e,windowLabel:t?.target,payload:n})}async function h(e,n,t){var r,a;const i=null===(r=(new Error).stack)||void 0===r?void 0:r.split("\n").map((e=>e.split("@"))),o=null==i?void 0:i.filter((([e,n])=>e.length>0&&"[native code]"!==n)),{file:l,line:s,keyValues:c}=null!=t?t:{};let _=null===(a=null==o?void 0:o[0])||void 0===a?void 0:a.filter((e=>e.length>0)).join("@");"Error"===_&&(_="webview::unknown"),await u("plugin:log|log",{level:e,message:n,location:_,file:l,line:s,keyValues:c})}return function(e){e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warn=4]="Warn",e[e.Error=5]="Error"}(d||(d={})),e.attachConsole=async function(){return await w("log://log",(e=>{const n=e.payload,t=n.message.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,"");switch(n.level){case d.Trace:console.log(t);break;case d.Debug:console.debug(t);break;case d.Info:console.info(t);break;case d.Warn:console.warn(t);break;case d.Error:console.error(t);break;default:throw new Error(`unknown log level ${n.level}`)}}))},e.debug=async function(e,n){await h(d.Debug,e,n)},e.error=async function(e,n){await h(d.Error,e,n)},e.info=async function(e,n){await h(d.Info,e,n)},e.trace=async function(e,n){await h(d.Trace,e,n)},e.warn=async function(e,n){await h(d.Warn,e,n)},e}({});Object.defineProperty(window.__TAURI__,"log",{value:__TAURI_LOG__})}

@ -499,7 +499,7 @@ fn get_log_file_path(
rotation_strategy: &RotationStrategy,
timezone_strategy: &TimezoneStrategy,
max_file_size: u128,
) -> plugin::Result<PathBuf> {
) -> Result<PathBuf, Box<dyn std::error::Error>> {
let path = dir.as_ref().join(format!("{file_name}.log"));
if path.exists() {

@ -4,7 +4,7 @@ Send message notifications (brief auto-expiring OS window element) to your user.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -13,7 +13,7 @@ import {
invoke,
PluginListener,
addPluginListener,
} from "@tauri-apps/api/tauri";
} from "@tauri-apps/api/primitives";
/**
* Options to send a notification.

@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { invoke } from "@tauri-apps/api/primitives";
import type { Options } from "./index";
(function () {
let permissionSettable = false;
let permissionValue = "default";
@ -10,10 +13,10 @@
if (window.Notification.permission !== "default") {
return Promise.resolve(window.Notification.permission === "granted");
}
return window.__TAURI_INVOKE__("plugin:notification|is_permission_granted");
return invoke("plugin:notification|is_permission_granted");
}
function setNotificationPermission(value) {
function setNotificationPermission(value: "granted" | "denied" | "default") {
permissionSettable = true;
// @ts-expect-error we can actually set this value on the webview
window.Notification.permission = value;
@ -21,22 +24,22 @@
}
function requestPermission() {
return window
.__TAURI_INVOKE__("plugin:notification|request_permission")
.then(function (permission) {
setNotificationPermission(
permission === "prompt" ? "default" : permission,
);
return permission;
});
return invoke<"prompt" | "default" | "granted" | "denied">(
"plugin:notification|request_permission",
).then((permission) => {
setNotificationPermission(
permission === "prompt" ? "default" : permission,
);
return permission;
});
}
function sendNotification(options) {
function sendNotification(options: string | Options) {
if (typeof options === "object") {
Object.freeze(options);
}
return window.__TAURI_INVOKE__("plugin:notification|notify", {
return invoke("plugin:notification|notify", {
options:
typeof options === "string"
? {
@ -49,17 +52,20 @@
// @ts-expect-error unfortunately we can't implement the whole type, so we overwrite it with our own version
window.Notification = function (title, options) {
const opts = options || {};
sendNotification(Object.assign(opts, { title }));
sendNotification(
Object.assign(opts, {
title,
}),
);
};
// @ts-expect-error tauri does not have sync IPC :(
window.Notification.requestPermission = requestPermission;
Object.defineProperty(window.Notification, "permission", {
enumerable: true,
get: function () {
return permissionValue;
},
set: function (v) {
get: () => permissionValue,
set: (v) => {
if (!permissionSettable) {
throw new Error("Readonly property");
}

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -2,10 +2,33 @@ import { readFileSync } from "fs";
import { createConfig } from "../../shared/rollup.config.mjs";
export default createConfig({
import typescript from "@rollup/plugin-typescript";
import resolve from "@rollup/plugin-node-resolve";
import terser from "@rollup/plugin-terser";
const config = createConfig({
input: "guest-js/index.ts",
pkg: JSON.parse(
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
),
external: [/^@tauri-apps\/api/],
});
config.push({
input: "guest-js/init.ts",
output: {
file: "src/init-iife.js",
format: "iife",
},
plugins: [
resolve(),
typescript({
sourceMap: false,
declaration: false,
declarationDir: undefined,
}),
terser(),
],
});
export default config;

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_NOTIFICATION__=function(n){"use strict";var e=Object.defineProperty,i=(n,e,i)=>{if(!e.has(n))throw TypeError("Cannot "+i)},t=(n,e,t)=>(i(n,e,"read from private field"),t?t.call(n):e.get(n)),o=(n,e,t,o)=>(i(n,e,"write to private field"),o?o.call(n,t):e.set(n,t),t);function r(n,e=!1){let i=window.crypto.getRandomValues(new Uint32Array(1))[0],t=`_${i}`;return Object.defineProperty(window,t,{value:i=>(e&&Reflect.deleteProperty(window,t),n?.(i)),writable:!1,configurable:!0}),i}((n,i)=>{for(var t in i)e(n,t,{get:i[t],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>f,addPluginListener:()=>d,convertFileSrc:()=>w,invoke:()=>_,transformCallback:()=>r});var c,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((n,e,i)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,i)})(this,c,(()=>{})),this.id=r((n=>{t(this,c).call(this,n)}))}set onmessage(n){o(this,c,n)}get onmessage(){return t(this,c)}toJSON(){return`__CHANNEL__:${this.id}`}};c=new WeakMap;var s,l,u,f=class{constructor(n,e,i){this.plugin=n,this.event=e,this.channelId=i}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function d(n,e,i){let t=new a;return t.onmessage=i,_(`plugin:${n}|register_listener`,{event:e,handler:t}).then((()=>new f(n,e,t.id)))}async function _(n,e={},i){return new Promise(((t,o)=>{let c=r((n=>{t(n),Reflect.deleteProperty(window,`_${a}`)}),!0),a=r((n=>{o(n),Reflect.deleteProperty(window,`_${c}`)}),!0);window.__TAURI_IPC__({cmd:n,callback:c,error:a,payload:e,options:i})}))}function w(n,e="asset"){return window.__TAURI__.convertFileSrc(n,e)}return function(n){n.Year="Year",n.Month="Month",n.TwoWeeks="TwoWeeks",n.Week="Week",n.Day="Day",n.Hour="Hour",n.Minute="Minute",n.Second="Second"}(s||(s={})),n.Importance=void 0,(l=n.Importance||(n.Importance={}))[l.None=0]="None",l[l.Min=1]="Min",l[l.Low=2]="Low",l[l.Default=3]="Default",l[l.High=4]="High",n.Visibility=void 0,(u=n.Visibility||(n.Visibility={}))[u.Secret=-1]="Secret",u[u.Private=0]="Private",u[u.Public=1]="Public",n.active=async function(){return _("plugin:notification|get_active")},n.cancel=async function(n){return _("plugin:notification|cancel",{notifications:n})},n.cancelAll=async function(){return _("plugin:notification|cancel")},n.channels=async function(){return _("plugin:notification|getActive")},n.createChannel=async function(n){return _("plugin:notification|create_channel",{...n})},n.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):_("plugin:notification|is_permission_granted")},n.onAction=async function(n){return d("notification","actionPerformed",n)},n.onNotificationReceived=async function(n){return d("notification","notification",n)},n.pending=async function(){return _("plugin:notification|get_pending")},n.registerActionTypes=async function(n){return _("plugin:notification|register_action_types",{types:n})},n.removeActive=async function(n){return _("plugin:notification|remove_active",{notifications:n})},n.removeAllActive=async function(){return _("plugin:notification|remove_active")},n.removeChannel=async function(n){return _("plugin:notification|delete_channel",{id:n})},n.requestPermission=async function(){return window.Notification.requestPermission()},n.sendNotification=function(n){"string"==typeof n?new window.Notification(n):new window.Notification(n.title,n)},n}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_NOTIFICATION__})}
if("__TAURI__"in window){var __TAURI_NOTIFICATION__=function(n){"use strict";var i=Object.defineProperty,e=(n,i,e)=>{if(!i.has(n))throw TypeError("Cannot "+e)},t=(n,i,t)=>(e(n,i,"read from private field"),t?t.call(n):i.get(n));function o(n,i=!1){return window.__TAURI_INTERNALS__.transformCallback(n,i)}((n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})})({},{Channel:()=>c,PluginListener:()=>l,addPluginListener:()=>f,convertFileSrc:()=>d,invoke:()=>_,transformCallback:()=>o});var r,c=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((n,i,e)=>{if(i.has(n))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(n):i.set(n,e)})(this,r,(()=>{})),this.id=o((n=>{t(this,r).call(this,n)}))}set onmessage(n){var i,t,o,c;o=n,e(i=this,t=r,"write to private field"),c?c.call(i,o):t.set(i,o)}get onmessage(){return t(this,r)}toJSON(){return`__CHANNEL__:${this.id}`}};r=new WeakMap;var a,s,u,l=class{constructor(n,i,e){this.plugin=n,this.event=i,this.channelId=e}async unregister(){return _(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function f(n,i,e){let t=new c;return t.onmessage=e,_(`plugin:${n}|register_listener`,{event:i,handler:t}).then((()=>new l(n,i,t.id)))}async function _(n,i={},e){return window.__TAURI_INTERNALS__.invoke(n,i,e)}function d(n,i="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(n,i)}return function(n){n.Year="Year",n.Month="Month",n.TwoWeeks="TwoWeeks",n.Week="Week",n.Day="Day",n.Hour="Hour",n.Minute="Minute",n.Second="Second"}(a||(a={})),n.Importance=void 0,(s=n.Importance||(n.Importance={}))[s.None=0]="None",s[s.Min=1]="Min",s[s.Low=2]="Low",s[s.Default=3]="Default",s[s.High=4]="High",n.Visibility=void 0,(u=n.Visibility||(n.Visibility={}))[u.Secret=-1]="Secret",u[u.Private=0]="Private",u[u.Public=1]="Public",n.active=async function(){return _("plugin:notification|get_active")},n.cancel=async function(n){return _("plugin:notification|cancel",{notifications:n})},n.cancelAll=async function(){return _("plugin:notification|cancel")},n.channels=async function(){return _("plugin:notification|getActive")},n.createChannel=async function(n){return _("plugin:notification|create_channel",{...n})},n.isPermissionGranted=async function(){return"default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):_("plugin:notification|is_permission_granted")},n.onAction=async function(n){return f("notification","actionPerformed",n)},n.onNotificationReceived=async function(n){return f("notification","notification",n)},n.pending=async function(){return _("plugin:notification|get_pending")},n.registerActionTypes=async function(n){return _("plugin:notification|register_action_types",{types:n})},n.removeActive=async function(n){return _("plugin:notification|remove_active",{notifications:n})},n.removeAllActive=async function(){return _("plugin:notification|remove_active")},n.removeChannel=async function(n){return _("plugin:notification|delete_channel",{id:n})},n.requestPermission=async function(){return window.Notification.requestPermission()},n.sendNotification=function(n){"string"==typeof n?new window.Notification(n):new window.Notification(n.title,n)},n}({});Object.defineProperty(window.__TAURI__,"notification",{value:__TAURI_NOTIFICATION__})}

@ -0,0 +1 @@
!function(){"use strict";var e=Object.defineProperty,n=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},t=(e,t,i)=>(n(e,t,"read from private field"),i?i.call(e):t.get(e));function i(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((n,t)=>{for(var i in t)e(n,i,{get:t[i],enumerable:!0})})({},{Channel:()=>o,PluginListener:()=>s,addPluginListener:()=>a,convertFileSrc:()=>l,invoke:()=>c,transformCallback:()=>i});var r,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,r,(()=>{})),this.id=i((e=>{t(this,r).call(this,e)}))}set onmessage(e){var t,i,o,s;o=e,n(t=this,i=r,"write to private field"),s?s.call(t,o):i.set(t,o)}get onmessage(){return t(this,r)}toJSON(){return`__CHANNEL__:${this.id}`}};r=new WeakMap;var s=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function a(e,n,t){let i=new o;return i.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:i}).then((()=>new s(e,n,i.id)))}async function c(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function l(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}!function(){let e=!1,n="default";function t(n){e=!0,window.Notification.permission=n,e=!1}window.Notification=function(e,n){const t=n||{};!function(e){"object"==typeof e&&Object.freeze(e),c("plugin:notification|notify",{options:"string"==typeof e?{title:e}:e})}(Object.assign(t,{title:e}))},window.Notification.requestPermission=function(){return c("plugin:notification|request_permission").then((e=>(t("prompt"===e?"default":e),e)))},Object.defineProperty(window.Notification,"permission",{enumerable:!0,get:()=>n,set:t=>{if(!e)throw new Error("Readonly property");n=t}}),("default"!==window.Notification.permission?Promise.resolve("granted"===window.Notification.permission):c("plugin:notification|is_permission_granted")).then((function(e){t(null===e?"default":e?"granted":"denied")}))}()}();

@ -221,7 +221,7 @@ impl<R: Runtime, T: Manager<R>> crate::NotificationExt<R> for T {
/// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> {
let mut init_script = include_str!("init.js").to_string();
let mut init_script = include_str!("init-iife.js").to_string();
init_script.push_str(include_str!("api-iife.js"));
Builder::new("notification")
.invoke_handler(tauri::generate_handler![

@ -1,5 +1,5 @@
{
"$schema": "../../../node_modules/.pnpm/@tauri-apps+cli@2.0.0-alpha.15/node_modules/@tauri-apps/cli/schema.json",
"$schema": "../../../node_modules/.pnpm/@tauri-apps+cli@2.0.0-alpha.16/node_modules/@tauri-apps/cli/schema.json",
"build": {
"distDir": ".",
"devPath": "http://localhost:4000"

@ -4,7 +4,7 @@ Read information about the operating system.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -8,9 +8,11 @@
* @module
*/
import { invoke } from "@tauri-apps/api/primitives";
/** @ignore */
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
__TAURI__: {
os: { __eol: string };
};
@ -69,7 +71,7 @@ function eol() {
*
*/
async function platform(): Promise<Platform> {
return window.__TAURI_INVOKE__("plugin:os|platform");
return invoke("plugin:os|platform");
}
/**
@ -83,7 +85,7 @@ async function platform(): Promise<Platform> {
* @since 2.0.0
*/
async function version(): Promise<string> {
return window.__TAURI_INVOKE__("plugin:os|version");
return invoke("plugin:os|version");
}
type Family = "unix" | "windows";
@ -99,7 +101,7 @@ type Family = "unix" | "windows";
* @since 2.0.0
*/
async function family(): Promise<Family> {
return window.__TAURI_INVOKE__("plugin:os|family");
return invoke("plugin:os|family");
}
/**
@ -113,7 +115,7 @@ async function family(): Promise<Family> {
* @since 2.0.0
*/
async function type(): Promise<OsType> {
return window.__TAURI_INVOKE__("plugin:os|os_type");
return invoke("plugin:os|os_type");
}
/**
@ -128,7 +130,7 @@ async function type(): Promise<OsType> {
* @since 2.0.0
*/
async function arch(): Promise<Arch> {
return window.__TAURI_INVOKE__("plugin:os|arch");
return invoke("plugin:os|arch");
}
/**
@ -145,7 +147,7 @@ async function arch(): Promise<Arch> {
* @since 2.0.0
*/
async function locale(): Promise<string | null> {
return window.__TAURI_INVOKE__("plugin:os|locale");
return invoke("plugin:os|locale");
}
/**
@ -159,7 +161,7 @@ async function locale(): Promise<string | null> {
* @since 2.0.0
*/
async function exeExtension(): Promise<string | null> {
return window.__TAURI_INVOKE__("plugin:os|exe_extension");
return invoke("plugin:os|exe_extension");
}
/**
@ -171,7 +173,7 @@ async function exeExtension(): Promise<string | null> {
* ```
*/
async function hostname(): Promise<string | null> {
return window.__TAURI_INVOKE__("plugin:os|hostname");
return invoke("plugin:os|hostname");
}
export {

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_OS__=function(n){"use strict";return n.arch=async function(){return window.__TAURI_INVOKE__("plugin:os|arch")},n.eol=function(){return window.__TAURI__.os.__eol},n.exeExtension=async function(){return window.__TAURI_INVOKE__("plugin:os|exe_extension")},n.family=async function(){return window.__TAURI_INVOKE__("plugin:os|family")},n.hostname=async function(){return window.__TAURI_INVOKE__("plugin:os|hostname")},n.locale=async function(){return window.__TAURI_INVOKE__("plugin:os|locale")},n.platform=async function(){return window.__TAURI_INVOKE__("plugin:os|platform")},n.type=async function(){return window.__TAURI_INVOKE__("plugin:os|os_type")},n.version=async function(){return window.__TAURI_INVOKE__("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_OS__})}
if("__TAURI__"in window){var __TAURI_OS__=function(n){"use strict";var e=Object.defineProperty,t=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},r=(n,e,r)=>(t(n,e,"read from private field"),r?r.call(n):e.get(n));function i(n,e=!1){return window.__TAURI_INTERNALS__.transformCallback(n,e)}((n,t)=>{for(var r in t)e(n,r,{get:t[r],enumerable:!0})})({},{Channel:()=>o,PluginListener:()=>a,addPluginListener:()=>_,convertFileSrc:()=>u,invoke:()=>c,transformCallback:()=>i});var s,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)})(this,s,(()=>{})),this.id=i((n=>{r(this,s).call(this,n)}))}set onmessage(n){var e,r,i,o;i=n,t(e=this,r=s,"write to private field"),o?o.call(e,i):r.set(e,i)}get onmessage(){return r(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var a=class{constructor(n,e,t){this.plugin=n,this.event=e,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function _(n,e,t){let r=new o;return r.onmessage=t,c(`plugin:${n}|register_listener`,{event:e,handler:r}).then((()=>new a(n,e,r.id)))}async function c(n,e={},t){return window.__TAURI_INTERNALS__.invoke(n,e,t)}function u(n,e="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(n,e)}return n.arch=async function(){return c("plugin:os|arch")},n.eol=function(){return window.__TAURI__.os.__eol},n.exeExtension=async function(){return c("plugin:os|exe_extension")},n.family=async function(){return c("plugin:os|family")},n.hostname=async function(){return c("plugin:os|hostname")},n.locale=async function(){return c("plugin:os|locale")},n.platform=async function(){return c("plugin:os|platform")},n.type=async function(){return c("plugin:os|os_type")},n.version=async function(){return c("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_OS__})}

@ -4,7 +4,7 @@ Save filesystem and asset scopes and restore them when the app is reopened.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -6,7 +6,7 @@ This plugin is a port of [electron-positioner](https://github.com/jenslind/elect
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -3,11 +3,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
/**
* Well known window positions.
@ -37,7 +33,7 @@ export enum Position {
* @param to The {@link Position} to move to.
*/
export async function moveWindow(to: Position): Promise<void> {
await window.__TAURI_INVOKE__("plugin:positioner|move_window", {
await invoke("plugin:positioner|move_window", {
position: to,
});
}

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_POSITIONER__=function(t){"use strict";var o;return t.Position=void 0,(o=t.Position||(t.Position={}))[o.TopLeft=0]="TopLeft",o[o.TopRight=1]="TopRight",o[o.BottomLeft=2]="BottomLeft",o[o.BottomRight=3]="BottomRight",o[o.TopCenter=4]="TopCenter",o[o.BottomCenter=5]="BottomCenter",o[o.LeftCenter=6]="LeftCenter",o[o.RightCenter=7]="RightCenter",o[o.Center=8]="Center",o[o.TrayLeft=9]="TrayLeft",o[o.TrayBottomLeft=10]="TrayBottomLeft",o[o.TrayRight=11]="TrayRight",o[o.TrayBottomRight=12]="TrayBottomRight",o[o.TrayCenter=13]="TrayCenter",o[o.TrayBottomCenter=14]="TrayBottomCenter",t.moveWindow=async function(t){await window.__TAURI_INVOKE__("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_POSITIONER__})}
if("__TAURI__"in window){var __TAURI_POSITIONER__=function(t){"use strict";var e=Object.defineProperty,n=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},r=(t,e,r)=>(n(t,e,"read from private field"),r?r.call(t):e.get(t));function o(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>_,addPluginListener:()=>h,convertFileSrc:()=>l,invoke:()=>c,transformCallback:()=>o});var i,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)})(this,i,(()=>{})),this.id=o((t=>{r(this,i).call(this,t)}))}set onmessage(t){var e,r,o,a;o=t,n(e=this,r=i,"write to private field"),a?a.call(e,o):r.set(e,o)}get onmessage(){return r(this,i)}toJSON(){return`__CHANNEL__:${this.id}`}};i=new WeakMap;var s,_=class{constructor(t,e,n){this.plugin=t,this.event=e,this.channelId=n}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function h(t,e,n){let r=new a;return r.onmessage=n,c(`plugin:${t}|register_listener`,{event:e,handler:r}).then((()=>new _(t,e,r.id)))}async function c(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function l(t,e="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(t,e)}return t.Position=void 0,(s=t.Position||(t.Position={}))[s.TopLeft=0]="TopLeft",s[s.TopRight=1]="TopRight",s[s.BottomLeft=2]="BottomLeft",s[s.BottomRight=3]="BottomRight",s[s.TopCenter=4]="TopCenter",s[s.BottomCenter=5]="BottomCenter",s[s.LeftCenter=6]="LeftCenter",s[s.RightCenter=7]="RightCenter",s[s.Center=8]="Center",s[s.TrayLeft=9]="TrayLeft",s[s.TrayBottomLeft=10]="TrayBottomLeft",s[s.TrayRight=11]="TrayRight",s[s.TrayBottomRight=12]="TrayBottomRight",s[s.TrayCenter=13]="TrayCenter",s[s.TrayBottomCenter=14]="TrayBottomCenter",t.moveWindow=async function(t){await c("plugin:positioner|move_window",{position:t})},t}({});Object.defineProperty(window.__TAURI__,"positioner",{value:__TAURI_POSITIONER__})}

@ -4,7 +4,7 @@ This plugin provides APIs to access the current process. To spawn child processe
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -7,11 +7,7 @@
* @module
*/
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
/**
* Exits immediately with the given `exitCode`.
@ -27,7 +23,7 @@ declare global {
* @since 2.0.0
*/
async function exit(code = 0): Promise<void> {
return window.__TAURI_INVOKE__("plugin:process|exit", { code });
return invoke("plugin:process|exit", { code });
}
/**
@ -43,7 +39,7 @@ async function exit(code = 0): Promise<void> {
* @since 2.0.0
*/
async function relaunch(): Promise<void> {
return window.__TAURI_INVOKE__("plugin:process|restart");
return invoke("plugin:process|restart");
}
export { exit, relaunch };

@ -27,6 +27,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_PROCESS__=function(_){"use strict";return _.exit=async function(_=0){return window.__TAURI_INVOKE__("plugin:process|exit",{code:_})},_.relaunch=async function(){return window.__TAURI_INVOKE__("plugin:process|restart")},_}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PROCESS__})}
if("__TAURI__"in window){var __TAURI_PROCESS__=function(e){"use strict";var n=Object.defineProperty,t=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},r=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function i(e,n=!1){return window.__TAURI_INTERNALS__.transformCallback(e,n)}((e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>o,addPluginListener:()=>_,convertFileSrc:()=>l,invoke:()=>c,transformCallback:()=>i});var s,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)})(this,s,(()=>{})),this.id=i((e=>{r(this,s).call(this,e)}))}set onmessage(e){var n,r,i,a;i=e,t(n=this,r=s,"write to private field"),a?a.call(n,i):r.set(n,i)}get onmessage(){return r(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var o=class{constructor(e,n,t){this.plugin=e,this.event=n,this.channelId=t}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function _(e,n,t){let r=new a;return r.onmessage=t,c(`plugin:${e}|register_listener`,{event:n,handler:r}).then((()=>new o(e,n,r.id)))}async function c(e,n={},t){return window.__TAURI_INTERNALS__.invoke(e,n,t)}function l(e,n="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,n)}return e.exit=async function(e=0){return c("plugin:process|exit",{code:e})},e.relaunch=async function(){return c("plugin:process|restart")},e}({});Object.defineProperty(window.__TAURI__,"process",{value:__TAURI_PROCESS__})}

@ -4,7 +4,7 @@ Access the system shell. Allows you to spawn child processes and manage files an
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -62,7 +62,7 @@
* @module
*/
import { invoke, Channel } from "@tauri-apps/api/tauri";
import { invoke, Channel } from "@tauri-apps/api/primitives";
/**
* @since 2.0.0

@ -27,6 +27,6 @@
"tslib": "^2.4.1"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_SHELL__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},r=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),s=(e,t,r,s)=>(n(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r);function i(e,t=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],r=`_${n}`;return Object.defineProperty(window,r,{value:n=>(t&&Reflect.deleteProperty(window,r),e?.(n)),writable:!1,configurable:!0}),n}((e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>c,addPluginListener:()=>l,convertFileSrc:()=>u,invoke:()=>h,transformCallback:()=>i});var o,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,o,(()=>{})),this.id=i((e=>{r(this,o).call(this,e)}))}set onmessage(e){s(this,o,e)}get onmessage(){return r(this,o)}toJSON(){return`__CHANNEL__:${this.id}`}};o=new WeakMap;var c=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return h(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,t,n){let r=new a;return r.onmessage=n,h(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new c(e,t,r.id)))}async function h(e,t={},n){return new Promise(((r,s)=>{let o=i((e=>{r(e),Reflect.deleteProperty(window,`_${a}`)}),!0),a=i((e=>{s(e),Reflect.deleteProperty(window,`_${o}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,payload:t,options:n})}))}function u(e,t="asset"){return window.__TAURI__.convertFileSrc(e,t)}class d{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const n=r=>{this.removeListener(e,n),t(r)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const n=this.eventListeners[e];for(const e of n)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const n=r=>{this.removeListener(e,n),t(r)};return this.prependListener(e,n)}}class p{constructor(e){this.pid=e}async write(e){return h("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return h("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class w extends d{constructor(e,t=[],n){super(),this.stdout=new d,this.stderr=new d,this.program=e,this.args="string"==typeof t?[t]:t,this.options=null!=n?n:{}}static create(e,t=[],n){return new w(e,t,n)}static sidecar(e,t=[],n){const r=new w(e,t,n);return r.options.sidecar=!0,r}async spawn(){return async function(e,t,n=[],r){"object"==typeof n&&Object.freeze(n);const s=new a;return s.onmessage=e,h("plugin:shell|execute",{program:t,args:n,options:r,onEvent:s})}((e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((e=>new p(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const n=[],r=[];this.stdout.on("data",(e=>{n.push(e)})),this.stderr.on("data",(e=>{r.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(n),stderr:this.collectOutput(r)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=p,e.Command=w,e.EventEmitter=d,e.open=async function(e,t){return h("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_SHELL__})}
if("__TAURI__"in window){var __TAURI_SHELL__=function(e){"use strict";var t=Object.defineProperty,n=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},s=(e,t,s)=>(n(e,t,"read from private field"),s?s.call(e):t.get(e));function r(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((e,n)=>{for(var s in n)t(e,s,{get:n[s],enumerable:!0})})({},{Channel:()=>o,PluginListener:()=>a,addPluginListener:()=>h,convertFileSrc:()=>l,invoke:()=>c,transformCallback:()=>r});var i,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,i,(()=>{})),this.id=r((e=>{s(this,i).call(this,e)}))}set onmessage(e){var t,s,r,o;r=e,n(t=this,s=i,"write to private field"),o?o.call(t,r):s.set(t,r)}get onmessage(){return s(this,i)}toJSON(){return`__CHANNEL__:${this.id}`}};i=new WeakMap;var a=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function h(e,t,n){let s=new o;return s.onmessage=n,c(`plugin:${e}|register_listener`,{event:t,handler:s}).then((()=>new a(e,t,s.id)))}async function c(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function l(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}class u{constructor(){this.eventListeners=Object.create(null)}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}on(e,t){return e in this.eventListeners?this.eventListeners[e].push(t):this.eventListeners[e]=[t],this}once(e,t){const n=s=>{this.removeListener(e,n),t(s)};return this.addListener(e,n)}off(e,t){return e in this.eventListeners&&(this.eventListeners[e]=this.eventListeners[e].filter((e=>e!==t))),this}removeAllListeners(e){return e?delete this.eventListeners[e]:this.eventListeners=Object.create(null),this}emit(e,t){if(e in this.eventListeners){const n=this.eventListeners[e];for(const e of n)e(t);return!0}return!1}listenerCount(e){return e in this.eventListeners?this.eventListeners[e].length:0}prependListener(e,t){return e in this.eventListeners?this.eventListeners[e].unshift(t):this.eventListeners[e]=[t],this}prependOnceListener(e,t){const n=s=>{this.removeListener(e,n),t(s)};return this.prependListener(e,n)}}class d{constructor(e){this.pid=e}async write(e){return c("plugin:shell|stdin_write",{pid:this.pid,buffer:"string"==typeof e?e:Array.from(e)})}async kill(){return c("plugin:shell|kill",{cmd:"killChild",pid:this.pid})}}class p extends u{constructor(e,t=[],n){super(),this.stdout=new u,this.stderr=new u,this.program=e,this.args="string"==typeof t?[t]:t,this.options=null!=n?n:{}}static create(e,t=[],n){return new p(e,t,n)}static sidecar(e,t=[],n){const s=new p(e,t,n);return s.options.sidecar=!0,s}async spawn(){return async function(e,t,n=[],s){"object"==typeof n&&Object.freeze(n);const r=new o;return r.onmessage=e,c("plugin:shell|execute",{program:t,args:n,options:s,onEvent:r})}((e=>{switch(e.event){case"Error":this.emit("error",e.payload);break;case"Terminated":this.emit("close",e.payload);break;case"Stdout":this.stdout.emit("data",e.payload);break;case"Stderr":this.stderr.emit("data",e.payload)}}),this.program,this.args,this.options).then((e=>new d(e)))}async execute(){return new Promise(((e,t)=>{this.on("error",t);const n=[],s=[];this.stdout.on("data",(e=>{n.push(e)})),this.stderr.on("data",(e=>{s.push(e)})),this.on("close",(t=>{e({code:t.code,signal:t.signal,stdout:this.collectOutput(n),stderr:this.collectOutput(s)})})),this.spawn().catch(t)}))}collectOutput(e){return"raw"===this.options.encoding?e.reduce(((e,t)=>new Uint8Array([...e,...t,10])),new Uint8Array):e.join("\n")}}return e.Child=d,e.Command=p,e.EventEmitter=u,e.open=async function(e,t){return c("plugin:shell|open",{path:e,with:t})},e}({});Object.defineProperty(window.__TAURI__,"shell",{value:__TAURI_SHELL__})}

@ -16,7 +16,7 @@
) &&
target.target === "_blank"
) {
window.__TAURI_INVOKE__("plugin:shell|open", {
invoke("plugin:shell|open", {
path: target.href,
});
e.preventDefault();

@ -120,7 +120,7 @@ fn shell_scope(scope: ShellAllowlistScope, open: &ShellAllowlistOpen) -> ScopeCo
let shell_scope_open = match open {
ShellAllowlistOpen::Flag(false) => None,
ShellAllowlistOpen::Flag(true) => {
Some(Regex::new(r#"^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+"#).unwrap())
Some(Regex::new(r"^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+").unwrap())
}
ShellAllowlistOpen::Validate(validator) => {
let validator =

@ -4,7 +4,7 @@ Ensure a single instance of your tauri app is running.
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -9,6 +9,6 @@
"author": "",
"license": "MIT",
"devDependencies": {
"@tauri-apps/cli": "2.0.0-alpha.15"
"@tauri-apps/cli": "2.0.0-alpha.16"
}
}

@ -5,7 +5,7 @@ description = "A Tauri App"
authors = [ "You" ]
repository = ""
edition = "2021"
rust-version = "1.65"
rust-version = "1.70"
[dependencies]
serde_json = { workspace = true }

@ -4,7 +4,7 @@ Interface with SQL databases through [sqlx](https://github.com/launchbadge/sqlx)
## Install
_This plugin requires a Rust version of at least **1.65**_
_This plugin requires a Rust version of at least **1.70**_
There are three general methods of installation that we can recommend.

@ -2,11 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
declare global {
interface Window {
__TAURI_INVOKE__: <T>(cmd: string, args?: unknown) => Promise<T>;
}
}
import { invoke } from "@tauri-apps/api/primitives";
export interface QueryResult {
/** The number of rows affected by the query. */
@ -50,7 +46,7 @@ export default class Database {
* ```
*/
static async load(path: string): Promise<Database> {
const _path = await window.__TAURI_INVOKE__<string>("plugin:sql|load", {
const _path = await invoke<string>("plugin:sql|load", {
db: path,
});
@ -110,13 +106,14 @@ export default class Database {
* ```
*/
async execute(query: string, bindValues?: unknown[]): Promise<QueryResult> {
const [rowsAffected, lastInsertId] = await window.__TAURI_INVOKE__<
[number, number]
>("plugin:sql|execute", {
db: this.path,
query,
values: bindValues ?? [],
});
const [rowsAffected, lastInsertId] = await invoke<[number, number]>(
"plugin:sql|execute",
{
db: this.path,
query,
values: bindValues ?? [],
},
);
return {
lastInsertId,
@ -142,7 +139,7 @@ export default class Database {
* ```
*/
async select<T>(query: string, bindValues?: unknown[]): Promise<T> {
const result = await window.__TAURI_INVOKE__<T>("plugin:sql|select", {
const result = await invoke<T>("plugin:sql|select", {
db: this.path,
query,
values: bindValues ?? [],
@ -163,7 +160,7 @@ export default class Database {
* @param db - Optionally state the name of a database if you are managing more than one. Otherwise, all database pools will be in scope.
*/
async close(db?: string): Promise<boolean> {
const success = await window.__TAURI_INVOKE__<boolean>("plugin:sql|close", {
const success = await invoke<boolean>("plugin:sql|close", {
db,
});
return success;

@ -28,6 +28,6 @@
"tslib": "2.6.0"
},
"dependencies": {
"@tauri-apps/api": "2.0.0-alpha.8"
"@tauri-apps/api": "2.0.0-alpha.9"
}
}

@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_SQL__=function(){"use strict";class _{constructor(_){this.path=_}static async load(t){const e=await window.__TAURI_INVOKE__("plugin:sql|load",{db:t});return new _(e)}static get(t){return new _(t)}async execute(_,t){const[e,n]=await window.__TAURI_INVOKE__("plugin:sql|execute",{db:this.path,query:_,values:null!=t?t:[]});return{lastInsertId:n,rowsAffected:e}}async select(_,t){return await window.__TAURI_INVOKE__("plugin:sql|select",{db:this.path,query:_,values:null!=t?t:[]})}async close(_){return await window.__TAURI_INVOKE__("plugin:sql|close",{db:_})}}return _}();Object.defineProperty(window.__TAURI__,"sql",{value:__TAURI_SQL__})}
if("__TAURI__"in window){var __TAURI_SQL__=function(){"use strict";var e=Object.defineProperty,t=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},n=(e,n,r)=>(t(e,n,"read from private field"),r?r.call(e):n.get(e));function r(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}((t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})})({},{Channel:()=>a,PluginListener:()=>i,addPluginListener:()=>l,convertFileSrc:()=>o,invoke:()=>c,transformCallback:()=>r});var s,a=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)})(this,s,(()=>{})),this.id=r((e=>{n(this,s).call(this,e)}))}set onmessage(e){var n,r,a,i;a=e,t(n=this,r=s,"write to private field"),i?i.call(n,a):r.set(n,a)}get onmessage(){return n(this,s)}toJSON(){return`__CHANNEL__:${this.id}`}};s=new WeakMap;var i=class{constructor(e,t,n){this.plugin=e,this.event=t,this.channelId=n}async unregister(){return c(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function l(e,t,n){let r=new a;return r.onmessage=n,c(`plugin:${e}|register_listener`,{event:t,handler:r}).then((()=>new i(e,t,r.id)))}async function c(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}function o(e,t="asset"){return window.__TAURI_INTERNALS__.convertFileSrc(e,t)}class _{constructor(e){this.path=e}static async load(e){const t=await c("plugin:sql|load",{db:e});return new _(t)}static get(e){return new _(e)}async execute(e,t){const[n,r]=await c("plugin:sql|execute",{db:this.path,query:e,values:null!=t?t:[]});return{lastInsertId:r,rowsAffected:n}}async select(e,t){return await c("plugin:sql|select",{db:this.path,query:e,values:null!=t?t:[]})}async close(e){return await c("plugin:sql|close",{db:e})}}return _}();Object.defineProperty(window.__TAURI__,"sql",{value:__TAURI_SQL__})}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save