Compare commits

..

11 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
21 changed files with 102 additions and 34 deletions
+22 -1
View File
@@ -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.
+1
View File
@@ -0,0 +1 @@
auto-install-peers=true
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## \[2.0.0-alpha.1]
### Dependencies
- Updated to latest `notification`
## \[2.0.0-alpha.0]
### Dependencies
+1 -1
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"
+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"
}
}
+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);
* });
+10 -6
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)
@@ -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