pull/1147/head
Tahmin Ahmed 1 year ago
commit ef3aba5447

@ -0,0 +1,6 @@
---
"clipboard-manager": "minor"
"clipboard-manager-js": "minor"
---
Add support for `read_image` and `write_image` to the clipboard plugin (desktop).

@ -0,0 +1,5 @@
---
"clipboard-manager": patch
---
The `write` and `read` commands are now called `write_text` and `read_text` so the permission name was changed.

@ -0,0 +1,5 @@
---
dialog: patch
---
Fixed an issue where the dialog apis panicked when they were called with no application windows open.

@ -0,0 +1,5 @@
---
"dialog": "patch"
---
Fixed an issue where dialogs on android would return the Content URI instead of the file path

@ -0,0 +1,5 @@
---
"fs": patch
---
Enhance the scope type to also allow a plain string representing the path to allow or deny.

@ -0,0 +1,5 @@
---
"autostart": patch
---
Fix LaunchAgent-based autostart for macOS.

@ -0,0 +1,5 @@
---
"fs": patch
---
Fixes `watch` and `watchImmediate` which previously ignored the `baseDir` parameter.

@ -0,0 +1,5 @@
---
"http": patch
---
Fixes scope not allowing subpaths, query parameters and hash when those values are empty.

@ -0,0 +1,5 @@
---
"updater": patch
---
Add a `on_before_exit` hook for cleanup before spawning the updater on Windows, defaults to `app.cleanup_before_exit` when used through `UpdaterExt`

@ -0,0 +1,5 @@
---
"updater": patch
---
Fix deserialization of `windows > installerArgs` config field.

@ -0,0 +1,5 @@
---
"updater": patch
---
On Windows, fallback to `passive` install mode when not defined in config.

@ -0,0 +1,5 @@
---
"updater": patch
---
Fix Windows powershell window flashing on update

@ -0,0 +1,32 @@
---
"authenticator": patch
"autostart": patch
"barcode-scanner": patch
"biometric": patch
"cli": patch
"clipboard-manager": patch
"deep-link": patch
"dialog": patch
"fs": patch
"global-shortcut": patch
"http": patch
"localhost": patch
"log-plugin": patch
"nfc": patch
"notification": patch
"os": patch
"persisted-scope": patch
"positioner": patch
"process": patch
"shell": patch
"single-instance": patch
"sql": patch
"store": patch
"stronghold": patch
"updater": patch
"upload": patch
"websocket": patch
"window-state": patch
---
The global API script is now only added to the binary when the `withGlobalTauri` config is true.

@ -0,0 +1,9 @@
---
"global-shortcut": "patch"
---
**Breaking change** Refactored the plugin Rust APIs for better DX and flexibility:
- Changed `Builder::with_handler` to be a method instead of a static method, it will also be triggered for any and all shortcuts even if the shortcut is registered through JS.
- Added `Builder::with_shortcut` and `Builder::with_shortcuts` to register shortcuts on the plugin builder.
- Added `on_shortcut` and `on_all_shortcuts` to register shortcuts with a handler.

@ -0,0 +1,5 @@
---
"http": patch
---
Add `unsafe-headers` cargo feature flag to allow using [forbidden headers](https://fetch.spec.whatwg.org/#terminology-headers).

@ -0,0 +1,5 @@
---
"notification": patch
---
Fix development mode check to set the app ID on macOS.

@ -3,14 +3,28 @@
"changes": [ "changes": [
".changes/beta.md", ".changes/beta.md",
".changes/clipboard-html.md", ".changes/clipboard-html.md",
".changes/clipboard-manager-image.md",
".changes/clipboard-text-command-rename.md",
".changes/dialog-can-create-directories.md", ".changes/dialog-can-create-directories.md",
".changes/dialog-linux-freeze.md", ".changes/dialog-linux-freeze.md",
".changes/dialog-main-thread.md",
".changes/enhance-http-scope.md", ".changes/enhance-http-scope.md",
".changes/file-autogen-fix.md", ".changes/file-autogen-fix.md",
".changes/fix-fs-watcher-basedir.md",
".changes/fix-http-scope-url-match.md",
".changes/fix-shutdown-timing.md", ".changes/fix-shutdown-timing.md",
".changes/fix-updater-installer-args-deserialization.md",
".changes/fix-updater-installmode.md",
".changes/fix-updater-powershell-flashing.md",
".changes/fix-zbus-import.md", ".changes/fix-zbus-import.md",
".changes/global-api-script-refactor.md",
".changes/global-shortcut-refactor.md",
".changes/http-unsafe-headers.md",
".changes/http-user-agent.md", ".changes/http-user-agent.md",
".changes/msrv-1.75.md", ".changes/msrv-1.75.md",
".changes/notification-fix-dev-check.md",
".changes/public-with-store.md",
".changes/shell-fix-schema-command-property-name.md",
".changes/shell-shellexcute.md", ".changes/shell-shellexcute.md",
".changes/tauri-beta-4.md", ".changes/tauri-beta-4.md",
".changes/tauri-beta-8.md", ".changes/tauri-beta-8.md",

@ -0,0 +1,5 @@
---
'store': patch
---
Fix `with_store` and `StoreCollection` changed to private in #1011

@ -0,0 +1,5 @@
---
"shell": "patch"
---
Change shell's schema property name `command` to `cmd`.

@ -46,10 +46,17 @@ jobs:
git config --global user.name "${{ github.event.pusher.name }}" git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}" git config --global user.email "${{ github.event.pusher.email }}"
- name: Setup target dir on /mnt
run: |
sudo mkdir /mnt/target
WORKSPACE_OWNER="$(stat -c '%U:%G' "${GITHUB_WORKSPACE}")"
sudo chown -R "${WORKSPACE_OWNER}" /mnt/target
- name: covector version or publish (publish when no change files present) - name: covector version or publish (publish when no change files present)
uses: jbolda/covector/packages/action@covector-v0 uses: jbolda/covector/packages/action@covector-v0
id: covector id: covector
env: env:
CARGO_TARGET_DIR: /mnt/target
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@ -64,5 +71,5 @@ jobs:
title: "Publish New Versions (v2)" title: "Publish New Versions (v2)"
commit-message: "publish new versions" commit-message: "publish new versions"
labels: "version updates" labels: "version updates"
branch: "release-v2" branch: "ci/release-v2"
body: ${{ steps.covector.outputs.change }} body: ${{ steps.covector.outputs.change }}

@ -42,6 +42,7 @@ jobs:
- uses: dorny/paths-filter@v2 - uses: dorny/paths-filter@v2
id: filter id: filter
with: with:
base: v2
filters: | filters: |
tauri-plugin-authenticator: tauri-plugin-authenticator:
- .github/workflows/test-rust.yml - .github/workflows/test-rust.yml

666
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -10,9 +10,9 @@ resolver = "2"
[workspace.dependencies] [workspace.dependencies]
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
log = "0.4" log = "0.4"
tauri = "2.0.0-beta.9" tauri = "2.0.0-beta.12"
tauri-build = "2.0.0-beta.7" tauri-build = "2.0.0-beta.10"
tauri-plugin = "2.0.0-beta.7" tauri-plugin = "2.0.0-beta.10"
serde_json = "1" serde_json = "1"
thiserror = "1" thiserror = "1"
url = "2" url = "2"

@ -1,5 +1,11 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
### Dependencies
- Upgraded to `clipboard-manager-js@2.1.0-beta.0`
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
{ {
"name": "svelte-app", "name": "svelte-app",
"private": true, "private": true,
"version": "2.0.0-beta.2", "version": "2.0.0-beta.3",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite --clearScreen false", "dev": "vite --clearScreen false",
@ -9,11 +9,11 @@
"serve": "vite preview" "serve": "vite preview"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4", "@tauri-apps/api": "2.0.0-beta.6",
"@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.2", "@tauri-apps/plugin-barcode-scanner": "2.0.0-beta.2",
"@tauri-apps/plugin-biometric": "2.0.0-beta.2", "@tauri-apps/plugin-biometric": "2.0.0-beta.2",
"@tauri-apps/plugin-cli": "2.0.0-beta.2", "@tauri-apps/plugin-cli": "2.0.0-beta.2",
"@tauri-apps/plugin-clipboard-manager": "2.0.0-beta.2", "@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.0",
"@tauri-apps/plugin-dialog": "2.0.0-beta.2", "@tauri-apps/plugin-dialog": "2.0.0-beta.2",
"@tauri-apps/plugin-fs": "2.0.0-beta.2", "@tauri-apps/plugin-fs": "2.0.0-beta.2",
"@tauri-apps/plugin-global-shortcut": "2.0.0-beta.2", "@tauri-apps/plugin-global-shortcut": "2.0.0-beta.2",
@ -30,7 +30,7 @@
"@iconify-json/codicon": "^1.1.37", "@iconify-json/codicon": "^1.1.37",
"@iconify-json/ph": "^1.1.8", "@iconify-json/ph": "^1.1.8",
"@sveltejs/vite-plugin-svelte": "^3.0.1", "@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tauri-apps/cli": "2.0.0-beta.7", "@tauri-apps/cli": "2.0.0-beta.9",
"@unocss/extractor-svelte": "^0.58.0", "@unocss/extractor-svelte": "^0.58.0",
"internal-ip": "^8.0.0", "internal-ip": "^8.0.0",
"svelte": "^4.2.8", "svelte": "^4.2.8",

@ -1,5 +1,25 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
### Dependencies
- Upgraded to `clipboard-manager@2.1.0-beta.0`
- Upgraded to `dialog@2.0.0-beta.3`
- Upgraded to `fs@2.0.0-beta.3`
- Upgraded to `http@2.0.0-beta.3`
- Upgraded to `updater@2.0.0-beta.3`
- Upgraded to `barcode-scanner@2.0.0-beta.3`
- Upgraded to `biometric@2.0.0-beta.3`
- Upgraded to `cli@2.0.0-beta.3`
- Upgraded to `global-shortcut@2.0.0-beta.3`
- Upgraded to `log-plugin@2.0.0-beta.3`
- Upgraded to `nfc@2.0.0-beta.3`
- Upgraded to `notification@2.0.0-beta.3`
- Upgraded to `os@2.0.0-beta.3`
- Upgraded to `process@2.0.0-beta.3`
- Upgraded to `shell@2.0.0-beta.3`
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
### Dependencies ### Dependencies

@ -1,7 +1,7 @@
[package] [package]
name = "api" name = "api"
publish = false publish = false
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "An example Tauri Application showcasing the api" description = "An example Tauri Application showcasing the api"
edition = "2021" edition = "2021"
rust-version = { workspace = true } rust-version = { workspace = true }
@ -19,15 +19,15 @@ serde_json = { workspace = true }
serde = { workspace = true } serde = { workspace = true }
tiny_http = "0.11" tiny_http = "0.11"
log = { workspace = true } log = { workspace = true }
tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.2" } tauri-plugin-log = { path = "../../../plugins/log", version = "2.0.0-beta.3" }
tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.2", features = [ "watch" ] } tauri-plugin-fs = { path = "../../../plugins/fs", version = "2.0.0-beta.3", features = [ "watch" ] }
tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.0.0-beta.2" } tauri-plugin-clipboard-manager = { path = "../../../plugins/clipboard-manager", version = "2.1.0-beta.0" }
tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.2" } tauri-plugin-dialog = { path = "../../../plugins/dialog", version = "2.0.0-beta.3" }
tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.2" } tauri-plugin-http = { path = "../../../plugins/http", features = [ "multipart" ], version = "2.0.0-beta.3" }
tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.2", features = [ "windows7-compat" ] } tauri-plugin-notification = { path = "../../../plugins/notification", version = "2.0.0-beta.3", features = [ "windows7-compat" ] }
tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.2" } tauri-plugin-os = { path = "../../../plugins/os", version = "2.0.0-beta.3" }
tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.2" } tauri-plugin-process = { path = "../../../plugins/process", version = "2.0.0-beta.3" }
tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.2" } tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.3" }
[dependencies.tauri] [dependencies.tauri]
workspace = true workspace = true
@ -41,14 +41,14 @@ tauri-plugin-shell = { path = "../../../plugins/shell", version = "2.0.0-beta.2"
] ]
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-beta.2" } tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-beta.3" }
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.2" } tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-beta.3" }
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.2" } tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-beta.3" }
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies] [target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.2" } tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-beta.3" }
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.2" } tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-beta.3" }
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.2" } tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-beta.3" }
[target."cfg(target_os = \"windows\")".dependencies] [target."cfg(target_os = \"windows\")".dependencies]
window-shadows = "0.2" window-shadows = "0.2"

