mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-05 12:25:10 +02:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 395ff65547 | |||
| ad3028646c | |||
| 0d0ed7b907 | |||
| 92233ea64a | |||
| 36b7296746 | |||
| d9b2331237 | |||
| 8916544034 | |||
| 3d4697b34a | |||
| 9174b808dc | |||
| a305ad3ddb | |||
| 7b9d7a1d88 | |||
| c4d2c8c693 | |||
| be2a90b7e2 | |||
| 417c85a2dd | |||
| 617cf38069 | |||
| 6ad221ed36 | |||
| 0984fc8374 | |||
| 523bcdc528 | |||
| ea63b40224 |
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"stronghold-js": minor
|
||||
---
|
||||
|
||||
Added `Stronghold.load` and removed its constructor.
|
||||
@@ -45,6 +45,8 @@ jobs:
|
||||
- name: build
|
||||
run: cargo build --workspace --exclude 'tauri-plugin-sql' --all-targets --all-features
|
||||
|
||||
- uses: dtolnay/rust-toolchain@1.65.0
|
||||
|
||||
- name: build sql:sqlite
|
||||
run: cargo build --package 'tauri-plugin-sql' --all-targets --features sqlite
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ https.get(url, options, (response) => {
|
||||
console.log(versions.length ? versions[0].num : "0.0.0");
|
||||
} else if (kind === "npm") {
|
||||
const versions = Object.keys(data.versions).filter((v) =>
|
||||
v.startsWith(target)
|
||||
v.startsWith(target),
|
||||
);
|
||||
console.log(versions[versions.length - 1] || "0.0.0");
|
||||
}
|
||||
|
||||
Generated
+297
-186
@@ -54,6 +54,18 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"getrandom 0.2.8",
|
||||
"once_cell",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.7.20"
|
||||
@@ -128,7 +140,7 @@ checksum = "1b19760fa2b7301cf235360ffd6d3558b1ed4249edd16d6cca8d690cee265b95"
|
||||
dependencies = [
|
||||
"event-listener",
|
||||
"futures-core",
|
||||
"parking_lot 0.12.1",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -229,9 +241,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "atoi"
|
||||
version = "1.0.0"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e"
|
||||
checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
@@ -325,6 +337,9 @@ name = "bitflags"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4f6e5df9abedba5099a01a6567c6086a6fbcff57af07c360d356737f9e0c644"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blake2"
|
||||
@@ -649,9 +664,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "const-oid"
|
||||
version = "0.7.1"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3"
|
||||
checksum = "6340df57935414636969091153f35f68d9f00bbc8fb4a9c6054706c213e6c6bc"
|
||||
|
||||
[[package]]
|
||||
name = "constant_time_eq"
|
||||
@@ -768,16 +783,6 @@ dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
@@ -940,13 +945,13 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb"
|
||||
|
||||
[[package]]
|
||||
name = "der"
|
||||
version = "0.5.1"
|
||||
version = "0.7.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c"
|
||||
checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"crypto-bigint",
|
||||
"pem-rfc7468",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -999,6 +1004,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
|
||||
dependencies = [
|
||||
"block-buffer 0.10.3",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle",
|
||||
]
|
||||
@@ -1084,7 +1090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"hashbrown",
|
||||
"hashbrown 0.12.3",
|
||||
"hex",
|
||||
"rand_core 0.6.4",
|
||||
"sha2 0.9.9",
|
||||
@@ -1096,6 +1102,9 @@ name = "either"
|
||||
version = "1.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "embed_plist"
|
||||
@@ -1133,6 +1142,23 @@ dependencies = [
|
||||
"syn 1.0.107",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "equivalent"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1"
|
||||
|
||||
[[package]]
|
||||
name = "etcetera"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"home",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "event-listener"
|
||||
version = "2.5.3"
|
||||
@@ -1295,13 +1321,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-intrusive"
|
||||
version = "0.4.2"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5"
|
||||
checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"lock_api",
|
||||
"parking_lot 0.11.2",
|
||||
"parking_lot",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1676,7 +1702,7 @@ dependencies = [
|
||||
"futures-sink",
|
||||
"futures-util",
|
||||
"http",
|
||||
"indexmap",
|
||||
"indexmap 1.9.2",
|
||||
"slab",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
@@ -1689,16 +1715,22 @@ version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"ahash 0.7.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
|
||||
|
||||
[[package]]
|
||||
name = "hashlink"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa"
|
||||
dependencies = [
|
||||
"hashbrown",
|
||||
"hashbrown 0.12.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1761,6 +1793,15 @@ dependencies = [
|
||||
"digest 0.10.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "home"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
|
||||
dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "html5ever"
|
||||
version = "0.25.2"
|
||||
@@ -1940,7 +1981,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"hashbrown",
|
||||
"hashbrown 0.12.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown 0.14.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2009,9 +2060,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "iota-crypto"
|
||||
version = "0.20.0"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0180a2a7939b4b0ae68e651bbec130b27fd5882ef552df5bb55e0320e78bacbc"
|
||||
checksum = "51a639b688f37dcb85e741c5defcf0e341527f39288931cc22ad8e6fbc396ca7"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
@@ -2234,9 +2285,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libsqlite3-sys"
|
||||
version = "0.24.2"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14"
|
||||
checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"pkg-config",
|
||||
@@ -2560,17 +2611,6 @@ dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint-dig"
|
||||
version = "0.8.2"
|
||||
@@ -2802,17 +2842,6 @@ version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72"
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.11.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
||||
dependencies = [
|
||||
"instant",
|
||||
"lock_api",
|
||||
"parking_lot_core 0.8.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
version = "0.12.1"
|
||||
@@ -2820,21 +2849,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
|
||||
dependencies = [
|
||||
"lock_api",
|
||||
"parking_lot_core 0.9.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot_core"
|
||||
version = "0.8.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"instant",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"winapi",
|
||||
"parking_lot_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2867,9 +2882,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pem-rfc7468"
|
||||
version = "0.3.1"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30"
|
||||
checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
]
|
||||
@@ -3022,24 +3037,23 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
name = "pkcs1"
|
||||
version = "0.3.3"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320"
|
||||
checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
|
||||
dependencies = [
|
||||
"der",
|
||||
"pkcs8",
|
||||
"zeroize",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.8.0"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0"
|
||||
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
||||
dependencies = [
|
||||
"der",
|
||||
"spki",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3055,7 +3069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5329b8f106a176ab0dce4aae5da86bfcb139bb74fb00882859e03745011f3635"
|
||||
dependencies = [
|
||||
"base64 0.13.1",
|
||||
"indexmap",
|
||||
"indexmap 1.9.2",
|
||||
"line-wrap",
|
||||
"quick-xml",
|
||||
"serde",
|
||||
@@ -3408,11 +3422,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rsa"
|
||||
version = "0.6.1"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b"
|
||||
checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"const-oid",
|
||||
"digest 0.10.6",
|
||||
"num-bigint-dig",
|
||||
"num-integer",
|
||||
@@ -3421,7 +3436,8 @@ dependencies = [
|
||||
"pkcs1",
|
||||
"pkcs8",
|
||||
"rand_core 0.6.4",
|
||||
"smallvec",
|
||||
"signature",
|
||||
"spki",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
@@ -3464,14 +3480,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.20.8"
|
||||
version = "0.21.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
|
||||
checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-webpki",
|
||||
"sct",
|
||||
"webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3483,6 +3498,16 @@ dependencies = [
|
||||
"base64 0.21.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.100.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.11"
|
||||
@@ -3781,6 +3806,16 @@ dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500"
|
||||
dependencies = [
|
||||
"digest 0.10.6",
|
||||
"rand_core 0.6.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "0.3.10"
|
||||
@@ -3857,9 +3892,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "spki"
|
||||
version = "0.5.4"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27"
|
||||
checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der",
|
||||
@@ -3878,106 +3913,206 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "sqlx"
|
||||
version = "0.6.2"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428"
|
||||
checksum = "91ef53c86d2066e04f0ac6b1364f16d13d82388e2d07f11a5c71782345555761"
|
||||
dependencies = [
|
||||
"sqlx-core",
|
||||
"sqlx-macros",
|
||||
"sqlx-mysql",
|
||||
"sqlx-postgres",
|
||||
"sqlx-sqlite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-core"
|
||||
version = "0.6.2"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105"
|
||||
checksum = "8a22fd81e9c1ad53c562edb869ff042b215d4eadefefc4784bacfbfd19835945"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"ahash 0.8.3",
|
||||
"atoi",
|
||||
"base64 0.13.1",
|
||||
"bitflags 1.3.2",
|
||||
"byteorder",
|
||||
"bytes 1.4.0",
|
||||
"crc",
|
||||
"crossbeam-queue",
|
||||
"digest 0.10.6",
|
||||
"dirs",
|
||||
"dotenvy",
|
||||
"either",
|
||||
"event-listener",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-intrusive",
|
||||
"futures-io",
|
||||
"futures-util",
|
||||
"hashlink",
|
||||
"hex",
|
||||
"indexmap 2.0.0",
|
||||
"log",
|
||||
"memchr",
|
||||
"once_cell",
|
||||
"paste",
|
||||
"percent-encoding",
|
||||
"rustls",
|
||||
"rustls-pemfile",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.6",
|
||||
"smallvec",
|
||||
"sqlformat",
|
||||
"thiserror",
|
||||
"time 0.3.20",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tracing",
|
||||
"url",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-macros"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "00bb7c096a202b8164c175614cbfb79fe0e1e0a3d50e0374526183ef2974e4a2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"sqlx-core",
|
||||
"sqlx-macros-core",
|
||||
"syn 1.0.107",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-macros-core"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37d644623ab9699014e5b3cb61a040d16caa50fd477008f63f1399ae35498a58"
|
||||
dependencies = [
|
||||
"dotenvy",
|
||||
"either",
|
||||
"heck 0.4.0",
|
||||
"hex",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.6",
|
||||
"sqlx-core",
|
||||
"sqlx-mysql",
|
||||
"sqlx-postgres",
|
||||
"sqlx-sqlite",
|
||||
"syn 1.0.107",
|
||||
"tempfile",
|
||||
"tokio",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-mysql"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8264c59b28b6858796acfcedc660aa4c9075cc6e4ec8eb03cdca2a3e725726db"
|
||||
dependencies = [
|
||||
"atoi",
|
||||
"base64 0.21.0",
|
||||
"bitflags 2.0.0",
|
||||
"byteorder",
|
||||
"bytes 1.4.0",
|
||||
"crc",
|
||||
"digest 0.10.6",
|
||||
"dotenvy",
|
||||
"either",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
"futures-util",
|
||||
"generic-array",
|
||||
"hex",
|
||||
"hkdf",
|
||||
"hmac",
|
||||
"itoa 1.0.5",
|
||||
"log",
|
||||
"md-5",
|
||||
"memchr",
|
||||
"once_cell",
|
||||
"percent-encoding",
|
||||
"rand 0.8.5",
|
||||
"rsa",
|
||||
"serde",
|
||||
"sha1",
|
||||
"sha2 0.10.6",
|
||||
"smallvec",
|
||||
"sqlx-core",
|
||||
"stringprep",
|
||||
"thiserror",
|
||||
"time 0.3.20",
|
||||
"tracing",
|
||||
"whoami",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-postgres"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1cab6147b81ca9213a7578f1b4c9d24c449a53953cd2222a7b5d7cd29a5c3139"
|
||||
dependencies = [
|
||||
"atoi",
|
||||
"base64 0.21.0",
|
||||
"bitflags 2.0.0",
|
||||
"byteorder",
|
||||
"crc",
|
||||
"dotenvy",
|
||||
"etcetera",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
"futures-util",
|
||||
"hex",
|
||||
"hkdf",
|
||||
"hmac",
|
||||
"home",
|
||||
"itoa 1.0.5",
|
||||
"log",
|
||||
"md-5",
|
||||
"memchr",
|
||||
"once_cell",
|
||||
"rand 0.8.5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha1",
|
||||
"sha2 0.10.6",
|
||||
"smallvec",
|
||||
"sqlx-core",
|
||||
"stringprep",
|
||||
"thiserror",
|
||||
"time 0.3.20",
|
||||
"tracing",
|
||||
"whoami",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-sqlite"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "59fba60afa64718104b71eec6984f8779d4caffff3b30cde91a75843c7efc126"
|
||||
dependencies = [
|
||||
"atoi",
|
||||
"flume",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-executor",
|
||||
"futures-intrusive",
|
||||
"futures-util",
|
||||
"generic-array",
|
||||
"hashlink",
|
||||
"hex",
|
||||
"hkdf",
|
||||
"hmac",
|
||||
"indexmap",
|
||||
"itoa 1.0.5",
|
||||
"libc",
|
||||
"libsqlite3-sys",
|
||||
"log",
|
||||
"md-5",
|
||||
"memchr",
|
||||
"num-bigint",
|
||||
"once_cell",
|
||||
"paste",
|
||||
"percent-encoding",
|
||||
"rand 0.8.5",
|
||||
"rsa",
|
||||
"rustls",
|
||||
"rustls-pemfile",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha1",
|
||||
"sha2 0.10.6",
|
||||
"smallvec",
|
||||
"sqlformat",
|
||||
"sqlx-rt",
|
||||
"stringprep",
|
||||
"thiserror",
|
||||
"time 0.3.20",
|
||||
"tokio-stream",
|
||||
"url",
|
||||
"webpki-roots",
|
||||
"whoami",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-macros"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9"
|
||||
dependencies = [
|
||||
"dotenvy",
|
||||
"either",
|
||||
"heck 0.4.0",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde_json",
|
||||
"sha2 0.10.6",
|
||||
"sqlx-core",
|
||||
"sqlx-rt",
|
||||
"syn 1.0.107",
|
||||
"time 0.3.20",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sqlx-rt"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stable_deref_trait"
|
||||
version = "1.2.0"
|
||||
@@ -4007,7 +4142,7 @@ checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08"
|
||||
dependencies = [
|
||||
"new_debug_unreachable",
|
||||
"once_cell",
|
||||
"parking_lot 0.12.1",
|
||||
"parking_lot",
|
||||
"phf_shared 0.10.0",
|
||||
"precomputed-hash",
|
||||
"serde",
|
||||
@@ -4200,7 +4335,7 @@ dependencies = [
|
||||
"ndk-sys",
|
||||
"objc",
|
||||
"once_cell",
|
||||
"parking_lot 0.12.1",
|
||||
"parking_lot",
|
||||
"paste",
|
||||
"png",
|
||||
"raw-window-handle",
|
||||
@@ -4392,7 +4527,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-persisted-scope"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
dependencies = [
|
||||
"aho-corasick 1.0.1",
|
||||
"bincode",
|
||||
@@ -4459,7 +4594,7 @@ name = "tauri-plugin-stronghold"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"iota-crypto 0.20.0",
|
||||
"iota-crypto 0.21.0",
|
||||
"iota_stronghold",
|
||||
"log",
|
||||
"rand 0.8.5",
|
||||
@@ -4746,17 +4881,6 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.23.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
|
||||
dependencies = [
|
||||
"rustls",
|
||||
"tokio",
|
||||
"webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-stream"
|
||||
version = "0.1.11"
|
||||
@@ -4817,7 +4941,7 @@ version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"indexmap 1.9.2",
|
||||
"nom8",
|
||||
"toml_datetime",
|
||||
]
|
||||
@@ -4835,6 +4959,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
@@ -5294,23 +5419,13 @@ dependencies = [
|
||||
"system-deps 6.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.22.6"
|
||||
version = "0.23.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87"
|
||||
checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338"
|
||||
dependencies = [
|
||||
"webpki",
|
||||
"rustls-webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5365,10 +5480,6 @@ name = "whoami"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "45dbc71f0cdca27dc261a9bd37ddec174e4a0af2b900b890f378460f745426e3"
|
||||
dependencies = [
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
|
||||
+5
-2
@@ -17,15 +17,18 @@
|
||||
"@typescript-eslint/parser": "^5.58.0",
|
||||
"eslint": "^8.38.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-config-standard-with-typescript": "^35.0.0",
|
||||
"eslint-config-standard-with-typescript": "^36.0.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-n": "^16.0.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-security": "^1.7.1",
|
||||
"prettier": "^2.8.7",
|
||||
"prettier": "^3.0.0",
|
||||
"rollup": "^3.20.4",
|
||||
"typescript": "^5.0.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"semver": ">=7.5.2"
|
||||
},
|
||||
"engines": {
|
||||
"pnpm": ">=7.33.0"
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-authenticator
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-authenticator#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-authenticator
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-authenticator#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-authenticator
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-authenticator#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -76,7 +76,7 @@ const r2 = await auth.verifyRegistration(
|
||||
challenge,
|
||||
app,
|
||||
registerResult.registerData,
|
||||
registerResult.clientData
|
||||
registerResult.clientData,
|
||||
);
|
||||
const j2 = JSON.parse(r2);
|
||||
|
||||
@@ -91,7 +91,7 @@ const counter = await auth.verifySignature(
|
||||
signData.signData,
|
||||
clientData,
|
||||
keyHandle,
|
||||
pubkey
|
||||
pubkey,
|
||||
);
|
||||
|
||||
if (counter && counter > 0) {
|
||||
|
||||
@@ -17,7 +17,7 @@ export class Authenticator {
|
||||
challenge: string,
|
||||
application: string,
|
||||
registerData: string,
|
||||
clientData: string
|
||||
clientData: string,
|
||||
): Promise<string> {
|
||||
return await invoke("plugin:authenticator|verify_registration", {
|
||||
challenge,
|
||||
@@ -30,7 +30,7 @@ export class Authenticator {
|
||||
async sign(
|
||||
challenge: string,
|
||||
application: string,
|
||||
keyHandle: string
|
||||
keyHandle: string,
|
||||
): Promise<string> {
|
||||
return await invoke("plugin:authenticator|sign", {
|
||||
timeout: 10000,
|
||||
@@ -46,7 +46,7 @@ export class Authenticator {
|
||||
signData: string,
|
||||
clientData: string,
|
||||
keyHandle: string,
|
||||
pubkey: string
|
||||
pubkey: string,
|
||||
): Promise<number> {
|
||||
return await invoke("plugin:authenticator|verify_signature", {
|
||||
challenge,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-autostart
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-autostart#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-autostart
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-autostart#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-autostart
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-autostart#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-fs-extra
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-fs-extra#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-fs-extra
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-fs-extra#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-fs-extra
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-fs-extra#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-fs-watch
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-fs-watch#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-fs-watch
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-fs-watch#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-fs-watch
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-fs-watch#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -57,17 +57,17 @@ import { watch, watchImmediate } from "tauri-plugin-fs-watch-api";
|
||||
const stopWatching = await watch(
|
||||
"/path/to/something",
|
||||
(event) => {
|
||||
const { type, payload } = event;
|
||||
const { kind, path } = event;
|
||||
},
|
||||
{ recursive: true }
|
||||
{ recursive: true },
|
||||
);
|
||||
|
||||
const stopRawWatcher = await watchImmediate(
|
||||
["/path/a", "/path/b"],
|
||||
(event) => {
|
||||
const { path, operation, cookie } = event;
|
||||
const { type, paths, attrs } = event;
|
||||
},
|
||||
{}
|
||||
{},
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ async function unwatch(id: number): Promise<void> {
|
||||
export async function watch(
|
||||
paths: string | string[],
|
||||
cb: (event: DebouncedEvent) => void,
|
||||
options: DebouncedWatchOptions = {}
|
||||
options: DebouncedWatchOptions = {},
|
||||
): Promise<UnlistenFn> {
|
||||
const opts = {
|
||||
recursive: false,
|
||||
@@ -71,7 +71,7 @@ export async function watch(
|
||||
`watcher://debounced-event/${id}`,
|
||||
(event) => {
|
||||
cb(event.payload);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
@@ -83,7 +83,7 @@ export async function watch(
|
||||
export async function watchImmediate(
|
||||
paths: string | string[],
|
||||
cb: (event: RawEvent) => void,
|
||||
options: WatchOptions = {}
|
||||
options: WatchOptions = {},
|
||||
): Promise<UnlistenFn> {
|
||||
const opts = {
|
||||
recursive: false,
|
||||
@@ -109,7 +109,7 @@ export async function watchImmediate(
|
||||
`watcher://raw-event/${id}`,
|
||||
(event) => {
|
||||
cb(event.payload);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-log
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-log#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-log
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-log#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-log
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-log#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -43,7 +43,7 @@ enum LogLevel {
|
||||
async function log(
|
||||
level: LogLevel,
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
const traces = new Error().stack?.split("\n").map((line) => line.split("@"));
|
||||
|
||||
@@ -86,7 +86,7 @@ async function log(
|
||||
*/
|
||||
export async function error(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Error, message, options);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ export async function error(
|
||||
*/
|
||||
export async function warn(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Warn, message, options);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ export async function warn(
|
||||
*/
|
||||
export async function info(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Info, message, options);
|
||||
}
|
||||
@@ -152,7 +152,7 @@ export async function info(
|
||||
*/
|
||||
export async function debug(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Debug, message, options);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ export async function debug(
|
||||
*/
|
||||
export async function trace(
|
||||
message: string,
|
||||
options?: LogOptions
|
||||
options?: LogOptions,
|
||||
): Promise<void> {
|
||||
await log(LogLevel.Trace, message, options);
|
||||
}
|
||||
@@ -193,7 +193,7 @@ export async function attachConsole(): Promise<UnlistenFn> {
|
||||
// TODO: Investigate security/detect-unsafe-regex
|
||||
// eslint-disable-next-line no-control-regex, security/detect-unsafe-regex
|
||||
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
|
||||
""
|
||||
"",
|
||||
);
|
||||
|
||||
switch (payload.level) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## \[0.1.3]
|
||||
|
||||
- Split up fs and asset scopes. **This will reset the asset protocol scope once!**
|
||||
- [ad30286](https://github.com/tauri-apps/plugins-workspace/commit/ad3028646c96ed213a2f483823ffdc3c17b5fc1e) fix(persisted-scope): separately save asset protocol patterns ([#459](https://github.com/tauri-apps/plugins-workspace/pull/459)) on 2023-07-10
|
||||
|
||||
## \[0.1.2]
|
||||
|
||||
- Fix usage of directory patterns by removing glob asterisks at the end before allowing/forbidding them. This was causing them to be escaped, and so undesirable paths were allowed/forbidden while polluting the `.persisted_scope` file.
|
||||
- [9174b80](https://github.com/tauri-apps/plugins-workspace/commit/9174b808dc37154999c119fcc3f31258a9c5a3fb) \[persisted scope] fix: handle recursive directory correctly ([#455](https://github.com/tauri-apps/plugins-workspace/pull/455)) on 2023-06-29
|
||||
|
||||
## \[0.1.1]
|
||||
|
||||
- The MSRV was raised to 1.64!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tauri-plugin-persisted-scope"
|
||||
version = "0.1.1"
|
||||
version = "0.1.3"
|
||||
description = "Save filesystem and asset scopes and restore them when the app is reopened."
|
||||
authors.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
@@ -6,7 +6,7 @@ use aho_corasick::AhoCorasick;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
AppHandle, FsScopeEvent, Manager, Runtime,
|
||||
FsScope, FsScopeEvent, Manager, Runtime,
|
||||
};
|
||||
|
||||
use std::{
|
||||
@@ -15,7 +15,10 @@ use std::{
|
||||
path::Path,
|
||||
};
|
||||
|
||||
// Using 2 separate files so that we don't have to think about write conflicts and not break backwards compat.
|
||||
const SCOPE_STATE_FILENAME: &str = ".persisted-scope";
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
const ASSET_SCOPE_STATE_FILENAME: &str = ".persisted-scope-asset";
|
||||
|
||||
// Most of these patterns are just added to try to fix broken files in the wild.
|
||||
// After a while we can hopefully reduce it to something like [r"[?]", r"[*]", r"\\?\\\?\"]
|
||||
@@ -42,6 +45,14 @@ enum Error {
|
||||
Bincode(#[from] Box<bincode::ErrorKind>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Deserialize, Serialize, Eq, PartialEq, Hash)]
|
||||
enum TargetType {
|
||||
#[default]
|
||||
File,
|
||||
Directory,
|
||||
RecursiveDirectory,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Deserialize, Serialize)]
|
||||
struct Scope {
|
||||
allowed_paths: Vec<String>,
|
||||
@@ -58,16 +69,74 @@ fn fix_pattern(ac: &AhoCorasick, s: &str) -> String {
|
||||
s
|
||||
}
|
||||
|
||||
fn save_scopes<R: Runtime>(app: &AppHandle<R>, app_dir: &Path, scope_state_path: &Path) {
|
||||
let fs_scope = app.fs_scope();
|
||||
const RESURSIVE_DIRECTORY_SUFFIX: &str = "**";
|
||||
const DIRECTORY_SUFFIX: &str = "*";
|
||||
|
||||
fn detect_scope_type(scope_state_path: &str) -> TargetType {
|
||||
if scope_state_path.ends_with(RESURSIVE_DIRECTORY_SUFFIX) {
|
||||
TargetType::RecursiveDirectory
|
||||
} else if scope_state_path.ends_with(DIRECTORY_SUFFIX) {
|
||||
TargetType::Directory
|
||||
} else {
|
||||
TargetType::File
|
||||
}
|
||||
}
|
||||
|
||||
fn fix_directory(path_str: &str) -> &Path {
|
||||
let mut path = Path::new(path_str);
|
||||
|
||||
if path.ends_with(DIRECTORY_SUFFIX) || path.ends_with(RESURSIVE_DIRECTORY_SUFFIX) {
|
||||
path = match path.parent() {
|
||||
Some(value) => value,
|
||||
None => return path,
|
||||
};
|
||||
}
|
||||
|
||||
path
|
||||
}
|
||||
|
||||
fn allow_path(scope: &FsScope, path: &str) {
|
||||
let target_type = detect_scope_type(path);
|
||||
|
||||
match target_type {
|
||||
TargetType::File => {
|
||||
let _ = scope.allow_file(path);
|
||||
}
|
||||
TargetType::Directory => {
|
||||
// We remove the '*' at the end of it, else it will be escaped by the pattern.
|
||||
let _ = scope.allow_directory(fix_directory(path), false);
|
||||
}
|
||||
TargetType::RecursiveDirectory => {
|
||||
// We remove the '**' at the end of it, else it will be escaped by the pattern.
|
||||
let _ = scope.allow_directory(fix_directory(path), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn forbid_path(scope: &FsScope, path: &str) {
|
||||
let target_type = detect_scope_type(path);
|
||||
|
||||
match target_type {
|
||||
TargetType::File => {
|
||||
let _ = scope.forbid_file(path);
|
||||
}
|
||||
TargetType::Directory => {
|
||||
let _ = scope.forbid_directory(fix_directory(path), false);
|
||||
}
|
||||
TargetType::RecursiveDirectory => {
|
||||
let _ = scope.forbid_directory(fix_directory(path), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn save_scopes(scope: &FsScope, app_dir: &Path, scope_state_path: &Path) {
|
||||
let scope = Scope {
|
||||
allowed_paths: fs_scope
|
||||
allowed_paths: scope
|
||||
.allowed_patterns()
|
||||
.into_iter()
|
||||
.map(|p| p.to_string())
|
||||
.collect(),
|
||||
forbidden_patterns: fs_scope
|
||||
forbidden_patterns: scope
|
||||
.forbidden_patterns()
|
||||
.into_iter()
|
||||
.map(|p| p.to_string())
|
||||
@@ -93,46 +162,74 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
let app_dir = app.path_resolver().app_data_dir();
|
||||
|
||||
if let Some(app_dir) = app_dir {
|
||||
let scope_state_path = app_dir.join(SCOPE_STATE_FILENAME);
|
||||
|
||||
let _ = fs_scope.forbid_file(&scope_state_path);
|
||||
let fs_scope_state_path = app_dir.join(SCOPE_STATE_FILENAME);
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let _ = asset_protocol_scope.forbid_file(&scope_state_path);
|
||||
let asset_scope_state_path = app_dir.join(ASSET_SCOPE_STATE_FILENAME);
|
||||
|
||||
let _ = fs_scope.forbid_file(&fs_scope_state_path);
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let _ = asset_protocol_scope.forbid_file(&asset_scope_state_path);
|
||||
|
||||
// We're trying to fix broken .persisted-scope files seamlessly, so we'll be running this on the values read on the saved file.
|
||||
// We will still save some semi-broken values because the scope events are quite spammy and we don't want to reduce runtime performance any further.
|
||||
let ac = AhoCorasick::new(PATTERNS).unwrap(/* This should be impossible to fail since we're using a small static input */);
|
||||
|
||||
if scope_state_path.exists() {
|
||||
let scope: Scope = tauri::api::file::read_binary(&scope_state_path)
|
||||
if fs_scope_state_path.exists() {
|
||||
let scope: Scope = tauri::api::file::read_binary(&fs_scope_state_path)
|
||||
.map_err(Error::from)
|
||||
.and_then(|scope| bincode::deserialize(&scope).map_err(Into::into))
|
||||
.unwrap_or_default();
|
||||
|
||||
for allowed in &scope.allowed_paths {
|
||||
let allowed = fix_pattern(&ac, allowed);
|
||||
|
||||
let _ = fs_scope.allow_file(&allowed);
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let _ = asset_protocol_scope.allow_file(&allowed);
|
||||
allow_path(&fs_scope, &allowed);
|
||||
}
|
||||
for forbidden in &scope.forbidden_patterns {
|
||||
let forbidden = fix_pattern(&ac, forbidden);
|
||||
|
||||
let _ = fs_scope.forbid_file(&forbidden);
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let _ = asset_protocol_scope.forbid_file(&forbidden);
|
||||
forbid_path(&fs_scope, &forbidden);
|
||||
}
|
||||
|
||||
// Manually save the fixed scopes to disk once.
|
||||
// This is needed to fix broken .peristed-scope files in case the app doesn't update the scope itself.
|
||||
save_scopes(&app, &app_dir, &scope_state_path);
|
||||
save_scopes(&fs_scope, &app_dir, &fs_scope_state_path);
|
||||
}
|
||||
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
if asset_scope_state_path.exists() {
|
||||
let scope: Scope = tauri::api::file::read_binary(&asset_scope_state_path)
|
||||
.map_err(Error::from)
|
||||
.and_then(|scope| bincode::deserialize(&scope).map_err(Into::into))
|
||||
.unwrap_or_default();
|
||||
|
||||
for allowed in &scope.allowed_paths {
|
||||
let allowed = fix_pattern(&ac, allowed);
|
||||
allow_path(&asset_protocol_scope, &allowed);
|
||||
}
|
||||
for forbidden in &scope.forbidden_patterns {
|
||||
let forbidden = fix_pattern(&ac, forbidden);
|
||||
forbid_path(&asset_protocol_scope, &forbidden);
|
||||
}
|
||||
|
||||
// Manually save the fixed scopes to disk once.
|
||||
save_scopes(&asset_protocol_scope, &app_dir, &asset_scope_state_path);
|
||||
}
|
||||
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
let app_dir_ = app_dir.clone();
|
||||
let fs_scope_ = fs_scope.clone();
|
||||
fs_scope.listen(move |event| {
|
||||
if let FsScopeEvent::PathAllowed(_) = event {
|
||||
save_scopes(&app, &app_dir, &scope_state_path);
|
||||
save_scopes(&fs_scope_, &app_dir, &fs_scope_state_path);
|
||||
}
|
||||
});
|
||||
#[cfg(feature = "protocol-asset")]
|
||||
{
|
||||
let asset_protocol_scope_ = asset_protocol_scope.clone();
|
||||
asset_protocol_scope.listen(move |event| {
|
||||
if let FsScopeEvent::PathAllowed(_) = event {
|
||||
save_scopes(&asset_protocol_scope_, &app_dir_, &asset_scope_state_path);
|
||||
}
|
||||
});}
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
|
||||
@@ -40,11 +40,11 @@ yarn add tauri-plugin-positioner-api
|
||||
Or through git:
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-positioner
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-positioner#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-positioner
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-positioner#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-positioner
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-positioner#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -5,7 +5,8 @@ description = "Interface with SQL databases."
|
||||
authors.workspace = true
|
||||
license.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
#rust-version.workspace = true
|
||||
rust-version = "1.65"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -16,11 +17,11 @@ tauri.workspace = true
|
||||
log.workspace = true
|
||||
thiserror.workspace = true
|
||||
futures-core = "0.3"
|
||||
sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "json", "time"] }
|
||||
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "json", "time"] }
|
||||
time = "0.3"
|
||||
tokio = { version = "1", features = ["sync"] }
|
||||
|
||||
[features]
|
||||
sqlite = ["sqlx/sqlite"]
|
||||
mysql = ["sqlx/mysql"]
|
||||
postgres = ["sqlx/postgres"]
|
||||
postgres = ["sqlx/postgres"]
|
||||
|
||||
@@ -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.64**_
|
||||
_This plugin requires a Rust version of at least **1.65**_
|
||||
|
||||
There are three general methods of installation that we can recommend.
|
||||
|
||||
@@ -28,11 +28,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-sql
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-sql#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-sql
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-sql#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-sql
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-sql#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class Database {
|
||||
db: this.path,
|
||||
query,
|
||||
values: bindValues ?? [],
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-store
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-store#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-store
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-store#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-store
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-store#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -177,7 +177,7 @@ export class Store {
|
||||
*/
|
||||
async onKeyChange<T>(
|
||||
key: string,
|
||||
cb: (value: T | null) => void
|
||||
cb: (value: T | null) => void,
|
||||
): Promise<UnlistenFn> {
|
||||
return await listen<ChangePayload<T>>("store://change", (event) => {
|
||||
if (event.payload.path === this.path && event.payload.key === key) {
|
||||
@@ -192,7 +192,7 @@ export class Store {
|
||||
* @returns A promise resolving to a function to unlisten to the event.
|
||||
*/
|
||||
async onChange<T>(
|
||||
cb: (key: string, value: T | null) => void
|
||||
cb: (key: string, value: T | null) => void,
|
||||
): Promise<UnlistenFn> {
|
||||
return await listen<ChangePayload<T>>("store://change", (event) => {
|
||||
if (event.payload.path === this.path) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ tauri.workspace = true
|
||||
log.workspace = true
|
||||
thiserror.workspace = true
|
||||
iota_stronghold = "1"
|
||||
iota-crypto = "0.20"
|
||||
iota-crypto = "0.21"
|
||||
hex = "0.4"
|
||||
zeroize = { version = "1", features = ["zeroize_derive"] }
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-stronghold
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-stronghold#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-stronghold
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-stronghold#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-stronghold
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-stronghold#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -23,7 +23,7 @@ export type StoreKey =
|
||||
| ArrayBuffer;
|
||||
|
||||
function toBytesDto(
|
||||
v: ClientPath | VaultPath | RecordPath | StoreKey
|
||||
v: ClientPath | VaultPath | RecordPath | StoreKey,
|
||||
): string | number[] {
|
||||
if (typeof v === "string") {
|
||||
return v;
|
||||
@@ -125,7 +125,7 @@ class ProcedureExecutor {
|
||||
*/
|
||||
async generateSLIP10Seed(
|
||||
outputLocation: Location,
|
||||
sizeBytes?: number
|
||||
sizeBytes?: number,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -152,7 +152,7 @@ class ProcedureExecutor {
|
||||
chain: number[],
|
||||
source: "Seed" | "Key",
|
||||
sourceLocation: Location,
|
||||
outputLocation: Location
|
||||
outputLocation: Location,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -181,7 +181,7 @@ class ProcedureExecutor {
|
||||
async recoverBIP39(
|
||||
mnemonic: string,
|
||||
outputLocation: Location,
|
||||
passphrase?: string
|
||||
passphrase?: string,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -205,7 +205,7 @@ class ProcedureExecutor {
|
||||
*/
|
||||
async generateBIP39(
|
||||
outputLocation: Location,
|
||||
passphrase?: string
|
||||
passphrase?: string,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -245,7 +245,7 @@ class ProcedureExecutor {
|
||||
*/
|
||||
async signEd25519(
|
||||
privateKeyLocation: Location,
|
||||
msg: string
|
||||
msg: string,
|
||||
): Promise<Uint8Array> {
|
||||
return await invoke<number[]>("plugin:stronghold|execute_procedure", {
|
||||
...this.procedureArgs,
|
||||
@@ -293,18 +293,24 @@ export class Store {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
async get(key: StoreKey): Promise<Uint8Array> {
|
||||
async get(key: StoreKey): Promise<Uint8Array | null> {
|
||||
return await invoke<number[]>("plugin:stronghold|get_store_record", {
|
||||
snapshotPath: this.path,
|
||||
client: this.client,
|
||||
key: toBytesDto(key),
|
||||
}).then((v) => Uint8Array.from(v));
|
||||
}).then((v) => {
|
||||
if (v) {
|
||||
return Uint8Array.from(v);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async insert(
|
||||
key: StoreKey,
|
||||
value: number[],
|
||||
lifetime?: Duration
|
||||
lifetime?: Duration,
|
||||
): Promise<void> {
|
||||
return await invoke("plugin:stronghold|save_store_record", {
|
||||
snapshotPath: this.path,
|
||||
@@ -322,7 +328,7 @@ export class Store {
|
||||
snapshotPath: this.path,
|
||||
client: this.client,
|
||||
key: toBytesDto(key),
|
||||
}
|
||||
},
|
||||
).then((v) => (v != null ? Uint8Array.from(v) : null));
|
||||
}
|
||||
}
|
||||
@@ -378,7 +384,7 @@ export class Vault extends ProcedureExecutor {
|
||||
snapshotPath: this.path,
|
||||
client: this.client,
|
||||
vault: this.name,
|
||||
location,
|
||||
recordPath: location.payload.record,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -27,11 +27,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-upload
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-upload#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-upload
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-upload#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-upload
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-upload#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -58,7 +58,7 @@ upload(
|
||||
"https://example.com/file-upload",
|
||||
"./path/to/my/file.txt",
|
||||
(progress, total) => console.log(`Uploaded ${progress} of ${total} bytes`), // a callback that will be called with the upload progress
|
||||
{ "Content-Type": "text/plain" } // optional headers to send with the request
|
||||
{ "Content-Type": "text/plain" }, // optional headers to send with the request
|
||||
);
|
||||
```
|
||||
|
||||
@@ -69,7 +69,7 @@ download(
|
||||
"https://example.com/file-download-link",
|
||||
"./path/to/save/my/file.txt",
|
||||
(progress, total) => console.log(`Downloaded ${progress} of ${total} bytes`), // a callback that will be called with the download progress
|
||||
{ "Content-Type": "text/plain" } // optional headers to send with the request
|
||||
{ "Content-Type": "text/plain" }, // optional headers to send with the request
|
||||
);
|
||||
```
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ async function upload(
|
||||
url: string,
|
||||
filePath: string,
|
||||
progressHandler?: ProgressHandler,
|
||||
headers?: Map<string, string>
|
||||
headers?: Map<string, string>,
|
||||
): Promise<void> {
|
||||
const ids = new Uint32Array(1);
|
||||
window.crypto.getRandomValues(ids);
|
||||
@@ -59,7 +59,7 @@ async function download(
|
||||
url: string,
|
||||
filePath: string,
|
||||
progressHandler?: ProgressHandler,
|
||||
headers?: Map<string, string>
|
||||
headers?: Map<string, string>,
|
||||
): Promise<void> {
|
||||
const ids = new Uint32Array(1);
|
||||
window.crypto.getRandomValues(ids);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-websocket
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-websocket#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-websocket
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-websocket#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-websocket
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-websocket#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -51,7 +51,7 @@ fn main() {
|
||||
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
|
||||
|
||||
```javascript
|
||||
import { WebSocket } from "tauri-plugin-websocket-api";
|
||||
import WebSocket from "tauri-plugin-websocket-api";
|
||||
|
||||
const ws = await WebSocket.connect("wss://example.com");
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "^2.0.0",
|
||||
"@sveltejs/kit": "^1.15.5",
|
||||
"@tauri-apps/cli": "^1.2.3",
|
||||
"svelte": "^3.58.0",
|
||||
"svelte-check": "^3.2.0",
|
||||
"tslib": "^2.5.0",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.2.1"
|
||||
"@sveltejs/adapter-auto": "^2.1.0",
|
||||
"@sveltejs/kit": "^1.22.0",
|
||||
"@tauri-apps/cli": "^1.4.0",
|
||||
"svelte": "^4.0.4",
|
||||
"svelte-check": "^3.4.4",
|
||||
"tslib": "^2.6.0",
|
||||
"typescript": "^5.1.6",
|
||||
"vite": "^4.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tauri-plugin-websocket-api": "link:../../"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class WebSocket {
|
||||
m = { type: "Binary", data: message };
|
||||
} else {
|
||||
throw new Error(
|
||||
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array"
|
||||
"invalid `message` type, expected a `{ type: string, data: any }` object, a string or a numeric array",
|
||||
);
|
||||
}
|
||||
return await invoke("plugin:websocket|send", {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
```sh
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-window-state
|
||||
pnpm add https://github.com/tauri-apps/tauri-plugin-window-state#v1
|
||||
# or
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-window-state
|
||||
npm add https://github.com/tauri-apps/tauri-plugin-window-state#v1
|
||||
# or
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-window-state
|
||||
yarn add https://github.com/tauri-apps/tauri-plugin-window-state#v1
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -14,22 +14,25 @@ export enum StateFlags {
|
||||
/**
|
||||
* Save the state of all open windows to disk.
|
||||
*/
|
||||
async function saveWindowState(flags: StateFlags) {
|
||||
invoke("plugin:window-state|save_window_state", { flags });
|
||||
async function saveWindowState(flags: StateFlags): Promise<void> {
|
||||
return invoke("plugin:window-state|save_window_state", { flags });
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the state for the specified window from disk.
|
||||
*/
|
||||
async function restoreState(label: WindowLabel, flags: StateFlags) {
|
||||
invoke("plugin:window-state|restore_state", { label, flags });
|
||||
async function restoreState(
|
||||
label: WindowLabel,
|
||||
flags: StateFlags,
|
||||
): Promise<void> {
|
||||
return invoke("plugin:window-state|restore_state", { label, flags });
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore the state for the current window from disk.
|
||||
*/
|
||||
async function restoreStateCurrent(flags: StateFlags) {
|
||||
restoreState(getCurrent().label, flags);
|
||||
async function restoreStateCurrent(flags: StateFlags): Promise<void> {
|
||||
return restoreState(getCurrent().label, flags);
|
||||
}
|
||||
|
||||
export { restoreState, restoreStateCurrent, saveWindowState };
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ impl Default for StateFlags {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Deserialize, Serialize, PartialEq)]
|
||||
#[derive(Debug, Deserialize, Serialize, PartialEq)]
|
||||
struct WindowState {
|
||||
width: f64,
|
||||
height: f64,
|
||||
@@ -65,6 +65,21 @@ struct WindowState {
|
||||
fullscreen: bool,
|
||||
}
|
||||
|
||||
impl Default for WindowState {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
width: Default::default(),
|
||||
height: Default::default(),
|
||||
x: Default::default(),
|
||||
y: Default::default(),
|
||||
maximized: Default::default(),
|
||||
visible: true,
|
||||
decorated: true,
|
||||
fullscreen: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct WindowStateCache(Arc<Mutex<HashMap<String, WindowState>>>);
|
||||
pub trait AppHandleExt {
|
||||
/// Saves all open windows state to disk
|
||||
@@ -175,7 +190,7 @@ impl<R: Runtime> WindowExt for Window<R> {
|
||||
}
|
||||
|
||||
if flags.contains(StateFlags::DECORATIONS) {
|
||||
metadata.visible = self.is_visible()?;
|
||||
metadata.decorated = self.is_decorated()?;
|
||||
}
|
||||
|
||||
if flags.contains(StateFlags::FULLSCREEN) {
|
||||
|
||||
Generated
+408
-193
File diff suppressed because it is too large
Load Diff
@@ -25,6 +25,8 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
|
||||
|
||||
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
|
||||
|
||||
<!-- Add the branch for installations using git! -->
|
||||
|
||||
```sh
|
||||
pnpm add <!-- plugin here -->
|
||||
# or
|
||||
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user