Compare commits

..

13 Commits

Author SHA1 Message Date
github-actions[bot] 91ffc01a91 Publish New Versions (v2) (#402)
Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
2023-06-06 09:31:55 -03:00
Lucas Nogueira 0413ed3ce6 Merge remote-tracking branch 'origin/v1' into v2 2023-06-06 09:24:49 -03:00
Lucas Fernandes Nogueira b3d7d11ae3 fix(stronghold): remove constructor, add static load function (#416) 2023-06-06 08:50:05 -03:00
Fabian-Lars d8b4aca69f fix(notification): Fix init.js script for use without global tauri object. (#414) 2023-06-04 13:36:49 +02:00
renovate[bot] 29bf8a2ab4 chore(deps): update dependency eslint-config-standard-with-typescript to v35 (#412)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-02 13:48:49 +02:00
Fabian-Lars 393667b547 chore: update pnpm version to 7.33 (#413)
* chore: update pnpm version to 7.33

* fmt
2023-06-02 13:30:44 +02:00
Lucas Fernandes Nogueira cf5864266e chore(window): fix package name on documentation (#408) 2023-05-27 09:20:09 -03:00
Lucas Fernandes Nogueira 0f480d0985 fix(tests): backport updater test fix from tauri (#404) 2023-05-27 04:39:54 -07:00
Ngo Iok Ui (Wu Yu Wei) a7cba0dac7 Merge pull request #401 from tauri-apps/feat/notification-sound
feat(notification): play default sound on Windows
2023-05-25 11:01:16 +08:00
Lucas Nogueira 7906397c64 fix(ci): enable sqlite feature when publishing the sql plugin 2023-05-24 18:14:54 -03:00
Lucas Nogueira 7d71ad4e58 feat(notification): play default sound on WIndows
Ref https://github.com/tauri-apps/tauri/pull/6680
2023-05-24 16:03:50 -03:00
Lucas Nogueira 94b3747a9c fix(covector): move fs up in the packages tree 2023-05-24 12:14:24 -03:00
Lucas Fernandes Nogueira b259baa17e refactor: rename clipboard plugin to clipboard-manager (#400) 2023-05-24 12:06:07 -03:00
63 changed files with 155 additions and 87 deletions
+35 -14
View File
@@ -112,12 +112,21 @@
"manager": "javascript"
},
"clipboard": {
"path": "./plugins/clipboard",
"clipboard-manager": {
"path": "./plugins/clipboard-manager",
"manager": "rust"
},
"clipboard-js": {
"path": "./plugins/clipboard",
"clipboard-manager-js": {
"path": "./plugins/clipboard-manager",
"manager": "javascript"
},
"fs": {
"path": "./plugins/fs",
"manager": "rust"
},
"fs-js": {
"path": "./plugins/fs",
"manager": "javascript"
},
@@ -131,15 +140,6 @@
"manager": "javascript"
},
"fs": {
"path": "./plugins/fs",
"manager": "rust"
},
"fs-js": {
"path": "./plugins/fs",
"manager": "javascript"
},
"global-shortcut": {
"path": "./plugins/global-shortcut",
"manager": "rust"
@@ -231,7 +231,28 @@
"sql": {
"path": "./plugins/sql",
"manager": "rust"
"manager": "rust",
"publish": [
{
"command": "cargo package --no-verify",
"dryRunCommand": true
},
{
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "cargo publish --features sqlite",
"dryRunCommand": "cargo publish --features sqlite --dry-run",
"pipe": true
},
{
"command": "echo '```\n\n</details>\n'",
"dryRunCommand": true,
"pipe": true
}
]
},
"sql-js": {
"path": "./plugins/sql",
+5
View File
@@ -0,0 +1,5 @@
---
"notification": patch
---
Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled.
+5
View File
@@ -0,0 +1,5 @@
---
"notification": patch
---
Play a default sound when showing a notification on Windows.
+6 -1
View File
@@ -1,4 +1,9 @@
{
"tag": "alpha",
"changes": [".changes/persisted-scope-fix-oom.md", ".changes/v2-alpha.md"]
"changes": [
".changes/notification-init-script.md",
".changes/notification-sound.md",
".changes/stronghold-constructor.md",
".changes/v2-alpha.md"
]
}
+5
View File
@@ -0,0 +1,5 @@
---
"stronghold-js": minor
---
Added `Stronghold.load` and removed its constructor.
+2 -2
View File
@@ -7,8 +7,8 @@
"autostart-js": major
"cli": major
"cli-js": major
"clipboard": major
"clipboard-js": major
"clipboard-manager": major
"clipboard-manager-js": major
"dialog": major
"dialog-js": major
"fs": major
+3 -3
View File
@@ -41,10 +41,10 @@ jobs:
- .github/workflows/check-generated-files.yml
- plugins/cli/guest-js/**
- plugins/cli/src/api-iife.js
clipboard:
clipboard-manager:
- .github/workflows/check-generated-files.yml
- plugins/clipboard/guest-js/**
- plugins/clipboard/src/api-iife.js
- plugins/clipboard-manager/guest-js/**
- plugins/clipboard-manager/src/api-iife.js
dialog:
- .github/workflows/check-generated-files.yml
- plugins/dialog/guest-js/**
+2 -2
View File
@@ -53,9 +53,9 @@ jobs:
tauri-plugin-cli:
- .github/workflows/lint-rust.yml
- plugins/cli/**
tauri-plugin-clipboard:
tauri-plugin-clipboard-manager:
- .github/workflows/lint-rust.yml
- plugins/clipboard/**
- plugins/clipboard-manager/**
tauri-plugin-dialog:
- .github/workflows/lint-rust.yml
- plugins/dialog/**
+2 -2
View File
@@ -55,9 +55,9 @@ jobs:
tauri-plugin-cli:
- .github/workflows/test-rust.yml
- plugins/cli/**
tauri-plugin-clipboard:
tauri-plugin-clipboard-manager:
- .github/workflows/test-rust.yml
- plugins/clipboard/**
- plugins/clipboard-manager/**
tauri-plugin-dialog:
- .github/workflows/test-rust.yml
- plugins/dialog/**
+1
View File
@@ -0,0 +1 @@
auto-install-peers=true
Generated
+2 -2
View File
@@ -215,7 +215,7 @@ dependencies = [
"tauri-build",
"tauri-plugin-app",
"tauri-plugin-cli",
"tauri-plugin-clipboard",
"tauri-plugin-clipboard-manager",
"tauri-plugin-dialog",
"tauri-plugin-fs",
"tauri-plugin-global-shortcut",
@@ -5158,7 +5158,7 @@ dependencies = [
]
[[package]]
name = "tauri-plugin-clipboard"
name = "tauri-plugin-clipboard-manager"
version = "2.0.0-alpha.0"
dependencies = [
"arboard",
+1 -1
View File
@@ -13,7 +13,7 @@
"@zerodevx/svelte-json-view": "0.2.1",
"@tauri-apps/plugin-app": "2.0.0-alpha.0",
"@tauri-apps/plugin-cli": "2.0.0-alpha.0",
"@tauri-apps/plugin-clipboard": "2.0.0-alpha.0",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-alpha.0",
"@tauri-apps/plugin-dialog": "2.0.0-alpha.0",
"@tauri-apps/plugin-fs": "2.0.0-alpha.0",
"@tauri-apps/plugin-global-shortcut": "2.0.0-alpha.0",
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## \[2.0.0-alpha.1]
### Dependencies
- Updated to latest `notification`
## \[2.0.0-alpha.0]
### Dependencies
+2 -2
View File
@@ -1,7 +1,7 @@
[package]
name = "api"
publish = false
version = "2.0.0-alpha.0"
version = "2.0.0-alpha.1"
description = "An example Tauri Application showcasing the api"
edition = "2021"
rust-version = "1.65"
@@ -21,7 +21,7 @@ log = { workspace = true }
tauri-plugin-app = { path = "../../../plugins/app", version = "2.0.0-alpha.0" }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-alpha.0" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-alpha.0" }
tauri-plugin-clipboard = { path = "../../../plugins/clipboard", version = "2.0.0-alpha.0" }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-alpha.0" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-alpha.0" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-alpha.0" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-alpha.0", features = [ "windows7-compat" ] }
+1 -1
View File
@@ -33,7 +33,7 @@ pub fn run() {
)
.plugin(tauri_plugin_app::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_clipboard::init())
.plugin(tauri_plugin_clipboard_manager::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_http::init())
.plugin(tauri_plugin_notification::init())
+1 -1
View File
@@ -1,5 +1,5 @@
<script>
import { writeText, readText } from "@tauri-apps/plugin-clipboard";
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager";
export let onMessage;
let text = "clipboard message";
+2 -2
View File
@@ -18,7 +18,7 @@
"covector": "^0.9.0",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-standard-with-typescript": "^34.0.1",
"eslint-config-standard-with-typescript": "^35.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
@@ -28,6 +28,6 @@
"typescript": "^5.0.4"
},
"engines": {
"pnpm": ">=7.24.2"
"pnpm": ">=7.33.0"
}
}
@@ -1,11 +1,11 @@
[package]
name = "tauri-plugin-clipboard"
name = "tauri-plugin-clipboard-manager"
version = "2.0.0-alpha.0"
description = "Read and write to the system clipboard."
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }
links = "tauri-plugin-clipboard"
links = "tauri-plugin-clipboard-manager"
[build-dependencies]
tauri-build = { workspace = true }
@@ -1,4 +1,4 @@
# Clipboard
# Clipboard Manager
Read and write to the system clipboard.
@@ -18,9 +18,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file:
```toml
[dependencies]
tauri-plugin-clipboard = "2.0.0-alpha"
tauri-plugin-clipboard-manager = "2.0.0-alpha"
# alternatively with Git:
tauri-plugin-clipboard = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
tauri-plugin-clipboard-manager = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
```
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
@@ -28,18 +28,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa
> Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.
```sh
pnpm add @tauri-apps/plugin-clipboard
pnpm add @tauri-apps/plugin-clipboard-manager
# or
npm add @tauri-apps/plugin-clipboard
npm add @tauri-apps/plugin-clipboard-manager
# or
yarn add @tauri-apps/plugin-clipboard
yarn add @tauri-apps/plugin-clipboard-manager
# alternatively with Git:
pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard#v2
pnpm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
# or
npm add https://github.com/tauri-apps/tauri-plugin-clipboard#v2
npm add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
# or
yarn add https://github.com/tauri-apps/tauri-plugin-clipboard#v2
yarn add https://github.com/tauri-apps/tauri-plugin-clipboard-manager#v2
```
## Usage
@@ -51,7 +51,7 @@ First you need to register the core plugin with Tauri:
```rust
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_clipboard::init())
.plugin(tauri_plugin_clipboard_manager::init())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
@@ -60,7 +60,7 @@ fn main() {
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
```javascript
import { writeText, readText } from "@tauri-apps/plugin-clipboard";
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager";
await writeText("Tauri is awesome!");
assert(await readText(), "Tauri is awesome!");
```
@@ -25,7 +25,7 @@ type ClipResponse = Clip<"PlainText", string>;
* Writes plain text to the clipboard.
* @example
* ```typescript
* import { writeText, readText } from '@tauri-apps/plugin-clipboard';
* import { writeText, readText } from '@tauri-apps/plugin-clipboard-manager';
* await writeText('Tauri is awesome!');
* assert(await readText(), 'Tauri is awesome!');
* ```
@@ -53,7 +53,7 @@ async function writeText(
* Gets the clipboard content as plain text.
* @example
* ```typescript
* import { readText } from '@tauri-apps/plugin-clipboard';
* import { readText } from '@tauri-apps/plugin-clipboard-manager';
* const clipboardText = await readText();
* ```
* @since 2.0.0
@@ -6,16 +6,16 @@
import PackageDescription
let package = Package(
name: "tauri-plugin-clipboard",
name: "tauri-plugin-clipboard-manager",
platforms: [
.iOS(.v13),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "tauri-plugin-clipboard",
name: "tauri-plugin-clipboard-manager",
type: .static,
targets: ["tauri-plugin-clipboard"]),
targets: ["tauri-plugin-clipboard-manager"]),
],
dependencies: [
.package(name: "Tauri", path: "../.tauri/tauri-api")
@@ -24,7 +24,7 @@ let package = Package(
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "tauri-plugin-clipboard",
name: "tauri-plugin-clipboard-manager",
dependencies: [
.byName(name: "Tauri")
],
@@ -1,5 +1,5 @@
{
"name": "@tauri-apps/plugin-clipboard",
"name": "@tauri-apps/plugin-clipboard-manager",
"version": "2.0.0-alpha.0",
"license": "MIT or APACHE-2.0",
"authors": [
@@ -0,0 +1 @@
if("__TAURI__"in window){var __TAURI_CLIPBOARDMANAGER__=function(_){"use strict";return _.readText=async function(){return(await window.__TAURI_INVOKE__("plugin:clipboard|read")).options},_.writeText=async function(_,n){return window.__TAURI_INVOKE__("plugin:clipboard|write",{data:{kind:"PlainText",options:{label:null==n?void 0:n.label,text:_}}})},_}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_CLIPBOARDMANAGER__})}
-1
View File
@@ -1 +0,0 @@
if("__TAURI__"in window){var __TAURI_CLIPBOARD__=function(_){"use strict";return _.readText=async function(){return(await window.__TAURI_INVOKE__("plugin:clipboard|read")).options},_.writeText=async function(_,i){return window.__TAURI_INVOKE__("plugin:clipboard|write",{data:{kind:"PlainText",options:{label:null==i?void 0:i.label,text:_}}})},_}({});Object.defineProperty(window.__TAURI__,"clipboard",{value:__TAURI_CLIPBOARD__})}
+1 -1
View File
@@ -2,7 +2,7 @@ app
authenticator
autostart
cli
clipboard
clipboard-manager
dialog
fs
global-shortcut
+5
View File
@@ -1,5 +1,10 @@
# Changelog
## \[2.0.0-alpha.1]
- [`d8b4aca`](https://github.com/tauri-apps/plugins-workspace/commit/d8b4aca69f628b170804ecb982e2c319d026ef47)([#414](https://github.com/tauri-apps/plugins-workspace/pull/414)) Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled.
- [`7d71ad4`](https://github.com/tauri-apps/plugins-workspace/commit/7d71ad4e587bcf47ea34645f5b226945e487b765) Play a default sound when showing a notification on Windows.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin-notification"
version = "2.0.0-alpha.0"
version = "2.0.0-alpha.1"
description = "Send desktop and mobile notifications on your Tauri application."
edition = { workspace = true }
authors = { workspace = true }
+3
View File
@@ -184,6 +184,9 @@ mod imp {
{
notification.app_id(&self.identifier);
}
// will be parsed as a `::winrt_notification::Sound`
notification.sound_name("Default");
}
#[cfg(target_os = "macos")]
{
+2 -2
View File
@@ -10,7 +10,7 @@
if (window.Notification.permission !== "default") {
return Promise.resolve(window.Notification.permission === "granted");
}
return window.__TAURI__.invoke("plugin:notification|is_permission_granted");
return window.__TAURI_INVOKE__("plugin:notification|is_permission_granted");
}
function setNotificationPermission(value) {
@@ -34,7 +34,7 @@
Object.freeze(options);
}
return window.__TAURI__.invoke("plugin:notification|notify", {
return window.__TAURI_INVOKE__("plugin:notification|notify", {
options:
typeof options === "string"
? {
+3
View File
@@ -7,6 +7,9 @@ license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
[package.metadata.docs.rs]
features = [ "sqlite" ]
[dependencies]
serde = { workspace = true }
serde_json = { workspace = true }
+4
View File
@@ -1,5 +1,9 @@
# Changelog
## \[2.0.0-alpha.1]
- [`b3d7d11`](https://github.com/tauri-apps/plugins-workspace/commit/b3d7d11ae32e0970184f53be26e2c5530f78cdf0)([#416](https://github.com/tauri-apps/plugins-workspace/pull/416)) Added `Stronghold.load` and removed its constructor.
## \[2.0.0-alpha.0]
- [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
+5 -6
View File
@@ -426,21 +426,20 @@ export class Stronghold {
* @param path
* @param password
*/
constructor(path: string, password: string) {
private constructor(path: string) {
this.path = path;
void this.reload(password);
}
/**
* Force a reload of the snapshot. The password must match.
* Load the snapshot if it exists (password must match), or start a fresh stronghold instance otherwise.
* @param password
* @returns
*/
private async reload(password: string): Promise<void> {
static async load(path: string, password: string): Promise<Stronghold> {
return await window.__TAURI_INVOKE__("plugin:stronghold|initialize", {
snapshotPath: this.path,
snapshotPath: path,
password,
});
}).then(() => new Stronghold(path));
}
/**
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tauri-apps/plugin-stronghold",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"description": "Store secrets and keys using the IOTA Stronghold encrypted database.",
"license": "MIT or APACHE-2.0",
"authors": [
+1 -1
View File
@@ -1 +1 @@
if("__TAURI__"in window){var __TAURI_STRONGHOLD__=function(t){"use strict";function e(t){return"string"==typeof t?t:Array.from(t instanceof ArrayBuffer?new Uint8Array(t):t)}class r{constructor(t,e){this.type=t,this.payload=e}static generic(t,n){return new r("Generic",{vault:e(t),record:e(n)})}static counter(t,n){return new r("Counter",{vault:e(t),counter:n})}}class n{constructor(t){this.procedureArgs=t}async generateSLIP10Seed(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Generate",payload:{output:t,sizeBytes:e}}}).then((t=>Uint8Array.from(t)))}async deriveSLIP10(t,e,r,n){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Derive",payload:{chain:t,input:{type:e,payload:r},output:n}}}).then((t=>Uint8Array.from(t)))}async recoverBIP39(t,e,r){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Recover",payload:{mnemonic:t,passphrase:r,output:e}}}).then((t=>Uint8Array.from(t)))}async generateBIP39(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Generate",payload:{output:t,passphrase:e}}}).then((t=>Uint8Array.from(t)))}async getEd25519PublicKey(t){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"PublicKey",payload:{type:"Ed25519",privateKey:t}}}).then((t=>Uint8Array.from(t)))}async signEd25519(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"Ed25519Sign",payload:{privateKey:t,msg:e}}}).then((t=>Uint8Array.from(t)))}}class a{constructor(t,r){this.path=t,this.name=e(r)}getVault(t){return new s(this.path,this.name,e(t))}getStore(){return new i(this.path,this.name)}}class i{constructor(t,e){this.path=t,this.client=e}async get(t){return await window.__TAURI_INVOKE__("plugin:stronghold|get_store_record",{snapshotPath:this.path,client:this.client,key:e(t)}).then((t=>Uint8Array.from(t)))}async insert(t,r,n){return await window.__TAURI_INVOKE__("plugin:stronghold|save_store_record",{snapshotPath:this.path,client:this.client,key:e(t),value:r,lifetime:n})}async remove(t){return await window.__TAURI_INVOKE__("plugin:stronghold|remove_store_record",{snapshotPath:this.path,client:this.client,key:e(t)}).then((t=>null!=t?Uint8Array.from(t):null))}}class s extends n{constructor(t,r,n){super({snapshotPath:t,client:r,vault:n}),this.path=t,this.client=e(r),this.name=e(n)}async insert(t,r){return await window.__TAURI_INVOKE__("plugin:stronghold|save_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:e(t),secret:r})}async remove(t){return await window.__TAURI_INVOKE__("plugin:stronghold|remove_secret",{snapshotPath:this.path,client:this.client,vault:this.name,location:t})}}return t.Client=a,t.Location=r,t.Store=i,t.Stronghold=class{constructor(t,e){this.path=t,this.reload(e)}async reload(t){return await window.__TAURI_INVOKE__("plugin:stronghold|initialize",{snapshotPath:this.path,password:t})}async unload(){return await window.__TAURI_INVOKE__("plugin:stronghold|destroy",{snapshotPath:this.path})}async loadClient(t){return await window.__TAURI_INVOKE__("plugin:stronghold|load_client",{snapshotPath:this.path,client:e(t)}).then((()=>new a(this.path,t)))}async createClient(t){return await window.__TAURI_INVOKE__("plugin:stronghold|create_client",{snapshotPath:this.path,client:e(t)}).then((()=>new a(this.path,t)))}async save(){return await window.__TAURI_INVOKE__("plugin:stronghold|save",{snapshotPath:this.path})}},t.Vault=s,t}({});Object.defineProperty(window.__TAURI__,"stronghold",{value:__TAURI_STRONGHOLD__})}
if("__TAURI__"in window){var __TAURI_STRONGHOLD__=function(t){"use strict";function e(t){return"string"==typeof t?t:Array.from(t instanceof ArrayBuffer?new Uint8Array(t):t)}class r{constructor(t,e){this.type=t,this.payload=e}static generic(t,n){return new r("Generic",{vault:e(t),record:e(n)})}static counter(t,n){return new r("Counter",{vault:e(t),counter:n})}}class n{constructor(t){this.procedureArgs=t}async generateSLIP10Seed(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Generate",payload:{output:t,sizeBytes:e}}}).then((t=>Uint8Array.from(t)))}async deriveSLIP10(t,e,r,n){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"SLIP10Derive",payload:{chain:t,input:{type:e,payload:r},output:n}}}).then((t=>Uint8Array.from(t)))}async recoverBIP39(t,e,r){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Recover",payload:{mnemonic:t,passphrase:r,output:e}}}).then((t=>Uint8Array.from(t)))}async generateBIP39(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"BIP39Generate",payload:{output:t,passphrase:e}}}).then((t=>Uint8Array.from(t)))}async getEd25519PublicKey(t){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"PublicKey",payload:{type:"Ed25519",privateKey:t}}}).then((t=>Uint8Array.from(t)))}async signEd25519(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|execute_procedure",{...this.procedureArgs,procedure:{type:"Ed25519Sign",payload:{privateKey:t,msg:e}}}).then((t=>Uint8Array.from(t)))}}class a{constructor(t,r){this.path=t,this.name=e(r)}getVault(t){return new s(this.path,this.name,e(t))}getStore(){return new i(this.path,this.name)}}class i{constructor(t,e){this.path=t,this.client=e}async get(t){return await window.__TAURI_INVOKE__("plugin:stronghold|get_store_record",{snapshotPath:this.path,client:this.client,key:e(t)}).then((t=>Uint8Array.from(t)))}async insert(t,r,n){return await window.__TAURI_INVOKE__("plugin:stronghold|save_store_record",{snapshotPath:this.path,client:this.client,key:e(t),value:r,lifetime:n})}async remove(t){return await window.__TAURI_INVOKE__("plugin:stronghold|remove_store_record",{snapshotPath:this.path,client:this.client,key:e(t)}).then((t=>null!=t?Uint8Array.from(t):null))}}class s extends n{constructor(t,r,n){super({snapshotPath:t,client:r,vault:n}),this.path=t,this.client=e(r),this.name=e(n)}async insert(t,r){return await window.__TAURI_INVOKE__("plugin:stronghold|save_secret",{snapshotPath:this.path,client:this.client,vault:this.name,recordPath:e(t),secret:r})}async remove(t){return await window.__TAURI_INVOKE__("plugin:stronghold|remove_secret",{snapshotPath:this.path,client:this.client,vault:this.name,location:t})}}class o{constructor(t){this.path=t}static async load(t,e){return await window.__TAURI_INVOKE__("plugin:stronghold|initialize",{snapshotPath:t,password:e}).then((()=>new o(t)))}async unload(){return await window.__TAURI_INVOKE__("plugin:stronghold|destroy",{snapshotPath:this.path})}async loadClient(t){return await window.__TAURI_INVOKE__("plugin:stronghold|load_client",{snapshotPath:this.path,client:e(t)}).then((()=>new a(this.path,t)))}async createClient(t){return await window.__TAURI_INVOKE__("plugin:stronghold|create_client",{snapshotPath:this.path,client:e(t)}).then((()=>new a(this.path,t)))}async save(){return await window.__TAURI_INVOKE__("plugin:stronghold|save",{snapshotPath:this.path})}}return t.Client=a,t.Location=r,t.Store=i,t.Stronghold=o,t.Vault=s,t}({});Object.defineProperty(window.__TAURI__,"stronghold",{value:__TAURI_STRONGHOLD__})}
@@ -34,9 +34,11 @@ fn main() {
tauri::async_runtime::spawn(async move {
match handle.updater().check().await {
Ok(update) => {
if let Err(e) = update.download_and_install(|_event| {}).await {
println!("{e}");
std::process::exit(1);
if update.is_update_available() {
if let Err(e) = update.download_and_install(|_event| {}).await {
println!("{e}");
std::process::exit(1);
}
}
std::process::exit(0);
}
+9 -9
View File
@@ -9,7 +9,7 @@
*
* Events can be listened to using `appWindow.listen`:
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* appWindow.listen("my-window-event", ({ event, payload }) => { });
* ```
*
@@ -1378,7 +1378,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onResized(({ payload: size }) => {
* console.log('Window resized', size);
* });
@@ -1404,7 +1404,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onMoved(({ payload: position }) => {
* console.log('Window moved', position);
* });
@@ -1430,7 +1430,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* import { confirm } from '@tauri-apps/api/dialog';
* const unlisten = await appWindow.onCloseRequested(async (event) => {
* const confirmed = await confirm('Are you sure?');
@@ -1469,7 +1469,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onFocusChanged(({ payload: focused }) => {
* console.log('Focus changed, window is focused? ' + focused);
* });
@@ -1511,7 +1511,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onScaleChanged(({ payload }) => {
* console.log('Scale changed', payload.scaleFactor, payload.size);
* });
@@ -1539,7 +1539,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onMenuClicked(({ payload: menuId }) => {
* console.log('Menu clicked: ' + menuId);
* });
@@ -1564,7 +1564,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onFileDropEvent((event) => {
* if (event.payload.type === 'hover') {
* console.log('User hovering', event.payload.paths);
@@ -1620,7 +1620,7 @@ class WindowManager extends WebviewWindowHandle {
*
* @example
* ```typescript
* import { appWindow } from "@tauri-apps/window";
* import { appWindow } from "@tauri-apps/plugin-window";
* const unlisten = await appWindow.onThemeChanged(({ payload: theme }) => {
* console.log('New theme: ' + theme);
* });
+13 -9
View File
@@ -1,4 +1,8 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
@@ -29,8 +33,8 @@ importers:
specifier: ^8.8.0
version: 8.8.0(eslint@8.39.0)
eslint-config-standard-with-typescript:
specifier: ^34.0.1
version: 34.0.1(@typescript-eslint/eslint-plugin@5.59.1)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.39.0)(typescript@5.0.4)
specifier: ^35.0.0
version: 35.0.0(@typescript-eslint/eslint-plugin@5.58.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)(typescript@5.0.4)
eslint-plugin-import:
specifier: ^2.27.5
version: 2.27.5(@typescript-eslint/parser@5.59.1)(eslint@8.39.0)
@@ -64,9 +68,9 @@ importers:
'@tauri-apps/plugin-cli':
specifier: 2.0.0-alpha.0
version: link:../../plugins/cli
'@tauri-apps/plugin-clipboard':
'@tauri-apps/plugin-clipboard-manager':
specifier: 2.0.0-alpha.0
version: link:../../plugins/clipboard
version: link:../../plugins/clipboard-manager
'@tauri-apps/plugin-dialog':
specifier: 2.0.0-alpha.0
version: link:../../plugins/dialog
@@ -166,7 +170,7 @@ importers:
specifier: ^2.4.1
version: 2.4.1
plugins/clipboard:
plugins/clipboard-manager:
dependencies:
'@tauri-apps/api':
specifier: 2.0.0-alpha.4
@@ -2221,10 +2225,10 @@ packages:
eslint: 8.39.0
dev: true
/eslint-config-standard-with-typescript@34.0.1(@typescript-eslint/eslint-plugin@5.59.1)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.39.0)(typescript@5.0.4):
resolution: {integrity: sha512-J7WvZeLtd0Vr9F+v4dZbqJCLD16cbIy4U+alJMq4MiXdpipdBM3U5NkXaGUjePc4sb1ZE01U9g6VuTBpHHz1fg==}
/eslint-config-standard-with-typescript@35.0.0(@typescript-eslint/eslint-plugin@5.58.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.0)(eslint-plugin-promise@6.1.1)(eslint@8.38.0)(typescript@5.0.4):
resolution: {integrity: sha512-Xa7DY9GgduZyp0qmXxBF0/dB+Vm4/DgWu1lGpNLJV2d46aCaUxTKDEnkzjUWX/1O9S0a+Dhnw7A4oI0JpYzwtw==}
peerDependencies:
'@typescript-eslint/eslint-plugin': ^5.43.0
'@typescript-eslint/eslint-plugin': ^5.50.0
eslint: ^8.0.1
eslint-plugin-import: ^2.25.2
eslint-plugin-n: ^15.0.0