@ -8,6 +8,7 @@
{ {
"identifier": "http:default", "identifier": "http:default",
"allow": [ "allow": [
"https://tauri.app",
{ {
"url": "http://localhost:3003" "url": "http://localhost:3003"
} }
@ -21,6 +22,7 @@
"tray:default", "tray:default",
"event:default", "event:default",
"window:default", "window:default",
"image:default",
"notification:default", "notification:default",
"os:allow-platform", "os:allow-platform",
"dialog:allow-open", "dialog:allow-open",
@ -54,8 +56,10 @@
}, },
"shell:allow-kill", "shell:allow-kill",
"shell:allow-stdin-write", "shell:allow-stdin-write",
"clipboard-manager:allow-read", "clipboard-manager:allow-read-text",
"clipboard-manager:allow-write", "clipboard-manager:allow-write-text",
"clipboard-manager:allow-read-image",
"clipboard-manager:allow-write-image",
"fs:allow-rename", "fs:allow-rename",
"fs:allow-mkdir", "fs:allow-mkdir",
"fs:allow-remove", "fs:allow-remove",
@ -69,11 +73,7 @@
"path": "$APPDATA/db/**" "path": "$APPDATA/db/**"
} }
], ],
"deny": [ "deny": ["$APPDATA/db/*.stronghold"]
{
"path": "$APPDATA/db/*.stronghold"
}
]
} }
] ]
} }

