From eb3495fb72b9ea33b6a425443a0aefc06de858e0 Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Wed, 14 Dec 2022 18:43:39 +0100 Subject: [PATCH] copy plugin sources --- .eslintignore | 3 + .eslintrc.json | 15 + .gitignore | 2 + .prettierignore | 3 + .vscode/settings.json | 3 + Cargo.lock | 5434 +++++++++++++++++ Cargo.toml | 15 + LICENSE | 21 - README.md | 1 - package.json | 27 + plugins/authenticator/Cargo.toml | 24 + .../authenticator/guest-js/dist/index.min.js | 45 + .../guest-js/dist/index.min.js.map | 1 + plugins/authenticator/guest-js/dist/index.mjs | 43 + .../authenticator/guest-js/dist/index.mjs.map | 1 + plugins/authenticator/guest-js/index.ts | 60 + plugins/authenticator/guest-js/package.json | 29 + .../authenticator/guest-js/rollup.config.mjs | 10 + plugins/authenticator/guest-js/tsconfig.json | 1 + plugins/authenticator/src/auth.rs | 217 + plugins/authenticator/src/error.rs | 22 + plugins/authenticator/src/lib.rs | 89 + plugins/authenticator/src/u2f.rs | 105 + plugins/autostart/Cargo.toml | 16 + plugins/autostart/guest-js/dist/index.min.js | 17 + .../autostart/guest-js/dist/index.min.js.map | 1 + plugins/autostart/guest-js/dist/index.mjs | 15 + plugins/autostart/guest-js/dist/index.mjs.map | 1 + plugins/autostart/guest-js/index.ts | 17 + plugins/autostart/guest-js/package.json | 29 + plugins/autostart/guest-js/rollup.config.mjs | 10 + plugins/autostart/guest-js/tsconfig.json | 1 + plugins/autostart/src/lib.rs | 131 + plugins/fs-extra/Cargo.toml | 15 + plugins/fs-extra/guest-js/dist/index.min.js | 24 + .../fs-extra/guest-js/dist/index.min.js.map | 1 + plugins/fs-extra/guest-js/dist/index.mjs | 22 + plugins/fs-extra/guest-js/dist/index.mjs.map | 1 + plugins/fs-extra/guest-js/index.ts | 130 + plugins/fs-extra/guest-js/package.json | 29 + plugins/fs-extra/guest-js/rollup.config.mjs | 10 + plugins/fs-extra/guest-js/tsconfig.json | 1 + plugins/fs-extra/src/lib.rs | 145 + plugins/fs-watch/Cargo.toml | 16 + plugins/fs-watch/guest-js/dist/index.min.js | 72 + .../fs-watch/guest-js/dist/index.min.js.map | 1 + plugins/fs-watch/guest-js/dist/index.mjs | 64 + plugins/fs-watch/guest-js/dist/index.mjs.map | 1 + plugins/fs-watch/guest-js/index.ts | 110 + plugins/fs-watch/guest-js/package.json | 29 + plugins/fs-watch/guest-js/rollup.config.mjs | 10 + plugins/fs-watch/guest-js/tsconfig.json | 1 + plugins/fs-watch/src/lib.rs | 189 + plugins/localhost/Cargo.toml | 17 + plugins/localhost/src/lib.rs | 118 + plugins/log/Cargo.toml | 18 + plugins/log/guest-js/dist/index.min.js | 176 + plugins/log/guest-js/dist/index.min.js.map | 1 + plugins/log/guest-js/dist/index.mjs | 171 + plugins/log/guest-js/dist/index.mjs.map | 1 + plugins/log/guest-js/index.ts | 206 + plugins/log/guest-js/package.json | 29 + plugins/log/guest-js/rollup.config.mjs | 10 + plugins/log/guest-js/tsconfig.json | 1 + plugins/log/src/lib.rs | 350 ++ plugins/persisted-scope/Cargo.toml | 19 + plugins/persisted-scope/src/lib.rs | 101 + plugins/positioner/Cargo.toml | 18 + plugins/positioner/guest-js/dist/index.min.js | 40 + .../positioner/guest-js/dist/index.min.js.map | 1 + plugins/positioner/guest-js/dist/index.mjs | 38 + .../positioner/guest-js/dist/index.mjs.map | 1 + plugins/positioner/guest-js/index.ts | 37 + plugins/positioner/guest-js/package.json | 29 + plugins/positioner/guest-js/rollup.config.mjs | 10 + plugins/positioner/guest-js/tsconfig.json | 1 + plugins/positioner/src/ext.rs | 182 + plugins/positioner/src/lib.rs | 71 + plugins/sql/Cargo.toml | 23 + plugins/sql/guest-js/dist/index.min.js | 119 + plugins/sql/guest-js/dist/index.min.js.map | 1 + plugins/sql/guest-js/dist/index.mjs | 117 + plugins/sql/guest-js/dist/index.mjs.map | 1 + plugins/sql/guest-js/index.ts | 140 + plugins/sql/guest-js/package.json | 29 + plugins/sql/guest-js/rollup.config.mjs | 10 + plugins/sql/guest-js/tsconfig.json | 1 + plugins/sql/src/lib.rs | 28 + plugins/sql/src/plugin.rs | 387 ++ plugins/store/Cargo.toml | 15 + plugins/store/guest-js/dist/index.min.js | 185 + plugins/store/guest-js/dist/index.min.js.map | 1 + plugins/store/guest-js/dist/index.mjs | 177 + plugins/store/guest-js/dist/index.mjs.map | 1 + plugins/store/guest-js/index.ts | 210 + plugins/store/guest-js/package.json | 29 + plugins/store/guest-js/rollup.config.mjs | 10 + plugins/store/guest-js/tsconfig.json | 1 + plugins/store/src/error.rs | 34 + plugins/store/src/lib.rs | 370 ++ plugins/store/src/store.rs | 212 + plugins/stronghold/Cargo.toml | 23 + plugins/stronghold/guest-js/dist/index.min.js | 217 + .../stronghold/guest-js/dist/index.min.js.map | 1 + plugins/stronghold/guest-js/dist/index.mjs | 215 + .../stronghold/guest-js/dist/index.mjs.map | 1 + plugins/stronghold/guest-js/index.ts | 355 ++ plugins/stronghold/guest-js/package.json | 29 + plugins/stronghold/guest-js/rollup.config.mjs | 10 + plugins/stronghold/guest-js/tsconfig.json | 1 + plugins/stronghold/src/lib.rs | 432 ++ plugins/stronghold/src/stronghold.rs | 65 + plugins/upload/Cargo.toml | 20 + plugins/upload/guest-js/dist/index.min.js | 46 + plugins/upload/guest-js/dist/index.min.js.map | 1 + plugins/upload/guest-js/dist/index.mjs | 38 + plugins/upload/guest-js/dist/index.mjs.map | 1 + plugins/upload/guest-js/index.ts | 52 + plugins/upload/guest-js/package.json | 29 + plugins/upload/guest-js/rollup.config.mjs | 10 + plugins/upload/guest-js/tsconfig.json | 1 + plugins/upload/src/lib.rs | 106 + plugins/websocket/Cargo.toml | 19 + plugins/websocket/guest-js/dist/index.min.js | 55 + .../websocket/guest-js/dist/index.min.js.map | 1 + plugins/websocket/guest-js/dist/index.mjs | 53 + plugins/websocket/guest-js/dist/index.mjs.map | 1 + plugins/websocket/guest-js/index.ts | 74 + plugins/websocket/guest-js/package.json | 29 + plugins/websocket/guest-js/rollup.config.mjs | 10 + plugins/websocket/guest-js/tsconfig.json | 1 + plugins/websocket/src/lib.rs | 189 + plugins/window-state/Cargo.toml | 16 + plugins/window-state/src/lib.rs | 290 + pnpm-lock.yaml | 2543 ++++++++ pnpm-workspace.yaml | 2 + shared/rollup.config.mjs | 51 + shared/template/Cargo.toml | 15 + shared/template/guest-js/index.ts | 0 shared/template/guest-js/package.json | 29 + shared/template/guest-js/rollup.config.mjs | 10 + shared/template/guest-js/tsconfig.json | 1 + shared/template/src/lib.rs | 0 shared/tsconfig.json | 4 + tsconfig.base.json | 18 + 145 files changed, 16069 insertions(+), 22 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 .vscode/settings.json create mode 100644 Cargo.lock create mode 100644 Cargo.toml delete mode 100644 LICENSE delete mode 100644 README.md create mode 100644 package.json create mode 100644 plugins/authenticator/Cargo.toml create mode 100644 plugins/authenticator/guest-js/dist/index.min.js create mode 100644 plugins/authenticator/guest-js/dist/index.min.js.map create mode 100644 plugins/authenticator/guest-js/dist/index.mjs create mode 100644 plugins/authenticator/guest-js/dist/index.mjs.map create mode 100644 plugins/authenticator/guest-js/index.ts create mode 100644 plugins/authenticator/guest-js/package.json create mode 100644 plugins/authenticator/guest-js/rollup.config.mjs create mode 120000 plugins/authenticator/guest-js/tsconfig.json create mode 100644 plugins/authenticator/src/auth.rs create mode 100644 plugins/authenticator/src/error.rs create mode 100644 plugins/authenticator/src/lib.rs create mode 100644 plugins/authenticator/src/u2f.rs create mode 100644 plugins/autostart/Cargo.toml create mode 100644 plugins/autostart/guest-js/dist/index.min.js create mode 100644 plugins/autostart/guest-js/dist/index.min.js.map create mode 100644 plugins/autostart/guest-js/dist/index.mjs create mode 100644 plugins/autostart/guest-js/dist/index.mjs.map create mode 100644 plugins/autostart/guest-js/index.ts create mode 100644 plugins/autostart/guest-js/package.json create mode 100644 plugins/autostart/guest-js/rollup.config.mjs create mode 120000 plugins/autostart/guest-js/tsconfig.json create mode 100644 plugins/autostart/src/lib.rs create mode 100644 plugins/fs-extra/Cargo.toml create mode 100644 plugins/fs-extra/guest-js/dist/index.min.js create mode 100644 plugins/fs-extra/guest-js/dist/index.min.js.map create mode 100644 plugins/fs-extra/guest-js/dist/index.mjs create mode 100644 plugins/fs-extra/guest-js/dist/index.mjs.map create mode 100644 plugins/fs-extra/guest-js/index.ts create mode 100644 plugins/fs-extra/guest-js/package.json create mode 100644 plugins/fs-extra/guest-js/rollup.config.mjs create mode 120000 plugins/fs-extra/guest-js/tsconfig.json create mode 100644 plugins/fs-extra/src/lib.rs create mode 100644 plugins/fs-watch/Cargo.toml create mode 100644 plugins/fs-watch/guest-js/dist/index.min.js create mode 100644 plugins/fs-watch/guest-js/dist/index.min.js.map create mode 100644 plugins/fs-watch/guest-js/dist/index.mjs create mode 100644 plugins/fs-watch/guest-js/dist/index.mjs.map create mode 100644 plugins/fs-watch/guest-js/index.ts create mode 100644 plugins/fs-watch/guest-js/package.json create mode 100644 plugins/fs-watch/guest-js/rollup.config.mjs create mode 120000 plugins/fs-watch/guest-js/tsconfig.json create mode 100644 plugins/fs-watch/src/lib.rs create mode 100644 plugins/localhost/Cargo.toml create mode 100644 plugins/localhost/src/lib.rs create mode 100644 plugins/log/Cargo.toml create mode 100644 plugins/log/guest-js/dist/index.min.js create mode 100644 plugins/log/guest-js/dist/index.min.js.map create mode 100644 plugins/log/guest-js/dist/index.mjs create mode 100644 plugins/log/guest-js/dist/index.mjs.map create mode 100644 plugins/log/guest-js/index.ts create mode 100644 plugins/log/guest-js/package.json create mode 100644 plugins/log/guest-js/rollup.config.mjs create mode 120000 plugins/log/guest-js/tsconfig.json create mode 100644 plugins/log/src/lib.rs create mode 100644 plugins/persisted-scope/Cargo.toml create mode 100644 plugins/persisted-scope/src/lib.rs create mode 100644 plugins/positioner/Cargo.toml create mode 100644 plugins/positioner/guest-js/dist/index.min.js create mode 100644 plugins/positioner/guest-js/dist/index.min.js.map create mode 100644 plugins/positioner/guest-js/dist/index.mjs create mode 100644 plugins/positioner/guest-js/dist/index.mjs.map create mode 100644 plugins/positioner/guest-js/index.ts create mode 100644 plugins/positioner/guest-js/package.json create mode 100644 plugins/positioner/guest-js/rollup.config.mjs create mode 120000 plugins/positioner/guest-js/tsconfig.json create mode 100644 plugins/positioner/src/ext.rs create mode 100644 plugins/positioner/src/lib.rs create mode 100644 plugins/sql/Cargo.toml create mode 100644 plugins/sql/guest-js/dist/index.min.js create mode 100644 plugins/sql/guest-js/dist/index.min.js.map create mode 100644 plugins/sql/guest-js/dist/index.mjs create mode 100644 plugins/sql/guest-js/dist/index.mjs.map create mode 100644 plugins/sql/guest-js/index.ts create mode 100644 plugins/sql/guest-js/package.json create mode 100644 plugins/sql/guest-js/rollup.config.mjs create mode 120000 plugins/sql/guest-js/tsconfig.json create mode 100644 plugins/sql/src/lib.rs create mode 100644 plugins/sql/src/plugin.rs create mode 100644 plugins/store/Cargo.toml create mode 100644 plugins/store/guest-js/dist/index.min.js create mode 100644 plugins/store/guest-js/dist/index.min.js.map create mode 100644 plugins/store/guest-js/dist/index.mjs create mode 100644 plugins/store/guest-js/dist/index.mjs.map create mode 100644 plugins/store/guest-js/index.ts create mode 100644 plugins/store/guest-js/package.json create mode 100644 plugins/store/guest-js/rollup.config.mjs create mode 120000 plugins/store/guest-js/tsconfig.json create mode 100644 plugins/store/src/error.rs create mode 100644 plugins/store/src/lib.rs create mode 100644 plugins/store/src/store.rs create mode 100644 plugins/stronghold/Cargo.toml create mode 100644 plugins/stronghold/guest-js/dist/index.min.js create mode 100644 plugins/stronghold/guest-js/dist/index.min.js.map create mode 100644 plugins/stronghold/guest-js/dist/index.mjs create mode 100644 plugins/stronghold/guest-js/dist/index.mjs.map create mode 100644 plugins/stronghold/guest-js/index.ts create mode 100644 plugins/stronghold/guest-js/package.json create mode 100644 plugins/stronghold/guest-js/rollup.config.mjs create mode 120000 plugins/stronghold/guest-js/tsconfig.json create mode 100644 plugins/stronghold/src/lib.rs create mode 100644 plugins/stronghold/src/stronghold.rs create mode 100644 plugins/upload/Cargo.toml create mode 100644 plugins/upload/guest-js/dist/index.min.js create mode 100644 plugins/upload/guest-js/dist/index.min.js.map create mode 100644 plugins/upload/guest-js/dist/index.mjs create mode 100644 plugins/upload/guest-js/dist/index.mjs.map create mode 100644 plugins/upload/guest-js/index.ts create mode 100644 plugins/upload/guest-js/package.json create mode 100644 plugins/upload/guest-js/rollup.config.mjs create mode 120000 plugins/upload/guest-js/tsconfig.json create mode 100644 plugins/upload/src/lib.rs create mode 100644 plugins/websocket/Cargo.toml create mode 100644 plugins/websocket/guest-js/dist/index.min.js create mode 100644 plugins/websocket/guest-js/dist/index.min.js.map create mode 100644 plugins/websocket/guest-js/dist/index.mjs create mode 100644 plugins/websocket/guest-js/dist/index.mjs.map create mode 100644 plugins/websocket/guest-js/index.ts create mode 100644 plugins/websocket/guest-js/package.json create mode 100644 plugins/websocket/guest-js/rollup.config.mjs create mode 120000 plugins/websocket/guest-js/tsconfig.json create mode 100644 plugins/websocket/src/lib.rs create mode 100644 plugins/window-state/Cargo.toml create mode 100644 plugins/window-state/src/lib.rs create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 shared/rollup.config.mjs create mode 100644 shared/template/Cargo.toml create mode 100644 shared/template/guest-js/index.ts create mode 100644 shared/template/guest-js/package.json create mode 100644 shared/template/guest-js/rollup.config.mjs create mode 120000 shared/template/guest-js/tsconfig.json create mode 100644 shared/template/src/lib.rs create mode 100644 shared/tsconfig.json create mode 100644 tsconfig.base.json diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..2c6d35b6 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +target +node_modules +dist \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..8400987e --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,15 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": ["prettier", "eslint:recommended", "plugin:@typescript-eslint/recommended"], + "overrides": [], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "plugins": ["@typescript-eslint"], + "rules": {} +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5feb9078 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target +node_modules \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..af776ff2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +target +node_modules +distr \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..95ee6b2e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "rust-analyzer.cargo.features": ["sqlite"] +} diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..58bf0c2f --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,5434 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures 0.2.5", + "opaque-debug", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "ascii" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "atoi" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atom" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dcfa7026c8fa43fa767bff0b7cd4d1963cdfd946e0386bee93003e9b2498562" + +[[package]] +name = "authenticator" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08cee7a0952628fde958e149507c2bb321ab4fccfafd225da0b20adc956ef88a" +dependencies = [ + "bitflags", + "core-foundation", + "devd-rs", + "libc", + "libudev", + "log 0.4.17", + "rand 0.7.3", + "runloop", + "winapi 0.3.9", +] + +[[package]] +name = "auto-launch" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642d13324da4df30a472026356a7fd24845d4a8038e5c47ed99c62074b526fa5" +dependencies = [ + "anyhow", + "dirs", + "winreg", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "blake2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array", +] + +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" +dependencies = [ + "memchr", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "byte-unit" +version = "4.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3348673602e04848647fffaa8e9a861e7b5d5cae6570727b41bde0f722514484" +dependencies = [ + "serde", + "utf8-width", +] + +[[package]] +name = "bytemuck" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "iovec", +] + +[[package]] +name = "bytes" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", + "thiserror", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "cc" +version = "1.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74f89d248799e3f15f91b70917f65381062a01bb8e222700ea0e5a7ff9785f9c" +dependencies = [ + "byteorder", + "uuid 0.8.2", +] + +[[package]] +name = "cfg-expr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-expr" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee7ad89dc1128635074c268ee661f90c3f7e83d9fd12910608c36b47d6c3412" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures 0.1.5", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1580317203210c517b6d44794abfbe600698276db18127e37ad3e69bf5e848e5" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-integer", + "num-traits", + "time 0.1.45", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "chunked_transfer" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes 1.3.0", + "memchr", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53757d12b596c16c78b83458d732a5d1a17ab3f53f2f7412f6fb57cc8a140ab3" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d0165d2900ae6778e36e80bbc4da3b5eefccee9ba939761f9c2882a5d9af3ff" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" +dependencies = [ + "cfg-if 1.0.0", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfae75de57f2b2e85e8768c3ea840fd159c8f33e2b6522c7835b7abac81be16e" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ctor" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "cxx" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", + "crypto-bigint", + "pem-rfc7468", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.0", + "syn", +] + +[[package]] +name = "devd-rs" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9313f104b590510b46fc01c0a324fc76505c13871454d3c48490468d04c8d395" +dependencies = [ + "libc", + "nom", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dotenvy" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" + +[[package]] +name = "dtoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" + +[[package]] +name = "dtoa-short" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bde03329ae10e79ede66c9ce4dc930aa8599043b0743008548680f25b91502d6" +dependencies = [ + "dtoa", +] + +[[package]] +name = "dunce" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek", + "hashbrown", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "embed_plist" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fern" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" +dependencies = [ + "log 0.4.17", +] + +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset", + "rustc_version 0.3.3", +] + +[[package]] +name = "filetime" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "windows-sys 0.42.0", +] + +[[package]] +name = "flate2" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "pin-project", + "spin 0.9.4", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fsevent" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" +dependencies = [ + "bitflags", + "fsevent-sys", +] + +[[package]] +name = "fsevent-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +dependencies = [ + "libc", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.11.2", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gdk" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "gdk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps 6.0.3", +] + +[[package]] +name = "gdkx11-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps 6.0.3", + "x11", +] + +[[package]] +name = "generator" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d266041a359dfa931b370ef684cceb84b166beb14f7f0421f4a6a3d0c446d12e" +dependencies = [ + "cc", + "libc", + "log 0.4.17", + "rustversion", + "windows", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", + "winapi 0.3.9", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a68131a662b04931e71891fb14aaf65ee4b44d08e8abc10f49e77418c86c64" +dependencies = [ + "anyhow", + "heck 0.4.0", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "globset" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log 0.4.17", + "regex", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.0.3", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps 6.0.3", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24f518afe90c23fba585b2d7697856f9e6a7bbc62f65588035e66f6afb01a2e9" +dependencies = [ + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes 1.3.0", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "html5ever" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c13fb08e5d4dfc151ee5e88bae63f7773d61852f3bdc73c9f4b9e1bde03148" +dependencies = [ + "log 0.4.17", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes 1.3.0", + "fnv", + "itoa 1.0.4", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes 1.3.0", + "http", + "pin-project-lite", +] + +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +dependencies = [ + "bytes 1.3.0", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa 1.0.4", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes 1.3.0", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "ico" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031530fe562d8c8d71c0635013d6d155bbfe8ba0aa4b4d2d24ce8af6b71047bd" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d" +dependencies = [ + "crossbeam-utils", + "globset", + "lazy_static", + "log 0.4.17", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.24.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-rational", + "num-traits", +] + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "infer" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b2b533137b9cad970793453d4f921c2e91312a6d88b1085c07bc15fc51bb3b" +dependencies = [ + "cfb", +] + +[[package]] +name = "inotify" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +dependencies = [ + "bitflags", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +dependencies = [ + "libc", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "iota-crypto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee273ae67ff1bc7c59317c0ab280e0e76259e6bd83e140ac4c2ecebec994f740" +dependencies = [ + "blake2 0.9.2", + "digest 0.9.0", +] + +[[package]] +name = "iota-crypto" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f03717e934972fad6f1c9b4cd25f662e1753b58a7f76e3dceadeb646e034b252" +dependencies = [ + "aead", + "aes", + "aes-gcm", + "blake2 0.10.5", + "chacha20poly1305", + "curve25519-dalek", + "digest 0.10.6", + "ed25519-zebra", + "generic-array", + "getrandom 0.2.8", + "hmac", + "pbkdf2", + "serde", + "sha2 0.10.6", + "unicode-normalization", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "iota-crypto" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53239ace29cccec48af2f3b509090d546bcc52648c6147866d88bc70f4352b3" + +[[package]] +name = "iota_stronghold" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241111d0e7fa6740c89e3355e0570f761445e561cb31a4d49ef784ee5ef99f0e" +dependencies = [ + "bincode", + "hkdf", + "iota-crypto 0.12.1", + "serde", + "stronghold-derive", + "stronghold-rlu", + "stronghold-utils", + "stronghold_engine", + "thiserror", + "zeroize", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipnet" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "javascriptcore-rs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +dependencies = [ + "bitflags", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "jni" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log 0.4.17", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3fa5a61630976fc4c353c70297f2e93f1930e3ccee574d59d618ccbd5154ce" +dependencies = [ + "serde", + "serde_json", + "treediff", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "kuchiki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8e9c6e031377cff82ee3001dc8026cdf431ed4e2e6b51f98ab8c73484a358" +dependencies = [ + "cssparser", + "html5ever", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libappindicator" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2d3cb96d092b4824cb306c9e544c856a4cb6210c1081945187f7f1924b47e8" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log 0.4.17", +] + +[[package]] +name = "libappindicator-sys" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b3b6681973cea8cc3bce7391e6d7d5502720b80a581c9a95c9cbaf592826aa" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if 1.0.0", + "winapi 0.3.9", +] + +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + +[[package]] +name = "libsodium-sys" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b779387cd56adfbc02ea4a668e704f729be8d6a6abd2c27ca5ee537849a92fd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "walkdir", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "898745e570c7d0453cc1fbc4a701eb6c662ed54e8fec8b7d14be137ebeeb9d14" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libudev" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe" +dependencies = [ + "libc", + "libudev-sys", +] + +[[package]] +name = "libudev-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "line-wrap" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" +dependencies = [ + "safemem", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.1.0" +dependencies = [ + "byte-unit", + "fern", + "log 0.4.17", + "serde", + "serde_json", + "serde_repr", + "tauri", + "time 0.3.17", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", + "value-bag", +] + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if 1.0.0", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a24f40fb03852d1cdd84330cddcaf98e9ec08a7b7768e952fad3b4cf048ec8fd" +dependencies = [ + "log 0.4.17", + "phf 0.8.0", + "phf_codegen", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "md-5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log 0.4.17", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log 0.4.17", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log 0.4.17", + "mio 0.6.23", + "slab", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log 0.4.17", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys", +] + +[[package]] +name = "net2" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "notify" +version = "4.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae03c8c853dba7bfd23e571ff0cff7bc9dceb40a4cd684cd1681824183f45257" +dependencies = [ + "bitflags", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio 0.6.23", + "mio-extras", + "walkdir", + "winapi 0.3.9", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi 0.3.9", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2399c9463abc5f909349d8aa9ba080e0b88b3ce2885389b60b993f39b1a56905" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.0.3", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.5", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "pem-rfc7468" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0" +dependencies = [ + "thiserror", + "ucd-trie", +] + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +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_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_macros" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fdf3184dd560f160dd73922bea2d5cd6e8f064bf4b13110abd81b03697b4e0" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" +dependencies = [ + "der", + "pkcs8", + "zeroize", +] + +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "plist" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225" +dependencies = [ + "base64 0.13.1", + "indexmap", + "line-wrap", + "serde", + "time 0.3.17", + "xml-rs", +] + +[[package]] +name = "png" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures 0.2.5", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.5", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + +[[package]] +name = "read-progress-stream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6435842fc2fea44b528719eb8c32203bbc1bb2f5b619fbe0c0a3d8350fd8d2a8" +dependencies = [ + "bytes 1.3.0", + "futures", + "pin-project-lite", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.8", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "reqwest" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +dependencies = [ + "base64 0.13.1", + "bytes 1.3.0", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log 0.4.17", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted", + "web-sys", + "winapi 0.3.9", +] + +[[package]] +name = "rsa" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" +dependencies = [ + "byteorder", + "digest 0.10.6", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "smallvec", + "subtle", + "zeroize", +] + +[[package]] +name = "runloop" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d79b4b604167921892e84afbbaad9d5ad74e091bf6c511d9dbfb0593f09fabd" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver 1.0.14", +] + +[[package]] +name = "rustls" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +dependencies = [ + "log 0.4.17", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64 0.13.1", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags", + "cssparser", + "derive_more", + "fxhash", + "log 0.4.17", + "matches", + "phf 0.8.0", + "phf_codegen", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +dependencies = [ + "itoa 1.0.4", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe39d9fbb0ebf5eb2c7cb7e2a47e4f462fad1379f1166b8ae49ad9eae89a7ca" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.4", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serialize-to-javascript" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb" +dependencies = [ + "serde", + "serde_json", + "serialize-to-javascript-impl", +] + +[[package]] +name = "serialize-to-javascript-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.5", + "digest 0.10.6", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.5", + "digest 0.10.6", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures 0.2.5", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.5", + "digest 0.10.6", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "soup2" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" +dependencies = [ + "bitflags", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", +] + +[[package]] +name = "soup2-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" +dependencies = [ + "bitflags", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlformat" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87e292b4291f154971a43c3774364e2cbcaec599d3f5bf6fa9d122885dbc38a" +dependencies = [ + "itertools", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" +dependencies = [ + "sqlx-core", + "sqlx-macros", +] + +[[package]] +name = "sqlx-core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" +dependencies = [ + "ahash", + "atoi", + "base64 0.13.1", + "bitflags", + "byteorder", + "bytes 1.3.0", + "crc", + "crossbeam-queue", + "digest 0.10.6", + "dirs", + "dotenvy", + "either", + "event-listener", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "generic-array", + "hashlink", + "hex", + "hkdf", + "hmac", + "indexmap", + "itoa 1.0.4", + "libc", + "libsqlite3-sys", + "log 0.4.17", + "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", + "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", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "state" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +dependencies = [ + "loom", +] + +[[package]] +name = "string_cache" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot 0.12.1", + "phf_shared 0.10.0", + "precomputed-hash", + "serde", +] + +[[package]] +name = "string_cache_codegen" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", + "proc-macro2", + "quote", +] + +[[package]] +name = "stringprep" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "stronghold-derive" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac933fa00ab0d0f1d6327ab9198a95aaaca3458dae09f0b8e1cd69fee2a7eaf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "stronghold-rlu" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b00fbacafc4ef96fb95fac07d86cc3ec5e21c8efa94785374ad7913a4a216ba" +dependencies = [ + "atom", + "lazy_static", + "log 0.4.17", + "thiserror", + "zeroize", +] + +[[package]] +name = "stronghold-runtime" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8845d2c5a4270ecdf542f489ff16b2a6fec245ad001c6afe098c2e6ea0211d6c" +dependencies = [ + "dirs", + "iota-crypto 0.8.0", + "libsodium-sys", + "rand 0.8.5", + "serde", + "thiserror", + "zeroize", +] + +[[package]] +name = "stronghold-utils" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be1ce0d6205e8ea89771f2b32d64aeaecbc930320919e95ec4efcc0aa96cd951" +dependencies = [ + "rand 0.8.5", + "stronghold-derive", +] + +[[package]] +name = "stronghold_engine" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab9d53f21c2293ba7e8fc3b6e7a5365ce12caf55f5c4b2a7d26e9e84d14071" +dependencies = [ + "anyhow", + "dirs-next", + "hex", + "iota-crypto 0.12.1", + "once_cell", + "paste", + "serde", + "stronghold-runtime", + "thiserror", + "zeroize", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "system-deps" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" +dependencies = [ + "cfg-expr 0.9.1", + "heck 0.3.3", + "pkg-config", + "toml", + "version-compare 0.0.11", +] + +[[package]] +name = "system-deps" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" +dependencies = [ + "cfg-expr 0.11.0", + "heck 0.4.0", + "pkg-config", + "toml", + "version-compare 0.1.1", +] + +[[package]] +name = "tao" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1fa15735311b4816d030ff54da58560b047daca0970e1031aed5502e84231a8" +dependencies = [ + "bitflags", + "cairo-rs", + "cc", + "cocoa", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dirs-next", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkx11-sys", + "gio", + "glib", + "glib-sys", + "gtk", + "image", + "instant", + "jni", + "lazy_static", + "libappindicator", + "libc", + "log 0.4.17", + "ndk", + "ndk-context", + "ndk-sys", + "objc", + "once_cell", + "parking_lot 0.12.1", + "paste", + "png", + "raw-window-handle", + "scopeguard", + "serde", + "unicode-segmentation", + "uuid 1.2.2", + "windows", + "windows-implement", + "x11-dl", +] + +[[package]] +name = "tar" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tauri" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ea1d785ab2164373703817bff144c4610a69ad3f659becaca0e1ea004b98d8" +dependencies = [ + "anyhow", + "cocoa", + "dirs-next", + "embed_plist", + "encoding_rs", + "flate2", + "futures-util", + "glib", + "glob", + "gtk", + "heck 0.4.0", + "http", + "ignore", + "objc", + "once_cell", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "semver 1.0.14", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "state", + "tar", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "tempfile", + "thiserror", + "tokio", + "url", + "uuid 1.2.2", + "webkit2gtk", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-codegen" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14388d484b6b1b5dc0f6a7d6cc6433b3b230bec85eaa576adcdf3f9fafa49251" +dependencies = [ + "base64 0.13.1", + "brotli", + "ico", + "json-patch", + "plist", + "png", + "proc-macro2", + "quote", + "semver 1.0.14", + "serde", + "serde_json", + "sha2 0.10.6", + "tauri-utils", + "thiserror", + "time 0.3.17", + "uuid 1.2.2", + "walkdir", +] + +[[package]] +name = "tauri-macros" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069319e5ecbe653a799b94b0690d9f9bf5d00f7b1d3989aa331c524d4e354075" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn", + "tauri-codegen", + "tauri-utils", +] + +[[package]] +name = "tauri-plugin-authenticator" +version = "0.1.0" +dependencies = [ + "authenticator", + "base64 0.13.1", + "chrono", + "log 0.4.17", + "once_cell", + "rand 0.8.5", + "rusty-fork", + "serde", + "serde_json", + "sha2 0.10.6", + "tauri", + "thiserror", + "u2f", +] + +[[package]] +name = "tauri-plugin-autostart" +version = "0.1.0" +dependencies = [ + "auto-launch", + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-fs-extra" +version = "0.1.0" +dependencies = [ + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-fs-watch" +version = "0.1.0" +dependencies = [ + "log 0.4.17", + "notify", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-localhost" +version = "0.1.0" +dependencies = [ + "http", + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", + "tiny_http", +] + +[[package]] +name = "tauri-plugin-persisted-scope" +version = "0.1.0" +dependencies = [ + "bincode", + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-positioner" +version = "0.1.0" +dependencies = [ + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-sql" +version = "0.1.0" +dependencies = [ + "futures", + "log 0.4.17", + "serde", + "serde_json", + "sqlx", + "tauri", + "thiserror", + "tokio", +] + +[[package]] +name = "tauri-plugin-store" +version = "0.1.0" +dependencies = [ + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-plugin-stronghold" +version = "0.1.0" +dependencies = [ + "hex", + "iota-crypto 0.14.3", + "iota_stronghold", + "log 0.4.17", + "rand 0.8.5", + "rusty-fork", + "serde", + "serde_json", + "tauri", + "thiserror", + "zeroize", +] + +[[package]] +name = "tauri-plugin-upload" +version = "0.1.0" +dependencies = [ + "futures", + "log 0.4.17", + "read-progress-stream", + "reqwest", + "serde", + "serde_json", + "tauri", + "thiserror", + "tokio", + "tokio-util", +] + +[[package]] +name = "tauri-plugin-websocket" +version = "0.1.0" +dependencies = [ + "futures-util", + "log 0.4.17", + "rand 0.8.5", + "serde", + "serde_json", + "tauri", + "thiserror", + "tokio", + "tokio-tungstenite", +] + +[[package]] +name = "tauri-plugin-window-state" +version = "0.1.0" +dependencies = [ + "bincode", + "log 0.4.17", + "serde", + "serde_json", + "tauri", + "thiserror", +] + +[[package]] +name = "tauri-runtime" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c507d954d08ac8705d235bc70ec6975b9054fb95ff7823af72dbb04186596f3b" +dependencies = [ + "gtk", + "http", + "http-range", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror", + "uuid 1.2.2", + "webview2-com", + "windows", +] + +[[package]] +name = "tauri-runtime-wry" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36b1c5764a41a13176a4599b5b7bd0881bea7d94dfe45e1e755f789b98317e30" +dependencies = [ + "cocoa", + "gtk", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "tauri-runtime", + "tauri-utils", + "uuid 1.2.2", + "webkit2gtk", + "webview2-com", + "windows", + "wry", +] + +[[package]] +name = "tauri-utils" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5abbc109a6eb45127956ffcc26ef0e875d160150ac16cfa45d26a6b2871686f1" +dependencies = [ + "brotli", + "ctor", + "glob", + "heck 0.4.0", + "html5ever", + "infer", + "json-patch", + "kuchiki", + "memchr", + "phf 0.10.1", + "proc-macro2", + "quote", + "semver 1.0.14", + "serde", + "serde_json", + "serde_with", + "thiserror", + "url", + "walkdir", + "windows", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.9", +] + +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + +[[package]] +name = "time" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +dependencies = [ + "itoa 1.0.4", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + +[[package]] +name = "tiny_http" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d6ef4e10d23c1efb862eecad25c5054429a71958b4eeef85eb5e7170b477ca" +dependencies = [ + "ascii", + "chunked_transfer", + "log 0.4.17", + "time 0.3.17", + "url", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +dependencies = [ + "autocfg", + "bytes 1.3.0", + "libc", + "memchr", + "mio 0.8.5", + "num_cpus", + "pin-project-lite", + "socket2", + "windows-sys 0.42.0", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +dependencies = [ + "futures-util", + "log 0.4.17", + "native-tls", + "tokio", + "tokio-native-tls", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes 1.3.0", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log 0.4.17", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "treediff" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "761e8d5ad7ce14bb82b7e61ccc0ca961005a275a060b9644a2431aa11553c2ff" +dependencies = [ + "serde_json", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tungstenite" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes 1.3.0", + "http", + "httparse", + "log 0.4.17", + "native-tls", + "rand 0.8.5", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "u2f" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2f285392366190c4d46823458f4543ac0f35174759c78e80c5baa39e1f7aa4f" +dependencies = [ + "base64 0.11.0", + "byteorder", + "bytes 0.4.12", + "chrono", + "openssl", + "serde", + "serde_derive", + "serde_json", + "time 0.1.45", +] + +[[package]] +name = "ucd-trie" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8-width" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi 0.3.9", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log 0.4.17", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log 0.4.17", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webkit2gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +dependencies = [ + "bitflags", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup2", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +dependencies = [ + "atk-sys", + "bitflags", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup2-sys", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki", +] + +[[package]] +name = "webview2-com" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows", + "windows-implement", +] + +[[package]] +name = "webview2-com-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "webview2-com-sys" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +dependencies = [ + "regex", + "serde", + "serde_json", + "thiserror", + "windows", + "windows-bindgen", + "windows-metadata", +] + +[[package]] +name = "whoami" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6631b6a2fd59b1841b622e8f1a7ad241ef0a46f2d580464ce8140ac94cbd571" +dependencies = [ + "bumpalo", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows-implement", + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + +[[package]] +name = "windows-bindgen" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +dependencies = [ + "windows-metadata", + "windows-tokens", +] + +[[package]] +name = "windows-implement" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +dependencies = [ + "syn", + "windows-tokens", +] + +[[package]] +name = "windows-metadata" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows-tokens" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "wry" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c1ad8e2424f554cc5bdebe8aa374ef5b433feff817aebabca0389961fc7ef98" +dependencies = [ + "base64 0.13.1", + "block", + "cocoa", + "core-graphics", + "crossbeam-channel", + "dunce", + "gdk", + "gio", + "glib", + "gtk", + "html5ever", + "http", + "kuchiki", + "libc", + "log 0.4.17", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "sha2 0.10.6", + "soup2", + "tao", + "thiserror", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows", + "windows-implement", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "x11" +version = "2.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2638d5b9c17ac40575fb54bb461a4b1d2a8d1b4ffcc4ff237d254ec59ddeb82" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1536d6965a5d4e573c7ef73a2c15ebcd0b2de3347bdf526c34c297c00ac40f0" +dependencies = [ + "lazy_static", + "libc", + "pkg-config", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "xattr" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" +dependencies = [ + "libc", +] + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..41ae9082 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,15 @@ +[workspace] +members = ["plugins/*"] +resolver = "2" + +[workspace.dependencies] +serde = { version = "1", features = ["derive"] } +log = "0.4" +tauri = "1" +serde_json = "1" +thiserror = "1" + +[workspace.package] +edition = "2021" +authors = [ "Tauri Programme within The Commons Conservancy" ] +license = "Apache-2.0 OR MIT" \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 47469816..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Tauri - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 2bb775bf..00000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# plugins-workspace \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..2e584acc --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "plugins-workspace", + "private": true, + "license": "MIT or APACHE-2.0", + "type": "module", + "scripts": { + "build": "pnpm run -r --parallel --filter !plugins-workspace build", + "lint": "eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-terser": "^0.2.0", + "@rollup/plugin-typescript": "^10.0.1", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.46.1", + "eslint": "^8.0.1", + "eslint-config-prettier": "^8.5.0", + "eslint-config-standard-with-typescript": "^24.0.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0", + "prettier": "^2.8.1", + "rollup": "^3.7.4", + "typescript": "^4.9.4" + } +} diff --git a/plugins/authenticator/Cargo.toml b/plugins/authenticator/Cargo.toml new file mode 100644 index 00000000..a5d5258d --- /dev/null +++ b/plugins/authenticator/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "tauri-bindgen-host-macro" +authors.workspace = true +version.workspace = true +edition.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +authenticator = "0.3.1" +once_cell = "1.9" +sha2 = "0.10" +base64 = { version = "^0.13" } +u2f = "0.2" +chrono = "0.4" + +[dev-dependencies] +rand = "0.8" +rusty-fork = "0.3" diff --git a/plugins/authenticator/guest-js/dist/index.min.js b/plugins/authenticator/guest-js/dist/index.min.js new file mode 100644 index 00000000..44e0d948 --- /dev/null +++ b/plugins/authenticator/guest-js/dist/index.min.js @@ -0,0 +1,45 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +class Authenticator { + async init() { + return await c("plugin:authenticator|init"); + } + async register(challenge, application) { + return await c("plugin:authenticator|register", { + timeout: 10000, + challenge, + application, + }); + } + async verifyRegistration(challenge, application, registerData, clientData) { + return await c("plugin:authenticator|verify_registration", { + challenge, + application, + registerData, + clientData, + }); + } + async sign(challenge, application, keyHandle) { + return await c("plugin:authenticator|sign", { + timeout: 10000, + challenge, + application, + keyHandle, + }); + } + async verifySignature(challenge, application, signData, clientData, keyHandle, pubkey) { + return await c("plugin:authenticator|verify_signature", { + challenge, + application, + signData, + clientData, + keyHandle, + pubkey, + }); + } +} + +export { Authenticator }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/authenticator/guest-js/dist/index.min.js.map b/plugins/authenticator/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..f4d8fb30 --- /dev/null +++ b/plugins/authenticator/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n",null],"names":["d","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IAAI,CAAC,CAAC,EAAE,CAACA,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CA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B,CACtB,SAAiB,EACjB,WAAmB,EACnB,YAAoB,EACpB,UAAkB,EAAA;AAElB,QAAA,OAAO,MAAMA,CAAM,CAAC,0CAA0C,EAAE;YAC9D,SAAS;YACT,WAAW;YACX,YAAY;YACZ,UAAU;AACX,SAAA,CAAC,CAAC;KACJ;AAED,IAAA,MAAM,IAAI,CACR,SAAiB,EACjB,WAAmB,EACnB,SAAiB,EAAA;AAEjB,QAAA,OAAO,MAAMA,CAAM,CAAC,2BAA2B,EAAE;AAC/C,YAAA,OAAO,EAAE,KAAK;YACd,SAAS;YACT,WAAW;YACX,SAAS;AACV,SAAA,CAAC,CAAC;KACJ;AAED,IAAA,MAAM,eAAe,CACnB,SAAiB,EACjB,WAAmB,EACnB,QAAgB,EAChB,UAAkB,EAClB,SAAiB,EACjB,MAAc,EAAA;AAEd,QAAA,OAAO,MAAMA,CAAM,CAAC,uCAAuC,EAAE;YAC3D,SAAS;YACT,WAAW;YACX,QAAQ;YACR,UAAU;YACV,SAAS;YACT,MAAM;AACP,SAAA,CAAC,CAAC;KACJ;AACF;;;;"} \ No newline at end of file diff --git a/plugins/authenticator/guest-js/dist/index.mjs b/plugins/authenticator/guest-js/dist/index.mjs new file mode 100644 index 00000000..b3ce700d --- /dev/null +++ b/plugins/authenticator/guest-js/dist/index.mjs @@ -0,0 +1,43 @@ +import { invoke } from '@tauri-apps/api/tauri'; + +class Authenticator { + async init() { + return await invoke("plugin:authenticator|init"); + } + async register(challenge, application) { + return await invoke("plugin:authenticator|register", { + timeout: 10000, + challenge, + application, + }); + } + async verifyRegistration(challenge, application, registerData, clientData) { + return await invoke("plugin:authenticator|verify_registration", { + challenge, + application, + registerData, + clientData, + }); + } + async sign(challenge, application, keyHandle) { + return await invoke("plugin:authenticator|sign", { + timeout: 10000, + challenge, + application, + keyHandle, + }); + } + async verifySignature(challenge, application, signData, clientData, keyHandle, pubkey) { + return await invoke("plugin:authenticator|verify_signature", { + challenge, + application, + signData, + clientData, + keyHandle, + pubkey, + }); + } +} + +export { Authenticator }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/authenticator/guest-js/dist/index.mjs.map b/plugins/authenticator/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..5c3da097 --- /dev/null +++ b/plugins/authenticator/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;MAEa,aAAa,CAAA;AACxB,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;KAClD;AAED,IAAA,MAAM,QAAQ,CAAC,SAAiB,EAAE,WAAmB,EAAA;AACnD,QAAA,OAAO,MAAM,MAAM,CAAC,+BAA+B,EAAE;AACnD,YAAA,OAAO,EAAE,KAAK;YACd,SAAS;YACT,WAAW;AACZ,SAAA,CAAC,CAAC;KACJ;IAED,MAAM,kBAAkB,CACtB,SAAiB,EACjB,WAAmB,EACnB,YAAoB,EACpB,UAAkB,EAAA;AAElB,QAAA,OAAO,MAAM,MAAM,CAAC,0CAA0C,EAAE;YAC9D,SAAS;YACT,WAAW;YACX,YAAY;YACZ,UAAU;AACX,SAAA,CAAC,CAAC;KACJ;AAED,IAAA,MAAM,IAAI,CACR,SAAiB,EACjB,WAAmB,EACnB,SAAiB,EAAA;AAEjB,QAAA,OAAO,MAAM,MAAM,CAAC,2BAA2B,EAAE;AAC/C,YAAA,OAAO,EAAE,KAAK;YACd,SAAS;YACT,WAAW;YACX,SAAS;AACV,SAAA,CAAC,CAAC;KACJ;AAED,IAAA,MAAM,eAAe,CACnB,SAAiB,EACjB,WAAmB,EACnB,QAAgB,EAChB,UAAkB,EAClB,SAAiB,EACjB,MAAc,EAAA;AAEd,QAAA,OAAO,MAAM,MAAM,CAAC,uCAAuC,EAAE;YAC3D,SAAS;YACT,WAAW;YACX,QAAQ;YACR,UAAU;YACV,SAAS;YACT,MAAM;AACP,SAAA,CAAC,CAAC;KACJ;AACF;;;;"} \ No newline at end of file diff --git a/plugins/authenticator/guest-js/index.ts b/plugins/authenticator/guest-js/index.ts new file mode 100644 index 00000000..6f9da943 --- /dev/null +++ b/plugins/authenticator/guest-js/index.ts @@ -0,0 +1,60 @@ +import { invoke } from "@tauri-apps/api/tauri"; + +export class Authenticator { + async init(): Promise { + return await invoke("plugin:authenticator|init"); + } + + async register(challenge: string, application: string): Promise { + return await invoke("plugin:authenticator|register", { + timeout: 10000, + challenge, + application, + }); + } + + async verifyRegistration( + challenge: string, + application: string, + registerData: string, + clientData: string + ): Promise { + return await invoke("plugin:authenticator|verify_registration", { + challenge, + application, + registerData, + clientData, + }); + } + + async sign( + challenge: string, + application: string, + keyHandle: string + ): Promise { + return await invoke("plugin:authenticator|sign", { + timeout: 10000, + challenge, + application, + keyHandle, + }); + } + + async verifySignature( + challenge: string, + application: string, + signData: string, + clientData: string, + keyHandle: string, + pubkey: string + ): Promise { + return await invoke("plugin:authenticator|verify_signature", { + challenge, + application, + signData, + clientData, + keyHandle, + pubkey, + }); + } +} diff --git a/plugins/authenticator/guest-js/package.json b/plugins/authenticator/guest-js/package.json new file mode 100644 index 00000000..ff39a4f7 --- /dev/null +++ b/plugins/authenticator/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-authenticator-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/authenticator/guest-js/rollup.config.mjs b/plugins/authenticator/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/authenticator/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/authenticator/guest-js/tsconfig.json b/plugins/authenticator/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/authenticator/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/authenticator/src/auth.rs b/plugins/authenticator/src/auth.rs new file mode 100644 index 00000000..363b0d11 --- /dev/null +++ b/plugins/authenticator/src/auth.rs @@ -0,0 +1,217 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use authenticator::{ + authenticatorservice::AuthenticatorService, statecallback::StateCallback, + AuthenticatorTransports, KeyHandle, RegisterFlags, SignFlags, StatusUpdate, +}; +use base64::{decode_config, encode_config, URL_SAFE_NO_PAD}; +use once_cell::sync::Lazy; +use serde::Serialize; +use sha2::{Digest, Sha256}; +use std::io; +use std::sync::mpsc::channel; +use std::{convert::Into, sync::Mutex}; + +static MANAGER: Lazy> = Lazy::new(|| { + let manager = AuthenticatorService::new().expect("The auth service should initialize safely"); + Mutex::new(manager) +}); + +pub fn init_usb() { + let mut manager = MANAGER.lock().unwrap(); + // theres also "add_detected_transports()" in the docs? + manager.add_u2f_usb_hid_platform_transports(); +} + +#[derive(Serialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Registration { + pub key_handle: String, + pub pubkey: String, + pub register_data: String, + pub client_data: String, +} + +pub fn register(application: String, timeout: u64, challenge: String) -> crate::Result { + let (chall_bytes, app_bytes, client_data_string) = + format_client_data(application.as_str(), challenge.as_str()); + + // log the status rx? + let (status_tx, _status_rx) = channel::(); + + let mut manager = MANAGER.lock().unwrap(); + + let (register_tx, register_rx) = channel(); + let callback = StateCallback::new(Box::new(move |rv| { + register_tx.send(rv).unwrap(); + })); + + let res = manager.register( + RegisterFlags::empty(), + timeout, + chall_bytes, + app_bytes, + vec![], + status_tx, + callback, + ); + + match res { + Ok(_r) => { + let register_result = register_rx + .recv() + .expect("Problem receiving, unable to continue"); + + if let Err(e) = register_result { + return Err(e.into()); + } + + let (register_data, device_info) = register_result.unwrap(); // error already has been checked + + // println!("Register result: {}", base64::encode(®ister_data)); + println!("Device info: {}", &device_info); + + let (key_handle, public_key) = + _u2f_get_key_handle_and_public_key_from_register_response(®ister_data).unwrap(); + let key_handle_base64 = encode_config(&key_handle, URL_SAFE_NO_PAD); + let public_key_base64 = encode_config(&public_key, URL_SAFE_NO_PAD); + let register_data_base64 = encode_config(®ister_data, URL_SAFE_NO_PAD); + println!("Key Handle: {}", &key_handle_base64); + println!("Public Key: {}", &public_key_base64); + + // Ok(base64::encode(®ister_data)) + // Ok(key_handle_base64) + let res = serde_json::to_string(&Registration { + key_handle: key_handle_base64, + pubkey: public_key_base64, + register_data: register_data_base64, + client_data: client_data_string, + })?; + Ok(res) + } + Err(e) => Err(e.into()), + } +} + +#[derive(Serialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct Signature { + pub key_handle: String, + pub sign_data: String, +} + +pub fn sign( + application: String, + timeout: u64, + challenge: String, + key_handle: String, +) -> crate::Result { + let credential = match decode_config(&key_handle, URL_SAFE_NO_PAD) { + Ok(v) => v, + Err(e) => { + return Err(e.into()); + } + }; + let key_handle = KeyHandle { + credential, + transports: AuthenticatorTransports::empty(), + }; + + let (chall_bytes, app_bytes, _) = format_client_data(application.as_str(), challenge.as_str()); + + let (sign_tx, sign_rx) = channel(); + let callback = StateCallback::new(Box::new(move |rv| { + sign_tx.send(rv).unwrap(); + })); + + // log the status rx? + let (status_tx, _status_rx) = channel::(); + + let mut manager = MANAGER.lock().unwrap(); + + let res = manager.sign( + SignFlags::empty(), + timeout, + chall_bytes, + vec![app_bytes], + vec![key_handle], + status_tx, + callback, + ); + match res { + Ok(_v) => { + let sign_result = sign_rx + .recv() + .expect("Problem receiving, unable to continue"); + + if let Err(e) = sign_result { + return Err(e.into()); + } + + let (_, handle_used, sign_data, device_info) = sign_result.unwrap(); + + let sig = encode_config(&sign_data, URL_SAFE_NO_PAD); + + println!("Sign result: {}", sig); + println!( + "Key handle used: {}", + encode_config(&handle_used, URL_SAFE_NO_PAD) + ); + println!("Device info: {}", &device_info); + println!("Done."); + + let res = serde_json::to_string(&Signature { + sign_data: sig, + key_handle: encode_config(&handle_used, URL_SAFE_NO_PAD), + })?; + Ok(res) + } + Err(e) => Err(e.into()), + } +} + +fn format_client_data(application: &str, challenge: &str) -> (Vec, Vec, String) { + let d = format!( + r#"{{"challenge": "{}", "version": "U2F_V2", "appId": "{}"}}"#, + challenge, application + ); + let mut challenge = Sha256::new(); + challenge.update(d.as_bytes()); + let chall_bytes = challenge.finalize().to_vec(); + + let mut app = Sha256::new(); + app.update(application.as_bytes()); + let app_bytes = app.finalize().to_vec(); + + (chall_bytes, app_bytes, d) +} + +fn _u2f_get_key_handle_and_public_key_from_register_response( + register_response: &[u8], +) -> io::Result<(Vec, Vec)> { + if register_response[0] != 0x05 { + return Err(io::Error::new( + io::ErrorKind::InvalidData, + "Reserved byte not set correctly", + )); + } + + // 1: reserved + // 65: public key + // 1: key handle length + // key handle + // x.509 cert + // sig + + let key_handle_len = register_response[66] as usize; + let mut public_key = register_response.to_owned(); + let mut key_handle = public_key.split_off(67); + let _attestation = key_handle.split_off(key_handle_len); + + // remove fist (reserved) and last (handle len) bytes + let pk: Vec = public_key[1..public_key.len() - 1].to_vec(); + + Ok((key_handle, pk)) +} diff --git a/plugins/authenticator/src/error.rs b/plugins/authenticator/src/error.rs new file mode 100644 index 00000000..87a393d2 --- /dev/null +++ b/plugins/authenticator/src/error.rs @@ -0,0 +1,22 @@ +use serde::{Serialize, Serializer}; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Base64Decode(#[from] base64::DecodeError), + #[error(transparent)] + JSON(#[from] serde_json::Error), + #[error(transparent)] + U2F(#[from] u2f::u2ferror::U2fError), + #[error(transparent)] + Auth(#[from] authenticator::errors::AuthenticatorError), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} diff --git a/plugins/authenticator/src/lib.rs b/plugins/authenticator/src/lib.rs new file mode 100644 index 00000000..bc0d4c35 --- /dev/null +++ b/plugins/authenticator/src/lib.rs @@ -0,0 +1,89 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +mod auth; +mod error; +mod u2f; + +use tauri::{plugin::Plugin, Invoke, Runtime}; + +pub use error::Error; +type Result = std::result::Result; + +#[tauri::command] +fn init() { + auth::init_usb(); +} + +#[tauri::command] +fn register(timeout: u64, challenge: String, application: String) -> crate::Result { + auth::register(application, timeout, challenge) +} + +#[tauri::command] +fn verify_registration( + challenge: String, + application: String, + register_data: String, + client_data: String, +) -> crate::Result { + u2f::verify_registration(application, challenge, register_data, client_data) +} + +#[tauri::command] +fn sign( + timeout: u64, + challenge: String, + application: String, + key_handle: String, +) -> crate::Result { + auth::sign(application, timeout, challenge, key_handle) +} + +#[tauri::command] +fn verify_signature( + challenge: String, + application: String, + sign_data: String, + client_data: String, + key_handle: String, + pubkey: String, +) -> crate::Result { + u2f::verify_signature( + application, + challenge, + sign_data, + client_data, + key_handle, + pubkey, + ) +} + +pub struct TauriAuthenticator { + invoke_handler: Box) + Send + Sync>, +} + +impl Default for TauriAuthenticator { + fn default() -> Self { + Self { + invoke_handler: Box::new(tauri::generate_handler![ + init, + register, + verify_registration, + sign, + verify_signature + ]), + } + } +} + +impl Plugin for TauriAuthenticator { + fn name(&self) -> &'static str { + "authenticator" + } + + fn extend_api(&mut self, invoke: Invoke) { + (self.invoke_handler)(invoke) + } +} diff --git a/plugins/authenticator/src/u2f.rs b/plugins/authenticator/src/u2f.rs new file mode 100644 index 00000000..b1f2e280 --- /dev/null +++ b/plugins/authenticator/src/u2f.rs @@ -0,0 +1,105 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use base64::{decode_config, encode_config, URL_SAFE_NO_PAD}; +use chrono::prelude::*; +use serde::Serialize; +use std::convert::Into; +use u2f::messages::*; +use u2f::protocol::*; +use u2f::register::*; + +static VERSION: &str = "U2F_V2"; + +pub fn make_challenge(app_id: &str, challenge_bytes: Vec) -> Challenge { + let utc: DateTime = Utc::now(); + Challenge { + challenge: encode_config(&challenge_bytes, URL_SAFE_NO_PAD), + timestamp: format!("{:?}", utc), + app_id: app_id.to_string(), + } +} + +#[derive(Serialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct RegistrationVerification { + pub key_handle: String, + pub pubkey: String, + pub device_name: Option, +} + +pub fn verify_registration( + app_id: String, + challenge: String, + register_data: String, + client_data: String, +) -> crate::Result { + let challenge_bytes = decode_config(&challenge, URL_SAFE_NO_PAD)?; + let challenge = make_challenge(&app_id, challenge_bytes); + let client_data_bytes: Vec = client_data.as_bytes().into(); + let client_data_base64 = encode_config(&client_data_bytes, URL_SAFE_NO_PAD); + let client = U2f::new(app_id); + match client.register_response( + challenge, + RegisterResponse { + registration_data: register_data, + client_data: client_data_base64, + version: VERSION.to_string(), + }, + ) { + Ok(v) => { + let rv = RegistrationVerification { + key_handle: encode_config(&v.key_handle, URL_SAFE_NO_PAD), + pubkey: encode_config(&v.pub_key, URL_SAFE_NO_PAD), + device_name: v.device_name, + }; + Ok(serde_json::to_string(&rv)?) + } + Err(e) => Err(e.into()), + } +} + +#[derive(Serialize, Clone)] +#[serde(rename_all = "camelCase")] +pub struct SignatureVerification { + pub counter: u8, +} + +pub fn verify_signature( + app_id: String, + challenge: String, + sign_data: String, + client_data: String, + key_handle: String, + pub_key: String, +) -> crate::Result { + let challenge_bytes = decode_config(&challenge, URL_SAFE_NO_PAD)?; + let chal = make_challenge(&app_id, challenge_bytes); + let client_data_bytes: Vec = client_data.as_bytes().into(); + let client_data_base64 = encode_config(&client_data_bytes, URL_SAFE_NO_PAD); + let key_handle_bytes = decode_config(&key_handle, URL_SAFE_NO_PAD)?; + let pubkey_bytes = decode_config(&pub_key, URL_SAFE_NO_PAD)?; + let client = U2f::new(app_id); + let mut _counter: u32 = 0; + match client.sign_response( + chal, + Registration { + // here only needs pubkey and keyhandle + key_handle: key_handle_bytes, + pub_key: pubkey_bytes, + attestation_cert: None, + device_name: None, + }, + SignResponse { + // here needs client data and sig data and key_handle + signature_data: sign_data, + client_data: client_data_base64, + key_handle, + }, + _counter, + ) { + Ok(v) => Ok(v), + Err(e) => Err(e.into()), + } +} diff --git a/plugins/autostart/Cargo.toml b/plugins/autostart/Cargo.toml new file mode 100644 index 00000000..3819ec10 --- /dev/null +++ b/plugins/autostart/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "tauri-plugin-autostart" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +auto-launch = "0.3" \ No newline at end of file diff --git a/plugins/autostart/guest-js/dist/index.min.js b/plugins/autostart/guest-js/dist/index.min.js new file mode 100644 index 00000000..ec57b5cc --- /dev/null +++ b/plugins/autostart/guest-js/dist/index.min.js @@ -0,0 +1,17 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +async function isEnabled() { + return await c("plugin:autostart|is_enabled"); +} +async function enable() { + await c("plugin:autostart|enable"); +} +async function disable() { + await c("plugin:autostart|disable"); +} + +export { disable, enable, isEnabled }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/autostart/guest-js/dist/index.min.js.map b/plugins/autostart/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..fe579aa2 --- /dev/null +++ b/plugins/autostart/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n",null],"names":["d","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IAAI,CAAC,CAAC,EAAE,CAACA,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC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mjs new file mode 100644 index 00000000..1ad484b9 --- /dev/null +++ b/plugins/autostart/guest-js/dist/index.mjs @@ -0,0 +1,15 @@ +import { invoke } from '@tauri-apps/api/tauri'; + +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +async function isEnabled() { + return await invoke("plugin:autostart|is_enabled"); +} +async function enable() { + await invoke("plugin:autostart|enable"); +} +async function disable() { + await invoke("plugin:autostart|disable"); +} + +export { disable, enable, isEnabled }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/autostart/guest-js/dist/index.mjs.map b/plugins/autostart/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..3a6571c8 --- /dev/null +++ b/plugins/autostart/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AAMO,eAAe,SAAS,GAAA;AAC7B,IAAA,OAAO,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC;AACrD,CAAC;AAEM,eAAe,MAAM,GAAA;AAC1B,IAAA,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAC1C,CAAC;AAEM,eAAe,OAAO,GAAA;AAC3B,IAAA,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAC3C;;;;"} \ No newline at end of file diff --git a/plugins/autostart/guest-js/index.ts b/plugins/autostart/guest-js/index.ts new file mode 100644 index 00000000..0d43fe6e --- /dev/null +++ b/plugins/autostart/guest-js/index.ts @@ -0,0 +1,17 @@ +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { invoke } from "@tauri-apps/api/tauri"; + +export async function isEnabled(): Promise { + return await invoke("plugin:autostart|is_enabled"); +} + +export async function enable(): Promise { + await invoke("plugin:autostart|enable"); +} + +export async function disable(): Promise { + await invoke("plugin:autostart|disable"); +} diff --git a/plugins/autostart/guest-js/package.json b/plugins/autostart/guest-js/package.json new file mode 100644 index 00000000..acd220b2 --- /dev/null +++ b/plugins/autostart/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-autostart-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/autostart/guest-js/rollup.config.mjs b/plugins/autostart/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/autostart/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/autostart/guest-js/tsconfig.json b/plugins/autostart/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/autostart/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/autostart/src/lib.rs b/plugins/autostart/src/lib.rs new file mode 100644 index 00000000..509e6b3f --- /dev/null +++ b/plugins/autostart/src/lib.rs @@ -0,0 +1,131 @@ +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use auto_launch::{AutoLaunch, AutoLaunchBuilder}; +use serde::{ser::Serializer, Serialize}; +use tauri::{ + command, + plugin::{Builder, TauriPlugin}, + Manager, Runtime, State, +}; + +use std::env::current_exe; + +type Result = std::result::Result; + +#[derive(Debug, Copy, Clone)] +pub enum MacosLauncher { + LaunchAgent, + AppleScript, +} + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + #[error("{0}")] + Anyhow(String), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +pub struct AutoLaunchManager(AutoLaunch); + +impl AutoLaunchManager { + pub fn enable(&self) -> Result<()> { + self.0 + .enable() + .map_err(|e| e.to_string()) + .map_err(Error::Anyhow) + } + + pub fn disable(&self) -> Result<()> { + self.0 + .disable() + .map_err(|e| e.to_string()) + .map_err(Error::Anyhow) + } + + pub fn is_enabled(&self) -> Result { + self.0 + .is_enabled() + .map_err(|e| e.to_string()) + .map_err(Error::Anyhow) + } +} + +pub trait ManagerExt { + fn autolaunch(&self) -> State<'_, AutoLaunchManager>; +} + +impl> ManagerExt for T { + fn autolaunch(&self) -> State<'_, AutoLaunchManager> { + self.state::() + } +} + +#[command] +async fn enable(manager: State<'_, AutoLaunchManager>) -> Result<()> { + manager.enable() +} + +#[command] +async fn disable(manager: State<'_, AutoLaunchManager>) -> Result<()> { + manager.disable() +} + +#[command] +async fn is_enabled(manager: State<'_, AutoLaunchManager>) -> Result { + manager.is_enabled() +} + +/// Initializes the plugin. +/// +/// `args` - are passed to your app on startup. +pub fn init( + macos_launcher: MacosLauncher, + args: Option>, +) -> TauriPlugin { + Builder::new("autostart") + .invoke_handler(tauri::generate_handler![enable, disable, is_enabled]) + .setup(move |app| { + let mut builder = AutoLaunchBuilder::new(); + + builder.set_app_name(&app.package_info().name); + if let Some(args) = args { + builder.set_args(&args); + } + builder.set_use_launch_agent(matches!(macos_launcher, MacosLauncher::LaunchAgent)); + + let current_exe = current_exe()?; + + #[cfg(windows)] + builder.set_app_path(¤t_exe.display().to_string()); + #[cfg(target_os = "macos")] + builder.set_app_path(¤t_exe.canonicalize()?.display().to_string()); + #[cfg(target_os = "linux")] + if let Some(appimage) = app + .env() + .appimage + .and_then(|p| p.to_str().map(|s| s.to_string())) + { + builder.set_app_path(&appimage); + } else { + builder.set_app_path(¤t_exe.display().to_string()); + } + + app.manage(AutoLaunchManager( + builder.build().map_err(|e| e.to_string())?, + )); + Ok(()) + }) + .build() +} diff --git a/plugins/fs-extra/Cargo.toml b/plugins/fs-extra/Cargo.toml new file mode 100644 index 00000000..63d5a13e --- /dev/null +++ b/plugins/fs-extra/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "tauri-plugin-fs-extra" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true \ No newline at end of file diff --git a/plugins/fs-extra/guest-js/dist/index.min.js b/plugins/fs-extra/guest-js/dist/index.min.js new file mode 100644 index 00000000..65055aee --- /dev/null +++ b/plugins/fs-extra/guest-js/dist/index.min.js @@ -0,0 +1,24 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +async function metadata(path) { + return await c("plugin:fs-extra|metadata", { + path, + }).then((metadata) => { + const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata; + return { + accessedAt: new Date(accessedAtMs), + createdAt: new Date(createdAtMs), + modifiedAt: new Date(modifiedAtMs), + ...data, + }; + }); +} +async function exists(path) { + return await c("plugin:fs-extra|exists", { path }); +} + +export { exists, metadata }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/fs-extra/guest-js/dist/index.min.js.map b/plugins/fs-extra/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..c3af6d13 --- /dev/null +++ b/plugins/fs-extra/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n",null],"names":["d","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,C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AAO,MAAMA,CAAM,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D;;;;"} \ No newline at end of file diff --git a/plugins/fs-extra/guest-js/dist/index.mjs b/plugins/fs-extra/guest-js/dist/index.mjs new file mode 100644 index 00000000..0a2b0086 --- /dev/null +++ b/plugins/fs-extra/guest-js/dist/index.mjs @@ -0,0 +1,22 @@ +import { invoke } from '@tauri-apps/api/tauri'; + +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +async function metadata(path) { + return await invoke("plugin:fs-extra|metadata", { + path, + }).then((metadata) => { + const { accessedAtMs, createdAtMs, modifiedAtMs, ...data } = metadata; + return { + accessedAt: new Date(accessedAtMs), + createdAt: new Date(createdAtMs), + modifiedAt: new Date(modifiedAtMs), + ...data, + }; + }); +} +async function exists(path) { + return await invoke("plugin:fs-extra|exists", { path }); +} + +export { exists, metadata }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/fs-extra/guest-js/dist/index.mjs.map b/plugins/fs-extra/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..91824ef2 --- /dev/null +++ b/plugins/fs-extra/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AAiHO,eAAe,QAAQ,CAAC,IAAY,EAAA;AACzC,IAAA,OAAO,MAAM,MAAM,CAAkB,0BAA0B,EAAE;QAC/D,IAAI;AACL,KAAA,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAI;AACnB,QAAA,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,CAAC;QACtE,OAAO;AACL,YAAA,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;AAClC,YAAA,SAAS,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC;AAChC,YAAA,UAAU,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;AAClC,YAAA,GAAG,IAAI;SACR,CAAC;AACJ,KAAC,CAAC,CAAC;AACL,CAAC;AAEM,eAAe,MAAM,CAAC,IAAY,EAAA;IACvC,OAAO,MAAM,MAAM,CAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1D;;;;"} \ No newline at end of file diff --git a/plugins/fs-extra/guest-js/index.ts b/plugins/fs-extra/guest-js/index.ts new file mode 100644 index 00000000..3236f645 --- /dev/null +++ b/plugins/fs-extra/guest-js/index.ts @@ -0,0 +1,130 @@ +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { invoke } from "@tauri-apps/api/tauri"; + +export interface Permissions { + /** + * `true` if these permissions describe a readonly (unwritable) file. + */ + readonly: boolean; + /** + * The underlying raw `st_mode` bits that contain the standard Unix permissions for this file. + */ + mode: number | undefined; +} + +/** + * Metadata information about a file. + * This structure is returned from the `metadata` function or method + * and represents known metadata about a file such as its permissions, size, modification times, etc. + */ +export interface Metadata { + /** + * The last access time of this metadata. + */ + accessedAt: Date; + /** + * The creation time listed in this metadata. + */ + createdAt: Date; + /** + * The last modification time listed in this metadata. + */ + modifiedAt: Date; + /** + * `true` if this metadata is for a directory. + */ + isDir: boolean; + /** + * `true` if this metadata is for a regular file. + */ + isFile: boolean; + /** + * `true` if this metadata is for a symbolic link. + */ + isSymlink: boolean; + /** + * The size of the file, in bytes, this metadata is for. + */ + size: number; + /** + * The permissions of the file this metadata is for. + */ + permissions: Permissions; + /** + * The ID of the device containing the file. Only available on Unix. + */ + dev: number | undefined; + /** + * The inode number. Only available on Unix. + */ + ino: number | undefined; + /** + * The rights applied to this file. Only available on Unix. + */ + mode: number | undefined; + /** + * The number of hard links pointing to this file. Only available on Unix. + */ + nlink: number | undefined; + /** + * The user ID of the owner of this file. Only available on Unix. + */ + uid: number | undefined; + /** + * The group ID of the owner of this file. Only available on Unix. + */ + gid: number | undefined; + /** + * The device ID of this file (if it is a special one). Only available on Unix. + */ + rdev: number | undefined; + /** + * The block size for filesystem I/O. Only available on Unix. + */ + blksize: number | undefined; + /** + * The number of blocks allocated to the file, in 512-byte units. Only available on Unix. + */ + blocks: number | undefined; +} + +interface BackendMetadata { + accessedAtMs: number; + createdAtMs: number; + modifiedAtMs: number; + isDir: boolean; + isFile: boolean; + isSymlink: boolean; + size: number; + permissions: Permissions; + dev: number | undefined; + ino: number | undefined; + mode: number | undefined; + nlink: number | undefined; + uid: number | undefined; + gid: number | undefined; + rdev: number | undefined; + blksize: number | undefined; + blocks: number | undefined; +} + +export async function metadata(path: string): Promise { + return await invoke("plugin:fs-extra|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 async function exists(path: string): Promise { + return await invoke("plugin:fs-extra|exists", { path }); +} diff --git a/plugins/fs-extra/guest-js/package.json b/plugins/fs-extra/guest-js/package.json new file mode 100644 index 00000000..c6d57a10 --- /dev/null +++ b/plugins/fs-extra/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-fs-extra-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/fs-extra/guest-js/rollup.config.mjs b/plugins/fs-extra/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/fs-extra/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/fs-extra/guest-js/tsconfig.json b/plugins/fs-extra/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/fs-extra/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/fs-extra/src/lib.rs b/plugins/fs-extra/src/lib.rs new file mode 100644 index 00000000..286e8508 --- /dev/null +++ b/plugins/fs-extra/src/lib.rs @@ -0,0 +1,145 @@ +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{ser::Serializer, Serialize}; +use tauri::{command, plugin::Plugin, Invoke, Runtime}; + +use std::{ + path::PathBuf, + time::{SystemTime, UNIX_EPOCH}, +}; + +#[cfg(unix)] +use std::os::unix::fs::{MetadataExt, PermissionsExt}; +#[cfg(windows)] +use std::os::windows::fs::MetadataExt; + +type Result = std::result::Result; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct Permissions { + readonly: bool, + #[cfg(unix)] + mode: u32, +} + +#[cfg(unix)] +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct UnixMetadata { + dev: u64, + ino: u64, + mode: u32, + nlink: u64, + uid: u32, + gid: u32, + rdev: u64, + blksize: u64, + blocks: u64, +} + +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +struct Metadata { + accessed_at_ms: u64, + created_at_ms: u64, + modified_at_ms: u64, + is_dir: bool, + is_file: bool, + is_symlink: bool, + size: u64, + permissions: Permissions, + #[cfg(unix)] + #[serde(flatten)] + unix: UnixMetadata, + #[cfg(windows)] + file_attributes: u32, +} + +fn system_time_to_ms(time: std::io::Result) -> u64 { + time.map(|t| { + let duration_since_epoch = t.duration_since(UNIX_EPOCH).unwrap(); + duration_since_epoch.as_millis() as u64 + }) + .unwrap_or_default() +} + +#[command] +async fn metadata(path: PathBuf) -> Result { + let metadata = std::fs::metadata(path)?; + let file_type = metadata.file_type(); + let permissions = metadata.permissions(); + Ok(Metadata { + accessed_at_ms: system_time_to_ms(metadata.accessed()), + created_at_ms: system_time_to_ms(metadata.created()), + modified_at_ms: system_time_to_ms(metadata.modified()), + is_dir: file_type.is_dir(), + is_file: file_type.is_file(), + is_symlink: file_type.is_symlink(), + size: metadata.len(), + permissions: Permissions { + readonly: permissions.readonly(), + #[cfg(unix)] + mode: permissions.mode(), + }, + #[cfg(unix)] + unix: UnixMetadata { + dev: metadata.dev(), + ino: metadata.ino(), + mode: metadata.mode(), + nlink: metadata.nlink(), + uid: metadata.uid(), + gid: metadata.gid(), + rdev: metadata.rdev(), + blksize: metadata.blksize(), + blocks: metadata.blocks(), + }, + #[cfg(windows)] + file_attributes: metadata.file_attributes(), + }) +} + +#[command] +async fn exists(path: PathBuf) -> bool { + path.exists() +} + +/// Tauri plugin. +pub struct FsExtra { + invoke_handler: Box) + Send + Sync>, +} + +impl Default for FsExtra { + fn default() -> Self { + Self { + invoke_handler: Box::new(tauri::generate_handler![exists, metadata]), + } + } +} + +impl Plugin for FsExtra { + fn name(&self) -> &'static str { + "fs-extra" + } + + fn extend_api(&mut self, message: Invoke) { + (self.invoke_handler)(message) + } +} diff --git a/plugins/fs-watch/Cargo.toml b/plugins/fs-watch/Cargo.toml new file mode 100644 index 00000000..0eb232a4 --- /dev/null +++ b/plugins/fs-watch/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "tauri-plugin-fs-watch" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +notify = "4.0" \ No newline at end of file diff --git a/plugins/fs-watch/guest-js/dist/index.min.js b/plugins/fs-watch/guest-js/dist/index.min.js new file mode 100644 index 00000000..bbd71b61 --- /dev/null +++ b/plugins/fs-watch/guest-js/dist/index.min.js @@ -0,0 +1,72 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f$1={};e(f$1,{convertFileSrc:()=>w$1,invoke:()=>c$2,transformCallback:()=>s$2});function u$2(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s$2(e,r=!1){let n=u$2(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c$2(e,r={}){return new Promise((n,t)=>{let o=s$2(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s$2(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w$1(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +async function a(i){return c$2("tauri",i)} + +var W$1={};e(W$1,{TauriEvent:()=>c$1,emit:()=>D,listen:()=>E$1,once:()=>_});async function s$1(n,t){return a({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:t}})}async function m$1(n,t,i){await a({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:t,payload:i}});}async function o$1(n,t,i){return a({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:t,handler:s$2(i)}}).then(r=>async()=>s$1(n,r))}async function u$1(n,t,i){return o$1(n,t,r=>{i(r),s$1(n,r.id).catch(()=>{});})}var c$1=(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.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(c$1||{});async function E$1(n,t){return o$1(n,null,t)}async function _(n,t){return u$1(n,null,t)}async function D(n,t){return m$1(n,void 0,t)} + +var C={};e(C,{CloseRequestedEvent:()=>y,LogicalPosition:()=>c,LogicalSize:()=>m,PhysicalPosition:()=>o,PhysicalSize:()=>l,UserAttentionType:()=>W,WebviewWindow:()=>s,WebviewWindowHandle:()=>u,WindowManager:()=>h,appWindow:()=>b,availableMonitors:()=>T,currentMonitor:()=>E,getAll:()=>M,getCurrent:()=>f,primaryMonitor:()=>z});var m=class{constructor(e,a){this.type="Logical";this.width=e,this.height=a;}},l=class{constructor(e,a){this.type="Physical";this.width=e,this.height=a;}toLogical(e){return new m(this.width/e,this.height/e)}},c=class{constructor(e,a){this.type="Logical";this.x=e,this.y=a;}},o=class{constructor(e,a){this.type="Physical";this.x=e,this.y=a;}toLogical(e){return new c(this.x/e,this.y/e)}},W=(a=>(a[a.Critical=1]="Critical",a[a.Informational=2]="Informational",a))(W||{});function f(){return new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function M(){return window.__TAURI_METADATA__.__windows.map(i=>new s(i.label,{skip:!0}))}var P=["tauri://created","tauri://error"],u=class{constructor(e){this.label=e,this.listeners=Object.create(null);}async listen(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1);}):o$1(e,this.label,a)}async once(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1);}):u$1(e,this.label,a)}async emit(e,a){if(P.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return m$1(e,this.label,a)}_handleTauriEvent(e,a){return P.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},h=class extends u{async scaleFactor(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:a})=>new o(e,a))}async outerPosition(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:a})=>new o(e,a))}async innerSize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:a})=>new l(e,a))}async outerSize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:a})=>new l(e,a))}async isFullscreen(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let a$1=null;return e&&(e===1?a$1={type:"Critical"}:a$1={type:"Informational"}),a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:a$1}}}})}async setResizable(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",a=>{let n=new y(a);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()});})}async onFocusChanged(e){let a=await this.listen("tauri://focus",d=>{e({...d,payload:!0});}),n=await this.listen("tauri://blur",d=>{e({...d,payload:!1});});return ()=>{a(),n();}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let a=await this.listen("tauri://file-drop",r=>{e({...r,payload:{type:"drop",paths:r.payload}});}),n=await this.listen("tauri://file-drop-hover",r=>{e({...r,payload:{type:"hover",paths:r.payload}});}),d=await this.listen("tauri://file-drop-cancelled",r=>{e({...r,payload:{type:"cancel"}});});return ()=>{a(),n(),d();}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},y=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id;}preventDefault(){this._preventDefault=!0;}isPreventDefault(){return this._preventDefault}},s=class extends h{constructor(e,a$1={}){super(e),a$1!=null&&a$1.skip||a({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...a$1}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n));}static getByLabel(e){return M().some(a=>a.label===e)?new s(e,{skip:!0}):null}},b;"__TAURI_METADATA__"in window?b=new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),b=new s("main",{skip:!0}));function g(i){return i===null?null:{name:i.name,scaleFactor:i.scaleFactor,position:new o(i.position.x,i.position.y),size:new l(i.size.width,i.size.height)}}async function E(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(g)}async function z(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(g)}async function T(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(i=>i.map(g))} + +const w = b; +async function unwatch(id) { + await c$2("plugin:fs-watch|unwatch", { id }); +} +async function watch(paths, options, cb) { + const opts = { + recursive: false, + delayMs: 2000, + ...options, + }; + let watchPaths; + if (typeof paths === "string") { + watchPaths = [paths]; + } + else { + watchPaths = paths; + } + const id = window.crypto.getRandomValues(new Uint32Array(1))[0]; + await c$2("plugin:fs-watch|watch", { + id, + paths: watchPaths, + options: opts, + }); + const unlisten = await w.listen(`watcher://debounced-event/${id}`, (event) => { + cb(event.payload); + }); + return () => { + void unwatch(id); + unlisten(); + }; +} +async function watchImmediate(paths, options, cb) { + const opts = { + recursive: false, + ...options, + delayMs: null, + }; + let watchPaths; + if (typeof paths === "string") { + watchPaths = [paths]; + } + else { + watchPaths = paths; + } + const id = window.crypto.getRandomValues(new Uint32Array(1))[0]; + await c$2("plugin:fs-watch|watch", { + id, + paths: watchPaths, + options: opts, + }); + const unlisten = await w.listen(`watcher://raw-event/${id}`, (event) => { + cb(event.payload); + }); + return () => { + void unwatch(id); + unlisten(); + }; +} + +export { watch, watchImmediate }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/fs-watch/guest-js/dist/index.min.js.map b/plugins/fs-watch/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..a1caa25f --- /dev/null +++ b/plugins/fs-watch/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-HNLFKTAJ.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-3WDDWFXT.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-QSWLDHGO.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n","import{b as o}from\"./chunk-RCPA6UVN.js\";async function a(i){return o(\"tauri\",i)}export{a};\n","import{a}from\"./chunk-HNLFKTAJ.js\";import{a as l}from\"./chunk-RCPA6UVN.js\";import{a as d}from\"./chunk-FEIY7W7S.js\";var W={};d(W,{TauriEvent:()=>c,emit:()=>D,listen:()=>E,once:()=>_});async function s(n,t){return a({__tauriModule:\"Event\",message:{cmd:\"unlisten\",event:n,eventId:t}})}async function m(n,t,i){await a({__tauriModule:\"Event\",message:{cmd:\"emit\",event:n,windowLabel:t,payload:i}})}async function o(n,t,i){return a({__tauriModule:\"Event\",message:{cmd:\"listen\",event:n,windowLabel:t,handler:l(i)}}).then(r=>async()=>s(n,r))}async function u(n,t,i){return o(n,t,r=>{i(r),s(n,r.id).catch(()=>{})})}var c=(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.CHECK_UPDATE=\"tauri://update\",e.UPDATE_AVAILABLE=\"tauri://update-available\",e.INSTALL_UPDATE=\"tauri://update-install\",e.STATUS_UPDATE=\"tauri://update-status\",e.DOWNLOAD_PROGRESS=\"tauri://update-download-progress\",e))(c||{});async function E(n,t){return o(n,null,t)}async function _(n,t){return u(n,null,t)}async function D(n,t){return m(n,void 0,t)}export{m as a,o as b,u as c,c as d,E as e,_ as f,D as g,W as h};\n","import{a as p,b as _,c as w}from\"./chunk-3WDDWFXT.js\";import{a as t}from\"./chunk-HNLFKTAJ.js\";import{a as v}from\"./chunk-FEIY7W7S.js\";var C={};v(C,{CloseRequestedEvent:()=>y,LogicalPosition:()=>c,LogicalSize:()=>m,PhysicalPosition:()=>o,PhysicalSize:()=>l,UserAttentionType:()=>W,WebviewWindow:()=>s,WebviewWindowHandle:()=>u,WindowManager:()=>h,appWindow:()=>b,availableMonitors:()=>T,currentMonitor:()=>E,getAll:()=>M,getCurrent:()=>f,primaryMonitor:()=>z});var m=class{constructor(e,a){this.type=\"Logical\";this.width=e,this.height=a}},l=class{constructor(e,a){this.type=\"Physical\";this.width=e,this.height=a}toLogical(e){return new m(this.width/e,this.height/e)}},c=class{constructor(e,a){this.type=\"Logical\";this.x=e,this.y=a}},o=class{constructor(e,a){this.type=\"Physical\";this.x=e,this.y=a}toLogical(e){return new c(this.x/e,this.y/e)}},W=(a=>(a[a.Critical=1]=\"Critical\",a[a.Informational=2]=\"Informational\",a))(W||{});function f(){return new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function M(){return window.__TAURI_METADATA__.__windows.map(i=>new s(i.label,{skip:!0}))}var P=[\"tauri://created\",\"tauri://error\"],u=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1)}):_(e,this.label,a)}async once(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1)}):w(e,this.label,a)}async emit(e,a){if(P.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return p(e,this.label,a)}_handleTauriEvent(e,a){return P.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},h=class extends u{async scaleFactor(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"scaleFactor\"}}}})}async innerPosition(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"innerPosition\"}}}}).then(({x:e,y:a})=>new o(e,a))}async outerPosition(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"outerPosition\"}}}}).then(({x:e,y:a})=>new o(e,a))}async innerSize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"innerSize\"}}}}).then(({width:e,height:a})=>new l(e,a))}async outerSize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"outerSize\"}}}}).then(({width:e,height:a})=>new l(e,a))}async isFullscreen(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isFullscreen\"}}}})}async isMaximized(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isMaximized\"}}}})}async isDecorated(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isDecorated\"}}}})}async isResizable(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isResizable\"}}}})}async isVisible(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isVisible\"}}}})}async theme(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"theme\"}}}})}async center(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"center\"}}}})}async requestUserAttention(e){let a=null;return e&&(e===1?a={type:\"Critical\"}:a={type:\"Informational\"}),t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"requestUserAttention\",payload:a}}}})}async setResizable(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setResizable\",payload:e}}}})}async setTitle(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setTitle\",payload:e}}}})}async maximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"maximize\"}}}})}async unmaximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"unmaximize\"}}}})}async toggleMaximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"toggleMaximize\"}}}})}async minimize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"minimize\"}}}})}async unminimize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"unminimize\"}}}})}async show(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"show\"}}}})}async hide(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"hide\"}}}})}async close(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"close\"}}}})}async setDecorations(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setDecorations\",payload:e}}}})}async setAlwaysOnTop(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setAlwaysOnTop\",payload:e}}}})}async setSize(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setSize\",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setMinSize\",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setMaxSize\",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setPosition\",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setFullscreen\",payload:e}}}})}async setFocus(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setFocus\"}}}})}async setIcon(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setIcon\",payload:{icon:typeof e==\"string\"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setSkipTaskbar\",payload:e}}}})}async setCursorGrab(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorGrab\",payload:e}}}})}async setCursorVisible(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorVisible\",payload:e}}}})}async setCursorIcon(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorIcon\",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorPosition\",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setIgnoreCursorEvents\",payload:e}}}})}async startDragging(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"startDragging\"}}}})}async onResized(e){return this.listen(\"tauri://resize\",e)}async onMoved(e){return this.listen(\"tauri://move\",e)}async onCloseRequested(e){return this.listen(\"tauri://close-requested\",a=>{let n=new y(a);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let a=await this.listen(\"tauri://focus\",d=>{e({...d,payload:!0})}),n=await this.listen(\"tauri://blur\",d=>{e({...d,payload:!1})});return()=>{a(),n()}}async onScaleChanged(e){return this.listen(\"tauri://scale-change\",e)}async onMenuClicked(e){return this.listen(\"tauri://menu\",e)}async onFileDropEvent(e){let a=await this.listen(\"tauri://file-drop\",r=>{e({...r,payload:{type:\"drop\",paths:r.payload}})}),n=await this.listen(\"tauri://file-drop-hover\",r=>{e({...r,payload:{type:\"hover\",paths:r.payload}})}),d=await this.listen(\"tauri://file-drop-cancelled\",r=>{e({...r,payload:{type:\"cancel\"}})});return()=>{a(),n(),d()}}async onThemeChanged(e){return this.listen(\"tauri://theme-changed\",e)}},y=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},s=class extends h{constructor(e,a={}){super(e),a!=null&&a.skip||t({__tauriModule:\"Window\",message:{cmd:\"createWebview\",data:{options:{label:e,...a}}}}).then(async()=>this.emit(\"tauri://created\")).catch(async n=>this.emit(\"tauri://error\",n))}static getByLabel(e){return M().some(a=>a.label===e)?new s(e,{skip:!0}):null}},b;\"__TAURI_METADATA__\"in window?b=new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find \"window.__TAURI_METADATA__\". The \"appWindow\" value will reference the \"main\" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`),b=new s(\"main\",{skip:!0}));function g(i){return i===null?null:{name:i.name,scaleFactor:i.scaleFactor,position:new o(i.position.x,i.position.y),size:new l(i.size.width,i.size.height)}}async function E(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"currentMonitor\"}}}}).then(g)}async function z(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"primaryMonitor\"}}}}).then(g)}async function T(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"availableMonitors\"}}}}).then(i=>i.map(g))}export{m as a,l as b,c,o as d,W as e,f,M as g,u as h,h as i,y as j,s as k,b as l,E as m,z as n,T as o,C as p};\n",null],"names":["f","d","w","c","s","u","o","W","E","m","l","v","_","p","t","a","appWindow","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IAAIA,GAAC,CAAC,EAAE,CAACC,CAAC,CAACD,GAAC,CAAC,CAAC,cAAc,CAAC,IAAIE,GAAC,CAAC,MAAM,CAAC,IAAIC,GAAC,CAAC,iBAAiB,CAAC,IAAIC,GAAC,CAAC,CAAC,CAAC,SAASC,GAAC,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAASD,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAACC,GAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,MA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UAAU,GAAG,KAAK,CAAC;AACpB,KAAA;AAED,IAAA,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhE,MAAMA,GAAM,CAAC,uBAAuB,EAAE;QACpC,EAAE;AACF,QAAA,KAAK,EAAE,UAAU;AACjB,QAAA,OAAO,EAAE,IAAI;AACd,KAAA,CAAC,CAAC;AAEH,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,MAAM,CAC7B,CAAuB,oBAAA,EAAA,EAAE,CAAE,CAAA,EAC3B,CAAC,KAAK,KAAI;AACR,QAAA,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACpB,KAAC,CACF,CAAC;AAEF,IAAA,OAAO,MAAK;AACV,QAAA,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;AACjB,QAAA,QAAQ,EAAE,CAAC;AACb,KAAC,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/plugins/fs-watch/guest-js/dist/index.mjs b/plugins/fs-watch/guest-js/dist/index.mjs new file mode 100644 index 00000000..6d876a15 --- /dev/null +++ b/plugins/fs-watch/guest-js/dist/index.mjs @@ -0,0 +1,64 @@ +import { invoke } from '@tauri-apps/api/tauri'; +import { appWindow } from '@tauri-apps/api/window'; + +const w = appWindow; +async function unwatch(id) { + await invoke("plugin:fs-watch|unwatch", { id }); +} +async function watch(paths, options, cb) { + const opts = { + recursive: false, + delayMs: 2000, + ...options, + }; + let watchPaths; + if (typeof paths === "string") { + watchPaths = [paths]; + } + else { + watchPaths = paths; + } + const id = window.crypto.getRandomValues(new Uint32Array(1))[0]; + await invoke("plugin:fs-watch|watch", { + id, + paths: watchPaths, + options: opts, + }); + const unlisten = await w.listen(`watcher://debounced-event/${id}`, (event) => { + cb(event.payload); + }); + return () => { + void unwatch(id); + unlisten(); + }; +} +async function watchImmediate(paths, options, cb) { + const opts = { + recursive: false, + ...options, + delayMs: null, + }; + let watchPaths; + if (typeof paths === "string") { + watchPaths = [paths]; + } + else { + watchPaths = paths; + } + const id = window.crypto.getRandomValues(new Uint32Array(1))[0]; + await invoke("plugin:fs-watch|watch", { + id, + paths: watchPaths, + options: opts, + }); + const unlisten = await w.listen(`watcher://raw-event/${id}`, (event) => { + cb(event.payload); + }); + return () => { + void unwatch(id); + unlisten(); + }; +} + +export { watch, watchImmediate }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/fs-watch/guest-js/dist/index.mjs.map b/plugins/fs-watch/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..29007a2d --- /dev/null +++ b/plugins/fs-watch/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAIA,MAAM,CAAC,GAAkB,SAAS,CAAC;AA2BnC,eAAe,OAAO,CAAC,EAAU,EAAA;IAC/B,MAAM,MAAM,CAAC,yBAAyB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAClD,CAAC;AAEM,eAAe,KAAK,CACzB,KAAwB,EACxB,OAA8B,EAC9B,EAAmC,EAAA;AAEnC,IAAA,MAAM,IAAI,GAAG;AACX,QAAA,SAAS,EAAE,KAAK;AAChB,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,GAAG,OAAO;KACX,CAAC;AACF,IAAA,IAAI,UAAU,CAAC;AACf,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,UAAU,GAAG,CAAC,KAAK,CAAC,CAAC;AACtB,KAAA;AAAM,SAAA;QACL,UAAU,GAAG,KAAK,CAAC;AACpB,KAAA;AAED,IAAA,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhE,MAAM,MAAM,CAAC,uBAAuB,EAAE;QACpC,EAAE;AACF,Q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AAC,CACF,CAAC;AAEF,IAAA,OAAO,MAAK;AACV,QAAA,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;AACjB,QAAA,QAAQ,EAAE,CAAC;AACb,KAAC,CAAC;AACJ;;;;"} \ No newline at end of file diff --git a/plugins/fs-watch/guest-js/index.ts b/plugins/fs-watch/guest-js/index.ts new file mode 100644 index 00000000..bb16c2c9 --- /dev/null +++ b/plugins/fs-watch/guest-js/index.ts @@ -0,0 +1,110 @@ +import { invoke } from "@tauri-apps/api/tauri"; +import { UnlistenFn } from "@tauri-apps/api/event"; +import { appWindow, WebviewWindow } from "@tauri-apps/api/window"; + +const w: WebviewWindow = appWindow; + +export interface WatchOptions { + recursive?: boolean; +} + +export interface DebouncedWatchOptions extends WatchOptions { + delayMs?: number; +} + +export interface RawEvent { + path: string | null; + operation: number; + cookie: number | null; +} + +export type DebouncedEvent = + | { type: "NoticeWrite"; payload: string } + | { type: "NoticeRemove"; payload: string } + | { type: "Create"; payload: string } + | { type: "Write"; payload: string } + | { type: "Chmod"; payload: string } + | { type: "Remove"; payload: string } + | { type: "Rename"; payload: string } + | { type: "Rescan"; payload: null } + | { type: "Error"; payload: { error: string; path: string | null } }; + +async function unwatch(id: number): Promise { + await invoke("plugin:fs-watch|unwatch", { id }); +} + +export async function watch( + paths: string | string[], + options: DebouncedWatchOptions, + cb: (event: DebouncedEvent) => void +): Promise { + const opts = { + recursive: false, + delayMs: 2000, + ...options, + }; + let watchPaths; + if (typeof paths === "string") { + watchPaths = [paths]; + } else { + watchPaths = paths; + } + + const id = window.crypto.getRandomValues(new Uint32Array(1))[0]; + + await invoke("plugin:fs-watch|watch", { + id, + paths: watchPaths, + options: opts, + }); + + const unlisten = await w.listen( + `watcher://debounced-event/${id}`, + (event) => { + cb(event.payload); + } + ); + + return () => { + void unwatch(id); + unlisten(); + }; +} + +export async function watchImmediate( + paths: string | string[], + options: WatchOptions, + cb: (event: RawEvent) => void +): Promise { + const opts = { + recursive: false, + ...options, + delayMs: null, + }; + let watchPaths; + if (typeof paths === "string") { + watchPaths = [paths]; + } else { + watchPaths = paths; + } + + const id = window.crypto.getRandomValues(new Uint32Array(1))[0]; + + await invoke("plugin:fs-watch|watch", { + id, + paths: watchPaths, + options: opts, + }); + + const unlisten = await w.listen( + `watcher://raw-event/${id}`, + (event) => { + cb(event.payload); + } + ); + + return () => { + void unwatch(id); + unlisten(); + }; +} diff --git a/plugins/fs-watch/guest-js/package.json b/plugins/fs-watch/guest-js/package.json new file mode 100644 index 00000000..b9f55dbe --- /dev/null +++ b/plugins/fs-watch/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-fs-watch-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/fs-watch/guest-js/rollup.config.mjs b/plugins/fs-watch/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/fs-watch/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/fs-watch/guest-js/tsconfig.json b/plugins/fs-watch/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/fs-watch/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/fs-watch/src/lib.rs b/plugins/fs-watch/src/lib.rs new file mode 100644 index 00000000..facf3298 --- /dev/null +++ b/plugins/fs-watch/src/lib.rs @@ -0,0 +1,189 @@ +use notify::{ + raw_watcher, watcher, DebouncedEvent, Op, RawEvent, RecommendedWatcher, RecursiveMode, + Watcher as _, +}; +use serde::{ser::Serializer, Deserialize, Serialize}; +use serde_json::Value as JsonValue; +use tauri::{command, plugin::Plugin, AppHandle, Invoke, Manager, Runtime, State, Window}; + +use std::{ + collections::HashMap, + path::PathBuf, + sync::{ + mpsc::{channel, Receiver}, + Mutex, + }, + thread::spawn, + time::Duration, +}; + +type Result = std::result::Result; +type Id = u32; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Watch(#[from] notify::Error), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +#[derive(Default)] +struct WatcherCollection(Mutex)>>); + +#[derive(Clone, Serialize)] +struct RawEventWrapper { + path: Option, + operation: u32, + cookie: Option, +} + +#[derive(Clone, Serialize)] +#[serde(tag = "type", content = "payload")] +enum DebouncedEventWrapper { + NoticeWrite(PathBuf), + NoticeRemove(PathBuf), + Create(PathBuf), + Write(PathBuf), + Chmod(PathBuf), + Remove(PathBuf), + Rename(PathBuf, PathBuf), + Rescan, + Error { + error: String, + path: Option, + }, +} + +impl From for DebouncedEventWrapper { + fn from(event: DebouncedEvent) -> Self { + match event { + DebouncedEvent::NoticeWrite(path) => Self::NoticeWrite(path), + DebouncedEvent::NoticeRemove(path) => Self::NoticeRemove(path), + DebouncedEvent::Create(path) => Self::Create(path), + DebouncedEvent::Write(path) => Self::Write(path), + DebouncedEvent::Chmod(path) => Self::Chmod(path), + DebouncedEvent::Remove(path) => Self::Remove(path), + DebouncedEvent::Rename(from, to) => Self::Rename(from, to), + DebouncedEvent::Rescan => Self::Rescan, + DebouncedEvent::Error(error, path) => Self::Error { + error: error.to_string(), + path, + }, + } + } +} + +fn watch_raw(window: Window, rx: Receiver, id: Id) { + spawn(move || { + let event_name = format!("watcher://raw-event/{}", id); + while let Ok(event) = rx.recv() { + let _ = window.emit( + &event_name, + RawEventWrapper { + path: event.path, + operation: event.op.unwrap_or_else(|_| Op::empty()).bits(), + cookie: event.cookie, + }, + ); + } + }); +} + +fn watch_debounced(window: Window, rx: Receiver, id: Id) { + spawn(move || { + let event_name = format!("watcher://debounced-event/{}", id); + while let Ok(event) = rx.recv() { + let _ = window.emit(&event_name, DebouncedEventWrapper::from(event)); + } + }); +} + +#[derive(Deserialize)] +#[serde(rename_all = "camelCase")] +struct WatchOptions { + delay_ms: Option, + recursive: bool, +} + +#[command] +async fn watch( + window: Window, + watchers: State<'_, WatcherCollection>, + id: Id, + paths: Vec, + options: WatchOptions, +) -> Result<()> { + let mode = if options.recursive { + RecursiveMode::Recursive + } else { + RecursiveMode::NonRecursive + }; + + let watcher = if let Some(delay) = options.delay_ms { + let (tx, rx) = channel(); + let mut watcher = watcher(tx, Duration::from_millis(delay))?; + for path in &paths { + watcher.watch(path, mode)?; + } + watch_debounced(window, rx, id); + watcher + } else { + let (tx, rx) = channel(); + let mut watcher = raw_watcher(tx)?; + for path in &paths { + watcher.watch(path, mode)?; + } + watch_raw(window, rx, id); + watcher + }; + + watchers.0.lock().unwrap().insert(id, (watcher, paths)); + + Ok(()) +} + +#[command] +async fn unwatch(watchers: State<'_, WatcherCollection>, id: Id) -> Result<()> { + if let Some((mut watcher, paths)) = watchers.0.lock().unwrap().remove(&id) { + for path in paths { + watcher.unwatch(path)?; + } + } + Ok(()) +} + +/// Tauri plugin. +pub struct Watcher { + invoke_handler: Box) + Send + Sync>, +} + +impl Default for Watcher { + fn default() -> Self { + Self { + invoke_handler: Box::new(tauri::generate_handler![watch, unwatch]), + } + } +} + +impl Plugin for Watcher { + fn name(&self) -> &'static str { + "fs-watch" + } + + fn initialize(&mut self, app: &AppHandle, _config: JsonValue) -> tauri::plugin::Result<()> { + app.manage(WatcherCollection::default()); + Ok(()) + } + + fn extend_api(&mut self, message: Invoke) { + (self.invoke_handler)(message) + } +} diff --git a/plugins/localhost/Cargo.toml b/plugins/localhost/Cargo.toml new file mode 100644 index 00000000..5c20919d --- /dev/null +++ b/plugins/localhost/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "tauri-plugin-localhost" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +tiny_http = "0.11" +http = "0.2" \ No newline at end of file diff --git a/plugins/localhost/src/lib.rs b/plugins/localhost/src/lib.rs new file mode 100644 index 00000000..b358956c --- /dev/null +++ b/plugins/localhost/src/lib.rs @@ -0,0 +1,118 @@ +// Copyright 2019-2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use std::collections::HashMap; + +use http::Uri; +use tauri::{ + plugin::{Builder as PluginBuilder, TauriPlugin}, + Runtime, +}; +use tiny_http::{Header, Response as HttpResponse, Server}; + +pub struct Request { + url: String, +} + +impl Request { + pub fn url(&self) -> &str { + &self.url + } +} + +pub struct Response { + headers: HashMap, +} + +impl Response { + pub fn add_header, V: Into>(&mut self, header: H, value: V) { + self.headers.insert(header.into(), value.into()); + } +} + +type OnRequest = Option>; + +pub struct Builder { + port: u16, + on_request: OnRequest, +} + +impl Builder { + pub fn new(port: u16) -> Self { + Self { + port, + on_request: None, + } + } + + pub fn on_request( + mut self, + f: F, + ) -> Self { + self.on_request.replace(Box::new(f)); + self + } + + pub fn build(mut self) -> TauriPlugin { + let port = self.port; + let on_request = self.on_request.take(); + + PluginBuilder::new("localhost") + .setup(move |app| { + let asset_resolver = app.asset_resolver(); + std::thread::spawn(move || { + let server = Server::http(&format!("localhost:{}", port)) + .expect("Unable to spawn server"); + for req in server.incoming_requests() { + let path = req + .url() + .parse::() + .map(|uri| uri.path().into()) + .unwrap_or_else(|_| req.url().into()); + + #[allow(unused_mut)] + if let Some(mut asset) = asset_resolver.get(path) { + let request = Request { + url: req.url().into(), + }; + let mut response = Response { + headers: Default::default(), + }; + + response.add_header("Content-Type", asset.mime_type); + if let Some(csp) = asset.csp_header { + response + .headers + .insert("Content-Security-Policy".into(), csp); + } + + if let Some(on_request) = &on_request { + on_request(&request, &mut response); + } + + #[cfg(target_os = "linux")] + if let Some(response_csp) = + response.headers.get("Content-Security-Policy") + { + let html = String::from_utf8_lossy(&asset.bytes); + let body = + html.replacen(tauri::utils::html::CSP_TOKEN, response_csp, 1); + asset.bytes = body.as_bytes().to_vec(); + } + + let mut resp = HttpResponse::from_data(asset.bytes); + for (header, value) in response.headers { + if let Ok(h) = Header::from_bytes(header.as_bytes(), value) { + resp.add_header(h); + } + } + req.respond(resp).expect("unable to setup response"); + } + } + }); + Ok(()) + }) + .build() + } +} diff --git a/plugins/log/Cargo.toml b/plugins/log/Cargo.toml new file mode 100644 index 00000000..ac30ee68 --- /dev/null +++ b/plugins/log/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "log" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +serde_repr = "0.1" +byte-unit = "4.0" +fern = "0.6" +log = { workspace = true, features = ["kv_unstable"] } +time = { version = "0.3", features = ["formatting"] } \ No newline at end of file diff --git a/plugins/log/guest-js/dist/index.min.js b/plugins/log/guest-js/dist/index.min.js new file mode 100644 index 00000000..0bc3a7aa --- /dev/null +++ b/plugins/log/guest-js/dist/index.min.js @@ -0,0 +1,176 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c$1,transformCallback:()=>s$1});function u$1(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s$1(e,r=!1){let n=u$1(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c$1(e,r={}){return new Promise((n,t)=>{let o=s$1(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s$1(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +async function a(i){return c$1("tauri",i)} + +var W={};e(W,{TauriEvent:()=>c,emit:()=>D,listen:()=>E,once:()=>_});async function s(n,t){return a({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:t}})}async function m(n,t,i){await a({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:t,payload:i}});}async function o(n,t,i){return a({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:t,handler:s$1(i)}}).then(r=>async()=>s(n,r))}async function u(n,t,i){return o(n,t,r=>{i(r),s(n,r.id).catch(()=>{});})}var c=(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.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(c||{});async function E(n,t){return o(n,null,t)}async function _(n,t){return u(n,null,t)}async function D(n,t){return m(n,void 0,t)} + +var LogLevel; +(function (LogLevel) { + /** + * The "trace" level. + * + * Designates very low priority, often extremely verbose, information. + */ + LogLevel[LogLevel["Trace"] = 1] = "Trace"; + /** + * The "debug" level. + * + * Designates lower priority information. + */ + LogLevel[LogLevel["Debug"] = 2] = "Debug"; + /** + * The "info" level. + * + * Designates useful information. + */ + LogLevel[LogLevel["Info"] = 3] = "Info"; + /** + * The "warn" level. + * + * Designates hazardous situations. + */ + LogLevel[LogLevel["Warn"] = 4] = "Warn"; + /** + * The "error" level. + * + * Designates very serious errors. + */ + LogLevel[LogLevel["Error"] = 5] = "Error"; +})(LogLevel || (LogLevel = {})); +async function log(level, message, options) { + var _a, _b; + const traces = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.split("\n").map((line) => line.split("@")); + const filtered = traces === null || traces === void 0 ? void 0 : traces.filter(([name, location]) => { + return name.length > 0 && location !== "[native code]"; + }); + const { file, line, ...keyValues } = options !== null && options !== void 0 ? options : {}; + await c$1("plugin:log|log", { + level, + message, + location: (_b = filtered === null || filtered === void 0 ? void 0 : filtered[0]) === null || _b === void 0 ? void 0 : _b.filter((v) => v.length > 0).join("@"), + file, + line, + keyValues, + }); +} +/** + * Logs a message at the error level. + * + * @param message + * + * # Examples + * + * ```js + * import { error } from 'tauri-plugin-log-api'; + * + * const err_info = "No connection"; + * const port = 22; + * + * error(`Error: ${err_info} on port ${port}`); + * ``` + */ +async function error(message, options) { + await log(LogLevel.Error, message, options); +} +/** + * Logs a message at the warn level. + * + * @param message + * + * # Examples + * + * ```js + * import { warn } from 'tauri-plugin-log-api'; + * + * const warn_description = "Invalid Input"; + * + * warn(`Warning! {warn_description}!`); + * ``` + */ +async function warn(message, options) { + await log(LogLevel.Warn, message, options); +} +/** + * Logs a message at the info level. + * + * @param message + * + * # Examples + * + * ```js + * import { info } from 'tauri-plugin-log-api'; + * + * const conn_info = { port: 40, speed: 3.20 }; + * + * info(`Connected to port {conn_info.port} at {conn_info.speed} Mb/s`); + * ``` + */ +async function info(message, options) { + await log(LogLevel.Info, message, options); +} +/** + * Logs a message at the debug level. + * + * @param message + * + * # Examples + * + * ```js + * import { debug } from 'tauri-plugin-log-api'; + * + * const pos = { x: 3.234, y: -1.223 }; + * + * debug(`New position: x: {pos.x}, y: {pos.y}`); + * ``` + */ +async function debug(message, options) { + await log(LogLevel.Debug, message, options); +} +/** + * Logs a message at the trace level. + * + * @param message + * + * # Examples + * + * ```js + * import { trace } from 'tauri-plugin-log-api'; + * + * let pos = { x: 3.234, y: -1.223 }; + * + * trace(`Position is: x: {pos.x}, y: {pos.y}`); + * ``` + */ +async function trace(message, options) { + await log(LogLevel.Trace, message, options); +} +async function attachConsole() { + return await E("log://log", (event) => { + const payload = event.payload; + switch (payload.level) { + case LogLevel.Trace: + console.log(payload.message); + break; + case LogLevel.Debug: + console.debug(payload.message); + break; + case LogLevel.Info: + console.info(payload.message); + break; + case LogLevel.Warn: + console.warn(payload.message); + break; + case LogLevel.Error: + console.error(payload.message); + break; + default: + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + throw new Error(`unknown log level ${payload.level}`); + } + }); +} + +export { attachConsole, debug, error, info, trace, warn }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/log/guest-js/dist/index.min.js.map b/plugins/log/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..47880b2d --- /dev/null +++ b/plugins/log/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-HNLFKTAJ.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-3WDDWFXT.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n","import{b as o}from\"./chunk-RCPA6UVN.js\";async function a(i){return o(\"tauri\",i)}export{a};\n","import{a}from\"./chunk-HNLFKTAJ.js\";import{a as l}from\"./chunk-RCPA6UVN.js\";import{a as d}from\"./chunk-FEIY7W7S.js\";var W={};d(W,{TauriEvent:()=>c,emit:()=>D,listen:()=>E,once:()=>_});async function s(n,t){return a({__tauriModule:\"Event\",message:{cmd:\"unlisten\",event:n,eventId:t}})}async function m(n,t,i){await a({__tauriModule:\"Event\",message:{cmd:\"emit\",event:n,windowLabel:t,payload:i}})}async function o(n,t,i){return a({__tauriModule:\"Event\",message:{cmd:\"listen\",event:n,windowLabel:t,handler:l(i)}}).then(r=>async()=>s(n,r))}async function u(n,t,i){return o(n,t,r=>{i(r),s(n,r.id).catch(()=>{})})}var c=(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.CHECK_UPDATE=\"tauri://update\",e.UPDATE_AVAILABLE=\"tauri://update-available\",e.INSTALL_UPDATE=\"tauri://update-install\",e.STATUS_UPDATE=\"tauri://update-status\",e.DOWNLOAD_PROGRESS=\"tauri://update-download-progress\",e))(c||{});async function E(n,t){return o(n,null,t)}async function _(n,t){return u(n,null,t)}async function D(n,t){return m(n,void 0,t)}export{m as a,o as b,u as c,c as d,E as e,_ as f,D as g,W as h};\n",null],"names":["d","c","s","u","o","l","invoke","listen"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IAAI,CAAC,CAAC,EAAE,CAACA,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAIC,GAAC,CAAC,iBAAiB,CAAC,IAAIC,GAAC,CAAC,CAAC,CAAC,SAASC,GAAC,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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guest-js/dist/index.mjs new file mode 100644 index 00000000..0290a40f --- /dev/null +++ b/plugins/log/guest-js/dist/index.mjs @@ -0,0 +1,171 @@ +import { invoke } from '@tauri-apps/api/tauri'; +import { listen } from '@tauri-apps/api/event'; + +var LogLevel; +(function (LogLevel) { + /** + * The "trace" level. + * + * Designates very low priority, often extremely verbose, information. + */ + LogLevel[LogLevel["Trace"] = 1] = "Trace"; + /** + * The "debug" level. + * + * Designates lower priority information. + */ + LogLevel[LogLevel["Debug"] = 2] = "Debug"; + /** + * The "info" level. + * + * Designates useful information. + */ + LogLevel[LogLevel["Info"] = 3] = "Info"; + /** + * The "warn" level. + * + * Designates hazardous situations. + */ + LogLevel[LogLevel["Warn"] = 4] = "Warn"; + /** + * The "error" level. + * + * Designates very serious errors. + */ + LogLevel[LogLevel["Error"] = 5] = "Error"; +})(LogLevel || (LogLevel = {})); +async function log(level, message, options) { + var _a, _b; + const traces = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.split("\n").map((line) => line.split("@")); + const filtered = traces === null || traces === void 0 ? void 0 : traces.filter(([name, location]) => { + return name.length > 0 && location !== "[native code]"; + }); + const { file, line, ...keyValues } = options !== null && options !== void 0 ? options : {}; + await invoke("plugin:log|log", { + level, + message, + location: (_b = filtered === null || filtered === void 0 ? void 0 : filtered[0]) === null || _b === void 0 ? void 0 : _b.filter((v) => v.length > 0).join("@"), + file, + line, + keyValues, + }); +} +/** + * Logs a message at the error level. + * + * @param message + * + * # Examples + * + * ```js + * import { error } from 'tauri-plugin-log-api'; + * + * const err_info = "No connection"; + * const port = 22; + * + * error(`Error: ${err_info} on port ${port}`); + * ``` + */ +async function error(message, options) { + await log(LogLevel.Error, message, options); +} +/** + * Logs a message at the warn level. + * + * @param message + * + * # Examples + * + * ```js + * import { warn } from 'tauri-plugin-log-api'; + * + * const warn_description = "Invalid Input"; + * + * warn(`Warning! {warn_description}!`); + * ``` + */ +async function warn(message, options) { + await log(LogLevel.Warn, message, options); +} +/** + * Logs a message at the info level. + * + * @param message + * + * # Examples + * + * ```js + * import { info } from 'tauri-plugin-log-api'; + * + * const conn_info = { port: 40, speed: 3.20 }; + * + * info(`Connected to port {conn_info.port} at {conn_info.speed} Mb/s`); + * ``` + */ +async function info(message, options) { + await log(LogLevel.Info, message, options); +} +/** + * Logs a message at the debug level. + * + * @param message + * + * # Examples + * + * ```js + * import { debug } from 'tauri-plugin-log-api'; + * + * const pos = { x: 3.234, y: -1.223 }; + * + * debug(`New position: x: {pos.x}, y: {pos.y}`); + * ``` + */ +async function debug(message, options) { + await log(LogLevel.Debug, message, options); +} +/** + * Logs a message at the trace level. + * + * @param message + * + * # Examples + * + * ```js + * import { trace } from 'tauri-plugin-log-api'; + * + * let pos = { x: 3.234, y: -1.223 }; + * + * trace(`Position is: x: {pos.x}, y: {pos.y}`); + * ``` + */ +async function trace(message, options) { + await log(LogLevel.Trace, message, options); +} +async function attachConsole() { + return await listen("log://log", (event) => { + const payload = event.payload; + switch (payload.level) { + case LogLevel.Trace: + console.log(payload.message); + break; + case LogLevel.Debug: + console.debug(payload.message); + break; + case LogLevel.Info: + console.info(payload.message); + break; + case LogLevel.Warn: + console.warn(payload.message); + break; + case LogLevel.Error: + console.error(payload.message); + break; + default: + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + throw new Error(`unknown log level ${payload.level}`); + } + }); +} + +export { attachConsole, debug, error, info, trace, warn }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/log/guest-js/dist/index.mjs.map b/plugins/log/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..b64ffe4b --- /dev/null +++ b/plugins/log/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAQA,IAAK,QA+BJ,CAAA;AA/BD,CAAA,UAAK,QAAQ,EAAA;AACX;;;;AAIG;AACH,IAAA,QAAA,CAAA,QAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,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Aa,GAAA;IACjC,OAAO,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,KAAI;AACzC,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAwB,CAAC;QAE/C,QAAQ,OAAO,CAAC,KAAK;YACnB,KAAK,QAAQ,CAAC,KAAK;AACjB,gBAAA,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC7B,MAAM;YACR,KAAK,QAAQ,CAAC,KAAK;AACjB,gBAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/B,MAAM;YACR,KAAK,QAAQ,CAAC,IAAI;AAChB,gBAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC9B,MAAM;YACR,KAAK,QAAQ,CAAC,IAAI;AAChB,gBAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC9B,MAAM;YACR,KAAK,QAAQ,CAAC,KAAK;AACjB,gBAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/B,MAAM;AACR,YAAA;;gBAEE,MAAM,IAAI,KAAK,CAAC,CAAA,kBAAA,EAAqB,OAAO,CAAC,KAAK,CAAE,CAAA,CAAC,CAAC;AACzD,SAAA;AACH,KAAC,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts new file mode 100644 index 00000000..0f35ff83 --- /dev/null +++ b/plugins/log/guest-js/index.ts @@ -0,0 +1,206 @@ +import { invoke } from "@tauri-apps/api/tauri"; +import { listen, UnlistenFn } from "@tauri-apps/api/event"; + +export type LogOptions = { + file?: string; + line?: number; +} & Record; + +enum LogLevel { + /** + * The "trace" level. + * + * Designates very low priority, often extremely verbose, information. + */ + Trace = 1, + /** + * The "debug" level. + * + * Designates lower priority information. + */ + Debug, + /** + * The "info" level. + * + * Designates useful information. + */ + Info, + /** + * The "warn" level. + * + * Designates hazardous situations. + */ + Warn, + /** + * The "error" level. + * + * Designates very serious errors. + */ + Error, +} + +async function log( + level: LogLevel, + message: string, + options?: LogOptions +): Promise { + const traces = new Error().stack?.split("\n").map((line) => line.split("@")); + + const filtered = traces?.filter(([name, location]) => { + return name.length > 0 && location !== "[native code]"; + }); + + const { file, line, ...keyValues } = options ?? {}; + + await invoke("plugin:log|log", { + level, + message, + location: filtered?.[0]?.filter((v) => v.length > 0).join("@"), + file, + line, + keyValues, + }); +} + +/** + * Logs a message at the error level. + * + * @param message + * + * # Examples + * + * ```js + * import { error } from 'tauri-plugin-log-api'; + * + * const err_info = "No connection"; + * const port = 22; + * + * error(`Error: ${err_info} on port ${port}`); + * ``` + */ +export async function error( + message: string, + options?: LogOptions +): Promise { + await log(LogLevel.Error, message, options); +} + +/** + * Logs a message at the warn level. + * + * @param message + * + * # Examples + * + * ```js + * import { warn } from 'tauri-plugin-log-api'; + * + * const warn_description = "Invalid Input"; + * + * warn(`Warning! {warn_description}!`); + * ``` + */ +export async function warn( + message: string, + options?: LogOptions +): Promise { + await log(LogLevel.Warn, message, options); +} + +/** + * Logs a message at the info level. + * + * @param message + * + * # Examples + * + * ```js + * import { info } from 'tauri-plugin-log-api'; + * + * const conn_info = { port: 40, speed: 3.20 }; + * + * info(`Connected to port {conn_info.port} at {conn_info.speed} Mb/s`); + * ``` + */ +export async function info( + message: string, + options?: LogOptions +): Promise { + await log(LogLevel.Info, message, options); +} + +/** + * Logs a message at the debug level. + * + * @param message + * + * # Examples + * + * ```js + * import { debug } from 'tauri-plugin-log-api'; + * + * const pos = { x: 3.234, y: -1.223 }; + * + * debug(`New position: x: {pos.x}, y: {pos.y}`); + * ``` + */ +export async function debug( + message: string, + options?: LogOptions +): Promise { + await log(LogLevel.Debug, message, options); +} + +/** + * Logs a message at the trace level. + * + * @param message + * + * # Examples + * + * ```js + * import { trace } from 'tauri-plugin-log-api'; + * + * let pos = { x: 3.234, y: -1.223 }; + * + * trace(`Position is: x: {pos.x}, y: {pos.y}`); + * ``` + */ +export async function trace( + message: string, + options?: LogOptions +): Promise { + await log(LogLevel.Trace, message, options); +} + +interface RecordPayload { + level: LogLevel; + message: string; +} + +export async function attachConsole(): Promise { + return await listen("log://log", (event) => { + const payload = event.payload as RecordPayload; + + switch (payload.level) { + case LogLevel.Trace: + console.log(payload.message); + break; + case LogLevel.Debug: + console.debug(payload.message); + break; + case LogLevel.Info: + console.info(payload.message); + break; + case LogLevel.Warn: + console.warn(payload.message); + break; + case LogLevel.Error: + console.error(payload.message); + break; + default: + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + throw new Error(`unknown log level ${payload.level}`); + } + }); +} diff --git a/plugins/log/guest-js/package.json b/plugins/log/guest-js/package.json new file mode 100644 index 00000000..54547b11 --- /dev/null +++ b/plugins/log/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-log", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/log/guest-js/rollup.config.mjs b/plugins/log/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/log/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/log/guest-js/tsconfig.json b/plugins/log/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/log/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs new file mode 100644 index 00000000..89ee1ff4 --- /dev/null +++ b/plugins/log/src/lib.rs @@ -0,0 +1,350 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use fern::FormatCallback; +use log::{logger, RecordBuilder}; +use log::{LevelFilter, Record}; +use serde::Serialize; +use serde_repr::{Deserialize_repr, Serialize_repr}; +use std::borrow::Cow; +use std::collections::HashMap; +use std::{ + fmt::Arguments, + fs::{self, File}, + iter::FromIterator, + path::{Path, PathBuf}, +}; +use tauri::{ + plugin::{self, TauriPlugin}, + Manager, Runtime, +}; + +pub use fern; + +const DEFAULT_MAX_FILE_SIZE: u128 = 40000; +const DEFAULT_ROTATION_STRATEGY: RotationStrategy = RotationStrategy::KeepOne; +const DEFAULT_LOG_TARGETS: [LogTarget; 2] = [LogTarget::Stdout, LogTarget::LogDir]; + +/// An enum representing the available verbosity levels of the logger. +/// +/// It is very similar to the [`log::Level`], but serializes to unsigned ints instead of strings. +#[derive(Debug, Clone, Deserialize_repr, Serialize_repr)] +#[repr(u16)] +pub enum LogLevel { + /// The "trace" level. + /// + /// Designates very low priority, often extremely verbose, information. + Trace = 1, + /// The "debug" level. + /// + /// Designates lower priority information. + Debug, + /// The "info" level. + /// + /// Designates useful information. + Info, + /// The "warn" level. + /// + /// Designates hazardous situations. + Warn, + /// The "error" level. + /// + /// Designates very serious errors. + Error, +} + +impl From for log::Level { + fn from(log_level: LogLevel) -> Self { + match log_level { + LogLevel::Trace => log::Level::Trace, + LogLevel::Debug => log::Level::Debug, + LogLevel::Info => log::Level::Info, + LogLevel::Warn => log::Level::Warn, + LogLevel::Error => log::Level::Error, + } + } +} + +impl From for LogLevel { + fn from(log_level: log::Level) -> Self { + match log_level { + log::Level::Trace => LogLevel::Trace, + log::Level::Debug => LogLevel::Debug, + log::Level::Info => LogLevel::Info, + log::Level::Warn => LogLevel::Warn, + log::Level::Error => LogLevel::Error, + } + } +} + +pub enum RotationStrategy { + KeepAll, + KeepOne, +} + +#[derive(Debug, Serialize, Clone)] +struct RecordPayload { + message: String, + level: LogLevel, +} + +/// An enum representing the available targets of the logger. +pub enum LogTarget { + /// Print logs to stdout. + Stdout, + /// Print logs to stderr. + Stderr, + /// Write logs to the given directory. + /// + /// The plugin will ensure the directory exists before writing logs. + Folder(PathBuf), + /// Write logs to the OS specififc logs directory. + /// + /// ### Platform-specific + /// + /// |Platform | Value | Example | + /// | ------- | --------------------------------------------- | ---------------------------------------------- | + /// | Linux | `{configDir}/{bundleIdentifier}` | `/home/alice/.config/com.tauri.dev` | + /// | macOS | `{homeDir}/Library/Logs/{bundleIdentifier}` | `/Users/Alice/Library/Logs/com.tauri.dev` | + /// | Windows | `{configDir}/{bundleIdentifier}` | `C:\Users\Alice\AppData\Roaming\com.tauri.dev` | + LogDir, + /// Forward logs to the webview (via the `log://log` event). + /// + /// This requires the webview to subscribe to log events, via this plugins `attachConsole` function. + Webview, +} + +#[tauri::command] +fn log( + level: LogLevel, + message: String, + location: Option<&str>, + file: Option<&str>, + line: Option, + key_values: Option>, +) { + let location = location.unwrap_or("webview"); + let mut builder = RecordBuilder::new(); + builder + .target(location) + .level(level.into()) + .file(file) + .line(line); + + let key_values = key_values.unwrap_or_default(); + let mut kv = HashMap::new(); + for (k, v) in key_values.iter() { + kv.insert(k.as_str(), v.as_str()); + } + builder.key_values(&kv); + + logger().log(&builder.args(format_args!("{message}")).build()); +} + +pub struct LoggerBuilder { + dispatch: fern::Dispatch, + rotation_strategy: RotationStrategy, + max_file_size: u128, + targets: Vec, +} + +impl Default for LoggerBuilder { + fn default() -> Self { + let format = + time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") + .unwrap(); + let dispatch = fern::Dispatch::new().format(move |out, message, record| { + out.finish(format_args!( + "{}[{}][{}] {}", + time::OffsetDateTime::now_utc().format(&format).unwrap(), + record.target(), + record.level(), + message + )) + }); + Self { + dispatch, + rotation_strategy: DEFAULT_ROTATION_STRATEGY, + max_file_size: DEFAULT_MAX_FILE_SIZE, + targets: DEFAULT_LOG_TARGETS.into(), + } + } +} + +impl LoggerBuilder { + pub fn new() -> Self { + Default::default() + } + + pub fn rotation_strategy(mut self, rotation_strategy: RotationStrategy) -> Self { + self.rotation_strategy = rotation_strategy; + self + } + + pub fn max_file_size(mut self, max_file_size: u128) -> Self { + self.max_file_size = max_file_size; + self + } + + pub fn format(mut self, formatter: F) -> Self + where + F: Fn(FormatCallback, &Arguments, &Record) + Sync + Send + 'static, + { + self.dispatch = self.dispatch.format(formatter); + self + } + + pub fn level(mut self, level_filter: impl Into) -> Self { + self.dispatch = self.dispatch.level(level_filter.into()); + self + } + + pub fn level_for(mut self, module: impl Into>, level: LevelFilter) -> Self { + self.dispatch = self.dispatch.level_for(module, level); + self + } + + pub fn filter(mut self, filter: F) -> Self + where + F: Fn(&log::Metadata) -> bool + Send + Sync + 'static, + { + self.dispatch = self.dispatch.filter(filter); + self + } + + pub fn target(mut self, target: LogTarget) -> Self { + self.targets.push(target); + self + } + + pub fn targets(mut self, targets: impl IntoIterator) -> Self { + self.targets = Vec::from_iter(targets); + self + } + + #[cfg(feature = "colored")] + pub fn with_colors(self, colors: fern::colors::ColoredLevelConfig) -> Self { + let format = + time::format_description::parse("[[[year]-[month]-[day]][[[hour]:[minute]:[second]]") + .unwrap(); + self.format(move |out, message, record| { + out.finish(format_args!( + "{}[{}][{}] {}", + time::OffsetDateTime::now_utc().format(&format).unwrap(), + record.target(), + colors.color(record.level()), + message + )) + }) + } + + pub fn build(mut self) -> TauriPlugin { + plugin::Builder::new("log") + .invoke_handler(tauri::generate_handler![log]) + .setup(move |app_handle| { + let app_name = &app_handle.package_info().name; + + // setup targets + for target in &self.targets { + self.dispatch = self.dispatch.chain(match target { + LogTarget::Stdout => fern::Output::from(std::io::stdout()), + LogTarget::Stderr => fern::Output::from(std::io::stderr()), + LogTarget::Folder(path) => { + if !path.exists() { + fs::create_dir_all(&path).unwrap(); + } + + fern::log_file(get_log_file_path( + &path, + app_name, + &self.rotation_strategy, + self.max_file_size, + )?)? + .into() + } + LogTarget::LogDir => { + let path = app_handle.path_resolver().log_dir().unwrap(); + if !path.exists() { + fs::create_dir_all(&path).unwrap(); + } + + fern::log_file(get_log_file_path( + &path, + app_name, + &self.rotation_strategy, + self.max_file_size, + )?)? + .into() + } + LogTarget::Webview => { + let app_handle = app_handle.clone(); + + fern::Output::call(move |record| { + let payload = RecordPayload { + message: record.args().to_string(), + level: record.level().into(), + }; + let app_handle = app_handle.clone(); + tauri::async_runtime::spawn(async move { + app_handle.emit_all("log://log", payload).unwrap(); + }); + }) + } + }); + } + + self.dispatch.apply()?; + + Ok(()) + }) + .build() + } +} + +fn get_log_file_path( + dir: &impl AsRef, + app_name: &str, + rotation_strategy: &RotationStrategy, + max_file_size: u128, +) -> plugin::Result { + let path = dir.as_ref().join(format!("{}.log", app_name)); + + if path.exists() { + let log_size = File::open(&path)?.metadata()?.len() as u128; + if log_size > max_file_size { + match rotation_strategy { + RotationStrategy::KeepAll => { + let to = dir.as_ref().join(format!( + "{}_{}.log", + app_name, + time::OffsetDateTime::now_utc() + .format( + &time::format_description::parse( + "[year]-[month]-[day]_[hour]-[minute]-[second]" + ) + .unwrap() + ) + .unwrap(), + )); + if to.is_file() { + // designated rotated log file name already exists + // highly unlikely but defensively handle anyway by adding .bak to filename + let mut to_bak = to.clone(); + to_bak.set_file_name(format!( + "{}.bak", + to_bak.file_name().unwrap().to_string_lossy() + )); + fs::rename(&to, to_bak)?; + } + fs::rename(&path, to)?; + } + RotationStrategy::KeepOne => { + fs::remove_file(&path)?; + } + } + } + } + + Ok(path) +} diff --git a/plugins/persisted-scope/Cargo.toml b/plugins/persisted-scope/Cargo.toml new file mode 100644 index 00000000..58427d32 --- /dev/null +++ b/plugins/persisted-scope/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "tauri-plugin-persisted-scope" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +bincode = "1" + +[features] +protocol-asset = [ "tauri/protocol-asset" ] \ No newline at end of file diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs new file mode 100644 index 00000000..f86a1407 --- /dev/null +++ b/plugins/persisted-scope/src/lib.rs @@ -0,0 +1,101 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Deserialize, Serialize}; +use tauri::{ + plugin::{Builder, TauriPlugin}, + FsScopeEvent, Manager, Runtime, +}; + +use std::{ + fs::{create_dir_all, File}, + io::Write, +}; + +const SCOPE_STATE_FILENAME: &str = ".persisted-scope"; + +#[derive(Debug, thiserror::Error)] +enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + Tauri(#[from] tauri::Error), + #[error(transparent)] + TauriApi(#[from] tauri::api::Error), + #[error(transparent)] + Bincode(#[from] Box), +} + +#[derive(Debug, Default, Deserialize, Serialize)] +struct Scope { + allowed_paths: Vec, + forbidden_patterns: Vec, +} + +pub fn init() -> TauriPlugin { + Builder::new("persisted-scope") + .setup(|app| { + let fs_scope = app.fs_scope(); + #[cfg(feature = "protocol-asset")] + let asset_protocol_scope = app.asset_protocol_scope(); + let app = app.clone(); + let app_dir = app.path_resolver().app_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); + #[cfg(feature = "protocol-asset")] + let _ = asset_protocol_scope.forbid_file(&scope_state_path); + + if scope_state_path.exists() { + let scope: Scope = tauri::api::file::read_binary(&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 { + // allows the path as is + let _ = fs_scope.allow_file(&allowed); + #[cfg(feature = "protocol-asset")] + let _ = asset_protocol_scope.allow_file(allowed); + } + for forbidden in scope.forbidden_patterns { + // forbid the path as is + let _ = fs_scope.forbid_file(&forbidden); + #[cfg(feature = "protocol-asset")] + let _ = asset_protocol_scope.forbid_file(forbidden); + } + } + + fs_scope.listen(move |event| { + let fs_scope = app.fs_scope(); + if let FsScopeEvent::PathAllowed(_) = event { + let scope = Scope { + allowed_paths: fs_scope + .allowed_patterns() + .into_iter() + .map(|p| p.to_string()) + .collect(), + forbidden_patterns: fs_scope + .forbidden_patterns() + .into_iter() + .map(|p| p.to_string()) + .collect(), + }; + let scope_state_path = scope_state_path.clone(); + + let _ = create_dir_all(&app_dir) + .and_then(|_| File::create(scope_state_path)) + .map_err(Error::Io) + .and_then(|mut f| { + f.write_all(&bincode::serialize(&scope).map_err(Error::from)?) + .map_err(Into::into) + }); + } + }); + } + Ok(()) + }) + .build() +} diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml new file mode 100644 index 00000000..a7286db0 --- /dev/null +++ b/plugins/positioner/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "tauri-plugin-positioner" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true + +[features] +system-tray = [ "tauri/system-tray" ] \ No newline at end of file diff --git a/plugins/positioner/guest-js/dist/index.min.js b/plugins/positioner/guest-js/dist/index.min.js new file mode 100644 index 00000000..bede7644 --- /dev/null +++ b/plugins/positioner/guest-js/dist/index.min.js @@ -0,0 +1,40 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +// Copyright 2021 Jonas Kruckenberg +/** + * Well known window positions. + */ +var Position; +(function (Position) { + Position[Position["TopLeft"] = 0] = "TopLeft"; + Position[Position["TopRight"] = 1] = "TopRight"; + Position[Position["BottomLeft"] = 2] = "BottomLeft"; + Position[Position["BottomRight"] = 3] = "BottomRight"; + Position[Position["TopCenter"] = 4] = "TopCenter"; + Position[Position["BottomCenter"] = 5] = "BottomCenter"; + Position[Position["LeftCenter"] = 6] = "LeftCenter"; + Position[Position["RightCenter"] = 7] = "RightCenter"; + Position[Position["Center"] = 8] = "Center"; + Position[Position["TrayLeft"] = 9] = "TrayLeft"; + Position[Position["TrayBottomLeft"] = 10] = "TrayBottomLeft"; + Position[Position["TrayRight"] = 11] = "TrayRight"; + Position[Position["TrayBottomRight"] = 12] = "TrayBottomRight"; + Position[Position["TrayCenter"] = 13] = "TrayCenter"; + Position[Position["TrayBottomCenter"] = 14] = "TrayBottomCenter"; +})(Position || (Position = {})); +/** + * Moves the `Window` to the given {@link Position} using `WindowExt.move_window()` + * All positions are relative to the **current** screen. + * + * @param to The {@link Position} to move to. + */ +async function moveWindow(to) { + await c("plugin:positioner|move_window", { + position: to, + }); +} + +export { Position, moveWindow }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/positioner/guest-js/dist/index.min.js.map b/plugins/positioner/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..4e7d8f60 --- /dev/null +++ b/plugins/positioner/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n",null],"names":["d","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IA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AA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,QAAA,CAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,QAAA,CAAA,QAAA,CAAA,gBAAA,CAAA,GAAA,EAAA,CAAA,GAAA,gBAAc,CAAA;AACd,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,EAAA,CAAA,GAAA,WAAS,CAAA;AACT,IAAA,QAAA,CAAA,QAAA,CAAA,iBAAA,CAAA,GAAA,EAAA,CAAA,GAAA,iBAAe,CAAA;AACf,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,EAAA,CAAA,GAAA,YAAU,CAAA;AACV,IAAA,QAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,GAAA,EAAA,CAAA,GAAA,kBAAgB,CAAA;AAClB,CAAC,EAhBW,QAAQ,KAAR,QAAQ,GAgBnB,EAAA,CAAA,CAAA,CAAA;AAED;;;;;AAKG;AACI,eAAe,UAAU,CAAC,EAAY,EAAA;IAC3C,MAAMC,CAAM,CAAC,+BAA+B,EAAE;AAC5C,QAAA,QAAQ,EAAE,EAAE;AACb,KAAA,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/plugins/positioner/guest-js/dist/index.mjs b/plugins/positioner/guest-js/dist/index.mjs new file mode 100644 index 00000000..9e84b96a --- /dev/null +++ b/plugins/positioner/guest-js/dist/index.mjs @@ -0,0 +1,38 @@ +import { invoke } from '@tauri-apps/api/tauri'; + +// Copyright 2021 Jonas Kruckenberg +/** + * Well known window positions. + */ +var Position; +(function (Position) { + Position[Position["TopLeft"] = 0] = "TopLeft"; + Position[Position["TopRight"] = 1] = "TopRight"; + Position[Position["BottomLeft"] = 2] = "BottomLeft"; + Position[Position["BottomRight"] = 3] = "BottomRight"; + Position[Position["TopCenter"] = 4] = "TopCenter"; + Position[Position["BottomCenter"] = 5] = "BottomCenter"; + Position[Position["LeftCenter"] = 6] = "LeftCenter"; + Position[Position["RightCenter"] = 7] = "RightCenter"; + Position[Position["Center"] = 8] = "Center"; + Position[Position["TrayLeft"] = 9] = "TrayLeft"; + Position[Position["TrayBottomLeft"] = 10] = "TrayBottomLeft"; + Position[Position["TrayRight"] = 11] = "TrayRight"; + Position[Position["TrayBottomRight"] = 12] = "TrayBottomRight"; + Position[Position["TrayCenter"] = 13] = "TrayCenter"; + Position[Position["TrayBottomCenter"] = 14] = "TrayBottomCenter"; +})(Position || (Position = {})); +/** + * Moves the `Window` to the given {@link Position} using `WindowExt.move_window()` + * All positions are relative to the **current** screen. + * + * @param to The {@link Position} to move to. + */ +async function moveWindow(to) { + await invoke("plugin:positioner|move_window", { + position: to, + }); +} + +export { Position, moveWindow }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/positioner/guest-js/dist/index.mjs.map b/plugins/positioner/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..05b871b6 --- /dev/null +++ b/plugins/positioner/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AAKA;;AAEG;IACS,SAgBX;AAhBD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,QAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW,CAAA;AACX,IAAA,QAAA,CAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;AACV,IAAA,QAAA,CAAA,QAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAW,CAAA;AACX,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAS,CAAA;AACT,IAAA,QAAA,CAAA,QAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAY,CAAA;AACZ,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAU,CAAA;AACV,IAAA,QAAA,CAAA,QAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAW,CAAA;AACX,IAAA,QAAA,CAAA,QAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,QAAA,CAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAQ,CAAA;AACR,IAAA,QAAA,CAAA,QAAA,CAAA,gBAAA,CAAA,GAAA,EAAA,CAAA,GAAA,gBAAc,CAAA;AACd,IAAA,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,GAAA,EAAA,CAAA,GAAA,WAAS,CAAA;AACT,IAAA,QAAA,CAAA,QAAA,CAAA,iBAAA,CAAA,GAAA,EAAA,CAAA,GAAA,iBAAe,CAAA;AACf,IAAA,QAAA,CAAA,QAAA,CAAA,YAAA,CAAA,GAAA,EAAA,CAAA,GAAA,YAAU,CAAA;AACV,IAAA,QAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,GAAA,EAAA,CAAA,GAAA,kBAAgB,CAAA;AAClB,CAAC,EAhBW,QAAQ,KAAR,QAAQ,GAgBnB,EAAA,CAAA,CAAA,CAAA;AAED;;;;;AAKG;AACI,eAAe,UAAU,CAAC,EAAY,EAAA;IAC3C,MAAM,MAAM,CAAC,+BAA+B,EAAE;AAC5C,QAAA,QAAQ,EAAE,EAAE;AACb,KAAA,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/plugins/positioner/guest-js/index.ts b/plugins/positioner/guest-js/index.ts new file mode 100644 index 00000000..dffbf54e --- /dev/null +++ b/plugins/positioner/guest-js/index.ts @@ -0,0 +1,37 @@ +// Copyright 2021 Jonas Kruckenberg +// SPDX-License-Identifier: MIT + +import { invoke } from "@tauri-apps/api/tauri"; + +/** + * Well known window positions. + */ +export enum Position { + TopLeft = 0, + TopRight, + BottomLeft, + BottomRight, + TopCenter, + BottomCenter, + LeftCenter, + RightCenter, + Center, + TrayLeft, + TrayBottomLeft, + TrayRight, + TrayBottomRight, + TrayCenter, + TrayBottomCenter, +} + +/** + * Moves the `Window` to the given {@link Position} using `WindowExt.move_window()` + * All positions are relative to the **current** screen. + * + * @param to The {@link Position} to move to. + */ +export async function moveWindow(to: Position): Promise { + await invoke("plugin:positioner|move_window", { + position: to, + }); +} diff --git a/plugins/positioner/guest-js/package.json b/plugins/positioner/guest-js/package.json new file mode 100644 index 00000000..2f146ec6 --- /dev/null +++ b/plugins/positioner/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-positioner-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/positioner/guest-js/rollup.config.mjs b/plugins/positioner/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/positioner/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/positioner/guest-js/tsconfig.json b/plugins/positioner/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/positioner/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/positioner/src/ext.rs b/plugins/positioner/src/ext.rs new file mode 100644 index 00000000..01d34cf5 --- /dev/null +++ b/plugins/positioner/src/ext.rs @@ -0,0 +1,182 @@ +// Copyright 2021 Jonas Kruckenberg +// SPDX-License-Identifier: MIT + +#[cfg(feature = "system-tray")] +use crate::Tray; +use serde_repr::Deserialize_repr; +#[cfg(feature = "system-tray")] +use tauri::Manager; +use tauri::{PhysicalPosition, PhysicalSize, Result, Runtime, Window}; + +/// Well known window positions. +#[derive(Debug, Deserialize_repr)] +#[repr(u16)] +pub enum Position { + TopLeft = 0, + TopRight, + BottomLeft, + BottomRight, + TopCenter, + BottomCenter, + LeftCenter, + RightCenter, + Center, + #[cfg(feature = "system-tray")] + TrayLeft, + #[cfg(feature = "system-tray")] + TrayBottomLeft, + #[cfg(feature = "system-tray")] + TrayRight, + #[cfg(feature = "system-tray")] + TrayBottomRight, + #[cfg(feature = "system-tray")] + TrayCenter, + #[cfg(feature = "system-tray")] + TrayBottomCenter, +} + +/// A [`Window`] extension that provides extra methods related to positioning. +pub trait WindowExt { + /// Moves the [`Window`] to the given [`Position`] + /// + /// All positions are relative to the **current** screen. + fn move_window(&self, position: Position) -> Result<()>; +} + +impl WindowExt for Window { + fn move_window(&self, pos: Position) -> Result<()> { + use Position::*; + + let screen = self.current_monitor()?.unwrap(); + let screen_position = screen.position(); + let screen_size = PhysicalSize:: { + width: screen.size().width as i32, + height: screen.size().height as i32, + }; + let window_size = PhysicalSize:: { + width: self.outer_size()?.width as i32, + height: self.outer_size()?.height as i32, + }; + #[cfg(feature = "system-tray")] + let (tray_position, tray_size) = self + .state::() + .0 + .lock() + .unwrap() + .map(|(pos, size)| { + ( + Some((pos.x as i32, pos.y as i32)), + Some((size.width as i32, size.height as i32)), + ) + }) + .unwrap_or_default(); + + let physical_pos = match pos { + TopLeft => *screen_position, + TopRight => PhysicalPosition { + x: screen_position.x + (screen_size.width - window_size.width), + y: screen_position.y, + }, + BottomLeft => PhysicalPosition { + x: screen_position.x, + y: screen_size.height - (window_size.height - screen_position.y), + }, + BottomRight => PhysicalPosition { + x: screen_position.x + (screen_size.width - window_size.width), + y: screen_size.height - (window_size.height - screen_position.y), + }, + TopCenter => PhysicalPosition { + x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), + y: screen_position.y, + }, + BottomCenter => PhysicalPosition { + x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), + y: screen_size.height - (window_size.height - screen_position.y), + }, + LeftCenter => PhysicalPosition { + x: screen_position.x, + y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), + }, + RightCenter => PhysicalPosition { + x: screen_position.x + (screen_size.width - window_size.width), + y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), + }, + Center => PhysicalPosition { + x: screen_position.x + ((screen_size.width / 2) - (window_size.width / 2)), + y: screen_position.y + (screen_size.height / 2) - (window_size.height / 2), + }, + #[cfg(feature = "system-tray")] + TrayLeft => { + if let Some((tray_x, tray_y)) = tray_position { + PhysicalPosition { + x: tray_x, + y: tray_y - window_size.height, + } + } else { + panic!("tray position not set"); + } + } + #[cfg(feature = "system-tray")] + TrayBottomLeft => { + if let Some((tray_x, tray_y)) = tray_position { + PhysicalPosition { + x: tray_x, + y: tray_y, + } + } else { + panic!("Tray position not set"); + } + } + #[cfg(feature = "system-tray")] + TrayRight => { + if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) + { + PhysicalPosition { + x: tray_x + tray_width, + y: tray_y - window_size.height, + } + } else { + panic!("Tray position not set"); + } + } + #[cfg(feature = "system-tray")] + TrayBottomRight => { + if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) + { + PhysicalPosition { + x: tray_x + tray_width, + y: tray_y, + } + } else { + panic!("Tray position not set"); + } + } + #[cfg(feature = "system-tray")] + TrayCenter => { + if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) + { + PhysicalPosition { + x: tray_x + (tray_width / 2) - (window_size.width / 2), + y: tray_y - window_size.height, + } + } else { + panic!("Tray position not set"); + } + } + #[cfg(feature = "system-tray")] + TrayBottomCenter => { + if let (Some((tray_x, tray_y)), Some((tray_width, _))) = (tray_position, tray_size) + { + PhysicalPosition { + x: tray_x + (tray_width / 2) - (window_size.width / 2), + y: tray_y, + } + } else { + panic!("Tray position not set"); + } + } + }; + + self.set_position(tauri::Position::Physical(physical_pos)) + } +} diff --git a/plugins/positioner/src/lib.rs b/plugins/positioner/src/lib.rs new file mode 100644 index 00000000..71d35392 --- /dev/null +++ b/plugins/positioner/src/lib.rs @@ -0,0 +1,71 @@ +// Copyright 2021 Jonas Kruckenberg +// SPDX-License-Identifier: MIT + +//! A plugin for Tauri that helps position your windows at well-known locations. +//! +//! # Cargo features +//! +//! - **system-tray**: Enables system-tray-relative positions. +//! +//! Note: This requires attaching the Tauri plugin, *even* when using the trait extension only. + +mod ext; + +pub use ext::*; +use tauri::{ + plugin::{self, TauriPlugin}, + Result, Runtime, +}; + +#[cfg(feature = "system-tray")] +use tauri::{AppHandle, Manager, PhysicalPosition, PhysicalSize, SystemTrayEvent}; + +#[cfg(feature = "system-tray")] +struct Tray(std::sync::Mutex, PhysicalSize)>>); + +#[cfg(feature = "system-tray")] +pub fn on_tray_event(app: &AppHandle, event: &SystemTrayEvent) { + match event { + SystemTrayEvent::LeftClick { position, size, .. } => { + app.state::() + .0 + .lock() + .unwrap() + .replace((*position, *size)); + } + SystemTrayEvent::RightClick { position, size, .. } => { + app.state::() + .0 + .lock() + .unwrap() + .replace((*position, *size)); + } + SystemTrayEvent::DoubleClick { position, size, .. } => { + app.state::() + .0 + .lock() + .unwrap() + .replace((*position, *size)); + } + _ => (), + } +} + +#[tauri::command] +async fn move_window(window: tauri::Window, position: Position) -> Result<()> { + window.move_window(position) +} + +/// The Tauri plugin that exposes [`WindowExt::move_window`] to the webview. +pub fn init() -> TauriPlugin { + let plugin = + plugin::Builder::new("positioner").invoke_handler(tauri::generate_handler![move_window]); + + #[cfg(feature = "system-tray")] + let plugin = plugin.setup(|app_handle| { + app_handle.manage(Tray(std::sync::Mutex::new(None))); + Ok(()) + }); + + plugin.build() +} diff --git a/plugins/sql/Cargo.toml b/plugins/sql/Cargo.toml new file mode 100644 index 00000000..cee4ba13 --- /dev/null +++ b/plugins/sql/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tauri-plugin-sql" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "json"] } +tokio = { version = "1", features = ["sync"] } +futures = "0.3" + +[features] +sqlite = ["sqlx/sqlite"] +mysql = ["sqlx/mysql"] +postgres = ["sqlx/postgres"] \ No newline at end of file diff --git a/plugins/sql/guest-js/dist/index.min.js b/plugins/sql/guest-js/dist/index.min.js new file mode 100644 index 00000000..f734a03f --- /dev/null +++ b/plugins/sql/guest-js/dist/index.min.js @@ -0,0 +1,119 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +/** + * **Database** + * + * The `Database` class serves as the primary interface for + * communicating with the rust side of the sql plugin. + */ +class Database { + constructor(path) { + this.path = path; + } + /** + * **load** + * + * A static initializer which connects to the underlying database and + * returns a `Database` instance once a connection to the database is established. + * + * # Sqlite + * + * The path is relative to `tauri::api::path::BaseDirectory::App` and must start with `sqlite:`. + * + * @example + * ```ts + * const db = await Database.load("sqlite:test.db"); + * ``` + */ + static async load(path) { + const _path = await c("plugin:sql|load", { + db: path, + }); + return new Database(_path); + } + /** + * **get** + * + * A static initializer which synchronously returns an instance of + * the Database class while deferring the actual database connection + * until the first invocation or selection on the database. + * + * # Sqlite + * + * The path is relative to `tauri::api::path::BaseDirectory::App` and must start with `sqlite:`. + * + * @example + * ```ts + * const db = Database.get("sqlite:test.db"); + * ``` + */ + static get(path) { + return new Database(path); + } + /** + * **execute** + * + * Passes a SQL expression to the database for execution. + * + * @example + * ```ts + * const result = await db.execute( + * "UPDATE todos SET title = $1, completed = $2 WHERE id = $3", + * [ todos.title, todos.status, todos.id ] + * ); + * ``` + */ + async execute(query, bindValues) { + const [rowsAffected, lastInsertId] = await c("plugin:sql|execute", { + db: this.path, + query, + values: bindValues !== null && bindValues !== void 0 ? bindValues : [], + }); + return { + lastInsertId, + rowsAffected, + }; + } + /** + * **select** + * + * Passes in a SELECT query to the database for execution. + * + * @example + * ```ts + * const result = await db.select( + * "SELECT * from todos WHERE id = $1", id + * ); + * ``` + */ + async select(query, bindValues) { + const result = await c("plugin:sql|select", { + db: this.path, + query, + values: bindValues !== null && bindValues !== void 0 ? bindValues : [], + }); + return result; + } + /** + * **close** + * + * Closes the database connection pool. + * + * @example + * ```ts + * const success = await db.close() + * ``` + * @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) { + const success = await c("plugin:sql|close", { + db, + }); + return success; + } +} + +export { Database as default }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/sql/guest-js/dist/index.min.js.map b/plugins/sql/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..7e3466c5 --- /dev/null +++ b/plugins/sql/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n",null],"names":["d","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IAAI,CAAC,CAAC,EAAE,CAACA,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAA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;YACL,YAAY;YACZ,YAAY;SACb,CAAC;KACH;AAED;;;;;;;;;;;AAWG;AACH,IAAA,MAAM,MAAM,CAAI,KAAa,EAAE,UAAsB,EAAA;AACnD,QAAA,MAAM,MAAM,GAAG,MAAMA,CAAM,CAAI,mBAAmB,EAAE;YAClD,EAAE,EAAE,IAAI,CAAC,IAAI;YACb,KAAK;AACL,YAAA,MAAM,EAAE,UAAU,KAAA,IAAA,IAAV,UAAU,KAAV,KAAA,CAAA,GAAA,UAAU,GAAI,EAAE;AACzB,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,MAAM,CAAC;KACf;AAED;;;;;;;;;;AAUG;IACH,MAAM,KAAK,CAAC,EAAW,EAAA;AACrB,QAAA,MAAM,OAAO,GAAG,MAAMA,CAAM,CAAU,kBAAkB,EAAE;YACxD,EAAE;AACH,SAAA,CAAC,CAAC;AACH,QAAA,OAAO,OAAO,CAAC;KAChB;AACF;;;;"} \ No newline at end of file diff --git a/plugins/sql/guest-js/dist/index.mjs b/plugins/sql/guest-js/dist/index.mjs new file mode 100644 index 00000000..e255900f --- /dev/null +++ b/plugins/sql/guest-js/dist/index.mjs @@ -0,0 +1,117 @@ +import { invoke } from '@tauri-apps/api/tauri'; + +/** + * **Database** + * + * The `Database` class serves as the primary interface for + * communicating with the rust side of the sql plugin. + */ +class Database { + constructor(path) { + this.path = path; + } + /** + * **load** + * + * A static initializer which connects to the underlying database and + * returns a `Database` instance once a connection to the database is established. + * + * # Sqlite + * + * The path is relative to `tauri::api::path::BaseDirectory::App` and must start with `sqlite:`. + * + * @example + * ```ts + * const db = await Database.load("sqlite:test.db"); + * ``` + */ + static async load(path) { + const _path = await invoke("plugin:sql|load", { + db: path, + }); + return new Database(_path); + } + /** + * **get** + * + * A static initializer which synchronously returns an instance of + * the Database class while deferring the actual database connection + * until the first invocation or selection on the database. + * + * # Sqlite + * + * The path is relative to `tauri::api::path::BaseDirectory::App` and must start with `sqlite:`. + * + * @example + * ```ts + * const db = Database.get("sqlite:test.db"); + * ``` + */ + static get(path) { + return new Database(path); + } + /** + * **execute** + * + * Passes a SQL expression to the database for execution. + * + * @example + * ```ts + * const result = await db.execute( + * "UPDATE todos SET title = $1, completed = $2 WHERE id = $3", + * [ todos.title, todos.status, todos.id ] + * ); + * ``` + */ + async execute(query, bindValues) { + const [rowsAffected, lastInsertId] = await invoke("plugin:sql|execute", { + db: this.path, + query, + values: bindValues !== null && bindValues !== void 0 ? bindValues : [], + }); + return { + lastInsertId, + rowsAffected, + }; + } + /** + * **select** + * + * Passes in a SELECT query to the database for execution. + * + * @example + * ```ts + * const result = await db.select( + * "SELECT * from todos WHERE id = $1", id + * ); + * ``` + */ + async select(query, bindValues) { + const result = await invoke("plugin:sql|select", { + db: this.path, + query, + values: bindValues !== null && bindValues !== void 0 ? bindValues : [], + }); + return result; + } + /** + * **close** + * + * Closes the database connection pool. + * + * @example + * ```ts + * const success = await db.close() + * ``` + * @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) { + const success = await invoke("plugin:sql|close", { + db, + }); + return success; + } +} + +export { Database as default }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/sql/guest-js/dist/index.mjs.map b/plugins/sql/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..a2499c4f --- /dev/null +++ b/plugins/sql/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAgBA;;;;;AAKG;AACW,MAAO,QAAQ,CAAA;AAE3B,IAAA,WAAA,CAAY,IAAY,EAAA;AACtB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;KAClB;AAED;;;;;;;;;;;;;;AAcG;AACH,IAAA,aAAa,IAAI,CAAC,IAAY,EAAA;AAC5B,QAAA,MAAM,KAAK,GAAG,MAAM,MAAM,CAAS,iBAAiB,EAAE;AACpD,YAAA,EAAE,EAAE,IAAI;AACT,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC5B;AAED;;;;;;;;;;;;;;;AAeG;IACH,OAAO,GAAG,CAAC,IAAY,EAAA;AACrB,QAAA,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;KAC3B;AAED;;;;;;;;;;;;AAYG;AACH,IAAA,MAAM,OAAO,CAAC,KAAa,EAAE,UAAsB,EAAA;QACjD,MAAM,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,MAAM,MAAM,CAC/C,oBAAoB,EACpB;YACE,EAAE,EAAE,IAAI,CAAC,IAAI;YACb,KAAK;AACL,YAAA,MAAM,EAAE,UAAU,KAAA,IAAA,IAAV,UAAU,KAAV,KAAA,CAAA,GAAA,UAAU,GAAI,EAAE;AACzB,SAAA,CACF,CAAC;QAEF,OAAO;YACL,YAAY;YACZ,YAAY;SACb,CAAC;KACH;AAED;;;;;;;;;;;AAWG;AACH,IAAA,MAAM,MAAM,CAAI,KAAa,EAAE,UAAsB,EAAA;AACnD,QAAA,MAAM,MAAM,GAAG,MAAM,MAAM,CAAI,mBAAmB,EAAE;YAClD,EAAE,EAAE,IAAI,CAAC,IAAI;YACb,KAAK;AACL,YAAA,MAAM,EAAE,UAAU,KAAA,IAAA,IAAV,UAAU,KAAV,KAAA,CAAA,GAAA,UAAU,GAAI,EAAE;AACzB,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,MAAM,CAAC;KACf;AAED;;;;;;;;;;AAUG;IACH,MAAM,KAAK,CAAC,EAAW,EAAA;AACrB,QAAA,MAAM,OAAO,GAAG,MAAM,MAAM,CAAU,kBAAkB,EAAE;YACxD,EAAE;AACH,SAAA,CAAC,CAAC;AACH,QAAA,OAAO,OAAO,CAAC;KAChB;AACF;;;;"} \ No newline at end of file diff --git a/plugins/sql/guest-js/index.ts b/plugins/sql/guest-js/index.ts new file mode 100644 index 00000000..a574e72e --- /dev/null +++ b/plugins/sql/guest-js/index.ts @@ -0,0 +1,140 @@ +import { invoke } from "@tauri-apps/api/tauri"; + +export interface QueryResult { + /** The number of rows affected by the query. */ + rowsAffected: number; + /** + * The last inserted `id`. + * + * This value is always `0` when using the Postgres driver. If the + * last inserted id is required on Postgres, the `select` function + * must be used, with a `RETURNING` clause + * (`INSERT INTO todos (title) VALUES ($1) RETURNING id`). + */ + lastInsertId: number; +} + +/** + * **Database** + * + * The `Database` class serves as the primary interface for + * communicating with the rust side of the sql plugin. + */ +export default class Database { + path: string; + constructor(path: string) { + this.path = path; + } + + /** + * **load** + * + * A static initializer which connects to the underlying database and + * returns a `Database` instance once a connection to the database is established. + * + * # Sqlite + * + * The path is relative to `tauri::api::path::BaseDirectory::App` and must start with `sqlite:`. + * + * @example + * ```ts + * const db = await Database.load("sqlite:test.db"); + * ``` + */ + static async load(path: string): Promise { + const _path = await invoke("plugin:sql|load", { + db: path, + }); + + return new Database(_path); + } + + /** + * **get** + * + * A static initializer which synchronously returns an instance of + * the Database class while deferring the actual database connection + * until the first invocation or selection on the database. + * + * # Sqlite + * + * The path is relative to `tauri::api::path::BaseDirectory::App` and must start with `sqlite:`. + * + * @example + * ```ts + * const db = Database.get("sqlite:test.db"); + * ``` + */ + static get(path: string): Database { + return new Database(path); + } + + /** + * **execute** + * + * Passes a SQL expression to the database for execution. + * + * @example + * ```ts + * const result = await db.execute( + * "UPDATE todos SET title = $1, completed = $2 WHERE id = $3", + * [ todos.title, todos.status, todos.id ] + * ); + * ``` + */ + async execute(query: string, bindValues?: unknown[]): Promise { + const [rowsAffected, lastInsertId] = await invoke<[number, number]>( + "plugin:sql|execute", + { + db: this.path, + query, + values: bindValues ?? [], + } + ); + + return { + lastInsertId, + rowsAffected, + }; + } + + /** + * **select** + * + * Passes in a SELECT query to the database for execution. + * + * @example + * ```ts + * const result = await db.select( + * "SELECT * from todos WHERE id = $1", id + * ); + * ``` + */ + async select(query: string, bindValues?: unknown[]): Promise { + const result = await invoke("plugin:sql|select", { + db: this.path, + query, + values: bindValues ?? [], + }); + + return result; + } + + /** + * **close** + * + * Closes the database connection pool. + * + * @example + * ```ts + * const success = await db.close() + * ``` + * @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 { + const success = await invoke("plugin:sql|close", { + db, + }); + return success; + } +} diff --git a/plugins/sql/guest-js/package.json b/plugins/sql/guest-js/package.json new file mode 100644 index 00000000..f3985e00 --- /dev/null +++ b/plugins/sql/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-{{name}}-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/sql/guest-js/rollup.config.mjs b/plugins/sql/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/sql/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/sql/guest-js/tsconfig.json b/plugins/sql/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/sql/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/sql/src/lib.rs b/plugins/sql/src/lib.rs new file mode 100644 index 00000000..aebeeecc --- /dev/null +++ b/plugins/sql/src/lib.rs @@ -0,0 +1,28 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +#[cfg(any( + all(feature = "sqlite", feature = "mysql"), + all(feature = "sqlite", feature = "postgres"), + all(feature = "mysql", feature = "postgres") +))] +compile_error!("Only one database driver can be enabled. Use `default-features = false` and set the feature flag for the driver of your choice."); + +#[cfg(not(any(feature = "sqlite", feature = "mysql", feature = "postgres")))] +compile_error!( + "Database driver not defined. Please set the feature flag for the driver of your choice." +); + +#[cfg(any( + all(feature = "sqlite", not(any(feature = "mysql", feature = "postgres"))), + all(feature = "mysql", not(any(feature = "sqlite", feature = "postgres"))), + all(feature = "postgres", not(any(feature = "sqlite", feature = "mysql"))), +))] +mod plugin; +#[cfg(any( + all(feature = "sqlite", not(any(feature = "mysql", feature = "postgres"))), + all(feature = "mysql", not(any(feature = "sqlite", feature = "postgres"))), + all(feature = "postgres", not(any(feature = "sqlite", feature = "mysql"))), +))] +pub use plugin::*; diff --git a/plugins/sql/src/plugin.rs b/plugins/sql/src/plugin.rs new file mode 100644 index 00000000..5440c926 --- /dev/null +++ b/plugins/sql/src/plugin.rs @@ -0,0 +1,387 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use futures::future::BoxFuture; +use serde::{ser::Serializer, Deserialize, Serialize}; +use serde_json::Value as JsonValue; +use sqlx::{ + error::BoxDynError, + migrate::{ + MigrateDatabase, Migration as SqlxMigration, MigrationSource, MigrationType, Migrator, + }, + Column, Pool, Row, TypeInfo, +}; +use tauri::{ + command, + plugin::{Plugin, Result as PluginResult}, + AppHandle, Invoke, Manager, RunEvent, Runtime, State, +}; +use tokio::sync::Mutex; + +use std::collections::HashMap; + +#[cfg(feature = "sqlite")] +use std::{fs::create_dir_all, path::PathBuf}; + +#[cfg(feature = "sqlite")] +type Db = sqlx::sqlite::Sqlite; +#[cfg(feature = "mysql")] +type Db = sqlx::mysql::MySql; +#[cfg(feature = "postgres")] +type Db = sqlx::postgres::Postgres; + +#[cfg(feature = "sqlite")] +type LastInsertId = i64; +#[cfg(not(feature = "sqlite"))] +type LastInsertId = u64; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Sql(#[from] sqlx::Error), + #[error(transparent)] + Migration(#[from] sqlx::migrate::MigrateError), + #[error("database {0} not loaded")] + DatabaseNotLoaded(String), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +type Result = std::result::Result; + +#[cfg(feature = "sqlite")] +/// Resolves the App's **file path** from the `AppHandle` context +/// object +fn app_path(app: &AppHandle) -> PathBuf { + #[allow(deprecated)] // FIXME: Change to non-deprecated function in Tauri v2 + app.path_resolver() + .app_dir() + .expect("No App path was found!") +} + +#[cfg(feature = "sqlite")] +/// Maps the user supplied DB connection string to a connection string +/// with a fully qualified file path to the App's designed "app_path" +fn path_mapper(mut app_path: PathBuf, connection_string: &str) -> String { + app_path.push( + connection_string + .split_once(':') + .expect("Couldn't parse the connection string for DB!") + .1, + ); + + format!( + "sqlite:{}", + app_path + .to_str() + .expect("Problem creating fully qualified path to Database file!") + ) +} + +#[derive(Default)] +struct DbInstances(Mutex>>); + +struct Migrations(Mutex>); + +#[derive(Default, Deserialize)] +struct PluginConfig { + #[serde(default)] + preload: Vec, +} + +#[derive(Debug)] +pub enum MigrationKind { + Up, + Down, +} + +impl From for MigrationType { + fn from(kind: MigrationKind) -> Self { + match kind { + MigrationKind::Up => Self::ReversibleUp, + MigrationKind::Down => Self::ReversibleDown, + } + } +} + +/// A migration definition. +#[derive(Debug)] +pub struct Migration { + pub version: i64, + pub description: &'static str, + pub sql: &'static str, + pub kind: MigrationKind, +} + +#[derive(Debug)] +struct MigrationList(Vec); + +impl MigrationSource<'static> for MigrationList { + fn resolve(self) -> BoxFuture<'static, std::result::Result, BoxDynError>> { + Box::pin(async move { + let mut migrations = Vec::new(); + for migration in self.0 { + if matches!(migration.kind, MigrationKind::Up) { + migrations.push(SqlxMigration::new( + migration.version, + migration.description.into(), + migration.kind.into(), + migration.sql.into(), + )); + } + } + Ok(migrations) + }) + } +} + +#[command] +async fn load( + #[allow(unused_variables)] app: AppHandle, + db_instances: State<'_, DbInstances>, + migrations: State<'_, Migrations>, + db: String, +) -> Result { + #[cfg(feature = "sqlite")] + let fqdb = path_mapper(app_path(&app), &db); + #[cfg(not(feature = "sqlite"))] + let fqdb = db.clone(); + + #[cfg(feature = "sqlite")] + create_dir_all(app_path(&app)).expect("Problem creating App directory!"); + + if !Db::database_exists(&fqdb).await.unwrap_or(false) { + Db::create_database(&fqdb).await?; + } + let pool = Pool::connect(&fqdb).await?; + + if let Some(migrations) = migrations.0.lock().await.remove(&db) { + let migrator = Migrator::new(migrations).await?; + migrator.run(&pool).await?; + } + + db_instances.0.lock().await.insert(db.clone(), pool); + Ok(db) +} + +/// Allows the database connection(s) to be closed; if no database +/// name is passed in then _all_ database connection pools will be +/// shut down. +#[command] +async fn close(db_instances: State<'_, DbInstances>, db: Option) -> Result { + let mut instances = db_instances.0.lock().await; + + let pools = if let Some(db) = db { + vec![db] + } else { + instances.keys().cloned().collect() + }; + + for pool in pools { + let db = instances + .get_mut(&pool) // + .ok_or(Error::DatabaseNotLoaded(pool))?; + db.close().await; + } + + Ok(true) +} + +/// Execute a command against the database +#[command] +async fn execute( + db_instances: State<'_, DbInstances>, + db: String, + query: String, + values: Vec, +) -> Result<(u64, LastInsertId)> { + let mut instances = db_instances.0.lock().await; + + let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?; + let mut query = sqlx::query(&query); + for value in values { + if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else { + query = query.bind(value); + } + } + let result = query.execute(&*db).await?; + #[cfg(feature = "sqlite")] + let r = Ok((result.rows_affected(), result.last_insert_rowid())); + #[cfg(feature = "mysql")] + let r = Ok((result.rows_affected(), result.last_insert_id())); + #[cfg(feature = "postgres")] + let r = Ok((result.rows_affected(), 0)); + r +} + +#[command] +async fn select( + db_instances: State<'_, DbInstances>, + db: String, + query: String, + values: Vec, +) -> Result>> { + let mut instances = db_instances.0.lock().await; + let db = instances.get_mut(&db).ok_or(Error::DatabaseNotLoaded(db))?; + let mut query = sqlx::query(&query); + for value in values { + if value.is_string() { + query = query.bind(value.as_str().unwrap().to_owned()) + } else { + query = query.bind(value); + } + } + let rows = query.fetch_all(&*db).await?; + let mut values = Vec::new(); + for row in rows { + let mut value = HashMap::default(); + for (i, column) in row.columns().iter().enumerate() { + let info = column.type_info(); + let v = if info.is_null() { + JsonValue::Null + } else { + match info.name() { + "VARCHAR" | "STRING" | "TEXT" | "DATETIME" => { + if let Ok(s) = row.try_get(i) { + JsonValue::String(s) + } else { + JsonValue::Null + } + } + "BOOL" | "BOOLEAN" => { + if let Ok(b) = row.try_get(i) { + JsonValue::Bool(b) + } else { + let x: String = row.get(i); + JsonValue::Bool(x.to_lowercase() == "true") + } + } + "INT" | "NUMBER" | "INTEGER" | "BIGINT" | "INT8" => { + if let Ok(n) = row.try_get::(i) { + JsonValue::Number(n.into()) + } else { + JsonValue::Null + } + } + "REAL" => { + if let Ok(n) = row.try_get::(i) { + JsonValue::from(n) + } else { + JsonValue::Null + } + } + // "JSON" => JsonValue::Object(row.get(i)), + "BLOB" => { + if let Ok(n) = row.try_get::, usize>(i) { + JsonValue::Array( + n.into_iter().map(|n| JsonValue::Number(n.into())).collect(), + ) + } else { + JsonValue::Null + } + } + _ => JsonValue::Null, + } + }; + value.insert(column.name().to_string(), v); + } + values.push(value); + } + Ok(values) +} + +/// Tauri SQL plugin. +pub struct TauriSql { + migrations: Option>, + invoke_handler: Box) + Send + Sync>, +} + +impl Default for TauriSql { + fn default() -> Self { + Self { + migrations: Some(Default::default()), + invoke_handler: Box::new(tauri::generate_handler![load, execute, select, close]), + } + } +} + +impl TauriSql { + /// Add migrations to a database. + #[must_use] + pub fn add_migrations(mut self, db_url: &str, migrations: Vec) -> Self { + self.migrations + .as_mut() + .unwrap() + .insert(db_url.to_string(), MigrationList(migrations)); + self + } +} + +impl Plugin for TauriSql { + fn name(&self) -> &'static str { + "sql" + } + + fn initialize(&mut self, app: &AppHandle, config: serde_json::Value) -> PluginResult<()> { + tauri::async_runtime::block_on(async move { + let config: PluginConfig = if config.is_null() { + Default::default() + } else { + serde_json::from_value(config)? + }; + + #[cfg(feature = "sqlite")] + create_dir_all(app_path(app)).expect("problems creating App directory!"); + + let instances = DbInstances::default(); + let mut lock = instances.0.lock().await; + for db in config.preload { + #[cfg(feature = "sqlite")] + let fqdb = path_mapper(app_path(app), &db); + #[cfg(not(feature = "sqlite"))] + let fqdb = db.clone(); + + if !Db::database_exists(&fqdb).await.unwrap_or(false) { + Db::create_database(&fqdb).await?; + } + let pool = Pool::connect(&fqdb).await?; + + if let Some(migrations) = self.migrations.as_mut().unwrap().remove(&db) { + let migrator = Migrator::new(migrations).await?; + migrator.run(&pool).await?; + } + lock.insert(db, pool); + } + drop(lock); + app.manage(instances); + app.manage(Migrations(Mutex::new(self.migrations.take().unwrap()))); + Ok(()) + }) + } + + fn extend_api(&mut self, message: Invoke) { + (self.invoke_handler)(message) + } + + fn on_event(&mut self, app: &AppHandle, event: &RunEvent) { + if let RunEvent::Exit = event { + tauri::async_runtime::block_on(async move { + let instances = &*app.state::(); + let instances = instances.0.lock().await; + for value in instances.values() { + value.close().await; + } + }); + } + } +} diff --git a/plugins/store/Cargo.toml b/plugins/store/Cargo.toml new file mode 100644 index 00000000..4ea9924e --- /dev/null +++ b/plugins/store/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "tauri-plugin-store" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true \ No newline at end of file diff --git a/plugins/store/guest-js/dist/index.min.js b/plugins/store/guest-js/dist/index.min.js new file mode 100644 index 00000000..67b53ac0 --- /dev/null +++ b/plugins/store/guest-js/dist/index.min.js @@ -0,0 +1,185 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f$1={};e(f$1,{convertFileSrc:()=>w,invoke:()=>c$2,transformCallback:()=>s$2});function u$2(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s$2(e,r=!1){let n=u$2(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c$2(e,r={}){return new Promise((n,t)=>{let o=s$2(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s$2(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +async function a(i){return c$2("tauri",i)} + +var W$1={};e(W$1,{TauriEvent:()=>c$1,emit:()=>D,listen:()=>E$1,once:()=>_});async function s$1(n,t){return a({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:t}})}async function m$1(n,t,i){await a({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:t,payload:i}});}async function o$1(n,t,i){return a({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:t,handler:s$2(i)}}).then(r=>async()=>s$1(n,r))}async function u$1(n,t,i){return o$1(n,t,r=>{i(r),s$1(n,r.id).catch(()=>{});})}var c$1=(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.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(c$1||{});async function E$1(n,t){return o$1(n,null,t)}async function _(n,t){return u$1(n,null,t)}async function D(n,t){return m$1(n,void 0,t)} + +var C={};e(C,{CloseRequestedEvent:()=>y,LogicalPosition:()=>c,LogicalSize:()=>m,PhysicalPosition:()=>o,PhysicalSize:()=>l,UserAttentionType:()=>W,WebviewWindow:()=>s,WebviewWindowHandle:()=>u,WindowManager:()=>h,appWindow:()=>b,availableMonitors:()=>T,currentMonitor:()=>E,getAll:()=>M,getCurrent:()=>f,primaryMonitor:()=>z});var m=class{constructor(e,a){this.type="Logical";this.width=e,this.height=a;}},l=class{constructor(e,a){this.type="Physical";this.width=e,this.height=a;}toLogical(e){return new m(this.width/e,this.height/e)}},c=class{constructor(e,a){this.type="Logical";this.x=e,this.y=a;}},o=class{constructor(e,a){this.type="Physical";this.x=e,this.y=a;}toLogical(e){return new c(this.x/e,this.y/e)}},W=(a=>(a[a.Critical=1]="Critical",a[a.Informational=2]="Informational",a))(W||{});function f(){return new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function M(){return window.__TAURI_METADATA__.__windows.map(i=>new s(i.label,{skip:!0}))}var P=["tauri://created","tauri://error"],u=class{constructor(e){this.label=e,this.listeners=Object.create(null);}async listen(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1);}):o$1(e,this.label,a)}async once(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1);}):u$1(e,this.label,a)}async emit(e,a){if(P.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return m$1(e,this.label,a)}_handleTauriEvent(e,a){return P.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},h=class extends u{async scaleFactor(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:a})=>new o(e,a))}async outerPosition(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:a})=>new o(e,a))}async innerSize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:a})=>new l(e,a))}async outerSize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:a})=>new l(e,a))}async isFullscreen(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let a$1=null;return e&&(e===1?a$1={type:"Critical"}:a$1={type:"Informational"}),a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:a$1}}}})}async setResizable(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",a=>{let n=new y(a);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()});})}async onFocusChanged(e){let a=await this.listen("tauri://focus",d=>{e({...d,payload:!0});}),n=await this.listen("tauri://blur",d=>{e({...d,payload:!1});});return ()=>{a(),n();}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let a=await this.listen("tauri://file-drop",r=>{e({...r,payload:{type:"drop",paths:r.payload}});}),n=await this.listen("tauri://file-drop-hover",r=>{e({...r,payload:{type:"hover",paths:r.payload}});}),d=await this.listen("tauri://file-drop-cancelled",r=>{e({...r,payload:{type:"cancel"}});});return ()=>{a(),n(),d();}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},y=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id;}preventDefault(){this._preventDefault=!0;}isPreventDefault(){return this._preventDefault}},s=class extends h{constructor(e,a$1={}){super(e),a$1!=null&&a$1.skip||a({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...a$1}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n));}static getByLabel(e){return M().some(a=>a.label===e)?new s(e,{skip:!0}):null}},b;"__TAURI_METADATA__"in window?b=new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),b=new s("main",{skip:!0}));function g(i){return i===null?null:{name:i.name,scaleFactor:i.scaleFactor,position:new o(i.position.x,i.position.y),size:new l(i.size.width,i.size.height)}}async function E(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(g)}async function z(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(g)}async function T(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(i=>i.map(g))} + +// Copyright 2021 Tauri Programme within The Commons Conservancy +/** + * A key-value store persisted by the backend layer. + */ +class Store { + constructor(path) { + this.path = path; + } + /** + * Inserts a key-value pair into the store. + * + * @param key + * @param value + * @returns + */ + async set(key, value) { + await c$2("plugin:store|set", { + path: this.path, + key, + value, + }); + } + /** + * Returns the value for the given `key` or `null` the key does not exist. + * + * @param key + * @returns + */ + async get(key) { + return await c$2("plugin:store|get", { + path: this.path, + key, + }); + } + /** + * Returns `true` if the given `key` exists in the store. + * + * @param key + * @returns + */ + async has(key) { + return await c$2("plugin:store|has", { + path: this.path, + key, + }); + } + /** + * Removes a key-value pair from the store. + * + * @param key + * @returns + */ + async delete(key) { + return await c$2("plugin:store|delete", { + path: this.path, + key, + }); + } + /** + * Clears the store, removing all key-value pairs. + * + * Note: To clear the storage and reset it to it's `default` value, use `reset` instead. + * @returns + */ + async clear() { + return await c$2("plugin:store|clear", { + path: this.path, + }); + } + /** + * Resets the store to it's `default` value. + * + * If no default value has been set, this method behaves identical to `clear`. + * @returns + */ + async reset() { + return await c$2("plugin:store|reset", { + path: this.path, + }); + } + /** + * Returns a list of all key in the store. + * + * @returns + */ + async keys() { + return await c$2("plugin:store|keys", { + path: this.path, + }); + } + /** + * Returns a list of all values in the store. + * + * @returns + */ + async values() { + return await c$2("plugin:store|values", { + path: this.path, + }); + } + /** + * Returns a list of all entries in the store. + * + * @returns + */ + async entries() { + return await c$2("plugin:store|entries", { + path: this.path, + }); + } + /** + * Returns the number of key-value pairs in the store. + * + * @returns + */ + async length() { + return await c$2("plugin:store|length", { + path: this.path, + }); + } + /** + * Attempts to load the on-disk state at the stores `path` into memory. + * + * This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. + * + * Note: This method does not emit change events. + * @returns + */ + async load() { + return await c$2("plugin:store|load", { + path: this.path, + }); + } + /** + * Saves the store to disk at the stores `path`. + * + * As the store is only persistet to disk before the apps exit, changes might be lost in a crash. + * This method let's you persist the store to disk whenever you deem necessary. + * @returns + */ + async save() { + return await c$2("plugin:store|save", { + path: this.path, + }); + } + /** + * Listen to changes on a store key. + * @param key + * @param cb + * @returns A promise resolving to a function to unlisten to the event. + */ + async onKeyChange(key, cb) { + return await b.listen("store://change", (event) => { + if (event.payload.path === this.path && event.payload.key === key) { + cb(event.payload.value); + } + }); + } + /** + * Listen to changes on the store. + * @param cb + * @returns A promise resolving to a function to unlisten to the event. + */ + async onChange(cb) { + return await b.listen("store://change", (event) => { + if (event.payload.path === this.path) { + cb(event.payload.key, event.payload.value); + } + }); + } +} + +export { Store }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/store/guest-js/dist/index.min.js.map b/plugins/store/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..d45809f4 --- /dev/null +++ b/plugins/store/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-HNLFKTAJ.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-3WDDWFXT.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-QSWLDHGO.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n","import{b as o}from\"./chunk-RCPA6UVN.js\";async function a(i){return o(\"tauri\",i)}export{a};\n","import{a}from\"./chunk-HNLFKTAJ.js\";import{a as l}from\"./chunk-RCPA6UVN.js\";import{a as d}from\"./chunk-FEIY7W7S.js\";var W={};d(W,{TauriEvent:()=>c,emit:()=>D,listen:()=>E,once:()=>_});async function s(n,t){return a({__tauriModule:\"Event\",message:{cmd:\"unlisten\",event:n,eventId:t}})}async function m(n,t,i){await a({__tauriModule:\"Event\",message:{cmd:\"emit\",event:n,windowLabel:t,payload:i}})}async function o(n,t,i){return a({__tauriModule:\"Event\",message:{cmd:\"listen\",event:n,windowLabel:t,handler:l(i)}}).then(r=>async()=>s(n,r))}async function u(n,t,i){return o(n,t,r=>{i(r),s(n,r.id).catch(()=>{})})}var c=(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.CHECK_UPDATE=\"tauri://update\",e.UPDATE_AVAILABLE=\"tauri://update-available\",e.INSTALL_UPDATE=\"tauri://update-install\",e.STATUS_UPDATE=\"tauri://update-status\",e.DOWNLOAD_PROGRESS=\"tauri://update-download-progress\",e))(c||{});async function E(n,t){return o(n,null,t)}async function _(n,t){return u(n,null,t)}async function D(n,t){return m(n,void 0,t)}export{m as a,o as b,u as c,c as d,E as e,_ as f,D as g,W as h};\n","import{a as p,b as _,c as w}from\"./chunk-3WDDWFXT.js\";import{a as t}from\"./chunk-HNLFKTAJ.js\";import{a as v}from\"./chunk-FEIY7W7S.js\";var C={};v(C,{CloseRequestedEvent:()=>y,LogicalPosition:()=>c,LogicalSize:()=>m,PhysicalPosition:()=>o,PhysicalSize:()=>l,UserAttentionType:()=>W,WebviewWindow:()=>s,WebviewWindowHandle:()=>u,WindowManager:()=>h,appWindow:()=>b,availableMonitors:()=>T,currentMonitor:()=>E,getAll:()=>M,getCurrent:()=>f,primaryMonitor:()=>z});var m=class{constructor(e,a){this.type=\"Logical\";this.width=e,this.height=a}},l=class{constructor(e,a){this.type=\"Physical\";this.width=e,this.height=a}toLogical(e){return new m(this.width/e,this.height/e)}},c=class{constructor(e,a){this.type=\"Logical\";this.x=e,this.y=a}},o=class{constructor(e,a){this.type=\"Physical\";this.x=e,this.y=a}toLogical(e){return new c(this.x/e,this.y/e)}},W=(a=>(a[a.Critical=1]=\"Critical\",a[a.Informational=2]=\"Informational\",a))(W||{});function f(){return new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function M(){return window.__TAURI_METADATA__.__windows.map(i=>new s(i.label,{skip:!0}))}var P=[\"tauri://created\",\"tauri://error\"],u=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1)}):_(e,this.label,a)}async once(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1)}):w(e,this.label,a)}async emit(e,a){if(P.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return p(e,this.label,a)}_handleTauriEvent(e,a){return P.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},h=class extends u{async scaleFactor(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"scaleFactor\"}}}})}async innerPosition(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"innerPosition\"}}}}).then(({x:e,y:a})=>new o(e,a))}async outerPosition(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"outerPosition\"}}}}).then(({x:e,y:a})=>new o(e,a))}async innerSize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"innerSize\"}}}}).then(({width:e,height:a})=>new l(e,a))}async outerSize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"outerSize\"}}}}).then(({width:e,height:a})=>new l(e,a))}async isFullscreen(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isFullscreen\"}}}})}async isMaximized(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isMaximized\"}}}})}async isDecorated(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isDecorated\"}}}})}async isResizable(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isResizable\"}}}})}async isVisible(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isVisible\"}}}})}async theme(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"theme\"}}}})}async center(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"center\"}}}})}async requestUserAttention(e){let a=null;return e&&(e===1?a={type:\"Critical\"}:a={type:\"Informational\"}),t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"requestUserAttention\",payload:a}}}})}async setResizable(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setResizable\",payload:e}}}})}async setTitle(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setTitle\",payload:e}}}})}async maximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"maximize\"}}}})}async unmaximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"unmaximize\"}}}})}async toggleMaximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"toggleMaximize\"}}}})}async minimize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"minimize\"}}}})}async unminimize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"unminimize\"}}}})}async show(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"show\"}}}})}async hide(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"hide\"}}}})}async close(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"close\"}}}})}async setDecorations(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setDecorations\",payload:e}}}})}async setAlwaysOnTop(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setAlwaysOnTop\",payload:e}}}})}async setSize(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setSize\",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setMinSize\",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setMaxSize\",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setPosition\",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setFullscreen\",payload:e}}}})}async setFocus(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setFocus\"}}}})}async setIcon(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setIcon\",payload:{icon:typeof e==\"string\"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setSkipTaskbar\",payload:e}}}})}async setCursorGrab(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorGrab\",payload:e}}}})}async setCursorVisible(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorVisible\",payload:e}}}})}async setCursorIcon(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorIcon\",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorPosition\",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setIgnoreCursorEvents\",payload:e}}}})}async startDragging(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"startDragging\"}}}})}async onResized(e){return this.listen(\"tauri://resize\",e)}async onMoved(e){return this.listen(\"tauri://move\",e)}async onCloseRequested(e){return this.listen(\"tauri://close-requested\",a=>{let n=new y(a);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let a=await this.listen(\"tauri://focus\",d=>{e({...d,payload:!0})}),n=await this.listen(\"tauri://blur\",d=>{e({...d,payload:!1})});return()=>{a(),n()}}async onScaleChanged(e){return this.listen(\"tauri://scale-change\",e)}async onMenuClicked(e){return this.listen(\"tauri://menu\",e)}async onFileDropEvent(e){let a=await this.listen(\"tauri://file-drop\",r=>{e({...r,payload:{type:\"drop\",paths:r.payload}})}),n=await this.listen(\"tauri://file-drop-hover\",r=>{e({...r,payload:{type:\"hover\",paths:r.payload}})}),d=await this.listen(\"tauri://file-drop-cancelled\",r=>{e({...r,payload:{type:\"cancel\"}})});return()=>{a(),n(),d()}}async onThemeChanged(e){return this.listen(\"tauri://theme-changed\",e)}},y=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},s=class extends h{constructor(e,a={}){super(e),a!=null&&a.skip||t({__tauriModule:\"Window\",message:{cmd:\"createWebview\",data:{options:{label:e,...a}}}}).then(async()=>this.emit(\"tauri://created\")).catch(async n=>this.emit(\"tauri://error\",n))}static getByLabel(e){return M().some(a=>a.label===e)?new s(e,{skip:!0}):null}},b;\"__TAURI_METADATA__\"in window?b=new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find \"window.__TAURI_METADATA__\". The \"appWindow\" value will reference the \"main\" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`),b=new s(\"main\",{skip:!0}));function g(i){return i===null?null:{name:i.name,scaleFactor:i.scaleFactor,position:new o(i.position.x,i.position.y),size:new l(i.size.width,i.size.height)}}async function E(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"currentMonitor\"}}}}).then(g)}async function z(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"primaryMonitor\"}}}}).then(g)}async function T(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"availableMonitors\"}}}}).then(i=>i.map(g))}export{m as a,l as b,c,o as d,W as e,f,M as g,u as h,h as i,y as j,s as k,b as l,E as m,z as n,T as o,C as p};\n",null],"names":["f","d","c","s","u","o","W","E","m","l","v","_","w","p","t","a","invoke","appWindow"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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AACR,QAAA,OAAO,MAAMA,GAAM,CAAC,mBAAmB,EAAE;YACvC,IAAI,EAAE,IAAI,CAAC,IAAI;AAChB,SAAA,CAAC,CAAC;KACJ;AAED;;;;;AAKG;AACH,IAAA,MAAM,WAAW,CACf,GAAW,EACX,EAA6B,EAAA;QAE7B,OAAO,MAAMC,CAAS,CAAC,MAAM,CAC3B,gBAAgB,EAChB,CAAC,KAAK,KAAI;AACR,YAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,EAAE;AACjE,gBAAA,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACzB,aAAA;AACH,SAAC,CACF,CAAC;KACH;AAED;;;;AAIG;IACH,MAAM,QAAQ,CACZ,EAAyC,EAAA;QAEzC,OAAO,MAAMA,CAAS,CAAC,MAAM,CAC3B,gBAAgB,EAChB,CAAC,KAAK,KAAI;YACR,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;AACpC,gBAAA,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5C,aAAA;AACH,SAAC,CACF,CAAC;KACH;AACF;;;;"} \ No newline at end of file diff --git a/plugins/store/guest-js/dist/index.mjs b/plugins/store/guest-js/dist/index.mjs new file mode 100644 index 00000000..6cccf8cd --- /dev/null +++ b/plugins/store/guest-js/dist/index.mjs @@ -0,0 +1,177 @@ +import { invoke } from '@tauri-apps/api/tauri'; +import { appWindow } from '@tauri-apps/api/window'; + +// Copyright 2021 Tauri Programme within The Commons Conservancy +/** + * A key-value store persisted by the backend layer. + */ +class Store { + constructor(path) { + this.path = path; + } + /** + * Inserts a key-value pair into the store. + * + * @param key + * @param value + * @returns + */ + async set(key, value) { + await invoke("plugin:store|set", { + path: this.path, + key, + value, + }); + } + /** + * Returns the value for the given `key` or `null` the key does not exist. + * + * @param key + * @returns + */ + async get(key) { + return await invoke("plugin:store|get", { + path: this.path, + key, + }); + } + /** + * Returns `true` if the given `key` exists in the store. + * + * @param key + * @returns + */ + async has(key) { + return await invoke("plugin:store|has", { + path: this.path, + key, + }); + } + /** + * Removes a key-value pair from the store. + * + * @param key + * @returns + */ + async delete(key) { + return await invoke("plugin:store|delete", { + path: this.path, + key, + }); + } + /** + * Clears the store, removing all key-value pairs. + * + * Note: To clear the storage and reset it to it's `default` value, use `reset` instead. + * @returns + */ + async clear() { + return await invoke("plugin:store|clear", { + path: this.path, + }); + } + /** + * Resets the store to it's `default` value. + * + * If no default value has been set, this method behaves identical to `clear`. + * @returns + */ + async reset() { + return await invoke("plugin:store|reset", { + path: this.path, + }); + } + /** + * Returns a list of all key in the store. + * + * @returns + */ + async keys() { + return await invoke("plugin:store|keys", { + path: this.path, + }); + } + /** + * Returns a list of all values in the store. + * + * @returns + */ + async values() { + return await invoke("plugin:store|values", { + path: this.path, + }); + } + /** + * Returns a list of all entries in the store. + * + * @returns + */ + async entries() { + return await invoke("plugin:store|entries", { + path: this.path, + }); + } + /** + * Returns the number of key-value pairs in the store. + * + * @returns + */ + async length() { + return await invoke("plugin:store|length", { + path: this.path, + }); + } + /** + * Attempts to load the on-disk state at the stores `path` into memory. + * + * This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. + * + * Note: This method does not emit change events. + * @returns + */ + async load() { + return await invoke("plugin:store|load", { + path: this.path, + }); + } + /** + * Saves the store to disk at the stores `path`. + * + * As the store is only persistet to disk before the apps exit, changes might be lost in a crash. + * This method let's you persist the store to disk whenever you deem necessary. + * @returns + */ + async save() { + return await invoke("plugin:store|save", { + path: this.path, + }); + } + /** + * Listen to changes on a store key. + * @param key + * @param cb + * @returns A promise resolving to a function to unlisten to the event. + */ + async onKeyChange(key, cb) { + return await appWindow.listen("store://change", (event) => { + if (event.payload.path === this.path && event.payload.key === key) { + cb(event.payload.value); + } + }); + } + /** + * Listen to changes on the store. + * @param cb + * @returns A promise resolving to a function to unlisten to the event. + */ + async onChange(cb) { + return await appWindow.listen("store://change", (event) => { + if (event.payload.path === this.path) { + cb(event.payload.key, event.payload.value); + } + }); + } +} + +export { Store }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/store/guest-js/dist/index.mjs.map b/plugins/store/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..e0cf891a --- /dev/null +++ b/plugins/store/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAAA;AAcA;;AAEG;MACU,KAAK,CAAA;AAEhB,IAAA,WAAA,CAAY,IAAY,EAAA;AACtB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;KAClB;AAED;;;;;;AAMG;AACH,IAAA,MAAM,GAAG,CAAC,GAAW,EAAE,KAAc,EAAA;QACnC,MAAM,MAAM,CAAC,kBAAkB,EAAE;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG;YACH,KAAK;AACN,SAAA,CAAC,CAAC;KACJ;AAED;;;;;AAKG;IACH,MAAM,GAAG,CAAI,GAAW,EAAA;AACtB,QAAA,OAAO,MAAM,MAAM,CAAC,kBAAkB,EAAE;YACtC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG;AACJ,SAAA,CAAC,CAAC;KACJ;AAED;;;;;AAKG;IACH,MAAM,GAAG,CAAC,GAAW,EAAA;AACnB,QAAA,OAAO,MAAM,MAAM,CAAC,kBAAkB,EAAE;YACtC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG;AACJ,SAAA,CAAC,CAAC;KACJ;AAED;;;;;AAKG;IACH,MAAM,MAAM,CAAC,GAAW,EAAA;AACtB,QAAA,OAAO,MAAM,MAAM,CAAC,qBAAqB,EAAE;YACzC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG;AACJ,SAAA,C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ACvC,IAAI,EAAE,IAAI,CAAC,IAAI;AAChB,SAAA,CAAC,CAAC;KACJ;AAED;;;;;AAKG;AACH,IAAA,MAAM,WAAW,CACf,GAAW,EACX,EAA6B,EAAA;QAE7B,OAAO,MAAM,SAAS,CAAC,MAAM,CAC3B,gBAAgB,EAChB,CAAC,KAAK,KAAI;AACR,YAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,EAAE;AACjE,gBAAA,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACzB,aAAA;AACH,SAAC,CACF,CAAC;KACH;AAED;;;;AAIG;IACH,MAAM,QAAQ,CACZ,EAAyC,EAAA;QAEzC,OAAO,MAAM,SAAS,CAAC,MAAM,CAC3B,gBAAgB,EAChB,CAAC,KAAK,KAAI;YACR,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;AACpC,gBAAA,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5C,aAAA;AACH,SAAC,CACF,CAAC;KACH;AACF;;;;"} \ No newline at end of file diff --git a/plugins/store/guest-js/index.ts b/plugins/store/guest-js/index.ts new file mode 100644 index 00000000..b943b0f2 --- /dev/null +++ b/plugins/store/guest-js/index.ts @@ -0,0 +1,210 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +import { invoke } from "@tauri-apps/api/tauri"; +import { UnlistenFn } from "@tauri-apps/api/event"; +import { appWindow } from "@tauri-apps/api/window"; + +interface ChangePayload { + path: string; + key: string; + value: T | null; +} + +/** + * A key-value store persisted by the backend layer. + */ +export class Store { + path: string; + constructor(path: string) { + this.path = path; + } + + /** + * Inserts a key-value pair into the store. + * + * @param key + * @param value + * @returns + */ + async set(key: string, value: unknown): Promise { + await invoke("plugin:store|set", { + path: this.path, + key, + value, + }); + } + + /** + * Returns the value for the given `key` or `null` the key does not exist. + * + * @param key + * @returns + */ + async get(key: string): Promise { + return await invoke("plugin:store|get", { + path: this.path, + key, + }); + } + + /** + * Returns `true` if the given `key` exists in the store. + * + * @param key + * @returns + */ + async has(key: string): Promise { + return await invoke("plugin:store|has", { + path: this.path, + key, + }); + } + + /** + * Removes a key-value pair from the store. + * + * @param key + * @returns + */ + async delete(key: string): Promise { + return await invoke("plugin:store|delete", { + path: this.path, + key, + }); + } + + /** + * Clears the store, removing all key-value pairs. + * + * Note: To clear the storage and reset it to it's `default` value, use `reset` instead. + * @returns + */ + async clear(): Promise { + return await invoke("plugin:store|clear", { + path: this.path, + }); + } + + /** + * Resets the store to it's `default` value. + * + * If no default value has been set, this method behaves identical to `clear`. + * @returns + */ + async reset(): Promise { + return await invoke("plugin:store|reset", { + path: this.path, + }); + } + + /** + * Returns a list of all key in the store. + * + * @returns + */ + async keys(): Promise { + return await invoke("plugin:store|keys", { + path: this.path, + }); + } + + /** + * Returns a list of all values in the store. + * + * @returns + */ + async values(): Promise { + return await invoke("plugin:store|values", { + path: this.path, + }); + } + + /** + * Returns a list of all entries in the store. + * + * @returns + */ + async entries(): Promise> { + return await invoke("plugin:store|entries", { + path: this.path, + }); + } + + /** + * Returns the number of key-value pairs in the store. + * + * @returns + */ + async length(): Promise { + return await invoke("plugin:store|length", { + path: this.path, + }); + } + + /** + * Attempts to load the on-disk state at the stores `path` into memory. + * + * This method is useful if the on-disk state was edited by the user and you want to synchronize the changes. + * + * Note: This method does not emit change events. + * @returns + */ + async load(): Promise { + return await invoke("plugin:store|load", { + path: this.path, + }); + } + + /** + * Saves the store to disk at the stores `path`. + * + * As the store is only persistet to disk before the apps exit, changes might be lost in a crash. + * This method let's you persist the store to disk whenever you deem necessary. + * @returns + */ + async save(): Promise { + return await invoke("plugin:store|save", { + path: this.path, + }); + } + + /** + * Listen to changes on a store key. + * @param key + * @param cb + * @returns A promise resolving to a function to unlisten to the event. + */ + async onKeyChange( + key: string, + cb: (value: T | null) => void + ): Promise { + return await appWindow.listen>( + "store://change", + (event) => { + if (event.payload.path === this.path && event.payload.key === key) { + cb(event.payload.value); + } + } + ); + } + + /** + * Listen to changes on the store. + * @param cb + * @returns A promise resolving to a function to unlisten to the event. + */ + async onChange( + cb: (key: string, value: unknown) => void + ): Promise { + return await appWindow.listen>( + "store://change", + (event) => { + if (event.payload.path === this.path) { + cb(event.payload.key, event.payload.value); + } + } + ); + } +} diff --git a/plugins/store/guest-js/package.json b/plugins/store/guest-js/package.json new file mode 100644 index 00000000..57e5a283 --- /dev/null +++ b/plugins/store/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-store-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/store/guest-js/rollup.config.mjs b/plugins/store/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/store/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/store/guest-js/tsconfig.json b/plugins/store/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/store/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/store/src/error.rs b/plugins/store/src/error.rs new file mode 100644 index 00000000..6919827d --- /dev/null +++ b/plugins/store/src/error.rs @@ -0,0 +1,34 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Serialize, Serializer}; +use std::path::PathBuf; + +/// The error types. +#[derive(thiserror::Error, Debug)] +#[non_exhaustive] +pub enum Error { + #[error("Failed to serialize store. {0}")] + Serialize(Box), + #[error("Failed to deserialize store. {0}")] + Deserialize(Box), + /// JSON error. + #[error(transparent)] + Json(#[from] serde_json::Error), + /// IO error. + #[error(transparent)] + Io(#[from] std::io::Error), + /// Store not found + #[error("Store \"{0}\" not found")] + NotFound(PathBuf), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} diff --git a/plugins/store/src/lib.rs b/plugins/store/src/lib.rs new file mode 100644 index 00000000..db9b3048 --- /dev/null +++ b/plugins/store/src/lib.rs @@ -0,0 +1,370 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +pub use error::Error; +use log::warn; +use serde::Serialize; +use serde_json::Value as JsonValue; +use std::{collections::HashMap, path::PathBuf, sync::Mutex}; +pub use store::{Store, StoreBuilder}; +use tauri::{ + plugin::{self, TauriPlugin}, + AppHandle, Manager, RunEvent, Runtime, State, Window, +}; + +mod error; +mod store; + +#[derive(Serialize, Clone)] +struct ChangePayload { + path: PathBuf, + key: String, + value: JsonValue, +} + +#[derive(Default)] +struct StoreCollection { + stores: Mutex>, + frozen: bool, +} + +fn with_store Result>( + app: &AppHandle, + collection: State<'_, StoreCollection>, + path: PathBuf, + f: F, +) -> Result { + let mut stores = collection.stores.lock().expect("mutex poisoned"); + + if !stores.contains_key(&path) { + if collection.frozen { + return Err(Error::NotFound(path)); + } + let mut store = StoreBuilder::new(path.clone()).build(); + // ignore loading errors, just use the default + if let Err(err) = store.load(app) { + warn!( + "Failed to load store {:?} from disk: {}. Falling back to default values.", + path, err + ); + } + stores.insert(path.clone(), store); + } + + f(stores + .get_mut(&path) + .expect("failed to retrieve store. This is a bug!")) +} + +#[tauri::command] +async fn set( + app: AppHandle, + window: Window, + stores: State<'_, StoreCollection>, + path: PathBuf, + key: String, + value: JsonValue, +) -> Result<(), Error> { + with_store(&app, stores, path.clone(), |store| { + store.cache.insert(key.clone(), value.clone()); + let _ = window.emit("store://change", ChangePayload { path, key, value }); + Ok(()) + }) +} + +#[tauri::command] +async fn get( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, + key: String, +) -> Result, Error> { + with_store(&app, stores, path, |store| { + Ok(store.cache.get(&key).cloned()) + }) +} + +#[tauri::command] +async fn has( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, + key: String, +) -> Result { + with_store(&app, stores, path, |store| { + Ok(store.cache.contains_key(&key)) + }) +} + +#[tauri::command] +async fn delete( + app: AppHandle, + window: Window, + stores: State<'_, StoreCollection>, + path: PathBuf, + key: String, +) -> Result { + with_store(&app, stores, path.clone(), |store| { + let flag = store.cache.remove(&key).is_some(); + if flag { + let _ = window.emit( + "store://change", + ChangePayload { + path, + key, + value: JsonValue::Null, + }, + ); + } + Ok(flag) + }) +} + +#[tauri::command] +async fn clear( + app: AppHandle, + window: Window, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result<(), Error> { + with_store(&app, stores, path.clone(), |store| { + let keys = store.cache.keys().cloned().collect::>(); + store.cache.clear(); + for key in keys { + let _ = window.emit( + "store://change", + ChangePayload { + path: path.clone(), + key, + value: JsonValue::Null, + }, + ); + } + Ok(()) + }) +} + +#[tauri::command] +async fn reset( + app: AppHandle, + window: Window, + collection: State<'_, StoreCollection>, + path: PathBuf, +) -> Result<(), Error> { + let has_defaults = collection + .stores + .lock() + .expect("mutex poisoned") + .get(&path) + .map(|store| store.defaults.is_some()); + + if Some(true) == has_defaults { + with_store(&app, collection, path.clone(), |store| { + if let Some(defaults) = &store.defaults { + for (key, value) in &store.cache { + if defaults.get(key) != Some(value) { + let _ = window.emit( + "store://change", + ChangePayload { + path: path.clone(), + key: key.clone(), + value: defaults.get(key).cloned().unwrap_or(JsonValue::Null), + }, + ); + } + } + store.cache = defaults.clone(); + } + Ok(()) + }) + } else { + clear(app, window, collection, path).await + } +} + +#[tauri::command] +async fn keys( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result, Error> { + with_store(&app, stores, path, |store| { + Ok(store.cache.keys().cloned().collect()) + }) +} + +#[tauri::command] +async fn values( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result, Error> { + with_store(&app, stores, path, |store| { + Ok(store.cache.values().cloned().collect()) + }) +} + +#[tauri::command] +async fn entries( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result, Error> { + with_store(&app, stores, path, |store| { + Ok(store.cache.clone().into_iter().collect()) + }) +} + +#[tauri::command] +async fn length( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result { + with_store(&app, stores, path, |store| Ok(store.cache.len())) +} + +#[tauri::command] +async fn load( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result<(), Error> { + with_store(&app, stores, path, |store| store.load(&app)) +} + +#[tauri::command] +async fn save( + app: AppHandle, + stores: State<'_, StoreCollection>, + path: PathBuf, +) -> Result<(), Error> { + with_store(&app, stores, path, |store| store.save(&app)) +} + +#[derive(Default)] +pub struct PluginBuilder { + stores: HashMap, + frozen: bool, +} + +impl PluginBuilder { + /// Registers a store with the plugin. + /// + /// # Examples + /// + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::{StoreBuilder,PluginBuilder}; + /// + /// let store = StoreBuilder::new("store.bin".parse()?).build(); + /// + /// let builder = PluginBuilder::default().store(store); + /// + /// # Ok(()) + /// # } + /// ``` + pub fn store(mut self, store: Store) -> Self { + self.stores.insert(store.path.clone(), store); + self + } + + /// Registers multiple stores with the plugin. + /// + /// # Examples + /// + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::{StoreBuilder,PluginBuilder}; + /// + /// let store = StoreBuilder::new("store.bin".parse()?).build(); + /// + /// let builder = PluginBuilder::default().stores([store]); + /// + /// # Ok(()) + /// # } + /// ``` + pub fn stores>(mut self, stores: T) -> Self { + self.stores = stores + .into_iter() + .map(|store| (store.path.clone(), store)) + .collect(); + self + } + + /// Freezes the collection. + /// + /// This causes requests for plugins that haven't been registered to fail + /// + /// # Examples + /// + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::{StoreBuilder,PluginBuilder}; + /// + /// let store = StoreBuilder::new("store.bin".parse()?).build(); + /// + /// let builder = PluginBuilder::default().freeze(); + /// + /// # Ok(()) + /// # } + /// ``` + pub fn freeze(mut self) -> Self { + self.frozen = true; + self + } + + /// Builds the plugin. + /// + /// # Examples + /// + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::{StoreBuilder,PluginBuilder}; + /// use tauri::Wry; + /// + /// let store = StoreBuilder::new("store.bin".parse()?).build(); + /// + /// let plugin = PluginBuilder::default().build::(); + /// + /// # Ok(()) + /// # } + /// ``` + pub fn build(mut self) -> TauriPlugin { + plugin::Builder::new("store") + .invoke_handler(tauri::generate_handler![ + set, get, has, delete, clear, reset, keys, values, length, entries, load, save + ]) + .setup(move |app_handle| { + for (path, store) in self.stores.iter_mut() { + // ignore loading errors, just use the default + if let Err(err) = store.load(app_handle) { + warn!( + "Failed to load store {:?} from disk: {}. Falling back to default values.", + path, err + ); + } + } + + app_handle.manage(StoreCollection { + stores: Mutex::new(self.stores), + frozen: self.frozen, + }); + + Ok(()) + }) + .on_event(|app_handle, event| { + if let RunEvent::Exit = event { + let collection = app_handle.state::(); + + for store in collection.stores.lock().expect("mutex poisoned").values() { + if let Err(err) = store.save(app_handle) { + eprintln!("failed to save store {:?} with error {:?}", store.path, err); + } + } + } + }) + .build() + } +} diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs new file mode 100644 index 00000000..9f29250f --- /dev/null +++ b/plugins/store/src/store.rs @@ -0,0 +1,212 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use crate::Error; +use serde_json::Value as JsonValue; +use std::{ + collections::HashMap, + fs::{create_dir_all, read, File}, + io::Write, + path::PathBuf, +}; +use tauri::{AppHandle, Runtime}; + +type SerializeFn = fn(&HashMap) -> Result, Box>; +type DeserializeFn = fn(&[u8]) -> Result, Box>; + +fn default_serialize( + cache: &HashMap, +) -> Result, Box> { + Ok(serde_json::to_vec(&cache)?) +} + +fn default_deserialize( + bytes: &[u8], +) -> Result, Box> { + serde_json::from_slice(bytes).map_err(Into::into) +} + +/// Builds a [`Store`] +pub struct StoreBuilder { + path: PathBuf, + defaults: Option>, + cache: HashMap, + serialize: SerializeFn, + deserialize: DeserializeFn, +} + +impl StoreBuilder { + /// Creates a new [`StoreBuilder`]. + /// + /// # Examples + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::StoreBuilder; + /// + /// let builder = StoreBuilder::new("store.bin".parse()?); + /// + /// # Ok(()) + /// # } + /// ``` + pub fn new(path: PathBuf) -> Self { + Self { + path, + defaults: None, + cache: Default::default(), + serialize: default_serialize, + deserialize: default_deserialize, + } + } + + /// Inserts a default key-value pair. + /// + /// # Examples + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::StoreBuilder; + /// use std::collections::HashMap; + /// + /// let mut defaults = HashMap::new(); + /// + /// defaults.insert("foo".to_string(), "bar".into()); + /// + /// let builder = StoreBuilder::new("store.bin".parse()?) + /// .defaults(defaults); + /// + /// # Ok(()) + /// # } + pub fn defaults(mut self, defaults: HashMap) -> Self { + self.cache = defaults.clone(); + self.defaults = Some(defaults); + self + } + + /// Inserts multiple key-value pairs. + /// + /// # Examples + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::StoreBuilder; + /// + /// let builder = StoreBuilder::new("store.bin".parse()?) + /// .default("foo".to_string(), "bar".into()); + /// + /// # Ok(()) + /// # } + pub fn default(mut self, key: String, value: JsonValue) -> Self { + self.cache.insert(key.clone(), value.clone()); + self.defaults + .get_or_insert(HashMap::new()) + .insert(key, value); + self + } + + /// Defines a custom serialization function. + /// + /// # Examples + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::StoreBuilder; + /// + /// let builder = StoreBuilder::new("store.json".parse()?) + /// .serialize(|cache| serde_json::to_vec(&cache).map_err(Into::into)); + /// + /// # Ok(()) + /// # } + pub fn serialize(mut self, serialize: SerializeFn) -> Self { + self.serialize = serialize; + self + } + + /// Defines a custom deserialization function + /// + /// # Examples + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::StoreBuilder; + /// + /// let builder = StoreBuilder::new("store.json".parse()?) + /// .deserialize(|bytes| serde_json::from_slice(&bytes).map_err(Into::into)); + /// + /// # Ok(()) + /// # } + pub fn deserialize(mut self, deserialize: DeserializeFn) -> Self { + self.deserialize = deserialize; + self + } + + /// Builds the [`Store`]. + /// + /// # Examples + /// ``` + /// # fn main() -> Result<(), Box> { + /// use tauri_plugin_store::StoreBuilder; + /// + /// let store = StoreBuilder::new("store.bin".parse()?).build(); + /// + /// # Ok(()) + /// # } + pub fn build(self) -> Store { + Store { + path: self.path, + defaults: self.defaults, + cache: self.cache, + serialize: self.serialize, + deserialize: self.deserialize, + } + } +} + +#[derive(Clone)] +pub struct Store { + pub(crate) path: PathBuf, + pub(crate) defaults: Option>, + pub(crate) cache: HashMap, + serialize: SerializeFn, + deserialize: DeserializeFn, +} + +impl Store { + /// Update the store from the on-disk state + pub fn load(&mut self, app: &AppHandle) -> Result<(), Error> { + let app_dir = app + .path_resolver() + .app_dir() + .expect("failed to resolve app dir"); + let store_path = app_dir.join(&self.path); + + let bytes = read(&store_path)?; + + self.cache = (self.deserialize)(&bytes).map_err(Error::Deserialize)?; + + Ok(()) + } + + /// Saves the store to disk + pub fn save(&self, app: &AppHandle) -> Result<(), Error> { + let app_dir = app + .path_resolver() + .app_dir() + .expect("failed to resolve app dir"); + let store_path = app_dir.join(&self.path); + + create_dir_all(store_path.parent().expect("invalid store path"))?; + + let bytes = (self.serialize)(&self.cache).map_err(Error::Serialize)?; + let mut f = File::create(&store_path)?; + f.write_all(&bytes)?; + + Ok(()) + } +} + +impl std::fmt::Debug for Store { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Store") + .field("path", &self.path) + .field("defaults", &self.defaults) + .field("cache", &self.cache) + .finish() + } +} diff --git a/plugins/stronghold/Cargo.toml b/plugins/stronghold/Cargo.toml new file mode 100644 index 00000000..ba8f6c3f --- /dev/null +++ b/plugins/stronghold/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "tauri-plugin-stronghold" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +iota_stronghold = { version = "0.8" } +iota-crypto = "0.14" +hex = "0.4" +zeroize = { version = "1", features = ["zeroize_derive"] } + +[dev-dependencies] +rand = "0.8" +rusty-fork = "0.3" \ No newline at end of file diff --git a/plugins/stronghold/guest-js/dist/index.min.js b/plugins/stronghold/guest-js/dist/index.min.js new file mode 100644 index 00000000..0cffa11d --- /dev/null +++ b/plugins/stronghold/guest-js/dist/index.min.js @@ -0,0 +1,217 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +function toBytesDto(v) { + if (typeof v === "string") { + return v; + } + return Array.from(v instanceof ArrayBuffer ? new Uint8Array(v) : v); +} +class Location { + constructor(type, payload) { + this.type = type; + this.payload = payload; + } + static generic(vault, record) { + return new Location("Generic", { + vault: toBytesDto(vault), + record: toBytesDto(record), + }); + } + static counter(vault, counter) { + return new Location("Counter", { + vault: toBytesDto(vault), + counter, + }); + } +} +class ProcedureExecutor { + constructor(procedureArgs) { + this.procedureArgs = procedureArgs; + } + async generateSLIP10Seed(outputLocation, sizeBytes) { + return await c("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "SLIP10Generate", + payload: { + output: outputLocation, + sizeBytes, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async deriveSLIP10(chain, source, sourceLocation, outputLocation) { + return await c("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "SLIP10Derive", + payload: { + chain, + input: { + type: source, + payload: sourceLocation, + }, + output: outputLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async recoverBIP39(mnemonic, outputLocation, passphrase) { + return await c("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "BIP39Recover", + payload: { + mnemonic, + passphrase, + output: outputLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async generateBIP39(outputLocation, passphrase) { + return await c("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "BIP39Generate", + payload: { + output: outputLocation, + passphrase, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async getEd25519PublicKey(privateKeyLocation) { + return await c("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "PublicKey", + payload: { + type: "Ed25519", + privateKey: privateKeyLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async signEd25519(privateKeyLocation, msg) { + return await c("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "Ed25519Sign", + payload: { + privateKey: privateKeyLocation, + msg, + }, + }, + }).then((n) => Uint8Array.from(n)); + } +} +class Client { + constructor(path, name) { + this.path = path; + this.name = toBytesDto(name); + } + getVault(name) { + return new Vault(this.path, this.name, toBytesDto(name)); + } + getStore() { + return new Store(this.path, this.name); + } +} +class Store { + constructor(path, client) { + this.path = path; + this.client = client; + } + async get(key) { + return await c("plugin:stronghold|get_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + }).then((v) => Uint8Array.from(v)); + } + async insert(key, value, lifetime) { + return await c("plugin:stronghold|save_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + value, + lifetime, + }); + } + async remove(key) { + return await c("plugin:stronghold|remove_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + }).then((v) => (v != null ? Uint8Array.from(v) : null)); + } +} +class Vault extends ProcedureExecutor { + constructor(path, client, name) { + super({ + snapshotPath: path, + client, + vault: name, + }); + this.path = path; + this.client = toBytesDto(client); + this.name = toBytesDto(name); + } + async insert(recordPath, secret) { + return await c("plugin:stronghold|save_secret", { + snapshotPath: this.path, + client: this.client, + vault: this.name, + recordPath: toBytesDto(recordPath), + secret, + }); + } + async remove(location) { + return await c("plugin:stronghold|remove_secret", { + snapshotPath: this.path, + client: this.client, + vault: this.name, + location, + }); + } +} +class Stronghold { + constructor(path, password) { + this.path = path; + void this.reload(password); + } + async reload(password) { + return await c("plugin:stronghold|initialize", { + snapshotPath: this.path, + password, + }); + } + async unload() { + return await c("plugin:stronghold|destroy", { + snapshotPath: this.path, + }); + } + async loadClient(client) { + return await c("plugin:stronghold|load_client", { + snapshotPath: this.path, + client: toBytesDto(client), + }).then(() => new Client(this.path, client)); + } + async createClient(client) { + return await c("plugin:stronghold|create_client", { + snapshotPath: this.path, + client: toBytesDto(client), + }).then(() => new Client(this.path, client)); + } + async save() { + return await c("plugin:stronghold|save", { + snapshotPath: this.path, + }); + } +} + +export { Client, Location, Store, Stronghold, Vault }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/stronghold/guest-js/dist/index.min.js.map b/plugins/stronghold/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..4054f833 --- /dev/null +++ b/plugins/stronghold/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as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AM,CAAC,+BAA+B,EAAE;YACnD,YAAY,EAAE,IAAI,CAAC,IAAI;AACvB,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;AAC3B,SAAA,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;KAC9C;IAED,MAAM,YAAY,CAAC,MAAkB,EAAA;AACnC,QAAA,OAAO,MAAMA,CAAM,CAAC,iCAAiC,EAAE;YACrD,YAAY,EAAE,IAAI,CAAC,IAAI;AACvB,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;AAC3B,SAAA,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;KAC9C;AAED,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,MAAMA,CAAM,CAAC,wBAAwB,EAAE;YAC5C,YAAY,EAAE,IAAI,CAAC,IAAI;AACxB,SAAA,CAAC,CAAC;KACJ;AACF;;;;"} \ No newline at end of file diff --git a/plugins/stronghold/guest-js/dist/index.mjs b/plugins/stronghold/guest-js/dist/index.mjs new file mode 100644 index 00000000..fd30c04a --- /dev/null +++ b/plugins/stronghold/guest-js/dist/index.mjs @@ -0,0 +1,215 @@ +import { invoke } from '@tauri-apps/api/tauri'; + +function toBytesDto(v) { + if (typeof v === "string") { + return v; + } + return Array.from(v instanceof ArrayBuffer ? new Uint8Array(v) : v); +} +class Location { + constructor(type, payload) { + this.type = type; + this.payload = payload; + } + static generic(vault, record) { + return new Location("Generic", { + vault: toBytesDto(vault), + record: toBytesDto(record), + }); + } + static counter(vault, counter) { + return new Location("Counter", { + vault: toBytesDto(vault), + counter, + }); + } +} +class ProcedureExecutor { + constructor(procedureArgs) { + this.procedureArgs = procedureArgs; + } + async generateSLIP10Seed(outputLocation, sizeBytes) { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "SLIP10Generate", + payload: { + output: outputLocation, + sizeBytes, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async deriveSLIP10(chain, source, sourceLocation, outputLocation) { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "SLIP10Derive", + payload: { + chain, + input: { + type: source, + payload: sourceLocation, + }, + output: outputLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async recoverBIP39(mnemonic, outputLocation, passphrase) { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "BIP39Recover", + payload: { + mnemonic, + passphrase, + output: outputLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async generateBIP39(outputLocation, passphrase) { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "BIP39Generate", + payload: { + output: outputLocation, + passphrase, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async getEd25519PublicKey(privateKeyLocation) { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "PublicKey", + payload: { + type: "Ed25519", + privateKey: privateKeyLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + async signEd25519(privateKeyLocation, msg) { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "Ed25519Sign", + payload: { + privateKey: privateKeyLocation, + msg, + }, + }, + }).then((n) => Uint8Array.from(n)); + } +} +class Client { + constructor(path, name) { + this.path = path; + this.name = toBytesDto(name); + } + getVault(name) { + return new Vault(this.path, this.name, toBytesDto(name)); + } + getStore() { + return new Store(this.path, this.name); + } +} +class Store { + constructor(path, client) { + this.path = path; + this.client = client; + } + async get(key) { + return await invoke("plugin:stronghold|get_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + }).then((v) => Uint8Array.from(v)); + } + async insert(key, value, lifetime) { + return await invoke("plugin:stronghold|save_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + value, + lifetime, + }); + } + async remove(key) { + return await invoke("plugin:stronghold|remove_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + }).then((v) => (v != null ? Uint8Array.from(v) : null)); + } +} +class Vault extends ProcedureExecutor { + constructor(path, client, name) { + super({ + snapshotPath: path, + client, + vault: name, + }); + this.path = path; + this.client = toBytesDto(client); + this.name = toBytesDto(name); + } + async insert(recordPath, secret) { + return await invoke("plugin:stronghold|save_secret", { + snapshotPath: this.path, + client: this.client, + vault: this.name, + recordPath: toBytesDto(recordPath), + secret, + }); + } + async remove(location) { + return await invoke("plugin:stronghold|remove_secret", { + snapshotPath: this.path, + client: this.client, + vault: this.name, + location, + }); + } +} +class Stronghold { + constructor(path, password) { + this.path = path; + void this.reload(password); + } + async reload(password) { + return await invoke("plugin:stronghold|initialize", { + snapshotPath: this.path, + password, + }); + } + async unload() { + return await invoke("plugin:stronghold|destroy", { + snapshotPath: this.path, + }); + } + async loadClient(client) { + return await invoke("plugin:stronghold|load_client", { + snapshotPath: this.path, + client: toBytesDto(client), + }).then(() => new Client(this.path, client)); + } + async createClient(client) { + return await invoke("plugin:stronghold|create_client", { + snapshotPath: this.path, + client: toBytesDto(client), + }).then(() => new Client(this.path, client)); + } + async save() { + return await invoke("plugin:stronghold|save", { + snapshotPath: this.path, + }); + } +} + +export { Client, Location, Store, Stronghold, Vault }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/stronghold/guest-js/dist/index.mjs.map b/plugins/stronghold/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..e4650fa7 --- /dev/null +++ b/plugins/stronghold/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAwBA,SAAS,UAAU,CACjB,CAAiD,EAAA;AAEjD,IAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AACzB,QAAA,OAAO,CAAC,CAAC;AACV,KAAA;IACD,OAAO,KAAK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,YAAY,EAAE,IAAI,CAAC,IAAI;YACvB,QAAQ;AACT,SAAA,CAAC,CAAC;KACJ;AAED,IAAA,MAAM,MAAM,GAAA;AACV,QAAA,OAAO,MAAM,MAAM,CAAC,2BAA2B,EAAE;YAC/C,YAAY,EAAE,IAAI,CAAC,IAAI;AACxB,SAAA,CAAC,CAAC;KACJ;IAED,MAAM,UAAU,CAAC,MAAkB,EAAA;AACjC,QAAA,OAAO,MAAM,MAAM,CAAC,+BAA+B,EAAE;YACnD,YAAY,EAAE,IAAI,CAAC,IAAI;AACvB,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;AAC3B,SAAA,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;KAC9C;IAED,MAAM,YAAY,CAAC,MAAkB,EAAA;AACnC,QAAA,OAAO,MAAM,MAAM,CAAC,iCAAiC,EAAE;YACrD,YAAY,EAAE,IAAI,CAAC,IAAI;AACvB,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;AAC3B,SAAA,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;KAC9C;AAED,IAAA,MAAM,IAAI,GAAA;AACR,QAAA,OAAO,MAAM,MAAM,CAAC,wBAAwB,EAAE;YAC5C,YAAY,EAAE,IAAI,CAAC,IAAI;AACxB,SAAA,CAAC,CAAC;KACJ;AACF;;;;"} \ No newline at end of file diff --git a/plugins/stronghold/guest-js/index.ts b/plugins/stronghold/guest-js/index.ts new file mode 100644 index 00000000..09334ade --- /dev/null +++ b/plugins/stronghold/guest-js/index.ts @@ -0,0 +1,355 @@ +import { invoke } from "@tauri-apps/api/tauri"; + +type BytesDto = string | number[]; +export type ClientPath = + | string + | Iterable + | ArrayLike + | ArrayBuffer; +export type VaultPath = + | string + | Iterable + | ArrayLike + | ArrayBuffer; +export type RecordPath = + | string + | Iterable + | ArrayLike + | ArrayBuffer; +export type StoreKey = + | string + | Iterable + | ArrayLike + | ArrayBuffer; + +function toBytesDto( + v: ClientPath | VaultPath | RecordPath | StoreKey +): string | number[] { + if (typeof v === "string") { + return v; + } + return Array.from(v instanceof ArrayBuffer ? new Uint8Array(v) : v); +} + +export interface ConnectionLimits { + maxPendingIncoming?: number; + maxPendingOutgoing?: number; + maxEstablishedIncoming?: number; + maxEstablishedOutgoing?: number; + maxEstablishedPerPeer?: number; + maxEstablishedTotal?: number; +} + +export interface PeerAddress { + known: string[]; // multiaddr + use_relay_fallback: boolean; +} + +export interface AddressInfo { + peers: Map; + relays: string[]; // peers +} + +export interface ClientAccess { + useVaultDefault?: boolean; + useVaultExceptions?: Map; + writeVaultDefault?: boolean; + writeVaultExceptions?: Map; + cloneVaultDefault?: boolean; + cloneVaultExceptions?: Map; + readStore?: boolean; + writeStore?: boolean; +} + +export interface Permissions { + default?: ClientAccess; + exceptions?: Map; +} + +export interface NetworkConfig { + requestTimeout?: Duration; + connectionTimeout?: Duration; + connectionsLimit?: ConnectionLimits; + enableMdns?: boolean; + enableRelay?: boolean; + addresses?: AddressInfo; + peerPermissions?: Map; + permissionsDefault?: Permissions; +} + +export interface Duration { + millis: number; + nanos: number; +} + +export class Location { + type: string; + payload: Record; + + constructor(type: string, payload: Record) { + this.type = type; + this.payload = payload; + } + + static generic(vault: VaultPath, record: RecordPath): Location { + return new Location("Generic", { + vault: toBytesDto(vault), + record: toBytesDto(record), + }); + } + + static counter(vault: VaultPath, counter: number): Location { + return new Location("Counter", { + vault: toBytesDto(vault), + counter, + }); + } +} + +class ProcedureExecutor { + procedureArgs: Record; + + constructor(procedureArgs: Record) { + this.procedureArgs = procedureArgs; + } + + async generateSLIP10Seed( + outputLocation: Location, + sizeBytes?: number + ): Promise { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "SLIP10Generate", + payload: { + output: outputLocation, + sizeBytes, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + + async deriveSLIP10( + chain: number[], + source: "Seed" | "Key", + sourceLocation: Location, + outputLocation: Location + ): Promise { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "SLIP10Derive", + payload: { + chain, + input: { + type: source, + payload: sourceLocation, + }, + output: outputLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + + async recoverBIP39( + mnemonic: string, + outputLocation: Location, + passphrase?: string + ): Promise { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "BIP39Recover", + payload: { + mnemonic, + passphrase, + output: outputLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + + async generateBIP39( + outputLocation: Location, + passphrase?: string + ): Promise { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "BIP39Generate", + payload: { + output: outputLocation, + passphrase, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + + async getEd25519PublicKey(privateKeyLocation: Location): Promise { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "PublicKey", + payload: { + type: "Ed25519", + privateKey: privateKeyLocation, + }, + }, + }).then((n) => Uint8Array.from(n)); + } + + async signEd25519( + privateKeyLocation: Location, + msg: string + ): Promise { + return await invoke("plugin:stronghold|execute_procedure", { + ...this.procedureArgs, + procedure: { + type: "Ed25519Sign", + payload: { + privateKey: privateKeyLocation, + msg, + }, + }, + }).then((n) => Uint8Array.from(n)); + } +} + +export class Client { + path: string; + name: BytesDto; + + constructor(path: string, name: ClientPath) { + this.path = path; + this.name = toBytesDto(name); + } + + getVault(name: VaultPath): Vault { + return new Vault(this.path, this.name, toBytesDto(name)); + } + + getStore(): Store { + return new Store(this.path, this.name); + } +} + +export class Store { + path: string; + client: BytesDto; + + constructor(path: string, client: BytesDto) { + this.path = path; + this.client = client; + } + + async get(key: StoreKey): Promise { + return await invoke("plugin:stronghold|get_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + }).then((v) => Uint8Array.from(v)); + } + + async insert( + key: StoreKey, + value: number[], + lifetime?: Duration + ): Promise { + return await invoke("plugin:stronghold|save_store_record", { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + value, + lifetime, + }); + } + + async remove(key: StoreKey): Promise { + return await invoke( + "plugin:stronghold|remove_store_record", + { + snapshotPath: this.path, + client: this.client, + key: toBytesDto(key), + } + ).then((v) => (v != null ? Uint8Array.from(v) : null)); + } +} + +export class Vault extends ProcedureExecutor { + path: string; + client: BytesDto; + name: BytesDto; + + constructor(path: string, client: ClientPath, name: VaultPath) { + super({ + snapshotPath: path, + client, + vault: name, + }); + this.path = path; + this.client = toBytesDto(client); + this.name = toBytesDto(name); + } + + async insert(recordPath: RecordPath, secret: number[]): Promise { + return await invoke("plugin:stronghold|save_secret", { + snapshotPath: this.path, + client: this.client, + vault: this.name, + recordPath: toBytesDto(recordPath), + secret, + }); + } + + async remove(location: Location): Promise { + return await invoke("plugin:stronghold|remove_secret", { + snapshotPath: this.path, + client: this.client, + vault: this.name, + location, + }); + } +} + +export class Stronghold { + path: string; + + constructor(path: string, password: string) { + this.path = path; + void this.reload(password); + } + + private async reload(password: string): Promise { + return await invoke("plugin:stronghold|initialize", { + snapshotPath: this.path, + password, + }); + } + + async unload(): Promise { + return await invoke("plugin:stronghold|destroy", { + snapshotPath: this.path, + }); + } + + async loadClient(client: ClientPath): Promise { + return await invoke("plugin:stronghold|load_client", { + snapshotPath: this.path, + client: toBytesDto(client), + }).then(() => new Client(this.path, client)); + } + + async createClient(client: ClientPath): Promise { + return await invoke("plugin:stronghold|create_client", { + snapshotPath: this.path, + client: toBytesDto(client), + }).then(() => new Client(this.path, client)); + } + + async save(): Promise { + return await invoke("plugin:stronghold|save", { + snapshotPath: this.path, + }); + } +} diff --git a/plugins/stronghold/guest-js/package.json b/plugins/stronghold/guest-js/package.json new file mode 100644 index 00000000..c0b87e8d --- /dev/null +++ b/plugins/stronghold/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-stronghold-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/stronghold/guest-js/rollup.config.mjs b/plugins/stronghold/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/stronghold/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/stronghold/guest-js/tsconfig.json b/plugins/stronghold/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/stronghold/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/stronghold/src/lib.rs b/plugins/stronghold/src/lib.rs new file mode 100644 index 00000000..b14b6990 --- /dev/null +++ b/plugins/stronghold/src/lib.rs @@ -0,0 +1,432 @@ +use std::{ + collections::HashMap, + fmt, + path::PathBuf, + sync::{Arc, Mutex}, + time::Duration, +}; + +use iota_stronghold::{ + procedures::{ + BIP39Generate, BIP39Recover, Chain, Ed25519Sign, KeyType as StrongholdKeyType, + MnemonicLanguage, PublicKey, Slip10Derive, Slip10DeriveInput, Slip10Generate, + StrongholdProcedure, + }, + Client, Location, +}; +use serde::{de::Visitor, Deserialize, Deserializer}; +use stronghold::{Error, Result, Stronghold}; +use tauri::{ + plugin::{Builder as PluginBuilder, TauriPlugin}, + Manager, Runtime, State, +}; +use zeroize::Zeroize; + +pub mod stronghold; + +type PasswordHashFn = dyn Fn(&str) -> Vec + Send + Sync; + +#[derive(Default)] +struct StrongholdCollection(Arc>>); + +struct PasswordHashFunction(Box); + +#[derive(Deserialize, Hash, Eq, PartialEq, Ord, PartialOrd)] +#[serde(untagged)] +enum BytesDto { + Text(String), + Raw(Vec), +} + +impl AsRef<[u8]> for BytesDto { + fn as_ref(&self) -> &[u8] { + match self { + Self::Text(t) => t.as_ref(), + Self::Raw(b) => b.as_ref(), + } + } +} + +impl From for Vec { + fn from(v: BytesDto) -> Self { + match v { + BytesDto::Text(t) => t.as_bytes().to_vec(), + BytesDto::Raw(b) => b, + } + } +} + +#[derive(Deserialize)] +#[serde(tag = "type", content = "payload")] +enum LocationDto { + Generic { vault: BytesDto, record: BytesDto }, + Counter { vault: BytesDto, counter: usize }, +} + +impl From for Location { + fn from(dto: LocationDto) -> Location { + match dto { + LocationDto::Generic { vault, record } => Location::generic(vault, record), + LocationDto::Counter { vault, counter } => Location::counter(vault, counter), + } + } +} + +#[derive(Deserialize)] +#[serde(tag = "type", content = "payload")] +#[allow(clippy::upper_case_acronyms)] +enum Slip10DeriveInputDto { + Seed(LocationDto), + Key(LocationDto), +} + +impl From for Slip10DeriveInput { + fn from(dto: Slip10DeriveInputDto) -> Slip10DeriveInput { + match dto { + Slip10DeriveInputDto::Seed(location) => Slip10DeriveInput::Seed(location.into()), + Slip10DeriveInputDto::Key(location) => Slip10DeriveInput::Key(location.into()), + } + } +} + +pub enum KeyType { + Ed25519, + X25519, +} + +impl From for StrongholdKeyType { + fn from(ty: KeyType) -> StrongholdKeyType { + match ty { + KeyType::Ed25519 => StrongholdKeyType::Ed25519, + KeyType::X25519 => StrongholdKeyType::X25519, + } + } +} + +impl<'de> Deserialize<'de> for KeyType { + fn deserialize(deserializer: D) -> std::result::Result + where + D: Deserializer<'de>, + { + struct KeyTypeVisitor; + + impl<'de> Visitor<'de> for KeyTypeVisitor { + type Value = KeyType; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("ed25519 or x25519") + } + + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value.to_lowercase().as_str() { + "ed25519" => Ok(KeyType::Ed25519), + "x25519" => Ok(KeyType::X25519), + _ => Err(serde::de::Error::custom("unknown key type")), + } + } + } + + deserializer.deserialize_str(KeyTypeVisitor) + } +} + +#[derive(Deserialize)] +#[serde(tag = "type", content = "payload")] +#[allow(clippy::upper_case_acronyms)] +enum ProcedureDto { + SLIP10Generate { + output: LocationDto, + #[serde(rename = "sizeBytes")] + size_bytes: Option, + }, + SLIP10Derive { + chain: Vec, + input: Slip10DeriveInputDto, + output: LocationDto, + }, + BIP39Recover { + mnemonic: String, + passphrase: Option, + output: LocationDto, + }, + BIP39Generate { + passphrase: Option, + output: LocationDto, + }, + PublicKey { + #[serde(rename = "type")] + ty: KeyType, + #[serde(rename = "privateKey")] + private_key: LocationDto, + }, + Ed25519Sign { + #[serde(rename = "privateKey")] + private_key: LocationDto, + msg: String, + }, +} + +impl From for StrongholdProcedure { + fn from(dto: ProcedureDto) -> StrongholdProcedure { + match dto { + ProcedureDto::SLIP10Generate { output, size_bytes } => { + StrongholdProcedure::Slip10Generate(Slip10Generate { + output: output.into(), + size_bytes, + }) + } + ProcedureDto::SLIP10Derive { + chain, + input, + output, + } => StrongholdProcedure::Slip10Derive(Slip10Derive { + chain: Chain::from_u32_hardened(chain), + input: input.into(), + output: output.into(), + }), + ProcedureDto::BIP39Recover { + mnemonic, + passphrase, + output, + } => StrongholdProcedure::BIP39Recover(BIP39Recover { + mnemonic, + passphrase, + output: output.into(), + }), + ProcedureDto::BIP39Generate { passphrase, output } => { + StrongholdProcedure::BIP39Generate(BIP39Generate { + passphrase, + output: output.into(), + language: MnemonicLanguage::English, + }) + } + ProcedureDto::PublicKey { ty, private_key } => { + StrongholdProcedure::PublicKey(PublicKey { + ty: ty.into(), + private_key: private_key.into(), + }) + } + ProcedureDto::Ed25519Sign { private_key, msg } => { + StrongholdProcedure::Ed25519Sign(Ed25519Sign { + private_key: private_key.into(), + msg: msg.as_bytes().to_vec(), + }) + } + } + } +} + +#[tauri::command] +async fn initialize( + collection: State<'_, StrongholdCollection>, + hash_function: State<'_, PasswordHashFunction>, + snapshot_path: PathBuf, + mut password: String, +) -> Result<()> { + let hash = (hash_function.0)(&password); + password.zeroize(); + let stronghold = Stronghold::new(snapshot_path.clone(), hash)?; + + collection + .0 + .lock() + .unwrap() + .insert(snapshot_path, stronghold); + + Ok(()) +} + +#[tauri::command] +async fn destroy( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, +) -> Result<()> { + let mut collection = collection.0.lock().unwrap(); + if let Some(stronghold) = collection.remove(&snapshot_path) { + if let Err(e) = stronghold.save() { + collection.insert(snapshot_path, stronghold); + return Err(e); + } + } + Ok(()) +} + +#[tauri::command] +async fn save(collection: State<'_, StrongholdCollection>, snapshot_path: PathBuf) -> Result<()> { + let collection = collection.0.lock().unwrap(); + if let Some(stronghold) = collection.get(&snapshot_path) { + stronghold.save()?; + } + Ok(()) +} + +#[tauri::command] +async fn create_client( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, +) -> Result<()> { + let stronghold = get_stronghold(collection, snapshot_path)?; + stronghold.create_client(client)?; + Ok(()) +} + +#[tauri::command] +async fn load_client( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, +) -> Result<()> { + let stronghold = get_stronghold(collection, snapshot_path)?; + stronghold.load_client(client)?; + Ok(()) +} + +#[tauri::command] +async fn get_store_record( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, + key: String, +) -> Result>> { + let client = get_client(collection, snapshot_path, client)?; + client.store().get(key.as_ref()).map_err(Into::into) +} + +#[tauri::command] +async fn save_store_record( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, + key: String, + value: Vec, + lifetime: Option, +) -> Result>> { + let client = get_client(collection, snapshot_path, client)?; + client + .store() + .insert(key.as_bytes().to_vec(), value, lifetime) + .map_err(Into::into) +} + +#[tauri::command] +async fn remove_store_record( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, + key: String, +) -> Result>> { + let client = get_client(collection, snapshot_path, client)?; + client.store().delete(key.as_ref()).map_err(Into::into) +} + +#[tauri::command] +async fn save_secret( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, + vault: BytesDto, + record_path: BytesDto, + secret: Vec, +) -> Result<()> { + let client = get_client(collection, snapshot_path, client)?; + client + .vault(&vault) + .write_secret(Location::generic(vault, record_path), secret) + .map_err(Into::into) +} + +#[tauri::command] +async fn remove_secret( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, + vault: BytesDto, + record_path: BytesDto, +) -> Result<()> { + let client = get_client(collection, snapshot_path, client)?; + client + .vault(vault) + .delete_secret(record_path) + .map(|_| ()) + .map_err(Into::into) +} + +#[tauri::command] +async fn execute_procedure( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, + procedure: ProcedureDto, +) -> Result> { + let client = get_client(collection, snapshot_path, client)?; + client + .execute_procedure(StrongholdProcedure::from(procedure)) + .map(Into::into) + .map_err(Into::into) +} + +fn get_stronghold( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, +) -> Result { + let collection = collection.0.lock().unwrap(); + if let Some(stronghold) = collection.get(&snapshot_path) { + Ok(stronghold.inner().clone()) + } else { + Err(Error::StrongholdNotInitialized) + } +} + +fn get_client( + collection: State<'_, StrongholdCollection>, + snapshot_path: PathBuf, + client: BytesDto, +) -> Result { + let collection = collection.0.lock().unwrap(); + if let Some(stronghold) = collection.get(&snapshot_path) { + stronghold.get_client(client).map_err(Into::into) + } else { + Err(Error::StrongholdNotInitialized) + } +} + +pub struct Builder { + password_hash_function: Box, +} + +impl Builder { + pub fn new Vec + Send + Sync + 'static>(password_hash_function: F) -> Self { + Self { + password_hash_function: Box::new(password_hash_function), + } + } + + pub fn build(self) -> TauriPlugin { + let password_hash_function = self.password_hash_function; + + PluginBuilder::new("stronghold") + .setup(move |app| { + app.manage(StrongholdCollection::default()); + app.manage(PasswordHashFunction(password_hash_function)); + Ok(()) + }) + .invoke_handler(tauri::generate_handler![ + initialize, + destroy, + save, + create_client, + load_client, + get_store_record, + save_store_record, + remove_store_record, + save_secret, + remove_secret, + execute_procedure, + ]) + .build() + } +} diff --git a/plugins/stronghold/src/stronghold.rs b/plugins/stronghold/src/stronghold.rs new file mode 100644 index 00000000..a4a5c826 --- /dev/null +++ b/plugins/stronghold/src/stronghold.rs @@ -0,0 +1,65 @@ +use std::{convert::TryFrom, ops::Deref, path::Path}; + +use iota_stronghold::{KeyProvider, SnapshotPath}; +use serde::{Serialize, Serializer}; + +pub type Result = std::result::Result; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error("stronghold not initialized")] + StrongholdNotInitialized, + #[error(transparent)] + Stronghold(#[from] iota_stronghold::ClientError), + #[error(transparent)] + Memory(#[from] iota_stronghold::MemoryError), + #[error(transparent)] + Procedure(#[from] iota_stronghold::procedures::ProcedureError), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_str()) + } +} + +pub struct Stronghold { + inner: iota_stronghold::Stronghold, + path: SnapshotPath, + keyprovider: KeyProvider, +} + +impl Stronghold { + pub fn new>(path: P, password: Vec) -> Result { + let path = SnapshotPath::from_path(path); + let stronghold = iota_stronghold::Stronghold::default(); + let keyprovider = KeyProvider::try_from(password)?; + if path.exists() { + stronghold.load_snapshot(&keyprovider, &path)?; + } + Ok(Self { + inner: stronghold, + path, + keyprovider, + }) + } + + pub fn save(&self) -> Result<()> { + self.inner.commit(&self.path, &self.keyprovider)?; + Ok(()) + } + + pub fn inner(&self) -> &iota_stronghold::Stronghold { + &self.inner + } +} + +impl Deref for Stronghold { + type Target = iota_stronghold::Stronghold; + fn deref(&self) -> &Self::Target { + &self.inner + } +} diff --git a/plugins/upload/Cargo.toml b/plugins/upload/Cargo.toml new file mode 100644 index 00000000..9d427d15 --- /dev/null +++ b/plugins/upload/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "tauri-plugin-upload" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +tokio = { version = "1.17", features = [ "fs" ] } +tokio-util = { version = "0.7", features = [ "codec" ] } +reqwest = { version = "0.11", features = [ "json", "stream" ] } +futures = "0.3" +read-progress-stream = "1.0.0" \ No newline at end of file diff --git a/plugins/upload/guest-js/dist/index.min.js b/plugins/upload/guest-js/dist/index.min.js new file mode 100644 index 00000000..22b7a98f --- /dev/null +++ b/plugins/upload/guest-js/dist/index.min.js @@ -0,0 +1,46 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f$1={};e(f$1,{convertFileSrc:()=>w,invoke:()=>c$2,transformCallback:()=>s$2});function u$2(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s$2(e,r=!1){let n=u$2(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c$2(e,r={}){return new Promise((n,t)=>{let o=s$2(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s$2(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +async function a(i){return c$2("tauri",i)} + +var W$1={};e(W$1,{TauriEvent:()=>c$1,emit:()=>D,listen:()=>E$1,once:()=>_});async function s$1(n,t){return a({__tauriModule:"Event",message:{cmd:"unlisten",event:n,eventId:t}})}async function m$1(n,t,i){await a({__tauriModule:"Event",message:{cmd:"emit",event:n,windowLabel:t,payload:i}});}async function o$1(n,t,i){return a({__tauriModule:"Event",message:{cmd:"listen",event:n,windowLabel:t,handler:s$2(i)}}).then(r=>async()=>s$1(n,r))}async function u$1(n,t,i){return o$1(n,t,r=>{i(r),s$1(n,r.id).catch(()=>{});})}var c$1=(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.CHECK_UPDATE="tauri://update",e.UPDATE_AVAILABLE="tauri://update-available",e.INSTALL_UPDATE="tauri://update-install",e.STATUS_UPDATE="tauri://update-status",e.DOWNLOAD_PROGRESS="tauri://update-download-progress",e))(c$1||{});async function E$1(n,t){return o$1(n,null,t)}async function _(n,t){return u$1(n,null,t)}async function D(n,t){return m$1(n,void 0,t)} + +var C={};e(C,{CloseRequestedEvent:()=>y,LogicalPosition:()=>c,LogicalSize:()=>m,PhysicalPosition:()=>o,PhysicalSize:()=>l,UserAttentionType:()=>W,WebviewWindow:()=>s,WebviewWindowHandle:()=>u,WindowManager:()=>h,appWindow:()=>b,availableMonitors:()=>T,currentMonitor:()=>E,getAll:()=>M,getCurrent:()=>f,primaryMonitor:()=>z});var m=class{constructor(e,a){this.type="Logical";this.width=e,this.height=a;}},l=class{constructor(e,a){this.type="Physical";this.width=e,this.height=a;}toLogical(e){return new m(this.width/e,this.height/e)}},c=class{constructor(e,a){this.type="Logical";this.x=e,this.y=a;}},o=class{constructor(e,a){this.type="Physical";this.x=e,this.y=a;}toLogical(e){return new c(this.x/e,this.y/e)}},W=(a=>(a[a.Critical=1]="Critical",a[a.Informational=2]="Informational",a))(W||{});function f(){return new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function M(){return window.__TAURI_METADATA__.__windows.map(i=>new s(i.label,{skip:!0}))}var P=["tauri://created","tauri://error"],u=class{constructor(e){this.label=e,this.listeners=Object.create(null);}async listen(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1);}):o$1(e,this.label,a)}async once(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1);}):u$1(e,this.label,a)}async emit(e,a){if(P.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return m$1(e,this.label,a)}_handleTauriEvent(e,a){return P.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},h=class extends u{async scaleFactor(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:e,y:a})=>new o(e,a))}async outerPosition(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:e,y:a})=>new o(e,a))}async innerSize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:e,height:a})=>new l(e,a))}async outerSize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:e,height:a})=>new l(e,a))}async isFullscreen(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMaximized(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isDecorated(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isVisible(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async theme(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(e){let a$1=null;return e&&(e===1?a$1={type:"Critical"}:a$1={type:"Informational"}),a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:a$1}}}})}async setResizable(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:e}}}})}async setTitle(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:e}}}})}async maximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:e}}}})}async setAlwaysOnTop(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:e}}}})}async setSize(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:e}}}})}async setFocus(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof e=="string"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:e}}}})}async setCursorGrab(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:e}}}})}async setCursorVisible(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:e}}}})}async setCursorIcon(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!=="Logical"&&e.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:e}}}})}async startDragging(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(e){return this.listen("tauri://resize",e)}async onMoved(e){return this.listen("tauri://move",e)}async onCloseRequested(e){return this.listen("tauri://close-requested",a=>{let n=new y(a);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()});})}async onFocusChanged(e){let a=await this.listen("tauri://focus",d=>{e({...d,payload:!0});}),n=await this.listen("tauri://blur",d=>{e({...d,payload:!1});});return ()=>{a(),n();}}async onScaleChanged(e){return this.listen("tauri://scale-change",e)}async onMenuClicked(e){return this.listen("tauri://menu",e)}async onFileDropEvent(e){let a=await this.listen("tauri://file-drop",r=>{e({...r,payload:{type:"drop",paths:r.payload}});}),n=await this.listen("tauri://file-drop-hover",r=>{e({...r,payload:{type:"hover",paths:r.payload}});}),d=await this.listen("tauri://file-drop-cancelled",r=>{e({...r,payload:{type:"cancel"}});});return ()=>{a(),n(),d();}}async onThemeChanged(e){return this.listen("tauri://theme-changed",e)}},y=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id;}preventDefault(){this._preventDefault=!0;}isPreventDefault(){return this._preventDefault}},s=class extends h{constructor(e,a$1={}){super(e),a$1!=null&&a$1.skip||a({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:e,...a$1}}}}).then(async()=>this.emit("tauri://created")).catch(async n=>this.emit("tauri://error",n));}static getByLabel(e){return M().some(a=>a.label===e)?new s(e,{skip:!0}):null}},b;"__TAURI_METADATA__"in window?b=new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label. +Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),b=new s("main",{skip:!0}));function g(i){return i===null?null:{name:i.name,scaleFactor:i.scaleFactor,position:new o(i.position.x,i.position.y),size:new l(i.size.width,i.size.height)}}async function E(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(g)}async function z(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(g)}async function T(){return a({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then(i=>i.map(g))} + +const handlers = new Map(); +let listening = false; +async function listenToUploadEventIfNeeded() { + if (listening) { + return await Promise.resolve(); + } + return await b + .listen("upload://progress", ({ payload }) => { + const handler = handlers.get(payload.id); + if (handler != null) { + handler(payload.progress, payload.total); + } + }) + .then(() => { + listening = true; + }); +} +async function upload(url, filePath, progressHandler, headers) { + const ids = new Uint32Array(1); + window.crypto.getRandomValues(ids); + const id = ids[0]; + if (progressHandler != null) { + handlers.set(id, progressHandler); + } + await listenToUploadEventIfNeeded(); + await c$2("plugin:upload|upload", { + id, + url, + filePath, + headers: headers !== null && headers !== void 0 ? headers : {}, + }); +} + +export { upload as default }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/upload/guest-js/dist/index.min.js.map b/plugins/upload/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..039a83fd --- /dev/null +++ b/plugins/upload/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-HNLFKTAJ.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-3WDDWFXT.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-QSWLDHGO.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n","import{b as o}from\"./chunk-RCPA6UVN.js\";async function a(i){return o(\"tauri\",i)}export{a};\n","import{a}from\"./chunk-HNLFKTAJ.js\";import{a as l}from\"./chunk-RCPA6UVN.js\";import{a as d}from\"./chunk-FEIY7W7S.js\";var W={};d(W,{TauriEvent:()=>c,emit:()=>D,listen:()=>E,once:()=>_});async function s(n,t){return a({__tauriModule:\"Event\",message:{cmd:\"unlisten\",event:n,eventId:t}})}async function m(n,t,i){await a({__tauriModule:\"Event\",message:{cmd:\"emit\",event:n,windowLabel:t,payload:i}})}async function o(n,t,i){return a({__tauriModule:\"Event\",message:{cmd:\"listen\",event:n,windowLabel:t,handler:l(i)}}).then(r=>async()=>s(n,r))}async function u(n,t,i){return o(n,t,r=>{i(r),s(n,r.id).catch(()=>{})})}var c=(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.CHECK_UPDATE=\"tauri://update\",e.UPDATE_AVAILABLE=\"tauri://update-available\",e.INSTALL_UPDATE=\"tauri://update-install\",e.STATUS_UPDATE=\"tauri://update-status\",e.DOWNLOAD_PROGRESS=\"tauri://update-download-progress\",e))(c||{});async function E(n,t){return o(n,null,t)}async function _(n,t){return u(n,null,t)}async function D(n,t){return m(n,void 0,t)}export{m as a,o as b,u as c,c as d,E as e,_ as f,D as g,W as h};\n","import{a as p,b as _,c as w}from\"./chunk-3WDDWFXT.js\";import{a as t}from\"./chunk-HNLFKTAJ.js\";import{a as v}from\"./chunk-FEIY7W7S.js\";var C={};v(C,{CloseRequestedEvent:()=>y,LogicalPosition:()=>c,LogicalSize:()=>m,PhysicalPosition:()=>o,PhysicalSize:()=>l,UserAttentionType:()=>W,WebviewWindow:()=>s,WebviewWindowHandle:()=>u,WindowManager:()=>h,appWindow:()=>b,availableMonitors:()=>T,currentMonitor:()=>E,getAll:()=>M,getCurrent:()=>f,primaryMonitor:()=>z});var m=class{constructor(e,a){this.type=\"Logical\";this.width=e,this.height=a}},l=class{constructor(e,a){this.type=\"Physical\";this.width=e,this.height=a}toLogical(e){return new m(this.width/e,this.height/e)}},c=class{constructor(e,a){this.type=\"Logical\";this.x=e,this.y=a}},o=class{constructor(e,a){this.type=\"Physical\";this.x=e,this.y=a}toLogical(e){return new c(this.x/e,this.y/e)}},W=(a=>(a[a.Critical=1]=\"Critical\",a[a.Informational=2]=\"Informational\",a))(W||{});function f(){return new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function M(){return window.__TAURI_METADATA__.__windows.map(i=>new s(i.label,{skip:!0}))}var P=[\"tauri://created\",\"tauri://error\"],u=class{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1)}):_(e,this.label,a)}async once(e,a){return this._handleTauriEvent(e,a)?Promise.resolve(()=>{let n=this.listeners[e];n.splice(n.indexOf(a),1)}):w(e,this.label,a)}async emit(e,a){if(P.includes(e)){for(let n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:a});return Promise.resolve()}return p(e,this.label,a)}_handleTauriEvent(e,a){return P.includes(e)?(e in this.listeners?this.listeners[e].push(a):this.listeners[e]=[a],!0):!1}},h=class extends u{async scaleFactor(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"scaleFactor\"}}}})}async innerPosition(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"innerPosition\"}}}}).then(({x:e,y:a})=>new o(e,a))}async outerPosition(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"outerPosition\"}}}}).then(({x:e,y:a})=>new o(e,a))}async innerSize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"innerSize\"}}}}).then(({width:e,height:a})=>new l(e,a))}async outerSize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"outerSize\"}}}}).then(({width:e,height:a})=>new l(e,a))}async isFullscreen(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isFullscreen\"}}}})}async isMaximized(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isMaximized\"}}}})}async isDecorated(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isDecorated\"}}}})}async isResizable(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isResizable\"}}}})}async isVisible(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"isVisible\"}}}})}async theme(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"theme\"}}}})}async center(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"center\"}}}})}async requestUserAttention(e){let a=null;return e&&(e===1?a={type:\"Critical\"}:a={type:\"Informational\"}),t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"requestUserAttention\",payload:a}}}})}async setResizable(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setResizable\",payload:e}}}})}async setTitle(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setTitle\",payload:e}}}})}async maximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"maximize\"}}}})}async unmaximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"unmaximize\"}}}})}async toggleMaximize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"toggleMaximize\"}}}})}async minimize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"minimize\"}}}})}async unminimize(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"unminimize\"}}}})}async show(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"show\"}}}})}async hide(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"hide\"}}}})}async close(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"close\"}}}})}async setDecorations(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setDecorations\",payload:e}}}})}async setAlwaysOnTop(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setAlwaysOnTop\",payload:e}}}})}async setSize(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setSize\",payload:{type:e.type,data:{width:e.width,height:e.height}}}}}})}async setMinSize(e){if(e&&e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setMinSize\",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setMaxSize(e){if(e&&e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `size` argument must be either a LogicalSize or a PhysicalSize instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setMaxSize\",payload:e?{type:e.type,data:{width:e.width,height:e.height}}:null}}}})}async setPosition(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setPosition\",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setFullscreen(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setFullscreen\",payload:e}}}})}async setFocus(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setFocus\"}}}})}async setIcon(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setIcon\",payload:{icon:typeof e==\"string\"?e:Array.from(e)}}}}})}async setSkipTaskbar(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setSkipTaskbar\",payload:e}}}})}async setCursorGrab(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorGrab\",payload:e}}}})}async setCursorVisible(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorVisible\",payload:e}}}})}async setCursorIcon(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorIcon\",payload:e}}}})}async setCursorPosition(e){if(!e||e.type!==\"Logical\"&&e.type!==\"Physical\")throw new Error(\"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance\");return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setCursorPosition\",payload:{type:e.type,data:{x:e.x,y:e.y}}}}}})}async setIgnoreCursorEvents(e){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"setIgnoreCursorEvents\",payload:e}}}})}async startDragging(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{label:this.label,cmd:{type:\"startDragging\"}}}})}async onResized(e){return this.listen(\"tauri://resize\",e)}async onMoved(e){return this.listen(\"tauri://move\",e)}async onCloseRequested(e){return this.listen(\"tauri://close-requested\",a=>{let n=new y(a);Promise.resolve(e(n)).then(()=>{if(!n.isPreventDefault())return this.close()})})}async onFocusChanged(e){let a=await this.listen(\"tauri://focus\",d=>{e({...d,payload:!0})}),n=await this.listen(\"tauri://blur\",d=>{e({...d,payload:!1})});return()=>{a(),n()}}async onScaleChanged(e){return this.listen(\"tauri://scale-change\",e)}async onMenuClicked(e){return this.listen(\"tauri://menu\",e)}async onFileDropEvent(e){let a=await this.listen(\"tauri://file-drop\",r=>{e({...r,payload:{type:\"drop\",paths:r.payload}})}),n=await this.listen(\"tauri://file-drop-hover\",r=>{e({...r,payload:{type:\"hover\",paths:r.payload}})}),d=await this.listen(\"tauri://file-drop-cancelled\",r=>{e({...r,payload:{type:\"cancel\"}})});return()=>{a(),n(),d()}}async onThemeChanged(e){return this.listen(\"tauri://theme-changed\",e)}},y=class{constructor(e){this._preventDefault=!1;this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}},s=class extends h{constructor(e,a={}){super(e),a!=null&&a.skip||t({__tauriModule:\"Window\",message:{cmd:\"createWebview\",data:{options:{label:e,...a}}}}).then(async()=>this.emit(\"tauri://created\")).catch(async n=>this.emit(\"tauri://error\",n))}static getByLabel(e){return M().some(a=>a.label===e)?new s(e,{skip:!0}):null}},b;\"__TAURI_METADATA__\"in window?b=new s(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn(`Could not find \"window.__TAURI_METADATA__\". The \"appWindow\" value will reference the \"main\" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`),b=new s(\"main\",{skip:!0}));function g(i){return i===null?null:{name:i.name,scaleFactor:i.scaleFactor,position:new o(i.position.x,i.position.y),size:new l(i.size.width,i.size.height)}}async function E(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"currentMonitor\"}}}}).then(g)}async function z(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"primaryMonitor\"}}}}).then(g)}async function T(){return t({__tauriModule:\"Window\",message:{cmd:\"manage\",data:{cmd:{type:\"availableMonitors\"}}}}).then(i=>i.map(g))}export{m as a,l as b,c,o as d,W as e,f,M as g,u as h,h as i,y as j,s as k,b as l,E as m,z as n,T as o,C as p};\n",null],"names":["f","d","c","s","u","o","W","E","m","l","v","_","w","p","t","a","appWindow","invoke"],"mappings":"AAAA,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC;;ACAjD,IAAIA,GAAC,CAAC,EAAE,CAACC,CAAC,CAACD,GAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAIE,GAAC,CAAC,iBAAiB,CAAC,IAAIC,GAAC,CAAC,CAAC,CAAC,SAASC,GAAC,EAAE,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAASD,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAACC,GAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,cAAc,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AACb,QAAA,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;AAChC,KAAA;AACD,IAAA,OAAO,MAAME,CAAS;SACnB,MAAM,CAAkB,mBAAmB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAI;QAC5D,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1C,SAAA;AACH,KAAC,CAAC;SACD,IAAI,CAAC,MAAK;QACT,SAAS,GAAG,IAAI,CAAC;AACnB,KAAC,CAAC,CAAC;AACP,CAAC;AAEc,eAAe,MAAM,CAClC,GAAW,EACX,QAAgB,EAChB,eAAiC,EACjC,OAA6B,EAAA;AAE7B,IAAA,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAC/B,IAAA,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;AACnC,IAAA,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAElB,IAAI,eAAe,IAAI,IAAI,EAAE;AAC3B,QAAA,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;AACnC,KAAA;IAED,MAAM,2BAA2B,EAAE,CAAC;IAEpC,MAAMC,GAAM,CAAC,sBAAsB,EAAE;QACnC,EAAE;QACF,GAAG;QACH,QAAQ;AACR,QAAA,OAAO,EAAE,OAAO,KAAA,IAAA,IAAP,OAAO,KAAP,KAAA,CAAA,GAAA,OAAO,GAAI,EAAE;AACvB,KAAA,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/plugins/upload/guest-js/dist/index.mjs b/plugins/upload/guest-js/dist/index.mjs new file mode 100644 index 00000000..2ffee4b3 --- /dev/null +++ b/plugins/upload/guest-js/dist/index.mjs @@ -0,0 +1,38 @@ +import { invoke } from '@tauri-apps/api/tauri'; +import { appWindow } from '@tauri-apps/api/window'; + +const handlers = new Map(); +let listening = false; +async function listenToUploadEventIfNeeded() { + if (listening) { + return await Promise.resolve(); + } + return await appWindow + .listen("upload://progress", ({ payload }) => { + const handler = handlers.get(payload.id); + if (handler != null) { + handler(payload.progress, payload.total); + } + }) + .then(() => { + listening = true; + }); +} +async function upload(url, filePath, progressHandler, headers) { + const ids = new Uint32Array(1); + window.crypto.getRandomValues(ids); + const id = ids[0]; + if (progressHandler != null) { + handlers.set(id, progressHandler); + } + await listenToUploadEventIfNeeded(); + await invoke("plugin:upload|upload", { + id, + url, + filePath, + headers: headers !== null && headers !== void 0 ? headers : {}, + }); +} + +export { upload as default }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/upload/guest-js/dist/index.mjs.map b/plugins/upload/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..3d37be93 --- /dev/null +++ b/plugins/upload/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAUA,MAAM,QAAQ,GAAiC,IAAI,GAAG,EAAE,CAAC;AACzD,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,eAAe,2BAA2B,GAAA;AACxC,IAAA,IAAI,SAAS,EAAE;AACb,QAAA,OAAO,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;AAChC,KAAA;AACD,IAAA,OAAO,MAAM,SAAS;SACnB,MAAM,CAAkB,mBAAmB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAI;QAC5D,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AAC1C,SAAA;AACH,KAAC,CAAC;SACD,IAAI,CAAC,MAAK;QACT,SAAS,GAAG,IAAI,CAAC;AACnB,KAAC,CAAC,CAAC;AACP,CAAC;AAEc,eAAe,MAAM,CAClC,GAAW,EACX,QAAgB,EAChB,eAAiC,EACjC,OAA6B,EAAA;AAE7B,IAAA,MAAM,GAAG,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAC/B,IAAA,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;AACnC,IAAA,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAElB,IAAI,eAAe,IAAI,IAAI,EAAE;AAC3B,QAAA,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,CAAC,CAAC;AACnC,KAAA;IAED,MAAM,2BAA2B,EAAE,CAAC;IAEpC,MAAM,MAAM,CAAC,sBAAsB,EAAE;QACnC,EAAE;QACF,GAAG;QACH,QAAQ;AACR,QAAA,OAAO,EAAE,OAAO,KAAA,IAAA,IAAP,OAAO,KAAP,KAAA,CAAA,GAAA,OAAO,GAAI,EAAE;AACvB,KAAA,CAAC,CAAC;AACL;;;;"} \ No newline at end of file diff --git a/plugins/upload/guest-js/index.ts b/plugins/upload/guest-js/index.ts new file mode 100644 index 00000000..88f5202e --- /dev/null +++ b/plugins/upload/guest-js/index.ts @@ -0,0 +1,52 @@ +import { invoke } from "@tauri-apps/api/tauri"; +import { appWindow } from "@tauri-apps/api/window"; + +interface ProgressPayload { + id: number; + progress: number; + total: number; +} + +type ProgressHandler = (progress: number, total: number) => void; +const handlers: Map = new Map(); +let listening = false; + +async function listenToUploadEventIfNeeded(): Promise { + if (listening) { + return await Promise.resolve(); + } + return await appWindow + .listen("upload://progress", ({ payload }) => { + const handler = handlers.get(payload.id); + if (handler != null) { + handler(payload.progress, payload.total); + } + }) + .then(() => { + listening = true; + }); +} + +export default async function upload( + url: string, + filePath: string, + progressHandler?: ProgressHandler, + headers?: Map +): Promise { + const ids = new Uint32Array(1); + window.crypto.getRandomValues(ids); + const id = ids[0]; + + if (progressHandler != null) { + handlers.set(id, progressHandler); + } + + await listenToUploadEventIfNeeded(); + + await invoke("plugin:upload|upload", { + id, + url, + filePath, + headers: headers ?? {}, + }); +} diff --git a/plugins/upload/guest-js/package.json b/plugins/upload/guest-js/package.json new file mode 100644 index 00000000..3c72ee80 --- /dev/null +++ b/plugins/upload/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-upload-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/upload/guest-js/rollup.config.mjs b/plugins/upload/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/upload/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/upload/guest-js/tsconfig.json b/plugins/upload/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/upload/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/upload/src/lib.rs b/plugins/upload/src/lib.rs new file mode 100644 index 00000000..b739435d --- /dev/null +++ b/plugins/upload/src/lib.rs @@ -0,0 +1,106 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use futures::TryStreamExt; +use serde::{ser::Serializer, Serialize}; +use tauri::{command, plugin::Plugin, Invoke, Runtime, Window}; +use tokio::fs::File; +use tokio_util::codec::{BytesCodec, FramedRead}; + +use read_progress_stream::ReadProgressStream; + +use std::{collections::HashMap, sync::Mutex}; + +type Result = std::result::Result; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + Request(#[from] reqwest::Error), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_ref()) + } +} + +#[derive(Clone, Serialize)] +struct ProgressPayload { + id: u32, + progress: u64, + total: u64, +} + +#[command] +async fn upload( + window: Window, + id: u32, + url: &str, + file_path: &str, + headers: HashMap, +) -> Result { + // Read the file + let file = File::open(file_path).await?; + + // Create the request and attach the file to the body + let client = reqwest::Client::new(); + let mut request = client.post(url).body(file_to_body(id, window, file)); + + // Loop trought the headers keys and values + // and add them to the request object. + for (key, value) in headers { + request = request.header(&key, value); + } + + let response = request.send().await?; + + response.json().await.map_err(Into::into) +} + +fn file_to_body(id: u32, window: Window, file: File) -> reqwest::Body { + let stream = FramedRead::new(file, BytesCodec::new()).map_ok(|r| r.freeze()); + let window = Mutex::new(window); + reqwest::Body::wrap_stream(ReadProgressStream::new( + stream, + Box::new(move |progress, total| { + let _ = window.lock().unwrap().emit( + "upload://progress", + ProgressPayload { + id, + progress, + total, + }, + ); + }), + )) +} + +/// Tauri plugin. +pub struct Upload { + invoke_handler: Box) + Send + Sync>, +} + +impl Default for Upload { + fn default() -> Self { + Self { + invoke_handler: Box::new(tauri::generate_handler![upload]), + } + } +} + +impl Plugin for Upload { + fn name(&self) -> &'static str { + "upload" + } + + fn extend_api(&mut self, message: Invoke) { + (self.invoke_handler)(message) + } +} diff --git a/plugins/websocket/Cargo.toml b/plugins/websocket/Cargo.toml new file mode 100644 index 00000000..1bea91f3 --- /dev/null +++ b/plugins/websocket/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "tauri-plugin-websocket" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +rand = "0.8" +futures-util = "0.3" +tokio = { version = "1.17", features = ["net", "sync"] } +tokio-tungstenite = { version = "0.17", features = ["native-tls"] } \ No newline at end of file diff --git a/plugins/websocket/guest-js/dist/index.min.js b/plugins/websocket/guest-js/dist/index.min.js new file mode 100644 index 00000000..7504467d --- /dev/null +++ b/plugins/websocket/guest-js/dist/index.min.js @@ -0,0 +1,55 @@ +var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0});}; + +var f={};e(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`);},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`);},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r});})}function w(e,r="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`} + +class WebSocket { + constructor(id, listeners) { + this.id = id; + this.listeners = listeners; + } + static async connect(url, options) { + const listeners = []; + const handler = (message) => { + listeners.forEach((l) => l(message)); + }; + return await c("plugin:websocket|connect", { + url, + callbackFunction: s(handler), + options, + }).then((id) => new WebSocket(id, listeners)); + } + addListener(cb) { + this.listeners.push(cb); + } + async send(message) { + let m; + if (typeof message === "string") { + m = { type: "Text", data: message }; + } + else if (typeof message === "object" && "type" in message) { + m = message; + } + else if (Array.isArray(message)) { + 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"); + } + return await c("plugin:websocket|send", { + id: this.id, + message: m, + }); + } + async disconnect() { + return await this.send({ + type: "Close", + data: { + code: 1000, + reason: "Disconnected by client", + }, + }); + } +} + +export { WebSocket as default }; +//# sourceMappingURL=index.min.js.map diff --git a/plugins/websocket/guest-js/dist/index.min.js.map b/plugins/websocket/guest-js/dist/index.min.js.map new file mode 100644 index 00000000..a7b238ab --- /dev/null +++ b/plugins/websocket/guest-js/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.min.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-FEIY7W7S.js","../../../../node_modules/.pnpm/@tauri-apps+api@1.2.0/node_modules/@tauri-apps/api/chunk-RCPA6UVN.js","../index.ts"],"sourcesContent":["var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};\n","import{a as d}from\"./chunk-FEIY7W7S.js\";var f={};d(f,{convertFileSrc:()=>w,invoke:()=>c,transformCallback:()=>s});function u(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(e,r=!1){let n=u(),t=`_${n}`;return Object.defineProperty(window,t,{value:o=>(r&&Reflect.deleteProperty(window,t),e==null?void 0:e(o)),writable:!1,configurable:!0}),n}async function c(e,r={}){return new Promise((n,t)=>{let o=s(i=>{n(i),Reflect.deleteProperty(window,`_${a}`)},!0),a=s(i=>{t(i),Reflect.deleteProperty(window,`_${o}`)},!0);window.__TAURI_IPC__({cmd:e,callback:o,error:a,...r})})}function w(e,r=\"asset\"){let n=encodeURIComponent(e);return navigator.userAgent.includes(\"Windows\")?`https://${r}.localhost/${n}`:`${r}://localhost/${n}`}export{s as a,c as b,w as c,f as d};\n",null],"names":["d","invoke","transformCallback"],"mappings":"AAAA,IAAI,CAAC,CAA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/dist/index.mjs b/plugins/websocket/guest-js/dist/index.mjs new file mode 100644 index 00000000..e392f6a0 --- /dev/null +++ b/plugins/websocket/guest-js/dist/index.mjs @@ -0,0 +1,53 @@ +import { invoke, transformCallback } from '@tauri-apps/api/tauri'; + +class WebSocket { + constructor(id, listeners) { + this.id = id; + this.listeners = listeners; + } + static async connect(url, options) { + const listeners = []; + const handler = (message) => { + listeners.forEach((l) => l(message)); + }; + return await invoke("plugin:websocket|connect", { + url, + callbackFunction: transformCallback(handler), + options, + }).then((id) => new WebSocket(id, listeners)); + } + addListener(cb) { + this.listeners.push(cb); + } + async send(message) { + let m; + if (typeof message === "string") { + m = { type: "Text", data: message }; + } + else if (typeof message === "object" && "type" in message) { + m = message; + } + else if (Array.isArray(message)) { + 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"); + } + return await invoke("plugin:websocket|send", { + id: this.id, + message: m, + }); + } + async disconnect() { + return await this.send({ + type: "Close", + data: { + code: 1000, + reason: "Disconnected by client", + }, + }); + } +} + +export { WebSocket as default }; +//# sourceMappingURL=index.mjs.map diff --git a/plugins/websocket/guest-js/dist/index.mjs.map b/plugins/websocket/guest-js/dist/index.mjs.map new file mode 100644 index 00000000..3b5c8b71 --- /dev/null +++ b/plugins/websocket/guest-js/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAmBc,MAAO,SAAS,CAAA;IAI5B,WAAY,CAAA,EAAU,EAAE,SAAwC,EAAA;AAC9D,QAAA,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;AACb,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC5B;AAED,IAAA,aAAa,OAAO,CAAC,GAAW,EAAE,OAAiB,EAAA;QACjD,MAAM,SAAS,GAAkC,EAAE,CAAC;AACpD,QAAA,MAAM,OAAO,GAAG,CAAC,OAAgB,KAAU;AACzC,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AI,EAAE,OAAO;AACb,YAAA,IAAI,EAAE;AACJ,gBAAA,IAAI,EAAE,IAAI;AACV,gBAAA,MAAM,EAAE,wBAAwB;AACjC,aAAA;AACF,SAAA,CAAC,CAAC;KACJ;AACF;;;;"} \ No newline at end of file diff --git a/plugins/websocket/guest-js/index.ts b/plugins/websocket/guest-js/index.ts new file mode 100644 index 00000000..9dc5b4d8 --- /dev/null +++ b/plugins/websocket/guest-js/index.ts @@ -0,0 +1,74 @@ +import { invoke, transformCallback } from "@tauri-apps/api/tauri"; + +export interface MessageKind { + type: T; + data: D; +} + +export interface CloseFrame { + code: number; + reason: string; +} + +export type Message = + | MessageKind<"Text", string> + | MessageKind<"Binary", number[]> + | MessageKind<"Ping", number[]> + | MessageKind<"Pong", number[]> + | MessageKind<"Close", CloseFrame | null>; + +export default class WebSocket { + id: number; + private readonly listeners: Array<(arg: Message) => void>; + + constructor(id: number, listeners: Array<(arg: Message) => void>) { + this.id = id; + this.listeners = listeners; + } + + static async connect(url: string, options?: unknown): Promise { + const listeners: Array<(arg: Message) => void> = []; + const handler = (message: Message): void => { + listeners.forEach((l) => l(message)); + }; + + return await invoke("plugin:websocket|connect", { + url, + callbackFunction: transformCallback(handler), + options, + }).then((id) => new WebSocket(id, listeners)); + } + + addListener(cb: (arg: Message) => void): void { + this.listeners.push(cb); + } + + async send(message: Message | string | number[]): Promise { + let m: Message; + if (typeof message === "string") { + m = { type: "Text", data: message }; + } else if (typeof message === "object" && "type" in message) { + m = message; + } else if (Array.isArray(message)) { + 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" + ); + } + return await invoke("plugin:websocket|send", { + id: this.id, + message: m, + }); + } + + async disconnect(): Promise { + return await this.send({ + type: "Close", + data: { + code: 1000, + reason: "Disconnected by client", + }, + }); + } +} diff --git a/plugins/websocket/guest-js/package.json b/plugins/websocket/guest-js/package.json new file mode 100644 index 00000000..08cead6b --- /dev/null +++ b/plugins/websocket/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-websocket-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/plugins/websocket/guest-js/rollup.config.mjs b/plugins/websocket/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/plugins/websocket/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/plugins/websocket/guest-js/tsconfig.json b/plugins/websocket/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/plugins/websocket/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/plugins/websocket/src/lib.rs b/plugins/websocket/src/lib.rs new file mode 100644 index 00000000..dccea1ec --- /dev/null +++ b/plugins/websocket/src/lib.rs @@ -0,0 +1,189 @@ +use futures_util::{stream::SplitSink, SinkExt, StreamExt}; +use serde::{ser::Serializer, Deserialize, Serialize}; +use serde_json::Value as JsonValue; +use tauri::{ + api::ipc::{format_callback, CallbackFn}, + plugin::Plugin, + AppHandle, Invoke, Manager, Runtime, State, Window, +}; +use tokio::{net::TcpStream, sync::Mutex}; +use tokio_tungstenite::{ + connect_async_with_config, + tungstenite::{ + protocol::{CloseFrame as ProtocolCloseFrame, WebSocketConfig}, + Message, + }, + MaybeTlsStream, WebSocketStream, +}; + +use std::collections::HashMap; + +type Id = u32; +type WebSocket = WebSocketStream>; +type WebSocketWriter = SplitSink; +type Result = std::result::Result; + +#[derive(Debug, thiserror::Error)] +enum Error { + #[error(transparent)] + Websocket(#[from] tokio_tungstenite::tungstenite::Error), + #[error("connection not found for the given id: {0}")] + ConnectionNotFound(Id), +} + +impl Serialize for Error { + fn serialize(&self, serializer: S) -> std::result::Result + where + S: Serializer, + { + serializer.serialize_str(self.to_string().as_str()) + } +} + +#[derive(Default)] +struct ConnectionManager(Mutex>); + +#[derive(Default, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ConnectionConfig { + pub max_send_queue: Option, + pub max_message_size: Option, + pub max_frame_size: Option, + pub accept_unmasked_frames: bool, +} + +impl From for WebSocketConfig { + fn from(config: ConnectionConfig) -> Self { + Self { + max_send_queue: config.max_send_queue, + max_message_size: config.max_message_size, + max_frame_size: config.max_frame_size, + accept_unmasked_frames: config.accept_unmasked_frames, + } + } +} + +#[derive(Deserialize, Serialize)] +struct CloseFrame { + pub code: u16, + pub reason: String, +} + +#[derive(Deserialize, Serialize)] +#[serde(tag = "type", content = "data")] +enum WebSocketMessage { + Text(String), + Binary(Vec), + Ping(Vec), + Pong(Vec), + Close(Option), +} + +#[tauri::command] +fn connect( + window: Window, + url: String, + callback_function: CallbackFn, + config: Option, +) -> Result { + let id = rand::random(); + let (ws_stream, _) = + tauri::async_runtime::block_on(connect_async_with_config(url, config.map(Into::into)))?; + + tauri::async_runtime::spawn(async move { + let (write, read) = ws_stream.split(); + let manager = window.state::(); + manager.0.lock().await.insert(id, write); + read.for_each(move |message| { + let window_ = window.clone(); + async move { + if let Ok(Message::Close(_)) = message { + let manager = window_.state::(); + manager.0.lock().await.remove(&id); + } + + let response = match message { + Ok(Message::Text(t)) => { + serde_json::to_value(WebSocketMessage::Text(t)).unwrap() + } + Ok(Message::Binary(t)) => { + serde_json::to_value(WebSocketMessage::Binary(t)).unwrap() + } + Ok(Message::Ping(t)) => { + serde_json::to_value(WebSocketMessage::Ping(t)).unwrap() + } + Ok(Message::Pong(t)) => { + serde_json::to_value(WebSocketMessage::Pong(t)).unwrap() + } + Ok(Message::Close(t)) => { + serde_json::to_value(WebSocketMessage::Close(t.map(|v| CloseFrame { + code: v.code.into(), + reason: v.reason.into_owned(), + }))) + .unwrap() + } + Ok(Message::Frame(_)) => serde_json::Value::Null, // This value can't be recieved. + Err(e) => serde_json::to_value(Error::from(e)).unwrap(), + }; + let js = format_callback(callback_function, &response) + .expect("unable to serialize websocket message"); + let _ = window_.eval(js.as_str()); + } + }) + .await; + }); + + Ok(id) +} + +#[tauri::command] +async fn send( + manager: State<'_, ConnectionManager>, + id: Id, + message: WebSocketMessage, +) -> Result<()> { + if let Some(write) = manager.0.lock().await.get_mut(&id) { + write + .send(match message { + WebSocketMessage::Text(t) => Message::Text(t), + WebSocketMessage::Binary(t) => Message::Binary(t), + WebSocketMessage::Ping(t) => Message::Ping(t), + WebSocketMessage::Pong(t) => Message::Pong(t), + WebSocketMessage::Close(t) => Message::Close(t.map(|v| ProtocolCloseFrame { + code: v.code.into(), + reason: std::borrow::Cow::Owned(v.reason), + })), + }) + .await?; + Ok(()) + } else { + Err(Error::ConnectionNotFound(id)) + } +} + +pub struct TauriWebsocket { + invoke_handler: Box) + Send + Sync>, +} + +impl Default for TauriWebsocket { + fn default() -> Self { + Self { + invoke_handler: Box::new(tauri::generate_handler![connect, send]), + } + } +} + +impl Plugin for TauriWebsocket { + fn name(&self) -> &'static str { + "websocket" + } + + fn initialize(&mut self, app: &AppHandle, _config: JsonValue) -> tauri::plugin::Result<()> { + app.manage(ConnectionManager::default()); + Ok(()) + } + + fn extend_api(&mut self, invoke: Invoke) { + (self.invoke_handler)(invoke) + } +} diff --git a/plugins/window-state/Cargo.toml b/plugins/window-state/Cargo.toml new file mode 100644 index 00000000..001ac646 --- /dev/null +++ b/plugins/window-state/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "tauri-plugin-window-state" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true +bincode = "1.3" \ No newline at end of file diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs new file mode 100644 index 00000000..8bec7e5b --- /dev/null +++ b/plugins/window-state/src/lib.rs @@ -0,0 +1,290 @@ +// Copyright 2021 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +use serde::{Deserialize, Serialize}; +use tauri::{ + plugin::{Builder as PluginBuilder, TauriPlugin}, + LogicalSize, Manager, PhysicalPosition, RunEvent, Runtime, Window, WindowEvent, +}; + +use std::{ + collections::{HashMap, HashSet}, + fs::{create_dir_all, File}, + io::Write, + sync::{Arc, Mutex}, +}; + +pub const STATE_FILENAME: &str = ".window-state"; + +#[derive(Debug, thiserror::Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] std::io::Error), + #[error(transparent)] + Tauri(#[from] tauri::Error), + #[error(transparent)] + TauriApi(#[from] tauri::api::Error), + #[error(transparent)] + Bincode(#[from] Box), +} + +/// Defines how the window visibility should be restored. +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub enum ShowMode { + /// The window will always be shown, regardless of what the last stored state was. + Always, + /// The window will be automatically shown if the last stored state for visibility was `true`. + LastSaved, + /// The window will not be automatically shown by this plugin. + Never, +} + +impl Default for ShowMode { + fn default() -> Self { + Self::LastSaved + } +} + +pub type Result = std::result::Result; + +#[derive(Debug, Default, Deserialize, Serialize)] +struct WindowMetadata { + width: f64, + height: f64, + x: i32, + y: i32, + maximized: bool, + visible: bool, + decorated: bool, + fullscreen: bool, + monitor: String, +} + +struct WindowStateCache(Arc>>); +pub trait AppHandleExt { + fn save_window_state(&self) -> Result<()>; +} + +impl AppHandleExt for tauri::AppHandle { + fn save_window_state(&self) -> Result<()> { + if let Some(app_dir) = self.path_resolver().app_config_dir() { + let state_path = app_dir.join(STATE_FILENAME); + let cache = self.state::(); + let state = cache.0.lock().unwrap(); + create_dir_all(&app_dir) + .map_err(Error::Io) + .and_then(|_| File::create(state_path).map_err(Into::into)) + .and_then(|mut f| { + f.write_all(&bincode::serialize(&*state).map_err(Error::Bincode)?) + .map_err(Into::into) + }) + } else { + Ok(()) + } + } +} + +pub trait WindowExt { + fn restore_state(&self, show_mode: ShowMode) -> tauri::Result<()>; +} + +impl WindowExt for Window { + fn restore_state(&self, show_mode: ShowMode) -> tauri::Result<()> { + let cache = self.state::(); + let mut c = cache.0.lock().unwrap(); + let mut should_show = true; + if let Some(state) = c.get(self.label()) { + self.set_decorations(state.decorated)?; + + self.set_size(LogicalSize { + width: state.width, + height: state.height, + })?; + + // restore position to saved value if saved monitor exists + // otherwise, let the OS decide where to place the window + for m in self.available_monitors()? { + if m.name().map(ToString::to_string).unwrap_or_default() == state.monitor { + self.set_position(PhysicalPosition { + x: state.x, + y: state.y, + })?; + break; + } + } + + if state.maximized { + self.maximize()?; + } + self.set_fullscreen(state.fullscreen)?; + + should_show = state.visible; + } else { + let scale_factor = self + .current_monitor()? + .map(|m| m.scale_factor()) + .unwrap_or(1.); + let LogicalSize { width, height } = self.inner_size()?.to_logical(scale_factor); + let PhysicalPosition { x, y } = self.outer_position()?; + let maximized = self.is_maximized().unwrap_or(false); + let visible = self.is_visible().unwrap_or(true); + let decorated = self.is_decorated().unwrap_or(true); + let fullscreen = self.is_fullscreen().unwrap_or(false); + let monitor = self + .current_monitor()? + .unwrap() + .name() + .map(ToString::to_string) + .unwrap_or_default(); + c.insert( + self.label().into(), + WindowMetadata { + width, + height, + x, + y, + maximized, + visible, + decorated, + fullscreen, + monitor, + }, + ); + } + + if show_mode == ShowMode::Always || (show_mode == ShowMode::LastSaved && should_show) { + self.show()?; + self.set_focus()?; + } + + Ok(()) + } +} + +#[derive(Default)] +pub struct Builder { + show_mode: ShowMode, + denylist: HashSet, + skip_initial_state: HashSet, +} + +impl Builder { + /// Sets how the window visibility should be restored. + /// + /// The default is [`ShowMode::LastSaved`] + pub fn with_show_mode(mut self, show_mode: ShowMode) -> Self { + self.show_mode = show_mode; + self + } + + /// Sets a list of windows that shouldn't be tracked and managed by this plugin + /// for example splash screen windows. + pub fn with_denylist(mut self, denylist: &[&str]) -> Self { + self.denylist = denylist.iter().map(|l| l.to_string()).collect(); + self + } + + /// Adds the given window label to a list of windows to skip initial state restore. + pub fn skip_initial_state(mut self, label: &str) -> Self { + self.skip_initial_state.insert(label.into()); + self + } + + pub fn build(self) -> TauriPlugin { + PluginBuilder::new("window-state") + .setup(|app| { + let cache: Arc>> = if let Some(app_dir) = + app.path_resolver().app_config_dir() + { + let state_path = app_dir.join(STATE_FILENAME); + if state_path.exists() { + Arc::new(Mutex::new( + tauri::api::file::read_binary(state_path) + .map_err(Error::TauriApi) + .and_then(|state| bincode::deserialize(&state).map_err(Into::into)) + .unwrap_or_default(), + )) + } else { + Default::default() + } + } else { + Default::default() + }; + app.manage(WindowStateCache(cache)); + Ok(()) + }) + .on_webview_ready(move |window| { + if self.denylist.contains(window.label()) { + return; + } + + if !self.skip_initial_state.contains(window.label()) { + let _ = window.restore_state(self.show_mode); + } + + let cache = window.state::(); + let cache = cache.0.clone(); + let label = window.label().to_string(); + let window_clone = window.clone(); + window.on_window_event(move |e| match e { + WindowEvent::Moved(position) => { + let mut c = cache.lock().unwrap(); + if let Some(state) = c.get_mut(&label) { + let is_maximized = window_clone.is_maximized().unwrap_or(false); + state.maximized = is_maximized; + + if let Some(monitor) = window_clone.current_monitor().unwrap() { + state.monitor = + monitor.name().map(ToString::to_string).unwrap_or_default(); + let monitor_position = monitor.position(); + // save only window positions that are inside the current monitor + if position.x > monitor_position.x + && position.y > monitor_position.y + && !is_maximized + { + state.x = position.x; + state.y = position.y; + }; + }; + } + } + WindowEvent::Resized(size) => { + let scale_factor = window_clone + .current_monitor() + .ok() + .map(|m| m.map(|m| m.scale_factor()).unwrap_or(1.)) + .unwrap_or(1.); + let size = size.to_logical(scale_factor); + let mut c = cache.lock().unwrap(); + if let Some(state) = c.get_mut(&label) { + let is_maximized = window_clone.is_maximized().unwrap_or(false); + let is_fullscreen = window_clone.is_fullscreen().unwrap_or(false); + state.decorated = window_clone.is_decorated().unwrap_or(true); + state.maximized = is_maximized; + state.fullscreen = is_fullscreen; + + // It doesn't make sense to save a window with 0 height or width + if size.width > 0. && size.height > 0. && !is_maximized { + state.width = size.width; + state.height = size.height; + } + } + } + WindowEvent::CloseRequested { .. } => { + let mut c = cache.lock().unwrap(); + if let Some(state) = c.get_mut(&label) { + state.visible = window_clone.is_visible().unwrap_or(true); + } + } + _ => {} + }); + }) + .on_event(|app, event| { + if let RunEvent::Exit = event { + let _ = app.save_window_state(); + } + }) + .build() + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..572fc642 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,2543 @@ +lockfileVersion: 5.4 + +importers: + .: + specifiers: + "@rollup/plugin-node-resolve": ^15.0.1 + "@rollup/plugin-terser": ^0.2.0 + "@rollup/plugin-typescript": ^10.0.1 + "@typescript-eslint/eslint-plugin": ^5.0.0 + "@typescript-eslint/parser": ^5.46.1 + eslint: ^8.0.1 + eslint-config-prettier: ^8.5.0 + eslint-config-standard-with-typescript: ^24.0.0 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: ^15.0.0 + eslint-plugin-promise: ^6.0.0 + prettier: ^2.8.1 + rollup: ^3.7.4 + typescript: ^4.9.4 + devDependencies: + "@rollup/plugin-node-resolve": 15.0.1_rollup@3.7.4 + "@rollup/plugin-terser": 0.2.0_rollup@3.7.4 + "@rollup/plugin-typescript": 10.0.1_fhibmf72xnv5tve6nwed265eae + "@typescript-eslint/eslint-plugin": 5.46.1_imrg37k3svwu377c6q7gkarwmi + "@typescript-eslint/parser": 5.46.1_ha6vam6werchizxrnqvarmz2zu + eslint: 8.29.0 + eslint-config-prettier: 8.5.0_eslint@8.29.0 + eslint-config-standard-with-typescript: 24.0.0_f7skxvi3ubnnb5utlsc5vholvm + eslint-plugin-import: 2.26.0_z7hwuz3w5sq2sbhy7d4iqrnsvq + eslint-plugin-n: 15.6.0_eslint@8.29.0 + eslint-plugin-promise: 6.1.1_eslint@8.29.0 + prettier: 2.8.1 + rollup: 3.7.4 + typescript: 4.9.4 + + plugins/authenticator/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/autostart/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/fs-extra/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/fs-watch/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/log/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/positioner/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/sql/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/store/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/stronghold/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/upload/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + + plugins/websocket/guest-js: + specifiers: + "@tauri-apps/api": ^1.2.0 + tslib: ^2.4.1 + dependencies: + "@tauri-apps/api": 1.2.0 + devDependencies: + tslib: 2.4.1 + +packages: + /@eslint/eslintrc/1.3.3: + resolution: + { + integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 9.4.1 + globals: 13.19.0 + ignore: 5.2.1 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/config-array/0.11.7: + resolution: + { + integrity: sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw==, + } + engines: { node: ">=10.10.0" } + dependencies: + "@humanwhocodes/object-schema": 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@humanwhocodes/module-importer/1.0.1: + resolution: + { + integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==, + } + engines: { node: ">=12.22" } + dev: true + + /@humanwhocodes/object-schema/1.2.1: + resolution: + { + integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==, + } + dev: true + + /@jridgewell/gen-mapping/0.3.2: + resolution: + { + integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==, + } + engines: { node: ">=6.0.0" } + dependencies: + "@jridgewell/set-array": 1.1.2 + "@jridgewell/sourcemap-codec": 1.4.14 + "@jridgewell/trace-mapping": 0.3.17 + dev: true + + /@jridgewell/resolve-uri/3.1.0: + resolution: + { + integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==, + } + engines: { node: ">=6.0.0" } + dev: true + + /@jridgewell/set-array/1.1.2: + resolution: + { + integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==, + } + engines: { node: ">=6.0.0" } + dev: true + + /@jridgewell/source-map/0.3.2: + resolution: + { + integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==, + } + dependencies: + "@jridgewell/gen-mapping": 0.3.2 + "@jridgewell/trace-mapping": 0.3.17 + dev: true + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: + { + integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==, + } + dev: true + + /@jridgewell/trace-mapping/0.3.17: + resolution: + { + integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==, + } + dependencies: + "@jridgewell/resolve-uri": 3.1.0 + "@jridgewell/sourcemap-codec": 1.4.14 + dev: true + + /@nodelib/fs.scandir/2.1.5: + resolution: + { + integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==, + } + engines: { node: ">= 8" } + dependencies: + "@nodelib/fs.stat": 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat/2.0.5: + resolution: + { + integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==, + } + engines: { node: ">= 8" } + dev: true + + /@nodelib/fs.walk/1.2.8: + resolution: + { + integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==, + } + engines: { node: ">= 8" } + dependencies: + "@nodelib/fs.scandir": 2.1.5 + fastq: 1.14.0 + dev: true + + /@rollup/plugin-node-resolve/15.0.1_rollup@3.7.4: + resolution: + { + integrity: sha512-ReY88T7JhJjeRVbfCyNj+NXAG3IIsVMsX9b5/9jC98dRP8/yxlZdz7mHZbHk5zHr24wZZICS5AcXsFZAXYUQEg==, + } + engines: { node: ">=14.0.0" } + peerDependencies: + rollup: ^2.78.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + "@rollup/pluginutils": 5.0.2_rollup@3.7.4 + "@types/resolve": 1.20.2 + deepmerge: 4.2.2 + is-builtin-module: 3.2.0 + is-module: 1.0.0 + resolve: 1.22.1 + rollup: 3.7.4 + dev: true + + /@rollup/plugin-terser/0.2.0_rollup@3.7.4: + resolution: + { + integrity: sha512-UBr4WNXBFipKW2C2db9JIzIdq9bFZsaTZwKeAd9Y0N9Pv9G2XgRhaimGdotx1+Wf/2XTuTJ+FVS2SO+y2WyiUQ==, + } + engines: { node: ">=14.0.0" } + peerDependencies: + rollup: ^2.x || ^3.x + peerDependenciesMeta: + rollup: + optional: true + dependencies: + rollup: 3.7.4 + serialize-javascript: 6.0.0 + smob: 0.0.6 + terser: 5.16.1 + dev: true + + /@rollup/plugin-typescript/10.0.1_fhibmf72xnv5tve6nwed265eae: + resolution: + { + integrity: sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A==, + } + engines: { node: ">=14.0.0" } + peerDependencies: + rollup: ^2.14.0||^3.0.0 + tslib: "*" + typescript: ">=3.7.0" + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + dependencies: + "@rollup/pluginutils": 5.0.2_rollup@3.7.4 + resolve: 1.22.1 + rollup: 3.7.4 + typescript: 4.9.4 + dev: true + + /@rollup/pluginutils/5.0.2_rollup@3.7.4: + resolution: + { + integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==, + } + engines: { node: ">=14.0.0" } + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + "@types/estree": 1.0.0 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 3.7.4 + dev: true + + /@tauri-apps/api/1.2.0: + resolution: + { + integrity: sha512-lsI54KI6HGf7VImuf/T9pnoejfgkNoXveP14pVV7XarrQ46rOejIVJLFqHI9sRReJMGdh2YuCoI3cc/yCWCsrw==, + } + engines: { node: ">= 14.6.0", npm: ">= 6.6.0", yarn: ">= 1.19.1" } + dev: false + + /@types/estree/1.0.0: + resolution: + { + integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==, + } + dev: true + + /@types/json-schema/7.0.11: + resolution: + { + integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==, + } + dev: true + + /@types/json5/0.0.29: + resolution: + { + integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==, + } + dev: true + + /@types/resolve/1.20.2: + resolution: + { + integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==, + } + dev: true + + /@types/semver/7.3.13: + resolution: + { + integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==, + } + dev: true + + /@typescript-eslint/eslint-plugin/5.46.1_imrg37k3svwu377c6q7gkarwmi: + resolution: + { + integrity: sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + "@typescript-eslint/parser": ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@typescript-eslint/parser": 5.46.1_ha6vam6werchizxrnqvarmz2zu + "@typescript-eslint/scope-manager": 5.46.1 + "@typescript-eslint/type-utils": 5.46.1_ha6vam6werchizxrnqvarmz2zu + "@typescript-eslint/utils": 5.46.1_ha6vam6werchizxrnqvarmz2zu + debug: 4.3.4 + eslint: 8.29.0 + ignore: 5.2.1 + natural-compare-lite: 1.4.0 + regexpp: 3.2.0 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.9.4 + typescript: 4.9.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/parser/5.46.1_ha6vam6werchizxrnqvarmz2zu: + resolution: + { + integrity: sha512-RelQ5cGypPh4ySAtfIMBzBGyrNerQcmfA1oJvPj5f+H4jI59rl9xxpn4bonC0tQvUKOEN7eGBFWxFLK3Xepneg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@typescript-eslint/scope-manager": 5.46.1 + "@typescript-eslint/types": 5.46.1 + "@typescript-eslint/typescript-estree": 5.46.1_typescript@4.9.4 + debug: 4.3.4 + eslint: 8.29.0 + typescript: 4.9.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/scope-manager/5.46.1: + resolution: + { + integrity: sha512-iOChVivo4jpwUdrJZyXSMrEIM/PvsbbDOX1y3UCKjSgWn+W89skxWaYXACQfxmIGhPVpRWK/VWPYc+bad6smIA==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + "@typescript-eslint/types": 5.46.1 + "@typescript-eslint/visitor-keys": 5.46.1 + dev: true + + /@typescript-eslint/type-utils/5.46.1_ha6vam6werchizxrnqvarmz2zu: + resolution: + { + integrity: sha512-V/zMyfI+jDmL1ADxfDxjZ0EMbtiVqj8LUGPAGyBkXXStWmCUErMpW873zEHsyguWCuq2iN4BrlWUkmuVj84yng==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: "*" + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@typescript-eslint/typescript-estree": 5.46.1_typescript@4.9.4 + "@typescript-eslint/utils": 5.46.1_ha6vam6werchizxrnqvarmz2zu + debug: 4.3.4 + eslint: 8.29.0 + tsutils: 3.21.0_typescript@4.9.4 + typescript: 4.9.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/types/5.46.1: + resolution: + { + integrity: sha512-Z5pvlCaZgU+93ryiYUwGwLl9AQVB/PQ1TsJ9NZ/gHzZjN7g9IAn6RSDkpCV8hqTwAiaj6fmCcKSQeBPlIpW28w==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dev: true + + /@typescript-eslint/typescript-estree/5.46.1_typescript@4.9.4: + resolution: + { + integrity: sha512-j9W4t67QiNp90kh5Nbr1w92wzt+toiIsaVPnEblB2Ih2U9fqBTyqV9T3pYWZBRt6QoMh/zVWP59EpuCjc4VRBg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + dependencies: + "@typescript-eslint/types": 5.46.1 + "@typescript-eslint/visitor-keys": 5.46.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.9.4 + typescript: 4.9.4 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils/5.46.1_ha6vam6werchizxrnqvarmz2zu: + resolution: + { + integrity: sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + "@types/json-schema": 7.0.11 + "@types/semver": 7.3.13 + "@typescript-eslint/scope-manager": 5.46.1 + "@typescript-eslint/types": 5.46.1 + "@typescript-eslint/typescript-estree": 5.46.1_typescript@4.9.4 + eslint: 8.29.0 + eslint-scope: 5.1.1 + eslint-utils: 3.0.0_eslint@8.29.0 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys/5.46.1: + resolution: + { + integrity: sha512-jczZ9noovXwy59KjRTk1OftT78pwygdcmCuBf8yMoWt/8O8l+6x2LSEze0E4TeepXK4MezW3zGSyoDRZK7Y9cg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + "@typescript-eslint/types": 5.46.1 + eslint-visitor-keys: 3.3.0 + dev: true + + /acorn-jsx/5.3.2_acorn@8.8.1: + resolution: + { + integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==, + } + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 8.8.1 + dev: true + + /acorn/8.8.1: + resolution: + { + integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==, + } + engines: { node: ">=0.4.0" } + hasBin: true + dev: true + + /ajv/6.12.6: + resolution: + { + integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==, + } + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + dev: true + + /ansi-regex/5.0.1: + resolution: + { + integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==, + } + engines: { node: ">=8" } + dev: true + + /ansi-styles/4.3.0: + resolution: + { + integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==, + } + engines: { node: ">=8" } + dependencies: + color-convert: 2.0.1 + dev: true + + /argparse/2.0.1: + resolution: + { + integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==, + } + dev: true + + /array-includes/3.1.6: + resolution: + { + integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.5 + get-intrinsic: 1.1.3 + is-string: 1.0.7 + dev: true + + /array-union/2.1.0: + resolution: + { + integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==, + } + engines: { node: ">=8" } + dev: true + + /array.prototype.flat/1.3.1: + resolution: + { + integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.5 + es-shim-unscopables: 1.0.0 + dev: true + + /balanced-match/1.0.2: + resolution: + { + integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==, + } + dev: true + + /brace-expansion/1.1.11: + resolution: + { + integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==, + } + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /braces/3.0.2: + resolution: + { + integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==, + } + engines: { node: ">=8" } + dependencies: + fill-range: 7.0.1 + dev: true + + /buffer-from/1.1.2: + resolution: + { + integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==, + } + dev: true + + /builtin-modules/3.3.0: + resolution: + { + integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==, + } + engines: { node: ">=6" } + dev: true + + /builtins/5.0.1: + resolution: + { + integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==, + } + dependencies: + semver: 7.3.8 + dev: true + + /call-bind/1.0.2: + resolution: + { + integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==, + } + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.1.3 + dev: true + + /callsites/3.1.0: + resolution: + { + integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==, + } + engines: { node: ">=6" } + dev: true + + /chalk/4.1.2: + resolution: + { + integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==, + } + engines: { node: ">=10" } + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /color-convert/2.0.1: + resolution: + { + integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==, + } + engines: { node: ">=7.0.0" } + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.4: + resolution: + { + integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==, + } + dev: true + + /commander/2.20.3: + resolution: + { + integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==, + } + dev: true + + /concat-map/0.0.1: + resolution: + { + integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==, + } + dev: true + + /cross-spawn/7.0.3: + resolution: + { + integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==, + } + engines: { node: ">= 8" } + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /debug/2.6.9: + resolution: + { + integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==, + } + peerDependencies: + supports-color: "*" + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug/3.2.7: + resolution: + { + integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==, + } + peerDependencies: + supports-color: "*" + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: true + + /debug/4.3.4: + resolution: + { + integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==, + } + engines: { node: ">=6.0" } + peerDependencies: + supports-color: "*" + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /deep-is/0.1.4: + resolution: + { + integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==, + } + dev: true + + /deepmerge/4.2.2: + resolution: + { + integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==, + } + engines: { node: ">=0.10.0" } + dev: true + + /define-properties/1.1.4: + resolution: + { + integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==, + } + engines: { node: ">= 0.4" } + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: true + + /dir-glob/3.0.1: + resolution: + { + integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==, + } + engines: { node: ">=8" } + dependencies: + path-type: 4.0.0 + dev: true + + /doctrine/2.1.0: + resolution: + { + integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==, + } + engines: { node: ">=0.10.0" } + dependencies: + esutils: 2.0.3 + dev: true + + /doctrine/3.0.0: + resolution: + { + integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==, + } + engines: { node: ">=6.0.0" } + dependencies: + esutils: 2.0.3 + dev: true + + /es-abstract/1.20.5: + resolution: + { + integrity: sha512-7h8MM2EQhsCA7pU/Nv78qOXFpD8Rhqd12gYiSJVkrH9+e8VuA8JlPJK/hQjjlLv6pJvx/z1iRFKzYb0XT/RuAQ==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.1.3 + get-symbol-description: 1.0.0 + gopd: 1.0.1 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-symbols: 1.0.3 + internal-slot: 1.0.4 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-weakref: 1.0.2 + object-inspect: 1.12.2 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 + unbox-primitive: 1.0.2 + dev: true + + /es-shim-unscopables/1.0.0: + resolution: + { + integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==, + } + dependencies: + has: 1.0.3 + dev: true + + /es-to-primitive/1.2.1: + resolution: + { + integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==, + } + engines: { node: ">= 0.4" } + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: true + + /escape-string-regexp/4.0.0: + resolution: + { + integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==, + } + engines: { node: ">=10" } + dev: true + + /eslint-config-prettier/8.5.0_eslint@8.29.0: + resolution: + { + integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==, + } + hasBin: true + peerDependencies: + eslint: ">=7.0.0" + dependencies: + eslint: 8.29.0 + dev: true + + /eslint-config-standard-with-typescript/24.0.0_f7skxvi3ubnnb5utlsc5vholvm: + resolution: + { + integrity: sha512-vEnGXZ5aiR1enl9652iIP4nTpY3GPcNEwuhrsPbKO3Ce3D6T3yCqZdkUPk8nJetfdL/yO0DLsHg2d/l9iECIdg==, + } + peerDependencies: + "@typescript-eslint/eslint-plugin": ^5.0.0 + eslint: ^8.0.1 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: ^15.0.0 + eslint-plugin-promise: ^6.0.0 + typescript: "*" + dependencies: + "@typescript-eslint/eslint-plugin": 5.46.1_imrg37k3svwu377c6q7gkarwmi + "@typescript-eslint/parser": 5.46.1_ha6vam6werchizxrnqvarmz2zu + eslint: 8.29.0 + eslint-config-standard: 17.0.0_wnkmxhw54rcoqx42l6oqxte7qq + eslint-plugin-import: 2.26.0_z7hwuz3w5sq2sbhy7d4iqrnsvq + eslint-plugin-n: 15.6.0_eslint@8.29.0 + eslint-plugin-promise: 6.1.1_eslint@8.29.0 + typescript: 4.9.4 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-config-standard/17.0.0_wnkmxhw54rcoqx42l6oqxte7qq: + resolution: + { + integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==, + } + peerDependencies: + eslint: ^8.0.1 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: ^15.0.0 + eslint-plugin-promise: ^6.0.0 + dependencies: + eslint: 8.29.0 + eslint-plugin-import: 2.26.0_z7hwuz3w5sq2sbhy7d4iqrnsvq + eslint-plugin-n: 15.6.0_eslint@8.29.0 + eslint-plugin-promise: 6.1.1_eslint@8.29.0 + dev: true + + /eslint-import-resolver-node/0.3.6: + resolution: + { + integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==, + } + dependencies: + debug: 3.2.7 + resolve: 1.22.1 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-module-utils/2.7.4_h4dlhne3g63bjzyi45ugdl2u4u: + resolution: + { + integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==, + } + engines: { node: ">=4" } + peerDependencies: + "@typescript-eslint/parser": "*" + eslint: "*" + eslint-import-resolver-node: "*" + eslint-import-resolver-typescript: "*" + eslint-import-resolver-webpack: "*" + peerDependenciesMeta: + "@typescript-eslint/parser": + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + "@typescript-eslint/parser": 5.46.1_ha6vam6werchizxrnqvarmz2zu + debug: 3.2.7 + eslint: 8.29.0 + eslint-import-resolver-node: 0.3.6 + transitivePeerDependencies: + - supports-color + dev: true + + /eslint-plugin-es/4.1.0_eslint@8.29.0: + resolution: + { + integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==, + } + engines: { node: ">=8.10.0" } + peerDependencies: + eslint: ">=4.19.1" + dependencies: + eslint: 8.29.0 + eslint-utils: 2.1.0 + regexpp: 3.2.0 + dev: true + + /eslint-plugin-import/2.26.0_z7hwuz3w5sq2sbhy7d4iqrnsvq: + resolution: + { + integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==, + } + engines: { node: ">=4" } + peerDependencies: + "@typescript-eslint/parser": "*" + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + "@typescript-eslint/parser": + optional: true + dependencies: + "@typescript-eslint/parser": 5.46.1_ha6vam6werchizxrnqvarmz2zu + array-includes: 3.1.6 + array.prototype.flat: 1.3.1 + debug: 2.6.9 + doctrine: 2.1.0 + eslint: 8.29.0 + eslint-import-resolver-node: 0.3.6 + eslint-module-utils: 2.7.4_h4dlhne3g63bjzyi45ugdl2u4u + has: 1.0.3 + is-core-module: 2.11.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.values: 1.1.6 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-plugin-n/15.6.0_eslint@8.29.0: + resolution: + { + integrity: sha512-Hd/F7wz4Mj44Jp0H6Jtty13NcE69GNTY0rVlgTIj1XBnGGVI6UTdDrpE6vqu3AHo07bygq/N+7OH/lgz1emUJw==, + } + engines: { node: ">=12.22.0" } + peerDependencies: + eslint: ">=7.0.0" + dependencies: + builtins: 5.0.1 + eslint: 8.29.0 + eslint-plugin-es: 4.1.0_eslint@8.29.0 + eslint-utils: 3.0.0_eslint@8.29.0 + ignore: 5.2.1 + is-core-module: 2.11.0 + minimatch: 3.1.2 + resolve: 1.22.1 + semver: 7.3.8 + dev: true + + /eslint-plugin-promise/6.1.1_eslint@8.29.0: + resolution: + { + integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + eslint: 8.29.0 + dev: true + + /eslint-scope/5.1.1: + resolution: + { + integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==, + } + engines: { node: ">=8.0.0" } + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + dev: true + + /eslint-scope/7.1.1: + resolution: + { + integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + esrecurse: 4.3.0 + estraverse: 5.3.0 + dev: true + + /eslint-utils/2.1.0: + resolution: + { + integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==, + } + engines: { node: ">=6" } + dependencies: + eslint-visitor-keys: 1.3.0 + dev: true + + /eslint-utils/3.0.0_eslint@8.29.0: + resolution: + { + integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==, + } + engines: { node: ^10.0.0 || ^12.0.0 || >= 14.0.0 } + peerDependencies: + eslint: ">=5" + dependencies: + eslint: 8.29.0 + eslint-visitor-keys: 2.1.0 + dev: true + + /eslint-visitor-keys/1.3.0: + resolution: + { + integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==, + } + engines: { node: ">=4" } + dev: true + + /eslint-visitor-keys/2.1.0: + resolution: + { + integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==, + } + engines: { node: ">=10" } + dev: true + + /eslint-visitor-keys/3.3.0: + resolution: + { + integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dev: true + + /eslint/8.29.0: + resolution: + { + integrity: sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + hasBin: true + dependencies: + "@eslint/eslintrc": 1.3.3 + "@humanwhocodes/config-array": 0.11.7 + "@humanwhocodes/module-importer": 1.0.1 + "@nodelib/fs.walk": 1.2.8 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + escape-string-regexp: 4.0.0 + eslint-scope: 7.1.1 + eslint-utils: 3.0.0_eslint@8.29.0 + eslint-visitor-keys: 3.3.0 + espree: 9.4.1 + esquery: 1.4.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + find-up: 5.0.0 + glob-parent: 6.0.2 + globals: 13.19.0 + grapheme-splitter: 1.0.4 + ignore: 5.2.1 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + is-path-inside: 3.0.3 + js-sdsl: 4.2.0 + js-yaml: 4.1.0 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.1 + regexpp: 3.2.0 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + text-table: 0.2.0 + transitivePeerDependencies: + - supports-color + dev: true + + /espree/9.4.1: + resolution: + { + integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==, + } + engines: { node: ^12.22.0 || ^14.17.0 || >=16.0.0 } + dependencies: + acorn: 8.8.1 + acorn-jsx: 5.3.2_acorn@8.8.1 + eslint-visitor-keys: 3.3.0 + dev: true + + /esquery/1.4.0: + resolution: + { + integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==, + } + engines: { node: ">=0.10" } + dependencies: + estraverse: 5.3.0 + dev: true + + /esrecurse/4.3.0: + resolution: + { + integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==, + } + engines: { node: ">=4.0" } + dependencies: + estraverse: 5.3.0 + dev: true + + /estraverse/4.3.0: + resolution: + { + integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==, + } + engines: { node: ">=4.0" } + dev: true + + /estraverse/5.3.0: + resolution: + { + integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==, + } + engines: { node: ">=4.0" } + dev: true + + /estree-walker/2.0.2: + resolution: + { + integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==, + } + dev: true + + /esutils/2.0.3: + resolution: + { + integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==, + } + engines: { node: ">=0.10.0" } + dev: true + + /fast-deep-equal/3.1.3: + resolution: + { + integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==, + } + dev: true + + /fast-glob/3.2.12: + resolution: + { + integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==, + } + engines: { node: ">=8.6.0" } + dependencies: + "@nodelib/fs.stat": 2.0.5 + "@nodelib/fs.walk": 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + + /fast-json-stable-stringify/2.1.0: + resolution: + { + integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==, + } + dev: true + + /fast-levenshtein/2.0.6: + resolution: + { + integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==, + } + dev: true + + /fastq/1.14.0: + resolution: + { + integrity: sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==, + } + dependencies: + reusify: 1.0.4 + dev: true + + /file-entry-cache/6.0.1: + resolution: + { + integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==, + } + engines: { node: ^10.12.0 || >=12.0.0 } + dependencies: + flat-cache: 3.0.4 + dev: true + + /fill-range/7.0.1: + resolution: + { + integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==, + } + engines: { node: ">=8" } + dependencies: + to-regex-range: 5.0.1 + dev: true + + /find-up/5.0.0: + resolution: + { + integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==, + } + engines: { node: ">=10" } + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /flat-cache/3.0.4: + resolution: + { + integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==, + } + engines: { node: ^10.12.0 || >=12.0.0 } + dependencies: + flatted: 3.2.7 + rimraf: 3.0.2 + dev: true + + /flatted/3.2.7: + resolution: + { + integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==, + } + dev: true + + /fs.realpath/1.0.0: + resolution: + { + integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==, + } + dev: true + + /fsevents/2.3.2: + resolution: + { + integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==, + } + engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.1: + resolution: + { + integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==, + } + dev: true + + /function.prototype.name/1.1.5: + resolution: + { + integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.5 + functions-have-names: 1.2.3 + dev: true + + /functions-have-names/1.2.3: + resolution: + { + integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==, + } + dev: true + + /get-intrinsic/1.1.3: + resolution: + { + integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==, + } + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: true + + /get-symbol-description/1.0.0: + resolution: + { + integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + dev: true + + /glob-parent/5.1.2: + resolution: + { + integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==, + } + engines: { node: ">= 6" } + dependencies: + is-glob: 4.0.3 + dev: true + + /glob-parent/6.0.2: + resolution: + { + integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==, + } + engines: { node: ">=10.13.0" } + dependencies: + is-glob: 4.0.3 + dev: true + + /glob/7.2.3: + resolution: + { + integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==, + } + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /globals/13.19.0: + resolution: + { + integrity: sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==, + } + engines: { node: ">=8" } + dependencies: + type-fest: 0.20.2 + dev: true + + /globby/11.1.0: + resolution: + { + integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==, + } + engines: { node: ">=10" } + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.12 + ignore: 5.2.1 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /gopd/1.0.1: + resolution: + { + integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==, + } + dependencies: + get-intrinsic: 1.1.3 + dev: true + + /grapheme-splitter/1.0.4: + resolution: + { + integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==, + } + dev: true + + /has-bigints/1.0.2: + resolution: + { + integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==, + } + dev: true + + /has-flag/4.0.0: + resolution: + { + integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==, + } + engines: { node: ">=8" } + dev: true + + /has-property-descriptors/1.0.0: + resolution: + { + integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==, + } + dependencies: + get-intrinsic: 1.1.3 + dev: true + + /has-symbols/1.0.3: + resolution: + { + integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==, + } + engines: { node: ">= 0.4" } + dev: true + + /has-tostringtag/1.0.0: + resolution: + { + integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==, + } + engines: { node: ">= 0.4" } + dependencies: + has-symbols: 1.0.3 + dev: true + + /has/1.0.3: + resolution: + { + integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==, + } + engines: { node: ">= 0.4.0" } + dependencies: + function-bind: 1.1.1 + dev: true + + /ignore/5.2.1: + resolution: + { + integrity: sha512-d2qQLzTJ9WxQftPAuEQpSPmKqzxePjzVbpAVv62AQ64NTL+wR4JkrVqR/LqFsFEUsHDAiId52mJteHDFuDkElA==, + } + engines: { node: ">= 4" } + dev: true + + /import-fresh/3.3.0: + resolution: + { + integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==, + } + engines: { node: ">=6" } + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /imurmurhash/0.1.4: + resolution: + { + integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==, + } + engines: { node: ">=0.8.19" } + dev: true + + /inflight/1.0.6: + resolution: + { + integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==, + } + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.4: + resolution: + { + integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==, + } + dev: true + + /internal-slot/1.0.4: + resolution: + { + integrity: sha512-tA8URYccNzMo94s5MQZgH8NB/XTa6HsOo0MLfXTKKEnHVVdegzaQoFZ7Jp44bdvLvY2waT5dc+j5ICEswhi7UQ==, + } + engines: { node: ">= 0.4" } + dependencies: + get-intrinsic: 1.1.3 + has: 1.0.3 + side-channel: 1.0.4 + dev: true + + /is-bigint/1.0.4: + resolution: + { + integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==, + } + dependencies: + has-bigints: 1.0.2 + dev: true + + /is-boolean-object/1.1.2: + resolution: + { + integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-builtin-module/3.2.0: + resolution: + { + integrity: sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==, + } + engines: { node: ">=6" } + dependencies: + builtin-modules: 3.3.0 + dev: true + + /is-callable/1.2.7: + resolution: + { + integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==, + } + engines: { node: ">= 0.4" } + dev: true + + /is-core-module/2.11.0: + resolution: + { + integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==, + } + dependencies: + has: 1.0.3 + dev: true + + /is-date-object/1.0.5: + resolution: + { + integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==, + } + engines: { node: ">= 0.4" } + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-extglob/2.1.1: + resolution: + { + integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==, + } + engines: { node: ">=0.10.0" } + dev: true + + /is-glob/4.0.3: + resolution: + { + integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==, + } + engines: { node: ">=0.10.0" } + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-module/1.0.0: + resolution: + { + integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==, + } + dev: true + + /is-negative-zero/2.0.2: + resolution: + { + integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==, + } + engines: { node: ">= 0.4" } + dev: true + + /is-number-object/1.0.7: + resolution: + { + integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==, + } + engines: { node: ">= 0.4" } + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-number/7.0.0: + resolution: + { + integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==, + } + engines: { node: ">=0.12.0" } + dev: true + + /is-path-inside/3.0.3: + resolution: + { + integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==, + } + engines: { node: ">=8" } + dev: true + + /is-regex/1.1.4: + resolution: + { + integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + + /is-shared-array-buffer/1.0.2: + resolution: + { + integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==, + } + dependencies: + call-bind: 1.0.2 + dev: true + + /is-string/1.0.7: + resolution: + { + integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==, + } + engines: { node: ">= 0.4" } + dependencies: + has-tostringtag: 1.0.0 + dev: true + + /is-symbol/1.0.4: + resolution: + { + integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==, + } + engines: { node: ">= 0.4" } + dependencies: + has-symbols: 1.0.3 + dev: true + + /is-weakref/1.0.2: + resolution: + { + integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==, + } + dependencies: + call-bind: 1.0.2 + dev: true + + /isexe/2.0.0: + resolution: + { + integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==, + } + dev: true + + /js-sdsl/4.2.0: + resolution: + { + integrity: sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==, + } + dev: true + + /js-yaml/4.1.0: + resolution: + { + integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==, + } + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /json-schema-traverse/0.4.1: + resolution: + { + integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==, + } + dev: true + + /json-stable-stringify-without-jsonify/1.0.1: + resolution: + { + integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==, + } + dev: true + + /json5/1.0.1: + resolution: + { + integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==, + } + hasBin: true + dependencies: + minimist: 1.2.7 + dev: true + + /levn/0.4.1: + resolution: + { + integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==, + } + engines: { node: ">= 0.8.0" } + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + dev: true + + /locate-path/6.0.0: + resolution: + { + integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==, + } + engines: { node: ">=10" } + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.merge/4.6.2: + resolution: + { + integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==, + } + dev: true + + /lru-cache/6.0.0: + resolution: + { + integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==, + } + engines: { node: ">=10" } + dependencies: + yallist: 4.0.0 + dev: true + + /merge2/1.4.1: + resolution: + { + integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==, + } + engines: { node: ">= 8" } + dev: true + + /micromatch/4.0.5: + resolution: + { + integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==, + } + engines: { node: ">=8.6" } + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /minimatch/3.1.2: + resolution: + { + integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==, + } + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimist/1.2.7: + resolution: + { + integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==, + } + dev: true + + /ms/2.0.0: + resolution: + { + integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==, + } + dev: true + + /ms/2.1.2: + resolution: + { + integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==, + } + dev: true + + /ms/2.1.3: + resolution: + { + integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==, + } + dev: true + + /natural-compare-lite/1.4.0: + resolution: + { + integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==, + } + dev: true + + /natural-compare/1.4.0: + resolution: + { + integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==, + } + dev: true + + /object-inspect/1.12.2: + resolution: + { + integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==, + } + dev: true + + /object-keys/1.1.1: + resolution: + { + integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==, + } + engines: { node: ">= 0.4" } + dev: true + + /object.assign/4.1.4: + resolution: + { + integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + + /object.values/1.1.6: + resolution: + { + integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.5 + dev: true + + /once/1.4.0: + resolution: + { + integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==, + } + dependencies: + wrappy: 1.0.2 + dev: true + + /optionator/0.9.1: + resolution: + { + integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==, + } + engines: { node: ">= 0.8.0" } + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.3 + dev: true + + /p-limit/3.1.0: + resolution: + { + integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==, + } + engines: { node: ">=10" } + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/5.0.0: + resolution: + { + integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==, + } + engines: { node: ">=10" } + dependencies: + p-limit: 3.1.0 + dev: true + + /parent-module/1.0.1: + resolution: + { + integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==, + } + engines: { node: ">=6" } + dependencies: + callsites: 3.1.0 + dev: true + + /path-exists/4.0.0: + resolution: + { + integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==, + } + engines: { node: ">=8" } + dev: true + + /path-is-absolute/1.0.1: + resolution: + { + integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==, + } + engines: { node: ">=0.10.0" } + dev: true + + /path-key/3.1.1: + resolution: + { + integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==, + } + engines: { node: ">=8" } + dev: true + + /path-parse/1.0.7: + resolution: + { + integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==, + } + dev: true + + /path-type/4.0.0: + resolution: + { + integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==, + } + engines: { node: ">=8" } + dev: true + + /picomatch/2.3.1: + resolution: + { + integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==, + } + engines: { node: ">=8.6" } + dev: true + + /prelude-ls/1.2.1: + resolution: + { + integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==, + } + engines: { node: ">= 0.8.0" } + dev: true + + /prettier/2.8.1: + resolution: + { + integrity: sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==, + } + engines: { node: ">=10.13.0" } + hasBin: true + dev: true + + /punycode/2.1.1: + resolution: + { + integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==, + } + engines: { node: ">=6" } + dev: true + + /queue-microtask/1.2.3: + resolution: + { + integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==, + } + dev: true + + /randombytes/2.1.0: + resolution: + { + integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==, + } + dependencies: + safe-buffer: 5.2.1 + dev: true + + /regexp.prototype.flags/1.4.3: + resolution: + { + integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==, + } + engines: { node: ">= 0.4" } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + functions-have-names: 1.2.3 + dev: true + + /regexpp/3.2.0: + resolution: + { + integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==, + } + engines: { node: ">=8" } + dev: true + + /resolve-from/4.0.0: + resolution: + { + integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==, + } + engines: { node: ">=4" } + dev: true + + /resolve/1.22.1: + resolution: + { + integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==, + } + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /reusify/1.0.4: + resolution: + { + integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==, + } + engines: { iojs: ">=1.0.0", node: ">=0.10.0" } + dev: true + + /rimraf/3.0.2: + resolution: + { + integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==, + } + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /rollup/3.7.4: + resolution: + { + integrity: sha512-jN9rx3k5pfg9H9al0r0y1EYKSeiRANZRYX32SuNXAnKzh6cVyf4LZVto1KAuDnbHT03E1CpsgqDKaqQ8FZtgxw==, + } + engines: { node: ">=14.18.0", npm: ">=8.0.0" } + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /run-parallel/1.2.0: + resolution: + { + integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==, + } + dependencies: + queue-microtask: 1.2.3 + dev: true + + /safe-buffer/5.2.1: + resolution: + { + integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==, + } + dev: true + + /safe-regex-test/1.0.0: + resolution: + { + integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==, + } + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + is-regex: 1.1.4 + dev: true + + /semver/7.3.8: + resolution: + { + integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==, + } + engines: { node: ">=10" } + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /serialize-javascript/6.0.0: + resolution: + { + integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==, + } + dependencies: + randombytes: 2.1.0 + dev: true + + /shebang-command/2.0.0: + resolution: + { + integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==, + } + engines: { node: ">=8" } + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/3.0.0: + resolution: + { + integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==, + } + engines: { node: ">=8" } + dev: true + + /side-channel/1.0.4: + resolution: + { + integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==, + } + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + object-inspect: 1.12.2 + dev: true + + /slash/3.0.0: + resolution: + { + integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==, + } + engines: { node: ">=8" } + dev: true + + /smob/0.0.6: + resolution: + { + integrity: sha512-V21+XeNni+tTyiST1MHsa84AQhT1aFZipzPpOFAVB8DkHzwJyjjAmt9bgwnuZiZWnIbMo2duE29wybxv/7HWUw==, + } + dev: true + + /source-map-support/0.5.21: + resolution: + { + integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==, + } + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map/0.6.1: + resolution: + { + integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, + } + engines: { node: ">=0.10.0" } + dev: true + + /string.prototype.trimend/1.0.6: + resolution: + { + integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==, + } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.5 + dev: true + + /string.prototype.trimstart/1.0.6: + resolution: + { + integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==, + } + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.5 + dev: true + + /strip-ansi/6.0.1: + resolution: + { + integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==, + } + engines: { node: ">=8" } + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-bom/3.0.0: + resolution: + { + integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==, + } + engines: { node: ">=4" } + dev: true + + /strip-json-comments/3.1.1: + resolution: + { + integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==, + } + engines: { node: ">=8" } + dev: true + + /supports-color/7.2.0: + resolution: + { + integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==, + } + engines: { node: ">=8" } + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: + { + integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==, + } + engines: { node: ">= 0.4" } + dev: true + + /terser/5.16.1: + resolution: + { + integrity: sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==, + } + engines: { node: ">=10" } + hasBin: true + dependencies: + "@jridgewell/source-map": 0.3.2 + acorn: 8.8.1 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + + /text-table/0.2.0: + resolution: + { + integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==, + } + dev: true + + /to-regex-range/5.0.1: + resolution: + { + integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==, + } + engines: { node: ">=8.0" } + dependencies: + is-number: 7.0.0 + dev: true + + /tsconfig-paths/3.14.1: + resolution: + { + integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==, + } + dependencies: + "@types/json5": 0.0.29 + json5: 1.0.1 + minimist: 1.2.7 + strip-bom: 3.0.0 + dev: true + + /tslib/1.14.1: + resolution: + { + integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==, + } + dev: true + + /tslib/2.4.1: + resolution: + { + integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==, + } + dev: true + + /tsutils/3.21.0_typescript@4.9.4: + resolution: + { + integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==, + } + engines: { node: ">= 6" } + peerDependencies: + typescript: ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + dependencies: + tslib: 1.14.1 + typescript: 4.9.4 + dev: true + + /type-check/0.4.0: + resolution: + { + integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==, + } + engines: { node: ">= 0.8.0" } + dependencies: + prelude-ls: 1.2.1 + dev: true + + /type-fest/0.20.2: + resolution: + { + integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==, + } + engines: { node: ">=10" } + dev: true + + /typescript/4.9.4: + resolution: + { + integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==, + } + engines: { node: ">=4.2.0" } + hasBin: true + dev: true + + /unbox-primitive/1.0.2: + resolution: + { + integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==, + } + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: true + + /uri-js/4.4.1: + resolution: + { + integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, + } + dependencies: + punycode: 2.1.1 + dev: true + + /which-boxed-primitive/1.0.2: + resolution: + { + integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==, + } + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: true + + /which/2.0.2: + resolution: + { + integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==, + } + engines: { node: ">= 8" } + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /word-wrap/1.2.3: + resolution: + { + integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==, + } + engines: { node: ">=0.10.0" } + dev: true + + /wrappy/1.0.2: + resolution: + { + integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==, + } + dev: true + + /yallist/4.0.0: + resolution: + { + integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==, + } + dev: true + + /yocto-queue/0.1.0: + resolution: + { + integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==, + } + engines: { node: ">=10" } + dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000..7f54532a --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - plugins/*/guest-js diff --git a/shared/rollup.config.mjs b/shared/rollup.config.mjs new file mode 100644 index 00000000..7ec69d2a --- /dev/null +++ b/shared/rollup.config.mjs @@ -0,0 +1,51 @@ +import { builtinModules } from "module"; + +import typescript from "@rollup/plugin-typescript"; +import resolve from "@rollup/plugin-node-resolve"; +// import terser from "@rollup/plugin-terser"; + +/** + * Create a base rollup config + * @param {Record} pkg Imported package.json + * @param {string[]} external Imported package.json + * @returns {import('rollup').RollupOptions} + */ +export function createConfig({ pkg, external = [] }) { + return [ + { + input: "index.ts", + external: Object.keys(pkg.dependencies || {}) + .concat(Object.keys(pkg.peerDependencies || {})) + .concat(builtinModules) + .concat(external), + onwarn: (warning) => { + throw Object.assign(new Error(), warning); + }, + strictDeprecations: true, + output: { + file: pkg.module, + format: "es", + sourcemap: true, + }, + plugins: [typescript({ sourceMap: true })], + }, + { + input: "index.ts", + onwarn: (warning) => { + throw Object.assign(new Error(), warning); + }, + strictDeprecations: true, + output: { + file: pkg.browser, + format: "es", + sourcemap: true, + entryFileNames: "[name].min.js", + }, + plugins: [ + resolve(), + // terser(), + typescript({ sourceMap: true }), + ], + }, + ]; +} diff --git a/shared/template/Cargo.toml b/shared/template/Cargo.toml new file mode 100644 index 00000000..edfd0141 --- /dev/null +++ b/shared/template/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "tauri-plugin-{{name}}" +version = "0.1.0" +edition.workspace = true +authors.workspace = true +license.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +serde.workspace = true +serde_json.workspace = true +tauri.workspace = true +log.workspace = true +thiserror.workspace = true \ No newline at end of file diff --git a/shared/template/guest-js/index.ts b/shared/template/guest-js/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/shared/template/guest-js/package.json b/shared/template/guest-js/package.json new file mode 100644 index 00000000..f3985e00 --- /dev/null +++ b/shared/template/guest-js/package.json @@ -0,0 +1,29 @@ +{ + "name": "tauri-plugin-{{name}}-api", + "version": "0.0.0", + "license": "MIT or APACHE-2.0", + "type": "module", + "browser": "dist/index.min.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "browser": "./dist/index.min.js" + }, + "scripts": { + "build": "rollup -c" + }, + "files": [ + "dist", + "!dist/**/*.map", + "README.md", + "LICENSE" + ], + "devDependencies": { + "tslib": "^2.4.1" + }, + "dependencies": { + "@tauri-apps/api": "^1.2.0" + } +} diff --git a/shared/template/guest-js/rollup.config.mjs b/shared/template/guest-js/rollup.config.mjs new file mode 100644 index 00000000..ee885522 --- /dev/null +++ b/shared/template/guest-js/rollup.config.mjs @@ -0,0 +1,10 @@ +import { readFileSync } from "fs"; + +import { createConfig } from "../../../shared/rollup.config.mjs"; + +export default createConfig({ + pkg: JSON.parse( + readFileSync(new URL("./package.json", import.meta.url), "utf8") + ), + external: [/^@tauri-apps\/api/], +}); diff --git a/shared/template/guest-js/tsconfig.json b/shared/template/guest-js/tsconfig.json new file mode 120000 index 00000000..9c2b2da2 --- /dev/null +++ b/shared/template/guest-js/tsconfig.json @@ -0,0 +1 @@ +../../../shared/tsconfig.json \ No newline at end of file diff --git a/shared/template/src/lib.rs b/shared/template/src/lib.rs new file mode 100644 index 00000000..e69de29b diff --git a/shared/tsconfig.json b/shared/tsconfig.json new file mode 100644 index 00000000..7911d822 --- /dev/null +++ b/shared/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../../tsconfig.base.json", + "include": ["*.ts", "types/**/*"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..30864e46 --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "lib": ["ES2019", "ES2020.Promise", "ES2020.String", "DOM"], + "module": "ESNext", + "moduleResolution": "node", + "noEmit": true, + "noEmitOnError": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "pretty": true, + "sourceMap": true, + "strict": true, + "target": "ES2019" + }, + "exclude": ["dist", "node_modules", "test/types"] +}