@ -41,8 +41,7 @@
"type": "object", "type": "object",
"required": [ "required": [
"identifier", "identifier",
"permissions", "permissions"
"windows"
], ],
"properties": { "properties": {
"identifier": { "identifier": {
@ -93,14 +92,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.", "description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
@ -115,7 +110,7 @@
], ],
"properties": { "properties": {
"urls": { "urls": {
"description": "Remote domains this capability refers to. Can use glob patterns.", "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
@ -189,7 +184,7 @@
] ]
}, },
{ {
"description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", "description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete `$APP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-app-write-recursive" "fs:allow-app-write-recursive"
@ -231,7 +226,7 @@
] ]
}, },
{ {
"description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", "description": "fs:allow-appcache-write-recursive -> This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appcache-write-recursive" "fs:allow-appcache-write-recursive"
@ -273,7 +268,7 @@
] ]
}, },
{ {
"description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", "description": "fs:allow-appconfig-write-recursive -> This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appconfig-write-recursive" "fs:allow-appconfig-write-recursive"
@ -315,7 +310,7 @@
] ]
}, },
{ {
"description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", "description": "fs:allow-appdata-write-recursive -> This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appdata-write-recursive" "fs:allow-appdata-write-recursive"
@ -357,7 +352,7 @@
] ]
}, },
{ {
"description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", "description": "fs:allow-applocaldata-write-recursive -> This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applocaldata-write-recursive" "fs:allow-applocaldata-write-recursive"
@ -399,7 +394,7 @@
] ]
}, },
{ {
"description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", "description": "fs:allow-applog-write-recursive -> This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applog-write-recursive" "fs:allow-applog-write-recursive"
@ -441,7 +436,7 @@
] ]
}, },
{ {
"description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", "description": "fs:allow-audio-write-recursive -> This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-audio-write-recursive" "fs:allow-audio-write-recursive"
@ -483,7 +478,7 @@
] ]
}, },
{ {
"description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", "description": "fs:allow-cache-write-recursive -> This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-cache-write-recursive" "fs:allow-cache-write-recursive"
@ -525,7 +520,7 @@
] ]
}, },
{ {
"description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", "description": "fs:allow-config-write-recursive -> This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-config-write-recursive" "fs:allow-config-write-recursive"
@ -567,7 +562,7 @@
] ]
}, },
{ {
"description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", "description": "fs:allow-data-write-recursive -> This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-data-write-recursive" "fs:allow-data-write-recursive"
@ -609,7 +604,7 @@
] ]
}, },
{ {
"description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", "description": "fs:allow-desktop-write-recursive -> This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-desktop-write-recursive" "fs:allow-desktop-write-recursive"
@ -651,7 +646,7 @@
] ]
}, },
{ {
"description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", "description": "fs:allow-document-write-recursive -> This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-document-write-recursive" "fs:allow-document-write-recursive"
@ -693,7 +688,7 @@
] ]
}, },
{ {
"description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", "description": "fs:allow-download-write-recursive -> This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-download-write-recursive" "fs:allow-download-write-recursive"
@ -735,7 +730,7 @@
] ]
}, },
{ {
"description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", "description": "fs:allow-exe-write-recursive -> This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-exe-write-recursive" "fs:allow-exe-write-recursive"
@ -777,7 +772,7 @@
] ]
}, },
{ {
"description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", "description": "fs:allow-font-write-recursive -> This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-font-write-recursive" "fs:allow-font-write-recursive"
@ -819,7 +814,7 @@
] ]
}, },
{ {
"description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", "description": "fs:allow-home-write-recursive -> This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-home-write-recursive" "fs:allow-home-write-recursive"
@ -861,7 +856,7 @@
] ]
}, },
{ {
"description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", "description": "fs:allow-localdata-write-recursive -> This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-localdata-write-recursive" "fs:allow-localdata-write-recursive"
@ -903,7 +898,7 @@
] ]
}, },
{ {
"description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", "description": "fs:allow-log-write-recursive -> This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-log-write-recursive" "fs:allow-log-write-recursive"
@ -945,7 +940,7 @@
] ]
}, },
{ {
"description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", "description": "fs:allow-picture-write-recursive -> This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-picture-write-recursive" "fs:allow-picture-write-recursive"
@ -987,7 +982,7 @@
] ]
}, },
{ {
"description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", "description": "fs:allow-public-write-recursive -> This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-public-write-recursive" "fs:allow-public-write-recursive"
@ -1029,7 +1024,7 @@
] ]
}, },
{ {
"description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", "description": "fs:allow-resource-write-recursive -> This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-resource-write-recursive" "fs:allow-resource-write-recursive"
@ -1071,7 +1066,7 @@
] ]
}, },
{ {
"description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", "description": "fs:allow-runtime-write-recursive -> This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-runtime-write-recursive" "fs:allow-runtime-write-recursive"
@ -1113,7 +1108,7 @@
] ]
}, },
{ {
"description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", "description": "fs:allow-temp-write-recursive -> This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-temp-write-recursive" "fs:allow-temp-write-recursive"
@ -1155,7 +1150,7 @@
] ]
}, },
{ {
"description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", "description": "fs:allow-template-write-recursive -> This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-template-write-recursive" "fs:allow-template-write-recursive"
@ -1197,7 +1192,7 @@
] ]
}, },
{ {
"description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", "description": "fs:allow-video-write-recursive -> This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-video-write-recursive" "fs:allow-video-write-recursive"
@ -2138,30 +2133,50 @@
}, },
"allow": { "allow": {
"items": { "items": {
"title": "Entry", "title": "FsScopeEntry",
"type": "object", "description": "FS scope entry.",
"required": [ "anyOf": [
"path" {
], "description": "FS scope path.",
"properties": {
"path": {
"type": "string" "type": "string"
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "FS scope path.",
"type": "string"
}
}
} }
} ]
} }
}, },
"deny": { "deny": {
"items": { "items": {
"title": "Entry", "title": "FsScopeEntry",
"type": "object", "description": "FS scope entry.",
"required": [ "anyOf": [
"path" {
], "description": "FS scope path.",
"properties": {
"path": {
"type": "string" "type": "string"
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "FS scope path.",
"type": "string"
}
}
} }
} ]
} }
} }
} }
@ -2241,8 +2256,8 @@
}, },
"allow": { "allow": {
"items": { "items": {
"title": "ScopeEntry", "title": "HttpScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry.",
"anyOf": [ "anyOf": [
{ {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
@ -2265,8 +2280,8 @@
}, },
"deny": { "deny": {
"items": { "items": {
"title": "ScopeEntry", "title": "HttpScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry.",
"anyOf": [ "anyOf": [
{ {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
@ -2297,6 +2312,12 @@
"properties": { "properties": {
"identifier": { "identifier": {
"oneOf": [ "oneOf": [
{
"type": "string",
"enum": [
"shell:default"
]
},
{ {
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
"type": "string", "type": "string",
@ -2362,7 +2383,7 @@
"type": "object", "type": "object",
"required": [ "required": [
"args", "args",
"command", "cmd",
"name", "name",
"sidecar" "sidecar"
], ],
@ -2375,7 +2396,7 @@
} }
] ]
}, },
"command": { "cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string" "type": "string"
}, },
@ -2397,7 +2418,7 @@
"type": "object", "type": "object",
"required": [ "required": [
"args", "args",
"command", "cmd",
"name", "name",
"sidecar" "sidecar"
], ],
@ -2410,7 +2431,7 @@
} }
] ]
}, },
"command": { "cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string" "type": "string"
}, },
@ -2532,31 +2553,99 @@
] ]
}, },
{ {
"description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:allow-read" "clipboard-manager:default"
] ]
}, },
{ {
"description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", "description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:allow-write" "clipboard-manager:allow-clear"
] ]
}, },
{ {
"description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", "description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:deny-read" "clipboard-manager:allow-read-image"
] ]
}, },
{ {
"description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", "description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:deny-write" "clipboard-manager:allow-read-text"
]
},
{
"description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-write-html"
]
},
{
"description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-write-image"
]
},
{
"description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-write-text"
]
},
{
"description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-clear"
]
},
{
"description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-read-image"
]
},
{
"description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-read-text"
]
},
{
"description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-write-html"
]
},
{
"description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-write-image"
]
},
{
"description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-write-text"
]
},
{
"type": "string",
"enum": [
"dialog:default"
] ]
}, },
{ {
@ -2728,7 +2817,7 @@
] ]
}, },
{ {
"description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", "description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete `$APP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-app-write-recursive" "fs:allow-app-write-recursive"
@ -2770,7 +2859,7 @@
] ]
}, },
{ {
"description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", "description": "fs:allow-appcache-write-recursive -> This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appcache-write-recursive" "fs:allow-appcache-write-recursive"
@ -2812,7 +2901,7 @@
] ]
}, },
{ {
"description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", "description": "fs:allow-appconfig-write-recursive -> This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appconfig-write-recursive" "fs:allow-appconfig-write-recursive"
@ -2854,7 +2943,7 @@
] ]
}, },
{ {
"description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", "description": "fs:allow-appdata-write-recursive -> This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appdata-write-recursive" "fs:allow-appdata-write-recursive"
@ -2896,7 +2985,7 @@
] ]
}, },
{ {
"description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", "description": "fs:allow-applocaldata-write-recursive -> This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applocaldata-write-recursive" "fs:allow-applocaldata-write-recursive"
@ -2938,7 +3027,7 @@
] ]
}, },
{ {
"description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", "description": "fs:allow-applog-write-recursive -> This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applog-write-recursive" "fs:allow-applog-write-recursive"
@ -2980,7 +3069,7 @@
] ]
}, },
{ {
"description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", "description": "fs:allow-audio-write-recursive -> This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-audio-write-recursive" "fs:allow-audio-write-recursive"
@ -3022,7 +3111,7 @@
] ]
}, },
{ {
"description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", "description": "fs:allow-cache-write-recursive -> This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-cache-write-recursive" "fs:allow-cache-write-recursive"
@ -3064,7 +3153,7 @@
] ]
}, },
{ {
"description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", "description": "fs:allow-config-write-recursive -> This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-config-write-recursive" "fs:allow-config-write-recursive"
@ -3106,7 +3195,7 @@
] ]
}, },
{ {
"description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", "description": "fs:allow-data-write-recursive -> This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-data-write-recursive" "fs:allow-data-write-recursive"
@ -3148,7 +3237,7 @@
] ]
}, },
{ {
"description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", "description": "fs:allow-desktop-write-recursive -> This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-desktop-write-recursive" "fs:allow-desktop-write-recursive"
@ -3190,7 +3279,7 @@
] ]
}, },
{ {
"description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", "description": "fs:allow-document-write-recursive -> This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-document-write-recursive" "fs:allow-document-write-recursive"
@ -3232,7 +3321,7 @@
] ]
}, },
{ {
"description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", "description": "fs:allow-download-write-recursive -> This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-download-write-recursive" "fs:allow-download-write-recursive"
@ -3274,7 +3363,7 @@
] ]
}, },
{ {
"description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", "description": "fs:allow-exe-write-recursive -> This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-exe-write-recursive" "fs:allow-exe-write-recursive"
@ -3316,7 +3405,7 @@
] ]
}, },
{ {
"description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", "description": "fs:allow-font-write-recursive -> This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-font-write-recursive" "fs:allow-font-write-recursive"
@ -3358,7 +3447,7 @@
] ]
}, },
{ {
"description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", "description": "fs:allow-home-write-recursive -> This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-home-write-recursive" "fs:allow-home-write-recursive"
@ -3400,7 +3489,7 @@
] ]
}, },
{ {
"description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", "description": "fs:allow-localdata-write-recursive -> This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-localdata-write-recursive" "fs:allow-localdata-write-recursive"
@ -3442,7 +3531,7 @@
] ]
}, },
{ {
"description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", "description": "fs:allow-log-write-recursive -> This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-log-write-recursive" "fs:allow-log-write-recursive"
@ -3484,7 +3573,7 @@
] ]
}, },
{ {
"description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", "description": "fs:allow-picture-write-recursive -> This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-picture-write-recursive" "fs:allow-picture-write-recursive"
@ -3526,7 +3615,7 @@
] ]
}, },
{ {
"description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", "description": "fs:allow-public-write-recursive -> This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-public-write-recursive" "fs:allow-public-write-recursive"
@ -3568,7 +3657,7 @@
] ]
}, },
{ {
"description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", "description": "fs:allow-resource-write-recursive -> This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-resource-write-recursive" "fs:allow-resource-write-recursive"
@ -3610,7 +3699,7 @@
] ]
}, },
{ {
"description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", "description": "fs:allow-runtime-write-recursive -> This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-runtime-write-recursive" "fs:allow-runtime-write-recursive"
@ -3652,7 +3741,7 @@
] ]
}, },
{ {
"description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", "description": "fs:allow-temp-write-recursive -> This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-temp-write-recursive" "fs:allow-temp-write-recursive"
@ -3694,7 +3783,7 @@
] ]
}, },
{ {
"description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", "description": "fs:allow-template-write-recursive -> This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-template-write-recursive" "fs:allow-template-write-recursive"
@ -3736,7 +3825,7 @@
] ]
}, },
{ {
"description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", "description": "fs:allow-video-write-recursive -> This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-video-write-recursive" "fs:allow-video-write-recursive"
@ -4680,6 +4769,12 @@
"fs:write-files" "fs:write-files"
] ]
}, },
{
"type": "string",
"enum": [
"global-shortcut:default"
]
},
{ {
"description": "global-shortcut:allow-is-registered -> Enables the is_registered command without any pre-configured scope.", "description": "global-shortcut:allow-is-registered -> Enables the is_registered command without any pre-configured scope.",
"type": "string", "type": "string",
@ -4827,13 +4922,6 @@
"image:allow-from-bytes" "image:allow-from-bytes"
] ]
}, },
{
"description": "image:allow-from-ico-bytes -> Enables the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-ico-bytes"
]
},
{ {
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.", "description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
"type": "string", "type": "string",
@ -4841,20 +4929,6 @@
"image:allow-from-path" "image:allow-from-path"
] ]
}, },
{
"description": "image:allow-from-png-bytes -> Enables the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-png-bytes"
]
},
{
"description": "image:allow-height -> Enables the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-height"
]
},
{ {
"description": "image:allow-new -> Enables the new command without any pre-configured scope.", "description": "image:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string", "type": "string",
@ -4870,10 +4944,10 @@
] ]
}, },
{ {
"description": "image:allow-width -> Enables the width command without any pre-configured scope.", "description": "image:allow-size -> Enables the size command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"image:allow-width" "image:allow-size"
] ]
}, },
{ {
@ -4883,13 +4957,6 @@
"image:deny-from-bytes" "image:deny-from-bytes"
] ]
}, },
{
"description": "image:deny-from-ico-bytes -> Denies the from_ico_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-ico-bytes"
]
},
{ {
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.", "description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
"type": "string", "type": "string",
@ -4897,20 +4964,6 @@
"image:deny-from-path" "image:deny-from-path"
] ]
}, },
{
"description": "image:deny-from-png-bytes -> Denies the from_png_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-png-bytes"
]
},
{
"description": "image:deny-height -> Denies the height command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-height"
]
},
{ {
"description": "image:deny-new -> Denies the new command without any pre-configured scope.", "description": "image:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string", "type": "string",
@ -4926,10 +4979,10 @@
] ]
}, },
{ {
"description": "image:deny-width -> Denies the width command without any pre-configured scope.", "description": "image:deny-size -> Denies the size command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"image:deny-width" "image:deny-size"
] ]
}, },
{ {
@ -5317,6 +5370,12 @@
"notification:deny-request-permission" "notification:deny-request-permission"
] ]
}, },
{
"type": "string",
"enum": [
"os:default"
]
},
{ {
"description": "os:allow-arch -> Enables the arch command without any pre-configured scope.", "description": "os:allow-arch -> Enables the arch command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5548,6 +5607,12 @@
"path:deny-resolve-directory" "path:deny-resolve-directory"
] ]
}, },
{
"type": "string",
"enum": [
"process:default"
]
},
{ {
"description": "process:allow-exit -> Enables the exit command without any pre-configured scope.", "description": "process:allow-exit -> Enables the exit command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5597,6 +5662,12 @@
"resources:deny-close" "resources:deny-close"
] ]
}, },
{
"type": "string",
"enum": [
"shell:default"
]
},
{ {
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5660,6 +5731,13 @@
"tray:default" "tray:default"
] ]
}, },
{
"description": "tray:allow-get-by-id -> Enables the get_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:allow-get-by-id"
]
},
{ {
"description": "tray:allow-new -> Enables the new command without any pre-configured scope.", "description": "tray:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5667,6 +5745,13 @@
"tray:allow-new" "tray:allow-new"
] ]
}, },
{
"description": "tray:allow-remove-by-id -> Enables the remove_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:allow-remove-by-id"
]
},
{ {
"description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", "description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5723,6 +5808,13 @@
"tray:allow-set-visible" "tray:allow-set-visible"
] ]
}, },
{
"description": "tray:deny-get-by-id -> Denies the get_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:deny-get-by-id"
]
},
{ {
"description": "tray:deny-new -> Denies the new command without any pre-configured scope.", "description": "tray:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5730,6 +5822,13 @@
"tray:deny-new" "tray:deny-new"
] ]
}, },
{
"description": "tray:deny-remove-by-id -> Denies the remove_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:deny-remove-by-id"
]
},
{ {
"description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", "description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.",
"type": "string", "type": "string",

@ -11,6 +11,13 @@
} }
] ]
}, },
{
"description": "A list of capabilities.",
"type": "array",
"items": {
"$ref": "#/definitions/Capability"
}
},
{ {
"description": "A list of capabilities.", "description": "A list of capabilities.",
"type": "object", "type": "object",
@ -34,8 +41,7 @@
"type": "object", "type": "object",
"required": [ "required": [
"identifier", "identifier",
"permissions", "permissions"
"windows"
], ],
"properties": { "properties": {
"identifier": { "identifier": {
@ -86,14 +92,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.", "description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
@ -108,7 +110,7 @@
], ],
"properties": { "properties": {
"urls": { "urls": {
"description": "Remote domains this capability refers to. Can use glob patterns.", "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n# Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
@ -182,7 +184,7 @@
] ]
}, },
{ {
"description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", "description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete `$APP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-app-write-recursive" "fs:allow-app-write-recursive"
@ -224,7 +226,7 @@
] ]
}, },
{ {
"description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", "description": "fs:allow-appcache-write-recursive -> This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appcache-write-recursive" "fs:allow-appcache-write-recursive"
@ -266,7 +268,7 @@
] ]
}, },
{ {
"description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", "description": "fs:allow-appconfig-write-recursive -> This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appconfig-write-recursive" "fs:allow-appconfig-write-recursive"
@ -308,7 +310,7 @@
] ]
}, },
{ {
"description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", "description": "fs:allow-appdata-write-recursive -> This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appdata-write-recursive" "fs:allow-appdata-write-recursive"
@ -350,7 +352,7 @@
] ]
}, },
{ {
"description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", "description": "fs:allow-applocaldata-write-recursive -> This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applocaldata-write-recursive" "fs:allow-applocaldata-write-recursive"
@ -392,7 +394,7 @@
] ]
}, },
{ {
"description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", "description": "fs:allow-applog-write-recursive -> This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applog-write-recursive" "fs:allow-applog-write-recursive"
@ -434,7 +436,7 @@
] ]
}, },
{ {
"description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", "description": "fs:allow-audio-write-recursive -> This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-audio-write-recursive" "fs:allow-audio-write-recursive"
@ -476,7 +478,7 @@
] ]
}, },
{ {
"description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", "description": "fs:allow-cache-write-recursive -> This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-cache-write-recursive" "fs:allow-cache-write-recursive"
@ -518,7 +520,7 @@
] ]
}, },
{ {
"description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", "description": "fs:allow-config-write-recursive -> This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-config-write-recursive" "fs:allow-config-write-recursive"
@ -560,7 +562,7 @@
] ]
}, },
{ {
"description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", "description": "fs:allow-data-write-recursive -> This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-data-write-recursive" "fs:allow-data-write-recursive"
@ -602,7 +604,7 @@
] ]
}, },
{ {
"description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", "description": "fs:allow-desktop-write-recursive -> This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-desktop-write-recursive" "fs:allow-desktop-write-recursive"
@ -644,7 +646,7 @@
] ]
}, },
{ {
"description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", "description": "fs:allow-document-write-recursive -> This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-document-write-recursive" "fs:allow-document-write-recursive"
@ -686,7 +688,7 @@
] ]
}, },
{ {
"description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", "description": "fs:allow-download-write-recursive -> This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-download-write-recursive" "fs:allow-download-write-recursive"
@ -728,7 +730,7 @@
] ]
}, },
{ {
"description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", "description": "fs:allow-exe-write-recursive -> This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-exe-write-recursive" "fs:allow-exe-write-recursive"
@ -770,7 +772,7 @@
] ]
}, },
{ {
"description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", "description": "fs:allow-font-write-recursive -> This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-font-write-recursive" "fs:allow-font-write-recursive"
@ -812,7 +814,7 @@
] ]
}, },
{ {
"description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", "description": "fs:allow-home-write-recursive -> This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-home-write-recursive" "fs:allow-home-write-recursive"
@ -854,7 +856,7 @@
] ]
}, },
{ {
"description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", "description": "fs:allow-localdata-write-recursive -> This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-localdata-write-recursive" "fs:allow-localdata-write-recursive"
@ -896,7 +898,7 @@
] ]
}, },
{ {
"description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", "description": "fs:allow-log-write-recursive -> This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-log-write-recursive" "fs:allow-log-write-recursive"
@ -938,7 +940,7 @@
] ]
}, },
{ {
"description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", "description": "fs:allow-picture-write-recursive -> This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-picture-write-recursive" "fs:allow-picture-write-recursive"
@ -980,7 +982,7 @@
] ]
}, },
{ {
"description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", "description": "fs:allow-public-write-recursive -> This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-public-write-recursive" "fs:allow-public-write-recursive"
@ -1022,7 +1024,7 @@
] ]
}, },
{ {
"description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", "description": "fs:allow-resource-write-recursive -> This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-resource-write-recursive" "fs:allow-resource-write-recursive"
@ -1064,7 +1066,7 @@
] ]
}, },
{ {
"description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", "description": "fs:allow-runtime-write-recursive -> This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-runtime-write-recursive" "fs:allow-runtime-write-recursive"
@ -1106,7 +1108,7 @@
] ]
}, },
{ {
"description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", "description": "fs:allow-temp-write-recursive -> This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-temp-write-recursive" "fs:allow-temp-write-recursive"
@ -1148,7 +1150,7 @@
] ]
}, },
{ {
"description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", "description": "fs:allow-template-write-recursive -> This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-template-write-recursive" "fs:allow-template-write-recursive"
@ -1190,7 +1192,7 @@
] ]
}, },
{ {
"description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", "description": "fs:allow-video-write-recursive -> This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-video-write-recursive" "fs:allow-video-write-recursive"
@ -2131,30 +2133,50 @@
}, },
"allow": { "allow": {
"items": { "items": {
"title": "Entry", "title": "FsScopeEntry",
"type": "object", "description": "FS scope entry.",
"required": [ "anyOf": [
"path" {
], "description": "FS scope path.",
"properties": {
"path": {
"type": "string" "type": "string"
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "FS scope path.",
"type": "string"
}
}
} }
} ]
} }
}, },
"deny": { "deny": {
"items": { "items": {
"title": "Entry", "title": "FsScopeEntry",
"type": "object", "description": "FS scope entry.",
"required": [ "anyOf": [
"path" {
], "description": "FS scope path.",
"properties": {
"path": {
"type": "string" "type": "string"
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"description": "FS scope path.",
"type": "string"
}
}
} }
} ]
} }
} }
} }
@ -2234,8 +2256,8 @@
}, },
"allow": { "allow": {
"items": { "items": {
"title": "ScopeEntry", "title": "HttpScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry.",
"anyOf": [ "anyOf": [
{ {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
@ -2258,8 +2280,8 @@
}, },
"deny": { "deny": {
"items": { "items": {
"title": "ScopeEntry", "title": "HttpScopeEntry",
"description": "HTTP scope entry object definition.", "description": "HTTP scope entry.",
"anyOf": [ "anyOf": [
{ {
"description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"", "description": "A URL that can be accessed by the webview when using the HTTP APIs. Wildcards can be used following the URL pattern standard.\n\nSee [the URL Pattern spec](https://urlpattern.spec.whatwg.org/) for more information.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin on port 443\n\n- \"https://*:*\" : allows all HTTPS origin on any port\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
@ -2290,6 +2312,12 @@
"properties": { "properties": {
"identifier": { "identifier": {
"oneOf": [ "oneOf": [
{
"type": "string",
"enum": [
"shell:default"
]
},
{ {
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
"type": "string", "type": "string",
@ -2355,7 +2383,7 @@
"type": "object", "type": "object",
"required": [ "required": [
"args", "args",
"command", "cmd",
"name", "name",
"sidecar" "sidecar"
], ],
@ -2368,7 +2396,7 @@
} }
] ]
}, },
"command": { "cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string" "type": "string"
}, },
@ -2390,7 +2418,7 @@
"type": "object", "type": "object",
"required": [ "required": [
"args", "args",
"command", "cmd",
"name", "name",
"sidecar" "sidecar"
], ],
@ -2403,7 +2431,7 @@
} }
] ]
}, },
"command": { "cmd": {
"description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string" "type": "string"
}, },
@ -2503,6 +2531,12 @@
"app:deny-version" "app:deny-version"
] ]
}, },
{
"type": "string",
"enum": [
"barcode-scanner:default"
]
},
{ {
"description": "barcode-scanner:allow-cancel -> Enables the cancel command without any pre-configured scope.", "description": "barcode-scanner:allow-cancel -> Enables the cancel command without any pre-configured scope.",
"type": "string", "type": "string",
@ -2587,6 +2621,12 @@
"barcode-scanner:deny-vibrate" "barcode-scanner:deny-vibrate"
] ]
}, },
{
"type": "string",
"enum": [
"biometric:default"
]
},
{ {
"description": "biometric:allow-authenticate -> Enables the authenticate command without any pre-configured scope.", "description": "biometric:allow-authenticate -> Enables the authenticate command without any pre-configured scope.",
"type": "string", "type": "string",
@ -2616,31 +2656,99 @@
] ]
}, },
{ {
"description": "clipboard-manager:allow-read -> Enables the read command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:allow-read" "clipboard-manager:default"
]
},
{
"description": "clipboard-manager:allow-clear -> Enables the clear command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-clear"
]
},
{
"description": "clipboard-manager:allow-read-image -> Enables the read_image command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-read-image"
]
},
{
"description": "clipboard-manager:allow-read-text -> Enables the read_text command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-read-text"
]
},
{
"description": "clipboard-manager:allow-write-html -> Enables the write_html command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-write-html"
]
},
{
"description": "clipboard-manager:allow-write-image -> Enables the write_image command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-write-image"
]
},
{
"description": "clipboard-manager:allow-write-text -> Enables the write_text command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:allow-write-text"
]
},
{
"description": "clipboard-manager:deny-clear -> Denies the clear command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-clear"
]
},
{
"description": "clipboard-manager:deny-read-image -> Denies the read_image command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-read-image"
]
},
{
"description": "clipboard-manager:deny-read-text -> Denies the read_text command without any pre-configured scope.",
"type": "string",
"enum": [
"clipboard-manager:deny-read-text"
] ]
}, },
{ {
"description": "clipboard-manager:allow-write -> Enables the write command without any pre-configured scope.", "description": "clipboard-manager:deny-write-html -> Denies the write_html command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:allow-write" "clipboard-manager:deny-write-html"
] ]
}, },
{ {
"description": "clipboard-manager:deny-read -> Denies the read command without any pre-configured scope.", "description": "clipboard-manager:deny-write-image -> Denies the write_image command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:deny-read" "clipboard-manager:deny-write-image"
] ]
}, },
{ {
"description": "clipboard-manager:deny-write -> Denies the write command without any pre-configured scope.", "description": "clipboard-manager:deny-write-text -> Denies the write_text command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"clipboard-manager:deny-write" "clipboard-manager:deny-write-text"
]
},
{
"type": "string",
"enum": [
"dialog:default"
] ]
}, },
{ {
@ -2812,7 +2920,7 @@
] ]
}, },
{ {
"description": "fs:allow-app-write-recursive -> This allows full recusrive write access to the complete `$APP` folder, files and subdirectories.", "description": "fs:allow-app-write-recursive -> This allows full recursive write access to the complete `$APP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-app-write-recursive" "fs:allow-app-write-recursive"
@ -2854,7 +2962,7 @@
] ]
}, },
{ {
"description": "fs:allow-appcache-write-recursive -> This allows full recusrive write access to the complete `$APPCACHE` folder, files and subdirectories.", "description": "fs:allow-appcache-write-recursive -> This allows full recursive write access to the complete `$APPCACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appcache-write-recursive" "fs:allow-appcache-write-recursive"
@ -2896,7 +3004,7 @@
] ]
}, },
{ {
"description": "fs:allow-appconfig-write-recursive -> This allows full recusrive write access to the complete `$APPCONFIG` folder, files and subdirectories.", "description": "fs:allow-appconfig-write-recursive -> This allows full recursive write access to the complete `$APPCONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appconfig-write-recursive" "fs:allow-appconfig-write-recursive"
@ -2938,7 +3046,7 @@
] ]
}, },
{ {
"description": "fs:allow-appdata-write-recursive -> This allows full recusrive write access to the complete `$APPDATA` folder, files and subdirectories.", "description": "fs:allow-appdata-write-recursive -> This allows full recursive write access to the complete `$APPDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-appdata-write-recursive" "fs:allow-appdata-write-recursive"
@ -2980,7 +3088,7 @@
] ]
}, },
{ {
"description": "fs:allow-applocaldata-write-recursive -> This allows full recusrive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.", "description": "fs:allow-applocaldata-write-recursive -> This allows full recursive write access to the complete `$APPLOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applocaldata-write-recursive" "fs:allow-applocaldata-write-recursive"
@ -3022,7 +3130,7 @@
] ]
}, },
{ {
"description": "fs:allow-applog-write-recursive -> This allows full recusrive write access to the complete `$APPLOG` folder, files and subdirectories.", "description": "fs:allow-applog-write-recursive -> This allows full recursive write access to the complete `$APPLOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-applog-write-recursive" "fs:allow-applog-write-recursive"
@ -3064,7 +3172,7 @@
] ]
}, },
{ {
"description": "fs:allow-audio-write-recursive -> This allows full recusrive write access to the complete `$AUDIO` folder, files and subdirectories.", "description": "fs:allow-audio-write-recursive -> This allows full recursive write access to the complete `$AUDIO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-audio-write-recursive" "fs:allow-audio-write-recursive"
@ -3106,7 +3214,7 @@
] ]
}, },
{ {
"description": "fs:allow-cache-write-recursive -> This allows full recusrive write access to the complete `$CACHE` folder, files and subdirectories.", "description": "fs:allow-cache-write-recursive -> This allows full recursive write access to the complete `$CACHE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-cache-write-recursive" "fs:allow-cache-write-recursive"
@ -3148,7 +3256,7 @@
] ]
}, },
{ {
"description": "fs:allow-config-write-recursive -> This allows full recusrive write access to the complete `$CONFIG` folder, files and subdirectories.", "description": "fs:allow-config-write-recursive -> This allows full recursive write access to the complete `$CONFIG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-config-write-recursive" "fs:allow-config-write-recursive"
@ -3190,7 +3298,7 @@
] ]
}, },
{ {
"description": "fs:allow-data-write-recursive -> This allows full recusrive write access to the complete `$DATA` folder, files and subdirectories.", "description": "fs:allow-data-write-recursive -> This allows full recursive write access to the complete `$DATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-data-write-recursive" "fs:allow-data-write-recursive"
@ -3232,7 +3340,7 @@
] ]
}, },
{ {
"description": "fs:allow-desktop-write-recursive -> This allows full recusrive write access to the complete `$DESKTOP` folder, files and subdirectories.", "description": "fs:allow-desktop-write-recursive -> This allows full recursive write access to the complete `$DESKTOP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-desktop-write-recursive" "fs:allow-desktop-write-recursive"
@ -3274,7 +3382,7 @@
] ]
}, },
{ {
"description": "fs:allow-document-write-recursive -> This allows full recusrive write access to the complete `$DOCUMENT` folder, files and subdirectories.", "description": "fs:allow-document-write-recursive -> This allows full recursive write access to the complete `$DOCUMENT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-document-write-recursive" "fs:allow-document-write-recursive"
@ -3316,7 +3424,7 @@
] ]
}, },
{ {
"description": "fs:allow-download-write-recursive -> This allows full recusrive write access to the complete `$DOWNLOAD` folder, files and subdirectories.", "description": "fs:allow-download-write-recursive -> This allows full recursive write access to the complete `$DOWNLOAD` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-download-write-recursive" "fs:allow-download-write-recursive"
@ -3358,7 +3466,7 @@
] ]
}, },
{ {
"description": "fs:allow-exe-write-recursive -> This allows full recusrive write access to the complete `$EXE` folder, files and subdirectories.", "description": "fs:allow-exe-write-recursive -> This allows full recursive write access to the complete `$EXE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-exe-write-recursive" "fs:allow-exe-write-recursive"
@ -3400,7 +3508,7 @@
] ]
}, },
{ {
"description": "fs:allow-font-write-recursive -> This allows full recusrive write access to the complete `$FONT` folder, files and subdirectories.", "description": "fs:allow-font-write-recursive -> This allows full recursive write access to the complete `$FONT` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-font-write-recursive" "fs:allow-font-write-recursive"
@ -3442,7 +3550,7 @@
] ]
}, },
{ {
"description": "fs:allow-home-write-recursive -> This allows full recusrive write access to the complete `$HOME` folder, files and subdirectories.", "description": "fs:allow-home-write-recursive -> This allows full recursive write access to the complete `$HOME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-home-write-recursive" "fs:allow-home-write-recursive"
@ -3484,7 +3592,7 @@
] ]
}, },
{ {
"description": "fs:allow-localdata-write-recursive -> This allows full recusrive write access to the complete `$LOCALDATA` folder, files and subdirectories.", "description": "fs:allow-localdata-write-recursive -> This allows full recursive write access to the complete `$LOCALDATA` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-localdata-write-recursive" "fs:allow-localdata-write-recursive"
@ -3526,7 +3634,7 @@
] ]
}, },
{ {
"description": "fs:allow-log-write-recursive -> This allows full recusrive write access to the complete `$LOG` folder, files and subdirectories.", "description": "fs:allow-log-write-recursive -> This allows full recursive write access to the complete `$LOG` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-log-write-recursive" "fs:allow-log-write-recursive"
@ -3568,7 +3676,7 @@
] ]
}, },
{ {
"description": "fs:allow-picture-write-recursive -> This allows full recusrive write access to the complete `$PICTURE` folder, files and subdirectories.", "description": "fs:allow-picture-write-recursive -> This allows full recursive write access to the complete `$PICTURE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-picture-write-recursive" "fs:allow-picture-write-recursive"
@ -3610,7 +3718,7 @@
] ]
}, },
{ {
"description": "fs:allow-public-write-recursive -> This allows full recusrive write access to the complete `$PUBLIC` folder, files and subdirectories.", "description": "fs:allow-public-write-recursive -> This allows full recursive write access to the complete `$PUBLIC` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-public-write-recursive" "fs:allow-public-write-recursive"
@ -3652,7 +3760,7 @@
] ]
}, },
{ {
"description": "fs:allow-resource-write-recursive -> This allows full recusrive write access to the complete `$RESOURCE` folder, files and subdirectories.", "description": "fs:allow-resource-write-recursive -> This allows full recursive write access to the complete `$RESOURCE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-resource-write-recursive" "fs:allow-resource-write-recursive"
@ -3694,7 +3802,7 @@
] ]
}, },
{ {
"description": "fs:allow-runtime-write-recursive -> This allows full recusrive write access to the complete `$RUNTIME` folder, files and subdirectories.", "description": "fs:allow-runtime-write-recursive -> This allows full recursive write access to the complete `$RUNTIME` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-runtime-write-recursive" "fs:allow-runtime-write-recursive"
@ -3736,7 +3844,7 @@
] ]
}, },
{ {
"description": "fs:allow-temp-write-recursive -> This allows full recusrive write access to the complete `$TEMP` folder, files and subdirectories.", "description": "fs:allow-temp-write-recursive -> This allows full recursive write access to the complete `$TEMP` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-temp-write-recursive" "fs:allow-temp-write-recursive"
@ -3778,7 +3886,7 @@
] ]
}, },
{ {
"description": "fs:allow-template-write-recursive -> This allows full recusrive write access to the complete `$TEMPLATE` folder, files and subdirectories.", "description": "fs:allow-template-write-recursive -> This allows full recursive write access to the complete `$TEMPLATE` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-template-write-recursive" "fs:allow-template-write-recursive"
@ -3820,7 +3928,7 @@
] ]
}, },
{ {
"description": "fs:allow-video-write-recursive -> This allows full recusrive write access to the complete `$VIDEO` folder, files and subdirectories.", "description": "fs:allow-video-write-recursive -> This allows full recursive write access to the complete `$VIDEO` folder, files and subdirectories.",
"type": "string", "type": "string",
"enum": [ "enum": [
"fs:allow-video-write-recursive" "fs:allow-video-write-recursive"
@ -4827,6 +4935,83 @@
"http:deny-fetch-send" "http:deny-fetch-send"
] ]
}, },
{
"description": "image:default -> Default permissions for the plugin.",
"type": "string",
"enum": [
"image:default"
]
},
{
"description": "image:allow-from-bytes -> Enables the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-bytes"
]
},
{
"description": "image:allow-from-path -> Enables the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-from-path"
]
},
{
"description": "image:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-new"
]
},
{
"description": "image:allow-rgba -> Enables the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-rgba"
]
},
{
"description": "image:allow-size -> Enables the size command without any pre-configured scope.",
"type": "string",
"enum": [
"image:allow-size"
]
},
{
"description": "image:deny-from-bytes -> Denies the from_bytes command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-bytes"
]
},
{
"description": "image:deny-from-path -> Denies the from_path command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-from-path"
]
},
{
"description": "image:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-new"
]
},
{
"description": "image:deny-rgba -> Denies the rgba command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-rgba"
]
},
{
"description": "image:deny-size -> Denies the size command without any pre-configured scope.",
"type": "string",
"enum": [
"image:deny-size"
]
},
{ {
"description": "log:default -> Allows the log command", "description": "log:default -> Allows the log command",
"type": "string", "type": "string",
@ -5163,6 +5348,12 @@
"menu:deny-text" "menu:deny-text"
] ]
}, },
{
"type": "string",
"enum": [
"nfc:default"
]
},
{ {
"description": "nfc:allow-is-available -> Enables the is_available command without any pre-configured scope.", "description": "nfc:allow-is-available -> Enables the is_available command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5254,6 +5445,12 @@
"notification:deny-request-permission" "notification:deny-request-permission"
] ]
}, },
{
"type": "string",
"enum": [
"os:default"
]
},
{ {
"description": "os:allow-arch -> Enables the arch command without any pre-configured scope.", "description": "os:allow-arch -> Enables the arch command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5485,6 +5682,12 @@
"path:deny-resolve-directory" "path:deny-resolve-directory"
] ]
}, },
{
"type": "string",
"enum": [
"process:default"
]
},
{ {
"description": "process:allow-exit -> Enables the exit command without any pre-configured scope.", "description": "process:allow-exit -> Enables the exit command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5534,6 +5737,12 @@
"resources:deny-close" "resources:deny-close"
] ]
}, },
{
"type": "string",
"enum": [
"shell:default"
]
},
{ {
"description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.", "description": "shell:allow-execute -> Enables the execute command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5597,6 +5806,13 @@
"tray:default" "tray:default"
] ]
}, },
{
"description": "tray:allow-get-by-id -> Enables the get_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:allow-get-by-id"
]
},
{ {
"description": "tray:allow-new -> Enables the new command without any pre-configured scope.", "description": "tray:allow-new -> Enables the new command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5604,6 +5820,13 @@
"tray:allow-new" "tray:allow-new"
] ]
}, },
{
"description": "tray:allow-remove-by-id -> Enables the remove_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:allow-remove-by-id"
]
},
{ {
"description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.", "description": "tray:allow-set-icon -> Enables the set_icon command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5660,6 +5883,13 @@
"tray:allow-set-visible" "tray:allow-set-visible"
] ]
}, },
{
"description": "tray:deny-get-by-id -> Denies the get_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:deny-get-by-id"
]
},
{ {
"description": "tray:deny-new -> Denies the new command without any pre-configured scope.", "description": "tray:deny-new -> Denies the new command without any pre-configured scope.",
"type": "string", "type": "string",
@ -5667,6 +5897,13 @@
"tray:deny-new" "tray:deny-new"
] ]
}, },
{
"description": "tray:deny-remove-by-id -> Denies the remove_by_id command without any pre-configured scope.",
"type": "string",
"enum": [
"tray:deny-remove-by-id"
]
},
{ {
"description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.", "description": "tray:deny-set-icon -> Denies the set_icon command without any pre-configured scope.",
"type": "string", "type": "string",

@ -80,9 +80,10 @@ pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
i @ "icon-1" | i @ "icon-2" => { i @ "icon-1" | i @ "icon-2" => {
if let Some(tray) = app.tray_by_id("tray-1") { if let Some(tray) = app.tray_by_id("tray-1") {
let _ = tray.set_icon(Some(if i == "icon-1" { let _ = tray.set_icon(Some(if i == "icon-1" {
tauri::Image::from_ico_bytes(include_bytes!("../icons/icon.ico")).unwrap() tauri::image::Image::from_bytes(include_bytes!("../icons/icon.ico"))
.unwrap()
} else { } else {
tauri::Image::from_png_bytes(include_bytes!( tauri::image::Image::from_bytes(include_bytes!(
"../icons/tray_icon_with_transparency.png" "../icons/tray_icon_with_transparency.png"
)) ))
.unwrap() .unwrap()

@ -6,8 +6,8 @@
"build": { "build": {
"devUrl": "http://localhost:5173", "devUrl": "http://localhost:5173",
"frontendDist": "../dist", "frontendDist": "../dist",
"beforeDevCommand": "yarn dev", "beforeDevCommand": "pnpm dev",
"beforeBuildCommand": "yarn build" "beforeBuildCommand": "pnpm build"
}, },
"app": { "app": {
"withGlobalTauri": true, "withGlobalTauri": true,

@ -0,0 +1,15 @@
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
export function arrayBufferToBase64(buffer, callback) {
const blob = new Blob([buffer], {
type: "application/octet-binary",
});
const reader = new FileReader();
reader.onload = function (evt) {
const dataurl = evt.target.result;
callback(dataurl.substr(dataurl.indexOf(",") + 1));
};
reader.readAsDataURL(blob);
}

@ -1,23 +1,59 @@
<script> <script>
import { writeText, readText } from "@tauri-apps/plugin-clipboard-manager"; import * as clipboard from "@tauri-apps/plugin-clipboard-manager";
import { open } from "@tauri-apps/plugin-dialog";
import { arrayBufferToBase64 } from "../lib/utils";
import { readFile } from "@tauri-apps/plugin-fs";
export let onMessage; export let onMessage;
export let insecureRenderHtml;
let text = "clipboard message"; let text = "clipboard message";
function write() { function writeText() {
writeText(text) clipboard
.writeText(text)
.then(() => { .then(() => {
onMessage("Wrote to the clipboard"); onMessage("Wrote to the clipboard");
}) })
.catch(onMessage); .catch(onMessage);
} }
function read() { async function writeImage() {
readText() try {
const res = await open({
title: "Image to write to clipboard",
filters: [
{
name: "Clipboard IMG",
extensions: ["png", "jpg", "jpeg"],
},
],
});
const bytes = await readFile(res.path);
await clipboard.writeImage(bytes);
onMessage("wrote image");
} catch (e) {
onMessage(e);
}
}
async function read() {
try {
const image = await clipboard.readImage();
arrayBufferToBase64(await image.rgba(), function (base64) {
const src = "data:image/png;base64," + base64;
insecureRenderHtml('<img src="' + src + '"></img>');
});
return;
} catch (_) {}
clipboard
.readText()
.then((contents) => { .then((contents) => {
onMessage(`Clipboard contents: ${contents}`); onMessage(`Clipboard contents: ${contents}`);
}) })
.catch(onMessage); .catch((e) => {
onMessage(e);
});
} }
</script> </script>
@ -27,6 +63,8 @@
placeholder="Text to write to the clipboard" placeholder="Text to write to the clipboard"
bind:value={text} bind:value={text}
/> />
<button class="btn" type="button" on:click={write}>Write</button> <button class="btn" type="button" on:click={writeText}>Write</button>
<button class="btn" type="button" on:click={writeImage}>Pick Image</button>
<button class="btn" type="button" on:click={read}>Read</button> <button class="btn" type="button" on:click={read}>Read</button>
</div> </div>

@ -1,6 +1,7 @@
<script> <script>
import * as fs from "@tauri-apps/plugin-fs"; import * as fs from "@tauri-apps/plugin-fs";
import { convertFileSrc } from "@tauri-apps/api/core"; import { convertFileSrc } from "@tauri-apps/api/core";
import { arrayBufferToBase64 } from "../lib/utils";
export let onMessage; export let onMessage;
export let insecureRenderHtml; export let insecureRenderHtml;
@ -20,18 +21,6 @@
return dirSelect.value ? parseInt(dir.value) : null; return dirSelect.value ? parseInt(dir.value) : null;
} }
function arrayBufferToBase64(buffer, callback) {
const blob = new Blob([buffer], {
type: "application/octet-binary",
});
const reader = new FileReader();
reader.onload = function (evt) {
const dataurl = evt.target.result;
callback(dataurl.substr(dataurl.indexOf(",") + 1));
};
reader.readAsDataURL(blob);
}
const DirOptions = Object.keys(fs.BaseDirectory) const DirOptions = Object.keys(fs.BaseDirectory)
.filter((key) => isNaN(parseInt(key))) .filter((key) => isNaN(parseInt(key)))
.map((dir) => [dir, fs.BaseDirectory[dir]]); .map((dir) => [dir, fs.BaseDirectory[dir]]);
@ -225,7 +214,9 @@
/> />
<br /> <br />
<div> <div>
<label for="watch-debounce-delay">Debounce delay in milliseconds (`0` disables the debouncer)</label> <label for="watch-debounce-delay"
>Debounce delay in milliseconds (`0` disables the debouncer)</label
>
<input <input
class="input" class="input"
id="watch-debounce-delay" id="watch-debounce-delay"

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-authenticator" name = "tauri-plugin-authenticator"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Use hardware security-keys in your Tauri App." description = "Use hardware security-keys in your Tauri App."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -11,5 +11,7 @@ const COMMANDS: &[&str] = &[
]; ];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS).build(); tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
} }

@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4" "@tauri-apps/api": "2.0.0-beta.6"
} }
} }

@ -139,14 +139,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.", "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }

@ -78,7 +78,6 @@ fn verify_signature(
pub fn init<R: Runtime>() -> TauriPlugin<R> { pub fn init<R: Runtime>() -> TauriPlugin<R> {
PluginBuilder::new("authenticator") PluginBuilder::new("authenticator")
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
init_auth, init_auth,
register, register,

@ -95,7 +95,8 @@ impl U2f {
challenge: Challenge, challenge: Challenge,
response: RegisterResponse, response: RegisterResponse,
) -> Result<Registration> { ) -> Result<Registration> {
if expiration(challenge.timestamp) > Duration::seconds(300) { // Safe to unwrap since 300 is within the constraints of Duration::try_seconds
if expiration(challenge.timestamp) > Duration::try_seconds(300).unwrap() {
return Err(U2fError::ChallengeExpired); return Err(U2fError::ChallengeExpired);
} }
@ -152,7 +153,8 @@ impl U2f {
sign_resp: SignResponse, sign_resp: SignResponse,
counter: u32, counter: u32,
) -> Result<u32> { ) -> Result<u32> {
if expiration(challenge.timestamp) > Duration::seconds(300) { // Safe to unwrap since 300 is within the constraints of Duration::try_seconds
if expiration(challenge.timestamp) > Duration::try_seconds(300).unwrap() {
return Err(U2fError::ChallengeExpired); return Err(U2fError::ChallengeExpired);
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-autostart" name = "tauri-plugin-autostart"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Automatically launch your application at startup." description = "Automatically launch your application at startup."
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -5,5 +5,7 @@
const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"]; const COMMANDS: &[&str] = &["enable", "disable", "is_enabled"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS).build(); tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
} }

@ -23,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4" "@tauri-apps/api": "2.0.0-beta.6"
} }
} }

@ -139,14 +139,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.", "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }

@ -107,7 +107,6 @@ pub fn init<R: Runtime>(
args: Option<Vec<&'static str>>, args: Option<Vec<&'static str>>,
) -> TauriPlugin<R> { ) -> TauriPlugin<R> {
Builder::new("autostart") Builder::new("autostart")
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![enable, disable, is_enabled]) .invoke_handler(tauri::generate_handler![enable, disable, is_enabled])
.setup(move |app, _api| { .setup(move |app, _api| {
let mut builder = AutoLaunchBuilder::new(); let mut builder = AutoLaunchBuilder::new();
@ -130,11 +129,12 @@ pub fn init<R: Runtime>(
// exe path to not break it. // exe path to not break it.
let exe_path = current_exe.canonicalize()?.display().to_string(); let exe_path = current_exe.canonicalize()?.display().to_string();
let parts: Vec<&str> = exe_path.split(".app/").collect(); let parts: Vec<&str> = exe_path.split(".app/").collect();
let app_path = if parts.len() == 2 { let app_path =
format!("{}.app", parts.first().unwrap()) if parts.len() == 2 && matches!(macos_launcher, MacosLauncher::AppleScript) {
} else { format!("{}.app", parts.first().unwrap())
exe_path } else {
}; exe_path
};
info!("auto_start path {}", &app_path); info!("auto_start path {}", &app_path);
builder.set_app_path(&app_path); builder.set_app_path(&app_path);
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-barcode-scanner" name = "tauri-plugin-barcode-scanner"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS" description = "Scan QR codes, EAN-13 and other kinds of barcodes on Android and iOS"
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -13,6 +13,7 @@ const COMMANDS: &[&str] = &[
fn main() { fn main() {
if let Err(error) = tauri_plugin::Builder::new(COMMANDS) if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.android_path("android") .android_path("android")
.ios_path("ios") .ios_path("ios")
.try_build() .try_build()

@ -24,6 +24,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4" "@tauri-apps/api": "2.0.0-beta.6"
} }
} }

@ -139,14 +139,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.", "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-biometric" name = "tauri-plugin-biometric"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Prompt the user for biometric authentication on Android and iOS." description = "Prompt the user for biometric authentication on Android and iOS."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -6,6 +6,7 @@ const COMMANDS: &[&str] = &["authenticate", "status"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS) tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.android_path("android") .android_path("android")
.ios_path("ios") .ios_path("ios")
.build(); .build();

@ -27,6 +27,6 @@
"tslib": "2.6.0" "tslib": "2.6.0"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4" "@tauri-apps/api": "2.0.0-beta.6"
} }
} }

@ -139,14 +139,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.", "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }

@ -59,7 +59,6 @@ impl<R: Runtime, T: Manager<R>> crate::BiometricExt<R> for T {
/// Initializes the plugin. /// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> { pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("biometric") Builder::new("biometric")
.js_init_script(include_str!("api-iife.js").to_string())
.setup(|app, api| { .setup(|app, api| {
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?; let handle = api.register_android_plugin(PLUGIN_IDENTIFIER, "BiometricPlugin")?;

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-cli" name = "tauri-plugin-cli"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Parse arguments from your Tauri application's command line interface." description = "Parse arguments from your Tauri application's command line interface."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }

@ -5,5 +5,7 @@
const COMMANDS: &[&str] = &["cli_matches"]; const COMMANDS: &[&str] = &["cli_matches"];
fn main() { fn main() {
tauri_plugin::Builder::new(COMMANDS).build(); tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.build();
} }

@ -23,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4" "@tauri-apps/api": "2.0.0-beta.6"
} }
} }

@ -139,14 +139,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.", "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }

@ -51,7 +51,6 @@ fn cli_matches<R: Runtime>(_app: AppHandle<R>, cli: State<'_, Cli<R>>) -> Result
pub fn init<R: Runtime>() -> TauriPlugin<R, Config> { pub fn init<R: Runtime>() -> TauriPlugin<R, Config> {
Builder::new("cli") Builder::new("cli")
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![cli_matches]) .invoke_handler(tauri::generate_handler![cli_matches])
.setup(|app, api| { .setup(|app, api| {
app.manage(Cli(api)); app.manage(Cli(api));

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.1.0-beta.0]
- [`9dec960`](https://github.com/tauri-apps/plugins-workspace/commit/9dec9605ed1ce19dbef697e55debddf9008ecba1)([#845](https://github.com/tauri-apps/plugins-workspace/pull/845)) Add support for `read_image` and `write_image` to the clipboard plugin (desktop).
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`dc6d332`](https://github.com/tauri-apps/plugins-workspace/commit/dc6d3321e5305fa8b7250553bd179cbee995998a)([#977](https://github.com/tauri-apps/plugins-workspace/pull/977)) Add support for writing HTML content to the clipboard. - [`dc6d332`](https://github.com/tauri-apps/plugins-workspace/commit/dc6d3321e5305fa8b7250553bd179cbee995998a)([#977](https://github.com/tauri-apps/plugins-workspace/pull/977)) Add support for writing HTML content to the clipboard.
@ -45,5 +49,12 @@
## \[2.0.0-alpha.0] ## \[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!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
te to alpha.11.
## \[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! - [`717ae67`](https://github.com/tauri-apps/plugins-workspace/commit/717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!
717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release! 717ae670978feb4492fac1f295998b93f2b9347f)([#371](https://github.com/tauri-apps/plugins-workspace/pull/371)) First v2 alpha release!

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-clipboard-manager" name = "tauri-plugin-clipboard-manager"
version = "2.0.0-beta.2" version = "2.1.0-beta.0"
description = "Read and write to the system clipboard." description = "Read and write to the system clipboard."
edition = { workspace = true } edition = { workspace = true }
authors = { workspace = true } authors = { workspace = true }
@ -25,3 +25,4 @@ thiserror = { workspace = true }
[target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"macos\", windows, target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
arboard = "3" arboard = "3"
image = "0.24"

@ -87,7 +87,7 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
@Command @Command
@Suppress("MoveVariableDeclarationIntoWhen") @Suppress("MoveVariableDeclarationIntoWhen")
fun write(invoke: Invoke) { fun writeText(invoke: Invoke) {
val args = invoke.parseArgs(WriteOptions::class.java) val args = invoke.parseArgs(WriteOptions::class.java)
val clipData = when (args) { val clipData = when (args) {
@ -106,7 +106,7 @@ class ClipboardPlugin(private val activity: Activity) : Plugin(activity) {
} }
@Command @Command
fun read(invoke: Invoke) { fun readText(invoke: Invoke) {
val data = if (manager.hasPrimaryClip()) { val data = if (manager.hasPrimaryClip()) {
if (manager.primaryClipDescription?.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN) == true) { if (manager.primaryClipDescription?.hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN) == true) {
val item: ClipData.Item = manager.primaryClip!!.getItemAt(0) val item: ClipData.Item = manager.primaryClip!!.getItemAt(0)

@ -0,0 +1 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(e){"use strict";var r;async function t(e,r={},t){return window.__TAURI_INTERNALS__.invoke(e,r,t)}"function"==typeof SuppressedError&&SuppressedError;class n{get rid(){return function(e,r,t,n){if("a"===t&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof r?e!==r||!n:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===t?n:"a"===t?n.call(e):n?n.value:r.get(e)}(this,r,"f")}constructor(e){r.set(this,void 0),function(e,r,t,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof r?e!==r||!a:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?a.call(e,t):a?a.value=t:r.set(e,t)}(this,r,e,"f")}async close(){return t("plugin:resources|close",{rid:this.rid})}}r=new WeakMap;class a extends n{constructor(e){super(e)}static async new(e,r,n){return t("plugin:image|new",{rgba:i(e),width:r,height:n}).then((e=>new a(e)))}static async fromBytes(e){return t("plugin:image|from_bytes",{bytes:i(e)}).then((e=>new a(e)))}static async fromPath(e){return t("plugin:image|from_path",{path:e}).then((e=>new a(e)))}async rgba(){return t("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return t("plugin:image|size",{rid:this.rid})}}function i(e){return null==e?null:"string"==typeof e?e:e instanceof Uint8Array?Array.from(e):e instanceof ArrayBuffer?Array.from(new Uint8Array(e)):e instanceof a?e.rid:e}return e.clear=async function(){await t("plugin:clipboard-manager|clear")},e.readImage=async function(){return await t("plugin:clipboard-manager|read_image").then((e=>new a(e)))},e.readText=async function(){return(await t("plugin:clipboard-manager|read_text")).plainText.text},e.writeHtml=async function(e,r){return t("plugin:clipboard-manager|write_html",{data:{html:{html:e,altHtml:r}}})},e.writeImage=async function(e){return t("plugin:clipboard-manager|write_image",{data:{image:{image:i(e)}}})},e.writeText=async function(e,r){return t("plugin:clipboard-manager|write_text",{data:{plainText:{label:r?.label,text:e}}})},e}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})}

@ -2,10 +2,18 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
const COMMANDS: &[&str] = &["write", "read"]; const COMMANDS: &[&str] = &[
"write_text",
"read_text",
"write_image",
"read_image",
"write_html",
"clear",
];
fn main() { fn main() {
if let Err(error) = tauri_plugin::Builder::new(COMMANDS) if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.android_path("android") .android_path("android")
.ios_path("ios") .ios_path("ios")
.try_build() .try_build()

@ -9,6 +9,7 @@
*/ */
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
import { Image, transformImage } from "@tauri-apps/api/image";
type ClipResponse = Record<"plainText", { text: string }>; type ClipResponse = Record<"plainText", { text: string }>;
@ -29,7 +30,7 @@ async function writeText(
text: string, text: string,
opts?: { label?: string }, opts?: { label?: string },
): Promise<void> { ): Promise<void> {
return invoke("plugin:clipboard-manager|write", { return invoke("plugin:clipboard-manager|write_text", {
data: { data: {
plainText: { plainText: {
label: opts?.label, label: opts?.label,
@ -49,12 +50,60 @@ async function writeText(
* @since 2.0.0 * @since 2.0.0
*/ */
async function readText(): Promise<string> { async function readText(): Promise<string> {
const kind: ClipResponse = await invoke("plugin:clipboard-manager|read"); const kind: ClipResponse = await invoke("plugin:clipboard-manager|read_text");
return kind.plainText.text; return kind.plainText.text;
} }
/** /**
* Writes HTML or fallbacks to write provided plain text to the clipboard. * Gets the clipboard content as Uint8Array image.
* @example
* ```typescript
* import { readImage } from '@tauri-apps/plugin-clipboard-manager';
*
* const clipboardImage = await readImage();
* const blob = new Blob([clipboardImage.bytes], { type: 'image' })
* const url = URL.createObjectURL(blob)
* ```
* @since 2.0.0
*/
async function readImage(): Promise<Image> {
return await invoke<number>("plugin:clipboard-manager|read_image").then(
(rid) => new Image(rid),
);
}
/**
* Writes image buffer to the clipboard.
* @example
* ```typescript
* import { writeImage } from '@tauri-apps/plugin-clipboard-manager';
* const buffer = [
* // A red pixel
* 255, 0, 0, 255,
*
* // A green pixel
* 0, 255, 0, 255,
* ];
* await writeImage(buffer);
*
* @returns A promise indicating the success or failure of the operation.
*
* @since 2.0.0
*/
async function writeImage(
image: string | Image | Uint8Array | ArrayBuffer | number[],
): Promise<void> {
return invoke("plugin:clipboard-manager|write_image", {
data: {
image: {
image: transformImage(image),
},
},
});
}
/**
* * Writes HTML or fallbacks to write provided plain text to the clipboard.
* @example * @example
* ```typescript * ```typescript
* import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager'; * import { writeHtml, readHtml } from '@tauri-apps/plugin-clipboard-manager';
@ -92,4 +141,4 @@ async function clear(): Promise<void> {
return; return;
} }
export { writeText, readText, writeHtml, clear }; export { writeText, readText, writeHtml, clear, readImage, writeImage };

@ -16,7 +16,7 @@ enum ReadClipData: Codable {
} }
class ClipboardPlugin: Plugin { class ClipboardPlugin: Plugin {
@objc public func write(_ invoke: Invoke) throws { @objc public func writeText(_ invoke: Invoke) throws {
let options = try invoke.parseArgs(WriteOptions.self) let options = try invoke.parseArgs(WriteOptions.self)
let clipboard = UIPasteboard.general let clipboard = UIPasteboard.general
switch options { switch options {
@ -30,7 +30,7 @@ class ClipboardPlugin: Plugin {
} }
@objc public func read(_ invoke: Invoke) throws { @objc public func readText(_ invoke: Invoke) throws {
let clipboard = UIPasteboard.general let clipboard = UIPasteboard.general
if let text = clipboard.string { if let text = clipboard.string {
invoke.resolve(ReadClipData.plainText(text: text)) invoke.resolve(ReadClipData.plainText(text: text))

@ -1,6 +1,6 @@
{ {
"name": "@tauri-apps/plugin-clipboard-manager", "name": "@tauri-apps/plugin-clipboard-manager",
"version": "2.0.0-beta.2", "version": "2.1.0-beta.0",
"license": "MIT or APACHE-2.0", "license": "MIT or APACHE-2.0",
"authors": [ "authors": [
"Tauri Programme within The Commons Conservancy" "Tauri Programme within The Commons Conservancy"
@ -23,6 +23,6 @@
"LICENSE" "LICENSE"
], ],
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4" "@tauri-apps/api": "2.0.0-beta.6"
} }
} }

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-clear"
description = "Enables the clear command without any pre-configured scope."
commands.allow = ["clear"]
[[permission]]
identifier = "deny-clear"
description = "Denies the clear command without any pre-configured scope."
commands.deny = ["clear"]

@ -1,13 +0,0 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-read"
description = "Enables the read command without any pre-configured scope."
commands.allow = ["read"]
[[permission]]
identifier = "deny-read"
description = "Denies the read command without any pre-configured scope."
commands.deny = ["read"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-read-image"
description = "Enables the read_image command without any pre-configured scope."
commands.allow = ["read_image"]
[[permission]]
identifier = "deny-read-image"
description = "Denies the read_image command without any pre-configured scope."
commands.deny = ["read_image"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-read-text"
description = "Enables the read_text command without any pre-configured scope."
commands.allow = ["read_text"]
[[permission]]
identifier = "deny-read-text"
description = "Denies the read_text command without any pre-configured scope."
commands.deny = ["read_text"]

@ -1,13 +0,0 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-write"
description = "Enables the write command without any pre-configured scope."
commands.allow = ["write"]
[[permission]]
identifier = "deny-write"
description = "Denies the write command without any pre-configured scope."
commands.deny = ["write"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-write-html"
description = "Enables the write_html command without any pre-configured scope."
commands.allow = ["write_html"]
[[permission]]
identifier = "deny-write-html"
description = "Denies the write_html command without any pre-configured scope."
commands.deny = ["write_html"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-write-image"
description = "Enables the write_image command without any pre-configured scope."
commands.allow = ["write_image"]
[[permission]]
identifier = "deny-write-image"
description = "Denies the write_image command without any pre-configured scope."
commands.deny = ["write_image"]

@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!
"$schema" = "../../schemas/schema.json"
[[permission]]
identifier = "allow-write-text"
description = "Enables the write_text command without any pre-configured scope."
commands.allow = ["write_text"]
[[permission]]
identifier = "deny-write-text"
description = "Denies the write_text command without any pre-configured scope."
commands.deny = ["write_text"]

@ -1,6 +1,14 @@
| Permission | Description | | Permission | Description |
|------|-----| |------|-----|
|`allow-read`|Enables the read command without any pre-configured scope.| |`allow-clear`|Enables the clear command without any pre-configured scope.|
|`deny-read`|Denies the read command without any pre-configured scope.| |`deny-clear`|Denies the clear command without any pre-configured scope.|
|`allow-write`|Enables the write command without any pre-configured scope.| |`allow-read-image`|Enables the read_image command without any pre-configured scope.|
|`deny-write`|Denies the write command without any pre-configured scope.| |`deny-read-image`|Denies the read_image command without any pre-configured scope.|
|`allow-read-text`|Enables the read_text command without any pre-configured scope.|
|`deny-read-text`|Denies the read_text command without any pre-configured scope.|
|`allow-write-html`|Enables the write_html command without any pre-configured scope.|
|`deny-write-html`|Denies the write_html command without any pre-configured scope.|
|`allow-write-image`|Enables the write_image command without any pre-configured scope.|
|`deny-write-image`|Denies the write_image command without any pre-configured scope.|
|`allow-write-text`|Enables the write_text command without any pre-configured scope.|
|`deny-write-text`|Denies the write_text command without any pre-configured scope.|

@ -139,14 +139,10 @@
}, },
"platforms": { "platforms": {
"description": "Target platforms this permission applies. By default all platforms are affected by this permission.", "description": "Target platforms this permission applies. By default all platforms are affected by this permission.",
"default": [ "type": [
"linux", "array",
"macOS", "null"
"windows",
"android",
"iOS"
], ],
"type": "array",
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
@ -299,31 +295,87 @@
"type": "string", "type": "string",
"oneOf": [ "oneOf": [
{ {
"description": "allow-read -> Enables the read command without any pre-configured scope.", "description": "allow-clear -> Enables the clear command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-clear"
]
},
{
"description": "deny-clear -> Denies the clear command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-clear"
]
},
{
"description": "allow-read-image -> Enables the read_image command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-read-image"
]
},
{
"description": "deny-read-image -> Denies the read_image command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-read-image"
]
},
{
"description": "allow-read-text -> Enables the read_text command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-read-text"
]
},
{
"description": "deny-read-text -> Denies the read_text command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-read-text"
]
},
{
"description": "allow-write-html -> Enables the write_html command without any pre-configured scope.",
"type": "string",
"enum": [
"allow-write-html"
]
},
{
"description": "deny-write-html -> Denies the write_html command without any pre-configured scope.",
"type": "string",
"enum": [
"deny-write-html"
]
},
{
"description": "allow-write-image -> Enables the write_image command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"allow-read" "allow-write-image"
] ]
}, },
{ {
"description": "deny-read -> Denies the read command without any pre-configured scope.", "description": "deny-write-image -> Denies the write_image command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"deny-read" "deny-write-image"
] ]
}, },
{ {
"description": "allow-write -> Enables the write command without any pre-configured scope.", "description": "allow-write-text -> Enables the write_text command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"allow-write" "allow-write-text"
] ]
}, },
{ {
"description": "deny-write -> Denies the write command without any pre-configured scope.", "description": "deny-write-text -> Denies the write_text command without any pre-configured scope.",
"type": "string", "type": "string",
"enum": [ "enum": [
"deny-write" "deny-write-text"
] ]
} }
] ]

@ -1 +0,0 @@
if("__TAURI__"in window){var __TAURI_PLUGIN_CLIPBOARDMANAGER__=function(n){"use strict";async function r(n,r={},a){return window.__TAURI_INTERNALS__.invoke(n,r,a)}return"function"==typeof SuppressedError&&SuppressedError,n.clear=async function(){await r("plugin:clipboard-manager|clear")},n.readText=async function(){return(await r("plugin:clipboard-manager|read")).plainText.text},n.writeHtml=async function(n,a){return r("plugin:clipboard-manager|write_html",{data:{html:{html:n,altHtml:a}}})},n.writeText=async function(n,a){return r("plugin:clipboard-manager|write",{data:{plainText:{label:a?.label,text:n}}})},n}({});Object.defineProperty(window.__TAURI__,"clipboardManager",{value:__TAURI_PLUGIN_CLIPBOARDMANAGER__})}

@ -2,25 +2,45 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use tauri::{command, AppHandle, Runtime, State}; use tauri::{command, AppHandle, Manager, ResourceId, Runtime, State};
use crate::{ClipKind, Clipboard, ClipboardContents, Result}; use crate::{ClipKind, Clipboard, ClipboardContents, Result};
#[command] #[command]
pub(crate) async fn write<R: Runtime>( pub(crate) async fn write_text<R: Runtime>(
_app: AppHandle<R>, _app: AppHandle<R>,
clipboard: State<'_, Clipboard<R>>, clipboard: State<'_, Clipboard<R>>,
data: ClipKind, data: ClipKind,
) -> Result<()> { ) -> Result<()> {
clipboard.write(data) clipboard.write_text(data)
} }
#[command] #[command]
pub(crate) async fn read<R: Runtime>( pub(crate) async fn write_image<R: Runtime>(
_app: AppHandle<R>,
clipboard: State<'_, Clipboard<R>>,
data: ClipKind,
) -> Result<()> {
clipboard.write_image(data)
}
#[command]
pub(crate) async fn read_text<R: Runtime>(
_app: AppHandle<R>, _app: AppHandle<R>,
clipboard: State<'_, Clipboard<R>>, clipboard: State<'_, Clipboard<R>>,
) -> Result<ClipboardContents> { ) -> Result<ClipboardContents> {
clipboard.read() clipboard.read_text()
}
#[command]
pub(crate) async fn read_image<R: Runtime>(
app: AppHandle<R>,
clipboard: State<'_, Clipboard<R>>,
) -> Result<ResourceId> {
let image = clipboard.read_image()?.to_owned();
let mut resources_table = app.resources_table();
let rid = resources_table.add(image);
Ok(rid)
} }
#[command] #[command]

@ -2,12 +2,14 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
use arboard::ImageData;
use image::ImageEncoder;
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use tauri::{plugin::PluginApi, AppHandle, Runtime}; use tauri::{image::Image, plugin::PluginApi, AppHandle, Runtime};
use crate::models::*; use crate::models::*;
use std::sync::Mutex; use std::{borrow::Cow, sync::Mutex};
pub fn init<R: Runtime, C: DeserializeOwned>( pub fn init<R: Runtime, C: DeserializeOwned>(
app: &AppHandle<R>, app: &AppHandle<R>,
@ -27,17 +29,38 @@ pub struct Clipboard<R: Runtime> {
} }
impl<R: Runtime> Clipboard<R> { impl<R: Runtime> Clipboard<R> {
pub fn write(&self, kind: ClipKind) -> crate::Result<()> { pub fn write_text(&self, kind: ClipKind) -> crate::Result<()> {
match kind { match kind {
ClipKind::PlainText { text, .. } => match &self.clipboard { ClipKind::PlainText { text, .. } => match &self.clipboard {
Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into), Ok(clipboard) => clipboard.lock().unwrap().set_text(text).map_err(Into::into),
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
}, },
_ => Err(crate::Error::Clipboard("Invalid clip kind!".to_string())), _ => Err(crate::Error::Clipboard("Invalid clip kind".to_string())),
}
}
pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
match kind {
ClipKind::Image { image, .. } => match &self.clipboard {
Ok(clipboard) => {
let image = image.into_img(&self.app)?;
clipboard
.lock()
.unwrap()
.set_image(ImageData {
bytes: Cow::Borrowed(image.rgba()),
width: image.width() as usize,
height: image.height() as usize,
})
.map_err(Into::into)
}
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
},
_ => Err(crate::Error::Clipboard("Invalid clip kind".to_string())),
} }
} }
pub fn read(&self) -> crate::Result<ClipboardContents> { pub fn read_text(&self) -> crate::Result<ClipboardContents> {
match &self.clipboard { match &self.clipboard {
Ok(clipboard) => { Ok(clipboard) => {
let text = clipboard.lock().unwrap().get_text()?; let text = clipboard.lock().unwrap().get_text()?;
@ -67,4 +90,24 @@ impl<R: Runtime> Clipboard<R> {
Err(e) => Err(crate::Error::Clipboard(e.to_string())), Err(e) => Err(crate::Error::Clipboard(e.to_string())),
} }
} }
pub fn read_image(&self) -> crate::Result<Image<'_>> {
match &self.clipboard {
Ok(clipboard) => {
let image = clipboard.lock().unwrap().get_image()?;
let mut buffer: Vec<u8> = Vec::new();
image::codecs::png::PngEncoder::new(&mut buffer).write_image(
&image.bytes,
image.width as u32,
image.height as u32,
image::ColorType::Rgba8,
)?;
let image = Image::new_owned(buffer, image.width as u32, image.height as u32);
Ok(image)
}
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
}
}
} }

@ -13,6 +13,12 @@ pub enum Error {
PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError), PluginInvoke(#[from] tauri::plugin::mobile::PluginInvokeError),
#[error("{0}")] #[error("{0}")]
Clipboard(String), Clipboard(String),
#[cfg(desktop)]
#[error(transparent)]
Tauri(#[from] tauri::Error),
#[cfg(desktop)]
#[error("invalid image: {0}")]
Image(#[from] image::ImageError),
} }
impl Serialize for Error { impl Serialize for Error {

@ -48,13 +48,12 @@ impl<R: Runtime, T: Manager<R>> crate::ClipboardExt<R> for T {
/// Initializes the plugin. /// Initializes the plugin.
pub fn init<R: Runtime>() -> TauriPlugin<R> { pub fn init<R: Runtime>() -> TauriPlugin<R> {
Builder::new("clipboard-manager") Builder::new("clipboard-manager")
.js_init_script(include_str!("api-iife.js").to_string())
.invoke_handler(tauri::generate_handler![ .invoke_handler(tauri::generate_handler![
commands::write, commands::write_text,
commands::read, commands::read_text,
#[cfg(desktop)] commands::read_image,
commands::write_image,
commands::write_html, commands::write_html,
#[cfg(desktop)]
commands::clear commands::clear
]) ])
.setup(|app, api| { .setup(|app, api| {

@ -4,6 +4,7 @@
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use tauri::{ use tauri::{
image::Image,
plugin::{PluginApi, PluginHandle}, plugin::{PluginApi, PluginHandle},
AppHandle, Runtime, AppHandle, Runtime,
}; };
@ -32,14 +33,26 @@ pub fn init<R: Runtime, C: DeserializeOwned>(
pub struct Clipboard<R: Runtime>(PluginHandle<R>); pub struct Clipboard<R: Runtime>(PluginHandle<R>);
impl<R: Runtime> Clipboard<R> { impl<R: Runtime> Clipboard<R> {
pub fn write(&self, kind: ClipKind) -> crate::Result<()> { pub fn write_text(&self, kind: ClipKind) -> crate::Result<()> {
self.0.run_mobile_plugin("write", kind).map_err(Into::into) self.0.run_mobile_plugin("write", kind).map_err(Into::into)
} }
pub fn read(&self) -> crate::Result<ClipboardContents> { pub fn write_image(&self, kind: ClipKind) -> crate::Result<()> {
Err(crate::Error::Clipboard(
"Unsupported on this platform".to_string(),
))
}
pub fn read_text(&self) -> crate::Result<ClipboardContents> {
self.0.run_mobile_plugin("read", ()).map_err(Into::into) self.0.run_mobile_plugin("read", ()).map_err(Into::into)
} }
pub fn read_image(&self) -> crate::Result<Image<'_>> {
Err(crate::Error::Clipboard(
"Unsupported on this platform".to_string(),
))
}
// Treat HTML as unsupported on mobile until tested // Treat HTML as unsupported on mobile until tested
pub fn write_html(&self, _kind: ClipKind) -> crate::Result<()> { pub fn write_html(&self, _kind: ClipKind) -> crate::Result<()> {
Err(crate::Error::Clipboard( Err(crate::Error::Clipboard(

@ -4,13 +4,18 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)] #[derive(Deserialize)]
#[cfg_attr(mobile, derive(Serialize))]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum ClipKind { pub enum ClipKind {
PlainText { PlainText {
label: Option<String>, label: Option<String>,
text: String, text: String,
}, },
#[cfg(desktop)]
Image {
image: tauri::image::JsImage,
},
Html { Html {
html: String, html: String,
alt_html: Option<String>, alt_html: Option<String>,
@ -20,5 +25,12 @@ pub enum ClipKind {
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub enum ClipboardContents { pub enum ClipboardContents {
PlainText { text: String }, PlainText {
text: String,
},
Image {
bytes: Vec<u8>,
width: usize,
height: usize,
},
} }

@ -1,5 +1,9 @@
# Changelog # Changelog
## \[2.0.0-beta.3]
- [`a04ea2f`](https://github.com/tauri-apps/plugins-workspace/commit/a04ea2f38294d5a3987578283badc8eec87a7752)([#1071](https://github.com/tauri-apps/plugins-workspace/pull/1071)) The global API script is now only added to the binary when the `withGlobalTauri` config is true.
## \[2.0.0-beta.2] ## \[2.0.0-beta.2]
- [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8. - [`99bea25`](https://github.com/tauri-apps/plugins-workspace/commit/99bea2559c2c0648c2519c50a18cd124dacef57b)([#1005](https://github.com/tauri-apps/plugins-workspace/pull/1005)) Update to tauri beta.8.

@ -1,6 +1,6 @@
[package] [package]
name = "tauri-plugin-deep-link" name = "tauri-plugin-deep-link"
version = "2.0.0-beta.2" version = "2.0.0-beta.3"
description = "Set your Tauri application as the default handler for an URL" description = "Set your Tauri application as the default handler for an URL"
authors = { workspace = true } authors = { workspace = true }
license = { workspace = true } license = { workspace = true }

@ -33,6 +33,7 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
fn main() { fn main() {
if let Err(error) = tauri_plugin::Builder::new(COMMANDS) if let Err(error) = tauri_plugin::Builder::new(COMMANDS)
.global_api_script_path("./api-iife.js")
.android_path("android") .android_path("android")
.try_build() .try_build()
{ {

@ -10,11 +10,11 @@
"tauri": "tauri" "tauri": "tauri"
}, },
"dependencies": { "dependencies": {
"@tauri-apps/api": "2.0.0-beta.4", "@tauri-apps/api": "2.0.0-beta.6",
"@tauri-apps/plugin-deep-link": "2.0.0-beta.2" "@tauri-apps/plugin-deep-link": "2.0.0-beta.2"
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "2.0.0-beta.7", "@tauri-apps/cli": "2.0.0-beta.9",
"internal-ip": "^8.0.0", "internal-ip": "^8.0.0",
"typescript": "^5.2.2", "typescript": "^5.2.2",
"vite": "^5.0.12" "vite": "^5.0.12"

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

Loading…
Cancel
Save